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 Ability to Transfer a Loadout from Saved to Default #6793

Merged
merged 13 commits into from
Feb 24, 2019
Merged
12 changes: 11 additions & 1 deletion addons/arsenal/functions/fnc_buttonLoadoutsSave.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,17 @@ switch (GVAR(currentLoadoutsTab)) do {
};
};

if (_loadoutIndex == -1) then {
if (GVAR(shiftState) && {is3DEN} && {!(_loadoutName isEqualTo "")} && {_cursSelRow != -1} && {!(_loadoutIndex isEqualto -1)}) exitwith {
private _defaultLoadoutsSearch = GVAR(defaultLoadoutsList) findIf {(_x select 0) == _loadoutName};
if (_defaultLoadoutsSearch isEqualto -1) then {
GVAR(defaultLoadoutsList) pushBack [_loadoutName, _curSelLoadout];
} else {
GVAR(defaultLoadoutsList) set [_defaultLoadoutsSearch , [ _loadoutName, _curSelLoadout]];
};
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
};

if (_loadoutIndex isEqualto -1) then {
_data pushBack [_editBoxContent, _loadout];
} else {
_data set [_loadoutIndex, [[_editBoxContent, _loadoutName] select (_loadoutName isEqualTo _editBoxContent), _loadout]];
Expand Down
3 changes: 3 additions & 0 deletions addons/arsenal/functions/fnc_loadoutsChangeTab.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,23 @@ switch (ctrlIDC _control) do {
case IDC_buttonMyLoadouts: {
_centerBoxTitleCtrl ctrlSetText (localize LSTRING(tabMyLoadoutsText));

if (is3den) then { _saveButtonCtrl ctrlSetTooltip format ["%1\n%2", localize LSTRING(buttonSaveTooltip), localize LSTRING(buttonSaveTooltip_shiftClick)]; };
_saveButtonCtrl ctrlEnable true;
_saveButtonCtrl ctrlCommit 0;
};

case IDC_buttonDefaultLoadouts: {
_centerBoxTitleCtrl ctrlSetText (localize LSTRING(tabDefaultLoadoutsText));

if (is3den) then { _saveButtonCtrl ctrlSetTooltip localize LSTRING(buttonSaveTooltip); };
_saveButtonCtrl ctrlEnable (is3DEN);
_saveButtonCtrl ctrlCommit 0;
};

case IDC_buttonSharedLoadouts: {
_centerBoxTitleCtrl ctrlSetText (localize LSTRING(tabSharedLoadoutsText));

if (is3den) then { _saveButtonCtrl ctrlSetTooltip localize LSTRING(buttonSaveTooltip); };
_saveButtonCtrl ctrlEnable false;
_saveButtonCtrl ctrlCommit 0;
};
Expand Down
3 changes: 3 additions & 0 deletions addons/arsenal/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
<Chinese>保存當前的裝備</Chinese>
<Chinesesimp>保存当前的装备</Chinesesimp>
</Key>
<Key ID="STR_ACE_Arsenal_buttonSaveTooltip_shiftClick">
<English>[Shift+Click to save to mission defaults]</English>
</Key>
<Key ID="STR_ACE_Arsenal_buttonRenameText">
<English>Rename</English>
<French>Renommer</French>
Expand Down