keybind to enable/disable toolbar

Leandro Silva [04-01-20 - 21:03]
keybind to enable/disable toolbar
Filename
Bindings.xml
Lang/de.lua
Lang/en.lua
Lang/fr.lua
Lang/jp.lua
LeoAltholic.txt
LeoAltholicInit.lua
ui/toolbar.lua
diff --git a/Bindings.xml b/Bindings.xml
index 74323fc..fb2c306 100644
--- a/Bindings.xml
+++ b/Bindings.xml
@@ -7,6 +7,16 @@
       <Action name="LEOALTHOLIC_TOGGLE_CHECKLIST">
         <Down>LeoAltholicChecklistUI.ToggleUI()</Down>
       </Action>
+      <Action name="LEOALTHOLIC_TOGGLE_TOOLBAR">
+        <Down>
+          if LeoAltholicToolbarUI.IsEnabled() then
+            LeoAltholicToolbarUI.BumpCompass(false)
+            LeoAltholicToolbarUI.SetEnabled(false)
+          else
+            LeoAltholicToolbarUI.SetEnabled(true)
+          end
+          </Down>
+      </Action>
       <Action name="LEOALTHOLIC_TRACK_QUEST">
         <Down>LeoAltholic.trackQuest(QUEST_JOURNAL_MANAGER:GetFocusedQuestIndex())</Down>
       </Action>
diff --git a/Lang/de.lua b/Lang/de.lua
index 0251e60..acc2621 100644
--- a/Lang/de.lua
+++ b/Lang/de.lua
@@ -42,6 +42,7 @@ ZO_CreateStringId("LEOALT_MAIL_PROVISIONER", "Versorgerzutaten")

 ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_WINDOW', "Zeige/Verstecke Haupt Fenster")
 ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_CHECKLIST', "Zeige/Verstecke Checkliste")
+ZO_CreateStringId("SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_TOOLBAR", "Zeige/Verstecke Leiste")
 ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TRACK_QUEST', "Verfolge tägliche Quest")

 ZO_CreateStringId("LEOALT_CHECKLIST", "Checkliste")
diff --git a/Lang/en.lua b/Lang/en.lua
index 0a9b33b..86c0b80 100644
--- a/Lang/en.lua
+++ b/Lang/en.lua
@@ -42,6 +42,7 @@ ZO_CreateStringId("LEOALT_MAIL_PROVISIONER", "Raw Provisioner Materials")

 ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_WINDOW', "Show/Hide Main Window")
 ZO_CreateStringId("SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_CHECKLIST", "Show/Hide Checklist")
+ZO_CreateStringId("SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_TOOLBAR", "Show/Hide Toolbar")
 ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TRACK_QUEST', "Track Daily Quest")

 ZO_CreateStringId("LEOALT_CHECKLIST", "Checklist")
diff --git a/Lang/fr.lua b/Lang/fr.lua
index 36c4d4f..2903df8 100644
--- a/Lang/fr.lua
+++ b/Lang/fr.lua
@@ -42,6 +42,7 @@ ZO_CreateStringId("LEOALT_MAIL_PROVISIONER", "Matériaux bruts de cuisine")

 ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_WINDOW', "Show/Hide Main Window")
 ZO_CreateStringId("SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_CHECKLIST", "Show/Hide Checklist")
+ZO_CreateStringId("SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_TOOLBAR", "Show/Hide Toolbar")
 ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TRACK_QUEST', "Track Daily Quest")

 ZO_CreateStringId("LEOALT_CHECKLIST", "Liste de contrôle")
diff --git a/Lang/jp.lua b/Lang/jp.lua
index 27db2c7..09c3f9c 100644
--- a/Lang/jp.lua
+++ b/Lang/jp.lua
@@ -42,6 +42,7 @@ ZO_CreateStringId("LEOALT_MAIL_PROVISIONER", "調理師用素材")

 ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_WINDOW', "表示/非表示 メイン 画面")
 ZO_CreateStringId("SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_CHECKLIST", "表示/非表示 チェックリスト")
+ZO_CreateStringId("SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_TOOLBAR", "Show/Hide Toolbar")
 ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TRACK_QUEST', "デイリークエストを追跡")

 ZO_CreateStringId("LEOALT_CHECKLIST", "チェックリスト")
diff --git a/LeoAltholic.txt b/LeoAltholic.txt
index 99f0193..461d025 100644
--- a/LeoAltholic.txt
+++ b/LeoAltholic.txt
@@ -1,7 +1,7 @@
 ## Title: Leo's Altholic
 ## APIVersion: 100029 100030
-## Version: 1.7.10
-## AddOnVersion: 1710
+## Version: 1.7.11
+## AddOnVersion: 1711
 ## Author: |c39B027@LeandroSilva|r
 ## SavedVariables: LeoAltholicSavedVariables LeoAltholicCharVariables
 ## DependsOn: LibFeedback LibAddonMenu-2.0
diff --git a/LeoAltholicInit.lua b/LeoAltholicInit.lua
index ad04d1c..8381f9c 100644
--- a/LeoAltholicInit.lua
+++ b/LeoAltholicInit.lua
@@ -6,7 +6,7 @@ LeoAltholicToolbarUI = LeoAltholicToolbarUI or {}

 LeoAltholic.name = "LeoAltholic"
 LeoAltholic.displayName = "Leo's Altholic"
-LeoAltholic.version = "1.7.10"
+LeoAltholic.version = "1.7.11"
 LeoAltholic.chatPrefix = "|c39B027" .. LeoAltholic.name .. "|r: "

 LeoAltholic.TAB_BIO = "Bio"
diff --git a/ui/toolbar.lua b/ui/toolbar.lua
index 52e936f..06c15dc 100644
--- a/ui/toolbar.lua
+++ b/ui/toolbar.lua
@@ -48,18 +48,21 @@ function LeoAltholicToolbarUI.GetBumpCompass()
     if LeoAltholic.globalData.settings.toolbar.bumpCompass == nil then LeoAltholic.globalData.settings.toolbar.bumpCompass = false end
     return LeoAltholic.globalData.settings.toolbar.bumpCompass
 end
-function LeoAltholicToolbarUI.BumpCompass()
+function LeoAltholicToolbarUI.BumpCompass(enabled)
+    if enabled == nil then enabled = true end
+
     local hasWykkydsToolbar = false
     if WYK_Toolbar and wykkydsToolbar then hasWykkydsToolbar = true end
+
     if not hasWykkydsToolbar and LeoAltholicToolbarUI.IsEnabled() and LeoAltholicToolbarUI.GetBumpCompass() then
-        if LeoAltholicToolbar:GetTop() <= 60 then
+        if LeoAltholicToolbar:GetTop() <= 60 and enabled then
             if math.floor(ZO_CompassFrame:GetTop()) ~= math.floor(LeoAltholicToolbar:GetTop()) + 60 then
                 ZO_CompassFrame:ClearAnchors()
                 ZO_CompassFrame:SetAnchor( TOP, GuiRoot, TOP, 0, LeoAltholicToolbar:GetTop() + 60)
                 ZO_TargetUnitFramereticleover:ClearAnchors()
                 ZO_TargetUnitFramereticleover:SetAnchor( TOP, GuiRoot, TOP, 0, LeoAltholicToolbar:GetTop() + 110)
             end
-        elseif ZO_CompassFrame:GetTop() ~= 40 then
+        elseif ZO_CompassFrame:GetTop() ~= 40 or not enabled then
             ZO_CompassFrame:ClearAnchors()
             ZO_CompassFrame:SetAnchor( TOP, GuiRoot, TOP, 0, 40 )
             ZO_TargetUnitFramereticleover:ClearAnchors()