Merge pull request #1339 from Areloch/Remove_Demo_Mode_Checks

Remove demo and trial checks
This commit is contained in:
Daniel Buckmaster 2015-07-23 20:33:31 +10:00
commit d268199f4f
25 changed files with 355 additions and 846 deletions

View file

@ -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
}
//--------------------------------------------------------------------------

View file

@ -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:

View file

@ -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;

View file

@ -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 );

View file

@ -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;

View file

@ -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.

View file

@ -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

View file

@ -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");

View file

@ -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;
}

View file

@ -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)

View file

@ -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.");
}

View file

@ -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 )

View file

@ -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;
}

View file

@ -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 );

View file

@ -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())
// If we didn't get passed a new mission name then
// prompt the user for one.
if ( %missionName $= "" )
{
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 $= "" )
%dlg = new SaveFileDialog()
{
%dlg = new SaveFileDialog()
{
Filters = $Pref::WorldEditor::FileSpec;
DefaultPath = EditorSettings.value("LevelInformation/levelsDirectory");
ChangePath = false;
OverwritePrompt = true;
};
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;
}
%ret = %dlg.Execute();
if(%ret)
{
// Immediately override/set the levelsDirectory
EditorSettings.setValue( "LevelInformation/levelsDirectory", collapseFilename(filePath( %dlg.FileName )) );
%dlg.delete();
if(! %ret)
return;
%missionName = %dlg.FileName;
}
if( fileExt( %missionName ) !$= ".mis" )
%missionName = %missionName @ ".mis";
EWorldEditor.isDirty = true;
%saveMissionFile = $Server::MissionFile;
$Server::MissionFile = %missionName;
%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);
%dlg.delete();
if(! %ret)
return;
}
if( fileExt( %missionName ) !$= ".mis" )
%missionName = %missionName @ ".mis";
EWorldEditor.isDirty = true;
%saveMissionFile = $Server::MissionFile;
$Server::MissionFile = %missionName;
%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;
%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;
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 ) )
{
error( "Failed to save '" @ %newTerrainFile @ "'" );
%copyTerrainsFailed = true;
break;
}
%terrainObject.terrainFile = %newTerrainFile;
}
ETerrainEditor.isDirty = false;
// Save the mission.
if(%copyTerrainsFailed || !EditorSaveMission())
{
// It failed, so restore the mission and terrain filenames.
$Server::MissionFile = %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";
%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 ) )
{
error( "Failed to save '" @ %newTerrainFile @ "'" );
%copyTerrainsFailed = true;
break;
}
%terrainObject.terrainFile = %newTerrainFile;
%terrainObject.terrainFile = %savedTerrNames.array[ %i ];
}
ETerrainEditor.isDirty = false;
// Save the mission.
if(%copyTerrainsFailed || !EditorSaveMission())
{
// 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();
}
else
{
EditorSaveMissionMenuDisableSave();
}
%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;
};
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";
%dlg.delete();
if ( !%ret )
return;
if ( EditorGui.currentEditor.getId() == ShapeEditorPlugin.getId() )
ShapeEdShapeView.exportToCollada( %exportFile );
else
EWorldEditor.colladaExportSelection( %exportFile );
%ret = %dlg.Execute();
if ( %ret )
{
$Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
%exportFile = %dlg.FileName;
}
if( fileExt( %exportFile ) !$= ".dae" )
%exportFile = %exportFile @ ".dae";
%dlg.delete();
if ( !%ret )
return;
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()

View file

@ -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

View file

@ -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");

View file

@ -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;
}

View file

@ -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)

View file

@ -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.");
}

View file

@ -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 )

View file

@ -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;
}

View file

@ -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 );

View file

@ -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())
// If we didn't get passed a new mission name then
// prompt the user for one.
if ( %missionName $= "" )
{
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 $= "" )
%dlg = new SaveFileDialog()
{
%dlg = new SaveFileDialog()
{
Filters = $Pref::WorldEditor::FileSpec;
DefaultPath = EditorSettings.value("LevelInformation/levelsDirectory");
ChangePath = false;
OverwritePrompt = true;
};
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;
}
%ret = %dlg.Execute();
if(%ret)
{
// Immediately override/set the levelsDirectory
EditorSettings.setValue( "LevelInformation/levelsDirectory", collapseFilename(filePath( %dlg.FileName )) );
%dlg.delete();
if(! %ret)
return;
%missionName = %dlg.FileName;
}
if( fileExt( %missionName ) !$= ".mis" )
%missionName = %missionName @ ".mis";
EWorldEditor.isDirty = true;
%saveMissionFile = $Server::MissionFile;
$Server::MissionFile = %missionName;
%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);
%dlg.delete();
if(! %ret)
return;
}
if( fileExt( %missionName ) !$= ".mis" )
%missionName = %missionName @ ".mis";
EWorldEditor.isDirty = true;
%saveMissionFile = $Server::MissionFile;
$Server::MissionFile = %missionName;
%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;
%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;
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 ) )
{
error( "Failed to save '" @ %newTerrainFile @ "'" );
%copyTerrainsFailed = true;
break;
}
%terrainObject.terrainFile = %newTerrainFile;
}
ETerrainEditor.isDirty = false;
// Save the mission.
if(%copyTerrainsFailed || !EditorSaveMission())
{
// It failed, so restore the mission and terrain filenames.
$Server::MissionFile = %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";
%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 ) )
{
error( "Failed to save '" @ %newTerrainFile @ "'" );
%copyTerrainsFailed = true;
break;
}
%terrainObject.terrainFile = %newTerrainFile;
%terrainObject.terrainFile = %savedTerrNames.array[ %i ];
}
ETerrainEditor.isDirty = false;
// Save the mission.
if(%copyTerrainsFailed || !EditorSaveMission())
{
// 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();
}
else
{
EditorSaveMissionMenuDisableSave();
}
%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()
{
%dlg = new SaveFileDialog()
{
Filters = "COLLADA Files (*.dae)|*.dae|";
DefaultPath = $Pref::WorldEditor::LastPath;
DefaultFile = "";
ChangePath = false;
OverwritePrompt = true;
};
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";
%dlg.delete();
if ( !%ret )
return;
if ( EditorGui.currentEditor.getId() == ShapeEditorPlugin.getId() )
ShapeEdShapeView.exportToCollada( %exportFile );
else
EWorldEditor.colladaExportSelection( %exportFile );
%ret = %dlg.Execute();
if ( %ret )
{
$Pref::WorldEditor::LastPath = filePath( %dlg.FileName );
%exportFile = %dlg.FileName;
}
if( fileExt( %exportFile ) !$= ".dae" )
%exportFile = %exportFile @ ".dae";
%dlg.delete();
if ( !%ret )
return;
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()

View file

@ -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