Fix error in ACE Arsenal stats (#6175)

* Fix the camera on remote units ending after ace arsenal closes

* Shorten handleStats, fix error with face, voice, insignia tabs

* Remove uneccessary code

You saw nothiiiiing.
This commit is contained in:
Josuan Albin 2018-03-03 18:34:24 +01:00 committed by jonpas
parent 8ee7c1b132
commit 859b6a16f6
3 changed files with 48 additions and 68 deletions

View File

@ -70,7 +70,7 @@ private _statsListLeftPanel = [
[[]], // GPS 11
[[]], // Radio 12
[[]], // Compass 13
[[]] // Watch 14
[[]] // Watch 14
];
private _statsListRightPanel = [

View File

@ -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 {

View File

@ -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;