mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-02 05:06:35 -05:00
use a no-change token when loading map scripts
this doesn't need to go in undo/redo. It's more in the 'deferred loading' category.
This commit is contained in:
@@ -158,13 +158,16 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map {
|
||||
});
|
||||
}
|
||||
|
||||
// create one-use NoDataChangeDeltaModel tokens rather than using tokens from CurrentChange
|
||||
// we don't really care for these to be part of undo/redo
|
||||
private void Load() {
|
||||
var model = viewPort.Model;
|
||||
SubScripts.Clear();
|
||||
var token = new NoDataChangeDeltaModel();
|
||||
if (scriptType != 2 && scriptType != 4) {
|
||||
// we're pointing at an XSERun
|
||||
if (model.GetNextRun(address).Start >= address) {
|
||||
model.ObserveRunWritten(viewPort.ChangeHistory.CurrentChange, new XSERun(address));
|
||||
model.ObserveRunWritten(token, new XSERun(address));
|
||||
}
|
||||
} else {
|
||||
var destination = address;
|
||||
@@ -177,8 +180,8 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map {
|
||||
destination += 8;
|
||||
}
|
||||
if (!ArrayRun.TryParse(model, "[variable:|h value: pointer<`xse`>]!0000", address, SortedSpan.One(start + 1), out var run).HasError) {
|
||||
model.ClearFormat(viewPort.ChangeHistory.CurrentChange, run.Start, run.Length);
|
||||
model.ObserveRunWritten(viewPort.ChangeHistory.CurrentChange, run);
|
||||
model.ClearFormat(token, run.Start, run.Length);
|
||||
model.ObserveRunWritten(token, run);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user