Skip to content

Commit

Permalink
[Bugfix] Potential fix for menu frame not showing up on russian client
Browse files Browse the repository at this point in the history
  • Loading branch information
Krealle committed Sep 8, 2024
1 parent 5a9ce0d commit f3a4ffa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
26 changes: 23 additions & 3 deletions Menu/Menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,29 @@ end
local function UpdatePreview()
--CUF:Log("Cell_UpdatePreview")
local layoutsTab = Util.findChildByName(Cell.frames.optionsFrame, "CellOptionsFrame_LayoutsTab")
if not layoutsTab then return end

if not layoutsTab then
if CUF.vars.testMode then
CUF:Print("UpdatePreview Unable to find layoutsTab")
end
return
end

local layoutPane = Util.findChildByName(layoutsTab, "Layout")
if not layoutPane then return end
if not layoutPane then
if CUF.vars.testMode then
CUF:Print("UpdatePreview Unable to find layoutPane")
end
return
end

local layoutDropdown = Util.findChildByProp(layoutPane, "items")
if not layoutDropdown then return end
if not layoutDropdown then
if CUF.vars.testMode then
CUF:Print("UpdatePreview Unable to find layoutDropdown")
end
return
end

hooksecurefunc(layoutDropdown, "SetSelectedValue", function(self)
--CUF:Log("Cell_SetSelectedValue", self:GetSelected())
Expand All @@ -317,6 +333,10 @@ end
---@param tab string
local function ShowTab(tab)
--CUF:Log("Cell_ShowTab", tab)
if CUF.vars.testMode then
CUF:Print("Cell_ShowTab", tab)
end

if tab ~= "layouts" then
menu:HideMenu()
elseif not menu.init then
Expand Down
5 changes: 3 additions & 2 deletions Util/Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local CUF = select(2, ...)
local Cell = CUF.Cell
local F = Cell.funcs
local DB = CUF.DB
local L = CUF.L

---@class CUF.Util
local Util = CUF.Util
Expand All @@ -20,7 +21,7 @@ function Util.findChildByName(frame, name)
---@cast child CellUnknowFrame
local childName = child:GetName() or (child.title and child.title:GetText()) or ""

if childName == name then
if childName == name or childName == L[name] then
return child
end
end
Expand All @@ -32,7 +33,7 @@ end
function Util.findChildByProp(frame, prop)
for _, child in pairs({ frame:GetChildren() }) do
---@cast child CellUnknowFrame
if child[prop] then
if child[prop] or child[L[prop]] then
return child
end
end
Expand Down

0 comments on commit f3a4ffa

Please sign in to comment.