Arsenal - Add Tools category and moveOnOverwrite parameter to FUNC(addCustomRightPanelButton) (#9247)

* add tools tab and setting

* move to preinit

* fix icon, add restart warning

* derp

Co-authored-by: Dystopian <sddex@ya.ru>

* Update addons/arsenal/stringtable.xml

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* remove setting

* add keepIfOverriden parameter

* docs again

* documentation whitespace

* docs grammar, change parameter name

* fix docs

* more docs fixes

* magazine support

* deprecate spare barrel item

* more docs, improve condition

---------

Co-authored-by: Dystopian <sddex@ya.ru>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
Grim 2023-07-21 22:39:48 +03:00 committed by GitHub
parent c8404f496e
commit 31e1ad0cff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 210 additions and 36 deletions

View File

@ -0,0 +1,10 @@
class CfgWeapons {
class ItemCore;
class ToolKit: ItemCore {
ACE_isTool = 1; // sort in Tools Tab
};
class DetectorCore;
class MineDetector: DetectorCore {
ACE_isTool = 1; // sort in Tools Tab
};
};

View File

@ -1,26 +1,15 @@
#include "script_component.hpp"
#include "defines.hpp"
#define TOOLS_TAB_ICON "\A3\ui_f\data\igui\cfg\actions\repair_ca.paa"
ADDON = false;
PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
// Arsenal
[QGVAR(camInverted), "CHECKBOX", LLSTRING(invertCameraSetting), LLSTRING(settingCategory), false] call CBA_fnc_addSetting;
[QGVAR(enableModIcons), "CHECKBOX", [LSTRING(modIconsSetting), LSTRING(modIconsTooltip)], LLSTRING(settingCategory), true] call CBA_fnc_addSetting;
[QGVAR(fontHeight), "SLIDER", [LSTRING(fontHeightSetting), LSTRING(fontHeightTooltip)], LLSTRING(settingCategory), [1, 10, 4.5, 1]] call CBA_fnc_addSetting;
[QGVAR(enableIdentityTabs), "CHECKBOX", LLSTRING(enableIdentityTabsSettings), LLSTRING(settingCategory), true, true] call CBA_fnc_addSetting;
// Arsenal loadouts
[QGVAR(allowDefaultLoadouts), "CHECKBOX", [LSTRING(allowDefaultLoadoutsSetting), LSTRING(defaultLoadoutsTooltip)], [LLSTRING(settingCategory), LLSTRING(loadoutSubcategory)], true, true] call CBA_fnc_addSetting;
[QGVAR(allowSharedLoadouts), "CHECKBOX", LLSTRING(allowSharingSetting), [LLSTRING(settingCategory), LLSTRING(loadoutSubcategory)], true, true] call CBA_fnc_addSetting;
[QGVAR(EnableRPTLog), "CHECKBOX", [LSTRING(printToRPTSetting), LSTRING(printToRPTTooltip)], [LLSTRING(settingCategory), LLSTRING(loadoutSubcategory)], false, false] call CBA_fnc_addSetting;
[QGVAR(loadoutsSaveFace), "CHECKBOX", LLSTRING(loadoutsSaveFaceSetting), [LLSTRING(settingCategory), LLSTRING(loadoutSubcategory)], false] call CBA_fnc_addSetting;
[QGVAR(loadoutsSaveVoice), "CHECKBOX", LLSTRING(loadoutsSaveVoiceSetting), [LLSTRING(settingCategory), LLSTRING(loadoutSubcategory)], false] call CBA_fnc_addSetting;
[QGVAR(loadoutsSaveInsignia), "CHECKBOX", LLSTRING(loadoutsSaveInsigniaSetting), [LLSTRING(settingCategory), LLSTRING(loadoutSubcategory)], true] call CBA_fnc_addSetting;
#include "initSettings.sqf"
// Arsenal events
[QGVAR(statsToggle), {
@ -76,4 +65,8 @@ call FUNC(compileSorts);
"CBA_disposable_arsenalClosed" call CBA_fnc_localEvent;
}] call CBA_fnc_addEventHandler;
// Setup Tools tab
[keys (uiNamespace getVariable [QGVAR(configItemsTools), createHashMap]), LLSTRING(toolsTab), TOOLS_TAB_ICON, -1, true] call FUNC(addRightPanelButton);
ADDON = true;

View File

@ -19,6 +19,7 @@ class CfgPatches {
#include "Display3DEN.hpp"
#include "Cfg3DEN.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
#include "RscDisplayMain.hpp"
#include "ACE_Arsenal_Sorts.hpp"
#include "ACE_Arsenal_Stats.hpp"

View File

@ -9,17 +9,19 @@
* 1: Tooltip <STRING> (default: "")
* 2: Picture path <STRING> (default: QPATHTOF(data\iconCustom.paa))
* 3: Override a specific button (0-9) <NUMBER> (default: -1)
* 4: Move button if its position is overridden <BOOL> (default: false)
*
* Return Value:
* Successful: Number of the slot (0-9); Error: -1 <NUMBER>
* Successful: Number of the slot (0-9) <NUMBER>
* Error: -1 <NUMBER>
*
* Example:
* [["ACE_bloodIV_500", "ACE_Banana"], "MedicalStuff", "\z\ace\addons\arsenal\data\iconCustom.paa", 5] call ace_arsenal_fnc_addRightPanelButton
* [["ACE_bloodIV_500", "ACE_Banana"], "MedicalStuff", "\z\ace\addons\arsenal\data\iconCustom.paa", 5, false] call ace_arsenal_fnc_addRightPanelButton
*
* Public: Yes
*/
params [["_items", [], [[]]], ["_tooltip", "", [""]], ["_picture", QPATHTOF(data\iconCustom.paa), [""]], ["_override", -1, [0]]];
params [["_items", [], [[]]], ["_tooltip", "", [""]], ["_picture", QPATHTOF(data\iconCustom.paa), [""]], ["_override", -1, [0]], ["_moveOnOverwrite", false, [false]]];
if (isNil QGVAR(customRightPanelButtons)) then {
GVAR(customRightPanelButtons) = [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil];
@ -44,6 +46,15 @@ if (_position < 0 || {_position > 9}) exitWith {
-1
};
// Check if we're overwriting a button that's being force-kept
private _currentButtonInPosition = GVAR(customRightPanelButtons) select _position;
if (!isNil "_currentButtonInPosition") then {
_currentButtonInPosition params ["_cbItems", "_cbPicture", "_cbTooltip", "_cbMove"];
if (_cbMove) then {
[{_this call FUNC(addRightPanelButton)}, [_cbItems, _cbTooltip, _cbPicture, -1, _cbMove]] call CBA_fnc_execNextFrame;
};
};
// If spot found, add items and return position
private _cfgWeapons = configFile >> "CfgWeapons";
private _cfgMagazines = configFile >> "CfgMagazines";
@ -58,6 +69,6 @@ _items = _items select {
{getNumber (_cfgMagazines >> _x >> "ACE_isUnique") == 1}
};
GVAR(customRightPanelButtons) set [_position, [_items apply {_x call EFUNC(common,getConfigName)}, _picture, _tooltip]];
GVAR(customRightPanelButtons) set [_position, [_items apply {_x call EFUNC(common,getConfigName)}, _picture, _tooltip, _moveOnOverwrite]];
_position

View File

@ -24,6 +24,9 @@ for "_index" from IDX_VIRT_ITEMS_ALL to IDX_VIRT_MISC_ITEMS do {
_configItems set [_index, createHashMap];
};
// Cache tools for separate tab
private _toolList = createHashMap;
// https://community.bistudio.com/wiki/Arma_3:_Characters_And_Gear_Encoding_Guide#Character_configuration
// https://github.com/acemod/ACE3/pull/9040#issuecomment-1597748331
private _filterFunction = toString {
@ -38,6 +41,7 @@ private _configItemInfo = "";
private _hasItemInfo = false;
private _itemInfoType = 0;
private _isMiscItem = false;
private _isTool = false;
// Get weapons and other various items
{
@ -47,6 +51,7 @@ private _isMiscItem = false;
_hasItemInfo = isClass (_configItemInfo);
_itemInfoType = if (_hasItemInfo) then {getNumber (_configItemInfo >> "type")} else {0};
_isMiscItem = _className isKindOf ["CBA_MiscItem", _cfgWeapons];
_isTool = getNumber (_x >> "ACE_isTool") isEqualTo 1;
switch (true) do {
// Weapon attachments
@ -130,6 +135,7 @@ private _isMiscItem = false;
{_simulationType == "ItemMineDetector"}
): {
(_configItems get IDX_VIRT_MISC_ITEMS) set [_className, nil];
if (_isTool) then {_toolList set [_className, nil]};
};
};
} forEach configProperties [_cfgWeapons, _filterFunction, true];
@ -160,9 +166,10 @@ private _magazineMiscItems = createHashMap;
switch (true) do {
// "Misc. items" magazines (e.g. spare barrels, intel, photos)
case (getNumber (_x >> "ACE_isUnique") == 1): {
case (getNumber (_x >> "ACE_isUnique") isEqualTo 1): {
(_configItems get IDX_VIRT_MISC_ITEMS) set [_className, nil];
_magazineMiscItems set [_className, nil];
if (getNumber (_x >> "ACE_isTool") isEqualTo 1) then {_toolList set [_className, nil]};
};
// Grenades
case (_className in _grenadeList): {
@ -266,3 +273,4 @@ uiNamespace setVariable [QGVAR(grenadeCache), _grenadeList];
uiNamespace setVariable [QGVAR(putCache), _putList];
uiNamespace setVariable [QGVAR(magazineMiscItems), _magazineMiscItems];
uiNamespace setVariable [QGVAR(CBAdisposableLaunchers), _launchers];
uiNamespace setVariable [QGVAR(configItemsTools), _toolList];

View File

@ -0,0 +1,83 @@
// Arsenal
private _category = LLSTRING(settingCategory);
[
QGVAR(camInverted),
"CHECKBOX",
LLSTRING(invertCameraSetting),
_category,
false
] call CBA_fnc_addSetting;
[
QGVAR(enableModIcons),
"CHECKBOX",
[LSTRING(modIconsSetting), LSTRING(modIconsTooltip)],
_category,
true
] call CBA_fnc_addSetting;
[
QGVAR(fontHeight),
"SLIDER",
[LSTRING(fontHeightSetting), LSTRING(fontHeightTooltip)],
_category,
[1, 10, 4.5, 1]
] call CBA_fnc_addSetting;
[
QGVAR(enableIdentityTabs),
"CHECKBOX",
LLSTRING(enableIdentityTabsSettings),
_category,
true,
true
] call CBA_fnc_addSetting;
private _loadoutCategory = LLSTRING(loadoutSubcategory);
// Arsenal loadouts
[QGVAR(allowDefaultLoadouts),
"CHECKBOX",
[LSTRING(allowDefaultLoadoutsSetting), LSTRING(defaultLoadoutsTooltip)],
[_category, _loadoutCategory],
true,
true
] call CBA_fnc_addSetting;
[QGVAR(allowSharedLoadouts),
"CHECKBOX",
LLSTRING(allowSharingSetting),
[_category, _loadoutCategory],
true,
true
] call CBA_fnc_addSetting;
[QGVAR(EnableRPTLog),
"CHECKBOX",
[LSTRING(printToRPTSetting),
LSTRING(printToRPTTooltip)],
[_category, _loadoutCategory],
false,
false
] call CBA_fnc_addSetting;
[QGVAR(loadoutsSaveFace),
"CHECKBOX",
LLSTRING(loadoutsSaveFaceSetting),
[_category, _loadoutCategory],
false
] call CBA_fnc_addSetting;
[QGVAR(loadoutsSaveVoice),
"CHECKBOX",
LLSTRING(loadoutsSaveVoiceSetting),
[_category, _loadoutCategory],
false
] call CBA_fnc_addSetting;
[QGVAR(loadoutsSaveInsignia),
"CHECKBOX",
LLSTRING(loadoutsSaveInsigniaSetting),
[_category, _loadoutCategory],
true
] call CBA_fnc_addSetting;

View File

@ -1489,5 +1489,21 @@
<Key ID="STR_ACE_Arsenal_sortAscending">
<English>Ascending</English>
</Key>
<Key ID="STR_ACE_Arsenal_toolsTab">
<English>Tools</English>
<Czech>Nástroje</Czech>
<German>Werkzeuge</German>
<Russian>Инструменты</Russian>
<Polish>Narzędzia</Polish>
<Italian>Strumenti</Italian>
<Spanish>Herramientas</Spanish>
<French>Outils</French>
<Chinese>工具</Chinese>
<Japanese>ツール</Japanese>
<Korean>도구</Korean>
<Portuguese>Ferramentas</Portuguese>
<Chinesesimp>工具</Chinesesimp>
<Turkish>Araçlar</Turkish>
</Key>
</Package>
</Project>

View File

@ -8,6 +8,7 @@ class CfgWeapons {
displayName = CSTRING(rangetable_displayName);
descriptionShort = CSTRING(rangetable_description);
picture = QPATHTOF(UI\icon_rangeTable.paa);
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0.5;
};

View File

@ -12,6 +12,7 @@ class CfgWeapons {
picture = QPATHTOF(UI\ATRAG_Icon.paa);
icon = "iconObject_circle";
mapSize = 0.034;
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 2;

View File

@ -54,6 +54,7 @@ class CfgWeapons {
model = "\A3\weapons_F\ammo\mag_univ.p3d";
picture = QPATHTOF(UI\ace_chemlight_shield_x_ca.paa);
scope = 2;
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 1;
};

View File

@ -12,6 +12,7 @@ class CfgWeapons {
picture = QPATHTOF(UI\DAGR_Icon.paa);
icon = "iconObject_circle";
mapSize = 0.034;
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 10;
};

View File

@ -26,6 +26,7 @@ class CfgWeapons {
GVAR(Range) = 250;
GVAR(Detonator) = 1;
GVAR(triggerType) = "Command";
ACE_isTool = 1;
class ItemInfo: ACE_ExplosiveItem {
mass = 3;
@ -46,6 +47,7 @@ class CfgWeapons {
descriptionShort = CSTRING(DefusalKit_description);
picture = QPATHTOF(Data\UI\Pliers.paa);
model = "\A3\Structures_F\Items\Tools\Pliers_F.p3d";
ACE_isTool = 1;
class ItemInfo: ACE_ExplosiveItem {
mass = 5;
@ -62,6 +64,7 @@ class CfgWeapons {
GVAR(Range) = 100;
GVAR(Detonator) = 1;
GVAR(triggerType) = "DeadManSwitch";
ACE_isTool = 1;
class ItemInfo: ACE_ExplosiveItem {
mass = 2;
@ -78,6 +81,7 @@ class CfgWeapons {
GVAR(Range) = 15000;
GVAR(Detonator) = 1;
GVAR(triggerType) = "Cellphone";
ACE_isTool = 1;
class ItemInfo: ACE_ExplosiveItem {
mass = 2;

View File

@ -22,7 +22,7 @@ GVAR(waterSourceOffsets) = _cache select 1;
// Custom Arsenal Tab
if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then {
[keys FIELD_RATIONS_ITEMS, LLSTRING(DisplayName), ARSENAL_CATEGORY_ICON] call EFUNC(arsenal,addRightPanelButton);
[keys FIELD_RATIONS_ITEMS, LLSTRING(DisplayName), ARSENAL_CATEGORY_ICON, -1, true] call EFUNC(arsenal,addRightPanelButton);
};
ADDON = true;

View File

@ -1,7 +1,7 @@
#include "script_component.hpp"
/*
* Author: Salluci
* Caches all item classnames used as field rations, their thirst/hunger values, and whether they are treated as magazines
* Author: LinkIsGrim
* Caches all item classnames used as field rations
*
* Arguments:
* None

View File

@ -72,6 +72,7 @@ class CfgWeapons {
descriptionShort = CSTRING(MX991_Description);
model = QPATHTOF(data\mx_991.p3d);
picture = QPATHTOF(UI\mx_991_ca.paa);
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 4;
@ -91,6 +92,7 @@ class CfgWeapons {
descriptionShort = CSTRING(KSF1_Description);
model = QPATHTOF(data\ksf_1.p3d);
picture = QPATHTOF(UI\ksf_1_ca.paa);
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 4;
@ -110,6 +112,7 @@ class CfgWeapons {
descriptionShort = CSTRING(XL50_Description);
model = QPATHTOF(data\maglite_xl50.p3d);
picture = QPATHTOF(UI\maglite_xl50_ca.paa);
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 3;

View File

@ -9,6 +9,7 @@ class CfgWeapons {
model = "\A3\Structures_F\Items\Tools\Hammer_F.p3d";
picture = QPATHTOF(UI\hammer_ca.paa);
scope = 2;
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0;
};

View File

@ -10,6 +10,7 @@ class CfgWeapons {
picture = QPATHTOF(UI\w_huntir_monitor_ca.paa);
descriptionShort = CSTRING(monitor_displayName);
model = QPATHTOF(data\ace_huntir_monitor.p3d);
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 20;

View File

@ -18,6 +18,7 @@ class CfgMagazines {
picture = QPATHTOF(ui\notepad_ca.paa);
model = "\a3\structures_f\items\documents\notepad_f.p3d";
GVAR(control) = QGVAR(RscNotepad);
ACE_isTool = 1;
};
class XGVAR(document): GVAR(base) {

View File

@ -12,6 +12,7 @@ class CfgWeapons {
picture = QPATHTOF(UI\Kestrel4500.paa);
icon = "iconObject_circle";
mapSize = 0.034;
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 2;

View File

@ -9,6 +9,7 @@ class CfgWeapons {
model = QPATHTOF(data\ace_wirecutter.p3d);
picture = QPATHTOF(ui\item_wirecutter_ca.paa);
ACE_isWirecutter = 1;
ACE_isTool = 1;
scope = 2;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 25;

View File

@ -9,6 +9,7 @@ class CfgWeapons {
model = QPATHTOF(data\ace_MapTools.p3d);
picture = QPATHTOF(UI\maptool_item.paa);
scope = 2;
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 1;
};

View File

@ -48,7 +48,7 @@ GVAR(facilityClasses) = [];
// Custom Arsenal tab
if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then {
[MEDICAL_TREATMENT_ITEMS, LELSTRING(medical,Category), ARSENAL_CATEGORY_ICON] call EFUNC(arsenal,addRightPanelButton);
[MEDICAL_TREATMENT_ITEMS, LELSTRING(medical,Category), ARSENAL_CATEGORY_ICON, -1, true] call EFUNC(arsenal,addRightPanelButton);
};
ADDON = true;

View File

@ -1,6 +1,6 @@
#include "script_component.hpp"
/*
* Author: Salluci
* Author: LinkIsGrim
* Caches all item classnames used in ACE_Medical_Treatment_Actions
*
* Arguments:
@ -22,7 +22,7 @@ private _fnc_isMedicalItem = toString {
getNumber (_x >> "ACE_isMedicalItem") isEqualTo 1
};
// get items in ACE_Medical_Treament_Actions, fallback for items without API config property
// Get items in ACE_Medical_Treament_Actions, fallback for items without API config property
{
_list append (getArray (_x >> "items"));
} forEach ("true" configClasses _cfgActions);
@ -31,4 +31,8 @@ private _fnc_isMedicalItem = toString {
_list pushBack (configName _x);
} forEach (_fnc_isMedicalItem configClasses (configFile >> "CfgWeapons"));
{
_list pushBack (configName _x);
} forEach (_fnc_isMedicalItem configClasses (configFile >> "CfgMagazines"));
uiNamespace setVariable [QGVAR(treatmentItems), compileFinal str (_list arrayIntersect _list)]

View File

@ -9,6 +9,7 @@ class CfgWeapons {
descriptionShort = CSTRING(itemDescription);
model = QPATHTOF(data\MicroDAGR.p3d);
picture = QPATHTOF(images\microDAGR_item.paa);
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 2;
};

View File

@ -8,6 +8,7 @@ class CfgWeapons {
displayName = CSTRING(rangetable_name);
descriptionShort = CSTRING(rangetable_description);
picture = QPATHTOF(UI\icon_rangeTable.paa);
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0.5;
};

View File

@ -99,10 +99,13 @@ class CfgWeapons {
};
class ACE_ItemCore;
class CBA_MiscItem_ItemInfo;
// Deprecated, 3.16.0 Arsenal supports showing magazines as misc items
class ACE_SpareBarrel_Item: ACE_ItemCore {
displayName = CSTRING(SpareBarrelName);
author = ECSTRING(common,ACETeam);
scope = 2;
scope = 1;
scopeArsenal = 0;
descriptionshort = CSTRING(SpareBarrelDescription);
picture = QUOTE(PATHTOF(UI\spare_barrel_ca.paa));
class ItemInfo: CBA_MiscItem_ItemInfo {

View File

@ -11,6 +11,7 @@ class CfgWeapons {
picture = QPATHTOF(UI\RangeCard_Icon.paa);
icon = "iconObject_circle";
mapSize = 0.034;
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 1;

View File

@ -9,6 +9,7 @@ class CfgWeapons {
descriptionShort = "";
picture = QPATHTOF(UI\w_spottingscope_ca.paa);
model = QPATHTOF(data\ace_spottingscope.p3d);
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 40;

View File

@ -9,6 +9,7 @@ class CfgWeapons {
model = QPATHTOEF(apl,ace_entrchtool.p3d);
picture = QPATHTOF(ui\w_entrchtool_ca.paa);
scope = 2;
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 10;
};

View File

@ -9,6 +9,7 @@ class CfgWeapons {
descriptionShort = "";
model = QPATHTOF(data\w_sniper_tripod.p3d);
picture = QPATHTOF(UI\w_sniper_tripod_ca.paa);
ACE_isTool = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 40;

View File

@ -44,7 +44,7 @@ Examples:
- `[_box, true] call ace_arsenal_fnc_initBox`
- `[_box, false, false] call ace_arsenal_fnc_initBox`
Passing an empty array or `false` will still add an interaction but no additional virtual items will be added.
Passing an empty array or `false` will still add an interaction but no additional virtual items will be added.
Please note that at least one virtual item needs to be added otherwise ACE Arsenal will not open.
### 1.2 Opening an arsenal box manually
@ -125,13 +125,22 @@ Built upon the function of section 2.1, this can be used to make an Arsenal only
4. Paste the created array from your clipboard into the space where the items are listed using <kbd>Ctrl</kbd> + <kbd>V</kbd>. The array is created with brackets.
Examples:
- For a new box:
- For a new box:
`[_box, ["item1", "item2", "itemN"]] call ace_arsenal_fnc_initBox`
- For an existing box:
- For an existing box:
`[_box, ["item1", "item2", "itemN"]] call ace_arsenal_fnc_addVirtualItems`
## 3. Config entries
### 3.1 Special config entries
ACE Arsenal uses 2 existing config entries to sort and display items.
- `baseWeapon`: Class name that is used to display an item in the arsenal. This property can be applied to any weapon or weapon attachment in `CfgWeapons`.
- `ACE_isUnique`: Classes in `CfgMagazines` with this property set to `1` will be treated and shown by the Arsenal as Misc. Items. Used for items with attached data that needs to be kept track of, such as Notepads or Spare Barrels.
### 3.2 New config entries
ACE Arsenal has 2 new config entries for items:
- `ace_arsenal_hide`: `0`(shown) or `1` (hidden), used to hide items from ACE Arsenal or `-1` (forced show), for magazines.
@ -139,8 +148,18 @@ ACE Arsenal has 2 new config entries for items:
Both of them are optional.
- `baseWeapon`: Class name that is used to display an item in the arsenal. This property can be applied to any weapon or weapon attachment in `CfgWeapons`.
- `ACE_isUnique`: Classes in `CfgMagazines` with this property set to `1` will be treated and shown by the Arsenal as Misc. Items. Used for items with attached data that needs to be kept track of, such as Notepads or Spare Barrels.
### 3.3 Adding items to ACE's sub-categories
ACE Arsenal includes a "Tools" sub-category by default:
- `ACE_isTool`: Items with this property set to `1` will be sorted to the Tools Tab.
ACE Medical Treatment and ACE Field Rations also add their own sub-categories, if they're present:
- `ACE_isMedicalItem`: Items with this property set to `1` will be sorted to the ACE Medical Tab.
- `ACE_isFieldRationItem`: Items with this property set to `1` will be sorted to the ACE Field Rations Tab.
Only Misc. Items will be checked for these properties. Magazines must have ACE_isUnique property.
## 4. Default loadouts
@ -339,7 +358,7 @@ Example:
{
_fireRate pushBackUnique (getNumber (_itemCfg >> _x >> "reloadTime"));
} forEach _fireModes;
_fireRate sort true;
_fireRate param [0, 0]
}] call ace_arsenal_fnc_addSort;
@ -380,10 +399,10 @@ All are local.
| ace_arsenal_onLoadoutLoad | loadout data (ARRAY), loadout name (STRING) |
| ace_arsenal_onLoadoutLoadExtended | CBA extended loadout data (ARRAY), loadout name (STRING) | 3.15.1
| ace_arsenal_onLoadoutDelete | loadout name (STRING) |
| ace_arsenal_loadoutShared | Loadouts list listnBox control (CONTROL), [loadout author (STRING), loadout name (STRING), loadout data (ARRAY)] |
| ace_arsenal_loadoutShared | Loadouts list listnBox control (CONTROL), loadout author (STRING), loadout name (STRING), loadout data (ARRAY) |
| ace_arsenal_loadoutUnshared | Loadouts list listnBox control (CONTROL), loadout author (STRING), loadout name (STRING) |
| ace_arsenal_cargoChanged | Arsenal display (DISPLAY), item (STRING), add or remove (NUMBER), shiftState (BOOL) |
| ace_arsenal_loadoutImported | Arsenal display (DISPLAY), (import list (BOOL) |
| ace_arsenal_loadoutImported | Arsenal display (DISPLAY), import list (BOOL) |
| ace_arsenal_loadoutExported | Arsenal display (DISPLAY), export list (BOOL) |
| ace_arsenal_loadoutsDisplayOpened | loadouts screen display (DISPLAY) | 3.12.3 |
| ace_arsenal_loadoutsDisplayClosed | None | 3.12.3 |
@ -402,14 +421,16 @@ All are local.
1 | Tooltip | String | Optional (default: `""`)
2 | Picture path | String | Optional (default: `"\z\ace\addons\arsenal\data\iconCustom.paa"`)
3 | Override a specific button | Number | Optional (default: `-1`)
4 | Move button on overwrite | Bool | Optional (default: `false`)
Return Value:
- Successful: Number of the slot (0-9)
- Error: -1
This function creates a sub category under misc. items in the ACE Arsenal.
Only items that are listed under 'Misc. Items' are available for sub categories.
This function creates a sub-category just above misc items in the ACE Arsenal.
Only items that are listed under 'Misc. Items' or other sub-categories are available for sub-categories.
If the 'Override a specific button' argument is not used, the button will added at the bottom of the rest.
If the 'Move button on overwrite' argument is used, the button will be moved to the bottom of the rest if its position is overridden.
Examples:
- `[["ACE_bloodIV_500", "ACE_fieldDressing"], "MedicalStuff"] call ace_arsenal_fnc_addRightPanelButton`
@ -426,3 +447,4 @@ private _buttonId = [["ACE_Flashlight_MX991", "ACE_Flashlight_KSF1"], "Flashligh
// now the category 'better flashlight' is replacing the category 'Flashlights' because it is set on the same button index
[["ACE_Flashlight_XL50"], "better flashlight", "\path\to\a\pictureWithAFlashlight.paa", _buttonId] call ace_arsenal_fnc_addRightPanelButton
```
If an overwritten button is not moved, its items will be added back to Misc. Items.