diff --git a/Bartender4.lua b/Bartender4.lua index d7c51d7..dbd3032 100644 --- a/Bartender4.lua +++ b/Bartender4.lua @@ -3,6 +3,9 @@ Bartender4 = AceAddon:NewAddon("Bartender4", "AceConsole-3.0", "AceEvent-3.0", " local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4") +local LDB = LibStub("LibDataBroker-1.1", true) +local LDBIcon = LibStub("LibDBIcon-1.0", true) + local defaults = { profile = { tooltip = "enabled", @@ -13,6 +16,7 @@ local defaults = { focuscastmodifier = true, selfcastrightclick = false, snapping = true, + minimapIcon = {}, } } @@ -38,6 +42,10 @@ function Bartender4:OnInitialize() MainMenuBarArtFrame:UnregisterEvent("UNIT_ENTERED_VEHICLE") MainMenuBarArtFrame:UnregisterEvent("UNIT_EXITING_VEHICLE") MainMenuBarArtFrame:UnregisterEvent("UNIT_EXITED_VEHICLE") + + if LDB then + createLDBLauncher() + end end --[[ function Bartender4:OnEnable() @@ -58,6 +66,9 @@ function Bartender4:UpdateModuleConfigs() v:ApplyConfig() end end + if LDB and LDBIcon then + LDBIcon:Refresh("Bartender4", Bartender4.db.profile.minimapIcon) + end end function Bartender4:CombatLockdown() @@ -221,12 +232,11 @@ end Bartender4:SetDefaultModulePrototype(Bartender4.modulePrototype) -local LDB = LibStub("LibDataBroker-1.1", true) -if LDB then +function createLDBLauncher() local L_BT_LEFT = L["|cffffff00Click|r to toggle bar lock"] local L_BT_RIGHT = L["|cffffff00Right-click|r to open the options menu"] - LibStub("LibDataBroker-1.1"):NewDataObject("Bartender4", { + local LDBObj = LibStub("LibDataBroker-1.1"):NewDataObject("Bartender4", { type = "launcher", text = "Bartender4", OnClick = function(_, msg) @@ -252,4 +262,8 @@ if LDB then tooltip:AddLine(L_BT_RIGHT) end, }) + + if LDBIcon then + LDBIcon:Register("Bartender4", LDBObj, Bartender4.db.profile.minimapIcon) + end end diff --git a/Options/Options.lua b/Options/Options.lua index b6811fd..646d876 100644 --- a/Options/Options.lua +++ b/Options/Options.lua @@ -16,6 +16,7 @@ do end local KB = LibStub("LibKeyBound-1.0") +local LDBIcon = LibStub("LibDBIcon-1.0", true) local function getOptions() if not Bartender4.options then Bartender4.options = { @@ -32,6 +33,7 @@ local function getOptions() desc = L["Lock all bars."], get = function() return Bartender4.Locked end, set = function(info, value) Bartender4[value and "Lock" or "Unlock"](Bartender4) end, + width = "half", }, buttonlock = { order = 2, @@ -41,8 +43,17 @@ local function getOptions() get = getFunc, set = setFunc, }, - kb = { + minimapIcon = { order = 3, + type = "toggle", + name = L["Minimap Icon"], + desc = L["Show a Icon to open the config at the Minimap"], + get = function() return not Bartender4.db.profile.minimapIcon.hide end, + set = function(info, value) Bartender4.db.profile.minimapIcon.hide = not value; LDBIcon[value and "Show" or "Hide"](LDBIcon, "Bartender4") end, + disabled = function() return not LDBIcon end, + }, + kb = { + order = 4, type = "execute", name = L["Key Bindings"], desc = L["Switch to key-binding mode"], diff --git a/locale/deDE.lua b/locale/deDE.lua index 13532eb..f77380c 100644 --- a/locale/deDE.lua +++ b/locale/deDE.lua @@ -85,6 +85,7 @@ if not L then return end -- L["Lock all bars."] = true -- L["Lock the buttons."] = true -- L["Micro Menu"] = true +-- L["Minimap Icon"] = true -- L["Modifier Based Switching"] = true -- L["No Display"] = true -- L["None"] = true @@ -107,6 +108,7 @@ if not L then return end -- L["Select the Self-Cast Modifier"] = true -- L["Self-Cast Modifier"] = true -- L["Self-Cast by modifier"] = true +-- L["Show a Icon to open the config at the Minimap"] = true -- L["Show the MicroMenu vertically."] = true -- L["Show the keyring button."] = true -- L["Specify the Color of the Out of Mana Indicator"] = true diff --git a/locale/enUS.lua b/locale/enUS.lua index caae95e..8d6cd59 100644 --- a/locale/enUS.lua +++ b/locale/enUS.lua @@ -85,6 +85,7 @@ L["Lock"] = true L["Lock all bars."] = true L["Lock the buttons."] = true L["Micro Menu"] = true +L["Minimap Icon"] = true L["Modifier Based Switching"] = true L["No Display"] = true L["None"] = true @@ -107,6 +108,7 @@ L["Select the Focus-Cast Modifier"] = true L["Select the Self-Cast Modifier"] = true L["Self-Cast Modifier"] = true L["Self-Cast by modifier"] = true +L["Show a Icon to open the config at the Minimap"] = true L["Show the MicroMenu vertically."] = true L["Show the keyring button."] = true L["Specify the Color of the Out of Mana Indicator"] = true diff --git a/locale/esES.lua b/locale/esES.lua index e3b8a2a..960ac50 100644 --- a/locale/esES.lua +++ b/locale/esES.lua @@ -85,6 +85,7 @@ if not L then return end -- L["Lock all bars."] = true -- L["Lock the buttons."] = true -- L["Micro Menu"] = true +-- L["Minimap Icon"] = true -- L["Modifier Based Switching"] = true -- L["No Display"] = true -- L["None"] = true @@ -107,6 +108,7 @@ if not L then return end -- L["Select the Self-Cast Modifier"] = true -- L["Self-Cast Modifier"] = true -- L["Self-Cast by modifier"] = true +-- L["Show a Icon to open the config at the Minimap"] = true -- L["Show the MicroMenu vertically."] = true -- L["Show the keyring button."] = true -- L["Specify the Color of the Out of Mana Indicator"] = true diff --git a/locale/esMX.lua b/locale/esMX.lua index ef7e2df..51a8332 100644 --- a/locale/esMX.lua +++ b/locale/esMX.lua @@ -85,6 +85,7 @@ if not L then return end -- L["Lock all bars."] = true -- L["Lock the buttons."] = true -- L["Micro Menu"] = true +-- L["Minimap Icon"] = true -- L["Modifier Based Switching"] = true -- L["No Display"] = true -- L["None"] = true @@ -107,6 +108,7 @@ if not L then return end -- L["Select the Self-Cast Modifier"] = true -- L["Self-Cast Modifier"] = true -- L["Self-Cast by modifier"] = true +-- L["Show a Icon to open the config at the Minimap"] = true -- L["Show the MicroMenu vertically."] = true -- L["Show the keyring button."] = true -- L["Specify the Color of the Out of Mana Indicator"] = true diff --git a/locale/frFR.lua b/locale/frFR.lua index f20ea21..74e0949 100644 --- a/locale/frFR.lua +++ b/locale/frFR.lua @@ -85,6 +85,7 @@ L["Lock"] = "Verrouiller" L["Lock all bars."] = "Verrouille toutes les barres." L["Lock the buttons."] = "Verrouille tous les boutons." L["Micro Menu"] = "Micro menu" +-- L["Minimap Icon"] = true L["Modifier Based Switching"] = "Permutations basées sur les modificateurs" L["No Display"] = "Pas d'affichage" -- L["None"] = true @@ -107,6 +108,7 @@ L["Scale"] = "Échelle" -- L["Select the Self-Cast Modifier"] = true -- L["Self-Cast Modifier"] = true L["Self-Cast by modifier"] = "Ciblage auto. modific." +-- L["Show a Icon to open the config at the Minimap"] = true -- L["Show the MicroMenu vertically."] = true L["Show the keyring button."] = "Affiche le bouton du trousseau de clés." L["Specify the Color of the Out of Mana Indicator"] = "Spécifie la couleur de l'indicateur Plus de mana." diff --git a/locale/koKR.lua b/locale/koKR.lua index b282b5f..23bd9eb 100644 --- a/locale/koKR.lua +++ b/locale/koKR.lua @@ -85,6 +85,7 @@ L["Lock"] = "고정" L["Lock all bars."] = "모든 바를 고정합니다." L["Lock the buttons."] = "버튼을 고정합니다." L["Micro Menu"] = "게임 메뉴" +-- L["Minimap Icon"] = true L["Modifier Based Switching"] = "기능키 기반 교체" L["No Display"] = "표시 안함" -- L["None"] = true @@ -107,6 +108,7 @@ L["Scale"] = "크기" -- L["Select the Self-Cast Modifier"] = true -- L["Self-Cast Modifier"] = true L["Self-Cast by modifier"] = "기능키에 의한 자신-시전" +-- L["Show a Icon to open the config at the Minimap"] = true -- L["Show the MicroMenu vertically."] = true L["Show the keyring button."] = "열쇠 고리 버튼을 표시합니다." L["Specify the Color of the Out of Mana Indicator"] = "마나 부족 지시기의 색상을 지정합니다." diff --git a/locale/ruRU.lua b/locale/ruRU.lua index 8983259..71b5378 100644 --- a/locale/ruRU.lua +++ b/locale/ruRU.lua @@ -85,6 +85,7 @@ L["Lock"] = "Блокировка" L["Lock all bars."] = "Заблокировать все панели" L["Lock the buttons."] = "Заблокировать кнопки" L["Micro Menu"] = "Микроменю" +-- L["Minimap Icon"] = true L["Modifier Based Switching"] = "Переключение, основанное на модификаторах" L["No Display"] = "Не отображать" -- L["None"] = true @@ -107,6 +108,7 @@ L["Scale"] = "Масштаб" -- L["Select the Self-Cast Modifier"] = true -- L["Self-Cast Modifier"] = true L["Self-Cast by modifier"] = "Чтение на себя по умолчанию" +-- L["Show a Icon to open the config at the Minimap"] = true -- L["Show the MicroMenu vertically."] = true L["Show the keyring button."] = "Показывать кнопку для связки ключей" L["Specify the Color of the Out of Mana Indicator"] = "Выберите цвет для индикации нехватки маны" diff --git a/locale/zhCN.lua b/locale/zhCN.lua index eb4304d..d610683 100644 --- a/locale/zhCN.lua +++ b/locale/zhCN.lua @@ -85,6 +85,7 @@ L["Lock"] = "锁定" L["Lock all bars."] = "锁定所有动作条。" L["Lock the buttons."] = "锁定动作条按钮。" L["Micro Menu"] = "微型主菜单" +-- L["Minimap Icon"] = true L["Modifier Based Switching"] = "修改基本切换" L["No Display"] = "不显示" -- L["None"] = true @@ -107,6 +108,7 @@ L["Scale"] = "缩放" -- L["Select the Self-Cast Modifier"] = true -- L["Self-Cast Modifier"] = true L["Self-Cast by modifier"] = "自我施法" +-- L["Show a Icon to open the config at the Minimap"] = true L["Show the MicroMenu vertically."] = "显示垂直的微型菜单." L["Show the keyring button."] = "显示钥匙链" L["Specify the Color of the Out of Mana Indicator"] = "设置法力不足的标识颜色" diff --git a/locale/zhTW.lua b/locale/zhTW.lua index 3096070..86240cd 100644 --- a/locale/zhTW.lua +++ b/locale/zhTW.lua @@ -85,6 +85,7 @@ L["Lock"] = "鎖定" L["Lock all bars."] = "鎖定所有動作列" L["Lock the buttons."] = "鎖定按鈕" L["Micro Menu"] = "微型選單" +-- L["Minimap Icon"] = true L["Modifier Based Switching"] = "修改基本切換" L["No Display"] = "不顯示" -- L["None"] = true @@ -107,6 +108,7 @@ L["Scale"] = "大小" -- L["Select the Self-Cast Modifier"] = true -- L["Self-Cast Modifier"] = true L["Self-Cast by modifier"] = "自我施法" +-- L["Show a Icon to open the config at the Minimap"] = true -- L["Show the MicroMenu vertically."] = true L["Show the keyring button."] = "顯示鑰匙圈按鈕" L["Specify the Color of the Out of Mana Indicator"] = "指定法力不足提示的顏色"