Merge branch 'arsenal_rewrite' into arsenal_3DEN

This commit is contained in:
Josuan Albin
2017-11-03 16:48:51 +01:00
committed by GitHub
15 changed files with 90 additions and 50 deletions

View File

@ -7,6 +7,7 @@ PREP_RECOMPILE_START;
PREP_RECOMPILE_END;
// Arsenal
GVAR(modList) = ["","curator","kart","heli","mark","expansion","expansionpremium"];
[QGVAR(camInverted), "CHECKBOX", "Invert camera controls", "ACE3 Arsenal", false] call CBA_Settings_fnc_init; // TBL

View File

@ -24,21 +24,29 @@ private _ctrlList = _display displayCtrl IDC_rightTabContentListnBox;
for "_l" from 0 to (lbSize _ctrlList - 1) do {
_ctrlList lnbSetText [[_l, 2], str 0];
_ctrlList lnbsetcolor [[_l, 1], [1, 1, 1, 1]];
_ctrlList lnbsetcolor [[_l, 2], [1, 1, 1, 1]];
};
// Fade out button
private _removeAllCtrl = _display displayCtrl IDC_buttonRemoveAll;
if (ctrlFade _removeAllCtrl != 1) then {
_removeAllCtrl ctrlSetFade 1;
};
if (ctrlShown _removeAllCtrl) then {
_removeAllCtrl ctrlShow false;
};
_removeAllCtrl ctrlSetFade 1;
_removeAllCtrl ctrlCommit FADE_DELAY;
(_display displayCtrl IDC_loadIndicatorBar) progressSetPosition 0;
(_display displayCtrl IDC_totalWeightText) ctrlSetText (GVAR(center) call EFUNC(movement,getWeight)); // TBL
// Update load bar and weight
private _loadIndicatorBarCtrl = _display displayCtrl IDC_loadIndicatorBar;
_loadIndicatorBarCtrl progressSetPosition 0;
(_display displayCtrl IDC_totalWeightText) ctrlSetText (GVAR(center) call EFUNC(movement,getWeight));
// Update right panel colors
private _maxLoad = switch (GVAR(currentLeftPanel)) do {
case IDC_buttonUniform: {
gettext (configfile >> "CfgWeapons" >> uniform GVAR(center) >> "ItemInfo" >> "containerClass")
};
case IDC_buttonVest: {
gettext (configfile >> "CfgWeapons" >> vest GVAR(center) >> "ItemInfo" >> "containerClass")
};
case IDC_buttonBackpack: {
backpack GVAR(center)
};
};
private _control = _display displayCtrl IDC_rightTabContentListnBox;
[_control, _maxLoad] call FUNC(updateRightPanel);

View File

@ -2,4 +2,4 @@
params ["_display"];
[_display, localize "Not implemented"] call FUNC(message);
[_display, "Not implemented"] call FUNC(message);

View File

@ -2,4 +2,4 @@
params ["_display"];
[_display, localize "Not implemented"] call FUNC(message);
[_display, "Not implemented"] call FUNC(message);

View File

@ -20,7 +20,7 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
};
_contentPanelCtrl setVariable [_loadoutName, nil];
_contentPanelCtrl setVariable [_loadoutName + QGVAR(currentLoadoutsTab), nil];
_contentPanelCtrl lnbDeleteRow _contentPanelCursSel;
_contentPanelCtrl lnbSetCurSelRow (_contentPanelCursSel);

View File

@ -10,7 +10,7 @@ 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, _loadout] select (GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts), true];
GVAR(center) setUnitLoadout [[_contentPanelCtrl getVariable _loadoutName + QGVAR(currentLoadoutsTab), _loadout] select (GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts), true];
GVAR(currentItems) = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", [], [], [], [], [], []];
for "_index" from 0 to 15 do {

View File

@ -23,8 +23,8 @@ if (count _similarLoadouts > 0) exitWith {
// Update loadout info in profile and list namespaces
_data set [_data find ((_data select {_x select 0 == _loadoutName}) select 0), [_editBoxContent, _loadout]];
_contentPanelCtrl setVariable [_loadoutName, nil];
_contentPanelCtrl setVariable [_editBoxContent, _loadout];
_contentPanelCtrl setVariable [_loadoutName + QGVAR(currentLoadoutsTab), nil];
_contentPanelCtrl setVariable [_editBoxContent + QGVAR(currentLoadoutsTab), _loadout];
_contentPanelCtrl lnbDeleteRow _curSelRow;

View File

@ -113,7 +113,7 @@ switch (GVAR(currentLoadoutsTab)) do {
_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];
_contentPanelCtrl lnbSort [1, false];

View File

@ -29,4 +29,5 @@ if (_loadoutIndex > -1) then {
[QGVAR(loadoutShared), [_contentPanelCtrl, [_profileName ,_loadoutName , _loadoutData]]] call CBA_fnc_remoteEvent;
};
_control ctrlSetText (["Share", "Unshare"] select ((_contentPanelCtrl lnbText [_contentPanelCursSel, 0]) != "")); // TBL
publicVariable QGVAR(sharedLoadoutsVars);

View File

@ -17,9 +17,23 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
{
_x params ["_loadoutName", "_loadoutData"];
([_loadoutData] call FUNC(verifyLoadout)) params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount"];
// Check if the check was ran already
if (isNil {_contentListCtrl getVariable _loadoutName}) then {
private _newRow = _contentListCtrl lnbAddRow ["",_loadoutName];
[_loadoutData] call FUNC(verifyLoadout)
} else {
_contentListCtrl getVariable (_loadoutName + "missingOrNilItemsCount")
} params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount", "_nullItemsList", "_unavailableItemsList"];
// Log missing / nil items to RPT
if (!(isNil "_nullItemsList") && {_nullItemsAmount > 0} || {_unavailableItemsAmount > 0}) then {
private _printComponent = "ACE_Arsenal - Loadout:";
private _printNullItemsList = ["Missing items:", str _nullItemsList] joinString " ";
private _printUnavailableItemsList = ["Unavailable items:", str _unavailableItemsList] joinString " ";
diag_log text (format ["%1%5 %2%5 %3%5 %4", _printComponent, "Name: " + _loadoutName, _printNullItemsList, _printUnavailableItemsList, endl]);
};
if (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts) then {
@ -28,6 +42,8 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
_contentListCtrl lnbSetColumnsPos [0, 0.05, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90];
};
private _newRow = _contentListCtrl lnbAddRow ["",_loadoutName];
_contentListCtrl lnbSetPicture [[_newRow, 2], getText (configFile >> "cfgWeapons" >> ((_loadout select 0) select 0) >> "picture")];
_contentListCtrl lnbSetPicture [[_newRow, 3], getText (configFile >> "cfgWeapons" >> ((_loadout select 1) select 0) >> "picture")];
_contentListCtrl lnbSetPicture [[_newRow, 4], getText (configFile >> "cfgWeapons" >> ((_loadout select 2) select 0) >> "picture")];
@ -47,7 +63,8 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
};
};
_contentListCtrl setVariable [_loadoutName, _loadout];
_contentListCtrl setVariable [_loadoutName + QGVAR(currentLoadoutsTab), _loadout];
_contentListCtrl setVariable [_loadoutName + "missingOrNilItemsCount" + QGVAR(currentLoadoutsTab) , [_nullItemsAmount, _unavailableItemsAmount]];
if ((profileName + _loadoutName) in GVAR(sharedLoadoutsVars)) then {
_contentListCtrl lnbSetText [[_newRow, 0], "X"];
@ -97,4 +114,5 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
publicVariable QGVAR(sharedLoadoutsVars);
};
GVAR(firstRun) = nil;
_contentListCtrl lnbSort [1, false];

View File

@ -48,8 +48,9 @@ if (isClass _itemCfg) then {
_ctrlDLC ctrlsetfade 1;
_ctrlDLCBackground ctrlsetfade 1;
};
_ctrlDLC ctrlcommit FADE_DELAY;
_ctrlDLCBackground ctrlcommit FADE_DELAY;
_ctrlDLC ctrlcommit 0;
_ctrlDLCBackground ctrlcommit 0;
} else {
_ctrlInfo ctrlSetFade 1;

View File

@ -64,7 +64,6 @@ GVAR(cameraPosition) = nil;
GVAR(visionMode) = nil;
GVAR(mouseButtonState) = nil;
GVAR(mode) = nil;
GVAR(currentLeftPanel) = nil;
GVAR(currentRightPanel) = nil;
GVAR(leftSearchbarFocus) = nil;

View File

@ -23,16 +23,12 @@ if (!GVAR(leftSearchbarFocus) && {!GVAR(rightSearchbarFocus)}) then {
[_display] call FUNC(buttonHide);
};
// Export button
case (_keyPressed == DIK_C): {
if (_ctrlState) then {
[_display] call FUNC(buttonExport);
};
case (_keyPressed == DIK_C && {_ctrlState}): {
[_display] call FUNC(buttonExport);
};
// Import button
case (_keyPressed == DIK_V): {
if (_ctrlState) then {
[_display] call FUNC(buttonImport);
};
case (_keyPressed == DIK_V && {_ctrlState}): {
[_display] call FUNC(buttonImport);
};
// Switch vision mode
case (_keyPressed in (actionkeys "nightvision")): {
@ -78,6 +74,15 @@ if (!GVAR(leftSearchbarFocus) && {!GVAR(rightSearchbarFocus)}) then {
[_display, _display displayCtrl IDC_rightSearchbar] call FUNC(handleSearchBar);
};
};
case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): {
_return = false;
};
case (_keyPressed == DIK_C && {_ctrlState}): {
_return = false;
};
case (_keyPressed == DIK_V && {_ctrlState}): {
_return = false;
};
};
};
@ -97,4 +102,4 @@ if (GVAR(rightTabLnBFocus) && {_keyPressed in [DIK_LEFT, DIK_RIGHT]}) then {
[_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo);
};
_return
_return

View File

@ -17,6 +17,8 @@ if (_curSel == -1) exitWith {
_saveButtonCtrl ctrlCommit 0;
};
_shareButtonCtrl ctrlSetText "Share"; // TBL
{
_x ctrlEnable false;
_x ctrlCommit 0;
@ -33,8 +35,10 @@ switch (GVAR(currentLoadoutsTab)) do {
_loadButtonCtrl ctrlEnable true;
_loadButtonCtrl ctrlCommit 0;
_shareButtonCtrl ctrlSetText (["Share", "Unshare"] select ((_control lnbText [_curSel, 0]) != "")); // TBL
{
_x ctrlEnable (_curSel >= 0);
_x ctrlEnable true;
_x ctrlCommit 0;
} foreach [_renameButtonCtrl, _deleteButtonCtrl];

View File

@ -12,6 +12,8 @@ private _accsArray = GVAR(virtualItems) select 1;
private _nullItemsAmount = 0;
private _unavailableItemsAmount = 0;
private _nullItemsList = [];
private _unavailableItemsList = [];
private _fnc_weaponCheck = {
params ["_dataPath"];
@ -26,13 +28,13 @@ private _fnc_weaponCheck = {
if (isClass (_weaponCfg >> _item)) then {
if !(CHECK_WEAPON_OR_ACC) then {
TRACE_1("item unavailable", _item);
_unavailableItemsList pushBackUnique _item;
_dataPath set [_forEachIndex, ""];
_unavailableItemsAmount = _unavailableItemsAmount + 1;
};
} else {
TRACE_1("item null", _item);
_nullItemsList pushBackUnique _item;
_dataPath set [_forEachIndex, ""];
_nullItemsAmount = _nullItemsAmount + 1;
};
@ -46,13 +48,13 @@ private _fnc_weaponCheck = {
if (isClass (_magCfg >> _mag)) then {
if !(_mag in (GVAR(virtualItems) select 2)) then {
TRACE_1("item unavailable", _item);
_unavailableItemsList pushBackUnique _item;
_dataPath set [_forEachIndex, []];
_unavailableItemsAmount = _unavailableItemsAmount + 1;
};
} else {
TRACE_1("item null", _item);
_nullItemsList pushBackUnique _item;
_dataPath set [_forEachIndex, []];
_nullItemsAmount = _nullItemsAmount + 1;
};
@ -83,7 +85,7 @@ for "_dataIndex" from 0 to 9 do {
if (isClass (_vehcCfg >> _item) || {isClass (_weaponCfg >> _item)}) then {
if !(CHECK_CONTAINER) then {
TRACE_1("item unavailable", _item);
_unavailableItemsList pushBackUnique _item;
_loadout set [_dataIndex, []];
_unavailableItemsAmount = _unavailableItemsAmount + 1;
} else {
@ -108,7 +110,7 @@ for "_dataIndex" from 0 to 9 do {
};
} else {
TRACE_1("item null", _item);
_nullItemsList pushBackUnique _item;
((_loadout select _dataIndex) select 1) set [_currentIndex, []];
_nullItemsAmount = _nullItemsAmount + 1;
};
@ -130,7 +132,7 @@ for "_dataIndex" from 0 to 9 do {
};
} else {
TRACE_1("item null", _item);
_nullItemsList pushBackUnique _item;
((_loadout select _dataIndex) select 1) set [_currentIndex, []];
_nullItemsAmount = _nullItemsAmount + 1;
};
@ -141,6 +143,7 @@ for "_dataIndex" from 0 to 9 do {
};
} else {
_nullItemsList pushBackUnique _item;
_loadout set [_dataIndex, []];
_nullItemsAmount = _nullItemsAmount + 1;
};
@ -156,13 +159,13 @@ for "_dataIndex" from 0 to 9 do {
if !(_item in (GVAR(virtualItems) select 3)) then {
TRACE_1("item unavailable", _item);
_unavailableItemsList pushBackUnique _item;
_loadout set [_dataIndex, ""];
_unavailableItemsAmount = _unavailableItemsAmount + 1;
};
} else {
TRACE_1("item null", _item);
_nullItemsList pushBackUnique _item;
_loadout set [_dataIndex, ""];
_nullItemsAmount = _nullItemsAmount + 1;
};
@ -178,13 +181,13 @@ for "_dataIndex" from 0 to 9 do {
if !(_item in (GVAR(virtualItems) select 7)) then {
TRACE_1("item unavailable", _item);
_unavailableItemsList pushBackUnique _item;
_loadout set [_dataIndex, ""];
_unavailableItemsAmount = _unavailableItemsAmount + 1;
};
} else {
TRACE_1("item null", _item);
_nullItemsList pushBackUnique _item;
_loadout set [_dataIndex, ""];
_nullItemsAmount = _nullItemsAmount + 1;
};
@ -201,13 +204,13 @@ for "_dataIndex" from 0 to 9 do {
if !(CHECK_ASSIGNED_ITEMS) then {
TRACE_1("item unavailable", _item);
_unavailableItemsList pushBackUnique _item;
(_loadout select _dataIndex) set [_subIndex, ""];
_unavailableItemsAmount = _unavailableItemsAmount + 1;
};
} else {
TRACE_1("item null", _item);
_nullItemsList pushBackUnique _item;
(_loadout select _dataIndex) set [_subIndex, ""];
_nullItemsAmount = _nullItemsAmount + 1;
};
@ -217,4 +220,4 @@ for "_dataIndex" from 0 to 9 do {
};
};
[_loadout, _nullItemsAmount, _unavailableItemsAmount]
[_loadout, _nullItemsAmount, _unavailableItemsAmount, _nullItemsList, _unavailableItemsList]