From 82f63b5935c795bda482ea953f2e9e28580dfb26 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 3 Jul 2016 12:17:42 -0500 Subject: [PATCH 1/3] Update showHud func for 1.62 (squad radar) --- addons/captives/functions/fnc_handlePlayerChanged.sqf | 2 +- .../functions/fnc_handleZeusDisplayChanged.sqf | 2 +- addons/captives/functions/fnc_setHandcuffed.sqf | 2 +- addons/captives/functions/fnc_setSurrendered.sqf | 2 +- addons/common/functions/fnc_showHud.sqf | 10 ++++++++-- addons/ui/functions/fnc_setElements.sqf | 1 + 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/addons/captives/functions/fnc_handlePlayerChanged.sqf b/addons/captives/functions/fnc_handlePlayerChanged.sqf index 3ff0e00752..a0ef557056 100644 --- a/addons/captives/functions/fnc_handlePlayerChanged.sqf +++ b/addons/captives/functions/fnc_handlePlayerChanged.sqf @@ -21,7 +21,7 @@ params ["_newUnit","_oldUnit"]; //set showHUD based on new unit status: if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then { TRACE_1("Player Change (showHUD false)",_newUnit); - ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); + ["captive", [false, false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); } else { TRACE_1("Player Change (showHUD true)",_newUnit); ["captive", []] call EFUNC(common,showHud); //same as showHud true; diff --git a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf index 433c1fc259..4cecd5d01c 100644 --- a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf +++ b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf @@ -19,7 +19,7 @@ if ((ACE_player getVariable [QGVAR(isHandcuffed), false]) || {ACE_player getVariable [QGVAR(isSurrendering), false]}) then { TRACE_1("Player Change (showHUD false)",ACE_player); - ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); + ["captive", [false, false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); } else { TRACE_1("Player Change (showHUD true)",ACE_player); ["captive", []] call EFUNC(common,showHud); //same as showHud true; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index 1859bfb0b1..ef68a222ff 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -50,7 +50,7 @@ if (_state) then { _unit setVariable [QGVAR(CargoIndex), ((vehicle _unit) getCargoIndex _unit), true]; if (_unit == ACE_player) then { - ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); + ["captive", [false, false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); }; // fix anim on mission start (should work on dedicated servers) diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 6acd3436aa..1450ec7d58 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -47,7 +47,7 @@ if (_state) then { [_unit, "setCaptive", QGVAR(Surrendered), true] call EFUNC(common,statusEffect_set); if (_unit == ACE_player) then { - ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); + ["captive", [false, false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); }; [_unit] call EFUNC(common,fixLoweredRifleAnimation); diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf index 723c2436ed..e07e272793 100644 --- a/addons/common/functions/fnc_showHud.sqf +++ b/addons/common/functions/fnc_showHud.sqf @@ -15,6 +15,7 @@ * - menu: Boolean - show commanding menu (hides HC related menus) * - group: Boolean - show group info bar (hides squad leader info bar) * - cursors: Boolean - show HUD weapon cursors (connected with scripted HUD) + * - squadRadar: Boolean - show HUD squad radar (since 1.62) * * Return Value: * Resulting ShowHud Array @@ -29,7 +30,12 @@ if (!hasInterface) exitWith {[-1]}; -params [["_reason", "", [""]], ["_mask", [], [[]], [0,8]]]; +params [["_reason", "", [""]], ["_mask", [], [[]], [0,8,9]]]; + +if ((count _mask) == 8) then { + ACE_LOGWARNING_1("ace_common_fnc_showHud - mask now takes 9 arguements in 1.62 [called with %1]",_this); + _mask pushBack true; +}; if (isArray (missionConfigFile >> "showHUD")) then { //(showHud = 0;) is fine - the array is the problem @@ -50,7 +56,7 @@ if (_reason != "") then { GVAR(showHudHash) params ["_reasons", "_masks"]; private _resultMask = []; -for "_index" from 0 to 7 do { +for "_index" from 0 to 8 do { private _set = true; //Default to true { if (!(_x select _index)) exitWith { diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index f029a9f5ae..8147bc3076 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -31,5 +31,6 @@ if (isArray (missionConfigFile >> "showHUD")) exitWith { true, GVAR(commandMenu), GVAR(groupBar), + true, true ]] call EFUNC(common,showHud); From 1922cac79e8d0023a09920252d411793a412fa02 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 3 Jul 2016 23:22:31 +0200 Subject: [PATCH 2/3] fix spelling of arguments --- addons/common/functions/fnc_showHud.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf index e07e272793..660ffdf519 100644 --- a/addons/common/functions/fnc_showHud.sqf +++ b/addons/common/functions/fnc_showHud.sqf @@ -33,7 +33,7 @@ if (!hasInterface) exitWith {[-1]}; params [["_reason", "", [""]], ["_mask", [], [[]], [0,8,9]]]; if ((count _mask) == 8) then { - ACE_LOGWARNING_1("ace_common_fnc_showHud - mask now takes 9 arguements in 1.62 [called with %1]",_this); + ACE_LOGWARNING_1("ace_common_fnc_showHud - mask now takes 9 arguments in 1.62 [called with %1]",_this); _mask pushBack true; }; From 005f17131ace78319ebd1273b6ad47cd2c8d820f Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 5 Jul 2016 23:06:44 +0200 Subject: [PATCH 3/3] Add Squad Radar UI setting --- addons/ui/ACE_Settings.hpp | 7 +++++++ addons/ui/CfgVehicles.hpp | 5 +++++ addons/ui/functions/fnc_moduleInit.sqf | 1 + addons/ui/functions/fnc_setElements.sqf | 2 +- addons/ui/script_component.hpp | 2 +- addons/ui/stringtable.xml | 5 ++++- 6 files changed, 19 insertions(+), 3 deletions(-) diff --git a/addons/ui/ACE_Settings.hpp b/addons/ui/ACE_Settings.hpp index e6c3e5e496..7e2c6bdf65 100644 --- a/addons/ui/ACE_Settings.hpp +++ b/addons/ui/ACE_Settings.hpp @@ -43,6 +43,13 @@ class ACE_Settings { value = 0; isClientSettable = 1; }; + class GVAR(squadRadar) { + category = CSTRING(Category); + displayName = CSTRING(SquadRadar); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; + }; // ADVANCED // Soldier diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index 0b1cc9b2a9..68dbce044c 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -42,6 +42,11 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 0; }; + class squadRadar { + displayName = CSTRING(SquadRadar); + typeName = "BOOL"; + defaultValue = 1; + }; // ADVANCED // Soldier diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index 6bfe29392f..d988d01639 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -30,6 +30,7 @@ if (isArray (missionConfigFile >> "showHUD")) then { [_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(groupBar), "groupBar"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(squadRadar), "squadRadar"] call EFUNC(common,readSettingFromModule); }; // Advanced diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index 8147bc3076..564f08d8d1 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -32,5 +32,5 @@ if (isArray (missionConfigFile >> "showHUD")) exitWith { GVAR(commandMenu), GVAR(groupBar), true, - true + GVAR(squadRadar) ]] call EFUNC(common,showHud); diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index 44ca977563..1af1a569a1 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -19,7 +19,7 @@ // Basic Elements -#define ELEMENTS_BASIC [QGVAR(soldierVehicleWeaponInfo), QGVAR(vehicleRadar), QGVAR(vehicleCompass), QGVAR(commandMenu), QGVAR(groupBar)] +#define ELEMENTS_BASIC [QGVAR(soldierVehicleWeaponInfo), QGVAR(vehicleRadar), QGVAR(vehicleCompass), QGVAR(commandMenu), QGVAR(groupBar), QGVAR(squadRadar)] /* RscUnitInfo = 300 diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 77b9ad66a9..94a316cf58 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -60,6 +60,9 @@ Barra de Grupo Barre de groupe + + Squad Radar + Weapon Name Název zbraně @@ -241,4 +244,4 @@ Impossible de modifier un élément de l'interface utilisateur forcé - \ No newline at end of file +