Browse Source

Added cleanup of exec stack for module when it's finished to avoid duplicate executions
Added proper container bracketing for the main menu buttons and made that the main navigation target
Added logic to UINav to prevent needlessly re-setting the root page if it already is the root page, which would break the navigation stack
Added logic to UINav toprevent needlessly adding duplicate pages whicn would break the navigation stack
Added logic to close the chooseLevelDlg page when the level is loaded to avoid the page being left hanging on the nav stack
Fixed assetId for no preview image fallback on the chooseLevelDlg page
Fixed display of icons in the shape editor shape helper section
Fixed name lookup on terrain material editor dialogue which would break saving of terrain materials
Disables TORQUE_SFX_DirectX which is currently not in use and nonfunctional

JeffR 3 years ago
parent
commit
c7763fe3ec

+ 1 - 0
Templates/BaseGame/game/core/utility/scripts/module.tscript

@@ -39,6 +39,7 @@ function callOnModules(%functionName, %moduleGroup, %var0, %var1, %var2, %var3,
    }
    
    ExecFilesList.pop_back(); //cleanup
+   %execArray.delete();
 }
 
 function loadModuleMaterials(%moduleGroup)

+ 2 - 0
Templates/BaseGame/game/data/UI/guis/MainMenuButtons.gui

@@ -1,6 +1,8 @@
 //--- OBJECT WRITE BEGIN ---
 $guiContent = new GuiControl(MainMenuButtons) {
    extent = "1024 768";
+   horizSizing = "width";
+   vertSizing = "height";
    profile = "GuiNonModalDefaultProfile";
    tooltipProfile = "GuiToolTipProfile";
    isContainer = "1";

+ 4 - 4
Templates/BaseGame/game/data/UI/guis/MainMenuButtons.tscript

@@ -11,7 +11,7 @@ function MainMenuButtons::onSleep(%this)
 // set MainMenuButtonList as it's root page. 
 // This is an optional function, but is called as part of the validation that the page
 // CAN be opened, so it's shown here as an example
-function MainMenuButtonList::canOpen(%this)
+function MainMenuButtons::canOpen(%this)
 {
    return true;
 }
@@ -21,7 +21,7 @@ function MainMenuButtonList::canOpen(%this)
 // set MainMenuButtonList as it's root page. 
 // Once the page is added to the MainMenuGUI's UINavigation page stack, onOpen here is called
 // Which allows us to actually do the work we need to do for display
-function MainMenuButtonList::onOpen(%this)
+function MainMenuButtons::onOpen(%this)
 {
    //Here, we set the MainMenuButtonList - a GuiStackControl with the MenuList class
    // to be the active menu list.
@@ -57,13 +57,13 @@ function MainMenuButtonList::onOpen(%this)
 }
 
 //Optional, as the check defaults to true, but here as an example case
-function MainMenuButtonList::canClose(%this)
+function MainMenuButtons::canClose(%this)
 {
    return true;
 }
 
 
-function MainMenuButtonList::onClose(%this)
+function MainMenuButtons::onClose(%this)
 {
 }
 

+ 4 - 2
Templates/BaseGame/game/data/UI/guis/chooseLevelDlg.tscript

@@ -35,7 +35,7 @@ function ChooseLevelDlg::onOpen(%this)
    LevelList.clearRows();
    LevelListEntries.empty();
    
-   ChooseLevelWindow->CurrentPreview.setBitmap("data/ui/images/no-preview");
+   ChooseLevelWindow->CurrentPreview.setBitmap("UI:no_preview_image");
    ChooseLevelWindow->LevelDescriptionLabel.visible = false;
    ChooseLevelWindow->LevelDescription.visible = false;
    
@@ -167,7 +167,7 @@ function LevelList::onChange(%this)
    if (isFile(%levelPreview))
       ChooseLevelWindow->CurrentPreview.setBitmap(%levelPreview);
    else
-      ChooseLevelWindow->CurrentPreview.setBitmap("data/ui/images/no-preview");
+      ChooseLevelWindow->CurrentPreview.setBitmap("UI:no_preview_image");
 
    // Get the description
    %levelDesc = %levelAsset.description;
@@ -193,6 +193,8 @@ function ChooseLevelDlg::beginLevel(%this)
    // So we can't fire the button when loading is in progress.
    if ( isObject( ServerGroup ) )
       return;
+      
+   %this.navigation.popPage();
 
    // Launch the chosen level with the editor open?
    if ( ChooseLevelDlg.launchInEditor )

+ 6 - 7
Templates/BaseGame/game/data/UI/guis/mainMenu.tscript

@@ -24,18 +24,17 @@ function MainMenuGui::onWake(%this)
    //We set up this catch by making said control our first responder, here
    MainMenuInputHandler.setFirstResponder();
    
-   //Lastly, we go ahead and display some actual navigable content up on our main menu here
-   //In this case, we set the MainMenuButtonList as our root page, so we always come back
-   //to having the main menu buttons on screen if every other page is closed.
-   //This will ultimately call MainMenuButtonList::onOpen(), so to see where the navigation
-   //chain continues, see that function.
-   %this.setRootPage(MainMenuButtonList);
-   
    //We also go ahead and mark for any future pages being added to the UINavigation's page stack
    //to be prompted to resize when added. This isn't required, but helps keep pages formated to 
    //the current size of the UINavigation, which is useful when dealing with aspect ratio or resolution
    //changes.
    %this.resizePages = true;
+   //Lastly, we go ahead and display some actual navigable content up on our main menu here
+   //In this case, we set the MainMenuButtons as our root page, so we always come back
+   //to having the main menu buttons on screen if every other page is closed.
+   //This will ultimately call MainMenuButtons::onOpen(), so to see where the navigation
+   //chain continues, see that function.
+   %this.setRootPage(MainMenuButtons);
 }
 
 function MainMenuButtonHolder::onWake(%this)

+ 7 - 0
Templates/BaseGame/game/data/UI/scripts/menuNavigation.tscript

@@ -14,6 +14,9 @@ function UINavigation::setRootPage(%this, %rootPage)
       %this.pageStack = new ArrayObject();  
    }
    
+   if(%this.rootPage $= %rootPage)
+      return;
+   
    if(isObject(%this.rootPage))
    {
       %canClose = true;
@@ -71,6 +74,10 @@ function UINavigation::pushPage(%this, %newPage, %callback)
       %this.pageStack = new ArrayObject();
    }
    
+   //don't re-add pages
+   if(%this.pageStack.getIndexFromKey(%newPage) != -1)
+      return;
+   
    %canChange = true;
    if(%newPage.isMethod("canOpen"))
       %canChange = %newPage.call("canOpen");

+ 4 - 1
Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript

@@ -563,7 +563,10 @@ function ShapeEdSelectWindow::addObjectHint( %this, %type, %name, %desc, %presen
       %ctrl.text = %name;
 
    %ctrl.tooltip = %desc;
-   %ctrl.setBitmap( "tools/editorClasses/gui/images/" @ ( %present ? "iconAccept" : "iconCancel" ) );
+   if(%present)
+      %ctrl.setBitmap( "ToolsModule:iconAccept_image" );
+   else
+      %ctrl.setBitmap( "ToolsModule:iconCancel_image" );
    %ctrl.setStateOn( false );
    %ctrl.resetState();
 

+ 1 - 1
Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.tscript

@@ -640,7 +640,7 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %materialAssetId )
             
    // Read out properties from the dialog.
    
-   %newName = %this-->matNameCtrl.getText(); 
+   %newName = %this-->matNameCtrl.text;
    
    %blankBitmap = AssetDatabase.acquireAsset($TerrainMaterialEditor::emptyMaterialImage).getImagePath();
    

+ 2 - 2
Tools/CMake/torque3d.cmake

@@ -61,8 +61,8 @@ option(TORQUE_ADVANCED_LIGHTING "Advanced Lighting" ON)
 mark_as_advanced(TORQUE_ADVANCED_LIGHTING)
 option(TORQUE_BASIC_LIGHTING "Basic Lighting" ON)
 mark_as_advanced(TORQUE_BASIC_LIGHTING)
-option(TORQUE_SFX_DirectX "DirectX Sound" OFF)
-mark_as_advanced(TORQUE_SFX_DirectX)
+# option(TORQUE_SFX_DirectX "DirectX Sound" OFF)
+# mark_as_advanced(TORQUE_SFX_DirectX)
 option(TORQUE_SFX_OPENAL "OpenAL Sound" ON)
 mark_as_advanced(TORQUE_APP_PASSWORD)
 set(TORQUE_APP_PASSWORD "changeme" CACHE STRING "zip file password")