Jelajahi Sumber

Merge pull request #752 from Areloch/MiscFixes20220326

Misc Bugfixes for 2022/03/26
Brian Roberts 3 tahun lalu
induk
melakukan
df56946a6b
54 mengubah file dengan 369 tambahan dan 524 penghapusan
  1. 6 1
      Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp
  2. 8 0
      Engine/source/gui/buttons/guiBitmapButtonCtrl.h
  3. 5 0
      Engine/source/gui/containers/guiWindowCtrl.cpp
  4. 1 0
      Engine/source/gui/containers/guiWindowCtrl.h
  5. 27 8
      Engine/source/gui/controls/guiGameSettingsCtrl.cpp
  6. 10 0
      Engine/source/gui/controls/guiGameSettingsCtrl.h
  7. 0 1
      Templates/BaseGame/game/core/gameObjects/shapes/Camera.asset.taml
  8. 1 1
      Templates/BaseGame/game/core/gui/scripts/canvas.tscript
  9. 2 2
      Templates/BaseGame/game/core/postFX/scripts/DepthOfField/DepthOfFieldPostFX.tscript
  10. 2 2
      Templates/BaseGame/game/core/postFX/scripts/LightRays/lightRays.tscript
  11. 2 2
      Templates/BaseGame/game/core/postFX/scripts/SSAO/SSAOPostFx.tscript
  12. 2 2
      Templates/BaseGame/game/core/postFX/scripts/Vignette/VignettePostFX.tscript
  13. 2 2
      Templates/BaseGame/game/core/rendering/Core_Rendering.tscript
  14. 1 1
      Templates/BaseGame/game/core/rendering/materials/moon_noglow.asset.taml
  15. 0 9
      Templates/BaseGame/game/core/rendering/materials/moon_noglow.tscript
  16. 0 14
      Templates/BaseGame/game/core/rendering/materials/moon_noglowMat.asset.taml
  17. 1 1
      Templates/BaseGame/game/core/rendering/materials/moon_wcorona.asset.taml
  18. 1 1
      Templates/BaseGame/game/core/rendering/materials/moon_wcoronaMat.asset.taml
  19. 0 9
      Templates/BaseGame/game/core/rendering/materials/moon_wglow.tscript
  20. 0 14
      Templates/BaseGame/game/core/rendering/materials/moon_wglowMat.asset.taml
  21. 1 1
      Templates/BaseGame/game/core/rendering/shapes/noShapeMat.asset.taml
  22. 59 258
      Templates/BaseGame/game/data/UI/guis/optionsMenu.gui
  23. 114 116
      Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript
  24. 0 0
      Templates/BaseGame/game/data/UI/images/group_border.png
  25. 1 1
      Templates/BaseGame/game/data/UI/images/group_border_image.asset.taml
  26. 0 0
      Templates/BaseGame/game/data/UI/images/no_preview.png
  27. 1 1
      Templates/BaseGame/game/data/UI/images/no_preview_image.asset.taml
  28. 0 3
      Templates/BaseGame/game/data/UI/images/nopreview_image.asset.taml
  29. 0 0
      Templates/BaseGame/game/data/UI/images/selector_button.png
  30. 0 0
      Templates/BaseGame/game/data/UI/images/selector_button_blank.png
  31. 1 1
      Templates/BaseGame/game/data/UI/images/selector_button_blank_image.asset.taml
  32. 0 0
      Templates/BaseGame/game/data/UI/images/selector_button_dark.png
  33. 1 1
      Templates/BaseGame/game/data/UI/images/selector_button_dark_image.asset.taml
  34. 0 0
      Templates/BaseGame/game/data/UI/images/selector_button_highlight_only.png
  35. 1 1
      Templates/BaseGame/game/data/UI/images/selector_button_highlight_only_image.asset.taml
  36. 1 1
      Templates/BaseGame/game/data/UI/images/selector_button_image.asset.taml
  37. 0 3
      Templates/BaseGame/game/data/UI/images/selectorbutton_image.asset.taml
  38. 0 3
      Templates/BaseGame/game/data/UI/images/selectorbuttonblank_image.asset.taml
  39. 0 3
      Templates/BaseGame/game/data/UI/images/selectorbuttondark_image.asset.taml
  40. 0 3
      Templates/BaseGame/game/data/UI/images/selectorbuttonhighlightonly_image.asset.taml
  41. 0 0
      Templates/BaseGame/game/data/UI/images/tab_border.png
  42. 1 1
      Templates/BaseGame/game/data/UI/images/tab_border_image.asset.taml
  43. 0 3
      Templates/BaseGame/game/data/UI/images/tabborder_image.asset.taml
  44. 48 6
      Templates/BaseGame/game/data/UI/scripts/menuInputHandling.tscript
  45. 13 3
      Templates/BaseGame/game/data/UI/scripts/messageBoxes.tscript
  46. 3 2
      Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui
  47. 2 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.tscript
  48. 19 3
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript
  49. 5 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript
  50. 0 17
      Templates/BaseGame/game/tools/convexEditor/convexEditor.tscript
  51. 19 2
      Templates/BaseGame/game/tools/gui/profiles.ed.tscript
  52. 0 17
      Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditor.tscript
  53. 2 4
      Templates/BaseGame/game/tools/settings.xml
  54. 6 0
      Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript

+ 6 - 1
Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp

@@ -138,10 +138,15 @@ void GuiBitmapButtonCtrl::initPersistFields()
 {
    addGroup( "Bitmap" );
 
-      INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiBitmapButtonCtrl, "Texture file to display on this button.\n"
+      addProtectedField("Bitmap", TypeImageFilename, Offset(mBitmapName, GuiBitmapButtonCtrl), _setBitmapFieldData, &defaultProtectedGetFn, "Texture file to display on this button.\n"
+         "If useStates is false, this will be the file that renders on the control.  Otherwise, this will "
+         "specify the default texture name to which the various state and modifier suffixes are appended "
+         "to find the per-state and per-modifier (if enabled) textures.", AbstractClassRep::FIELD_HideInInspectors); \
+      addProtectedField("BitmapAsset", TypeImageAssetId, Offset(mBitmapAssetId, GuiBitmapButtonCtrl), _setBitmapFieldData, &defaultProtectedGetFn, "Texture file to display on this button.\n"
          "If useStates is false, this will be the file that renders on the control.  Otherwise, this will "
          "specify the default texture name to which the various state and modifier suffixes are appended "
          "to find the per-state and per-modifier (if enabled) textures.");
+
       addField("color", TypeColorI, Offset(mColor, GuiBitmapButtonCtrl), "color mul");
 
       addField( "bitmapMode", TYPEID< BitmapMode >(), Offset( mBitmapMode, GuiBitmapButtonCtrl ),

+ 8 - 0
Engine/source/gui/buttons/guiBitmapButtonCtrl.h

@@ -185,6 +185,14 @@ class GuiBitmapButtonCtrl : public GuiButtonCtrl
       DECLARE_CONOBJECT(GuiBitmapButtonCtrl);
       DECLARE_DESCRIPTION( "A button control rendered entirely from bitmaps.\n"
                            "The individual button states are represented with separate bitmaps." );
+
+      //Basically a wrapper function to do our special state handling setup when the fields change
+      static bool _setBitmapFieldData(void* obj, const char* index, const char* data)
+      {
+         GuiBitmapButtonCtrl* object = static_cast<GuiBitmapButtonCtrl*>(obj); 
+         object->setBitmap(StringTable->insert(data)); 
+         return false; 
+      }
 };
 
 typedef GuiBitmapButtonCtrl::BitmapMode GuiBitmapMode;

+ 5 - 0
Engine/source/gui/containers/guiWindowCtrl.cpp

@@ -66,6 +66,9 @@ IMPLEMENT_CALLBACK( GuiWindowCtrl, onCollapse, void, (), (),
    "Called when the window is collapsed by clicking its title bar." );
 IMPLEMENT_CALLBACK( GuiWindowCtrl, onRestore, void, (), (),
    "Called when the window is restored from minimized, maximized, or collapsed state." );
+IMPLEMENT_CALLBACK(GuiWindowCtrl, onResize, void, (S32 posX, S32 posY, S32 width, S32 height), (0, 0, 0, 0),
+   "Called when the window is resized in a regular manner by mouse manipulation.");
+
 
 //-----------------------------------------------------------------------------
 
@@ -1557,6 +1560,8 @@ bool GuiWindowCtrl::resize(const Point2I &newPosition, const Point2I &newExtent)
    // Set the button coords
    positionButtons();
 
+   onResize_callback(newPosition.x, newPosition.y, newExtent.x, newExtent.y);
+
    return true;
 }
 

+ 1 - 0
Engine/source/gui/containers/guiWindowCtrl.h

@@ -201,6 +201,7 @@ class GuiWindowCtrl : public GuiContainer
       DECLARE_CALLBACK( void, onMaximize, () );
       DECLARE_CALLBACK( void, onCollapse, () );
       DECLARE_CALLBACK( void, onRestore, () );
+      DECLARE_CALLBACK(void, onResize, (S32 posX, S32 posY, S32 width, S32 height));
       
       /// @}
 

+ 27 - 8
Engine/source/gui/controls/guiGameSettingsCtrl.cpp

@@ -740,7 +740,7 @@ void GuiGameSettingsCtrl::changeOption(S32 delta)
    if (mScriptCallback != NULL && (mSelectedOption != NO_OPTION && mMode != GuiGameSettingsCtrl::Slider))
    {
       setThisControl();
-      StringTableEntry direction = NULL;
+      StringTableEntry direction = StringTable->EmptyString();
       if (delta < 0)
       {
          direction = LEFT;
@@ -749,7 +749,7 @@ void GuiGameSettingsCtrl::changeOption(S32 delta)
       {
          direction = RIGHT;
       }
-      if ((direction != NULL) && (Con::isFunction(mScriptCallback)))
+      if ((direction != StringTable->EmptyString()) && (Con::isFunction(mScriptCallback)))
       {
          Con::executef(mScriptCallback, direction);
       }
@@ -849,6 +849,16 @@ void GuiGameSettingsCtrl::setValue(F32 value)
    mValue = value;
 }
 
+F32 GuiGameSettingsCtrl::getIncrement()
+{
+   return mStepSize;
+}
+
+Point2F GuiGameSettingsCtrl::getRange()
+{
+   return mRange;
+}
+
 const char* GuiGameSettingsCtrl::getTooltip()
 {
    return mTooltip;
@@ -1100,22 +1110,31 @@ DefineEngineMethod(GuiGameSettingsCtrl, addOption, void, (const char* displayTex
 }
 
 DefineEngineMethod(GuiGameSettingsCtrl, getValue, F32, (), ,
-   "Sets the list of options on the given control.\n\n"
-   "@param optionsList A tab separated list of options for the control.")
+   "Gets the value of the slider on the given control.")
 {
    return object->getValue();
 }
 
 DefineEngineMethod(GuiGameSettingsCtrl, setValue, void, (F32 value), ,
-   "Sets the list of options on the given control.\n\n"
-   "@param optionsList A tab separated list of options for the control.")
+   "Sets the value of the slider on the given control.")
 {
    object->setValue(value);
 }
 
+DefineEngineMethod(GuiGameSettingsCtrl, getIncrement, F32, (), ,
+   "Gets the increment amount of the slider on a given control.")
+{
+   return object->getIncrement();
+}
+
+DefineEngineMethod(GuiGameSettingsCtrl, getRange, Point2F, (), ,
+   "Gets the min and max values for the range of the slider on a given control.")
+{
+   return object->getRange();
+}
+
 DefineEngineMethod(GuiGameSettingsCtrl, getTooltip, const char*, (), ,
-   "Sets the list of options on the given control.\n\n"
-   "@param optionsList A tab separated list of options for the control.")
+   "Gets the tooltip on the given control.")
 {
    return object->getTooltip();
 }

+ 10 - 0
Engine/source/gui/controls/guiGameSettingsCtrl.h

@@ -214,6 +214,16 @@ public:
 
    Mode getMode() { return mMode; }
 
+   /// <summary>
+   /// Gets the incremenet amount
+   /// </summary>
+   F32 getIncrement();
+
+   /// <summary>
+   /// Gets range of values allowed
+   /// </summary>
+   Point2F getRange();
+
    /// Gets the tooltip
    const char* getTooltip();
 

+ 0 - 1
Templates/BaseGame/game/core/gameObjects/shapes/Camera.asset.taml

@@ -1 +0,0 @@
-    constuctorFileName="@assetFile=camera.tscript" />

+ 1 - 1
Templates/BaseGame/game/core/gui/scripts/canvas.tscript

@@ -115,7 +115,7 @@ function configureCanvas()
       "--Screen Mode    : " @ %fsLabel NL
       "--Bits Per Pixel : " @ %bpp NL
       "--Refresh Rate   : " @ %rate NL
-      "--FSAA Level     : " @ %aa NL
+      "--FXAA Level     : " @ %aa NL
       "--------------");
 
    // Actually set the new video mode

+ 2 - 2
Templates/BaseGame/game/core/postFX/scripts/DepthOfField/DepthOfFieldPostFX.tscript

@@ -474,7 +474,7 @@ function DepthOfFieldPostFX::populatePostFXSettings(%this)
 
 function PostEffectEditorInspector::toggleDepthOfFieldPostFX(%this)
 {
-   if($PostFX::DepthOfFieldPostFX::Enabled)
+   if($PostFX::DepthOfFieldPostFX::Enabled && $pref::PostFX::EnableDOF)
       DepthOfFieldPostFX.enable();
    else
       DepthOfFieldPostFX.disable();
@@ -482,7 +482,7 @@ function PostEffectEditorInspector::toggleDepthOfFieldPostFX(%this)
 
 function DepthOfFieldPostFX::applyFromPreset(%this)
 {
-   if($PostFX::DepthOfFieldPostFX::Enabled)
+   if($PostFX::DepthOfFieldPostFX::Enabled && $pref::PostFX::EnableDOF)
       DepthOfFieldPostFX.enable();
    else
       DepthOfFieldPostFX.disable();

+ 2 - 2
Templates/BaseGame/game/core/postFX/scripts/LightRays/lightRays.tscript

@@ -126,7 +126,7 @@ function LightRayPostFX::populatePostFXSettings(%this)
 
 function PostEffectEditorInspector::toggleLightRayPostFX(%this)
 {
-   if($PostFX::LightRayPostFX::Enabled)
+   if($PostFX::LightRayPostFX::Enabled && $pref::PostFX::EnableLightRays)
       LightRayPostFX.enable();
    else
       LightRayPostFX.disable();
@@ -134,7 +134,7 @@ function PostEffectEditorInspector::toggleLightRayPostFX(%this)
 
 function LightRayPostFX::applyFromPreset(%this)
 {
-   if($PostFX::LightRayPostFX::Enabled)
+   if($PostFX::LightRayPostFX::Enabled && $pref::PostFX::EnableLightRays)
       %this.enable();
    else
       %this.disable();

+ 2 - 2
Templates/BaseGame/game/core/postFX/scripts/SSAO/SSAOPostFx.tscript

@@ -165,7 +165,7 @@ function SSAOPostFx::populatePostFXSettings(%this)
 
 function PostEffectEditorInspector::toggleSSAOPostFx(%this)
 {
-   if($PostFX::SSAOPostFx::Enabled)
+   if($PostFX::SSAOPostFx::Enabled && $pref::PostFX::EnableSSAO)
       SSAOPostFx.enable();
    else
       SSAOPostFx.disable();
@@ -173,7 +173,7 @@ function PostEffectEditorInspector::toggleSSAOPostFx(%this)
 
 function SSAOPostFx::applyFromPreset(%this)
 {
-   if($PostFXManager::PostFX::Enable)
+   if($PostFXManager::PostFX::Enable && $pref::PostFX::EnableSSAO)
       %this.enable();
    else
       %this.disable();

+ 2 - 2
Templates/BaseGame/game/core/postFX/scripts/Vignette/VignettePostFX.tscript

@@ -91,7 +91,7 @@ function VignettePostFX::populatePostFXSettings(%this)
 //Allow us to easily toggle the postFX and have it respond immediately
 function PostEffectEditorInspector::toggleVignettePostFX(%this)
 {
-   if($PostFX::VignettePostFX::Enabled)
+   if($PostFX::VignettePostFX::Enabled && $pref::PostFX::EnableVignette)
       VignettePostFX.enable();
    else
       VignettePostFX.disable();
@@ -102,7 +102,7 @@ function PostEffectEditorInspector::toggleVignettePostFX(%this)
 //when rendering. This allows us to modify things but still leave room for reverting or temporarily applying them
 function VignettePostFX::applyFromPreset(%this)
 {
-   if($PostFX::VignettePostFX::Enabled)
+   if($PostFX::VignettePostFX::Enabled && $pref::PostFX::EnableVignette)
       %this.enable();
    else
       %this.disable();

+ 2 - 2
Templates/BaseGame/game/core/rendering/Core_Rendering.tscript

@@ -56,11 +56,11 @@ function Core_Rendering::initClient(%this)
    %prefPath = getPrefpath();
    if ( isFile( %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension ) )
       exec( %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension );
+      
+   postFXInit();
    
    configureCanvas();
    
-   postFXInit();
-   
    //Autodetect settings if it's our first time
    if($pref::Video::autoDetect)
       AutodetectGraphics();

+ 1 - 1
Templates/BaseGame/game/core/rendering/materials/moon_noglow.asset.taml

@@ -12,7 +12,7 @@
         <Material.Stages>
             <Stages_beginarray
                 DiffuseMapAsset="Core_Rendering:moon_noglow_image"
-                vertColor="1";/>
+                vertColor="1"/>
         </Material.Stages>
     </Material>
 </MaterialAsset>

+ 0 - 9
Templates/BaseGame/game/core/rendering/materials/moon_noglow.tscript

@@ -1,9 +0,0 @@
-//--- OBJECT WRITE BEGIN ---
-singleton Material(moon_noglow) {
-   mapTo="moon_noglow";
-   DiffuseMapAsset = "Core_Rendering:moon_noglow_image";
-   emissive = true;
-   translucent = true;
-   vertColor[ 0 ] = true;
-};
-//--- OBJECT WRITE END ---

+ 0 - 14
Templates/BaseGame/game/core/rendering/materials/moon_noglowMat.asset.taml

@@ -1,14 +0,0 @@
-<MaterialAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="OccluderProxyMaterial"
-    materialDefinitionName="OccluderProxyMaterial"
-    VersionId="1">
-    <Material
-        Name="OccluderProxyMaterial">
-        <Material.Stages>
-            <Stages_beginarray
-                DiffuseMapAsset="ToolsModule:occluderProxyImage_image"/>
-        </Material.Stages>
-    </Material>
-</MaterialAsset>

+ 1 - 1
Templates/BaseGame/game/core/rendering/materials/moon_wcorona.asset.taml

@@ -1,7 +1,7 @@
 <ImageAsset
     canSave="true"
     canSaveDynamicFields="true"
-    AssetName="moon_wcorona"
+    AssetName="moon_wcorona_image"
     imageFile="@assetFile=moon_wcorona.png"
     UseMips="true"
     isHDRImage="false"

+ 1 - 1
Templates/BaseGame/game/core/rendering/materials/moon_wcoronaMat.asset.taml

@@ -12,7 +12,7 @@
         <Material.Stages>
             <Stages_beginarray
                 DiffuseMapAsset="Core_Rendering:moon_wcorona_image"
-                vertColor="1";/>
+                vertColor="1"/>
         </Material.Stages>
     </Material>
 </MaterialAsset>

+ 0 - 9
Templates/BaseGame/game/core/rendering/materials/moon_wglow.tscript

@@ -1,9 +0,0 @@
-//--- OBJECT WRITE BEGIN ---
-singleton Material(moon_wglow) {
-   mapTo="moon_wglow";
-   DiffuseMapAsset = "Core_Rendering:moon_wglow_image";
-   emissive = true;
-   translucent = true;
-   vertColor[ 0 ] = true;
-};
-//--- OBJECT WRITE END ---

+ 0 - 14
Templates/BaseGame/game/core/rendering/materials/moon_wglowMat.asset.taml

@@ -1,14 +0,0 @@
-<MaterialAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="OccluderProxyMaterial"
-    materialDefinitionName="OccluderProxyMaterial"
-    VersionId="1">
-    <Material
-        Name="OccluderProxyMaterial">
-        <Material.Stages>
-            <Stages_beginarray
-                DiffuseMapAsset="ToolsModule:occluderProxyImage_image"/>
-        </Material.Stages>
-    </Material>
-</MaterialAsset>

+ 1 - 1
Templates/BaseGame/game/core/rendering/shapes/noShapeMat.asset.taml

@@ -7,7 +7,7 @@
     <Material
         Name="NoShapeMat"
         mapTo="NoShape"
-        translucent="1";
+        translucent="1"
         translucentBlendOp="LerpAlpha";
         castShadows="0">
         <Material.Stages>

+ 59 - 258
Templates/BaseGame/game/data/UI/guis/optionsMenu.gui

@@ -1,296 +1,160 @@
 //--- OBJECT WRITE BEGIN ---
 $guiContent = new GuiControl(OptionsMenu) {
-   position = "0 0";
    extent = "1024 768";
-   minExtent = "8 2";
-   horizSizing = "right";
-   vertSizing = "bottom";
    profile = "GuiDefaultProfile";
-   visible = "1";
-   active = "1";
    tooltipProfile = "GuiToolTipProfile";
-   hovertime = "1000";
    isContainer = "1";
-   canSave = "1";
    canSaveDynamicFields = "1";
+      currentCategory = "Display";
+      optionsCategories = "17177";
       pageTabIndex = "0";
       returnGui = "MainMenuGui";
       tamlReader = "20088";
       tile = "0";
+      unappliedChanges = "17178";
       useVariable = "0";
 
    new GuiControl() {
       position = "48 56";
       extent = "928 655";
-      minExtent = "8 2";
       horizSizing = "aspectCenter";
       vertSizing = "center";
       profile = "GuiDefaultProfile";
-      visible = "1";
-      active = "1";
       tooltipProfile = "GuiToolTipProfile";
-      hovertime = "1000";
       isContainer = "1";
-      canSave = "1";
-      canSaveDynamicFields = "0";
 
       new GuiBitmapBarCtrl() {
-         percent = "100";
-         vertical = "0";
-         flipClip = "0";
          BitmapAsset = "UI:panel_low_image";
-         color = "255 255 255 255";
          position = "0 40";
          extent = "927 618";
-         minExtent = "8 2";
          horizSizing = "width";
-         vertSizing = "bottom";
          profile = "GuiDefaultProfile";
-         visible = "1";
-         active = "1";
          tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
       };
       new GuiBitmapBarCtrl() {
-         percent = "100";
-         vertical = "0";
-         flipClip = "0";
          BitmapAsset = "UI:panel_image";
-         color = "255 255 255 255";
-         position = "0 0";
          extent = "927 40";
-         minExtent = "8 2";
          horizSizing = "width";
-         vertSizing = "bottom";
          profile = "GuiDefaultProfile";
-         visible = "1";
-         active = "1";
          tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
       };
       new GuiTextCtrl() {
          text = "OPTIONS";
-         maxLength = "1024";
-         margin = "0 0 0 0";
-         padding = "0 0 0 0";
-         anchorTop = "1";
-         anchorBottom = "0";
-         anchorLeft = "1";
-         anchorRight = "0";
          position = "22 7";
          extent = "120 28";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
          profile = "MenuHeaderText";
-         visible = "1";
-         active = "1";
          tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "1";
-         canSave = "1";
-         canSaveDynamicFields = "0";
       };
       new GuiTextCtrl(OptionName) {
-         maxLength = "1024";
-         margin = "0 0 0 0";
-         padding = "0 0 0 0";
-         anchorTop = "1";
-         anchorBottom = "0";
-         anchorLeft = "1";
-         anchorRight = "0";
          position = "3 606";
          extent = "293 17";
-         minExtent = "8 2";
          horizSizing = "width";
-         vertSizing = "bottom";
          profile = "MenuSubHeaderText";
-         visible = "1";
-         active = "1";
          tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "1";
-         canSave = "1";
-         canSaveDynamicFields = "0";
       };
       new GuiMLTextCtrl(OptionDescription) {
-         lineSpacing = "2";
-         allowColorChars = "0";
-         maxChars = "-1";
          text = "This is a placeholder text for an option.";
-         useURLMouseCursor = "0";
          position = "3 625";
          extent = "293 14";
-         minExtent = "8 2";
          horizSizing = "width";
-         vertSizing = "bottom";
          profile = "GuiMLTextProfile";
-         visible = "1";
-         active = "1";
          tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
       };
       new GuiSplitContainer() {
-         orientation = "Vertical";
-         splitterSize = "2";
          splitPoint = "250 100";
          fixedPanel = "FirstPanel";
          fixedSize = "250";
-         docking = "None";
-         margin = "0 0 0 0";
-         padding = "0 0 0 0";
-         anchorTop = "1";
-         anchorBottom = "0";
-         anchorLeft = "1";
-         anchorRight = "0";
          position = "0 48";
          extent = "928 555";
-         minExtent = "64 64";
          horizSizing = "width";
-         vertSizing = "bottom";
          profile = "GuiMenuScrollProfile";
-         visible = "1";
-         active = "1";
          tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "1";
-         canSave = "1";
-         canSaveDynamicFields = "0";
 
          new GuiPanel() {
             docking = "Client";
-            margin = "0 0 0 0";
-            padding = "0 0 0 0";
-            anchorTop = "1";
-            anchorBottom = "0";
-            anchorLeft = "1";
-            anchorRight = "0";
-            position = "0 0";
             extent = "248 555";
-            minExtent = "16 16";
-            horizSizing = "right";
-            vertSizing = "bottom";
             profile = "GuiOverlayProfile";
-            visible = "1";
-            active = "1";
             tooltipProfile = "GuiToolTipProfile";
-            hovertime = "1000";
-            isContainer = "1";
             internalName = "Panel1";
-            canSave = "1";
-            canSaveDynamicFields = "0";
 
             new GuiStackControl(OptionsMenuCategoryList) {
-               stackingType = "Vertical";
-               horizStacking = "Left to Right";
-               vertStacking = "Top to Bottom";
                padding = "10";
                dynamicSize = "0";
-               dynamicNonStackExtent = "0";
-               dynamicPos = "0";
-               changeChildSizeToFit = "1";
-               changeChildPosition = "1";
-               position = "0 0";
                extent = "248 555";
-               minExtent = "16 16";
                horizSizing = "width";
                vertSizing = "height";
                profile = "GuiDefaultProfile";
-               visible = "1";
-               active = "1";
                tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "1";
                class = "MenuList";
-               canSave = "1";
-               canSaveDynamicFields = "0";
+
+               new GuiButtonCtrl() {
+                  text = "Display";
+                  extent = "248 35";
+                  profile = "GuiMenuButtonProfile";
+                  command = "populateDisplaySettingsList();";
+                  tooltipProfile = "GuiToolTipProfile";
+               };
+               new GuiButtonCtrl() {
+                  text = "Graphics";
+                  position = "0 45";
+                  extent = "248 35";
+                  profile = "GuiMenuButtonProfile";
+                  command = "populateGraphicsSettingsList();";
+                  tooltipProfile = "GuiToolTipProfile";
+               };
+               new GuiButtonCtrl() {
+                  text = "Audio";
+                  position = "0 90";
+                  extent = "248 35";
+                  profile = "GuiMenuButtonProfile";
+                  command = "populateAudioSettingsList();";
+                  tooltipProfile = "GuiToolTipProfile";
+               };
+               new GuiButtonCtrl() {
+                  text = "Keyboard & Mouse";
+                  position = "0 135";
+                  extent = "248 35";
+                  profile = "GuiMenuButtonProfile";
+                  command = "populateKeyboardMouseSettingsList();";
+                  tooltipProfile = "GuiToolTipProfile";
+               };
+               new GuiButtonCtrl() {
+                  text = "Gamepad";
+                  position = "0 180";
+                  extent = "248 35";
+                  profile = "GuiMenuButtonProfile";
+                  command = "populateGamepadSettingsList();";
+                  tooltipProfile = "GuiToolTipProfile";
+               };
             };
          };
          new GuiPanel() {
             docking = "Client";
-            margin = "0 0 0 0";
-            padding = "0 0 0 0";
-            anchorTop = "1";
-            anchorBottom = "0";
-            anchorLeft = "1";
-            anchorRight = "0";
             position = "252 0";
             extent = "676 555";
-            minExtent = "16 16";
-            horizSizing = "right";
-            vertSizing = "bottom";
             profile = "GuiOverlayProfile";
-            visible = "1";
-            active = "1";
             tooltipProfile = "GuiToolTipProfile";
-            hovertime = "1000";
-            isContainer = "1";
             internalName = "panel2";
-            canSave = "1";
-            canSaveDynamicFields = "0";
 
             new GuiScrollCtrl() {
-               willFirstRespond = "1";
                hScrollBar = "alwaysOff";
                vScrollBar = "dynamic";
-               lockHorizScroll = "0";
-               lockVertScroll = "0";
-               constantThumbHeight = "0";
-               childMargin = "0 0";
-               mouseWheelScrollSpeed = "-1";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "0 0";
                extent = "676 554";
-               minExtent = "8 2";
                horizSizing = "width";
                vertSizing = "height";
                profile = "GuiMenuScrollProfile";
-               visible = "1";
-               active = "1";
                tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "1";
-               canSave = "1";
-               canSaveDynamicFields = "0";
 
                new GuiStackControl(OptionsMenuSettingsList) {
-                  stackingType = "Vertical";
-                  horizStacking = "Left to Right";
-                  vertStacking = "Top to Bottom";
                   padding = "5";
-                  dynamicSize = "1";
-                  dynamicNonStackExtent = "0";
-                  dynamicPos = "0";
                   changeChildSizeToFit = "0";
-                  changeChildPosition = "1";
                   position = "1 1";
                   extent = "661 30";
-                  minExtent = "16 16";
                   horizSizing = "width";
                   vertSizing = "height";
                   profile = "GuiDefaultProfile";
-                  visible = "1";
-                  active = "1";
                   tooltipProfile = "GuiToolTipProfile";
-                  hovertime = "1000";
-                  isContainer = "1";
                   class = "MenuList";
-                  canSave = "1";
-                  canSaveDynamicFields = "0";
                };
             };
          };
@@ -299,130 +163,67 @@ $guiContent = new GuiControl(OptionsMenu) {
    new GuiControl(OptionsButtonHolder) {
       position = "116 711";
       extent = "791 40";
-      minExtent = "8 2";
       horizSizing = "center";
       vertSizing = "top";
       profile = "GuiDefaultProfile";
-      visible = "1";
-      active = "1";
       tooltipProfile = "GuiToolTipProfile";
-      hovertime = "1000";
       isContainer = "1";
       class = "MenuInputButtonContainer";
-      canSave = "1";
-      canSaveDynamicFields = "0";
 
       new GuiIconButtonCtrl() {
-         buttonMargin = "4 4";
-         BitmapAsset = "UI:Keyboard_Black_Return_image";
-         iconLocation = "Left";
+         BitmapAsset = "UI:Keyboard_Black_R_image";
          sizeIconToButton = "1";
          makeIconSquare = "1";
          textLocation = "Right";
-         textMargin = "4";
-         autoSize = "0";
-         text = "Apply";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         position = "507 0";
+         text = "Reset";
+         position = "173 0";
          extent = "140 40";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
          profile = "GuiMenuButtonProfile";
-         visible = "1";
-         active = "1";
-         command = "OptionsMenu.apply();";
+         command = "OptionsMenu.resetToDefaults();";
          tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "0";
-         internalName = "applyButton";
+         internalName = "resetButton";
          class = "MenuInputButton";
-         canSave = "1";
-         canSaveDynamicFields = "0";
       };
-      new GuiIconButtonCtrl() {
-         buttonMargin = "4 4";
-         BitmapAsset = "UI:Keyboard_Black_Escape_image";
-         iconLocation = "Left";
+      new GuiIconButtonCtrl(OptionsMenuSelectButton) {
+         BitmapAsset = "UI:Keyboard_Black_Return_image";
          sizeIconToButton = "1";
          makeIconSquare = "1";
          textLocation = "Right";
-         textMargin = "4";
-         autoSize = "0";
-         text = "Back";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         position = "651 0";
+         text = "Select";
+         position = "507 0";
          extent = "140 40";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
          profile = "GuiMenuButtonProfile";
-         visible = "1";
-         active = "1";
-         command = "OptionsMenu.backOut();";
+         command = "";
          tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "0";
-         internalName = "backButton";
+         internalName = "SelectButton";
          class = "MenuInputButton";
-         canSave = "1";
-         canSaveDynamicFields = "0";
       };
       new GuiIconButtonCtrl() {
-         buttonMargin = "4 4";
-         BitmapAsset = "UI:Keyboard_Black_R_image";
-         iconLocation = "Left";
+         BitmapAsset = "UI:Keyboard_Black_Escape_image";
          sizeIconToButton = "1";
          makeIconSquare = "1";
          textLocation = "Right";
-         textMargin = "4";
-         autoSize = "0";
-         text = "Reset";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         position = "325 0";
+         text = "Back";
+         position = "651 0";
          extent = "140 40";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
          profile = "GuiMenuButtonProfile";
-         visible = "1";
-         active = "1";
-         command = "OptionsMenu.resetToDefaults();";
+         command = "OptionsMenu.backOut();";
          tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "0";
-         internalName = "resetButton";
+         internalName = "backButton";
          class = "MenuInputButton";
-         canSave = "1";
-         canSaveDynamicFields = "0";
       };
    };
    new GuiInputCtrl(OptionsMenuInputHandler) {
       sendAxisEvents = "1";
       sendBreakEvents = "1";
-      sendModifierEvents = "0";
       ignoreMouseEvents = "1";
-      lockMouse = "0";
       position = "-50 0";
       extent = "10 10";
-      minExtent = "8 2";
       horizSizing = "left";
       vertSizing = "top";
       profile = "GuiInputCtrlProfile";
-      visible = "1";
-      active = "1";
       tooltipProfile = "GuiToolTipProfile";
-      hovertime = "1000";
-      isContainer = "0";
       class = "MenuInputHandler";
-      canSave = "1";
-      canSaveDynamicFields = "0";
    };
 };
 //--- OBJECT WRITE END ---

+ 114 - 116
Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript

@@ -55,9 +55,11 @@ function OptionsMenu::onAdd(%this)
    
    if(!isObject(%this.unappliedChanges))
    {
-      %this.unappliedChanges = new ArrayObject();
+      %this.unappliedChanges = new ArrayObject(OptionsMenuUnappliedChanges);
    }  
    
+   %this.currentCategory = "";
+   
    addOptionsMenuCategory("Display", "populateDisplaySettingsList();");
    addOptionsMenuCategory("Graphics", "populateGraphicsSettingsList();");
    addOptionsMenuCategory("Audio", "populateAudioSettingsList();");
@@ -121,12 +123,33 @@ function OptionsMenu::onWake(%this)
 function OptionsButtonHolder::onWake(%this)
 {
    %this-->resetButton.set("btn_back", "R", "Reset", "OptionsMenu.resetToDefaults();");
-   %this-->applyButton.set("btn_start", "Return", "Apply", "OptionsMenu.apply();");
+   %this-->selectButton.set("btn_a", "Return", "Select", "OptionsMenu.select();", true);
    %this-->backButton.set("btn_b", "Escape", "Back", "OptionsMenu.backOut();");
    
    //OptionsMenuCategoryList.getObject(0).performClick();
 }
 
+function OptionsMenu::select(%this)
+{
+   if(OptionsMenuCategoryList.isActiveMenuList())
+   {
+      OptionsMenuSettingsList.setAsActiveMenuList();
+      %this.updateSelectButton();
+   }
+}
+
+function OptionsMenu::updateSelectButton(%this)
+{
+   if(OptionsMenuCategoryList.isActiveMenuList())
+   {
+      %this-->selectButton.setHidden(false);
+   }
+   else if(OptionsMenuSettingsList.isActiveMenuList())
+   {
+      %this-->selectButton.setHidden(true);
+   }
+}
+
 function OptionsMenu::apply(%this)
 {
    //Now we run through our list of unapplied changes and... apply them.
@@ -137,7 +160,7 @@ function OptionsMenu::apply(%this)
    for(%i=0; %i < %this.unappliedChanges.count(); %i++)
    {
       %targetVar = %this.unappliedChanges.getKey(%i);
-      %newValue = %this.unappliedChanges.getValue(%i);
+      %newValue = strReplace(%this.unappliedChanges.getValue(%i), "\"", "");
       
       //First, lets just check through our action map names, see if any match
       %wasKeybind = false;
@@ -245,6 +268,9 @@ function OptionsMenu::apply(%this)
    export("$pref::*", %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension, false);
    
    OptionsMenu.unappliedChanges.empty();
+   
+   //Now we can back out of the options menu
+   OptionsMenu.doOptionsMenuBackOut();
 }
 
 function OptionsMenu::resetToDefaults(%this)
@@ -252,6 +278,40 @@ function OptionsMenu::resetToDefaults(%this)
    MessageBoxOKCancel("", "This will set the graphical settings back to the auto-detected defaults. Do you wish to continue?", "AutodetectGraphics();", "");
 }
 
+function OptionsMenu::refresh(%this)
+{
+   if(%this.currentCategory !$= "")
+   {
+      %category = %this.optionsCategories.getKey(%this.currentCategory);
+      %command = %this.optionsCategories.getValue(%this.currentCategory);
+      eval(%command);
+   }
+}
+
+function OptionsMenu::getOptionVariableValue(%this, %variableName)
+{
+   %unappliedPrefIndex = %this.unappliedChanges.getIndexFromKey(%variableName);
+   if(%unappliedPrefIndex != -1)
+   {
+      %value = %this.unappliedChanges.getValue(%unappliedPrefIndex);
+      return strreplace(%value, "\"", "");
+   }  
+   
+   return getVariable(%variableName);
+}
+
+function OptionsMenuSelectButton::onVisible(%this, %state)
+{
+   //We're sorta cheating here.
+   //This button should only be displayed when we're in the categories list
+   //so whenever the status changes, such as automatically refreshing due to 
+   //navigation events, we'll just do a quick check to ensure we're 
+   //in the right visibility mode
+   if(%state && OptionsMenuSettingsList.isActiveMenuList())
+   {
+      %this.setHidden(true);
+   }
+}
 //
 //
 //
@@ -308,17 +368,16 @@ function populateDisplaySettingsList()
    else
       OptionsMenuSettingsList.setRowEnabled(1, false);
    
-   %mode = getField($Video::ModeTags, $pref::Video::deviceMode);
+   %mode = OptionsMenu.getOptionVariableValue("$pref::Video::deviceMode");
+   if(isInt(%mode))
+      %mode = getField($Video::ModeTags, $pref::Video::deviceMode);
    OptionsMenuSettingsList.addOptionRow("Window Mode", "$pref::Video::deviceMode", $Video::ModeTags, false, "", true, "", %mode);
    
-   %resolutionList = getScreenResolutionList($pref::Video::deviceId, $pref::Video::deviceMode);
-   OptionsMenuSettingsList.addOptionRow("Resolution", "$pref::Video::Resolution", %resolutionList, false, "onDisplayResChange",  true, "Resolution of the game window", _makePrettyResString( $pref::Video::mode ));
-   
-   //If they're doing borderless, the window resolution must match the display resolution
    if(%mode !$= "Borderless")
-      OptionsMenuSettingsList.setRowEnabled(3, true);
-   else
-      OptionsMenuSettingsList.setRowEnabled(3, false);
+   {
+      %resolutionList = getScreenResolutionList($pref::Video::deviceId, $pref::Video::deviceMode);
+      OptionsMenuSettingsList.addOptionRow("Resolution", "$pref::Video::Resolution", %resolutionList, false, "",  true, "Resolution of the game window", _makePrettyResString( $pref::Video::mode ));
+   }
    
    OptionsMenuSettingsList.addOptionRow("VSync", "$pref::Video::disableVerticalSync", "No\tYes", false, "",  true, "", convertBoolToYesNo(!$pref::Video::disableVerticalSync));
 
@@ -333,27 +392,6 @@ function populateDisplaySettingsList()
    OptionsMenuSettingsList.addSliderRow("Contrast", "", 0.5, 0.1, "0 1", "");
 }
 
-/*function OptionsMenu::applyDisplaySettings(%this)
-{
-	%newDevice = OptionsMenuSettingsList.getCurrentOption(0);
-							
-   // Change the device.
-   if ( %newDevice !$= $pref::Video::displayDevice )
-   {
-      $pref::Video::displayDevice = %newDevice;
-      if( %newDevice !$= getDisplayDeviceInformation() )
-         MessageBoxOK( "Change requires restart", "Please restart the game for a display device change to take effect." );
-         
-      $changingDisplayDevice = %newDevice;
-   }
-   
-   updateDisplaySettings();
-   
-   echo("Exporting client prefs");
-   %prefPath = getPrefpath();
-   export("$pref::*", %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension, false);
-}*/
-
 //
 //
 //
@@ -394,6 +432,20 @@ function updateDisplaySettings()
    //Update the display settings now
    %deviceName = getDisplayDeviceName();
    %newDeviceID = getWord(%deviceName, 0) - 1;
+   
+   if(!isInt($pref::Video::deviceMode))
+   {
+      //probably saved out as the mode name, so just translate it back
+      for(%i=0; %i < getFieldCount($Video::ModeTags); %i++)
+      {
+         if(getField($Video::ModeTags, %i) $= $pref::Video::deviceMode)
+         {
+            $pref::Video::deviceMode = %i;
+            break;
+         }
+      }
+   }
+   
    %deviceModeName = getField($Video::ModeTags, $pref::Video::deviceMode);
    %newDeviceMode = 0;
    foreach$(%modeName in $Video::ModeTags)
@@ -403,6 +455,14 @@ function updateDisplaySettings()
       else
          %newDeviceMode++;
    }
+   
+   if($pref::Video::deviceMode == $Video::ModeBorderless)
+   {
+      //if we're changing to borderless, we swap to the full resolution of the desktop  
+      $pref::Video::mode = Canvas.getBestCanvasRes($pref::Video::deviceId, $pref::Video::deviceMode);
+      
+      $pref::Video::Resolution = $pref::Video::mode.x SPC $pref::Video::mode.y;
+   }
 
    %newRes = $pref::Video::Resolution;
    %newBpp = 32; // ... its not 1997 anymore.
@@ -448,7 +508,7 @@ function updateDisplaySettings()
 function updatePostFXSettings()
 {
    PostFXManager.settingsEffectSetEnabled(SSAOPostFx, $pref::PostFX::EnableSSAO);
-   PostFXManager.settingsEffectSetEnabled(DOFPostEffect, $pref::PostFX::EnableDOF);
+   PostFXManager.settingsEffectSetEnabled(DepthOfFieldPostFX, $pref::PostFX::EnableDOF);
    PostFXManager.settingsEffectSetEnabled(LightRayPostFX, $pref::PostFX::EnableLightRays);
    PostFXManager.settingsEffectSetEnabled(vignettePostFX, $pref::PostFX::EnableVignette);
 }
@@ -583,13 +643,21 @@ function OptionsMenuList::activateRow(%this)
 
 function OptionsMenu::backOut(%this)
 {
-   if(%this.unappliedChanges.count() != 0)
+   if(OptionsMenuSettingsList.isActiveMenuList())
    {
-      MessageBoxOKCancel("Discard Changes?", "You have unapplied changes to your settings, do you wish to continue?", "OptionsMenu.doOptionsMenuBackOut();", "");
+      OptionsMenuCategoryList.setAsActiveMenuList();
+      %this.updateSelectButton();
    }
    else
    {
-      %this.doOptionsMenuBackOut();
+      if(%this.unappliedChanges.count() != 0)
+      {
+         MessageBoxOKCancel("Discard Changes?", "You have unapplied changes to your settings, do you wish to apply or discard them?", "OptionsMenu.apply();", "OptionsMenu.doOptionsMenuBackOut();", "Apply", "Discard");
+      }
+      else
+      {
+         %this.doOptionsMenuBackOut();
+      }
    }
 }
 
@@ -630,7 +698,7 @@ function OptionsMenuSettingsList::addOptionRow(%this, %label, %targetPrefVar, %o
       %enabled = true;
       
    %optionsRowSize = 30;
-   %optionColumnWidth = %this.extent.x - 450;//todo, calculate off longest option text?
+   %optionColumnWidth = %this.extent.x * 0.3;//todo, calculate off longest option text?
       
    %option = new GuiGameSettingsCtrl() { 
       class = "MenuOptionsButton";
@@ -723,6 +791,7 @@ function OptionsMenuSettingsList::addKeybindRow(%this, %label, %bitmapName, %cal
 //
 function OptionsMenuCategoryList::onNavigate(%this, %index)
 {
+   OptionsMenu.currentCategory = %index;
    %this.getObject(%index).performClick();
 }
 
@@ -750,83 +819,6 @@ function convertBoolToOnOff(%val)
       return "Off";
 }
 
-function onDisplayModeChange(%val)
-{  
-   // The display device (monitor) or screen mode has changed. Refill the
-   // resolution list with only available options.
-   %deviceName = OptionsMenuSettingsList.getCurrentOption(1);
-   %newDeviceID = getWord(%deviceName, 0) - 1;
-   %deviceModeName = OptionsMenuSettingsList.getCurrentOption(2);
-   %newDeviceMode = 0;
-   foreach$(%modeName in $Video::ModeTags)
-   {
-      if (%deviceModeName $= %modeName)
-         break;
-      else
-         %newDeviceMode++;
-   }
-   %resolutionList = getScreenResolutionList(%newDeviceID, %newDeviceMode);
-
-   if (%newDeviceMode == $Video::ModeBorderless)
-   {  // If we're switching to borderless, default to monitor res on Windows OS,
-      // monitor usable area for other platforms.
-      if ($platform $= "windows")
-         %newRes = getWords(Canvas.getMonitorRect(%newDeviceID), 2);
-      else
-         %newRes = getWords(Canvas.getMonitorUsableRect(%newDeviceID), 2);
-   }
-   else
-   {  // Otherwise, if our old resolution is still in the list, attempt to reset it.
-      %oldRes = getWord(OptionsMenuSettingsList.getCurrentOption(3), 0) SPC getWord(OptionsMenuSettingsList.getCurrentOption(3), 2);
-
-      %found = false;
-      %retCount = getFieldCount(%resolutionList);
-      for (%i = 0; %i < %retCount; %i++)
-      {
-         %existingEntry = getField(%resolutionList, %i);
-         if ((%existingEntry.x $= %oldRes.x) && (%existingEntry.z $= %oldRes.y))
-         {
-            %found = true;
-            %newRes = %oldRes;
-            break;  
-         }
-      }
-
-      if (!%found)
-      {  // Pick the best resoltion available for the device and mode
-         %newRes = Canvas.getBestCanvasRes(%newDeviceID, %newDeviceMode);
-      }
-   }
-   
-   if(%newDeviceMode == $Video::ModeBorderless)
-      OptionsMenuSettingsList.setRowEnabled(3, false);
-   else
-      OptionsMenuSettingsList.setRowEnabled(3, true);
-      
-   OptionsMenuSettingsList.setOptions(3, %resolutionList);
-   OptionsMenuSettingsList.selectOption(3, _makePrettyResString(%newRes));
-}
-
-function onDisplayResChange(%val)
-{  // The resolution has changed. Setup refresh rates available at this res.
-   %newRes = getWord(OptionsMenuSettingsList.getCurrentOption(3), 0) SPC getWord(OptionsMenuSettingsList.getCurrentOption(3), 2);
-   %refreshList = getScreenRefreshList(%newRes);
-
-   // If our old rate still exists, select it
-   %oldRate = OptionsMenuSettingsList.getCurrentOption(5);
-   %retCount = getFieldCount(%refreshList);
-   for (%i = 0; %i < %retCount; %i++)
-   {
-      %existingEntry = getField(%refreshList, %i);
-      %newRate = %existingEntry;
-      if (%existingEntry $= %oldRate)
-         break;  
-   }
-
-   OptionsMenuSettingsList.setOptions(5, %refreshList);
-   OptionsMenuSettingsList.selectOption(5, %newRate);
-}
-
 function getDisplayDeviceName()
 {
    %numDevices = Canvas.getMonitorCount();
@@ -880,10 +872,16 @@ function MenuOptionsButton::onChange(%this)
       
       %prefIndex = OptionsMenu.unappliedChanges.getIndexFromKey(%targetVar);
       if(%prefIndex == -1)
-         OptionsMenu.unappliedChanges.add(%targetVar, %saveReadyValue);
+      {
+         echo("Setting UnappliedChanges via add: key:" @ %targetVar @", value: " @ %saveReadyValue);
+         OptionsMenu.unappliedChanges.add(%targetVar, "\"" @ %saveReadyValue @ "\"" );
+      }
       else
-         OptionsMenu.unappliedChanges.setValue(%saveReadyValue, %prefIndex);
+         OptionsMenu.unappliedChanges.setValue("\"" @ %saveReadyValue @ "\"", %prefIndex);
    }
+   
+   //Update the UI in case there's responsive logic
+   schedule(32, OptionsMenu, "refresh");
 }
 
 function OptionsMenu::onKeybindChanged(%this, %actionMap, %keybind)

+ 0 - 0
Templates/BaseGame/game/data/UI/images/groupborder.png → Templates/BaseGame/game/data/UI/images/group_border.png


+ 1 - 1
Templates/BaseGame/game/data/UI/images/group_border_image.asset.taml

@@ -2,7 +2,7 @@
     canSave="true"
     canSaveDynamicFields="true"
     AssetName="group_border_image"
-    imageFile="@assetFile=group-border.png"
+    imageFile="@assetFile=group_border.png"
     UseMips="true"
     isHDRImage="false"
     imageType="Albedo" />

+ 0 - 0
Templates/BaseGame/game/data/UI/images/nopreview.png → Templates/BaseGame/game/data/UI/images/no_preview.png


+ 1 - 1
Templates/BaseGame/game/data/UI/images/no_preview_image.asset.taml

@@ -2,7 +2,7 @@
     canSave="true"
     canSaveDynamicFields="true"
     AssetName="no_preview_image"
-    imageFile="@assetFile=no-preview.png"
+    imageFile="@assetFile=no_preview.png"
     UseMips="true"
     isHDRImage="false"
     imageType="Albedo" />

+ 0 - 3
Templates/BaseGame/game/data/UI/images/nopreview_image.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="nopreview_image"
-    imageFile="@assetFile=nopreview.png"/>

+ 0 - 0
Templates/BaseGame/game/data/UI/images/selectorbutton.png → Templates/BaseGame/game/data/UI/images/selector_button.png


+ 0 - 0
Templates/BaseGame/game/data/UI/images/selectorbuttonblank.png → Templates/BaseGame/game/data/UI/images/selector_button_blank.png


+ 1 - 1
Templates/BaseGame/game/data/UI/images/selector_button_blank_image.asset.taml

@@ -2,7 +2,7 @@
     canSave="true"
     canSaveDynamicFields="true"
     AssetName="selector_button_blank_image"
-    imageFile="@assetFile=selector-button-blank.png"
+    imageFile="@assetFile=selector_button_blank.png"
     UseMips="true"
     isHDRImage="false"
     imageType="Albedo" />

+ 0 - 0
Templates/BaseGame/game/data/UI/images/selectorbuttondark.png → Templates/BaseGame/game/data/UI/images/selector_button_dark.png


+ 1 - 1
Templates/BaseGame/game/data/UI/images/selector_button_dark_image.asset.taml

@@ -2,7 +2,7 @@
     canSave="true"
     canSaveDynamicFields="true"
     AssetName="selector_button_dark_image"
-    imageFile="@assetFile=selector-button-dark.png"
+    imageFile="@assetFile=selector_button_dark.png"
     UseMips="true"
     isHDRImage="false"
     imageType="Albedo" />

+ 0 - 0
Templates/BaseGame/game/data/UI/images/selectorbuttonhighlightonly.png → Templates/BaseGame/game/data/UI/images/selector_button_highlight_only.png


+ 1 - 1
Templates/BaseGame/game/data/UI/images/selector_button_highlight_only_image.asset.taml

@@ -2,7 +2,7 @@
     canSave="true"
     canSaveDynamicFields="true"
     AssetName="selector_button_highlight_only_image"
-    imageFile="@assetFile=selector-button-highlight-only.png"
+    imageFile="@assetFile=selector_button_highlight_only.png"
     UseMips="true"
     isHDRImage="false"
     imageType="Albedo" />

+ 1 - 1
Templates/BaseGame/game/data/UI/images/selector_button_image.asset.taml

@@ -2,7 +2,7 @@
     canSave="true"
     canSaveDynamicFields="true"
     AssetName="selector_button_image"
-    imageFile="@assetFile=selector-button.png"
+    imageFile="@assetFile=selector_button.png"
     UseMips="true"
     isHDRImage="false"
     imageType="Albedo" />

+ 0 - 3
Templates/BaseGame/game/data/UI/images/selectorbutton_image.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="selectorbutton_image"
-    imageFile="@assetFile=selectorbutton.png"/>

+ 0 - 3
Templates/BaseGame/game/data/UI/images/selectorbuttonblank_image.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="selectorbuttonblank_image"
-    imageFile="@assetFile=selectorbuttonblank.png"/>

+ 0 - 3
Templates/BaseGame/game/data/UI/images/selectorbuttondark_image.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="selectorbuttondark_image"
-    imageFile="@assetFile=selectorbuttondark.png"/>

+ 0 - 3
Templates/BaseGame/game/data/UI/images/selectorbuttonhighlightonly_image.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="selectorbuttonhighlightonly_image"
-    imageFile="@assetFile=selectorbuttonhighlightonly.png"/>

+ 0 - 0
Templates/BaseGame/game/data/UI/images/tabborder.png → Templates/BaseGame/game/data/UI/images/tab_border.png


+ 1 - 1
Templates/BaseGame/game/data/UI/images/tab_border_image.asset.taml

@@ -2,7 +2,7 @@
     canSave="true"
     canSaveDynamicFields="true"
     AssetName="tab_border_image"
-    imageFile="@assetFile=tab-border.png"
+    imageFile="@assetFile=tab_border.png"
     UseMips="true"
     isHDRImage="false"
     imageType="Albedo" />

+ 0 - 3
Templates/BaseGame/game/data/UI/images/tabborder_image.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="tabborder_image"
-    imageFile="@assetFile=tabborder.png"/>

+ 48 - 6
Templates/BaseGame/game/data/UI/scripts/menuInputHandling.tscript

@@ -412,6 +412,13 @@ function MenuInputHandler::onInputEvent(%this, %device, %action, %state)
 // Menu List processing
 // These functions manage the navigation and activation of the Menu Lists
 //==============================================================================
+function MenuList::isActiveMenuList(%this)
+{
+   if($activeMenuList == %this)
+      return true;
+   
+   return false;
+}
 
 function MenuList::setAsActiveMenuList(%this, %startPosition, %menuMode)
 {
@@ -485,8 +492,6 @@ function MenuList::navigateDown(%this)
 
 function MenuList::navigateLeft()
 {
-   echo("Menu list navigated left!"); 
-   
    //Atm, we're only handling specific control types, namely options entries, but
    //this could readily be expanded upon to handle grids like for inventory screens
    //or the like
@@ -494,17 +499,54 @@ function MenuList::navigateLeft()
    %btn = $activeMenuList.getObject($activeMenuListPosition.y);
    if(%btn.getClassName() $= "GuiGameSettingsCtrl" && %btn.isEnabled())
    {
-      warnf("MenuList::navigateLeft() - actioned the option" @ %btn @ " to the left");
+      %mode = %btn.getMode();
+      if(%mode == 0) //options list
+      {
+         %optionId = %btn.getCurrentOptionIndex() - 1;
+         %btn.selectOptionByIndex(%optionId);
+         %btn.onChange();
+      }
+      else if(%mode == 1) //slider
+      {
+         %value = %btn.getValue();
+         %adjustedValue = %value - %btn.getIncrement();
+         %minValue = %btn.getRange().x;
+         if(%adjustedValue < %minValue)
+            %adjustedValue = %minValue;
+            
+         %btn.setValue(%adjustedValue);
+         %btn.onChange();
+      }
    }
 }
 
 function MenuList::navigateRight()
 {
-   echo("Menu list navigated right!");  
-   
    %btn = $activeMenuList.getObject($activeMenuListPosition.y);
    if(%btn.getClassName() $= "GuiGameSettingsCtrl" && %btn.isEnabled())
    {
-      warnf("MenuList::navigateLeft() - actioned the option" @ %btn @ " to the left");
+      %mode = %btn.getMode();
+      if(%mode == 0) //options list
+      {
+         %optionId = %btn.getCurrentOptionIndex() + 1;
+         %btn.selectOptionByIndex(%optionId);
+         %btn.onChange();
+      }
+      else if(%mode == 1) //slider
+      {
+         %value = %btn.getValue();
+         %adjustedValue = %value + %btn.getIncrement();
+         %maxValue = %btn.getRange().y;
+         if(%adjustedValue > %maxValue)
+            %adjustedValue = %maxValue;
+            
+         %btn.setValue(%adjustedValue);
+         %btn.onChange();
+      }
    }
 }
+
+function MenuList::getActiveRow(%this)
+{
+   return $activeMenuListPosition.y;
+}

+ 13 - 3
Templates/BaseGame/game/data/UI/scripts/messageBoxes.tscript

@@ -116,7 +116,7 @@ function MessageBoxOKDlg::onSleep( %this )
    MessageBoxCtrl.originalMenuInputContainer.setActive();
 }
 
-function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
+function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback, %okLabelOverride, %cancelLabelOverride)
 {
    Canvas.pushDialog(MessageBoxDlg);
    MessageBoxTitleText.text = %title;
@@ -125,8 +125,18 @@ function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
    MessageBoxYNCButtonHolder.hidden = true;
    MessageBoxOKButtonHolder.hidden = true;
    
-   MessageBoxOCButtonHolder-->OKButton.set("btn_a", "Return", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
-   MessageBoxOCButtonHolder-->CancelButton.set("btn_b", "Escape", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
+   if(%okLabelOverride $= "")
+      %okLabel = "OK";
+   else
+      %okLabel = %okLabelOverride;
+      
+   if(%cancelLabelOverride $= "")
+      %cancelLabel = "Cancel";
+   else
+      %cancelLabel = %cancelLabelOverride;
+   
+   MessageBoxOCButtonHolder-->OKButton.set("btn_a", "Return", %okLabel, "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
+   MessageBoxOCButtonHolder-->CancelButton.set("btn_b", "Escape", %cancelLabel, "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
 
    MessageBoxCtrl.originalMenuInputContainer = $activeMenuButtonContainer;
    MessageBoxOCButtonHolder.setActive();

+ 3 - 2
Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui

@@ -1089,7 +1089,7 @@ $guiContent = new GuiControl(AssetBrowser) {
          position = "5 588";
          extent = "20 20";
          minExtent = "8 2";
-         horizSizing = "left";
+         horizSizing = "right";
          vertSizing = "top";
          profile = "ToolsGuiDefaultProfile";
          visible = "1";
@@ -1124,13 +1124,14 @@ $guiContent = new GuiControl(AssetBrowser) {
          class = "assetBrowserPreviewSlider";
          canSave = "1";
          canSaveDynamicFields = "0";
+         command = "AssetBrowser-->previewSlider.onMouseDragged();";
       };
       new GuiBitmapCtrl() {
          bitmapAsset = "ToolsModule:larger_image";
          position = "103 588";
          extent = "20 20";
          minExtent = "8 2";
-         horizSizing = "left";
+         horizSizing = "right";
          vertSizing = "top";
          profile = "ToolsGuiDefaultProfile";
          visible = "1";

+ 2 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.tscript

@@ -127,6 +127,8 @@ function AssetBrowserModuleList::refresh(%this)
       %moduleName = %moduleDef.ModuleId;
       %this.add(%moduleName, %i);  
    }
+   
+   %this.sort();
 }
 
 function AssetBrowserSelModuleAddBtn::onClick(%this)

+ 19 - 3
Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript

@@ -360,6 +360,13 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
    {
       %this.previewData = new ScriptObject();      
    }
+   else
+   {
+      %this.previewData.tooltip = "";
+      %this.previewData.assetName = "";
+      %this.previewData.previewImage = "";
+      %this.previewData.doubleClickCommand = "";
+   }
    
    AssetPreviewArray.empty();
    
@@ -493,8 +500,6 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
    
    %tooltip = %assetName;
    
-   %doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );";
-   
    %textBottomPad = 20;
    
    %previewButton = new GuiIconButtonCtrl()
@@ -535,6 +540,15 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
    %previewButton.moduleName = %moduleName;
    %previewButton.assetType = %assetType;
    
+   if(%this.selectMode)
+   {
+      %doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
+   }
+   else
+   {
+      %doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );";
+   }
+   
    //Build out the preview
    %buildCommand = %this @ ".build" @ %assetType @ "Preview(\"" @ %assetDesc @ "\"," @ %this.previewData @ ");";
    eval(%buildCommand);
@@ -543,7 +557,9 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
    %tooltip = %this.previewData.tooltip;
    %assetName = %this.previewData.assetName;
    %previewImage = %this.previewData.previewImage;
-   %doubleClickCommand = %this.previewData.doubleClickCommand;
+   
+   if(%this.previewData.doubleClickCommand !$= "")
+      %doubleClickCommand = %this.previewData.doubleClickCommand;
    
    %previewButton.assetName = %assetName;
    %previewButton.moduleName = %moduleName;

+ 5 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript

@@ -507,6 +507,11 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData)
                            "\nAsset Type: Material Asset" @  
                            "\nAsset Definition ID: " @  %assetDef @
                            "\nDefinition Path: " @ %assetDef.getScriptPath();
+                           
+   if(!%this.selectMode)
+   {
+      %previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
+   }
 }
 
 function AssetBrowser::onMaterialAssetEditorDropped(%this, %assetDef, %position)

+ 0 - 17
Templates/BaseGame/game/tools/convexEditor/convexEditor.tscript

@@ -27,20 +27,3 @@ singleton GuiControlProfile( ConvexEditorProfile )
    fillColor = "192 192 192 192";
    category = "Editor";
 };
-
-singleton GuiControlProfile (GuiDisabledTextEditProfile)
-{
-   opaque = false;   
-   border = 0;
-   bitmap = "./textEdit";
-   borderColor = "255 255 255 200";
-   fontColor = "0 0 0";
-   fontColorHL = "255 255 255";
-   fontColorNA = "128 128 128";
-   textOffset = "4 2";
-   autoSizeWidth = false;
-   autoSizeHeight = false;
-   tab = false;
-   canKeyFocus = false;   
-   category = "Editor";
-};

+ 19 - 2
Templates/BaseGame/game/tools/gui/profiles.ed.tscript

@@ -39,7 +39,7 @@ new GuiControlProfile (ToolsGuiDefaultProfile)
    // fill color
    opaque = false;
    fillColor = EditorSettings.value("Theme/tabsColor");
-   fillColorHL = EditorSettings.value("Theme/tabsGLColor");
+   fillColorHL = EditorSettings.value("Theme/tabsHLColor");
    fillColorSEL = EditorSettings.value("Theme/tabsSELColor");
    fillColorNA = EditorSettings.value("Theme/tabsSELColor");
 
@@ -355,7 +355,7 @@ new GuiControlProfile( ToolsGuiButtonProfile )
    opaque = true;
    border = true;
    fillColor = EditorSettings.value("Theme/tabsColor");
-   fillColorHL = EditorSettings.value("Theme/tabsGLColor");
+   fillColorHL = EditorSettings.value("Theme/tabsHLColor");
    fillColorSEL = EditorSettings.value("Theme/tabsSELColor");
    fillColorNA = EditorSettings.value("Theme/tabsSELColor");
    
@@ -1238,3 +1238,20 @@ singleton GuiControlProfile (GuiSimpleBorderProfile)
    border = 1;   
    category = "Editor";
 };
+
+singleton GuiControlProfile (GuiDisabledTextEditProfile)
+{
+   opaque = false;   
+   border = 0;
+   bitmapAsset = "ToolsModule:textEdit_image";
+   borderColor = "255 255 255 200";
+   fontColor = "0 0 0";
+   fontColorHL = "255 255 255";
+   fontColorNA = "128 128 128";
+   textOffset = "4 2";
+   autoSizeWidth = false;
+   autoSizeHeight = false;
+   tab = false;
+   canKeyFocus = false;   
+   category = "Editor";
+};

+ 0 - 17
Templates/BaseGame/game/tools/meshRoadEditor/meshRoadEditor.tscript

@@ -26,21 +26,4 @@ singleton GuiControlProfile( MeshRoadEditorProfile )
    opaque = true;
    fillColor = "192 192 192 192";
    category = "Editor";
-};
-
-singleton GuiControlProfile (GuiDisabledTextEditProfile)
-{
-   opaque = false;   
-   border = 0;
-   bitmap = "./textEdit";
-   borderColor = "255 255 255 200";
-   fontColor = "0 0 0";
-   fontColorHL = "255 255 255";
-   fontColorNA = "128 128 128";
-   textOffset = "4 2";
-   autoSizeWidth = false;
-   autoSizeHeight = false;
-   tab = false;
-   canKeyFocus = false;   
-   category = "Editor";
 };

+ 2 - 4
Templates/BaseGame/game/tools/settings.xml

@@ -38,6 +38,8 @@
             name="AutoImport">0</Setting>
         <Group
             name="Browser">
+            <Setting
+				name="doubleClickAction">Edit Asset</Setting>
             <Setting
                 name="previewTileSize">1</Setting>
             <Setting
@@ -363,14 +365,10 @@
             name="forceLoadDAE">0</Setting>
         <Setting
             name="forceSidebarToSide">1</Setting>
-        <Setting
-            name="lastEditedLevel">FPSGameplay:EmptyLevel</Setting>
         <Setting
             name="orthoFOV">4.60158</Setting>
         <Setting
             name="orthoShowGrid">1</Setting>
-        <Setting
-            name="recentLevelsList">FPSGameplay:EmptyLevel,FPSGameplay:EmptyTerrain,pbr:PbrMatTestLevel,TTR:DasBootLevel</Setting>
         <Setting
             name="startupMode">Blank Level</Setting>
         <Setting

+ 6 - 0
Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript

@@ -1820,6 +1820,12 @@ function EditorTree::update( %this )
    %this.buildVisibleTree( false );
 }
 
+//------------------------------------------------------------------------------
+function EWTreeWindow::onResize(%this, %posX, %posY, %width, %height )
+{
+    EditorTree.extent.x = %this.extent.x;
+}
+
 //------------------------------------------------------------------------------
 
 // Tooltip for TSStatic