diff --git a/addons/arsenal/functions/fnc_compileStats.sqf b/addons/arsenal/functions/fnc_compileStats.sqf index 6ef70b811b..f705e76884 100644 --- a/addons/arsenal/functions/fnc_compileStats.sqf +++ b/addons/arsenal/functions/fnc_compileStats.sqf @@ -70,7 +70,7 @@ private _statsListLeftPanel = [ [[]], // GPS 11 [[]], // Radio 12 [[]], // Compass 13 - [[]] // Watch 14 + [[]] // Watch 14 ]; private _statsListRightPanel = [ diff --git a/addons/arsenal/functions/fnc_handleStats.sqf b/addons/arsenal/functions/fnc_handleStats.sqf index 980aeb8621..f9180f372d 100644 --- a/addons/arsenal/functions/fnc_handleStats.sqf +++ b/addons/arsenal/functions/fnc_handleStats.sqf @@ -157,61 +157,43 @@ if !(isNil "_itemCfg") then { if (ctrlIDC _control == IDC_leftTabContent) then { - switch (GVAR(currentLeftPanel)) do { - case IDC_buttonPrimaryWeapon: { - [0, true] call _handleStatsFnc; - }; - case IDC_buttonHandgun: { - [1, true] call _handleStatsFnc; - }; - case IDC_buttonSecondaryWeapon: { - [2, true] call _handleStatsFnc; - }; - case IDC_buttonUniform: { - [3, true] call _handleStatsFnc; - }; - case IDC_buttonVest: { - [4, true] call _handleStatsFnc; - }; - case IDC_buttonBackpack: { - [5, true] call _handleStatsFnc; - }; - case IDC_buttonHeadgear: { - [6, true] call _handleStatsFnc; - }; - case IDC_buttonGoggles: { - [7, true] call _handleStatsFnc; - }; - case IDC_buttonNVG: { - [8, true] call _handleStatsFnc; - }; - case IDC_buttonBinoculars: { - [9, true] call _handleStatsFnc; - }; - case IDC_buttonMap: { - [10, true] call _handleStatsFnc; - }; - case IDC_buttonGPS: { - [11, true] call _handleStatsFnc; - }; - case IDC_buttonRadio: { - [12, true] call _handleStatsFnc; - }; - case IDC_buttonCompass: { - [13, true] call _handleStatsFnc; - }; - case IDC_buttonWatch: { - [14, true] call _handleStatsFnc; - }; - case IDC_buttonFace: { - [15, true] call _handleStatsFnc; - }; - case IDC_buttonVoice: { - [16, true] call _handleStatsFnc; - }; - case IDC_buttonInsigna: { - [17, true] call _handleStatsFnc; - }; + if ([IDC_buttonFace, IDC_buttonVoice, IDC_buttonInsigna] find GVAR(currentLeftPanel) > -1) then { + + [[1, 2, 3, 4, 5]] call _hideUnusedFnc; + _statsBoxCtrl ctrlSetPosition [ + (0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP, + safezoneY + 1.8 * GRID_H, + 47 * GRID_W, + 11 * GRID_H + ]; + _statsBoxCtrl ctrlCommit 0; + + { + _x ctrlSetFade 1; + _x ctrlCommit 0; + } forEach [ + _statsPreviousPageCtrl, + _statsNextPageCtrl, + _statsCurrentPageCtrl + ]; + } else { + [[ + IDC_buttonPrimaryWeapon, + IDC_buttonHandgun, + IDC_buttonSecondaryWeapon, + IDC_buttonUniform, + IDC_buttonVest, + IDC_buttonBackpack, + IDC_buttonHeadgear, + IDC_buttonGoggles, + IDC_buttonNVG, + IDC_buttonBinoculars, + IDC_buttonMap, + IDC_buttonGPS, + IDC_buttonRadio, + IDC_buttonCompass, + IDC_buttonWatch + ] find GVAR(currentLeftPanel), true] call _handleStatsFnc; }; } else { diff --git a/addons/arsenal/functions/fnc_onArsenalClose.sqf b/addons/arsenal/functions/fnc_onArsenalClose.sqf index a456c5e1a3..316197faf0 100644 --- a/addons/arsenal/functions/fnc_onArsenalClose.sqf +++ b/addons/arsenal/functions/fnc_onArsenalClose.sqf @@ -14,19 +14,11 @@ (_this select 1) params ["", "_exitCode"]; -GVAR(camera) cameraEffect ["terminate", "back"]; private _cameraData = [getposAtl GVAR(camera), (getposAtl GVAR(camera)) vectorFromTo (getposAtl GVAR(cameraHelper))]; [QGVAR(displayClosed), []] call CBA_fnc_localEvent; - removeMissionEventHandler ["draw3D", GVAR(camPosUpdateHandle)]; -GVAR(camera) cameraEffect ["terminate","back"]; -player switchCamera GVAR(cameraView); - -deleteVehicle GVAR(cameraHelper); -camDestroy GVAR(camera); - if (is3DEN) then { private _centerOriginParent = objectParent GVAR(centerOrigin); @@ -62,8 +54,18 @@ if (is3DEN) then { case 1: {GVAR(center) selectWeapon secondaryWeapon GVAR(center);}; case 2: {GVAR(center) selectWeapon handgunWeapon GVAR(center);}; }; + + if (!(isnull curatorCamera) && {ACE_player == player}) then { + curatorcamera cameraEffect ["internal","back"]; + } else { + GVAR(camera) cameraEffect ["terminate","back"]; + ACE_player switchCamera GVAR(cameraView); + }; }; +deleteVehicle GVAR(cameraHelper); +camDestroy GVAR(camera); + if (isMultiplayer) then { [QGVAR(broadcastFace), [GVAR(center), GVAR(currentFace)], QGVAR(center) + "_face"] call CBA_fnc_globalEventJIP; @@ -73,10 +75,6 @@ if (isMultiplayer) then { [QGVAR(center) + "_voice", GVAR(center)] call CBA_fnc_removeGlobalEventJIP; }; -if !(isnull curatorCamera) then { - curatorcamera cameraEffect ["internal","back"]; -}; - GVAR(camera) = nil; GVAR(cameraHelper) = nil;