Add /binder delete
Amber Yust [04-16-14 - 01:26]
diff --git a/Binder.lua b/Binder.lua
index 4a8040a..7c2d0ed 100644
--- a/Binder.lua
+++ b/Binder.lua
@@ -140,11 +140,25 @@ function Binder.ListBindings()
end
end
+function Binder.DeleteBindings(bindSetName)
+ if bindSetName == nil or bindSetName == "" then
+ print("Usage: /binder delete <set name>")
+ return
+ end
+ if Binder.savedVariables.bindings[bindSetName] == nil then
+ print("Bind set '", bindSetName, "' does not exist.")
+ return
+ end
+ Binder.savedVariables.bindings[bindSetName] = nil
+ print("Deleted bind set '", bindSetName, "'.")
+end
+
Binder.commands = {
["build"] = Binder.BuildBindingsTable,
["save"] = Binder.SaveBindings,
["load"] = Binder.LoadBindings,
["list"] = Binder.ListBindings,
+ ["delete"] = Binder.DeleteBindings,
}
function Binder.SlashCommandHelp()
@@ -152,6 +166,7 @@ function Binder.SlashCommandHelp()
print("- /binder save <set name> (saves current keybindings)")
print("- /binder load <set name> (loads specified keybindings)")
print("- /binder list (lists all saved bind sets)")
+ print("- /binder delete <set name> (deletes specified keybindings)")
end
function Binder.SlashCommand(argtext)