Skip to content

Commit 7734fc6

Browse files
committed
Make it possible to set default parameter of "Do This" script action based on script name
1 parent 9a0d510 commit 7734fc6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/TSMapEditor/UI/Windows/ScriptsWindow.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,11 @@ private ScriptActionEntry CreateNewScriptActionEntry(int actionId)
554554
if (wp != null)
555555
entry.Argument = wp.Identifier;
556556
break;
557+
default:
558+
ScriptActionPresetOption preset = scriptActionType.PresetOptions.Find(p => editedScript.Name.Contains(p.Text, StringComparison.OrdinalIgnoreCase));
559+
if (preset != null)
560+
entry.Argument = preset.Value;
561+
break;
557562
}
558563
}
559564

0 commit comments

Comments
 (0)