mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e06c6f7835
* General - Replace toLower with toLowerANSI where applicable * whoops Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/repair/functions/fnc_setHitPointDamage.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/repair/dev/draw_showRepairInfo.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/tagging/XEH_preStart.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/vehicle_damage/functions/fnc_handleCookoff.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/tagging/XEH_preStart.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * comparment -> compartment * Update fnc_showHud.sqf * Update fnc_registerObjects.sqf * Update addons/common/functions/fnc_cbaSettings_settingChanged.sqf --------- Co-authored-by: PabstMirror <pabstmirror@gmail.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
54 lines
1.3 KiB
Plaintext
54 lines
1.3 KiB
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: johnb43
|
|
* Remove a sort from ACE Arsenal.
|
|
*
|
|
* Arguments:
|
|
* 0: Array of IDs <ARRAY of STRINGS>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [["scopeSortL00", "scopeSortL01", "scopeSortL02", "scopeSortR07"]] call ace_arsenal_fnc_removeSort;
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params ["_IDList"];
|
|
|
|
// Compile sorts from config (in case this is called before preInit)
|
|
call FUNC(compileSorts);
|
|
|
|
private _currentID = "";
|
|
private _stringCount = 0;
|
|
private _tabSide = "";
|
|
private _tab = "";
|
|
private _tabToChange = [];
|
|
|
|
{
|
|
_currentID = _x;
|
|
_stringCount = count _currentID;
|
|
|
|
// Make sure to keep at least 1 sort per category, so make default sort not deletable
|
|
if ("ace_alphabetically" in toLowerANSI (_currentID select [0, _stringCount - 3])) then {
|
|
continue;
|
|
};
|
|
|
|
// Get tab info
|
|
_tabSide = _currentID select [_stringCount - 3, 1];
|
|
_tab = _currentID select [_stringCount - 2, 2];
|
|
|
|
_tab = parseNumber _tab;
|
|
|
|
// Check which side to delete it from
|
|
_tabToChange = if (_tabSide == "R") then {
|
|
GVAR(sortListRightPanel) select _tab
|
|
} else {
|
|
GVAR(sortListLeftPanel) select _tab
|
|
};
|
|
|
|
// Remove entry (all names are unique, there are no duplicates)
|
|
_tabToChange deleteAt (_tabToChange findIf {_x select 0 == _currentID});
|
|
} forEach _IDList;
|