Browse Source

Merge pull request #260 from thecelloman/removeUshell

Remove unused and (partially) unworking UnifiedShell.
SilentMike 12 năm trước cách đây
mục cha
commit
5094eb5930
37 tập tin đã thay đổi với 6 bổ sung2732 xóa
  1. 0 2
      Templates/Empty/game/core/main.cs
  2. 1 8
      Templates/Empty/game/core/scripts/client/recordings.cs
  3. 0 95
      Templates/Empty/game/core/unifiedShell/GamepadButtonsGui.cs
  4. 0 222
      Templates/Empty/game/core/unifiedShell/GamepadButtonsGui.gui
  5. 0 105
      Templates/Empty/game/core/unifiedShell/MainMenuGui.cs
  6. 0 72
      Templates/Empty/game/core/unifiedShell/MainMenuGui.gui
  7. 0 172
      Templates/Empty/game/core/unifiedShell/ObjectPickerGui.cs
  8. 0 82
      Templates/Empty/game/core/unifiedShell/ObjectPickerGui.gui
  9. 0 380
      Templates/Empty/game/core/unifiedShell/OptionsGui.cs
  10. 0 104
      Templates/Empty/game/core/unifiedShell/OptionsGui.gui
  11. BIN
      Templates/Empty/game/core/unifiedShell/images/gamepad_button_a.png
  12. BIN
      Templates/Empty/game/core/unifiedShell/images/gamepad_button_b.png
  13. BIN
      Templates/Empty/game/core/unifiedShell/images/gamepad_button_x.png
  14. BIN
      Templates/Empty/game/core/unifiedShell/images/gamepad_button_y.png
  15. BIN
      Templates/Empty/game/core/unifiedShell/images/listMenuArray.png
  16. 0 40
      Templates/Empty/game/core/unifiedShell/main.cs
  17. 0 79
      Templates/Empty/game/core/unifiedShell/profiles.cs
  18. 2 4
      Templates/Empty/game/scripts/client/init.cs
  19. 0 2
      Templates/Full/game/core/main.cs
  20. 1 8
      Templates/Full/game/core/scripts/client/recordings.cs
  21. 0 95
      Templates/Full/game/core/unifiedShell/GamepadButtonsGui.cs
  22. 0 222
      Templates/Full/game/core/unifiedShell/GamepadButtonsGui.gui
  23. 0 105
      Templates/Full/game/core/unifiedShell/MainMenuGui.cs
  24. 0 72
      Templates/Full/game/core/unifiedShell/MainMenuGui.gui
  25. 0 172
      Templates/Full/game/core/unifiedShell/ObjectPickerGui.cs
  26. 0 82
      Templates/Full/game/core/unifiedShell/ObjectPickerGui.gui
  27. 0 380
      Templates/Full/game/core/unifiedShell/OptionsGui.cs
  28. 0 104
      Templates/Full/game/core/unifiedShell/OptionsGui.gui
  29. BIN
      Templates/Full/game/core/unifiedShell/images/gamepad_button_a.png
  30. BIN
      Templates/Full/game/core/unifiedShell/images/gamepad_button_b.png
  31. BIN
      Templates/Full/game/core/unifiedShell/images/gamepad_button_x.png
  32. BIN
      Templates/Full/game/core/unifiedShell/images/gamepad_button_y.png
  33. BIN
      Templates/Full/game/core/unifiedShell/images/listMenuArray.png
  34. 0 40
      Templates/Full/game/core/unifiedShell/main.cs
  35. 0 79
      Templates/Full/game/core/unifiedShell/profiles.cs
  36. 2 4
      Templates/Full/game/scripts/client/init.cs
  37. 0 2
      Templates/Full/game/scripts/client/serverConnection.cs

+ 0 - 2
Templates/Empty/game/core/main.cs

@@ -75,8 +75,6 @@ function onStart()
    exec("./scripts/client/core.cs");
    initializeCore();
 
-   exec("./unifiedShell/main.cs");
-
    exec("./scripts/client/client.cs");
    exec("./scripts/server/server.cs");
    

+ 1 - 8
Templates/Empty/game/core/scripts/client/recordings.cs

@@ -129,14 +129,7 @@ function demoPlaybackComplete()
    // handling functionality.
    clientEndMission();
 
-   if ( $UseUnifiedShell )
-   {
-      if (isObject( UnifiedMainMenuGui ))
-         Canvas.setContent( UnifiedMainMenuGui );
-      else if (isObject( MainMenuGui ))
-         Canvas.setContent( MainMenuGui );
-   }
-   else if (isObject( MainMenuGui ))
+   if (isObject( MainMenuGui ))
       Canvas.setContent( MainMenuGui );
 
    Canvas.pushDialog(RecordingsDlg);

+ 0 - 95
Templates/Empty/game/core/unifiedShell/GamepadButtonsGui.cs

@@ -1,95 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// global vars
-//------------------------------------------------------------------------------
-
-$BUTTON_A   =  0;
-$BUTTON_B   =  1;
-$BUTTON_X   =  2;
-$BUTTON_Y   =  3;
-
-//------------------------------------------------------------------------------
-// GamepadButtonsGui methods
-//------------------------------------------------------------------------------
-
-/// Callback when this control wakes up. All buttons are set to invisible and
-/// disabled.
-function GamepadButtonsGui::onWake(%this)
-{
-   %this.setButton($BUTTON_A);
-   %this.setButton($BUTTON_B);
-   %this.setButton($BUTTON_X);
-   %this.setButton($BUTTON_Y);
-}
-
-/// Sets the command and text for the specified button. If %text and %command
-/// are left empty, the button will be disabled and hidden.
-/// Note: This command is not executed when the A button is pressed. That
-/// command is executed directly from the GuiGameList___Ctrl. This command is
-/// for the graphical hint and to allow a mouse equivalent.
-///
-/// \param %button (constant) The button to set. See: $BUTTON_A, _B, _X, _Y
-/// \param %text (string) The text to display next to the A button graphic.
-/// \param %command (string) The command executed when the A button is pressed.
-function GamepadButtonsGui::setButton(%this, %button, %text, %command)
-{
-   switch (%button)
-   {
-      case $BUTTON_A :
-         %labelCtrl = ButtonALabel;
-         %buttonCtrl = ButtonAButton;
-         %imgCtrl = ButtonAImg;
-
-      case $BUTTON_B :
-         %labelCtrl = ButtonBLabel;
-         %buttonCtrl = ButtonBButton;
-         %imgCtrl = ButtonBImg;
-
-      case $BUTTON_X :
-         %labelCtrl = ButtonXLabel;
-         %buttonCtrl = ButtonXButton;
-         %imgCtrl = ButtonXImg;
-
-      case $BUTTON_Y :
-         %labelCtrl = ButtonYLabel;
-         %buttonCtrl = ButtonYButton;
-         %imgCtrl = ButtonYImg;
-
-      default:
-         error("GamepadButtonsGui::setButton(" @ %button @ ", " @ %text @ ", " @ %command @ "). No valid button was specified. Please pass one of the $BUTTON_ globals for this parameter.");
-         return "";
-   }
-
-   %set = (! ((%text $= "") && (%command $= "")));
-   %labelCtrl.setText(%text);
-   %labelCtrl.setActive(%set);
-   %labelCtrl.setVisible(%set);
-
-   %buttonCtrl.Command = %command;
-   %buttonCtrl.setActive(%set);
-   %buttonCtrl.setVisible(%set);
-
-   %imgCtrl.setActive(%set);
-   %imgCtrl.setVisible(%set);
-}

+ 0 - 222
Templates/Empty/game/core/unifiedShell/GamepadButtonsGui.gui

@@ -1,222 +0,0 @@
-//------------------------------------------------------------------------------
-// Torque        Engine
-// Copyright (C) GarageGames.com, Inc.
-//------------------------------------------------------------------------------
-
-//--- OBJECT WRITE BEGIN ---
-%guiContent = new GuiControl(GamepadButtonsGui) {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GamepadDefaultProfile";
-   HorizSizing = "center";
-   VertSizing = "center";
-   position = "0 0";
-   Extent = "464 112";
-   MinExtent = "8 2";
-   canSave = "1";
-   Visible = "1";
-   hovertime = "1000";
-
-   new GuiBitmapCtrl(ButtonBImg) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "left";
-      VertSizing = "relative";
-      position = "416 16";
-      Extent = "32 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = "core/unifiedShell/images/gamepad_button_b";
-      wrap = "0";
-   };
-   new GuiTextCtrl(ButtonBLabel) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadButtonTextRight";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "248 16";
-      Extent = "160 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button B Label";
-      maxLength = "1024";
-   };
-   new GuiButtonBaseCtrl(ButtonBButton) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "248 16";
-      Extent = "200 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button";
-      groupNum = "-1";
-      buttonType = "PushButton";
-      useMouseEvents = "0";
-   };
-   new GuiBitmapCtrl(ButtonAImg) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "left";
-      VertSizing = "relative";
-      position = "400 64";
-      Extent = "32 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = "core/unifiedShell/images/gamepad_button_a";
-      wrap = "0";
-   };
-   new GuiTextCtrl(ButtonALabel) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadButtonTextRight";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "232 64";
-      Extent = "160 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button B Label";
-      maxLength = "1024";
-   };
-   new GuiButtonBaseCtrl(ButtonAButton) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "232 64";
-      Extent = "200 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button";
-      groupNum = "-1";
-      buttonType = "PushButton";
-      useMouseEvents = "0";
-   };
-   new GuiBitmapCtrl(ButtonXImg) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "right";
-      VertSizing = "relative";
-      position = "32 64";
-      Extent = "32 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = "core/unifiedShell/images/gamepad_button_x";
-      wrap = "0";
-   };
-   new GuiTextCtrl(ButtonXLabel) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadButtonTextLeft";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "72 64";
-      Extent = "160 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button X Label";
-      maxLength = "1024";
-   };
-   new GuiButtonBaseCtrl(ButtonXButton) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "32 64";
-      Extent = "200 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button";
-      groupNum = "-1";
-      buttonType = "PushButton";
-      useMouseEvents = "0";
-   };
-   new GuiBitmapCtrl(ButtonYImg) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "right";
-      VertSizing = "relative";
-      position = "16 16";
-      Extent = "32 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = "core/unifiedShell/images/gamepad_button_y";
-      wrap = "0";
-   };
-   new GuiTextCtrl(ButtonYLabel) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadButtonTextLeft";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "55 16";
-      Extent = "164 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button Y Label";
-      maxLength = "1024";
-   };
-   new GuiButtonBaseCtrl(ButtonYButton) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "16 16";
-      Extent = "208 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button";
-      groupNum = "-1";
-      buttonType = "PushButton";
-      useMouseEvents = "0";
-   };
-};
-//--- OBJECT WRITE END ---

+ 0 - 105
Templates/Empty/game/core/unifiedShell/MainMenuGui.cs

@@ -1,105 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// ListMenu methods
-//------------------------------------------------------------------------------
-
-/// Callback when this gui is added to the sim.
-function ListMenu::onAdd(%this)
-{
-   %this.addRow("Play Game", "onSinglePlayer", 0);
-
-   // Defunct for now
-   //%this.addRow("Select Model", "onSelectModel", 4, -15);
-
-   // No need for video options on Xbox 360
-   if ( $platform $= "xenon" )
-      %this.addRow("Exit Game", "onQuit", 4, -15);
-   else
-   {
-      %this.addRow("Setup", "onOptions", 4, -15);
-      %this.addRow("Exit Game", "onQuit", 6, -15);
-   }
-}
-
-//------------------------------------------------------------------------------
-// MainMenuButtonHolder methods
-//------------------------------------------------------------------------------
-
-function MainMenuButtonHolder::onWake(%this)
-{
-   %this.add(GamepadButtonsGui);
-
-   GamepadButtonsGui.setButton($BUTTON_A, "Go", ListMenu.CallbackOnA);
-}
-
-//------------------------------------------------------------------------------
-// global methods
-//------------------------------------------------------------------------------
-
-/// Callback from the shell button for triggering single player.
-function onSinglePlayer()
-{
-   echo("Default implementation. Override onSinglePlayer() to add game specific functionality");
-
-   if ( isObject( LoadingGui ) )
-   {
-      Canvas.setContent("LoadingGui");
-      LoadingProgress.setValue(1);
-      LoadingProgressTxt.setValue("LOADING MISSION FILE");
-      Canvas.repaint();
-   }
-   
-   // Grab the specified default level
-   %mission = $DefaultLevelFile;
-
-   // If the default level isn't loaded attempt a fallback
-   if ( %mission $= "" )
-      %mission = "levels/default.mis";
-
-   %serverType = $AutoLoadLevelMode;
-
-   if ( %serverType $= "" )
-      %serverType = "SinglePlayer";
-
-   createAndConnectToLocalServer( %serverType, %mission );
-}
-
-/// Callback from the shell button to bring up the object picker.
-function onSelectModel()
-{
-   Canvas.setContent(ObjectPickerGui);
-}
-
-/// Callback from the shell button to bring up the options gui.
-function onOptions()
-{
-   Canvas.setContent(OptionsGui);
-}
-
-/// Callback from the shell "quit" button.
-function onQuit()
-{
-   echo("Default implementation. Override onQuit() to add game specific functionality");
-   quit();
-}

+ 0 - 72
Templates/Empty/game/core/unifiedShell/MainMenuGui.gui

@@ -1,72 +0,0 @@
-//------------------------------------------------------------------------------
-// Torque        Engine
-// Copyright (C) GarageGames.com, Inc.
-//------------------------------------------------------------------------------
-
-//--- OBJECT WRITE BEGIN ---
-%guiContent = singleton GuiChunkedBitmapCtrl(UnifiedMainMenuGui) {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GuiContentProfile";
-   HorizSizing = "width";
-   VertSizing = "height";
-   Position = "0 0";
-   Extent = "800 600";
-   MinExtent = "8 8";
-   canSave = "1";
-   Visible = "1";
-   tooltipprofile = "GuiToolTipProfile";
-   hovertime = "1000";
-   bitmap = "art/gui/background";
-   useVariable = "0";
-   tile = "0";
-   
-  new GuiControl() {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GuiDefaultProfile";
-   HorizSizing = "center";
-   VertSizing = "center";
-   position = "0 0";
-   Extent = "640 480";
-   MinExtent = "8 8";
-   canSave = "1";
-   Visible = "1";
-   hovertime = "1000";
-   
-	   new GuiControl(MainMenuButtonHolder) {
-		  canSaveDynamicFields = "0";
-		  Enabled = "1";
-		  isContainer = "1";
-		  Profile = "GamepadDefaultProfile";
-		  HorizSizing = "center";
-		  VertSizing = "bottom";
-		  position = "88 340";
-		  Extent = "464 112";
-		  MinExtent = "8 2";
-		  canSave = "1";
-		  Visible = "1";
-		  hovertime = "1000";
-	   };
-
-	   singleton GuiGameListMenuCtrl(ListMenu) {
-		  canSaveDynamicFields = "0";
-		  isContainer = "0";
-		  Profile = "DefaultListMenuProfile";
-		  HorizSizing = "center";
-		  VertSizing = "bottom";
-		  position = "160 64";
-		  Extent = "320 240";
-		  MinExtent = "8 2";
-		  canSave = "1";
-		  Visible = "1";
-		  hovertime = "1000";
-		  CallbackOnA = "ListMenu.activateRow();";
-		  DebugRender = false;
-	   };
-	   
-   };
-};
-//--- OBJECT WRITE END ---

+ 0 - 172
Templates/Empty/game/core/unifiedShell/ObjectPickerGui.cs

@@ -1,172 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// global vars
-//------------------------------------------------------------------------------
-
-$PICKER::ROW_OBJECT  =  0; ///< The row used to pick ojbects
-$PICKER::ROW_MOUNT   =  1; ///< The row used to pick the mounted object
-
-$PICKER::MODEL["Default"]   =  getWorkingDirectory() @ "/art/shapes/players/SpaceOrc/SpaceOrc.dts";
-
-$PICKER::WEAPON["Default"]  = getWorkingDirectory() @ "/art/shapes/weapons/SwarmGun/swarmgun.dts";
-$PICKER::WEAPON["Rocket Launcher"] = getWorkingDirectory() @ "/art/shapes/weapons/SwarmGun/swarmgun.dts";
-
-//------------------------------------------------------------------------------
-// PickerMenu methods
-//------------------------------------------------------------------------------
-
-/// Callback when this gui is added to the sim.
-function PickerMenu::onAdd(%this)
-{
-   %this.addRow("Model", "Default", true, "onModelChange");
-   %this.addRow("Weapon", "Default", true, "onMountChange");
-}
-
-/// Callback when the control wakes up.
-function PickerMenu::onWake(%this)
-{
-   // For now PlayerDatasGroup is currently being populated
-   // by loadPlayerPickerData() which is implemented in
-   // <$defaultGame>/client/init.cs
-      
-   %this.modelList = "";
-   
-   if (isObject(PlayerDatasGroup))
-   {
-      for (%i = 0; %i < PlayerDatasGroup.getCount(); %i++)
-      {
-         %obj = PlayerDatasGroup.getObject(%i);
-         %name = %obj.getName();
-         
-         %name = strreplace(%name, "Data", "");
-         echo(%name);
-         $PICKER::MODEL[%name]   =  %obj.shapeFile;
-         
-         %this.modelList = %this.modelList @ %name @ "\t";
-      }
-   }
-   
-   %this.setOptions($PICKER::ROW_OBJECT, %this.modelList);
-
-   %this.setOptions($PICKER::ROW_MOUNT, "Default\tRocket Launcher");
-
-   // Initialize the currently selected object here
-   if ($pref::Player:PlayerDB $= "")
-      $pref::Player:PlayerDB = getField(%this.modelList, 0) @ "Data";
-      
-   %db = strreplace($pref::Player:PlayerDB, "Data", "");
-
-   //PickerObjectView.setModel($PICKER::MODEL[%db]);
-   
-   if ($pref::Player:Weapon $= "")
-      $pref::Player:Weapon = "Default";
-
-   
-   PickerObjectView.setMount($PICKER::WEAPON[$pref::Player:Weapon],0);
-   PickerObjectView.setOrbitDistance(3);
-   
-   %this.selectOption($PICKER::ROW_OBJECT, %db);
-   %this.selectOption($PICKER::ROW_MOUNT, $pref::Player:Weapon);
-}
-
-function PickerMenu::setPlayer(%this)
-{
-   %selected = PickerMenu.getCurrentOption($PICKER::ROW_OBJECT);
-   
-   if (%selected $= "Default")
-      %selected = "DefaultPlayer";
-   
-   $pref::Player:PlayerDB = %selected @ "Data";
-
-   %selected = PickerMenu.getCurrentOption($PICKER::ROW_MOUNT);
-   
-   $pref::Player:Weapon = %selected;
-   
-   Canvas.setContent(UnifiedMainMenuGui);
-}
-
-//------------------------------------------------------------------------------
-// callbacks from PickerMenu
-//------------------------------------------------------------------------------
-
-/// Callback when the primary object model is changed.
-///
-/// \param %direction (string) "LEFT" or "RIGHT" indicating the direction the
-/// option changed.
-function onModelChange(%direction)
-{
-   %selected = PickerMenu.getCurrentOption($PICKER::ROW_OBJECT);
-   PickerObjectView.setModel($PICKER::MODEL[%selected]);
-   PickerObjectView.setOrbitDistance(3);
-   PickerInfoDisplay.update();
-}
-
-/// Callback when the mounted object model is changed.
-///
-/// \param %direction (string) "LEFT" or "RIGHT" indicating the direction the
-/// option changed.
-function onMountChange(%direction)
-{
-   %selected = PickerMenu.getCurrentOption($PICKER::ROW_MOUNT);
-   PickerObjectView.setMount($PICKER::WEAPON[%selected],0);
-   $pref::Player:Weapon = %selected;
-   
-   PickerInfoDisplay.update();
-}
-
-//------------------------------------------------------------------------------
-// PickerInfoDisplay methods
-//------------------------------------------------------------------------------
-
-/// Updates the information display to show information about the currently
-/// selected objects.
-function PickerInfoDisplay::update(%this)
-{
-   %objectName = PickerMenu.getCurrentOption($PICKER::ROW_OBJECT);
-   %mountName = PickerMenu.getCurrentOption($PICKER::ROW_MOUNT);
-   %this.setText("");
-   %this.addText("<color:666666><tab:80>", false);
-   %this.addText("Selected Objects<br>", false);
-   %this.addText("Object:" TAB %objectName @ "<br>", false);
-   %this.addText("Mounted Object:" TAB %mountName @ "<br>", false);
-   %this.forceReflow();
-}
-
-/// Callback when this control wakes up
-function PickerInfoDisplay::onWake(%this)
-{
-   %this.update();
-}
-
-//------------------------------------------------------------------------------
-// PickerButtonHolder methods
-//------------------------------------------------------------------------------
-
-function PickerButtonHolder::onWake(%this)
-{
-   %this.add(GamepadButtonsGui);
-
-   GamepadButtonsGui.setButton($BUTTON_A, "Accept", PickerMenu.CallbackOnA);
-   GamepadButtonsGui.setButton($BUTTON_B, "Go Back", PickerMenu.CallbackOnB);
-}

+ 0 - 82
Templates/Empty/game/core/unifiedShell/ObjectPickerGui.gui

@@ -1,82 +0,0 @@
-//------------------------------------------------------------------------------
-// Torque        Engine
-// Copyright (C) GarageGames.com, Inc.
-//------------------------------------------------------------------------------
-
-//--- OBJECT WRITE BEGIN ---
-%guiContent = new GuiControl(ObjectPickerGui) {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GuiDefaultProfile";
-   HorizSizing = "width";
-   VertSizing = "height";
-   position = "0 0";
-   Extent = "640 480";
-   MinExtent = "8 8";
-   canSave = "1";
-   Visible = "1";
-   hovertime = "1000";
-
-   new GuiBitmapCtrl(PickerBackground) {
-      canSaveDynamicFields = "1";
-      isContainer = "0";
-      Profile = "GuiDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "0 0";
-      Extent = "640 480";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = getWorkingDirectory() @ "/art/skies/skybox_1.jpg";
-      wrap = "0";
-   };
-   new GuiGameListOptionsCtrl(PickerMenu) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "DefaultOptionsMenuProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "20 185";
-      Extent = "320 186";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      CallbackOnA = "PickerMenu.setPlayer();";
-      CallbackOnB = "Canvas.setContent(UnifiedMainMenuGui);";
-      hovertime = "1000";
-      DebugRender = false;
-   };
-   new GuiMLTextCtrl(PickerInfoDisplay) {
-      Profile = "GuiDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "350 185";
-      Extent = "240 56";
-   };
-   new GuiObjectView(PickerObjectView) {
-      Profile = "GuiDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "230 0";
-      Extent = "180 180";
-   };
-   new GuiControl(PickerButtonHolder) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "1";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "center";
-      VertSizing = "top";
-      position = "88 368";
-      Extent = "464 112";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-   };
-};
-//--- OBJECT WRITE END ---

+ 0 - 380
Templates/Empty/game/core/unifiedShell/OptionsGui.cs

@@ -1,380 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// global vars
-//------------------------------------------------------------------------------
-
-$OPTIONS_MENU::NO_DEVICE      = -1; ///< Indicates there is no specified device
-$OPTIONS_MENU::ROW_GFXDEVICE  = 0;  ///< Row to choose gfx device
-$OPTIONS_MENU::ROW_GFXRES     = 1;  ///< Row to choose gfx resolution
-$OPTIONS_MENU::ROW_FULLSCREEN = 2;  ///< Row to choose fullscreen or not
-$OPTIONS_MENU::ROW_VOLUME     = 3;  ///< Row to set audio volume
-$OPTIONS_MENU::ROW_AA         = 4;  ///< Row to set AA
-
-//------------------------------------------------------------------------------
-// OptionsMenu methods
-//------------------------------------------------------------------------------
-
-/// Callback when this gui is added to the sim.
-function OptionsMenu::onAdd(%this)
-{
-   %deviceList = %this.getGfxDeviceList();
-   %this.addRow("Adapter", %deviceList, true, "onGfxDeviceChange", 0, 0, false);
-
-   %resList = %this.getGfxResList(isFullScreen());
-   %this.addRow("Resolution", %resList, false, "", 0, -15);
-
-   %yesNoList = "Yes\tNo";
-   %this.addRow("Fullscreen", %yesNoList, true, "onFullscreenChange", 0, -15);
-
-   %volumeList = %this.getSfxVolumeList();
-   %this.addRow("Volume", %volumeList, false, "onVolumeChange", 0, -15, false);
-   
-   %aaList = %this.getAAList();
-   %this.addRow("Antialias", %aaList, false, "", 0, -15);
-}
-
-/// Callback when the control wakes up.
-function OptionsMenu::onWake(%this)
-{
-   %this.loadPrefs();
-}
-
-/// Initializes each row on this control to reflect the state of saved prefs.
-function OptionsMenu::loadPrefs(%this)
-{
-   // init the display adapter chooser
-   %this.selectOption($OPTIONS_MENU::ROW_GFXDEVICE, $pref::Video::displayDevice);
-   OptionsInfoDisplay.displayGfxDevice();
-
-   // init the display resolution chooser
-   %currRes = getWords($pref::Video::mode, $WORD::RES_X, $WORD::RES_Y);
-   %this.selectOption($OPTIONS_MENU::ROW_GFXRES, %currRes);
-
-   // init the fullscreen chooser
-   %fullscreen = (isFullScreen()) ? "Yes" : "No";
-   %this.selectOption($OPTIONS_MENU::ROW_FULLSCREEN, %fullscreen);
-
-   // init the master volume
-   %volume = mRoundByFive($pref::Audio::masterVolume * 100);
-   %this.selectOption($OPTIONS_MENU::ROW_VOLUME, %volume);
-      
-   %currAA = getWord($pref::Video::mode, $WORD::AA);      
-   %this.selectOption($OPTIONS_MENU::ROW_AA, %currAA);
-}
-
-/// Gets a tab separated list of all the graphics devices available. The list
-/// will not include the null device by default but you may request to have the
-/// null device included. Devices are listed by type.
-///
-/// \param %includeNull (bool) [optional] Specify true to include the null
-/// device in the list. Default is false.
-/// \return (string) A tab separated list of the avilable graphics devices.
-function OptionsMenu::getGfxDeviceList(%this, %includeNull)
-{
-   %count = GFXInit::getAdapterCount();
-   %list = "";
-   for (%i = 0; %i < %count; %i++)
-   {
-      %type = GFXInit::getAdapterType(%i);
-      if ((%includeNull) || (%type !$= "NullDevice"))
-      {
-         %list = %list TAB %type;
-      }
-   }
-   return trim(%list);
-}
-
-/// Gets a tab separated list of available graphics resolutions. The resolutions
-/// will be those available for the settings currently shown on the options
-/// screen.
-///
-/// \param %fullscreen (bool) Specify true to get a list of all resolutions or
-/// false to prune out resolutions that won't fit nicely on the desktop.
-/// \return (string) A tab separated list of available graphics resolutions.
-function OptionsMenu::getGfxResList(%this, %fullscreen)
-{
-   %type = %this.getCurrentOption($OPTIONS_MENU::ROW_GFXDEVICE);
-   %adapter = getGfxDeviceIndex(%type);
-
-   %deskRes = getDesktopResolution();
-   %deskResX = firstWord(%deskRes);
-   %deskResY = getWord(%deskRes, 1);
-
-   %list = "";
-   %count = GFXInit::getAdapterModeCount(%adapter);
-   for (%i = 0; %i < %count; %i++)
-   {
-      %rawRes = GFXInit::getAdapterMode(%adapter, %i);
-      %resX = firstWord(%rawRes);
-      %resY = getWord(%rawRes, 1);
-      if (%fullscreen || ((%resX < %deskResX) && (%resY < %deskResY)))
-      {
-         %res = %resX SPC %resY;
-         if (! listHasElement(%list, %res))
-         {
-            %list = %list TAB %res;
-         }
-      }
-   }
-
-   return trim(%list);
-}
-
-/// Refreshes the list of resolutions on the control taking into account the
-/// displayed settings for device and fullscreen.
-function OptionsMenu::refreshResolutions(%this)
-{
-   %oldRes = %this.getCurrentOption($OPTIONS_MENU::ROW_GFXRES);
-   %fullscreen = (%this.getCurrentOption($OPTIONS_MENU::ROW_FULLSCREEN) $= "Yes");
-   %newResList = %this.getGfxResList(%fullscreen);
-   %this.setOptions($OPTIONS_MENU::ROW_GFXRES, %newResList);
-   %this.selectOption($OPTIONS_MENU::ROW_GFXRES, %oldRes);
-}
-
-/// Builds a list of volume increments suitable for listing on the volume
-/// control. List will be from 0 to 100, incrementing by 5.
-function OptionsMenu::getSfxVolumeList(%this)
-{
-   %start = 0;
-   %end = 100;
-   %inc = 5;
-
-   %list = "";
-   for (%i = %start; %i <= %end; %i += %inc)
-   {
-      %list = %list TAB %i;
-   }
-
-   return trim(%list);
-}
-
-function OptionsMenu::getAAList(%this)
-{
-   %type = %this.getCurrentOption($OPTIONS_MENU::ROW_GFXDEVICE);
-   %adapter = getGfxDeviceIndex(%type);
-
-   %list = "";
-   %count = GFXInit::getAdapterModeCount(%adapter);
-   %maxAA = 0;
-   for (%i = 0; %i < %count; %i++)
-   {
-      %rawRes = GFXInit::getAdapterMode(%adapter, %i);       
-      %aa = getWord(%rawRes, $WORD::AA);
-      if (%aa > %maxAA)
-         %maxAA = %aa;
-   }
-   
-   %list = "";
-   for (%i = 0; %i <= %maxAA; %i++)
-   {
-      %list = %list TAB %i;
-   }
-   return trim(%list);
-}
-
-//------------------------------------------------------------------------------
-// OptionsButtonHolder methods
-//------------------------------------------------------------------------------
-
-function OptionsButtonHolder::onWake(%this)
-{
-   %this.add(GamepadButtonsGui);
-
-   GamepadButtonsGui.setButton($BUTTON_A, "Apply Changes", OptionsMenu.CallbackOnA);
-   GamepadButtonsGui.setButton($BUTTON_B, "Go Back", OptionsMenu.CallbackOnB);
-   GamepadButtonsGui.setButton($BUTTON_Y, "Revert Options", OptionsMenu.CallbackOnY);
-}
-
-//------------------------------------------------------------------------------
-// OptionsInfoDisplay methods
-//------------------------------------------------------------------------------
-
-/// Updates the control to display information on the display device selected on
-/// the control for choosing a display device.
-function OptionsInfoDisplay::displayGfxDevice(%this)
-{
-   %type = OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_GFXDEVICE);
-   %index = getGfxDeviceIndex(%type);
-   if (%index != $OPTIONS_MENU::NO_DEVICE)
-   {
-      %name = GFXInit::getAdapterName(%index);
-      %shader = GFXInit::getAdapterShaderModel(%index);
-   }
-   else
-   {
-      %name = "<spush><color:ff0000>No valid device of that type<spop>";
-      %shader = "<spush><color:ff0000>NA<spop>";
-   }
-   %this.setText("");
-   %this.addText("<color:666666><tab:80>", false);
-   %this.addText("Graphics Device<br>", false);
-   %this.addText("Type:" TAB %type @ "<br>", false);
-   %this.addText("Device:" TAB %name @ "<br>", false);
-   %this.addText("Shader:" TAB %shader @ "<br>", false);
-   %this.forceReflow();
-}
-
-//------------------------------------------------------------------------------
-// callbacks from OptionsMenu
-//------------------------------------------------------------------------------
-
-/// Callback when the graphics device is changed. This will refresh the lists of
-/// resolutions and other related settings.
-///
-/// \param %direction (string) "LEFT" or "RIGHT" indicating the direction the
-/// option changed.
-function onGfxDeviceChange(%direction)
-{
-   OptionsInfoDisplay.displayGfxDevice();
-   $ThisControl.refreshResolutions();
-}
-
-/// Callback when the fullscreen setting is changed. Refreshes the list of
-/// resolutions to reflect what is available.
-///
-/// \param %direction (string) "LEFT" or "RIGHT" indicating the direction the
-/// option changed.
-function onFullscreenChange(%direction)
-{
-   $ThisControl.refreshResolutions();
-}
-
-/// Callback when the volume setting is changed.
-///
-/// \param %direction (string) "LEFT" or "RIGHT" indicating the direction the
-/// option changed.
-function onVolumeChange(%direction)
-{
-   %volume = (OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_VOLUME) / 100);
-   sfxSetMasterVolume(%volume);
-   // TODO: play sample audio blip for user feedback
-}
-
-//------------------------------------------------------------------------------
-// global methods
-//------------------------------------------------------------------------------
-
-/// Applies the options that have been set.
-function applyOptions()
-{
-   // set the audio options
-   %rawVolume = OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_VOLUME);
-   $pref::Audio::masterVolume = %rawVolume / 100;
-
-   // set the new video mode.
-   %newRes = OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_GFXRES);
-   %newFs = (OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_FULLSCREEN) $= "Yes");
-   %newBpp = "32";
-   %rate = getWord($pref::Video::mode, $WORD::REFRESH);
-   %aa = OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_AA);
-
-   // even though pref is set by "setVideoMode" we must set it here to handle
-   // the case of a restart to apply new driver settings
-   $pref::Video::mode = %newRes SPC %newFs SPC %newBpp SPC %rate SPC %aa;
-   
-   // check if Torque will require a restart for the new driver
-   %oldDriver = $pref::Video::displayDevice;
-   $pref::Video::displayDevice = OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_GFXDEVICE);
-   if (%oldDriver !$= $pref::Video::displayDevice)
-   {
-      MessageBoxOKCancel("Change Video Device Now?",
-         "Changing your video device requires Torque to be restarted. Selecting \"Ok\" will restart Torque with the new settings. Selecting \"Cancel\" will keep the new video settings and apply them next time you restart Torque.",
-         "restartInstance();", "");
-   }
-
-   $pref::Video::mode = %newRes SPC %newFs SPC %newBpp SPC %rate SPC %aa;
-   configureCanvas();
-}
-
-/// Reverts all options to the saved preferences.
-function revertOptions()
-{
-   OptionsMenu.loadPrefs();
-}
-
-/// Looks up the system index of the gfx device from the type.
-///
-/// \param %type (string) A string representing the system type of the adapter.
-/// \return (int) The index of the adapter if it is found or if there is no
-/// device with that type it returns $OPTIONS_MENU::NO_DEVICE
-function getGfxDeviceIndex(%type)
-{
-   %count = GFXInit::getAdapterCount();
-   for (%i = 0; %i < %count; %i++)
-   {
-      %otherType = GFXInit::getAdapterType(%i);
-      if (%type $= %otherType)
-      {
-         return %i;
-      }
-   }
-
-   return $OPTIONS_MENU::NO_DEVICE;
-}
-
-/// Determines if the list contains the given element.
-///
-/// \return (bool) True if the element is found in the list, false if it is not.
-function listHasElement(%list, %element)
-{
-   %count = getFieldCount(%list);
-   for (%i = 0; %i < %count; %i++)
-   {
-      %word = getField(%list, %i);
-      if (%word $= %element)
-      {
-         return true;
-      }
-   }
-
-   return false;
-}
-
-/// Rounds %n to the nearest whole integer ending in a multiple of five.
-///
-/// \param %n (int or float) The number to round.
-/// \return (int) %n rounded to the nearest multiple of five.
-function mRoundByFive(%n)
-{
-   return (mFloor((%n + 2.5) / 5) * 5);
-}
-
-/// Determines if the saved preferences indicate running in fullscreen mode.
-///
-/// \return (bool) True if the preferences are saved to run in fullscreen or
-/// false if saved to run windowed.
-function isFullScreen()
-{
-   %fullscreen = getWord($pref::Video::mode, $WORD::FULLSCREEN);
-   return (%fullscreen $= "true");
-}
-
-/// Sets the preference for fullscreen to the indicated value.
-///
-/// \param %bool (bool) Specify true to set the preference to fullscreen, false
-/// to set it to windowed.
-function setFullScreen(%bool)
-{
-   $pref::Video::resolution = setWord($pref::Video::mode, $WORD::FULLSCREEN, (%bool ? "true" : "false"));
-}

+ 0 - 104
Templates/Empty/game/core/unifiedShell/OptionsGui.gui

@@ -1,104 +0,0 @@
-//------------------------------------------------------------------------------
-// Torque        Engine
-// Copyright (C) GarageGames.com, Inc.
-//------------------------------------------------------------------------------
-
-//--- OBJECT WRITE BEGIN ---
-%guiContent = new GuiControl(OptionsGui) {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GuiDefaultProfile";
-   HorizSizing = "width";
-   VertSizing = "height";
-   position = "0 0";
-   Extent = "640 480";
-   MinExtent = "8 8";
-   canSave = "1";
-   Visible = "1";
-   hovertime = "1000";
-
-   new GuiMLTextCtrl(OptionsInfoDisplay) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GuiDefaultProfile";
-      HorizSizing = "center";
-      VertSizing = "bottom";
-      position = "160 25";
-      Extent = "320 70";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      lineSpacing = "2";
-      allowColorChars = "0";
-      maxChars = "-1";
-   };
-   new GuiBitmapCtrl(OptionsMenuBackground) {
-      canSaveDynamicFields = "1";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GuiDefaultProfile";
-      HorizSizing = "width";
-      VertSizing = "height";
-      position = "0 0";
-      Extent = "640 480";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = getWorkingDirectory() @ "/art/skies/skybox_1.jpg";
-      wrap = "0";
-   };
-   
-  new GuiControl() {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GuiDefaultProfile";
-   HorizSizing = "center";
-   VertSizing = "center";
-   position = "0 0";
-   Extent = "640 480";
-   MinExtent = "8 8";
-   canSave = "1";
-   Visible = "1";
-   hovertime = "1000";
-
-	   new GuiControl(OptionsButtonHolder) {
-		  canSaveDynamicFields = "0";
-		  Enabled = "1";
-		  isContainer = "1";
-		  Profile = "GamepadDefaultProfile";
-		  HorizSizing = "center";
-		  VertSizing = "top";
-		  position = "88 380";
-		  Extent = "464 112";
-		  MinExtent = "8 2";
-		  canSave = "1";
-		  Visible = "1";
-		  hovertime = "1000";
-	   };
-
-	   new GuiGameListOptionsCtrl(OptionsMenu) {
-		  canSaveDynamicFields = "0";
-		  Enabled = "1";
-		  isContainer = "0";
-		  Profile = "DefaultOptionsMenuProfile";
-		  HorizSizing = "center";
-		  VertSizing = "bottom";
-		  position = "160 0";
-		  Extent = "320 240";
-		  MinExtent = "8 2";
-		  canSave = "1";
-		  Visible = "1";
-		  CallbackOnA = "applyOptions();";
-		  CallbackOnB = "Canvas.setContent(UnifiedMainMenuGui);";
-		  CallbackOnY = "revertOptions();";
-		  hovertime = "1000";
-		  DebugRender = false;
-	   };
-   };
-};
-//--- OBJECT WRITE END ---

BIN
Templates/Empty/game/core/unifiedShell/images/gamepad_button_a.png


BIN
Templates/Empty/game/core/unifiedShell/images/gamepad_button_b.png


BIN
Templates/Empty/game/core/unifiedShell/images/gamepad_button_x.png


BIN
Templates/Empty/game/core/unifiedShell/images/gamepad_button_y.png


BIN
Templates/Empty/game/core/unifiedShell/images/listMenuArray.png


+ 0 - 40
Templates/Empty/game/core/unifiedShell/main.cs

@@ -1,40 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-function loadShell()
-{
-   exec("./profiles.cs");
-
-   exec("./MainMenuGui.cs");
-   exec("./MainMenuGui.gui");
-
-   exec("./OptionsGui.cs");
-   exec("./OptionsGui.gui");
-
-   exec("./GamepadButtonsGui.cs");
-   exec("./GamepadButtonsGui.gui");
-
-   exec("./ObjectPickerGui.cs");
-   exec("./ObjectPickerGui.gui");
-}
-
-loadShell();

+ 0 - 79
Templates/Empty/game/core/unifiedShell/profiles.cs

@@ -1,79 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// Gui Profiles for the unified shell
-//------------------------------------------------------------------------------
-
-singleton GuiGameListMenuProfile(DefaultListMenuProfile)
-{
-   fontType = "Arial Bold";
-   fontSize = 20;
-   fontColor = "120 120 120";
-   fontColorSEL = "16 16 16";
-   fontColorNA = "200 200 200";
-   fontColorHL = "100 100 120";
-   HitAreaUpperLeft = "16 20";
-   HitAreaLowerRight = "503 74";
-   IconOffset = "40 0";
-   TextOffset = "100 0";
-   RowSize = "525 93";
-   bitmap = "./images/listMenuArray";
-   canKeyFocus = true;
-};
-
-singleton GuiGameListOptionsProfile(DefaultOptionsMenuProfile)
-{
-   fontType = "Arial Bold";
-   fontSize = 20;
-   fontColor = "120 120 120";
-   fontColorSEL = "16 16 16";
-   fontColorNA = "200 200 200";
-   fontColorHL = "100 100 120";
-   HitAreaUpperLeft = "16 20";
-   HitAreaLowerRight = "503 74";
-   IconOffset = "40 0";
-   TextOffset = "90 0";
-   RowSize = "525 93";
-   ColumnSplit = "220";
-   RightPad = "20";
-   bitmap = "./images/listMenuArray";
-   canKeyFocus = true;
-};
-
-singleton GuiControlProfile(GamepadDefaultProfile)
-{
-   border = 0;
-};
-
-singleton GuiControlProfile(GamepadButtonTextLeft)
-{
-   fontType = "Arial Bold";
-   fontSize = 20;
-   fontColor = "40 40 40";
-   justify = "left";
-};
-
-singleton GuiControlProfile(GamepadButtonTextRight : GamepadButtonTextLeft)
-{
-   justify = "right";
-};

+ 2 - 4
Templates/Empty/game/scripts/client/init.cs

@@ -70,8 +70,7 @@ function initClient()
    exec("art/gui/playGui.gui");
 
    // Load up the shell GUIs
-   if($platform !$= "xenon")  // Use the unified shell instead
-      exec("art/gui/mainMenuGui.gui");
+   exec("art/gui/mainMenuGui.gui");
    exec("art/gui/StartupGui.gui");
 
    // Gui scripts
@@ -133,8 +132,7 @@ function loadMainMenu()
    // Startup the client with the Main menu...
    if (isObject( MainMenuGui ))
       Canvas.setContent( MainMenuGui );
-   else if (isObject( UnifiedMainMenuGui ))
-      Canvas.setContent( UnifiedMainMenuGui );
+   
    Canvas.setCursor("DefaultCursor");
 
    // first check if we have a level file to load

+ 0 - 2
Templates/Full/game/core/main.cs

@@ -75,8 +75,6 @@ function onStart()
    exec("./scripts/client/core.cs");
    initializeCore();
 
-   exec("./unifiedShell/main.cs");
-
    exec("./scripts/client/client.cs");
    exec("./scripts/server/server.cs");
    

+ 1 - 8
Templates/Full/game/core/scripts/client/recordings.cs

@@ -129,14 +129,7 @@ function demoPlaybackComplete()
    // handling functionality.
    clientEndMission();
 
-   if ( $UseUnifiedShell )
-   {
-      if (isObject( UnifiedMainMenuGui ))
-         Canvas.setContent( UnifiedMainMenuGui );
-      else if (isObject( MainMenuGui ))
-         Canvas.setContent( MainMenuGui );
-   }
-   else if (isObject( MainMenuGui ))
+   if (isObject( MainMenuGui ))
       Canvas.setContent( MainMenuGui );
 
    Canvas.pushDialog(RecordingsDlg);

+ 0 - 95
Templates/Full/game/core/unifiedShell/GamepadButtonsGui.cs

@@ -1,95 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// global vars
-//------------------------------------------------------------------------------
-
-$BUTTON_A   =  0;
-$BUTTON_B   =  1;
-$BUTTON_X   =  2;
-$BUTTON_Y   =  3;
-
-//------------------------------------------------------------------------------
-// GamepadButtonsGui methods
-//------------------------------------------------------------------------------
-
-/// Callback when this control wakes up. All buttons are set to invisible and
-/// disabled.
-function GamepadButtonsGui::onWake(%this)
-{
-   %this.setButton($BUTTON_A);
-   %this.setButton($BUTTON_B);
-   %this.setButton($BUTTON_X);
-   %this.setButton($BUTTON_Y);
-}
-
-/// Sets the command and text for the specified button. If %text and %command
-/// are left empty, the button will be disabled and hidden.
-/// Note: This command is not executed when the A button is pressed. That
-/// command is executed directly from the GuiGameList___Ctrl. This command is
-/// for the graphical hint and to allow a mouse equivalent.
-///
-/// \param %button (constant) The button to set. See: $BUTTON_A, _B, _X, _Y
-/// \param %text (string) The text to display next to the A button graphic.
-/// \param %command (string) The command executed when the A button is pressed.
-function GamepadButtonsGui::setButton(%this, %button, %text, %command)
-{
-   switch (%button)
-   {
-      case $BUTTON_A :
-         %labelCtrl = ButtonALabel;
-         %buttonCtrl = ButtonAButton;
-         %imgCtrl = ButtonAImg;
-
-      case $BUTTON_B :
-         %labelCtrl = ButtonBLabel;
-         %buttonCtrl = ButtonBButton;
-         %imgCtrl = ButtonBImg;
-
-      case $BUTTON_X :
-         %labelCtrl = ButtonXLabel;
-         %buttonCtrl = ButtonXButton;
-         %imgCtrl = ButtonXImg;
-
-      case $BUTTON_Y :
-         %labelCtrl = ButtonYLabel;
-         %buttonCtrl = ButtonYButton;
-         %imgCtrl = ButtonYImg;
-
-      default:
-         error("GamepadButtonsGui::setButton(" @ %button @ ", " @ %text @ ", " @ %command @ "). No valid button was specified. Please pass one of the $BUTTON_ globals for this parameter.");
-         return "";
-   }
-
-   %set = (! ((%text $= "") && (%command $= "")));
-   %labelCtrl.setText(%text);
-   %labelCtrl.setActive(%set);
-   %labelCtrl.setVisible(%set);
-
-   %buttonCtrl.Command = %command;
-   %buttonCtrl.setActive(%set);
-   %buttonCtrl.setVisible(%set);
-
-   %imgCtrl.setActive(%set);
-   %imgCtrl.setVisible(%set);
-}

+ 0 - 222
Templates/Full/game/core/unifiedShell/GamepadButtonsGui.gui

@@ -1,222 +0,0 @@
-//------------------------------------------------------------------------------
-// Torque        Engine
-// Copyright (C) GarageGames.com, Inc.
-//------------------------------------------------------------------------------
-
-//--- OBJECT WRITE BEGIN ---
-%guiContent = new GuiControl(GamepadButtonsGui) {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GamepadDefaultProfile";
-   HorizSizing = "center";
-   VertSizing = "center";
-   position = "0 0";
-   Extent = "464 112";
-   MinExtent = "8 2";
-   canSave = "1";
-   Visible = "1";
-   hovertime = "1000";
-
-   new GuiBitmapCtrl(ButtonBImg) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "left";
-      VertSizing = "relative";
-      position = "416 16";
-      Extent = "32 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = "core/unifiedShell/images/gamepad_button_b";
-      wrap = "0";
-   };
-   new GuiTextCtrl(ButtonBLabel) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadButtonTextRight";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "248 16";
-      Extent = "160 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button B Label";
-      maxLength = "1024";
-   };
-   new GuiButtonBaseCtrl(ButtonBButton) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "248 16";
-      Extent = "200 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button";
-      groupNum = "-1";
-      buttonType = "PushButton";
-      useMouseEvents = "0";
-   };
-   new GuiBitmapCtrl(ButtonAImg) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "left";
-      VertSizing = "relative";
-      position = "400 64";
-      Extent = "32 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = "core/unifiedShell/images/gamepad_button_a";
-      wrap = "0";
-   };
-   new GuiTextCtrl(ButtonALabel) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadButtonTextRight";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "232 64";
-      Extent = "160 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button B Label";
-      maxLength = "1024";
-   };
-   new GuiButtonBaseCtrl(ButtonAButton) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "232 64";
-      Extent = "200 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button";
-      groupNum = "-1";
-      buttonType = "PushButton";
-      useMouseEvents = "0";
-   };
-   new GuiBitmapCtrl(ButtonXImg) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "right";
-      VertSizing = "relative";
-      position = "32 64";
-      Extent = "32 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = "core/unifiedShell/images/gamepad_button_x";
-      wrap = "0";
-   };
-   new GuiTextCtrl(ButtonXLabel) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadButtonTextLeft";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "72 64";
-      Extent = "160 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button X Label";
-      maxLength = "1024";
-   };
-   new GuiButtonBaseCtrl(ButtonXButton) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "32 64";
-      Extent = "200 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button";
-      groupNum = "-1";
-      buttonType = "PushButton";
-      useMouseEvents = "0";
-   };
-   new GuiBitmapCtrl(ButtonYImg) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "right";
-      VertSizing = "relative";
-      position = "16 16";
-      Extent = "32 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = "core/unifiedShell/images/gamepad_button_y";
-      wrap = "0";
-   };
-   new GuiTextCtrl(ButtonYLabel) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadButtonTextLeft";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "55 16";
-      Extent = "164 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button Y Label";
-      maxLength = "1024";
-   };
-   new GuiButtonBaseCtrl(ButtonYButton) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "16 16";
-      Extent = "208 32";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      text = "Button";
-      groupNum = "-1";
-      buttonType = "PushButton";
-      useMouseEvents = "0";
-   };
-};
-//--- OBJECT WRITE END ---

+ 0 - 105
Templates/Full/game/core/unifiedShell/MainMenuGui.cs

@@ -1,105 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// ListMenu methods
-//------------------------------------------------------------------------------
-
-/// Callback when this gui is added to the sim.
-function ListMenu::onAdd(%this)
-{
-   %this.addRow("Play Game", "onSinglePlayer", 0);
-
-   // Defunct for now
-   //%this.addRow("Select Model", "onSelectModel", 4, -15);
-
-   // No need for video options on Xbox 360
-   if ( $platform $= "xenon" )
-      %this.addRow("Exit Game", "onQuit", 4, -15);
-   else
-   {
-      %this.addRow("Setup", "onOptions", 4, -15);
-      %this.addRow("Exit Game", "onQuit", 6, -15);
-   }
-}
-
-//------------------------------------------------------------------------------
-// MainMenuButtonHolder methods
-//------------------------------------------------------------------------------
-
-function MainMenuButtonHolder::onWake(%this)
-{
-   %this.add(GamepadButtonsGui);
-
-   GamepadButtonsGui.setButton($BUTTON_A, "Go", ListMenu.CallbackOnA);
-}
-
-//------------------------------------------------------------------------------
-// global methods
-//------------------------------------------------------------------------------
-
-/// Callback from the shell button for triggering single player.
-function onSinglePlayer()
-{
-   echo("Default implementation. Override onSinglePlayer() to add game specific functionality");
-
-   if ( isObject( LoadingGui ) )
-   {
-      Canvas.setContent("LoadingGui");
-      LoadingProgress.setValue(1);
-      LoadingProgressTxt.setValue("LOADING MISSION FILE");
-      Canvas.repaint();
-   }
-   
-   // Grab the specified default level
-   %mission = $DefaultLevelFile;
-
-   // If the default level isn't loaded attempt a fallback
-   if ( %mission $= "" )
-      %mission = "levels/default.mis";
-
-   %serverType = $AutoLoadLevelMode;
-
-   if ( %serverType $= "" )
-      %serverType = "SinglePlayer";
-
-   createAndConnectToLocalServer( %serverType, %mission );
-}
-
-/// Callback from the shell button to bring up the object picker.
-function onSelectModel()
-{
-   Canvas.setContent(ObjectPickerGui);
-}
-
-/// Callback from the shell button to bring up the options gui.
-function onOptions()
-{
-   Canvas.setContent(OptionsGui);
-}
-
-/// Callback from the shell "quit" button.
-function onQuit()
-{
-   echo("Default implementation. Override onQuit() to add game specific functionality");
-   quit();
-}

+ 0 - 72
Templates/Full/game/core/unifiedShell/MainMenuGui.gui

@@ -1,72 +0,0 @@
-//------------------------------------------------------------------------------
-// Torque        Engine
-// Copyright (C) GarageGames.com, Inc.
-//------------------------------------------------------------------------------
-
-//--- OBJECT WRITE BEGIN ---
-%guiContent = singleton GuiChunkedBitmapCtrl(UnifiedMainMenuGui) {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GuiContentProfile";
-   HorizSizing = "width";
-   VertSizing = "height";
-   Position = "0 0";
-   Extent = "800 600";
-   MinExtent = "8 8";
-   canSave = "1";
-   Visible = "1";
-   tooltipprofile = "GuiToolTipProfile";
-   hovertime = "1000";
-   bitmap = "art/gui/background";
-   useVariable = "0";
-   tile = "0";
-   
-  new GuiControl() {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GuiDefaultProfile";
-   HorizSizing = "center";
-   VertSizing = "center";
-   position = "0 0";
-   Extent = "640 480";
-   MinExtent = "8 8";
-   canSave = "1";
-   Visible = "1";
-   hovertime = "1000";
-   
-	   new GuiControl(MainMenuButtonHolder) {
-		  canSaveDynamicFields = "0";
-		  Enabled = "1";
-		  isContainer = "1";
-		  Profile = "GamepadDefaultProfile";
-		  HorizSizing = "center";
-		  VertSizing = "bottom";
-		  position = "88 340";
-		  Extent = "464 112";
-		  MinExtent = "8 2";
-		  canSave = "1";
-		  Visible = "1";
-		  hovertime = "1000";
-	   };
-
-	   singleton GuiGameListMenuCtrl(ListMenu) {
-		  canSaveDynamicFields = "0";
-		  isContainer = "0";
-		  Profile = "DefaultListMenuProfile";
-		  HorizSizing = "center";
-		  VertSizing = "bottom";
-		  position = "160 64";
-		  Extent = "320 240";
-		  MinExtent = "8 2";
-		  canSave = "1";
-		  Visible = "1";
-		  hovertime = "1000";
-		  CallbackOnA = "ListMenu.activateRow();";
-		  DebugRender = false;
-	   };
-	   
-   };
-};
-//--- OBJECT WRITE END ---

+ 0 - 172
Templates/Full/game/core/unifiedShell/ObjectPickerGui.cs

@@ -1,172 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// global vars
-//------------------------------------------------------------------------------
-
-$PICKER::ROW_OBJECT  =  0; ///< The row used to pick ojbects
-$PICKER::ROW_MOUNT   =  1; ///< The row used to pick the mounted object
-
-$PICKER::MODEL["Default"]   =  getWorkingDirectory() @ "/art/shapes/players/SpaceOrc/SpaceOrc.dts";
-
-$PICKER::WEAPON["Default"]  = getWorkingDirectory() @ "/art/shapes/weapons/SwarmGun/swarmgun.dts";
-$PICKER::WEAPON["Rocket Launcher"] = getWorkingDirectory() @ "/art/shapes/weapons/SwarmGun/swarmgun.dts";
-
-//------------------------------------------------------------------------------
-// PickerMenu methods
-//------------------------------------------------------------------------------
-
-/// Callback when this gui is added to the sim.
-function PickerMenu::onAdd(%this)
-{
-   %this.addRow("Model", "Default", true, "onModelChange");
-   %this.addRow("Weapon", "Default", true, "onMountChange");
-}
-
-/// Callback when the control wakes up.
-function PickerMenu::onWake(%this)
-{
-   // For now PlayerDatasGroup is currently being populated
-   // by loadPlayerPickerData() which is implemented in
-   // <$defaultGame>/client/init.cs
-      
-   %this.modelList = "";
-   
-   if (isObject(PlayerDatasGroup))
-   {
-      for (%i = 0; %i < PlayerDatasGroup.getCount(); %i++)
-      {
-         %obj = PlayerDatasGroup.getObject(%i);
-         %name = %obj.getName();
-         
-         %name = strreplace(%name, "Data", "");
-         echo(%name);
-         $PICKER::MODEL[%name]   =  %obj.shapeFile;
-         
-         %this.modelList = %this.modelList @ %name @ "\t";
-      }
-   }
-   
-   %this.setOptions($PICKER::ROW_OBJECT, %this.modelList);
-
-   %this.setOptions($PICKER::ROW_MOUNT, "Default\tRocket Launcher");
-
-   // Initialize the currently selected object here
-   if ($pref::Player:PlayerDB $= "")
-      $pref::Player:PlayerDB = getField(%this.modelList, 0) @ "Data";
-      
-   %db = strreplace($pref::Player:PlayerDB, "Data", "");
-
-   //PickerObjectView.setModel($PICKER::MODEL[%db]);
-   
-   if ($pref::Player:Weapon $= "")
-      $pref::Player:Weapon = "Default";
-
-   
-   PickerObjectView.setMount($PICKER::WEAPON[$pref::Player:Weapon],0);
-   PickerObjectView.setOrbitDistance(3);
-   
-   %this.selectOption($PICKER::ROW_OBJECT, %db);
-   %this.selectOption($PICKER::ROW_MOUNT, $pref::Player:Weapon);
-}
-
-function PickerMenu::setPlayer(%this)
-{
-   %selected = PickerMenu.getCurrentOption($PICKER::ROW_OBJECT);
-   
-   if (%selected $= "Default")
-      %selected = "DefaultPlayer";
-   
-   $pref::Player:PlayerDB = %selected @ "Data";
-
-   %selected = PickerMenu.getCurrentOption($PICKER::ROW_MOUNT);
-   
-   $pref::Player:Weapon = %selected;
-   
-   Canvas.setContent(UnifiedMainMenuGui);
-}
-
-//------------------------------------------------------------------------------
-// callbacks from PickerMenu
-//------------------------------------------------------------------------------
-
-/// Callback when the primary object model is changed.
-///
-/// \param %direction (string) "LEFT" or "RIGHT" indicating the direction the
-/// option changed.
-function onModelChange(%direction)
-{
-   %selected = PickerMenu.getCurrentOption($PICKER::ROW_OBJECT);
-   PickerObjectView.setModel($PICKER::MODEL[%selected]);
-   PickerObjectView.setOrbitDistance(3);
-   PickerInfoDisplay.update();
-}
-
-/// Callback when the mounted object model is changed.
-///
-/// \param %direction (string) "LEFT" or "RIGHT" indicating the direction the
-/// option changed.
-function onMountChange(%direction)
-{
-   %selected = PickerMenu.getCurrentOption($PICKER::ROW_MOUNT);
-   PickerObjectView.setMount($PICKER::WEAPON[%selected],0);
-   $pref::Player:Weapon = %selected;
-   
-   PickerInfoDisplay.update();
-}
-
-//------------------------------------------------------------------------------
-// PickerInfoDisplay methods
-//------------------------------------------------------------------------------
-
-/// Updates the information display to show information about the currently
-/// selected objects.
-function PickerInfoDisplay::update(%this)
-{
-   %objectName = PickerMenu.getCurrentOption($PICKER::ROW_OBJECT);
-   %mountName = PickerMenu.getCurrentOption($PICKER::ROW_MOUNT);
-   %this.setText("");
-   %this.addText("<color:666666><tab:80>", false);
-   %this.addText("Selected Objects<br>", false);
-   %this.addText("Object:" TAB %objectName @ "<br>", false);
-   %this.addText("Mounted Object:" TAB %mountName @ "<br>", false);
-   %this.forceReflow();
-}
-
-/// Callback when this control wakes up
-function PickerInfoDisplay::onWake(%this)
-{
-   %this.update();
-}
-
-//------------------------------------------------------------------------------
-// PickerButtonHolder methods
-//------------------------------------------------------------------------------
-
-function PickerButtonHolder::onWake(%this)
-{
-   %this.add(GamepadButtonsGui);
-
-   GamepadButtonsGui.setButton($BUTTON_A, "Accept", PickerMenu.CallbackOnA);
-   GamepadButtonsGui.setButton($BUTTON_B, "Go Back", PickerMenu.CallbackOnB);
-}

+ 0 - 82
Templates/Full/game/core/unifiedShell/ObjectPickerGui.gui

@@ -1,82 +0,0 @@
-//------------------------------------------------------------------------------
-// Torque        Engine
-// Copyright (C) GarageGames.com, Inc.
-//------------------------------------------------------------------------------
-
-//--- OBJECT WRITE BEGIN ---
-%guiContent = new GuiControl(ObjectPickerGui) {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GuiDefaultProfile";
-   HorizSizing = "width";
-   VertSizing = "height";
-   position = "0 0";
-   Extent = "640 480";
-   MinExtent = "8 8";
-   canSave = "1";
-   Visible = "1";
-   hovertime = "1000";
-
-   new GuiBitmapCtrl(PickerBackground) {
-      canSaveDynamicFields = "1";
-      isContainer = "0";
-      Profile = "GuiDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "0 0";
-      Extent = "640 480";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = getWorkingDirectory() @ "/art/skies/skybox_1.jpg";
-      wrap = "0";
-   };
-   new GuiGameListOptionsCtrl(PickerMenu) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "DefaultOptionsMenuProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "20 185";
-      Extent = "320 186";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      CallbackOnA = "PickerMenu.setPlayer();";
-      CallbackOnB = "Canvas.setContent(UnifiedMainMenuGui);";
-      hovertime = "1000";
-      DebugRender = false;
-   };
-   new GuiMLTextCtrl(PickerInfoDisplay) {
-      Profile = "GuiDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "350 185";
-      Extent = "240 56";
-   };
-   new GuiObjectView(PickerObjectView) {
-      Profile = "GuiDefaultProfile";
-      HorizSizing = "relative";
-      VertSizing = "relative";
-      position = "230 0";
-      Extent = "180 180";
-   };
-   new GuiControl(PickerButtonHolder) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "1";
-      Profile = "GamepadDefaultProfile";
-      HorizSizing = "center";
-      VertSizing = "top";
-      position = "88 368";
-      Extent = "464 112";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-   };
-};
-//--- OBJECT WRITE END ---

+ 0 - 380
Templates/Full/game/core/unifiedShell/OptionsGui.cs

@@ -1,380 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// global vars
-//------------------------------------------------------------------------------
-
-$OPTIONS_MENU::NO_DEVICE      = -1; ///< Indicates there is no specified device
-$OPTIONS_MENU::ROW_GFXDEVICE  = 0;  ///< Row to choose gfx device
-$OPTIONS_MENU::ROW_GFXRES     = 1;  ///< Row to choose gfx resolution
-$OPTIONS_MENU::ROW_FULLSCREEN = 2;  ///< Row to choose fullscreen or not
-$OPTIONS_MENU::ROW_VOLUME     = 3;  ///< Row to set audio volume
-$OPTIONS_MENU::ROW_AA         = 4;  ///< Row to set AA
-
-//------------------------------------------------------------------------------
-// OptionsMenu methods
-//------------------------------------------------------------------------------
-
-/// Callback when this gui is added to the sim.
-function OptionsMenu::onAdd(%this)
-{
-   %deviceList = %this.getGfxDeviceList();
-   %this.addRow("Adapter", %deviceList, true, "onGfxDeviceChange", 0, 0, false);
-
-   %resList = %this.getGfxResList(isFullScreen());
-   %this.addRow("Resolution", %resList, false, "", 0, -15);
-
-   %yesNoList = "Yes\tNo";
-   %this.addRow("Fullscreen", %yesNoList, true, "onFullscreenChange", 0, -15);
-
-   %volumeList = %this.getSfxVolumeList();
-   %this.addRow("Volume", %volumeList, false, "onVolumeChange", 0, -15, false);
-   
-   %aaList = %this.getAAList();
-   %this.addRow("Antialias", %aaList, false, "", 0, -15);
-}
-
-/// Callback when the control wakes up.
-function OptionsMenu::onWake(%this)
-{
-   %this.loadPrefs();
-}
-
-/// Initializes each row on this control to reflect the state of saved prefs.
-function OptionsMenu::loadPrefs(%this)
-{
-   // init the display adapter chooser
-   %this.selectOption($OPTIONS_MENU::ROW_GFXDEVICE, $pref::Video::displayDevice);
-   OptionsInfoDisplay.displayGfxDevice();
-
-   // init the display resolution chooser
-   %currRes = getWords($pref::Video::mode, $WORD::RES_X, $WORD::RES_Y);
-   %this.selectOption($OPTIONS_MENU::ROW_GFXRES, %currRes);
-
-   // init the fullscreen chooser
-   %fullscreen = (isFullScreen()) ? "Yes" : "No";
-   %this.selectOption($OPTIONS_MENU::ROW_FULLSCREEN, %fullscreen);
-
-   // init the master volume
-   %volume = mRoundByFive($pref::Audio::masterVolume * 100);
-   %this.selectOption($OPTIONS_MENU::ROW_VOLUME, %volume);
-      
-   %currAA = getWord($pref::Video::mode, $WORD::AA);      
-   %this.selectOption($OPTIONS_MENU::ROW_AA, %currAA);
-}
-
-/// Gets a tab separated list of all the graphics devices available. The list
-/// will not include the null device by default but you may request to have the
-/// null device included. Devices are listed by type.
-///
-/// \param %includeNull (bool) [optional] Specify true to include the null
-/// device in the list. Default is false.
-/// \return (string) A tab separated list of the avilable graphics devices.
-function OptionsMenu::getGfxDeviceList(%this, %includeNull)
-{
-   %count = GFXInit::getAdapterCount();
-   %list = "";
-   for (%i = 0; %i < %count; %i++)
-   {
-      %type = GFXInit::getAdapterType(%i);
-      if ((%includeNull) || (%type !$= "NullDevice"))
-      {
-         %list = %list TAB %type;
-      }
-   }
-   return trim(%list);
-}
-
-/// Gets a tab separated list of available graphics resolutions. The resolutions
-/// will be those available for the settings currently shown on the options
-/// screen.
-///
-/// \param %fullscreen (bool) Specify true to get a list of all resolutions or
-/// false to prune out resolutions that won't fit nicely on the desktop.
-/// \return (string) A tab separated list of available graphics resolutions.
-function OptionsMenu::getGfxResList(%this, %fullscreen)
-{
-   %type = %this.getCurrentOption($OPTIONS_MENU::ROW_GFXDEVICE);
-   %adapter = getGfxDeviceIndex(%type);
-
-   %deskRes = getDesktopResolution();
-   %deskResX = firstWord(%deskRes);
-   %deskResY = getWord(%deskRes, 1);
-
-   %list = "";
-   %count = GFXInit::getAdapterModeCount(%adapter);
-   for (%i = 0; %i < %count; %i++)
-   {
-      %rawRes = GFXInit::getAdapterMode(%adapter, %i);
-      %resX = firstWord(%rawRes);
-      %resY = getWord(%rawRes, 1);
-      if (%fullscreen || ((%resX < %deskResX) && (%resY < %deskResY)))
-      {
-         %res = %resX SPC %resY;
-         if (! listHasElement(%list, %res))
-         {
-            %list = %list TAB %res;
-         }
-      }
-   }
-
-   return trim(%list);
-}
-
-/// Refreshes the list of resolutions on the control taking into account the
-/// displayed settings for device and fullscreen.
-function OptionsMenu::refreshResolutions(%this)
-{
-   %oldRes = %this.getCurrentOption($OPTIONS_MENU::ROW_GFXRES);
-   %fullscreen = (%this.getCurrentOption($OPTIONS_MENU::ROW_FULLSCREEN) $= "Yes");
-   %newResList = %this.getGfxResList(%fullscreen);
-   %this.setOptions($OPTIONS_MENU::ROW_GFXRES, %newResList);
-   %this.selectOption($OPTIONS_MENU::ROW_GFXRES, %oldRes);
-}
-
-/// Builds a list of volume increments suitable for listing on the volume
-/// control. List will be from 0 to 100, incrementing by 5.
-function OptionsMenu::getSfxVolumeList(%this)
-{
-   %start = 0;
-   %end = 100;
-   %inc = 5;
-
-   %list = "";
-   for (%i = %start; %i <= %end; %i += %inc)
-   {
-      %list = %list TAB %i;
-   }
-
-   return trim(%list);
-}
-
-function OptionsMenu::getAAList(%this)
-{
-   %type = %this.getCurrentOption($OPTIONS_MENU::ROW_GFXDEVICE);
-   %adapter = getGfxDeviceIndex(%type);
-
-   %list = "";
-   %count = GFXInit::getAdapterModeCount(%adapter);
-   %maxAA = 0;
-   for (%i = 0; %i < %count; %i++)
-   {
-      %rawRes = GFXInit::getAdapterMode(%adapter, %i);       
-      %aa = getWord(%rawRes, $WORD::AA);
-      if (%aa > %maxAA)
-         %maxAA = %aa;
-   }
-   
-   %list = "";
-   for (%i = 0; %i <= %maxAA; %i++)
-   {
-      %list = %list TAB %i;
-   }
-   return trim(%list);
-}
-
-//------------------------------------------------------------------------------
-// OptionsButtonHolder methods
-//------------------------------------------------------------------------------
-
-function OptionsButtonHolder::onWake(%this)
-{
-   %this.add(GamepadButtonsGui);
-
-   GamepadButtonsGui.setButton($BUTTON_A, "Apply Changes", OptionsMenu.CallbackOnA);
-   GamepadButtonsGui.setButton($BUTTON_B, "Go Back", OptionsMenu.CallbackOnB);
-   GamepadButtonsGui.setButton($BUTTON_Y, "Revert Options", OptionsMenu.CallbackOnY);
-}
-
-//------------------------------------------------------------------------------
-// OptionsInfoDisplay methods
-//------------------------------------------------------------------------------
-
-/// Updates the control to display information on the display device selected on
-/// the control for choosing a display device.
-function OptionsInfoDisplay::displayGfxDevice(%this)
-{
-   %type = OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_GFXDEVICE);
-   %index = getGfxDeviceIndex(%type);
-   if (%index != $OPTIONS_MENU::NO_DEVICE)
-   {
-      %name = GFXInit::getAdapterName(%index);
-      %shader = GFXInit::getAdapterShaderModel(%index);
-   }
-   else
-   {
-      %name = "<spush><color:ff0000>No valid device of that type<spop>";
-      %shader = "<spush><color:ff0000>NA<spop>";
-   }
-   %this.setText("");
-   %this.addText("<color:666666><tab:80>", false);
-   %this.addText("Graphics Device<br>", false);
-   %this.addText("Type:" TAB %type @ "<br>", false);
-   %this.addText("Device:" TAB %name @ "<br>", false);
-   %this.addText("Shader:" TAB %shader @ "<br>", false);
-   %this.forceReflow();
-}
-
-//------------------------------------------------------------------------------
-// callbacks from OptionsMenu
-//------------------------------------------------------------------------------
-
-/// Callback when the graphics device is changed. This will refresh the lists of
-/// resolutions and other related settings.
-///
-/// \param %direction (string) "LEFT" or "RIGHT" indicating the direction the
-/// option changed.
-function onGfxDeviceChange(%direction)
-{
-   OptionsInfoDisplay.displayGfxDevice();
-   $ThisControl.refreshResolutions();
-}
-
-/// Callback when the fullscreen setting is changed. Refreshes the list of
-/// resolutions to reflect what is available.
-///
-/// \param %direction (string) "LEFT" or "RIGHT" indicating the direction the
-/// option changed.
-function onFullscreenChange(%direction)
-{
-   $ThisControl.refreshResolutions();
-}
-
-/// Callback when the volume setting is changed.
-///
-/// \param %direction (string) "LEFT" or "RIGHT" indicating the direction the
-/// option changed.
-function onVolumeChange(%direction)
-{
-   %volume = (OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_VOLUME) / 100);
-   sfxSetMasterVolume(%volume);
-   // TODO: play sample audio blip for user feedback
-}
-
-//------------------------------------------------------------------------------
-// global methods
-//------------------------------------------------------------------------------
-
-/// Applies the options that have been set.
-function applyOptions()
-{
-   // set the audio options
-   %rawVolume = OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_VOLUME);
-   $pref::Audio::masterVolume = %rawVolume / 100;
-
-   // set the new video mode.
-   %newRes = OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_GFXRES);
-   %newFs = (OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_FULLSCREEN) $= "Yes");
-   %newBpp = "32";
-   %rate = getWord($pref::Video::mode, $WORD::REFRESH);
-   %aa = OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_AA);
-
-   // even though pref is set by "setVideoMode" we must set it here to handle
-   // the case of a restart to apply new driver settings
-   $pref::Video::mode = %newRes SPC %newFs SPC %newBpp SPC %rate SPC %aa;
-   
-   // check if Torque will require a restart for the new driver
-   %oldDriver = $pref::Video::displayDevice;
-   $pref::Video::displayDevice = OptionsMenu.getCurrentOption($OPTIONS_MENU::ROW_GFXDEVICE);
-   if (%oldDriver !$= $pref::Video::displayDevice)
-   {
-      MessageBoxOKCancel("Change Video Device Now?",
-         "Changing your video device requires Torque to be restarted. Selecting \"Ok\" will restart Torque with the new settings. Selecting \"Cancel\" will keep the new video settings and apply them next time you restart Torque.",
-         "restartInstance();", "");
-   }
-
-   $pref::Video::mode = %newRes SPC %newFs SPC %newBpp SPC %rate SPC %aa;
-   configureCanvas();
-}
-
-/// Reverts all options to the saved preferences.
-function revertOptions()
-{
-   OptionsMenu.loadPrefs();
-}
-
-/// Looks up the system index of the gfx device from the type.
-///
-/// \param %type (string) A string representing the system type of the adapter.
-/// \return (int) The index of the adapter if it is found or if there is no
-/// device with that type it returns $OPTIONS_MENU::NO_DEVICE
-function getGfxDeviceIndex(%type)
-{
-   %count = GFXInit::getAdapterCount();
-   for (%i = 0; %i < %count; %i++)
-   {
-      %otherType = GFXInit::getAdapterType(%i);
-      if (%type $= %otherType)
-      {
-         return %i;
-      }
-   }
-
-   return $OPTIONS_MENU::NO_DEVICE;
-}
-
-/// Determines if the list contains the given element.
-///
-/// \return (bool) True if the element is found in the list, false if it is not.
-function listHasElement(%list, %element)
-{
-   %count = getFieldCount(%list);
-   for (%i = 0; %i < %count; %i++)
-   {
-      %word = getField(%list, %i);
-      if (%word $= %element)
-      {
-         return true;
-      }
-   }
-
-   return false;
-}
-
-/// Rounds %n to the nearest whole integer ending in a multiple of five.
-///
-/// \param %n (int or float) The number to round.
-/// \return (int) %n rounded to the nearest multiple of five.
-function mRoundByFive(%n)
-{
-   return (mFloor((%n + 2.5) / 5) * 5);
-}
-
-/// Determines if the saved preferences indicate running in fullscreen mode.
-///
-/// \return (bool) True if the preferences are saved to run in fullscreen or
-/// false if saved to run windowed.
-function isFullScreen()
-{
-   %fullscreen = getWord($pref::Video::mode, $WORD::FULLSCREEN);
-   return (%fullscreen $= "true");
-}
-
-/// Sets the preference for fullscreen to the indicated value.
-///
-/// \param %bool (bool) Specify true to set the preference to fullscreen, false
-/// to set it to windowed.
-function setFullScreen(%bool)
-{
-   $pref::Video::resolution = setWord($pref::Video::mode, $WORD::FULLSCREEN, (%bool ? "true" : "false"));
-}

+ 0 - 104
Templates/Full/game/core/unifiedShell/OptionsGui.gui

@@ -1,104 +0,0 @@
-//------------------------------------------------------------------------------
-// Torque        Engine
-// Copyright (C) GarageGames.com, Inc.
-//------------------------------------------------------------------------------
-
-//--- OBJECT WRITE BEGIN ---
-%guiContent = new GuiControl(OptionsGui) {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GuiDefaultProfile";
-   HorizSizing = "width";
-   VertSizing = "height";
-   position = "0 0";
-   Extent = "640 480";
-   MinExtent = "8 8";
-   canSave = "1";
-   Visible = "1";
-   hovertime = "1000";
-
-   new GuiMLTextCtrl(OptionsInfoDisplay) {
-      canSaveDynamicFields = "0";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GuiDefaultProfile";
-      HorizSizing = "center";
-      VertSizing = "bottom";
-      position = "160 25";
-      Extent = "320 70";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      lineSpacing = "2";
-      allowColorChars = "0";
-      maxChars = "-1";
-   };
-   new GuiBitmapCtrl(OptionsMenuBackground) {
-      canSaveDynamicFields = "1";
-      Enabled = "1";
-      isContainer = "0";
-      Profile = "GuiDefaultProfile";
-      HorizSizing = "width";
-      VertSizing = "height";
-      position = "0 0";
-      Extent = "640 480";
-      MinExtent = "8 2";
-      canSave = "1";
-      Visible = "1";
-      hovertime = "1000";
-      bitmap = getWorkingDirectory() @ "/art/skies/skybox_1.jpg";
-      wrap = "0";
-   };
-   
-  new GuiControl() {
-   canSaveDynamicFields = "0";
-   Enabled = "1";
-   isContainer = "1";
-   Profile = "GuiDefaultProfile";
-   HorizSizing = "center";
-   VertSizing = "center";
-   position = "0 0";
-   Extent = "640 480";
-   MinExtent = "8 8";
-   canSave = "1";
-   Visible = "1";
-   hovertime = "1000";
-
-	   new GuiControl(OptionsButtonHolder) {
-		  canSaveDynamicFields = "0";
-		  Enabled = "1";
-		  isContainer = "1";
-		  Profile = "GamepadDefaultProfile";
-		  HorizSizing = "center";
-		  VertSizing = "top";
-		  position = "88 380";
-		  Extent = "464 112";
-		  MinExtent = "8 2";
-		  canSave = "1";
-		  Visible = "1";
-		  hovertime = "1000";
-	   };
-
-	   new GuiGameListOptionsCtrl(OptionsMenu) {
-		  canSaveDynamicFields = "0";
-		  Enabled = "1";
-		  isContainer = "0";
-		  Profile = "DefaultOptionsMenuProfile";
-		  HorizSizing = "center";
-		  VertSizing = "bottom";
-		  position = "160 0";
-		  Extent = "320 240";
-		  MinExtent = "8 2";
-		  canSave = "1";
-		  Visible = "1";
-		  CallbackOnA = "applyOptions();";
-		  CallbackOnB = "Canvas.setContent(UnifiedMainMenuGui);";
-		  CallbackOnY = "revertOptions();";
-		  hovertime = "1000";
-		  DebugRender = false;
-	   };
-   };
-};
-//--- OBJECT WRITE END ---

BIN
Templates/Full/game/core/unifiedShell/images/gamepad_button_a.png


BIN
Templates/Full/game/core/unifiedShell/images/gamepad_button_b.png


BIN
Templates/Full/game/core/unifiedShell/images/gamepad_button_x.png


BIN
Templates/Full/game/core/unifiedShell/images/gamepad_button_y.png


BIN
Templates/Full/game/core/unifiedShell/images/listMenuArray.png


+ 0 - 40
Templates/Full/game/core/unifiedShell/main.cs

@@ -1,40 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-function loadShell()
-{
-   exec("./profiles.cs");
-
-   exec("./MainMenuGui.cs");
-   exec("./MainMenuGui.gui");
-
-   exec("./OptionsGui.cs");
-   exec("./OptionsGui.gui");
-
-   exec("./GamepadButtonsGui.cs");
-   exec("./GamepadButtonsGui.gui");
-
-   exec("./ObjectPickerGui.cs");
-   exec("./ObjectPickerGui.gui");
-}
-
-loadShell();

+ 0 - 79
Templates/Full/game/core/unifiedShell/profiles.cs

@@ -1,79 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// Gui Profiles for the unified shell
-//------------------------------------------------------------------------------
-
-singleton GuiGameListMenuProfile(DefaultListMenuProfile)
-{
-   fontType = "Arial Bold";
-   fontSize = 20;
-   fontColor = "120 120 120";
-   fontColorSEL = "16 16 16";
-   fontColorNA = "200 200 200";
-   fontColorHL = "100 100 120";
-   HitAreaUpperLeft = "16 20";
-   HitAreaLowerRight = "503 74";
-   IconOffset = "40 0";
-   TextOffset = "100 0";
-   RowSize = "525 93";
-   bitmap = "./images/listMenuArray";
-   canKeyFocus = true;
-};
-
-singleton GuiGameListOptionsProfile(DefaultOptionsMenuProfile)
-{
-   fontType = "Arial Bold";
-   fontSize = 20;
-   fontColor = "120 120 120";
-   fontColorSEL = "16 16 16";
-   fontColorNA = "200 200 200";
-   fontColorHL = "100 100 120";
-   HitAreaUpperLeft = "16 20";
-   HitAreaLowerRight = "503 74";
-   IconOffset = "40 0";
-   TextOffset = "90 0";
-   RowSize = "525 93";
-   ColumnSplit = "220";
-   RightPad = "20";
-   bitmap = "./images/listMenuArray";
-   canKeyFocus = true;
-};
-
-singleton GuiControlProfile(GamepadDefaultProfile)
-{
-   border = 0;
-};
-
-singleton GuiControlProfile(GamepadButtonTextLeft)
-{
-   fontType = "Arial Bold";
-   fontSize = 20;
-   fontColor = "40 40 40";
-   justify = "left";
-};
-
-singleton GuiControlProfile(GamepadButtonTextRight : GamepadButtonTextLeft)
-{
-   justify = "right";
-};

+ 2 - 4
Templates/Full/game/scripts/client/init.cs

@@ -77,8 +77,7 @@ function initClient()
    exec("art/gui/controlsHelpDlg.gui");
 
    // Load up the shell GUIs
-   if($platform !$= "xenon")  // Use the unified shell instead
-      exec("art/gui/mainMenuGui.gui");
+   exec("art/gui/mainMenuGui.gui");
    exec("art/gui/joinServerDlg.gui");
    exec("art/gui/endGameGui.gui");
    exec("art/gui/StartupGui.gui");
@@ -150,8 +149,7 @@ function loadMainMenu()
    // Startup the client with the Main menu...
    if (isObject( MainMenuGui ))
       Canvas.setContent( MainMenuGui );
-   else if (isObject( UnifiedMainMenuGui ))
-      Canvas.setContent( UnifiedMainMenuGui );
+   
    Canvas.setCursor("DefaultCursor");
 
    // first check if we have a level file to load

+ 0 - 2
Templates/Full/game/scripts/client/serverConnection.cs

@@ -220,8 +220,6 @@ function disconnectedCleanup()
    // Back to the launch screen
    if (isObject( MainMenuGui ))
       Canvas.setContent( MainMenuGui );
-   else if (isObject( UnifiedMainMenuGui ))
-      Canvas.setContent( UnifiedMainMenuGui );
 
    // Before we destroy the client physics world
    // make sure all ServerConnection objects are deleted.