Răsfoiți Sursa

Merge pull request #1339 from Areloch/Remove_Demo_Mode_Checks

Remove demo and trial checks
Daniel Buckmaster 10 ani în urmă
părinte
comite
d268199f4f
25 a modificat fișierele cu 333 adăugiri și 824 ștergeri
  1. 0 8
      Engine/source/T3D/gameTSCtrl.cpp
  2. 0 10
      Engine/source/T3D/gameTSCtrl.h
  3. 0 13
      Engine/source/app/mainLoop.cpp
  4. 1 19
      Engine/source/app/version.cpp
  5. 0 4
      Engine/source/console/consoleFunctions.cpp
  6. 0 37
      Engine/source/gui/core/guiCanvas.cpp
  7. 0 21
      Engine/source/gui/core/guiCanvas.h
  8. 0 3
      Templates/Empty/game/tools/gui/guiDialogs.ed.cs
  9. 0 85
      Templates/Empty/game/tools/gui/messageBoxOKBuy.ed.gui
  10. 0 6
      Templates/Empty/game/tools/main.cs
  11. 0 17
      Templates/Empty/game/tools/navEditor/main.cs
  12. 0 3
      Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs
  13. 0 6
      Templates/Empty/game/tools/worldEditor/scripts/editorPlugin.ed.cs
  14. 0 18
      Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs
  15. 144 191
      Templates/Empty/game/tools/worldEditor/scripts/menuHandlers.ed.cs
  16. 21 28
      Templates/Empty/game/tools/worldEditor/scripts/menus.ed.cs
  17. 0 3
      Templates/Full/game/tools/gui/guiDialogs.ed.cs
  18. 0 85
      Templates/Full/game/tools/gui/messageBoxOKBuy.ed.gui
  19. 0 6
      Templates/Full/game/tools/main.cs
  20. 0 17
      Templates/Full/game/tools/navEditor/main.cs
  21. 0 3
      Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs
  22. 0 6
      Templates/Full/game/tools/worldEditor/scripts/editorPlugin.ed.cs
  23. 0 18
      Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs
  24. 146 189
      Templates/Full/game/tools/worldEditor/scripts/menuHandlers.ed.cs
  25. 21 28
      Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs

+ 0 - 8
Engine/source/T3D/gameTSCtrl.cpp

@@ -55,10 +55,6 @@ bool GameTSCtrl::onAdd()
    if ( !Parent::onAdd() )
       return false;
 
-#ifdef TORQUE_DEMO_WATERMARK
-   mWatermark.init();
-#endif
-
    return true;
 }
 
@@ -172,10 +168,6 @@ void GameTSCtrl::onRender(Point2I offset, const RectI &updateRect)
 
    if(!skipRender || true)
       Parent::onRender(offset, updateRect);
-
-#ifdef TORQUE_DEMO_WATERMARK
-   mWatermark.render(getExtent());
-#endif
 }
 
 //--------------------------------------------------------------------------

+ 0 - 10
Engine/source/T3D/gameTSCtrl.h

@@ -30,12 +30,6 @@
 #include "gui/3d/guiTSControl.h"
 #endif
 
-#ifdef TORQUE_DEMO_WATERMARK
-#ifndef _WATERMARK_H_
-#include "demo/watermark/watermark.h"
-#endif
-#endif
-
 class ProjectileData;
 class GameBase;
 
@@ -45,10 +39,6 @@ class GameTSCtrl : public GuiTSCtrl
 private:
    typedef GuiTSCtrl Parent;
 
-#ifdef TORQUE_DEMO_WATERMARK
-   Watermark mWatermark;
-#endif
-
    void makeScriptCall(const char *func, const GuiEvent &evt) const;
 
 public:

+ 0 - 13
Engine/source/app/mainLoop.cpp

@@ -61,10 +61,6 @@
 // For the TickMs define... fix this for T2D...
 #include "T3D/gameBase/processList.h"
 
-#ifdef TORQUE_DEMO_PURCHASE
-#include "demo/pestTimer/pestTimer.h"
-#endif
-
 #ifdef TORQUE_ENABLE_VFS
 #include "platform/platformVFS.h"
 #endif
@@ -309,10 +305,6 @@ void StandardMainLoop::init()
    // Hook in for UDP notification
    Net::smPacketReceive.notify(GNet, &NetInterface::processPacketReceiveEvent);
 
-   #ifdef TORQUE_DEMO_PURCHASE
-   PestTimerinit();
-   #endif
-
    #ifdef TORQUE_DEBUG_GUARD
       Memory::flagCurrentAllocs( Memory::FLAG_Static );
    #endif
@@ -613,11 +605,6 @@ bool StandardMainLoop::doMainLoop()
       ThreadPool::processMainThreadWorkItems();
       Sampler::endFrame();
       PROFILE_END_NAMED(MainLoop);
-
-	  #ifdef TORQUE_DEMO_PURCHASE
-	  CheckTimer();
-	  CheckBlocker();
-	  #endif
    }
    
    return keepRunning;

+ 1 - 19
Engine/source/app/version.cpp

@@ -139,22 +139,4 @@ DefineConsoleFunction( getBuildString, const char*, (), , "Get the type of build
 #endif
 }
 
-ConsoleFunctionGroupEnd( CompileInformation );
-
-DefineConsoleFunction( isDemo, bool, (), , "")
-{
-#ifdef TORQUE_DEMO
-   return true;
-#else
-   return false;
-#endif
-}
-
-DefineConsoleFunction( isWebDemo, bool, (), , "")
-{
-#ifdef TORQUE_DEMO
-   return Platform::getWebDeployment();
-#else
-   return false;
-#endif
-}
+ConsoleFunctionGroupEnd( CompileInformation );

+ 0 - 4
Engine/source/console/consoleFunctions.cpp

@@ -34,10 +34,6 @@
 #include "core/util/journal/journal.h"
 #include "core/util/uuid.h"
 
-#ifdef TORQUE_DEMO_PURCHASE
-#include "gui/core/guiCanvas.h"
-#endif
-
 // This is a temporary hack to get tools using the library to
 // link in this module which contains no other references.
 bool LinkConsoleFunctions = false;

+ 0 - 37
Engine/source/gui/core/guiCanvas.cpp

@@ -144,23 +144,12 @@ GuiCanvas::GuiCanvas(): GuiControl(),
 #else
    mNumFences = 0;
 #endif
-
-#ifdef TORQUE_DEMO_PURCHASE
-   mPurchaseScreen = NULL;
-#endif
 }
 
 GuiCanvas::~GuiCanvas()
 {
    SAFE_DELETE(mPlatformWindow);
    SAFE_DELETE_ARRAY( mFences );
-
-#ifdef TORQUE_DEMO_PURCHASE
- //  if (mPurchaseScreen)
- //  {
- //     SAFE_DELETE(mPurchaseScreen);
- //  }
-#endif
 }
 
 //------------------------------------------------------------------------------
@@ -282,13 +271,6 @@ bool GuiCanvas::onAdd()
    // Define the menu bar for this canvas (if any)
    Con::executef(this, "onCreateMenu");
 
-#ifdef TORQUE_DEMO_PURCHASE
-   mPurchaseScreen = new PurchaseScreen;
-   mPurchaseScreen->init();
-
-   mLastPurchaseHideTime = 0;
-#endif
-
    Sim::findObject("PlatformGenericMenubar", mMenuBarCtrl);
 
    return parentRet;
@@ -296,11 +278,6 @@ bool GuiCanvas::onAdd()
 
 void GuiCanvas::onRemove()
 {
-#ifdef TORQUE_DEMO_PURCHASE
-   if (mPurchaseScreen && mPurchaseScreen->isAwake())
-      removeObject(mPurchaseScreen);
-#endif
-
    // And the process list
    Process::remove(this, &GuiCanvas::paint);
 
@@ -1362,11 +1339,6 @@ bool GuiCanvas::rootMouseWheelDown(const GuiEvent &event)
 
 void GuiCanvas::setContentControl(GuiControl *gui)
 {
-#ifdef TORQUE_DEMO_PURCHASE
-   if (mPurchaseScreen->isForceExit())
-      return;
-#endif
-
    // Skip out if we got passed NULL (why would that happen?)
    if(!gui)
       return;
@@ -1435,11 +1407,6 @@ GuiControl *GuiCanvas::getContentControl()
 
 void GuiCanvas::pushDialogControl(GuiControl *gui, S32 layer, bool center)
 {
-#ifdef TORQUE_DEMO_PURCHASE
-   if (mPurchaseScreen->isForceExit())
-      return;
-#endif
-
    if( center )
       gui->setPosition( getExtent().x / 2 - gui->getExtent().x / 2,
                         getExtent().y / 2 - gui->getExtent().y / 2 );
@@ -1956,10 +1923,6 @@ void GuiCanvas::renderFrame(bool preRenderOnly, bool bufferSwap /* = true */)
    // this situation is necessary because it needs to take the screenshot
    // before the buffers swap
 
-#ifdef TORQUE_DEMO_TIMEOUT
-   checkTimeOut();
-#endif  
-
    PROFILE_END();
 
    // Fence logic here, because this is where endScene is called.

+ 0 - 21
Engine/source/gui/core/guiCanvas.h

@@ -37,12 +37,6 @@
 #include "windowManager/platformWindowMgr.h"
 #include "gfx/gfxFence.h"
 
-#ifdef TORQUE_DEMO_PURCHASE
-#ifndef _PURCHASESCREEN_H_
-#include "demo/purchase/purchaseScreen.h"
-#endif
-#endif
-
 /// A canvas on which rendering occurs.
 ///
 ///
@@ -442,21 +436,6 @@ public:
 
 private:
    static const U32 MAX_GAMEPADS = 4; ///< The maximum number of supported gamepads
-
-#ifdef TORQUE_DEMO_PURCHASE
-private:
-   PurchaseScreen* mPurchaseScreen;
-   U32             mLastPurchaseHideTime;
-
-public:
-   void showPurchaseScreen(bool show, bool startBlocker, const char* location, bool doExit);
-   void updatePurchaseScreen(const char* value);
-#endif
-
-#ifdef TORQUE_DEMO_TIMEOUT
-private:
-   void checkTimeOut();
-#endif
 };
 
 #endif

+ 0 - 3
Templates/Empty/game/tools/gui/guiDialogs.ed.cs

@@ -36,6 +36,3 @@ exec("./guiObjectInspector.ed.cs");
 exec("./uvEditor.ed.gui");
 exec("./objectSelection.ed.cs");
 exec("./guiPlatformGenericMenubar.ed.cs");
-
-if (isDemo())
-   exec("./messageBoxOKBuy.ed.gui");

+ 0 - 85
Templates/Empty/game/tools/gui/messageBoxOKBuy.ed.gui

@@ -1,85 +0,0 @@
-//--- OBJECT WRITE BEGIN ---
-%guiContent = new GuiControl(MessageBoxOKBuyDlg) {
-	profile = "ToolsGuiDefaultProfile";
-	horizSizing = "width";
-	vertSizing = "height";
-	position = "0 0";
-	extent = "640 480";
-	minExtent = "8 8";
-	visible = "1";
-	helpTag = "0";
-
-	new GuiWindowCtrl(MBOKBuyFrame) {
-      profile = "ToolsGuiWindowProfile";
-      horizSizing = "center";
-      vertSizing = "center";
-      position = "170 175";
-      extent = "300 100";
-      minExtent = "48 92";
-      visible = "1";
-      helpTag = "0";
-      maxLength = "255";
-      resizeWidth = "1";
-      resizeHeight = "1";
-      canMove = "1";
-      canClose = "1";
-      canMinimize = "0";
-      canMaximize = "0";
-      minSize = "50 50";
-      text = "";
-      closeCommand = "MessageCallback(MessageBoxOKBuyDlg,MessageBoxOKBuyDlg.noCallback);";
-
-		new GuiMLTextCtrl(MBOKBuyText) {
-         profile = "ToolsGuiMLTextProfile";
-         horizSizing = "center";
-         vertSizing = "bottom";
-         position = "11 38";
-         extent = "280 14";
-         minExtent = "8 8";
-         visible = "1";
-         helpTag = "0";
-         lineSpacing = "2";
-         allowColorChars = "0";
-         maxChars = "-1";
-		};
-		new GuiButtonCtrl() {
-         profile = "ToolsGuiButtonProfile";
-         horizSizing = "right";
-         vertSizing = "top";
-         position = "70 68";
-         extent = "80 22";
-         minExtent = "8 8";
-         visible = "1";
-			command = "MessageCallback(MessageBoxOKBuyDlg,MessageBoxOKBuyDlg.OKCallback);";
-         accelerator = "return";
-         helpTag = "0";
-         text = "OK";
-         simpleStyle = "0";
-		};
-		new GuiButtonCtrl() {
-         profile = "ToolsGuiButtonProfile";
-         horizSizing = "right";
-         vertSizing = "top";
-         position = "167 68";
-         extent = "80 22";
-         minExtent = "8 8";
-         visible = "1";
-			command = "MessageCallback(MessageBoxOKBuyDlg,MessageBoxOKBuyDlg.BuyCallback);";
-         accelerator = "escape";
-         helpTag = "0";
-         text = "Buy Now!";
-         simpleStyle = "0";
-		};
-	};
-};
-//--- OBJECT WRITE END ---
-
-function MessageBoxOKBuy(%title, %message, %OKCallback, %BuyCallback)
-{
-   MBOKBuyFrame.text = %title;
-   MessageBoxOKBuyDlg.profile = "ToolsGuiOverlayProfile";
-   Canvas.pushDialog(MessageBoxOKBuyDlg);
-   MBSetText(MBOKBuyText, MBOKBuyFrame, %message);
-   MessageBoxOKBuyDlg.OKCallback = %OKCallback;
-   MessageBoxOKBuyDlg.BuyCallback = %BuyCallback;
-}

+ 0 - 6
Templates/Empty/game/tools/main.cs

@@ -131,12 +131,6 @@ package Tools
       Tools::LoadResources( $Tools::resourcePath );
       
       //$Scripts::ignoreDSOs = %toggle;
-      
-      if(isWebDemo())
-      {
-         // if this is the web tool demo lets init some value storage
-         //$clicks
-      }
    }
    
    function startToolTime(%tool)

+ 0 - 17
Templates/Empty/game/tools/navEditor/main.cs

@@ -272,20 +272,3 @@ function ESettingsWindowPopup::onSelect(%this)
    EditorSettings.setValue(%this.editorSettingsValue, %this.getText());
    eval(%this.editorSettingsRead);
 }
-
-//-----------------------------------------------------------------------------
-// Demo
-//-----------------------------------------------------------------------------
-
-function OnWalkaboutDemoLimit()
-{
-   MessageBoxOK("Walkabout demo",
-      "This demo only allows two NavMeshes to be created. Sorry!");
-}
-
-function OnWalkaboutDemoSave()
-{
-   MessageBoxOK("Walkabout demo",
-      "This demo doesn't allow you to save NavMeshes. Sorry!" SPC
-      "The rest of your mission will still be saved.");
-}

+ 0 - 3
Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs

@@ -561,9 +561,6 @@ function EditorGui::onWake( %this )
    
    if( %levelName !$= %this.levelName )
       %this.onNewLevelLoaded( %levelName );
-      
-   if (isObject(DemoEditorAlert) && DemoEditorAlert.helpTag<2)
-      Canvas.pushDialog(DemoEditorAlert);
 }
 
 function EditorGui::onSleep( %this )

+ 0 - 6
Templates/Empty/game/tools/worldEditor/scripts/editorPlugin.ed.cs

@@ -81,9 +81,6 @@ function EditorPlugin::onEditorSleep( %this )
 /// Push Gui's, stuff like that
 function EditorPlugin::onActivated( %this )
 {
-   if(isDemo())
-      startToolTime(%this.getName());
-      
    %this.isActivated = true;
 }
 
@@ -91,9 +88,6 @@ function EditorPlugin::onActivated( %this )
 /// Pop Gui's, stuff like that
 function EditorPlugin::onDeactivated( %this )
 {
-   if(isDemo())
-      endToolTime(%this.getName());
-      
    %this.isActivated = false;
 }
 

+ 0 - 18
Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs

@@ -176,12 +176,6 @@ function EWCreatorWindow::createStatic( %this, %file )
    if ( !$missionRunning )
       return;
 
-   if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
-   {
-      MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
-      return;
-   }
-
    if( !isObject(%this.objectGroup) )
       %this.setNewObjectGroup( MissionGroup );
 
@@ -200,12 +194,6 @@ function EWCreatorWindow::createPrefab( %this, %file )
    if ( !$missionRunning )
       return;
 
-   if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
-   {
-      MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
-      return;
-   }
-
    if( !isObject(%this.objectGroup) )
       %this.setNewObjectGroup( MissionGroup );
 
@@ -224,12 +212,6 @@ function EWCreatorWindow::createObject( %this, %cmd )
    if ( !$missionRunning )
       return;
 
-   if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
-   {
-      MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
-      return;
-   }
-      
    if( !isObject(%this.objectGroup) )
       %this.setNewObjectGroup( MissionGroup );
 

+ 144 - 191
Templates/Empty/game/tools/worldEditor/scripts/menuHandlers.ed.cs

@@ -28,9 +28,7 @@ $Pref::WorldEditor::FileSpec = "Torque Mission Files (*.mis)|*.mis|All Files (*.
 
 function EditorFileMenu::onMenuSelect(%this)
 {
-   // don't do this since it won't exist if this is a "demo"
-   if(!isWebDemo())
-      %this.enableItem(2, EditorIsDirty());
+   %this.enableItem(2, EditorIsDirty());
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -88,7 +86,7 @@ function EditorClearDirty()
 
 function EditorQuitGame()
 {
-   if( EditorIsDirty() && !isWebDemo())
+   if( EditorIsDirty())
    {
       MessageBoxYesNoCancel("Level Modified", "Would you like to save your changes before quitting?", "EditorSaveMissionMenu(); quit();", "quit();", "" );
    }
@@ -98,7 +96,7 @@ function EditorQuitGame()
 
 function EditorExitMission()
 {  
-   if( EditorIsDirty() && !isWebDemo() )
+   if( EditorIsDirty())
    {
       MessageBoxYesNoCancel("Level Modified", "Would you like to save your changes before exiting?", "EditorDoExitMission(true);", "EditorDoExitMission(false);", "");
    }
@@ -108,7 +106,7 @@ function EditorExitMission()
 
 function EditorDoExitMission(%saveFirst)
 {
-   if(%saveFirst && !isWebDemo())
+   if(%saveFirst)
    {
       EditorSaveMissionMenu();
    }
@@ -202,9 +200,6 @@ function EditorOpenDeclarationInTorsion( %object )
 
 function EditorNewLevel( %file )
 {
-   if(isWebDemo())
-      return;
-      
    %saveFirst = false;
    if ( EditorIsDirty() )
    {
@@ -241,28 +236,14 @@ function EditorNewLevel( %file )
 
 function EditorSaveMissionMenu()
 {
-   if(!$Pref::disableSaving && !isWebDemo())
-   {
-      if(EditorGui.saveAs)
-         EditorSaveMissionAs();
-      else
-         EditorSaveMission();
-   }
+   if(EditorGui.saveAs)
+      EditorSaveMissionAs();
    else
-   {
-      EditorSaveMissionMenuDisableSave();
-   }
+      EditorSaveMission();
 }
 
 function EditorSaveMission()
 {
-   // just save the mission without renaming it
-   if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
-   {
-      MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
-      return;
-   }
-   
    // first check for dirty and read-only files:
    if((EWorldEditor.isDirty || ETerrainEditor.isMissionDirty) && !isWriteableFileName($Server::MissionFile))
    {
@@ -316,146 +297,125 @@ function EditorSaveMission()
    return true;
 }
 
-function EditorSaveMissionMenuDisableSave()
-{
-   GenericPromptDialog-->GenericPromptWindow.text = "Warning";
-   GenericPromptDialog-->GenericPromptText.setText("Saving disabled in demo mode."); 
-   Canvas.pushDialog( GenericPromptDialog ); 
-}
-
 function EditorSaveMissionAs( %missionName )
 {
-   if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
-   {
-      MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
-      return;
-   }
-   
-   if(!$Pref::disableSaving && !isWebDemo())
+   // If we didn't get passed a new mission name then
+   // prompt the user for one.
+   if ( %missionName $= "" )
    {
-      // If we didn't get passed a new mission name then
-      // prompt the user for one.
-      if ( %missionName $= "" )
+      %dlg = new SaveFileDialog()
       {
-         %dlg = new SaveFileDialog()
-         {
-            Filters        = $Pref::WorldEditor::FileSpec;
-            DefaultPath    = EditorSettings.value("LevelInformation/levelsDirectory");
-            ChangePath     = false;
-            OverwritePrompt   = true;
-         };
-
-         %ret = %dlg.Execute();
-         if(%ret)
-         {
-            // Immediately override/set the levelsDirectory
-            EditorSettings.setValue( "LevelInformation/levelsDirectory", collapseFilename(filePath( %dlg.FileName )) );
-            
-            %missionName = %dlg.FileName;
-         }
-         
-         %dlg.delete();
+         Filters        = $Pref::WorldEditor::FileSpec;
+         DefaultPath    = EditorSettings.value("LevelInformation/levelsDirectory");
+         ChangePath     = false;
+         OverwritePrompt   = true;
+      };
+
+      %ret = %dlg.Execute();
+      if(%ret)
+      {
+         // Immediately override/set the levelsDirectory
+         EditorSettings.setValue( "LevelInformation/levelsDirectory", collapseFilename(filePath( %dlg.FileName )) );
          
-         if(! %ret)
-            return;
+         %missionName = %dlg.FileName;
       }
-                  
-      if( fileExt( %missionName ) !$= ".mis" )
-         %missionName = %missionName @ ".mis";
+      
+      %dlg.delete();
+      
+      if(! %ret)
+         return;
+   }
+               
+   if( fileExt( %missionName ) !$= ".mis" )
+      %missionName = %missionName @ ".mis";
 
-      EWorldEditor.isDirty = true;
-      %saveMissionFile = $Server::MissionFile;
+   EWorldEditor.isDirty = true;
+   %saveMissionFile = $Server::MissionFile;
 
-      $Server::MissionFile = %missionName;
+   $Server::MissionFile = %missionName;
 
-      %copyTerrainsFailed = false;
+   %copyTerrainsFailed = false;
 
-      // Rename all the terrain files.  Save all previous names so we can
-      // reset them if saving fails.
-      %newMissionName = fileBase(%missionName);
-      %oldMissionName = fileBase(%saveMissionFile);
-      
-      initContainerTypeSearch( $TypeMasks::TerrainObjectType );
-      %savedTerrNames = new ScriptObject();
-      for( %i = 0;; %i ++ )
-      {
-         %terrainObject = containerSearchNext();
-         if( !%terrainObject )
-            break;
+   // Rename all the terrain files.  Save all previous names so we can
+   // reset them if saving fails.
+   %newMissionName = fileBase(%missionName);
+   %oldMissionName = fileBase(%saveMissionFile);
+   
+   initContainerTypeSearch( $TypeMasks::TerrainObjectType );
+   %savedTerrNames = new ScriptObject();
+   for( %i = 0;; %i ++ )
+   {
+      %terrainObject = containerSearchNext();
+      if( !%terrainObject )
+         break;
 
-         %savedTerrNames.array[ %i ] = %terrainObject.terrainFile;
-         
-         %terrainFilePath = makeRelativePath( filePath( %terrainObject.terrainFile ), getMainDotCsDir() );
-         %terrainFileName = fileName( %terrainObject.terrainFile );
-                  
-         // Workaround to have terrains created in an unsaved "New Level..." mission
-         // moved to the correct place.
-         
-         if( EditorGui.saveAs && %terrainFilePath $= "tools/art/terrains" )
-            %terrainFilePath = "art/terrains";
-         
-         // Try and follow the existing naming convention.
-         // If we can't, use systematic terrain file names.
-         if( strstr( %terrainFileName, %oldMissionName ) >= 0 )
-            %terrainFileName = strreplace( %terrainFileName, %oldMissionName, %newMissionName );
-         else
-            %terrainFileName = %newMissionName @ "_" @ %i @ ".ter";
+      %savedTerrNames.array[ %i ] = %terrainObject.terrainFile;
+      
+      %terrainFilePath = makeRelativePath( filePath( %terrainObject.terrainFile ), getMainDotCsDir() );
+      %terrainFileName = fileName( %terrainObject.terrainFile );
+               
+      // Workaround to have terrains created in an unsaved "New Level..." mission
+      // moved to the correct place.
+      
+      if( EditorGui.saveAs && %terrainFilePath $= "tools/art/terrains" )
+         %terrainFilePath = "art/terrains";
+      
+      // Try and follow the existing naming convention.
+      // If we can't, use systematic terrain file names.
+      if( strstr( %terrainFileName, %oldMissionName ) >= 0 )
+         %terrainFileName = strreplace( %terrainFileName, %oldMissionName, %newMissionName );
+      else
+         %terrainFileName = %newMissionName @ "_" @ %i @ ".ter";
 
-         %newTerrainFile = %terrainFilePath @ "/" @ %terrainFileName;
+      %newTerrainFile = %terrainFilePath @ "/" @ %terrainFileName;
 
-         if (!isWriteableFileName(%newTerrainFile))
-         {
-            if (MessageBox("Error", "Terrain file \""@ %newTerrainFile @ "\" is read-only.  Continue?", "Ok", "Stop") == $MROk)
-               continue;
-            else
-            {
-               %copyTerrainsFailed = true;
-               break;
-            }
-         }
-         
-         if( !%terrainObject.save( %newTerrainFile ) )
+      if (!isWriteableFileName(%newTerrainFile))
+      {
+         if (MessageBox("Error", "Terrain file \""@ %newTerrainFile @ "\" is read-only.  Continue?", "Ok", "Stop") == $MROk)
+            continue;
+         else
          {
-            error( "Failed to save '" @ %newTerrainFile @ "'" );
             %copyTerrainsFailed = true;
             break;
          }
-         
-         %terrainObject.terrainFile = %newTerrainFile;
       }
-
-      ETerrainEditor.isDirty = false;
       
-      // Save the mission.
-      if(%copyTerrainsFailed || !EditorSaveMission())
+      if( !%terrainObject.save( %newTerrainFile ) )
       {
-         // It failed, so restore the mission and terrain filenames.
-         
-         $Server::MissionFile = %saveMissionFile;
-
-         initContainerTypeSearch( $TypeMasks::TerrainObjectType );
-         for( %i = 0;; %i ++ )
-         {
-            %terrainObject = containerSearchNext();
-            if( !%terrainObject )
-               break;
-               
-            %terrainObject.terrainFile = %savedTerrNames.array[ %i ];
-         }
+         error( "Failed to save '" @ %newTerrainFile @ "'" );
+         %copyTerrainsFailed = true;
+         break;
       }
       
-      %savedTerrNames.delete();
+      %terrainObject.terrainFile = %newTerrainFile;
    }
-   else
+
+   ETerrainEditor.isDirty = false;
+   
+   // Save the mission.
+   if(%copyTerrainsFailed || !EditorSaveMission())
    {
-      EditorSaveMissionMenuDisableSave();
+      // It failed, so restore the mission and terrain filenames.
+      
+      $Server::MissionFile = %saveMissionFile;
+
+      initContainerTypeSearch( $TypeMasks::TerrainObjectType );
+      for( %i = 0;; %i ++ )
+      {
+         %terrainObject = containerSearchNext();
+         if( !%terrainObject )
+            break;
+            
+         %terrainObject.terrainFile = %savedTerrNames.array[ %i ];
+      }
    }
    
+   %savedTerrNames.delete();
 }
 
 function EditorOpenMission(%filename)
 {
-   if( EditorIsDirty() && !isWebDemo() )
+   if( EditorIsDirty())
    {
       // "EditorSaveBeforeLoad();", "getLoadFilename(\"*.mis\", \"EditorDoLoadMission\");"
       if(MessageBox("Mission Modified", "Would you like to save changes to the current mission \"" @
@@ -523,72 +483,65 @@ function EditorOpenMission(%filename)
 
 function EditorExportToCollada()
 {
-   if ( !$Pref::disableSaving && !isWebDemo() )
+   %dlg = new SaveFileDialog()
    {
-      %dlg = new SaveFileDialog()
-      {
-         Filters        = "COLLADA Files (*.dae)|*.dae|";
-         DefaultPath    = $Pref::WorldEditor::LastPath;
-         DefaultFile    = "";
-         ChangePath     = false;
-         OverwritePrompt   = true;
-      };
-
-      %ret = %dlg.Execute();
-      if ( %ret )
-      {
-         $Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
-         %exportFile = %dlg.FileName;
-      }
+      Filters        = "COLLADA Files (*.dae)|*.dae|";
+      DefaultPath    = $Pref::WorldEditor::LastPath;
+      DefaultFile    = "";
+      ChangePath     = false;
+      OverwritePrompt   = true;
+   };
+
+   %ret = %dlg.Execute();
+   if ( %ret )
+   {
+      $Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
+      %exportFile = %dlg.FileName;
+   }
 
-      if( fileExt( %exportFile ) !$= ".dae" )
-         %exportFile = %exportFile @ ".dae";
+   if( fileExt( %exportFile ) !$= ".dae" )
+      %exportFile = %exportFile @ ".dae";
 
-      %dlg.delete();
+   %dlg.delete();
 
-      if ( !%ret )
-         return;
+   if ( !%ret )
+      return;
 
-      if ( EditorGui.currentEditor.getId() == ShapeEditorPlugin.getId() )
-         ShapeEdShapeView.exportToCollada( %exportFile );
-      else
-         EWorldEditor.colladaExportSelection( %exportFile );
-   }
+   if ( EditorGui.currentEditor.getId() == ShapeEditorPlugin.getId() )
+      ShapeEdShapeView.exportToCollada( %exportFile );
+   else
+      EWorldEditor.colladaExportSelection( %exportFile );
 }
 
 function EditorMakePrefab()
 {
-   // Should this be protected or not?
-   if ( !$Pref::disableSaving && !isWebDemo() )
+   %dlg = new SaveFileDialog()
    {
-      %dlg = new SaveFileDialog()
-      {
-         Filters        = "Prefab Files (*.prefab)|*.prefab|";
-         DefaultPath    = $Pref::WorldEditor::LastPath;
-         DefaultFile    = "";
-         ChangePath     = false;
-         OverwritePrompt   = true;
-      };
-            
-      %ret = %dlg.Execute();
-      if ( %ret )
-      {
-         $Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
-         %saveFile = %dlg.FileName;
-      }
-      
-      if( fileExt( %saveFile ) !$= ".prefab" )
-         %saveFile = %saveFile @ ".prefab";
-      
-      %dlg.delete();
-      
-      if ( !%ret )
-         return;
-      
-      EWorldEditor.makeSelectionPrefab( %saveFile );    
-      
-      EditorTree.buildVisibleTree( true );  
+      Filters        = "Prefab Files (*.prefab)|*.prefab|";
+      DefaultPath    = $Pref::WorldEditor::LastPath;
+      DefaultFile    = "";
+      ChangePath     = false;
+      OverwritePrompt   = true;
+   };
+         
+   %ret = %dlg.Execute();
+   if ( %ret )
+   {
+      $Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
+      %saveFile = %dlg.FileName;
    }
+   
+   if( fileExt( %saveFile ) !$= ".prefab" )
+      %saveFile = %saveFile @ ".prefab";
+   
+   %dlg.delete();
+   
+   if ( !%ret )
+      return;
+   
+   EWorldEditor.makeSelectionPrefab( %saveFile );    
+   
+   EditorTree.buildVisibleTree( true );  
 }
 
 function EditorExplodePrefab()

+ 21 - 28
Templates/Empty/game/tools/worldEditor/scripts/menus.ed.cs

@@ -112,35 +112,30 @@ function EditorGui::buildMenus(%this)
       barTitle = "File";
    };
    
-   if(!isWebDemo())
-   {
-      %fileMenu.appendItem("New Level" TAB "" TAB "schedule( 1, 0, \"EditorNewLevel\" );");
-      %fileMenu.appendItem("Open Level..." TAB %cmdCtrl SPC "O" TAB "schedule( 1, 0, \"EditorOpenMission\" );");
-      %fileMenu.appendItem("Save Level" TAB %cmdCtrl SPC "S" TAB "EditorSaveMissionMenu();");
-      %fileMenu.appendItem("Save Level As..." TAB "" TAB "EditorSaveMissionAs();");
-      %fileMenu.appendItem("-");
 
-      if( $platform $= "windows" )
-      {
-         %fileMenu.appendItem( "Open Project in Torsion" TAB "" TAB "EditorOpenTorsionProject();" );
-         %fileMenu.appendItem( "Open Level File in Torsion" TAB "" TAB "EditorOpenFileInTorsion();" );
-         %fileMenu.appendItem( "-" );
-      }
+   %fileMenu.appendItem("New Level" TAB "" TAB "schedule( 1, 0, \"EditorNewLevel\" );");
+   %fileMenu.appendItem("Open Level..." TAB %cmdCtrl SPC "O" TAB "schedule( 1, 0, \"EditorOpenMission\" );");
+   %fileMenu.appendItem("Save Level" TAB %cmdCtrl SPC "S" TAB "EditorSaveMissionMenu();");
+   %fileMenu.appendItem("Save Level As..." TAB "" TAB "EditorSaveMissionAs();");
+   %fileMenu.appendItem("-");
+
+   if( $platform $= "windows" )
+   {
+      %fileMenu.appendItem( "Open Project in Torsion" TAB "" TAB "EditorOpenTorsionProject();" );
+      %fileMenu.appendItem( "Open Level File in Torsion" TAB "" TAB "EditorOpenFileInTorsion();" );
+      %fileMenu.appendItem( "-" );
    }
    
    %fileMenu.appendItem("Create Blank Terrain" TAB "" TAB "Canvas.pushDialog( CreateNewTerrainGui );");        
    %fileMenu.appendItem("Import Terrain Heightmap" TAB "" TAB "Canvas.pushDialog( TerrainImportGui );");
    
-   if(!isWebDemo())
-   {
-      %fileMenu.appendItem("Export Terrain Heightmap" TAB "" TAB "Canvas.pushDialog( TerrainExportGui );");
-      %fileMenu.appendItem("-");
-      %fileMenu.appendItem("Export To COLLADA..." TAB "" TAB "EditorExportToCollada();");
-         //item[5] = "Import Terraform Data..." TAB "" TAB "Heightfield::import();";
-         //item[6] = "Import Texture Data..." TAB "" TAB "Texture::import();";
-         //item[7] = "-";
-         //item[8] = "Export Terraform Data..." TAB "" TAB "Heightfield::saveBitmap(\"\");";
-   }
+   %fileMenu.appendItem("Export Terrain Heightmap" TAB "" TAB "Canvas.pushDialog( TerrainExportGui );");
+   %fileMenu.appendItem("-");
+   %fileMenu.appendItem("Export To COLLADA..." TAB "" TAB "EditorExportToCollada();");
+      //item[5] = "Import Terraform Data..." TAB "" TAB "Heightfield::import();";
+      //item[6] = "Import Texture Data..." TAB "" TAB "Texture::import();";
+      //item[7] = "-";
+      //item[8] = "Export Terraform Data..." TAB "" TAB "Heightfield::saveBitmap(\"\");";
    
    %fileMenu.appendItem( "-" );
    %fileMenu.appendItem( "Add FMOD Designer Audio..." TAB "" TAB "AddFMODProjectDlg.show();" );
@@ -148,11 +143,9 @@ function EditorGui::buildMenus(%this)
    %fileMenu.appendItem("-");
    %fileMenu.appendItem("Play Level" TAB "F11" TAB "Editor.close(\"PlayGui\");");
       
-   if(!isWebDemo())
-   {
-      %fileMenu.appendItem("Exit Level" TAB "" TAB "EditorExitMission();");
-      %fileMenu.appendItem("Quit" TAB %quitShortcut TAB "EditorQuitGame();");
-   }
+   %fileMenu.appendItem("Exit Level" TAB "" TAB "EditorExitMission();");
+   %fileMenu.appendItem("Quit" TAB %quitShortcut TAB "EditorQuitGame();");
+
    %this.menuBar.insert(%fileMenu, %this.menuBar.getCount());
    
    // Edit Menu

+ 0 - 3
Templates/Full/game/tools/gui/guiDialogs.ed.cs

@@ -36,6 +36,3 @@ exec("./guiObjectInspector.ed.cs");
 exec("./uvEditor.ed.gui");
 exec("./objectSelection.ed.cs");
 exec("./guiPlatformGenericMenubar.ed.cs");
-
-if (isDemo())
-   exec("./messageBoxOKBuy.ed.gui");

+ 0 - 85
Templates/Full/game/tools/gui/messageBoxOKBuy.ed.gui

@@ -1,85 +0,0 @@
-//--- OBJECT WRITE BEGIN ---
-%guiContent = new GuiControl(MessageBoxOKBuyDlg) {
-	profile = "ToolsGuiDefaultProfile";
-	horizSizing = "width";
-	vertSizing = "height";
-	position = "0 0";
-	extent = "640 480";
-	minExtent = "8 8";
-	visible = "1";
-	helpTag = "0";
-
-	new GuiWindowCtrl(MBOKBuyFrame) {
-      profile = "ToolsGuiWindowProfile";
-      horizSizing = "center";
-      vertSizing = "center";
-      position = "170 175";
-      extent = "300 100";
-      minExtent = "48 92";
-      visible = "1";
-      helpTag = "0";
-      maxLength = "255";
-      resizeWidth = "1";
-      resizeHeight = "1";
-      canMove = "1";
-      canClose = "1";
-      canMinimize = "0";
-      canMaximize = "0";
-      minSize = "50 50";
-      text = "";
-      closeCommand = "MessageCallback(MessageBoxOKBuyDlg,MessageBoxOKBuyDlg.noCallback);";
-
-		new GuiMLTextCtrl(MBOKBuyText) {
-         profile = "ToolsGuiMLTextProfile";
-         horizSizing = "center";
-         vertSizing = "bottom";
-         position = "11 38";
-         extent = "280 14";
-         minExtent = "8 8";
-         visible = "1";
-         helpTag = "0";
-         lineSpacing = "2";
-         allowColorChars = "0";
-         maxChars = "-1";
-		};
-		new GuiButtonCtrl() {
-         profile = "ToolsGuiButtonProfile";
-         horizSizing = "right";
-         vertSizing = "top";
-         position = "70 68";
-         extent = "80 22";
-         minExtent = "8 8";
-         visible = "1";
-			command = "MessageCallback(MessageBoxOKBuyDlg,MessageBoxOKBuyDlg.OKCallback);";
-         accelerator = "return";
-         helpTag = "0";
-         text = "OK";
-         simpleStyle = "0";
-		};
-		new GuiButtonCtrl() {
-         profile = "ToolsGuiButtonProfile";
-         horizSizing = "right";
-         vertSizing = "top";
-         position = "167 68";
-         extent = "80 22";
-         minExtent = "8 8";
-         visible = "1";
-			command = "MessageCallback(MessageBoxOKBuyDlg,MessageBoxOKBuyDlg.BuyCallback);";
-         accelerator = "escape";
-         helpTag = "0";
-         text = "Buy Now!";
-         simpleStyle = "0";
-		};
-	};
-};
-//--- OBJECT WRITE END ---
-
-function MessageBoxOKBuy(%title, %message, %OKCallback, %BuyCallback)
-{
-   MBOKBuyFrame.text = %title;
-   MessageBoxOKBuyDlg.profile = "ToolsGuiOverlayProfile";
-   Canvas.pushDialog(MessageBoxOKBuyDlg);
-   MBSetText(MBOKBuyText, MBOKBuyFrame, %message);
-   MessageBoxOKBuyDlg.OKCallback = %OKCallback;
-   MessageBoxOKBuyDlg.BuyCallback = %BuyCallback;
-}

+ 0 - 6
Templates/Full/game/tools/main.cs

@@ -131,12 +131,6 @@ package Tools
       Tools::LoadResources( $Tools::resourcePath );
       
       //$Scripts::ignoreDSOs = %toggle;
-      
-      if(isWebDemo())
-      {
-         // if this is the web tool demo lets init some value storage
-         //$clicks
-      }
    }
    
    function startToolTime(%tool)

+ 0 - 17
Templates/Full/game/tools/navEditor/main.cs

@@ -272,20 +272,3 @@ function ESettingsWindowPopup::onSelect(%this)
    EditorSettings.setValue(%this.editorSettingsValue, %this.getText());
    eval(%this.editorSettingsRead);
 }
-
-//-----------------------------------------------------------------------------
-// Demo
-//-----------------------------------------------------------------------------
-
-function OnWalkaboutDemoLimit()
-{
-   MessageBoxOK("Walkabout demo",
-      "This demo only allows two NavMeshes to be created. Sorry!");
-}
-
-function OnWalkaboutDemoSave()
-{
-   MessageBoxOK("Walkabout demo",
-      "This demo doesn't allow you to save NavMeshes. Sorry!" SPC
-      "The rest of your mission will still be saved.");
-}

+ 0 - 3
Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs

@@ -561,9 +561,6 @@ function EditorGui::onWake( %this )
    
    if( %levelName !$= %this.levelName )
       %this.onNewLevelLoaded( %levelName );
-      
-   if (isObject(DemoEditorAlert) && DemoEditorAlert.helpTag<2)
-      Canvas.pushDialog(DemoEditorAlert);
 }
 
 function EditorGui::onSleep( %this )

+ 0 - 6
Templates/Full/game/tools/worldEditor/scripts/editorPlugin.ed.cs

@@ -81,9 +81,6 @@ function EditorPlugin::onEditorSleep( %this )
 /// Push Gui's, stuff like that
 function EditorPlugin::onActivated( %this )
 {
-   if(isDemo())
-      startToolTime(%this.getName());
-      
    %this.isActivated = true;
 }
 
@@ -91,9 +88,6 @@ function EditorPlugin::onActivated( %this )
 /// Pop Gui's, stuff like that
 function EditorPlugin::onDeactivated( %this )
 {
-   if(isDemo())
-      endToolTime(%this.getName());
-      
    %this.isActivated = false;
 }
 

+ 0 - 18
Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs

@@ -176,12 +176,6 @@ function EWCreatorWindow::createStatic( %this, %file )
    if ( !$missionRunning )
       return;
 
-   if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
-   {
-      MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
-      return;
-   }
-
    if( !isObject(%this.objectGroup) )
       %this.setNewObjectGroup( MissionGroup );
 
@@ -200,12 +194,6 @@ function EWCreatorWindow::createPrefab( %this, %file )
    if ( !$missionRunning )
       return;
 
-   if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
-   {
-      MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
-      return;
-   }
-
    if( !isObject(%this.objectGroup) )
       %this.setNewObjectGroup( MissionGroup );
 
@@ -224,12 +212,6 @@ function EWCreatorWindow::createObject( %this, %cmd )
    if ( !$missionRunning )
       return;
 
-   if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
-   {
-      MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
-      return;
-   }
-      
    if( !isObject(%this.objectGroup) )
       %this.setNewObjectGroup( MissionGroup );
 

+ 146 - 189
Templates/Full/game/tools/worldEditor/scripts/menuHandlers.ed.cs

@@ -28,9 +28,7 @@ $Pref::WorldEditor::FileSpec = "Torque Mission Files (*.mis)|*.mis|All Files (*.
 
 function EditorFileMenu::onMenuSelect(%this)
 {
-   // don't do this since it won't exist if this is a "demo"
-   if(!isWebDemo())
-      %this.enableItem(2, EditorIsDirty());
+   %this.enableItem(2, EditorIsDirty());
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -88,7 +86,7 @@ function EditorClearDirty()
 
 function EditorQuitGame()
 {
-   if( EditorIsDirty() && !isWebDemo())
+   if( EditorIsDirty())
    {
       MessageBoxYesNoCancel("Level Modified", "Would you like to save your changes before quitting?", "EditorSaveMissionMenu(); quit();", "quit();", "" );
    }
@@ -98,7 +96,7 @@ function EditorQuitGame()
 
 function EditorExitMission()
 {  
-   if( EditorIsDirty() && !isWebDemo() )
+   if( EditorIsDirty())
    {
       MessageBoxYesNoCancel("Level Modified", "Would you like to save your changes before exiting?", "EditorDoExitMission(true);", "EditorDoExitMission(false);", "");
    }
@@ -108,7 +106,7 @@ function EditorExitMission()
 
 function EditorDoExitMission(%saveFirst)
 {
-   if(%saveFirst && !isWebDemo())
+   if(%saveFirst)
    {
       EditorSaveMissionMenu();
    }
@@ -202,9 +200,6 @@ function EditorOpenDeclarationInTorsion( %object )
 
 function EditorNewLevel( %file )
 {
-   if(isWebDemo())
-      return;
-      
    %saveFirst = false;
    if ( EditorIsDirty() )
    {
@@ -241,27 +236,15 @@ function EditorNewLevel( %file )
 
 function EditorSaveMissionMenu()
 {
-   if(!$Pref::disableSaving && !isWebDemo())
-   {
-      if(EditorGui.saveAs)
-         EditorSaveMissionAs();
-      else
-         EditorSaveMission();
-   }
+   if(EditorGui.saveAs)
+      EditorSaveMissionAs();
    else
-   {
-      EditorSaveMissionMenuDisableSave();
-   }
+      EditorSaveMission();
 }
 
 function EditorSaveMission()
 {
    // just save the mission without renaming it
-   if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
-   {
-      MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
-      return;
-   }
    
    // first check for dirty and read-only files:
    if((EWorldEditor.isDirty || ETerrainEditor.isMissionDirty) && !isWriteableFileName($Server::MissionFile))
@@ -316,146 +299,125 @@ function EditorSaveMission()
    return true;
 }
 
-function EditorSaveMissionMenuDisableSave()
-{
-   GenericPromptDialog-->GenericPromptWindow.text = "Warning";
-   GenericPromptDialog-->GenericPromptText.setText("Saving disabled in demo mode."); 
-   Canvas.pushDialog( GenericPromptDialog ); 
-}
-
 function EditorSaveMissionAs( %missionName )
 {
-   if(isFunction("getObjectLimit") && MissionGroup.getFullCount() >= getObjectLimit())
-   {
-      MessageBoxOKBuy( "Object Limit Reached", "You have exceeded the object limit of " @ getObjectLimit() @ " for this demo. You can remove objects if you would like to add more.", "", "Canvas.showPurchaseScreen(\"objectlimit\");" );
-      return;
-   }
-   
-   if(!$Pref::disableSaving && !isWebDemo())
+   // If we didn't get passed a new mission name then
+   // prompt the user for one.
+   if ( %missionName $= "" )
    {
-      // If we didn't get passed a new mission name then
-      // prompt the user for one.
-      if ( %missionName $= "" )
+      %dlg = new SaveFileDialog()
       {
-         %dlg = new SaveFileDialog()
-         {
-            Filters        = $Pref::WorldEditor::FileSpec;
-            DefaultPath    = EditorSettings.value("LevelInformation/levelsDirectory");
-            ChangePath     = false;
-            OverwritePrompt   = true;
-         };
-
-         %ret = %dlg.Execute();
-         if(%ret)
-         {
-            // Immediately override/set the levelsDirectory
-            EditorSettings.setValue( "LevelInformation/levelsDirectory", collapseFilename(filePath( %dlg.FileName )) );
-            
-            %missionName = %dlg.FileName;
-         }
-         
-         %dlg.delete();
+         Filters        = $Pref::WorldEditor::FileSpec;
+         DefaultPath    = EditorSettings.value("LevelInformation/levelsDirectory");
+         ChangePath     = false;
+         OverwritePrompt   = true;
+      };
+
+      %ret = %dlg.Execute();
+      if(%ret)
+      {
+         // Immediately override/set the levelsDirectory
+         EditorSettings.setValue( "LevelInformation/levelsDirectory", collapseFilename(filePath( %dlg.FileName )) );
          
-         if(! %ret)
-            return;
+         %missionName = %dlg.FileName;
       }
-                  
-      if( fileExt( %missionName ) !$= ".mis" )
-         %missionName = %missionName @ ".mis";
+      
+      %dlg.delete();
+      
+      if(! %ret)
+         return;
+   }
+               
+   if( fileExt( %missionName ) !$= ".mis" )
+      %missionName = %missionName @ ".mis";
 
-      EWorldEditor.isDirty = true;
-      %saveMissionFile = $Server::MissionFile;
+   EWorldEditor.isDirty = true;
+   %saveMissionFile = $Server::MissionFile;
 
-      $Server::MissionFile = %missionName;
+   $Server::MissionFile = %missionName;
 
-      %copyTerrainsFailed = false;
+   %copyTerrainsFailed = false;
 
-      // Rename all the terrain files.  Save all previous names so we can
-      // reset them if saving fails.
-      %newMissionName = fileBase(%missionName);
-      %oldMissionName = fileBase(%saveMissionFile);
-      
-      initContainerTypeSearch( $TypeMasks::TerrainObjectType );
-      %savedTerrNames = new ScriptObject();
-      for( %i = 0;; %i ++ )
-      {
-         %terrainObject = containerSearchNext();
-         if( !%terrainObject )
-            break;
+   // Rename all the terrain files.  Save all previous names so we can
+   // reset them if saving fails.
+   %newMissionName = fileBase(%missionName);
+   %oldMissionName = fileBase(%saveMissionFile);
+   
+   initContainerTypeSearch( $TypeMasks::TerrainObjectType );
+   %savedTerrNames = new ScriptObject();
+   for( %i = 0;; %i ++ )
+   {
+      %terrainObject = containerSearchNext();
+      if( !%terrainObject )
+         break;
 
-         %savedTerrNames.array[ %i ] = %terrainObject.terrainFile;
-         
-         %terrainFilePath = makeRelativePath( filePath( %terrainObject.terrainFile ), getMainDotCsDir() );
-         %terrainFileName = fileName( %terrainObject.terrainFile );
-                  
-         // Workaround to have terrains created in an unsaved "New Level..." mission
-         // moved to the correct place.
-         
-         if( EditorGui.saveAs && %terrainFilePath $= "tools/art/terrains" )
-            %terrainFilePath = "art/terrains";
-         
-         // Try and follow the existing naming convention.
-         // If we can't, use systematic terrain file names.
-         if( strstr( %terrainFileName, %oldMissionName ) >= 0 )
-            %terrainFileName = strreplace( %terrainFileName, %oldMissionName, %newMissionName );
-         else
-            %terrainFileName = %newMissionName @ "_" @ %i @ ".ter";
+      %savedTerrNames.array[ %i ] = %terrainObject.terrainFile;
+      
+      %terrainFilePath = makeRelativePath( filePath( %terrainObject.terrainFile ), getMainDotCsDir() );
+      %terrainFileName = fileName( %terrainObject.terrainFile );
+               
+      // Workaround to have terrains created in an unsaved "New Level..." mission
+      // moved to the correct place.
+      
+      if( EditorGui.saveAs && %terrainFilePath $= "tools/art/terrains" )
+         %terrainFilePath = "art/terrains";
+      
+      // Try and follow the existing naming convention.
+      // If we can't, use systematic terrain file names.
+      if( strstr( %terrainFileName, %oldMissionName ) >= 0 )
+         %terrainFileName = strreplace( %terrainFileName, %oldMissionName, %newMissionName );
+      else
+         %terrainFileName = %newMissionName @ "_" @ %i @ ".ter";
 
-         %newTerrainFile = %terrainFilePath @ "/" @ %terrainFileName;
+      %newTerrainFile = %terrainFilePath @ "/" @ %terrainFileName;
 
-         if (!isWriteableFileName(%newTerrainFile))
-         {
-            if (MessageBox("Error", "Terrain file \""@ %newTerrainFile @ "\" is read-only.  Continue?", "Ok", "Stop") == $MROk)
-               continue;
-            else
-            {
-               %copyTerrainsFailed = true;
-               break;
-            }
-         }
-         
-         if( !%terrainObject.save( %newTerrainFile ) )
+      if (!isWriteableFileName(%newTerrainFile))
+      {
+         if (MessageBox("Error", "Terrain file \""@ %newTerrainFile @ "\" is read-only.  Continue?", "Ok", "Stop") == $MROk)
+            continue;
+         else
          {
-            error( "Failed to save '" @ %newTerrainFile @ "'" );
             %copyTerrainsFailed = true;
             break;
          }
-         
-         %terrainObject.terrainFile = %newTerrainFile;
       }
-
-      ETerrainEditor.isDirty = false;
       
-      // Save the mission.
-      if(%copyTerrainsFailed || !EditorSaveMission())
+      if( !%terrainObject.save( %newTerrainFile ) )
       {
-         // It failed, so restore the mission and terrain filenames.
-         
-         $Server::MissionFile = %saveMissionFile;
-
-         initContainerTypeSearch( $TypeMasks::TerrainObjectType );
-         for( %i = 0;; %i ++ )
-         {
-            %terrainObject = containerSearchNext();
-            if( !%terrainObject )
-               break;
-               
-            %terrainObject.terrainFile = %savedTerrNames.array[ %i ];
-         }
+         error( "Failed to save '" @ %newTerrainFile @ "'" );
+         %copyTerrainsFailed = true;
+         break;
       }
       
-      %savedTerrNames.delete();
+      %terrainObject.terrainFile = %newTerrainFile;
    }
-   else
+
+   ETerrainEditor.isDirty = false;
+   
+   // Save the mission.
+   if(%copyTerrainsFailed || !EditorSaveMission())
    {
-      EditorSaveMissionMenuDisableSave();
+      // It failed, so restore the mission and terrain filenames.
+      
+      $Server::MissionFile = %saveMissionFile;
+
+      initContainerTypeSearch( $TypeMasks::TerrainObjectType );
+      for( %i = 0;; %i ++ )
+      {
+         %terrainObject = containerSearchNext();
+         if( !%terrainObject )
+            break;
+            
+         %terrainObject.terrainFile = %savedTerrNames.array[ %i ];
+      }
    }
    
+   %savedTerrNames.delete();
 }
 
 function EditorOpenMission(%filename)
 {
-   if( EditorIsDirty() && !isWebDemo() )
+   if( EditorIsDirty())
    {
       // "EditorSaveBeforeLoad();", "getLoadFilename(\"*.mis\", \"EditorDoLoadMission\");"
       if(MessageBox("Mission Modified", "Would you like to save changes to the current mission \"" @
@@ -523,72 +485,67 @@ function EditorOpenMission(%filename)
 
 function EditorExportToCollada()
 {
-   if ( !$Pref::disableSaving && !isWebDemo() )
-   {
-      %dlg = new SaveFileDialog()
-      {
-         Filters        = "COLLADA Files (*.dae)|*.dae|";
-         DefaultPath    = $Pref::WorldEditor::LastPath;
-         DefaultFile    = "";
-         ChangePath     = false;
-         OverwritePrompt   = true;
-      };
 
-      %ret = %dlg.Execute();
-      if ( %ret )
-      {
-         $Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
-         %exportFile = %dlg.FileName;
-      }
+   %dlg = new SaveFileDialog()
+   {
+      Filters        = "COLLADA Files (*.dae)|*.dae|";
+      DefaultPath    = $Pref::WorldEditor::LastPath;
+      DefaultFile    = "";
+      ChangePath     = false;
+      OverwritePrompt   = true;
+   };
+
+   %ret = %dlg.Execute();
+   if ( %ret )
+   {
+      $Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
+      %exportFile = %dlg.FileName;
+   }
 
-      if( fileExt( %exportFile ) !$= ".dae" )
-         %exportFile = %exportFile @ ".dae";
+   if( fileExt( %exportFile ) !$= ".dae" )
+      %exportFile = %exportFile @ ".dae";
 
-      %dlg.delete();
+   %dlg.delete();
 
-      if ( !%ret )
-         return;
+   if ( !%ret )
+      return;
 
-      if ( EditorGui.currentEditor.getId() == ShapeEditorPlugin.getId() )
-         ShapeEdShapeView.exportToCollada( %exportFile );
-      else
-         EWorldEditor.colladaExportSelection( %exportFile );
-   }
+   if ( EditorGui.currentEditor.getId() == ShapeEditorPlugin.getId() )
+      ShapeEdShapeView.exportToCollada( %exportFile );
+   else
+      EWorldEditor.colladaExportSelection( %exportFile );
 }
 
 function EditorMakePrefab()
 {
-   // Should this be protected or not?
-   if ( !$Pref::disableSaving && !isWebDemo() )
+
+   %dlg = new SaveFileDialog()
    {
-      %dlg = new SaveFileDialog()
-      {
-         Filters        = "Prefab Files (*.prefab)|*.prefab|";
-         DefaultPath    = $Pref::WorldEditor::LastPath;
-         DefaultFile    = "";
-         ChangePath     = false;
-         OverwritePrompt   = true;
-      };
-            
-      %ret = %dlg.Execute();
-      if ( %ret )
-      {
-         $Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
-         %saveFile = %dlg.FileName;
-      }
-      
-      if( fileExt( %saveFile ) !$= ".prefab" )
-         %saveFile = %saveFile @ ".prefab";
-      
-      %dlg.delete();
-      
-      if ( !%ret )
-         return;
-      
-      EWorldEditor.makeSelectionPrefab( %saveFile );    
-      
-      EditorTree.buildVisibleTree( true );  
+      Filters        = "Prefab Files (*.prefab)|*.prefab|";
+      DefaultPath    = $Pref::WorldEditor::LastPath;
+      DefaultFile    = "";
+      ChangePath     = false;
+      OverwritePrompt   = true;
+   };
+         
+   %ret = %dlg.Execute();
+   if ( %ret )
+   {
+      $Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
+      %saveFile = %dlg.FileName;
    }
+   
+   if( fileExt( %saveFile ) !$= ".prefab" )
+      %saveFile = %saveFile @ ".prefab";
+   
+   %dlg.delete();
+   
+   if ( !%ret )
+      return;
+   
+   EWorldEditor.makeSelectionPrefab( %saveFile );    
+   
+   EditorTree.buildVisibleTree( true );  
 }
 
 function EditorExplodePrefab()

+ 21 - 28
Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs

@@ -112,35 +112,30 @@ function EditorGui::buildMenus(%this)
       barTitle = "File";
    };
    
-   if(!isWebDemo())
-   {
-      %fileMenu.appendItem("New Level" TAB "" TAB "schedule( 1, 0, \"EditorNewLevel\" );");
-      %fileMenu.appendItem("Open Level..." TAB %cmdCtrl SPC "O" TAB "schedule( 1, 0, \"EditorOpenMission\" );");
-      %fileMenu.appendItem("Save Level" TAB %cmdCtrl SPC "S" TAB "EditorSaveMissionMenu();");
-      %fileMenu.appendItem("Save Level As..." TAB "" TAB "EditorSaveMissionAs();");
-      %fileMenu.appendItem("-");
 
-      if( $platform $= "windows" )
-      {
-         %fileMenu.appendItem( "Open Project in Torsion" TAB "" TAB "EditorOpenTorsionProject();" );
-         %fileMenu.appendItem( "Open Level File in Torsion" TAB "" TAB "EditorOpenFileInTorsion();" );
-         %fileMenu.appendItem( "-" );
-      }
+   %fileMenu.appendItem("New Level" TAB "" TAB "schedule( 1, 0, \"EditorNewLevel\" );");
+   %fileMenu.appendItem("Open Level..." TAB %cmdCtrl SPC "O" TAB "schedule( 1, 0, \"EditorOpenMission\" );");
+   %fileMenu.appendItem("Save Level" TAB %cmdCtrl SPC "S" TAB "EditorSaveMissionMenu();");
+   %fileMenu.appendItem("Save Level As..." TAB "" TAB "EditorSaveMissionAs();");
+   %fileMenu.appendItem("-");
+
+   if( $platform $= "windows" )
+   {
+      %fileMenu.appendItem( "Open Project in Torsion" TAB "" TAB "EditorOpenTorsionProject();" );
+      %fileMenu.appendItem( "Open Level File in Torsion" TAB "" TAB "EditorOpenFileInTorsion();" );
+      %fileMenu.appendItem( "-" );
    }
    
    %fileMenu.appendItem("Create Blank Terrain" TAB "" TAB "Canvas.pushDialog( CreateNewTerrainGui );");        
    %fileMenu.appendItem("Import Terrain Heightmap" TAB "" TAB "Canvas.pushDialog( TerrainImportGui );");
    
-   if(!isWebDemo())
-   {
-      %fileMenu.appendItem("Export Terrain Heightmap" TAB "" TAB "Canvas.pushDialog( TerrainExportGui );");
-      %fileMenu.appendItem("-");
-      %fileMenu.appendItem("Export To COLLADA..." TAB "" TAB "EditorExportToCollada();");
-         //item[5] = "Import Terraform Data..." TAB "" TAB "Heightfield::import();";
-         //item[6] = "Import Texture Data..." TAB "" TAB "Texture::import();";
-         //item[7] = "-";
-         //item[8] = "Export Terraform Data..." TAB "" TAB "Heightfield::saveBitmap(\"\");";
-   }
+   %fileMenu.appendItem("Export Terrain Heightmap" TAB "" TAB "Canvas.pushDialog( TerrainExportGui );");
+   %fileMenu.appendItem("-");
+   %fileMenu.appendItem("Export To COLLADA..." TAB "" TAB "EditorExportToCollada();");
+      //item[5] = "Import Terraform Data..." TAB "" TAB "Heightfield::import();";
+      //item[6] = "Import Texture Data..." TAB "" TAB "Texture::import();";
+      //item[7] = "-";
+      //item[8] = "Export Terraform Data..." TAB "" TAB "Heightfield::saveBitmap(\"\");";
    
    %fileMenu.appendItem( "-" );
    %fileMenu.appendItem( "Add FMOD Designer Audio..." TAB "" TAB "AddFMODProjectDlg.show();" );
@@ -148,11 +143,9 @@ function EditorGui::buildMenus(%this)
    %fileMenu.appendItem("-");
    %fileMenu.appendItem("Play Level" TAB "F11" TAB "Editor.close(\"PlayGui\");");
       
-   if(!isWebDemo())
-   {
-      %fileMenu.appendItem("Exit Level" TAB "" TAB "EditorExitMission();");
-      %fileMenu.appendItem("Quit" TAB %quitShortcut TAB "EditorQuitGame();");
-   }
+   %fileMenu.appendItem("Exit Level" TAB "" TAB "EditorExitMission();");
+   %fileMenu.appendItem("Quit" TAB %quitShortcut TAB "EditorQuitGame();");
+
    %this.menuBar.insert(%fileMenu, %this.menuBar.getCount());
    
    // Edit Menu