ACE3/addons/refuel/Cfg3DEN.hpp
Dystopian 7c65f8503d
Refuel - Add enable setting (#7613)
* Add enable setting

* Exclude man class init

* Fix multiplayer terrain pump fuel sync

* Add terrain pumps positions

* Add vanilla fuel cargo restoring before destroying

* Add Livonia positions by bux

* Fix terrain pumps destruction

* Improve settings init

* Fix double settings category

* Check enabled var in public functions

* Fix fnc_makeSource

* Handle recent CUP Terrains changes

* Update includes

* Fix issues introduced in #9133

* Change warning

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Optimisations and cleanup

- Use hashmaps wherever possible
- Reduced pump search radius by ~30%
- Sorted pumps alphabetically and sorted positions by "smallest" first, for consistency

* Add init debug trace

* compileScript in dev

* yoda conditions & DFUNC macro

* Wait until CBA settings are ready

* Update Chernarus 2020 and add more maps configs

* Remove vanilla fuel cargo restoring before destroying

---------

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2024-05-23 21:47:19 +02:00

34 lines
1.6 KiB
C++

#define GET_1ST_ARRAY(config) (if (isArray (config)) then {getArray (config) select 0} else {[ARR_3(0,0,0)]})
#define DEFAULT_HOOKS GET_1ST_ARRAY(configOf _this >> QQGVAR(hooks))
class Cfg3DEN {
class Object {
class AttributeCategories {
class ace_attributes {
class Attributes {
class GVAR(fuelCargo) {
displayName = CSTRING(fuelCargo_edenName);
tooltip = CSTRING(fuelCargo_edenDesc);
property = QGVAR(fuelCargo);
control = "EditShort";
expression = QUOTE(if (_value != (_this call FUNC(getFuelCargo))) then {[ARR_2(_this,_value)] call FUNC(makeSource)});
defaultValue = QUOTE(_this call FUNC(getFuelCargo));
validate = "number";
condition = "(1-objectBrain)*(1-objectAgent)";
typeName = "NUMBER";
};
class GVAR(hooks) {
displayName = CSTRING(hooks_edenName);
tooltip = CSTRING(hooks_edenDesc);
property = QGVAR(hooks);
control = "EditXYZ";
expression = QUOTE(if (_value isNotEqualTo DEFAULT_HOOKS) then {_this setVariable [ARR_3('%s',[_value],true)]});
defaultValue = QUOTE(DEFAULT_HOOKS);
condition = "(1-objectBrain)*(1-objectAgent)";
};
};
};
};
};
};