mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-02 05:06:35 -05:00
signpost -> goto script should set NoInfoRuns to XSERuns
This commit is contained in:
@@ -1132,7 +1132,8 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map {
|
||||
if (!ShowPointer) return;
|
||||
var destinationRun = new XSERun(Pointer, SortedSpan<int>.None);
|
||||
var existingRun = element.Model.GetNextRun(destinationRun.Start);
|
||||
if (existingRun.Start <= destinationRun.Start) return; // don't erase existing runs for this
|
||||
if (existingRun.Start < destinationRun.Start) return; // don't erase existing runs for this
|
||||
if (existingRun.Start == destinationRun.Start && existingRun is not NoInfoRun) return;
|
||||
element.Model.ObserveRunWritten(new ModelDelta(), destinationRun); // don't track this change
|
||||
}
|
||||
|
||||
@@ -1210,7 +1211,10 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map {
|
||||
}
|
||||
|
||||
public bool CanGotoScript => 0 <= Pointer && Pointer < element.Model.Count;
|
||||
public void GotoScript() => gotoAddress(Pointer);
|
||||
public void GotoScript() {
|
||||
SetDestinationFormat();
|
||||
gotoAddress(Pointer);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using HavenSoft.HexManiac.Core;
|
||||
using HavenSoft.HexManiac.Core.Models.Runs;
|
||||
using HavenSoft.HexManiac.Core.ViewModels.Map;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Xunit;
|
||||
|
||||
@@ -67,5 +68,19 @@ namespace HavenSoft.HexManiac.Integration {
|
||||
var editor = firered.MapEditor;
|
||||
Assert.Contains(editor.PrimaryMap, editor.VisibleMaps);
|
||||
}
|
||||
|
||||
[SkippableFact]
|
||||
public void OakLabSignpost_RepointScript_UpdateSignpostScriptField() {
|
||||
var firered = LoadFireRed();
|
||||
var address1 = firered.Maps[3][0].Events.Signposts[0].Arg;
|
||||
|
||||
firered.Goto.Execute(StartTown);
|
||||
firered.MapEditor.PrimaryMap.EventGroup.Signposts[0].GotoScript();
|
||||
var script = firered.Tools.CodeTool.Contents[0];
|
||||
script.Content = "nop" + Environment.NewLine + script.Content; // causes repoint
|
||||
|
||||
var address2 = firered.Maps[3][0].Events.Signposts[0].Arg;
|
||||
Assert.NotEqual(address1, address2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user