Skip to content

Add Supply Cargo Attributes #753

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

Merged
merged 6 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions addons/attributes/initAttributes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,48 @@
{GVAR(enableAmmo) && {alive _entity} && {_entity call EFUNC(common,getVehicleAmmo) != -1}}
] call FUNC(addAttribute);

[
"Object",
LSTRING(AmmoCargo),
QGVAR(slider),
[0, 1, 0.1, true],
{
{
[QEGVAR(common,setAmmoCargo), [_x, _value], _x] call CBA_fnc_targetEvent;
} forEach call EFUNC(common,getSelectedVehicles);
},
{getAmmoCargo _entity},
{GVAR(enableAmmoCargo) && {getAmmoCargo _entity >= 0}}
] call FUNC(addAttribute);

[
"Object",
LSTRING(FuelCargo),
QGVAR(slider),
[0, 1, 0.1, true],
{
{
[QEGVAR(common,setFuelCargo), [_x, _value], _x] call CBA_fnc_targetEvent;
} forEach call EFUNC(common,getSelectedVehicles);
},
{getFuelCargo _entity},
{GVAR(enableFuelCargo) && {getFuelCargo _entity >= 0}}
] call FUNC(addAttribute);

[
"Object",
LSTRING(RepairCargo),
QGVAR(slider),
[0, 1, 0.1, true],
{
{
[QEGVAR(common,setRepairCargo), [_x, _value], _x] call CBA_fnc_targetEvent;
} forEach call EFUNC(common,getSelectedVehicles);
},
{getRepairCargo _entity},
{GVAR(enableRepairCargo) && {getRepairCargo _entity >= 0}}
] call FUNC(addAttribute);

[
"Object",
"STR_3DEN_Object_Attribute_Rank_displayName",
Expand Down
27 changes: 27 additions & 0 deletions addons/attributes/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,33 @@
false
] call CBA_fnc_addSetting;

[
QGVAR(enableAmmoCargo),
"CHECKBOX",
LSTRING(AmmoCargo),
[LSTRING(DisplayName), "STR_3DEN_Object_textPlural"],
true,
false
] call CBA_fnc_addSetting;

[
QGVAR(enableFuelCargo),
"CHECKBOX",
LSTRING(FuelCargo),
[LSTRING(DisplayName), "STR_3DEN_Object_textPlural"],
true,
false
] call CBA_fnc_addSetting;

[
QGVAR(enableRepairCargo),
"CHECKBOX",
LSTRING(RepairCargo),
[LSTRING(DisplayName), "STR_3DEN_Object_textPlural"],
true,
false
] call CBA_fnc_addSetting;

[
QGVAR(enableRank),
"CHECKBOX",
Expand Down
9 changes: 9 additions & 0 deletions addons/attributes/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
<Chinesesimp>Zeus Enhanced - 属性</Chinesesimp>
<Turkish>Zeus Enhanced - Özellikler</Turkish>
</Key>
<Key ID="STR_ZEN_Attributes_AmmoCargo">
<English>Ammo Cargo</English>
</Key>
<Key ID="STR_ZEN_Attributes_FuelCargo">
<English>Fuel Cargo</English>
</Key>
<Key ID="STR_ZEN_Attributes_RepairCargo">
<English>Repair Cargo</English>
</Key>
<Key ID="STR_ZEN_Attributes_Engine">
<English>Engine</English>
<French>Moteur</French>
Expand Down
15 changes: 15 additions & 0 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@
_vehicle setFuel _fuel;
}] call CBA_fnc_addEventHandler;

[QGVAR(setAmmoCargo), {
params ["_vehicle", "_ammoCargo"];
_vehicle setAmmoCargo _ammoCargo;
}] call CBA_fnc_addEventHandler;

[QGVAR(setFuelCargo), {
params ["_vehicle", "_fuelCargo"];
_vehicle setFuelCargo _fuelCargo;
}] call CBA_fnc_addEventHandler;

[QGVAR(setRepairCargo), {
params ["_vehicle", "_repairCargo"];
_vehicle setRepairCargo _repairCargo;
}] call CBA_fnc_addEventHandler;

[QGVAR(allowDamage), {
params ["_object", "_allow"];
_object allowDamage _allow;
Expand Down