From 29a0b2ef09d6b8fd9be25ab4c0471cc6badbdeeb Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Sun, 28 Jan 2018 22:39:46 +0100 Subject: [PATCH] Misc arsenal fixes (#6083) * Change backpack and scope checks in scanConfig and addVirtualItems Reason: was not a good implementation Might cause issue of people compalining about tents. * Give IDC to menuBar controls, disable import button in MP Reason: copyFromClipboard is disabled in MP * Add tooltip strings for the loadouts, export, import menu buttons * Remove double space in onArsenalOpen --- addons/arsenal/defines.hpp | 4 ++++ .../arsenal/functions/fnc_addVirtualItems.sqf | 2 +- addons/arsenal/functions/fnc_onArsenalOpen.sqf | 7 +++++++ addons/arsenal/functions/fnc_scanConfig.sqf | 8 ++++---- addons/arsenal/stringtable.xml | 18 +++++++++++++++--- addons/arsenal/ui/RscAttributes.hpp | 11 +++++++---- 6 files changed, 38 insertions(+), 12 deletions(-) diff --git a/addons/arsenal/defines.hpp b/addons/arsenal/defines.hpp index 1381deed85..ca5e7ed6a2 100644 --- a/addons/arsenal/defines.hpp +++ b/addons/arsenal/defines.hpp @@ -23,6 +23,10 @@ #define IDC_message 9 #define IDC_menuBar 10 #define IDC_menuBarClose 1001 +#define IDC_buttonHide 1002 +#define IDC_buttonLoadouts 1003 +#define IDC_buttonExport 1004 +#define IDC_buttonImport 1005 #define IDC_infoBox 11 #define IDC_infoBackground 1101 #define IDC_infoName 1102 diff --git a/addons/arsenal/functions/fnc_addVirtualItems.sqf b/addons/arsenal/functions/fnc_addVirtualItems.sqf index d47fa9b7c1..bfe17761c2 100644 --- a/addons/arsenal/functions/fnc_addVirtualItems.sqf +++ b/addons/arsenal/functions/fnc_addVirtualItems.sqf @@ -210,7 +210,7 @@ if (_items isEqualType true) then { }; }; case (isClass (configFile >> "CfgVehicles" >> _x)): { - if (getText (configFile >> "CfgVehicles" >> _x >> "vehicleClass") == "Backpacks") then { + if (getNumber (configFile >> "CfgVehicles" >> _x >> "isBackpack") == 1) then { (_cargo select 6) pushBackUnique _x; }; }; diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index 7f4a23cd59..c5d1cc0104 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -199,6 +199,13 @@ _mouseBlockCtrl ctrlEnable false; IDC_rightSearchbar ]; +if (isMultiplayer) then { + private _importButtonCtrl = _display displayCtrl IDC_buttonImport; + _importButtonCtrl ctrlEnable false; + _importButtonCtrl ctrlSetFade 0.6; + _importButtonCtrl ctrlCommit 0; +}; + //--------------- Camera prep cutText ["","plain"]; showCommandingMenu ""; diff --git a/addons/arsenal/functions/fnc_scanConfig.sqf b/addons/arsenal/functions/fnc_scanConfig.sqf index 4948f2c41d..c7457ae4ec 100644 --- a/addons/arsenal/functions/fnc_scanConfig.sqf +++ b/addons/arsenal/functions/fnc_scanConfig.sqf @@ -166,17 +166,17 @@ private _putList = []; [_magazineGroups, _x, _entry] call CBA_fnc_hashSet; } forEach getArray (_x >> "magazineGroup") }; -} foreach configProperties [(configFile >> "CfgMagazines"), "isClass _x && {getNumber (_x >> 'scope') == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; +} foreach configProperties [(configFile >> "CfgMagazines"), "isClass _x && {(if (isNumber (_x >> 'scopeArsenal')) then {getNumber (_x >> 'scopeArsenal')} else {getNumber (_x >> 'scope')}) == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; { - if (getText (_x >> "vehicleClass") == "Backpacks") then { + if (getNumber (_x >> "isBackpack") == 1) then { (_cargo select 6) pushBackUnique (configName _x); }; -} foreach configProperties [(configFile >> "CfgVehicles"), "isClass _x && {getNumber (_x >> 'scope') == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; +} foreach configProperties [(configFile >> "CfgVehicles"), "isClass _x && {(if (isNumber (_x >> 'scopeArsenal')) then {getNumber (_x >> 'scopeArsenal')} else {getNumber (_x >> 'scope')}) == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; { (_cargo select 7) pushBackUnique (configName _x); -} foreach configProperties [(configFile >> "CfgGlasses"), "isClass _x && {getNumber (_x >> 'scope') == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; +} foreach configProperties [(configFile >> "CfgGlasses"), "isClass _x && {(if (isNumber (_x >> 'scopeArsenal')) then {getNumber (_x >> 'scopeArsenal')} else {getNumber (_x >> 'scope')}) == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; uiNamespace setVariable [QGVAR(configItems), _cargo]; uiNamespace setVariable [QGVAR(magazineGroups), _magazineGroups]; diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 47604703e9..8c4fa74c1c 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -434,17 +434,17 @@ Impossibile aprire l'arsenale ACE ACE 武器庫を開けません - + Import BI VA loadouts to ACE Arsenal Importe les loadouts de BI VA dans ACE Arsenal 標準の VA 装備から ACE 武器庫へ取り込み - + No player unit available! Place a unit and mark it as "Player". Aucune unité joueur disponible ! Placez une unité et marquez la en tant que "joueur". プレイヤー ユニットがありません!ユニットを設置しそれを"Player"と名付けてください。 - + No loadouts to import. Aucun loadout à importer. 取り込みする装備がありません。 @@ -469,5 +469,17 @@ Probiere verschiedene Waffen und Ausrüstung aus und stelle dir eigene Ausrüstungsprofile zusammen. さまざまな武器と装備を試して、あなただけの装備を作成してください。 + + Open the loadouts screen + Affiche la page des équipements + + + Export current / default loadouts + Exporte l'équipement actuel ou la liste d'équipements de base + + + Import current / default loadouts + Importer l'équipement actuel ou la liste d'équipements de base + diff --git a/addons/arsenal/ui/RscAttributes.hpp b/addons/arsenal/ui/RscAttributes.hpp index 735797de67..e9c4f1f6b4 100644 --- a/addons/arsenal/ui/RscAttributes.hpp +++ b/addons/arsenal/ui/RscAttributes.hpp @@ -167,7 +167,7 @@ class GVAR(display) { h = QUOTE(7 * GRID_H); class controls { class buttonHide: ctrlButton { - idc = -1; + idc = IDC_buttonHide; colorBackground[] = {0,0,0,0.8}; x = QUOTE(1 * WIDTH_GAP + 0 * WIDTH_SINGLE); y = QUOTE(0); @@ -180,21 +180,24 @@ class GVAR(display) { onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonHide)); }; class buttonLoadouts: buttonHide { - idc = -1; + idc = IDC_buttonLoadouts; x = QUOTE(2 * WIDTH_GAP + 1 * WIDTH_SINGLE); text = CSTRING(buttonLoadoutsText); + tooltip = CSTRING(buttonLoadoutsTooltip); onButtonClick = QUOTE(createDialog QQGVAR(loadoutsDisplay)); }; class buttonExport: buttonHide { - idc = -1; + idc = IDC_buttonExport; x = QUOTE(3 * WIDTH_GAP + 2 * WIDTH_SINGLE); text = CSTRING(buttonExportText); + tooltip = CSTRING(buttonExportTooltip); onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonExport)); }; class buttonImport: buttonHide { - idc = -1; + idc = IDC_buttonImport; x = QUOTE(4 * WIDTH_GAP + 3 * WIDTH_SINGLE); text = CSTRING(buttonImportText); + tooltip = CSTRING(buttonImportTooltip); onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonImport)); }; class buttonClose: ctrlButtonOK {