Browse Source

- Added Scene (un)pause button.

MelvMay-GG 12 years ago
parent
commit
9889e4e
2 changed files with 36 additions and 1 deletions
  1. 21 1
      modules/Sandbox/1/gui/MainOverlay.gui.taml
  2. 15 0
      modules/Sandbox/1/scripts/toolbox.cs

+ 21 - 1
modules/Sandbox/1/gui/MainOverlay.gui.taml

@@ -19,7 +19,7 @@
         isContainer="0"
         HorizSizing="left"
         VertSizing="bottom"
-        Position="474 0"
+        Position="360 0"
         Extent="100 30"
         MinExtent="8 2"
         canSave="1"
@@ -29,6 +29,26 @@
         groupNum="-1"
         useMouseEvents="1" />		
 
+	<!-- Pause Scene Mode-->
+    <GuiButtonCtrl
+        Name="PauseSceneModeButton"
+        Profile="BlueButtonProfile"
+		Text="(Un)Pause"
+		ButtonType="PushButton"
+        canSaveDynamicFields="0"
+        isContainer="0"
+        HorizSizing="left"
+        VertSizing="bottom"
+        Position="474 0"
+        Extent="100 30"
+        MinExtent="8 2"
+        canSave="1"
+        Visible="1"
+        Active="1"
+        hovertime="1000"
+        groupNum="-1"
+        useMouseEvents="1" />		
+		
 	<!-- Reload Toy-->
     <GuiButtonCtrl
 		Name="ReloadToyOverlayButton"

+ 15 - 0
modules/Sandbox/1/scripts/toolbox.cs

@@ -246,6 +246,21 @@ function ResolutionSelectList::onSelect(%this)
 
 //-----------------------------------------------------------------------------
 
+function PauseSceneModeButton::onClick(%this)
+{
+    // Sanity!
+    if ( !isObject(SandboxScene) )
+    {
+        error( "Cannot pause/unpause the Sandbox scene as it does not exist." );
+        return;
+    }
+    
+    // Toggle the scene pause.
+    SandboxScene.setScenePause( !SandboxScene.getScenePause() );   
+}
+
+//-----------------------------------------------------------------------------
+
 function ReloadToyOverlayButton::onClick(%this)
 {
     // Finish if no toy is loaded.