diff --git a/Actions.lua b/Actions.lua index 678e763..055420e 100644 --- a/Actions.lua +++ b/Actions.lua @@ -39,13 +39,19 @@ local pickupActionButton = { } ---@param index number ----@param actionButton {type: string, id: number|string} ----@return boolean, number? -local function RestoreActionButton(index, actionButton) +---@return nil +local function ClearActionButton(index) if GetActionInfo(index) then PickupAction(index) ClearCursor() end +end + +---@param index number +---@param actionButton {type: string, id: number|string} +---@return boolean, number? +local function RestoreActionButton(index, actionButton) + ClearActionButton(index) if not actionButton then return true, nil end @@ -174,6 +180,7 @@ function RestoreActionbarSet(setName) for i = 1, MAX_ACTION_BUTTONS do local actionButton = set[i] + ClearActionButton(i) if actionButton then if IsMacro(actionButton) and duplicates[actionButton.id] then ---@cast actionButton {type: string, id: string} diff --git a/KeybindSaver.lua b/KeybindSaver.lua index 59a7fab..8700460 100644 --- a/KeybindSaver.lua +++ b/KeybindSaver.lua @@ -143,6 +143,12 @@ local function ImportKeybindSet(setName, importStr) for _, line in ipairs(lines) do local command, key, key2 = strsplit(":", line) if command and key then + if string.find(command, "CLICK ") then + -- I can't believe we have to do this bullshit... + local tmp = key + key = key2 + key2 = tmp + end if not set[command] then set[command] = { key1 = key, key2 = key2,