From 6c73bde8cf07320dc0ba595b21e0c4d59d827d16 Mon Sep 17 00:00:00 2001 From: John Jordan Date: Wed, 10 Jul 2024 04:06:12 +0100 Subject: [PATCH] Fix incorrect licensing and slow-server UI issue in arsenal limits dialog --- A3A/addons/gui/dialogues/arsenalLimitsDialog.hpp | 1 + .../gui/functions/GUI/fn_arsenalLimitsDialog.sqf | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/A3A/addons/gui/dialogues/arsenalLimitsDialog.hpp b/A3A/addons/gui/dialogues/arsenalLimitsDialog.hpp index 2d49af391b..f95761e102 100644 --- a/A3A/addons/gui/dialogues/arsenalLimitsDialog.hpp +++ b/A3A/addons/gui/dialogues/arsenalLimitsDialog.hpp @@ -76,6 +76,7 @@ class A3A_ArsenalLimitsDialog : A3A_DefaultDialog { idc = A3A_IDC_ARSLIMTYPESBASE + 0; text="\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\PrimaryWeapon_ca.paa"; tooltip="$STR_A3_RscDisplayArsenal_tab_PrimaryWeapon"; + onLoad = "(_this # 0) ctrlEnable false"; // disable until init is complete onButtonClick = "['typeSelect', [ctrlIDC (_this#0)]] call A3A_GUI_fnc_arsenalLimitsDialog"; colorDisabled[] = {0,0,0,1}; colorBackgroundDisabled[] = {1,1,1,1}; diff --git a/A3A/addons/gui/functions/GUI/fn_arsenalLimitsDialog.sqf b/A3A/addons/gui/functions/GUI/fn_arsenalLimitsDialog.sqf index 9ef0608864..580a570798 100644 --- a/A3A/addons/gui/functions/GUI/fn_arsenalLimitsDialog.sqf +++ b/A3A/addons/gui/functions/GUI/fn_arsenalLimitsDialog.sqf @@ -1,5 +1,5 @@ /* -Maintainer: Caleb Serafin, DoomMetal +Maintainer: John Jordan Handles the initialization and updating of the arsenal guest limits dialog. Arguments: @@ -12,8 +12,6 @@ Returns: Environment: Should not be called by onLoad because findDisplay and ctrlParent do not work in that context. -License: APL-ND - */ #include "..\..\dialogues\ids.inc" @@ -46,7 +44,7 @@ switch (_mode) do [localize "STR_antistasi_arsenal_limits_dialog_hint_title", localize "STR_antistasi_arsenal_limits_dialog_guest_warning"] call A3A_fnc_customHint; (_display displayctrl A3A_IDC_ARSLIMRESETBUTTON) ctrlEnable false; }; - ["typeSelect", [A3A_IDC_ARSLIMTYPESBASE]] call A3A_GUI_fnc_ArsenalLimitsDialog; + ["typeSelect", [A3A_IDC_ARSLIMTYPESBASE]] call A3A_GUI_fnc_arsenalLimitsDialog; }; case ("typeSelect"): @@ -95,7 +93,7 @@ switch (_mode) do _button ctrlCommit 0; _button ctrlSetText _text; _button setVariable ["A3A_params", [_valCtrl, _adjust]]; - _button ctrlAddEventHandler ["ButtonClick", { ["listButton", _this] call A3A_GUI_fnc_ArsenalLimitsDialog }]; + _button ctrlAddEventHandler ["ButtonClick", { ["listButton", _this] call A3A_GUI_fnc_arsenalLimitsDialog }]; } forEach [["R", "R", 66], ["-", -5, 70], ["+", 5, 82], ["U", "U", 86]]; } forEach (jna_datalist#_typeIndex select {_x#1>0}); // only show non-unlocked items @@ -142,7 +140,7 @@ switch (_mode) do A3A_arsenalLimits deleteAt (_x#0); } forEach (jna_datalist#_typeIndex); - ["typeSelect", [_typeIndex + A3A_IDC_ARSLIMTYPESBASE]] call A3A_GUI_fnc_ArsenalLimitsDialog; // refresh the display + ["typeSelect", [_typeIndex + A3A_IDC_ARSLIMTYPESBASE]] call A3A_GUI_fnc_arsenalLimitsDialog; // refresh the display }; /* case ("stepButton"):