mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
4cf61a026b
* 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>
32 lines
638 B
Plaintext
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]
|