User Interface - Add setting for Development Build watermark (#8140)

Co-authored-by: jonpas <jonpas33@gmail.com>
This commit is contained in:
Dystopian 2021-04-21 01:26:48 +04:00 committed by PabstMirror
parent 011389c05c
commit 89fb57fdcf
7 changed files with 88 additions and 59 deletions

View File

@ -1,174 +1,182 @@
class ACE_UI { class ACE_UI {
class devWatermark {
idd = IDD_MISSION;
elements[] = {11400};
location = ANYWHERE;
class conditions {
isDevelopmentBranch = QUOTE(productVersion select 4 == 'Development');
};
};
class weaponName { class weaponName {
idd = 300; idd = IDD_UNITINFO;
elements[] = {118}; elements[] = {IDC_IGUI_WEAPON};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class weaponNameBackground { class weaponNameBackground {
idd = 300; idd = IDD_UNITINFO;
elements[] = {1001, 1008}; elements[] = {1001, 1008};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class firingMode { class firingMode {
idd = 300; idd = IDD_UNITINFO;
elements[] = {187, 1203}; elements[] = {IDC_IGUI_WEAPON_MODE_TEXTURE, 1203};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class ammoType { class ammoType {
idd = 300; idd = IDD_UNITINFO;
elements[] = {155}; elements[] = {IDC_IGUI_WEAPON_AMMO};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class ammoCount { class ammoCount {
idd = 300; idd = IDD_UNITINFO;
elements[] = {184}; elements[] = {IDC_IGUI_AMMOCOUNT};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class magCount { class magCount {
idd = 300; idd = IDD_UNITINFO;
elements[] = {185}; elements[] = {IDC_IGUI_MAGCOUNT};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class throwableName { class throwableName {
idd = 300; idd = IDD_UNITINFO;
elements[] = {152}; elements[] = {152};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class throwableCount { class throwableCount {
idd = 300; idd = IDD_UNITINFO;
elements[] = {151}; elements[] = {151};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class zeroing { class zeroing {
idd = 300; idd = IDD_UNITINFO;
elements[] = {168}; elements[] = {IDC_IGUI_WEAPON_ELEVATION};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class weaponLowerInfoBackground { class weaponLowerInfoBackground {
idd = 300; idd = IDD_UNITINFO;
elements[] = {1202}; elements[] = {1202};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class staminaBar { class staminaBar {
idd = 305; idd = IDD_STAMINA_BAR;
elements[] = {193}; elements[] = {IDC_IGUI_STAMINA_BAR};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class stance { class stance {
idd = 303; idd = IDD_STANCEINFO;
elements[] = {188, 1201}; elements[] = {IDC_IGUI_STANCE_INDICATOR, 1201};
location = GROUND_ONLY; location = GROUND_ONLY;
class conditions {}; class conditions {};
}; };
class gunnerWeaponName { class gunnerWeaponName {
idd = 300; idd = IDD_UNITINFO;
elements[] = {118}; elements[] = {IDC_IGUI_WEAPON};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class gunnerWeaponNameBackground { class gunnerWeaponNameBackground {
idd = 300; idd = IDD_UNITINFO;
elements[] = {1001, 1008}; elements[] = {1001, 1008};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class gunnerFiringMode { class gunnerFiringMode {
idd = 300; idd = IDD_UNITINFO;
elements[] = {187, 1203}; elements[] = {IDC_IGUI_WEAPON_MODE_TEXTURE, 1203};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class gunnerAmmoType { class gunnerAmmoType {
idd = 300; idd = IDD_UNITINFO;
elements[] = {155}; elements[] = {IDC_IGUI_WEAPON_AMMO};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class gunnerAmmoCount { class gunnerAmmoCount {
idd = 300; idd = IDD_UNITINFO;
elements[] = {184}; elements[] = {IDC_IGUI_AMMOCOUNT};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class gunnerMagCount { class gunnerMagCount {
idd = 300; idd = IDD_UNITINFO;
elements[] = {185}; elements[] = {IDC_IGUI_MAGCOUNT};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class gunnerLaunchableName { class gunnerLaunchableName {
idd = 300; idd = IDD_UNITINFO;
elements[] = {152}; elements[] = {152};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class gunnerLaunchableCount { class gunnerLaunchableCount {
idd = 300; idd = IDD_UNITINFO;
elements[] = {151}; elements[] = {151};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class gunnerZeroing { class gunnerZeroing {
idd = 300; idd = IDD_UNITINFO;
elements[] = {168}; elements[] = {IDC_IGUI_WEAPON_ELEVATION};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class gunnerWeaponLowerInfoBackground { class gunnerWeaponLowerInfoBackground {
idd = 300; idd = IDD_UNITINFO;
elements[] = {1202}; elements[] = {1202};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class vehicleName { class vehicleName {
idd = 300; idd = IDD_UNITINFO;
elements[] = {120}; elements[] = {IDC_IGUI_VEHICLE};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class vehicleNameBackground { class vehicleNameBackground {
idd = 300; idd = IDD_UNITINFO;
elements[] = {1000, 1013}; elements[] = {1000, 1013};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class vehicleFuelBar { class vehicleFuelBar {
idd = 300; idd = IDD_UNITINFO;
elements[] = {113, 1202}; elements[] = {IDC_IGUI_VALUE_FUEL, 1202};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class vehicleSpeed { class vehicleSpeed {
idd = 300; idd = IDD_UNITINFO;
elements[] = {121, 1004, 1006}; elements[] = {IDC_IGUI_SPEED, 1004, 1006};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class vehicleAltitude { class vehicleAltitude {
idd = 300; idd = IDD_UNITINFO;
elements[] = {122, 1005, 1014}; elements[] = {IDC_IGUI_ALT, 1005, 1014};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class vehicleDamage { class vehicleDamage {
idd = 300; idd = IDD_UNITINFO;
elements[] = {111}; elements[] = {IDC_IGUI_HITZONES};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};
}; };
class vehicleInfoBackground { class vehicleInfoBackground {
idd = 300; idd = IDD_UNITINFO;
elements[] = {1200}; elements[] = {1200};
location = VEHICLE_ONLY; location = VEHICLE_ONLY;
class conditions {}; class conditions {};

View File

@ -33,16 +33,19 @@ GVAR(elementsSet) = call CBA_fnc_createNamespace;
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;
// On changing settings // On changing settings
["ace_settingChanged", { ["CBA_SettingChanged", {
params ["_name"]; params ["_name", "_value"];
private _delimPos = count QUOTE(DOUBLES(ADDON,));
if (_name select [0, _delimPos] != QUOTE(DOUBLES(ADDON,))) exitWith {};
if (_name in ELEMENTS_BASIC) then { if (_name in ELEMENTS_BASIC) then {
[true] call FUNC(setElements); [true] call FUNC(setElements);
} else { } else {
private _nameNoPrefix = toLower (_name select [7]); private _nameNoPrefix = toLower (_name select [_delimPos]);
private _cachedElement = GVAR(configCache) getVariable _nameNoPrefix; private _cachedElement = GVAR(configCache) getVariable _nameNoPrefix;
if (!isNil "_cachedElement") then { if (!isNil "_cachedElement") then {
[_nameNoPrefix, missionNamespace getVariable _name, true] call FUNC(setAdvancedElement); [_nameNoPrefix, _value, true] call FUNC(setAdvancedElement);
}; };
}; };
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;

View File

@ -8,4 +8,6 @@ PREP_RECOMPILE_END;
GVAR(interfaceInitialized) = false; GVAR(interfaceInitialized) = false;
#include "initSettings.sqf"
ADDON = true; ADDON = true;

View File

@ -66,6 +66,7 @@ if (!_force) then {
}; };
}; };
private _displays = ((uiNamespace getVariable "IGUI_displays") + [findDisplay IDD_MISSION]) select {_idd == ctrlIDD _x};
private _fade = [1, 0] select _show; private _fade = [1, 0] select _show;
// Disable/Enable elements // Disable/Enable elements
@ -75,15 +76,16 @@ private _success = false;
// Loop through IGUI displays as they can be present several times for some reason // Loop through IGUI displays as they can be present several times for some reason
{ {
if (_idd == ctrlIDD _x) then { _success = true;
private _control = _x displayCtrl _idc;
if (ctrlFade _control == _fade) then {continue};
TRACE_4("Setting Element Visibility",_element,_fade,_idd,_idc); TRACE_4("Setting Element Visibility",_element,_fade,_idd,_idc);
(_x displayCtrl _idc) ctrlSetFade _fade; _control ctrlSetFade _fade;
(_x displayCtrl _idc) ctrlCommit 0; _control ctrlCommit 0;
} count _displays;
_success = true;
};
} count (uiNamespace getVariable "IGUI_displays");
nil nil
} count _elements; } count _elements;

View File

@ -0,0 +1,9 @@
if (productVersion select 4 == 'Development') then {
[
QGVAR(devWatermark),
"CHECKBOX",
LSTRING(devWatermark),
"ACE " + LLSTRING(Category),
true
] call CBA_fnc_addSetting;
};

View File

@ -16,6 +16,7 @@
#include "\z\ace\addons\main\script_macros.hpp" #include "\z\ace\addons\main\script_macros.hpp"
#include "\a3\ui_f\hpp\defineResincl.inc"
// Basic Elements // Basic Elements
#define ELEMENTS_BASIC [QGVAR(soldierVehicleWeaponInfo), QGVAR(vehicleRadar), QGVAR(vehicleCompass), QGVAR(commandMenu), QGVAR(groupBar)] #define ELEMENTS_BASIC [QGVAR(soldierVehicleWeaponInfo), QGVAR(vehicleRadar), QGVAR(vehicleCompass), QGVAR(commandMenu), QGVAR(groupBar)]

View File

@ -156,6 +156,10 @@
<Spanish>Barra de grupo</Spanish> <Spanish>Barra de grupo</Spanish>
<Turkish>Grup Göstergesi</Turkish> <Turkish>Grup Göstergesi</Turkish>
</Key> </Key>
<Key ID="STR_ACE_UI_devWatermark">
<English>Development Build Watermark</English>
<Russian>Водяной знак Development Build</Russian>
</Key>
<Key ID="STR_ACE_UI_WeaponName"> <Key ID="STR_ACE_UI_WeaponName">
<English>Weapon Name</English> <English>Weapon Name</English>
<Czech>Název zbraně</Czech> <Czech>Název zbraně</Czech>