mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Make rename work in default loadouts tab in 3DEN
This commit is contained in:
@ -1,3 +1,16 @@
|
||||
/*
|
||||
* Author: Alganthe
|
||||
* Rename selected loadout
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Display <DISPLAY>
|
||||
* 1: Button control <CONTROL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#include "..\defines.hpp"
|
||||
|
||||
@ -5,12 +18,13 @@ params ["_display", "_control"];
|
||||
|
||||
if !(ctrlEnabled _control) exitWith {};
|
||||
|
||||
private _data = profileNamespace getVariable [QGVAR(saved_loadouts), []];
|
||||
|
||||
private _data = [profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts);
|
||||
|
||||
private _contentPanelCtrl = _display displayCtrl IDC_contentPanel;
|
||||
private _curSelRow = lnbCurSelRow _contentPanelCtrl;
|
||||
private _loadoutName = _contentPanelCtrl lnbText [_curSelRow, 1];
|
||||
private _loadout = _contentPanelCtrl getVariable _loadoutName;
|
||||
private _loadout = _contentPanelCtrl getVariable (_loadoutName + QGVAR(currentLoadoutsTab));
|
||||
|
||||
private _editBoxCtrl = _display displayCtrl IDC_textEditBox;
|
||||
private _editBoxContent = ctrlText _editBoxCtrl;
|
||||
@ -38,7 +52,7 @@ _contentPanelCtrl lnbSetPicture [[_newRow, 6], getText (configFile >> "cfgWeapon
|
||||
_contentPanelCtrl lnbSetPicture [[_newRow, 7], getText (configFile >> "cfgVehicles" >> ((_loadout select 5) select 0) >> "picture")];
|
||||
_contentPanelCtrl lnbSetPicture [[_newRow, 8], getText (configFile >> "cfgWeapons" >> (_loadout select 6) >> "picture")];
|
||||
_contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "cfgGlasses" >> (_loadout select 7) >> "picture")];
|
||||
_contentPanelCtrl setVariable [_editBoxContent, _loadout];
|
||||
_contentPanelCtrl setVariable [_editBoxContent + QGVAR(currentLoadoutsTab), _loadout];
|
||||
|
||||
// Sort and select the current row
|
||||
_contentPanelCtrl lnbSort [1, false];
|
||||
@ -46,4 +60,8 @@ for '_i' from 0 to (((lnbsize _contentPanelCtrl) select 0) - 1) do {
|
||||
if ((_contentPanelCtrl lnbText [_i, 1]) == _editBoxContent) exitwith {_contentPanelCtrl lnbSetCurSelRow _i};
|
||||
};
|
||||
|
||||
if (is3DEN) then {
|
||||
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
|
||||
};
|
||||
|
||||
[(findDisplay IDD_ace_arsenal), format ["Loadout '%1' was renamed to '%2'", _loadoutName, _editBoxContent]] call FUNC(message); // TBL
|
||||
|
@ -55,8 +55,10 @@ switch (GVAR(currentLoadoutsTab)) do {
|
||||
_shareButtonCtrl ctrlEnable false;
|
||||
_shareButtonCtrl ctrlCommit 0;
|
||||
|
||||
_deleteButtonCtrl ctrlEnable (is3DEN);
|
||||
_deleteButtonCtrl ctrlCommit 0;
|
||||
{
|
||||
_x ctrlEnable (is3DEN);
|
||||
_x ctrlCommit 0;
|
||||
} foreach [_deleteButtonCtrl, _renameButtonCtrl];
|
||||
|
||||
_textEditBoxCtrl ctrlSetText (_control lnbText [_curSel, 1]);
|
||||
};
|
||||
|
Reference in New Issue
Block a user