mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Indentation
This commit is contained in:
parent
281bad1e7e
commit
7ceaf7907a
@ -4,41 +4,41 @@
|
|||||||
// TODO This is a basic and limited implementation that mimics some of the functionality from the A3 module framework, but not all of it.
|
// TODO This is a basic and limited implementation that mimics some of the functionality from the A3 module framework, but not all of it.
|
||||||
// We have to execute this in the postInit XEH because on object init, the parameters of the modules are not yet available. They are if we execute it at the start of postInit execution.
|
// We have to execute this in the postInit XEH because on object init, the parameters of the modules are not yet available. They are if we execute it at the start of postInit execution.
|
||||||
{
|
{
|
||||||
[_x] call {
|
[_x] call {
|
||||||
private ["_logic", "_logicType", "_config", "_isGlobal", "_isDisposable", "_isPersistent","_function"];
|
private ["_logic", "_logicType", "_config", "_isGlobal", "_isDisposable", "_isPersistent","_function"];
|
||||||
_logic = _this select 0;
|
_logic = _this select 0;
|
||||||
_logicType = typeof _logic;
|
_logicType = typeof _logic;
|
||||||
_logic hideobject true;
|
_logic hideobject true;
|
||||||
|
|
||||||
if (_logic getvariable [QGVAR(initalized), false]) exitwith {};
|
if (_logic getvariable [QGVAR(initalized), false]) exitwith {};
|
||||||
_config = (configFile >> "CfgVehicles" >> _logicType);
|
_config = (configFile >> "CfgVehicles" >> _logicType);
|
||||||
if !(isClass _config) exitwith {};
|
if !(isClass _config) exitwith {};
|
||||||
|
|
||||||
// isGlobal = 1;
|
// isGlobal = 1;
|
||||||
_isGlobal = getNumber (_config >> "isGlobal") > 0;
|
_isGlobal = getNumber (_config >> "isGlobal") > 0;
|
||||||
_isDisposable = getNumber (_config >> "isDisposable") > 0;
|
_isDisposable = getNumber (_config >> "isDisposable") > 0;
|
||||||
_isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1;
|
_isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1;
|
||||||
_function = getText (_config >> "function");
|
_function = getText (_config >> "function");
|
||||||
if (isnil _function) then {
|
if (isnil _function) then {
|
||||||
_function = compile _function;
|
_function = compile _function;
|
||||||
} else {
|
} else {
|
||||||
_function = missionNamespace getvariable _function;
|
_function = missionNamespace getvariable _function;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_isGlobal) then {
|
if (_isGlobal) then {
|
||||||
[_logic, [], true] call _function;
|
[_logic, [], true] call _function;
|
||||||
} else {
|
} else {
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
[_logic, [], true] call _function;
|
[_logic, [], true] call _function;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if !(_isPersistent) then {
|
if !(_isPersistent) then {
|
||||||
_logic setvariable [QGVAR(initalized), true];
|
_logic setvariable [QGVAR(initalized), true];
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_isDisposable) then {
|
if (_isDisposable) then {
|
||||||
deleteVehicle _logic;
|
deleteVehicle _logic;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}foreach GVAR(moduleInitCollection);
|
}foreach GVAR(moduleInitCollection);
|
||||||
|
@ -19,9 +19,9 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
class ACE_Module: Module_F {
|
class ACE_Module: Module_F {
|
||||||
class EventHandlers {
|
class EventHandlers {
|
||||||
init = QUOTE(_this call DFUNC(moduleInit));
|
init = QUOTE(_this call DFUNC(moduleInit));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15,5 +15,5 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if ((_this select 0) isKindOf "Module_F") then {
|
if ((_this select 0) isKindOf "Module_F") then {
|
||||||
GVAR(moduleInitCollection) pushback (_this select 0);
|
GVAR(moduleInitCollection) pushback (_this select 0);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user