mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Improve cook off settings UX (#5351)
* Improve cookoff setting UX - Adds second eden attribute to boxes/vehicles to toggle the ammunition cookoff itself - Removes the cookoff toggle from boxes (they only care about ammunition cookoff) * Fix attribute default values * Update incendiary box ignition code
This commit is contained in:
parent
0630ebd93a
commit
b1f5caacbb
@ -11,8 +11,18 @@ class Cfg3DEN {
|
|||||||
tooltip = CSTRING(enable_tooltip);
|
tooltip = CSTRING(enable_tooltip);
|
||||||
expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};);
|
expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};);
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
|
condition = "objectVehicle";
|
||||||
|
defaultValue = QUOTE(GETMVAR(QGVAR(enable),true));
|
||||||
|
};
|
||||||
|
class GVAR(enableAmmoCookoff) {
|
||||||
|
property = QGVAR(enableAmmoCookoff);
|
||||||
|
control = "Checkbox";
|
||||||
|
displayName = CSTRING(enableAmmoCookoff_name);
|
||||||
|
tooltip = CSTRING(enableAmmoCookoff_tooltip);
|
||||||
|
expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};);
|
||||||
|
typeName = "BOOL";
|
||||||
condition = "objectHasInventoryCargo";
|
condition = "objectHasInventoryCargo";
|
||||||
defaultValue = "(true)"; // fix pbo project preprocessing bug
|
defaultValue = QUOTE(if (_this isKindOf 'ReammoBox_F') then { GETMVAR(QGVAR(enableAmmobox),true) } else { GETMVAR(QGVAR(enableAmmoCookoff),true) };);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -71,7 +71,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
|
|||||||
|
|
||||||
["ReammoBox_F", "init", {
|
["ReammoBox_F", "init", {
|
||||||
(_this select 0) addEventHandler ["HandleDamage", {
|
(_this select 0) addEventHandler ["HandleDamage", {
|
||||||
if ((_this select 0) getVariable [QGVAR(enable), GVAR(enableAmmobox)]) then {
|
if ((_this select 0) getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmobox)]) then {
|
||||||
["box", _this] call FUNC(handleDamage);
|
["box", _this] call FUNC(handleDamage);
|
||||||
};
|
};
|
||||||
}];
|
}];
|
||||||
|
@ -44,11 +44,9 @@ if (local _box) then {
|
|||||||
|
|
||||||
// These functions are smart and do all the cooking off work
|
// These functions are smart and do all the cooking off work
|
||||||
if (local _box) then {
|
if (local _box) then {
|
||||||
if (_box getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)]) then {
|
if (GVAR(ammoCookoffDuration) == 0) exitWith {};
|
||||||
if (GVAR(ammoCookoffDuration) == 0) exitWith {};
|
([_box] call FUNC(getVehicleAmmo)) params ["_mags", "_total"];
|
||||||
([_box] call FUNC(getVehicleAmmo)) params ["_mags", "_total"];
|
[_box, _mags, _total] call FUNC(detonateAmmunition);
|
||||||
[_box, _mags, _total] call FUNC(detonateAmmunition);
|
|
||||||
};
|
|
||||||
|
|
||||||
// This shit is busy being on fire, magazines aren't accessible/usable
|
// This shit is busy being on fire, magazines aren't accessible/usable
|
||||||
clearMagazineCargoGlobal _box;
|
clearMagazineCargoGlobal _box;
|
||||||
|
@ -169,7 +169,10 @@ if (isServer) then {
|
|||||||
_x setDamage 1;
|
_x setDamage 1;
|
||||||
};
|
};
|
||||||
if (_x isKindOf "ReammoBox_F") then {
|
if (_x isKindOf "ReammoBox_F") then {
|
||||||
if ("ace_cookoff" call EFUNC(common,isModLoaded) && {EGVAR(cookoff,enable)}) then {
|
if (
|
||||||
|
"ace_cookoff" call EFUNC(common,isModLoaded) &&
|
||||||
|
{GETVAR(_x,EGVAR(cookoff,enableAmmoCookoff),EGVAR(cookoff,enableAmmobox))}
|
||||||
|
) then {
|
||||||
_x call EFUNC(cookoff,cookOffBox);
|
_x call EFUNC(cookoff,cookOffBox);
|
||||||
} else {
|
} else {
|
||||||
_x setDamage 1;
|
_x setDamage 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user