From 63b8afa9ed620f5d98543bb83edbfa6df5fe3354 Mon Sep 17 00:00:00 2001 From: Dominic <100990090+Waves966@users.noreply.github.com> Date: Sat, 15 Oct 2022 19:41:49 -0600 Subject: [PATCH] refactor(addKeybind): consistency with defaultKey (#128) --- imports/addKeybind/client.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imports/addKeybind/client.lua b/imports/addKeybind/client.lua index 28d7f83..d16afa7 100644 --- a/imports/addKeybind/client.lua +++ b/imports/addKeybind/client.lua @@ -2,7 +2,7 @@ ---@field name string ---@field description string ---@field defaultKey? string ----@field keybind string +---@field currentKey string ---@field disabled? boolean ---@field disable? fun(self: CKeybind, toggle: boolean) ---@field onPressed? fun(self: CKeybind) @@ -20,7 +20,7 @@ local IsPauseMenuActive = IsPauseMenuActive ---@return CKeybind function lib.addKeybind(data) data.defaultKey = data.defaultKey or '' - data.keybind = GetControlInstructionalButton(0, joaat('+' .. data.name) | 0x80000000, true):sub(3) + data.currentKey = GetControlInstructionalButton(0, joaat('+' .. data.name) | 0x80000000, true):sub(3) data.disabled = data.disabled or false data.disable = disableKeybind @@ -34,7 +34,7 @@ function lib.addKeybind(data) data:onReleased() end) - RegisterKeyMapping('+' .. data.name, data.description, 'keyboard', data.keybind) + RegisterKeyMapping('+' .. data.name, data.description, 'keyboard', data.defaultKey) SetTimeout(500, function() TriggerEvent('chat:removeSuggestion', ('/+%s'):format(data.name))