Merge modules, Add base allow client settings toggle, Add requires descriptions

This commit is contained in:
jonpas 2016-03-06 15:41:17 +01:00
parent a064c0c98d
commit 9b46e8856e
12 changed files with 240 additions and 239 deletions

View File

@ -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;
};
};
};*/
};
};

View File

@ -20,6 +20,4 @@ class CfgPatches {
#include "CfgActions.hpp" #include "CfgActions.hpp"
#include "RscInGameUI.hpp"
#include "ACE_Settings.hpp" #include "ACE_Settings.hpp"

View File

@ -1,182 +1,208 @@
class ACE_Settings { class ACE_Settings {
class GVAR(allowSelectiveUI) {
category = CSTRING(Category);
displayName = CSTRING(AllowSelectiveUI);
description = CSTRING(AllowSelectiveUI_Description);
typeName = "BOOL";
value = 1;
};
// BASIC // BASIC
class GVAR(soldierVehicleWeaponInfo) { class GVAR(soldierVehicleWeaponInfo) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(SoldierVehicleWeaponInfo);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(SoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(vehicleRadar) { class GVAR(vehicleRadar) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(VehicleRadar);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(VehicleRadar);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(vehicleCompass) { class GVAR(vehicleCompass) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(VehicleCompass);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(VehicleCompass);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(commandMenu) { class GVAR(commandMenu) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(CommandMenu);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(CommandMenu);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(groupBar) { class GVAR(groupBar) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(GroupBar);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(GroupBar);
typeName = "BOOL";
value = 0;
isClientSettable = 1;
}; };
// ADVANCED // ADVANCED
// Upper Weapon Info // Upper Weapon Info
class GVAR(weaponName) { class GVAR(weaponName) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(WeaponName);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(WeaponName);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(weaponNameBackground) { class GVAR(weaponNameBackground) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(WeaponNameBackground);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(WeaponNameBackground);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(firingMode) { class GVAR(firingMode) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(FiringMode);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(FiringMode);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
// Lower Weapon Info // Lower Weapon Info
class GVAR(ammoType) { class GVAR(ammoType) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(AmmoType);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(AmmoType);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(ammoCount) { class GVAR(ammoCount) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(AmmoCount);
description = CSTRING(AmmoCountDesc);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(AmmoCount);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 0;
isClientSettable = 1;
}; };
class GVAR(magCount) { class GVAR(magCount) {
value = 1; category = CSTRING(Category);
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(MagCount); displayName = CSTRING(MagCount);
category = CSTRING(Category); description = CSTRING(RequiresSoldierVehicleWeaponInfo);
};
class GVAR(grenadeFlareType) {
value = 1;
typeName = "BOOL"; typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(GrenadeFlareType);
category = CSTRING(Category);
};
class GVAR(grenadeFlareCount) {
value = 1; value = 1;
typeName = "BOOL";
isClientSettable = 1; isClientSettable = 1;
displayName = CSTRING(GrenadeFlareCount); };
class GVAR(throwableName) {
category = CSTRING(Category); 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) { class GVAR(zeroing) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(Zeroing);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(Zeroing);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(weaponLowerInfoBackground) { class GVAR(weaponLowerInfoBackground) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(WeaponLowerInfoBackground); //todo
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(WeaponLowerInfoBackground); //todo
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
// Stance // Stance
class GVAR(stance) { class GVAR(stance) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(Stance);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(Stance);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
// Vehicle // Vehicle
class GVAR(vehicleName) { class GVAR(vehicleName) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(VehicleName);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(VehicleName);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(vehicleNameBackground) { class GVAR(vehicleNameBackground) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(VehicleNameBackground);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(VehicleNameBackground);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(vehicleFuelBar) { class GVAR(vehicleFuelBar) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(VehicleFuelBar);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(VehicleFuelBar);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(vehicleSpeed) { class GVAR(vehicleSpeed) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(VehicleSpeed);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(VehicleSpeed);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(vehicleAltitude) { class GVAR(vehicleAltitude) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(VehicleAltitude);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(VehicleAltitude);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(vehicleDamage) { class GVAR(vehicleDamage) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(VehicleDamage);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(VehicleDamage);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(vehicleInfoBackground) { class GVAR(vehicleInfoBackground) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(VehicleInfoBackground);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(VehicleInfoBackground);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
class GVAR(vehicleGunnerWeapon) { class GVAR(vehicleGunnerWeapon) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(VehicleGunnerWeapon);
category = CSTRING(Category); category = CSTRING(Category);
displayName = CSTRING(VehicleGunnerWeapon);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
}; };
}; };

View File

@ -1,8 +1,6 @@
class CfgVehicles { class CfgVehicles {
class ACE_Module; class ACE_Module;
class GVAR(Module): ACE_Module {
// Basic
class ACE_ModuleUI: ACE_Module {
author = ECSTRING(common,ACETeam); author = ECSTRING(common,ACETeam);
category = "ACE"; category = "ACE";
displayName = CSTRING(ModuleName); displayName = CSTRING(ModuleName);
@ -11,6 +9,13 @@ class CfgVehicles {
isGlobal = 1; isGlobal = 1;
//icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa)); //icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa));
class Arguments { class Arguments {
// BASIC
class allowSelectiveUI {
displayName = CSTRING(AllowSelectiveUI);
description = CSTRING(AllowSelectiveUI_Description);
typeName = "BOOL";
defaultValue = 1;
};
class soldierVehicleWeaponInfo { class soldierVehicleWeaponInfo {
displayName = CSTRING(SoldierVehicleWeaponInfo); displayName = CSTRING(SoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
@ -34,37 +39,26 @@ class CfgVehicles {
class groupBar { class groupBar {
displayName = CSTRING(GroupBar); displayName = CSTRING(GroupBar);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 0;
};
};
class ModuleDescription {
description = CSTRING(ModuleDescription);
};
}; };
// Advanced // 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 // Upper Weapon Info
class weaponName { class weaponName {
displayName = CSTRING(WeaponName); displayName = CSTRING(WeaponName);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class weaponNameBackground { class weaponNameBackground {
displayName = CSTRING(WeaponNameBackground); displayName = CSTRING(WeaponNameBackground);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class firingMode { class firingMode {
displayName = CSTRING(FiringMode); displayName = CSTRING(FiringMode);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
@ -72,37 +66,43 @@ class CfgVehicles {
// Lower Weapon Info // Lower Weapon Info
class ammoType { class ammoType {
displayName = CSTRING(AmmoType); displayName = CSTRING(AmmoType);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class ammoCount { class ammoCount {
displayName = CSTRING(AmmoCount); displayName = CSTRING(AmmoCount);
description = CSTRING(AmmoCountDesc); description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 0;
}; };
class magCount { class magCount {
displayName = CSTRING(MagCount); displayName = CSTRING(MagCount);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class grenadeFlareType { class throwableName {
displayName = CSTRING(GrenadeFlareType); displayName = CSTRING(throwableName);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class grenadeFlareCount { class throwableCount {
displayName = CSTRING(GrenadeFlareCount); displayName = CSTRING(throwableCount);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class zeroing { class zeroing {
displayName = CSTRING(Zeroing); displayName = CSTRING(Zeroing);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class weaponLowerInfoBackground { class weaponLowerInfoBackground {
displayName = CSTRING(WeaponLowerInfoBackground); displayName = CSTRING(WeaponLowerInfoBackground);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
@ -110,55 +110,63 @@ class CfgVehicles {
// Stance // Stance
class stance { class stance {
displayName = CSTRING(Stance); displayName = CSTRING(Stance);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
// Vehicle // Vehicle
class vehicleName { class vehicleName {
displayName = CSTRING(VehicleName); displayName = CSTRING(VehicleName);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class vehicleNameBackground { class vehicleNameBackground {
displayName = CSTRING(VehicleNameBackground); displayName = CSTRING(VehicleNameBackground);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class vehicleFuelBar { class vehicleFuelBar {
displayName = CSTRING(VehicleFuelBar); displayName = CSTRING(VehicleFuelBar);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class vehicleSpeed { class vehicleSpeed {
displayName = CSTRING(VehicleSpeed); displayName = CSTRING(VehicleSpeed);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class vehicleAltitude { class vehicleAltitude {
displayName = CSTRING(VehicleAltitude); displayName = CSTRING(VehicleAltitude);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class vehicleDamage { class vehicleDamage {
displayName = CSTRING(VehicleDamage); displayName = CSTRING(VehicleDamage);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class vehicleInfoBackground { class vehicleInfoBackground {
displayName = CSTRING(VehicleInfoBackground); displayName = CSTRING(VehicleInfoBackground);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
class vehicleGunnerWeapon { class vehicleGunnerWeapon {
displayName = CSTRING(VehicleGunnerWeapon); displayName = CSTRING(VehicleGunnerWeapon);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 1; defaultValue = 1;
}; };
}; };
class ModuleDescription { class ModuleDescription {
description = CSTRING(ModuleDescription_Advanced); description = CSTRING(ModuleDescription);
}; };
}; };
}; };

View File

@ -1,4 +1,3 @@
PREP(moduleInit); PREP(moduleInit);
PREP(moduleInitAdvanced);
PREP(setAdvancedElement); PREP(setAdvancedElement);
PREP(setElements); PREP(setElements);

View File

@ -5,19 +5,24 @@
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};
["SettingsInitialized", { ["SettingsInitialized", {
// Selective UI Basic // Initial settings
call FUNC(setElements); [true] call FUNC(setElements);
// On load and entering/exiting a vehicle // On load and entering/exiting a vehicle
["infoDisplayChanged", { ["infoDisplayChanged", {
// Selective UI Advanced // 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 call FUNC(setAdvancedElement); [_x, true] call FUNC(setAdvancedElement);
} forEach ELEMENTS_ADVANCED; } forEach ELEMENTS_ADVANCED;
} else {
{
[_x] call FUNC(setAdvancedElement);
} forEach ELEMENTS_ADVANCED;
};
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);
["SettingChanged", { ["SettingChanged", {
params ["_name"]; params ["_name"];
@ -31,11 +36,10 @@ if (!hasInterface) exitWith {};
_x params ["_element"]; _x params ["_element"];
if (_name == _element) then { if (_name == _element) then {
_x call FUNC(setAdvancedElement); [_x] call FUNC(setAdvancedElement);
TRACE_2("Setting Changed",_name,_element); TRACE_2("Setting Changed",_name,_element);
}; };
} forEach ELEMENTS_ADVANCED; } forEach ELEMENTS_ADVANCED;
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);

View File

@ -20,13 +20,36 @@ if (!_activated) exitWith {};
// Exit if HUD visibility is hardcoded in mission config and showHUD command is overriden // Exit if HUD visibility is hardcoded in mission config and showHUD command is overriden
if (isArray (missionConfigFile >> "showHUD")) exitWith { 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(soldierVehicleWeaponInfo), "soldierVehicleWeaponInfo"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(vehicleRadar), "vehicleRadar"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleRadar), "vehicleRadar"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(vehicleCompass), "vehicleCompass"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(commandMenu), "commandMenu"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(groupBar), "groupBar"] 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));

View File

@ -1,42 +0,0 @@
/*
* Author: Jonpas
* Initializes the UI module.
*
* Arguments:
* 0: Module Logic <LOGIC>
* 1: Units <ARRAY>
* 2: Activated <BOOL>
*
* 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.");

View File

@ -3,22 +3,29 @@
* Sets advanced visible element of the UI using displays and controls. * Sets advanced visible element of the UI using displays and controls.
* *
* Arguments: * Arguments:
* 0: Element info <ARRAY>
* 0: Show/Hide Element OR Element Variable <BOOL/STRING> * 0: Show/Hide Element OR Element Variable <BOOL/STRING>
* 1: Element IDD <NUMBER> * 1: Element IDD <NUMBER>
* 2: Element IDCs <ARRAY> * 2: Element IDCs <ARRAY>
* 1: Force change even when disallowed <BOOL>
* *
* Return Value: * Return Value:
* None * None
* *
* Example: * Example:
* [show, 303, [188]] call ace_ui_fnc_setAdvancedElement * [[show, 303, [188]], false] call ace_ui_fnc_setAdvancedElement
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #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 // Get show/hide boolean from mission namespace if it's a string
if (typeName _show == "STRING") then { if (typeName _show == "STRING") then {
@ -26,7 +33,6 @@ if (typeName _show == "STRING") then {
}; };
_show = [1, 0] select _show; _show = [1, 0] select _show;
// Disable/Enable elements // Disable/Enable elements
{ {
private _idc = _x; private _idc = _x;

View File

@ -3,18 +3,24 @@
* Sets basic visible elements of the UI using showHUD setter. * Sets basic visible elements of the UI using showHUD setter.
* *
* Arguments: * Arguments:
* None * 0: Force change even when disallowed <BOOL>
* *
* Return Value: * Return Value:
* None * None
* *
* Example: * Example:
* [] call ace_ui_fnc_setElements * [false] call ace_ui_fnc_setElements
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #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] private _shownHUD = shownHUD; // [hud, info, radar, compass, direction, menu, group, cursors]
["ui", [ ["ui", [

View File

@ -1,8 +1,8 @@
#define COMPONENT ui #define COMPONENT ui
#include "\z\ace\addons\main\script_mod.hpp" #include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS // #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS // #define ENABLE_PERFORMANCE_COUNTERS
@ -28,8 +28,8 @@
[QGVAR(ammoType), 300, [155] ], \ [QGVAR(ammoType), 300, [155] ], \
[QGVAR(ammoCount), 300, [184] ], \ [QGVAR(ammoCount), 300, [184] ], \
[QGVAR(magCount), 300, [185] ], \ [QGVAR(magCount), 300, [185] ], \
[QGVAR(grenadeName), 300, [152] ], \ [QGVAR(throwableName), 300, [152] ], \
[QGVAR(grenadeCount), 300, [151] ], \ [QGVAR(throwableCount), 300, [151] ], \
[QGVAR(weaponLowerInfoBackground), 300, [1202] ], \ [QGVAR(weaponLowerInfoBackground), 300, [1202] ], \
[QGVAR(zeroing), 300, [168] ], \ [QGVAR(zeroing), 300, [168] ], \
[QGVAR(stance), 303, [188, 1201] ], \ [QGVAR(stance), 303, [188, 1201] ], \

View File

@ -4,14 +4,18 @@
<Key ID="STR_ACE_UI_Category"> <Key ID="STR_ACE_UI_Category">
<English>User Interface</English> <English>User Interface</English>
</Key> </Key>
<Key ID="STR_ACE_UI_ModuleName"> <Key ID="STR_ACE_UI_ModuleName">
<English>User Interface (Basic)</English> <English>User Interface</English>
</Key> </Key>
<Key ID="STR_ACE_UI_ModuleDescription"> <Key ID="STR_ACE_UI_ModuleDescription">
<English>This module allows hiding of basic user interface parts. Makes some User Interface (Advanced) settings inoperable.</English> <English>This module allows toggling visible user interface parts.</English>
</Key>
<Key ID="STR_ACE_UI_AllowSelectiveUI">
<English>Allow Selective UI</English>
</Key>
<Key ID="STR_ACE_UI_AllowSelectiveUI_Description">
<English>Allow client to modify their UI.</English>
</Key> </Key>
<Key ID="STR_ACE_UI_SoldierVehicleWeaponInfo"> <Key ID="STR_ACE_UI_SoldierVehicleWeaponInfo">
<English>Soldier/Vehicle/Weapon Information</English> <English>Soldier/Vehicle/Weapon Information</English>
</Key> </Key>
@ -27,15 +31,6 @@
<Key ID="STR_ACE_UI_GroupBar"> <Key ID="STR_ACE_UI_GroupBar">
<English>Group Bar</English> <English>Group Bar</English>
</Key> </Key>
<Key ID="STR_ACE_UI_ModuleName_Advanced">
<English>User Interface (Advanced)</English>
</Key>
<Key ID="STR_ACE_UI_ModuleDescription_Advanced">
<English>This module allows hiding of specific user interface parts, more detailed than basic. User Interface (Basic) settings will make some of the settings inoperable.</English>
</Key>
<Key ID="STR_ACE_UI_WeaponName"> <Key ID="STR_ACE_UI_WeaponName">
<English>Weapon Name</English> <English>Weapon Name</English>
</Key> </Key>
@ -51,17 +46,14 @@
<Key ID="STR_ACE_UI_AmmoCount"> <Key ID="STR_ACE_UI_AmmoCount">
<English>Ammo Count</English> <English>Ammo Count</English>
</Key> </Key>
<Key ID="STR_ACE_UI_AmmoCountDesc">
<English>Always disabled on foot by ace_reload.</English>
</Key>
<Key ID="STR_ACE_UI_MagCount"> <Key ID="STR_ACE_UI_MagCount">
<English>Magazine Count</English> <English>Magazine Count</English>
</Key> </Key>
<Key ID="STR_ACE_UI_GrenadeFlareType"> <Key ID="STR_ACE_UI_ThrowableName">
<English>Grenade/Flare Type</English> <English>Throwable Type</English>
</Key> </Key>
<Key ID="STR_ACE_UI_GrenadeFlareCount"> <Key ID="STR_ACE_UI_ThrowableCount">
<English>Grenade/Flare Count</English> <English>Throwable Count</English>
</Key> </Key>
<Key ID="STR_ACE_UI_Zeroing"> <Key ID="STR_ACE_UI_Zeroing">
<English>Zeroing</English> <English>Zeroing</English>
@ -72,7 +64,6 @@
<Key ID="STR_ACE_UI_Stance"> <Key ID="STR_ACE_UI_Stance">
<English>Stance</English> <English>Stance</English>
</Key> </Key>
<Key ID="STR_ACE_UI_VehicleName"> <Key ID="STR_ACE_UI_VehicleName">
<English>Vehicle Name</English> <English>Vehicle Name</English>
</Key> </Key>
@ -97,5 +88,11 @@
<Key ID="STR_ACE_UI_VehicleGunnerWeapon"> <Key ID="STR_ACE_UI_VehicleGunnerWeapon">
<English>Vehicle Gunner Weapon</English> <English>Vehicle Gunner Weapon</English>
</Key> </Key>
<Key ID="STR_ACE_UI_RequiresSoldierVehicleWeaponInfo">
<English>Requires Soldier/Vehicle/Weapons Information.</English>
</Key>
<Key ID="STR_ACE_UI_Disallowed">
<English>Modifying User Interface is disabled.</English>
</Key>
</Package> </Package>
</Project> </Project>