ACE3/addons/fieldmanual/functions/fnc_getKeybindName.sqf

35 lines
895 B
Plaintext
Raw Normal View History

Field Manual - Add Framework (#9320) * Field Manual Framework Created barebones framework for addition of the Field Manual * Created Stringtable.xml Created Stringtable.xml Created a few strings... more to come * Update addons/fieldmanual/config.cpp Moved opening brace Co-authored-by: Mike-MF <TyroneMF@hotmail.com> * Update addons/fieldmanual/config.cpp new lines at end of file Co-authored-by: Mike-MF <TyroneMF@hotmail.com> * update stringtable.xml Added arguments to ACE_Field_Rations_Base Added strings for descriptions of subclasses * update stringtable.xml Added medical item documentation Added field ration documentation * Update stringtable.xml Added fortify tool documentation * updated stringtable.xml and cfgHints.hpp Added item documentation Cleaned up other strings Added additional arguments and made them universal * updated/reordered contents. added images Reordered CfgHints.hpp Added Range Tables string Reordered stringtable Added images for inline use * changed indentation style changed indentation style to guidelines added empty line to the end of each file * Update addons/fieldmanual/CfgHints.hpp remove redundant includes Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/fieldmanual/CfgHintCategories.hpp remove redundant includes Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update stringtable.xml added explosives string - no image yet * Update stringtable.xml added dead man's switch - no image as of yet * Update addons/fieldmanual/script_component.hpp Co-authored-by: jonpas <jonpas33@gmail.com> * Update addons/fieldmanual/script_component.hpp Co-authored-by: jonpas <jonpas33@gmail.com> * Update addons/fieldmanual/stringtable.xml Co-authored-by: jonpas <jonpas33@gmail.com> * Update stringtable.xml Removed containers Modified table to 4 space indentation Started using Tabler * update cfghints and stringtable moved the fortify tool to items and removed it's specialized class added DAGR and MicroDAGR strings - no image * restructure CfgHints.cpp - added additional arguments + placeholders for forward compatibility Removed images and img from strings - will add in a different PR Stringtable.xml - added 99% of content * update strings updated stringtables consolidated cfghint base classes * cfghints fixed multiline string code * Update CfgHints.hpp Missed trailing \ * update cfghints.hpp fixed leading \ still trying to get the pboproject to like it * Update stringtable.xml deleted original stringtable entry due to error with Arma/Vlidate (pull_request) * Update addons/fieldmanual/script_component.hpp Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> * Update addons/fieldmanual/CfgHintCategories.hpp Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/fieldmanual/stringtable.xml Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/fieldmanual/stringtable.xml Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/fieldmanual/stringtable.xml Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/fieldmanual/stringtable.xml Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/fieldmanual/stringtable.xml Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/fieldmanual/stringtable.xml Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/fieldmanual/stringtable.xml Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update stringtable.xml changed structures for spray paint to surfaces * Apply suggestions from code review Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Dynamically get item names * stringtables, better unbound key handling * disable preprocess (rip tools) * bound key change * standardize on medical keybinds * fix medial menu keybind --------- Co-authored-by: Hypoxic <amartini@martinicreations.com> Co-authored-by: Mike-MF <TyroneMF@hotmail.com> Co-authored-by: PabstMirror <pabstmirror@gmail.com> Co-authored-by: jonpas <jonpas33@gmail.com> Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
2023-10-11 20:53:10 +00:00
#include "..\script_component.hpp"
/*
* Author: Hypoxic, PabstMirror
* Gets keybind name from CBA
*
* Arguments:
* 0: Addon <STRING>
* 1: Key Name <STRING>
*
* Return Value:
* <STRING>
*
* Example:
* ["ACE3 Common", "ace_interact_menu_selfInteractKey"] call ace_fieldmanual_fnc_getKeybindName
*
* Public: No
*/
params ["_addon", "_keyName"];
private _return = _keyName;
with missionNamespace do { // hint is calling from uiNamespace
private _keyInfo = [_addon, _keyName] call CBA_fnc_getKeybind;
if (!isNil "_keyInfo") then {
private _localizeInfo = _keyInfo select 8 param [0, []];
if (_localizeInfo isEqualTo []) then {
_return = format ["%1 -> %2", _addon, _keyInfo select 2];
} else {
_return = format ["%1 -> %2 (%3)", _addon, _keyInfo select 2, _localizeInfo call CBA_fnc_localizeKey];
};
};
};
_return