mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 14:44:36 +00:00
Updates the BaseGame UI theme to be more legible and visually consistent.
Also standardizes and fixes the menuInputButtons system.
This commit is contained in:
parent
ba1eb59e9f
commit
37420cda66
26 changed files with 1163 additions and 643 deletions
|
|
@ -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 );
|
||||
397
Templates/BaseGame/game/data/ui/scripts/menuInputButtons.cs
Normal file
397
Templates/BaseGame/game/data/ui/scripts/menuInputButtons.cs
Normal file
|
|
@ -0,0 +1,397 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// 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;
|
||||
|
||||
function UIMenuButtonList::onInputEvent(%this, %device, %action, %state)
|
||||
{
|
||||
if(%state)
|
||||
$activeMenuButtonContainer.processInputs(%device, %action);
|
||||
}
|
||||
|
||||
function UIMenuButtonList::onAxisEvent(%this, %device, %action, %axisVal)
|
||||
{
|
||||
$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.
|
||||
/// 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 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;
|
||||
}
|
||||
|
||||
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 && $activeControllerName $= "K&M")
|
||||
%set = false;
|
||||
|
||||
%this.setActive(%set);
|
||||
%this.setVisible(%set);
|
||||
|
||||
if(!%this.isActive())
|
||||
return;
|
||||
|
||||
if($activeControllerName !$= "K&M")
|
||||
{
|
||||
if(%this.gamepadButton !$= "")
|
||||
{
|
||||
%path = "";
|
||||
if($activeControllerName $= "PS4 Controller")
|
||||
{
|
||||
%path = "data/ui/images/inputs/PS4/PS4_";
|
||||
|
||||
if(%this.gamepadButton $= "A")
|
||||
%path = %path @ "Cross";
|
||||
else if(%this.gamepadButton $= "B")
|
||||
%path = %path @ "Circle";
|
||||
else if(%this.gamepadButton $= "X")
|
||||
%path = %path @ "Square";
|
||||
else if(%this.gamepadButton $= "Y")
|
||||
%path = %path @ "Triangle";
|
||||
else if(%this.gamepadButton $= "LB")
|
||||
%path = %path @ "L1";
|
||||
else if(%this.gamepadButton $= "LT")
|
||||
%path = %path @ "L2";
|
||||
else if(%this.gamepadButton $= "RB")
|
||||
%path = %path @ "R1";
|
||||
else if(%this.gamepadButton $= "RT")
|
||||
%path = %path @ "R2";
|
||||
//else
|
||||
// continue;
|
||||
}
|
||||
else if($activeControllerName $= "Nintendo Switch Pro Controller")
|
||||
{
|
||||
%path = "data/ui/images/inputs/Switch/Switch_";
|
||||
|
||||
if(%this.gamepadButton $= "A")
|
||||
%path = %path @ "B";
|
||||
else if(%this.gamepadButton $= "B")
|
||||
%path = %path @ "A";
|
||||
else if(%this.gamepadButton $= "X")
|
||||
%path = %path @ "Y";
|
||||
else if(%this.gamepadButton $= "Y")
|
||||
%path = %path @ "X";
|
||||
else if(%this.gamepadButton $= "LB")
|
||||
%path = %path @ "LB";
|
||||
else if(%this.gamepadButton $= "LT")
|
||||
%path = %path @ "LT";
|
||||
else if(%this.gamepadButton $= "RB")
|
||||
%path = %path @ "RB";
|
||||
else if(%this.gamepadButton $= "RT")
|
||||
%path = %path @ "RT";
|
||||
//else
|
||||
// continue;
|
||||
}
|
||||
else if($activeControllerName !$= "")
|
||||
{
|
||||
%path = "data/ui/images/inputs/Xbox/Xbox_";
|
||||
|
||||
%path = %path @ %this.gamepadButton;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(%this.keyboardButton !$= "")
|
||||
{
|
||||
%path = "data/ui/images/Inputs/Keyboard & Mouse/Keyboard_Black_" @ %this.keyboardButton;
|
||||
}
|
||||
}
|
||||
|
||||
%this.setBitmap(%path);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function MenuInputButtonContainer::refresh(%this)
|
||||
{
|
||||
%count = %this.getCount();
|
||||
for(%i=0; %i < %count; %i++)
|
||||
{
|
||||
%btn = %this.getObject(%i);
|
||||
|
||||
%btn.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
function MenuInputButtonContainer::setActive(%this)
|
||||
{
|
||||
if(isObject($activeMenuButtonContainer))
|
||||
$activeMenuButtonContainer.hidden = true;
|
||||
|
||||
$activeMenuButtonContainer = %this;
|
||||
$activeMenuButtonContainer.hidden = false;
|
||||
$activeMenuButtonContainer.refresh();
|
||||
}
|
||||
|
||||
function MenuInputButtonContainer::checkGamepad(%this)
|
||||
{
|
||||
%controllerName = SDLInputManager::JoystickNameForIndex(0);
|
||||
|
||||
$activeControllerName = %controllerName;
|
||||
|
||||
if($activeControllerName $= "")
|
||||
$activeControllerName = "K&M";
|
||||
}
|
||||
|
||||
function MenuInputButtonContainer::refreshButtons(%this)
|
||||
{
|
||||
//Set up our basic buttons
|
||||
for(%i=0; %i < %this.getCount(); %i++)
|
||||
{
|
||||
%btn = %this.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 && $activeControllerName $= "K&M")
|
||||
%set = false;
|
||||
|
||||
%btn.setActive(%set);
|
||||
%btn.setVisible(%set);
|
||||
|
||||
if(!%btn.isActive())
|
||||
continue;
|
||||
|
||||
if($activeControllerName !$= "K&M")
|
||||
{
|
||||
if(%btn.gamepadButton !$= "")
|
||||
{
|
||||
%path = "";
|
||||
if($activeControllerName $= "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($activeControllerName $= "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($activeControllerName !$= "")
|
||||
{
|
||||
%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 MenuInputButtonContainer::processInputs(%this, %device, %action)
|
||||
{
|
||||
//check to see if our status has changed
|
||||
%changed = false;
|
||||
|
||||
%oldDevice = $activeControllerName;
|
||||
|
||||
if(startsWith(%device, "Keyboard"))
|
||||
{
|
||||
if($activeControllerName !$= %device)
|
||||
%changed = true;
|
||||
|
||||
$activeControllerName = "K&M";
|
||||
Canvas.showCursor();
|
||||
}
|
||||
else if(startsWith(%device, "Mouse"))
|
||||
{
|
||||
if(startsWith(%action, "button"))
|
||||
{
|
||||
if($activeControllerName !$= %device)
|
||||
%changed = true;
|
||||
|
||||
$activeControllerName = "K&M";
|
||||
Canvas.showCursor();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(%this.checkGamepad())
|
||||
{
|
||||
Canvas.hideCursor();
|
||||
}
|
||||
|
||||
if($activeControllerName !$= %device)
|
||||
%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($activeControllerName !$= "K&M")
|
||||
{
|
||||
if(%action $= "btn_a")
|
||||
%action = "A";
|
||||
else if(%action $= "btn_b")
|
||||
%action = "B";
|
||||
else if(%action $= "btn_x")
|
||||
%action = "X";
|
||||
else if(%action $= "btn_y")
|
||||
%action = "Y";
|
||||
else 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 MenuInputButtonContainer::processAxisEvent(%this, %device, %action, %axisVal)
|
||||
{
|
||||
%changed = false;
|
||||
|
||||
%oldDevice = $activeControllerName;
|
||||
|
||||
if(startsWith(%device, "Mouse"))
|
||||
{
|
||||
if(startsWith(%action, "button"))
|
||||
{
|
||||
if($activeControllerName !$= %device)
|
||||
%changed = true;
|
||||
|
||||
$activeControllerName = "K&M";
|
||||
Canvas.showCursor();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(%this.checkGamepad())
|
||||
{
|
||||
Canvas.hideCursor();
|
||||
}
|
||||
|
||||
if($activeControllerName !$= %device)
|
||||
%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;
|
||||
}*/
|
||||
}
|
||||
|
|
@ -44,9 +44,6 @@ new SFXProfile(messageBoxBeep)
|
|||
//---------------------------------------------------------------------------------------------
|
||||
function messageCallback(%dlg, %callback)
|
||||
{
|
||||
MessageBoxDlg.originalMenubuttonContainer.add(GamepadButtonsGui);
|
||||
MessageBoxDlg.originalMenubuttonContainer.refresh();
|
||||
|
||||
Canvas.popDialog(%dlg);
|
||||
eval(%callback);
|
||||
}
|
||||
|
|
@ -85,6 +82,10 @@ function MBSetText(%text, %frame, %msg)
|
|||
//sfxPlayOnce( messageBoxBeep );
|
||||
}
|
||||
|
||||
function MessageBoxCtrl::onWake(%this)
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Various message box display functions. Each one takes a window title, a message, and a
|
||||
// callback for each button.
|
||||
|
|
@ -96,12 +97,15 @@ function MessageBoxOK(%title, %message, %callback)
|
|||
Canvas.pushDialog(MessageBoxDlg);
|
||||
MessageBoxTitleText.text = %title;
|
||||
|
||||
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent();
|
||||
MessageBoxButtonHolder-->OKButton.set("A", "Enter", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
|
||||
|
||||
MessageBoxButtonHolder.add(GamepadButtonsGui);
|
||||
GamepadButtonsGui.clearButtons();
|
||||
GamepadButtonsGui.setButton(7, "A", "", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
|
||||
GamepadButtonsGui.refreshButtons();
|
||||
MessageBoxButtonHolder.setActive();
|
||||
|
||||
MessageBoxButtonHolder-->oc_OKButton.hidden = true;
|
||||
MessageBoxButtonHolder-->oc_CancelButton.hidden = true;
|
||||
MessageBoxButtonHolder-->ync_yesButton.hidden = true;
|
||||
MessageBoxButtonHolder-->ync_noButton.hidden = true;
|
||||
MessageBoxButtonHolder-->ync_CancelButton.hidden = true;
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
MessageBoxDlg.callback = %callback;
|
||||
|
|
@ -117,13 +121,15 @@ function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
|
|||
Canvas.pushDialog(MessageBoxDlg);
|
||||
MessageBoxTitleText.text = %title;
|
||||
|
||||
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent();
|
||||
MessageBoxButtonHolder-->oc_OKButton.set("A", "Enter", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
|
||||
MessageBoxButtonHolder-->oc_CancelButton.set("B", "Esc", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
|
||||
|
||||
MessageBoxButtonHolder.setActive();
|
||||
|
||||
MessageBoxButtonHolder.add(GamepadButtonsGui);
|
||||
GamepadButtonsGui.clearButtons();
|
||||
GamepadButtonsGui.setButton(5, "A", "", "OK", "MessageCallback(MessageBoxDlg,MessageBoxDlg.callback);");
|
||||
GamepadButtonsGui.setButton(6, "B", "", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
|
||||
GamepadButtonsGui.refreshButtons();
|
||||
MessageBoxButtonHolder-->OKButton.hidden = true;
|
||||
MessageBoxButtonHolder-->ync_yesButton.hidden = true;
|
||||
MessageBoxButtonHolder-->ync_noButton.hidden = true;
|
||||
MessageBoxButtonHolder-->ync_CancelButton.hidden = true;
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
MessageBoxDlg.callback = %callback;
|
||||
|
|
@ -211,13 +217,15 @@ function MessageBoxYesNo(%title, %message, %yesCallback, %noCallback)
|
|||
Canvas.pushDialog(MessageBoxDlg);
|
||||
MessageBoxTitleText.text = %title;
|
||||
|
||||
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent();
|
||||
MessageBoxButtonHolder-->oc_OKButton.set("A", "Enter", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);");
|
||||
MessageBoxButtonHolder-->oc_CancelButton.set("B", "Esc", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
|
||||
|
||||
MessageBoxButtonHolder.add(GamepadButtonsGui);
|
||||
GamepadButtonsGui.clearButtons();
|
||||
GamepadButtonsGui.setButton(5, "A", "", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);");
|
||||
GamepadButtonsGui.setButton(6, "B", "", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
|
||||
GamepadButtonsGui.refreshButtons();
|
||||
MessageBoxButtonHolder.setActive();
|
||||
|
||||
MessageBoxButtonHolder-->OKButton.hidden = true;
|
||||
MessageBoxButtonHolder-->ync_yesButton.hidden = true;
|
||||
MessageBoxButtonHolder-->ync_noButton.hidden = true;
|
||||
MessageBoxButtonHolder-->ync_CancelButton.hidden = true;
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
MessageBoxDlg.yesCallBack = %yesCallback;
|
||||
|
|
@ -229,14 +237,15 @@ function MessageBoxYesNoCancel(%title, %message, %yesCallback, %noCallback, %can
|
|||
Canvas.pushDialog(MessageBoxDlg);
|
||||
MessageBoxTitleText.text = %title;
|
||||
|
||||
MessageBoxDlg.originalMenubuttonContainer = GamepadButtonsGui.getParent();
|
||||
MessageBoxButtonHolder-->ync_yesButton.set("A", "Enter", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);");
|
||||
MessageBoxButtonHolder-->ync_noButton.set("X", "Backspace", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
|
||||
MessageBoxButtonHolder-->ync_cancelButton.set("B", "Esc", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
|
||||
|
||||
MessageBoxButtonHolder.add(GamepadButtonsGui);
|
||||
GamepadButtonsGui.clearButtons();
|
||||
GamepadButtonsGui.setButton(5, "A", "", "Yes", "MessageCallback(MessageBoxDlg,MessageBoxDlg.yesCallBack);");
|
||||
GamepadButtonsGui.setButton(6, "B", "", "No", "MessageCallback(MessageBoxDlg,MessageBoxDlg.noCallback);");
|
||||
GamepadButtonsGui.setButton(7, "Back", "", "Cancel", "MessageCallback(MessageBoxDlg,MessageBoxDlg.cancelCallback);");
|
||||
GamepadButtonsGui.refreshButtons();
|
||||
MessageBoxButtonHolder.setActive();
|
||||
|
||||
MessageBoxButtonHolder-->OKButton.hidden = true;
|
||||
MessageBoxButtonHolder-->oc_OKButton.hidden = true;
|
||||
MessageBoxButtonHolder-->oc_CancelButton.hidden = true;
|
||||
|
||||
MBSetText(MessageBoxText, MessageBoxCtrl, %message);
|
||||
MessageBoxDlg.yesCallBack = %yesCallback;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
$TextMediumEmphasisColor = "200 200 200";
|
||||
$TextHighEmphasisColor = "224 224 224";
|
||||
$TextDisabledColor = "108 108 108";
|
||||
|
||||
new GuiGameListMenuProfile(DefaultListMenuProfile)
|
||||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 20;
|
||||
fontColor = "120 120 120";
|
||||
fontColorSEL = "16 16 16";
|
||||
fontColorNA = "200 200 200";
|
||||
fontColorHL = "100 100 120";
|
||||
fontColor = $TextMediumEmphasisColor;
|
||||
fontColorSEL = $TextMediumEmphasisColor;
|
||||
fontColorNA = $TextDisabledColor;
|
||||
fontColorHL = $TextMediumEmphasisColor;
|
||||
HitAreaUpperLeft = "16 20";
|
||||
HitAreaLowerRight = "503 74";
|
||||
IconOffset = "40 0";
|
||||
|
|
@ -40,7 +43,7 @@ new GuiControlProfile(MenuHeaderText)
|
|||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 30;
|
||||
fontColor = "255 255 255";
|
||||
fontColor = $TextHighEmphasisColor;
|
||||
justify = "left";
|
||||
};
|
||||
|
||||
|
|
@ -48,7 +51,7 @@ new GuiControlProfile(MenuHeaderTextCenter)
|
|||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 30;
|
||||
fontColor = "255 255 255";
|
||||
fontColor = $TextHighEmphasisColor;
|
||||
justify = "center";
|
||||
};
|
||||
|
||||
|
|
@ -56,7 +59,7 @@ new GuiControlProfile(MenuSubHeaderText)
|
|||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 20;
|
||||
fontColor = "255 255 255";
|
||||
fontColor = $TextMediumEmphasisColor;
|
||||
justify = "left";
|
||||
};
|
||||
|
||||
|
|
@ -64,7 +67,7 @@ new GuiControlProfile(MenuMLSubHeaderText)
|
|||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 20;
|
||||
fontColor = "255 255 255";
|
||||
fontColor = $TextMediumEmphasisColor;
|
||||
justify = "left";
|
||||
autoSizeWidth = true;
|
||||
autoSizeHeight = true;
|
||||
|
|
@ -74,23 +77,23 @@ if( !isObject( GuiMenuButtonProfile ) )
|
|||
new GuiControlProfile( GuiMenuButtonProfile )
|
||||
{
|
||||
opaque = true;
|
||||
border = false;
|
||||
border = true;
|
||||
fontSize = 18;
|
||||
fontType = "Arial Bold";
|
||||
fontColor = "200 200 200";
|
||||
fontColorHL = "80 80 80";
|
||||
fontColorNA = "0 0 0";
|
||||
fontColorSEL = "0 0 0";
|
||||
fillColor = "255 255 255 120";
|
||||
fillColorHL = "100 100 100 50";
|
||||
fillColorNA = "0 0 0 50";
|
||||
borderColor = "0 0 0 0";
|
||||
borderColorNA = "0 0 0 0";
|
||||
borderColorHL = "0 0 0 0";
|
||||
fontColor = $TextMediumEmphasisColor;
|
||||
fontColorHL = $TextMediumEmphasisColor;
|
||||
fontColorNA = $TextDisabledColor;
|
||||
fontColorSEL = $TextMediumEmphasisColor;
|
||||
fillColor = "40 40 40";
|
||||
fillColorHL = "56 56 56";
|
||||
fillColorNA = "40 40 40";
|
||||
borderColor = "87 87 87";
|
||||
borderColorNA = "0 0 0";
|
||||
borderColorHL = "255 255 255";
|
||||
fixedExtent = false;
|
||||
justify = "center";
|
||||
canKeyFocus = false;
|
||||
bitmap = "data/ui/images/menu-button";
|
||||
//bitmap = "data/ui/images/menu-button";
|
||||
hasBitmapArray = false;
|
||||
soundButtonDown = menuButtonPressed;
|
||||
soundButtonOver = menuButtonHover;
|
||||
|
|
@ -255,8 +258,13 @@ new GuiControlProfile( GuiBigTextProfile : GuiTextProfile )
|
|||
if( !isObject( GuiMLTextProfile ) )
|
||||
new GuiControlProfile( GuiMLTextProfile )
|
||||
{
|
||||
fontColor = $TextMediumEmphasisColor;
|
||||
fontColorHL = $TextMediumEmphasisColor;
|
||||
fontColorSEL = $TextMediumEmphasisColor;
|
||||
fontColorNA = $TextDisabledColor;
|
||||
|
||||
fontColorLink = "100 100 100";
|
||||
fontColorLinkHL = "255 255 255";
|
||||
fontColorLinkHL = $TextMediumEmphasisColor;
|
||||
autoSizeWidth = true;
|
||||
autoSizeHeight = true;
|
||||
border = false;
|
||||
|
|
@ -267,7 +275,7 @@ if( !isObject( GuiMLWhiteTextProfile ) )
|
|||
new GuiControlProfile( GuiMLWhiteTextProfile )
|
||||
{
|
||||
fontColor = "220 220 220";
|
||||
fontColorHL = "255 255 255";
|
||||
fontColorHL = $TextMediumEmphasisColor;
|
||||
autoSizeWidth = true;
|
||||
autoSizeHeight = true;
|
||||
border = false;
|
||||
|
|
@ -277,17 +285,43 @@ new GuiControlProfile( GuiMLWhiteTextProfile )
|
|||
if( !isObject( GuiTextArrayProfile ) )
|
||||
new GuiControlProfile( GuiTextArrayProfile : GuiTextProfile )
|
||||
{
|
||||
fontColor = "250 250 250";
|
||||
fontColorHL = " 0 0 0";
|
||||
fontColorSEL = "0 0 0";
|
||||
fillColor ="50 50 50";
|
||||
fillColorHL = "125 125 125";
|
||||
fillColorSEL = "180 180 180";
|
||||
border = false;
|
||||
fontColor = $TextMediumEmphasisColor;
|
||||
fontColorHL = $TextMediumEmphasisColor;
|
||||
fontColorSEL = $TextMediumEmphasisColor;
|
||||
fontColorNA = $TextDisabledColor;
|
||||
|
||||
fillColor = "22 22 22 255";
|
||||
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";
|
||||
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
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
@ -484,7 +518,7 @@ if(!isObject(GuiMenuScrollProfile))
|
|||
new GuiControlProfile(GuiMenuScrollProfile)
|
||||
{
|
||||
opaque = false;
|
||||
fillcolor = "50 50 50";
|
||||
fillcolor = "22 22 22";
|
||||
fontColor = "200 200 200";
|
||||
fontColorHL = "250 250 250";
|
||||
border = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue