Skip to content

Commit

Permalink
Merge pull request #89 from MotherGinger/patch-1
Browse files Browse the repository at this point in the history
Fix #87 - Add backdrop mixin to GameTooltip
  • Loading branch information
cdmichaelb authored Jan 20, 2022
2 parents e6bfc1a + 5c76a14 commit 1b83c9b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
22 changes: 16 additions & 6 deletions Libraries/LibDropdown-1.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,25 @@ end

-- Make the frame match the tooltip
local function InitializeFrame(frame)
-- local backdrop = GameTooltip:GetBackdrop()
local backdrop = GameTooltip.NineSlice:GetBackdrop()
if not GameTooltip.GetBackdrop then
Mixin(GameTooltip, BackdropTemplateMixin)
end

if GameTooltip.NineSlice.GetBackdrop then
local backdrop = GameTooltip.NineSlice:GetBackdrop()

frame:SetBackdrop(backdrop)
frame:SetBackdrop(backdrop)

if backdrop then
frame:SetBackdropColor(GameTooltip:GetBackdropColor())
frame:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor())
if backdrop then
frame:SetBackdropColor(GameTooltip.NineSlice:GetBackdropColor())
frame:SetBackdropBorderColor(GameTooltip.NineSlice:GetBackdropBorderColor())
end
else
-- If we don't have a backdrop to mimic from the tooltip, use a sane default
-- BACKDROP_DARK_DIALOG_32_32 is a blizzard backdrop global
frame:SetBackdrop(BACKDROP_DARK_DIALOG_32_32)
end

frame:SetScale(GameTooltip:GetScale())
end

Expand Down
10 changes: 10 additions & 0 deletions OutfitterBar.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
-- Global Backdrops
BACKDROP_OUTFITTER_DIALOG_32_32 = {
bgFile = "Interface\\Addons\\Outfitter\\Textures\\DialogBox-Background",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
tile = true,
tileSize = 32,
edgeSize = 32,
insets = { left = 11, right = 12, top = 12, bottom = 11 },
}

----------------------------------------
Outfitter.OutfitBar = {}
----------------------------------------
Expand Down
16 changes: 4 additions & 12 deletions OutfitterBar.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">

<Frame name="OutfitterDialogFrameTemplate" setAllPoints="true" virtual="true">
<Backdrop bgFile="Interface\Addons\Outfitter\Textures\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>
<Frame name="OutfitterDialogFrameTemplate" setAllPoints="true" virtual="true" inherits="BackdropTemplate" inherit="prepend">
<KeyValues>
<KeyValue key="backdropInfo" value="BACKDROP_OUTFITTER_DIALOG_32_32" type="global"/>
</KeyValues>
<Scripts>
<OnShow>
self:SetFrameLevel(self:GetParent():GetFrameLevel())
Expand Down

0 comments on commit 1b83c9b

Please sign in to comment.