mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add selective UI
This commit is contained in:
parent
3f59b2fd4e
commit
94ce49fedc
@ -1,37 +1,182 @@
|
|||||||
class ACE_Settings {
|
class ACE_Settings {
|
||||||
class GVAR(weaponInfo) {
|
// BASIC
|
||||||
|
class GVAR(soldierVehicleWeaponInfo) {
|
||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
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) {
|
class GVAR(weaponName) {
|
||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
|
isClientSettable = 1;
|
||||||
displayName = CSTRING(WeaponName);
|
displayName = CSTRING(WeaponName);
|
||||||
|
category = CSTRING(Category);
|
||||||
};
|
};
|
||||||
/*class GVAR(ammoCount) { // Disabled in config by ace_reload
|
class GVAR(weaponNameBackground) {
|
||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
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);
|
displayName = CSTRING(AmmoCount);
|
||||||
};*/
|
description = CSTRING(AmmoCountDesc);
|
||||||
|
category = CSTRING(Category);
|
||||||
|
};
|
||||||
class GVAR(magCount) {
|
class GVAR(magCount) {
|
||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
|
isClientSettable = 1;
|
||||||
displayName = CSTRING(MagCount);
|
displayName = CSTRING(MagCount);
|
||||||
|
category = CSTRING(Category);
|
||||||
};
|
};
|
||||||
class GVAR(grenadeName) {
|
class GVAR(grenadeFlareType) {
|
||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
displayName = CSTRING(GrenadeName);
|
isClientSettable = 1;
|
||||||
|
displayName = CSTRING(GrenadeFlareType);
|
||||||
|
category = CSTRING(Category);
|
||||||
};
|
};
|
||||||
class GVAR(grenadeCount) {
|
class GVAR(grenadeFlareCount) {
|
||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
displayName = CSTRING(GrenadeCount);
|
isClientSettable = 1;
|
||||||
|
displayName = CSTRING(GrenadeFlareCount);
|
||||||
|
category = CSTRING(Category);
|
||||||
};
|
};
|
||||||
class GVAR(zeroing) {
|
class GVAR(zeroing) {
|
||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
|
isClientSettable = 1;
|
||||||
displayName = CSTRING(Zeroing);
|
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);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,52 +1,38 @@
|
|||||||
class CfgVehicles {
|
class CfgVehicles {
|
||||||
class ACE_Module;
|
class ACE_Module;
|
||||||
|
|
||||||
|
// Basic
|
||||||
class ACE_ModuleUI: ACE_Module {
|
class ACE_ModuleUI: ACE_Module {
|
||||||
author = ECSTRING(common,ACETeam);
|
author = ECSTRING(common,ACETeam);
|
||||||
category = "ACE";
|
category = "ACE";
|
||||||
displayName = CSTRING(ModuleDisplayName);
|
displayName = CSTRING(ModuleName);
|
||||||
function = QFUNC(moduleInit);
|
function = QFUNC(moduleInit);
|
||||||
scope = 2;
|
scope = 2;
|
||||||
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 {
|
||||||
class weaponInfo {
|
class soldierVehicleWeaponInfo {
|
||||||
displayName = CSTRING(WeaponInfo);
|
displayName = CSTRING(SoldierVehicleWeaponInfo);
|
||||||
description = CSTRING(WeaponInfoDesc);
|
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
defaultValue = 1;
|
defaultValue = 1;
|
||||||
};
|
};
|
||||||
class weaponName {
|
class vehicleRadar {
|
||||||
displayName = CSTRING(WeaponName);
|
displayName = CSTRING(VehicleRadar);
|
||||||
description = CSTRING(WeaponNameDesc);
|
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
defaultValue = 1;
|
defaultValue = 1;
|
||||||
};
|
};
|
||||||
/*class ammoCount { // Disabled in config by ace_reload
|
class vehicleCompass {
|
||||||
displayName = CSTRING(AmmoCount);
|
displayName = CSTRING(VehicleCompass);
|
||||||
description = CSTRING(AmmoCountDesc);
|
|
||||||
typeName = "BOOL";
|
|
||||||
defaultValue = 1;
|
|
||||||
};*/
|
|
||||||
class magCount {
|
|
||||||
displayName = CSTRING(MagCount);
|
|
||||||
description = CSTRING(MagCountDesc);
|
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
defaultValue = 1;
|
defaultValue = 1;
|
||||||
};
|
};
|
||||||
class grenadeName {
|
class commandMenu {
|
||||||
displayName = CSTRING(GrenadeName);
|
displayName = CSTRING(CommandMenu);
|
||||||
description = CSTRING(GrenadeNameDesc);
|
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
defaultValue = 1;
|
defaultValue = 1;
|
||||||
};
|
};
|
||||||
class grenadeCount {
|
class groupBar {
|
||||||
displayName = CSTRING(GrenadeCount);
|
displayName = CSTRING(GroupBar);
|
||||||
description = CSTRING(GrenadeCountDesc);
|
|
||||||
typeName = "BOOL";
|
|
||||||
defaultValue = 1;
|
|
||||||
};
|
|
||||||
class zeroing {
|
|
||||||
displayName = CSTRING(Zeroing);
|
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
defaultValue = 1;
|
defaultValue = 1;
|
||||||
};
|
};
|
||||||
@ -55,4 +41,124 @@ class CfgVehicles {
|
|||||||
description = CSTRING(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 {
|
||||||
|
// 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);
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,63 +1,41 @@
|
|||||||
#define DEBUG_MODE_FULL
|
//#define DEBUG_MODE_FULL
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
// Exit on Headless
|
// Exit on Headless
|
||||||
if !(hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
["SettingsInitialized", {
|
["SettingsInitialized", {
|
||||||
|
// Selective UI Basic
|
||||||
|
call FUNC(setElements);
|
||||||
|
|
||||||
|
|
||||||
// On load and entering/exiting a vehicle
|
// On load and entering/exiting a vehicle
|
||||||
["infoDisplayChanged", {
|
["infoDisplayChanged", {
|
||||||
LOG("UI infoDisplayChanged");
|
// Selective UI Advanced
|
||||||
|
|
||||||
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;
|
_x call FUNC(setAdvancedElement);
|
||||||
{
|
} forEach ELEMENTS_ADVANCED;
|
||||||
EXPLODE_3_PVT(_x,_show,_idd,_idc);
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
//_idd = 300; //debug
|
|
||||||
//_idc = 122; //debug
|
|
||||||
if (_idd == ctrlIDD _display) then {
|
|
||||||
_show = if (_show) then {0} else {1};
|
|
||||||
|
|
||||||
(_display displayCtrl _idc) ctrlSetFade _show;
|
["SettingChanged", {
|
||||||
(_display displayCtrl _idc) ctrlCommit 0;
|
params ["_name"];
|
||||||
|
|
||||||
|
// Selective UI Basic
|
||||||
|
if (_name in ELEMENTS_BASIC) then {
|
||||||
|
call FUNC(setElements);
|
||||||
};
|
};
|
||||||
} forEach _elements;
|
|
||||||
} forEach (uiNamespace getVariable "IGUI_displays"); // Those displays can be present several times for some reason
|
// Selective UI Advanced
|
||||||
}] call EFUNC(common,addEventHandler);
|
{
|
||||||
|
_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);
|
||||||
|
|
||||||
|
}] 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)
|
|
||||||
*/
|
|
||||||
|
@ -3,5 +3,8 @@
|
|||||||
ADDON = false;
|
ADDON = false;
|
||||||
|
|
||||||
PREP(moduleInit);
|
PREP(moduleInit);
|
||||||
|
PREP(moduleInitAdvanced);
|
||||||
|
PREP(setAdvancedElement);
|
||||||
|
PREP(setElements);
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -12,18 +12,21 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#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);
|
// Exit if HUD visibility is hardcoded in mission config and showHUD command is overriden
|
||||||
[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule);
|
if (isArray (missionConfigFile >> "showHUD")) exitWith {
|
||||||
//[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); // Disabled in config by ace_reload
|
ACE_LOGINFO("User Interface (Basic) Module Failed to Initialize - showHUD overriden in mission config!");
|
||||||
[_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.";
|
[_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.");
|
||||||
|
42
addons/ui/functions/fnc_moduleInitAdvanced.sqf
Normal file
42
addons/ui/functions/fnc_moduleInitAdvanced.sqf
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* 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.");
|
43
addons/ui/functions/fnc_setAdvancedElement.sqf
Normal file
43
addons/ui/functions/fnc_setAdvancedElement.sqf
Normal file
@ -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 <BOOL/STRING>
|
||||||
|
* 1: Element IDD <NUMBER>
|
||||||
|
* 2: Element IDCs <ARRAY>
|
||||||
|
*
|
||||||
|
* 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;
|
44
addons/ui/functions/fnc_setElements.sqf
Normal file
44
addons/ui/functions/fnc_setElements.sqf
Normal file
@ -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);
|
||||||
|
*/
|
1
addons/ui/functions/script_component.hpp
Normal file
1
addons/ui/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "\z\ace\addons\ui\script_component.hpp"
|
@ -10,3 +10,75 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "\z\ace\addons\main\script_macros.hpp"
|
#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)
|
||||||
|
*/
|
||||||
|
@ -1,50 +1,101 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project name="ACE">
|
<Project name="ACE">
|
||||||
<Package name="UI">
|
<Package name="UI">
|
||||||
<Key ID="STR_ACE_UI_WeaponInfo">
|
<Key ID="STR_ACE_UI_Category">
|
||||||
<English>Weapon Info</English>
|
<English>User Interface</English>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_UI_WeaponInfoDesc">
|
|
||||||
<English>Entire weapon info interface (weapon name, firing mode, magazine info, ammo count, magazine count, grenade count) except zeroing.</English>
|
<Key ID="STR_ACE_UI_ModuleName">
|
||||||
|
<English>User Interface (Basic)</English>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_ModuleDescription">
|
||||||
|
<English>This module allows hiding of basic user interface parts. Makes some User Interface (Advanced) settings inoperable.</English>
|
||||||
|
</Key>
|
||||||
|
|
||||||
|
<Key ID="STR_ACE_UI_SoldierVehicleWeaponInfo">
|
||||||
|
<English>Soldier/Vehicle/Weapon Information</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_VehicleRadar">
|
||||||
|
<English>Vehicle Radar</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_VehicleCompass">
|
||||||
|
<English>Vehicle Compass</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_CommandMenu">
|
||||||
|
<English>Command Menu</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_GroupBar">
|
||||||
|
<English>Group Bar</English>
|
||||||
|
</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>
|
||||||
<Key ID="STR_ACE_UI_WeaponNameDesc">
|
<Key ID="STR_ACE_UI_WeaponNameBackground">
|
||||||
<English>Requires enabled Weapon Info</English>
|
<English>Weapon Name Background</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_FiringMode">
|
||||||
|
<English>Firing Mode</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_AmmoType">
|
||||||
|
<English>Ammo Type</English>
|
||||||
</Key>
|
</Key>
|
||||||
<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">
|
<Key ID="STR_ACE_UI_AmmoCountDesc">
|
||||||
<English>Requires enabled Weapon Info</English>
|
<English>Always disabled on foot by ace_reload.</English>
|
||||||
</Key>
|
</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_MagCountDesc">
|
<Key ID="STR_ACE_UI_GrenadeFlareType">
|
||||||
<English>Requires enabled Weapon Info</English>
|
<English>Grenade/Flare Type</English>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_UI_GrenadeName">
|
<Key ID="STR_ACE_UI_GrenadeFlareCount">
|
||||||
<English>Grenade Name</English>
|
<English>Grenade/Flare Count</English>
|
||||||
</Key>
|
|
||||||
<Key ID="STR_ACE_UI_GrenadeNameDesc">
|
|
||||||
<English>Requires enabled Weapon Info</English>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_ACE_UI_GrenadeCount">
|
|
||||||
<English>Grenade Count</English>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_ACE_UI_GrenadeCountDesc">
|
|
||||||
<English>Requires enabled Weapon Info</English>
|
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_UI_Zeroing">
|
<Key ID="STR_ACE_UI_Zeroing">
|
||||||
<English>Zeroing</English>
|
<English>Zeroing</English>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_UI_ModuleDisplayName">
|
<Key ID="STR_ACE_UI_WeaponLowerInfoBackground">
|
||||||
<English>User Interface</English>
|
<English>Weapon Lower Info Background</English>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_UI_ModuleDescription">
|
<Key ID="STR_ACE_UI_Stance">
|
||||||
<English>This module allows hiding of specific user interface parts.</English>
|
<English>Stance</English>
|
||||||
|
</Key>
|
||||||
|
|
||||||
|
<Key ID="STR_ACE_UI_VehicleName">
|
||||||
|
<English>Vehicle Name</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_VehicleNameBackground">
|
||||||
|
<English>Vehicle Name Background</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_VehicleFuelBar">
|
||||||
|
<English>Vehicle Fuel Bar</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_VehicleSpeed">
|
||||||
|
<English>Vehicle Speed</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_VehicleAltitude">
|
||||||
|
<English>Vehicle Altitude</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_VehicleDamage">
|
||||||
|
<English>Vehicle Damage</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_VehicleInfoBackground">
|
||||||
|
<English>Vehicle Info Background</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_UI_VehicleGunnerWeapon">
|
||||||
|
<English>Vehicle Gunner Weapon</English>
|
||||||
</Key>
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue
Block a user