2022-02-23 05:28:28 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
// 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
|
|
|
|
|
*/
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
2022-02-23 05:28:28 +00:00
|
|
|
/// 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
|
2022-05-09 21:17:22 +00:00
|
|
|
///
|
|
|
|
|
/// \param %device (string) The name of the device the input event is coming fromt
|
|
|
|
|
/// \param %action (string) The specific key/input action
|
|
|
|
|
/// \param %state (bool) The down/up state of the event sent
|
2022-02-23 05:28:28 +00:00
|
|
|
function UIMenuButtonList::onInputEvent(%this, %device, %action, %state)
|
|
|
|
|
{
|
|
|
|
|
if(%state)
|
|
|
|
|
$activeMenuButtonContainer.processInputs(%device, %action);
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
2022-02-23 05:28:28 +00:00
|
|
|
/// 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
|
2022-05-09 21:17:22 +00:00
|
|
|
///
|
|
|
|
|
/// \param %device (string) The name of the device the input event is coming fromt
|
|
|
|
|
/// \param %action (string) The specific key/input action
|
|
|
|
|
/// \param %axisVal (float) The float value of the axis event
|
2022-02-23 05:28:28 +00:00
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
2022-02-23 05:28:28 +00:00
|
|
|
/// 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.
|
2022-05-07 04:39:16 +00:00
|
|
|
function MenuInputButton::set(%this, %gamepadButton, %keyboardButton, %text, %command)
|
2022-02-23 05:28:28 +00:00
|
|
|
{
|
2022-05-07 04:39:16 +00:00
|
|
|
%this.setHidden(false);
|
|
|
|
|
|
2022-02-23 05:28:28 +00:00
|
|
|
%set = (! ((%text $= "") && (%command $= "")));
|
|
|
|
|
|
|
|
|
|
%this.gamepadButton = %gamepadButton;
|
|
|
|
|
%this.keyboardButton = %keyboardButton;
|
|
|
|
|
|
2022-05-07 04:39:16 +00:00
|
|
|
if(%gamepadButton $= "")
|
|
|
|
|
%this.gamepadValid = false;
|
|
|
|
|
else
|
|
|
|
|
%this.gamepadValid = true;
|
2022-02-23 05:28:28 +00:00
|
|
|
|
2022-05-07 04:39:16 +00:00
|
|
|
if(%keyboardButton $= "")
|
|
|
|
|
%this.kbmValid = false;
|
|
|
|
|
else
|
|
|
|
|
%this.kbmValid = true;
|
2022-02-23 05:28:28 +00:00
|
|
|
|
2022-05-07 04:39:16 +00:00
|
|
|
if((!%this.kbmValid && $activeControllerType !$= "gamepad") ||
|
|
|
|
|
(!%this.gamepadValid && $activeControllerType $= "gamepad"))
|
|
|
|
|
%set = false;
|
|
|
|
|
|
|
|
|
|
%this.setText(%text);
|
2022-02-23 05:28:28 +00:00
|
|
|
%this.Command = %command;
|
2022-05-07 04:39:16 +00:00
|
|
|
|
|
|
|
|
%this.refresh();
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// Disables the MenuInputButton, marking it as not to consume inputs or display
|
2022-05-07 04:39:16 +00:00
|
|
|
function MenuInputButton::disable(%this)
|
|
|
|
|
{
|
|
|
|
|
%this.setText("");
|
|
|
|
|
%this.Command = "";
|
|
|
|
|
%this.setActive(false);
|
|
|
|
|
%this.setVisible(false);
|
2022-02-23 05:28:28 +00:00
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
2022-02-23 05:28:28 +00:00
|
|
|
/// Refreshes the specific button, updating it's visbility status and the displayed input image
|
|
|
|
|
function MenuInputButton::refresh(%this)
|
|
|
|
|
{
|
|
|
|
|
%set = (! ((%this.text $= "") && (%this.command $= "")));
|
|
|
|
|
|
2022-05-07 04:39:16 +00:00
|
|
|
//Do a check so if a MenuInput is selectively bound and we're not using the
|
|
|
|
|
//matched input type, then we skip
|
|
|
|
|
if((!%this.kbmValid && $activeControllerType !$= "gamepad") ||
|
|
|
|
|
(!%this.gamepadValid && $activeControllerType $= "gamepad"))
|
2022-02-23 05:28:28 +00:00
|
|
|
%set = false;
|
|
|
|
|
|
|
|
|
|
%this.setActive(%set);
|
|
|
|
|
%this.setVisible(%set);
|
|
|
|
|
|
|
|
|
|
if(!%this.isActive())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if($activeControllerType $= "gamepad")
|
|
|
|
|
{
|
|
|
|
|
if(%this.gamepadButton !$= "")
|
|
|
|
|
{
|
|
|
|
|
%assetId = "";
|
|
|
|
|
if($activeControllerName $= "PS4 Controller")
|
|
|
|
|
{
|
|
|
|
|
%assetId = "UI:PS4_";
|
|
|
|
|
|
|
|
|
|
if(%this.gamepadButton $= "btn_a")
|
|
|
|
|
%assetId = %assetId @ "Cross";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_b")
|
|
|
|
|
%assetId = %assetId @ "Circle";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_x")
|
|
|
|
|
%assetId = %assetId @ "Square";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_y")
|
|
|
|
|
%assetId = %assetId @ "Triangle";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_l")
|
|
|
|
|
%assetId = %assetId @ "L1";
|
|
|
|
|
else if(%this.gamepadButton $= "zaxis")
|
|
|
|
|
%assetId = %assetId @ "L2";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_r")
|
|
|
|
|
%assetId = %assetId @ "R1";
|
|
|
|
|
else if(%this.gamepadButton $= "rzaxis")
|
|
|
|
|
%assetId = %assetId @ "R2";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_start")
|
|
|
|
|
%assetId = %assetId @ "Options";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_back")
|
|
|
|
|
%assetId = %assetId @ "Share";
|
|
|
|
|
}
|
|
|
|
|
else if($activeControllerName $= "Nintendo Switch Pro Controller")
|
|
|
|
|
{
|
|
|
|
|
%assetId = "UI:Switch_";
|
|
|
|
|
|
|
|
|
|
if(%this.gamepadButton $= "btn_a")
|
|
|
|
|
%assetId = %assetId @ "B";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_b")
|
|
|
|
|
%assetId = %assetId @ "A";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_x")
|
|
|
|
|
%assetId = %assetId @ "Y";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_y")
|
|
|
|
|
%assetId = %assetId @ "X";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_l")
|
|
|
|
|
%assetId = %assetId @ "LB";
|
|
|
|
|
else if(%this.gamepadButton $= "zaxis")
|
|
|
|
|
%assetId = %assetId @ "LT";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_r")
|
|
|
|
|
%assetId = %assetId @ "RB";
|
|
|
|
|
else if(%this.gamepadButton $= "rzaxis")
|
|
|
|
|
%assetId = %assetId @ "RT";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_start")
|
|
|
|
|
%assetId = %assetId @ "Plus";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_back")
|
|
|
|
|
%assetId = %assetId @ "Minus";
|
|
|
|
|
}
|
|
|
|
|
else if($activeControllerName !$= "")
|
|
|
|
|
{
|
|
|
|
|
%assetId = "UI:Xbox_";
|
|
|
|
|
|
|
|
|
|
if(%this.gamepadButton $= "btn_a")
|
|
|
|
|
%assetId = %assetId @ "A";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_b")
|
|
|
|
|
%assetId = %assetId @ "B";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_x")
|
|
|
|
|
%assetId = %assetId @ "X";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_y")
|
|
|
|
|
%assetId = %assetId @ "Y";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_l")
|
|
|
|
|
%assetId = %assetId @ "LB";
|
|
|
|
|
else if(%this.gamepadButton $= "zaxis")
|
|
|
|
|
%assetId = %assetId @ "LT";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_r")
|
|
|
|
|
%assetId = %assetId @ "RB";
|
|
|
|
|
else if(%this.gamepadButton $= "rzaxis")
|
|
|
|
|
%assetId = %assetId @ "RT";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_start")
|
|
|
|
|
%assetId = %assetId @ "Menu";
|
|
|
|
|
else if(%this.gamepadButton $= "btn_back")
|
|
|
|
|
%assetId = %assetId @ "Windows";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(%this.keyboardButton !$= "")
|
|
|
|
|
{
|
|
|
|
|
%assetId = "UI:Keyboard_Black_" @ %this.keyboardButton;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%this.setBitmap(%assetId @ "_image");
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
2022-02-23 05:28:28 +00:00
|
|
|
/// 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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
2022-02-23 05:28:28 +00:00
|
|
|
/// 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();
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
2022-02-23 05:28:28 +00:00
|
|
|
/// 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";
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
2022-02-23 05:28:28 +00:00
|
|
|
/// 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.
|
2022-05-09 21:17:22 +00:00
|
|
|
///
|
|
|
|
|
/// \param %device (string) The device that is causing the input event
|
|
|
|
|
/// \param %action (string) The name of the input action
|
2022-02-23 05:28:28 +00:00
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
2022-02-23 05:28:28 +00:00
|
|
|
/// 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
|
2022-05-09 21:17:22 +00:00
|
|
|
///
|
|
|
|
|
/// \param %device (string) The name of the device the input event is coming fromt
|
|
|
|
|
/// \param %action (string) The specific key/input action
|
|
|
|
|
/// \param %axisVal (float) The float value of the axis event
|
2022-02-23 05:28:28 +00:00
|
|
|
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;
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
|
// Menu Input processing
|
|
|
|
|
// These functions manage the Menu input processing in general
|
|
|
|
|
// Whenever a MenuInputHandler consumes an input event, it'll process them here
|
|
|
|
|
// This'll let the active menu list be navigated, as well as buttons be processed
|
|
|
|
|
// and ultimately handled by the Input Buttons above
|
|
|
|
|
//==============================================================================
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// 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
|
|
|
|
|
///
|
|
|
|
|
/// \param %device (string) The name of the device the input event is coming fromt
|
|
|
|
|
/// \param %action (string) The specific key/input action
|
|
|
|
|
/// \param %axisVal (float) The float value of the axis event
|
2022-02-23 05:28:28 +00:00
|
|
|
function MenuInputHandler::onAxisEvent(%this, %device, %action, %value)
|
|
|
|
|
{
|
|
|
|
|
//this is to force a refresh of the menu
|
|
|
|
|
if(%value == 1 || %value == -1)
|
|
|
|
|
$activeMenuButtonContainer.processInputs(%device, %action);
|
|
|
|
|
|
|
|
|
|
if(startsWith(%device, "mouse"))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if((%action $= "upov" && %value > 0) || (%action $= "yaxis" && %value == -1))
|
|
|
|
|
{
|
|
|
|
|
$activeMenuList.navigateUp();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if((%action $= "dpov" && %value > 0) || (%action $= "yaxis" && %value == 1))
|
|
|
|
|
{
|
|
|
|
|
$activeMenuList.navigateDown();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//How we deal with the left and right navigation is dependant on the mode of the
|
|
|
|
|
//menu list
|
|
|
|
|
if($activeMenuListMode $= "Settings")
|
|
|
|
|
{
|
|
|
|
|
if((%action $= "lpov" && %value > 0) || (%action $= "xaxis" && %value == -1))
|
|
|
|
|
{
|
|
|
|
|
echo("Options menu nudged left!");
|
|
|
|
|
//$activeMenuList.navigateLeft();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if((%action $= "rpov" && %value > 0) || (%action $= "xaxis" && %value == -1))
|
|
|
|
|
{
|
|
|
|
|
echo("Options menu nudged right!");
|
|
|
|
|
//$activeMenuList.navigateRight();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if((%action $= "lpov" && %value > 0) || (%action $= "xaxis" && %value == -1))
|
|
|
|
|
{
|
|
|
|
|
$activeMenuList.navigateLeft();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if((%action $= "rpov" && %value > 0) || (%action $= "xaxis" && %value == -1))
|
|
|
|
|
{
|
|
|
|
|
$activeMenuList.navigateRight();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// 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
|
|
|
|
|
///
|
|
|
|
|
/// \param %device (string) The name of the device the input event is coming fromt
|
|
|
|
|
/// \param %action (string) The specific key/input action
|
|
|
|
|
/// \param %state (bool) The down/up state of the event sent
|
2022-02-23 05:28:28 +00:00
|
|
|
function MenuInputHandler::onInputEvent(%this, %device, %action, %state)
|
|
|
|
|
{
|
|
|
|
|
if(%action $= "upov" || %action $= "dpov" || %action $= "lpov" || %action $= "rpov")
|
|
|
|
|
{
|
|
|
|
|
%this.onAxisEvent(%device, %action, %state);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(%state)
|
|
|
|
|
$activeMenuButtonContainer.processInputs(%device, %action);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
|
// Menu List processing
|
|
|
|
|
// These functions manage the navigation and activation of the Menu Lists
|
|
|
|
|
//==============================================================================
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// Is the GUIContainer with this MenuList namespace the 'active' menulist as far
|
|
|
|
|
/// as UI interfaces is concerned?
|
Adjusted handling for the bitmap and bitmapAsset fields for guiBitmapButtonCtrl to forcefully update the button states when changed, ensuring that the bitmaps refresh when changed via the field
Added callback for onResize to guiWindowCtrl so controls - such as the EditorTree - can be properly resized in certain circumstances when the window is changed
Added getIncrement() and getRange() to GuiGameSettingsCtrl to better facilitate options manipulation on the script side
Corrected some of the console method documentation strings in GuiGameSettingsCtrl
Removed some unneeded, extraneous files and their asset definitions that came from odd import conversions. Where applicable, created cleaned up versions to make naming conventions and references stable
Fixed canvas mode update text typo: FSAA -> FXAA
Added logic to DOF, Light Rays, SSAO and Vignette postFX's to check both the preset setting AND the user preference before enabling.
Shifted initialization order so PostFX's are loaded before we configure the canvas, to ensure stuff like the FXAAPostFX exists and can be toggled on on load
Fixed multiple issues with options menu:
When using gamepad, unable to navigate from categories to options. Fixed so can now traverse as normal
Input limitations on gamepad necessitated changing of how setting applying happens, is now done as a 'apply or discard' prompt when leaving the options menu
Added proper handling for adjusting settings with gamepad with left/right inputs
Fixed issue where the unapplied change for an option was sometimes being processed as an object name rather than an implicit string. Now made to be explicit strings to avoid issue.
Made the menu button input for "Select" to go from categories to options gamepad only, and hidden when in the options list
Fixed issue where changing window mode didn't correctly affect resolution option. Now set up so changing this field correctly refreshes the resolution option. Specifically, when on borderless, the resolution field does not show, preventing confusion as it is always full resolution
Generally have the options list refresh when changes happen to allow any and all fields to be able to dynamically respond to other options having changed improving flexibility.
Cleaned up old, unused, commented out functions
Added ability on OKCancel message boxes to override the button text if needed
Fixed issue with AssetBrowser where the shrink/grow icons next to the preview size slider were not anchored correctly.
Adjusted callback logic so if preview slider is clicked on, rather than dragged, it will correctly update the zoom values
Added sorting to Modules List dropdown for the AssetBrowser
Improved standardization of double-clicking in AssetBrowser. Now defaults to editing action if regularly browsing and selecting if in select mode. Still allows regular per-type overrides as normal
Moved definition of GuiDisabledTextEditProfile to gui profiles.ed.tscript file, removed duplicates to stop error spam
Adjusted default settings value for double-click action in AB to be edit to prevent unstable behavior
Removed old file refs from Load Recent list in the default settings
2022-03-27 03:36:37 +00:00
|
|
|
function MenuList::isActiveMenuList(%this)
|
|
|
|
|
{
|
|
|
|
|
if($activeMenuList == %this)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2022-02-23 05:28:28 +00:00
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// Sets the GUIContainer with this MenuList namespace as the active menulist.
|
|
|
|
|
/// This means that any input events caught in MenuInputHandlers is directed at
|
|
|
|
|
/// this menu list to navigate it
|
|
|
|
|
///
|
|
|
|
|
/// \param %startPosition (Point2F) The X and Y starting positions of the selection for this menuList
|
|
|
|
|
/// \param %menuMode (string) Indicates the mode/type of menuList, allowing for special behaviors depending on type
|
2022-02-23 05:28:28 +00:00
|
|
|
function MenuList::setAsActiveMenuList(%this, %startPosition, %menuMode)
|
|
|
|
|
{
|
|
|
|
|
if(%startPosition $= "")
|
|
|
|
|
%startPosition = "0 0";
|
|
|
|
|
|
|
|
|
|
if(%menuMode $= "")
|
|
|
|
|
%menuMode = "Menu";
|
|
|
|
|
|
|
|
|
|
$activeMenuList = %this;
|
|
|
|
|
$activeMenuList.hidden = false;
|
2022-05-07 04:39:16 +00:00
|
|
|
$activeMenuList.ListPosition = %startPosition;
|
2022-02-23 05:28:28 +00:00
|
|
|
$activeMenuListMode = %menuMode;
|
|
|
|
|
|
|
|
|
|
%this.refresh();
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// Activates the currently highlighted child object
|
2022-02-23 05:28:28 +00:00
|
|
|
function MenuList::activate(%this)
|
|
|
|
|
{
|
|
|
|
|
//check for a highlighted element
|
2022-05-07 04:39:16 +00:00
|
|
|
if($activeMenuList.ListPosition.y > -1 && $activeMenuList.ListPosition < $activeMenuList.getCount())
|
2022-02-23 05:28:28 +00:00
|
|
|
{
|
2022-05-07 04:39:16 +00:00
|
|
|
%btn = $activeMenuList.getObject($activeMenuList.ListPosition.y);
|
2022-02-23 05:28:28 +00:00
|
|
|
%btn.performClick();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// refreshes the menuList, updating children highlight status and if there is
|
|
|
|
|
/// a button pointer control defined on our list, we update it's position as
|
|
|
|
|
/// needed
|
2022-02-23 05:28:28 +00:00
|
|
|
function MenuList::refresh(%this)
|
|
|
|
|
{
|
2022-05-07 04:39:16 +00:00
|
|
|
%selectedObject = -1;
|
2022-02-23 05:28:28 +00:00
|
|
|
for(%i=0; %i < $activeMenuList.getCount(); %i++)
|
|
|
|
|
{
|
|
|
|
|
%btn = $activeMenuList.getObject(%i);
|
|
|
|
|
|
2022-05-07 04:39:16 +00:00
|
|
|
%isSelected = %i == $activeMenuList.ListPosition.y;
|
2022-02-23 05:28:28 +00:00
|
|
|
|
|
|
|
|
%btn.setHighlighted(%isSelected);
|
|
|
|
|
|
|
|
|
|
if(%isSelected)
|
|
|
|
|
%selectedObject = %i;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-07 04:39:16 +00:00
|
|
|
if(isObject(%this.buttonPointerCtrl))
|
|
|
|
|
{
|
|
|
|
|
if(%selectedObject != -1)
|
|
|
|
|
{
|
|
|
|
|
%this.buttonPointerCtrl.setHidden(false);
|
|
|
|
|
|
|
|
|
|
%buttonCenter = $activeMenuList.getObject(%selectedObject).getGlobalCenter();
|
|
|
|
|
|
|
|
|
|
if(%this.centerButtonPointerCtrl)
|
|
|
|
|
{
|
|
|
|
|
%this.buttonPointerCtrl.setCenter(%buttonCenter.x, %buttonCenter.y);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//if we're not centering, then left-justify
|
|
|
|
|
%this.buttonPointerCtrl.setCenter(%buttonCenter.x - $activeMenuList.getObject(%selectedObject).extent.x / 2, %buttonCenter.y);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
%this.buttonPointerCtrl.setHidden(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-23 05:28:28 +00:00
|
|
|
if($activeMenuList.isMethod("onNavigate"))
|
2022-05-07 04:39:16 +00:00
|
|
|
$activeMenuList.onNavigate($activeMenuList.ListPosition.y);
|
2022-02-23 05:28:28 +00:00
|
|
|
|
|
|
|
|
%parent = $activeMenuList.getParent();
|
|
|
|
|
if(%parent.getClassName() $= "GuiScrollCtrl")
|
|
|
|
|
{
|
|
|
|
|
%parent.scrollToObject(%selectedObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// Selects the next 'up' child item in the menuList. If the current is the topmost
|
|
|
|
|
/// then nothing happens
|
2022-02-23 05:28:28 +00:00
|
|
|
function MenuList::navigateUp(%this)
|
|
|
|
|
{
|
2022-05-07 04:39:16 +00:00
|
|
|
$activeMenuList.ListPosition.y -= 1;
|
|
|
|
|
if($activeMenuList.ListPosition.y < 0)
|
|
|
|
|
$activeMenuList.ListPosition.y = 0;
|
2022-02-23 05:28:28 +00:00
|
|
|
|
|
|
|
|
%this.refresh();
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// Selects the next 'down' child item in the menuList. If the current is the bottommost
|
|
|
|
|
/// then nothing happens
|
2022-02-23 05:28:28 +00:00
|
|
|
function MenuList::navigateDown(%this)
|
|
|
|
|
{
|
2022-05-07 04:39:16 +00:00
|
|
|
$activeMenuList.ListPosition.y += 1;
|
|
|
|
|
if($activeMenuList.ListPosition.y >= $activeMenuList.getCount())
|
|
|
|
|
$activeMenuList.ListPosition.y = $activeMenuList.getCount()-1;
|
2022-02-23 05:28:28 +00:00
|
|
|
|
|
|
|
|
%this.refresh();
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// Selects the next 'left' child item in the menuList. If the current item is the leftmost
|
|
|
|
|
/// then nothing happens
|
2022-02-23 05:28:28 +00:00
|
|
|
function MenuList::navigateLeft()
|
|
|
|
|
{
|
|
|
|
|
//Atm, we're only handling specific control types, namely options entries, but
|
|
|
|
|
//this could readily be expanded upon to handle grids like for inventory screens
|
|
|
|
|
//or the like
|
|
|
|
|
|
2022-05-07 04:39:16 +00:00
|
|
|
%btn = $activeMenuList.getObject($activeMenuList.ListPosition.y);
|
2022-02-23 05:28:28 +00:00
|
|
|
if(%btn.getClassName() $= "GuiGameSettingsCtrl" && %btn.isEnabled())
|
|
|
|
|
{
|
Adjusted handling for the bitmap and bitmapAsset fields for guiBitmapButtonCtrl to forcefully update the button states when changed, ensuring that the bitmaps refresh when changed via the field
Added callback for onResize to guiWindowCtrl so controls - such as the EditorTree - can be properly resized in certain circumstances when the window is changed
Added getIncrement() and getRange() to GuiGameSettingsCtrl to better facilitate options manipulation on the script side
Corrected some of the console method documentation strings in GuiGameSettingsCtrl
Removed some unneeded, extraneous files and their asset definitions that came from odd import conversions. Where applicable, created cleaned up versions to make naming conventions and references stable
Fixed canvas mode update text typo: FSAA -> FXAA
Added logic to DOF, Light Rays, SSAO and Vignette postFX's to check both the preset setting AND the user preference before enabling.
Shifted initialization order so PostFX's are loaded before we configure the canvas, to ensure stuff like the FXAAPostFX exists and can be toggled on on load
Fixed multiple issues with options menu:
When using gamepad, unable to navigate from categories to options. Fixed so can now traverse as normal
Input limitations on gamepad necessitated changing of how setting applying happens, is now done as a 'apply or discard' prompt when leaving the options menu
Added proper handling for adjusting settings with gamepad with left/right inputs
Fixed issue where the unapplied change for an option was sometimes being processed as an object name rather than an implicit string. Now made to be explicit strings to avoid issue.
Made the menu button input for "Select" to go from categories to options gamepad only, and hidden when in the options list
Fixed issue where changing window mode didn't correctly affect resolution option. Now set up so changing this field correctly refreshes the resolution option. Specifically, when on borderless, the resolution field does not show, preventing confusion as it is always full resolution
Generally have the options list refresh when changes happen to allow any and all fields to be able to dynamically respond to other options having changed improving flexibility.
Cleaned up old, unused, commented out functions
Added ability on OKCancel message boxes to override the button text if needed
Fixed issue with AssetBrowser where the shrink/grow icons next to the preview size slider were not anchored correctly.
Adjusted callback logic so if preview slider is clicked on, rather than dragged, it will correctly update the zoom values
Added sorting to Modules List dropdown for the AssetBrowser
Improved standardization of double-clicking in AssetBrowser. Now defaults to editing action if regularly browsing and selecting if in select mode. Still allows regular per-type overrides as normal
Moved definition of GuiDisabledTextEditProfile to gui profiles.ed.tscript file, removed duplicates to stop error spam
Adjusted default settings value for double-click action in AB to be edit to prevent unstable behavior
Removed old file refs from Load Recent list in the default settings
2022-03-27 03:36:37 +00:00
|
|
|
%mode = %btn.getMode();
|
|
|
|
|
if(%mode == 0) //options list
|
|
|
|
|
{
|
|
|
|
|
%optionId = %btn.getCurrentOptionIndex() - 1;
|
|
|
|
|
%btn.selectOptionByIndex(%optionId);
|
|
|
|
|
%btn.onChange();
|
|
|
|
|
}
|
|
|
|
|
else if(%mode == 1) //slider
|
|
|
|
|
{
|
|
|
|
|
%value = %btn.getValue();
|
|
|
|
|
%adjustedValue = %value - %btn.getIncrement();
|
|
|
|
|
%minValue = %btn.getRange().x;
|
|
|
|
|
if(%adjustedValue < %minValue)
|
|
|
|
|
%adjustedValue = %minValue;
|
|
|
|
|
|
|
|
|
|
%btn.setValue(%adjustedValue);
|
|
|
|
|
%btn.onChange();
|
|
|
|
|
}
|
2022-02-23 05:28:28 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// Selects the next 'right' child item in the menuList. If the current item is the rightmost
|
|
|
|
|
/// then nothing happens
|
2022-02-23 05:28:28 +00:00
|
|
|
function MenuList::navigateRight()
|
|
|
|
|
{
|
2022-05-07 04:39:16 +00:00
|
|
|
%btn = $activeMenuList.getObject($activeMenuList.ListPosition.y);
|
2022-02-23 05:28:28 +00:00
|
|
|
if(%btn.getClassName() $= "GuiGameSettingsCtrl" && %btn.isEnabled())
|
|
|
|
|
{
|
Adjusted handling for the bitmap and bitmapAsset fields for guiBitmapButtonCtrl to forcefully update the button states when changed, ensuring that the bitmaps refresh when changed via the field
Added callback for onResize to guiWindowCtrl so controls - such as the EditorTree - can be properly resized in certain circumstances when the window is changed
Added getIncrement() and getRange() to GuiGameSettingsCtrl to better facilitate options manipulation on the script side
Corrected some of the console method documentation strings in GuiGameSettingsCtrl
Removed some unneeded, extraneous files and their asset definitions that came from odd import conversions. Where applicable, created cleaned up versions to make naming conventions and references stable
Fixed canvas mode update text typo: FSAA -> FXAA
Added logic to DOF, Light Rays, SSAO and Vignette postFX's to check both the preset setting AND the user preference before enabling.
Shifted initialization order so PostFX's are loaded before we configure the canvas, to ensure stuff like the FXAAPostFX exists and can be toggled on on load
Fixed multiple issues with options menu:
When using gamepad, unable to navigate from categories to options. Fixed so can now traverse as normal
Input limitations on gamepad necessitated changing of how setting applying happens, is now done as a 'apply or discard' prompt when leaving the options menu
Added proper handling for adjusting settings with gamepad with left/right inputs
Fixed issue where the unapplied change for an option was sometimes being processed as an object name rather than an implicit string. Now made to be explicit strings to avoid issue.
Made the menu button input for "Select" to go from categories to options gamepad only, and hidden when in the options list
Fixed issue where changing window mode didn't correctly affect resolution option. Now set up so changing this field correctly refreshes the resolution option. Specifically, when on borderless, the resolution field does not show, preventing confusion as it is always full resolution
Generally have the options list refresh when changes happen to allow any and all fields to be able to dynamically respond to other options having changed improving flexibility.
Cleaned up old, unused, commented out functions
Added ability on OKCancel message boxes to override the button text if needed
Fixed issue with AssetBrowser where the shrink/grow icons next to the preview size slider were not anchored correctly.
Adjusted callback logic so if preview slider is clicked on, rather than dragged, it will correctly update the zoom values
Added sorting to Modules List dropdown for the AssetBrowser
Improved standardization of double-clicking in AssetBrowser. Now defaults to editing action if regularly browsing and selecting if in select mode. Still allows regular per-type overrides as normal
Moved definition of GuiDisabledTextEditProfile to gui profiles.ed.tscript file, removed duplicates to stop error spam
Adjusted default settings value for double-click action in AB to be edit to prevent unstable behavior
Removed old file refs from Load Recent list in the default settings
2022-03-27 03:36:37 +00:00
|
|
|
%mode = %btn.getMode();
|
|
|
|
|
if(%mode == 0) //options list
|
|
|
|
|
{
|
|
|
|
|
%optionId = %btn.getCurrentOptionIndex() + 1;
|
|
|
|
|
%btn.selectOptionByIndex(%optionId);
|
|
|
|
|
%btn.onChange();
|
|
|
|
|
}
|
|
|
|
|
else if(%mode == 1) //slider
|
|
|
|
|
{
|
|
|
|
|
%value = %btn.getValue();
|
|
|
|
|
%adjustedValue = %value + %btn.getIncrement();
|
|
|
|
|
%maxValue = %btn.getRange().y;
|
|
|
|
|
if(%adjustedValue > %maxValue)
|
|
|
|
|
%adjustedValue = %maxValue;
|
|
|
|
|
|
|
|
|
|
%btn.setValue(%adjustedValue);
|
|
|
|
|
%btn.onChange();
|
|
|
|
|
}
|
2022-02-23 05:28:28 +00:00
|
|
|
}
|
|
|
|
|
}
|
Adjusted handling for the bitmap and bitmapAsset fields for guiBitmapButtonCtrl to forcefully update the button states when changed, ensuring that the bitmaps refresh when changed via the field
Added callback for onResize to guiWindowCtrl so controls - such as the EditorTree - can be properly resized in certain circumstances when the window is changed
Added getIncrement() and getRange() to GuiGameSettingsCtrl to better facilitate options manipulation on the script side
Corrected some of the console method documentation strings in GuiGameSettingsCtrl
Removed some unneeded, extraneous files and their asset definitions that came from odd import conversions. Where applicable, created cleaned up versions to make naming conventions and references stable
Fixed canvas mode update text typo: FSAA -> FXAA
Added logic to DOF, Light Rays, SSAO and Vignette postFX's to check both the preset setting AND the user preference before enabling.
Shifted initialization order so PostFX's are loaded before we configure the canvas, to ensure stuff like the FXAAPostFX exists and can be toggled on on load
Fixed multiple issues with options menu:
When using gamepad, unable to navigate from categories to options. Fixed so can now traverse as normal
Input limitations on gamepad necessitated changing of how setting applying happens, is now done as a 'apply or discard' prompt when leaving the options menu
Added proper handling for adjusting settings with gamepad with left/right inputs
Fixed issue where the unapplied change for an option was sometimes being processed as an object name rather than an implicit string. Now made to be explicit strings to avoid issue.
Made the menu button input for "Select" to go from categories to options gamepad only, and hidden when in the options list
Fixed issue where changing window mode didn't correctly affect resolution option. Now set up so changing this field correctly refreshes the resolution option. Specifically, when on borderless, the resolution field does not show, preventing confusion as it is always full resolution
Generally have the options list refresh when changes happen to allow any and all fields to be able to dynamically respond to other options having changed improving flexibility.
Cleaned up old, unused, commented out functions
Added ability on OKCancel message boxes to override the button text if needed
Fixed issue with AssetBrowser where the shrink/grow icons next to the preview size slider were not anchored correctly.
Adjusted callback logic so if preview slider is clicked on, rather than dragged, it will correctly update the zoom values
Added sorting to Modules List dropdown for the AssetBrowser
Improved standardization of double-clicking in AssetBrowser. Now defaults to editing action if regularly browsing and selecting if in select mode. Still allows regular per-type overrides as normal
Moved definition of GuiDisabledTextEditProfile to gui profiles.ed.tscript file, removed duplicates to stop error spam
Adjusted default settings value for double-click action in AB to be edit to prevent unstable behavior
Removed old file refs from Load Recent list in the default settings
2022-03-27 03:36:37 +00:00
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// Gets the current vertical positionally selected child object
|
Adjusted handling for the bitmap and bitmapAsset fields for guiBitmapButtonCtrl to forcefully update the button states when changed, ensuring that the bitmaps refresh when changed via the field
Added callback for onResize to guiWindowCtrl so controls - such as the EditorTree - can be properly resized in certain circumstances when the window is changed
Added getIncrement() and getRange() to GuiGameSettingsCtrl to better facilitate options manipulation on the script side
Corrected some of the console method documentation strings in GuiGameSettingsCtrl
Removed some unneeded, extraneous files and their asset definitions that came from odd import conversions. Where applicable, created cleaned up versions to make naming conventions and references stable
Fixed canvas mode update text typo: FSAA -> FXAA
Added logic to DOF, Light Rays, SSAO and Vignette postFX's to check both the preset setting AND the user preference before enabling.
Shifted initialization order so PostFX's are loaded before we configure the canvas, to ensure stuff like the FXAAPostFX exists and can be toggled on on load
Fixed multiple issues with options menu:
When using gamepad, unable to navigate from categories to options. Fixed so can now traverse as normal
Input limitations on gamepad necessitated changing of how setting applying happens, is now done as a 'apply or discard' prompt when leaving the options menu
Added proper handling for adjusting settings with gamepad with left/right inputs
Fixed issue where the unapplied change for an option was sometimes being processed as an object name rather than an implicit string. Now made to be explicit strings to avoid issue.
Made the menu button input for "Select" to go from categories to options gamepad only, and hidden when in the options list
Fixed issue where changing window mode didn't correctly affect resolution option. Now set up so changing this field correctly refreshes the resolution option. Specifically, when on borderless, the resolution field does not show, preventing confusion as it is always full resolution
Generally have the options list refresh when changes happen to allow any and all fields to be able to dynamically respond to other options having changed improving flexibility.
Cleaned up old, unused, commented out functions
Added ability on OKCancel message boxes to override the button text if needed
Fixed issue with AssetBrowser where the shrink/grow icons next to the preview size slider were not anchored correctly.
Adjusted callback logic so if preview slider is clicked on, rather than dragged, it will correctly update the zoom values
Added sorting to Modules List dropdown for the AssetBrowser
Improved standardization of double-clicking in AssetBrowser. Now defaults to editing action if regularly browsing and selecting if in select mode. Still allows regular per-type overrides as normal
Moved definition of GuiDisabledTextEditProfile to gui profiles.ed.tscript file, removed duplicates to stop error spam
Adjusted default settings value for double-click action in AB to be edit to prevent unstable behavior
Removed old file refs from Load Recent list in the default settings
2022-03-27 03:36:37 +00:00
|
|
|
function MenuList::getActiveRow(%this)
|
|
|
|
|
{
|
2022-05-07 04:39:16 +00:00
|
|
|
return $activeMenuList.ListPosition.y;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 21:17:22 +00:00
|
|
|
//==============================================================================
|
|
|
|
|
/// Summary:
|
|
|
|
|
/// Called from the engine when a GUIButtonBase-derived class with MenuListButton namespace class
|
|
|
|
|
/// has its highlighting status changed. Allows us to react to this change of state and trigger refreshse
|
|
|
|
|
/// or other events to keep the navigation tracking up to date
|
|
|
|
|
///
|
|
|
|
|
/// \param %state (bool) The on/off state of the button being highlighted
|
2022-05-07 04:39:16 +00:00
|
|
|
function MenuListButton::onHighlighted(%this, %state)
|
|
|
|
|
{
|
2022-05-09 21:17:22 +00:00
|
|
|
echo("MenuListButton::onHighlighted() - " @ %this.internalName @ " was " @ %state @ " highlighted");
|
2022-05-07 04:39:16 +00:00
|
|
|
%parentContainer = %this.getParent();
|
|
|
|
|
if(%parentContainer.class $= "MenuList" || %parentContainer.superClass $= "MenuList")
|
|
|
|
|
{
|
|
|
|
|
if(isObject(%parentContainer.buttonPointerCtrl))
|
|
|
|
|
{
|
|
|
|
|
if(%state)
|
|
|
|
|
{
|
|
|
|
|
%parentContainer.buttonPointerCtrl.setHidden(false);
|
|
|
|
|
|
|
|
|
|
%buttonCenter = %this.getGlobalCenter();
|
2022-05-09 21:17:22 +00:00
|
|
|
echo(" - button center:" @ %buttonCenter);
|
2022-05-07 04:39:16 +00:00
|
|
|
|
|
|
|
|
if(%parentContainer.centerButtonPointerCtrl)
|
|
|
|
|
{
|
|
|
|
|
%parentContainer.buttonPointerCtrl.setGlobalCenter(%buttonCenter.x, %buttonCenter.y);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//if we're not centering, then left-justify
|
|
|
|
|
%parentContainer.buttonPointerCtrl.setGlobalCenter(%buttonCenter.x - %this.extent.x / 2, %buttonCenter.y);
|
|
|
|
|
}
|
2022-05-09 21:17:22 +00:00
|
|
|
echo(" - pointer position:" @ %parentContainer.buttonPointerCtrl.getPosition());
|
2022-05-07 04:39:16 +00:00
|
|
|
}
|
2022-05-09 21:17:22 +00:00
|
|
|
/*else
|
|
|
|
|
{
|
|
|
|
|
%parentContainer.buttonPointerCtrl.setHidden(true);
|
|
|
|
|
}*/
|
2022-05-07 04:39:16 +00:00
|
|
|
}
|
|
|
|
|
}
|
Adjusted handling for the bitmap and bitmapAsset fields for guiBitmapButtonCtrl to forcefully update the button states when changed, ensuring that the bitmaps refresh when changed via the field
Added callback for onResize to guiWindowCtrl so controls - such as the EditorTree - can be properly resized in certain circumstances when the window is changed
Added getIncrement() and getRange() to GuiGameSettingsCtrl to better facilitate options manipulation on the script side
Corrected some of the console method documentation strings in GuiGameSettingsCtrl
Removed some unneeded, extraneous files and their asset definitions that came from odd import conversions. Where applicable, created cleaned up versions to make naming conventions and references stable
Fixed canvas mode update text typo: FSAA -> FXAA
Added logic to DOF, Light Rays, SSAO and Vignette postFX's to check both the preset setting AND the user preference before enabling.
Shifted initialization order so PostFX's are loaded before we configure the canvas, to ensure stuff like the FXAAPostFX exists and can be toggled on on load
Fixed multiple issues with options menu:
When using gamepad, unable to navigate from categories to options. Fixed so can now traverse as normal
Input limitations on gamepad necessitated changing of how setting applying happens, is now done as a 'apply or discard' prompt when leaving the options menu
Added proper handling for adjusting settings with gamepad with left/right inputs
Fixed issue where the unapplied change for an option was sometimes being processed as an object name rather than an implicit string. Now made to be explicit strings to avoid issue.
Made the menu button input for "Select" to go from categories to options gamepad only, and hidden when in the options list
Fixed issue where changing window mode didn't correctly affect resolution option. Now set up so changing this field correctly refreshes the resolution option. Specifically, when on borderless, the resolution field does not show, preventing confusion as it is always full resolution
Generally have the options list refresh when changes happen to allow any and all fields to be able to dynamically respond to other options having changed improving flexibility.
Cleaned up old, unused, commented out functions
Added ability on OKCancel message boxes to override the button text if needed
Fixed issue with AssetBrowser where the shrink/grow icons next to the preview size slider were not anchored correctly.
Adjusted callback logic so if preview slider is clicked on, rather than dragged, it will correctly update the zoom values
Added sorting to Modules List dropdown for the AssetBrowser
Improved standardization of double-clicking in AssetBrowser. Now defaults to editing action if regularly browsing and selecting if in select mode. Still allows regular per-type overrides as normal
Moved definition of GuiDisabledTextEditProfile to gui profiles.ed.tscript file, removed duplicates to stop error spam
Adjusted default settings value for double-click action in AB to be edit to prevent unstable behavior
Removed old file refs from Load Recent list in the default settings
2022-03-27 03:36:37 +00:00
|
|
|
}
|