Skip to content

Commit d29cb4a

Browse files
committed
Add checkbox for smart script action cloning to settings panel and enable smart script action cloning by default
1 parent 17caa75 commit d29cb4a

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/TSMapEditor/Settings/UserSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public async Task SaveSettingsAsync()
8888

8989
public StringSetting Theme = new StringSetting(General, "Theme", "Default");
9090
public BoolSetting UseBoldFont = new BoolSetting(General, "UseBoldFont", false);
91-
public BoolSetting SmartScriptActionCloning = new BoolSetting(General, "SmartScriptActionCloning", false);
91+
public BoolSetting SmartScriptActionCloning = new BoolSetting(General, "SmartScriptActionCloning", true);
9292
public IntSetting AutoSaveInterval = new IntSetting(General, "AutoSaveInterval", 300);
9393
public IntSetting SidebarWidth = new IntSetting(General, "SidebarWidth", 250);
9494

src/TSMapEditor/UI/SettingsPanel.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public SettingsPanel(WindowManager windowManager) : base(windowManager)
8080
private XNADropDown ddScrollRate;
8181
private XNACheckBox chkUseBoldFont;
8282
private XNACheckBox chkGraphicsLevel;
83+
private XNACheckBox chkSmartScriptActionCloning;
8384
private EditorTextBox tbTextEditorPath;
8485

8586
public override void Kill()
@@ -185,11 +186,18 @@ public override void Initialize()
185186
chkGraphicsLevel.Text = "Enhanced Graphical Quality";
186187
AddChild(chkGraphicsLevel);
187188

189+
chkSmartScriptActionCloning = new XNACheckBox(WindowManager);
190+
chkSmartScriptActionCloning.Name = nameof(chkSmartScriptActionCloning);
191+
chkSmartScriptActionCloning.X = Constants.UIEmptySideSpace;
192+
chkSmartScriptActionCloning.Y = chkGraphicsLevel.Bottom + Constants.UIVerticalSpacing;
193+
chkSmartScriptActionCloning.Text = "Smart Script Action Cloning";
194+
AddChild(chkSmartScriptActionCloning);
195+
188196
var lblTextEditorPath = new XNALabel(WindowManager);
189197
lblTextEditorPath.Name = nameof(lblTextEditorPath);
190198
lblTextEditorPath.Text = "Text Editor Path:";
191199
lblTextEditorPath.X = Constants.UIEmptySideSpace;
192-
lblTextEditorPath.Y = chkGraphicsLevel.Bottom + Constants.UIVerticalSpacing * 2;
200+
lblTextEditorPath.Y = chkSmartScriptActionCloning.Bottom + Constants.UIVerticalSpacing * 2;
193201
AddChild(lblTextEditorPath);
194202

195203
tbTextEditorPath = new EditorTextBox(WindowManager);
@@ -220,6 +228,7 @@ private void LoadSettings()
220228
chkBorderless.Checked = userSettings.Borderless;
221229
chkUseBoldFont.Checked = userSettings.UseBoldFont;
222230
chkGraphicsLevel.Checked = userSettings.GraphicsLevel > 0;
231+
chkSmartScriptActionCloning.Checked = userSettings.SmartScriptActionCloning;
223232

224233
tbTextEditorPath.Text = userSettings.TextEditorPath;
225234
}
@@ -230,6 +239,7 @@ public void ApplySettings()
230239

231240
userSettings.UseBoldFont.UserDefinedValue = chkUseBoldFont.Checked;
232241
userSettings.GraphicsLevel.UserDefinedValue = chkGraphicsLevel.Checked ? 1 : 0;
242+
userSettings.SmartScriptActionCloning.UserDefinedValue = chkSmartScriptActionCloning.Checked;
233243

234244
userSettings.Theme.UserDefinedValue = ddTheme.SelectedItem.Text;
235245
if (ddScrollRate.SelectedItem != null)

0 commit comments

Comments
 (0)