From 0612d8508d2562c547f71fa6721d3787d0523eff Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 16 Sep 2024 13:52:11 -0500 Subject: [PATCH] preserve gridsnap state between runs --- .../game/tools/worldEditor/scripts/EditorGui.ed.tscript | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript index 0c20f21fe9..f30b64f128 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript @@ -2488,7 +2488,8 @@ function EWorldEditor::syncGui( %this ) ESnapOptions-->SnapSize.setText( EWorldEditor.getSoftSnapSize() ); ESnapOptions-->GridSize.setText( EWorldEditor.getGridSize() ); - ESnapOptions-->GridSnapButton.setStateOn( %this.getGridSnap() ); + %this.UseGridSnap = EditorSettings.value("WorldEditor/Tools/UseGridSnap"); + ESnapOptions-->GridSnapButton.setStateOn( %this.UseGridSnap ); %this.UseGroupCenter = EditorSettings.value("WorldEditor/Tools/UseGroupCenter"); @@ -2762,7 +2763,9 @@ function toggleSnappingOptions( %var ) } else if( %var $= "grid" ) { - EWorldEditor.setGridSnap( !EWorldEditor.getGridSnap() ); + EWorldEditor.UseGridSnap = !EWorldEditor.UseGridSnap; + EditorSettings.setValue("WorldEditor/Tools/UseGridSnap", EWorldEditor.UseGridSnap ); + EWorldEditor.setGridSnap( EWorldEditor.UseGridSnap ); } else if( %var $= "byGroup" ) {