Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
1759ebfab6 | |||
798043c7aa | |||
396ef0437f | |||
d92fe23d8a | |||
1b09f262d5 |
@@ -1,6 +1,6 @@
|
|||||||
## Interface: 70300
|
## Interface: 70300
|
||||||
## Title: ActionBarSaver: Daved
|
## Title: ActionBarSaver: Daved
|
||||||
## Version: 1.2.0
|
## Version: 1.2.3
|
||||||
## Notes: Manage, save, restore, import and export action bar and keybind profiles
|
## Notes: Manage, save, restore, import and export action bar and keybind profiles
|
||||||
## Author: Phat phuck dave
|
## Author: Phat phuck dave
|
||||||
## SavedVariables: ActionBarSaverDaved, KeybindSaverDaved
|
## SavedVariables: ActionBarSaverDaved, KeybindSaverDaved
|
||||||
|
13
Actions.lua
13
Actions.lua
@@ -39,13 +39,19 @@ local pickupActionButton = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
---@param index number
|
---@param index number
|
||||||
---@param actionButton {type: string, id: number|string}
|
---@return nil
|
||||||
---@return boolean, number?
|
local function ClearActionButton(index)
|
||||||
local function RestoreActionButton(index, actionButton)
|
|
||||||
if GetActionInfo(index) then
|
if GetActionInfo(index) then
|
||||||
PickupAction(index)
|
PickupAction(index)
|
||||||
ClearCursor()
|
ClearCursor()
|
||||||
end
|
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
|
if not actionButton then return true, nil end
|
||||||
|
|
||||||
@@ -174,6 +180,7 @@ function RestoreActionbarSet(setName)
|
|||||||
|
|
||||||
for i = 1, MAX_ACTION_BUTTONS do
|
for i = 1, MAX_ACTION_BUTTONS do
|
||||||
local actionButton = set[i]
|
local actionButton = set[i]
|
||||||
|
ClearActionButton(i)
|
||||||
if actionButton then
|
if actionButton then
|
||||||
if IsMacro(actionButton) and duplicates[actionButton.id] then
|
if IsMacro(actionButton) and duplicates[actionButton.id] then
|
||||||
---@cast actionButton {type: string, id: string}
|
---@cast actionButton {type: string, id: string}
|
||||||
|
@@ -92,6 +92,7 @@ local function RestoreKeybindSet(setName)
|
|||||||
|
|
||||||
-- Save the changes
|
-- Save the changes
|
||||||
SaveBindings(GetCurrentBindingSet())
|
SaveBindings(GetCurrentBindingSet())
|
||||||
|
SaveBindings(1)
|
||||||
print(string.format("Restored keybind set '%s'", setName))
|
print(string.format("Restored keybind set '%s'", setName))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -143,6 +144,12 @@ local function ImportKeybindSet(setName, importStr)
|
|||||||
for _, line in ipairs(lines) do
|
for _, line in ipairs(lines) do
|
||||||
local command, key, key2 = strsplit(":", line)
|
local command, key, key2 = strsplit(":", line)
|
||||||
if command and key then
|
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] = {
|
if not set[command] then set[command] = {
|
||||||
key1 = key,
|
key1 = key,
|
||||||
key2 = key2,
|
key2 = key2,
|
||||||
|
2
Meta
2
Meta
Submodule Meta updated: 51a48175fa...9aae83307e
Reference in New Issue
Block a user