Fix shared loadouts loadout index being null

Forgot to change that one getVar
This commit is contained in:
Josuan Albin
2017-11-05 06:59:14 +01:00
parent 917cb81d80
commit 362838d066
4 changed files with 19 additions and 5 deletions

View File

@ -9,8 +9,22 @@ private _contentPanelCtrl = _display displayCtrl IDC_contentPanel;
private _curSel = lnbCurSelRow _contentPanelCtrl;
private _loadoutName = _contentPanelCtrl lnbText [_curSel, 1];
private _loadout = (GVAR(sharedLoadoutsNamespace) getVariable ((_contentPanelCtrl lnbText [_curSel, 0]) + (_contentPanelCtrl lnbText [_curSel, 1]))) select 2;
GVAR(center) setUnitLoadout [[_contentPanelCtrl getVariable _loadoutName + QGVAR(currentLoadoutsTab), _loadout] select (GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts), true];
private _loadout = switch GVAR(currentLoadoutsTab) do {
case IDC_buttonMyLoadouts;
case IDC_buttonDefaultLoadouts:{
_contentPanelCtrl getVariable _loadoutName + QGVAR(currentLoadoutsTab)
};
case IDC_buttonSharedLoadouts:{
(GVAR(sharedLoadoutsNamespace) getVariable ((_contentPanelCtrl lnbText [_curSel, 0]) + (_contentPanelCtrl lnbText [_curSel, 1]))) select 2
};
};
TRACE_1("loadout load", _loadout);
GVAR(center) setUnitLoadout [_loadout, true];
GVAR(currentItems) = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", [], [], [], [], [], []];
for "_index" from 0 to 15 do {

View File

@ -12,7 +12,7 @@ private _profileName = profileName; // GVAR(center) could be a remote unit
private _loadoutVar = _profileName + _loadoutName;
private _loadoutIndex = GVAR(sharedLoadoutsVars) find _loadoutVar;
private _loadoutData = _contentPanelCtrl getVariable _loadoutName;
private _loadoutData = _contentPanelCtrl getVariable (_loadoutName + QGVAR(currentLoadoutsTab));
if (_loadoutIndex > -1) then {
GVAR(sharedLoadoutsNamespace) setVariable [_loadoutVar, nil, true];

View File

@ -75,7 +75,7 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
{
_x params ["_playerName", "_loadoutName", "_loadoutData"];
if !((allPlayers apply {name _x}) find _playerName > -1) then {
if ((allPlayers apply {name _x}) find _playerName == -1) then {
private _loadoutVar = _playerName + _loadoutName;
GVAR(sharedLoadoutsNamespace) setVariable [_loadoutVar, nil, true];

View File

@ -15,7 +15,7 @@
* [LOGIC, nil, true] call ace_zeus_fnc_bi_moduleArsenal
*
* Public: No
*/
*/
#include "script_component.hpp"