Add setting to hide place or carry actions

This commit is contained in:
Timi007 2022-06-10 23:18:47 +02:00
parent 8a78b1b62e
commit 37cd98a4ee
No known key found for this signature in database
GPG Key ID: AFC60E0DA93308DA
4 changed files with 44 additions and 3 deletions

View File

@ -6,6 +6,8 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
ADDON = true;
#include "initSettings.sqf"
GVAR(flagItemCache) = createHashMap;
ADDON = true;

View File

@ -32,7 +32,7 @@ private _actions = [];
params ["_player", "", "_item"];
[_player, _item] call FUNC(placeFlag);
},
{true},
{GVAR(enablePlacing)},
{},
_x
] call EFUNC(interact_menu,createAction),
@ -50,7 +50,7 @@ private _actions = [];
params ["_player", "", "_item"];
[_player, _item] call FUNC(carryFlag);
},
{!([_this select 0] call FUNC(carriesFlag))}, // Should not carry flag already
{GVAR(enableCarrying) && {!([_this select 0] call FUNC(carriesFlag))}}, // Should not carry flag already
{},
_x
] call EFUNC(interact_menu,createAction),

View File

@ -0,0 +1,17 @@
private _category = [LELSTRING(common,categoryUncategorized), LLSTRING(SettingCategory)];
[
QGVAR(enablePlacing), "CHECKBOX",
[LSTRING(AllowPlacingFlags), LSTRING(AllowPlacingFlagsTooltip)],
_category,
true,
0
] call CBA_fnc_addSetting;
[
QGVAR(enableCarrying), "CHECKBOX",
[LSTRING(AllowCarryingFlags), LSTRING(AllowCarryingFlagsTooltip)],
_category,
true,
0
] call CBA_fnc_addSetting;

View File

@ -1,6 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Flags">
<Container name="settings">
<Key ID="STR_ACE_Flags_SettingCategory">
<English>Flags</English>
<German>Flaggen</German>
</Key>
<Key ID="STR_ACE_Flags_AllowPlacingFlags">
<English>Allow placing flags</English>
<German>Erlaube Flaggen zu platzieren</German>
</Key>
<Key ID="STR_ACE_Flags_AllowPlacingFlagsTooltip">
<English>Adds the actions to place flags when the corresponding item is in the inventory.</English>
<German>Fügt Aktionen zum Platzieren von Flaggen hinzu, wenn das jeweilige Item im Inventar ist.</German>
</Key>
<Key ID="STR_ACE_Flags_AllowCarryingFlags">
<English>Allow carrying flags</English>
<German>Erlaube Flaggen zu tragen</German>
</Key>
<Key ID="STR_ACE_Flags_AllowCarryingFlagsTooltip">
<English>Adds the actions to carry flags when the corresponding item is in the inventory.</English>
<German>Fügt Aktionen zum Tragen von Flaggen hinzu, wenn das jeweilige Item im Inventar ist.</German>
</Key>
</Container>
<Container name="displayNames">
<Key ID="STR_ACE_Flags_White">
<Original>Flag (White)</Original>