From 16cce1663bd665f2711f0c3f6c15fb4706ae8bd3 Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sun, 15 Nov 2020 10:21:08 +0100 Subject: [PATCH 01/11] Add basic options --- addons/adminmenu/authorized_player.hpp | 24 ++++++++++++++++++++++++ addons/adminmenu/config.cpp | 7 +------ 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 addons/adminmenu/authorized_player.hpp diff --git a/addons/adminmenu/authorized_player.hpp b/addons/adminmenu/authorized_player.hpp new file mode 100644 index 00000000..fea4df81 --- /dev/null +++ b/addons/adminmenu/authorized_player.hpp @@ -0,0 +1,24 @@ + +enum { + // Adminmenu tabs + TM_ALLOW_DASHBOARD = 1, + TM_ALLOW_PLAYERMANAGEMENT = 2, + TM_ALLOW_RESPAWN = 4, // Also controls Quick Respawn in Player Management + TM_ALLOW_ENDMISSION = 8, + TM_ALLOW_LOGS = 16, + TM_ALLOW_MENUALL = 31 +}; + +class GVAR(authorized_players) { + // Default values if none otherwise defined + debugConsole = true; // Access to debug console, also controls execute code in Player Management + zeus = true; // Allowed to grab or use Zeus + spectatorRC = true; // Allow remote controlling units while in spectator + + adminmenu = __EVAL(TM_ALLOW_MENUALL); // Which adminmenu tabs are allowed + //adminmenu = __EVAL(TM_ALLOW_DASHBOARD + TM_ALLOW_PLAYERMANAGEMENT); + + /*class Bear { + uid = "12345"; // SteamID64 of players authorized to access admin tools (matches against getPlayerUID) + };*/ +}; diff --git a/addons/adminmenu/config.cpp b/addons/adminmenu/config.cpp index 5e110299..0bda40f7 100644 --- a/addons/adminmenu/config.cpp +++ b/addons/adminmenu/config.cpp @@ -13,12 +13,7 @@ class CfgPatches { }; }; -// SteamID64 of players authorized to access admin tools (matches against getPlayerUID) -class GVAR(authorized_players) { - /*class Bear { - uid = "12345"; - };*/ -}; +#include "authorized_player.hpp" #include "CfgFunctions.hpp" #include "CfgDebriefing.hpp" From e8c688ce0e76a89aa408ccc382d26b2ac6ca7c2f Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sun, 15 Nov 2020 12:23:40 +0100 Subject: [PATCH 02/11] Add logic --- addons/adminmenu/CfgEventHandlers.hpp | 1 + addons/adminmenu/XEH_PREP.sqf | 1 + addons/adminmenu/XEH_preStart.sqf | 5 ++ addons/adminmenu/authorized_player.hpp | 24 --------- addons/adminmenu/config.cpp | 23 ++++++++- .../functions/fnc_checkPermission.sqf | 50 +++++++++++++++++++ .../adminmenu/functions/fnc_isAuthorized.sqf | 28 ++++++++++- addons/adminmenu/script_component.hpp | 11 ++++ 8 files changed, 116 insertions(+), 27 deletions(-) create mode 100644 addons/adminmenu/XEH_preStart.sqf delete mode 100644 addons/adminmenu/authorized_player.hpp create mode 100644 addons/adminmenu/functions/fnc_checkPermission.sqf diff --git a/addons/adminmenu/CfgEventHandlers.hpp b/addons/adminmenu/CfgEventHandlers.hpp index 48a76999..c07b283c 100644 --- a/addons/adminmenu/CfgEventHandlers.hpp +++ b/addons/adminmenu/CfgEventHandlers.hpp @@ -6,3 +6,4 @@ class Extended_PostInit_EventHandlers { }; XEH_PREINIT; +XEH_PRESTART; diff --git a/addons/adminmenu/XEH_PREP.sqf b/addons/adminmenu/XEH_PREP.sqf index 8602588f..f00964ba 100644 --- a/addons/adminmenu/XEH_PREP.sqf +++ b/addons/adminmenu/XEH_PREP.sqf @@ -1,5 +1,6 @@ PREP(fpsHandlerServer); PREP(isAuthorized); +PREP(checkPermission); PREP(getCurrentAdminClient); PREP(getCurrentAdminServer); PREP(keyPressed); diff --git a/addons/adminmenu/XEH_preStart.sqf b/addons/adminmenu/XEH_preStart.sqf new file mode 100644 index 00000000..f002bf91 --- /dev/null +++ b/addons/adminmenu/XEH_preStart.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +#include "XEH_PREP.sqf" + +uiNamespace setVariable [QGVAR(storedPerms), [[],false] call CBA_fnc_hashCreate]; diff --git a/addons/adminmenu/authorized_player.hpp b/addons/adminmenu/authorized_player.hpp deleted file mode 100644 index fea4df81..00000000 --- a/addons/adminmenu/authorized_player.hpp +++ /dev/null @@ -1,24 +0,0 @@ - -enum { - // Adminmenu tabs - TM_ALLOW_DASHBOARD = 1, - TM_ALLOW_PLAYERMANAGEMENT = 2, - TM_ALLOW_RESPAWN = 4, // Also controls Quick Respawn in Player Management - TM_ALLOW_ENDMISSION = 8, - TM_ALLOW_LOGS = 16, - TM_ALLOW_MENUALL = 31 -}; - -class GVAR(authorized_players) { - // Default values if none otherwise defined - debugConsole = true; // Access to debug console, also controls execute code in Player Management - zeus = true; // Allowed to grab or use Zeus - spectatorRC = true; // Allow remote controlling units while in spectator - - adminmenu = __EVAL(TM_ALLOW_MENUALL); // Which adminmenu tabs are allowed - //adminmenu = __EVAL(TM_ALLOW_DASHBOARD + TM_ALLOW_PLAYERMANAGEMENT); - - /*class Bear { - uid = "12345"; // SteamID64 of players authorized to access admin tools (matches against getPlayerUID) - };*/ -}; diff --git a/addons/adminmenu/config.cpp b/addons/adminmenu/config.cpp index 0bda40f7..5367f73f 100644 --- a/addons/adminmenu/config.cpp +++ b/addons/adminmenu/config.cpp @@ -13,7 +13,28 @@ class CfgPatches { }; }; -#include "authorized_player.hpp" +/* + #define TMF_ALLOW_NONE 0 + #define TMF_ALLOW_DASHBOARD 1 + #define TMF_ALLOW_PLAYERMANAGEMENT 2 + #define TMF_ALLOW_RESPAWN 4 + #define TMF_ALLOW_ENDMISSION 8 + #define TMF_ALLOW_LOGS 16 + #define TMF_ALLOW_ALL 31 +*/ +class GVAR(authorized_players) { + // Default values if none otherwise defined + debugConsole = 1; // Access to debug console, also controls execute code in Player Management + zeus = 1; // Allowed to grab or use Zeus + spectatorRC = 1; // Allow remote controlling units while in spectator + + adminmenu = __EVAL(TMF_ALLOW_ALL); // Which adminmenu tabs are allowed + //adminmenu = __EVAL(TMF_ALLOW_DASHBOARD + TMF_ALLOW_PLAYERMANAGEMENT); // Macros + + /*class Bear { + uid = "12345"; // SteamID64 of players authorized to access admin tools (matches against getPlayerUID) + };*/ +}; #include "CfgFunctions.hpp" #include "CfgDebriefing.hpp" diff --git a/addons/adminmenu/functions/fnc_checkPermission.sqf b/addons/adminmenu/functions/fnc_checkPermission.sqf new file mode 100644 index 00000000..96bbc4a9 --- /dev/null +++ b/addons/adminmenu/functions/fnc_checkPermission.sqf @@ -0,0 +1,50 @@ +#include "\x\tmf\addons\adminmenu\script_component.hpp" + +params [ + ["_class", configNull, [configNull]], + ["_perm", "", [""]] +]; +TRACE_2("Checking permission",_class,_perm); + +_perm = toLower _perm; +private _defaultsClass = (configFile >> QGVAR(authorized_players)); + +// Check cached values +private _cachedPerms = uiNamespace getVariable QGVAR(storedPerms); +private _entry = [configName _class, _perm] joinString "_"; +if ([_cachedPerms,_entry] call CBA_fnc_hashHasKey) exitWith { + TRACE_1("Found cached permission value",_entry); + [_cachedPerms, _entry] call CBA_fnc_hashGet +}; + +#define CHECK_BOOL(var1) \ +if (isNumber (_class >> var1)) then { \ + (_class >> var1) call BIS_fnc_getCfgDataBool \ +} else { \ + (_defaultsClass >> var1) call BIS_fnc_getCfgDataBool \ +}; +#define CHECK_BITWISE(var1,var2) \ +if (isNumber (_class >> var1)) then { \ + [getNumber (_class >> var1), var2] call BIS_fnc_bitflagsCheck; \ +} else { \ + [getNumber (_defaultsClass >> var1), var2] call BIS_fnc_bitflagsCheck; \ +}; + +private _hasPerm = switch _perm do { + case "debugconsole": {CHECK_BOOL("debugConsole")}; + case "zeus": {CHECK_BOOL("zeus")}; + case "spectatorrc": {CHECK_BOOL("spectatorRC")}; + case "dashboard": {CHECK_BITWISE("adminmenu",TMF_ALLOW_DASHBOARD)}; + case "playermanagement":{CHECK_BITWISE("adminmenu",TMF_ALLOW_PLAYERMANAGEMENT)}; + case "respawn": {CHECK_BITWISE("adminmenu",TMF_ALLOW_RESPAWN)}; + case "endmission": {CHECK_BITWISE("adminmenu",TMF_ALLOW_ENDMISSION)}; + case "logs": {CHECK_BITWISE("adminmenu",TMF_ALLOW_LOGS)}; + + default {false}; +}; + +// Store value +TRACE_2("Caching permission value",_entry,_hasPerm); +[_cachedPerms, _entry, _hasPerm] call CBA_fnc_hashSet; + +_hasPerm diff --git a/addons/adminmenu/functions/fnc_isAuthorized.sqf b/addons/adminmenu/functions/fnc_isAuthorized.sqf index bb4a75b6..e6cb274b 100644 --- a/addons/adminmenu/functions/fnc_isAuthorized.sqf +++ b/addons/adminmenu/functions/fnc_isAuthorized.sqf @@ -17,11 +17,19 @@ * Return: * Boolean. - Whether player is an authorized admin */ -params [["_unit", player,[objNull]]]; +params [["_unit", player,[objNull]], "_perm"]; -private _index = ("true" configClasses (configFile >> QGVAR(authorized_players))) findIf {getText (_x >> "uid") isEqualTo getPlayerUID _unit}; +TRACE_2("Checking if unit is authorized",_unit,_perm); +private _uid = getPlayerUID _unit; +private _classes = "true" configClasses (configFile >> QGVAR(authorized_players)); +private _index = _classes findIf {getText (_x >> "uid") isEqualTo getPlayerUID _unit}; + +#ifdef DEBUG_MODE_FULL +private _authorized = switch true do { +#else switch true do { +#endif // Return true for server/HCs case ((isServer || !hasInterface) && {isNull _unit}); // Player UID listed in authorized_players config @@ -34,5 +42,21 @@ switch true do { case (is3DEN); case (is3DENMultiplayer): {true}; + case (_index != -1): { + if (!isNil "_perm" && _perm != "") then { + // Check specific permission + private _class = _classes # _index; + + [_class,_perm] call FUNC(checkPermission) + } else { + // Overall true + true + }; + }; + default {false}; }; + +#ifdef DEBUG_MODE_FULL +TRACE_1("Authorization check complete",_authorized); +#endif diff --git a/addons/adminmenu/script_component.hpp b/addons/adminmenu/script_component.hpp index 3b7aee19..7d481d02 100644 --- a/addons/adminmenu/script_component.hpp +++ b/addons/adminmenu/script_component.hpp @@ -3,6 +3,17 @@ #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" +/* PERMS */ +#define TMF_ALLOW_NONE 0 +#define TMF_ALLOW_DASHBOARD 1 +#define TMF_ALLOW_PLAYERMANAGEMENT 2 +#define TMF_ALLOW_RESPAWN 4 +#define TMF_ALLOW_ENDMISSION 8 +#define TMF_ALLOW_LOGS 16 +#define TMF_ALLOW_ALL 31 + +/* ADMINMENU */ + #define TMF_ADMINMENU_STD_WIDTH (((safezoneW / safezoneH) min 1.2) / 40) #define TMF_ADMINMENU_STD_HEIGHT ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) #define TMF_ADMINMENU_STD_SIZEX (TMF_ADMINMENU_STD_HEIGHT * 0.8) From 3f9fafbe87075f25000b5cebae63665f73944514 Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sun, 15 Nov 2020 12:30:07 +0100 Subject: [PATCH 03/11] Tweak --- addons/adminmenu/config.cpp | 6 +++++- addons/adminmenu/functions/fnc_isAuthorized.sqf | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/adminmenu/config.cpp b/addons/adminmenu/config.cpp index 5367f73f..0f8c1d6d 100644 --- a/addons/adminmenu/config.cpp +++ b/addons/adminmenu/config.cpp @@ -20,7 +20,7 @@ class CfgPatches { #define TMF_ALLOW_RESPAWN 4 #define TMF_ALLOW_ENDMISSION 8 #define TMF_ALLOW_LOGS 16 - #define TMF_ALLOW_ALL 31 + #define TMF_ALLOW_ALL 31 */ class GVAR(authorized_players) { // Default values if none otherwise defined @@ -31,6 +31,10 @@ class GVAR(authorized_players) { adminmenu = __EVAL(TMF_ALLOW_ALL); // Which adminmenu tabs are allowed //adminmenu = __EVAL(TMF_ALLOW_DASHBOARD + TMF_ALLOW_PLAYERMANAGEMENT); // Macros + class freddo { + uid = "76561198095500326"; + zeus = 0; + }; /*class Bear { uid = "12345"; // SteamID64 of players authorized to access admin tools (matches against getPlayerUID) };*/ diff --git a/addons/adminmenu/functions/fnc_isAuthorized.sqf b/addons/adminmenu/functions/fnc_isAuthorized.sqf index e6cb274b..916c0e99 100644 --- a/addons/adminmenu/functions/fnc_isAuthorized.sqf +++ b/addons/adminmenu/functions/fnc_isAuthorized.sqf @@ -40,7 +40,7 @@ switch true do { case (isServer && {admin owner _unit > 0}); case (!isMultiplayer); case (is3DEN); - case (is3DENMultiplayer): {true}; + case (is3DENPreview): {true}; case (_index != -1): { if (!isNil "_perm" && _perm != "") then { From f17641026cdd247e578c7bfa51aefa24a8736a4c Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sun, 15 Nov 2020 14:55:49 +0100 Subject: [PATCH 04/11] Debug console, logs and other perms --- addons/adminmenu/XEH_postInit.sqf | 2 +- addons/adminmenu/XEH_preServerInit.sqf | 2 +- addons/adminmenu/config.cpp | 10 +++-- .../adminmenu/fnc_isDebugConsoleAllowed.sqf | 2 +- .../functions/fnc_checkPermission.sqf | 13 ++++-- .../adminmenu/functions/fnc_isAuthorized.sqf | 12 +++--- addons/adminmenu/functions/fnc_keyPressed.sqf | 18 ++++---- addons/adminmenu/functions/fnc_onLoad.sqf | 43 ++++++++++++++++++- addons/adminmenu/initKeybinds.sqf | 23 +++++++++- 9 files changed, 95 insertions(+), 30 deletions(-) diff --git a/addons/adminmenu/XEH_postInit.sqf b/addons/adminmenu/XEH_postInit.sqf index a72c4200..50bedb52 100644 --- a/addons/adminmenu/XEH_postInit.sqf +++ b/addons/adminmenu/XEH_postInit.sqf @@ -9,7 +9,7 @@ GVAR(playerManagement_selected) = []; if (isTMF) then { [ - {time > 5 && [] call FUNC(isAuthorized)}, + {time > 5 && [player, "logs"] call FUNC(isAuthorized)}, { _this call FUNC(resyncLog); diff --git a/addons/adminmenu/XEH_preServerInit.sqf b/addons/adminmenu/XEH_preServerInit.sqf index 86e5f259..14b9174a 100644 --- a/addons/adminmenu/XEH_preServerInit.sqf +++ b/addons/adminmenu/XEH_preServerInit.sqf @@ -3,7 +3,7 @@ [ // Emit new log messages to admins QGVAR(serverLog), { - private _targets = (allPlayers select {[_x] call FUNC(isAuthorized)}); + private _targets = (allPlayers select {[_x, "logs"] call FUNC(isAuthorized)}); if (isServer && !hasInterface) then { GVAR(logEntries) pushBack _this; GVAR(logEntries) sort true; diff --git a/addons/adminmenu/config.cpp b/addons/adminmenu/config.cpp index 0f8c1d6d..7a1cb9c0 100644 --- a/addons/adminmenu/config.cpp +++ b/addons/adminmenu/config.cpp @@ -1,3 +1,5 @@ +#include "\a3\ui_f\hpp\defineCommon.inc" +#include "\a3\ui_f\hpp\defineResincl.inc" #include "script_component.hpp" class CfgPatches { @@ -27,16 +29,16 @@ class GVAR(authorized_players) { debugConsole = 1; // Access to debug console, also controls execute code in Player Management zeus = 1; // Allowed to grab or use Zeus spectatorRC = 1; // Allow remote controlling units while in spectator + map = 1; // Allow using the admin map + safestart = 1; // Allow toggling safestart adminmenu = __EVAL(TMF_ALLOW_ALL); // Which adminmenu tabs are allowed //adminmenu = __EVAL(TMF_ALLOW_DASHBOARD + TMF_ALLOW_PLAYERMANAGEMENT); // Macros - class freddo { - uid = "76561198095500326"; - zeus = 0; - }; /*class Bear { uid = "12345"; // SteamID64 of players authorized to access admin tools (matches against getPlayerUID) + adminmenu = __EVAL(TMF_ALLOW_DASHBOARD + TMF_ALLOW_PLAYERMANAGEMENT); // Only allow dashboard and playermanagement + zeus = 0; // Disallow zeus };*/ }; diff --git a/addons/adminmenu/fnc_isDebugConsoleAllowed.sqf b/addons/adminmenu/fnc_isDebugConsoleAllowed.sqf index 3847dc93..7cde4d01 100644 --- a/addons/adminmenu/fnc_isDebugConsoleAllowed.sqf +++ b/addons/adminmenu/fnc_isDebugConsoleAllowed.sqf @@ -1,3 +1,3 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" -([] call BIS_fnc_isDebugConsoleAllowed_old || {[] call FUNC(isAuthorized)}) +([] call BIS_fnc_isDebugConsoleAllowed_old || {[player, "debugConsole"] call FUNC(isAuthorized)}) diff --git a/addons/adminmenu/functions/fnc_checkPermission.sqf b/addons/adminmenu/functions/fnc_checkPermission.sqf index 96bbc4a9..7f4aefa1 100644 --- a/addons/adminmenu/functions/fnc_checkPermission.sqf +++ b/addons/adminmenu/functions/fnc_checkPermission.sqf @@ -31,16 +31,21 @@ if (isNumber (_class >> var1)) then { \ }; private _hasPerm = switch _perm do { - case "debugconsole": {CHECK_BOOL("debugConsole")}; - case "zeus": {CHECK_BOOL("zeus")}; - case "spectatorrc": {CHECK_BOOL("spectatorRC")}; + /* Go to default instead + case "debugconsole"; + case "zeus"; + case "spectatorrc"; + case "map"; + case "safestart"; + case "adminmenu": {CHECK_BOOL(_perm))}; + */ case "dashboard": {CHECK_BITWISE("adminmenu",TMF_ALLOW_DASHBOARD)}; case "playermanagement":{CHECK_BITWISE("adminmenu",TMF_ALLOW_PLAYERMANAGEMENT)}; case "respawn": {CHECK_BITWISE("adminmenu",TMF_ALLOW_RESPAWN)}; case "endmission": {CHECK_BITWISE("adminmenu",TMF_ALLOW_ENDMISSION)}; case "logs": {CHECK_BITWISE("adminmenu",TMF_ALLOW_LOGS)}; - default {false}; + default {CHECK_BOOL(_perm)}; }; // Store value diff --git a/addons/adminmenu/functions/fnc_isAuthorized.sqf b/addons/adminmenu/functions/fnc_isAuthorized.sqf index 916c0e99..891701b7 100644 --- a/addons/adminmenu/functions/fnc_isAuthorized.sqf +++ b/addons/adminmenu/functions/fnc_isAuthorized.sqf @@ -17,7 +17,7 @@ * Return: * Boolean. - Whether player is an authorized admin */ -params [["_unit", player,[objNull]], "_perm"]; +params [["_unit", player,[objNull]], ["_perm","",[""]]]; TRACE_2("Checking if unit is authorized",_unit,_perm); @@ -30,11 +30,8 @@ private _authorized = switch true do { #else switch true do { #endif - // Return true for server/HCs - case ((isServer || !hasInterface) && {isNull _unit}); - // Player UID listed in authorized_players config - case (_index != -1); - // Check if local client is admin + case (isServer); + case (!hasInterface); case ((local _unit || isNull _unit) && {[] call BIS_fnc_admin > 0}); // Check if remote client is admin (only available for servers) case (isServer && {admin owner _unit > 0}); @@ -42,8 +39,9 @@ switch true do { case (is3DEN); case (is3DENPreview): {true}; + // Player UID listed in authorized_players config case (_index != -1): { - if (!isNil "_perm" && _perm != "") then { + if (_perm != "") then { // Check specific permission private _class = _classes # _index; diff --git a/addons/adminmenu/functions/fnc_keyPressed.sqf b/addons/adminmenu/functions/fnc_keyPressed.sqf index d6f41a2a..efab5c6e 100644 --- a/addons/adminmenu/functions/fnc_keyPressed.sqf +++ b/addons/adminmenu/functions/fnc_keyPressed.sqf @@ -3,7 +3,7 @@ params ["", "_keyPressed"]; private _modifiersPressed = _this select [2, 3]; -private _authorized = [player] call FUNC(isAuthorized); +private _rtrn = false; private _binding = ["TMF", QGVAR(openKey)] call CBA_fnc_getKeybind; if (isNil "_binding") exitWith {}; @@ -11,7 +11,7 @@ if (isNil "_binding") exitWith {}; private _handleKeypress = (_keyPressed isEqualTo _DIK) && (_modifiersPressed isEqualTo _modifiers); if (_handleKeypress) then { - if (_authorized) then { + if ([player, "adminmenu"] call FUNC(isAuthorized)) then { if (dialog && !isNull (uiNamespace getVariable [QGVAR(display), displayNull])) then { systemChat "[TMF Admin Menu] The admin menu is already open" } else { @@ -19,8 +19,11 @@ if (_handleKeypress) then { systemChat "[TMF Admin Menu] Can't open the admin menu in the Zeus interface"; } else { createDialog QUOTE(ADDON); + _rtrn = true; }; }; + } else { + systemChat "[TMF Admin Menu] You're not authorized to use the admin menu"; }; } else { _binding = ["TMF", QGVAR(spectatorRemoteControl)] call CBA_fnc_getKeybind; @@ -29,7 +32,7 @@ if (_handleKeypress) then { _handleKeypress = (_keyPressed isEqualTo _DIK) && (_modifiersPressed isEqualTo _modifiers); if (_handleKeypress) then { - if (_authorized) then { + if ([player, "spectatorRC"] call FUNC(isAuthorized)) then { if (isNull (findDisplay 5454)) then { if (isNull (missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull])) then { systemChat "[TMF Admin Menu] Remote Control is available only through TMF Spectator"; @@ -44,14 +47,13 @@ if (_handleKeypress) then { } else { [EGVAR(spectator,target), true] call FUNC(remoteControl); [format ["%1 remote controlled unit: %2", profileName,EGVAR(spectator,target)],false,"Admin Menu"] call FUNC(log); + _rtrn = true; }; }; + } else { + systemChat "[TMF Admin Menu] You're not authorized to remote control units"; }; }; }; -if (_handleKeypress && !_authorized) then { - systemChat "[TMF Admin Menu] You're not authorized to use the admin menu"; -}; - -true; +_rtrn diff --git a/addons/adminmenu/functions/fnc_onLoad.sqf b/addons/adminmenu/functions/fnc_onLoad.sqf index 4c482d43..9f04ce0f 100644 --- a/addons/adminmenu/functions/fnc_onLoad.sqf +++ b/addons/adminmenu/functions/fnc_onLoad.sqf @@ -158,5 +158,44 @@ _ctrlSelectInvert ctrlAddEventHandler ["ButtonClick", { // Register client as server FPS receiver [true] remoteExec [QFUNC(fpsHandlerServer), 2]; -// Show dashboard when opening the admin menu, hide other tabs -[_display] call FUNC(selectTab); + +//Handle perms + +// Select first allowed tab, hide other tabs +private _tabSelected = false; +{ + _x params ["_tab", "_idcGroup", "_idcButton"]; + if ([player, _tab] call FUNC(isAuthorized)) then { + if (!_tabSelected) then { + [_display, _idcGroup] call FUNC(selectTab); + _tabSelected = true; + }; + } else { + // No permission, disable button + private _ctrl = _display displayCtrl _idcButton; + _ctrl ctrlEnable false; + _ctrl ctrlSetTooltip "You lack permission to use this"; + }; +} forEach [ + ["dashboard", IDC_TMF_ADMINMENU_G_DASH, IDC_TMF_ADMINMENU_DASH], + ["playermanagement", IDC_TMF_ADMINMENU_G_PMAN, IDC_TMF_ADMINMENU_PMAN], + ["respawn", IDC_TMF_ADMINMENU_G_RESP, IDC_TMF_ADMINMENU_RESP], + ["endmission", IDC_TMF_ADMINMENU_G_ENDM, IDC_TMF_ADMINMENU_ENDM], + ["logs", IDC_TMF_ADMINMENU_G_MSGS, IDC_TMF_ADMINMENU_MSGS] +]; + +#define CHECK_DISABLE_CTRL(var1,var2) \ +if !([player, (var1)] call FUNC(isAuthorized)) then { \ + private _ctrl = _display displayCtrl (var2); \ + _ctrl ctrlEnable false; \ + _ctrl ctrlSetTooltip "You lack permission to use this"; \ +}; + +{CHECK_DISABLE_CTRL(_x # 0,_x # 1)} forEach [ + ["zeus",IDC_TMF_ADMINMENU_DASH_CLAIMZEUS], + ["zeus",IDC_TMF_ADMINMENU_PMAN_GRANTZEUS], + ["debugConsole",IDC_TMF_ADMINMENU_DASH_DEBUGCON], + ["debugConsole",IDC_TMF_ADMINMENU_PMAN_RUNCODE], + ["map",IDC_TMF_ADMINMENU_ADME], + ["safestart",IDC_TMF_ADMINMENU_DASH_SAFESTART] +]; diff --git a/addons/adminmenu/initKeybinds.sqf b/addons/adminmenu/initKeybinds.sqf index 4cd6541a..b1c8de1d 100644 --- a/addons/adminmenu/initKeybinds.sqf +++ b/addons/adminmenu/initKeybinds.sqf @@ -1,5 +1,24 @@ -["TMF", QGVAR(openKey), ["Open Admin Menu", "Only available for admins and in singleplayer"], FUNC(keyPressed), {false}, [59, [true, false, false]], false, 0] call CBA_fnc_addKeybind; // Shift + F1 -["TMF", QGVAR(spectatorRemoteControl), ["Control Focused Spectator Unit", "Only available in TMF Spectator, and only for admins and in singleplayer"], FUNC(keyPressed), {false}, [0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // No default bind +[ + "TMF", + QGVAR(openKey), + ["Open Admin Menu", "Only available for admins and in singleplayer"], + FUNC(keyPressed), + {false}, + [59, + [true, false, false]], + false, + 0 +] call CBA_fnc_addKeybind; // Shift + F1 +[ + "TMF", + QGVAR(spectatorRemoteControl), + ["Control Focused Spectator Unit", "Only available in TMF Spectator, and only for admins and in singleplayer"], + FUNC(keyPressed), + {false}, + [0, [false, false, false]], + false, + 0 +] call CBA_fnc_addKeybind; // No default bind [QEGVAR(spectator,keyDown), { From fae54b2ccefa989caa67e7fcbb6054267c1df9e7 Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sun, 15 Nov 2020 21:46:49 +0100 Subject: [PATCH 05/11] Move to GUI Grid Macros --- .../functions/fnc_modal_ACRE2Languages.sqf | 13 +- .../functions/fnc_modal_ACRE2Radios.sqf | 21 +- .../functions/fnc_modal_assignGear.sqf | 33 +-- .../functions/fnc_modal_assignTraits.sqf | 13 +- .../adminmenu/functions/fnc_modal_message.sqf | 9 +- .../adminmenu/functions/fnc_modal_runCode.sqf | 13 +- .../functions/fnc_modal_teleport.sqf | 17 +- .../functions/fnc_remoteControl_dialog.sqf | 7 +- addons/adminmenu/gui/adminMenu.hpp | 253 ++++++++---------- addons/adminmenu/gui/dashboard.hpp | 232 +++++++--------- addons/adminmenu/gui/dashboard_table.hpp | 129 ++++----- addons/adminmenu/gui/endMission.hpp | 203 +++++++------- addons/adminmenu/gui/messageLog.hpp | 20 +- addons/adminmenu/gui/modal.hpp | 92 +++---- addons/adminmenu/gui/playerManagement.hpp | 150 +++++------ addons/adminmenu/gui/respawn.hpp | 210 +++++++-------- addons/adminmenu/script_component.hpp | 41 ++- 17 files changed, 694 insertions(+), 762 deletions(-) diff --git a/addons/adminmenu/functions/fnc_modal_ACRE2Languages.sqf b/addons/adminmenu/functions/fnc_modal_ACRE2Languages.sqf index 6b5cd616..ca5f7c42 100644 --- a/addons/adminmenu/functions/fnc_modal_ACRE2Languages.sqf +++ b/addons/adminmenu/functions/fnc_modal_ACRE2Languages.sqf @@ -1,4 +1,5 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" disableSerialization; params ["_ctrlGroup"]; @@ -7,19 +8,19 @@ params ["_ctrlGroup"]; private _ctrlLabelLangs = _display ctrlCreate [QGVAR(RscTextLarge), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelLangs; -_ctrlLabelLangs ctrlSetPosition [0, 0, (0.5 * _ctrlGrpWidth), TMF_ADMINMENU_STD_HEIGHT]; +_ctrlLabelLangs ctrlSetPosition [0, 0, (0.5 * _ctrlGrpWidth), GUI_GRID_H]; _ctrlLabelLangs ctrlCommit 0; _ctrlLabelLangs ctrlSetText "Assign players' ACRE2 Babel languages"; if (count acre_sys_core_languages == 0) exitWith { _ctrlLabelLangs = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelLangs; - _ctrlLabelLangs ctrlSetPosition [0, 2.1 * TMF_ADMINMENU_STD_HEIGHT, (0.25 * _ctrlGrpWidth), TMF_ADMINMENU_STD_HEIGHT]; + _ctrlLabelLangs ctrlSetPosition [0, 2.1 * GUI_GRID_H, (0.25 * _ctrlGrpWidth), GUI_GRID_H]; _ctrlLabelLangs ctrlCommit 0; _ctrlLabelLangs ctrlSetText "No languages configured for mission!"; }; -private _langY = 2.1 * TMF_ADMINMENU_STD_HEIGHT; +private _langY = 2.1 * GUI_GRID_H; private _langComboCtrls = []; { @@ -27,14 +28,14 @@ private _langComboCtrls = []; private _ctrlLabelName = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelName; - _ctrlLabelName ctrlSetPosition [0, _langY + (_forEachIndex * (1.1 * TMF_ADMINMENU_STD_HEIGHT)), (0.25 * _ctrlGrpWidth), TMF_ADMINMENU_STD_HEIGHT]; + _ctrlLabelName ctrlSetPosition [0, _langY + (_forEachIndex * (1.1 * GUI_GRID_H)), (0.25 * _ctrlGrpWidth), GUI_GRID_H]; _ctrlLabelName ctrlCommit 0; _ctrlLabelName ctrlSetText _name; private _ctrlComboAction = _display ctrlCreate [QGVAR(RscCombo), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlComboAction; _langComboCtrls pushBack _ctrlComboAction; - _ctrlComboAction ctrlSetPosition [0.5 * _ctrlGrpWidth, _langY + (_forEachIndex * (1.1 * TMF_ADMINMENU_STD_HEIGHT)), 0.5 * _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; + _ctrlComboAction ctrlSetPosition [0.5 * _ctrlGrpWidth, _langY + (_forEachIndex * (1.1 * GUI_GRID_H)), 0.5 * _ctrlGrpWidth, GUI_GRID_H]; _ctrlComboAction ctrlCommit 0; _ctrlComboAction lbSetValue [(_ctrlComboAction lbAdd "Don't Change"), -1]; @@ -46,7 +47,7 @@ private _langComboCtrls = []; private _ctrlButton = _display ctrlCreate [QGVAR(RscButtonMenu), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlButton; -_ctrlButton ctrlSetPosition [_ctrlGrpWidth * 0.8, _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT, _ctrlGrpWidth * 0.2, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlButton ctrlSetPosition [_ctrlGrpWidth * 0.8, _ctrlGrpHeight - GUI_GRID_H, _ctrlGrpWidth * 0.2, GUI_GRID_H]; _ctrlButton ctrlCommit 0; _ctrlButton ctrlSetText "Assign Languages"; _ctrlButton setVariable [QGVAR(association), _langComboCtrls]; diff --git a/addons/adminmenu/functions/fnc_modal_ACRE2Radios.sqf b/addons/adminmenu/functions/fnc_modal_ACRE2Radios.sqf index 60001fa0..06ac67b9 100644 --- a/addons/adminmenu/functions/fnc_modal_ACRE2Radios.sqf +++ b/addons/adminmenu/functions/fnc_modal_ACRE2Radios.sqf @@ -1,4 +1,5 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" disableSerialization; params ["_ctrlGroup"]; @@ -7,13 +8,13 @@ params ["_ctrlGroup"]; private _ctrlLabelRadios = _display ctrlCreate [QGVAR(RscTextLarge), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelRadios; -_ctrlLabelRadios ctrlSetPosition [0, 0, (0.5 * _ctrlGrpWidth), TMF_ADMINMENU_STD_HEIGHT]; +_ctrlLabelRadios ctrlSetPosition [0, 0, (0.5 * _ctrlGrpWidth), GUI_GRID_H]; _ctrlLabelRadios ctrlCommit 0; _ctrlLabelRadios ctrlSetText "Add Radios"; private _ctrlLabelRadioGroup = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelRadioGroup; -_ctrlLabelRadioGroup ctrlSetPosition [0, (1.1 * TMF_ADMINMENU_STD_HEIGHT), 0.5 * _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlLabelRadioGroup ctrlSetPosition [0, (1.1 * GUI_GRID_H), 0.5 * _ctrlGrpWidth, GUI_GRID_H]; _ctrlLabelRadioGroup ctrlCommit 0; _ctrlLabelRadioGroup ctrlSetText "Radios with the same (number) postfix are compatible"; @@ -22,7 +23,7 @@ private _radios = []; _radios append (_x select 0); } forEach EGVAR(acre2,radioCoreSettings); private _radioCtrls = []; -private _radioCtrlsY = 2.2 * TMF_ADMINMENU_STD_HEIGHT; +private _radioCtrlsY = 2.2 * GUI_GRID_H; { private _radio = _x; @@ -31,13 +32,13 @@ private _radioCtrlsY = 2.2 * TMF_ADMINMENU_STD_HEIGHT; private _ctrlRadioCheck = _display ctrlCreate ["RscCheckBox", -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlRadioCheck; _radioCtrls pushBack _ctrlRadioCheck; - _ctrlRadioCheck ctrlSetPosition [0, _radioCtrlsY + (_forEachIndex * TMF_ADMINMENU_STD_HEIGHT), TMF_ADMINMENU_STD_WIDTH, TMF_ADMINMENU_STD_HEIGHT]; + _ctrlRadioCheck ctrlSetPosition [0, _radioCtrlsY + (_forEachIndex * GUI_GRID_H), GUI_GRID_W, GUI_GRID_H]; _ctrlRadioCheck ctrlCommit 0; _ctrlRadioCheck setVariable [QGVAR(association), _x]; private _ctrlRadioName = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlRadioName; - _ctrlRadioName ctrlSetPosition [TMF_ADMINMENU_STD_WIDTH, _radioCtrlsY + (_forEachIndex * TMF_ADMINMENU_STD_HEIGHT), (0.5 * _ctrlGrpWidth) - TMF_ADMINMENU_STD_WIDTH, TMF_ADMINMENU_STD_HEIGHT]; + _ctrlRadioName ctrlSetPosition [GUI_GRID_W, _radioCtrlsY + (_forEachIndex * GUI_GRID_H), (0.5 * _ctrlGrpWidth) - GUI_GRID_W, GUI_GRID_H]; _ctrlRadioName ctrlCommit 0; if (_radioGroup > 0) then { _ctrlRadioName ctrlSetText format ["%1 (%2)", getText (configFile >> "CfgWeapons" >> _x >> "displayName"), _radioGroup]; @@ -54,19 +55,19 @@ if (!isNil QEGVAR(acre2,networksWithRadioChannels)) then { private _ctrlCheckNetwork = _display ctrlCreate ["RscCheckBox", -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlCheckNetwork; _networkCtrls pushBack _ctrlCheckNetwork; - _ctrlCheckNetwork ctrlSetPosition [0.5 * _ctrlGrpWidth, 0, TMF_ADMINMENU_STD_WIDTH, TMF_ADMINMENU_STD_HEIGHT]; + _ctrlCheckNetwork ctrlSetPosition [0.5 * _ctrlGrpWidth, 0, GUI_GRID_W, GUI_GRID_H]; _ctrlCheckNetwork ctrlCommit 0; private _ctrlLabelNetwork = _display ctrlCreate [QGVAR(RscTextLarge), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelNetwork; - _ctrlLabelNetwork ctrlSetPosition [(0.5 * _ctrlGrpWidth) + TMF_ADMINMENU_STD_WIDTH, 0, (0.5 * _ctrlGrpWidth) - (1.1 * TMF_ADMINMENU_STD_WIDTH), TMF_ADMINMENU_STD_HEIGHT]; + _ctrlLabelNetwork ctrlSetPosition [(0.5 * _ctrlGrpWidth) + GUI_GRID_W, 0, (0.5 * _ctrlGrpWidth) - (1.1 * GUI_GRID_W), GUI_GRID_H]; _ctrlLabelNetwork ctrlCommit 0; _ctrlLabelNetwork ctrlSetText "Change Radio Network"; _ctrlCheckNetwork ctrlCommit 0; private _ctrlLabelNetworkWarning = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelNetworkWarning; - _ctrlLabelNetworkWarning ctrlSetPosition [0.5 * _ctrlGrpWidth, (1.1 * TMF_ADMINMENU_STD_HEIGHT), 0.5 * _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; + _ctrlLabelNetworkWarning ctrlSetPosition [0.5 * _ctrlGrpWidth, (1.1 * GUI_GRID_H), 0.5 * _ctrlGrpWidth, GUI_GRID_H]; _ctrlLabelNetworkWarning ctrlSetTextColor [1, 192/255, 77/255, 1]; _ctrlLabelNetworkWarning ctrlCommit 0; _ctrlLabelNetworkWarning ctrlSetText "Warning: Change only if you know what you're doing!"; @@ -74,7 +75,7 @@ if (!isNil QEGVAR(acre2,networksWithRadioChannels)) then { private _ctrlListNetwork = _display ctrlCreate [QGVAR(RscListBox), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlListNetwork; _networkCtrls pushBack _ctrlListNetwork; - _ctrlListNetwork ctrlSetPosition [0.5 * _ctrlGrpWidth, _radioCtrlsY, (0.5 * _ctrlGrpWidth) - (0.1 * TMF_ADMINMENU_STD_WIDTH), _ctrlGrpHeight - _radioCtrlsY - (2 * TMF_ADMINMENU_STD_HEIGHT)]; + _ctrlListNetwork ctrlSetPosition [0.5 * _ctrlGrpWidth, _radioCtrlsY, (0.5 * _ctrlGrpWidth) - (0.1 * GUI_GRID_W), _ctrlGrpHeight - _radioCtrlsY - (2 * GUI_GRID_H)]; _ctrlListNetwork ctrlCommit 0; { @@ -102,7 +103,7 @@ if (!isNil QEGVAR(acre2,networksWithRadioChannels)) then { private _ctrlButton = _display ctrlCreate [QGVAR(RscButtonMenu), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlButton; -_ctrlButton ctrlSetPosition [_ctrlGrpWidth * 0.8, _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT, _ctrlGrpWidth * 0.2, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlButton ctrlSetPosition [_ctrlGrpWidth * 0.8, _ctrlGrpHeight - GUI_GRID_H, _ctrlGrpWidth * 0.2, GUI_GRID_H]; _ctrlButton ctrlCommit 0; _ctrlButton ctrlSetText "Assign Radios"; _ctrlButton setVariable [QGVAR(association), [_radioCtrls, _networkCtrls]]; diff --git a/addons/adminmenu/functions/fnc_modal_assignGear.sqf b/addons/adminmenu/functions/fnc_modal_assignGear.sqf index ce4ca034..77892576 100644 --- a/addons/adminmenu/functions/fnc_modal_assignGear.sqf +++ b/addons/adminmenu/functions/fnc_modal_assignGear.sqf @@ -1,4 +1,5 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" disableSerialization; params ["_ctrlGroup"]; @@ -7,83 +8,83 @@ params ["_ctrlGroup"]; private _ctrlCheckFaction = _display ctrlCreate ["RscCheckBox", -1, _ctrlGroup]; GVAR(utilityTabControls) = [_ctrlCheckFaction]; -_ctrlCheckFaction ctrlSetPosition [0, 0, TMF_ADMINMENU_STD_WIDTH, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlCheckFaction ctrlSetPosition [0, 0, GUI_GRID_W, GUI_GRID_H]; _ctrlCheckFaction ctrlCommit 0; private _ctrlLabelFaction = _display ctrlCreate [QGVAR(RscTextLarge), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelFaction; -_ctrlLabelFaction ctrlSetPosition [TMF_ADMINMENU_STD_WIDTH, 0, (0.25 * _ctrlGrpWidth), TMF_ADMINMENU_STD_HEIGHT]; +_ctrlLabelFaction ctrlSetPosition [GUI_GRID_W, 0, (0.25 * _ctrlGrpWidth), GUI_GRID_H]; _ctrlLabelFaction ctrlCommit 0; _ctrlLabelFaction ctrlSetText "Change Faction"; private _ctrlCheckFromMission = _display ctrlCreate ["RscCheckBox", -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlCheckFromMission; -_ctrlCheckFromMission ctrlSetPosition [(2 * TMF_ADMINMENU_STD_WIDTH) + (0.25 * _ctrlGrpWidth), 0, TMF_ADMINMENU_STD_WIDTH, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlCheckFromMission ctrlSetPosition [(2 * GUI_GRID_W) + (0.25 * _ctrlGrpWidth), 0, GUI_GRID_W, GUI_GRID_H]; _ctrlCheckFromMission ctrlCommit 0; _ctrlCheckFromMission ctrlAddEventHandler ["CheckedChanged", FUNC(modal_assignGear_listboxFactions)]; private _ctrlLabelFromMission = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelFromMission; -_ctrlLabelFromMission ctrlSetPosition [(3 * TMF_ADMINMENU_STD_WIDTH) + (0.25 * _ctrlGrpWidth), 0, (0.6 * _ctrlGrpWidth), TMF_ADMINMENU_STD_HEIGHT]; +_ctrlLabelFromMission ctrlSetPosition [(3 * GUI_GRID_W) + (0.25 * _ctrlGrpWidth), 0, (0.6 * _ctrlGrpWidth), GUI_GRID_H]; _ctrlLabelFromMission ctrlCommit 0; _ctrlLabelFromMission ctrlSetText "List factions present in scenario only"; private _ctrlComboFaction = _display ctrlCreate [QGVAR(RscCombo), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlComboFaction; -_ctrlComboFaction ctrlSetPosition [(0.1 * TMF_ADMINMENU_STD_WIDTH), (1.1 * TMF_ADMINMENU_STD_HEIGHT), _ctrlGrpWidth - (0.2 * TMF_ADMINMENU_STD_WIDTH), TMF_ADMINMENU_STD_HEIGHT]; +_ctrlComboFaction ctrlSetPosition [(0.1 * GUI_GRID_W), (1.1 * GUI_GRID_H), _ctrlGrpWidth - (0.2 * GUI_GRID_W), GUI_GRID_H]; _ctrlComboFaction ctrlCommit 0; _ctrlCheckFromMission setVariable [QGVAR(association), _ctrlComboFaction]; _ctrlComboFaction ctrlAddEventHandler ["LBSelChanged", FUNC(modal_assignGear_listboxRoles)]; private _ctrlLabelBracketNumbers = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelBracketNumbers; -_ctrlLabelBracketNumbers ctrlSetPosition [0, (2.2 * TMF_ADMINMENU_STD_HEIGHT), _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlLabelBracketNumbers ctrlSetPosition [0, (2.2 * GUI_GRID_H), _ctrlGrpWidth, GUI_GRID_H]; _ctrlLabelBracketNumbers ctrlCommit 0; _ctrlLabelBracketNumbers ctrlSetText "* denotes a mission config loadout. To change role, tick the adjacent checkbox."; private _ctrlLabelRoles = _display ctrlCreate [QGVAR(RscTextLarge), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelRoles; -_ctrlLabelRoles ctrlSetPosition [0, (4.2 * TMF_ADMINMENU_STD_HEIGHT), (0.25 * _ctrlGrpWidth), TMF_ADMINMENU_STD_HEIGHT]; +_ctrlLabelRoles ctrlSetPosition [0, (4.2 * GUI_GRID_H), (0.25 * _ctrlGrpWidth), GUI_GRID_H]; _ctrlLabelRoles ctrlCommit 0; _ctrlLabelRoles ctrlSetText "Change Roles"; -private _ctrlGrpRolesWidth = _ctrlGrpWidth - (0.2 * TMF_ADMINMENU_STD_WIDTH); +private _ctrlGrpRolesWidth = _ctrlGrpWidth - (0.2 * GUI_GRID_W); private _ctrlGrpRoles = _display ctrlCreate ["RscControlsGroup", -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlGrpRoles; -_ctrlGrpRoles ctrlSetPosition [(0.1 * TMF_ADMINMENU_STD_WIDTH), (5.3 * TMF_ADMINMENU_STD_HEIGHT), _ctrlGrpRolesWidth, _ctrlGrpHeight - (6.4 * TMF_ADMINMENU_STD_HEIGHT)]; +_ctrlGrpRoles ctrlSetPosition [(0.1 * GUI_GRID_W), (5.3 * GUI_GRID_H), _ctrlGrpRolesWidth, _ctrlGrpHeight - (6.4 * GUI_GRID_H)]; _ctrlGrpRoles ctrlCommit 0; _ctrlGrpRoles ctrlSetText "Number within brackets tell how many players use the loadout"; GVAR(utility_assigngear_rolectrls) = []; private _ctrlLabelPlayerW = 0.4 * _ctrlGrpRolesWidth; private _ctrlComboRoleX = 0.5 * _ctrlGrpRolesWidth; -private _ctrlComboRoleW = (0.5 * _ctrlGrpRolesWidth) - TMF_ADMINMENU_STD_WIDTH; -private _ctrlCheckChangeX = _ctrlGrpRolesWidth - TMF_ADMINMENU_STD_WIDTH; +private _ctrlComboRoleW = (0.5 * _ctrlGrpRolesWidth) - GUI_GRID_W; +private _ctrlCheckChangeX = _ctrlGrpRolesWidth - GUI_GRID_W; { - private _ctrlLineY = _forEachIndex * (1.1 * TMF_ADMINMENU_STD_HEIGHT); + private _ctrlLineY = _forEachIndex * (1.1 * GUI_GRID_H); private _ctrlLabelPlayer = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGrpRoles]; GVAR(utilityTabControls) pushBack _ctrlLabelPlayer; - _ctrlLabelPlayer ctrlSetPosition [0, _ctrlLineY, _ctrlLabelPlayerW, TMF_ADMINMENU_STD_HEIGHT]; + _ctrlLabelPlayer ctrlSetPosition [0, _ctrlLineY, _ctrlLabelPlayerW, GUI_GRID_H]; _ctrlLabelPlayer ctrlCommit 0; _ctrlLabelPlayer ctrlSetText format ["%1 [%2]", name _x, _x getVariable [QEGVAR(assigngear,role), "no role"]]; private _ctrlComboRole = _display ctrlCreate [QGVAR(RscCombo), -1, _ctrlGrpRoles]; GVAR(utilityTabControls) pushBack _ctrlComboRole; - _ctrlComboRole ctrlSetPosition [_ctrlComboRoleX, _ctrlLineY, _ctrlComboRoleW, TMF_ADMINMENU_STD_HEIGHT]; + _ctrlComboRole ctrlSetPosition [_ctrlComboRoleX, _ctrlLineY, _ctrlComboRoleW, GUI_GRID_H]; _ctrlComboRole ctrlCommit 0; private _ctrlCheckChange = _display ctrlCreate ["RscCheckBox", -1, _ctrlGrpRoles]; GVAR(utilityTabControls) pushBack _ctrlCheckChange; GVAR(utility_assigngear_rolectrls) pushBack _ctrlCheckChange; - _ctrlCheckChange ctrlSetPosition [_ctrlCheckChangeX, _ctrlLineY, TMF_ADMINMENU_STD_WIDTH, TMF_ADMINMENU_STD_HEIGHT]; + _ctrlCheckChange ctrlSetPosition [_ctrlCheckChangeX, _ctrlLineY, GUI_GRID_W, GUI_GRID_H]; _ctrlCheckChange ctrlCommit 0; _ctrlCheckChange setVariable [QGVAR(association), [_x, _ctrlComboRole]]; } forEach GVAR(utilityData); private _ctrlButton = _display ctrlCreate [QGVAR(RscButtonMenu), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlButton; -_ctrlButton ctrlSetPosition [_ctrlGrpWidth * 0.8, _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT, _ctrlGrpWidth * 0.2, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlButton ctrlSetPosition [_ctrlGrpWidth * 0.8, _ctrlGrpHeight - GUI_GRID_H, _ctrlGrpWidth * 0.2, GUI_GRID_H]; _ctrlButton ctrlCommit 0; _ctrlButton ctrlSetText "Assign Gear"; _ctrlButton setVariable [QGVAR(association), [_ctrlCheckFaction, _ctrlComboFaction]]; diff --git a/addons/adminmenu/functions/fnc_modal_assignTraits.sqf b/addons/adminmenu/functions/fnc_modal_assignTraits.sqf index 7f6dcf80..4ff4a743 100644 --- a/addons/adminmenu/functions/fnc_modal_assignTraits.sqf +++ b/addons/adminmenu/functions/fnc_modal_assignTraits.sqf @@ -1,4 +1,5 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" disableSerialization; params ["_ctrlGroup"]; @@ -7,29 +8,29 @@ params ["_ctrlGroup"]; private _ctrlLabelTraits = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlLabelTraits; -_ctrlLabelTraits ctrlSetPosition [0, 0, (0.25 * _ctrlGrpWidth), TMF_ADMINMENU_STD_HEIGHT]; +_ctrlLabelTraits ctrlSetPosition [0, 0, (0.25 * _ctrlGrpWidth), GUI_GRID_H]; _ctrlLabelTraits ctrlCommit 0; _ctrlLabelTraits ctrlSetText "Assign Players' Traits"; private _ctrlComboTraitLabelW = 0.4 * _ctrlGrpWidth; private _ctrlComboTraitX = 0.5 * _ctrlGrpWidth; -private _ctrlComboTraitY = 2.2 * TMF_ADMINMENU_STD_HEIGHT; +private _ctrlComboTraitY = 2.2 * GUI_GRID_H; private _ctrlComboTraitW = 0.5 * _ctrlGrpWidth; private _traitComboCtrls = []; { - private _ctrlLineY = _ctrlComboTraitY + _forEachIndex * (1.1 * TMF_ADMINMENU_STD_HEIGHT); + private _ctrlLineY = _ctrlComboTraitY + _forEachIndex * (1.1 * GUI_GRID_H); private _ctrlComboTraitLabel = _display ctrlCreate [QGVAR(RscTextLarge), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlComboTraitLabel; - _ctrlComboTraitLabel ctrlSetPosition [0.1 * TMF_ADMINMENU_STD_WIDTH, _ctrlLineY, _ctrlComboTraitLabelW, TMF_ADMINMENU_STD_HEIGHT]; + _ctrlComboTraitLabel ctrlSetPosition [0.1 * GUI_GRID_W, _ctrlLineY, _ctrlComboTraitLabelW, GUI_GRID_H]; _ctrlComboTraitLabel ctrlCommit 0; _ctrlComboTraitLabel ctrlSetText _x; private _ctrlComboTrait = _display ctrlCreate [QGVAR(RscCombo), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlComboTrait; _traitComboCtrls pushBack _ctrlComboTrait; - _ctrlComboTrait ctrlSetPosition [_ctrlComboTraitX, _ctrlLineY, _ctrlComboTraitW, TMF_ADMINMENU_STD_HEIGHT]; + _ctrlComboTrait ctrlSetPosition [_ctrlComboTraitX, _ctrlLineY, _ctrlComboTraitW, GUI_GRID_H]; _ctrlComboTrait ctrlCommit 0; _ctrlComboTrait lbSetValue [(_ctrlComboTrait lbAdd "Don't Change"), -1]; @@ -47,7 +48,7 @@ private _traitComboCtrls = []; private _ctrlButton = _display ctrlCreate [QGVAR(RscButtonMenu), -1, _ctrlGroup]; GVAR(utilityTabControls) pushBack _ctrlButton; -_ctrlButton ctrlSetPosition [_ctrlGrpWidth * 0.8, _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT, _ctrlGrpWidth * 0.2, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlButton ctrlSetPosition [_ctrlGrpWidth * 0.8, _ctrlGrpHeight - GUI_GRID_H, _ctrlGrpWidth * 0.2, GUI_GRID_H]; _ctrlButton ctrlCommit 0; _ctrlButton ctrlSetText "Assign Traits"; _ctrlButton setVariable [QGVAR(association), _traitComboCtrls]; diff --git a/addons/adminmenu/functions/fnc_modal_message.sqf b/addons/adminmenu/functions/fnc_modal_message.sqf index 36d063b9..2fad0167 100644 --- a/addons/adminmenu/functions/fnc_modal_message.sqf +++ b/addons/adminmenu/functions/fnc_modal_message.sqf @@ -1,4 +1,5 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" disableSerialization; params ["_ctrlGroup"]; @@ -7,13 +8,13 @@ params ["_ctrlGroup"]; private _display = uiNamespace getVariable [QGVAR(modalDisplay), displayNull]; private _ctrlEdit = _display ctrlCreate ["RscEditMulti", -1, _ctrlGroup]; -private _ctrlEditPos = [0.1 * TMF_ADMINMENU_STD_WIDTH, 0.1 * TMF_ADMINMENU_STD_HEIGHT, _ctrlGrpWidth - (0.2 * TMF_ADMINMENU_STD_WIDTH), _ctrlGrpHeight - (1.3 * TMF_ADMINMENU_STD_HEIGHT)]; +private _ctrlEditPos = [0.1 * GUI_GRID_W, 0.1 * GUI_GRID_H, _ctrlGrpWidth - (0.2 * GUI_GRID_W), _ctrlGrpHeight - (1.3 * GUI_GRID_H)]; _ctrlEdit ctrlSetPosition _ctrlEditPos; _ctrlEdit ctrlCommit 0; _ctrlEdit ctrlSetText (missionNamespace getVariable [QGVAR(utility_message_last), ""]); private _ctrlCombo = _display ctrlCreate [QGVAR(RscCombo), -1, _ctrlGroup]; -_ctrlCombo ctrlSetPosition [0.1 * TMF_ADMINMENU_STD_WIDTH, _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT, _ctrlGrpWidth * 0.3, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlCombo ctrlSetPosition [0.1 * GUI_GRID_W, _ctrlGrpHeight - GUI_GRID_H, _ctrlGrpWidth * 0.3, GUI_GRID_H]; _ctrlCombo ctrlCommit 0; _ctrlCombo lbAdd "Show in Chat"; _ctrlCombo lbAdd "Show in Hint"; @@ -21,7 +22,7 @@ _ctrlCombo lbAdd "Show in Subtitle from 'PAPA BEAR'"; _ctrlCombo lbSetCurSel 0; private _ctrlButtonPreview = _display ctrlCreate [QGVAR(RscButtonMenu), -1, _ctrlGroup]; -_ctrlButtonPreview ctrlSetPosition [(_ctrlGrpWidth * 0.7) - (0.2 * TMF_ADMINMENU_STD_WIDTH), _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT, (_ctrlGrpWidth * 0.15), TMF_ADMINMENU_STD_HEIGHT]; +_ctrlButtonPreview ctrlSetPosition [(_ctrlGrpWidth * 0.7) - (0.2 * GUI_GRID_W), _ctrlGrpHeight - GUI_GRID_H, (_ctrlGrpWidth * 0.15), GUI_GRID_H]; _ctrlButtonPreview ctrlCommit 0; _ctrlButtonPreview ctrlSetText "Preview"; _ctrlButtonPreview setVariable [QGVAR(association), [_ctrlEdit, _ctrlCombo]]; @@ -52,7 +53,7 @@ _ctrlButtonPreview ctrlAddEventHandler ["buttonClick", { }]; private _ctrlButtonCommit = _display ctrlCreate [QGVAR(RscButtonMenu), -1, _ctrlGroup]; -_ctrlButtonCommit ctrlSetPosition [(_ctrlGrpWidth * 0.85), _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT, (_ctrlGrpWidth * 0.15) - (0.1 * TMF_ADMINMENU_STD_WIDTH), TMF_ADMINMENU_STD_HEIGHT]; +_ctrlButtonCommit ctrlSetPosition [(_ctrlGrpWidth * 0.85), _ctrlGrpHeight - GUI_GRID_H, (_ctrlGrpWidth * 0.15) - (0.1 * GUI_GRID_W), GUI_GRID_H]; _ctrlButtonCommit ctrlCommit 0; _ctrlButtonCommit ctrlSetText "Send Message"; _ctrlButtonCommit setVariable [QGVAR(association), [_ctrlEdit, _ctrlCombo]]; diff --git a/addons/adminmenu/functions/fnc_modal_runCode.sqf b/addons/adminmenu/functions/fnc_modal_runCode.sqf index 8766f643..c80a0fd9 100644 --- a/addons/adminmenu/functions/fnc_modal_runCode.sqf +++ b/addons/adminmenu/functions/fnc_modal_runCode.sqf @@ -1,4 +1,5 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" disableSerialization; params ["_ctrlGroup"]; @@ -7,24 +8,24 @@ params ["_ctrlGroup"]; private _display = uiNamespace getVariable [QGVAR(modalDisplay), displayNull]; private _ctrlEdit = _display ctrlCreate [QGVAR(RscEditMultiCode), -1, _ctrlGroup]; -_ctrlEdit ctrlSetPosition [0.1 * TMF_ADMINMENU_STD_WIDTH, 1.1 * TMF_ADMINMENU_STD_HEIGHT, _ctrlGrpWidth - (0.2 * TMF_ADMINMENU_STD_WIDTH), _ctrlGrpHeight - (2.3 * TMF_ADMINMENU_STD_HEIGHT)]; +_ctrlEdit ctrlSetPosition [0.1 * GUI_GRID_W, 1.1 * GUI_GRID_H, _ctrlGrpWidth - (0.2 * GUI_GRID_W), _ctrlGrpHeight - (2.3 * GUI_GRID_H)]; _ctrlEdit ctrlCommit 0; _ctrlEdit ctrlSetText (missionNamespace getVariable [QGVAR(utility_runcode_last), ""]); private _ctrlHintEdit = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGroup]; -_ctrlHintEdit ctrlSetPosition [0, 0, _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlHintEdit ctrlSetPosition [0, 0, _ctrlGrpWidth, GUI_GRID_H]; _ctrlHintEdit ctrlCommit 0; _ctrlHintEdit ctrlSetText "'_this' is the targetted player object"; -private _bottomY = _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT; +private _bottomY = _ctrlGrpHeight - GUI_GRID_H; private _ctrlHintCombo = _display ctrlCreate [QGVAR(RscText), -1, _ctrlGroup]; -_ctrlHintCombo ctrlSetPosition [0, _bottomY, 0.15 * _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlHintCombo ctrlSetPosition [0, _bottomY, 0.15 * _ctrlGrpWidth, GUI_GRID_H]; _ctrlHintCombo ctrlCommit 0; _ctrlHintCombo ctrlSetText "Execute on:"; private _ctrlCombo = _display ctrlCreate [QGVAR(RscCombo), -1, _ctrlGroup]; -_ctrlCombo ctrlSetPosition [0.15 * _ctrlGrpWidth, _bottomY, 0.25 * _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlCombo ctrlSetPosition [0.15 * _ctrlGrpWidth, _bottomY, 0.25 * _ctrlGrpWidth, GUI_GRID_H]; _ctrlCombo ctrlCommit 0; _ctrlCombo lbAdd "Your Client"; _ctrlCombo lbAdd "Targets' Clients"; @@ -33,7 +34,7 @@ _ctrlCombo lbAdd "All Clients and Server"; _ctrlCombo lbSetCurSel 0; private _ctrlButton = _display ctrlCreate [QGVAR(RscButtonMenu), -1, _ctrlGroup]; -_ctrlButton ctrlSetPosition [0.8 * _ctrlGrpWidth, _bottomY, 0.2 * _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlButton ctrlSetPosition [0.8 * _ctrlGrpWidth, _bottomY, 0.2 * _ctrlGrpWidth, GUI_GRID_H]; _ctrlButton ctrlCommit 0; _ctrlButton ctrlSetText "Execute"; _ctrlButton setVariable [QGVAR(association), [_ctrlEdit, _ctrlCombo]]; diff --git a/addons/adminmenu/functions/fnc_modal_teleport.sqf b/addons/adminmenu/functions/fnc_modal_teleport.sqf index 18a3b47b..e0454733 100644 --- a/addons/adminmenu/functions/fnc_modal_teleport.sqf +++ b/addons/adminmenu/functions/fnc_modal_teleport.sqf @@ -1,4 +1,5 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" disableSerialization; params ["_ctrlGroup"]; @@ -13,7 +14,7 @@ _ctrlGroup ctrlEnable false; private _display = uiNamespace getVariable [QGVAR(modalDisplay), displayNull]; private _ctrlMap = _display ctrlCreate ["RscMapControl", -1]; GVAR(utilityTabControls) pushBack _ctrlMap; -_ctrlMap ctrlSetPosition [_ctrlGrpX, _ctrlGrpY, _ctrlGrpWidth, _ctrlGrpHeight - (2.2 * TMF_ADMINMENU_STD_HEIGHT)]; +_ctrlMap ctrlSetPosition [_ctrlGrpX, _ctrlGrpY, _ctrlGrpWidth, _ctrlGrpHeight - (2.2 * GUI_GRID_H)]; _ctrlMap ctrlCommit 0; if (!isNull cameraOn) then { _ctrlMap ctrlMapAnimAdd [0, ctrlMapScale _ctrlMap, cameraOn]; @@ -126,7 +127,7 @@ _ctrlMap ctrlAddEventHandler ["draw", { private _ctrlCheckDrawAllSides = _display ctrlCreate ["RscCheckBox", -1]; GVAR(utilityTabControls) pushBack _ctrlCheckDrawAllSides; -_ctrlCheckDrawAllSides ctrlSetPosition [_ctrlGrpX, _ctrlGrpY + _ctrlGrpHeight - (2.2 * TMF_ADMINMENU_STD_HEIGHT), TMF_ADMINMENU_STD_WIDTH, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlCheckDrawAllSides ctrlSetPosition [_ctrlGrpX, _ctrlGrpY + _ctrlGrpHeight - (2.2 * GUI_GRID_H), GUI_GRID_W, GUI_GRID_H]; _ctrlCheckDrawAllSides ctrlCommit 0; _ctrlCheckDrawAllSides ctrlAddEventHandler ["CheckedChanged", { GVAR(utility_teleport_drawEnemy) = param [1]; @@ -134,14 +135,14 @@ _ctrlCheckDrawAllSides ctrlAddEventHandler ["CheckedChanged", { private _ctrlLabelDrawAllSides = _display ctrlCreate [QGVAR(RscText), -1]; GVAR(utilityTabControls) pushBack _ctrlLabelDrawAllSides; -_ctrlLabelDrawAllSides ctrlSetPosition [_ctrlGrpX + TMF_ADMINMENU_STD_WIDTH, _ctrlGrpY + _ctrlGrpHeight - (2.2 * TMF_ADMINMENU_STD_HEIGHT), (0.2 * _ctrlGrpWidth) - TMF_ADMINMENU_STD_WIDTH, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlLabelDrawAllSides ctrlSetPosition [_ctrlGrpX + GUI_GRID_W, _ctrlGrpY + _ctrlGrpHeight - (2.2 * GUI_GRID_H), (0.2 * _ctrlGrpWidth) - GUI_GRID_W, GUI_GRID_H]; _ctrlLabelDrawAllSides ctrlCommit 0; _ctrlLabelDrawAllSides ctrlSetText "Draw enemy units on map"; -//private _paradropCheckX = (ctrlPosition _ctrlLabelDrawAllSides) select 0 + ctrlTextWidth _ctrlLabelDrawAllSides + TMF_ADMINMENU_STD_WIDTH; +//private _paradropCheckX = (ctrlPosition _ctrlLabelDrawAllSides) select 0 + ctrlTextWidth _ctrlLabelDrawAllSides + GUI_GRID_W; private _ctrlCheckParadropInfantry = _display ctrlCreate ["RscCheckBox", -1]; GVAR(utilityTabControls) pushBack _ctrlCheckParadropInfantry; -_ctrlCheckParadropInfantry ctrlSetPosition [_ctrlGrpX + (0.2 * _ctrlGrpWidth), _ctrlGrpY + _ctrlGrpHeight - (2.2 * TMF_ADMINMENU_STD_HEIGHT), TMF_ADMINMENU_STD_WIDTH, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlCheckParadropInfantry ctrlSetPosition [_ctrlGrpX + (0.2 * _ctrlGrpWidth), _ctrlGrpY + _ctrlGrpHeight - (2.2 * GUI_GRID_H), GUI_GRID_W, GUI_GRID_H]; _ctrlCheckParadropInfantry ctrlCommit 0; _ctrlCheckParadropInfantry ctrlAddEventHandler ["CheckedChanged", { GVAR(utility_teleport_paradrop) = param [1]; @@ -149,19 +150,19 @@ _ctrlCheckParadropInfantry ctrlAddEventHandler ["CheckedChanged", { private _ctrlLabelParadropInfantry = _display ctrlCreate [QGVAR(RscText), -1]; GVAR(utilityTabControls) pushBack _ctrlLabelParadropInfantry; -_ctrlLabelParadropInfantry ctrlSetPosition [_ctrlGrpX + (0.2 * _ctrlGrpWidth) + TMF_ADMINMENU_STD_WIDTH, _ctrlGrpY + _ctrlGrpHeight - (2.2 * TMF_ADMINMENU_STD_HEIGHT), (0.2 * _ctrlGrpWidth) - TMF_ADMINMENU_STD_WIDTH, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlLabelParadropInfantry ctrlSetPosition [_ctrlGrpX + (0.2 * _ctrlGrpWidth) + GUI_GRID_W, _ctrlGrpY + _ctrlGrpHeight - (2.2 * GUI_GRID_H), (0.2 * _ctrlGrpWidth) - GUI_GRID_W, GUI_GRID_H]; _ctrlLabelParadropInfantry ctrlCommit 0; _ctrlLabelParadropInfantry ctrlSetText "Drop infantry in parachute"; private _ctrlHint = _display ctrlCreate [QGVAR(RscText), -1]; GVAR(utilityTabControls) pushBack _ctrlHint; -_ctrlHint ctrlSetPosition [_ctrlGrpX, _ctrlGrpY + _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT, 0.8 * _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlHint ctrlSetPosition [_ctrlGrpX, _ctrlGrpY + _ctrlGrpHeight - GUI_GRID_H, 0.8 * _ctrlGrpWidth, GUI_GRID_H]; _ctrlHint ctrlCommit 0; _ctrlHint ctrlSetText "After locating the destination area, press the Enable Teleport button and then click the desired location on the map."; private _ctrlButton = _display ctrlCreate [QGVAR(RscButtonMenu), -1]; GVAR(utilityTabControls) pushBack _ctrlButton; -_ctrlButton ctrlSetPosition [_ctrlGrpX + 0.8 * _ctrlGrpWidth, _ctrlGrpY + _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT, 0.2 * _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; +_ctrlButton ctrlSetPosition [_ctrlGrpX + 0.8 * _ctrlGrpWidth, _ctrlGrpY + _ctrlGrpHeight - GUI_GRID_H, 0.2 * _ctrlGrpWidth, GUI_GRID_H]; _ctrlButton ctrlCommit 0; _ctrlButton ctrlSetText "Enable Teleport"; _ctrlButton ctrlAddEventHandler ["buttonClick", { diff --git a/addons/adminmenu/functions/fnc_remoteControl_dialog.sqf b/addons/adminmenu/functions/fnc_remoteControl_dialog.sqf index ed4b0a1f..11b1d1c9 100644 --- a/addons/adminmenu/functions/fnc_remoteControl_dialog.sqf +++ b/addons/adminmenu/functions/fnc_remoteControl_dialog.sqf @@ -1,4 +1,5 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" disableSerialization; params ["_ctrlBackground"]; @@ -11,7 +12,7 @@ private _display = ctrlParent _ctrlBackground; private _dialogPosition = ctrlPosition _ctrlBackground; private _ctrlList = _display ctrlCreate [QGVAR(RscListBox), -1]; -_ctrlList ctrlSetPosition [(_dialogPosition # 0) + 0.1 * TMF_ADMINMENU_STD_WIDTH, (_dialogPosition # 1) + 0.1 * TMF_ADMINMENU_STD_HEIGHT, (_dialogPosition # 2) - (0.2 * TMF_ADMINMENU_STD_WIDTH), (_dialogPosition # 3) - (0.2 * TMF_ADMINMENU_STD_HEIGHT)]; +_ctrlList ctrlSetPosition [(_dialogPosition # 0) + 0.1 * GUI_GRID_W, (_dialogPosition # 1) + 0.1 * GUI_GRID_H, (_dialogPosition # 2) - (0.2 * GUI_GRID_W), (_dialogPosition # 3) - (0.2 * GUI_GRID_H)]; _ctrlList ctrlCommit 0; { private _name = _x # 1; @@ -29,7 +30,7 @@ _ctrlList lbSetCurSel 0; private _ctrlOK = _display ctrlCreate [QGVAR(RscButtonMenu), -1]; _ctrlOK ctrlSetText "Control"; -_ctrlOK ctrlSetPosition [(_dialogPosition # 0) + 0.67 * (_dialogPosition # 2), (_dialogPosition # 1) + (_dialogPosition # 3) + 0.1 * TMF_ADMINMENU_STD_HEIGHT, 0.33 * (_dialogPosition # 2), TMF_ADMINMENU_STD_HEIGHT]; +_ctrlOK ctrlSetPosition [(_dialogPosition # 0) + 0.67 * (_dialogPosition # 2), (_dialogPosition # 1) + (_dialogPosition # 3) + 0.1 * GUI_GRID_H, 0.33 * (_dialogPosition # 2), GUI_GRID_H]; _ctrlOK ctrlCommit 0; _ctrlOK setVariable [QGVAR(association), _ctrlList]; _ctrlOK ctrlAddEventHandler ["buttonClick", { @@ -42,4 +43,4 @@ _ctrlOK ctrlAddEventHandler ["buttonClick", { [_unit, true, true] call FUNC(remoteControl); GVAR(remoteControlUnits) = nil; -}]; \ No newline at end of file +}]; diff --git a/addons/adminmenu/gui/adminMenu.hpp b/addons/adminmenu/gui/adminMenu.hpp index dd3a5778..de050284 100644 --- a/addons/adminmenu/gui/adminMenu.hpp +++ b/addons/adminmenu/gui/adminMenu.hpp @@ -16,35 +16,34 @@ class RscToolbox; class RscStructuredText; class RscControlsTable; class RscMapControl; -class ScrollBar; - +class RscStandardDisplay; class GVAR(RscButtonMenu): RscButtonMenu { - style = "0x02 + 0x0C"; - font = "RobotoCondensed"; - sizeEx = TMF_ADMINMENU_STD_SIZEX_L; - size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.9)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER + ST_VCENTER; + font = GUI_FONT_NORMAL; + sizeEx = GUI_TEXT_SIZE_MEDIUM; + size = (GUI_GRID_H * 0.9); + h = 1 * GUI_GRID_H; }; class GVAR(RscText): RscText { - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = GUI_TEXT_SIZE_SMALL; }; class GVAR(RscTextLarge): RscText { - sizeEx = TMF_ADMINMENU_STD_SIZEX_L; + sizeEx = GUI_TEXT_SIZE_MEDIUM; }; class GVAR(RscSpectatorControlTableText): RscText { - sizeEx = TMF_ADMINMENU_STD_SIZEX; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + h = 1 * GUI_GRID_H; w = (6/10) * TMF_ADMINMENU_RESP_W_COL1; x = 0; y = 0; }; class GVAR(RscTextMultiline): GVAR(RscText) { - style = "0x00 + 0x10 + 0x0200"; + style = ST_LEFT + ST_MULTI + ST_NO_RECT; lineSpacing = 1; }; @@ -53,152 +52,135 @@ class GVAR(RscEditMultiCode): RscEditMulti { }; class GVAR(RscCombo): RscCombo { - font = "RobotoCondensed"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + font = GUI_FONT_NORMAL; + sizeEx = GUI_TEXT_SIZE_SMALL; }; class GVAR(RscTextIcon): RscText { - style = 48 + 2048; - type = 0; + style = ST_PICTURE + ST_KEEP_ASPECT_RATIO; + type = CT_STATIC; }; class GVAR(RscListBox): RscListBox { - font = "RobotoCondensed"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + font = GUI_FONT_NORMAL; + sizeEx = GUI_TEXT_SIZE_SMALL; }; class GVAR(RscListNBox): RscListNBox { - font = "RobotoCondensed"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + font = GUI_FONT_NORMAL; + sizeEx = GUI_TEXT_SIZE_SMALL; }; -class ADDON -{ +class ADDON: RscStandardDisplay { idd = IDD_TMF_ADMINMENU; - movingEnable = 0; - enableDisplay = 1; - enableSimulation = 1; onLoad = QUOTE(_this call FUNC(onLoad);); onUnload = QUOTE(_this call FUNC(onUnload);); - class Controls - { - class Title: RscTitle - { + class Controls { + class Title: RscTitle { idc = -1; text = "TMF Admin Menu"; - style = 0; + style = ST_SINGLE; + moving = true; colorBackground[] = {0, 0, 0, 0}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 1 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 15 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class TitleFPS: Title - { + class TitleFPS: Title { idc = IDC_TMF_ADMINMENU_FPS; text = ""; - style = 1; - x = "16 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - w = "23 * (((safezoneW / safezoneH) min 1.2) / 40)"; + style = ST_RIGHT; + x = 16 * GUI_GRID_W + GUI_GRID_CENTER_X; + w = 23 * GUI_GRID_W; }; // Buttons for Tabs - class TabDashboard: RscButtonMenu - { + class TabDashboard: RscButtonMenu { idc = IDC_TMF_ADMINMENU_DASH; text = "Dashboard"; tooltip = ""; onButtonClick = QUOTE([ARR_2(ctrlParent param [0],IDC_TMF_ADMINMENU_G_DASH)] call FUNC(selectTab)); colorBackground[] = {0, 0, 0, 0}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "5.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 1 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 2.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 5.8 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class TabPlayerManagement: TabDashboard - { + class TabPlayerManagement: TabDashboard { idc = IDC_TMF_ADMINMENU_PMAN; text = "Player Management"; tooltip = "Perform actions on players"; onButtonClick = QUOTE([ARR_2(ctrlParent param [0],IDC_TMF_ADMINMENU_G_PMAN)] call FUNC(selectTab)); - x = "6.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - w = "9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 6.9 * GUI_GRID_W + GUI_GRID_CENTER_X; + w = 9 * GUI_GRID_W; }; - class TabRespawnPlayers: TabDashboard - { + class TabRespawnPlayers: TabDashboard { idc = IDC_TMF_ADMINMENU_RESP; text = "Respawn"; tooltip = "Respawn dead players back in the game"; onButtonClick = QUOTE([ARR_2(ctrlParent param [0],IDC_TMF_ADMINMENU_G_RESP)] call FUNC(selectTab)); - x = "16 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - w = "4.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 16 * GUI_GRID_W + GUI_GRID_CENTER_X; + w = 4.8 * GUI_GRID_W; }; - class TabEndMission: TabDashboard - { + class TabEndMission: TabDashboard { idc = IDC_TMF_ADMINMENU_ENDM; text = "End Mission"; tooltip = "Select and execute a mission ending"; onButtonClick = QUOTE([ARR_2(ctrlParent param [0],IDC_TMF_ADMINMENU_G_ENDM)] call FUNC(selectTab)); - x = "20.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - w = "5.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 20.9 * GUI_GRID_W + GUI_GRID_CENTER_X; + w = 5.9 * GUI_GRID_W; }; - class TabMessageLog: TabDashboard - { + class TabMessageLog: TabDashboard { idc = IDC_TMF_ADMINMENU_MSGS; text = "Logs"; tooltip = "Status and debug messages from TMF components"; onButtonClick = QUOTE([ARR_2(ctrlParent param [0],IDC_TMF_ADMINMENU_G_MSGS)] call FUNC(selectTab)); - x = "26.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 26.9 * GUI_GRID_W + GUI_GRID_CENTER_X; + w = 3 * GUI_GRID_W; }; // Groups for Tabs - class GroupBase: RscControlsGroup - { - x = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "0"; - h = "0"; + class GroupBase: RscControlsGroup { + x = 1.1 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 3.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 0; + h = 0; class Controls {}; }; - class GroupDashboard: GroupBase - { + class GroupDashboard: GroupBase { idc = IDC_TMF_ADMINMENU_G_DASH; w = TMF_GROUPBASE_W; h = TMF_GROUPBASE_H; #include "dashboard.hpp" }; - class GroupPlayerManagement: GroupBase - { + class GroupPlayerManagement: GroupBase { idc = IDC_TMF_ADMINMENU_G_PMAN; w = TMF_GROUPBASE_W; h = TMF_GROUPBASE_H; #include "playerManagement.hpp" }; - class GroupRespawn: GroupBase - { + class GroupRespawn: GroupBase { idc = IDC_TMF_ADMINMENU_G_RESP; w = TMF_GROUPBASE_W; h = TMF_GROUPBASE_H; #include "respawn.hpp" }; - class GroupEndMission: GroupBase - { + class GroupEndMission: GroupBase { idc = IDC_TMF_ADMINMENU_G_ENDM; w = TMF_GROUPBASE_W; h = TMF_GROUPBASE_H; #include "endMission.hpp" }; - class GroupMessageLog: GroupBase - { + class GroupMessageLog: GroupBase { idc = IDC_TMF_ADMINMENU_G_MSGS; w = TMF_GROUPBASE_W; h = TMF_GROUPBASE_H; @@ -206,55 +188,48 @@ class ADDON }; // Utility Tab - class UtilityTitleBackground: RscText - { + class UtilityTitleBackground: RscText { idc = IDC_TMF_ADMINMENU_UTIL_TBACK; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = GUI_BCG_COLOR; + x = 1 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 3.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 38 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class UtilityTitle: RscTitle - { + class UtilityTitle: RscTitle { idc = IDC_TMF_ADMINMENU_UTIL_TITLE; text = "Utility Title"; - style = 0; + style = ST_SINGLE; colorBackground[] = {0, 0, 0, 0}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 1 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 3.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 38 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class UtilityGroup: GroupBase - { + class UtilityGroup: GroupBase { idc = IDC_TMF_ADMINMENU_G_UTIL; - y = "4.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "37.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "19.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 4.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 37.8 * GUI_GRID_W; + h = 19.6 * GUI_GRID_H; }; }; - class ControlsBackground - { - class TitleBackground: RscText - { - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + class ControlsBackground { + class TitleBackground: RscText { + colorBackground[] = GUI_BCG_COLOR; + x = 1 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 38 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class TabsBackgroundLeft: TitleBackground - { + class TabsBackgroundLeft: TitleBackground { colorBackground[] = {0, 0, 0, 1}; - y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 2.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class MainBackground: TitleBackground - { + class MainBackground: TitleBackground { colorBackground[] = {0, 0, 0, 0.7}; - y = "3.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - h = "20.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 3.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; + h = 20.8 * GUI_GRID_H; }; }; }; @@ -263,18 +238,15 @@ class ADDON -class GVAR(respawnMapDialog) { +class GVAR(respawnMapDialog): RscStandardDisplay { idd = IDC_TMF_ADMINMENU_RESP_MAP_DISPLAY; - movingEnable = 0; - class controlsBackground { - }; - class objects { - }; + movingEnable = false; + class controlsBackground {}; + class objects {}; class controls { - class FullRespawnMap : RscMapControl - { + class FullRespawnMap : RscMapControl { idc = IDC_TMF_ADMINMENU_RESP_MAP_CONTROL; - type = 100; + type = CT_MAP; x = 0 * safezoneW + safezoneX; y = 0 * safezoneH + safezoneY; w = 1 * safezoneW; @@ -288,18 +260,15 @@ class GVAR(respawnMapDialog) { }; -class GVAR(adminEyeDialog) { +class GVAR(adminEyeDialog): RscStandardDisplay { idd = IDC_TMF_ADMINMENU_ADME_MAP_DISPLAY; - movingEnable = 0; - class controlsBackground { - }; - class objects { - }; + movingEnable = false; + class controlsBackground {}; + class objects {}; class controls { - class FullRespawnMap : RscMapControl - { + class FullRespawnMap : RscMapControl { idc = IDC_TMF_ADMINMENU_ADME_MAP_CONTROL; - type = 100; + type = CT_MAP; x = 0 * safezoneW + safezoneX; y = 0 * safezoneH + safezoneY; w = 1 * safezoneW; @@ -313,28 +282,28 @@ class GVAR(adminEyeDialog) { }; -class GVAR(spectatorControlUnitDialog) { +class GVAR(spectatorControlUnitDialog): RscStandardDisplay { idd = -1; - movingEnable = 0; class Controls {}; class ControlsBackground { class Title: RscTitle { idc = -1; text = "Select Unit in Vehicle"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "19 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; + moving = true; + x = 1 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 19 * GUI_GRID_W; + h = 1 * GUI_GRID_H; + colorBackground[] = GUI_BCG_COLOR; shadow = 1; - style = 0; + style = ST_SINGLE; }; class Background: RscText { onLoad = QUOTE(_this call FUNC(remoteControl_dialog)); - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "19 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "16 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 1 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 2.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 19 * GUI_GRID_W; + h = 16 * GUI_GRID_H; colorBackground[] = {0,0,0,0.7}; }; }; diff --git a/addons/adminmenu/gui/dashboard.hpp b/addons/adminmenu/gui/dashboard.hpp index 639efde6..fc96e452 100644 --- a/addons/adminmenu/gui/dashboard.hpp +++ b/addons/adminmenu/gui/dashboard.hpp @@ -1,104 +1,91 @@ -class Controls -{ +class Controls { // Shortcuts - class LabelShortcuts: RscText - { + class LabelShortcuts: RscText { text = "Shortcuts"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "0"; - y = "0"; - w = "7 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class ButtonDebugConsole: GVAR(RscButtonMenu) - { + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 0; + y = 0; + w = 7 * GUI_GRID_W; + h = 1 * GUI_GRID_H; + }; + class ButtonDebugConsole: GVAR(RscButtonMenu) { idc = IDC_TMF_ADMINMENU_DASH_DEBUGCON; text = "Debug Console"; onButtonClick = "(ctrlParent param [0]) closeDisplay 1; createDialog 'RscDisplayDebugPublic';"; - x = "0"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "7 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 0; + y = 1.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 7 * GUI_GRID_W; }; - class ButtonClaimZeus: ButtonDebugConsole - { + class ButtonClaimZeus: ButtonDebugConsole { idc = IDC_TMF_ADMINMENU_DASH_CLAIMZEUS; text = "Claim Zeus"; onButtonClick = QUOTE(call FUNC(claimZeus)); - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 2.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class ButtonCamera: ButtonDebugConsole - { + class ButtonCamera: ButtonDebugConsole { idc = IDC_TMF_ADMINMENU_DASH_CAMERA; text = "Camera"; onButtonClick = "(ctrlParent param [0]) closeDisplay 1; [] spawn BIS_fnc_camera;"; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 3.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class ButtonArsenal: ButtonDebugConsole - { + class ButtonArsenal: ButtonDebugConsole { idc = IDC_TMF_ADMINMENU_DASH_ARSENAL; text = "Arsenal"; tooltip = "ACE Arsenal. Hold Shift to open vanilla Arsenal."; onButtonClick = ""; onMouseButtonClick = "if (player isKindOf 'CAManBase' && alive player) then {(ctrlParent param [0]) closeDisplay 1; if (!param [4]) then {[player, player, true] call ACE_arsenal_fnc_openBox;} else {['Open', true] spawn BIS_fnc_arsenal;};} else {systemChat '[TMF Admin Menu] Player object not compatible with Arsenal';};"; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 4.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class TabAdminEye: ButtonDebugConsole - { + class TabAdminEye: ButtonDebugConsole { idc = IDC_TMF_ADMINMENU_ADME; text = "Map"; tooltip = "View Admin Map"; onButtonClick = QUOTE([] call FUNC(adminEye_open)); - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 5.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; // Safestart - class LabelSafestart: LabelShortcuts - { + class LabelSafestart: LabelShortcuts { text = "Safestart"; - y = "6.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 6.8 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class CheckboxSafestartEnabled: RscCheckBox - { + class CheckboxSafestartEnabled: RscCheckBox { idc = IDC_TMF_ADMINMENU_DASH_SAFESTART; - x = "0.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "7.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 0.1 * GUI_GRID_W; + y = 7.7 * GUI_GRID_H; + w = 1 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class LabelSafestartEnabled: LabelShortcuts - { + class LabelSafestartEnabled: LabelShortcuts { idc = -1; text = "Enabled"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = GUI_TEXT_SIZE_SMALL; colorText[] = {0.8, 0.8, 0.8, 1}; - x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "7.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "5.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 0.9 * GUI_GRID_W; + y = 7.7 * GUI_GRID_H; + w = 5.8 * GUI_GRID_W; }; // Toggle Spectator Talk - class LabelSpectatorTalk: LabelShortcuts - { + class LabelSpectatorTalk: LabelShortcuts { text = "Talk with Spectators"; - y = "9.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 9.0 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class CheckboxSpectatorTalkEnabled: RscCheckBox - { + class CheckboxSpectatorTalkEnabled: RscCheckBox { idc = IDC_TMF_ADMINMENU_DASH_SPECTATORTALK; - x = "0.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "9.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 0.1 * GUI_GRID_W; + y = 9.9 * GUI_GRID_H; + w = 1 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class LabelSpectatorTalkEnabled: LabelShortcuts - { + class LabelSpectatorTalkEnabled: LabelShortcuts { idc = -1; text = "Enabled"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = GUI_TEXT_SIZE_SMALL; colorText[] = {0.8, 0.8, 0.8, 1}; - x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "9.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "5.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 0.9 * GUI_GRID_W; + y = 9.9 * GUI_GRID_H; + w = 5.8 * GUI_GRID_W; }; @@ -106,118 +93,101 @@ class Controls #include "dashboard_table.hpp" // General stats, center bottom - class LabelInformation: RscText - { + class LabelInformation: RscText { text = "General Information"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "8.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "7 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class StatsLabel_Vehicles: RscText - { + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 8 * GUI_GRID_W; + y = 8.7 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 7 * GUI_GRID_W; + h = 1 * GUI_GRID_H; + }; + class StatsLabel_Vehicles: RscText { text = "Vehicles"; colorBackground[] = {1, 1, 1, 0.2}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "9.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class StatsValue_Vehicles: StatsLabel_Vehicles - { + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 8 * GUI_GRID_W; + y = 9.8 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 4.5 * GUI_GRID_W; + h = 1 * GUI_GRID_H; + }; + class StatsValue_Vehicles: StatsLabel_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_VEHICLES; text = "0"; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - x = "12.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "8.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 12.6 * GUI_GRID_W; + w = 8.8 * GUI_GRID_W; }; - class StatsLabel_DeadUnits: StatsLabel_Vehicles - { + class StatsLabel_DeadUnits: StatsLabel_Vehicles { text = "Dead Units"; - y = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 10.9 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class StatsValue_DeadUnits: StatsValue_Vehicles - { + class StatsValue_DeadUnits: StatsValue_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_DEADMEN; text = "0"; - y = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 10.9 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class StatsLabel_HeadlessClients: StatsLabel_Vehicles - { + class StatsLabel_HeadlessClients: StatsLabel_Vehicles { text = "AI Load Balance"; tooltip = "The number of groups being run on the server and each HC."; - y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 12 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class StatsValue_HeadlessClients: StatsValue_Vehicles - { + class StatsValue_HeadlessClients: StatsValue_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_HEADLESS; text = "0"; - y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 12 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class StatsLabel_Curators: StatsLabel_Vehicles - { + class StatsLabel_Curators: StatsLabel_Vehicles { text = "Zeuses"; - y = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 13.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class StatsValue_Curators: StatsValue_Vehicles - { + class StatsValue_Curators: StatsValue_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_CURATORS; text = "0"; - y = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 13.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class StatsLabel_CurrentAdmin: StatsLabel_Vehicles - { + class StatsLabel_CurrentAdmin: StatsLabel_Vehicles { text = "Current Admin"; - y = "14.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 14.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class StatsValue_CurrentAdmin: StatsValue_Vehicles - { + class StatsValue_CurrentAdmin: StatsValue_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_CURRADMIN; text = "no data"; - y = "14.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 14.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class StatsLabel_MissionRuntime: StatsLabel_Vehicles - { + class StatsLabel_MissionRuntime: StatsLabel_Vehicles { text = "Mission Runtime"; - y = "15.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 15.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class StatsValue_MissionRuntime: StatsValue_Vehicles - { + class StatsValue_MissionRuntime: StatsValue_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_RUNTIME; text = "18m 37s"; - y = "15.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 15.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; // Mission maker's notes, right - class LabelMissionNotes: RscText - { + class LabelMissionNotes: RscText { text = "Mission Maker's Notes"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "22.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0"; - w = "15.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class GroupMissionNotes: RscControlsGroup - { + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 22.4 * GUI_GRID_W; + y = 0; + w = 15.4 * GUI_GRID_W; + h = 1 * GUI_GRID_H; + }; + class GroupMissionNotes: RscControlsGroup { idc = IDC_TMF_ADMINMENU_G_DASH_MISSIONNOTES; - x = "22.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "15.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - class Controls - { - class TextMissionNotes: RscStructuredText - { + x = 22.4 * GUI_GRID_W; + y = 1.1 * GUI_GRID_H; + w = 15.4 * GUI_GRID_W; + h = 19.5 * GUI_GRID_H; + class Controls { + class TextMissionNotes: RscStructuredText { idc = IDC_TMF_ADMINMENU_DASH_MISSIONNOTES; - size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "0"; - y = "0"; - w = "14.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; // Margin for vertical scrollbar - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = GUI_TEXT_SIZE_SMALL; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 0; + y = 0; + w = 14.9 * GUI_GRID_W; // Margin for vertical scrollbar + h = 1 * GUI_GRID_H; }; }; }; diff --git a/addons/adminmenu/gui/dashboard_table.hpp b/addons/adminmenu/gui/dashboard_table.hpp index f91b0c2a..af2dad42 100644 --- a/addons/adminmenu/gui/dashboard_table.hpp +++ b/addons/adminmenu/gui/dashboard_table.hpp @@ -1,11 +1,11 @@ class LabelUnitStats: RscText { text = "Statistics"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0"; - w = "13.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 8 * GUI_GRID_W; + y = 0; + w = 13.4 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; // Header @@ -13,217 +13,220 @@ class UnitStats_SideBackground: RscText { text = ""; colorBackground[] = {1, 1, 1, 0.2}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 8 * GUI_GRID_W; + y = 1.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 1 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; class UnitStats_AI: UnitStats_SideBackground { text = "AI"; - x = "9.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 9.1 * GUI_GRID_W; + w = 2 * GUI_GRID_W; }; class UnitStats_Players: UnitStats_AI { text = "Players"; - x = "11.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 11.2 * GUI_GRID_W; + w = 3 * GUI_GRID_W; }; class UnitStats_Spectators: UnitStats_AI { text = "Spectators"; - x = "14.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "4 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 14.3 * GUI_GRID_W; + w = 4 * GUI_GRID_W; }; class UnitStats_Total: UnitStats_AI { text = "Total"; - x = "18.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 18.4 * GUI_GRID_W; + w = 3 * GUI_GRID_W; }; // Blufor class UnitStats_SideBackground_Blufor: UnitStats_SideBackground { colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 2.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_SideIcon_Blufor: RscPicture { - style = 48 + 2048; // picture + keep aspect ratio - text = "\a3\ui_f\data\GUI\Rsc\RscDisplayMultiplayerSetup\flag_indep_ca.paa"; - colorText[] = {"(profilenamespace getvariable ['Map_BLUFOR_R',0])", "(profilenamespace getvariable ['Map_BLUFOR_G',0])", "(profilenamespace getvariable ['Map_BLUFOR_B',1])", 0.8}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "2.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_PICTURE + ST_KEEP_ASPECT_RATIO; + text = flag_west; + colorText[] = Map_BLUFOR_RGBA; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 8 * GUI_GRID_W; + y = 2.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 1 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; class UnitStats_AI_Blufor: UnitStats_AI { idc = IDC_TMF_ADMINMENU_DASH_STATS_BLUFOR_AI; text = ""; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 2.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Players_Blufor: UnitStats_Players { idc = IDC_TMF_ADMINMENU_DASH_STATS_BLUFOR_PLAYERS; text = ""; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 2.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Spectators_Blufor: UnitStats_Spectators { idc = IDC_TMF_ADMINMENU_DASH_STATS_BLUFOR_SPECTATORS; text = ""; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 2.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Total_Blufor: UnitStats_Total { idc = IDC_TMF_ADMINMENU_DASH_STATS_BLUFOR_TOTAL; text = ""; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 2.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; // Opfor class UnitStats_SideBackground_Opfor: UnitStats_SideBackground { colorBackground[] = {1, 1, 1, 0.1}; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 3.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_SideIcon_Opfor: UnitStats_SideIcon_Blufor { - colorText[] = {"(profilenamespace getvariable ['Map_OPFOR_R',1])", "(profilenamespace getvariable ['Map_OPFOR_G',0])", "(profilenamespace getvariable ['Map_OPFOR_B',0])", 0.8}; - y = "3.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = flag_east; + colorText[] = Map_OPFOR_RGBA; + y = 3.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_AI_Opfor: UnitStats_AI { idc = IDC_TMF_ADMINMENU_DASH_STATS_OPFOR_AI; text = ""; colorBackground[] = {1, 1, 1, 0.1}; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 3.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Players_Opfor: UnitStats_Players { idc = IDC_TMF_ADMINMENU_DASH_STATS_OPFOR_PLAYERS; text = ""; colorBackground[] = {1, 1, 1, 0.1}; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 3.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Spectators_Opfor: UnitStats_Spectators { idc = IDC_TMF_ADMINMENU_DASH_STATS_OPFOR_SPECTATORS; text = ""; colorBackground[] = {1, 1, 1, 0.1}; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 3.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Total_Opfor: UnitStats_Total { idc = IDC_TMF_ADMINMENU_DASH_STATS_OPFOR_TOTAL; text = ""; colorBackground[] = {1, 1, 1, 0.1}; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 3.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; // Indep class UnitStats_SideBackground_Indep: UnitStats_SideBackground_Blufor { - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 4.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_SideIcon_Indep: UnitStats_SideIcon_Blufor { - colorText[] = {"(profilenamespace getvariable ['Map_Independent_R',0])", "(profilenamespace getvariable ['Map_Independent_G',1])", "(profilenamespace getvariable ['Map_Independent_B',0])", 0.8}; - y = "4.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = flag_guer; + colorText[] = Map_Independent_RGBA; + y = 4.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_AI_Indep: UnitStats_AI_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_INDEP_AI; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 4.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Players_Indep: UnitStats_Players_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_INDEP_PLAYERS; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 4.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Spectators_Indep: UnitStats_Spectators_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_INDEP_SPECTATORS; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 4.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Total_Indep: UnitStats_Total_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_INDEP_TOTAL; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 4.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; // Civilian class UnitStats_SideBackground_Civilian: UnitStats_SideBackground_Opfor { - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 5.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_SideIcon_Civilian: UnitStats_SideIcon_Blufor { - colorText[] = {"(profilenamespace getvariable ['Map_Civilian_R',0.5])", "(profilenamespace getvariable ['Map_Civilian_G',0])", "(profilenamespace getvariable ['Map_Civilian_B',0.5])", 0.8}; - y = "5.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = flag_civl; + colorText[] = Map_Civilian_RGBA; + y = 5.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_AI_Civilian: UnitStats_AI_Opfor { idc = IDC_TMF_ADMINMENU_DASH_STATS_CIV_AI; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 5.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Players_Civilian: UnitStats_Players_Opfor { idc = IDC_TMF_ADMINMENU_DASH_STATS_CIV_PLAYERS; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 5.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Spectators_Civilian: UnitStats_Spectators_Opfor { idc = IDC_TMF_ADMINMENU_DASH_STATS_CIV_SPECTATORS; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 5.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Total_Civilian: UnitStats_Total_Opfor { idc = IDC_TMF_ADMINMENU_DASH_STATS_CIV_TOTAL; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 5.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; // Total class UnitStats_SideBackground_Total: UnitStats_SideBackground_Blufor { - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 6.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_SideIcon_Total: RscText { - style = 2; // Center + style = ST_CENTER; text = "*"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 8 * GUI_GRID_W; + y = 6.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 1 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; class UnitStats_AI_Total: UnitStats_AI_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_TOTAL_AI; - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 6.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Players_Total: UnitStats_Players_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_TOTAL_PLAYERS; - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 6.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Spectators_Total: UnitStats_Spectators_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_TOTAL_SPECTATORS; - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 6.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class UnitStats_Total_Total: UnitStats_Total_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_TOTAL_TOTAL; - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 6.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; diff --git a/addons/adminmenu/gui/endMission.hpp b/addons/adminmenu/gui/endMission.hpp index 7df15d4e..409bb268 100644 --- a/addons/adminmenu/gui/endMission.hpp +++ b/addons/adminmenu/gui/endMission.hpp @@ -4,45 +4,45 @@ class Controls { idc = IDC_TMF_ADMINMENU_ENDM_FROMMISSION; onCheckedChanged = QUOTE([ARR_2(ctrlParent (param [0]), ctrlIDC (param [0]))] call FUNC(endMission_occluder);); - x = "0"; - y = "0"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 0; + y = 0; + w = 1 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; class LabelEndings: RscText { idc = -1; text = "Use Ending from Mission"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "1.0 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0"; - w = "23.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 1.0 * GUI_GRID_W; + y = 0; + w = 23.2 * GUI_GRID_W; + h = 1.0 * GUI_GRID_H; }; class ListEndings: RscListBox { idc = IDC_TMF_ADMINMENU_ENDM_LIST; tooltip = "These endings are present in the mission"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "0"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "24.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "12.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 0; + y = 1.1 * GUI_GRID_H; + w = 24.2 * GUI_GRID_W; + h = 12.9 * GUI_GRID_H; }; class CheckboxMissionEndingDefeat: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_FROMMISSION_ISDEFEAT; onCheckedChanged = ""; - x = "0"; - y = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 0; + y = 14 * GUI_GRID_H; }; class LabelMissionEndingDefeat: LabelEndings { text = "Mission is a Defeat (determines music played)"; colorText[] = {0.8, 0.8, 0.8, 1}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "23.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 1 * GUI_GRID_W; + y = 14 * GUI_GRID_H; + w = 23.2 * GUI_GRID_W; }; class ButtonEndMission: GVAR(RscButtonMenu) @@ -51,26 +51,26 @@ class Controls text = "End Mission"; colorBackground[] = {0.8,0.27,0.133,1}; onButtonClick = QUOTE((ctrlParent (param [0])) call FUNC(endMission_commit)); - x = "32.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "5.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 32.3 * GUI_GRID_W; + y = 19.5 * GUI_GRID_H; + w = 5.5 * GUI_GRID_W; }; class CheckboxExportAAR: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_EXPORTAAR; onCheckedChanged = ""; - x = "32.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "18.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 32.3 * GUI_GRID_W; + y = 18.4 * GUI_GRID_H; }; class LabelExportAAR: LabelEndings { idc = -1; text = "Export AAR"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = GUI_TEXT_SIZE_SMALL; colorText[] = {0.8, 0.8, 0.8, 1}; - x = "33.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "18.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 33.3 * GUI_GRID_W; + y = 18.4 * GUI_GRID_H; + w = 4.5 * GUI_GRID_W; }; class ButtonActivateHunt: GVAR(RscButtonMenu) { @@ -78,51 +78,51 @@ class Controls text = "Activate AI Hunt"; onButtonClick = QUOTE([] call FUNC(endMission_hunt)); colorBackground[] = {0, 0, 0, 1}; - x = "25.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "7 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 25.2 * GUI_GRID_W; + y = 19.5 * GUI_GRID_H; + w = 7 * GUI_GRID_W; }; class CheckboxUseSideSpecificEnding: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_SIDESPECIFIC; onCheckedChanged = QUOTE([ARR_2(ctrlParent (param [0]), ctrlIDC (param [0]))] call FUNC(endMission_occluder);); - x = "25.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 25.2 * GUI_GRID_W; }; class LabelEndingsGenericSide: LabelEndings { text = "Use Side-Specific Endings"; - x = "26.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "11.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 26.2 * GUI_GRID_W; + w = 11.6 * GUI_GRID_W; }; class IconSide_Blufor: RscPicture { - style = 48 + 2048; // picture + keep aspect ratio - text = "\a3\ui_f\data\GUI\Rsc\RscDisplayMultiplayerSetup\flag_indep_ca.paa"; - colorText[] = {"(profilenamespace getvariable ['Map_BLUFOR_R',0])", "(profilenamespace getvariable ['Map_BLUFOR_G',0])", "(profilenamespace getvariable ['Map_BLUFOR_B',1])", 0.8}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "24.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "1.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_PICTURE + ST_KEEP_ASPECT_RATIO; + text = flag_west; + colorText[] = Map_BLUFOR_RGBA; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 24.9 * GUI_GRID_W; + y = 1.0 * GUI_GRID_H; + w = 1.3 * GUI_GRID_W; + h = 1.3 * GUI_GRID_H; }; class LabelSide_Blufor: RscText { idc = -1; text = "BLUFOR"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "25.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "11.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 25.9 * GUI_GRID_W; + y = 1.1 * GUI_GRID_H; + w = 11.6 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; class EndingSide_Blufor: RscToolbox { idc = IDC_TMF_ADMINMENU_ENDM_BLUFOR; onToolBoxSelChanged = QUOTE(GVAR(DOUBLES(ending,blufor)) = param [1];); - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = GUI_TEXT_SIZE_SMALL; rows = 1; columns = 2; strings[] = {"Defeat", "Victory"}; @@ -137,157 +137,160 @@ class Controls colorSelectedBg[] = {1, 1, 1, 0.2}; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - x = "25.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "12.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 25.2 * GUI_GRID_W; + y = 2.2 * GUI_GRID_H; + w = 12.6 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; class IconSide_Opfor: IconSide_Blufor { - colorText[] = {"(profilenamespace getvariable ['Map_OPFOR_R',1])", "(profilenamespace getvariable ['Map_OPFOR_G',0])", "(profilenamespace getvariable ['Map_OPFOR_B',0])", 0.8}; - y = "3.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = flag_east; + colorText[] = Map_OPFOR_RGBA; + y = 3.4 * GUI_GRID_H; }; class LabelSide_Opfor: LabelSide_Blufor { text = "OPFOR"; - y = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 3.5 * GUI_GRID_H; }; class EndingSide_Opfor: EndingSide_Blufor { idc = IDC_TMF_ADMINMENU_ENDM_OPFOR; onToolBoxSelChanged = QUOTE(GVAR(DOUBLES(ending,opfor)) = param [1];); - y = "4.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 4.6 * GUI_GRID_H; }; class IconSide_Indep: IconSide_Blufor { - colorText[] = {"(profilenamespace getvariable ['Map_Independent_R',0])", "(profilenamespace getvariable ['Map_Independent_G',1])", "(profilenamespace getvariable ['Map_Independent_B',0])", 0.8}; - y = "5.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = flag_guer; + colorText[] = Map_Independent_RGBA; + y = 5.8 * GUI_GRID_H; }; class LabelSide_Indep: LabelSide_Blufor { text = "Independent"; - y = "5.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 5.9 * GUI_GRID_H; }; class EndingSide_Indep: EndingSide_Blufor { idc = IDC_TMF_ADMINMENU_ENDM_INDEP; onToolBoxSelChanged = QUOTE(GVAR(DOUBLES(ending,resistance)) = param [1];); - y = "7.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 7.0 * GUI_GRID_H; }; class IconSide_Civilian: IconSide_Blufor { - colorText[] = {"(profilenamespace getvariable ['Map_Civilian_R',0.5])", "(profilenamespace getvariable ['Map_Civilian_G',0])", "(profilenamespace getvariable ['Map_Civilian_B',0.5])", 0.8}; - y = "8.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = flag_civl; + colorText[] = Map_Civilian_RGBA; + y = 8.2 * GUI_GRID_H; }; class LabelSide_Civilian: LabelSide_Blufor { text = "Civilian"; - y = "8.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 8.3 * GUI_GRID_H; }; class EndingSide_Civilian: EndingSide_Blufor { idc = IDC_TMF_ADMINMENU_ENDM_CIVILIAN; onToolBoxSelChanged = QUOTE(GVAR(DOUBLES(ending,civilian)) = param [1];); - y = "9.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 9.4 * GUI_GRID_H; }; class CheckboxEndingSideDraw: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_SIDEDRAW; onCheckedChanged = ""; - x = "25.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "11.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 25.2 * GUI_GRID_W; + y = 11.0 * GUI_GRID_H; }; class LabelEndingSideDraw: LabelExportAAR { text = "Mission is a Draw (ignores above options)"; - x = "26.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "11.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "11.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 26.2 * GUI_GRID_W; + y = 11.0 * GUI_GRID_H; + w = 11.6 * GUI_GRID_W; }; class CheckboxUseCustomEnding: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_CUSTOM; onCheckedChanged = QUOTE([ARR_2(ctrlParent (param [0]), ctrlIDC (param [0]))] call FUNC(endMission_occluder);); - y = "16.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 16.1 * GUI_GRID_H; }; class LabelCustomEnding: LabelEndings { text = "Use Custom Ending"; - y = "16.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 16.1 * GUI_GRID_H; }; class LabelCustomEndingTitle: LabelExportAAR { text = "Title"; - x = "0"; - y = "17.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "2.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 0; + y = 17.2 * GUI_GRID_H; + w = 2.4 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; class TextfieldCustomEndingTitle: RscEdit { idc = IDC_TMF_ADMINMENU_ENDM_CUSTOM_TITLE; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; colorBorder[] = {1, 1, 1, 0.33}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "2.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "17.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "10.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 2.4 * GUI_GRID_W; + y = 17.2 * GUI_GRID_H; + w = 10.9 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; class LabelCustomEndingSubtext: LabelCustomEndingTitle { text = "Subtext"; - y = "18.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 18.3 * GUI_GRID_H; }; class TextfieldCustomEndingSubtext: TextfieldCustomEndingTitle { idc = IDC_TMF_ADMINMENU_ENDM_CUSTOM_SUBTEXT; - y = "18.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 18.3 * GUI_GRID_H; }; class CheckboxCustomEndingDefeat: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_CUSTOM_ISDEFEAT; onCheckedChanged = ""; - x = "0"; - y = "19.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 0; + y = 19.4 * GUI_GRID_H; }; class LabelCustomEndingDefeat: LabelExportAAR { text = "Mission is a Defeat (determines music played)"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "19.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "23.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 1 * GUI_GRID_W; + y = 19.4 * GUI_GRID_H; + w = 23.2 * GUI_GRID_W; }; class OccluderLeftUp: RscText { idc = IDC_TMF_ADMINMENU_ENDM_OCCLUDER_LU; colorBackground[] = {0, 0, 0, 0.75}; - style = "0x02"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "0"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "24.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 0; + y = 1.1 * GUI_GRID_H; + w = 24.2 * GUI_GRID_W; + h = 14 * GUI_GRID_H; }; class OccluderLeftDown: OccluderLeftUp { idc = IDC_TMF_ADMINMENU_ENDM_OCCLUDER_LD; - y = "17.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "24.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = 17.2 * GUI_GRID_H; + w = 24.2 * GUI_GRID_W; + h = 3.2 * GUI_GRID_H; }; class OccluderRight: OccluderLeftUp { idc = IDC_TMF_ADMINMENU_ENDM_OCCLUDER_R; - x = "25.15 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "12.65 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 25.15 * GUI_GRID_W; + y = 1.1 * GUI_GRID_H; + w = 12.65 * GUI_GRID_W; + h = 10.9 * GUI_GRID_H; }; }; diff --git a/addons/adminmenu/gui/messageLog.hpp b/addons/adminmenu/gui/messageLog.hpp index a32df21a..1787328e 100644 --- a/addons/adminmenu/gui/messageLog.hpp +++ b/addons/adminmenu/gui/messageLog.hpp @@ -7,19 +7,19 @@ class Controls w = TMF_ADMINMENU_MSGS_W_LIST; h = TMF_ADMINMENU_MSGS_H_LIST; colorBackground[] = {0, 0, 0, 0.3}; - style = "0x02"; + style = ST_CENTER; }; class ListMessages: RscListBox { idc = IDC_TMF_ADMINMENU_MSGS_LIST; //style = 32 + 16; // LB_MULTI + ST_MULTI - sizeEx = TMF_ADMINMENU_STD_SIZEX; - sizeEx2 = TMF_ADMINMENU_STD_SIZEX; + sizeEx = GUI_TEXT_SIZE_SMALL; + sizeEx2 = GUI_TEXT_SIZE_SMALL; pictureColor[] = {1,1,1,1}; // Picture color pictureColorSelect[] = {1,1,1,1}; // Selected picture color pictureColorDisabled[] = {1,1,1,1}; // Disabled picture color - rowHeight = TMF_ADMINMENU_STD_HEIGHT; + rowHeight = GUI_GRID_H; colorText[] = {1,1,1,1}; colorBackground[] = {1,0,0,0}; itemBackground[] = {1,1,1,0.2}; @@ -37,9 +37,9 @@ class Controls onButtonClick = QUOTE(_this call FUNC(messageLog_print)); tooltip = "Prints currently selected log entry to RPT."; colorBackground[] = {0, 0, 0, 1}; - x = 0 * TMF_ADMINMENU_STD_WIDTH; - y = 19.5 * TMF_ADMINMENU_STD_HEIGHT; - w = 9 * TMF_ADMINMENU_STD_WIDTH; + x = 0 * GUI_GRID_W; + y = 19.5 * GUI_GRID_H; + w = 9 * GUI_GRID_W; }; class ButtonPrintAll: GVAR(RscButtonMenu) @@ -49,8 +49,8 @@ class Controls tooltip = "Prints all logged entries to RPT."; onButtonClick = QUOTE(_this call FUNC(messageLog_printAll)); colorBackground[] = {0, 0, 0, 1}; - x = 9.1 * TMF_ADMINMENU_STD_WIDTH; - y = 19.5 * TMF_ADMINMENU_STD_HEIGHT; - w = 7 * TMF_ADMINMENU_STD_WIDTH; + x = 9.1 * GUI_GRID_W; + y = 19.5 * GUI_GRID_H; + w = 7 * GUI_GRID_W; }; }; diff --git a/addons/adminmenu/gui/modal.hpp b/addons/adminmenu/gui/modal.hpp index f3be1fd9..50fed8be 100644 --- a/addons/adminmenu/gui/modal.hpp +++ b/addons/adminmenu/gui/modal.hpp @@ -1,74 +1,68 @@ -class GVAR(modal) -{ +class GVAR(modal) { idd = IDD_TMF_ADMINMENU; - movingEnable = 0; - enableDisplay = 1; - enableSimulation = 1; + movingEnable = true; + enableDisplay = true; + enableSimulation = true; onLoad = QUOTE(_this call FUNC(modalOnLoad);); onUnload = QUOTE(_this call FUNC(modalOnUnload);); - class Controls - { - class Background: RscText - { + class Controls { + class Background: RscText { idc = IDC_TMF_ADMINMENU_MODAL_BACK; colorBackground[] = {0, 0, 0, 0}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "23 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 1 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 38 * GUI_GRID_W; + h = 23 * GUI_GRID_H; }; - class TitleBackground: RscText - { + class TitleBackground: RscText { idc = IDC_TMF_ADMINMENU_MODAL_TBACK; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; - x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = GUI_BCG_COLOR; + moving = true; + x = 1.5 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 2.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 37 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class Title: RscTitle - { + class Title: RscTitle { idc = IDC_TMF_ADMINMENU_MODAL_TITLE; text = "TMF Admin Menu"; - style = 0; + style = ST_SINGLE; + moving = true; colorBackground[] = {0, 0, 0, 0}; - x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 1.5 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 2.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 37 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class GroupBackground: RscText - { + class GroupBackground: RscText { idc = IDC_TMF_ADMINMENU_MODAL_GBACK; colorBackground[] = {0, 0, 0, 0.8}; shadow = 2; colorShadow[] = {1, 1, 1, 1}; colorText[] = {1, 1, 1, 1}; - x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "20.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 1.5 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 3.7 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 37 * GUI_GRID_W; + h = 20.3 * GUI_GRID_H; }; - class Group: RscControlsGroup - { + class Group: RscControlsGroup { idc = IDC_TMF_ADMINMENU_G_MODAL; - x = "1.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "36.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "20.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 1.6 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 3.8 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 36.8 * GUI_GRID_W; + h = 20.1 * GUI_GRID_H; class Controls {}; }; - class Close - { + class Close { idc = IDC_TMF_ADMINMENU_MODAL_CLOSE; - type = 1; - style = 48 + 2048; + type = CT_BUTTON; + style = ST_PICTURE + ST_KEEP_ASPECT_RATIO; text = "\a3\ui_f\data\GUI\Rsc\RscDisplayArcadeMap\top_close_gs.paa"; tooltip = "Close Utility"; onMouseButtonClick = "closeDialog 1;"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - font = "RobotoCondensed"; + sizeEx = GUI_TEXT_SIZE_SMALL; + font = GUI_FONT_NORMAL; colorBackground[] = {0, 0, 0, 0}; colorBackgroundActive[] = {0, 0, 0, 0}; colorBackgroundDisabled[] = {0, 0, 0, 0}; @@ -86,10 +80,10 @@ class GVAR(modal) soundPush[] = {"", 0.1, 1}; soundClick[] = {"", 0.1, 1}; soundEscape[] = {"", 0.1, 1}; - x = "37.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 37.5 * GUI_GRID_W + GUI_GRID_CENTER_X; + y = 2.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 1 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; }; }; diff --git a/addons/adminmenu/gui/playerManagement.hpp b/addons/adminmenu/gui/playerManagement.hpp index aea67081..9696dadf 100644 --- a/addons/adminmenu/gui/playerManagement.hpp +++ b/addons/adminmenu/gui/playerManagement.hpp @@ -1,74 +1,66 @@ -class Controls -{ - class LabelFilter: RscText - { +class Controls { + class LabelFilter: RscText { text = "Filter:"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "0"; - y = "0"; - w = "2.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 0; + y = 0; + w = 2.1 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class ComboFilterSide: RscCombo - { + class ComboFilterSide: RscCombo { idc = IDC_TMF_ADMINMENU_PMAN_FILTER_SIDE; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - font = "RobotoCondensed"; - x = "2.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0"; - w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class ComboFilterState: ComboFilterSide - { + sizeEx = GUI_TEXT_SIZE_SMALL; + font = GUI_FONT_NORMAL; + x = 2.2 * GUI_GRID_W; + y = 0; + w = 6 * GUI_GRID_W; + h = 1 * GUI_GRID_H; + }; + class ComboFilterState: ComboFilterSide { idc = IDC_TMF_ADMINMENU_PMAN_FILTER_STATE; - x = "8.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "8.3 * GUI_GRID_W"; + w = "5 * GUI_GRID_W"; }; - class ButtonFilterReset: GVAR(RscButtonMenu) - { + class ButtonFilterReset: GVAR(RscButtonMenu) { idc = IDC_TMF_ADMINMENU_PMAN_FILTER_RESET; text = "Reset"; - x = "13.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0"; - w = "2.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 13.4 * GUI_GRID_W; + y = 0; + w = 2.5 * GUI_GRID_W; }; - class ButtonRefresh: GVAR(RscButtonMenu) - { + class ButtonRefresh: GVAR(RscButtonMenu) { idc = IDC_TMF_ADMINMENU_PMAN_REFRESH; text = "Refresh"; - x = "26.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0"; - w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 26.9 * GUI_GRID_W; + y = 0; + w = 3 * GUI_GRID_W; }; - class BackgroundGroupList: RscText - { - x = "0"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + class BackgroundGroupList: RscText { + x = 0; + y = 1.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_PMAN_W_LISTGROUP; h = TMF_ADMINMENU_PMAN_H_LISTGROUP; colorBackground[] = {0, 0, 0, 0.3}; - style = "0x02"; + style = ST_CENTER; }; - class ListPlayers: RscListBox - { + class ListPlayers: RscListBox { idc = IDC_TMF_ADMINMENU_PMAN_LIST; - style = 32 + 16; // LB_MULTI + ST_MULTI + style = LB_MULTI + ST_MULTI; onLBSelChanged = QUOTE(_this call FUNC(playerManagement_listSelChange);); - sizeEx = TMF_ADMINMENU_STD_SIZEX; - sizeEx2 = TMF_ADMINMENU_STD_SIZEX; + sizeEx = GUI_TEXT_SIZE_SMALL; + sizeEx2 = GUI_TEXT_SIZE_SMALL; pictureColor[] = {1,1,1,1}; // Picture color pictureColorSelect[] = {1,1,1,1}; // Selected picture color pictureColorDisabled[] = {1,1,1,0.5}; // Disabled picture color - rowHeight = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + rowHeight = 1 * GUI_GRID_H; colorText[] = {1,1,1,1}; colorBackground[] = {0,0,0,0}; itemBackground[] = {1,1,1,0.2}; itemSpacing = 0; x = 0; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 1.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_PMAN_W_LISTGROUP; h = TMF_ADMINMENU_PMAN_H_LISTGROUP; }; @@ -76,122 +68,118 @@ class Controls /* * Right-hand side vertical menu */ - class LabelSelect: RscText - { + class LabelSelect: RscText { text = "Select..."; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "30.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0"; - w = "6.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 30.9 * GUI_GRID_W; + y = 0; + w = 6.9 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - class ButtonSelectAll: ButtonFilterReset - { + class ButtonSelectAll: ButtonFilterReset { idc = IDC_TMF_ADMINMENU_PMAN_SEL_ALL; text = "All"; - x = "30.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "6.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = 30.9 * GUI_GRID_W; + y = 1.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 6.9 * GUI_GRID_W; }; - class ButtonSelectNone: ButtonSelectAll - { + class ButtonSelectNone: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_SEL_NONE; text = "None"; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 2.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; - class ButtonSelectInvert: ButtonSelectAll - { + class ButtonSelectInvert: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_SEL_INVERT; text = "Invert"; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 3.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class LabelWithSelected: RscText { idc = -1; text = "With Selected..."; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "30.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "6.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 30.9 * GUI_GRID_W; + y = 4.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = 6.9 * GUI_GRID_W; + h = 1 * GUI_GRID_H; }; - + class ButtonACRE2Languages: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_ACRELANGUAGES; text = "ACRE2 Languages"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_ACRE2Languages)),ctrlText (_this select 0))] call FUNC(modal);); - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 5.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class ButtonACRE2Radios: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_ACRERADIOS; text = "ACRE2 Radios"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_ACRE2Radios)),ctrlText (_this select 0))] call FUNC(modal);); - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 6.6 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class ButtonAssignGear: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_ASSIGNGEAR; text = "Assign Gear"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_assignGear)),ctrlText (_this select 0))] call FUNC(modal);); - y = "7.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 7.7 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class ButtonAssignTraits: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_ASSIGNTRAITS; text = "Assign Traits"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_assignTraits)),ctrlText (_this select 0))] call FUNC(modal);); - y = "8.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 8.8 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class ButtonGrantZeus: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_GRANTZEUS; text = "Grant Zeus"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(utility_grantZeus)),ctrlText (_this select 0))] call FUNC(utility);); - y = "9.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 9.9 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class ButtonHeal: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_HEAL; text = "Heal"; - onButtonClick = QUOTE([ARR_3(QUOTE(QFUNC(utility_heal)),ctrlText (_this select 0),true)] call FUNC(utility);); - y = "11 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + onButtonClick = QUOTE([ARR_3(QUOTE(QFUNC(utility_heal)),ctrlText (_this select 0),True)] call FUNC(utility);); + y = 11 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class ButtonMessage: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_MESSAGE; text = "Message"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_message)),ctrlText (_this select 0))] call FUNC(modal);); - y = "12.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 12.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class ButtonQuickRespawn: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_QRESPAWN; text = "Quick Respawn"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(utility_quickRespawn)),ctrlText (_this select 0))] call FUNC(utility);); - y = "13.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 13.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class ButtonRunCode: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_RUNCODE; text = "Run Code On"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_runCode)),ctrlText (_this select 0))] call FUNC(modal);); - y = "14.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 14.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class ButtonSteamProfile: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_STEAM; text = "Steam Profile"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_steamProfile)),ctrlText (_this select 0))] call FUNC(modal);); - y = "15.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 15.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; class ButtonTeleport: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_TELEPORT; text = "Teleport"; - onButtonClick = QUOTE([ARR_3(QUOTE(QFUNC(modal_teleport)),ctrlText (_this select 0),true)] call FUNC(modal);); - y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + onButtonClick = QUOTE([ARR_3(QUOTE(QFUNC(modal_teleport)),ctrlText (_this select 0),True)] call FUNC(modal);); + y = 16.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; }; }; diff --git a/addons/adminmenu/gui/respawn.hpp b/addons/adminmenu/gui/respawn.hpp index 01e11505..a7cf6a39 100644 --- a/addons/adminmenu/gui/respawn.hpp +++ b/addons/adminmenu/gui/respawn.hpp @@ -4,22 +4,22 @@ class Controls { idc = IDC_TMF_ADMINMENU_RESP_SPECTATORTEXT; text = "Players in Spectator: 0"; - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - + + sizeEx = GUI_TEXT_SIZE_SMALL; + x = 0; y = 0; w = TMF_ADMINMENU_RESP_W_COL1; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; class spectatorListBox: RscListBox { idc = IDC_TMF_ADMINMENU_RESP_SPECTATORLIST; - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - sizeEx2 = TMF_ADMINMENU_STD_SIZEX; - //rowHeight = 0.97 * TMF_ADMINMENU_STD_HEIGHT; - //rowHeight = TMF_ADMINMENU_STD_HEIGHT; + + sizeEx = GUI_TEXT_SIZE_SMALL; + sizeEx2 = GUI_TEXT_SIZE_SMALL; + //rowHeight = 0.97 * GUI_GRID_H; + //rowHeight = GUI_GRID_H; //colorBackground[] = {0, 0, 0, 1}; //shadow = 0; //itemSpacing = 0.05; @@ -28,16 +28,16 @@ class Controls pictureColorSelect[] = {1,1,1,1}; // Selected picture color pictureColorDisabled[] = {1,1,1,0.5}; // Disabled picture color - rowHeight = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + rowHeight = 1 * GUI_GRID_H; colorText[] = {1,1,1,1}; // colorBackground[] = {0,0,0,0}; itemBackground[] = {1,1,1,0.2}; itemSpacing = 0; tooltip = "tooltip test"; - - x = "0"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + + x = 0; + y = 1.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL1; h = 0.308 * safezoneH; }; @@ -47,9 +47,9 @@ class Controls idc = IDC_TMF_ADMINMENU_RESP_ADDBUTTON; text = "Add"; x = TMF_ADMINMENU_RESP_X_COL2; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 1.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL2; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; onButtonClick=QUOTE((ctrlParent (param [0])) call FUNC(respawn_addAction)); }; class respawnMenuRemoveButton: GVAR(RscButtonMenu) @@ -57,43 +57,43 @@ class Controls idc = IDC_TMF_ADMINMENU_RESP_REMOVEBUTTON; text = "Remove"; x = TMF_ADMINMENU_RESP_X_COL2; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 2.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL2; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; onButtonClick=QUOTE((ctrlParent (param [0])) call FUNC(respawn_removeAction)); }; class respawnMenuRscComboRole: RscCombo { idc = IDC_TMF_ADMINMENU_RESP_ROLECOMBO; text = "Role"; - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - font = "RobotoCondensed"; - + + sizeEx = GUI_TEXT_SIZE_SMALL; + font = GUI_FONT_NORMAL; + x = TMF_ADMINMENU_RESP_X_COL2; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 3.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL2; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; class RankText: RscText { idc = -1; text = "Unit rank:"; - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - + + sizeEx = GUI_TEXT_SIZE_SMALL; + x = TMF_ADMINMENU_RESP_X_COL2; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 4.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL2; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; - + class RankSelector: RscToolbox { idc = IDC_TMF_ADMINMENU_RESP_RANK; - - style="0x02 + 0x30 + 0x800"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + + style = ST_CENTER + ST_PICTURE + ST_KEEP_ASPECT_RATIO; + sizeEx = GUI_TEXT_SIZE_SMALL; rows = 2; columns = 4; strings[]= @@ -128,9 +128,9 @@ class Controls colorBackground[] = {0.5, 0.5, 0.5, 0.1}; x = TMF_ADMINMENU_RESP_X_COL2; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 5.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL2; - h = 2*TMF_ADMINMENU_STD_HEIGHT; + h = 2 * GUI_GRID_H; }; class respawnMenuVOIP: GVAR(RscButtonMenu) @@ -138,9 +138,9 @@ class Controls idc = IDC_TMF_ADMINMENU_RESP_SPECTATORVOIP; text = "Toggle Spectator VOIP"; x = TMF_ADMINMENU_RESP_X_COL3; - y = "0"; + y = 0; w = TMF_ADMINMENU_RESP_W_COL3; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; tooltip = "Toggles the spectator channel for you (ACRE/TFAR), so that you can talk to dead players if alive."; onButtonClick = QUOTE((ctrlParent (param [0])) call FUNC(respawn_toggleSpectatorVOIP)); }; @@ -148,10 +148,10 @@ class Controls { idc = IDC_TMF_ADMINMENU_RESP_GROUPLIST; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - sizeEx2 = TMF_ADMINMENU_STD_SIZEX; - //rowHeight = 0.97 * TMF_ADMINMENU_STD_HEIGHT; - //rowHeight = TMF_ADMINMENU_STD_HEIGHT; + sizeEx = GUI_TEXT_SIZE_SMALL; + sizeEx2 = GUI_TEXT_SIZE_SMALL; + //rowHeight = 0.97 * GUI_GRID_H; + //rowHeight = GUI_GRID_H; //colorBackground[] = {0, 0, 0, 1}; //shadow = 0; //itemSpacing = 0.05; @@ -160,7 +160,7 @@ class Controls pictureColorSelect[] = {1,1,1,1}; // Selected picture color pictureColorDisabled[] = {1,1,1,0.5}; // Disabled picture color - rowHeight = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + rowHeight = 1 * GUI_GRID_H; colorText[] = {1,1,1,1}; // colorBackground[] = {0,0,0,0}; itemBackground[] = {1,1,1,0.2}; @@ -169,7 +169,7 @@ class Controls tooltip = "tooltip test"; x = TMF_ADMINMENU_RESP_X_COL3; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 1.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL3; h = 0.308 * safezoneH; }; @@ -178,147 +178,147 @@ class Controls { idc = -1; text = "Group Details:"; - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - + + sizeEx = GUI_TEXT_SIZE_SMALL; + x = TMF_ADMINMENU_RESP_X_COL4; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 1.1 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL1; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; class respawnMenuGroupNameText: RscEdit { idc = IDC_TMF_ADMINMENU_RESP_GROUPNAME; text = "INSERT_GROUP_NAME"; - + colorBackground[] = {0.5, 0.5, 0.5, 0.1}; colorBorder[] = {1, 1, 1, 0.33}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - + sizeEx = GUI_TEXT_SIZE_SMALL; + x = TMF_ADMINMENU_RESP_X_COL4; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 2.2 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; class respawnMenuFactionCategoryCombo: RscCombo { idc = IDC_TMF_ADMINMENU_RESP_FACTIONCATEGORY; text = "FactionCategory"; /*Formerly side */ - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - font = "RobotoCondensed"; - + + sizeEx = GUI_TEXT_SIZE_SMALL; + font = GUI_FONT_NORMAL; + x = TMF_ADMINMENU_RESP_X_COL4; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 3.3 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; class respawnMenuFactionCombo: RscCombo { idc = IDC_TMF_ADMINMENU_RESP_FACTION; text = "Faction"; - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - font = "RobotoCondensed"; - + + sizeEx = GUI_TEXT_SIZE_SMALL; + font = GUI_FONT_NORMAL; + x = TMF_ADMINMENU_RESP_X_COL4; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 4.4 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; class respawnMenuSideCombo: RscCombo { idc = IDC_TMF_ADMINMENU_RESP_SIDE; text = "Side"; - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - font = "RobotoCondensed"; - + + sizeEx = GUI_TEXT_SIZE_SMALL; + font = GUI_FONT_NORMAL; + x = TMF_ADMINMENU_RESP_X_COL4; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 5.5 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; - + class respawnMenuSpawnMarkerText: RscText { idc = -1; text = "Spawn with ORBAT marker?"; - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - + + sizeEx = GUI_TEXT_SIZE_SMALL; + x = TMF_ADMINMENU_RESP_X_COL4; - y = "7.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 7.7 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; class respawnMenuGroupMarkerCheckbox: RscCheckBox { idc = IDC_TMF_ADMINMENU_RESP_GROUPMARKERCHECKBOX; text = "Give group marker"; - x = TMF_ADMINMENU_RESP_X_COL4 + (7 * (((safezoneW / safezoneH) min 1.2) / 40)); - y = "7.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = (1 * (((safezoneW / safezoneH) min 1.2) / 40)); - h = TMF_ADMINMENU_STD_HEIGHT; + x = TMF_ADMINMENU_RESP_X_COL4 + (7 * GUI_GRID_W); + y = 7.7 * GUI_GRID_H + GUI_GRID_CENTER_Y; + w = (1 * GUI_GRID_W); + h = GUI_GRID_H; //action = "['respawnMenuToggleGroupCheckbox'] spawn tmf_respawn_fnc_handleRespawnUI"; }; class respawnMenuMarkerName: RscEdit { idc = IDC_TMF_ADMINMENU_RESP_GROUPMARKERNAME; text = "INSERT_MARKER_NAME"; - + // colorBackground[] = {0.5, 0.5, 0.5, 0.1}; // colorBorder[] = {1, 1, 1, 0.33}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - + sizeEx = GUI_TEXT_SIZE_SMALL; + x = TMF_ADMINMENU_RESP_X_COL4; - y = "8.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 8.8 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; - - + + //Marker combo boxs class MarkerTypeCombo: RscCombo { idc = IDC_TMF_ADMINMENU_RESP_MARKERTYPE; text = "Side"; - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - font = "RobotoCondensed"; - - + + sizeEx = GUI_TEXT_SIZE_SMALL; + font = GUI_FONT_NORMAL; + + x = TMF_ADMINMENU_RESP_X_COL4; - y = "9.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 9.9 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; class MarkerColourCombo: RscCombo { idc = IDC_TMF_ADMINMENU_RESP_MARKERCOLOUR; text = "Side"; - - sizeEx = TMF_ADMINMENU_STD_SIZEX; - font = "RobotoCondensed"; - + + sizeEx = GUI_TEXT_SIZE_SMALL; + font = GUI_FONT_NORMAL; + x = TMF_ADMINMENU_RESP_X_COL4; - y = "11 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 11 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + h = GUI_GRID_H; }; - + class respawnMenuSpawnButton: GVAR(RscButtonMenu) { idc = IDC_TMF_ADMINMENU_RESP_SPAWNBUTTON; text = "Spawn Group"; x = TMF_ADMINMENU_RESP_X_COL4; - y = "19 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = 19 * GUI_GRID_H + GUI_GRID_CENTER_Y; w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; - + h = GUI_GRID_H; + onButtonClick=QUOTE((ctrlParent (param [0])) call FUNC(respawn_respawnButton)); }; - + // class respawnMenuCloseButton: GVAR(RscButtonMenu) diff --git a/addons/adminmenu/script_component.hpp b/addons/adminmenu/script_component.hpp index 7d481d02..68afab24 100644 --- a/addons/adminmenu/script_component.hpp +++ b/addons/adminmenu/script_component.hpp @@ -14,13 +14,10 @@ /* ADMINMENU */ -#define TMF_ADMINMENU_STD_WIDTH (((safezoneW / safezoneH) min 1.2) / 40) -#define TMF_ADMINMENU_STD_HEIGHT ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) -#define TMF_ADMINMENU_STD_SIZEX (TMF_ADMINMENU_STD_HEIGHT * 0.8) -#define TMF_ADMINMENU_STD_SIZEX_L (TMF_ADMINMENU_STD_HEIGHT * 0.9) +//#define GUI_TEXT_SIZE_MEDIUM (GUI_GRID_H * 0.9) -#define TMF_GROUPBASE_W (37.8 * TMF_ADMINMENU_STD_WIDTH) -#define TMF_GROUPBASE_H (20.6 * TMF_ADMINMENU_STD_HEIGHT) +#define TMF_GROUPBASE_W (37.8 * GUI_GRID_W) +#define TMF_GROUPBASE_H (20.6 * GUI_GRID_H) #define IDD_TMF_ADMINMENU 56100 @@ -109,16 +106,16 @@ #define IDC_TMF_ADMINMENU_PMAN_STEAM 56320 #define IDC_TMF_ADMINMENU_PMAN_QRESPAWN 56321 -#define TMF_ADMINMENU_PMAN_W_LISTGROUP (29.9 * (((safezoneW / safezoneH) min 1.2) / 40)) -#define TMF_ADMINMENU_PMAN_H_LISTGROUP (19.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) +#define TMF_ADMINMENU_PMAN_W_LISTGROUP (29.9 * GUI_GRID_W) +#define TMF_ADMINMENU_PMAN_H_LISTGROUP (19.4 * GUI_GRID_H) // 4.4*stdwidth -#define TMF_ADMINMENU_PMAN_W_LIST (TMF_ADMINMENU_PMAN_W_LISTGROUP - (6.6 * TMF_ADMINMENU_STD_WIDTH)) +#define TMF_ADMINMENU_PMAN_W_LIST (TMF_ADMINMENU_PMAN_W_LISTGROUP - (6.6 * GUI_GRID_W)) #define TMF_ADMINMENU_PMAN_X_DEAD 0 -#define TMF_ADMINMENU_PMAN_X_SIDE (TMF_ADMINMENU_PMAN_X_DEAD + (1.1 * TMF_ADMINMENU_STD_WIDTH)) -#define TMF_ADMINMENU_PMAN_X_LIST (TMF_ADMINMENU_PMAN_X_SIDE + (1.1 * TMF_ADMINMENU_STD_WIDTH)) -#define TMF_ADMINMENU_PMAN_X_QRESP (TMF_ADMINMENU_PMAN_X_LIST + TMF_ADMINMENU_PMAN_W_LIST + (0.1 * TMF_ADMINMENU_STD_WIDTH)) -#define TMF_ADMINMENU_PMAN_X_STEAM (TMF_ADMINMENU_PMAN_X_QRESP + (1.1 * TMF_ADMINMENU_STD_WIDTH)) +#define TMF_ADMINMENU_PMAN_X_SIDE (TMF_ADMINMENU_PMAN_X_DEAD + (1.1 * GUI_GRID_W)) +#define TMF_ADMINMENU_PMAN_X_LIST (TMF_ADMINMENU_PMAN_X_SIDE + (1.1 * GUI_GRID_W)) +#define TMF_ADMINMENU_PMAN_X_QRESP (TMF_ADMINMENU_PMAN_X_LIST + TMF_ADMINMENU_PMAN_W_LIST + (0.1 * GUI_GRID_W)) +#define TMF_ADMINMENU_PMAN_X_STEAM (TMF_ADMINMENU_PMAN_X_QRESP + (1.1 * GUI_GRID_W)) /* RESPAWN MENU */ @@ -146,18 +143,18 @@ //37.8 max width let's do 37.8 - 10 // max H is 20 -#define TMF_ADMINMENU_RESP_W_COL1 (10 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_W_COL1 (10 * GUI_GRID_W) #define TMF_ADMINMENU_RESP_X_COL1 0 -#define TMF_ADMINMENU_RESP_W_COL2 (4.8 * (((safezoneW / safezoneH) min 1.2) / 40)) -#define TMF_ADMINMENU_RESP_X_COL2 (11 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_W_COL2 (4.8 * GUI_GRID_W) +#define TMF_ADMINMENU_RESP_X_COL2 (11 * GUI_GRID_W) -#define TMF_ADMINMENU_RESP_X_COL3 (16.8 * (((safezoneW / safezoneH) min 1.2) / 40)) -#define TMF_ADMINMENU_RESP_W_COL3 (10 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_X_COL3 (16.8 * GUI_GRID_W) +#define TMF_ADMINMENU_RESP_W_COL3 (10 * GUI_GRID_W) // COL3 is same as COL1 Width -#define TMF_ADMINMENU_RESP_W_COL4 (10 * (((safezoneW / safezoneH) min 1.2) / 40)) -#define TMF_ADMINMENU_RESP_X_COL4 (27.8 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_W_COL4 (10 * GUI_GRID_W) +#define TMF_ADMINMENU_RESP_X_COL4 (27.8 * GUI_GRID_W) #define IDC_TMF_ADMINMENU_ENDM_LIST 56501 #define IDC_TMF_ADMINMENU_ENDM_ENDMISSION 56502 @@ -188,8 +185,8 @@ #define IDC_TMF_ADMINMENU_MSGS_SOMETHING 56601 #define IDC_TMF_ADMINMENU_MSGS_LIST 56602 -#define TMF_ADMINMENU_MSGS_W_LIST (TMF_GROUPBASE_W - 0.1 * TMF_ADMINMENU_STD_WIDTH) -#define TMF_ADMINMENU_MSGS_H_LIST (TMF_GROUPBASE_H - 1.1 * TMF_ADMINMENU_STD_HEIGHT) +#define TMF_ADMINMENU_MSGS_W_LIST (TMF_GROUPBASE_W - 0.1 * GUI_GRID_W) +#define TMF_ADMINMENU_MSGS_H_LIST (TMF_GROUPBASE_H - 1.1 * GUI_GRID_H) #define IDC_TMF_ADMINMENU_MSGS_COPY 56603 #define IDC_TMF_ADMINMENU_MSGS_COPYALL 56604 From d570b5ffc6a01ec714aed4a11385873dfc751dd5 Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sat, 21 Nov 2020 13:25:46 +0100 Subject: [PATCH 06/11] Add ACRE God Mode functionality --- addons/acre2/XEH_postInit.sqf | 20 ++++++++++++++++++++ addons/spectator/config.cpp | 6 ++++++ 2 files changed, 26 insertions(+) diff --git a/addons/acre2/XEH_postInit.sqf b/addons/acre2/XEH_postInit.sqf index a78b6b83..f0a03864 100644 --- a/addons/acre2/XEH_postInit.sqf +++ b/addons/acre2/XEH_postInit.sqf @@ -77,6 +77,26 @@ if (_tmfNetworkEnabled) then { if (hasInterface) then { + // Set up god mode + ["Admins", 0] call acre_api_fnc_godModeNameGroup; + ["Spectators", 1] call acre_api_fnc_godModeNameGroup; + ["Curators", 2] call acre_api_fnc_godModeNameGroup; + + private _canBroadcast = [player, "acreBroadcast"] call EFUNC(adminMenu,isAuthorized); + private _canGroupChat = [player, "acreGroupChat"] call EFUNC(adminMenu,isAuthorized); + + TRACE_3("Initializing god mode",getPlayerUID player,_canBroadcast,_canGroupChat); + [_canBroadcast, _canGroupChat] call acre_api_fnc_godModeConfigureAccess; + + if _canGroupChat then { + [getPlayerUID player, 0, 1] remoteExecCall ["acre_api_fnc_godModeModifyGroup", 0, true]; + }; + [{ + allPlayers select {_x isKindOf QEGVAR(spectator,unit) || {[_x] call acre_api_fnc_isSpectator}} + }, 1, 0] call acre_api_fnc_godModeModifyGroup; + [{[] call BIS_fnc_listCuratorPlayers}, 2, 0] call acre_api_fnc_godModeModifyGroup; + + // Handle VarSync [{ if (isNull player) exitWith {}; params ["_tmfNetworkEnabled"]; diff --git a/addons/spectator/config.cpp b/addons/spectator/config.cpp index 24f1a925..585b6dc7 100644 --- a/addons/spectator/config.cpp +++ b/addons/spectator/config.cpp @@ -24,6 +24,12 @@ class CfgRespawnTemplates onPlayerKilled = ""; }; }; + +class EGVAR(adminMenu,authorized_players) { + acreBroadcast = 1; // Can broadcast to everyone within a chat channel + acreGroupChat = 1; // Can broadcast to admins, spectators and curators +}; + #include "autotest.hpp" #include "CfgEventHandlers.hpp" #include "display3DEN.hpp" From 02dbcd51899326e32cf2bbefd6ca20351909ab61 Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sat, 21 Nov 2020 13:43:29 +0100 Subject: [PATCH 07/11] Add toggle option --- addons/acre2/XEH_postInit.sqf | 28 +++++++++++++++------------- addons/acre2/XEH_preInit.sqf | 1 + addons/acre2/initSettings.sqf | 10 ++++++++++ 3 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 addons/acre2/initSettings.sqf diff --git a/addons/acre2/XEH_postInit.sqf b/addons/acre2/XEH_postInit.sqf index f0a03864..0f5c9e8f 100644 --- a/addons/acre2/XEH_postInit.sqf +++ b/addons/acre2/XEH_postInit.sqf @@ -78,23 +78,25 @@ if (_tmfNetworkEnabled) then { if (hasInterface) then { // Set up god mode - ["Admins", 0] call acre_api_fnc_godModeNameGroup; - ["Spectators", 1] call acre_api_fnc_godModeNameGroup; - ["Curators", 2] call acre_api_fnc_godModeNameGroup; + if GVAR(godmodeEnabled) then { + ["Admins", 0] call acre_api_fnc_godModeNameGroup; + ["Spectators", 1] call acre_api_fnc_godModeNameGroup; + ["Curators", 2] call acre_api_fnc_godModeNameGroup; - private _canBroadcast = [player, "acreBroadcast"] call EFUNC(adminMenu,isAuthorized); - private _canGroupChat = [player, "acreGroupChat"] call EFUNC(adminMenu,isAuthorized); + private _canBroadcast = [player, "acreBroadcast"] call EFUNC(adminMenu,isAuthorized); + private _canGroupChat = [player, "acreGroupChat"] call EFUNC(adminMenu,isAuthorized); - TRACE_3("Initializing god mode",getPlayerUID player,_canBroadcast,_canGroupChat); - [_canBroadcast, _canGroupChat] call acre_api_fnc_godModeConfigureAccess; + TRACE_3("Initializing god mode",getPlayerUID player,_canBroadcast,_canGroupChat); + [_canBroadcast, _canGroupChat] call acre_api_fnc_godModeConfigureAccess; - if _canGroupChat then { - [getPlayerUID player, 0, 1] remoteExecCall ["acre_api_fnc_godModeModifyGroup", 0, true]; + if _canGroupChat then { + [getPlayerUID player, 0, 1] remoteExecCall ["acre_api_fnc_godModeModifyGroup", 0, true]; + }; + [{ + allPlayers select {_x isKindOf QEGVAR(spectator,unit) || {[_x] call acre_api_fnc_isSpectator}} + }, 1, 0] call acre_api_fnc_godModeModifyGroup; + [{[] call BIS_fnc_listCuratorPlayers}, 2, 0] call acre_api_fnc_godModeModifyGroup; }; - [{ - allPlayers select {_x isKindOf QEGVAR(spectator,unit) || {[_x] call acre_api_fnc_isSpectator}} - }, 1, 0] call acre_api_fnc_godModeModifyGroup; - [{[] call BIS_fnc_listCuratorPlayers}, 2, 0] call acre_api_fnc_godModeModifyGroup; // Handle VarSync [{ diff --git a/addons/acre2/XEH_preInit.sqf b/addons/acre2/XEH_preInit.sqf index 683b3f0c..3329698f 100644 --- a/addons/acre2/XEH_preInit.sqf +++ b/addons/acre2/XEH_preInit.sqf @@ -1,5 +1,6 @@ #include "script_component.hpp" #include "XEH_PREP.sqf" +#include "initSettings.sqf" GVAR(showSpectatorRadios) = false; diff --git a/addons/acre2/initSettings.sqf b/addons/acre2/initSettings.sqf new file mode 100644 index 00000000..4dc0c242 --- /dev/null +++ b/addons/acre2/initSettings.sqf @@ -0,0 +1,10 @@ +[ + QGVAR(godmodeEnabled), + "CHECKBOX", + ["Handle God Mode", "Whether TMF should handle ACRE God Mode configuration. \nDefault Configuration: \n- Group 1: Admins \n- Group 2: Spectators \n- Group 3: Curators\nSee ACRE wiki for more info on God Mode."], + ["TMF", "ACRE2"], + true, + 1, + {}, + true +] call CBA_fnc_addSetting; From f074d4f2901cbf0bf6f3a84b34f84be474fd2e01 Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sat, 21 Nov 2020 14:27:53 +0100 Subject: [PATCH 08/11] Add warning about granting/claiming zeus --- addons/adminmenu/functions/fnc_claimZeus.sqf | 24 +++++++++++++++++++ .../functions/fnc_utility_grantzeus.sqf | 24 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/addons/adminmenu/functions/fnc_claimZeus.sqf b/addons/adminmenu/functions/fnc_claimZeus.sqf index b126a8e6..86dc1818 100644 --- a/addons/adminmenu/functions/fnc_claimZeus.sqf +++ b/addons/adminmenu/functions/fnc_claimZeus.sqf @@ -1,5 +1,29 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +disableSerialization; +if !canSuspend exitWith { + _this spawn FUNC(claimZeus); +}; + +// Because people don't understand that grabbing zeus after mission start is a bad idea +if !( + [ + [ + "Claiming Zeus after mission start may cause certain functionality to break.", + "As such it should only be used for debug purposes or in emergencies.", + "To prevent any issues you should use the Game Master editor module whenever possible.", + "", + "Do you still wish to proceed?" + ] joinString "
", + "WARNING", + true, + true, + uiNamespace getVariable [QGVAR(display),displayNull], + true, + false + ] call BIS_fnc_guiMessage +) exitWith {}; + if (isNull (getAssignedCuratorLogic player)) then { player remoteExec [QFUNC(makeZeusServer), 2]; systemChat "[TMF Admin Menu] You now have access to Zeus"; diff --git a/addons/adminmenu/functions/fnc_utility_grantzeus.sqf b/addons/adminmenu/functions/fnc_utility_grantzeus.sqf index 0a92427a..ec06ac36 100644 --- a/addons/adminmenu/functions/fnc_utility_grantzeus.sqf +++ b/addons/adminmenu/functions/fnc_utility_grantzeus.sqf @@ -1,5 +1,29 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +disableSerialization; +if !canSuspend exitWith { + _this spawn FUNC(utility_grantZeus); +}; + +// Because people don't understand that grabbing zeus after mission start is a bad idea +if !( + [ + [ + "Claiming Zeus after mission start may cause certain functionality to break.", + "As such it should only be used for debug purposes or in emergencies.", + "To prevent any issues you should use the Game Master editor module whenever possible.", + "", + "Do you still wish to proceed?" + ] joinString "
", + "WARNING", + true, + true, + uiNamespace getVariable [QGVAR(display),displayNull], + true, + false + ] call BIS_fnc_guiMessage +) exitWith {}; + private _given = []; private _had = []; From 89fd05da441f5881c6525321efcc23ea8c19def0 Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sat, 21 Nov 2020 14:45:06 +0100 Subject: [PATCH 09/11] Add fnc_checkPermission header --- .../functions/fnc_checkPermission.sqf | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/addons/adminmenu/functions/fnc_checkPermission.sqf b/addons/adminmenu/functions/fnc_checkPermission.sqf index 7f4aefa1..e7d8e963 100644 --- a/addons/adminmenu/functions/fnc_checkPermission.sqf +++ b/addons/adminmenu/functions/fnc_checkPermission.sqf @@ -1,5 +1,28 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" +/* ---------------------------------------------------------------------------- +Internal Function: TMF_adminmenu_fnc_checkPermission +Description: + Checks if a config class within tmf_adminmenu_authorized_players has the specified permission. + If no permission is set, it falls back to the default values set directly in + tmf_adminmenu_authorized_players. + +Parameters: + _class - Config class in (configFile >> "tmf_adminmenu_authorized_players") [Config] + _perm - Permission to check [String] + +Returns: + Whether config has the specified permission. [Boolean] + +Examples: + (begin example) + [(configFile >> "tmf_adminmenu_authorized_players" >> "bear"), "debugConsole"] call TMF_adminmenu_fnc_checkPermission; + // true + (end) + +Author: + Freddo +---------------------------------------------------------------------------- */ params [ ["_class", configNull, [configNull]], ["_perm", "", [""]] From d3ec685c92896a04d36d6635ac028f5048246b72 Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sat, 21 Nov 2020 14:50:44 +0100 Subject: [PATCH 10/11] Github validation --- addons/adminmenu/functions/fnc_isAuthorized.sqf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/adminmenu/functions/fnc_isAuthorized.sqf b/addons/adminmenu/functions/fnc_isAuthorized.sqf index 891701b7..1e87470d 100644 --- a/addons/adminmenu/functions/fnc_isAuthorized.sqf +++ b/addons/adminmenu/functions/fnc_isAuthorized.sqf @@ -53,7 +53,11 @@ switch true do { }; default {false}; +#ifdef DEBUG_MODE_FULL +}; // Because otherwise github validation fails +#else }; +#endif #ifdef DEBUG_MODE_FULL TRACE_1("Authorization check complete",_authorized); From ed7e652431ed35f5518cccaa30880dc43e064c81 Mon Sep 17 00:00:00 2001 From: Freddo3000 Date: Sat, 21 Nov 2020 19:06:04 +0100 Subject: [PATCH 11/11] Small tweak --- addons/adminmenu/functions/fnc_isAuthorized.sqf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/adminmenu/functions/fnc_isAuthorized.sqf b/addons/adminmenu/functions/fnc_isAuthorized.sqf index 1e87470d..6ac3985f 100644 --- a/addons/adminmenu/functions/fnc_isAuthorized.sqf +++ b/addons/adminmenu/functions/fnc_isAuthorized.sqf @@ -53,12 +53,9 @@ switch true do { }; default {false}; -#ifdef DEBUG_MODE_FULL +#ifndef DEBUG_MODE_FULL }; // Because otherwise github validation fails #else }; -#endif - -#ifdef DEBUG_MODE_FULL TRACE_1("Authorization check complete",_authorized); #endif