add setting to disable cook off effects

This commit is contained in:
commy2 2016-08-13 12:12:34 +02:00
parent c42004449d
commit f0a74781c9
4 changed files with 42 additions and 7 deletions

View File

@ -0,0 +1,9 @@
class ACE_Settings {
class GVAR(enableCookoff) {
displayName = CSTRING(enable_name);
description = CSTRING(enable_tooltip);
value = 0;
typeName = "BOOL";
};
};

View File

@ -6,26 +6,38 @@
// cookoff and burning engine
["Tank", "init", {
(_this select 0) addEventHandler ["HandleDamage", {
["tank", _this] call FUNC(handleDamage);
if (GVAR(enableCookoff)) then {
["tank", _this] call FUNC(handleDamage);
};
}];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
["Wheeled_APC_F", "init", {
(_this select 0) addEventHandler ["HandleDamage", {
["tank", _this] call FUNC(handleDamage);
if (GVAR(enableCookoff)) then {
["tank", _this] call FUNC(handleDamage);
};
}];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
["Car", "init", {
(_this select 0) addEventHandler ["HandleDamage", {
["car", _this] call FUNC(handleDamage);
if (GVAR(enableCookoff)) then {
["car", _this] call FUNC(handleDamage);
};
}];
}, nil, ["Wheeled_APC_F"], true] call CBA_fnc_addClassEventHandler;
// secondary explosions
["AllVehicles", "killed", {(_this select 0) call FUNC(secondaryExplosions)}, nil, ["Man"]] call CBA_fnc_addClassEventHandler;
["AllVehicles", "killed", {
if (GVAR(enableCookoff)) then {
(_this select 0) call FUNC(secondaryExplosions);
};
}, nil, ["Man"]] call CBA_fnc_addClassEventHandler;
// blow off turret effect
["Tank", "killed", {(_this select 0) call FUNC(blowOffTurret)}] call CBA_fnc_addClassEventHandler;
//Reammobox_F
["Tank", "killed", {
if (GVAR(enableCookoff)) then {
(_this select 0) call FUNC(blowOffTurret);
};
}] call CBA_fnc_addClassEventHandler;

View File

@ -14,6 +14,7 @@ class CfgPatches {
};
};
#include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgCloudlets.hpp"

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="CookOff">
<Key ID="STR_ACE_CookOff_enable_name">
<English>Enable cook off</English>
<German>Cook-off ermöglichen</German>
</Key>
<Key ID="STR_ACE_CookOff_enable_tooltip">
<English>Enables cook off and related vehicle destruction effects.</English>
<German>Ermöglicht Cook-off und zugehörige Fahrzeug-Zerstörungseffekte.</German>
</Key>
</Package>
</Project>