Shifts the tools messageboxes to be distinct from any messageboxes in the main game

Reorged the canvas handling of gamepad inputs for the axis and triggers to use the SI_ versions in the right spots
Fixed issue where pause menu would be hidden and not display again
Made the pause menu active from the gamepad start button rather than back
This commit is contained in:
Areloch 2020-07-24 00:40:03 -05:00
parent ef4cc8b573
commit 5b289bce5e
57 changed files with 217 additions and 217 deletions

View file

@ -1075,14 +1075,12 @@ bool GuiCanvas::processGamepadEvent(InputEventInfo &inputEvent)
switch (inputEvent.objInst) switch (inputEvent.objInst)
{ {
case XI_LEFT_TRIGGER: case SI_ZAXIS:
case XI_RIGHT_TRIGGER: case SI_RZAXIS:
return mFirstResponder->onGamepadTrigger(mLastEvent); return mFirstResponder->onGamepadTrigger(mLastEvent);
case SI_ZAXIS:
case SI_YAXIS: case SI_YAXIS:
case XI_THUMBLY: case SI_RYAXIS:
case XI_THUMBRY:
if (!negative) if (!negative)
{ {
return mFirstResponder->onGamepadAxisDown(mLastEvent); return mFirstResponder->onGamepadAxisDown(mLastEvent);
@ -1093,8 +1091,7 @@ bool GuiCanvas::processGamepadEvent(InputEventInfo &inputEvent)
} }
case SI_XAXIS: case SI_XAXIS:
case XI_THUMBLX: case SI_RXAXIS:
case XI_THUMBRX:
default: default:
if (negative) if (negative)
{ {

View file

@ -136,7 +136,7 @@ ExampleMoveMap.bind( gamepad, thumbly, "D", "-0.23 0.23", gamePadMoveY );
ExampleMoveMap.bind( gamepad, btn_a, jump ); ExampleMoveMap.bind( gamepad, btn_a, jump );
ExampleMoveMap.bind( gamepad, btn_x, moveup ); ExampleMoveMap.bind( gamepad, btn_x, moveup );
ExampleMoveMap.bind( gamepad, btn_y, movedown ); ExampleMoveMap.bind( gamepad, btn_y, movedown );
ExampleMoveMap.bindCmd( gamepad, btn_back, "Canvas.pushDialog(PauseMenu);", "" ); ExampleMoveMap.bindCmd( gamepad, btn_start, "Canvas.pushDialog(PauseMenu);", "" );
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Misc. // Misc.

View file

@ -9,6 +9,8 @@ function PauseMenu::onWake(%this)
{ {
$timescale = 0; $timescale = 0;
PauseMenuList.hidden = false;
PauseMenuList.setFirstResponder();
PauseButtonHolder.setActive(); PauseButtonHolder.setActive();
} }
@ -21,6 +23,7 @@ function PauseMenu::onSleep(%this)
function PauseMenu::onReturnTo(%this) function PauseMenu::onReturnTo(%this)
{ {
PauseMenuList.hidden = false; PauseMenuList.hidden = false;
PauseMenuList.setFirstResponder();
PauseButtonHolder.setActive(); PauseButtonHolder.setActive();
} }

View file

@ -283,7 +283,7 @@ function VerveEditorGroupBuilderGUI::_Build( %this, %groupLabel )
{ {
if ( %groupLabel $= "" ) if ( %groupLabel $= "" )
{ {
messageBox( "Warning", "You must provide a Valid Group Label.", "Ok" ); toolsMessageBox( "Warning", "You must provide a Valid Group Label.", "Ok" );
return; return;
} }

View file

@ -30,7 +30,7 @@ function VGroup::OnAdd( %this )
if ( %groupObject.isMemberOfClass( %ourClass ) ) if ( %groupObject.isMemberOfClass( %ourClass ) )
{ {
// Alert Message. // Alert Message.
messageBox( "Verve Editor", "You cannot have more than one \"" @ %ourClass @ "\" in your sequence.", "Ok", "Warning" ); toolsMessageBox( "Verve Editor", "You cannot have more than one \"" @ %ourClass @ "\" in your sequence.", "Ok", "Warning" );
// Invalid. // Invalid.
return false; return false;

View file

@ -172,7 +172,7 @@ function VerveEditor::SavePrompt()
return true; return true;
} }
%result = messageBox( "Verve Editor", "Save Changes to your sequence?", "SaveDontSave", "Warning" ); %result = toolsMessageBox( "Verve Editor", "Save Changes to your sequence?", "SaveDontSave", "Warning" );
if ( %result $= $MROk ) if ( %result $= $MROk )
{ {
// Save. // Save.
@ -189,7 +189,7 @@ function VerveEditor::SavePromptCancel()
return true; return true;
} }
%result = messageBox( "Verve Editor", "Save Changes to your sequence?", "SaveDontSaveCancel", "Warning" ); %result = toolsMessageBox( "Verve Editor", "Save Changes to your sequence?", "SaveDontSaveCancel", "Warning" );
if ( %result $= $MRCancel ) if ( %result $= $MRCancel )
{ {
return false; return false;

View file

@ -30,7 +30,7 @@ function VTrack::OnAdd( %this )
if ( %trackObject.isMemberOfClass( %ourClass ) ) if ( %trackObject.isMemberOfClass( %ourClass ) )
{ {
// Alert Message. // Alert Message.
messageBox( "Verve Editor", "You cannot have more than one \"" @ %ourClass @ "\" in a group.", "Ok", "Warning" ); toolsMessageBox( "Verve Editor", "You cannot have more than one \"" @ %ourClass @ "\" in a group.", "Ok", "Warning" );
// Invalid. // Invalid.
return false; return false;

View file

@ -928,7 +928,7 @@ function AssetBrowser::showDeleteDialog( %this )
if( isObject( %material ) ) if( isObject( %material ) )
{ {
MessageBoxYesNoCancel("Delete Material?", toolsMessageBoxYesNoCancel("Delete Material?",
"Are you sure you want to delete<br><br>" @ %material.getName() @ "<br><br> Material deletion won't take affect until the engine is quit.", "Are you sure you want to delete<br><br>" @ %material.getName() @ "<br><br> Material deletion won't take affect until the engine is quit.",
"AssetBrowser.deleteMaterial( " @ %material @ ", " @ %secondFilter @ ", " @ %secondFilterName @" );", "AssetBrowser.deleteMaterial( " @ %material @ ", " @ %secondFilter @ ", " @ %secondFilterName @" );",
"", "",
@ -2320,7 +2320,7 @@ function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position )
if(%path !$= AssetBrowser.dirHandler.CurrentAddress) if(%path !$= AssetBrowser.dirHandler.CurrentAddress)
{ {
//we're trying to move the asset to a different module! //we're trying to move the asset to a different module!
//MessageBoxYesNo( "Move Asset", "Do you wish to move asset " @ %assetName @ " to " @ %path @ "?", //toolsMessageBoxYesNo( "Move Asset", "Do you wish to move asset " @ %assetName @ " to " @ %path @ "?",
// "AssetBrowser.moveAsset(\""@ %moduleName @ ":" @ %assetName @"\", \""@%path@"\");", ""); // "AssetBrowser.moveAsset(\""@ %moduleName @ ":" @ %assetName @"\", \""@%path@"\");", "");
if(%assetType $= "Folder") if(%assetType $= "Folder")

View file

@ -422,19 +422,19 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this)
EditorSettings.value("Assets/AssetImporDefaultConfig") $= "" || EditorSettings.value("Assets/AssetImporDefaultConfig") $= "" ||
EditorSettings.value("Assets/AutoImport", false) == false) EditorSettings.value("Assets/AutoImport", false) == false)
{ {
MessageBoxOK("Unable to AutoImport", "Attempted to import a loose file " @ %filePath @ " with AutoImport but was unable to either due to lacking a valid import config, or the editor settings are not set to auto import."); toolsMessageBoxOK("Unable to AutoImport", "Attempted to import a loose file " @ %filePath @ " with AutoImport but was unable to either due to lacking a valid import config, or the editor settings are not set to auto import.");
return false; return false;
} }
if(%assetType $= "folder" || %assetType $= "zip") if(%assetType $= "folder" || %assetType $= "zip")
{ {
MessageBoxOK("Unable to AutoImport", "Unable to auto import folders or zips at this time"); toolsMessageBoxOK("Unable to AutoImport", "Unable to auto import folders or zips at this time");
return false; return false;
} }
if(%assetType $= "") if(%assetType $= "")
{ {
MessageBoxOK("Unable to AutoImport", "Unable to auto import unknown file type for file " @ %filePath); toolsMessageBoxOK("Unable to AutoImport", "Unable to auto import unknown file type for file " @ %filePath);
return false; return false;
} }
} }
@ -706,7 +706,7 @@ function ImportAssetWindow::doRefresh(%this)
if(ImportAssetWindow.importConfigsList.count() == 0) if(ImportAssetWindow.importConfigsList.count() == 0)
{ {
MessageBoxOK( "Warning", "No base import config. Please create an import configuration set to simplify asset importing."); toolsMessageBoxOK( "Warning", "No base import config. Please create an import configuration set to simplify asset importing.");
} }
%this.dirty = false; %this.dirty = false;
@ -978,7 +978,7 @@ function ImportAssetWindow::ImportAssets(%this)
if(!isObject(%module)) if(!isObject(%module))
{ {
MessageBoxOK( "Error!", "No module selected. You must select or create a module for the assets to be added to."); toolsMessageBoxOK( "Error!", "No module selected. You must select or create a module for the assets to be added to.");
return; return;
} }

View file

@ -168,7 +168,7 @@ function AssetImportConfigEditor::createNewImportConfig(%this)
function AssetImportConfigEditor::deleteConfig(%this) function AssetImportConfigEditor::deleteConfig(%this)
{ {
%callback = "AssetImportConfigEditor.onDeleteConfig();"; %callback = "AssetImportConfigEditor.onDeleteConfig();";
MessageBoxOKCancel("Delete Import Config", "This will delete the " @ AssetImportConfigList.currentConfig @ " config. Continue?", %callback, ""); toolsMessageBoxOKCancel("Delete Import Config", "This will delete the " @ AssetImportConfigList.currentConfig @ " config. Continue?", %callback, "");
} }
function AssetImportConfigEditor::onDeleteConfig(%this) function AssetImportConfigEditor::onDeleteConfig(%this)

View file

@ -349,7 +349,7 @@ function AssetBrowser::deleteAsset(%this)
//%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId); //%assetDef = AssetDatabase.acquireAsset(EditAssetPopup.assetId);
//%assetType = %assetDef.getClassName(); //%assetType = %assetDef.getClassName();
MessageBoxOKCancel("Warning!", "This will delete the selected content and the files associated to it, do you wish to continue?", toolsMessageBoxOKCancel("Warning!", "This will delete the selected content and the files associated to it, do you wish to continue?",
"AssetBrowser.confirmDeleteAsset();", ""); "AssetBrowser.confirmDeleteAsset();", "");
} }

View file

@ -20,7 +20,7 @@ function AssetBrowser::CreateNewModule(%this)
function AssetBrowser::promptNewModuleFolders(%this) function AssetBrowser::promptNewModuleFolders(%this)
{ {
MessageBoxYesNo("Create Folders?", toolsMessageBoxYesNo("Create Folders?",
"Do you want to create some common folders for organization of your new Module?", "Do you want to create some common folders for organization of your new Module?",
"AssetBrowser.makeModuleFolders();", //if yes, make the foldesr "AssetBrowser.makeModuleFolders();", //if yes, make the foldesr
"AssetBrowser.loadDirectories();"); //if no, just refresh "AssetBrowser.loadDirectories();"); //if no, just refresh

View file

@ -157,7 +157,7 @@ function CreateNewAsset()
if(%assetName $= "") if(%assetName $= "")
{ {
MessageBoxOK( "Error", "Attempted to make a new asset with no name!"); toolsMessageBoxOK( "Error", "Attempted to make a new asset with no name!");
return; return;
} }
@ -166,7 +166,7 @@ function CreateNewAsset()
if(%moduleName $= "") if(%moduleName $= "")
{ {
MessageBoxOK( "Error", "Attempted to make a new asset with no module!"); toolsMessageBoxOK( "Error", "Attempted to make a new asset with no module!");
return; return;
} }
@ -175,7 +175,7 @@ function CreateNewAsset()
%assetType = AssetBrowser.newAssetSettings.assetType; %assetType = AssetBrowser.newAssetSettings.assetType;
if(%assetType $= "") if(%assetType $= "")
{ {
MessageBoxOK( "Error", "Attempted to make a new asset with no type!"); toolsMessageBoxOK( "Error", "Attempted to make a new asset with no type!");
return; return;
} }

View file

@ -610,7 +610,7 @@ function DatablockEditorPlugin::deleteDatablock( %this )
// Show some confirmation. // Show some confirmation.
if( %numSelected == 1 ) if( %numSelected == 1 )
MessageBoxOk( "Datablock Deleted", "The datablock (" @ %db.getName() @ ") has been removed from " @ toolsMessageBoxOk( "Datablock Deleted", "The datablock (" @ %db.getName() @ ") has been removed from " @
"it's file (" @ %db.getFilename() @ ") and upon restart will cease to exist" ); "it's file (" @ %db.getFilename() @ ") and upon restart will cease to exist" );
} }
@ -622,7 +622,7 @@ function DatablockEditorPlugin::deleteDatablock( %this )
// Show confirmation for multiple datablocks. // Show confirmation for multiple datablocks.
if( %numSelected > 1 ) if( %numSelected > 1 )
MessageBoxOk( "Datablocks Deleted", "The datablocks have been deleted and upon restart will cease to exist." ); toolsMessageBoxOk( "Datablocks Deleted", "The datablocks have been deleted and upon restart will cease to exist." );
// Clear selection. // Clear selection.

View file

@ -141,7 +141,7 @@ function RetargetDecalButton::onClick( %this )
if( !isObject(%datablock) ) if( !isObject(%datablock) )
{ {
MessageBoxOK("Error", "A valid Decal Template must be selected."); toolsMessageBoxOK("Error", "A valid Decal Template must be selected.");
return; return;
} }
@ -184,7 +184,7 @@ function DeleteDecalButton::onClick( %this )
%id = DecalDataList.getSelectedItem(); %id = DecalDataList.getSelectedItem();
%datablock = DecalDataList.getItemText(%id ); %datablock = DecalDataList.getItemText(%id );
MessageBoxYesNoCancel("Delete Decal Datablock?", toolsMessageBoxYesNoCancel("Delete Decal Datablock?",
"Are you sure you want to delete<br><br>" @ %datablock @ "<br><br> Datablock deletion won't take affect until the engine is quit.", "Are you sure you want to delete<br><br>" @ %datablock @ "<br><br> Datablock deletion won't take affect until the engine is quit.",
"DecalEditorGui.deleteSelectedDecalDatablock();", "DecalEditorGui.deleteSelectedDecalDatablock();",
"", "",

View file

@ -95,7 +95,7 @@ function ProjectBase::_onProjectOpen( %this, %data )
if( !%this.LoadProject( %data ) ) if( !%this.LoadProject( %data ) )
{ {
messageBox("Unable to Load Project", "The project file you're attempting to open was created with an incompatible version of this software\n\nConversion of 1.1.X projects will be addressed soon, we apologize for the inconvenience.","Ok","Error"); toolsMessageBox("Unable to Load Project", "The project file you're attempting to open was created with an incompatible version of this software\n\nConversion of 1.1.X projects will be addressed soon, we apologize for the inconvenience.","Ok","Error");
return false; return false;
} }

View file

@ -40,7 +40,7 @@ function ForestEditorGui::onActiveForestUpdated( %this, %forest, %createNew )
// Give the user a chance to add a forest. // Give the user a chance to add a forest.
if ( !%gotForest && %createNew ) if ( !%gotForest && %createNew )
{ {
MessageBoxYesNo( "Forest", toolsMessageBoxYesNo( "Forest",
"There is not a Forest in this mission. Do you want to add one?", "There is not a Forest in this mission. Do you want to add one?",
%this @ ".createForest();", "" ); %this @ ".createForest();", "" );
return; return;
@ -245,7 +245,7 @@ function ForestEditorGui::deleteMesh( %this )
if ( isObject( %obj ) ) if ( isObject( %obj ) )
{ {
MessageBoxOKCancel( "Warning", toolsMessageBoxOKCancel( "Warning",
"Deleting this mesh will also delete BrushesElements and ForestItems referencing it.", "Deleting this mesh will also delete BrushesElements and ForestItems referencing it.",
"ForestEditorGui.okDeleteMesh(" @ %obj @ ");", "ForestEditorGui.okDeleteMesh(" @ %obj @ ");",
"" ); "" );
@ -389,7 +389,7 @@ function ForestEditBrushTree::handleRenameObject( %this, %name, %obj )
%found = ForestBrushGroup.findObjectByInternalName( %name ); %found = ForestBrushGroup.findObjectByInternalName( %name );
if ( isObject( %found ) && %found.getId() != %obj.getId() ) if ( isObject( %found ) && %found.getId() != %obj.getId() )
{ {
MessageBoxOK( "Error", "Brush or Element with that name already exists.", "" ); toolsMessageBoxOK( "Error", "Brush or Element with that name already exists.", "" );
// true as in, we handled it, don't rename the object. // true as in, we handled it, don't rename the object.
return true; return true;

View file

@ -205,7 +205,7 @@ function ForestEditorPlugin::onActivated( %this )
} }
if ( %this.showError ) if ( %this.showError )
MessageBoxOK( "Error", "Your tools/forestEditor folder does not contain a valid brushes.cs. Brushes you create will not be saved!" ); toolsMessageBoxOK( "Error", "Your tools/forestEditor folder does not contain a valid brushes.cs. Brushes you create will not be saved!" );
} }
function ForestEditorPlugin::onDeactivated( %this ) function ForestEditorPlugin::onDeactivated( %this )

View file

@ -1368,7 +1368,7 @@ function MaterialSelector::createFilter( %this, %filter )
{ {
if( %filter $= %existingFilters ) if( %filter $= %existingFilters )
{ {
MessageBoxOK( "Error", "Can not create blank filter."); toolsMessageBoxOK( "Error", "Can not create blank filter.");
return; return;
} }
@ -1377,7 +1377,7 @@ function MaterialSelector::createFilter( %this, %filter )
%existingFilters = MaterialSelector-->filterArray.getObject(%i).getObject(0).filter; %existingFilters = MaterialSelector-->filterArray.getObject(%i).getObject(0).filter;
if( %filter $= %existingFilters ) if( %filter $= %existingFilters )
{ {
MessageBoxOK( "Error", "Can not create two filters of the same name."); toolsMessageBoxOK( "Error", "Can not create two filters of the same name.");
return; return;
} }
} }
@ -1713,7 +1713,7 @@ function MaterialSelector::showDeleteDialog( %this )
if( isObject( %material ) ) if( isObject( %material ) )
{ {
MessageBoxYesNoCancel("Delete Material?", toolsMessageBoxYesNoCancel("Delete Material?",
"Are you sure you want to delete<br><br>" @ %material.getName() @ "<br><br> Material deletion won't take affect until the engine is quit.", "Are you sure you want to delete<br><br>" @ %material.getName() @ "<br><br> Material deletion won't take affect until the engine is quit.",
"MaterialSelector.deleteMaterial( " @ %material @ ", " @ %secondFilter @ ", " @ %secondFilterName @" );", "MaterialSelector.deleteMaterial( " @ %material @ ", " @ %secondFilter @ ", " @ %secondFilterName @" );",
"", "",

View file

@ -24,16 +24,16 @@
// Cleanup Dialog created by 'core' // Cleanup Dialog created by 'core'
if( isObject( MessagePopupDlg ) ) if( isObject( MessagePopupDlg ) )
MessagePopupDlg.delete(); MessagePopupDlg.delete();
if( isObject( MessageBoxYesNoDlg ) ) if( isObject( toolsMessageBoxYesNoDlg ) )
MessageBoxYesNoDlg.delete(); toolsMessageBoxYesNoDlg.delete();
if( isObject( MessageBoxYesNoCancelDlg ) ) if( isObject( toolsMessageBoxYesNoCancelDlg ) )
MessageBoxYesNoCancelDlg.delete(); toolsMessageBoxYesNoCancelDlg.delete();
if( isObject( MessageBoxOKCancelDetailsDlg ) ) if( isObject( toolsMessageBoxOKCancelDetailsDlg ) )
MessageBoxOKCancelDetailsDlg.delete(); toolsMessageBoxOKCancelDetailsDlg.delete();
if( isObject( MessageBoxOKCancelDlg ) ) if( isObject( toolsMessageBoxOKCancelDlg ) )
MessageBoxOKCancelDlg.delete(); toolsMessageBoxOKCancelDlg.delete();
if( isObject( MessageBoxOKDlg ) ) if( isObject( toolsMessageBoxOKDlg ) )
MessageBoxOKDlg.delete(); toolsMessageBoxOKDlg.delete();
if( isObject( IODropdownDlg ) ) if( isObject( IODropdownDlg ) )
IODropdownDlg.delete(); IODropdownDlg.delete();
@ -51,7 +51,7 @@ exec("./messagePopup.ed.gui");
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// Message Sound // Message Sound
// -------------------------------------------------------------------- // --------------------------------------------------------------------
/*new SFXDescription(MessageBoxAudioDescription) /*new SFXDescription(toolsMessageBoxAudioDescription)
{ {
volume = 1.0; volume = 1.0;
isLooping = false; isLooping = false;
@ -59,10 +59,10 @@ exec("./messagePopup.ed.gui");
channel = $GuiAudioType; channel = $GuiAudioType;
}; };
new SFXProfile(messageBoxBeep) new SFXProfile(toolsMessageBoxBeep)
{ {
filename = "./messageBoxSound"; filename = "./toolsMessageBoxSound";
description = MessageBoxAudioDescription; description = toolsMessageBoxAudioDescription;
preload = true; preload = true;
};*/ };*/
@ -122,7 +122,7 @@ function MBSetText(%text, %frame, %msg)
%frame.canMinimize = "0"; %frame.canMinimize = "0";
%frame.canMaximize = "0"; %frame.canMaximize = "0";
//sfxPlayOnce( messageBoxBeep ); //sfxPlayOnce( toolsMessageBoxBeep );
} }
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
@ -130,34 +130,34 @@ function MBSetText(%text, %frame, %msg)
// callback for each button. // callback for each button.
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
function MessageBoxOK(%title, %message, %callback) function toolsMessageBoxOK(%title, %message, %callback)
{ {
MBOKFrame.text = %title; MBOKFrame.text = %title;
Canvas.pushDialog(MessageBoxOKDlg); Canvas.pushDialog(toolsMessageBoxOKDlg);
MBSetText(MBOKText, MBOKFrame, %message); MBSetText(MBOKText, MBOKFrame, %message);
MessageBoxOKDlg.callback = %callback; toolsMessageBoxOKDlg.callback = %callback;
} }
function MessageBoxOKDlg::onSleep( %this ) function toolsMessageBoxOKDlg::onSleep( %this )
{ {
%this.callback = ""; %this.callback = "";
} }
function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback) function toolsMessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
{ {
MBOKCancelFrame.text = %title; MBOKCancelFrame.text = %title;
Canvas.pushDialog(MessageBoxOKCancelDlg); Canvas.pushDialog(toolsMessageBoxOKCancelDlg);
MBSetText(MBOKCancelText, MBOKCancelFrame, %message); MBSetText(MBOKCancelText, MBOKCancelFrame, %message);
MessageBoxOKCancelDlg.callback = %callback; toolsMessageBoxOKCancelDlg.callback = %callback;
MessageBoxOKCancelDlg.cancelCallback = %cancelCallback; toolsMessageBoxOKCancelDlg.cancelCallback = %cancelCallback;
} }
function MessageBoxOKCancelDlg::onSleep( %this ) function toolsMessageBoxOKCancelDlg::onSleep( %this )
{ {
%this.callback = ""; %this.callback = "";
} }
function MessageBoxOKCancelDetails(%title, %message, %details, %callback, %cancelCallback) function toolsMessageBoxOKCancelDetails(%title, %message, %details, %callback, %cancelCallback)
{ {
if(%details $= "") if(%details $= "")
{ {
@ -168,7 +168,7 @@ function MessageBoxOKCancelDetails(%title, %message, %details, %callback, %cance
MBOKCancelDetailsFrame.setText( %title ); MBOKCancelDetailsFrame.setText( %title );
Canvas.pushDialog(MessageBoxOKCancelDetailsDlg); Canvas.pushDialog(toolsMessageBoxOKCancelDetailsDlg);
MBSetText(MBOKCancelDetailsText, MBOKCancelDetailsFrame, %message); MBSetText(MBOKCancelDetailsText, MBOKCancelDetailsFrame, %message);
MBOKCancelDetailsInfoText.setText(%details); MBOKCancelDetailsInfoText.setText(%details);
@ -183,8 +183,8 @@ function MessageBoxOKCancelDetails(%title, %message, %details, %callback, %cance
MBOKCancelDetailsFrame.setExtent(300, %extentY); MBOKCancelDetailsFrame.setExtent(300, %extentY);
MessageBoxOKCancelDetailsDlg.callback = %callback; toolsMessageBoxOKCancelDetailsDlg.callback = %callback;
MessageBoxOKCancelDetailsDlg.cancelCallback = %cancelCallback; toolsMessageBoxOKCancelDetailsDlg.cancelCallback = %cancelCallback;
MBOKCancelDetailsFrame.defaultExtent = MBOKCancelDetailsFrame.getExtent(); MBOKCancelDetailsFrame.defaultExtent = MBOKCancelDetailsFrame.getExtent();
} }
@ -223,33 +223,33 @@ function MBOKCancelDetailsToggleInfoFrame()
} }
} }
function MessageBoxOKCancelDetailsDlg::onSleep( %this ) function toolsMessageBoxOKCancelDetailsDlg::onSleep( %this )
{ {
%this.callback = ""; %this.callback = "";
} }
function MessageBoxYesNo(%title, %message, %yesCallback, %noCallback) function toolsMessageBoxYesNo(%title, %message, %yesCallback, %noCallback)
{ {
MBYesNoFrame.text = %title; MBYesNoFrame.text = %title;
MessageBoxYesNoDlg.profile = "GuiOverlayProfile"; toolsMessageBoxYesNoDlg.profile = "GuiOverlayProfile";
Canvas.pushDialog(MessageBoxYesNoDlg); Canvas.pushDialog(toolsMessageBoxYesNoDlg);
MBSetText(MBYesNoText, MBYesNoFrame, %message); MBSetText(MBYesNoText, MBYesNoFrame, %message);
MessageBoxYesNoDlg.yesCallBack = %yesCallback; toolsMessageBoxYesNoDlg.yesCallBack = %yesCallback;
MessageBoxYesNoDlg.noCallback = %noCallBack; toolsMessageBoxYesNoDlg.noCallback = %noCallBack;
} }
function MessageBoxYesNoCancel(%title, %message, %yesCallback, %noCallback, %cancelCallback) function toolsMessageBoxYesNoCancel(%title, %message, %yesCallback, %noCallback, %cancelCallback)
{ {
MBYesNoCancelFrame.text = %title; MBYesNoCancelFrame.text = %title;
MessageBoxYesNoDlg.profile = "GuiOverlayProfile"; toolsMessageBoxYesNoDlg.profile = "GuiOverlayProfile";
Canvas.pushDialog(MessageBoxYesNoCancelDlg); Canvas.pushDialog(toolsMessageBoxYesNoCancelDlg);
MBSetText(MBYesNoCancelText, MBYesNoCancelFrame, %message); MBSetText(MBYesNoCancelText, MBYesNoCancelFrame, %message);
MessageBoxYesNoCancelDlg.yesCallBack = %yesCallback; toolsMessageBoxYesNoCancelDlg.yesCallBack = %yesCallback;
MessageBoxYesNoCancelDlg.noCallback = %noCallBack; toolsMessageBoxYesNoCancelDlg.noCallback = %noCallBack;
MessageBoxYesNoCancelDlg.cancelCallback = %cancelCallback; toolsMessageBoxYesNoCancelDlg.cancelCallback = %cancelCallback;
} }
function MessageBoxYesNoDlg::onSleep( %this ) function toolsMessageBoxYesNoDlg::onSleep( %this )
{ {
%this.yesCallback = ""; %this.yesCallback = "";
%this.noCallback = ""; %this.noCallback = "";
@ -311,15 +311,15 @@ function CloseMessagePopup()
// "Old" message box function aliases for backwards-compatibility. // "Old" message box function aliases for backwards-compatibility.
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
function MessageBoxOKOld( %title, %message, %callback ) function toolsMessageBoxOKOld( %title, %message, %callback )
{ {
MessageBoxOK( %title, %message, %callback ); toolsMessageBoxOK( %title, %message, %callback );
} }
function MessageBoxOKCancelOld( %title, %message, %callback, %cancelCallback ) function toolsMessageBoxOKCancelOld( %title, %message, %callback, %cancelCallback )
{ {
MessageBoxOKCancel( %title, %message, %callback, %cancelCallback ); toolsMessageBoxOKCancel( %title, %message, %callback, %cancelCallback );
} }
function MessageBoxYesNoOld( %title, %message, %yesCallback, %noCallback ) function toolsMessageBoxYesNoOld( %title, %message, %yesCallback, %noCallback )
{ {
MessageBoxYesNo( %title, %message, %yesCallback, %noCallback ); toolsMessageBoxYesNo( %title, %message, %yesCallback, %noCallback );
} }

View file

@ -1,5 +1,5 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MessageBoxOKDlg) { %guiContent = new GuiControl(toolsMessageBoxOKDlg) {
profile = "GuiOverlayProfile"; profile = "GuiOverlayProfile";
horizSizing = "width"; horizSizing = "width";
vertSizing = "height"; vertSizing = "height";
@ -49,7 +49,7 @@
extent = "80 24"; extent = "80 24";
minExtent = "8 8"; minExtent = "8 8";
visible = "1"; visible = "1";
command = "MessageCallback(MessageBoxOKDlg,MessageBoxOKDlg.callback);"; command = "MessageCallback(toolsMessageBoxOKDlg,toolsMessageBoxOKDlg.callback);";
accelerator = "return"; accelerator = "return";
helpTag = "0"; helpTag = "0";
text = "Ok"; text = "Ok";

View file

@ -1,5 +1,5 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MessageBoxOKBuyDlg) { %guiContent = new GuiControl(toolsMessageBoxOKBuyDlg) {
profile = "ToolsGuiDefaultProfile"; profile = "ToolsGuiDefaultProfile";
horizSizing = "width"; horizSizing = "width";
vertSizing = "height"; vertSizing = "height";
@ -27,7 +27,7 @@
canMaximize = "0"; canMaximize = "0";
minSize = "50 50"; minSize = "50 50";
text = ""; text = "";
closeCommand = "MessageCallback(MessageBoxOKBuyDlg,MessageBoxOKBuyDlg.noCallback);"; closeCommand = "MessageCallback(toolsMessageBoxOKBuyDlg,toolsMessageBoxOKBuyDlg.noCallback);";
new GuiMLTextCtrl(MBOKBuyText) { new GuiMLTextCtrl(MBOKBuyText) {
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
@ -50,7 +50,7 @@
extent = "80 22"; extent = "80 22";
minExtent = "8 8"; minExtent = "8 8";
visible = "1"; visible = "1";
command = "MessageCallback(MessageBoxOKBuyDlg,MessageBoxOKBuyDlg.OKCallback);"; command = "MessageCallback(toolsMessageBoxOKBuyDlg,toolsMessageBoxOKBuyDlg.OKCallback);";
accelerator = "return"; accelerator = "return";
helpTag = "0"; helpTag = "0";
text = "OK"; text = "OK";
@ -64,7 +64,7 @@
extent = "80 22"; extent = "80 22";
minExtent = "8 8"; minExtent = "8 8";
visible = "1"; visible = "1";
command = "MessageCallback(MessageBoxOKBuyDlg,MessageBoxOKBuyDlg.BuyCallback);"; command = "MessageCallback(toolsMessageBoxOKBuyDlg,toolsMessageBoxOKBuyDlg.BuyCallback);";
accelerator = "escape"; accelerator = "escape";
helpTag = "0"; helpTag = "0";
text = "Buy Now!"; text = "Buy Now!";
@ -74,12 +74,12 @@
}; };
//--- OBJECT WRITE END --- //--- OBJECT WRITE END ---
function MessageBoxOKBuy(%title, %message, %OKCallback, %BuyCallback) function toolsMessageBoxOKBuy(%title, %message, %OKCallback, %BuyCallback)
{ {
MBOKBuyFrame.text = %title; MBOKBuyFrame.text = %title;
MessageBoxOKBuyDlg.profile = "ToolsGuiOverlayProfile"; toolsMessageBoxOKBuyDlg.profile = "ToolsGuiOverlayProfile";
Canvas.pushDialog(MessageBoxOKBuyDlg); Canvas.pushDialog(toolsMessageBoxOKBuyDlg);
MBSetText(MBOKBuyText, MBOKBuyFrame, %message); MBSetText(MBOKBuyText, MBOKBuyFrame, %message);
MessageBoxOKBuyDlg.OKCallback = %OKCallback; toolsMessageBoxOKBuyDlg.OKCallback = %OKCallback;
MessageBoxOKBuyDlg.BuyCallback = %BuyCallback; toolsMessageBoxOKBuyDlg.BuyCallback = %BuyCallback;
} }

View file

@ -1,5 +1,5 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MessageBoxOKCancelDlg) { %guiContent = new GuiControl(toolsMessageBoxOKCancelDlg) {
profile = "GuiOverlayProfile"; profile = "GuiOverlayProfile";
horizSizing = "width"; horizSizing = "width";
vertSizing = "height"; vertSizing = "height";
@ -50,7 +50,7 @@
extent = "80 24"; extent = "80 24";
minExtent = "8 8"; minExtent = "8 8";
visible = "1"; visible = "1";
command = "MessageCallback(MessageBoxOKCancelDlg,MessageBoxOKCancelDlg.callback);"; command = "MessageCallback(toolsMessageBoxOKCancelDlg,toolsMessageBoxOKCancelDlg.callback);";
accelerator = "return"; accelerator = "return";
helpTag = "0"; helpTag = "0";
text = "Ok"; text = "Ok";
@ -64,7 +64,7 @@
extent = "80 24"; extent = "80 24";
minExtent = "8 8"; minExtent = "8 8";
visible = "1"; visible = "1";
command = "MessageCallback(MessageBoxOKCancelDlg,MessageBoxOKCancelDlg.cancelCallback);"; command = "MessageCallback(toolsMessageBoxOKCancelDlg,toolsMessageBoxOKCancelDlg.cancelCallback);";
accelerator = "escape"; accelerator = "escape";
helpTag = "0"; helpTag = "0";
text = "Cancel"; text = "Cancel";

View file

@ -1,5 +1,5 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MessageBoxOKCancelDetailsDlg) { %guiContent = new GuiControl(toolsMessageBoxOKCancelDetailsDlg) {
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
Profile = "GuiOverlayProfile"; Profile = "GuiOverlayProfile";
HorizSizing = "width"; HorizSizing = "width";
@ -57,7 +57,7 @@
MinExtent = "8 8"; MinExtent = "8 8";
canSave = "1"; canSave = "1";
Visible = "1"; Visible = "1";
Command = "MessageCallback(MessageBoxOKCancelDetailsDlg,MessageBoxOKCancelDetailsDlg.callback);"; Command = "MessageCallback(toolsMessageBoxOKCancelDetailsDlg,toolsMessageBoxOKCancelDetailsDlg.callback);";
Accelerator = "return"; Accelerator = "return";
hovertime = "1000"; hovertime = "1000";
text = "OK"; text = "OK";
@ -74,7 +74,7 @@
MinExtent = "8 8"; MinExtent = "8 8";
canSave = "1"; canSave = "1";
Visible = "1"; Visible = "1";
Command = "MessageCallback(MessageBoxOKCancelDetailsDlg,MessageBoxOKCancelDetailsDlg.cancelCallback);"; Command = "MessageCallback(toolsMessageBoxOKCancelDetailsDlg,toolsMessageBoxOKCancelDetailsDlg.cancelCallback);";
Accelerator = "escape"; Accelerator = "escape";
hovertime = "1000"; hovertime = "1000";
text = "CANCEL"; text = "CANCEL";

View file

@ -1,5 +1,5 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MessageBoxYesNoDlg) { %guiContent = new GuiControl(toolsMessageBoxYesNoDlg) {
profile = "GuiOverlayProfile"; profile = "GuiOverlayProfile";
horizSizing = "width"; horizSizing = "width";
vertSizing = "height"; vertSizing = "height";
@ -27,7 +27,7 @@
canMaximize = "0"; canMaximize = "0";
minSize = "50 50"; minSize = "50 50";
text = ""; text = "";
closeCommand = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.noCallback);"; closeCommand = "MessageCallback(toolsMessageBoxYesNoDlg,toolsMessageBoxYesNoDlg.noCallback);";
new GuiMLTextCtrl(MBYesNoText) { new GuiMLTextCtrl(MBYesNoText) {
profile = "ToolsGuiMLTextProfile"; profile = "ToolsGuiMLTextProfile";
@ -50,7 +50,7 @@
extent = "80 22"; extent = "80 22";
minExtent = "8 8"; minExtent = "8 8";
visible = "1"; visible = "1";
command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.yesCallback);"; command = "MessageCallback(toolsMessageBoxYesNoDlg,toolsMessageBoxYesNoDlg.yesCallback);";
accelerator = "return"; accelerator = "return";
helpTag = "0"; helpTag = "0";
text = "Yes"; text = "Yes";
@ -64,7 +64,7 @@
extent = "80 22"; extent = "80 22";
minExtent = "8 8"; minExtent = "8 8";
visible = "1"; visible = "1";
command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.noCallback);"; command = "MessageCallback(toolsMessageBoxYesNoDlg,toolsMessageBoxYesNoDlg.noCallback);";
accelerator = "escape"; accelerator = "escape";
helpTag = "0"; helpTag = "0";
text = "No"; text = "No";

View file

@ -1,5 +1,5 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MessageBoxYesNoCancelDlg) { %guiContent = new GuiControl(toolsMessageBoxYesNoCancelDlg) {
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
Profile = "GuiOverlayProfile"; Profile = "GuiOverlayProfile";
HorizSizing = "width"; HorizSizing = "width";
@ -31,7 +31,7 @@
canMaximize = "0"; canMaximize = "0";
minSize = "50 50"; minSize = "50 50";
text = ""; text = "";
closeCommand="MessageCallback(MessageBoxYesNoCancelDlg,MessageBoxYesNoCancelDlg.cancelCallback);"; closeCommand="MessageCallback(toolsMessageBoxYesNoCancelDlg,toolsMessageBoxYesNoCancelDlg.cancelCallback);";
new GuiMLTextCtrl(MBYesNoCancelText) { new GuiMLTextCtrl(MBYesNoCancelText) {
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
@ -58,7 +58,7 @@
MinExtent = "8 8"; MinExtent = "8 8";
canSave = "1"; canSave = "1";
Visible = "1"; Visible = "1";
Command = "MessageCallback(MessageBoxYesNoCancelDlg,MessageBoxYesNoCancelDlg.yesCallback);"; Command = "MessageCallback(toolsMessageBoxYesNoCancelDlg,toolsMessageBoxYesNoCancelDlg.yesCallback);";
Accelerator = "return"; Accelerator = "return";
hovertime = "1000"; hovertime = "1000";
text = "Yes"; text = "Yes";
@ -75,7 +75,7 @@
MinExtent = "8 8"; MinExtent = "8 8";
canSave = "1"; canSave = "1";
Visible = "1"; Visible = "1";
Command = "MessageCallback(MessageBoxYesNoCancelDlg,MessageBoxYesNoCancelDlg.noCallback);"; Command = "MessageCallback(toolsMessageBoxYesNoCancelDlg,toolsMessageBoxYesNoCancelDlg.noCallback);";
hovertime = "1000"; hovertime = "1000";
text = "No"; text = "No";
groupNum = "-1"; groupNum = "-1";
@ -91,7 +91,7 @@
MinExtent = "8 8"; MinExtent = "8 8";
canSave = "1"; canSave = "1";
Visible = "1"; Visible = "1";
Command = "MessageCallback(MessageBoxYesNoCancelDlg,MessageBoxYesNoCancelDlg.cancelCallback);"; Command = "MessageCallback(toolsMessageBoxYesNoCancelDlg,toolsMessageBoxYesNoCancelDlg.cancelCallback);";
Accelerator = "escape"; Accelerator = "escape";
hovertime = "1000"; hovertime = "1000";
text = "Cancel"; text = "Cancel";

View file

@ -1,5 +1,5 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MessageBoxSaveChangesDlg, EditorGuiGroup) { %guiContent = new GuiControl(toolsMessageBoxSaveChangesDlg, EditorGuiGroup) {
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
Profile = "ToolsGuiDefaultProfile"; Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width"; HorizSizing = "width";
@ -136,45 +136,45 @@
}; };
//--- OBJECT WRITE END --- //--- OBJECT WRITE END ---
function MessageBoxSaveChangesDlg::onWake( %this ) function toolsMessageBoxSaveChangesDlg::onWake( %this )
{ {
MBSaveChangesFrame.setText( %this.Data ); MBSaveChangesFrame.setText( %this.Data );
} }
function mbSaveDlgSaveButton::onClick( %this ) function mbSaveDlgSaveButton::onClick( %this )
{ {
if( MessageBoxSaveChangesDlg.SaveCallback !$= "" ) if( toolsMessageBoxSaveChangesDlg.SaveCallback !$= "" )
eval( MessageBoxSaveChangesDlg.SaveCallback @ "(" @ MessageBoxSaveChangesDlg.Data @ ");" ); eval( toolsMessageBoxSaveChangesDlg.SaveCallback @ "(" @ toolsMessageBoxSaveChangesDlg.Data @ ");" );
Canvas.popDialog( MessageBoxSaveChangesDlg ); Canvas.popDialog( toolsMessageBoxSaveChangesDlg );
} }
function mbSaveDlgCancelButton::onClick( %this ) function mbSaveDlgCancelButton::onClick( %this )
{ {
Canvas.popDialog( MessageBoxSaveChangesDlg ); Canvas.popDialog( toolsMessageBoxSaveChangesDlg );
} }
function mbSaveDlgDontButton::onClick( %this ) function mbSaveDlgDontButton::onClick( %this )
{ {
if( MessageBoxSaveChangesDlg.DontSaveCallback !$= "" ) if( toolsMessageBoxSaveChangesDlg.DontSaveCallback !$= "" )
eval( MessageBoxSaveChangesDlg.DontSaveCallback @ "(" @ MessageBoxSaveChangesDlg.Data @ ");" ); eval( toolsMessageBoxSaveChangesDlg.DontSaveCallback @ "(" @ toolsMessageBoxSaveChangesDlg.Data @ ");" );
Canvas.popDialog( MessageBoxSaveChangesDlg ); Canvas.popDialog( toolsMessageBoxSaveChangesDlg );
} }
// Deprecated when platform layers are all sufficient // Deprecated when platform layers are all sufficient
function checkSaveChangesOld( %data, %saveCallback, %dontSaveCallback ) function checkSaveChangesOld( %data, %saveCallback, %dontSaveCallback )
{ {
// Sanity Check // Sanity Check
if( MessageBoxSaveChangesDlg.isAwake() ) if( toolsMessageBoxSaveChangesDlg.isAwake() )
{ {
warn("Save Changes Dialog already Awake, NOT creating second instance."); warn("Save Changes Dialog already Awake, NOT creating second instance.");
return; return;
} }
// Set Proper State // Set Proper State
MessageBoxSaveChangesDlg.SaveCallback = %saveCallback; toolsMessageBoxSaveChangesDlg.SaveCallback = %saveCallback;
MessageBoxSaveChangesDlg.DontSaveCallback = %dontSaveCallback; toolsMessageBoxSaveChangesDlg.DontSaveCallback = %dontSaveCallback;
MessageBoxSaveChangesDlg.Data = %data; toolsMessageBoxSaveChangesDlg.Data = %data;
// Show Dialog // Show Dialog
Canvas.pushDialog( MessageBoxSaveChangesDlg ); Canvas.pushDialog( toolsMessageBoxSaveChangesDlg );
} }

View file

@ -51,7 +51,7 @@ function GE_OpenGUIFile()
// group. And, it should be the only thing in the group. // group. And, it should be the only thing in the group.
if( !isObject( %guiContent ) ) if( !isObject( %guiContent ) )
{ {
MessageBox( getEngineName(), toolsMessageBox( getEngineName(),
"You have loaded a Gui file that was created before this version. It has been loaded but you must open it manually from the content list dropdown", "You have loaded a Gui file that was created before this version. It has been loaded but you must open it manually from the content list dropdown",
"Ok", "Information" ); "Ok", "Information" );
GuiEditContent( Canvas.getContent() ); GuiEditContent( Canvas.getContent() );

View file

@ -32,7 +32,7 @@ function GuiEdit( %val )
{ {
if (Canvas.isFullscreen()) if (Canvas.isFullscreen())
{ {
MessageBoxOK("Windowed Mode Required", "Please switch to windowed mode to access the GUI Editor."); toolsMessageBoxOK("Windowed Mode Required", "Please switch to windowed mode to access the GUI Editor.");
return; return;
} }

View file

@ -283,7 +283,7 @@ function GuiEditCanvas::load( %this, %filename )
// group. And, it should be the only thing in the group. // group. And, it should be the only thing in the group.
if( !isObject( %guiContent ) ) if( !isObject( %guiContent ) )
{ {
MessageBox( getEngineName(), toolsMessageBox( getEngineName(),
"You have loaded a Gui file that was created before this version. It has been loaded but you must open it manually from the content list dropdown", "You have loaded a Gui file that was created before this version. It has been loaded but you must open it manually from the content list dropdown",
"Ok", "Information" ); "Ok", "Information" );
return 0; return 0;
@ -333,7 +333,7 @@ function GuiEditCanvas::save( %this, %selectedOnly, %noPrompt )
return; return;
else if( %selected.getCount() > 1 ) else if( %selected.getCount() > 1 )
{ {
MessageBox( "Invalid selection", "Only a single control hierarchy can be saved to a file. Make sure you have selected only one control in the tree view." ); toolsMessageBox( "Invalid selection", "Only a single control hierarchy can be saved to a file. Make sure you have selected only one control in the tree view." );
return; return;
} }
@ -464,7 +464,7 @@ function GuiEditCanvas::save( %this, %selectedOnly, %noPrompt )
GuiEditorStatusBar.print( "Saved file '" @ %currentObject.getFileName() @ "'" ); GuiEditorStatusBar.print( "Saved file '" @ %currentObject.getFileName() @ "'" );
} }
else else
MessageBox( "Error writing to file", "There was an error writing to file '" @ %currentFile @ "'. The file may be read-only.", "Ok", "Error" ); toolsMessageBox( "Error writing to file", "There was an error writing to file '" @ %currentFile @ "'. The file may be read-only.", "Ok", "Error" );
} }
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
@ -490,7 +490,7 @@ function GuiEditCanvas::append( %this )
if( !isObject( %guiContent ) ) if( !isObject( %guiContent ) )
{ {
MessageBox( "Error loading GUI file", "The GUI content controls could not be found. This function can only be used with files saved by the GUI editor.", "Ok", "Error" ); toolsMessageBox( "Error loading GUI file", "The GUI content controls could not be found. This function can only be used with files saved by the GUI editor.", "Ok", "Error" );
return; return;
} }
@ -519,7 +519,7 @@ function GuiEditCanvas::revert( %this )
if( %filename $= "" ) if( %filename $= "" )
return; return;
if( MessageBox( "Revert Gui", "Really revert the current Gui? This cannot be undone.", "OkCancel", "Question" ) == $MROk ) if( toolsMessageBox( "Revert Gui", "Really revert the current Gui? This cannot be undone.", "OkCancel", "Question" ) == $MROk )
%this.load( %filename ); %this.load( %filename );
} }

View file

@ -30,11 +30,11 @@ if( !isDefined( "$GuiEditor::GuiFilterList" ) )
$GuiEditor::GuiFilterList = $GuiEditor::GuiFilterList =
"GuiEditorGui" TAB "GuiEditorGui" TAB
"AL_ShadowVizOverlayCtrl" TAB "AL_ShadowVizOverlayCtrl" TAB
"MessageBoxOKDlg" TAB "toolsMessageBoxOKDlg" TAB
"MessageBoxOKCancelDlg" TAB "toolsMessageBoxOKCancelDlg" TAB
"MessageBoxOKCancelDetailsDlg" TAB "toolsMessageBoxOKCancelDetailsDlg" TAB
"MessageBoxYesNoDlg" TAB "toolsMessageBoxYesNoDlg" TAB
"MessageBoxYesNoCancelDlg" TAB "toolsMessageBoxYesNoCancelDlg" TAB
"MessagePopupDlg"; "MessagePopupDlg";
} }

View file

@ -81,7 +81,7 @@ function GuiEditorNewGuiDialog::onOK( %this )
if( isObject( %name ) && %name.isMemberOfClass( "GuiControl" ) ) if( isObject( %name ) && %name.isMemberOfClass( "GuiControl" ) )
{ {
if( MessageBox( "Warning", "Replace the existing control '" @ %name @ "'?", "OkCancel", "Question" ) == $MROk ) if( toolsMessageBox( "Warning", "Replace the existing control '" @ %name @ "'?", "OkCancel", "Question" ) == $MROk )
%name.delete(); %name.delete();
else else
return; return;

View file

@ -86,13 +86,13 @@ function GuiEditor::showDeleteProfileDialog( %this, %profile )
if( %profile.isInUse() ) if( %profile.isInUse() )
{ {
MessageBoxOk( "Error", toolsMessageBoxOk( "Error",
"The profile '" @ %profile.getName() @ "' is still used by Gui controls." "The profile '" @ %profile.getName() @ "' is still used by Gui controls."
); );
return; return;
} }
MessageBoxYesNo( "Delete Profile?", toolsMessageBoxYesNo( "Delete Profile?",
"Do you really want to delete '" @ %profile.getName() @ "'?", "Do you really want to delete '" @ %profile.getName() @ "'?",
"GuiEditor.deleteProfile( " @ %profile @ " );" "GuiEditor.deleteProfile( " @ %profile @ " );"
); );

View file

@ -436,7 +436,7 @@ function MaterialEditorGui::setActiveMaterial( %this, %material )
// Warn if selecting a CustomMaterial (they can't be properly previewed or edited) // Warn if selecting a CustomMaterial (they can't be properly previewed or edited)
if ( isObject( %material ) && %material.isMemberOfClass( "CustomMaterial" ) ) if ( isObject( %material ) && %material.isMemberOfClass( "CustomMaterial" ) )
{ {
MessageBoxOK( "Warning", "The selected Material (" @ %material.getName() @ toolsMessageBoxOK( "Warning", "The selected Material (" @ %material.getName() @
") is a CustomMaterial, and cannot be edited using the Material Editor." ); ") is a CustomMaterial, and cannot be edited using the Material Editor." );
return; return;
} }
@ -1794,7 +1794,7 @@ function MaterialEditorGui::addCubemap( %this,%cubemapName )
{ {
if( %cubemapName $= "" ) if( %cubemapName $= "" )
{ {
MessageBoxOK( "Error", "Can not create a cubemap without a valid name."); toolsMessageBoxOK( "Error", "Can not create a cubemap without a valid name.");
return; return;
} }
@ -1802,7 +1802,7 @@ function MaterialEditorGui::addCubemap( %this,%cubemapName )
{ {
if( %cubemapName $= RootGroup.getObject(%i).getName() ) if( %cubemapName $= RootGroup.getObject(%i).getName() )
{ {
MessageBoxOK( "Error", "There is already an object with the same name."); toolsMessageBoxOK( "Error", "There is already an object with the same name.");
return; return;
} }
} }
@ -1884,7 +1884,7 @@ function MaterialEditorGui::showDeleteCubemapDialog(%this)
if( isObject( %cubemap ) ) if( isObject( %cubemap ) )
{ {
MessageBoxYesNoCancel("Delete Cubemap?", toolsMessageBoxYesNoCancel("Delete Cubemap?",
"Are you sure you want to delete<br><br>" @ %cubemap.getName() @ "<br><br> Cubemap deletion won't take affect until the engine is quit.", "Are you sure you want to delete<br><br>" @ %cubemap.getName() @ "<br><br> Cubemap deletion won't take affect until the engine is quit.",
"MaterialEditorGui.deleteCubemap( " @ %cubemap @ ", " @ %idx @ " );", "MaterialEditorGui.deleteCubemap( " @ %cubemap @ ", " @ %idx @ " );",
"", "",
@ -1926,7 +1926,7 @@ function matEd_cubemapEd_availableCubemapList::onSelect( %this, %id, %cubemap )
if( matEd_cubemapEditor.dirty ) if( matEd_cubemapEditor.dirty )
{ {
%savedCubemap = MaterialEditorGui.currentCubemap; %savedCubemap = MaterialEditorGui.currentCubemap;
MessageBoxYesNoCancel("Save Existing Cubemap?", toolsMessageBoxYesNoCancel("Save Existing Cubemap?",
"Do you want to save changes to <br><br>" @ %savedCubemap.getName(), "Do you want to save changes to <br><br>" @ %savedCubemap.getName(),
"MaterialEditorGui.saveCubemap(" @ true @ ");", "MaterialEditorGui.saveCubemap(" @ true @ ");",
"MaterialEditorGui.saveCubemapDialogDontSave(" @ %cubemap @ ");", "MaterialEditorGui.saveCubemapDialogDontSave(" @ %cubemap @ ");",
@ -1942,7 +1942,7 @@ function MaterialEditorGui::showSaveCubemapDialog( %this )
if( !isObject(%cubemap) ) if( !isObject(%cubemap) )
return; return;
MessageBoxYesNoCancel("Save Cubemap?", toolsMessageBoxYesNoCancel("Save Cubemap?",
"Do you want to save changes to <br><br>" @ %cubemap.getName(), "Do you want to save changes to <br><br>" @ %cubemap.getName(),
"MaterialEditorGui.saveCubemap( " @ %cubemap @ " );", "MaterialEditorGui.saveCubemap( " @ %cubemap @ " );",
"", "",
@ -2070,7 +2070,7 @@ function MaterialEditorGui::copyCubemaps( %this, %copyFrom, %copyTo)
function MaterialEditorGui::showSaveDialog( %this, %toMaterial ) function MaterialEditorGui::showSaveDialog( %this, %toMaterial )
{ {
MessageBoxYesNoCancel("Save Material?", toolsMessageBoxYesNoCancel("Save Material?",
"The material " @ MaterialEditorGui.currentMaterial.getName() @ " has unsaved changes. <br>Do you want to save?", "The material " @ MaterialEditorGui.currentMaterial.getName() @ " has unsaved changes. <br>Do you want to save?",
"MaterialEditorGui.saveDialogSave(" @ %toMaterial @ ");", "MaterialEditorGui.saveDialogSave(" @ %toMaterial @ ");",
"MaterialEditorGui.saveDialogDontSave(" @ %toMaterial @ ");", "MaterialEditorGui.saveDialogDontSave(" @ %toMaterial @ ");",
@ -2081,7 +2081,7 @@ function MaterialEditorGui::showMaterialChangeSaveDialog( %this, %toMaterial )
{ {
%fromMaterial = MaterialEditorGui.currentMaterial; %fromMaterial = MaterialEditorGui.currentMaterial;
MessageBoxYesNoCancel("Save Material?", toolsMessageBoxYesNoCancel("Save Material?",
"The material " @ %fromMaterial.getName() @ " has unsaved changes. <br>Do you want to save before changing the material?", "The material " @ %fromMaterial.getName() @ " has unsaved changes. <br>Do you want to save before changing the material?",
"MaterialEditorGui.saveDialogSave(" @ %toMaterial @ "); MaterialEditorGui.changeMaterial(" @ %fromMaterial @ ", " @ %toMaterial @ ");", "MaterialEditorGui.saveDialogSave(" @ %toMaterial @ "); MaterialEditorGui.changeMaterial(" @ %fromMaterial @ ", " @ %toMaterial @ ");",
"MaterialEditorGui.saveDialogDontSave(" @ %toMaterial @ "); MaterialEditorGui.changeMaterial(" @ %fromMaterial @ ", " @ %toMaterial @ ");", "MaterialEditorGui.saveDialogDontSave(" @ %toMaterial @ "); MaterialEditorGui.changeMaterial(" @ %fromMaterial @ ", " @ %toMaterial @ ");",
@ -2091,7 +2091,7 @@ function MaterialEditorGui::showMaterialChangeSaveDialog( %this, %toMaterial )
/* /*
function MaterialEditorGui::showCreateNewMaterialSaveDialog( %this, %toMaterial ) function MaterialEditorGui::showCreateNewMaterialSaveDialog( %this, %toMaterial )
{ {
MessageBoxYesNoCancel("Save Material?", toolsMessageBoxYesNoCancel("Save Material?",
"The material " @ MaterialEditorGui.currentMaterial.getName() @ " has unsaved changes. <br>Do you want to save before changing the material?", "The material " @ MaterialEditorGui.currentMaterial.getName() @ " has unsaved changes. <br>Do you want to save before changing the material?",
"MaterialEditorGui.save(); MaterialEditorGui.createNewMaterial(" @ %toMaterial @ ");", "MaterialEditorGui.save(); MaterialEditorGui.createNewMaterial(" @ %toMaterial @ ");",
"MaterialEditorGui.saveDialogDontSave(" @ %toMaterial @ "); MaterialEditorGui.changeMaterial(" @ %toMaterial @ ");", "MaterialEditorGui.saveDialogDontSave(" @ %toMaterial @ "); MaterialEditorGui.changeMaterial(" @ %toMaterial @ ");",
@ -2133,7 +2133,7 @@ function MaterialEditorGui::save( %this )
{ {
if( MaterialEditorGui.currentMaterial.getName() $= "" ) if( MaterialEditorGui.currentMaterial.getName() $= "" )
{ {
MessageBoxOK("Cannot perform operation", "Saved materials cannot be named \"\". A name must be given before operation is performed" ); toolsMessageBoxOK("Cannot perform operation", "Saved materials cannot be named \"\". A name must be given before operation is performed" );
return; return;
} }
@ -2143,7 +2143,7 @@ function MaterialEditorGui::save( %this )
%currentMaterial = MaterialEditorGui.currentMaterial; %currentMaterial = MaterialEditorGui.currentMaterial;
if( %currentMaterial == -1 ) if( %currentMaterial == -1 )
{ {
MessageBoxOK("Cannot perform operation", "Could not locate material" ); toolsMessageBoxOK("Cannot perform operation", "Could not locate material" );
return; return;
} }
@ -2348,7 +2348,7 @@ function MaterialEditorGui::lookupMaterialInstances( %this )
{ {
if( MaterialEditorGui.currentMaterial.getName() $= "" ) if( MaterialEditorGui.currentMaterial.getName() $= "" )
{ {
MessageBoxOK("Cannot perform operation", "Unable to look up a material with a blank name" ); toolsMessageBoxOK("Cannot perform operation", "Unable to look up a material with a blank name" );
return; return;
} }

View file

@ -104,7 +104,7 @@ function MissionAreaEditorPlugin::setEditorFunction( %this )
%missionAreaExists = isObject(getMissionAreaServerObject()); %missionAreaExists = isObject(getMissionAreaServerObject());
if( %missionAreaExists == false ) if( %missionAreaExists == false )
MessageBoxYesNoCancel("No Mission Area","Would you like to create a New Mission Area?", "MissionAreaEditorPlugin.createNewMissionArea();"); toolsMessageBoxYesNoCancel("No Mission Area","Would you like to create a New Mission Area?", "MissionAreaEditorPlugin.createNewMissionArea();");
return %missionAreaExists; return %missionAreaExists;
} }

View file

@ -346,7 +346,7 @@ function CreateNewNavMeshDlg::create(%this)
%name = %this-->MeshName.getText(); %name = %this-->MeshName.getText();
if(%name $= "" || nameToID(%name) != -1) if(%name $= "" || nameToID(%name) != -1)
{ {
MessageBoxOk("Error", "A NavMesh must have a unique name!"); toolsMessageBoxOk("Error", "A NavMesh must have a unique name!");
return; return;
} }
@ -356,7 +356,7 @@ function CreateNewNavMeshDlg::create(%this)
{ {
if(!isObject(getScene(0))) if(!isObject(getScene(0)))
{ {
MessageBoxOk("Error", "You must have a Scene to use the mission bounds function."); toolsMessageBoxOk("Error", "You must have a Scene to use the mission bounds function.");
return; return;
} }
// Get maximum extents of all objects. // Get maximum extents of all objects.

View file

@ -132,7 +132,7 @@ function NavEditorPlugin::onActivated(%this)
if(!isObject(ServerNavMeshSet)) if(!isObject(ServerNavMeshSet))
new SimSet(ServerNavMeshSet); new SimSet(ServerNavMeshSet);
if(ServerNavMeshSet.getCount() == 0) if(ServerNavMeshSet.getCount() == 0)
MessageBoxYesNo("No NavMesh", "There is no NavMesh in this level. Would you like to create one?" SPC toolsMessageBoxYesNo("No NavMesh", "There is no NavMesh in this level. Would you like to create one?" SPC
"If not, please use the Nav Editor to create a new NavMesh.", "If not, please use the Nav Editor to create a new NavMesh.",
"Canvas.pushDialog(CreateNewNavMeshDlg);"); "Canvas.pushDialog(CreateNewNavMeshDlg);");
NavTreeView.open(ServerNavMeshSet, true); NavTreeView.open(ServerNavMeshSet, true);

View file

@ -122,7 +122,7 @@ function NavEditorGui::deleteSelected(%this)
case "SelectMode": case "SelectMode":
// Try to delete the selected NavMesh. // Try to delete the selected NavMesh.
if(isObject(NavEditorGui.selectedObject)) if(isObject(NavEditorGui.selectedObject))
MessageBoxYesNo("Warning", toolsMessageBoxYesNo("Warning",
"Are you sure you want to delete" SPC NavEditorGui.selectedObject.getName(), "Are you sure you want to delete" SPC NavEditorGui.selectedObject.getName(),
"NavEditorGui.deleteMesh();"); "NavEditorGui.deleteMesh();");
case "TestMode": case "TestMode":
@ -277,7 +277,7 @@ function NavEditorGui::followObject(%this)
{ {
eval("%obj = " @ %text); eval("%obj = " @ %text);
if(!isObject(%obj)) if(!isObject(%obj))
MessageBoxOk("Error", "Cannot find object" SPC %text); toolsMessageBoxOk("Error", "Cannot find object" SPC %text);
} }
if(isObject(%obj)) if(isObject(%obj))
%this.getPlayer().followObject(%obj, NavEditorOptionsWindow-->TestProperties->FollowRadius.getText()); %this.getPlayer().followObject(%obj, NavEditorOptionsWindow-->TestProperties->FollowRadius.getText());

View file

@ -420,7 +420,7 @@ function PE_EmitterEditor::updateParticlesFields( %this )
if( %changedEditParticle && PE_ParticleEditor.dirty ) if( %changedEditParticle && PE_ParticleEditor.dirty )
{ {
MessageBoxYesNoCancel("Save Particle Changes?", toolsMessageBoxYesNoCancel("Save Particle Changes?",
"Do you wish to save the changes made to the <br>current particle before changing the particle?", "Do you wish to save the changes made to the <br>current particle before changing the particle?",
"PE_ParticleEditor.saveParticle( " @ PE_ParticleEditor.currParticle.getName() @ " ); PE_EmitterEditor.updateEmitter( \"particles\"," @ %particles @ ");", "PE_ParticleEditor.saveParticle( " @ PE_ParticleEditor.currParticle.getName() @ " ); PE_EmitterEditor.updateEmitter( \"particles\"," @ %particles @ ");",
"PE_ParticleEditor.saveParticleDialogDontSave( " @ PE_ParticleEditor.currParticle.getName() @ " ); PE_EmitterEditor.updateEmitter( \"particles\"," @ %particles @ ");", "PE_ParticleEditor.saveParticleDialogDontSave( " @ PE_ParticleEditor.currParticle.getName() @ " ); PE_EmitterEditor.updateEmitter( \"particles\"," @ %particles @ ");",
@ -447,14 +447,14 @@ function PE_EmitterEditor::onNewEmitter( %this )
if( PE_ParticleEditor.dirty ) if( PE_ParticleEditor.dirty )
{ {
MessageBoxYesNo("Save Existing Particle?", toolsMessageBoxYesNo("Save Existing Particle?",
"Do you want to save changes to <br><br>" @ PE_ParticleEditor.currParticle.getName(), "Do you want to save changes to <br><br>" @ PE_ParticleEditor.currParticle.getName(),
"PE_ParticleEditor.saveParticle(" @ PE_ParticleEditor.currParticle @ ");" "PE_ParticleEditor.saveParticle(" @ PE_ParticleEditor.currParticle @ ");"
); );
} }
%savedEmitter = PE_EmitterEditor.currEmitter; %savedEmitter = PE_EmitterEditor.currEmitter;
MessageBoxYesNoCancel("Save Existing Emitter?", toolsMessageBoxYesNoCancel("Save Existing Emitter?",
"Do you want to save changes to <br><br>" @ %savedEmitter.getName(), "Do you want to save changes to <br><br>" @ %savedEmitter.getName(),
"PE_EmitterEditor.saveEmitter(" @ %savedEmitter@ "); PE_EmitterEditor.loadNewEmitter();", "PE_EmitterEditor.saveEmitter(" @ %savedEmitter@ "); PE_EmitterEditor.loadNewEmitter();",
"PE_EmitterEditor.saveEmitterDialogDontSave(" @ %savedEmitter @ "); PE_EmitterEditor.loadNewEmitter();" "PE_EmitterEditor.saveEmitterDialogDontSave(" @ %savedEmitter @ "); PE_EmitterEditor.loadNewEmitter();"
@ -527,7 +527,7 @@ function PE_EmitterEditor::showNewDialog( %this )
if( PE_ParticleEditor.dirty ) if( PE_ParticleEditor.dirty )
{ {
MessageBoxYesNo("Save Existing Particle?", toolsMessageBoxYesNo("Save Existing Particle?",
"Do you want to save changes to <br><br>" @ PE_ParticleEditor.currParticle.getName(), "Do you want to save changes to <br><br>" @ PE_ParticleEditor.currParticle.getName(),
"PE_ParticleEditor.saveParticle(" @ PE_ParticleEditor.currParticle @ ");" "PE_ParticleEditor.saveParticle(" @ PE_ParticleEditor.currParticle @ ");"
); );
@ -535,7 +535,7 @@ function PE_EmitterEditor::showNewDialog( %this )
if( PE_EmitterEditor.dirty ) if( PE_EmitterEditor.dirty )
{ {
MessageBoxYesNoCancel("Save Emitter Changes?", toolsMessageBoxYesNoCancel("Save Emitter Changes?",
"Do you wish to save the changes made to the <br>current emitter before changing the emitter?", "Do you wish to save the changes made to the <br>current emitter before changing the emitter?",
"PE_EmitterEditor.saveEmitter( " @ PE_EmitterEditor.currEmitter.getName() @ " ); PE_EmitterEditor.createEmitter();", "PE_EmitterEditor.saveEmitter( " @ PE_EmitterEditor.currEmitter.getName() @ " ); PE_EmitterEditor.createEmitter();",
"PE_EmitterEditor.saveEmitterDialogDontSave( " @ PE_EmitterEditor.currEmitter.getName() @ " ); PE_EmitterEditor.createEmitter();" "PE_EmitterEditor.saveEmitterDialogDontSave( " @ PE_EmitterEditor.currEmitter.getName() @ " ); PE_EmitterEditor.createEmitter();"
@ -579,13 +579,13 @@ function PE_EmitterEditor::showDeleteDialog( %this )
{ {
if( PE_EmitterEditor.currEmitter.getName() $= "DefaultEmitter" ) if( PE_EmitterEditor.currEmitter.getName() $= "DefaultEmitter" )
{ {
MessageBoxOK( "Error", "Cannot delete DefaultEmitter"); toolsMessageBoxOK( "Error", "Cannot delete DefaultEmitter");
return; return;
} }
if( isObject( PE_EmitterEditor.currEmitter ) ) if( isObject( PE_EmitterEditor.currEmitter ) )
{ {
MessageBoxYesNoCancel("Delete Emitter?", toolsMessageBoxYesNoCancel("Delete Emitter?",
"Are you sure you want to delete<br><br>" @ PE_EmitterEditor.currEmitter.getName() @ "<br><br> Emitter deletion won't take affect until the level is exited.", "Are you sure you want to delete<br><br>" @ PE_EmitterEditor.currEmitter.getName() @ "<br><br> Emitter deletion won't take affect until the level is exited.",
"PE_EmitterEditor.saveEmitterDialogDontSave( " @ PE_EmitterEditor.currEmitter.getName() @ " ); PE_EmitterEditor.deleteEmitter();" "PE_EmitterEditor.saveEmitterDialogDontSave( " @ PE_EmitterEditor.currEmitter.getName() @ " ); PE_EmitterEditor.deleteEmitter();"
); );

View file

@ -366,7 +366,7 @@ function PE_ParticleEditor::onNewParticle( %this )
// Load new particle if we're not in a dirty state // Load new particle if we're not in a dirty state
if( PE_ParticleEditor.dirty ) if( PE_ParticleEditor.dirty )
{ {
MessageBoxYesNoCancel("Save Existing Particle?", toolsMessageBoxYesNoCancel("Save Existing Particle?",
"Do you want to save changes to <br><br>" @ PE_ParticleEditor.currParticle.getName(), "Do you want to save changes to <br><br>" @ PE_ParticleEditor.currParticle.getName(),
"PE_ParticleEditor.saveParticle(" @ PE_ParticleEditor.currParticle @ ");", "PE_ParticleEditor.saveParticle(" @ PE_ParticleEditor.currParticle @ ");",
"PE_ParticleEditor.saveParticleDialogDontSave(" @ PE_ParticleEditor.currParticle @ "); PE_ParticleEditor.loadNewParticle();" "PE_ParticleEditor.saveParticleDialogDontSave(" @ PE_ParticleEditor.currParticle @ "); PE_ParticleEditor.loadNewParticle();"
@ -430,7 +430,7 @@ function PE_ParticleEditor::showNewDialog( %this, %replaceSlot )
// Open a dialog if the current Particle is dirty // Open a dialog if the current Particle is dirty
if( PE_ParticleEditor.dirty ) if( PE_ParticleEditor.dirty )
{ {
MessageBoxYesNoCancel("Save Particle Changes?", toolsMessageBoxYesNoCancel("Save Particle Changes?",
"Do you wish to save the changes made to the <br>current particle before changing the particle?", "Do you wish to save the changes made to the <br>current particle before changing the particle?",
"PE_ParticleEditor.saveParticle( " @ PE_ParticleEditor.currParticle.getName() @ " ); PE_ParticleEditor.createParticle( " @ %replaceSlot @ " );", "PE_ParticleEditor.saveParticle( " @ PE_ParticleEditor.currParticle.getName() @ " ); PE_ParticleEditor.createParticle( " @ %replaceSlot @ " );",
"PE_ParticleEditor.saveParticleDialogDontSave( " @ PE_ParticleEditor.currParticle.getName() @ " ); PE_ParticleEditor.createParticle( " @ %replaceSlot @ " );" "PE_ParticleEditor.saveParticleDialogDontSave( " @ PE_ParticleEditor.currParticle.getName() @ " ); PE_ParticleEditor.createParticle( " @ %replaceSlot @ " );"
@ -453,7 +453,7 @@ function PE_ParticleEditor::createParticle( %this, %replaceSlot )
%numExistingParticles = getWordCount( PE_EmitterEditor.currEmitter.particles ); %numExistingParticles = getWordCount( PE_EmitterEditor.currEmitter.particles );
if( %numExistingParticles > 3 ) if( %numExistingParticles > 3 )
{ {
MessageBoxOK( "Error", "An emitter cannot have more than 4 particles assigned to it." ); toolsMessageBoxOK( "Error", "An emitter cannot have more than 4 particles assigned to it." );
return; return;
} }
@ -493,7 +493,7 @@ function PE_ParticleEditor::showDeleteDialog( %this )
if( PE_ParticleEditor.currParticle.getName() $= "DefaultParticle" ) if( PE_ParticleEditor.currParticle.getName() $= "DefaultParticle" )
{ {
MessageBoxOK( "Error", "Cannot delete DefaultParticle"); toolsMessageBoxOK( "Error", "Cannot delete DefaultParticle");
return; return;
} }
@ -501,7 +501,7 @@ function PE_ParticleEditor::showDeleteDialog( %this )
if( getWordCount( PE_EmitterEditor.currEmitter.particles ) == 1 ) if( getWordCount( PE_EmitterEditor.currEmitter.particles ) == 1 )
{ {
MessageBoxOK( "Error", "At least one particle must remain on the particle emitter."); toolsMessageBoxOK( "Error", "At least one particle must remain on the particle emitter.");
return; return;
} }
@ -509,7 +509,7 @@ function PE_ParticleEditor::showDeleteDialog( %this )
if( isObject( PE_ParticleEditor.currParticle ) ) if( isObject( PE_ParticleEditor.currParticle ) )
{ {
MessageBoxYesNoCancel( "Delete Particle?", toolsMessageBoxYesNoCancel( "Delete Particle?",
"Are you sure you want to delete<br><br>" @ PE_ParticleEditor.currParticle.getName() @ "<br><br> Particle deletion won't take affect until the engine is quit.", "Are you sure you want to delete<br><br>" @ PE_ParticleEditor.currParticle.getName() @ "<br><br> Particle deletion won't take affect until the engine is quit.",
"PE_ParticleEditor.saveParticleDialogDontSave( " @ PE_ParticleEditor.currParticle.getName() @ " ); PE_ParticleEditor.deleteParticle();", "PE_ParticleEditor.saveParticleDialogDontSave( " @ PE_ParticleEditor.currParticle.getName() @ " ); PE_ParticleEditor.deleteParticle();",
"", "",

View file

@ -166,7 +166,7 @@ function RoadEditorPlugin::setEditorFunction( %this )
%terrainExists = parseMissionGroup( "TerrainBlock" ); %terrainExists = parseMissionGroup( "TerrainBlock" );
if( %terrainExists == false ) if( %terrainExists == false )
MessageBoxYesNoCancel("No Terrain","Would you like to create a New Terrain?", "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule, createTerrainBlock);"); toolsMessageBoxYesNoCancel("No Terrain","Would you like to create a New Terrain?", "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule, createTerrainBlock);");
return %terrainExists; return %terrainExists;
} }

View file

@ -62,7 +62,7 @@ function RoadEditorGui::onDeleteKey( %this )
} }
else else
{ {
MessageBoxOKCancel( "Notice", "Delete selected DecalRoad?", "RoadEditorGui.deleteRoad();", "" ); toolsMessageBoxOKCancel( "Notice", "Delete selected DecalRoad?", "RoadEditorGui.deleteRoad();", "" );
} }
} }

View file

@ -323,7 +323,7 @@ function ShapeEditorPlugin::openShape( %this, %path, %discardChangesToCurrent )
if( ShapeEditor.isDirty() && !%discardChangesToCurrent ) if( ShapeEditor.isDirty() && !%discardChangesToCurrent )
{ {
MessageBoxYesNo( "Save Changes?", toolsMessageBoxYesNo( "Save Changes?",
"Save changes to current shape?", "Save changes to current shape?",
"ShapeEditor.saveChanges(); ShapeEditorPlugin.openShape(\"" @ %path @ "\");", "ShapeEditor.saveChanges(); ShapeEditorPlugin.openShape(\"" @ %path @ "\");",
"ShapeEditorPlugin.openShape(\"" @ %path @ "\");" ); "ShapeEditorPlugin.openShape(\"" @ %path @ "\");" );

View file

@ -265,7 +265,7 @@ function ShapeEdSelectWindow::onSelect( %this, %path )
if ( ShapeEditor.isDirty() ) if ( ShapeEditor.isDirty() )
{ {
%cmd = "showImportDialog( \"" @ %path @ "\", \"ShapeEditor.selectShape( \\\"" @ %path @ "\\\", "; %cmd = "showImportDialog( \"" @ %path @ "\", \"ShapeEditor.selectShape( \\\"" @ %path @ "\\\", ";
MessageBoxYesNoCancel( "Shape Modified", "Would you like to save your changes?", %cmd @ "true );\" );", %cmd @ "false );\" );" ); toolsMessageBoxYesNoCancel( "Shape Modified", "Would you like to save your changes?", %cmd @ "true );\" );", %cmd @ "false );\" );" );
} }
else else
{ {
@ -296,7 +296,7 @@ function ShapeEditor::selectShape( %this, %path, %saveOld )
// Initialise the shape preview window // Initialise the shape preview window
if ( !ShapeEdShapeView.setModel( %path ) ) if ( !ShapeEdShapeView.setModel( %path ) )
{ {
MessageBoxOK( "Error", "Failed to load '" @ %path @ "'. Check the console for error messages." ); toolsMessageBoxOK( "Error", "Failed to load '" @ %path @ "'. Check the console for error messages." );
return; return;
} }
ShapeEdShapeView.fitToShape(); ShapeEdShapeView.fitToShape();
@ -1617,7 +1617,7 @@ function ShapeEdSequences::onEditBlend( %this )
%blendFrame = %this-->blendFrame.getText(); %blendFrame = %this-->blendFrame.getText();
if ( ( %blendSeq $= "" ) || ( %blendFrame $= "" ) ) if ( ( %blendSeq $= "" ) || ( %blendFrame $= "" ) )
{ {
MessageBoxOK( "Blend reference not set", "The blend reference sequence and " @ toolsMessageBoxOK( "Blend reference not set", "The blend reference sequence and " @
"frame must be set before changing the blend flag or frame." ); "frame must be set before changing the blend flag or frame." );
ShapeEdSequences-->blendFlag.setStateOn( %oldBlend ); ShapeEdSequences-->blendFlag.setStateOn( %oldBlend );
return; return;
@ -2231,7 +2231,7 @@ function ShapeEdSequences::onAddTrigger( %this )
%frame = mRound( ShapeEdSeqSlider.getValue() ) - %this-->startFrame.getText(); %frame = mRound( ShapeEdSeqSlider.getValue() ) - %this-->startFrame.getText();
if ((%frame < 0) || (%frame > %this-->endFrame.getText() - %this-->startFrame.getText())) if ((%frame < 0) || (%frame > %this-->endFrame.getText() - %this-->startFrame.getText()))
{ {
MessageBoxOK( "Error", "Trigger out of range of the selected animation." ); toolsMessageBoxOK( "Error", "Trigger out of range of the selected animation." );
} }
else else
{ {
@ -3157,7 +3157,7 @@ function ShapeEdColWindow::editCollision( %this )
if ( ( ShapeEditor.shape.getDetailLevelIndex( -1 ) >= 0 ) && if ( ( ShapeEditor.shape.getDetailLevelIndex( -1 ) >= 0 ) &&
( getField(%this.lastColSettings, 0) $= "" ) ) ( getField(%this.lastColSettings, 0) $= "" ) )
{ {
MessageBoxYesNo( "Warning", "Existing collision geometry at detail size " @ toolsMessageBoxYesNo( "Warning", "Existing collision geometry at detail size " @
"-1 will be removed, and this cannot be undone. Do you want to continue?", "-1 will be removed, and this cannot be undone. Do you want to continue?",
"ShapeEdColWindow.editCollisionOK();", "" ); "ShapeEdColWindow.editCollisionOK();", "" );
} }
@ -3366,7 +3366,7 @@ function ShapeEdMountWindow::mountShape( %this, %slot )
} }
else else
{ {
MessageBoxOK( "Error", "Failed to mount \"" @ %model @ "\". Check the console for error messages.", "" ); toolsMessageBoxOK( "Error", "Failed to mount \"" @ %model @ "\". Check the console for error messages.", "" );
} }
} }

View file

@ -95,7 +95,7 @@ function ShapeEditor::doAction( %this, %action )
} }
else else
{ {
MessageBoxOK( "Error", %action.actionName SPC "failed. Check the console for error messages.", "" ); toolsMessageBoxOK( "Error", %action.actionName SPC "failed. Check the console for error messages.", "" );
} }
} }
@ -108,7 +108,7 @@ function BaseShapeEdAction::redo( %this )
} }
else else
{ {
MessageBoxOK( "Error", "Redo" SPC %this.actionName SPC "failed. Check the console for error messages.", "" ); toolsMessageBoxOK( "Error", "Redo" SPC %this.actionName SPC "failed. Check the console for error messages.", "" );
} }
} }
@ -122,7 +122,7 @@ function BaseShapeEdAction::undo( %this )
function ShapeEditor::doRemoveShapeData( %this, %type, %name ) function ShapeEditor::doRemoveShapeData( %this, %type, %name )
{ {
// Removing data from the shape cannot be undone => so warn the user first // Removing data from the shape cannot be undone => so warn the user first
MessageBoxYesNo( "Warning", "Deleting a " @ %type @ " cannot be undone. Do " @ toolsMessageBoxYesNo( "Warning", "Deleting a " @ %type @ " cannot be undone. Do " @
"you want to continue?", "ShapeEditor.doRemove" @ %type @ "( \"" @ %name @ "\" );", "" ); "you want to continue?", "ShapeEditor.doRemove" @ %type @ "( \"" @ %name @ "\" );", "" );
} }

View file

@ -413,7 +413,7 @@ function ECameraSettingsPage::deleteCameraSettingsGroup( %this, %levelName, %rol
{ {
if( %levelName $= EditorGui.levelName ) if( %levelName $= EditorGui.levelName )
{ {
MessageBoxOK("Error", "You may not delete the settings group associated with the currently loaded level"); toolsMessageBoxOK("Error", "You may not delete the settings group associated with the currently loaded level");
return; return;
} }

View file

@ -238,7 +238,7 @@ function TerrainExportGui::export( %this )
%terrainObj = TerrainSelectListBox.getItemObject( %itemId ); %terrainObj = TerrainSelectListBox.getItemObject( %itemId );
if ( !isObject( %terrainObj ) ) if ( !isObject( %terrainObj ) )
{ {
MessageBoxOK( "Export failed", "Could not find the selected TerrainBlock!" ); toolsMessageBoxOK( "Export failed", "Could not find the selected TerrainBlock!" );
return; return;
} }

View file

@ -620,7 +620,7 @@ function TerrainImportGui::import( %this )
} }
else else
{ {
MessageBox( "Import Terrain", toolsMessageBox( "Import Terrain",
"Terrain import failed! Check console for error messages.", "Terrain import failed! Check console for error messages.",
"Ok", "Error" ); "Ok", "Error" );
} }

View file

@ -716,7 +716,7 @@ function ObjectBuilderGui::buildScatterSky( %this, %dontWarnAboutSun )
if( %object.isMemberOfClass( "Sun" ) ) if( %object.isMemberOfClass( "Sun" ) )
{ {
MessageBoxYesNo( "Warning", toolsMessageBoxYesNo( "Warning",
"A ScatterSky object will conflict with the Sun object that is already in the level." SPC "A ScatterSky object will conflict with the Sun object that is already in the level." SPC
"Do you still want to create a ScatterSky object?", "Do you still want to create a ScatterSky object?",
%this @ ".buildScatterSky( true );" ); %this @ ".buildScatterSky( true );" );
@ -812,7 +812,7 @@ function ObjectBuilderGui::buildSun( %this, %dontWarnAboutScatterSky )
if( %object.isMemberOfClass( "ScatterSky" ) ) if( %object.isMemberOfClass( "ScatterSky" ) )
{ {
MessageBoxYesNo( "Warning", toolsMessageBoxYesNo( "Warning",
"A Sun object will conflict with the ScatterSky object that is already in the level." SPC "A Sun object will conflict with the ScatterSky object that is already in the level." SPC
"Do you still want to create a Sun object?", "Do you still want to create a Sun object?",
%this @ ".buildSun( true );" ); %this @ ".buildSun( true );" );

View file

@ -45,7 +45,7 @@ function AddFMODProjectDlg::show( %this )
if( getField( sfxGetDeviceInfo(), $SFX::DEVICE_INFO_PROVIDER ) !$= "FMOD" ) if( getField( sfxGetDeviceInfo(), $SFX::DEVICE_INFO_PROVIDER ) !$= "FMOD" )
{ {
MessageBoxOK( "Error", toolsMessageBoxOK( "Error",
"You do not currently have FMOD selected as your sound system." NL "You do not currently have FMOD selected as your sound system." NL
"" NL "" NL
"To install FMOD, place the FMOD DLLs (" @ %fmodex @ " and " @ %fmodevent @ ")" SPC "To install FMOD, place the FMOD DLLs (" @ %fmodex @ " and " @ %fmodevent @ ")" SPC
@ -64,7 +64,7 @@ function AddFMODProjectDlg::show( %this )
%deviceCaps = getField( sfxGetDeviceInfo(), $SFX::DEVICE_INFO_CAPS ); %deviceCaps = getField( sfxGetDeviceInfo(), $SFX::DEVICE_INFO_CAPS );
if( !( %deviceCaps & $SFX::DEVICE_CAPS_FMODDESIGNER ) ) if( !( %deviceCaps & $SFX::DEVICE_CAPS_FMODDESIGNER ) )
{ {
MessageBoxOK( "Error", toolsMessageBoxOK( "Error",
"You do not have the requisite FMOD Event DLL in place." NL "You do not have the requisite FMOD Event DLL in place." NL
"" NL "" NL
"Please copy " @ %fmodevent @ " into your game/ folder and restart Torque." "Please copy " @ %fmodevent @ " into your game/ folder and restart Torque."
@ -114,14 +114,14 @@ function AddFMODProjectDlg::onOK( %this )
if( %fileName $= "" ) if( %fileName $= "" )
{ {
MessageBoxOK( "Error", toolsMessageBoxOK( "Error",
"Please enter a project file name." "Please enter a project file name."
); );
return; return;
} }
if( !isFile( %fileName ) ) if( !isFile( %fileName ) )
{ {
MessageBoxOK( "Error", toolsMessageBoxOK( "Error",
"'" @ %fileName @ "' is not a valid file." "'" @ %fileName @ "' is not a valid file."
); );
return; return;
@ -131,7 +131,7 @@ function AddFMODProjectDlg::onOK( %this )
if( !isDirectory( %mediaPath ) ) if( !isDirectory( %mediaPath ) )
{ {
MessageBoxOK( "Error", toolsMessageBoxOK( "Error",
"'" @ %mediaPath @ "' is not a valid directory." "'" @ %mediaPath @ "' is not a valid directory."
); );
return; return;
@ -155,7 +155,7 @@ function AddFMODProjectDlg::onOK( %this )
if( !isObject( %objName ) ) if( !isObject( %objName ) )
{ {
MessageBoxOK( "Error", toolsMessageBoxOK( "Error",
"Failed to create the object. Please take a look at the log for details." "Failed to create the object. Please take a look at the log for details."
); );
return; return;

View file

@ -2088,7 +2088,7 @@ function EWorldEditor::addSimGroup( %this, %groupCurrentSelection )
%activeSelection = %this.getActiveSelection(); %activeSelection = %this.getActiveSelection();
if ( %activeSelection.getObjectIndex( getScene(0) ) != -1 ) if ( %activeSelection.getObjectIndex( getScene(0) ) != -1 )
{ {
MessageBoxOK( "Error", "Cannot add Scene to a new SimGroup" ); toolsMessageBoxOK( "Error", "Cannot add Scene to a new SimGroup" );
return; return;
} }

View file

@ -84,7 +84,7 @@ function EManageSFXParameters::createNewParameter( %this, %name )
function EManageSFXParameters::showDeleteParameterDlg( %this, %parameter ) function EManageSFXParameters::showDeleteParameterDlg( %this, %parameter )
{ {
MessageBoxOkCancel( "Confirmation", toolsMessageBoxOkCancel( "Confirmation",
"Really delete '" @ %parameter.getInternalName() @ "'?" NL "Really delete '" @ %parameter.getInternalName() @ "'?" NL
"" NL "" NL
"The parameter will be removed from the file '" @ %parameter.getFileName() @ "'.", "The parameter will be removed from the file '" @ %parameter.getFileName() @ "'.",

View file

@ -133,7 +133,7 @@ function ESelectObjectsWindow::onSelectObjects( %this, %val, %reuseExistingSet )
{ {
if( !%name.isMemberOfClass( "WorldEditorSelection" ) ) if( !%name.isMemberOfClass( "WorldEditorSelection" ) )
{ {
MessageBoxOk( "Error", toolsMessageBoxOk( "Error",
"An object called '" @ %name @ "' already exists and is not a selection." NL "An object called '" @ %name @ "' already exists and is not a selection." NL
"" NL "" NL
"Please choose a different name." ); "Please choose a different name." );
@ -141,7 +141,7 @@ function ESelectObjectsWindow::onSelectObjects( %this, %val, %reuseExistingSet )
} }
else if( !%reuseExistingSet ) else if( !%reuseExistingSet )
{ {
MessageBoxYesNo( "Question", toolsMessageBoxYesNo( "Question",
"A selection called '" @ %name @ "' already exists. Modify the existing selection?", "A selection called '" @ %name @ "' already exists. Modify the existing selection?",
%this @ ".onSelectObjects( " @ %val @ ", true );" ); %this @ ".onSelectObjects( " @ %val @ ", true );" );
return; return;
@ -159,7 +159,7 @@ function ESelectObjectsWindow::onSelectObjects( %this, %val, %reuseExistingSet )
eval( "%sel = new WorldEditorSelection( " @ %name @ " ) { parentGroup = Selections; canSave = true; };" ); eval( "%sel = new WorldEditorSelection( " @ %name @ " ) { parentGroup = Selections; canSave = true; };" );
if( !isObject( %sel ) ) if( !isObject( %sel ) )
{ {
MessageBoxOk( "Error", toolsMessageBoxOk( "Error",
"Could not create the selection set. Please look at the console.log for details." ); "Could not create the selection set. Please look at the console.log for details." );
return; return;
} }

View file

@ -338,7 +338,7 @@ function EManageBookmarksTextEdit::onValidate( %this )
{ {
%id = %this.getId(); %id = %this.getId();
%callback = %id @ ".setText(\"" @ %oldname @ "\"); " @ %id @ ".makeFirstResponder(true); " @ %id @ ".selectAllText();"; %callback = %id @ ".setText(\"" @ %oldname @ "\"); " @ %id @ ".makeFirstResponder(true); " @ %id @ ".selectAllText();";
MessageBoxOK("Create Bookmark", "You must provide a unique name for the new bookmark.", %callback); toolsMessageBoxOK("Create Bookmark", "You must provide a unique name for the new bookmark.", %callback);
return; return;
} }

View file

@ -189,7 +189,7 @@ function EPainter::updateLayers( %this, %matIndex )
function EPainter::showMaterialDeleteDlg( %this, %matInternalName ) function EPainter::showMaterialDeleteDlg( %this, %matInternalName )
{ {
MessageBoxYesNo( "Confirmation", toolsMessageBoxYesNo( "Confirmation",
"Really remove material '" @ %matInternalName @ "' from the terrain?", "Really remove material '" @ %matInternalName @ "' from the terrain?",
%this @ ".removeMaterial( " @ %matInternalName @ " );", "" ); %this @ ".removeMaterial( " @ %matInternalName @ " );", "" );
} }
@ -389,7 +389,7 @@ function TerrainEditorPlugin::setEditorFunction(%this)
%terrainExists = parseMissionGroup( "TerrainBlock" ); %terrainExists = parseMissionGroup( "TerrainBlock" );
if( %terrainExists == false ) if( %terrainExists == false )
MessageBoxYesNoCancel("No Terrain","Would you like to create a New Terrain? No to Select Existing Terrain Block Asset", toolsMessageBoxYesNoCancel("No Terrain","Would you like to create a New Terrain? No to Select Existing Terrain Block Asset",
"AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule, createTerrainBlock);", "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule, createTerrainBlock);",
"AssetBrowser.showDialog(\"TerrainAsset\", createTerrainBlock, \"\", \"\", \"\");"); "AssetBrowser.showDialog(\"TerrainAsset\", createTerrainBlock, \"\", \"\", \"\");");
@ -401,7 +401,7 @@ function TerrainPainterPlugin::setEditorFunction(%this, %overrideGroup)
%terrainExists = parseMissionGroup( "TerrainBlock" ); %terrainExists = parseMissionGroup( "TerrainBlock" );
if( %terrainExists == false ) if( %terrainExists == false )
MessageBoxYesNoCancel("No Terrain","Would you like to create a New Terrain? No to Select Existing Terrain Block Asset", toolsMessageBoxYesNoCancel("No Terrain","Would you like to create a New Terrain? No to Select Existing Terrain Block Asset",
"AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule, createTerrainBlock);", "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule, createTerrainBlock);",
"AssetBrowser.showDialog(\"TerrainAsset\", createTerrainBlock, \"\", \"\", \"\");"); "AssetBrowser.showDialog(\"TerrainAsset\", createTerrainBlock, \"\", \"\", \"\");");

View file

@ -206,7 +206,7 @@ function TerrainMaterialDlg::setMaterialName( %this, %newName )
%existingMat = TerrainMaterialSet.findObjectByInternalName( %newName ); %existingMat = TerrainMaterialSet.findObjectByInternalName( %newName );
if( isObject( %existingMat ) ) if( isObject( %existingMat ) )
{ {
MessageBoxOK( "Error", toolsMessageBoxOK( "Error",
"There already is a terrain material called '" @ %newName @ "'.", "", "" ); "There already is a terrain material called '" @ %newName @ "'.", "", "" );
} }
else else
@ -366,7 +366,7 @@ function TerrainMaterialDlg::deleteMat( %this )
if ( ( ETerrainEditor.getMaterialCount() == 1 ) && if ( ( ETerrainEditor.getMaterialCount() == 1 ) &&
( ETerrainEditor.getMaterialIndex( %this.activeMat.internalName ) != -1 ) ) ( ETerrainEditor.getMaterialIndex( %this.activeMat.internalName ) != -1 ) )
{ {
MessageBoxOK( "Error", "Cannot delete this Material, it is the only " @ toolsMessageBoxOK( "Error", "Cannot delete this Material, it is the only " @
"Material still in use by the active Terrain." ); "Material still in use by the active Terrain." );
return; return;
} }
@ -543,7 +543,7 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
%existingMat = TerrainMaterialSet.findObjectByInternalName( %newName ); %existingMat = TerrainMaterialSet.findObjectByInternalName( %newName );
if( isObject( %existingMat ) ) if( isObject( %existingMat ) )
{ {
MessageBoxOK( "Error", toolsMessageBoxOK( "Error",
"There already is a terrain material called '" @ %newName @ "'.", "", "" ); "There already is a terrain material called '" @ %newName @ "'.", "", "" );
// Reset the name edit control to the old name. // Reset the name edit control to the old name.

View file

@ -88,7 +88,7 @@ function EditorQuitGame()
{ {
if( EditorIsDirty()) if( EditorIsDirty())
{ {
MessageBoxYesNoCancel("Level Modified", "Would you like to save your changes before quitting?", "EditorSaveMissionMenu(); quit();", "quit();", "" ); toolsMessageBoxYesNoCancel("Level Modified", "Would you like to save your changes before quitting?", "EditorSaveMissionMenu(); quit();", "quit();", "" );
} }
else else
quit(); quit();
@ -98,7 +98,7 @@ function EditorExitMission()
{ {
if( EditorIsDirty()) if( EditorIsDirty())
{ {
MessageBoxYesNoCancel("Level Modified", "Would you like to save your changes before exiting?", "EditorDoExitMission(true);", "EditorDoExitMission(false);", ""); toolsMessageBoxYesNoCancel("Level Modified", "Would you like to save your changes before exiting?", "EditorDoExitMission(true);", "EditorDoExitMission(false);", "");
} }
else else
EditorDoExitMission(false); EditorDoExitMission(false);
@ -129,7 +129,7 @@ function EditorOpenTorsionProject( %projectFile )
%torsionPath = EditorSettings.value( "WorldEditor/torsionPath" ); %torsionPath = EditorSettings.value( "WorldEditor/torsionPath" );
if( !isFile( %torsionPath ) ) if( !isFile( %torsionPath ) )
{ {
MessageBoxOK( toolsMessageBoxOK(
"Torsion Not Found", "Torsion Not Found",
"Torsion not found at '" @ %torsionPath @ "'. Please set the correct path in the Editor Settings." "Torsion not found at '" @ %torsionPath @ "'. Please set the correct path in the Editor Settings."
); );
@ -147,7 +147,7 @@ function EditorOpenTorsionProject( %projectFile )
%projectFile = findFirstFile( "*.torsion", false ); %projectFile = findFirstFile( "*.torsion", false );
if( !isFile( %projectFile ) ) if( !isFile( %projectFile ) )
{ {
MessageBoxOK( toolsMessageBoxOK(
"Project File Not Found", "Project File Not Found",
"Cannot find .torsion project file in '" @ getMainDotCsDir() @ "'." "Cannot find .torsion project file in '" @ getMainDotCsDir() @ "'."
); );
@ -168,7 +168,7 @@ function EditorOpenFileInTorsion( %file, %line )
%torsionPath = EditorSettings.value( "WorldEditor/torsionPath" ); %torsionPath = EditorSettings.value( "WorldEditor/torsionPath" );
if( !isFile( %torsionPath ) ) if( !isFile( %torsionPath ) )
{ {
MessageBoxOK( toolsMessageBoxOK(
"Torsion Not Found", "Torsion Not Found",
"Torsion not found at '" @ %torsionPath @ "'. Please set the correct path in the Editor Settings." "Torsion not found at '" @ %torsionPath @ "'. Please set the correct path in the Editor Settings."
); );
@ -205,7 +205,7 @@ function EditorNewLevel( %file )
if ( EditorIsDirty() ) if ( EditorIsDirty() )
{ {
error(knob); error(knob);
%saveFirst = MessageBox("Mission Modified", "Would you like to save changes to the current mission \"" @ %saveFirst = toolsMessageBox("Mission Modified", "Would you like to save changes to the current mission \"" @
$Server::MissionFile @ "\" before creating a new mission?", "SaveDontSave", "Question") == $MROk; $Server::MissionFile @ "\" before creating a new mission?", "SaveDontSave", "Question") == $MROk;
} }
@ -239,7 +239,7 @@ function EditorNewLevel( %file )
function EditorSaveAsDefaultLevel() function EditorSaveAsDefaultLevel()
{ {
MessageBoxYesNo("Save as Default?", "This will save the currently active root scene as the default level the editor loads when it is opened. Continue?", toolsMessageBoxYesNo("Save as Default?", "This will save the currently active root scene as the default level the editor loads when it is opened. Continue?",
"doEditorSaveAsDefaultLevel();", ""); "doEditorSaveAsDefaultLevel();", "");
} }
@ -250,7 +250,7 @@ function doEditorSaveAsDefaultLevel()
function EditorResetDefaultLevel() function EditorResetDefaultLevel()
{ {
MessageBoxYesNo("Reset Default?", "This will reset the default level for the editor back to the original. Continue?", toolsMessageBoxYesNo("Reset Default?", "This will reset the default level for the editor back to the original. Continue?",
"doEditorResetDefaultLevel();", ""); "doEditorResetDefaultLevel();", "");
} }
@ -279,7 +279,7 @@ function EditorSaveMission()
// first check for dirty and read-only files: // first check for dirty and read-only files:
if((EWorldEditor.isDirty || ETerrainEditor.isMissionDirty) && !isWriteableFileName($Server::MissionFile)) if((EWorldEditor.isDirty || ETerrainEditor.isMissionDirty) && !isWriteableFileName($Server::MissionFile))
{ {
MessageBox("Error", "Mission file \""@ $Server::MissionFile @ "\" is read-only. Continue?", "Ok", "Stop"); toolsMessageBox("Error", "Mission file \""@ $Server::MissionFile @ "\" is read-only. Continue?", "Ok", "Stop");
return false; return false;
} }
if(ETerrainEditor.isDirty) if(ETerrainEditor.isDirty)
@ -291,7 +291,7 @@ function EditorSaveMission()
{ {
if (!isWriteableFileName(%terrainObject.terrainFile)) if (!isWriteableFileName(%terrainObject.terrainFile))
{ {
if (MessageBox("Error", "Terrain file \""@ %terrainObject.terrainFile @ "\" is read-only. Continue?", "Ok", "Stop") == $MROk) if (toolsMessageBox("Error", "Terrain file \""@ %terrainObject.terrainFile @ "\" is read-only. Continue?", "Ok", "Stop") == $MROk)
continue; continue;
else else
return false; return false;
@ -370,7 +370,7 @@ function EditorOpenMission(%levelAsset)
if( EditorIsDirty()) if( EditorIsDirty())
{ {
// "EditorSaveBeforeLoad();", "getLoadFilename(\"*.mis\", \"EditorDoLoadMission\");" // "EditorSaveBeforeLoad();", "getLoadFilename(\"*.mis\", \"EditorDoLoadMission\");"
if(MessageBox("Mission Modified", "Would you like to save changes to the current mission \"" @ if(toolsMessageBox("Mission Modified", "Would you like to save changes to the current mission \"" @
$Server::MissionFile @ "\" before opening a new mission?", SaveDontSave, Question) == $MROk) $Server::MissionFile @ "\" before opening a new mission?", SaveDontSave, Question) == $MROk)
{ {
if(! EditorSaveMission()) if(! EditorSaveMission())