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

Arsenal - Add JIP support to Default Loadouts added mid-mission #9715

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions addons/arsenal/functions/fnc_addDefaultLoadout.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

params [["_name", "", [""]], ["_loadout", [], [[]]], ["_global", false, [false]]];

if (_global) then {
[QGVAR(addDefaultLoadout), [_name, _loadout]] call CBA_fnc_remoteEvent;
if (_global) exitWith {
private _eventID = format [QGVAR(loadouts_%1), _name];
[QGVAR(addDefaultLoadout), [_name, _loadout], _eventID] call CBA_fnc_globalEventJIP;
};

private _extendedInfo = createHashMap;
Expand Down
6 changes: 1 addition & 5 deletions addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ private _loadoutIndex = _data findIf {(_x select 0) == _loadoutName};
(_data select _loadoutIndex) set [0, _editBoxContent];

if (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts) then {
if (is3DEN) then {
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
} else {
[QGVAR(renameDefaultLoadout), [_loadoutName, _editBoxContent]] call CBA_fnc_remoteEvent;
};
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
};

private _currentLoadoutsTab = str GVAR(currentLoadoutsTab);
Expand Down
1 change: 1 addition & 0 deletions addons/arsenal/functions/fnc_loadoutsChangeTab.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ switch (ctrlIDC _control) do {
_saveButtonCtrl ctrlSetTooltip LLSTRING(buttonSaveTooltip);
};

_renameButtonCtrl ctrlEnable is3DEN; // no renaming mid-mission
_saveButtonCtrl ctrlEnable call FUNC(canEditDefaultLoadout);
_saveButtonCtrl ctrlCommit 0;
};
Expand Down
6 changes: 4 additions & 2 deletions addons/arsenal/functions/fnc_removeDefaultLoadout.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
*/
params [["_name", "", [""]], ["_global", false, [false]]];

if (_global) then {
[QGVAR(removeDefaultLoadout), [_name]] call CBA_fnc_remoteEvent;
if (_global) exitWith {
private _eventID = format [QGVAR(loadouts_%1), _name];
[_eventID] call CBA_fnc_removeGlobalEventJIP;
[QGVAR(removeDefaultLoadout), [_name]] call CBA_fnc_globalEvent;
};

GVAR(defaultLoadoutsList) deleteAt (GVAR(defaultLoadoutsList) findIf {(_x select 0) == _name});
Expand Down