diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs index 332f4266c..6a7c2e642 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs @@ -419,9 +419,15 @@ function ImportOptionsConfigList::changeEditorSetting(%this, %varName, %value) %configGroup = AssetImportConfigName.getText(); + %oldValue = AssetImportSettings.value(%configGroup @ "/" @ %varName, %value); + AssetImportSettings.setValue(%configGroup @ "/" @ %varName, %value); - //%success = AssetImportSettings.write(); + if(%oldValue !$= %value) + { + %id = %this.getSelectedRow(); + %this.setSelectedRow(%id); + } } function ImportOptionsConfigList::ToggleImportMesh(%this, %fieldName, %newValue, %ownerObject) diff --git a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs index 94ca1b065..7a673d64d 100644 --- a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs +++ b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs @@ -118,6 +118,18 @@ function ESettingsWindow::addGameSettingsPage(%this, %settingsPageName, %setting GameSettingsPageList.add(%settingsPageName, %settingsPageText); } +function ESettingsWindow::refresh(%this) +{ + if(ESettingsWindow.selectedPageId !$= "") + { + ESettingsWindowList.setSelectedById( ESettingsWindow.selectedPageId ); + } + else + { + ESettingsWindowList.setSelectedById( 1 ); + } +} + //----------------------------------------------------------------------------- function ESettingsWindowList::onSelect( %this, %id, %text ) @@ -130,6 +142,9 @@ function ESettingsWindowList::onSelect( %this, %id, %text ) %pageName = GameSettingsPageList.getKey(GameSettingsPageList.getIndexFromValue(%text)); eval("ESettingsWindow.get" @ %pageName @ "Settings();"); + + ESettingsWindow.selectedPageId = %id; + ESettingsWindow.selectedPageText = %text; } //Read/write field functions @@ -147,25 +162,30 @@ function SettingsInspector::changeEditorSetting(%this, %varName, %value) { %varName = strreplace(%varName, "-", "/"); - if(isFile(%value) || IsDirectory(%value)) + if(%value !$= "" && (fileExt(%value) !$= "" || IsDirectory(%value))) { %value = makeFullPath(%value); } - echo("Set " @ %varName @ " to be " @ %value); + //echo("Set " @ %varName @ " to be " @ %value); + + if(ESettingsWindow.mode $= "Editor") + %oldValue = EditorSettings.value(%varName); + else + %oldValue = ProjectSettings.value(%varName); if(ESettingsWindow.mode $= "Editor") EditorSettings.setValue(%varName, %value); else ProjectSettings.setValue(%varName, %value); - //%id = ESettingsWindowList.getSelectedRow(); - //ESettingsWindowList.setSelectedRow(%id); - if(ESettingsWindow.mode $= "Editor") %success = EditorSettings.write(); else %success = ProjectSettings.write(); + + if(%oldValue !$= %value) + ESettingsWindow.refresh(); } function GuiInspectorVariableGroup::buildOptionsSettingField(%this, %fieldName, %fieldLabel, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %ownerObj) diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs index e841830e7..384517223 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs @@ -131,7 +131,7 @@ function EditorOpenTorsionProject( %projectFile ) { MessageBoxOK( "Torsion Not Found", - "Torsion not found at '" @ %torsionPath @ "'. Please set the correct path in the preferences." + "Torsion not found at '" @ %torsionPath @ "'. Please set the correct path in the Editor Settings." ); return; } @@ -170,7 +170,7 @@ function EditorOpenFileInTorsion( %file, %line ) { MessageBoxOK( "Torsion Not Found", - "Torsion not found at '" @ %torsionPath @ "'. Please set the correct path in the preferences." + "Torsion not found at '" @ %torsionPath @ "'. Please set the correct path in the Editor Settings." ); return; }