Added click-through plumbing and click-through support to Rep/XP Bars

This commit is contained in:
Hendrik Leppkes
2009-01-20 13:10:51 +01:00
parent 6d9c184d97
commit ef9968ce8e
12 changed files with 59 additions and 2 deletions
+14
View File
@@ -178,6 +178,7 @@ function Bar:ApplyConfig(config)
self:LoadPosition()
self:SetConfigScale()
self:SetConfigAlpha()
self:SetClickThrough()
self:InitVisibilityDriver()
end
@@ -252,6 +253,19 @@ function Bar:SetConfigScale(scale)
self:LoadPosition()
end
function Bar:GetClickThrough()
return self.config.clickthrough
end
function Bar:SetClickThrough(click)
if click ~= nil then
self.config.clickthrough = click
end
if self.ControlClickThrough then
self:ControlClickThrough()
end
end
function Bar:GetFadeOut()
return self.config.fadeout
end
+17 -1
View File
@@ -8,7 +8,7 @@ local Bar = Bartender4.Bar.prototype
local barregistry = Bartender4.Bar.barregistry
-- option utilty functions
local optGetter, optSetter, visibilityGetter, visibilitySetter, customEnabled, customDisabled, customCopy
local optGetter, optSetter, visibilityGetter, visibilitySetter, customEnabled, customDisabled, customCopy, clickThroughVis
do
local getBar, optionMap, callFunc
-- maps option keys to function names
@@ -18,6 +18,7 @@ do
fadeout = "FadeOut",
fadeoutalpha = "FadeOutAlpha",
fadeoutdelay = "FadeOutDelay",
clickthrough = "ClickThrough",
}
-- retrieves a valid bar object from the barregistry table
@@ -74,6 +75,11 @@ do
local bar = getBar(info[2])
bar:CopyCustomConditionals()
end
function clickThroughVis(info)
local bar = getBar(info[2])
return (not bar.ClickThroughSupport)
end
end
local _, class = UnitClass("player")
@@ -124,6 +130,16 @@ function Bar:GetOptionObject()
get = optGetter,
set = optSetter,
},
clickthrough = {
order = 200,
name = L["Click-Through"],
desc = L["Disable any reaction to mouse events on this bar, making the bar click-through."],
type = "toggle",
get = optGetter,
set = optSetter,
hidden = clickThroughVis,
width = "full",
},
},
},
visibility = {
+10 -1
View File
@@ -58,6 +58,12 @@ function RepBar:PerformLayout()
bar:SetPoint("TOPLEFT", self, "TOPLEFT", 5, -3)
end
RepBar.ClickThroughSupport = true
function RepBar:ControlClickThrough()
self.content:EnableMouse(not self.config.clickthrough)
end
-- register module
local XPBarMod = Bartender4:NewModule("XPBar")
@@ -72,7 +78,7 @@ end
function XPBarMod:OnEnable()
if not self.bar then
self.bar = setmetatable(Bartender4.Bar:Create("XP", self.db.profile, L["XP Bar"]), {__index = XPBar})
self.bar.content= MainMenuExpBar
self.bar.content = MainMenuExpBar
self.bar.content:SetParent(self.bar)
self.bar.content:Show()
@@ -86,3 +92,6 @@ end
XPBarMod.ApplyConfig = RepBarMod.ApplyConfig
XPBar.ApplyConfig = RepBar.ApplyConfig
XPBar.PerformLayout = RepBar.PerformLayout
XPBar.ClickThroughSupport = true
XPBar.ControlClickThrough = RepBar.ControlClickThrough
+2
View File
@@ -23,6 +23,7 @@ if not L then return end
-- L["Button Tooltip"] = true
-- L["Buttons"] = true
-- L["CTRL"] = true
-- L["Click-Through"] = true
-- L["Colors"] = true
-- L["Configure the Stance Bar"] = true
-- L["Configure Bar %s"] = true
@@ -44,6 +45,7 @@ if not L then return end
-- L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."] = true
-- L["Custom Conditionals"] = true
-- L["Default Bar State"] = true
-- L["Disable any reaction to mouse events on this bar, making the bar click-through."] = true
-- L["Disabled"] = true
-- L["Disabled in Combat"] = true
-- L["Don't Page"] = true
+2
View File
@@ -23,6 +23,7 @@ L["Button Look"] = true
L["Button Tooltip"] = true
L["Buttons"] = true
L["CTRL"] = true
L["Click-Through"] = true
L["Colors"] = true
L["Configure the Stance Bar"] = true
L["Configure Bar %s"] = true
@@ -44,6 +45,7 @@ L["Copy Conditionals"] = true
L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."] = true
L["Custom Conditionals"] = true
L["Default Bar State"] = true
L["Disable any reaction to mouse events on this bar, making the bar click-through."] = true
L["Disabled"] = true
L["Disabled in Combat"] = true
L["Don't Page"] = true
+2
View File
@@ -23,6 +23,7 @@ if not L then return end
-- L["Button Tooltip"] = true
-- L["Buttons"] = true
-- L["CTRL"] = true
-- L["Click-Through"] = true
-- L["Colors"] = true
-- L["Configure the Stance Bar"] = true
-- L["Configure Bar %s"] = true
@@ -44,6 +45,7 @@ if not L then return end
-- L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."] = true
-- L["Custom Conditionals"] = true
-- L["Default Bar State"] = true
-- L["Disable any reaction to mouse events on this bar, making the bar click-through."] = true
-- L["Disabled"] = true
-- L["Disabled in Combat"] = true
-- L["Don't Page"] = true
+2
View File
@@ -23,6 +23,7 @@ if not L then return end
-- L["Button Tooltip"] = true
-- L["Buttons"] = true
-- L["CTRL"] = true
-- L["Click-Through"] = true
-- L["Colors"] = true
-- L["Configure the Stance Bar"] = true
-- L["Configure Bar %s"] = true
@@ -44,6 +45,7 @@ if not L then return end
-- L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."] = true
-- L["Custom Conditionals"] = true
-- L["Default Bar State"] = true
-- L["Disable any reaction to mouse events on this bar, making the bar click-through."] = true
-- L["Disabled"] = true
-- L["Disabled in Combat"] = true
-- L["Don't Page"] = true
+2
View File
@@ -23,6 +23,7 @@ L["Button Look"] = "Look des boutons"
L["Button Tooltip"] = "Bulle d'aide des boutons"
L["Buttons"] = "Boutons"
L["CTRL"] = "CTRL"
-- L["Click-Through"] = true
L["Colors"] = "Couleurs"
L["Configure the Stance Bar"] = "Configure la barre des postures."
L["Configure Bar %s"] = "Configure la %s|4ère:ème; barre."
@@ -44,6 +45,7 @@ L["Copy Conditionals"] = "Copie conditionnelles"
L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."] = "Créée une copie des conditionnelles auto-générées comme template de base pour la configuration personnalisée."
L["Custom Conditionals"] = "Conditionnelles personnalisées"
L["Default Bar State"] = "État par défaut de la barre"
-- L["Disable any reaction to mouse events on this bar, making the bar click-through."] = true
L["Disabled"] = "Désactivée"
L["Disabled in Combat"] = "Désactivée en combat"
-- L["Don't Page"] = true
+2
View File
@@ -23,6 +23,7 @@ L["Button Look"] = "버튼 표시"
L["Button Tooltip"] = "버튼 툴팁"
L["Buttons"] = "버튼"
L["CTRL"] = "CTRL"
-- L["Click-Through"] = true
L["Colors"] = "색상"
L["Configure the Stance Bar"] = "태세 바 설정"
L["Configure Bar %s"] = "바 %s 설정"
@@ -44,6 +45,7 @@ L["Copy Conditionals"] = "조건 복사"
L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."] = "사용자 설정 기반의 자동으로 생성된 조건을 복사하여 생성합니다."
L["Custom Conditionals"] = "사용자 조건 설정"
L["Default Bar State"] = "기본 상태"
-- L["Disable any reaction to mouse events on this bar, making the bar click-through."] = true
L["Disabled"] = "사용하지 않음"
L["Disabled in Combat"] = "전투중 숨김"
L["Don't Page"] = "변경하지 않음"
+2
View File
@@ -23,6 +23,7 @@ L["Button Look"] = "Вид кнопок"
L["Button Tooltip"] = "Подсказка кнопок"
L["Buttons"] = "Количество кнопок"
L["CTRL"] = "CTRL"
-- L["Click-Through"] = true
L["Colors"] = "Цвета"
L["Configure the Stance Bar"] = "Настройка панели стоек"
L["Configure Bar %s"] = "Настройка панели %s"
@@ -44,6 +45,7 @@ L["Copy Conditionals"] = "Копирование условий"
-- L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."] = true
L["Custom Conditionals"] = "Своё условие"
L["Default Bar State"] = "Состояние по-умолчанию"
-- L["Disable any reaction to mouse events on this bar, making the bar click-through."] = true
L["Disabled"] = "Отключено"
L["Disabled in Combat"] = "Отключать в бою"
L["Don't Page"] = "Не страница"
+2
View File
@@ -23,6 +23,7 @@ L["Button Look"] = "按钮外观"
L["Button Tooltip"] = "按钮鼠标提示"
L["Buttons"] = "按钮"
L["CTRL"] = "按下 CTRL"
-- L["Click-Through"] = true
L["Colors"] = "颜色设置"
L["Configure the Stance Bar"] = "配置姿态栏"
L["Configure Bar %s"] = "设置动作条 %s"
@@ -44,6 +45,7 @@ L["Copy Conditionals"] = "复制条件"
L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."] = "在自定义配置中复制一个条件作为模板。"
L["Custom Conditionals"] = "自定义条件"
L["Default Bar State"] = "默认动作条状态"
-- L["Disable any reaction to mouse events on this bar, making the bar click-through."] = true
L["Disabled"] = "禁用"
L["Disabled in Combat"] = "战斗中关闭"
L["Don't Page"] = "不翻页"
+2
View File
@@ -23,6 +23,7 @@ L["Button Look"] = "按鈕外觀"
L["Button Tooltip"] = "按鈕說明提示"
L["Buttons"] = "按鈕"
L["CTRL"] = "CTRL"
-- L["Click-Through"] = true
L["Colors"] = "顏色"
L["Configure the Stance Bar"] = "設定姿勢列"
L["Configure Bar %s"] = "設定動作條 %s"
@@ -44,6 +45,7 @@ L["Copy Conditionals"] = "條件複製"
L["Create a copy of the auto-generated conditionals in the custom configuration as a base template."] = "複製一個自動生成條件的副本 定制配置為基礎的範本"
L["Custom Conditionals"] = "自訂條件"
L["Default Bar State"] = "預設動作條狀態"
-- L["Disable any reaction to mouse events on this bar, making the bar click-through."] = true
L["Disabled"] = "關閉"
L["Disabled in Combat"] = "戰鬥中關閉"
L["Don't Page"] = "不轉換"