Skip to content

Commit

Permalink
Misc arsenal fixes (#6083)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
alganthe authored and PabstMirror committed Jan 28, 2018
1 parent cc503e0 commit 29a0b2e
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 12 deletions.
4 changes: 4 additions & 0 deletions addons/arsenal/defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion addons/arsenal/functions/fnc_addVirtualItems.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
};
Expand Down
7 changes: 7 additions & 0 deletions addons/arsenal/functions/fnc_onArsenalOpen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
Expand Down
8 changes: 4 additions & 4 deletions addons/arsenal/functions/fnc_scanConfig.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
18 changes: 15 additions & 3 deletions addons/arsenal/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,17 @@
<Italian>Impossibile aprire l'arsenale ACE</Italian>
<Japanese>ACE 武器庫を開けません</Japanese>
</Key>
<Key ID= "STR_ACE_Arsenal_portLoadoutsText">
<Key ID="STR_ACE_Arsenal_portLoadoutsText">
<English>Import BI VA loadouts to ACE Arsenal</English>
<French>Importe les loadouts de BI VA dans ACE Arsenal</French>
<Japanese>標準の VA 装備から ACE 武器庫へ取り込み</Japanese>
</Key>
<Key ID= "STR_ACE_Arsenal_portLoadoutsPlayerError">
<Key ID="STR_ACE_Arsenal_portLoadoutsPlayerError">
<English>No player unit available! Place a unit and mark it as "Player".</English>
<French>Aucune unité joueur disponible ! Placez une unité et marquez la en tant que "joueur".</French>
<Japanese>プレイヤー ユニットがありません!ユニットを設置しそれを"Player"と名付けてください。</Japanese>
</Key>
<Key ID= "STR_ACE_Arsenal_portLoadoutsLoadoutError">
<Key ID="STR_ACE_Arsenal_portLoadoutsLoadoutError">
<English>No loadouts to import.</English>
<French>Aucun loadout à importer.</French>
<Japanese>取り込みする装備がありません。</Japanese>
Expand All @@ -469,5 +469,17 @@
<German>Probiere verschiedene Waffen und Ausrüstung aus und stelle dir eigene Ausrüstungsprofile zusammen.</German>
<Japanese>さまざまな武器と装備を試して、あなただけの装備を作成してください。</Japanese>
</Key>
<Key ID="STR_ACE_Arsenal_buttonLoadoutsTooltip">
<English>Open the loadouts screen</English>
<French>Affiche la page des équipements</French>
</Key>
<Key ID="STR_ACE_Arsenal_buttonExportTooltip">
<English>Export current / default loadouts</English>
<French>Exporte l'équipement actuel ou la liste d'équipements de base</French>
</Key>
<Key ID="STR_ACE_Arsenal_buttonImportTooltip">
<English>Import current / default loadouts</English>
<French>Importer l'équipement actuel ou la liste d'équipements de base</French>
</Key>
</Package>
</Project>
11 changes: 7 additions & 4 deletions addons/arsenal/ui/RscAttributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 {
Expand Down

0 comments on commit 29a0b2e

Please sign in to comment.