diff --git a/Bar.lua b/Bar.lua index ea1ca25..c358650 100644 --- a/Bar.lua +++ b/Bar.lua @@ -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 diff --git a/Options/Bar.lua b/Options/Bar.lua index baa665b..9191a15 100644 --- a/Options/Bar.lua +++ b/Options/Bar.lua @@ -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 = { diff --git a/RepXPBar.lua b/RepXPBar.lua index 92a8693..089de8b 100644 --- a/RepXPBar.lua +++ b/RepXPBar.lua @@ -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 diff --git a/locale/deDE.lua b/locale/deDE.lua index 636d0c1..b248a92 100644 --- a/locale/deDE.lua +++ b/locale/deDE.lua @@ -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 diff --git a/locale/enUS.lua b/locale/enUS.lua index 17322c0..5629f08 100644 --- a/locale/enUS.lua +++ b/locale/enUS.lua @@ -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 diff --git a/locale/esES.lua b/locale/esES.lua index 709762b..93923fd 100644 --- a/locale/esES.lua +++ b/locale/esES.lua @@ -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 diff --git a/locale/esMX.lua b/locale/esMX.lua index cc17893..4ed9c2f 100644 --- a/locale/esMX.lua +++ b/locale/esMX.lua @@ -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 diff --git a/locale/frFR.lua b/locale/frFR.lua index bb2598c..725e9bb 100644 --- a/locale/frFR.lua +++ b/locale/frFR.lua @@ -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 diff --git a/locale/koKR.lua b/locale/koKR.lua index 444dc85..b3135c7 100644 --- a/locale/koKR.lua +++ b/locale/koKR.lua @@ -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"] = "변경하지 않음" diff --git a/locale/ruRU.lua b/locale/ruRU.lua index 091b89f..e0abbfe 100644 --- a/locale/ruRU.lua +++ b/locale/ruRU.lua @@ -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"] = "Не страница" diff --git a/locale/zhCN.lua b/locale/zhCN.lua index e268fd2..be0e3e5 100644 --- a/locale/zhCN.lua +++ b/locale/zhCN.lua @@ -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"] = "不翻页" diff --git a/locale/zhTW.lua b/locale/zhTW.lua index 1d2518d..8fcbbd1 100644 --- a/locale/zhTW.lua +++ b/locale/zhTW.lua @@ -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"] = "不轉換"