ACE3/addons/interact_menu/functions/fnc_splitPath.sqf
johnb432 4cf61a026b
Interact Menu - Use hashmaps for interactions (#9920)
* Use hashmaps for interactions

* Update addons/interact_menu/functions/fnc_splitPath.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Account for case sensitivity

* Update addons/interact_menu/functions/fnc_compileMenu.sqf

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

* Update addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf

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

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2024-05-21 20:18:32 -05:00

32 lines
638 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: esteldunedain
* Take full path and split it between parent path and action name
*
* Arguments:
* Full path of the action to remove <ARRAY>
*
* Return Value:
* 0: Parent path <ARRAY>
* 1: Action name <STRING>
*
* Example:
* [[path]] call ACE_interact_menu_fnc_splitPath
*
* Public: No
*/
private _parentPath = [];
_parentPath append _this;
private _count = count _this;
private _actionName = if (_count > 0) then {
_parentPath deleteAt (_count - 1) // TODO: replace with _parentPath deleteAt [-1] and drop _count in 2.18
} else {
""
};
[_parentPath, _actionName]