Skip to content

Commit

Permalink
BugFix for GameMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Aug 12, 2024
1 parent 15b9c09 commit bbe4459
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Core/Skins/Blizzard/Base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ local function OnEnable()
if not SUI.Skins.DB.Blizzard.GameMenu then SUI.Skins.DB.Blizzard.GameMenu = {} end
if not SUI.Skins.DB.Blizzard.GameMenu.Scale then SUI.Skins.DB.Blizzard.GameMenu.Scale = 0.8 end

if SUI:IsAddonDisabled('Skinner') and SUI:IsAddonDisabled('ConsolePort') then
GameMenuFrame:SetScale(SUI.Skins.DB.Blizzard.GameMenu.Scale)
else
if SUI:IsAddonEnabled('Skinner') or SUI:IsAddonEnabled('ConsolePort') then
if GameMenuFrame.SUI then return end

local button = CreateFrame('Button', 'SUI_GameMenuButton', GameMenuFrame, 'MainMenuFrameButtonTemplate')
Expand Down
4 changes: 3 additions & 1 deletion Core/Skins/Blizzard/GameMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function SUIGameMenu:IsDisabled()
end

function SUIGameMenu:OnEnable()
if SUIGameMenu:IsDisabled() then return end
-- Set up hooks
GameMenuFrame:HookScript('OnShow', function()
if SUIGameMenu:IsDisabled() then return end
Expand All @@ -70,6 +71,7 @@ function SUIGameMenu:OnEnable()
MenuSkin.BottomLine:SetAlpha(0.5)

hooksecurefunc(GameMenuFrame, 'Layout', function()
if SUIGameMenu:IsDisabled() then return end
MenuSkin:OnFrameShown(GameMenuFrame:IsShown())
end)
end
Expand Down Expand Up @@ -198,7 +200,7 @@ end

function MenuSkin:OnFrameShown(showMenu)
if showMenu then
GameMenuFrame:SetScale(SUI.Skins.DB.Blizzard.GameMenu.Scale)
GameMenuFrame:SetScale(SUI.Skins.DB.Blizzard.GameMenu.Scale or 0.8)
self:ResetAnimation()
self:OnDataLoaded()
self:InterpolatePoints(GameMenuFrame)
Expand Down
5 changes: 5 additions & 0 deletions Core/Skins/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ local module = SUI:NewModule('Handler.Skins')

---@class SkinDB
local DBDefaults = {
Blizzard = {
GameMenu = {
Scale = 0.8,
},
},
components = {
['**'] = {
enabled = true,
Expand Down

0 comments on commit bbe4459

Please sign in to comment.