Skip to content

Instantly share code, notes, and snippets.

@Heyoxe
Created April 28, 2020 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Heyoxe/f257e592c31cbd12e3d9883fe1ec4588 to your computer and use it in GitHub Desktop.
Save Heyoxe/f257e592c31cbd12e3d9883fe1ec4588 to your computer and use it in GitHub Desktop.
Get all Arma Actions Keys.
_fnc_localizeKeyArray = {
params [
["_actions", [], []]
];
private _localized = [];
{
private _action = _x;
private _preLocalName = "";
{
private _char = _x;
if (_char in ("ABCDEFGHIJKLMNOPQRSTUVWXYZ" splitString "") && (_forEachIndex > 0)) then {
_preLocalName = _preLocalName + "_";
};
_preLocalName = _preLocalName + _char;
} forEach (_action splitString "");
private _name = actionName _action;
private _tooltip = localize ("str_controls_tooltips_" + _preLocalName);
_localized pushBack [_action, _name, _tooltip];
} forEach _actions;
_localized
};
// private _preset = "Arma3";
// private _actions = configProperties [(configFile >> "CfgDefaultKeysPresets" >> _preset >> "Mappings"), "true", true];
// private _allKeys = [(_actions apply { configName _x})] call _fnc_localizeKeyArray;
// _allKeys
private _groups = configProperties [(configFile >> "UserActionGroups"), "true", true];
private _keyGroups = [];
{
private _group = getArray (_x >> "group");
private _localized = [_group] call _fnc_localizeKeyArray;
_keyGroups pushBack [
getText (_x >> "name"),
_localized
];
} forEach _groups;
_keyGroups
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment