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_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
#define IDD_ace_arsenal 1127001
#define IDC_mouseArea 0

View File

@ -47,7 +47,8 @@ private _cargo = _object getVariable [QGVAR(virtualItems), [
private _configCfgWeapons = configFile >> "CfgWeapons"; //Save this lookup in variable for perf improvement
if (_items isEqualType true && {_items}) then {
if (_items isEqualType true) then {
if (_items) then {
private _configItems = uiNamespace getVariable QGVAR(configItems);
{
@ -67,6 +68,7 @@ if (_items isEqualType true && {_items}) then {
(_cargo select _index) append (_configItems select _index);
_cargo set [_index, (_cargo select _index) arrayIntersect (_cargo select _index)];
};
};
} else {
{

View File

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

View File

@ -246,6 +246,20 @@ if (is3DEN) then {
GVAR(visionMode)= -2 call bis_fnc_3DENVisionMode;
["ShowInterface",false] spawn bis_fnc_3DENInterface;
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

View File

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

View File

@ -44,9 +44,11 @@ private _cargo = _object getVariable [QGVAR(virtualItems), [
[ ] // InventoryItems 17
]];
if (_items isEqualType true && {_items}) then {
if (_items isEqualType true) then {
if (_items) then {
[_object, _global] call FUNC(removeBox);
_object setVariable [QGVAR(virtualItems), nil, _global];
};
} else {
// 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];
{
private _className = configName _x;
private _grenadeList = [];
{
_grenadeList append getArray (_configCfgWeapons >> "Throw" >> _x >> "magazines");
false
} count getArray (_configCfgWeapons >> "Throw" >> "muzzles");
} foreach getArray (_configCfgWeapons >> "Throw" >> "muzzles");
private _putList = [];
{
_putList append getArray (_configCfgWeapons >> "Put" >> _x >> "magazines");
false
} count getArray (_configCfgWeapons >> "Put" >> "muzzles");
} foreach getArray (_configCfgWeapons >> "Put" >> "muzzles");
{
private _className = configName _x;
switch true do {
// Rifle, handgun, secondary weapons mags

View File

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

View File

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

Binary file not shown.