diff --git a/addons/keybinding/fnc_addKeybind.sqf b/addons/keybinding/fnc_addKeybind.sqf index 2d6ade80e..e4be1d251 100644 --- a/addons/keybinding/fnc_addKeybind.sqf +++ b/addons/keybinding/fnc_addKeybind.sqf @@ -45,7 +45,25 @@ if (!hasInterface) exitWith {}; _nullKeybind = [-1, [false,false,false]]; -params ["_modName","_actionId","_displayName","_downCode","_upCode", ["_defaultKeybind", _nullKeybind], ["_holdKey",true], ["_holdDelay",0], ["_overwrite",false]]; +params [ + ["_modName", "", [""]], + ["_actionId", "", [""]], + ["_displayName", "", ["", []]], + "_downCode", + "_upCode", + ["_defaultKeybind", _nullKeybind], + ["_holdKey", true], + ["_holdDelay", 0], + ["_overwrite", false] +]; + +_displayName params [["_name", "", [""]], ["_tooltip", "", [""]]]; + +if (_tooltip isEqualTo "") then { + _displayName = _name; +} else { + _displayName = [_name, _tooltip]; +}; if (count _defaultKeybind == 4) then { _msg = format ["%1: %2 - Wrong format for the default keybind parameter. Use [DIK, [shift, ctrl, alt]]", _modName, _actionId];