Added keybindings and slash command
René Welbers [01-09-16 - 11:24]
Added keybindings and slash command
diff --git a/AutoInvite.txt b/AutoInvite.txt
index 39e32b4..b01150f 100644
--- a/AutoInvite.txt
+++ b/AutoInvite.txt
@@ -1,6 +1,6 @@
## APIVersion: 100013
## Title: AutoInvite
-## Version: 2.1.5
+## Version: 2.1.6
## Author: Sasky, Kyoma & |c4779cesilentgecko|r
## SavedVariables: AutoInviteSettings
## OptionalDependsOn: LibAddonMenu-2.0
@@ -35,5 +35,6 @@ ui/half_grouplist.xml
ui/ai_enabled_fragment.lua
ui/ai_options_fragment.lua
ui/autoinvitescene.lua
+ui/bindings.xml
AutoInvite.lua
diff --git a/lang/en.lua b/lang/en.lua
index 3b5d546..8d59298 100644
--- a/lang/en.lua
+++ b/lang/en.lua
@@ -55,11 +55,16 @@ ZO_CreateStringId("SI_AUTO_INVITE_BTN_REFRESH", "Refresh List")
ZO_CreateStringId("SI_AUTO_INVITE_BTN_REFORM", "Re-form Group")
ZO_CreateStringId("SI_AUTO_INVITE_BTN_REINVITE", "Re-Invite Group")
+-- keybind
+ZO_CreateStringId("SI_BINDING_NAME_AUTOINVITE_REGROUP", "Re-form Group")
+ZO_CreateStringId("SI_BINDING_NAME_AUTOINVITE_REINVITE", "Re-Invite Group")
+
--Slash commands
--Note: Don't translate between the color codes |C ... |r
ZO_CreateStringId("SI_AUTO_INVITE_SLASHCMD_INFO", "AutoInvite - command |CFFFF00/ai <str>|r. Usage:")
ZO_CreateStringId("SI_AUTO_INVITE_SLASHCMD_START", "|CFFFF00/ai foo|r - start listening on 'foo'")
ZO_CreateStringId("SI_AUTO_INVITE_SLASHCMD_STOP", "|CFFFF00/ai|r - turn off AutoInvite")
+ZO_CreateStringId("SI_AUTO_INVITE_SLASHCMD_REGRP", "|CFFFF00/ai regrp|r - Re-form Group")
ZO_CreateStringId("SI_AUTO_INVITE_SLASHCMD_HELP", "|CFFFF00/ai help|r - show this help menu")
--Templates for using in code (reference):
diff --git a/lang/fr.lua b/lang/fr.lua
index d579a72..efe1dd7 100644
--- a/lang/fr.lua
+++ b/lang/fr.lua
@@ -58,11 +58,16 @@ ZO_CreateStringId("SI_AUTO_INVITE_OPT_SLASHCMD", "Commande manuelle")
ZO_CreateStringId("SI_AUTO_INVITE_BTN_REFRESH", "Rafraîchir la liste")
ZO_CreateStringId("SI_AUTO_INVITE_BTN_REFORM", "Refaire le groupe")
+-- keybind
+ZO_CreateStringId("SI_BINDING_NAME_AUTOINVITE_REGROUP", "Refaire le groupe")
+ZO_CreateStringId("SI_BINDING_NAME_AUTOINVITE_REINVITE", "Re-Invite Group")
+
--Slash commands
--Note: Don't translate between the color codes |C ... |r
ZO_CreateStringId("SI_AUTO_INVITE_SLASHCMD_INFO", "AutoInvite - commande |CFFFF00/ai <str>|r. Exemple :")
ZO_CreateStringId("SI_AUTO_INVITE_SLASHCMD_START", "|CFFFF00/ai foo|r - Commencer à écouter 'foo'.")
ZO_CreateStringId("SI_AUTO_INVITE_SLASHCMD_STOP", "|CFFFF00/ai|r - Arrêter AutoInvite.")
+ZO_CreateStringId("SI_AUTO_INVITE_SLASHCMD_REGRP", "|CFFFF00/ai regrp|r - Refaire le groupe")
ZO_CreateStringId("SI_AUTO_INVITE_SLASHCMD_HELP", "|CFFFF00/ai help|r - Afficher cette aide.")
--Templates for using in code (reference):
diff --git a/lua/cli.lua b/lua/cli.lua
index 60b0686..7fe87d6 100644
--- a/lua/cli.lua
+++ b/lua/cli.lua
@@ -28,6 +28,7 @@ local function echo(msg) CHAT_SYSTEM.primaryContainer.currentBuffer:AddMessage("
AutoInvite.help = function()
echo(GetString(SI_AUTO_INVITE_SLASHCMD_INFO))
echo(" " .. GetString(SI_AUTO_INVITE_SLASHCMD_START))
+ echo(" " .. GetString(SI_AUTO_INVITE_SLASHCMD_REGRP))
echo(" " .. GetString(SI_AUTO_INVITE_SLASHCMD_HELP))
echo(" " .. GetString(SI_AUTO_INVITE_SLASHCMD_STOP))
return
@@ -43,6 +44,9 @@ SLASH_COMMANDS["/ai"] = function(str)
echo(GetString(SI_AUTO_INVITE_OFF))
AutoInvite.disable()
return
+ elseif str == "regrp" then
+ AutoInvite:resetGroup()
+ return
end
AutoInvite.cfg.watchStr = string.lower(str)
AutoInvite.startListening()
diff --git a/ui/bindings.xml b/ui/bindings.xml
new file mode 100644
index 0000000..cceaaac
--- /dev/null
+++ b/ui/bindings.xml
@@ -0,0 +1,12 @@
+<Bindings>
+ <Layer name="SI_KEYBINDINGS_LAYER_GENERAL">
+ <Category name="AutoInvite">
+ <Action name="AUTOINVITE_REGROUP">
+ <Down>AutoInvite:resetGroup()</Down>
+ </Action>
+ <Action name="AUTOINVITE_REINVITE">
+ <Down>AutoInvite:inviteGroup()</Down>
+ </Action>
+ </Category>
+ </Layer>
+</Bindings>
\ No newline at end of file