Various ACE Arsenal fixes (see description) (#5996)

* Copy the array properly when using preStart cache in openBox

* Fix add and removeVirtualItems erroring out when passing false as arg

* Disable face, voice, and insignia tabs in 3DEN

* Move grenadeList and putList outside of foreach in scanConfig

* Fix grenadeList and putList indentation

* Change the camera handling in onArsenalClose

Fixes the camera not being focused on the player after using ACE Arsenal on an other unit outside of zeus / 3DEN.
Remove the code that moved the curatorCam near the edited unit after ACE Arsenal is closed.

* Fix message control overflowing, move width defines to defines.hpp

* Add ability to exit arsenal and not apply a loadout in 3DEN

* Add ACE3 logo to common, fix config pathing to a non existing file
This commit is contained in:
Josuan Albin 2018-01-05 18:56:21 +01:00 committed by jonpas
parent 4379346b2f
commit 0acbde1489
10 changed files with 70 additions and 54 deletions

View File

@ -3,6 +3,10 @@
#define GRID_W (pixelW * pixelGridNoUIScale * pixelScale) #define GRID_W (pixelW * pixelGridNoUIScale * pixelScale)
#define GRID_H (pixelH * pixelGridNoUIScale * pixelScale) #define GRID_H (pixelH * pixelGridNoUIScale * pixelScale)
#define WIDTH_TOTAL (safezoneW - 2 * (93 * GRID_W))
#define WIDTH_GAP (WIDTH_TOTAL / 100)
#define WIDTH_SINGLE ((WIDTH_TOTAL - 6 * WIDTH_GAP) / 5)
// IDCs // IDCs
#define IDD_ace_arsenal 1127001 #define IDD_ace_arsenal 1127001
#define IDC_mouseArea 0 #define IDC_mouseArea 0

View File

@ -47,25 +47,27 @@ private _cargo = _object getVariable [QGVAR(virtualItems), [
private _configCfgWeapons = configFile >> "CfgWeapons"; //Save this lookup in variable for perf improvement private _configCfgWeapons = configFile >> "CfgWeapons"; //Save this lookup in variable for perf improvement
if (_items isEqualType true && {_items}) then { if (_items isEqualType true) then {
private _configItems = uiNamespace getVariable QGVAR(configItems); if (_items) then {
private _configItems = uiNamespace getVariable QGVAR(configItems);
{ {
(_x select 0) append (_x select 1); (_x select 0) append (_x select 1);
(_x select 2) set [(_x select 3), (_x select 0) arrayIntersect (_x select 0)]; (_x select 2) set [(_x select 3), (_x select 0) arrayIntersect (_x select 0)];
} forEach [ } forEach [
[(_cargo select 0 select 0),(_configItems select 0 select 0), _cargo select 0, 0], [(_cargo select 0 select 0),(_configItems select 0 select 0), _cargo select 0, 0],
[(_cargo select 0 select 1),(_configItems select 0 select 1), _cargo select 0, 1], [(_cargo select 0 select 1),(_configItems select 0 select 1), _cargo select 0, 1],
[(_cargo select 0 select 2),(_configItems select 0 select 2), _cargo select 0, 2], [(_cargo select 0 select 2),(_configItems select 0 select 2), _cargo select 0, 2],
[(_cargo select 1 select 0),(_configItems select 1 select 0), _cargo select 1, 0], [(_cargo select 1 select 0),(_configItems select 1 select 0), _cargo select 1, 0],
[(_cargo select 1 select 1),(_configItems select 1 select 1), _cargo select 1, 1], [(_cargo select 1 select 1),(_configItems select 1 select 1), _cargo select 1, 1],
[(_cargo select 1 select 2),(_configItems select 1 select 2), _cargo select 1, 2], [(_cargo select 1 select 2),(_configItems select 1 select 2), _cargo select 1, 2],
[(_cargo select 1 select 3),(_configItems select 1 select 3), _cargo select 1, 3] [(_cargo select 1 select 3),(_configItems select 1 select 3), _cargo select 1, 3]
]; ];
for "_index" from 2 to 17 do { for "_index" from 2 to 17 do {
(_cargo select _index) append (_configItems select _index); (_cargo select _index) append (_configItems select _index);
_cargo set [_index, (_cargo select _index) arrayIntersect (_cargo select _index)]; _cargo set [_index, (_cargo select _index) arrayIntersect (_cargo select _index)];
};
}; };
} else { } else {

View File

@ -12,6 +12,8 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
(_this select 1) params ["", "_exitCode"];
GVAR(camera) cameraEffect ["terminate", "back"]; GVAR(camera) cameraEffect ["terminate", "back"];
private _cameraData = [getposAtl GVAR(camera), (getposAtl GVAR(camera)) vectorFromTo (getposAtl GVAR(cameraHelper))]; private _cameraData = [getposAtl GVAR(camera), (getposAtl GVAR(camera)) vectorFromTo (getposAtl GVAR(cameraHelper))];
@ -19,9 +21,11 @@ private _cameraData = [getposAtl GVAR(camera), (getposAtl GVAR(camera)) vectorFr
removeMissionEventHandler ["draw3D", GVAR(camPosUpdateHandle)]; removeMissionEventHandler ["draw3D", GVAR(camPosUpdateHandle)];
camDestroy GVAR(camera); GVAR(camera) cameraEffect ["terminate","back"];
GVAR(center) switchCamera GVAR(cameraView); player switchCamera GVAR(cameraView);
deleteVehicle GVAR(cameraHelper); deleteVehicle GVAR(cameraHelper);
camDestroy GVAR(camera);
if (is3DEN) then { if (is3DEN) then {
@ -34,13 +38,13 @@ if (is3DEN) then {
GVAR(centerOrigin) hideObject false; GVAR(centerOrigin) hideObject false;
// Apply the loadout from the dummy to all selected units // Apply the loadout from the dummy to all selected units
{ if (_exitCode == 1) then {
_x setUnitLoadout (getUnitLoadout GVAR(center)); {
_x setFace GVAR(currentFace); _x setUnitLoadout (getUnitLoadout GVAR(center));
_x setSpeaker GVAR(currentVoice); } foreach (get3DENSelected "object");
} foreach (get3DENSelected "object");
save3DENInventory (get3DENSelected "object"); save3DENInventory (get3DENSelected "object");
};
deleteVehicle GVAR(light); deleteVehicle GVAR(light);
deleteVehicle GVAR(center); deleteVehicle GVAR(center);
@ -70,8 +74,6 @@ if (isMultiplayer) then {
}; };
if !(isnull curatorCamera) then { if !(isnull curatorCamera) then {
curatorcamera setPosAtl (_cameraData select 0);
curatorcamera setVectorDir (_cameraData select 1);
curatorcamera cameraEffect ["internal","back"]; curatorcamera cameraEffect ["internal","back"];
}; };

View File

@ -246,6 +246,20 @@ if (is3DEN) then {
GVAR(visionMode)= -2 call bis_fnc_3DENVisionMode; GVAR(visionMode)= -2 call bis_fnc_3DENVisionMode;
["ShowInterface",false] spawn bis_fnc_3DENInterface; ["ShowInterface",false] spawn bis_fnc_3DENInterface;
if (get3denactionstate "togglemap" > 0) then {do3DENAction "togglemap";}; if (get3denactionstate "togglemap" > 0) then {do3DENAction "togglemap";};
{
private _ctrl = _display displayctrl _x;
_ctrl ctrlEnable false;
_ctrl ctrlSetFade 0.6;
_ctrl ctrlcommit 0;
} foreach [
IDC_buttonFace,
IDC_buttonVoice,
IDC_buttonInsigna
];
_buttonCloseCtrl = _display displayCtrl IDC_menuBarClose;
_buttonCloseCtrl ctrlSetText (localize "STR_DISP_OK");
}; };
//--------------- Prepare the left panel //--------------- Prepare the left panel

View File

@ -42,7 +42,7 @@ if (isNil "_displayToUse" || {!isnil QGVAR(camera)}) exitWith {
}; };
if (_mode) then { if (_mode) then {
GVAR(virtualItems) = uiNamespace getVariable QGVAR(configItems); GVAR(virtualItems) = +(uiNamespace getVariable QGVAR(configItems));
} else { } else {
GVAR(virtualItems) = +(_object getVariable [QGVAR(virtualItems), [ GVAR(virtualItems) = +(_object getVariable [QGVAR(virtualItems), [
[[], [], []], [[], [], [], []], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [] [[], [], []], [[], [], [], []], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []

View File

@ -44,9 +44,11 @@ private _cargo = _object getVariable [QGVAR(virtualItems), [
[ ] // InventoryItems 17 [ ] // InventoryItems 17
]]; ]];
if (_items isEqualType true && {_items}) then { if (_items isEqualType true) then {
[_object, _global] call FUNC(removeBox); if (_items) then {
_object setVariable [QGVAR(virtualItems), nil, _global]; [_object, _global] call FUNC(removeBox);
_object setVariable [QGVAR(virtualItems), nil, _global];
};
} else { } else {
// Make sure all items are in string form // Make sure all items are in string form

View File

@ -127,20 +127,18 @@ private _magazineGroups = [[],[]] call CBA_fnc_hashCreate;
}; };
} foreach configProperties [_configCfgWeapons, "isClass _x && {(if (isNumber (_x >> 'scopeArsenal')) then {getNumber (_x >> 'scopeArsenal')} else {getNumber (_x >> 'scope')}) == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; } foreach configProperties [_configCfgWeapons, "isClass _x && {(if (isNumber (_x >> 'scopeArsenal')) then {getNumber (_x >> 'scopeArsenal')} else {getNumber (_x >> 'scope')}) == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true];
private _grenadeList = [];
{
_grenadeList append getArray (_configCfgWeapons >> "Throw" >> _x >> "magazines");
} foreach getArray (_configCfgWeapons >> "Throw" >> "muzzles");
private _putList = [];
{
_putList append getArray (_configCfgWeapons >> "Put" >> _x >> "magazines");
} foreach getArray (_configCfgWeapons >> "Put" >> "muzzles");
{ {
private _className = configName _x; private _className = configName _x;
private _grenadeList = [];
{
_grenadeList append getArray (_configCfgWeapons >> "Throw" >> _x >> "magazines");
false
} count getArray (_configCfgWeapons >> "Throw" >> "muzzles");
private _putList = [];
{
_putList append getArray (_configCfgWeapons >> "Put" >> _x >> "magazines");
false
} count getArray (_configCfgWeapons >> "Put" >> "muzzles");
switch true do { switch true do {
// Rifle, handgun, secondary weapons mags // Rifle, handgun, secondary weapons mags

View File

@ -153,17 +153,12 @@ class GVAR(display) {
shadow=0; shadow=0;
colorBackground[]={0,0,0,0.69999999}; colorBackground[]={0,0,0,0.69999999};
text=""; text="";
x = QUOTE(safezoneX + safezoneW * 0.50 - 80 * GRID_W); x = QUOTE(0.5 - WIDTH_TOTAL / 2);
y = QUOTE(safeZoneH + safezoneY - 25 * GRID_H); y = QUOTE(safeZoneH + safezoneY - 25 * GRID_H);
w = QUOTE(160 * GRID_W); w = QUOTE(WIDTH_TOTAL);
h = QUOTE(10 * GRID_H); h = QUOTE(10 * GRID_H);
sizeEx = QUOTE(5 * GRID_H); sizeEx = QUOTE(5 * GRID_H);
}; };
#define WIDTH_TOTAL (safezoneW - 2 * (93 * GRID_W))
#define WIDTH_GAP (WIDTH_TOTAL / 100)
#define WIDTH_SINGLE ((WIDTH_TOTAL - 6 * WIDTH_GAP) / 5)
class menuBar: RscControlsGroupNoScrollbars { class menuBar: RscControlsGroupNoScrollbars {
idc = IDC_menuBar; idc = IDC_menuBar;
x = QUOTE(0.5 - WIDTH_TOTAL / 2); x = QUOTE(0.5 - WIDTH_TOTAL / 2);
@ -202,7 +197,7 @@ class GVAR(display) {
text = CSTRING(buttonImportText); text = CSTRING(buttonImportText);
onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonImport)); onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonImport));
}; };
class buttonClose: ctrlButtonClose { class buttonClose: ctrlButtonOK {
idc = IDC_menuBarClose; idc = IDC_menuBarClose;
colorBackground[] = {0,0,0,0.8}; colorBackground[] = {0,0,0,0.8};
x = QUOTE(5 * WIDTH_GAP + 4 * WIDTH_SINGLE); x = QUOTE(5 * WIDTH_GAP + 4 * WIDTH_SINGLE);
@ -211,8 +206,7 @@ class GVAR(display) {
h = QUOTE(7 * GRID_H); h = QUOTE(7 * GRID_H);
text = CSTRING(buttonCloseText); text = CSTRING(buttonCloseText);
sizeEx = QUOTE(5 * GRID_H); sizeEx = QUOTE(5 * GRID_H);
shortcuts[]= {"0x01"}; onButtonClick = QUOTE(ctrlparent (_this select 0) closeDisplay 1);
onButtonClick = QUOTE(ctrlparent (_this select 0) closeDisplay 2);
}; };
}; };
}; };

View File

@ -283,7 +283,7 @@ class Display3DEN {
}; };
class ACE_arsenal_portVALoadouts { class ACE_arsenal_portVALoadouts {
text = CSTRING(portLoadoutsText); text = CSTRING(portLoadoutsText);
picture = "\z\ace\logo_ace3_ca.paa"; picture = QPATHTOEF(common,data\logo_ace3_ca.paa);
action = "call ace_arsenal_fnc_portVALoadouts;"; action = "call ace_arsenal_fnc_portVALoadouts;";
}; };
}; };

Binary file not shown.