From 9b46e8856e800359503174dff788bdf7c91fad47 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 6 Mar 2016 15:41:17 +0100 Subject: [PATCH] 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. +