From dfca7b2f4426ecf049fb6eeac60a44d1ab9a8dfa Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 15 Jul 2015 05:51:13 +0200 Subject: [PATCH 01/13] Split UI configs, Removed Vignette, Initial work on selective UI --- addons/ui/$PBOPREFIX$ | 2 +- addons/ui/ACE_Settings.hpp | 37 +++++++++++++++ addons/ui/CfgEventHandlers.hpp | 11 +++++ addons/ui/CfgVehicles.hpp | 58 ++++++++++++++++++++++++ addons/ui/README.md | 3 +- addons/ui/RscChat.hpp | 15 ++++++ addons/ui/RscVignette.hpp | 4 ++ addons/ui/XEH_clientInit.sqf | 63 ++++++++++++++++++++++++++ addons/ui/XEH_preInit.sqf | 7 +++ addons/ui/config.cpp | 24 +++------- addons/ui/functions/fnc_moduleInit.sqf | 29 ++++++++++++ addons/ui/stringtable.xml | 50 ++++++++++++++++++++ 12 files changed, 284 insertions(+), 19 deletions(-) create mode 100644 addons/ui/ACE_Settings.hpp create mode 100644 addons/ui/CfgEventHandlers.hpp create mode 100644 addons/ui/CfgVehicles.hpp create mode 100644 addons/ui/RscChat.hpp create mode 100644 addons/ui/RscVignette.hpp create mode 100644 addons/ui/XEH_clientInit.sqf create mode 100644 addons/ui/XEH_preInit.sqf create mode 100644 addons/ui/functions/fnc_moduleInit.sqf create mode 100644 addons/ui/stringtable.xml diff --git a/addons/ui/$PBOPREFIX$ b/addons/ui/$PBOPREFIX$ index 601bbd5f60..9b6ac48f4f 100644 --- a/addons/ui/$PBOPREFIX$ +++ b/addons/ui/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\ui \ No newline at end of file +z\ace\addons\ui \ No newline at end of file diff --git a/addons/ui/ACE_Settings.hpp b/addons/ui/ACE_Settings.hpp new file mode 100644 index 0000000000..09bdb47634 --- /dev/null +++ b/addons/ui/ACE_Settings.hpp @@ -0,0 +1,37 @@ +class ACE_Settings { + class GVAR(weaponInfo) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(WeaponInfo); + }; + class GVAR(weaponName) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(WeaponName); + }; + /*class GVAR(ammoCount) { // Disabled in config by ace_reload + value = 1; + typeName = "BOOL"; + displayName = CSTRING(AmmoCount); + };*/ + class GVAR(magCount) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(MagCount); + }; + class GVAR(grenadeName) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(GrenadeName); + }; + class GVAR(grenadeCount) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(GrenadeCount); + }; + class GVAR(zeroing) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(Zeroing); + }; +}; diff --git a/addons/ui/CfgEventHandlers.hpp b/addons/ui/CfgEventHandlers.hpp new file mode 100644 index 0000000000..423993f757 --- /dev/null +++ b/addons/ui/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); + }; +}; diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp new file mode 100644 index 0000000000..f918360518 --- /dev/null +++ b/addons/ui/CfgVehicles.hpp @@ -0,0 +1,58 @@ +class CfgVehicles { + class ACE_Module; + class ACE_ModuleUI: ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(ModuleDisplayName); + function = QFUNC(moduleInit); + scope = 2; + isGlobal = 1; + //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); + class Arguments { + class weaponInfo { + displayName = CSTRING(WeaponInfo); + description = CSTRING(WeaponInfoDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + class weaponName { + displayName = CSTRING(WeaponName); + description = CSTRING(WeaponNameDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + /*class ammoCount { // Disabled in config by ace_reload + displayName = CSTRING(AmmoCount); + description = CSTRING(AmmoCountDesc); + typeName = "BOOL"; + defaultValue = 1; + };*/ + class magCount { + displayName = CSTRING(MagCount); + description = CSTRING(MagCountDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + class grenadeName { + displayName = CSTRING(GrenadeName); + description = CSTRING(GrenadeNameDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + class grenadeCount { + displayName = CSTRING(GrenadeCount); + description = CSTRING(GrenadeCountDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + class zeroing { + displayName = CSTRING(Zeroing); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = CSTRING(ModuleDescription); + }; + }; +}; diff --git a/addons/ui/README.md b/addons/ui/README.md index f11027038f..b3c2b3acb7 100644 --- a/addons/ui/README.md +++ b/addons/ui/README.md @@ -1,9 +1,10 @@ ace_ui ======= -Changes the chat contrast on the map to allow easier reading +Changes the chat contrast on the map to allow easier reading, removes vignette and provides settings to toggle different UI elements unavailable in Vanilla. ## Maintainers The people responsible for merging changes to this component or answering potential questions. +- [Jonpas] (https://github.com/jonpas) diff --git a/addons/ui/RscChat.hpp b/addons/ui/RscChat.hpp new file mode 100644 index 0000000000..6b091d73bc --- /dev/null +++ b/addons/ui/RscChat.hpp @@ -0,0 +1,15 @@ +class RscText; +class RscDisplayChat { + class controls { + delete Line; + delete Background; + class CA_Background: RscText { + colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker + }; + }; +}; + +class RscChatListDefault { + colorBackground[] = {0,0,0,0.5}; // Make the chat background darker + colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter +}; diff --git a/addons/ui/RscVignette.hpp b/addons/ui/RscVignette.hpp new file mode 100644 index 0000000000..118fad96e6 --- /dev/null +++ b/addons/ui/RscVignette.hpp @@ -0,0 +1,4 @@ +class RscPicture; +class RscVignette: RscPicture { + colorText[] = {0, 0, 0, 0}; // Hide Vignette +}; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf new file mode 100644 index 0000000000..fec845d49a --- /dev/null +++ b/addons/ui/XEH_clientInit.sqf @@ -0,0 +1,63 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + +// Exit on Headless +if !(hasInterface) exitWith {}; + +["SettingsInitialized", { + // On load and entering/exiting a vehicle + ["infoDisplayChanged", { + LOG("UI infoDisplayChanged"); + + private ["_elements", "_display"]; + + // All elements with their show/hide, IDD and IDC + _elements = [ + [GVAR(weaponInfo), 300, 2302], + [GVAR(weaponName), 300, 118], + //[GVAR(ammoCount), 300, 184], // Disabled in config by ace_reload + [GVAR(magCount), 300, 185], + [GVAR(grenadeName), 300, 152], + [GVAR(grenadeCount), 300, 151], + [GVAR(zeroing), 300, 168] + ]; + + disableSerialization; + { + _display = _x; + { + EXPLODE_3_PVT(_x,_show,_idd,_idc); + + //_idd = 300; //debug + //_idc = 122; //debug + if (_idd == ctrlIDD _display) then { + _show = if (_show) then {0} else {1}; + + (_display displayCtrl _idc) ctrlSetFade _show; + (_display displayCtrl _idc) ctrlCommit 0; + }; + } forEach _elements; + } forEach (uiNamespace getVariable "IGUI_displays"); // Those displays can be present several times for some reason + }] call EFUNC(common,addEventHandler); +}] call EFUNC(common,addEventHandler); + + +/* +RscUnitInfo = 300 +-------- +Alt = 122 (UNKNOWN) +Ammo = 119 (UNKNOWN) +AmmoCount = 184 (Ammo Count) +MagCount = 185 (Magazine Count) +CA_TextFlares = 151 (Grenade Count) +CA_TextFlaresMode = 152 (Grenade Name) +CA_Zeroing = 168 (Zeroing) +Weapon = 118 (Weapon Name) +WeaponInfoControlsGroupLeft = 2302 (entire Weapon Info without Zeroing and Stance) +WeaponInfoControlsGroupRight = 2303 (UNKNOWN) + + +RscStanceInfo = 303 +------- +StanceIndicator = 188 (UNKNOWN) +*/ diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf new file mode 100644 index 0000000000..7e1c3ec9ed --- /dev/null +++ b/addons/ui/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(moduleInit); + +ADDON = true; diff --git a/addons/ui/config.cpp b/addons/ui/config.cpp index e7ea4b32eb..fa10420277 100644 --- a/addons/ui/config.cpp +++ b/addons/ui/config.cpp @@ -6,25 +6,15 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"VKing"}; - authorUrl = "https://github.com/ACEMod/"; + author[] = {"VKing", "Jonpas"}; + authorUrl = "https://github.com/acemod/ACE3"; VERSION_CONFIG; }; }; -class RscText; +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "ACE_Settings.hpp" -class RscDisplayChat { - class controls { - delete Line; - delete Background; - class CA_Background: RscText { - colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker - }; - }; -}; - -class RscChatListDefault { - colorBackground[] = {0,0,0,0.5}; // Make the chat background darker - colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter -}; +#include "RscChat.hpp" +#include "RscVignette.hpp" diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf new file mode 100644 index 0000000000..02d9c2ecbf --- /dev/null +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -0,0 +1,29 @@ +/* + * Author: Jonpas + * Initializes the UI module. + * + * Arguments: + * 0: Module Logic + * 1: Units + * 2: Activated + * + * Return Value: + * None + */ +#include "script_component.hpp" + +if !(isServer) exitWith {}; + +PARAMS_3(_logic,_units,_activated); + +if !(_activated) exitWith {}; + +[_logic, QGVAR(weaponInfo), "weaponInfo"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); +//[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); // Disabled in config by ace_reload +[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(grenadeName), "grenadeName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(grenadeCount), "grenadeCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); + +diag_log text "[ACE]: UI Module Initialized."; diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml new file mode 100644 index 0000000000..b33c28292d --- /dev/null +++ b/addons/ui/stringtable.xml @@ -0,0 +1,50 @@ + + + + + Weapon Info + + + Entire weapon info interface (weapon name, firing mode, magazine info, ammo count, magazine count, grenade count) except zeroing. + + + Weapon Name + + + Requires enabled Weapon Info + + + Ammo Count + + + Requires enabled Weapon Info + + + Magazine Count + + + Requires enabled Weapon Info + + + Grenade Name + + + Requires enabled Weapon Info + + + Grenade Count + + + Requires enabled Weapon Info + + + Zeroing + + + User Interface + + + This module allows hiding of specific user interface parts. + + + \ No newline at end of file From 7d792f9d1471ba99e25e125be7573524b5c5355d Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 20 Jul 2015 04:50:25 +0200 Subject: [PATCH 02/13] Proper Vignette removal, Fixed stringtable typo --- addons/ui/RscVignette.hpp | 2 +- addons/ui/XEH_clientInit.sqf | 2 +- addons/ui/stringtable.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/ui/RscVignette.hpp b/addons/ui/RscVignette.hpp index 118fad96e6..1da39c2118 100644 --- a/addons/ui/RscVignette.hpp +++ b/addons/ui/RscVignette.hpp @@ -1,4 +1,4 @@ class RscPicture; class RscVignette: RscPicture { - colorText[] = {0, 0, 0, 0}; // Hide Vignette + text = ""; // Remove Vignette Texture }; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index fec845d49a..d6b0883d4d 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -53,7 +53,7 @@ CA_TextFlares = 151 (Grenade Count) CA_TextFlaresMode = 152 (Grenade Name) CA_Zeroing = 168 (Zeroing) Weapon = 118 (Weapon Name) -WeaponInfoControlsGroupLeft = 2302 (entire Weapon Info without Zeroing and Stance) +WeaponInfoControlsGroupLeft = 2302 (entire RscUnitInfo without Zeroing) WeaponInfoControlsGroupRight = 2303 (UNKNOWN) diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index b33c28292d..daabe80453 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -10,7 +10,7 @@ Weapon Name - + Requires enabled Weapon Info From 94ce49fedc8e37e3f408be0cd43a9d6a152729ca Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 28 Oct 2015 23:23:02 +0100 Subject: [PATCH 03/13] Add selective UI --- addons/ui/ACE_Settings.hpp | 161 +++++++++++++++++- addons/ui/CfgVehicles.hpp | 160 ++++++++++++++--- addons/ui/XEH_clientInit.sqf | 84 ++++----- addons/ui/XEH_preInit.sqf | 3 + addons/ui/functions/fnc_moduleInit.sqf | 25 +-- .../ui/functions/fnc_moduleInitAdvanced.sqf | 42 +++++ .../ui/functions/fnc_setAdvancedElement.sqf | 43 +++++ addons/ui/functions/fnc_setElements.sqf | 44 +++++ addons/ui/functions/script_component.hpp | 1 + addons/ui/script_component.hpp | 72 ++++++++ addons/ui/stringtable.xml | 103 ++++++++--- 11 files changed, 613 insertions(+), 125 deletions(-) create mode 100644 addons/ui/functions/fnc_moduleInitAdvanced.sqf create mode 100644 addons/ui/functions/fnc_setAdvancedElement.sqf create mode 100644 addons/ui/functions/fnc_setElements.sqf create mode 100644 addons/ui/functions/script_component.hpp diff --git a/addons/ui/ACE_Settings.hpp b/addons/ui/ACE_Settings.hpp index 09bdb47634..53e1496b38 100644 --- a/addons/ui/ACE_Settings.hpp +++ b/addons/ui/ACE_Settings.hpp @@ -1,37 +1,182 @@ class ACE_Settings { - class GVAR(weaponInfo) { +// BASIC + class GVAR(soldierVehicleWeaponInfo) { value = 1; typeName = "BOOL"; - displayName = CSTRING(WeaponInfo); + isClientSettable = 1; + displayName = CSTRING(SoldierVehicleWeaponInfo); + category = CSTRING(Category); }; + class GVAR(vehicleRadar) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleRadar); + category = CSTRING(Category); + }; + class GVAR(vehicleCompass) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleCompass); + category = CSTRING(Category); + }; + class GVAR(commandMenu) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(CommandMenu); + category = CSTRING(Category); + }; + class GVAR(groupBar) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(GroupBar); + category = CSTRING(Category); + }; + +// ADVANCED + // Upper Weapon Info class GVAR(weaponName) { value = 1; typeName = "BOOL"; + isClientSettable = 1; displayName = CSTRING(WeaponName); + category = CSTRING(Category); }; - /*class GVAR(ammoCount) { // Disabled in config by ace_reload + class GVAR(weaponNameBackground) { value = 1; typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(WeaponNameBackground); + category = CSTRING(Category); + }; + class GVAR(firingMode) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(FiringMode); + category = CSTRING(Category); + }; + + // Lower Weapon Info + class GVAR(ammoType) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(AmmoType); + category = CSTRING(Category); + }; + class GVAR(ammoCount) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; displayName = CSTRING(AmmoCount); - };*/ + description = CSTRING(AmmoCountDesc); + category = CSTRING(Category); + }; class GVAR(magCount) { value = 1; typeName = "BOOL"; + isClientSettable = 1; displayName = CSTRING(MagCount); + category = CSTRING(Category); }; - class GVAR(grenadeName) { + class GVAR(grenadeFlareType) { value = 1; typeName = "BOOL"; - displayName = CSTRING(GrenadeName); + isClientSettable = 1; + displayName = CSTRING(GrenadeFlareType); + category = CSTRING(Category); }; - class GVAR(grenadeCount) { + class GVAR(grenadeFlareCount) { value = 1; typeName = "BOOL"; - displayName = CSTRING(GrenadeCount); + isClientSettable = 1; + displayName = CSTRING(GrenadeFlareCount); + category = CSTRING(Category); }; class GVAR(zeroing) { value = 1; typeName = "BOOL"; + isClientSettable = 1; displayName = CSTRING(Zeroing); + category = CSTRING(Category); + }; + class GVAR(weaponLowerInfoBackground) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(WeaponLowerInfoBackground); //todo + category = CSTRING(Category); + }; + + // Stance + class GVAR(stance) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(Stance); + category = CSTRING(Category); + }; + + + // Vehicle + class GVAR(vehicleName) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleName); + category = CSTRING(Category); + }; + class GVAR(vehicleNameBackground) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleNameBackground); + category = CSTRING(Category); + }; + class GVAR(vehicleFuelBar) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleFuelBar); + category = CSTRING(Category); + }; + class GVAR(vehicleSpeed) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleSpeed); + category = CSTRING(Category); + }; + class GVAR(vehicleAltitude) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleAltitude); + category = CSTRING(Category); + }; + class GVAR(vehicleDamage) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleDamage); + category = CSTRING(Category); + }; + class GVAR(vehicleInfoBackground) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleInfoBackground); + category = CSTRING(Category); + }; + class GVAR(vehicleGunnerWeapon) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(VehicleGunnerWeapon); + category = CSTRING(Category); }; }; diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index f918360518..69f28f955e 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -1,52 +1,38 @@ class CfgVehicles { class ACE_Module; + + // Basic class ACE_ModuleUI: ACE_Module { author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = CSTRING(ModuleDisplayName); + displayName = CSTRING(ModuleName); function = QFUNC(moduleInit); scope = 2; isGlobal = 1; //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); class Arguments { - class weaponInfo { - displayName = CSTRING(WeaponInfo); - description = CSTRING(WeaponInfoDesc); + class soldierVehicleWeaponInfo { + displayName = CSTRING(SoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; - class weaponName { - displayName = CSTRING(WeaponName); - description = CSTRING(WeaponNameDesc); + class vehicleRadar { + displayName = CSTRING(VehicleRadar); typeName = "BOOL"; defaultValue = 1; }; - /*class ammoCount { // Disabled in config by ace_reload - displayName = CSTRING(AmmoCount); - description = CSTRING(AmmoCountDesc); - typeName = "BOOL"; - defaultValue = 1; - };*/ - class magCount { - displayName = CSTRING(MagCount); - description = CSTRING(MagCountDesc); + class vehicleCompass { + displayName = CSTRING(VehicleCompass); typeName = "BOOL"; defaultValue = 1; }; - class grenadeName { - displayName = CSTRING(GrenadeName); - description = CSTRING(GrenadeNameDesc); + class commandMenu { + displayName = CSTRING(CommandMenu); typeName = "BOOL"; defaultValue = 1; }; - class grenadeCount { - displayName = CSTRING(GrenadeCount); - description = CSTRING(GrenadeCountDesc); - typeName = "BOOL"; - defaultValue = 1; - }; - class zeroing { - displayName = CSTRING(Zeroing); + class groupBar { + displayName = CSTRING(GroupBar); typeName = "BOOL"; defaultValue = 1; }; @@ -55,4 +41,124 @@ class CfgVehicles { description = CSTRING(ModuleDescription); }; }; + + // Advanced + class ACE_ModuleUI_Advanced: ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(ModuleName_Advanced); + function = QFUNC(moduleInitAdvanced); + scope = 2; + isGlobal = 1; + //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); + class Arguments { + // Upper Weapon Info + class weaponName { + displayName = CSTRING(WeaponName); + typeName = "BOOL"; + defaultValue = 1; + }; + class weaponNameBackground { + displayName = CSTRING(WeaponNameBackground); + typeName = "BOOL"; + defaultValue = 1; + }; + class firingMode { + displayName = CSTRING(FiringMode); + typeName = "BOOL"; + defaultValue = 1; + }; + + // Lower Weapon Info + class ammoType { + displayName = CSTRING(AmmoType); + typeName = "BOOL"; + defaultValue = 1; + }; + class ammoCount { + displayName = CSTRING(AmmoCount); + description = CSTRING(AmmoCountDesc); + typeName = "BOOL"; + defaultValue = 1; + }; + class magCount { + displayName = CSTRING(MagCount); + typeName = "BOOL"; + defaultValue = 1; + }; + class grenadeFlareType { + displayName = CSTRING(GrenadeFlareType); + typeName = "BOOL"; + defaultValue = 1; + }; + class grenadeFlareCount { + displayName = CSTRING(GrenadeFlareCount); + typeName = "BOOL"; + defaultValue = 1; + }; + class zeroing { + displayName = CSTRING(Zeroing); + typeName = "BOOL"; + defaultValue = 1; + }; + class weaponLowerInfoBackground { + displayName = CSTRING(WeaponLowerInfoBackground); + typeName = "BOOL"; + defaultValue = 1; + }; + + // Stance + class stance { + displayName = CSTRING(Stance); + typeName = "BOOL"; + defaultValue = 1; + }; + + + // Vehicle + class vehicleName { + displayName = CSTRING(VehicleName); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleNameBackground { + displayName = CSTRING(VehicleNameBackground); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleFuelBar { + displayName = CSTRING(VehicleFuelBar); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleSpeed { + displayName = CSTRING(VehicleSpeed); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleAltitude { + displayName = CSTRING(VehicleAltitude); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleDamage { + displayName = CSTRING(VehicleDamage); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleInfoBackground { + displayName = CSTRING(VehicleInfoBackground); + typeName = "BOOL"; + defaultValue = 1; + }; + class vehicleGunnerWeapon { + displayName = CSTRING(VehicleGunnerWeapon); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = CSTRING(ModuleDescription_Advanced); + }; + }; }; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index d6b0883d4d..d778fb2746 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -1,63 +1,41 @@ -#define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" // Exit on Headless -if !(hasInterface) exitWith {}; +if (!hasInterface) exitWith {}; ["SettingsInitialized", { + // Selective UI Basic + call FUNC(setElements); + + // On load and entering/exiting a vehicle ["infoDisplayChanged", { - LOG("UI infoDisplayChanged"); - - private ["_elements", "_display"]; - - // All elements with their show/hide, IDD and IDC - _elements = [ - [GVAR(weaponInfo), 300, 2302], - [GVAR(weaponName), 300, 118], - //[GVAR(ammoCount), 300, 184], // Disabled in config by ace_reload - [GVAR(magCount), 300, 185], - [GVAR(grenadeName), 300, 152], - [GVAR(grenadeCount), 300, 151], - [GVAR(zeroing), 300, 168] - ]; - - disableSerialization; + // Selective UI Advanced { - _display = _x; - { - EXPLODE_3_PVT(_x,_show,_idd,_idc); - - //_idd = 300; //debug - //_idc = 122; //debug - if (_idd == ctrlIDD _display) then { - _show = if (_show) then {0} else {1}; - - (_display displayCtrl _idc) ctrlSetFade _show; - (_display displayCtrl _idc) ctrlCommit 0; - }; - } forEach _elements; - } forEach (uiNamespace getVariable "IGUI_displays"); // Those displays can be present several times for some reason + _x call FUNC(setAdvancedElement); + } forEach ELEMENTS_ADVANCED; }] call EFUNC(common,addEventHandler); + + + ["SettingChanged", { + params ["_name"]; + + // Selective UI Basic + if (_name in ELEMENTS_BASIC) then { + call FUNC(setElements); + }; + + // Selective UI Advanced + { + _x params ["_element"]; + + if (_name == _element) then { + _x call FUNC(setAdvancedElement); + TRACE_2("Setting Changed",_name,_element); + }; + } forEach ELEMENTS_ADVANCED; + + }] call EFUNC(common,addEventHandler); + }] call EFUNC(common,addEventHandler); - - -/* -RscUnitInfo = 300 --------- -Alt = 122 (UNKNOWN) -Ammo = 119 (UNKNOWN) -AmmoCount = 184 (Ammo Count) -MagCount = 185 (Magazine Count) -CA_TextFlares = 151 (Grenade Count) -CA_TextFlaresMode = 152 (Grenade Name) -CA_Zeroing = 168 (Zeroing) -Weapon = 118 (Weapon Name) -WeaponInfoControlsGroupLeft = 2302 (entire RscUnitInfo without Zeroing) -WeaponInfoControlsGroupRight = 2303 (UNKNOWN) - - -RscStanceInfo = 303 -------- -StanceIndicator = 188 (UNKNOWN) -*/ diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf index 7e1c3ec9ed..8a86e3ec32 100644 --- a/addons/ui/XEH_preInit.sqf +++ b/addons/ui/XEH_preInit.sqf @@ -3,5 +3,8 @@ ADDON = false; PREP(moduleInit); +PREP(moduleInitAdvanced); +PREP(setAdvancedElement); +PREP(setElements); ADDON = true; diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index 02d9c2ecbf..f4a57831c8 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -12,18 +12,21 @@ */ #include "script_component.hpp" -if !(isServer) exitWith {}; +if (!isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; -if !(_activated) exitWith {}; +if (!_activated) exitWith {}; -[_logic, QGVAR(weaponInfo), "weaponInfo"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); -//[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); // Disabled in config by ace_reload -[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(grenadeName), "grenadeName"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(grenadeCount), "grenadeCount"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); +// Exit if HUD visibility is hardcoded in mission config and showHUD command is overriden +if (isArray (missionConfigFile >> "showHUD")) exitWith { + ACE_LOGINFO("User Interface (Basic) Module Failed to Initialize - showHUD overriden in mission config!"); +}; -diag_log text "[ACE]: UI Module Initialized."; +[_logic, QGVAR(soldierVehicleWeaponInfo), "soldierVehicleWeaponInfo"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleRadar), "vehicleRadar"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(groupBar), "groupBar"] call EFUNC(common,readSettingFromModule); + +ACE_LOGINFO("User Interface (Basic) Module Initialized."); diff --git a/addons/ui/functions/fnc_moduleInitAdvanced.sqf b/addons/ui/functions/fnc_moduleInitAdvanced.sqf new file mode 100644 index 0000000000..ab5666af69 --- /dev/null +++ b/addons/ui/functions/fnc_moduleInitAdvanced.sqf @@ -0,0 +1,42 @@ +/* + * Author: Jonpas + * Initializes the UI module. + * + * Arguments: + * 0: Module Logic + * 1: Units + * 2: Activated + * + * Return Value: + * None + */ +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +params ["_logic", "_units", "_activated"]; + +if (!_activated) exitWith {}; + +[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(weaponNameBackground), "weaponNameBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(firingMode), "firingMode"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(ammoType), "ammoType"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(grenadeFlareType), "grenadeFlareType"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(grenadeFlareCount), "grenadeFlareCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(weaponLowerInfoBackground), "weaponLowerInfoBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(stance), "stance"] call EFUNC(common,readSettingFromModule); + +[_logic, QGVAR(vehicleName), "vehicleName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleNameBackground), "vehicleNameBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleFuelBar), "vehicleFuelBar"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleSpeed), "vehicleSpeed"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleAltitude), "vehicleAltitude"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleDamage), "vehicleDamage"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleInfoBackground), "vehicleInfoBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleGunnerWeapon), "vehicleGunnerWeapon"] call EFUNC(common,readSettingFromModule); + +ACE_LOGINFO("User Interface (Advanced) Module Initialized."); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf new file mode 100644 index 0000000000..c87a79ffae --- /dev/null +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -0,0 +1,43 @@ +/* + * Author: Jonpas + * Sets advanced visible element of the UI using displays and controls. + * + * Arguments: + * 0: Show/Hide Element OR Element Variable + * 1: Element IDD + * 2: Element IDCs + * + * Return Value: + * None + * + * Example: + * [show, 303, [188] ] call ace_ui_fnc_setAdvancedElement + * + * Public: No + */ +#include "script_component.hpp" + +params ["_show", "_idd", "_elements"]; + + +// Get show/hide boolean from mission namespace if it's a string +if (typeName _show == "STRING") then { + _show = missionNamespace getVariable _show; +}; +_show = [1, 0] select _show; + + +// Disable/Enable elements +{ + local _idc = _x; + + // Loop through IGUI displays as they can be present several times for some reason + { + if (_idd == ctrlIDD _x) then { + TRACE_3("Setting Element Visibility",_show,_idd,_idc); + + (_x displayCtrl _idc) ctrlSetFade _show; + (_x displayCtrl _idc) ctrlCommit 0; + }; + } forEach (uiNamespace getVariable "IGUI_displays"); +} forEach _elements; diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf new file mode 100644 index 0000000000..3952d8e337 --- /dev/null +++ b/addons/ui/functions/fnc_setElements.sqf @@ -0,0 +1,44 @@ +/* + * Author: Jonpas + * Sets basic visible elements of the UI using showHUD setter. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_ui_fnc_setBasicElements + * + * Public: No + */ +#include "script_component.hpp" + +//@todo - change to EFUNC(common,showHud) setter + +local _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors] + +showHUD [ + _shownHUD select 0, + GVAR(soldierVehicleWeaponInfo), + GVAR(vehicleRadar), + GVAR(vehicleCompass), + _shownHUD select 4, + GVAR(commandMenu), + GVAR(groupBar), + _shownHUD select 7 +]; + +/* +["UIselective", [ + _shownHUD select 0, + _shownHUD select 1, + _shownHUD select 2, + _shownHUD select 3, + _shownHUD select 4, + GVAR(commandMenu), + _shownHUD select 6, + _shownHUD select 7 +]] call EFUNC(common,showHud); +*/ diff --git a/addons/ui/functions/script_component.hpp b/addons/ui/functions/script_component.hpp new file mode 100644 index 0000000000..656228f742 --- /dev/null +++ b/addons/ui/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\ui\script_component.hpp" diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index a0fa713f9f..2a9e582306 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -10,3 +10,75 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + + +// Elements +#define ELEMENTS_BASIC [QGVAR(soldierVehicleWeaponInfo), QGVAR(vehicleRadar), QGVAR(vehicleCompass), QGVAR(commandMenu), QGVAR(groupBar)] + +// Element, IDD, IDC +#define ELEMENTS_ADVANCED [ \ + [QGVAR(weaponName), 300, [118] ], \ + [QGVAR(weaponNameBackground), 300, [1001, 1008] ], \ + [QGVAR(firingMode), 300, [187, 1203] ], \ + [QGVAR(ammoType), 300, [155] ], \ + [QGVAR(ammoCount), 300, [184] ], \ + [QGVAR(magCount), 300, [185] ], \ + [QGVAR(grenadeName), 300, [152] ], \ + [QGVAR(grenadeCount), 300, [151] ], \ + [QGVAR(weaponLowerInfoBackground), 300, [1202] ], \ + [QGVAR(zeroing), 300, [168] ], \ + [QGVAR(stance), 303, [188, 1201] ], \ + [QGVAR(vehicleName), 300, [120] ], \ + [QGVAR(vehicleNameBackground), 300, [1000, 1013] ], \ + [QGVAR(vehicleFuelBar), 300, [113, 1202] ], \ + [QGVAR(vehicleSpeed), 300, [121, 1004, 1006] ], \ + [QGVAR(vehicleAltitude), 300, [122, 1005, 1014] ], \ + [QGVAR(vehicleDamage), 300, [111] ], \ + [QGVAR(vehicleInfoBackground), 300, [1200] ], \ + [QGVAR(vehicleGunnerWeapon), 300, [150] ] \ +] + + +/* +RscUnitInfo = 300 +-------------------- +118 (Weapon Name) ++ 1001 (Weapon Name Background 1/2) ++ 1008 (Weapon Name Background 2/2) + +187 (Firing Mode) ++ 1203 (Firing Mode Background) + +155 (Ammo Type) +184 (Ammo Count) - disabled in config by ace_reload +185 (Magazine Count) +152 (Grenade/Flare Type) +151 (Grenade/Flare Count) +1202 (Lower Weapon Info Background) +168 (Zeroing) + + +120 (Vehicle Name) +1000 (Vehicle Name Background 1/2) ++ 1013 (Vehicle Name Background 2/2) + +113 (Vehicle Fuel Bar) ++ 1202 (Vehicle Fuel Bar Background) + +121 (Vehicle Speed Number) ++ 1004 (Vehicle Speed Unit) ++ 1006 (Vehicle Speed Background) +122 (Vehicle Altitude Number) ++ 1005 (Vehicle Altitude Units) ++ 1014 (Vehicle Altitude Background) +111 (Vehicle Damage) +1200 (Vehicle Info Background) + +150 (Vehicle Gunner Weapon) + + +RscStanceInfo = 303 +-------------------- +188 (Stance) ++ 1201 (Stance Background) +*/ diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index daabe80453..e320d3ce39 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -1,50 +1,101 @@ - + - - Weapon Info + + User Interface - - Entire weapon info interface (weapon name, firing mode, magazine info, ammo count, magazine count, grenade count) except zeroing. + + + User Interface (Basic) + + This module allows hiding of basic user interface parts. Makes some User Interface (Advanced) settings inoperable. + + + + Soldier/Vehicle/Weapon Information + + + Vehicle Radar + + + Vehicle Compass + + + Command Menu + + + Group Bar + + + + + User Interface (Advanced) + + + This module allows hiding of specific user interface parts, more detailed than basic. User Interface (Basic) settings will make some of the settings inoperable. + + Weapon Name - - Requires enabled Weapon Info + + Weapon Name Background + + + Firing Mode + + + Ammo Type Ammo Count - Requires enabled Weapon Info + Always disabled on foot by ace_reload. Magazine Count - - Requires enabled Weapon Info + + Grenade/Flare Type - - Grenade Name - - - Requires enabled Weapon Info - - - Grenade Count - - - Requires enabled Weapon Info + + Grenade/Flare Count Zeroing - - User Interface + + Weapon Lower Info Background - - This module allows hiding of specific user interface parts. + + Stance + + + + Vehicle Name + + + Vehicle Name Background + + + Vehicle Fuel Bar + + + Vehicle Speed + + + Vehicle Altitude + + + Vehicle Damage + + + Vehicle Info Background + + + Vehicle Gunner Weapon - \ No newline at end of file + From a064c0c98db5b5e98a82ac0478bbd5d929c916fa Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 6 Mar 2016 12:50:16 +0100 Subject: [PATCH 04/13] Modernize code --- addons/ui/CfgEventHandlers.hpp | 6 ++++++ addons/ui/XEH_PREP.hpp | 4 ++++ addons/ui/XEH_preInit.sqf | 5 +---- addons/ui/XEH_preStart.sqf | 3 +++ .../ui/functions/fnc_setAdvancedElement.sqf | 4 ++-- addons/ui/functions/fnc_setElements.sqf | 21 +++---------------- 6 files changed, 19 insertions(+), 24 deletions(-) create mode 100644 addons/ui/XEH_PREP.hpp create mode 100644 addons/ui/XEH_preStart.sqf diff --git a/addons/ui/CfgEventHandlers.hpp b/addons/ui/CfgEventHandlers.hpp index 423993f757..36c0fca8a3 100644 --- a/addons/ui/CfgEventHandlers.hpp +++ b/addons/ui/CfgEventHandlers.hpp @@ -1,3 +1,9 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); diff --git a/addons/ui/XEH_PREP.hpp b/addons/ui/XEH_PREP.hpp new file mode 100644 index 0000000000..222afadf25 --- /dev/null +++ b/addons/ui/XEH_PREP.hpp @@ -0,0 +1,4 @@ +PREP(moduleInit); +PREP(moduleInitAdvanced); +PREP(setAdvancedElement); +PREP(setElements); diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf index 8a86e3ec32..a7feade1c3 100644 --- a/addons/ui/XEH_preInit.sqf +++ b/addons/ui/XEH_preInit.sqf @@ -2,9 +2,6 @@ ADDON = false; -PREP(moduleInit); -PREP(moduleInitAdvanced); -PREP(setAdvancedElement); -PREP(setElements); +#include "XEH_PREP.hpp" ADDON = true; diff --git a/addons/ui/XEH_preStart.sqf b/addons/ui/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/ui/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index c87a79ffae..e5fc66d565 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -11,7 +11,7 @@ * None * * Example: - * [show, 303, [188] ] call ace_ui_fnc_setAdvancedElement + * [show, 303, [188]] call ace_ui_fnc_setAdvancedElement * * Public: No */ @@ -29,7 +29,7 @@ _show = [1, 0] select _show; // Disable/Enable elements { - local _idc = _x; + private _idc = _x; // Loop through IGUI displays as they can be present several times for some reason { diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index 3952d8e337..1a9ca73399 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -9,17 +9,15 @@ * None * * Example: - * call ace_ui_fnc_setBasicElements + * [] call ace_ui_fnc_setElements * * Public: No */ #include "script_component.hpp" -//@todo - change to EFUNC(common,showHud) setter +private _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors] -local _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors] - -showHUD [ +["ui", [ _shownHUD select 0, GVAR(soldierVehicleWeaponInfo), GVAR(vehicleRadar), @@ -28,17 +26,4 @@ showHUD [ GVAR(commandMenu), GVAR(groupBar), _shownHUD select 7 -]; - -/* -["UIselective", [ - _shownHUD select 0, - _shownHUD select 1, - _shownHUD select 2, - _shownHUD select 3, - _shownHUD select 4, - GVAR(commandMenu), - _shownHUD select 6, - _shownHUD select 7 ]] call EFUNC(common,showHud); -*/ From 9b46e8856e800359503174dff788bdf7c91fad47 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 6 Mar 2016 15:41:17 +0100 Subject: [PATCH 05/13] Merge modules, Add base allow client settings toggle, Add requires descriptions --- addons/reload/RscInGameUI.hpp | 24 -- addons/reload/config.cpp | 2 - addons/ui/ACE_Settings.hpp | 224 ++++++++++-------- addons/ui/CfgVehicles.hpp | 62 ++--- addons/ui/XEH_PREP.hpp | 1 - addons/ui/XEH_clientInit.sqf | 22 +- addons/ui/functions/fnc_moduleInit.sqf | 27 ++- .../ui/functions/fnc_moduleInitAdvanced.sqf | 42 ---- .../ui/functions/fnc_setAdvancedElement.sqf | 18 +- addons/ui/functions/fnc_setElements.sqf | 10 +- addons/ui/script_component.hpp | 8 +- addons/ui/stringtable.xml | 39 ++- 12 files changed, 240 insertions(+), 239 deletions(-) delete mode 100644 addons/reload/RscInGameUI.hpp delete mode 100644 addons/ui/functions/fnc_moduleInitAdvanced.sqf diff --git a/addons/reload/RscInGameUI.hpp b/addons/reload/RscInGameUI.hpp deleted file mode 100644 index 7310690f16..0000000000 --- a/addons/reload/RscInGameUI.hpp +++ /dev/null @@ -1,24 +0,0 @@ - -class RscControlsGroup; -class RscText; - -class RscInGameUI { - class RscUnitInfo { - // Soldiers - class WeaponInfoControlsGroupLeft: RscControlsGroup { - class controls { - class CA_AmmoCount: RscText { - sizeEx = 0; - }; - }; - }; - // Vehicles - /*class WeaponInfoControlsGroupRight: RscControlsGroup { - class controls { - class CA_AmmoCount: RscText { - sizeEx = 0; - }; - }; - };*/ - }; -}; diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 6ded1cd687..86ba809a93 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -20,6 +20,4 @@ class CfgPatches { #include "CfgActions.hpp" -#include "RscInGameUI.hpp" - #include "ACE_Settings.hpp" diff --git a/addons/ui/ACE_Settings.hpp b/addons/ui/ACE_Settings.hpp index 53e1496b38..3e5c53d328 100644 --- a/addons/ui/ACE_Settings.hpp +++ b/addons/ui/ACE_Settings.hpp @@ -1,182 +1,208 @@ class ACE_Settings { + class GVAR(allowSelectiveUI) { + category = CSTRING(Category); + displayName = CSTRING(AllowSelectiveUI); + description = CSTRING(AllowSelectiveUI_Description); + typeName = "BOOL"; + value = 1; + }; + // BASIC class GVAR(soldierVehicleWeaponInfo) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(SoldierVehicleWeaponInfo); category = CSTRING(Category); + displayName = CSTRING(SoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleRadar) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleRadar); category = CSTRING(Category); + displayName = CSTRING(VehicleRadar); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleCompass) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleCompass); category = CSTRING(Category); + displayName = CSTRING(VehicleCompass); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(commandMenu) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(CommandMenu); category = CSTRING(Category); + displayName = CSTRING(CommandMenu); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(groupBar) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(GroupBar); category = CSTRING(Category); + displayName = CSTRING(GroupBar); + typeName = "BOOL"; + value = 0; + isClientSettable = 1; }; // ADVANCED // Upper Weapon Info class GVAR(weaponName) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(WeaponName); category = CSTRING(Category); + displayName = CSTRING(WeaponName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(weaponNameBackground) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(WeaponNameBackground); category = CSTRING(Category); + displayName = CSTRING(WeaponNameBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(firingMode) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(FiringMode); category = CSTRING(Category); + displayName = CSTRING(FiringMode); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; // Lower Weapon Info class GVAR(ammoType) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(AmmoType); category = CSTRING(Category); + displayName = CSTRING(AmmoType); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(ammoCount) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(AmmoCount); - description = CSTRING(AmmoCountDesc); category = CSTRING(Category); + displayName = CSTRING(AmmoCount); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 0; + isClientSettable = 1; }; class GVAR(magCount) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; + category = CSTRING(Category); displayName = CSTRING(MagCount); - category = CSTRING(Category); - }; - class GVAR(grenadeFlareType) { - value = 1; + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(GrenadeFlareType); - category = CSTRING(Category); - }; - class GVAR(grenadeFlareCount) { value = 1; - typeName = "BOOL"; isClientSettable = 1; - displayName = CSTRING(GrenadeFlareCount); + }; + class GVAR(throwableName) { category = CSTRING(Category); + displayName = CSTRING(throwableName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; + }; + class GVAR(throwableCount) { + category = CSTRING(Category); + displayName = CSTRING(throwableCount); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(zeroing) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(Zeroing); category = CSTRING(Category); + displayName = CSTRING(Zeroing); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(weaponLowerInfoBackground) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(WeaponLowerInfoBackground); //todo category = CSTRING(Category); + displayName = CSTRING(WeaponLowerInfoBackground); //todo + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; // Stance class GVAR(stance) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(Stance); category = CSTRING(Category); + displayName = CSTRING(Stance); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; // Vehicle class GVAR(vehicleName) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleName); category = CSTRING(Category); + displayName = CSTRING(VehicleName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleNameBackground) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleNameBackground); category = CSTRING(Category); + displayName = CSTRING(VehicleNameBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleFuelBar) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleFuelBar); category = CSTRING(Category); + displayName = CSTRING(VehicleFuelBar); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleSpeed) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleSpeed); category = CSTRING(Category); + displayName = CSTRING(VehicleSpeed); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleAltitude) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleAltitude); category = CSTRING(Category); + displayName = CSTRING(VehicleAltitude); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleDamage) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleDamage); category = CSTRING(Category); + displayName = CSTRING(VehicleDamage); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleInfoBackground) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleInfoBackground); category = CSTRING(Category); + displayName = CSTRING(VehicleInfoBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; class GVAR(vehicleGunnerWeapon) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = CSTRING(VehicleGunnerWeapon); category = CSTRING(Category); + displayName = CSTRING(VehicleGunnerWeapon); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; }; }; diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index 69f28f955e..1441d97217 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -1,8 +1,6 @@ class CfgVehicles { class ACE_Module; - - // Basic - class ACE_ModuleUI: ACE_Module { + class GVAR(Module): ACE_Module { author = ECSTRING(common,ACETeam); category = "ACE"; displayName = CSTRING(ModuleName); @@ -11,6 +9,13 @@ class CfgVehicles { isGlobal = 1; //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); class Arguments { + // BASIC + class allowSelectiveUI { + displayName = CSTRING(AllowSelectiveUI); + description = CSTRING(AllowSelectiveUI_Description); + typeName = "BOOL"; + defaultValue = 1; + }; class soldierVehicleWeaponInfo { displayName = CSTRING(SoldierVehicleWeaponInfo); typeName = "BOOL"; @@ -34,37 +39,26 @@ class CfgVehicles { class groupBar { displayName = CSTRING(GroupBar); typeName = "BOOL"; - defaultValue = 1; + defaultValue = 0; }; - }; - class ModuleDescription { - description = CSTRING(ModuleDescription); - }; - }; - // Advanced - class ACE_ModuleUI_Advanced: ACE_Module { - author = ECSTRING(common,ACETeam); - category = "ACE"; - displayName = CSTRING(ModuleName_Advanced); - function = QFUNC(moduleInitAdvanced); - scope = 2; - isGlobal = 1; - //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); - class Arguments { + // ADVANCED // Upper Weapon Info class weaponName { displayName = CSTRING(WeaponName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class weaponNameBackground { displayName = CSTRING(WeaponNameBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class firingMode { displayName = CSTRING(FiringMode); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; @@ -72,37 +66,43 @@ class CfgVehicles { // Lower Weapon Info class ammoType { displayName = CSTRING(AmmoType); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class ammoCount { displayName = CSTRING(AmmoCount); - description = CSTRING(AmmoCountDesc); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; - defaultValue = 1; + defaultValue = 0; }; class magCount { displayName = CSTRING(MagCount); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; - class grenadeFlareType { - displayName = CSTRING(GrenadeFlareType); + class throwableName { + displayName = CSTRING(throwableName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; - class grenadeFlareCount { - displayName = CSTRING(GrenadeFlareCount); + class throwableCount { + displayName = CSTRING(throwableCount); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class zeroing { displayName = CSTRING(Zeroing); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class weaponLowerInfoBackground { displayName = CSTRING(WeaponLowerInfoBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; @@ -110,55 +110,63 @@ class CfgVehicles { // Stance class stance { displayName = CSTRING(Stance); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; - // Vehicle class vehicleName { displayName = CSTRING(VehicleName); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleNameBackground { displayName = CSTRING(VehicleNameBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleFuelBar { displayName = CSTRING(VehicleFuelBar); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleSpeed { displayName = CSTRING(VehicleSpeed); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleAltitude { displayName = CSTRING(VehicleAltitude); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleDamage { displayName = CSTRING(VehicleDamage); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleInfoBackground { displayName = CSTRING(VehicleInfoBackground); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; class vehicleGunnerWeapon { displayName = CSTRING(VehicleGunnerWeapon); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); typeName = "BOOL"; defaultValue = 1; }; }; class ModuleDescription { - description = CSTRING(ModuleDescription_Advanced); + description = CSTRING(ModuleDescription); }; }; }; diff --git a/addons/ui/XEH_PREP.hpp b/addons/ui/XEH_PREP.hpp index 222afadf25..6660470ba8 100644 --- a/addons/ui/XEH_PREP.hpp +++ b/addons/ui/XEH_PREP.hpp @@ -1,4 +1,3 @@ PREP(moduleInit); -PREP(moduleInitAdvanced); PREP(setAdvancedElement); PREP(setElements); diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index d778fb2746..23fa19af11 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -5,19 +5,24 @@ if (!hasInterface) exitWith {}; ["SettingsInitialized", { - // Selective UI Basic - call FUNC(setElements); - + // Initial settings + [true] call FUNC(setElements); // On load and entering/exiting a vehicle ["infoDisplayChanged", { // Selective UI Advanced - { - _x call FUNC(setAdvancedElement); - } forEach ELEMENTS_ADVANCED; + // Defaults must be set in this EH to make sure controls are activated and advanced settings can be modified + if (!GVAR(allowSelectiveUI)) then { + { + [_x, true] call FUNC(setAdvancedElement); + } forEach ELEMENTS_ADVANCED; + } else { + { + [_x] call FUNC(setAdvancedElement); + } forEach ELEMENTS_ADVANCED; + }; }] call EFUNC(common,addEventHandler); - ["SettingChanged", { params ["_name"]; @@ -31,11 +36,10 @@ if (!hasInterface) exitWith {}; _x params ["_element"]; if (_name == _element) then { - _x call FUNC(setAdvancedElement); + [_x] call FUNC(setAdvancedElement); TRACE_2("Setting Changed",_name,_element); }; } forEach ELEMENTS_ADVANCED; - }] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler); diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index f4a57831c8..fe0f07709a 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -20,13 +20,36 @@ if (!_activated) exitWith {}; // Exit if HUD visibility is hardcoded in mission config and showHUD command is overriden if (isArray (missionConfigFile >> "showHUD")) exitWith { - ACE_LOGINFO("User Interface (Basic) Module Failed to Initialize - showHUD overriden in mission config!"); + ACE_LOGINFO("User Interface Module Failed to Initialize - showHUD overriden in mission config!"); }; +// Basic +[_logic, QGVAR(allowSelectiveUI), "allowSelectiveUI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(soldierVehicleWeaponInfo), "soldierVehicleWeaponInfo"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleRadar), "vehicleRadar"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(groupBar), "groupBar"] call EFUNC(common,readSettingFromModule); -ACE_LOGINFO("User Interface (Basic) Module Initialized."); +// Advanced +[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(weaponNameBackground), "weaponNameBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(firingMode), "firingMode"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(ammoType), "ammoType"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(throwableName), "throwableName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(throwableCount), "throwableCount"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(weaponLowerInfoBackground), "weaponLowerInfoBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(stance), "stance"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleName), "vehicleName"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleNameBackground), "vehicleNameBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleFuelBar), "vehicleFuelBar"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleSpeed), "vehicleSpeed"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleAltitude), "vehicleAltitude"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleDamage), "vehicleDamage"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleInfoBackground), "vehicleInfoBackground"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleGunnerWeapon), "vehicleGunnerWeapon"] call EFUNC(common,readSettingFromModule); + +ACE_LOGINFO_1("User Interface Module Initialized. Allow client modifications: %1",GVAR(allowSelectiveUI)); diff --git a/addons/ui/functions/fnc_moduleInitAdvanced.sqf b/addons/ui/functions/fnc_moduleInitAdvanced.sqf deleted file mode 100644 index ab5666af69..0000000000 --- a/addons/ui/functions/fnc_moduleInitAdvanced.sqf +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Author: Jonpas - * Initializes the UI module. - * - * Arguments: - * 0: Module Logic - * 1: Units - * 2: Activated - * - * Return Value: - * None - */ -#include "script_component.hpp" - -if (!isServer) exitWith {}; - -params ["_logic", "_units", "_activated"]; - -if (!_activated) exitWith {}; - -[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(weaponNameBackground), "weaponNameBackground"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(firingMode), "firingMode"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(ammoType), "ammoType"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(grenadeFlareType), "grenadeFlareType"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(grenadeFlareCount), "grenadeFlareCount"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(weaponLowerInfoBackground), "weaponLowerInfoBackground"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(stance), "stance"] call EFUNC(common,readSettingFromModule); - -[_logic, QGVAR(vehicleName), "vehicleName"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleNameBackground), "vehicleNameBackground"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleFuelBar), "vehicleFuelBar"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleSpeed), "vehicleSpeed"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleAltitude), "vehicleAltitude"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleDamage), "vehicleDamage"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleInfoBackground), "vehicleInfoBackground"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleGunnerWeapon), "vehicleGunnerWeapon"] call EFUNC(common,readSettingFromModule); - -ACE_LOGINFO("User Interface (Advanced) Module Initialized."); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index e5fc66d565..21910f0042 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -3,22 +3,29 @@ * Sets advanced visible element of the UI using displays and controls. * * Arguments: - * 0: Show/Hide Element OR Element Variable - * 1: Element IDD - * 2: Element IDCs + * 0: Element info + * 0: Show/Hide Element OR Element Variable + * 1: Element IDD + * 2: Element IDCs + * 1: Force change even when disallowed * * Return Value: * None * * Example: - * [show, 303, [188]] call ace_ui_fnc_setAdvancedElement + * [[show, 303, [188]], false] call ace_ui_fnc_setAdvancedElement * * Public: No */ #include "script_component.hpp" -params ["_show", "_idd", "_elements"]; +params ["_elementInfo", ["_force", false, [true]] ]; +if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { + [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured) +}; + +_elementInfo params ["_show", "_idd", "_elements"]; // Get show/hide boolean from mission namespace if it's a string if (typeName _show == "STRING") then { @@ -26,7 +33,6 @@ if (typeName _show == "STRING") then { }; _show = [1, 0] select _show; - // Disable/Enable elements { private _idc = _x; diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index 1a9ca73399..c1bb131db5 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -3,18 +3,24 @@ * Sets basic visible elements of the UI using showHUD setter. * * Arguments: - * None + * 0: Force change even when disallowed * * Return Value: * None * * Example: - * [] call ace_ui_fnc_setElements + * [false] call ace_ui_fnc_setElements * * Public: No */ #include "script_component.hpp" +params [ ["_force", false, [true]] ]; + +if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { + [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured) +}; + private _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors] ["ui", [ diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index 72f9066f1b..15f0b731b6 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -1,8 +1,8 @@ #define COMPONENT ui #include "\z\ace\addons\main\script_mod.hpp" -// #define DEBUG_MODE_FULL -// #define DISABLE_COMPILE_CACHE + #define DEBUG_MODE_FULL + #define DISABLE_COMPILE_CACHE // #define CBA_DEBUG_SYNCHRONOUS // #define ENABLE_PERFORMANCE_COUNTERS @@ -28,8 +28,8 @@ [QGVAR(ammoType), 300, [155] ], \ [QGVAR(ammoCount), 300, [184] ], \ [QGVAR(magCount), 300, [185] ], \ - [QGVAR(grenadeName), 300, [152] ], \ - [QGVAR(grenadeCount), 300, [151] ], \ + [QGVAR(throwableName), 300, [152] ], \ + [QGVAR(throwableCount), 300, [151] ], \ [QGVAR(weaponLowerInfoBackground), 300, [1202] ], \ [QGVAR(zeroing), 300, [168] ], \ [QGVAR(stance), 303, [188, 1201] ], \ diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index e320d3ce39..21932cb98e 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -4,14 +4,18 @@ User Interface - - User Interface (Basic) + User Interface - This module allows hiding of basic user interface parts. Makes some User Interface (Advanced) settings inoperable. + This module allows toggling visible user interface parts. + + + Allow Selective UI + + + Allow client to modify their UI. - Soldier/Vehicle/Weapon Information @@ -27,15 +31,6 @@ Group Bar - - - - User Interface (Advanced) - - - This module allows hiding of specific user interface parts, more detailed than basic. User Interface (Basic) settings will make some of the settings inoperable. - - Weapon Name @@ -51,17 +46,14 @@ Ammo Count - - Always disabled on foot by ace_reload. - Magazine Count - - Grenade/Flare Type + + Throwable Type - - Grenade/Flare Count + + Throwable Count Zeroing @@ -72,7 +64,6 @@ Stance - Vehicle Name @@ -97,5 +88,11 @@ Vehicle Gunner Weapon + + Requires Soldier/Vehicle/Weapons Information. + + + Modifying User Interface is disabled. + From 64fe944b0fdbf7d7db271a0ea488fb1f6e347b6a Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 8 Mar 2016 18:12:01 +0100 Subject: [PATCH 06/13] Add public setter function, Optimize some checks --- addons/ui/XEH_PREP.hpp | 1 + addons/ui/XEH_preInit.sqf | 2 + addons/ui/functions/fnc_moduleInit.sqf | 22 ++++---- .../ui/functions/fnc_setAdvancedElement.sqf | 7 +++ .../ui/functions/fnc_setElementVisibility.sqf | 52 +++++++++++++++++++ addons/ui/functions/fnc_setElements.sqf | 2 + 6 files changed, 75 insertions(+), 11 deletions(-) create mode 100644 addons/ui/functions/fnc_setElementVisibility.sqf diff --git a/addons/ui/XEH_PREP.hpp b/addons/ui/XEH_PREP.hpp index 6660470ba8..8a6b4d2ce1 100644 --- a/addons/ui/XEH_PREP.hpp +++ b/addons/ui/XEH_PREP.hpp @@ -1,3 +1,4 @@ PREP(moduleInit); PREP(setAdvancedElement); PREP(setElements); +PREP(setElementVisibility); diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf index a7feade1c3..4a5638fc03 100644 --- a/addons/ui/XEH_preInit.sqf +++ b/addons/ui/XEH_preInit.sqf @@ -4,4 +4,6 @@ ADDON = false; #include "XEH_PREP.hpp" +GVAR(elementsSet) = []; + ADDON = true; diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index fe0f07709a..8327b09e72 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -18,18 +18,18 @@ params ["_logic", "_units", "_activated"]; if (!_activated) exitWith {}; -// Exit if HUD visibility is hardcoded in mission config and showHUD command is overriden -if (isArray (missionConfigFile >> "showHUD")) exitWith { - ACE_LOGINFO("User Interface Module Failed to Initialize - showHUD overriden in mission config!"); -}; - // Basic -[_logic, QGVAR(allowSelectiveUI), "allowSelectiveUI"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(soldierVehicleWeaponInfo), "soldierVehicleWeaponInfo"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleRadar), "vehicleRadar"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(groupBar), "groupBar"] call EFUNC(common,readSettingFromModule); +if (isArray (missionConfigFile >> "showHUD")) then { + // HUD visibility is hardcoded in mission config and showHUD command is overriden + ACE_LOGINFO("User Interface Module Failed to Initialize Basic settings - showHUD overriden in mission config!"); +} else { + [_logic, QGVAR(allowSelectiveUI), "allowSelectiveUI"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(soldierVehicleWeaponInfo), "soldierVehicleWeaponInfo"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(vehicleRadar), "vehicleRadar"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(groupBar), "groupBar"] call EFUNC(common,readSettingFromModule); +}; // Advanced [_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index 21910f0042..9e001d7d9c 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -21,6 +21,8 @@ params ["_elementInfo", ["_force", false, [true]] ]; +if (_elementInfo in GVAR(elementsSet)) exitWith {}; + if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured) }; @@ -34,6 +36,7 @@ if (typeName _show == "STRING") then { _show = [1, 0] select _show; // Disable/Enable elements +private _success = false; { private _idc = _x; @@ -44,6 +47,10 @@ _show = [1, 0] select _show; (_x displayCtrl _idc) ctrlSetFade _show; (_x displayCtrl _idc) ctrlCommit 0; + + _success = true; }; } forEach (uiNamespace getVariable "IGUI_displays"); } forEach _elements; + +_success diff --git a/addons/ui/functions/fnc_setElementVisibility.sqf b/addons/ui/functions/fnc_setElementVisibility.sqf new file mode 100644 index 0000000000..f09fe061f1 --- /dev/null +++ b/addons/ui/functions/fnc_setElementVisibility.sqf @@ -0,0 +1,52 @@ +/* + * Author: Jonpas + * Wrapper for setting advanced element visibility. + * + * Arguments: + * 0: Set/Unset (default: true) + * 1: Element info + * 0: Show/Hide Element OR Element Variable + * 1: Element IDD + * 2: Element IDCs + * + * Return Value: + * None + * + * Example: + * [false] call ace_ui_fnc_setElementVisibility + * + * Public: Yes + */ +#include "script_component.hpp" + +params [ + ["_set", true, [true]], + ["_elementInfo", [true, 0, []], [[]], 3] +]; + +_elementInfo params [ + ["_show", false, [true, ""]], + ["_idd", 0, [0]], + ["_elements", [], [[]]] +]; + +if (_set) then { + if ([_idd, _elements] in GVAR(elementsSet)) exitWith { TRACE_2("Element already set",_elementInfo,GVAR(elementsSet)); }; + + TRACE_2("Setting element",_elementInfo,GVAR(elementsSet)); + private _success = [_elementInfo] call FUNC(setAdvancedElement); + + if (_success) then { + GVAR(elementsSet) pushBack [_idd, _elements]; + }; +} else { + if ([_idd, _elements] in GVAR(elementsSet)) then { + TRACE_2("Unsetting element",_elementInfo,GVAR(elementsSet)); + + TRACE_2("Toggling element",_elementInfo,GVAR(elementsSet)); + [_elementInfo] call FUNC(setAdvancedElement); + + private _index = GVAR(elementsSet) find [_idd, _elements]; + GVAR(elementsSet) deleteAt _index; + }; +}; diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index c1bb131db5..71fbfdf945 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -15,6 +15,8 @@ */ #include "script_component.hpp" +if (isArray (missionConfigFile >> "showHUD")) exitWith {}; + params [ ["_force", false, [true]] ]; if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { From 23e2617db8c97868d888b7f9e7e34e70f083b031 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 8 Mar 2016 18:40:23 +0100 Subject: [PATCH 07/13] Change params order and improve clientInit --- addons/ui/XEH_clientInit.sqf | 22 +++++----- .../ui/functions/fnc_setAdvancedElement.sqf | 17 ++++---- .../ui/functions/fnc_setElementVisibility.sqf | 33 +++++++-------- addons/ui/functions/fnc_setElements.sqf | 2 +- addons/ui/script_component.hpp | 40 +++++++++---------- 5 files changed, 51 insertions(+), 63 deletions(-) diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index 23fa19af11..47fb36cb14 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -12,17 +12,13 @@ if (!hasInterface) exitWith {}; ["infoDisplayChanged", { // Selective UI Advanced // Defaults must be set in this EH to make sure controls are activated and advanced settings can be modified - if (!GVAR(allowSelectiveUI)) then { - { - [_x, true] call FUNC(setAdvancedElement); - } forEach ELEMENTS_ADVANCED; - } else { - { - [_x] call FUNC(setAdvancedElement); - } forEach ELEMENTS_ADVANCED; - }; + private _force = [true, false] select (GVAR(allowSelectiveUI)); + { + [_x select 0, _x select 1, _x select 2, _force] call FUNC(setAdvancedElement); + } forEach ELEMENTS_ADVANCED; }] call EFUNC(common,addEventHandler); + // On changing settings ["SettingChanged", { params ["_name"]; @@ -33,11 +29,11 @@ if (!hasInterface) exitWith {}; // Selective UI Advanced { - _x params ["_element"]; + params ["_idd", "_elements", "_name"]; - if (_name == _element) then { - [_x] call FUNC(setAdvancedElement); - TRACE_2("Setting Changed",_name,_element); + if (_name == _name) then { + [_idd, _elements, _name] call FUNC(setAdvancedElement); + TRACE_2("Setting Changed",_name,_name); }; } forEach ELEMENTS_ADVANCED; }] call EFUNC(common,addEventHandler); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index 9e001d7d9c..2ef88d5868 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -3,23 +3,22 @@ * Sets advanced visible element of the UI using displays and controls. * * Arguments: - * 0: Element info - * 0: Show/Hide Element OR Element Variable - * 1: Element IDD - * 2: Element IDCs - * 1: Force change even when disallowed + * 0: Element IDD + * 1: Element IDCs + * 2: Show/Hide Element OR Element ACE Settings Variable + * 3: Force change even when disallowed (default: false) * * Return Value: - * None + * Successfully Set * * Example: - * [[show, 303, [188]], false] call ace_ui_fnc_setAdvancedElement + * [303, [188], true, false] call ace_ui_fnc_setAdvancedElement * * Public: No */ #include "script_component.hpp" -params ["_elementInfo", ["_force", false, [true]] ]; +params ["_idd", "_elements", "_show", ["_force", false, [true]] ]; if (_elementInfo in GVAR(elementsSet)) exitWith {}; @@ -27,8 +26,6 @@ if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured) }; -_elementInfo params ["_show", "_idd", "_elements"]; - // Get show/hide boolean from mission namespace if it's a string if (typeName _show == "STRING") then { _show = missionNamespace getVariable _show; diff --git a/addons/ui/functions/fnc_setElementVisibility.sqf b/addons/ui/functions/fnc_setElementVisibility.sqf index f09fe061f1..d2ec34d7ba 100644 --- a/addons/ui/functions/fnc_setElementVisibility.sqf +++ b/addons/ui/functions/fnc_setElementVisibility.sqf @@ -1,19 +1,18 @@ /* * Author: Jonpas - * Wrapper for setting advanced element visibility. + * Setter for toggling advanced element visibility. * * Arguments: * 0: Set/Unset (default: true) - * 1: Element info - * 0: Show/Hide Element OR Element Variable - * 1: Element IDD - * 2: Element IDCs + * 1: Element IDD (default: 0) + * 2: Element IDCs (default: []) + * 3: Show/Hide Element OR Element ACE Settings Variable (default: false) * * Return Value: * None * * Example: - * [false] call ace_ui_fnc_setElementVisibility + * [true, 300, [188], false] call ace_ui_fnc_setElementVisibility * * Public: Yes */ @@ -21,32 +20,28 @@ params [ ["_set", true, [true]], - ["_elementInfo", [true, 0, []], [[]], 3] -]; - -_elementInfo params [ - ["_show", false, [true, ""]], ["_idd", 0, [0]], - ["_elements", [], [[]]] + ["_elements", [], [[]]], + ["_show", false, [true, ""]] ]; if (_set) then { - if ([_idd, _elements] in GVAR(elementsSet)) exitWith { TRACE_2("Element already set",_elementInfo,GVAR(elementsSet)); }; + if ([_idd, _elements] in GVAR(elementsSet)) exitWith { TRACE_3("Element already set",_idd,_elements,GVAR(elementsSet)); }; - TRACE_2("Setting element",_elementInfo,GVAR(elementsSet)); - private _success = [_elementInfo] call FUNC(setAdvancedElement); + TRACE_4("Setting element",_idd,_elements,_show,GVAR(elementsSet)); + private _success = [_idd, _elements, _show] call FUNC(setAdvancedElement); if (_success) then { GVAR(elementsSet) pushBack [_idd, _elements]; }; } else { if ([_idd, _elements] in GVAR(elementsSet)) then { - TRACE_2("Unsetting element",_elementInfo,GVAR(elementsSet)); - - TRACE_2("Toggling element",_elementInfo,GVAR(elementsSet)); - [_elementInfo] call FUNC(setAdvancedElement); + TRACE_4("Setting element",_idd,_elements,_show,GVAR(elementsSet)); + [_idd, _elements, _show] call FUNC(setAdvancedElement); private _index = GVAR(elementsSet) find [_idd, _elements]; GVAR(elementsSet) deleteAt _index; }; }; + +TRACE_1("Visibility set",GVAR(elementsSet)); diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index 71fbfdf945..92cc981065 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -3,7 +3,7 @@ * Sets basic visible elements of the UI using showHUD setter. * * Arguments: - * 0: Force change even when disallowed + * 0: Force change even when disallowed (default: false) * * Return Value: * None diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index 15f0b731b6..14392f5af2 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -20,27 +20,27 @@ // Elements #define ELEMENTS_BASIC [QGVAR(soldierVehicleWeaponInfo), QGVAR(vehicleRadar), QGVAR(vehicleCompass), QGVAR(commandMenu), QGVAR(groupBar)] -// Element, IDD, IDC +// IDD, IDC, Element (must be string to compare to changed setting name) #define ELEMENTS_ADVANCED [ \ - [QGVAR(weaponName), 300, [118] ], \ - [QGVAR(weaponNameBackground), 300, [1001, 1008] ], \ - [QGVAR(firingMode), 300, [187, 1203] ], \ - [QGVAR(ammoType), 300, [155] ], \ - [QGVAR(ammoCount), 300, [184] ], \ - [QGVAR(magCount), 300, [185] ], \ - [QGVAR(throwableName), 300, [152] ], \ - [QGVAR(throwableCount), 300, [151] ], \ - [QGVAR(weaponLowerInfoBackground), 300, [1202] ], \ - [QGVAR(zeroing), 300, [168] ], \ - [QGVAR(stance), 303, [188, 1201] ], \ - [QGVAR(vehicleName), 300, [120] ], \ - [QGVAR(vehicleNameBackground), 300, [1000, 1013] ], \ - [QGVAR(vehicleFuelBar), 300, [113, 1202] ], \ - [QGVAR(vehicleSpeed), 300, [121, 1004, 1006] ], \ - [QGVAR(vehicleAltitude), 300, [122, 1005, 1014] ], \ - [QGVAR(vehicleDamage), 300, [111] ], \ - [QGVAR(vehicleInfoBackground), 300, [1200] ], \ - [QGVAR(vehicleGunnerWeapon), 300, [150] ] \ + [300, [118], QGVAR(weaponName)], \ + [300, [1001, 1008], QGVAR(weaponNameBackground)], \ + [300, [187, 1203], QGVAR(firingMode)], \ + [300, [155], QGVAR(ammoType)], \ + [300, [184], QGVAR(ammoCount)], \ + [300, [185], QGVAR(magCount)], \ + [300, [152], QGVAR(throwableName)], \ + [300, [151], QGVAR(throwableCount)], \ + [300, [1202], QGVAR(weaponLowerInfoBackground)], \ + [300, [168], QGVAR(zeroing)], \ + [303, [188, 1201], QGVAR(stance)], \ + [300, [120], QGVAR(vehicleName)], \ + [300, [1000, 1013], QGVAR(vehicleNameBackground)], \ + [300, [113, 1202], QGVAR(vehicleFuelBar)], \ + [300, [121, 1004, 1006], QGVAR(vehicleSpeed)], \ + [300, [122, 1005, 1014], QGVAR(vehicleAltitude)], \ + [300, [111], QGVAR(vehicleDamage)], \ + [300, [1200], QGVAR(vehicleInfoBackground)], \ + [300, [150], QGVAR(vehicleGunnerWeapon)] \ ] From e90ef30904cd4ea73f03be9d81ef82d5ce06a8cd Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 8 Mar 2016 18:42:37 +0100 Subject: [PATCH 08/13] Add return value to public setElementVisibility function --- addons/ui/functions/fnc_setElementVisibility.sqf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/ui/functions/fnc_setElementVisibility.sqf b/addons/ui/functions/fnc_setElementVisibility.sqf index d2ec34d7ba..b019c4c081 100644 --- a/addons/ui/functions/fnc_setElementVisibility.sqf +++ b/addons/ui/functions/fnc_setElementVisibility.sqf @@ -25,6 +25,8 @@ params [ ["_show", false, [true, ""]] ]; +private _return = false; + if (_set) then { if ([_idd, _elements] in GVAR(elementsSet)) exitWith { TRACE_3("Element already set",_idd,_elements,GVAR(elementsSet)); }; @@ -33,6 +35,7 @@ if (_set) then { if (_success) then { GVAR(elementsSet) pushBack [_idd, _elements]; + _return = true; }; } else { if ([_idd, _elements] in GVAR(elementsSet)) then { @@ -41,7 +44,9 @@ if (_set) then { private _index = GVAR(elementsSet) find [_idd, _elements]; GVAR(elementsSet) deleteAt _index; + _return = true; }; }; -TRACE_1("Visibility set",GVAR(elementsSet)); +TRACE_2("Visibility set",_return,GVAR(elementsSet)); +_return From 70100825cf23de1ca2d0ef9ffb4528b420fa1994 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 8 Mar 2016 18:49:19 +0100 Subject: [PATCH 09/13] Fix params in clientInit --- addons/ui/XEH_clientInit.sqf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index 47fb36cb14..97cc3e026b 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -29,11 +29,11 @@ if (!hasInterface) exitWith {}; // Selective UI Advanced { - params ["_idd", "_elements", "_name"]; + _x params ["_idd", "_elements", "_elementName"]; - if (_name == _name) then { - [_idd, _elements, _name] call FUNC(setAdvancedElement); - TRACE_2("Setting Changed",_name,_name); + if (_name == _elementName) then { + [_idd, _elements, _elementName] call FUNC(setAdvancedElement); + TRACE_2("Setting Changed",_name,_elementName); }; } forEach ELEMENTS_ADVANCED; }] call EFUNC(common,addEventHandler); From 32c32b6cc556385d4854440b9f805e51e8ee30d3 Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 9 Mar 2016 18:58:46 +0100 Subject: [PATCH 10/13] Add stamina bar selective UI --- addons/ui/ACE_Settings.hpp | 9 +++++++++ addons/ui/CfgVehicles.hpp | 8 ++++++++ addons/ui/functions/fnc_moduleInit.sqf | 1 + addons/ui/script_component.hpp | 6 ++++++ addons/ui/stringtable.xml | 3 +++ 5 files changed, 27 insertions(+) diff --git a/addons/ui/ACE_Settings.hpp b/addons/ui/ACE_Settings.hpp index 3e5c53d328..89ddc8d35d 100644 --- a/addons/ui/ACE_Settings.hpp +++ b/addons/ui/ACE_Settings.hpp @@ -139,6 +139,15 @@ class ACE_Settings { isClientSettable = 1; }; + // Stamina Bar + class GVAR(staminaBar) { + category = CSTRING(Category); + displayName = CSTRING(StaminaBar); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; + }; // Vehicle class GVAR(vehicleName) { diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index 1441d97217..ccd79684f5 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -115,6 +115,14 @@ class CfgVehicles { defaultValue = 1; }; + // Stamina Bar + class staminaBar { + displayName = CSTRING(StaminaBar); + description = CSTRING(RequiresSoldierVehicleWeaponInfo); + typeName = "BOOL"; + defaultValue = 1; + }; + // Vehicle class vehicleName { displayName = CSTRING(VehicleName); diff --git a/addons/ui/functions/fnc_moduleInit.sqf b/addons/ui/functions/fnc_moduleInit.sqf index 8327b09e72..10f18f94f3 100644 --- a/addons/ui/functions/fnc_moduleInit.sqf +++ b/addons/ui/functions/fnc_moduleInit.sqf @@ -43,6 +43,7 @@ if (isArray (missionConfigFile >> "showHUD")) then { [_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(weaponLowerInfoBackground), "weaponLowerInfoBackground"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(stance), "stance"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(staminaBar), "staminaBar"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleName), "vehicleName"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleNameBackground), "vehicleNameBackground"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleFuelBar), "vehicleFuelBar"] call EFUNC(common,readSettingFromModule); diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index 14392f5af2..e9051beeac 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -32,6 +32,7 @@ [300, [151], QGVAR(throwableCount)], \ [300, [1202], QGVAR(weaponLowerInfoBackground)], \ [300, [168], QGVAR(zeroing)], \ + [305, [193], QGVAR(staminaBar)], \ [303, [188, 1201], QGVAR(stance)], \ [300, [120], QGVAR(vehicleName)], \ [300, [1000, 1013], QGVAR(vehicleNameBackground)], \ @@ -86,4 +87,9 @@ RscStanceInfo = 303 -------------------- 188 (Stance) + 1201 (Stance Background) + + +RscStaminaBar = 305 +-------------------- +193 (Stamina Bar) */ diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 21932cb98e..42e7932411 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -64,6 +64,9 @@ Stance + + Stamina Bar + Vehicle Name From 89924e927a53520c643402d5b73f09ce803623ad Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 14 Mar 2016 17:25:20 +0100 Subject: [PATCH 11/13] Disable debug --- addons/ui/script_component.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index e9051beeac..a7410a49b8 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -1,8 +1,8 @@ #define COMPONENT ui #include "\z\ace\addons\main\script_mod.hpp" - #define DEBUG_MODE_FULL - #define DISABLE_COMPILE_CACHE +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE // #define CBA_DEBUG_SYNCHRONOUS // #define ENABLE_PERFORMANCE_COUNTERS From c568c18865102bf28cdada9b13f472995a859e51 Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 14 Mar 2016 19:14:52 +0100 Subject: [PATCH 12/13] Add module icon --- addons/ui/CfgVehicles.hpp | 2 +- addons/ui/README.md | 4 ++-- addons/ui/UI/Icon_Module_UI_ca.paa | Bin 0 -> 5625 bytes .../Icon_Module_png/Icon_Module_UI_ca.png | Bin 0 -> 2999 bytes extras/assets/icons/Icons_Modules.psd | Bin 2357207 -> 2371272 bytes 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 addons/ui/UI/Icon_Module_UI_ca.paa create mode 100644 extras/assets/icons/Icon_Module_png/Icon_Module_UI_ca.png diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index ccd79684f5..24340db031 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -7,7 +7,7 @@ class CfgVehicles { function = QFUNC(moduleInit); scope = 2; isGlobal = 1; - //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); + icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); class Arguments { // BASIC class allowSelectiveUI { diff --git a/addons/ui/README.md b/addons/ui/README.md index 7fac3a4946..c55ffbc5c7 100644 --- a/addons/ui/README.md +++ b/addons/ui/README.md @@ -1,7 +1,7 @@ ace_ui ======= -Removes vignette, changes the chat contrast on the map to allow easier reading and provides settings to toggle different UI elements unavailable in Vanilla. +Removes vignette, changes the chat contrast on the map to allow easier reading and provides settings to hide or show different UI elements. ## Maintainers @@ -9,4 +9,4 @@ Removes vignette, changes the chat contrast on the map to allow easier reading a The people responsible for merging changes to this component or answering potential questions. - [VKing](https://github.com/VKing6) -- [Jonpas] (https://github.com/jonpas) +- [Jonpas](https://github.com/jonpas) diff --git a/addons/ui/UI/Icon_Module_UI_ca.paa b/addons/ui/UI/Icon_Module_UI_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..f23b8b40c9eaa9a2aedc73f5de9adfb4e42814a7 GIT binary patch literal 5625 zcmeHLPe>F|82?r_Rxc${AxJsO(jn~HDcH9Jt}BIyLhKT$$CB{k(S0Rkfz+@ObV$5+ z5)TWVW}=gax)#|%DCoLbU=C^H!4=k z(17sQpJHvqZpjNkbmZ|i@}SG5+u&WcAH~W1@I6Z(xcPE5hO=ci+f09||Hu&cCn-O! zPgLWW`47r2Xy=aciN;eh8~EinEob6h)L z$k75b`~QCa(SNka#1F8z(r~N#SNV_2!<5D3x5N}cJ3d(a!%@8xl`c!3i}l|$zKYxC zr+=FBr{|06C9C*MB(C=fMk2}?msZTCX@mI52 z-_Gmp{fFdNjeVS-%in9<7(lE?Ym#fkZymahXwcfbM2g7mQAD)ra8?LrKby&Ch^ zaF9g#)~D$qwvN#tb8{P+qZ={$vAP)xVHB-4mtLhF*AJUP3;no0HfH#-NNqFH95cut zSomr5qrJ;{>$OD4%5%TAWZGEB+ElNFK^9#5HHNQG;@la>lAol<^((q{>2;0U^*^j%loPGT=CCk+@KbwgLm$YpVs2o*9wdIo zAz^rteVop5H+~AlkBkBfXkv78LNAlvR%Ll>rl7GSE35srCxaRzf8YA(abvdd?`EJp zX~N+6GXv%FK#%5k{I#=)g~r0inPKshsdO2-eEhWs?+BOXKI5&i;*R)3x2!Sbcn@C& z_v^$ShQV=5eOnj48_fATp_4v~eiROMjz4=dH#@Sb@oj(c c&HD%EM>NjjM8$ZDm9-bsHx^Inzm>JW0G*1dMgRZ+ literal 0 HcmV?d00001 diff --git a/extras/assets/icons/Icon_Module_png/Icon_Module_UI_ca.png b/extras/assets/icons/Icon_Module_png/Icon_Module_UI_ca.png new file mode 100644 index 0000000000000000000000000000000000000000..e69102a216a99605b99cecef622f09bc0f1afb14 GIT binary patch literal 2999 zcmV;o3rO^dP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv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S64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0002uNkl^9t6u{dZdFP)c0sznh!XtSv$Tkrm0)?hQD&WI)K>G-Ib$K%l(gOeh;BRAz zzavHk002O-g^;NL003y+14IP?06^;=u<9CI!Q0OK4ix|Z00000000000000000000 z006K9z?0vX0f@e>u9G6*%x8a$JugW)>)DU2fU-}Qu0+{Yb%2?J&`CW&FSDN_HY=N8 tiRqD*V0Qpsk|F{C^d3I|009600|4I#8k=$v3e^Ar002ovPDHLkV1l;Pfg1n- literal 0 HcmV?d00001 diff --git a/extras/assets/icons/Icons_Modules.psd b/extras/assets/icons/Icons_Modules.psd index 553449898aaed4cb6dce26e0cbd677c500206448..0da44ea68106022ee9fa90f40c6db5af943219c0 100644 GIT binary patch delta 6738 zcmc&&3s@9Kwyx?KU_?Y^d_;xV1QcBZGd)kxL_mc2enbgIBQWv`2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C{Tzk2sgsI|e&=-_qF(5aO(wgp z7nn0xZ?HaKeZl&Hy$seL%mvI9%ni&P%mYjcCIj;X^Ww7W2ITvwh5U%x`se)r{0Bu& zEw#G6)PKAVnBY1JOaf*HW)J27)(OlJtTWh4U|qnvf^`Gy4%P##Czul(T-R&3@b#bF zHPAb0Qg_rlJV3|8d0rP-Fl08a<#+zQ$fJRO7}$-frxMLEgRD-GjUzsEU!J@0RcGf_u&q!g|M#yIns;ZUXEJ+)}|EdSpUI8j5L0wn%{BB-~0B(vzIPiaEecBB?y(hRnozS%DZl{!qr4#t|G;HfeVht zuK2lgDXIya&SDrnmpjDU8EcAZ$B)jGwV11~CWltir8JJd2_ks>Q59WA<26q~1TD$c z^kW*oQwkzz*`%ipbf=JA*Git;JGjhDqtj+$-*Sdoul>bLaCvAAT}R^&ia{FnJ861( z3rM4GLmQ2b!GWaK(DgKqGxE~Npws!8Rt=5r!7<*cp&Mu%UST1f3-%?StS7|8-iNjI zp{+F94g>>FKwrYtnGg$&V=6!?k6LK77NUgI0%n&_$kR~B^f@3;0QneJS@>0wMnbYo zG!AJ5WF5rQ0a7U-W}+ddV5S~4bsrYv51RqIBw*Eq6qsoAA!zFUTAB{g8Xy%TlyLz_ zX=d6X9CAK8e7X(x^Z3_iZ3NxZL%z-*SqL$IuZc}6v=GTLI^-HOu4Waa2{A$gP&P>K zX-sr<%w3S4M!#tp)E0Z6hj8dM&|Y;LO{FvtBXp7q*MMpr64u4ufo} zO9`n4?ZIJCvFG#tID_IqdmS0;Dh(YOwKPfg v{Ebg*oe&B;X6WEU<%!p=Ft5EvV$cg*a4u~&Ja From b06659a2e40e4d1136e2fa614b15e27a1fea0635 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 23 Apr 2016 00:29:58 +0200 Subject: [PATCH 13/13] Fix params error --- addons/ui/CfgVehicles.hpp | 3 ++- addons/ui/XEH_clientInit.sqf | 3 +-- addons/ui/functions/fnc_setElements.sqf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/ui/CfgVehicles.hpp b/addons/ui/CfgVehicles.hpp index 24340db031..391b3627eb 100644 --- a/addons/ui/CfgVehicles.hpp +++ b/addons/ui/CfgVehicles.hpp @@ -9,13 +9,14 @@ class CfgVehicles { isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); class Arguments { - // BASIC class allowSelectiveUI { displayName = CSTRING(AllowSelectiveUI); description = CSTRING(AllowSelectiveUI_Description); typeName = "BOOL"; defaultValue = 1; }; + + // BASIC class soldierVehicleWeaponInfo { displayName = CSTRING(SoldierVehicleWeaponInfo); typeName = "BOOL"; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index 97cc3e026b..d228696fc0 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -1,4 +1,3 @@ -//#define DEBUG_MODE_FULL #include "script_component.hpp" // Exit on Headless @@ -24,7 +23,7 @@ if (!hasInterface) exitWith {}; // Selective UI Basic if (_name in ELEMENTS_BASIC) then { - call FUNC(setElements); + [false] call FUNC(setElements); }; // Selective UI Advanced diff --git a/addons/ui/functions/fnc_setElements.sqf b/addons/ui/functions/fnc_setElements.sqf index 92cc981065..b94b0f9a22 100644 --- a/addons/ui/functions/fnc_setElements.sqf +++ b/addons/ui/functions/fnc_setElements.sqf @@ -20,7 +20,7 @@ if (isArray (missionConfigFile >> "showHUD")) exitWith {}; params [ ["_force", false, [true]] ]; if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { - [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured) + [LSTRING(Disallowed), 2] call EFUNC(common,displayTextStructured); }; private _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors]