瀏覽代碼

Merge branch 'TorqueGameEngines:Preview4_0' into SoundFixRandD

Areloch 3 年之前
父節點
當前提交
d778f370fe

+ 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
    ExecFilesList.pop_back(); //cleanup
+   %execArray.delete();
 }
 }
 
 
 function loadModuleMaterials(%moduleGroup)
 function loadModuleMaterials(%moduleGroup)

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

@@ -1,6 +1,8 @@
 //--- OBJECT WRITE BEGIN ---
 //--- OBJECT WRITE BEGIN ---
 $guiContent = new GuiControl(MainMenuButtons) {
 $guiContent = new GuiControl(MainMenuButtons) {
    extent = "1024 768";
    extent = "1024 768";
+   horizSizing = "width";
+   vertSizing = "height";
    profile = "GuiNonModalDefaultProfile";
    profile = "GuiNonModalDefaultProfile";
    tooltipProfile = "GuiToolTipProfile";
    tooltipProfile = "GuiToolTipProfile";
    isContainer = "1";
    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. 
 // set MainMenuButtonList as it's root page. 
 // This is an optional function, but is called as part of the validation that the 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
 // CAN be opened, so it's shown here as an example
-function MainMenuButtonList::canOpen(%this)
+function MainMenuButtons::canOpen(%this)
 {
 {
    return true;
    return true;
 }
 }
@@ -21,7 +21,7 @@ function MainMenuButtonList::canOpen(%this)
 // set MainMenuButtonList as it's root page. 
 // set MainMenuButtonList as it's root page. 
 // Once the page is added to the MainMenuGUI's UINavigation page stack, onOpen here is called
 // 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
 // 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
    //Here, we set the MainMenuButtonList - a GuiStackControl with the MenuList class
    // to be the active menu list.
    // 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
 //Optional, as the check defaults to true, but here as an example case
-function MainMenuButtonList::canClose(%this)
+function MainMenuButtons::canClose(%this)
 {
 {
    return true;
    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();
    LevelList.clearRows();
    LevelListEntries.empty();
    LevelListEntries.empty();
    
    
-   ChooseLevelWindow->CurrentPreview.setBitmap("data/ui/images/no-preview");
+   ChooseLevelWindow->CurrentPreview.setBitmap("UI:no_preview_image");
    ChooseLevelWindow->LevelDescriptionLabel.visible = false;
    ChooseLevelWindow->LevelDescriptionLabel.visible = false;
    ChooseLevelWindow->LevelDescription.visible = false;
    ChooseLevelWindow->LevelDescription.visible = false;
    
    
@@ -167,7 +167,7 @@ function LevelList::onChange(%this)
    if (isFile(%levelPreview))
    if (isFile(%levelPreview))
       ChooseLevelWindow->CurrentPreview.setBitmap(%levelPreview);
       ChooseLevelWindow->CurrentPreview.setBitmap(%levelPreview);
    else
    else
-      ChooseLevelWindow->CurrentPreview.setBitmap("data/ui/images/no-preview");
+      ChooseLevelWindow->CurrentPreview.setBitmap("UI:no_preview_image");
 
 
    // Get the description
    // Get the description
    %levelDesc = %levelAsset.description;
    %levelDesc = %levelAsset.description;
@@ -193,6 +193,8 @@ function ChooseLevelDlg::beginLevel(%this)
    // So we can't fire the button when loading is in progress.
    // So we can't fire the button when loading is in progress.
    if ( isObject( ServerGroup ) )
    if ( isObject( ServerGroup ) )
       return;
       return;
+      
+   %this.navigation.popPage();
 
 
    // Launch the chosen level with the editor open?
    // Launch the chosen level with the editor open?
    if ( ChooseLevelDlg.launchInEditor )
    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
    //We set up this catch by making said control our first responder, here
    MainMenuInputHandler.setFirstResponder();
    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
    //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 
    //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
    //the current size of the UINavigation, which is useful when dealing with aspect ratio or resolution
    //changes.
    //changes.
    %this.resizePages = true;
    %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)
 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();  
       %this.pageStack = new ArrayObject();  
    }
    }
    
    
+   if(%this.rootPage $= %rootPage)
+      return;
+   
    if(isObject(%this.rootPage))
    if(isObject(%this.rootPage))
    {
    {
       %canClose = true;
       %canClose = true;
@@ -71,6 +74,10 @@ function UINavigation::pushPage(%this, %newPage, %callback)
       %this.pageStack = new ArrayObject();
       %this.pageStack = new ArrayObject();
    }
    }
    
    
+   //don't re-add pages
+   if(%this.pageStack.getIndexFromKey(%newPage) != -1)
+      return;
+   
    %canChange = true;
    %canChange = true;
    if(%newPage.isMethod("canOpen"))
    if(%newPage.isMethod("canOpen"))
       %canChange = %newPage.call("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.text = %name;
 
 
    %ctrl.tooltip = %desc;
    %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.setStateOn( false );
    %ctrl.resetState();
    %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.
    // Read out properties from the dialog.
    
    
-   %newName = %this-->matNameCtrl.getText(); 
+   %newName = %this-->matNameCtrl.text;
    
    
    %blankBitmap = AssetDatabase.acquireAsset($TerrainMaterialEditor::emptyMaterialImage).getImagePath();
    %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)
 mark_as_advanced(TORQUE_ADVANCED_LIGHTING)
 option(TORQUE_BASIC_LIGHTING "Basic Lighting" ON)
 option(TORQUE_BASIC_LIGHTING "Basic Lighting" ON)
 mark_as_advanced(TORQUE_BASIC_LIGHTING)
 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)
 option(TORQUE_SFX_OPENAL "OpenAL Sound" ON)
 mark_as_advanced(TORQUE_APP_PASSWORD)
 mark_as_advanced(TORQUE_APP_PASSWORD)
 set(TORQUE_APP_PASSWORD "changeme" CACHE STRING "zip file password")
 set(TORQUE_APP_PASSWORD "changeme" CACHE STRING "zip file password")