Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add settings to toggle attributes #716

Merged
merged 14 commits into from
May 21, 2023
1 change: 1 addition & 0 deletions addons/attributes/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ GVAR(previousMarkerColors) = [] call CBA_fnc_createNamespace;

// Initialize the core/default attributes
#include "initAttributes.sqf"
#include "initSettings.sqf"

ADDON = true;
8 changes: 4 additions & 4 deletions addons/attributes/initAttributes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
} forEach call EFUNC(common,getSelectedUnits);
},
{rank _entity},
{alive _entity && {_entity isKindOf "CAManBase"}}
{GVAR(enableRank) && {alive _entity && {_entity isKindOf "CAManBase"}}}
] call FUNC(addAttribute);

[
Expand Down Expand Up @@ -140,7 +140,7 @@
} forEach call EFUNC(common,getSelectedVehicles);
},
{locked _entity},
{alive _entity && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}}
{GVAR(enableVehicleLock) && {alive _entity} && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}}
] call FUNC(addAttribute);

[
Expand Down Expand Up @@ -249,7 +249,7 @@
{
_entity getVariable [QGVAR(respawnPos), []] param [0, sideEmpty]
},
{alive _entity && {canMove _entity} && {_entity isKindOf "AllVehicles"} && {!(_entity isKindOf "Animal")}}
{GVAR(enableRespawn) && {alive _entity} && {canMove _entity} && {_entity isKindOf "AllVehicles"} && {!(_entity isKindOf "Animal")}}
] call FUNC(addAttribute);

[
Expand Down Expand Up @@ -298,7 +298,7 @@

_respawnID
},
{_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}
{GVAR(enableRespawn) && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}}
] call FUNC(addAttribute);

[
Expand Down
26 changes: 26 additions & 0 deletions addons/attributes/initSettings.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
QGVAR(enableRank),
"CHECKBOX",
["str_3den_object_attribute_rank_displayname", LSTRING(EnableAttribute_Description)],
[ELSTRING(main,DisplayName), "str_3den_display3den_menubar_attributes_text"],
true,
false
] call CBA_fnc_addSetting;

[
QGVAR(enableVehicleLock),
"CHECKBOX",
["str_3den_object_attribute_lock_displayname", LSTRING(EnableAttribute_Description)],
[ELSTRING(main,DisplayName), "str_3den_display3den_menubar_attributes_text"],
true,
false
] call CBA_fnc_addSetting;

[
QGVAR(enableRespawn),
"CHECKBOX",
["str_3den_multiplayer_attributecategory_respawn_displayname", LSTRING(EnableAttribute_Description)],
[ELSTRING(main,DisplayName), "str_3den_display3den_menubar_attributes_text"],
true,
false
] call CBA_fnc_addSetting;
4 changes: 4 additions & 0 deletions addons/attributes/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -368,5 +368,9 @@
<Chinese>打開所選實體的Zeus屬性顯示。當選擇多個實體時(即由於選擇了一個小組),將使用懸停的實體。</Chinese>
<Italian>Apre la visualizzazione degli attributi di Zeus per l'entità selezionata.\nQuando vengono selezionate più entità (ad es. a causa della selezione di un gruppo), verrà utilizzata l'entità al passaggio del mouse.</Italian>
</Key>
<Key ID="STR_ZEN_Attributes_EnableAttribute_Description">
<English>Enables the related attribute(s) in the Zeus attributes display</English>
<German>Zeigt die entsprechende Eigentschaft(en) im Eigenschaftsfenster an.</German>
</Key>
</Package>
</Project>