added keybindings

Leandro Silva [04-03-20 - 16:13]
added keybindings
Filename
Bindings.xml
Inviter.lua
LeoDolmenRunner.lua
LeoDolmenRunner.txt
Runner.lua
diff --git a/Bindings.xml b/Bindings.xml
new file mode 100644
index 0000000..7c2b3a5
--- /dev/null
+++ b/Bindings.xml
@@ -0,0 +1,15 @@
+<Bindings>
+  <Layer name="SI_KEYBINDINGS_CATEGORY_GENERAL">
+    <Category name="Leo's Dolmen Runner">
+      <Action name="LEODOLMENRUNNER_TOGGLE_WINDOW">
+        <Down>LeoDolmenRunnerWindow:ToggleHidden()</Down>
+      </Action>
+      <Action name="LEODOLMENRUNNER_RUNNER_TOGGLE">
+        <Down>LeoDolmenRunner.runner:StartStop()</Down>
+      </Action>
+      <Action name="LEODOLMENRUNNER_INVITER_TOGGLE">
+        <Down>LeoDolmenRunner.inviter:StartStop()</Down>
+      </Action>
+    </Category>
+  </Layer>
+</Bindings>
diff --git a/Inviter.lua b/Inviter.lua
index b9c6319..dbc3e7c 100644
--- a/Inviter.lua
+++ b/Inviter.lua
@@ -8,15 +8,15 @@ function Inviter:Kick()
     if not Inviter.started then return end
     for name, data in pairs(Inviter.kickList) do
         if data ~= nil and GetTimeStamp() - data.added > LeoDolmenRunner.settings.inviter.kickDelay then
-            LeoDolmenRunner.debug("Kicking " .. name)
             for i = 1, GetGroupSize() do
                 local tag = GetGroupUnitTagByIndex(i)
                 if GetUnitName(tag) == name then
-                    Inviter.kickList[name] = nil
+                    LeoDolmenRunner.log("Kicking " .. name)
                     GroupKick(tag)
                     break
                 end
             end
+            Inviter.kickList[name] = nil
         end
     end
 end
diff --git a/LeoDolmenRunner.lua b/LeoDolmenRunner.lua
index 91e3ac2..63efdd8 100644
--- a/LeoDolmenRunner.lua
+++ b/LeoDolmenRunner.lua
@@ -1,7 +1,7 @@
 LeoDolmenRunner = {
     name = "LeoDolmenRunner",
     displayName = "Leo's Dolmen Runner",
-    version = "1.1.2",
+    version = "1.1.3",
     chatPrefix = "|c39B027LeoDolmenRunner|r: ",
     isDebug = false,
     defaults = {
@@ -126,3 +126,7 @@ local function OnAddOnLoaded(event, addonName)
 end

 EVENT_MANAGER:RegisterForEvent(LDR.name, EVENT_ADD_ON_LOADED, OnAddOnLoaded)
+
+ZO_CreateStringId('SI_BINDING_NAME_LEODOLMENRUNNER_TOGGLE_WINDOW', "Show/Hide Main Window")
+ZO_CreateStringId('SI_BINDING_NAME_LEODOLMENRUNNER_RUNNER_TOGGLE', "Start/Stop runner")
+ZO_CreateStringId('SI_BINDING_NAME_LEODOLMENRUNNER_INVITER_TOGGLE', "Start/Stop auto inviter")
diff --git a/LeoDolmenRunner.txt b/LeoDolmenRunner.txt
index c33b709..40bde3d 100644
--- a/LeoDolmenRunner.txt
+++ b/LeoDolmenRunner.txt
@@ -1,7 +1,7 @@
 ## Title: Leo's Dolmen Runner
 ## APIVersion: 100029 100030
-## Version: 1.1.2
-## AddOnVersion: 112
+## Version: 1.1.3
+## AddOnVersion: 113
 ## Author: |c39B027@LeandroSilva|r
 ## SavedVariables: LeoDolmenRunner_Data
 ## DependsOn: LibFeedback LibAddonMenu-2.0 LibSavedVars
@@ -12,3 +12,4 @@ Inviter.lua
 Ui.lua
 Settings.lua
 LeoDolmenRunner.xml
+Bindings.xml
diff --git a/Runner.lua b/Runner.lua
index f15acad..9e5c4ba 100644
--- a/Runner.lua
+++ b/Runner.lua
@@ -76,8 +76,10 @@ local Runner = {

 function Runner:Start()
     LeoDolmenRunner.log("Starting runner")
+    local direction = Runner.data.direction
     ZO_ShallowTableCopy(Runner.defaultData, Runner.data)
     Runner.data.startedTime = GetTimeStamp()
+    Runner.data.direction = direction
     Runner.started = true
     LeoDolmenRunnerWindowPanelStartStopLabel:SetText("Stop")
     LeoDolmenRunner.ui:CreateUI()