Merge pull request #258 from Areloch/BaseGameThemeUpdate

Updates the BaseGame UI theme
This commit is contained in:
Brian Roberts 2020-07-26 13:09:00 -05:00 committed by GitHub
commit 4890ed8789
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
96 changed files with 1669 additions and 2612 deletions

View file

@ -278,7 +278,7 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset)
bool isRowSelected = (getSelected() != NO_ROW) && (row == mRows[getSelected()]); bool isRowSelected = (getSelected() != NO_ROW) && (row == mRows[getSelected()]);
bool isRowHighlighted = (getHighlighted() != NO_ROW) ? ((row == mRows[getHighlighted()]) && (row->mEnabled)) : false; bool isRowHighlighted = (getHighlighted() != NO_ROW) ? ((row == mRows[getHighlighted()]) && (row->mEnabled)) : false;
if (profileHasArrows) /*if (profileHasArrows)
{ {
// render the left arrow // render the left arrow
bool arrowOnL = (isRowSelected || isRowHighlighted) && (row->mValue > row->mRange.x); bool arrowOnL = (isRowSelected || isRowHighlighted) && (row->mValue > row->mRange.x);
@ -297,7 +297,7 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset)
drawer->clearBitmapModulation(); drawer->clearBitmapModulation();
drawer->drawBitmapStretchSR(profile->mTextureObject, RectI(arrowOffset, arrowExtent), profile->getBitmapArrayRect((U32)iconIndex)); drawer->drawBitmapStretchSR(profile->mTextureObject, RectI(arrowOffset, arrowExtent), profile->getBitmapArrayRect((U32)iconIndex));
} }*/
//Draw the slider bar //Draw the slider bar
if (row->mEnabled) if (row->mEnabled)
@ -324,8 +324,8 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset)
ColorI barOutlineColor; ColorI barOutlineColor;
if (isRowSelected) if (isRowSelected)
{ {
barColor = profile->mFillColorHL; barColor = profile->mFillColor;
barOutlineColor = profile->mFillColor; barOutlineColor = profile->mFillColorSEL;
} }
else else
{ {
@ -818,6 +818,8 @@ bool GuiGameListMenuCtrl::onInputEvent(const InputEventInfo& event)
{ {
bool isModifier = false; bool isModifier = false;
bool state = event.action == SI_MAKE;
switch (event.objInst) switch (event.objInst)
{ {
case KEY_LCONTROL: case KEY_LCONTROL:
@ -837,12 +839,12 @@ bool GuiGameListMenuCtrl::onInputEvent(const InputEventInfo& event)
if (!ActionMap::getKeyString(event.objInst, keyString)) if (!ActionMap::getKeyString(event.objInst, keyString))
return false; return false;
onInputEvent_callback(deviceString, keyString, event.action); onInputEvent_callback(deviceString, keyString, state);
} }
else else
{ {
const char* actionString = ActionMap::buildActionString(&event); const char* actionString = ActionMap::buildActionString(&event);
onInputEvent_callback(deviceString, actionString, event.action); onInputEvent_callback(deviceString, actionString, state);
} }
} }
else if (event.objType == SI_AXIS || event.objType == SI_INT || event.objType == SI_FLOAT) else if (event.objType == SI_AXIS || event.objType == SI_INT || event.objType == SI_FLOAT)
@ -1159,10 +1161,22 @@ void GuiGameListMenuCtrl::changeOption(Row* row, S32 delta)
} }
row->mSelectedOption = newSelection; row->mSelectedOption = newSelection;
if (row->mMode == GuiGameListMenuCtrl::Row::Slider)
{
row->mValue += row->mStepSize * delta;
row->mValue = mRound(row->mValue / row->mStepSize) * row->mStepSize;
if (row->mValue < row->mRange.x)
row->mValue = row->mRange.x;
if (row->mValue > row->mRange.y)
row->mValue = row->mRange.y;
}
static StringTableEntry LEFT = StringTable->insert("LEFT", true); static StringTableEntry LEFT = StringTable->insert("LEFT", true);
static StringTableEntry RIGHT = StringTable->insert("RIGHT", true); static StringTableEntry RIGHT = StringTable->insert("RIGHT", true);
if (row->mScriptCallback != NULL) if (row->mScriptCallback != NULL && (row->mSelectedOption != NO_OPTION && row->mMode != GuiGameListMenuCtrl::Row::Slider))
{ {
setThisControl(); setThisControl();
StringTableEntry direction = NULL; StringTableEntry direction = NULL;
@ -1712,9 +1726,6 @@ void GuiGameListMenuProfile::initPersistFields()
removeField("modal"); removeField("modal");
removeField("opaque"); removeField("opaque");
removeField("fillColor");
removeField("fillColorHL");
removeField("fillColorNA");
removeField("border"); removeField("border");
removeField("borderThickness"); removeField("borderThickness");
removeField("borderColor"); removeField("borderColor");

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

@ -132,6 +132,12 @@ bool GuiFadeinBitmapCtrl::onKeyDown(const GuiEvent &)
return true; return true;
} }
bool GuiFadeinBitmapCtrl::onGamepadButtonDown(const GuiEvent& event)
{
click_callback();
return true;
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool GuiFadeinBitmapCtrl::onWake() bool GuiFadeinBitmapCtrl::onWake()

View file

@ -72,6 +72,7 @@ class GuiFadeinBitmapCtrl : public GuiBitmapCtrl
virtual void onPreRender(); virtual void onPreRender();
virtual void onMouseDown(const GuiEvent &); virtual void onMouseDown(const GuiEvent &);
virtual bool onKeyDown(const GuiEvent &); virtual bool onKeyDown(const GuiEvent &);
virtual bool onGamepadButtonDown(const GuiEvent& event);
virtual bool onWake(); virtual bool onWake();
virtual void onRender(Point2I offset, const RectI &updateRect); virtual void onRender(Point2I offset, const RectI &updateRect);

View file

@ -97,7 +97,16 @@ ExampleMoveMap.bind(keyboard, "ctrl h", hideHUDs);
ExampleMoveMap.bind(keyboard, "alt p", doScreenShotHudless); ExampleMoveMap.bind(keyboard, "alt p", doScreenShotHudless);
ExampleMoveMap.bindCmd(keyboard, "escape", "", "disconnect();"); function openPauseMenu(%val)
{
if(%val && PauseMenu.isAwake() == false)
{
echo("PUSHING PAUSE MENU");
Canvas.pushDialog(PauseMenu);
}
}
ExampleMoveMap.bind(keyboard, "escape", openPauseMenu);
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Movement Keys // Movement Keys
@ -119,21 +128,21 @@ ExampleMoveMap.bind( keyboard, space, jump );
ExampleMoveMap.bind( mouse, xaxis, yaw ); ExampleMoveMap.bind( mouse, xaxis, yaw );
ExampleMoveMap.bind( mouse, yaxis, pitch ); ExampleMoveMap.bind( mouse, yaxis, pitch );
ExampleMoveMap.bind( gamepad, thumbrx, "D", "-0.23 0.23", gamepadYaw ); ExampleMoveMap.bind( gamepad, rxaxis, "D", "-0.23 0.23", gamepadYaw );
ExampleMoveMap.bind( gamepad, thumbry, "D", "-0.23 0.23", gamepadPitch ); ExampleMoveMap.bind( gamepad, ryaxis, "D", "-0.23 0.23", gamepadPitch );
ExampleMoveMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamePadMoveX ); ExampleMoveMap.bind( gamepad, xaxis, "D", "-0.23 0.23", gamePadMoveX );
ExampleMoveMap.bind( gamepad, thumbly, "D", "-0.23 0.23", gamePadMoveY ); ExampleMoveMap.bind( gamepad, yaxis, "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, "disconnect();", "" ); ExampleMoveMap.bindCmd( gamepad, btn_start, "Canvas.pushDialog(PauseMenu);", "" );
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Misc. // Misc.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
GlobalActionMap.bind(keyboard, "tilde", toggleConsole); GlobalActionMap.bind(keyboard, "tilde", toggleConsole);
GlobalActionMap.bindCmd(keyboard, "alt k", "cls();",""); GlobalActionMap.bindCmd(keyboard, "alt k", "cls();","");
GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.attemptFullscreenToggle();"); GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.toggleFullscreen();");
GlobalActionMap.bindCmd(keyboard, "F1", "", "contextHelp();"); GlobalActionMap.bindCmd(keyboard, "F1", "", "contextHelp();");
ExampleMoveMap.bindCmd(keyboard, "n", "toggleNetGraph();", ""); ExampleMoveMap.bindCmd(keyboard, "n", "toggleNetGraph();", "");

View file

@ -147,6 +147,8 @@ function gamePadMoveX( %val )
function gamePadMoveY( %val ) function gamePadMoveY( %val )
{ {
%val *= -1;
if(%val > 0) if(%val > 0)
{ {
$mvForwardAction = %val * $movementSpeed; $mvForwardAction = %val * $movementSpeed;
@ -183,6 +185,8 @@ function gamepadYaw(%val)
function gamepadPitch(%val) function gamepadPitch(%val)
{ {
%val *= -1;
%pitchAdj = getGamepadAdjustAmount(%val); %pitchAdj = getGamepadAdjustAmount(%val);
if(ServerConnection.isControlObjectRotDampedCamera()) if(ServerConnection.isControlObjectRotDampedCamera())
{ {

View file

@ -36,8 +36,7 @@ function UI::initClient(%this)
exec("./scripts/profiles.cs"); exec("./scripts/profiles.cs");
//Now gui files //Now gui files
exec("./guis/guiGamepadButton.cs"); exec("./scripts/menuInputButtons.cs");
exec("./guis/guiGamepadButton.gui");
exec("./guis/mainMenu.cs"); exec("./guis/mainMenu.cs");
exec("./guis/mainMenu.gui"); exec("./guis/mainMenu.gui");
@ -80,10 +79,6 @@ function UI::initClient(%this)
exec("./scripts/help.cs"); exec("./scripts/help.cs");
exec("./scripts/cursors.cs"); exec("./scripts/cursors.cs");
exec("./scripts/utility.cs"); exec("./scripts/utility.cs");
exec("./scripts/default.keybinds.cs");
exec("./guis/menuGraphics.gui");
exec("./guis/menuGraphics.cs");
loadStartup(); loadStartup();
} }

View file

@ -139,23 +139,14 @@ function ChooseLevelDlg::onWake( %this )
%preview.levelDesc = %desc; %preview.levelDesc = %desc;
}*/ }*/
ChooseLevelButtonHolder.setActive();
} }
function ChooseLevelButtonHolder::onWake(%this) function ChooseLevelButtonHolder::onWake(%this)
{ {
%this.refresh(); %this-->goButton.set("btn_a", "Return", "Start Level", "ChooseLevelDlg.beginLevel();");
} %this-->backButton.set("btn_b", "Escape", "Back", "ChooseLevelDlg.backOut();");
function ChooseLevelButtonHolder::refresh(%this)
{
ChooseLevelButtonHolder.add(GamepadButtonsGui);
GamepadButtonsGui.clearButtons();
GamepadButtonsGui.setButton(2, "A", "Enter", "Start Level", "ChooseLevelDlg.beginLevel();");
GamepadButtonsGui.setButton(3, "B", "Esc", "Back", "ChooseLevelDlg.backOut();");
GamepadButtonsGui.refreshButtons();
} }
function ChooseLevelDlg::onSleep( %this ) function ChooseLevelDlg::onSleep( %this )

View file

@ -32,8 +32,28 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiBitmapBarCtrl() {
percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel.png";
color = "255 255 255 255";
position = "0 0";
extent = "927 40";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(LevelSelectTitle) { new GuiTextCtrl(LevelSelectTitle) {
text = "CHOOSE LEVEL"; text = "SINGLE PLAYER";
maxLength = "1024"; maxLength = "1024";
margin = "0 0 0 0"; margin = "0 0 0 0";
padding = "0 0 0 0"; padding = "0 0 0 0";
@ -55,6 +75,26 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
new GuiBitmapBarCtrl() {
percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel_low.png";
color = "255 255 255 255";
position = "0 40";
extent = "927 618";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapCtrl() { new GuiBitmapCtrl() {
bitmap = "data/ui/images/no-preview"; bitmap = "data/ui/images/no-preview";
color = "255 255 255 255"; color = "255 255 255 255";
@ -76,7 +116,7 @@
Enabled = "1"; Enabled = "1";
}; };
new GuiTextCtrl() { new GuiTextCtrl() {
text = "EmptyLevel"; text = "Example Level";
maxLength = "255"; maxLength = "255";
margin = "0 0 0 0"; margin = "0 0 0 0";
padding = "0 0 0 0"; padding = "0 0 0 0";
@ -177,7 +217,7 @@
debugRender = "0"; debugRender = "0";
callbackOnInputs = "1"; callbackOnInputs = "1";
position = "1 1"; position = "1 1";
extent = "450 580"; extent = "450 90";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
@ -194,8 +234,8 @@
}; };
}; };
new GuiControl(ChooseLevelButtonHolder) { new GuiControl(ChooseLevelButtonHolder) {
position = "189 652"; position = "189 711";
extent = "646 130"; extent = "646 40";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "center"; horizSizing = "center";
vertSizing = "top"; vertSizing = "top";
@ -205,8 +245,70 @@
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "1"; isContainer = "1";
class = "MenuInputButtonContainer";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "./";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Go";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "363 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuButtonList.activateRow();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "goButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "./";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Back";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "507 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuButtonList.activateRow();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "backButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
}; };
}; };
//--- OBJECT WRITE END --- //--- OBJECT WRITE END ---

View file

@ -1,319 +0,0 @@
//------------------------------------------------------------------------------
// global vars
//------------------------------------------------------------------------------
$BUTTON_A = 0;
$BUTTON_B = 1;
$BUTTON_X = 2;
$BUTTON_Y = 3;
$BUTTON_BACK = 4;
$BUTTON_START = 5;
$BUTTON_LTRIGGER = 6;
$BUTTON_RTRIGGER = 7;
$BUTTON_LSHOULDER = 8;
$BUTTON_RSHOULDER = 9;
$BUTTON_LSTICK = 10;
$BUTTON_RSTICK = 11;
//------------------------------------------------------------------------------
// GamepadButtonsGui methods
//------------------------------------------------------------------------------
/// Callback when this control wakes up. All buttons are set to invisible and
/// disabled.
function GamepadButtonsGui::onWake(%this)
{
GamepadButtonsGui.controllerName = "K&M";
}
function GamepadButtonsGui::initMenuButtons(%this)
{
%buttonExt = %this.extent.x / 4 SPC %this.extent.y / 2;
for(%i=0; %i < 9; %i++)
{
%btn = new GuiIconButtonCtrl()
{
iconLocation = "Left";
sizeIconToButton = true;
makeIconSquare = true;
textLocation = "Right";
extent = %buttonExt;
profile="GuiMenuButtonProfile";
gamepadButton = "";
keyboardButton = "";
};
GamepadButtonsGui.addGuiControl(%btn);
}
GamepadButtonsGui.refresh();
}
/// Sets the command and text for the specified button. If %text and %command
/// are left empty, the button will be disabled and hidden.
/// Note: This command is not executed when the A button is pressed. That
/// command is executed directly from the GuiGameList___Ctrl. This command is
/// for the graphical hint and to allow a mouse equivalent.
///
/// \param %button (constant) The button to set. See: $BUTTON_A, _B, _X, _Y
/// \param %text (string) The text to display next to the A button graphic.
/// \param %command (string) The command executed when the A button is pressed.
function GamepadButtonsGui::setButton(%this, %buttonIdx, %gamepadButton, %keyboardButton, %text, %command, %gamepadOnly)
{
if(%buttonIdx >= GamepadButtonsGui.getCount())
return;
%btn = GamepadButtonsGui.getObject(%buttonIdx);
%set = (! ((%text $= "") && (%command $= "")));
%btn.setText(%text);
%btn.setActive(%set);
%btn.setVisible(%set);
%btn.gamepadButton = %gamepadButton;
%btn.keyboardButton = %keyboardButton;
if(%gamepadOnly $= "")
%gamepadOnly = false;
%btn.gamepadOnly = %gamepadOnly;
%btn.Command = %command;
}
function GamepadButtonsGui::checkGamepad(%this)
{
%controllerName = SDLInputManager::JoystickNameForIndex(0);
GamepadButtonsGui.controllerName = %controllerName;
}
function GamepadButtonsGui::clearButtons(%this)
{
for(%i=0; %i < GamepadButtonsGui.getCount(); %i++)
{
%btn = GamepadButtonsGui.getObject(%i);
%btn.setBitmap("");
%btn.text = "";
%btn.command = "";
}
}
function GamepadButtonsGui::refreshButtons(%this)
{
//Set up our basic buttons
for(%i=0; %i < GamepadButtonsGui.getCount(); %i++)
{
%btn = GamepadButtonsGui.getObject(%i);
%set = (! ((%btn.text $= "") && (%btn.command $= "")));
//Special-case of where we're in keyboard+mouse mode, but the menubutton is gamepad only mode, so we early out
if(%btn.gamepadOnly && GamepadButtonsGui.controllerName $= "K&M")
%set = false;
%btn.setActive(%set);
%btn.setVisible(%set);
if(!%btn.isActive())
continue;
if(GamepadButtonsGui.controllerName !$= "K&M")
{
if(%btn.gamepadButton !$= "")
{
%path = "";
if(GamepadButtonsGui.controllerName $= "PS4 Controller")
{
%path = "data/ui/images/inputs/PS4/PS4_";
if(%btn.gamepadButton $= "A")
%path = %path @ "Cross";
else if(%btn.gamepadButton $= "B")
%path = %path @ "Circle";
else if(%btn.gamepadButton $= "X")
%path = %path @ "Square";
else if(%btn.gamepadButton $= "Y")
%path = %path @ "Triangle";
else if(%btn.gamepadButton $= "LB")
%path = %path @ "L1";
else if(%btn.gamepadButton $= "LT")
%path = %path @ "L2";
else if(%btn.gamepadButton $= "RB")
%path = %path @ "R1";
else if(%btn.gamepadButton $= "RT")
%path = %path @ "R2";
else
continue;
}
else if(GamepadButtonsGui.controllerName $= "Nintendo Switch Pro Controller")
{
%path = "data/ui/images/inputs/Switch/Switch_";
if(%btn.gamepadButton $= "A")
%path = %path @ "B";
else if(%btn.gamepadButton $= "B")
%path = %path @ "A";
else if(%btn.gamepadButton $= "X")
%path = %path @ "Y";
else if(%btn.gamepadButton $= "Y")
%path = %path @ "X";
else if(%btn.gamepadButton $= "LB")
%path = %path @ "LB";
else if(%btn.gamepadButton $= "LT")
%path = %path @ "LT";
else if(%btn.gamepadButton $= "RB")
%path = %path @ "RB";
else if(%btn.gamepadButton $= "RT")
%path = %path @ "RT";
else
continue;
}
else if(GamepadButtonsGui.controllerName !$= "")
{
%path = "data/ui/images/inputs/Xbox/Xbox_";
%path = %path @ %btn.gamepadButton;
}
}
}
else
{
if(%btn.keyboardButton !$= "")
{
%path = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_" @ %btn.keyboardButton;
}
}
%btn.setBitmap(%path);
}
return true;
}
function GamepadButtonsGui::processInputs(%this, %device, %action)
{
//check to see if our status has changed
%changed = false;
%oldDevice = GamepadButtonsGui.controllerName;
if(startsWith(%device, "Keyboard"))
{
if(GamepadButtonsGui.controllerName !$= %device)
%changed = true;
GamepadButtonsGui.controllerName = "K&M";
Canvas.showCursor();
}
else if(startsWith(%device, "Mouse"))
{
if(startsWith(%action, "button"))
{
if(GamepadButtonsGui.controllerName !$= %device)
%changed = true;
GamepadButtonsGui.controllerName = "K&M";
Canvas.showCursor();
}
}
else
{
if(GamepadButtonsGui.checkGamepad())
{
Canvas.hideCursor();
}
if(GamepadButtonsGui.controllerName !$= %device)
%changed = true;
}
if(%changed)
GamepadButtonsGui.refreshButtons();
//Now process the input for the button accelerator, if applicable
//Set up our basic buttons
for(%i=0; %i < GamepadButtonsGui.getCount(); %i++)
{
%btn = GamepadButtonsGui.getObject(%i);
if(!%btn.isActive())
continue;
if(GamepadButtonsGui.controllerName !$= "K&M")
{
if(%action $= "btn_r")
%action = "RB";
else if(%action $= "btn_l")
%action = "LB";
if(%btn.gamepadButton $= %action)
{
eval(%btn.command);
}
}
else
{
if(%action $= "return")
%action = "enter";
else if(%action $= "escape")
%action = "esc";
if(%btn.keyboardButton $= %action)
{
eval(%btn.command);
}
}
}
}
function GamepadButtonsGui::processAxisEvent(%this, %device, %action, %axisVal)
{
%changed = false;
%oldDevice = GamepadButtonsGui.controllerName;
if(startsWith(%device, "Mouse"))
{
if(startsWith(%action, "button"))
{
if(GamepadButtonsGui.controllerName !$= %device)
%changed = true;
GamepadButtonsGui.controllerName = "K&M";
Canvas.showCursor();
}
}
else
{
if(GamepadButtonsGui.checkGamepad())
{
Canvas.hideCursor();
}
if(GamepadButtonsGui.controllerName !$= %device)
%changed = true;
}
if(%changed)
GamepadButtonsGui.refreshButtons();
}
//
//
function onSDLDeviceConnected(%sdlIndex, %deviceName, %deviceType)
{
/*if(GamepadButtonsGui.checkGamepad())
{
GamepadButtonsGui.hidden = false;
}*/
}
function onSDLDeviceDisconnected(%sdlIndex)
{
/*if(!GamepadButtonsGui.checkGamepad())
{
GamepadButtonsGui.hidden = true;
}*/
}

View file

@ -1,239 +0,0 @@
//--- OBJECT WRITE BEGIN ---
new GuiControl(GamepadButtonsGuiCtrl) {
position = "0 0";
extent = "646 130";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GamepadDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
new GuiDynamicCtrlArrayControl(GamepadButtonsGui) {
position = "0 0";
extent = "640 100";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GamepadDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
colSize = "155";
rowSize = "45";
rowSpacing = 5;
colSpacing = 5;
frozen = true;
/*new GuiBitmapCtrl(ButtonBImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadDefaultProfile";
HorizSizing = "left";
VertSizing = "relative";
position = "416 16";
Extent = "32 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "data/ui/images/Inputs/Xbox/Xbox_B";
wrap = "0";
};
new GuiTextCtrl(ButtonBLabel) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadButtonTextRight";
HorizSizing = "relative";
VertSizing = "relative";
position = "248 16";
Extent = "160 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
text = "Button B Label";
maxLength = "1024";
};
new GuiButtonBaseCtrl(ButtonBButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadDefaultProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "248 16";
Extent = "200 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapCtrl(ButtonAImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadDefaultProfile";
HorizSizing = "left";
VertSizing = "relative";
position = "400 64";
Extent = "32 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "data/ui/images/Inputs/Xbox/Xbox_A";
wrap = "0";
};
new GuiTextCtrl(ButtonALabel) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadButtonTextRight";
HorizSizing = "relative";
VertSizing = "relative";
position = "232 64";
Extent = "160 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
text = "Button B Label";
maxLength = "1024";
};
new GuiButtonBaseCtrl(ButtonAButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadDefaultProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "232 64";
Extent = "200 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapCtrl(ButtonXImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadDefaultProfile";
HorizSizing = "right";
VertSizing = "relative";
position = "32 64";
Extent = "32 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "data/ui/images/Inputs/Xbox/Xbox_X";
wrap = "0";
};
new GuiTextCtrl(ButtonXLabel) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadButtonTextLeft";
HorizSizing = "relative";
VertSizing = "relative";
position = "72 64";
Extent = "160 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
text = "Button X Label";
maxLength = "1024";
};
new GuiButtonBaseCtrl(ButtonXButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadDefaultProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "32 64";
Extent = "200 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapCtrl(ButtonYImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadDefaultProfile";
HorizSizing = "right";
VertSizing = "relative";
position = "16 16";
Extent = "32 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "data/ui/images/Inputs/Xbox/Xbox_Y";
wrap = "0";
};
new GuiTextCtrl(ButtonYLabel) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadButtonTextLeft";
HorizSizing = "relative";
VertSizing = "relative";
position = "55 16";
Extent = "164 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
text = "Button Y Label";
maxLength = "1024";
};
new GuiButtonBaseCtrl(ButtonYButton) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GamepadDefaultProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "16 16";
Extent = "208 32";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};*/
};
};
//--- OBJECT WRITE END ---

View file

@ -4,26 +4,25 @@ function JoinServerMenu::onWake()
// Double check the status. Tried setting this the control // Double check the status. Tried setting this the control
// inactive to start with, but that didn't seem to work. // inactive to start with, but that didn't seem to work.
JoinServerJoinBtn.setActive(JS_serverList.rowCount() > 0); JoinServerJoinBtn.setActive(JS_serverList.rowCount() > 0);
JoinServerButtonHolder.setActive();
JoinServerMenuInputHandler.setFirstResponder();
} }
function JoinServerButtonHolder::onWake(%this) function JoinServerButtonHolder::onWake(%this)
{ {
%this.refresh(); %this-->joinButton.set("btn_start", "Return", "Join", "JoinServerMenu.join();");
%this-->backButton.set("btn_b", "Escape", "Back", "JoinServerMenu.backOut();");
%this-->refreshButton.set("btn_y", "R", "Refresh", "JoinServerMenu.refresh();");
%this-->queryLANButton.set("btn_a", "Q", "Query LAN", "JoinServerMenu.queryLan();");
%this-->queryInternetButton.set("btn_x", "E", "Query Internet", "JoinServerMenu.query();");
} }
function JoinServerButtonHolder::refresh(%this) function JoinServerMenuInputHandler::onInputEvent(%this, %device, %action, %state)
{ {
JoinServerButtonHolder.add(GamepadButtonsGui); if(%state)
$activeMenuButtonContainer.processInputs(%device, %action);
GamepadButtonsGui.clearButtons();
GamepadButtonsGui.setButton(1, "A", "", "Query LAN", "JoinServerMenu.queryLan();");
GamepadButtonsGui.setButton(2, "X", "", "Query Internet", "JoinServerMenu.query();");
GamepadButtonsGui.setButton(3, "B", "", "Refresh", "JoinServerMenu.refresh();");
GamepadButtonsGui.setButton(6, "Start", "Enter", "Join", "JoinServerMenu.join();");
GamepadButtonsGui.setButton(7, "B", "Esc", "Back", "JoinServerMenu.backOut();");
GamepadButtonsGui.refreshButtons();
} }
//---------------------------------------- //----------------------------------------

View file

@ -13,9 +13,22 @@
isContainer = "1"; isContainer = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
returnGui = "MainMenuGui";
new GuiInputCtrl(JoinServerMenuInputHandler){
profile = "GuiInputCtrlProfile";
visible = "1";
active = "1";
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
sendBreakEvents="1";
};
new GuiControl(JoinServerWindow) { new GuiControl(JoinServerWindow) {
position = "45 56"; position = "48 56";
extent = "928 655"; extent = "928 655";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "center"; horizSizing = "center";
@ -29,14 +42,16 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiBitmapCtrl() { new GuiBitmapBarCtrl() {
bitmap = "data/ui/images/hudfill.png"; percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel.png";
color = "255 255 255 255"; color = "255 255 255 255";
wrap = "0";
position = "0 0"; position = "0 0";
extent = "928 655"; extent = "927 40";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "width";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "GuiDefaultProfile"; profile = "GuiDefaultProfile";
visible = "1"; visible = "1";
@ -70,6 +85,26 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
new GuiBitmapBarCtrl() {
percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel_low.png";
color = "255 255 255 255";
position = "0 40";
extent = "927 618";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() { new GuiTextCtrl() {
text = "Player Name:"; text = "Player Name:";
maxLength = "255"; maxLength = "255";
@ -99,6 +134,7 @@
sinkAllKeyEvents = "0"; sinkAllKeyEvents = "0";
password = "0"; password = "0";
passwordMask = "*"; passwordMask = "*";
text = "Visitor";
maxLength = "255"; maxLength = "255";
margin = "0 0 0 0"; margin = "0 0 0 0";
padding = "0 0 0 0"; padding = "0 0 0 0";
@ -111,7 +147,7 @@
minExtent = "8 8"; minExtent = "8 8";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "GuiTextEditProfile"; profile = "GuiMenuTextEditProfile";
visible = "1"; visible = "1";
active = "1"; active = "1";
variable = "$pref::Player::Name"; variable = "$pref::Player::Name";
@ -294,7 +330,7 @@
clipColumnText = "0"; clipColumnText = "0";
rowHeightPadding = "2"; rowHeightPadding = "2";
position = "1 1"; position = "1 1";
extent = "765 8"; extent = "888 8";
minExtent = "8 8"; minExtent = "8 8";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
@ -498,7 +534,7 @@
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
}; };
new GuiControl(JoinServerButtonHolder) { new GuiControl() {
position = "189 652"; position = "189 652";
extent = "646 130"; extent = "646 130";
minExtent = "8 2"; minExtent = "8 2";
@ -513,5 +549,174 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
new GuiControl(JoinServerButtonHolder) {
position = "109 711";
extent = "791 40";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "top";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
class = "MenuInputButtonContainer";
canSave = "1";
canSaveDynamicFields = "0";
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Join";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "507 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "OptionsMenu.apply();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "joinButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Esc";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Back";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "651 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "OptionsMenu.backOut();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "backButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Prev Tab";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "0";
active = "0";
command = "OptionsMenu.prevTab();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "queryLANButton";
class = "MenuInputButton";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Esc";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Next Tab";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "144 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "0";
active = "0";
command = "OptionsMenu.nextTab();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "queryInternetButton";
class = "MenuInputButton";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_R";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Reset";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "325 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "OptionsMenu.resetToDefaults();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "refreshButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
};
}; };
//--- OBJECT WRITE END --- //--- OBJECT WRITE END ---

View file

@ -4,7 +4,7 @@
useVariable = "0"; useVariable = "0";
tile = "0"; tile = "0";
position = "0 0"; position = "0 0";
extent = "1600 838"; extent = "1024 768";
minExtent = "8 8"; minExtent = "8 8";
horizSizing = "width"; horizSizing = "width";
vertSizing = "height"; vertSizing = "height";
@ -19,7 +19,7 @@
Enabled = "1"; Enabled = "1";
new GuiControl() { new GuiControl() {
position = "391 429"; position = "263 301";
extent = "497 166"; extent = "497 166";
minExtent = "8 8"; minExtent = "8 8";
horizSizing = "center"; horizSizing = "center";
@ -35,8 +35,27 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiBitmapCtrl() {
bitmap = "data/ui/images/panel.png";
color = "255 255 255 255";
wrap = "0";
position = "0 0";
extent = "497 166";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapCtrl(LoadingLogo) { new GuiBitmapCtrl(LoadingLogo) {
bitmap = "data/ui/images/Torque-3D-logo.png"; bitmap = "data/ui/images/Torque-3D-logo_alt.png";
color = "255 255 255 255";
wrap = "0"; wrap = "0";
position = "27 6"; position = "27 6";
extent = "443 139"; extent = "443 139";

View file

@ -1,32 +1,22 @@
function MainMenuGui::onAdd(%this) function MainMenuGui::onAdd(%this)
{ {
GamepadButtonsGui.initMenuButtons(); $activeControllerName = "K&M"; //default input type
} }
function MainMenuGui::onWake(%this) function MainMenuGui::onWake(%this)
{ {
MainMenuButtonList.hidden = false; MainMenuButtonList.hidden = false;
MainMenuButtonHolder.setActive();
} }
function MainMenuGui::onSleep(%this) function MainMenuGui::onSleep(%this)
{ {
MainMenuButtonHolder.hidden = true;
} }
function MainMenuButtonHolder::onWake(%this) function MainMenuButtonHolder::onWake(%this)
{ {
%this.refresh(); %this-->goButton.set("btn_a", "Return", "Go", "MainMenuButtonList.activateRow();");
}
function MainMenuButtonHolder::refresh(%this)
{
%this.add(GamepadButtonsGui);
GamepadButtonsGui.clearButtons();
//GamepadButtonsGui.setButton(2, "A", "Select", "Go", "echo(\"FART\");");
//GamepadButtonsGui.setButton(3, "B", "Esc", "Back", "");
GamepadButtonsGui.refreshButtons();
} }
function MainMenuButtonList::onAdd(%this) function MainMenuButtonList::onAdd(%this)
@ -40,24 +30,13 @@ function MainMenuButtonList::onAdd(%this)
MainMenuButtonList.addRow("Exit Game", "quit", 8, -15); MainMenuButtonList.addRow("Exit Game", "quit", 8, -15);
} }
function UIMenuButtonList::onInputEvent(%this, %device, %action, %state)
{
if(%state)
GamepadButtonsGui.processInputs(%device, %action);
}
function UIMenuButtonList::onAxisEvent(%this, %device, %action, %axisVal)
{
GamepadButtonsGui.processAxisEvent(%device, %action);
}
function openSinglePlayerMenu() function openSinglePlayerMenu()
{ {
$pref::HostMultiPlayer=false; $pref::HostMultiPlayer=false;
Canvas.pushDialog(ChooseLevelDlg); Canvas.pushDialog(ChooseLevelDlg);
ChooseLevelDlg.returnGui = MainMenuGui; ChooseLevelDlg.returnGui = MainMenuGui;
MainMenuButtonList.hidden = true; MainMenuButtonList.hidden = true;
MainMenuAppLogo.setBitmap("data/ui/images/Torque-3D-logo"); MainMenuButtonHolder.hidden = true;
} }
function openMultiPlayerMenu() function openMultiPlayerMenu()
@ -66,7 +45,6 @@ function openMultiPlayerMenu()
Canvas.pushDialog(ChooseLevelDlg); Canvas.pushDialog(ChooseLevelDlg);
ChooseLevelDlg.returnGui = MainMenuGui; ChooseLevelDlg.returnGui = MainMenuGui;
MainMenuButtonList.hidden = true; MainMenuButtonList.hidden = true;
MainMenuAppLogo.setBitmap("data/ui/images/Torque-3D-logo");
} }
function openJoinServerMenu() function openJoinServerMenu()
@ -81,7 +59,6 @@ function openOptionsMenu()
Canvas.pushDialog(OptionsMenu); Canvas.pushDialog(OptionsMenu);
OptionsMenu.returnGui = MainMenuGui; OptionsMenu.returnGui = MainMenuGui;
MainMenuButtonList.hidden = true; MainMenuButtonList.hidden = true;
MainMenuAppLogo.setBitmap("data/ui/images/Torque-3D-logo");
} }
function openWorldEditorBtn() function openWorldEditorBtn()
@ -97,5 +74,6 @@ function openGUIEditorBtn()
function MainMenuGui::onReturnTo(%this) function MainMenuGui::onReturnTo(%this)
{ {
MainMenuButtonList.hidden = false; MainMenuButtonList.hidden = false;
MainMenuAppLogo.setBitmap("data/ui/images/Torque-3D-logo-shortcut"); MainMenuButtonList.setFirstResponder();
MainMenuButtonHolder.setActive();
} }

View file

@ -21,17 +21,15 @@ exec( "tools/gui/profiles.ed.cs" );
Enabled = "1"; Enabled = "1";
isDecoy = "0"; isDecoy = "0";
navigationIndex = "-1"; navigationIndex = "-1";
new GuiBitmapButtonCtrl(MainMenuAppLogo) { new GuiBitmapCtrl(MainMenuAppLogo) {
bitmap = "data/ui/images/Torque-3D-logo"; bitmap = "data/ui/images/Torque-3D-logo_alt.png";
bitmapMode = "Stretched"; bitmapMode = "Stretched";
autoFitExtents = "0"; autoFitExtents = "0";
useModifiers = "0"; useModifiers = "0";
useStates = "1"; useStates = "1";
masked = "0"; masked = "0";
groupNum = "-1"; groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "550 30"; position = "550 30";
extent = "443 139"; extent = "443 139";
minExtent = "8 2"; minExtent = "8 2";
@ -40,7 +38,6 @@ exec( "tools/gui/profiles.ed.cs" );
profile = "GuiDefaultProfile"; profile = "GuiDefaultProfile";
visible = "1"; visible = "1";
active = "1"; active = "1";
command = "gotoWebPage(\"forums.torque3d.org\");";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
@ -48,10 +45,9 @@ exec( "tools/gui/profiles.ed.cs" );
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
navigationIndex = "-1"; navigationIndex = "-1";
}; };
new GuiGameListMenuCtrl(MainMenuButtonList) { new GuiGameListMenuCtrl(MainMenuButtonList) {
class = "UIMenuButtonList";
debugRender = "0"; debugRender = "0";
callbackOnA = "MainMenuButtonList.activateRow();";
callbackOnInputs = "1"; callbackOnInputs = "1";
position = "292 103"; position = "292 103";
extent = "439 561"; extent = "439 561";
@ -64,12 +60,13 @@ exec( "tools/gui/profiles.ed.cs" );
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
class = "UIMenuButtonList";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
new GuiControl(MainMenuButtonHolder) { new GuiControl(MainMenuButtonHolder) {
position = "190 652"; position = "189 711";
extent = "646 130"; extent = "646 40";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "center"; horizSizing = "center";
vertSizing = "top"; vertSizing = "top";
@ -79,8 +76,40 @@ exec( "tools/gui/profiles.ed.cs" );
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "1"; isContainer = "1";
class = "MenuInputButtonContainer";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Go";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "507 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuButtonList.activateRow();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "goButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
}; };
}; };
//--- OBJECT WRITE END --- //--- OBJECT WRITE END ---

View file

@ -30,15 +30,17 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiBitmapCtrl() { new GuiBitmapBarCtrl() {
bitmap = "data/ui/images/hudfill.png"; percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel.png";
color = "255 255 255 255"; color = "255 255 255 255";
wrap = "0";
position = "0 0"; position = "0 0";
extent = "1156 704"; extent = "641 40";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "width"; horizSizing = "width";
vertSizing = "height"; vertSizing = "bottom";
profile = "GuiDefaultProfile"; profile = "GuiDefaultProfile";
visible = "1"; visible = "1";
active = "1"; active = "1";
@ -57,7 +59,7 @@
anchorBottom = "0"; anchorBottom = "0";
anchorLeft = "1"; anchorLeft = "1";
anchorRight = "0"; anchorRight = "0";
position = "32 10"; position = "32 7";
extent = "577 28"; extent = "577 28";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
@ -71,13 +73,33 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
new GuiBitmapBarCtrl() {
percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel_low.png";
color = "255 255 255 255";
position = "0 40";
extent = "641 341";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiMLTextCtrl(MessageBoxText) { new GuiMLTextCtrl(MessageBoxText) {
lineSpacing = "2"; lineSpacing = "2";
allowColorChars = "0"; allowColorChars = "0";
maxChars = "-1"; maxChars = "-1";
useURLMouseCursor = "0"; useURLMouseCursor = "0";
position = "81 83"; position = "81 83";
extent = "481 14"; extent = "481 19";
minExtent = "8 8"; minExtent = "8 8";
horizSizing = "center"; horizSizing = "center";
vertSizing = "center"; vertSizing = "center";
@ -90,9 +112,9 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
new GuiControl(MessageBoxButtonHolder) { new GuiControl(MessageBoxOKButtonHolder) {
position = "0 237"; position = "0 285";
extent = "641 130"; extent = "642 40";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "center"; horizSizing = "center";
vertSizing = "top"; vertSizing = "top";
@ -102,8 +124,224 @@
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "1"; isContainer = "1";
class = "MenuInputButtonContainer";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Go";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "251 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuButtonList.activateRow();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "OKButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiControl(MessageBoxOCButtonHolder) {
position = "0 285";
extent = "642 40";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "top";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
class = "MenuInputButtonContainer";
canSave = "1";
canSaveDynamicFields = "0";
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Go";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "171 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuButtonList.activateRow();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "OKButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Go";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "323 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuButtonList.activateRow();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "CancelButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiControl(MessageBoxYNCButtonHolder) {
position = "0 285";
extent = "642 40";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "top";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
class = "MenuInputButtonContainer";
canSave = "1";
canSaveDynamicFields = "0";
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Go";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "99 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuButtonList.activateRow();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "yesButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Go";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "251 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuButtonList.activateRow();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "noButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Go";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "403 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuButtonList.activateRow();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "CancelButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
}; };
}; };
}; };

View file

@ -57,26 +57,17 @@ function OptionsMenu::onWake(%this)
%this.pageTabIndex = 0; %this.pageTabIndex = 0;
%tab = %this.getTab(); %tab = %this.getTab();
%tab.performClick(); %tab.performClick();
OptionsButtonHolder.setActive();
} }
function OptionsButtonHolder::onWake(%this) function OptionsButtonHolder::onWake(%this)
{ {
%this.refresh(); %this-->prevTabButton.set("btn_l", "", "Prev Tab", "OptionsMenu.prevTab();", true);
} %this-->nextTabButton.set("btn_r", "", "Next Tab", "OptionsMenu.nextTab();", true);
%this-->resetButton.set("btn_back", "R", "Reset", "OptionsMenu.resetToDefaults();");
function OptionsButtonHolder::refresh(%this) %this-->applyButton.set("btn_start", "Return", "Apply", "OptionsMenu.apply();");
{ %this-->backButton.set("btn_b", "Escape", "Back", "OptionsMenu.backOut();");
OptionsButtonHolder.add(GamepadButtonsGui);
GamepadButtonsGui.clearButtons();
GamepadButtonsGui.setButton(0, "LB", "", "Prev Tab", "OptionsMenu.prevTab();", true);
GamepadButtonsGui.setButton(1, "RB", "", "Next Tab", "OptionsMenu.nextTab();", true);
GamepadButtonsGui.setButton(2, "Start", "Enter", "Apply", "OptionsMenu.apply();");
GamepadButtonsGui.setButton(3, "B", "Esc", "Back", "OptionsMenu.backOut();");
GamepadButtonsGui.setButton(7, "Back", "R", "Reset", "OptionsMenu.resetToDefaults();");
GamepadButtonsGui.refreshButtons();
} }
function OptionsMenu::apply(%this) function OptionsMenu::apply(%this)
@ -224,18 +215,19 @@ function OptionsMenu::populateDisplaySettingsList(%this)
function OptionsMenu::applyDisplaySettings(%this) function OptionsMenu::applyDisplaySettings(%this)
{ {
%newAdapter = GraphicsMenuDriver.getText(); //%newAdapter = GraphicsMenuDriver.getText();
%numAdapters = GFXInit::getAdapterCount(); //%numAdapters = GFXInit::getAdapterCount();
%newDevice = OptionsMenuSettingsList.getCurrentOption(0); %newDevice = OptionsMenuSettingsList.getCurrentOption(0);
for( %i = 0; %i < %numAdapters; %i ++ ) /*for( %i = 0; %i < %numAdapters; %i ++ )
{ {
if( GFXInit::getAdapterName( %i ) $= %newAdapter ) %targetAdapter = GFXInit::getAdapterName( %i );
if( GFXInit::getAdapterName( %i ) $= %newDevice )
{ {
%newDevice = GFXInit::getAdapterType( %i ); %newDevice = GFXInit::getAdapterType( %i );
break; break;
} }
} }*/
// Change the device. // Change the device.
if ( %newDevice !$= $pref::Video::displayDevice ) if ( %newDevice !$= $pref::Video::displayDevice )
@ -267,6 +259,7 @@ function OptionsMenu::populateGraphicsSettingsList(%this)
%onOffList = "Off\tOn"; %onOffList = "Off\tOn";
%highMedLow = "Low\tMedium\tHigh"; %highMedLow = "Low\tMedium\tHigh";
%anisoFilter = "Off\t4\t8\t16"; %anisoFilter = "Off\t4\t8\t16";
%aaFilter = "Off\t1\t2\t4";
OptionsMenuSettingsList.addOptionRow("Shadow Quality", getQualityLevels(ShadowQualityList), false, "", -1, -30, true, "Shadow revolution quality", getCurrentQualityLevel(ShadowQualityList)); OptionsMenuSettingsList.addOptionRow("Shadow Quality", getQualityLevels(ShadowQualityList), false, "", -1, -30, true, "Shadow revolution quality", getCurrentQualityLevel(ShadowQualityList));
OptionsMenuSettingsList.addOptionRow("Soft Shadow Quality", getQualityLevels(SoftShadowList), false, "", -1, -30, true, "Amount of softening applied to shadowmaps", getCurrentQualityLevel(SoftShadowList)); OptionsMenuSettingsList.addOptionRow("Soft Shadow Quality", getQualityLevels(SoftShadowList), false, "", -1, -30, true, "Amount of softening applied to shadowmaps", getCurrentQualityLevel(SoftShadowList));
OptionsMenuSettingsList.addOptionRow("Mesh Quality", getQualityLevels(MeshQualityGroup), false, "", -1, -30, true, "Fidelity of rendering of mesh objects", getCurrentQualityLevel(MeshQualityGroup)); OptionsMenuSettingsList.addOptionRow("Mesh Quality", getQualityLevels(MeshQualityGroup), false, "", -1, -30, true, "Fidelity of rendering of mesh objects", getCurrentQualityLevel(MeshQualityGroup));
@ -276,7 +269,7 @@ function OptionsMenu::populateGraphicsSettingsList(%this)
OptionsMenuSettingsList.addOptionRow("Ground Cover Density", getQualityLevels(GroundCoverDensityGroup), false, "", -1, -30, true, "Density of ground cover items, such as grass", getCurrentQualityLevel(GroundCoverDensityGroup)); OptionsMenuSettingsList.addOptionRow("Ground Cover Density", getQualityLevels(GroundCoverDensityGroup), false, "", -1, -30, true, "Density of ground cover items, such as grass", getCurrentQualityLevel(GroundCoverDensityGroup));
OptionsMenuSettingsList.addOptionRow("Shader Quality", getQualityLevels(ShaderQualityGroup), false, "", -1, -30, true, "Dictates the overall shader quality level, adjusting what features are enabled.", getCurrentQualityLevel(ShaderQualityGroup)); OptionsMenuSettingsList.addOptionRow("Shader Quality", getQualityLevels(ShaderQualityGroup), false, "", -1, -30, true, "Dictates the overall shader quality level, adjusting what features are enabled.", getCurrentQualityLevel(ShaderQualityGroup));
OptionsMenuSettingsList.addOptionRow("Anisotropic Filtering", %anisoFilter, false, "", -1, -30, true, "Amount of Anisotropic Filtering on textures, which dictates their sharpness at a distance", $pref::Video::defaultAnisotropy); OptionsMenuSettingsList.addOptionRow("Anisotropic Filtering", %anisoFilter, false, "", -1, -30, true, "Amount of Anisotropic Filtering on textures, which dictates their sharpness at a distance", $pref::Video::defaultAnisotropy);
OptionsMenuSettingsList.addOptionRow("Anti-Aliasing", "4\t2\t1\tOff", false, "", -1, -30, true, "Amount of Post-Processing Anti-Aliasing applied to rendering", $pref::Video::AA); OptionsMenuSettingsList.addOptionRow("Anti-Aliasing", %aaFilter, false, "", -1, -30, true, "Amount of Post-Processing Anti-Aliasing applied to rendering", $pref::Video::AA);
OptionsMenuSettingsList.addOptionRow("Parallax", %onOffList, false, "", -1, -30, true, "Whether the surface parallax shader effect is enabled", convertBoolToOnOff(!$pref::Video::disableParallaxMapping)); OptionsMenuSettingsList.addOptionRow("Parallax", %onOffList, false, "", -1, -30, true, "Whether the surface parallax shader effect is enabled", convertBoolToOnOff(!$pref::Video::disableParallaxMapping));
OptionsMenuSettingsList.addOptionRow("Water Reflections", %onOffList, false, "", -1, -30, true, "Whether water reflections are enabled", convertBoolToOnOff(!$pref::Water::disableTrueReflections)); OptionsMenuSettingsList.addOptionRow("Water Reflections", %onOffList, false, "", -1, -30, true, "Whether water reflections are enabled", convertBoolToOnOff(!$pref::Water::disableTrueReflections));
OptionsMenuSettingsList.addOptionRow("SSAO", %onOffList, false, "", -1, -30, true, "Whether Screen-Space Ambient Occlusion is enabled", convertBoolToOnOff($pref::PostFX::EnableSSAO)); OptionsMenuSettingsList.addOptionRow("SSAO", %onOffList, false, "", -1, -30, true, "Whether Screen-Space Ambient Occlusion is enabled", convertBoolToOnOff($pref::PostFX::EnableSSAO));

View file

@ -13,6 +13,8 @@
isContainer = "1"; isContainer = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
pageTabIndex = "0";
returnGui = "MainMenuGui";
tamlReader = "20088"; tamlReader = "20088";
tile = "0"; tile = "0";
useVariable = "0"; useVariable = "0";
@ -32,6 +34,26 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiBitmapBarCtrl() {
percent = "100";
vertical = "0";
flipClip = "0";
bitmap = "data/ui/images/panel.png";
color = "255 255 255 255";
position = "0 0";
extent = "927 40";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() { new GuiTextCtrl() {
text = "OPTIONS"; text = "OPTIONS";
maxLength = "1024"; maxLength = "1024";
@ -41,7 +63,7 @@
anchorBottom = "0"; anchorBottom = "0";
anchorLeft = "1"; anchorLeft = "1";
anchorRight = "0"; anchorRight = "0";
position = "22 10"; position = "22 7";
extent = "120 28"; extent = "120 28";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
@ -59,20 +81,19 @@
percent = "100"; percent = "100";
vertical = "0"; vertical = "0";
flipClip = "0"; flipClip = "0";
bitmap = "data/ui/images/hudfill.png"; bitmap = "data/ui/images/panel_low.png";
color = "255 255 255 255"; color = "255 255 255 255";
position = "0 40"; position = "0 40";
extent = "846 618"; extent = "927 618";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "width";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "GuiDefaultProfile"; profile = "GuiDefaultProfile";
visible = "0"; visible = "1";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
hidden = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
@ -89,13 +110,13 @@
profile = "GuiMenuButtonProfile"; profile = "GuiMenuButtonProfile";
visible = "1"; visible = "1";
active = "1"; active = "1";
command = "OptionsMenu.populateDisplaySettingsList();";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
internalName = "DisplayButton";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
internalName = "DisplayButton";
command="OptionsMenu.populateDisplaySettingsList();";
}; };
new GuiButtonCtrl() { new GuiButtonCtrl() {
text = "Graphics"; text = "Graphics";
@ -110,13 +131,13 @@
profile = "GuiMenuButtonProfile"; profile = "GuiMenuButtonProfile";
visible = "1"; visible = "1";
active = "1"; active = "1";
command = "OptionsMenu.populateGraphicsSettingsList();";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
internalName = "GraphicsButton";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
internalName = "GraphicsButton";
command="OptionsMenu.populateGraphicsSettingsList();";
}; };
new GuiButtonCtrl() { new GuiButtonCtrl() {
text = "Audio"; text = "Audio";
@ -131,13 +152,13 @@
profile = "GuiMenuButtonProfile"; profile = "GuiMenuButtonProfile";
visible = "1"; visible = "1";
active = "1"; active = "1";
command = "OptionsMenu.populateAudioSettingsList();";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
internalName = "AudioButton";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
internalName = "AudioButton";
command="OptionsMenu.populateAudioSettingsList();";
}; };
new GuiButtonCtrl() { new GuiButtonCtrl() {
text = "Keyboard + Mouse"; text = "Keyboard + Mouse";
@ -152,13 +173,13 @@
profile = "GuiMenuButtonProfile"; profile = "GuiMenuButtonProfile";
visible = "1"; visible = "1";
active = "1"; active = "1";
command = "OptionsMenu.populateKeyboardMouseSettingsList();";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
internalName = "KBMButton";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
internalName = "KBMButton";
command="OptionsMenu.populateKeyboardMouseSettingsList();";
}; };
new GuiButtonCtrl() { new GuiButtonCtrl() {
text = "Gamepad"; text = "Gamepad";
@ -173,13 +194,13 @@
profile = "GuiMenuButtonProfile"; profile = "GuiMenuButtonProfile";
visible = "1"; visible = "1";
active = "1"; active = "1";
command = "OptionsMenu.populateGamepadSettingsList();";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
internalName = "gamepadButton";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
internalName = "GamepadButton";
command="OptionsMenu.populateGamepadSettingsList();";
}; };
new GuiScrollCtrl() { new GuiScrollCtrl() {
willFirstRespond = "1"; willFirstRespond = "1";
@ -211,13 +232,10 @@
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiGameListMenuCtrl(OptionsMenuSettingsList) { new GuiGameListMenuCtrl(OptionsMenuSettingsList) {
class = "UIMenuButtonList";
debugRender = "0"; debugRender = "0";
callbackOnA = "OptionsMenuSettingsList.activateRow();";
callbackOnB = "OptionsMenuSettingsList.backOut();";
callbackOnInputs = "1"; callbackOnInputs = "1";
position = "1 1"; position = "1 1";
extent = "621 141"; extent = "621 510";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "width"; horizSizing = "width";
vertSizing = "bottom"; vertSizing = "bottom";
@ -227,12 +245,12 @@
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
class = "UIMenuButtonList";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
}; };
new GuiTextCtrl(OptionName) { new GuiTextCtrl(OptionName) {
text = "Option";
maxLength = "1024"; maxLength = "1024";
margin = "0 0 0 0"; margin = "0 0 0 0";
padding = "0 0 0 0"; padding = "0 0 0 0";
@ -265,7 +283,7 @@
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "right"; horizSizing = "right";
vertSizing = "bottom"; vertSizing = "bottom";
profile = "GuiMLWhiteTextProfile"; profile = "GuiMLTextProfile";
visible = "1"; visible = "1";
active = "1"; active = "1";
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
@ -275,7 +293,7 @@
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
}; };
new GuiControl(OptionsButtonHolder) { new GuiControl() {
position = "189 652"; position = "189 652";
extent = "646 130"; extent = "646 130";
minExtent = "8 2"; minExtent = "8 2";
@ -290,5 +308,169 @@
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
new GuiControl(OptionsButtonHolder) {
position = "109 711";
extent = "791 40";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "top";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
class = "MenuInputButtonContainer";
canSave = "1";
canSaveDynamicFields = "0";
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Apply";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "507 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "ChooseLevelDlg.beginLevel();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "applyButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Esc";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Back";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "651 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "ChooseLevelDlg.backOut();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "backButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Prev Tab";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "prevTabButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Esc";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Next Tab";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "144 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "nextTabButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Esc";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Reset";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "325 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "resetButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
};
}; };
//--- OBJECT WRITE END --- //--- OBJECT WRITE END ---

View file

@ -8,6 +8,10 @@ function PauseMenuList::onAdd(%this)
function PauseMenu::onWake(%this) function PauseMenu::onWake(%this)
{ {
$timescale = 0; $timescale = 0;
PauseMenuList.hidden = false;
PauseMenuList.setFirstResponder();
PauseButtonHolder.setActive();
} }
@ -19,7 +23,8 @@ function PauseMenu::onSleep(%this)
function PauseMenu::onReturnTo(%this) function PauseMenu::onReturnTo(%this)
{ {
PauseMenuList.hidden = false; PauseMenuList.hidden = false;
PauseButtonHolder.refresh(); PauseMenuList.setFirstResponder();
PauseButtonHolder.setActive();
} }
function openPauseMenuOptions() function openPauseMenuOptions()
@ -43,17 +48,6 @@ function pauseMenuExitToDesktop()
function PauseButtonHolder::onWake(%this) function PauseButtonHolder::onWake(%this)
{ {
%this.refresh(); %this-->goButton.set("btn_a", "Return", "OK", "PauseMenuList.activateRow();", true);
} %this-->backButton.set("btn_b", "Escape", "Back", "Canvas.popDialog();");
function PauseButtonHolder::refresh(%this)
{
PauseButtonHolder.add(GamepadButtonsGui);
GamepadButtonsGui.clearButtons();
GamepadButtonsGui.setButton(2, "A", "", "", "", true);
GamepadButtonsGui.setButton(3, "B", "Esc", "Back", "Canvas.popDialog();");
GamepadButtonsGui.refreshButtons();
} }

View file

@ -36,7 +36,7 @@
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
}; };
new GuiControl() { new GuiControl() {
position = "155 118"; position = "162 125";
extent = "700 518"; extent = "700 518";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "center"; horizSizing = "center";
@ -49,12 +49,9 @@
isContainer = "1"; isContainer = "1";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiGameListMenuCtrl(PauseMenuList) { new GuiGameListMenuCtrl(PauseMenuList) {
class = "UIMenuButtonList";
debugRender = "0"; debugRender = "0";
callbackOnA = "OptionsMenuSettingsList.activateRow();";
callbackOnB = "OptionsMenuSettingsList.backOut();";
callbackOnInputs = "1"; callbackOnInputs = "1";
position = "0 0"; position = "0 0";
extent = "700 320"; extent = "700 320";
@ -67,14 +64,14 @@
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "0"; isContainer = "0";
class = "UIMenuButtonList";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
}; };
}; };
new GuiControl(PauseButtonHolder) { new GuiControl(PauseButtonHolder) {
position = "189 652"; position = "189 711";
extent = "646 130"; extent = "646 40";
minExtent = "8 2"; minExtent = "8 2";
horizSizing = "center"; horizSizing = "center";
vertSizing = "top"; vertSizing = "top";
@ -84,8 +81,70 @@
tooltipProfile = "GuiToolTipProfile"; tooltipProfile = "GuiToolTipProfile";
hovertime = "1000"; hovertime = "1000";
isContainer = "1"; isContainer = "1";
class = "MenuInputButtonContainer";
canSave = "1"; canSave = "1";
canSaveDynamicFields = "0"; canSaveDynamicFields = "0";
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Enter";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "OK";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "363 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "PauseMenuList.activateRow();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "goButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiIconButtonCtrl() {
buttonMargin = "4 4";
iconBitmap = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_Esc";
iconLocation = "Left";
sizeIconToButton = "1";
makeIconSquare = "1";
textLocation = "Right";
textMargin = "4";
autoSize = "0";
text = "Back";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "507 0";
extent = "140 40";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "Canvas.popDialog();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "backButton";
class = "MenuInputButton";
canSave = "1";
canSaveDynamicFields = "0";
};
}; };
}; };
//--- OBJECT WRITE END --- //--- OBJECT WRITE END ---

View file

@ -33,13 +33,15 @@ function loadStartup()
// to cycle through. Note that they have to // to cycle through. Note that they have to
// be in consecutive numerical order // be in consecutive numerical order
StartupGui.bitmap[0] = "data/ui/images/background-dark"; StartupGui.bitmap[0] = "data/ui/images/background-dark";
StartupGui.logo[0] = "data/ui/images/Torque-3D-logo"; StartupGui.logo[0] = "data/ui/images/Torque-3D-logo_alt";
StartupGui.logoPos[0] = "178 251"; StartupGui.logoPos[0] = "178 251";
StartupGui.logoExtent[0] = "443 139"; StartupGui.logoExtent[0] = "443 139";
// Call the next() function to set our firt // Call the next() function to set our firt
// splash screen // splash screen
StartupGui.next(); StartupGui.next();
StartupGui.setFirstResponder();
// Play our startup sound // Play our startup sound
//SFXPlayOnce(AudioGui, "data/ui/sounds/startup");//SFXPlay(startsnd); //SFXPlayOnce(AudioGui, "data/ui/sounds/startup");//SFXPlay(startsnd);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Before After
Before After

View file

@ -1,200 +0,0 @@
// =============================================================================
// AUDIO MENU
// =============================================================================
$AudioTestHandle = 0;
// Description to use for playing the volume test sound. This isn't
// played with the description of the channel that has its volume changed
// because we know nothing about the playback state of the channel. If it
// is paused or stopped, the test sound would not play then.
$AudioTestDescription = new SFXDescription()
{
sourceGroup = AudioChannelMaster;
};
function AudioMenu::loadSettings(%this)
{
// Audio
//OptAudioHardwareToggle.setStateOn($pref::SFX::useHardware);
//OptAudioHardwareToggle.setActive( true );
/*%this-->OptAudioVolumeMaster.setValue( $pref::SFX::masterVolume );
%this-->OptAudioVolumeShell.setValue( $pref::SFX::channelVolume[ $GuiAudioType] );
%this-->OptAudioVolumeSim.setValue( $pref::SFX::channelVolume[ $SimAudioType ] );
%this-->OptAudioVolumeMusic.setValue( $pref::SFX::channelVolume[ $MusicAudioType ] );
AudioMenuSoundDriver.clear();
%buffer = sfxGetAvailableDevices();
%count = getRecordCount( %buffer );
for(%i = 0; %i < %count; %i++)
{
%record = getRecord(%buffer, %i);
%provider = getField(%record, 0);
if ( AudioMenuSoundDriver.findText( %provider ) == -1 )
AudioMenuSoundDriver.add( %provider, %i );
}
AudioMenuSoundDriver.sort();
%selId = AudioMenuSoundDriver.findText($pref::SFX::provider);
if ( %selId == -1 )
AudioMenuSoundDriver.setFirstSelected();
else
AudioMenuSoundDriver.setSelected( %selId );*/
OptionsSettingStack.clear();
OptionsMenu.addSliderOption(OptionsSettingStack, "Master Volume", $pref::Video::Brightness, "0 1", 10, 5);
OptionsMenu.addSliderOption(OptionsSettingStack, "Menu Volume", $pref::Video::Brightness, "0 1", 10, 5);
OptionsMenu.addSliderOption(OptionsSettingStack, "Effects Volume", $pref::Video::Brightness, "0 1", 10, 5);
OptionsMenu.addSliderOption(OptionsSettingStack, "Music Volume", $pref::Video::Brightness, "0 1", 10, 5);
}
function AudioMenu::loadDevices(%this)
{
if(!isObject(SoundDeviceGroup))
{
new SimGroup( SoundDeviceGroup );
}
else
{
SoundDeviceGroup.clear();
}
%buffer = sfxGetAvailableDevices();
%count = getRecordCount( %buffer );
for (%i = 0; %i < %count; %i++)
{
%record = getRecord(%buffer, %i);
%provider = getField(%record, 0);
%device = getField(%record, 1);
if($pref::SFX::provider !$= %provider)
continue;
%setting = new ArrayObject()
{
class = "OptionsMenuSettingLevel";
caseSensitive = true;
displayName = %device;
key["$pref::SFX::Device"] = %device;
};
SoundDeviceGroup.add(%setting);
}
}
function AudioMenu::apply(%this)
{
sfxSetMasterVolume( $pref::SFX::masterVolume );
sfxSetChannelVolume( $GuiAudioType, $pref::SFX::channelVolume[ $GuiAudioType ] );
sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ $SimAudioType ] );
sfxSetChannelVolume( $MusicAudioType, $pref::SFX::channelVolume[ $MusicAudioType ] );
if ( !sfxCreateDevice( $pref::SFX::provider,
$pref::SFX::device,
$pref::SFX::useHardware,
-1 ) )
error( "Unable to create SFX device: " @ $pref::SFX::provider
SPC $pref::SFX::device
SPC $pref::SFX::useHardware );
if( !isObject( $AudioTestHandle ) )
{
sfxPlay(menuButtonPressed);
}
}
function AudioMenuOKButton::onClick(%this)
{
//save the settings and then back out
AudioMenu.apply();
OptionsMenu.backOut();
}
function AudioMenuDefaultsButton::onClick(%this)
{
sfxInit();
AudioMenu.loadSettings();
}
function OptAudioUpdateMasterVolume( %volume )
{
if( %volume == $pref::SFX::masterVolume )
return;
sfxSetMasterVolume( %volume );
$pref::SFX::masterVolume = %volume;
if( !isObject( $AudioTestHandle ) )
$AudioTestHandle = sfxPlayOnce( AudioChannel, "data/ui/sounds/volumeTest.wav" );
}
function OptAudioUpdateChannelVolume( %description, %volume )
{
%channel = sfxGroupToOldChannel( %description.sourceGroup );
if( %volume == $pref::SFX::channelVolume[ %channel ] )
return;
sfxSetChannelVolume( %channel, %volume );
$pref::SFX::channelVolume[ %channel ] = %volume;
if( !isObject( $AudioTestHandle ) )
{
$AudioTestDescription.volume = %volume;
$AudioTestHandle = sfxPlayOnce( $AudioTestDescription, "data/ui/sounds/volumeTest.wav" );
}
}
function AudioMenuSoundDriver::onSelect( %this, %id, %text )
{
// Skip empty provider selections.
if ( %text $= "" )
return;
$pref::SFX::provider = %text;
AudioMenuSoundDevice.clear();
%buffer = sfxGetAvailableDevices();
%count = getRecordCount( %buffer );
for(%i = 0; %i < %count; %i++)
{
%record = getRecord(%buffer, %i);
%provider = getField(%record, 0);
%device = getField(%record, 1);
if (%provider !$= %text)
continue;
if ( AudioMenuSoundDevice.findText( %device ) == -1 )
AudioMenuSoundDevice.add( %device, %i );
}
// Find the previous selected device.
%selId = AudioMenuSoundDevice.findText($pref::SFX::device);
if ( %selId == -1 )
AudioMenuSoundDevice.setFirstSelected();
else
AudioMenuSoundDevice.setSelected( %selId );
}
function AudioMenuSoundDevice::onSelect( %this, %id, %text )
{
// Skip empty selections.
if ( %text $= "" )
return;
$pref::SFX::device = %text;
if ( !sfxCreateDevice( $pref::SFX::provider,
$pref::SFX::device,
$pref::SFX::useHardware,
-1 ) )
error( "Unable to create SFX device: " @ $pref::SFX::provider
SPC $pref::SFX::device
SPC $pref::SFX::useHardware );
}

View file

@ -1,103 +0,0 @@
$movementSpeed = 1; // m/s
function moveleft(%val)
{
$mvLeftAction = %val * $movementSpeed;
}
function moveright(%val)
{
$mvRightAction = %val * $movementSpeed;
}
function moveforward(%val)
{
$mvForwardAction = %val * $movementSpeed;
}
function movebackward(%val)
{
$mvBackwardAction = %val * $movementSpeed;
}
function gamePadMoveX( %val )
{
if(%val > 0)
{
$mvRightAction = %val * $movementSpeed;
$mvLeftAction = 0;
}
else
{
$mvRightAction = 0;
$mvLeftAction = -%val * $movementSpeed;
}
}
function gamePadMoveY( %val )
{
if(%val > 0)
{
$mvForwardAction = %val * $movementSpeed;
$mvBackwardAction = 0;
}
else
{
$mvForwardAction = 0;
$mvBackwardAction = -%val * $movementSpeed;
}
}
function gamepadYaw(%val)
{
%yawAdj = getGamepadAdjustAmount(%val);
if(ServerConnection.isControlObjectRotDampedCamera())
{
// Clamp and scale
%yawAdj = mClamp(%yawAdj, -m2Pi()+0.01, m2Pi()-0.01);
%yawAdj *= 0.5;
}
if(%yawAdj > 0)
{
$mvYawLeftSpeed = %yawAdj;
$mvYawRightSpeed = 0;
}
else
{
$mvYawLeftSpeed = 0;
$mvYawRightSpeed = -%yawAdj;
}
}
function gamepadPitch(%val)
{
%pitchAdj = getGamepadAdjustAmount(%val);
if(ServerConnection.isControlObjectRotDampedCamera())
{
// Clamp and scale
%pitchAdj = mClamp(%pitchAdj, -m2Pi()+0.01, m2Pi()-0.01);
%pitchAdj *= 0.5;
}
if(%pitchAdj > 0)
{
$mvPitchDownSpeed = %pitchAdj;
$mvPitchUpSpeed = 0;
}
else
{
$mvPitchDownSpeed = 0;
$mvPitchUpSpeed = -%pitchAdj;
}
}
moveMap.bind( keyboard, a, moveleft );
moveMap.bind( keyboard, d, moveright );
moveMap.bind( keyboard, w, moveforward );
moveMap.bind( keyboard, s, movebackward );
moveMap.bind( gamepad, thumbrx, "D", "-0.23 0.23", gamepadYaw );
moveMap.bind( gamepad, thumbry, "D", "-0.23 0.23", gamepadPitch );
moveMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamePadMoveX );
moveMap.bind( gamepad, thumbly, "D", "-0.23 0.23", gamePadMoveY );

View file

@ -1,245 +0,0 @@
function DisplayMenu::loadSettings()
{
OptionsMenu.currentMenu = "DisplayMenu";
OptionsSettingStack.clear();
%APICount = getTokenCount(GraphicsDriverSetting::getList(),",");
if(%APICount > 1)
OptionsMenu.addSettingOption(OptionsSettingStack, "Diplay API", "", "GraphicsDriverSetting");
OptionsMenu.addSettingOption(OptionsSettingStack, "Screen Resolution", "", "ScreenResolutionSetting");
OptionsMenu.addSettingOption(OptionsSettingStack, "Fullscreen", "", "FullscreenSetting");
OptionsMenu.addSettingOption(OptionsSettingStack, "VSync", "", "VSyncSetting");
OptionsMenu.addSliderOption(OptionsSettingStack, "Field of View", $pref::Video::FOV, "65 120", 55, 75);
OptionsMenu.addSliderOption(OptionsSettingStack, "Brightness", $pref::Video::Brightness, "0 1", 10, 5);
OptionsMenu.addSliderOption(OptionsSettingStack, "Contrast", $pref::Video::Contrast, "0 1", 10, 5);
GraphicsSettingsCache.empty();
}
function DisplayMenu::apply(%this)
{
//Loop through the settings cache and actually apply the values
%cachedSettingCount = GraphicsSettingsCache.count();
for(%i=0; %i < %cachedSettingCount; %i++)
{
%var = GraphicsSettingsCache.getKey(%i);
%val = GraphicsSettingsCache.getValue(%i);
if(%var $= "$pref::Video::displayDevice")
{
MessageBoxOK( "Change requires restart", "Please restart the game for a display device change to take effect." );
}
setVariable(%var, %val);
}
//Update the display settings now
if (getWord( $pref::Video::Resolution, 2) $= "")
{
$pref::Video::Resolution = getWord( $pref::Video::Resolution, 0 ) SPC getWord( $pref::Video::Resolution, 1 );
}
else
{
$pref::Video::Resolution = getWord( $pref::Video::Resolution, 0 ) SPC getWord( $pref::Video::Resolution, 2 );
}
/*if ( %newFullScreen $= "false" )
{
// If we're in windowed mode switch the fullscreen check
// if the resolution is bigger than the desktop.
%deskRes = getDesktopResolution();
%deskResX = getWord(%deskRes, $WORD::RES_X);
%deskResY = getWord(%deskRes, $WORD::RES_Y);
if ( getWord( %newRes, $WORD::RES_X ) > %deskResX ||
getWord( %newRes, $WORD::RES_Y ) > %deskResY )
{
$pref::Video::FullScreen = "true";
GraphicsMenuFullScreen.setStateOn( true );
}
}*/
// Build the final mode string.
%newMode = $pref::Video::Resolution SPC $pref::Video::FullScreen SPC 32 SPC $pref::Video::RefreshRate SPC $pref::Video::AA;
// Change the video mode.
/*if ( %newMode !$= $pref::Video::mode ||
%newVsync != $pref::Video::disableVerticalSync )
{
if ( %testNeedApply )
return true;*/
$pref::Video::mode = %newMode;
//$pref::Video::disableVerticalSync = %newVsync;
configureCanvas();
//}
echo("Exporting client prefs");
%prefPath = getPrefpath();
export("$pref::*", %prefPath @ "/clientPrefs.cs", false);
}
//
function GraphicsDriverSetting::set(%setting)
{
switch$(%setting)
{
case "D3D11":
GraphicsMenu::set("$pref::Video::displayDevice", "D3D11");
case "OpenGL":
GraphicsMenu::set("$pref::Video::displayDevice", "OpenGL");
default:
GraphicsMenu::set("$pref::Video::displayDevice", "OpenGL");
}
}
function GraphicsDriverSetting::get()
{
if($pref::Video::displayDevice $= "D3D11")
return "D3D11";
else if($pref::Video::displayDevice $= "OpenGL")
return "OpenGL";
else
return "Unknown";
}
function GraphicsDriverSetting::getList()
{
%returnsList = "";
%buffer = getDisplayDeviceList();
%deviceCount = getFieldCount( %buffer );
%numAdapters = GFXInit::getAdapterCount();
%count = 0;
for(%i = 0; %i < %deviceCount; %i++)
{
%deviceDesc = getField(%buffer, %i);
if(%deviceDesc $= "GFX Null Device")
continue;
for( %i = 0; %i < %numAdapters; %i ++ )
{
if( GFXInit::getAdapterName( %i ) $= %deviceDesc )
{
%deviceName = GFXInit::getAdapterType( %i );
break;
}
}
if(%count != 0)
%returnsList = %returnsList @ "," @ %deviceName;
else
%returnsList = %deviceName;
%count++;
}
return %returnsList;
}
//
function ScreenResolutionSetting::set(%setting)
{
GraphicsMenu::set("$pref::Video::Resolution", %setting);
}
function ScreenResolutionSetting::get()
{
return _makePrettyResString( $pref::Video::Resolution );
}
function ScreenResolutionSetting::getList()
{
%returnsList = "";
%resCount = Canvas.getModeCount();
for (%i = 0; %i < %resCount; %i++)
{
%testResString = Canvas.getMode( %i );
%testRes = _makePrettyResString( %testResString );
//sanitize
%found = false;
%retCount = getTokenCount(%returnsList, ",");
for (%x = 0; %x < %retCount; %x++)
{
%existingEntry = getToken(%returnsList, ",", %x);
if(%existingEntry $= %testRes)
{
%found = true;
break;
}
}
if(%found)
continue;
if(%i != 0)
%returnsList = %returnsList @ "," @ %testRes;
else
%returnsList = %testRes;
}
return %returnsList;
}
//
function FullscreenSetting::set(%setting)
{
switch$(%setting)
{
case "On":
GraphicsMenu::set("$pref::Video::FullScreen", "1");
case "Off":
GraphicsMenu::set("$pref::Video::FullScreen", "0");
default:
GraphicsMenu::set("$pref::Video::FullScreen", "0");
}
}
function FullscreenSetting::get()
{
if($pref::Video::FullScreen == 1)
return "On";
else if($pref::Video::FullScreen == 0)
return "Off";
else
return "Custom";
}
function FullscreenSetting::getList()
{
return "Off,On";
}
//
function VSyncSetting::set(%setting)
{
switch$(%setting)
{
case "On":
GraphicsMenu::set("$pref::Video::disableVerticalSync", "0");
case "Off":
GraphicsMenu::set("$pref::Video::disableVerticalSync", "1");
default:
GraphicsMenu::set("$pref::Video::disableVerticalSync", "1");
}
}
function VSyncSetting::get()
{
if($pref::Video::disableVerticalSync == 0)
return "On";
else if($pref::Video::disableVerticalSync == 1)
return "Off";
else
return "Custom";
}
function VSyncSetting::getList()
{
return "Off,On";
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,347 @@
//==============================================================================
// Menu Input Buttons
// This file manages the Menu Input Buttons stuff
// Any time you have a GUI button that should be clickable AND map to a key input
// such as a gamepad button, or enter, etc, this stuff can be used
//==============================================================================
/*
Gamepad input reference for 360 controller
btn_a = A
btn_b = B
btn_x = X
btn_y = Y
btn_r = Right Bumper
btn_l = Right Bumper
upov = Dpad Up
dpov = Dpad Down
lpov = Dpad Left
rpov = Dpad Right
xaxis = Left Stick | + values = up, - values = down
yaxis = Left Stick | + values = up, - values = down
rxaxis = Right Stick | + values = up, - values = down
ryaxis = Right Stick | + values = up, - values = down
zaxis = Left Trigger
rzaxis = Right Trigger
btn_start = Start
btn_back = Back/Select
*/
/// This is used with the main UI menu lists, when a non-axis input event is called
/// such as pressing a button
/// It is called from the engine
function UIMenuButtonList::onInputEvent(%this, %device, %action, %state)
{
if(%state)
$activeMenuButtonContainer.processInputs(%device, %action);
}
/// This is used with the main UI menu lists, when an axis input event is called
/// such as moving a joystick
/// It is called from the engine
function UIMenuButtonList::onAxisEvent(%this, %device, %action, %axisVal)
{
//Skip out of the value is too low as it could just be noise or miscalibrated defaults
if(%axisVal < 0.02)
return;
$activeMenuButtonContainer.processAxisEvent(%device, %action);
}
/// Sets the command and text for the specified button. If %text and %command
/// are left empty, the button will be disabled and hidden.
///
/// \param %gamepadButton (string) The button to set for when using gamepad input. See the input map reference comment at the top of the file
/// \param %keyboardButton (string) The button to set for when using keyboard/mouse input.
/// \param %text (string) The text to display next to the A button graphic.
/// \param %command (string) The command executed when the A button is pressed.
/// \param %gamepadOnly (bool) If true, will only show the button when working in the gamepad input mode
function MenuInputButton::set(%this, %gamepadButton, %keyboardButton, %text, %command, %gamepadOnly)
{
%set = (! ((%text $= "") && (%command $= "")));
%this.setText(%text);
%this.setActive(%set);
%this.setVisible(%set);
%this.gamepadButton = %gamepadButton;
%this.keyboardButton = %keyboardButton;
if(%gamepadOnly $= "")
%gamepadOnly = false;
%this.gamepadOnly = %gamepadOnly;
%this.Command = %command;
}
/// Refreshes the specific button, updating it's visbility status and the displayed input image
function MenuInputButton::refresh(%this)
{
%set = (! ((%this.text $= "") && (%this.command $= "")));
//Special-case of where we're in keyboard+mouse mode, but the menubutton is gamepad only mode, so we early out
if(%this.gamepadOnly && $activeControllerType !$= "gamepad")
%set = false;
%this.setActive(%set);
%this.setVisible(%set);
if(!%this.isActive())
return;
if($activeControllerType $= "gamepad")
{
if(%this.gamepadButton !$= "")
{
%path = "";
if($activeControllerName $= "PS4 Controller")
{
%path = "data/ui/images/inputs/PS4/PS4_";
if(%this.gamepadButton $= "btn_a")
%path = %path @ "Cross";
else if(%this.gamepadButton $= "btn_b")
%path = %path @ "Circle";
else if(%this.gamepadButton $= "btn_x")
%path = %path @ "Square";
else if(%this.gamepadButton $= "btn_y")
%path = %path @ "Triangle";
else if(%this.gamepadButton $= "btn_l")
%path = %path @ "L1";
else if(%this.gamepadButton $= "zaxis")
%path = %path @ "L2";
else if(%this.gamepadButton $= "btn_r")
%path = %path @ "R1";
else if(%this.gamepadButton $= "rzaxis")
%path = %path @ "R2";
else if(%this.gamepadButton $= "btn_start")
%path = %path @ "Options";
else if(%this.gamepadButton $= "btn_back")
%path = %path @ "Share";
else
continue;
}
else if($activeControllerName $= "Nintendo Switch Pro Controller")
{
%path = "data/ui/images/inputs/Switch/Switch_";
if(%this.gamepadButton $= "btn_a")
%path = %path @ "B";
else if(%this.gamepadButton $= "btn_b")
%path = %path @ "A";
else if(%this.gamepadButton $= "btn_x")
%path = %path @ "Y";
else if(%this.gamepadButton $= "btn_y")
%path = %path @ "X";
else if(%this.gamepadButton $= "btn_l")
%path = %path @ "LB";
else if(%this.gamepadButton $= "zaxis")
%path = %path @ "LT";
else if(%this.gamepadButton $= "btn_r")
%path = %path @ "RB";
else if(%this.gamepadButton $= "rzaxis")
%path = %path @ "RT";
else if(%this.gamepadButton $= "btn_start")
%path = %path @ "Plus";
else if(%this.gamepadButton $= "btn_back")
%path = %path @ "Minus";
else
continue;
}
else if($activeControllerName !$= "")
{
%path = "data/ui/images/inputs/Xbox/Xbox_";
if(%this.gamepadButton $= "btn_a")
%path = %path @ "A";
else if(%this.gamepadButton $= "btn_b")
%path = %path @ "B";
else if(%this.gamepadButton $= "btn_x")
%path = %path @ "X";
else if(%this.gamepadButton $= "btn_y")
%path = %path @ "Y";
else if(%this.gamepadButton $= "btn_l")
%path = %path @ "LB";
else if(%this.gamepadButton $= "zaxis")
%path = %path @ "LT";
else if(%this.gamepadButton $= "btn_r")
%path = %path @ "RB";
else if(%this.gamepadButton $= "rzaxis")
%path = %path @ "RT";
else if(%this.gamepadButton $= "btn_start")
%path = %path @ "Menu";
else if(%this.gamepadButton $= "btn_back")
%path = %path @ "Windows";
else
continue;
}
}
}
else
{
if(%this.keyboardButton !$= "")
{
%path = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_" @ %this.keyboardButton;
}
}
%this.setBitmap(%path);
return true;
}
/// Refreshes a menu input container, updating the buttons inside it
function MenuInputButtonContainer::refresh(%this)
{
%count = %this.getCount();
for(%i=0; %i < %count; %i++)
{
%btn = %this.getObject(%i);
%btn.refresh();
}
}
/// Sets the given MenuInputButtonContainer as the active one. This directs input events
/// to it's buttons, ensures it's visible, and auto-hides the old active container if it was set
function MenuInputButtonContainer::setActive(%this)
{
if(isObject($activeMenuButtonContainer))
$activeMenuButtonContainer.hidden = true;
$activeMenuButtonContainer = %this;
$activeMenuButtonContainer.hidden = false;
$activeMenuButtonContainer.refresh();
}
/// Checks the input manager for if we have a gamepad active and gets it's name
/// If we have one, also sets the active input type to gamepad
function MenuInputButtonContainer::checkGamepad(%this)
{
%controllerName = SDLInputManager::JoystickNameForIndex(0);
$activeControllerName = %controllerName;
if($activeControllerName $= "")
$activeControllerType = "K&M";
else
$activeControllerType = "gamepad";
}
/// This is called by the earlier inputs callback that comes from the menu list
/// this allows us to first check what the input type is, and if the device is different
/// (such as going from keyboard and mouse to gamepad) we can refresh the buttons to update
/// the display
/// Then we process the input to see if it matches to any of the button maps for our
/// MenuInputButtons. If we have a match, we execute it's command.
function MenuInputButtonContainer::processInputs(%this, %device, %action)
{
//check to see if our status has changed
%changed = false;
%oldDevice = $activeControllerName;
%deviceName = stripTrailingNumber(%device);
if(%deviceName $= "keyboard" || %deviceName $= "mouse")
{
if($activeControllerName !$= "K&M")
%changed = true;
$activeControllerName = "K&M";
$activeControllerType = "K&M";
Canvas.showCursor();
}
else
{
if(%this.checkGamepad())
{
Canvas.hideCursor();
}
if($activeControllerType !$= %oldDevice)
%changed = true;
}
if(%changed)
%this.refresh();
//Now process the input for the button accelerator, if applicable
//Set up our basic buttons
for(%i=0; %i < %this.getCount(); %i++)
{
%btn = %this.getObject(%i);
if(!%btn.isActive())
continue;
if($activeControllerType !$= "K&M")
{
if(%btn.gamepadButton $= %action)
{
eval(%btn.command);
}
}
else
{
if(%btn.keyboardButton $= %action)
{
eval(%btn.command);
}
}
}
}
/// This is called by the earlier inputs callback that comes from the menu list
/// this allows us to first check what the input type is, and if the device is different
/// (such as going from keyboard and mouse to gamepad) we can refresh the buttons to update
/// the display
function MenuInputButtonContainer::processAxisEvent(%this, %device, %action, %axisVal)
{
//check to see if our status has changed
%changed = false;
%oldDevice = $activeControllerName;
%deviceName = stripTrailingNumber(%device);
if(%deviceName $= "mouse")
{
if($activeControllerName !$= "K&M")
%changed = true;
$activeControllerName = "K&M";
$activeControllerType = "K&M";
Canvas.showCursor();
}
else
{
if(%this.checkGamepad())
{
Canvas.hideCursor();
}
if($activeControllerType !$= %oldDevice)
%changed = true;
}
if(%changed)
%this.refresh();
}
//
//
function onSDLDeviceConnected(%sdlIndex, %deviceName, %deviceType)
{
/*if(GamepadButtonsGui.checkGamepad())
{
GamepadButtonsGui.hidden = false;
}*/
}
function onSDLDeviceDisconnected(%sdlIndex)
{
/*if(!GamepadButtonsGui.checkGamepad())
{
GamepadButtonsGui.hidden = true;
}*/
}

View file

@ -44,9 +44,6 @@ new SFXProfile(messageBoxBeep)
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
function messageCallback(%dlg, %callback) function messageCallback(%dlg, %callback)
{ {
MessageBoxDlg.originalMenubuttonContainer.add(GamepadButtonsGui);
MessageBoxDlg.originalMenubuttonContainer.refresh();
Canvas.popDialog(%dlg); Canvas.popDialog(%dlg);
eval(%callback); eval(%callback);
} }
@ -85,6 +82,10 @@ function MBSetText(%text, %frame, %msg)
//sfxPlayOnce( messageBoxBeep ); //sfxPlayOnce( messageBoxBeep );
} }
function MessageBoxCtrl::onWake(%this)
{
}
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
// Various message box display functions. Each one takes a window title, a message, and a // Various message box display functions. Each one takes a window title, a message, and a
// callback for each button. // callback for each button.
@ -96,12 +97,14 @@ function MessageBoxOK(%title, %message, %callback)
Canvas.pushDialog(MessageBoxDlg); Canvas.pushDialog(MessageBoxDlg);
MessageBoxTitleText.text = %title; MessageBoxTitleText.text = %title;
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent(); MessageBoxOCButtonHolder.hidden = true;
MessageBoxYNCButtonHolder.hidden = true;
MessageBoxOKButtonHolder.hidden = false;
MessageBoxButtonHolder.add(GamepadButtonsGui); MessageBoxOKButtonHolder-->OKButton.set("btn_a", "Return", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
GamepadButtonsGui.clearButtons();
GamepadButtonsGui.setButton(7, "A", "", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);"); MessageBoxCtrl.originalMenuInputContainer = $activeMenuButtonContainer;
GamepadButtonsGui.refreshButtons(); MessageBoxOKButtonHolder.setActive();
MBSetText(MessageBoxText, MessageBoxCtrl, %message); MBSetText(MessageBoxText, MessageBoxCtrl, %message);
MessageBoxDlg.callback = %callback; MessageBoxDlg.callback = %callback;
@ -110,6 +113,7 @@ function MessageBoxOK(%title, %message, %callback)
function MessageBoxOKDlg::onSleep( %this ) function MessageBoxOKDlg::onSleep( %this )
{ {
%this.callback = ""; %this.callback = "";
MessageBoxCtrl.originalMenuInputContainer.setActive();
} }
function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback) function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
@ -117,13 +121,15 @@ function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
Canvas.pushDialog(MessageBoxDlg); Canvas.pushDialog(MessageBoxDlg);
MessageBoxTitleText.text = %title; MessageBoxTitleText.text = %title;
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent(); MessageBoxOCButtonHolder.hidden = false;
MessageBoxYNCButtonHolder.hidden = true;
MessageBoxOKButtonHolder.hidden = true;
MessageBoxButtonHolder.add(GamepadButtonsGui); MessageBoxOCButtonHolder-->OKButton.set("btn_a", "Return", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
GamepadButtonsGui.clearButtons(); MessageBoxOCButtonHolder-->CancelButton.set("btn_b", "Escape", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
GamepadButtonsGui.setButton(5, "A", "", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
GamepadButtonsGui.setButton(6, "B", "", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);"); MessageBoxCtrl.originalMenuInputContainer = $activeMenuButtonContainer;
GamepadButtonsGui.refreshButtons(); MessageBoxOCButtonHolder.setActive();
MBSetText(MessageBoxText, MessageBoxCtrl, %message); MBSetText(MessageBoxText, MessageBoxCtrl, %message);
MessageBoxDlg.callback = %callback; MessageBoxDlg.callback = %callback;
@ -133,6 +139,7 @@ function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
function MessageBoxOKCancelDlg::onSleep( %this ) function MessageBoxOKCancelDlg::onSleep( %this )
{ {
%this.callback = ""; %this.callback = "";
MessageBoxCtrl.originalMenuInputContainer.setActive();
} }
function MessageBoxOKCancelDetails(%title, %message, %details, %callback, %cancelCallback) function MessageBoxOKCancelDetails(%title, %message, %details, %callback, %cancelCallback)
@ -204,6 +211,7 @@ function MBOKCancelDetailsToggleInfoFrame()
function MessageBoxOKCancelDetailsDlg::onSleep( %this ) function MessageBoxOKCancelDetailsDlg::onSleep( %this )
{ {
%this.callback = ""; %this.callback = "";
MessageBoxCtrl.originalMenuInputContainer.setActive();
} }
function MessageBoxYesNo(%title, %message, %yesCallback, %noCallback) function MessageBoxYesNo(%title, %message, %yesCallback, %noCallback)
@ -211,13 +219,15 @@ function MessageBoxYesNo(%title, %message, %yesCallback, %noCallback)
Canvas.pushDialog(MessageBoxDlg); Canvas.pushDialog(MessageBoxDlg);
MessageBoxTitleText.text = %title; MessageBoxTitleText.text = %title;
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent(); MessageBoxOCButtonHolder.hidden = false;
MessageBoxYNCButtonHolder.hidden = true;
MessageBoxOKButtonHolder.hidden = true;
MessageBoxButtonHolder.add(GamepadButtonsGui); MessageBoxOCButtonHolder-->OKButton.set("btn_a", "Return", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);");
GamepadButtonsGui.clearButtons(); MessageBoxOCButtonHolder-->CancelButton.set("btn_b", "Escape", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
GamepadButtonsGui.setButton(5, "A", "", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);");
GamepadButtonsGui.setButton(6, "B", "", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);"); MessageBoxCtrl.originalMenuInputContainer = $activeMenuButtonContainer;
GamepadButtonsGui.refreshButtons(); MessageBoxOCButtonHolder.setActive();
MBSetText(MessageBoxText, MessageBoxCtrl, %message); MBSetText(MessageBoxText, MessageBoxCtrl, %message);
MessageBoxDlg.yesCallBack = %yesCallback; MessageBoxDlg.yesCallBack = %yesCallback;
@ -229,14 +239,16 @@ function MessageBoxYesNoCancel(%title, %message, %yesCallback, %noCallback, %can
Canvas.pushDialog(MessageBoxDlg); Canvas.pushDialog(MessageBoxDlg);
MessageBoxTitleText.text = %title; MessageBoxTitleText.text = %title;
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent(); MessageBoxOCButtonHolder.hidden = true;
MessageBoxYNCButtonHolder.hidden = false;
MessageBoxOKButtonHolder.hidden = true;
MessageBoxButtonHolder.add(GamepadButtonsGui); MessageBoxYNCButtonHolder-->yesButton.set("btn_a", "Return", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);");
GamepadButtonsGui.clearButtons(); MessageBoxYNCButtonHolder-->noButton.set("btn_x", "backspace", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
GamepadButtonsGui.setButton(5, "A", "", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);"); MessageBoxYNCButtonHolder-->cancelButton.set("btn_b", "Escape", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
GamepadButtonsGui.setButton(6, "B", "", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
GamepadButtonsGui.setButton(7, "Back", "", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);"); MessageBoxCtrl.originalMenuInputContainer = $activeMenuButtonContainer;
GamepadButtonsGui.refreshButtons(); MessageBoxYNCButtonHolder.setActive();
MBSetText(MessageBoxText, MessageBoxCtrl, %message); MBSetText(MessageBoxText, MessageBoxCtrl, %message);
MessageBoxDlg.yesCallBack = %yesCallback; MessageBoxDlg.yesCallBack = %yesCallback;
@ -251,6 +263,7 @@ function MessageBoxDlg::onSleep( %this )
%this.yesCallback = ""; %this.yesCallback = "";
%this.noCallback = ""; %this.noCallback = "";
%this.cancelCallback = ""; %this.cancelCallback = "";
MessageBoxCtrl.originalMenuInputContainer.setActive();
} }
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------

View file

@ -1,12 +1,20 @@
$TextMediumEmphasisColor = "200 200 200";
$TextHighEmphasisColor = "224 224 224";
$TextDisabledColor = "108 108 108";
new GuiGameListMenuProfile(DefaultListMenuProfile) new GuiGameListMenuProfile(DefaultListMenuProfile)
{ {
fontType = "Arial Bold"; fontType = "Arial Bold";
fontSize = 20; fontSize = 20;
fontColor = "120 120 120"; fontColor = $TextMediumEmphasisColor;
fontColorSEL = "16 16 16"; fontColorSEL = $TextMediumEmphasisColor;
fontColorNA = "200 200 200"; fontColorNA = $TextDisabledColor;
fontColorHL = "100 100 120"; fontColorHL = $TextMediumEmphasisColor;
fillColor = "108 108 108";
fillColorHL = "140 140 140";
fillColorSEL = "180 180 180";
HitAreaUpperLeft = "16 20"; HitAreaUpperLeft = "16 20";
HitAreaLowerRight = "503 74"; HitAreaLowerRight = "503 74";
IconOffset = "40 0"; IconOffset = "40 0";
@ -40,7 +48,7 @@ new GuiControlProfile(MenuHeaderText)
{ {
fontType = "Arial Bold"; fontType = "Arial Bold";
fontSize = 30; fontSize = 30;
fontColor = "255 255 255"; fontColor = $TextHighEmphasisColor;
justify = "left"; justify = "left";
}; };
@ -48,7 +56,7 @@ new GuiControlProfile(MenuHeaderTextCenter)
{ {
fontType = "Arial Bold"; fontType = "Arial Bold";
fontSize = 30; fontSize = 30;
fontColor = "255 255 255"; fontColor = $TextHighEmphasisColor;
justify = "center"; justify = "center";
}; };
@ -56,7 +64,7 @@ new GuiControlProfile(MenuSubHeaderText)
{ {
fontType = "Arial Bold"; fontType = "Arial Bold";
fontSize = 20; fontSize = 20;
fontColor = "255 255 255"; fontColor = $TextMediumEmphasisColor;
justify = "left"; justify = "left";
}; };
@ -64,7 +72,7 @@ new GuiControlProfile(MenuMLSubHeaderText)
{ {
fontType = "Arial Bold"; fontType = "Arial Bold";
fontSize = 20; fontSize = 20;
fontColor = "255 255 255"; fontColor = $TextMediumEmphasisColor;
justify = "left"; justify = "left";
autoSizeWidth = true; autoSizeWidth = true;
autoSizeHeight = true; autoSizeHeight = true;
@ -74,23 +82,23 @@ if( !isObject( GuiMenuButtonProfile ) )
new GuiControlProfile( GuiMenuButtonProfile ) new GuiControlProfile( GuiMenuButtonProfile )
{ {
opaque = true; opaque = true;
border = false; border = true;
fontSize = 18; fontSize = 18;
fontType = "Arial Bold"; fontType = "Arial Bold";
fontColor = "200 200 200"; fontColor = $TextMediumEmphasisColor;
fontColorHL = "80 80 80"; fontColorHL = $TextMediumEmphasisColor;
fontColorNA = "0 0 0"; fontColorNA = $TextDisabledColor;
fontColorSEL = "0 0 0"; fontColorSEL = $TextMediumEmphasisColor;
fillColor = "255 255 255 120"; fillColor = "40 40 40";
fillColorHL = "100 100 100 50"; fillColorHL = "56 56 56";
fillColorNA = "0 0 0 50"; fillColorNA = "40 40 40";
borderColor = "0 0 0 0"; borderColor = "87 87 87";
borderColorNA = "0 0 0 0"; borderColorNA = "0 0 0";
borderColorHL = "0 0 0 0"; borderColorHL = "255 255 255";
fixedExtent = false; fixedExtent = false;
justify = "center"; justify = "center";
canKeyFocus = false; canKeyFocus = false;
bitmap = "data/ui/images/menu-button"; //bitmap = "data/ui/images/menu-button";
hasBitmapArray = false; hasBitmapArray = false;
soundButtonDown = menuButtonPressed; soundButtonDown = menuButtonPressed;
soundButtonOver = menuButtonHover; soundButtonOver = menuButtonHover;
@ -255,8 +263,13 @@ new GuiControlProfile( GuiBigTextProfile : GuiTextProfile )
if( !isObject( GuiMLTextProfile ) ) if( !isObject( GuiMLTextProfile ) )
new GuiControlProfile( GuiMLTextProfile ) new GuiControlProfile( GuiMLTextProfile )
{ {
fontColor = $TextMediumEmphasisColor;
fontColorHL = $TextMediumEmphasisColor;
fontColorSEL = $TextMediumEmphasisColor;
fontColorNA = $TextDisabledColor;
fontColorLink = "100 100 100"; fontColorLink = "100 100 100";
fontColorLinkHL = "255 255 255"; fontColorLinkHL = $TextMediumEmphasisColor;
autoSizeWidth = true; autoSizeWidth = true;
autoSizeHeight = true; autoSizeHeight = true;
border = false; border = false;
@ -267,7 +280,7 @@ if( !isObject( GuiMLWhiteTextProfile ) )
new GuiControlProfile( GuiMLWhiteTextProfile ) new GuiControlProfile( GuiMLWhiteTextProfile )
{ {
fontColor = "220 220 220"; fontColor = "220 220 220";
fontColorHL = "255 255 255"; fontColorHL = $TextMediumEmphasisColor;
autoSizeWidth = true; autoSizeWidth = true;
autoSizeHeight = true; autoSizeHeight = true;
border = false; border = false;
@ -277,17 +290,43 @@ new GuiControlProfile( GuiMLWhiteTextProfile )
if( !isObject( GuiTextArrayProfile ) ) if( !isObject( GuiTextArrayProfile ) )
new GuiControlProfile( GuiTextArrayProfile : GuiTextProfile ) new GuiControlProfile( GuiTextArrayProfile : GuiTextProfile )
{ {
fontColor = "250 250 250"; fontColor = $TextMediumEmphasisColor;
fontColorHL = " 0 0 0"; fontColorHL = $TextMediumEmphasisColor;
fontColorSEL = "0 0 0"; fontColorSEL = $TextMediumEmphasisColor;
fillColor ="50 50 50"; fontColorNA = $TextDisabledColor;
fillColorHL = "125 125 125";
fillColorSEL = "180 180 180"; fillColor = "22 22 22 255";
border = false; fillColorHL = "22 22 22 255";
fillColorSEL = "56 56 56 255";
border = true;
borderColor ="87 87 87";
borderColorHL = "87 87 87";
borderColorSEL = "255 255 255";
category = "Core"; category = "Core";
canKeyFocus = true; canKeyFocus = true;
}; };
if( !isObject( GuiMenuTextEditProfile ) )
new GuiControlProfile( GuiMenuTextEditProfile : GuiTextEditProfile )
{
fontColor = $TextMediumEmphasisColor;
fontColorHL = $TextMediumEmphasisColor;
fontColorSEL = $TextMediumEmphasisColor;
fontColorNA = $TextDisabledColor;
fillColor = "22 22 22 255";
fillColorHL = "22 22 22 255";
border = true;
borderColor ="87 87 87";
borderColorHL = "87 87 87";
borderColorSEL = "255 255 255";
category = "Core";
};
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// TODO: Revisit Popupmenu // TODO: Revisit Popupmenu
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -484,7 +523,7 @@ if(!isObject(GuiMenuScrollProfile))
new GuiControlProfile(GuiMenuScrollProfile) new GuiControlProfile(GuiMenuScrollProfile)
{ {
opaque = false; opaque = false;
fillcolor = "50 50 50"; fillcolor = "22 22 22";
fontColor = "200 200 200"; fontColor = "200 200 200";
fontColorHL = "250 250 250"; fontColorHL = "250 250 250";
border = false; border = false;

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