From 36d00e09d3565f0f91df5cfe111f18ac97ba807c Mon Sep 17 00:00:00 2001 From: Areloch Date: Wed, 27 Dec 2023 01:36:58 -0600 Subject: [PATCH] - Fixed Back on-screen menu button for OptionsMenu wasn't working - Fixed MainMenu buttonlist not navigating with keybinds after going to optionsMenu and going back - Fixed menu title text clipping - Fixed keybind preview images on keybind lists in OptionsMenu being modal - Fixed btn_l and btn_r bitmap button binding not working - Fixed a/b and x/y button bitmaps on xbox controllers being flipped --- .../game/data/UI/guis/ChooseLevelMenu.gui | 2 +- .../game/data/UI/guis/joinServerMenu.gui | 2 +- .../game/data/UI/guis/mainMenu.tscript | 2 +- .../game/data/UI/guis/optionsMenu.gui | 4 +-- .../game/data/UI/guis/optionsMenu.tscript | 4 +-- .../game/data/UI/scripts/profiles.tscript | 1 + .../game/data/UI/scripts/utility.tscript | 32 ++++++++++++------- 7 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Templates/BaseGame/game/data/UI/guis/ChooseLevelMenu.gui b/Templates/BaseGame/game/data/UI/guis/ChooseLevelMenu.gui index 7fb06379a..6739e8bc9 100644 --- a/Templates/BaseGame/game/data/UI/guis/ChooseLevelMenu.gui +++ b/Templates/BaseGame/game/data/UI/guis/ChooseLevelMenu.gui @@ -31,7 +31,7 @@ $guiContent = new GuiControl(ChooseLevelMenu) { new GuiTextCtrl(ChooseLevelTitleText) { text = "SINGLE PLAYER"; position = "22 23"; - extent = "220 28"; + extent = "1281 28"; profile = "MenuHeaderText"; tooltipProfile = "GuiToolTipProfile"; }; diff --git a/Templates/BaseGame/game/data/UI/guis/joinServerMenu.gui b/Templates/BaseGame/game/data/UI/guis/joinServerMenu.gui index fe2575ca2..30b6a8d04 100644 --- a/Templates/BaseGame/game/data/UI/guis/joinServerMenu.gui +++ b/Templates/BaseGame/game/data/UI/guis/joinServerMenu.gui @@ -28,7 +28,7 @@ $guiContent = new GuiControl(JoinServerMenu) { new GuiTextCtrl() { text = "JOIN SERVER"; position = "22 23"; - extent = "220 28"; + extent = "1281 28"; profile = "MenuHeaderText"; tooltipProfile = "GuiToolTipProfile"; }; diff --git a/Templates/BaseGame/game/data/UI/guis/mainMenu.tscript b/Templates/BaseGame/game/data/UI/guis/mainMenu.tscript index b334aeca8..0989607ce 100644 --- a/Templates/BaseGame/game/data/UI/guis/mainMenu.tscript +++ b/Templates/BaseGame/game/data/UI/guis/mainMenu.tscript @@ -64,7 +64,7 @@ function BaseUIStickNavigate(%val) function BaseUIBackOut(%val) { //we can't navigate further back than the MainMenuGui - if(%val && Canvas.getObject(Canvas.getCount()-1) != MainMenuGui) + if(%val && Canvas.getObject(Canvas.getCount()-1).getId() != MainMenuGui.getId()) { Canvas.popDialog(); %topMenu = Canvas.getObject(Canvas.getCount()-1); diff --git a/Templates/BaseGame/game/data/UI/guis/optionsMenu.gui b/Templates/BaseGame/game/data/UI/guis/optionsMenu.gui index a6906986f..9ef81c263 100644 --- a/Templates/BaseGame/game/data/UI/guis/optionsMenu.gui +++ b/Templates/BaseGame/game/data/UI/guis/optionsMenu.gui @@ -165,7 +165,7 @@ $guiContent = new GuiControl(OptionsMenu) { new GuiTextCtrl() { text = "OPTIONS"; position = "22 23"; - extent = "220 28"; + extent = "1281 28"; profile = "MenuHeaderText"; tooltipProfile = "GuiToolTipProfile"; }; @@ -188,7 +188,7 @@ $guiContent = new GuiControl(OptionsMenu) { extent = "140 40"; vertSizing = "center"; profile = "GuiMenuButtonProfile"; - command = "tryCloseOptionsMenu();"; + command = "tryCloseOptionsMenu(1);"; tooltipProfile = "GuiToolTipProfile"; class = "MenuInputButton"; }; diff --git a/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript b/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript index 93762fb81..ba6f1e9b4 100644 --- a/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript +++ b/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript @@ -623,7 +623,7 @@ function tryCloseOptionsMenu(%val) } else { - Canvas.popDialog(OptionsMenu); + BaseUIBackOut(1); } } @@ -642,7 +642,7 @@ function OptionsMenu::applyChangedOptions(%this) %prefPath = getPrefpath(); export("$pref::*", %prefPath @ "/clientPrefs." @ $TorqueScriptFileExtension, false); - Canvas.popDialog(OptionsMenu); + BaseUIBackOut(1); if($optionsChangeRequiresRestart) MessageBoxOK("Restart Required", "Some of your changes require the game to be restarted."); diff --git a/Templates/BaseGame/game/data/UI/scripts/profiles.tscript b/Templates/BaseGame/game/data/UI/scripts/profiles.tscript index c6c34cb9c..60c7f4bf7 100644 --- a/Templates/BaseGame/game/data/UI/scripts/profiles.tscript +++ b/Templates/BaseGame/game/data/UI/scripts/profiles.tscript @@ -187,6 +187,7 @@ singleton GuiControlProfile( GuiRemapActionMapButtonProfile : GuiMenuButtonProfi { fillColor = "18 18 18 255"; fillColorHL = "0 0 0 255"; + modal = false; }; singleton GuiControlProfile(GuiMenuScrollProfile) diff --git a/Templates/BaseGame/game/data/UI/scripts/utility.tscript b/Templates/BaseGame/game/data/UI/scripts/utility.tscript index a0870f54d..a3d596088 100644 --- a/Templates/BaseGame/game/data/UI/scripts/utility.tscript +++ b/Templates/BaseGame/game/data/UI/scripts/utility.tscript @@ -45,13 +45,13 @@ function getButtonBitmap(%device, %button) %assetId = %assetId @ "Square"; else if(%button $= "Y" || %button $= "btn_y") %assetId = %assetId @ "Triangle"; - else if(%button $= "LB") + else if(%button $= "LB" || %button $= "btn_l") %assetId = %assetId @ "L1"; - else if(%button $= "LT") + else if(%button $= "LT" || %button $= "btn_lt") %assetId = %assetId @ "L2"; - else if(%button $= "RB") + else if(%button $= "RB" || %button $= "btn_r") %assetId = %assetId @ "R1"; - else if(%button $= "RT") + else if(%button $= "RT" || %button $= "btn_rt") %assetId = %assetId @ "R2"; else if(%button $= "thumbrx" || %button $= "thumbry") %assetId = %assetId @ "Right_Stick"; @@ -84,13 +84,13 @@ function getButtonBitmap(%device, %button) %assetId = %assetId @ "Y"; else if(%button $= "Y" || %button $= "btn_y") %assetId = %assetId @ "X"; - else if(%button $= "LB") + else if(%button $= "LB" || %button $= "btn_l") %assetId = %assetId @ "LB"; - else if(%button $= "LT") + else if(%button $= "LT" || %button $= "btn_lt") %assetId = %assetId @ "LT"; - else if(%button $= "RB") + else if(%button $= "RB" || %button $= "btn_r") %assetId = %assetId @ "RB"; - else if(%button $= "RT") + else if(%button $= "RT" || %button $= "btn_rt") %assetId = %assetId @ "RT"; else if(%button $= "thumbrx" || %button $= "thumbry") %assetId = %assetId @ "Right_Stick"; @@ -120,13 +120,21 @@ function getButtonBitmap(%device, %button) %assetId = "UI:Xbox_"; if(%button $= "btn_a") - %assetId = %assetId @ "B"; - else if(%button $= "btn_b") %assetId = %assetId @ "A"; + else if(%button $= "btn_b") + %assetId = %assetId @ "B"; else if(%button $= "btn_x") - %assetId = %assetId @ "Y"; - else if(%button $= "btn_y") %assetId = %assetId @ "X"; + else if(%button $= "btn_y") + %assetId = %assetId @ "Y"; + else if(%button $= "LB" || %button $= "btn_l") + %assetId = %assetId @ "LB"; + else if(%button $= "LT" || %button $= "btn_lt") + %assetId = %assetId @ "LT"; + else if(%button $= "RB" || %button $= "btn_r") + %assetId = %assetId @ "RB"; + else if(%button $= "RT" || %button $= "btn_rt") + %assetId = %assetId @ "RT"; else if(%button $= "thumbrx" || %button $= "thumbry") %assetId = %assetId @ "Right_Stick"; else if(%button $= "thumblx" || %button $= "thumbly")