Add a minimap icon using LibDBIcon-1.0

This commit is contained in:
Hendrik Leppkes
2008-10-30 11:50:06 +01:00
parent 9fdc622450
commit 925ba03aaf
11 changed files with 47 additions and 4 deletions
+17 -3
View File
@@ -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
+12 -1
View File
@@ -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"],
+2
View File
@@ -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
+2
View File
@@ -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
+2
View File
@@ -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
+2
View File
@@ -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
+2
View File
@@ -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."
+2
View File
@@ -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"] = "마나 부족 지시기의 색상을 지정합니다."
+2
View File
@@ -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"] = "Выберите цвет для индикации нехватки маны"
+2
View File
@@ -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"] = "设置法力不足的标识颜色"
+2
View File
@@ -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"] = "指定法力不足提示的顏色"