Skip to content

Commit

Permalink
fix backdrops not showing due to Shadowlands changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pewpewkatchu committed Oct 17, 2020
1 parent ea4519d commit 0f7611b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 32 deletions.
35 changes: 4 additions & 31 deletions UI.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
<Ui>
<Script file="main.lua"/>
<Frame name="MainFrame" toplevel="true" parent="UIParent" frameStrata="DIALOG" enableMouse="true" movable="true" hidden="true">
<Frame name="MainFrame" toplevel="true" parent="UIParent" frameStrata="DIALOG" enableMouse="true" movable="true" hidden="true" inherits="BackdropTemplate">
<Scripts>
<OnLoad>self:RegisterForDrag("LeftButton");</OnLoad>
<OnDragStart>self:StartMoving();</OnDragStart>
<OnDragStop>self:StopMovingOrSizing();</OnDragStop>
</Scripts>

<Anchors><Anchor point="CENTER"/></Anchors>

<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background"
edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize><AbsValue val="32"/></TileSize>
<EdgeSize><AbsValue val="32"/></EdgeSize>
</Backdrop>


<Layers>
<!-- Window Header -->
<Layer level="ARTWORK">
Expand Down Expand Up @@ -80,7 +71,7 @@
</Frames>
</Frame>

<Frame name="OptionsFrame" toplevel="true" parent="UIParent" frameStrata="DIALOG" enableMouse="true" movable="true" hidden="true">
<Frame name="OptionsFrame" toplevel="true" parent="UIParent" frameStrata="DIALOG" enableMouse="true" movable="true" hidden="true" inherits="BackdropTemplate">
<Scripts>
<OnLoad>self:RegisterForDrag("LeftButton");</OnLoad>
<OnDragStart>self:StartMoving();</OnDragStart>
Expand All @@ -91,15 +82,6 @@

<Anchors><Anchor point="CENTER"/></Anchors>

<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background"
edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize><AbsValue val="32"/></TileSize>
<EdgeSize><AbsValue val="32"/></EdgeSize>
</Backdrop>

<Layers>
<!-- Window Header -->
<Layer level="ARTWORK">
Expand Down Expand Up @@ -138,7 +120,7 @@
</Frames>
</Frame>

<Frame name="LeaderboardFrame" toplevel="true" parent="UIParent" frameStrata="DIALOG" enableMouse="true" movable="true" hidden="true">
<Frame name="LeaderboardFrame" toplevel="true" parent="UIParent" frameStrata="DIALOG" enableMouse="true" movable="true" hidden="true" inherits="BackdropTemplate">
<Scripts>
<OnLoad>self:RegisterForDrag("LeftButton");</OnLoad>
<OnDragStart>self:StartMoving();</OnDragStart>
Expand All @@ -147,15 +129,6 @@

<Anchors><Anchor point="CENTER"/></Anchors>

<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background"
edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize><AbsValue val="32"/></TileSize>
<EdgeSize><AbsValue val="32"/></EdgeSize>
</Backdrop>

<Layers>
<!-- Window Header -->
<Layer level="ARTWORK">
Expand Down
24 changes: 23 additions & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,28 @@ function setupMainUI()
if (mainUiCreated) then
return
end
--Set backdrops here instead of in XML due to Shadowlands changes. See: https://github.com/Stanzilla/WoWUIBugs/wiki/9.0.1-Consolidated-UI-Changes#backdrop-system-changes
MainFrame:SetBackdrop({
bgFile = "Interface/DialogFrame/UI-DialogBox-Background",
edgeFile = "Interface/DialogFrame/UI-DialogBox-Border",
edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 },
})

OptionsFrame:SetBackdrop({
bgFile = "Interface/DialogFrame/UI-DialogBox-Background",
edgeFile = "Interface/DialogFrame/UI-DialogBox-Border",
edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 },
})

LeaderboardFrame:SetBackdrop({
bgFile = "Interface/DialogFrame/UI-DialogBox-Background",
edgeFile = "Interface/DialogFrame/UI-DialogBox-Border",
edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 },
})

--set up the frame for the buttons based on number of rows
local numSounds = #SOUND_TABLE
local numRows = 0
Expand All @@ -124,7 +146,7 @@ function setupMainUI()
else
numRows = math.floor(numSounds / BTNS_PER_ROW) + 1
end
MainFrame:SetSize(BTNS_PER_ROW * BTN_SIZE + OUTER_HORIZONTAL_SPACING * 2, numRows * BTN_SIZE + 77)
MainFrame:SetSize(BTNS_PER_ROW * BTN_SIZE + OUTER_HORIZONTAL_SPACING * 2, numRows * BTN_SIZE + 72)

--add a button for each item in the sound table
for i, sound in ipairs(SOUND_TABLE) do
Expand Down

0 comments on commit 0f7611b

Please sign in to comment.