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