From 849b4c8a60d88161632d27016f44d53a2dd38a04 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Thu, 1 Feb 2018 12:16:05 +0100 Subject: [PATCH 01/12] Disable anim previews when center isn't the player --- addons/arsenal/functions/fnc_onArsenalClose.sqf | 1 + addons/arsenal/functions/fnc_onArsenalOpen.sqf | 5 +++++ addons/arsenal/functions/fnc_showItem.sqf | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/arsenal/functions/fnc_onArsenalClose.sqf b/addons/arsenal/functions/fnc_onArsenalClose.sqf index f9d2e2f2c56..f5194825fdb 100644 --- a/addons/arsenal/functions/fnc_onArsenalClose.sqf +++ b/addons/arsenal/functions/fnc_onArsenalClose.sqf @@ -99,5 +99,6 @@ GVAR(currentInsignia) = nil; GVAR(currentAction) = nil; GVAR(center) = nil; +GVAR(centerNotPlayer) = nil; showHUD true; diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index c5d1cc01046..68012986ad6 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -22,6 +22,11 @@ _args params ["_display"]; if (isNil QGVAR(center)) then { GVAR(center) = player; }; +if (!is3DEN && {GVAR(center) != player}) then { + GVAR(centerNotPlayer) = true; +} else { + GVAR(centerNotPlayer) = false; +}; GVAR(mouseButtonState) = [[],[]]; diff --git a/addons/arsenal/functions/fnc_showItem.sqf b/addons/arsenal/functions/fnc_showItem.sqf index e97ebd8dd55..478ae4218d8 100644 --- a/addons/arsenal/functions/fnc_showItem.sqf +++ b/addons/arsenal/functions/fnc_showItem.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" #include "..\defines.hpp" - +if (GVAR(centerNotPlayer)) exitWith {}; private _nextAction = switch (GVAR(currentLeftPanel)) do { From 26a272ae2cc45b3513881fac24073310e8e14b1c Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Thu, 1 Feb 2018 14:03:40 +0100 Subject: [PATCH 02/12] Abuse configs to change the edit loadout 3DEN entry --- addons/arsenal/ui/RscCommon.hpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/addons/arsenal/ui/RscCommon.hpp b/addons/arsenal/ui/RscCommon.hpp index 60bceeaec3f..e5c5157aac8 100644 --- a/addons/arsenal/ui/RscCommon.hpp +++ b/addons/arsenal/ui/RscCommon.hpp @@ -270,7 +270,21 @@ class ctrlCheckboxToolbar; class Display3DEN { class ContextMenu :ctrlMenu { class Items { - class Arsenal { + class Log; + class Arsenal: Log { + text="$STR_3den_display3den_entitymenu_arsenal_text"; + items[]= {"aceArsenal", "virtualArsenal"}; + }; + class virtualArsenal { + text = "BI Virtual arsenal"; + action= QUOTE(['arsenal'] call bis_fnc_3DENEntityMenu); + value=0; + data="Arsenal"; + conditionShow="hoverObjectBrain * (1 - (hoverObjectVehicle))"; + opensNewWindow=1; + }; + class aceArsenal: virtualArsenal { + text = "ACE Arsenal"; action= QUOTE(call FUNC(open3DEN)); }; }; From 79e710f8de4865bb8781481948efb89584661cd6 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Thu, 1 Feb 2018 14:12:49 +0100 Subject: [PATCH 03/12] Remove inheriting as it's not needed --- addons/arsenal/ui/RscCommon.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/arsenal/ui/RscCommon.hpp b/addons/arsenal/ui/RscCommon.hpp index e5c5157aac8..f14f6b8dca3 100644 --- a/addons/arsenal/ui/RscCommon.hpp +++ b/addons/arsenal/ui/RscCommon.hpp @@ -270,13 +270,11 @@ class ctrlCheckboxToolbar; class Display3DEN { class ContextMenu :ctrlMenu { class Items { - class Log; - class Arsenal: Log { - text="$STR_3den_display3den_entitymenu_arsenal_text"; + class Arsenal { items[]= {"aceArsenal", "virtualArsenal"}; }; class virtualArsenal { - text = "BI Virtual arsenal"; + text = "BI Virtual Arsenal"; action= QUOTE(['arsenal'] call bis_fnc_3DENEntityMenu); value=0; data="Arsenal"; From 9641eab42caec339f2fe17606a57da6356133098 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Thu, 1 Feb 2018 14:15:29 +0100 Subject: [PATCH 04/12] Remove uneeded condition --- addons/arsenal/ui/RscCommon.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/arsenal/ui/RscCommon.hpp b/addons/arsenal/ui/RscCommon.hpp index f14f6b8dca3..1d580c679e4 100644 --- a/addons/arsenal/ui/RscCommon.hpp +++ b/addons/arsenal/ui/RscCommon.hpp @@ -278,7 +278,6 @@ class Display3DEN { action= QUOTE(['arsenal'] call bis_fnc_3DENEntityMenu); value=0; data="Arsenal"; - conditionShow="hoverObjectBrain * (1 - (hoverObjectVehicle))"; opensNewWindow=1; }; class aceArsenal: virtualArsenal { From e97b80e6e032aad6555b3f430ac1410fb29e3273 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Thu, 1 Feb 2018 14:55:28 +0100 Subject: [PATCH 05/12] Add zeus modules for ACE Arsenal, revert old arsenal modules --- addons/zeus/CfgFactionClasses.hpp | 5 +++ addons/zeus/CfgVehicles.hpp | 12 ++++++ addons/zeus/XEH_PREP.hpp | 2 + addons/zeus/config.cpp | 9 +++++ .../functions/fnc_moduleAddAceArsenal.sqf | 36 ++++++++++++++++++ .../zeus/functions/fnc_moduleAddArsenal.sqf | 12 ++---- .../functions/fnc_moduleRemoveAceArsenal.sqf | 37 +++++++++++++++++++ .../functions/fnc_moduleRemoveArsenal.sqf | 16 +++----- addons/zeus/stringtable.xml | 6 +++ 9 files changed, 115 insertions(+), 20 deletions(-) create mode 100644 addons/zeus/functions/fnc_moduleAddAceArsenal.sqf create mode 100644 addons/zeus/functions/fnc_moduleRemoveAceArsenal.sqf diff --git a/addons/zeus/CfgFactionClasses.hpp b/addons/zeus/CfgFactionClasses.hpp index 7d758adfc08..6c164a3c5da 100644 --- a/addons/zeus/CfgFactionClasses.hpp +++ b/addons/zeus/CfgFactionClasses.hpp @@ -24,4 +24,9 @@ class CfgFactionClasses { priority = 2; side = 7; }; + class GVAR(Arsenal) { + displayName = "ACE Arsenal"; + priority = 2; + side = 7; + }; }; diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 49fcb9532a9..efa777e5ec5 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -266,6 +266,18 @@ class CfgVehicles { displayName = CSTRING(ModuleRemoveArsenal_DisplayName); function = QFUNC(moduleRemoveArsenal); }; + class GVAR(AddFullAceArsenal): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Arsenal); + displayName = CSTRING(ModuleAddFullACEArsenal_DisplayName); + function = QFUNC(moduleAddAceArsenal); + }; + class GVAR(RemoveFullAceArsenal): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Arsenal); + displayName = CSTRING(ModuleRemoveACEArsenal_DisplayName); + function = QFUNC(moduleRemoveAceArsenal); + }; class ModuleArsenal_F: Module_F { function=QFUNC(bi_moduleArsenal); }; diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index aba07e71141..648282216a3 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -8,6 +8,7 @@ PREP(bi_moduleRemoteControl); PREP(getModuleDestination); PREP(handleZeusUnitAssigned); PREP(moduleAddArsenal); +PREP(moduleAddAceArsenal); PREP(moduleAddSpareTrack); PREP(moduleAddSpareWheel); PREP(moduleAddOrRemoveFRIES); @@ -18,6 +19,7 @@ PREP(moduleGlobalSetSkill); PREP(moduleGroupSide); PREP(moduleLoadIntoCargo); PREP(moduleRemoveArsenal); +PREP(moduleRemoveAceArsenal); PREP(moduleSearchNearby); PREP(moduleSetMedic); PREP(moduleSetMedicalVehicle); diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 5b764b6007c..8e6d9767d60 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -22,6 +22,8 @@ class CfgPatches { QGVAR(moduleSuppressiveFire), QGVAR(AddFullArsenal), QGVAR(RemoveFullArsenal), + QGVAR(AddFullAceArsenal), + QGVAR(RemoveFullAceArsenal), QGVAR(moduleTeleportPlayers) }; weapons[] = {}; @@ -69,6 +71,12 @@ class CfgPatches { QGVAR(moduleConfigurePylons) }; }; + class GVAR(arsenal): ADDON { + units[] = { + QGVAR(AddFullAceArsenal), + QGVAR(RemoveFullAceArsenal) + }; + }; }; class ACE_Curator { @@ -78,6 +86,7 @@ class ACE_Curator { GVAR(cargoAndRepair)[] = {"ace_cargo", "ace_repair"}; GVAR(fastroping) = "ace_fastroping"; GVAR(pylons) = "ace_pylons"; + GVAR(arsenal) = "ace_arsenal"; }; #include "CfgFactionClasses.hpp" diff --git a/addons/zeus/functions/fnc_moduleAddAceArsenal.sqf b/addons/zeus/functions/fnc_moduleAddAceArsenal.sqf new file mode 100644 index 00000000000..d3a6a0cb720 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleAddAceArsenal.sqf @@ -0,0 +1,36 @@ +/* + * Author: alganthe + * Add a full ACE Arsenal to an object + * + * Arguments: + * 0: The module logic + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic"]; +if (!local _logic) exitWith {}; + +private _object = attachedTo _logic; +TRACE_3("moduleAddArsenal",_logic,_object,typeOf _object); + +switch (true) do { + case (isNull _object): { + [LSTRING(NothingSelected)] call FUNC(showMessage); + }; + case (isPlayer _object): { + ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage); + }; + case (!alive _object): { + [LSTRING(OnlyAlive)] call FUNC(showMessage); + }; + default { + [_object, true, true] call EFUNC(arsenal,initBox); + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleAddArsenal.sqf b/addons/zeus/functions/fnc_moduleAddArsenal.sqf index 68b5148521a..b8eed64d76f 100644 --- a/addons/zeus/functions/fnc_moduleAddArsenal.sqf +++ b/addons/zeus/functions/fnc_moduleAddArsenal.sqf @@ -29,15 +29,9 @@ switch (true) do { [LSTRING(OnlyAlive)] call FUNC(showMessage); }; default { - if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then { - - [_object, true, true] call EFUNC(arsenal,initBox); - } else { - - TRACE_1("BIS_fnc_arsenal: AmmoboxInit",_object); - // Global Effects: "Action to access the Arsenal will be added automatically on all clients." - ["AmmoboxInit", [_object, true]] call BIS_fnc_arsenal; - }; + TRACE_1("BIS_fnc_arsenal: AmmoboxInit",_object); + // Global Effects: "Action to access the Arsenal will be added automatically on all clients." + ["AmmoboxInit", [_object, true]] call BIS_fnc_arsenal; }; }; diff --git a/addons/zeus/functions/fnc_moduleRemoveAceArsenal.sqf b/addons/zeus/functions/fnc_moduleRemoveAceArsenal.sqf new file mode 100644 index 00000000000..c39b51a3dea --- /dev/null +++ b/addons/zeus/functions/fnc_moduleRemoveAceArsenal.sqf @@ -0,0 +1,37 @@ +/* + * Author: alganthe + * Remove ACE Arsenal from an object + * + * Arguments: + * 0: The module logic + * + * Return Value: + * None + * + * Public: No +*/ + +#include "script_component.hpp" + +params ["_logic"]; +if (!local _logic) exitWith {}; + +private _object = attachedTo _logic; +TRACE_3("moduleRemoveArsenal",_logic,_object,typeOf _object); + +switch (true) do { + case (isNull _object): { + [LSTRING(NothingSelected)] call FUNC(showMessage); + }; + case (isPlayer _object): { + ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage); + }; + case (!alive _object): { + [LSTRING(OnlyAlive)] call FUNC(showMessage); + }; + default { + [_object, true, true] call EFUNC(arsenal,removeBox); + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf index b14509c2725..9693881810c 100644 --- a/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf +++ b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf @@ -31,17 +31,11 @@ switch (true) do { }; default { - if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then { - - [_object, true, true] call EFUNC(arsenal,removeBox); - } else { - - TRACE_1("Calling removeVirtualXXXCargo functions",_object); - [_object, (_object call BIS_fnc_getVirtualItemCargo), true] call BIS_fnc_removeVirtualItemCargo; - [_object, (_object call BIS_fnc_getVirtualWeaponCargo), true] call BIS_fnc_removeVirtualWeaponCargo; - [_object, (_object call BIS_fnc_getVirtualMagazineCargo), true] call BIS_fnc_removeVirtualMagazineCargo; - [_object, (_object call BIS_fnc_getVirtualBackpackCargo), true] call BIS_fnc_removeVirtualBackpackCargo; - }; + TRACE_1("Calling removeVirtualXXXCargo functions", _object); + [_object, (_object call BIS_fnc_getVirtualItemCargo), true] call BIS_fnc_removeVirtualItemCargo; + [_object, (_object call BIS_fnc_getVirtualWeaponCargo), true] call BIS_fnc_removeVirtualWeaponCargo; + [_object, (_object call BIS_fnc_getVirtualMagazineCargo), true] call BIS_fnc_removeVirtualMagazineCargo; + [_object, (_object call BIS_fnc_getVirtualBackpackCargo), true] call BIS_fnc_removeVirtualBackpackCargo; }; }; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 7b34b84039c..3981cb63efb 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1238,5 +1238,11 @@ 解除驻军驻守状态 주둔해제 + + Add full ACE Arsenal + + + Remove ACE Arsenal + From 3db77c6a745014bc9048eb9a1f3427c528b98922 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Thu, 1 Feb 2018 16:13:03 +0100 Subject: [PATCH 06/12] Add 3 new arsenal EHs --- addons/arsenal/functions/fnc_buttonExport.sqf | 2 ++ addons/arsenal/functions/fnc_buttonImport.sqf | 2 ++ addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf | 2 ++ 3 files changed, 6 insertions(+) diff --git a/addons/arsenal/functions/fnc_buttonExport.sqf b/addons/arsenal/functions/fnc_buttonExport.sqf index 7bcac4c8ba3..dd9233764b0 100644 --- a/addons/arsenal/functions/fnc_buttonExport.sqf +++ b/addons/arsenal/functions/fnc_buttonExport.sqf @@ -49,3 +49,5 @@ if (GVAR(shiftState)) then { [_display, localize LSTRING(exportCurrent)] call FUNC(message); }; + +[QGVAR(loadoutExported), [_display, GVAR(shiftState)]] call CBA_fnc_localEvent; diff --git a/addons/arsenal/functions/fnc_buttonImport.sqf b/addons/arsenal/functions/fnc_buttonImport.sqf index 76cd2f3a757..7cc059d818f 100644 --- a/addons/arsenal/functions/fnc_buttonImport.sqf +++ b/addons/arsenal/functions/fnc_buttonImport.sqf @@ -109,3 +109,5 @@ if (GVAR(shiftState) && {is3DEN}) then { [_display, localize LSTRING(importedCurrent)] call FUNC(message); }; }; + +[QGVAR(loadoutImported), [_display, (GVAR(shiftState) && {is3DEN})]] call CBA_fnc_localEvent; diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf index 9d413a233c9..17081f7f95c 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf @@ -88,3 +88,5 @@ call FUNC(updateUniqueItemsList); [GVAR(center), GVAR(currentInsignia)] call bis_fnc_setUnitInsignia; [(findDisplay IDD_ace_arsenal), [localize LSTRING(loadoutLoaded), _loadoutName] joinString " "] call FUNC(message); + +[QGVAR(onLoadoutLoad), [_loadout]] call CBA_fnc_localEvent; From 997ecd50241419ee01a2cd1a516a6d256beddd9e Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Thu, 1 Feb 2018 16:34:53 +0100 Subject: [PATCH 07/12] Add a setting to disable the identity tabs in ace arsenal --- addons/arsenal/XEH_preInit.sqf | 2 ++ addons/arsenal/functions/fnc_onArsenalOpen.sqf | 18 +++++++++++++----- addons/arsenal/stringtable.xml | 4 ++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/addons/arsenal/XEH_preInit.sqf b/addons/arsenal/XEH_preInit.sqf index 537af9c11d5..d91a73ac96d 100644 --- a/addons/arsenal/XEH_preInit.sqf +++ b/addons/arsenal/XEH_preInit.sqf @@ -12,6 +12,8 @@ GVAR(modList) = ["","curator","kart","heli","mark","expansion","expansionpremium [QGVAR(camInverted), "CHECKBOX", localize LSTRING(invertCameraSetting), localize LSTRING(settingCategory), false] call CBA_Settings_fnc_init; [QGVAR(enableModIcons), "CHECKBOX", [LSTRING(modIconsSetting), LSTRING(modIconsTooltip)], localize LSTRING(settingCategory), true] call CBA_Settings_fnc_init; [QGVAR(fontHeight), "SLIDER", [LSTRING(fontHeightSetting), LSTRING(fontHeightTooltip)], localize LSTRING(settingCategory), [1, 10, 4.5, 1]] call CBA_Settings_fnc_init; +[QGVAR(enableIdentityTabs), "CHECKBOX", localize LSTRING(enableIdentityTabsSettings), localize LSTRING(settingCategory), true, true] call CBA_Settings_fnc_init; + // Arsenal loadouts [QGVAR(allowDefaultLoadouts), "CHECKBOX", [LSTRING(allowDefaultLoadoutsSetting), LSTRING(defaultLoadoutsTooltip)], localize LSTRING(settingCategory), true, true] call CBA_Settings_fnc_init; diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index 68012986ad6..f8d60eeddf2 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -22,11 +22,6 @@ _args params ["_display"]; if (isNil QGVAR(center)) then { GVAR(center) = player; }; -if (!is3DEN && {GVAR(center) != player}) then { - GVAR(centerNotPlayer) = true; -} else { - GVAR(centerNotPlayer) = false; -}; GVAR(mouseButtonState) = [[],[]]; @@ -272,6 +267,19 @@ if (is3DEN) then { _buttonCloseCtrl = _display displayCtrl IDC_menuBarClose; _buttonCloseCtrl ctrlSetText (localize "str_ui_debug_but_apply"); +} else { + GVAR(centerNotPlayer) = (GVAR(center) != player); + + { + private _ctrl = _display displayCtrl _x; + _ctrl ctrlEnable GVAR(enableIdentityTabs); + _ctrl ctrlSetFade ([0.6, 0] select GVAR(enableIdentityTabs)); + _ctrl ctrlcommit 0; + } foreach [ + IDC_buttonFace, + IDC_buttonVoice, + IDC_buttonInsigna + ]; }; //--------------- Prepare the left panel diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 91650bff8bb..7bb4d58b0b5 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -543,5 +543,9 @@ Import current / default loadouts Importer l'équipement actuel ou la liste d'équipements de base + + Enable the faces / voices / insignias tabs + Activer les onglets faces / voix / insignes + From d9995016df4162bcf463fa37877d60817d702f7b Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Thu, 1 Feb 2018 17:54:14 +0100 Subject: [PATCH 08/12] Pass loadoutName in the onloadoutLoad EH --- addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf index 17081f7f95c..131bc1331f3 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf @@ -89,4 +89,4 @@ call FUNC(updateUniqueItemsList); [(findDisplay IDD_ace_arsenal), [localize LSTRING(loadoutLoaded), _loadoutName] joinString " "] call FUNC(message); -[QGVAR(onLoadoutLoad), [_loadout]] call CBA_fnc_localEvent; +[QGVAR(onLoadoutLoad), [_loadout, _loadoutName]] call CBA_fnc_localEvent; From c9990922e46b4f57f22fd8a370f825d44e59ccbc Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Wed, 7 Feb 2018 21:31:17 +0100 Subject: [PATCH 09/12] Change foreach to forEach and ctrlcommit to ctrlCommit --- .../arsenal/functions/fnc_onArsenalOpen.sqf | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index f8d60eeddf2..7642599c779 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -87,8 +87,8 @@ for "_index" from 0 to 10 do { if (_x != "") then { (GVAR(virtualItems) select _index) select ([2, 1, 0, 3] select _forEachIndex) pushBackUnique _x; }; - } foreach _x; - } foreach _accsArray; + } forEach _x; + } forEach _accsArray; { if !(_x isEqualTo []) then { @@ -101,7 +101,7 @@ for "_index" from 0 to 10 do { (GVAR(virtualItems) select 2) pushBackUnique (_x select 1); }; }; - } foreach _magsArray; + } forEach _magsArray; }; // Inventory items @@ -113,7 +113,7 @@ for "_index" from 0 to 10 do { default { private _array = (LIST_DEFAULTS select _index) select {!(_x isEqualTo "")}; if !(_array isEqualTo []) then { - {(GVAR(virtualItems) select _index) pushBackUnique _x} foreach _array; + {(GVAR(virtualItems) select _index) pushBackUnique _x} forEach _array; }; }; }; @@ -163,7 +163,7 @@ for "_index" from 0 to 15 do { private _index = 10 + (["itemmap", "itemcompass", "itemradio", "itemwatch", "itemgps"] find (tolower _simulationType)); GVAR(currentItems) set [_index, _x]; -} foreach (assignedItems GVAR(center)); +} forEach (assignedItems GVAR(center)); GVAR(currentWeaponType) = switch true do { case (currentWeapon GVAR(center) == GVAR(currentItems) select 0): {0}; @@ -184,7 +184,7 @@ _mouseBlockCtrl ctrlEnable false; _x ctrlSetFade 1; _x ctrlShow false; _x ctrlCommit 0; -} foreach [ +} forEach [ IDC_blockRightFrame, IDC_blockRighttBackground, IDC_loadIndicator, @@ -258,8 +258,8 @@ if (is3DEN) then { private _ctrl = _display displayctrl _x; _ctrl ctrlEnable false; _ctrl ctrlSetFade 0.6; - _ctrl ctrlcommit 0; - } foreach [ + _ctrl ctrlCommit 0; + } forEach [ IDC_buttonFace, IDC_buttonVoice, IDC_buttonInsigna @@ -274,8 +274,8 @@ if (is3DEN) then { private _ctrl = _display displayCtrl _x; _ctrl ctrlEnable GVAR(enableIdentityTabs); _ctrl ctrlSetFade ([0.6, 0] select GVAR(enableIdentityTabs)); - _ctrl ctrlcommit 0; - } foreach [ + _ctrl ctrlCommit 0; + } forEach [ IDC_buttonFace, IDC_buttonVoice, IDC_buttonInsigna @@ -295,7 +295,7 @@ GVAR(rightTabLnBFocus) = false; private _panel = _display displayCtrl _x; _panel ctrlSetFontHeight (GVAR(fontHeight) * GRID_H); _panel ctrlCommit 0; -} foreach [IDC_leftTabContent, IDC_rightTabContent, IDC_rightTabContentListnBox]; +} forEach [IDC_leftTabContent, IDC_rightTabContent, IDC_rightTabContentListnBox]; [_display, _display displayCtrl IDC_buttonPrimaryWeapon] call FUNC(fillLeftPanel); From a1c64966de568aa4ced096a3e425eb081359e72c Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Wed, 7 Feb 2018 21:31:41 +0100 Subject: [PATCH 10/12] Resize the right window when the load bar isn't there --- addons/arsenal/defines.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/addons/arsenal/defines.hpp b/addons/arsenal/defines.hpp index ca5e7ed6a28..b414484103e 100644 --- a/addons/arsenal/defines.hpp +++ b/addons/arsenal/defines.hpp @@ -200,6 +200,21 @@ _buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\ IDC_rightTabContentListnBox,\ RIGHT_PANEL_ITEMS_BACKGROUND_IDCS,\ IDC_buttonRemoveAll\ +];\ +{\ + _x = _display displayCtrl _x;\ + _x ctrlSetPosition [\ + safezoneX + safezoneW - 93 * GRID_W,\ + safezoneY + 14 * GRID_H,\ + 80 * GRID_W,\ + safezoneH - 28 * GRID_H\ + ];\ + _x ctrlCommit 0;\ +} foreach [\ + IDC_rightTabContent,\ + IDC_rightTabContentListnBox,\ + IDC_blockRightFrame,\ + IDC_blockRighttBackground\ ]; #define TOGGLE_RIGHT_PANEL_CONTAINER\ @@ -232,6 +247,21 @@ _buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\ IDC_buttonCurrentMag2,\ IDC_iconBackgroundCurrentMag,\ IDC_iconBackgroundCurrentMag2\ +];\ +{\ + _x = _display displayCtrl _x;\ + _x ctrlSetPosition [\ + safezoneX + safezoneW - 93 * GRID_W,\ + safezoneY + 14 * GRID_H,\ + 80 * GRID_W,\ + safezoneH - 34 * GRID_H\ + ];\ + _x ctrlCommit 0;\ +} foreach [\ + IDC_rightTabContent,\ + IDC_rightTabContentListnBox,\ + IDC_blockRightFrame,\ + IDC_blockRighttBackground\ ]; #define TOGGLE_RIGHT_PANEL_HIDE\ From 1409600646a1774d9f4300b6148855fe38eaae1e Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Wed, 7 Feb 2018 21:45:07 +0100 Subject: [PATCH 11/12] Add a tooltip for the "clear container" button --- addons/arsenal/stringtable.xml | 4 ++++ addons/arsenal/ui/RscAttributes.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 7bb4d58b0b5..6466f79d877 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -547,5 +547,9 @@ Enable the faces / voices / insignias tabs Activer les onglets faces / voix / insignes + + Empty the selected container + Vider le conteneur selectionné + diff --git a/addons/arsenal/ui/RscAttributes.hpp b/addons/arsenal/ui/RscAttributes.hpp index e9c4f1f6b47..e52929a58a4 100644 --- a/addons/arsenal/ui/RscAttributes.hpp +++ b/addons/arsenal/ui/RscAttributes.hpp @@ -717,6 +717,7 @@ class GVAR(display) { class buttonRemoveAll: ctrlButtonPicture { idc = IDC_buttonRemoveAll; text = QPATHTOF(data\iconClearContainer.paa); + tooltip = CSTRING(buttonClearContainerTooltip); colorBackground[]={0,0,0,0.5}; onButtonClick = QUOTE(ctrlParent (_this select 0) call FUNC(buttonClearAll)); fade=1; From a15d707c515ebf18367a28bd39338ca98c88100b Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Wed, 7 Feb 2018 22:22:18 +0100 Subject: [PATCH 12/12] Improve onKeyDown, add classname copying using ctrl+c --- addons/arsenal/functions/fnc_onKeyDown.sqf | 54 ++++++++++++++-------- addons/arsenal/stringtable.xml | 4 ++ 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/addons/arsenal/functions/fnc_onKeyDown.sqf b/addons/arsenal/functions/fnc_onKeyDown.sqf index b9639740332..d06055f1491 100644 --- a/addons/arsenal/functions/fnc_onKeyDown.sqf +++ b/addons/arsenal/functions/fnc_onKeyDown.sqf @@ -85,9 +85,31 @@ if !(_loadoutsDisplay isEqualTo displayNull) then { case (_keyPressed == DIK_BACKSPACE): { [_display] call FUNC(buttonHide); }; - // Export button + // Export button / export classname case (_keyPressed == DIK_C && {_ctrlState}): { - [_display] call FUNC(buttonExport); + if (GVAR(leftTabFocus) || {GVAR(rightTabFocus)} || {GVAR(rightTabLnBFocus)}) then { + switch true do { + case (GVAR(leftTabFocus)): { + private _control = (_display displayCtrl IDC_leftTabContent); + _control lbData (lbCurSel _control) + }; + case (GVAR(rightTabFocus)): { + private _control = (_display displayCtrl IDC_rightTabContent); + _control lbData (lbCurSel _control) + }; + case (GVAR(rightTabLnBFocus)): { + private _control = (_display displayCtrl IDC_rightTabContentListnBox); + _control lnbData [(lnbCurSelRow _control), 0] + }; + } params ["_className"]; + + "ace_clipboard" callExtension (_className + ";"); + "ace_clipboard" callExtension "--COMPLETE--"; + + [_display, localize LSTRING(exportedClassnameText)] call FUNC(message); + } else { + [_display] call FUNC(buttonExport); + }; }; // Import button case (_keyPressed == DIK_V && {_ctrlState}): { @@ -124,6 +146,18 @@ if !(_loadoutsDisplay isEqualTo displayNull) then { playsound ["RscDisplayCurator_visionMode",true]; }; + // Panel up down + case (_keyPressed in [DIK_UP, DIK_DOWN]): { + if (GVAR(leftTabFocus) || {GVAR(rightTabFocus)} || {GVAR(rightTabLnBFocus)}) then { + _return = false; + }; + }; + // Right panel lnb + and - buttons + case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): { + if (GVAR(rightTabLnBFocus)) then { + [_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo); + }; + }; }; } else { switch true do { @@ -167,22 +201,6 @@ if !(_loadoutsDisplay isEqualTo displayNull) then { }; }; }; - - if (GVAR(leftTabFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { - _return = false; - }; - - if (GVAR(rightTabFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { - _return = false; - }; - - if (GVAR(rightTabLnBFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { - _return = false; - }; - - if (GVAR(rightTabLnBFocus) && {_keyPressed in [DIK_LEFT, DIK_RIGHT]}) then { - [_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo); - }; }; _return diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 6466f79d877..a7889d39f56 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -551,5 +551,9 @@ Empty the selected container Vider le conteneur selectionné + + Exported class name to clipboard + Nom de classe exporté dans le presse papier +