Skip to content
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

Persistent modules #579

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion addons/custom_modules/functions/fnc_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ params ["_logic"];

private _index = getNumber (configOf _logic >> QGVAR(index));
private _function = GVAR(modulesList) param [_index, []] param [3, {}];
private _persist = GVAR(modulesList) param [_index, []] param [4, false];

private _position = getPosASL _logic;
deleteVehicle _logic;
if(!_persist) then { deleteVehicle _logic };

// Not using curatorCanAttach because that alters the height of the module
curatorMouseOver params ["_type", "_entity"];
Expand Down
5 changes: 3 additions & 2 deletions addons/custom_modules/functions/fnc_register.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ params [
["_category", "", [""]],
["_displayName", "", [""]],
["_function", {}, [{}]],
["_icon", "", [""]]
["_icon", "", [""]],
["_persist", false, [false]]
];

if (isNil QGVAR(modulesList)) then {
Expand All @@ -55,6 +56,6 @@ if (_icon isEqualTo "") then {
_icon = DEFAULT_ICON;
};

GVAR(modulesList) pushBack [_category, _displayName, _icon, _function];
GVAR(modulesList) pushBack [_category, _displayName, _icon, _function, _persist];

true