Fix some other bullshit, make work
This commit is contained in:
29
Actions.lua
29
Actions.lua
@@ -23,7 +23,6 @@ local pickupActionButton = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local function RestoreActionButton(self, index, actionButton)
|
local function RestoreActionButton(self, index, actionButton)
|
||||||
-- Clear the slot
|
|
||||||
if GetActionInfo(index) then
|
if GetActionInfo(index) then
|
||||||
PickupAction(index)
|
PickupAction(index)
|
||||||
ClearCursor()
|
ClearCursor()
|
||||||
@@ -34,9 +33,9 @@ local function RestoreActionButton(self, index, actionButton)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local aliases = ActionBarSaverReloaded.spellAliases[actionButton.id] or {}
|
local aliases = ActionBarSaverReloaded.spellAliases[actionButton.id] or {}
|
||||||
local ids = Array.insert(aliases, actionButton.id, 1)
|
table.insert(aliases, actionButton.id)
|
||||||
|
|
||||||
for _, id in ipairs(ids) do
|
for _, id in ipairs(aliases) do
|
||||||
pickupActionButton[actionButton.type](id)
|
pickupActionButton[actionButton.type](id)
|
||||||
|
|
||||||
if GetCursorInfo() == actionButton.type then
|
if GetCursorInfo() == actionButton.type then
|
||||||
@@ -80,7 +79,6 @@ local function AddWarning(warnings, macroName, usages)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function SaveSet(setName)
|
function SaveSet(setName)
|
||||||
print("ABS SaveSet")
|
|
||||||
if not setName or setName == "" then
|
if not setName or setName == "" then
|
||||||
print("Set name cannot be empty")
|
print("Set name cannot be empty")
|
||||||
return
|
return
|
||||||
@@ -111,9 +109,9 @@ function SaveSet(setName)
|
|||||||
|
|
||||||
ActionBarSaverReloaded.sets[setName] = set
|
ActionBarSaverReloaded.sets[setName] = set
|
||||||
print(string.format("Saved set '%s'!", setName))
|
print(string.format("Saved set '%s'!", setName))
|
||||||
Array.iter(warnings, function(warning)
|
for _, warning in ipairs(warnings) do
|
||||||
print(warning)
|
print(warning)
|
||||||
end)
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function RestoreSet(setName)
|
function RestoreSet(setName)
|
||||||
@@ -158,9 +156,9 @@ function RestoreSet(setName)
|
|||||||
end
|
end
|
||||||
|
|
||||||
print(string.format("Restored set '%s'", setName))
|
print(string.format("Restored set '%s'", setName))
|
||||||
Array.iter(messages, function(warning)
|
for _, warning in ipairs(messages) do
|
||||||
print(warning)
|
print(warning)
|
||||||
end)
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function DeleteSet(setName)
|
function DeleteSet(setName)
|
||||||
@@ -180,7 +178,10 @@ function DeleteSet(setName)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ListSets()
|
function ListSets()
|
||||||
local sets = Dict.keysAsArray(ActionBarSaverReloaded.sets)
|
local sets = {}
|
||||||
|
for setName, _ in pairs(ActionBarSaverReloaded.sets) do
|
||||||
|
table.insert(sets, setName)
|
||||||
|
end
|
||||||
table.sort(sets)
|
table.sort(sets)
|
||||||
local setsStr = table.concat(sets, ", ")
|
local setsStr = table.concat(sets, ", ")
|
||||||
|
|
||||||
@@ -204,10 +205,14 @@ function AliasSpell(args)
|
|||||||
|
|
||||||
local aliases = ActionBarSaverReloaded.spellAliases[spellID] or {}
|
local aliases = ActionBarSaverReloaded.spellAliases[spellID] or {}
|
||||||
|
|
||||||
if Array.contains(aliases, aliasID) then
|
for _, id in ipairs(aliases) do
|
||||||
|
if id == aliasID then
|
||||||
print(string.format("Spell %d is already aliased by %d", spellID, aliasID))
|
print(string.format("Spell %d is already aliased by %d", spellID, aliasID))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(aliases, aliasID)
|
||||||
|
|
||||||
table.insert(aliases, aliasID)
|
table.insert(aliases, aliasID)
|
||||||
ActionBarSaverReloaded.spellAliases[spellID] = aliases
|
ActionBarSaverReloaded.spellAliases[spellID] = aliases
|
||||||
@@ -258,10 +263,8 @@ function PrintUsage()
|
|||||||
end
|
end
|
||||||
|
|
||||||
SlashCmdList["ABS"] = function(argv)
|
SlashCmdList["ABS"] = function(argv)
|
||||||
print("ABS slash", tostring(argv))
|
local args = {strsplit(" ", argv)}
|
||||||
local args = strsplit(" ", argv)
|
|
||||||
local cmd = args[1]
|
local cmd = args[1]
|
||||||
print("ABS slash", tostring(cmd))
|
|
||||||
|
|
||||||
if cmd == "save" then
|
if cmd == "save" then
|
||||||
SaveSet(args[2])
|
SaveSet(args[2])
|
||||||
|
|||||||
Reference in New Issue
Block a user