From ec2028cc8af90444e4181774de1883520acf4232 Mon Sep 17 00:00:00 2001 From: shukari Date: Mon, 15 Nov 2021 12:18:54 +0100 Subject: [PATCH] Documentation - Add Arsenal custom sub-item categories (#8678) * New Info: Adding custom sub item categories * typo fix * Custom sub item categories * Update arsenal.md --- .../functions/fnc_addRightPanelButton.sqf | 4 +- docs/wiki/feature/arsenal.md | 1 + docs/wiki/framework/arsenal-framework.md | 37 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/addons/arsenal/functions/fnc_addRightPanelButton.sqf b/addons/arsenal/functions/fnc_addRightPanelButton.sqf index e09aef4c9e..7d4ecd0d98 100644 --- a/addons/arsenal/functions/fnc_addRightPanelButton.sqf +++ b/addons/arsenal/functions/fnc_addRightPanelButton.sqf @@ -9,10 +9,10 @@ * 0: items only misc items * 1: tooltip (Optional) * 2: picture path (Optional) - * 3: override a spezific button (0-9) (Optional) + * 3: override a specific button (0-9) (Optional) * * Return Value: - * successful: number of the slot; error: -1 + * successful: number of the slot (0-9); error: -1 * * Example: * [["ACE_bloodIV_500", "ACE_Banana"], "MedicalStuff", "\z\ace\addons\arsenal\data\iconCustom.paa", 5] call ace_arsenal_fnc_addRightPanelButton diff --git a/docs/wiki/feature/arsenal.md b/docs/wiki/feature/arsenal.md index 91b4341de0..2d0c483b2e 100644 --- a/docs/wiki/feature/arsenal.md +++ b/docs/wiki/feature/arsenal.md @@ -27,6 +27,7 @@ ACE Arsenal has a pretty large number of improvements over BI Virtual Arsenal, h - A setting to disable mod icons to increase performance even further. - An other setting to invert horizontal camera controls. - Settings to disable the "Default loadouts" and "Public loadouts" tabs. +- Custom sub item categories for misc items * Items not currently available in ACE Arsenal but in the unit's inventory, unique items will be omitted when loading loadouts and they can only be removed from containers. diff --git a/docs/wiki/framework/arsenal-framework.md b/docs/wiki/framework/arsenal-framework.md index eb7c2123f6..2e269e3d6d 100644 --- a/docs/wiki/framework/arsenal-framework.md +++ b/docs/wiki/framework/arsenal-framework.md @@ -300,3 +300,40 @@ All are local. | ace_arsenal_loadoutsDisplayClosed | None | 3.12.3 | | ace_arsenal_loadoutsTabChanged | loadouts screen display (DISPLAY), tab control (CONTROL) | 3.12.3 | | ace_arsenal_loadoutsListFilled | loadouts screen display (DISPLAY), tab control (CONTROL) | 3.12.3 | + +## 7. Custom sub item categories + +### 7.1 Adding a sub item category + +`ace_arsenal_fnc_addRightPanelButton` + +| | Argument | Type | Optional (default value) +---| -------- | ---- | ------------------------ +0 | Misc. items | Array of strings | Required +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`) + +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. +If the 'Override a specific button' argument is not used, the button will added at the bottom of the rest. + +Examples: +- `[["ACE_bloodIV_500", "ACE_fieldDressing"], "MedicalStuff"] call ace_arsenal_fnc_addRightPanelButton` +- `[["ACE_Banana"], "Fruits", "\path\to\a\picture.paa"] call ace_arsenal_fnc_addRightPanelButton` + +Override Examples: +``` sqf +// a category 'Explosives' is created at the bottom (last possible location) +[["ACE_Clacker", "ACE_M26_Clacker"], "Explosives", nil, 9] call ace_arsenal_fnc_addRightPanelButton; +``` +``` sqf +// a category 'Flashlights' is created and the buttonId is saved +private _buttonId = [["ACE_Flashlight_MX991", "ACE_Flashlight_KSF1"], "Flashlights", "\path\to\a\pictureWithAFlashlight.paa"] call ace_arsenal_fnc_addRightPanelButton; +// 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 +```