Skip to content

Commit

Permalink
classic era fix for backdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
Taidtuskecyh authored and Taidtuskecyh committed Jun 15, 2021
1 parent 0e671e2 commit 006ae2d
Show file tree
Hide file tree
Showing 15 changed files with 559 additions and 128 deletions.
100 changes: 83 additions & 17 deletions CommunityDKP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,13 @@ function CommDKP:SortDKPTable(id, reset) -- reorganizes core.WorkingTable
end

function CommDKP:CreateMenu()
CommDKP.UIConfig = CreateFrame("Frame", "CommDKPConfig", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil) --UIPanelDialogueTemplate, ShadowOverlaySmallTemplate

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
CommDKP.UIConfig = CreateFrame("Frame", "CommDKPConfig", UIParent, "ShadowOverlaySmallTemplate")
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
CommDKP.UIConfig = CreateFrame("Frame", "CommDKPConfig", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil) --UIPanelDialogueTemplate, ShadowOverlaySmallTemplate
end

CommDKP.UIConfig:SetPoint("CENTER", UIParent, "CENTER", -250, 100);
CommDKP.UIConfig:SetSize(550, 590);
CommDKP.UIConfig:SetBackdrop({
Expand All @@ -248,9 +254,6 @@ function CommDKP:CreateMenu()
CommDKP.UIConfig:SetBackdropColor(0,0,0,0.8);
CommDKP.UIConfig:SetMovable(true);
CommDKP.UIConfig:EnableMouse(true);
--CommDKP.UIConfig:SetResizable(true);
--CommDKP.UIConfig:SetMaxResize(1400, 875)
--CommDKP.UIConfig:SetMinResize(1000, 590)
CommDKP.UIConfig:RegisterForDrag("LeftButton");
CommDKP.UIConfig:SetScript("OnDragStart", CommDKP.UIConfig.StartMoving);
CommDKP.UIConfig:SetScript("OnDragStop", CommDKP.UIConfig.StopMovingOrSizing);
Expand All @@ -262,18 +265,34 @@ function CommDKP:CreateMenu()
if core.BiddingWindow then core.BiddingWindow:SetFrameLevel(2) end
end)
-- Close Button
CommDKP.UIConfig.closeContainer = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil)

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
CommDKP.UIConfig.closeContainer = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig)
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
CommDKP.UIConfig.closeContainer = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil)
end

CommDKP.UIConfig.closeContainer:SetPoint("CENTER", CommDKP.UIConfig, "TOPRIGHT", -4, 0)
Mixin(CommDKP.UIConfig.closeContainer, BackdropTemplateMixin)

if WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
Mixin(CommDKP.UIConfig.closeContainer, BackdropTemplateMixin)
end

CommDKP.UIConfig.closeContainer:SetBackdrop({
bgFile = "Textures\\white.blp", tile = true,
edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 3,
});

CommDKP.UIConfig.closeContainer:SetBackdropColor(0,0,0,0.9)
CommDKP.UIConfig.closeContainer:SetBackdropBorderColor(1,1,1,0.2)
CommDKP.UIConfig.closeContainer:SetSize(28, 28)

CommDKP.UIConfig.closeBtn = CreateFrame("Button", nil, CommDKP.UIConfig, "UIPanelCloseButton", BackdropTemplateMixin and "BackdropTemplate" or nil)
if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
CommDKP.UIConfig.closeBtn = CreateFrame("Button", nil, CommDKP.UIConfig, "UIPanelCloseButton")
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
CommDKP.UIConfig.closeBtn = CreateFrame("Button", nil, CommDKP.UIConfig, "UIPanelCloseButton", BackdropTemplateMixin and "BackdropTemplate" or nil)
end

CommDKP.UIConfig.closeBtn:SetPoint("CENTER", CommDKP.UIConfig.closeContainer, "TOPRIGHT", -14, -14)
tinsert(UISpecialFrames, CommDKP.UIConfig:GetName()); -- Sets frame to close on "Escape"
---------------------------------------
Expand All @@ -285,10 +304,20 @@ function CommDKP:CreateMenu()
---------------------------------------
-- DKP Table Header and Sort Buttons
---------------------------------------
CommDKP.DKPTable_Headers = CreateFrame("Frame", "CommDKPDKPTableHeaders", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil)

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
CommDKP.DKPTable_Headers = CreateFrame("Frame", "CommDKPDKPTableHeaders", CommDKP.UIConfig)
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
CommDKP.DKPTable_Headers = CreateFrame("Frame", "CommDKPDKPTableHeaders", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil)
end

CommDKP.DKPTable_Headers:SetSize(500, 22)
CommDKP.DKPTable_Headers:SetPoint("BOTTOMLEFT", CommDKP.DKPTable, "TOPLEFT", 0, 1)
Mixin(CommDKP.DKPTable_Headers, BackdropTemplateMixin)

if WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
Mixin(CommDKP.DKPTable_Headers, BackdropTemplateMixin)
end

CommDKP.DKPTable_Headers:SetBackdrop({
bgFile = "Textures\\white.blp", tile = true,
edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 2,
Expand All @@ -299,9 +328,17 @@ function CommDKP:CreateMenu()
---------------------------------------
-- Sort Buttons
---------------------------------------
SortButtons.player = CreateFrame("Button", "$ParentSortButtonPlayer", CommDKP.DKPTable_Headers, BackdropTemplateMixin and "BackdropTemplate" or nil)
SortButtons.class = CreateFrame("Button", "$ParentSortButtonClass", CommDKP.DKPTable_Headers, BackdropTemplateMixin and "BackdropTemplate" or nil)
SortButtons.dkp = CreateFrame("Button", "$ParentSortButtonDkp", CommDKP.DKPTable_Headers, BackdropTemplateMixin and "BackdropTemplate" or nil)

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
SortButtons.player = CreateFrame("Button", "$ParentSortButtonPlayer", CommDKP.DKPTable_Headers)
SortButtons.class = CreateFrame("Button", "$ParentSortButtonClass", CommDKP.DKPTable_Headers)
SortButtons.dkp = CreateFrame("Button", "$ParentSortButtonDkp", CommDKP.DKPTable_Headers)
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
SortButtons.player = CreateFrame("Button", "$ParentSortButtonPlayer", CommDKP.DKPTable_Headers, BackdropTemplateMixin and "BackdropTemplate" or nil)
SortButtons.class = CreateFrame("Button", "$ParentSortButtonClass", CommDKP.DKPTable_Headers, BackdropTemplateMixin and "BackdropTemplate" or nil)
SortButtons.dkp = CreateFrame("Button", "$ParentSortButtonDkp", CommDKP.DKPTable_Headers, BackdropTemplateMixin and "BackdropTemplate" or nil)
end

SortButtons.class:SetPoint("BOTTOM", CommDKP.DKPTable_Headers, "BOTTOM", 0, 2)
SortButtons.player:SetPoint("RIGHT", SortButtons.class, "LEFT")
SortButtons.dkp:SetPoint("LEFT", SortButtons.class, "RIGHT")
Expand Down Expand Up @@ -396,7 +433,13 @@ function CommDKP:CreateMenu()
------------------------------
-- Search Box
------------------------------
CommDKP.UIConfig.search = CreateFrame("EditBox", nil, CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil)

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
CommDKP.UIConfig.search = CreateFrame("EditBox", nil, CommDKP.UIConfig)
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
CommDKP.UIConfig.search = CreateFrame("EditBox", nil, CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil)
end

CommDKP.UIConfig.search:SetPoint("BOTTOMLEFT", CommDKP.UIConfig, "BOTTOMLEFT", 50, 18)
CommDKP.UIConfig.search:SetAutoFocus(false)
CommDKP.UIConfig.search:SetMultiLine(false)
Expand Down Expand Up @@ -536,7 +579,13 @@ function CommDKP:CreateMenu()
---------------------------------------
-- Expand / Collapse Arrow
---------------------------------------
CommDKP.UIConfig.expand = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil)

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
CommDKP.UIConfig.expand = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig)
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
CommDKP.UIConfig.expand = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil)
end

CommDKP.UIConfig.expand:SetPoint("LEFT", CommDKP.UIConfig, "RIGHT", 0, 0)
CommDKP.UIConfig.expand:SetBackdrop({
bgFile = "Textures\\white.blp", tile = true,
Expand Down Expand Up @@ -568,7 +617,13 @@ function CommDKP:CreateMenu()
end)

-- Title Frame (top/center)
CommDKP.UIConfig.TitleBar = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil)

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
CommDKP.UIConfig.TitleBar = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, "ShadowOverlaySmallTemplate")
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
CommDKP.UIConfig.TitleBar = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil)
end

CommDKP.UIConfig.TitleBar:SetPoint("BOTTOM", SortButtons.class, "TOP", 0, 10)
CommDKP.UIConfig.TitleBar:SetBackdrop({
bgFile = "Textures\\white.blp", tile = true,
Expand All @@ -587,7 +642,12 @@ function CommDKP:CreateMenu()
-- CHANGE LOG WINDOW
---------------------------------------
if core.DB.defaults.HideChangeLogs < core.BuildNumber then
CommDKP.ChangeLogDisplay = CreateFrame("Frame", "CommDKP_ChangeLogDisplay", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil);

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
CommDKP.ChangeLogDisplay = CreateFrame("Frame", "CommDKP_ChangeLogDisplay", UIParent, "ShadowOverlaySmallTemplate");
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
CommDKP.ChangeLogDisplay = CreateFrame("Frame", "CommDKP_ChangeLogDisplay", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil);
end

CommDKP.ChangeLogDisplay:SetPoint("TOP", UIParent, "TOP", 0, -200);
CommDKP.ChangeLogDisplay:SetSize(600, 100);
Expand Down Expand Up @@ -632,7 +692,13 @@ function CommDKP:CreateMenu()
CommDKP.ChangeLogDisplay.ChangeLogText:SetPoint("TOPLEFT", CommDKP.ChangeLogDisplay.VerNumber, "BOTTOMLEFT", 5, -0);

-- Change Log Close Button
CommDKP.ChangeLogDisplay.closeContainer = CreateFrame("Frame", "CommDKPChangeLogClose", CommDKP.ChangeLogDisplay, BackdropTemplateMixin and "BackdropTemplate" or nil)

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
CommDKP.ChangeLogDisplay.closeContainer = CreateFrame("Frame", "CommDKPChangeLogClose", CommDKP.ChangeLogDisplay)
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
CommDKP.ChangeLogDisplay.closeContainer = CreateFrame("Frame", "CommDKPChangeLogClose", CommDKP.ChangeLogDisplay, BackdropTemplateMixin and "BackdropTemplate" or nil)
end

CommDKP.ChangeLogDisplay.closeContainer:SetPoint("CENTER", CommDKP.ChangeLogDisplay, "TOPRIGHT", -4, 0)
CommDKP.ChangeLogDisplay.closeContainer:SetBackdrop({
bgFile = "Textures\\white.blp", tile = true,
Expand Down
20 changes: 14 additions & 6 deletions ConfigMenuTabs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ function CommDKP:ConfigMenuTabs()
---------------------------------------
-- TabMenu
---------------------------------------
CommDKP.UIConfig.TabMenu = CreateFrame("Frame", "CommDKPCommDKP.ConfigTabMenu", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil);

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
CommDKP.UIConfig.TabMenu = CreateFrame("Frame", "CommDKPCommDKP.ConfigTabMenu", CommDKP.UIConfig);
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
CommDKP.UIConfig.TabMenu = CreateFrame("Frame", "CommDKPCommDKP.ConfigTabMenu", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil);
end

CommDKP.UIConfig.TabMenu:SetPoint("TOPRIGHT", CommDKP.UIConfig, "TOPRIGHT", -25, -25); --Moves the entire tabframe (defaults -25, -25)
CommDKP.UIConfig.TabMenu:SetSize(535, 510); --default: 477,510
CommDKP.UIConfig.TabMenu:SetBackdrop( {
Expand All @@ -146,12 +152,14 @@ function CommDKP:ConfigMenuTabs()
CommDKP.UIConfig.TabMenu.ScrollFrame:SetClipsChildren(false);
CommDKP.UIConfig.TabMenu.ScrollFrame:SetScript("OnMouseWheel", ScrollFrame_OnMouseWheel);

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
-- CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar = CreateFrame("Slider", nil, CommDKP.UIConfig.TabMenu.ScrollFrame, "UIPanelScrollFrameTemplate")
-- CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar:Hide();
-- CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar:ClearAllPoints();
-- CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar:SetPoint("TOPLEFT", CommDKP.UIConfig.TabMenu.ScrollFrame, "TOPRIGHT", -20, -12);
-- CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar:SetPoint("BOTTOMRIGHT", CommDKP.UIConfig.TabMenu.ScrollFrame, "BOTTOMRIGHT", -2, 15);
end

--CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar = CreateFrame("Slider", nil, CommDKP.UIConfig.TabMenu.ScrollFrame, "UIPanelScrollFrameTemplate")
--CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar:Hide();
--CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar:ClearAllPoints();
--CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar:SetPoint("TOPLEFT", CommDKP.UIConfig.TabMenu.ScrollFrame, "TOPRIGHT", -20, -12);
--CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar:SetPoint("BOTTOMRIGHT", CommDKP.UIConfig.TabMenu.ScrollFrame, "BOTTOMRIGHT", -2, 15);

CommDKP.ConfigTab1, CommDKP.ConfigTab2, CommDKP.ConfigTab3, CommDKP.ConfigTab4, CommDKP.ConfigTab5, CommDKP.ConfigTab6, CommDKP.ConfigTab7 = CommDKP:SetTabs(CommDKP.UIConfig.TabMenu, 7, 533, 490, L["FILTERS"], L["ADJUSTDKP"], L["MANAGE"], L["OPTIONS"], L["LOOTHISTORY"], L["DKPHISTORY"], L["PRICETAB"]);

Expand Down
16 changes: 14 additions & 2 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -505,15 +505,27 @@ function CommDKP:BroadcastTimer(seconds, ...) -- broadcasts timer and star
end

function CommDKP:CreateContainer(parent, name, header)
local f = CreateFrame("Frame", "CommDKP"..name, parent, BackdropTemplateMixin and "BackdropTemplate" or nil);

if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
local f = CreateFrame("Frame", "CommDKP"..name, parent);
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
local f = CreateFrame("Frame", "CommDKP"..name, parent, BackdropTemplateMixin and "BackdropTemplate" or nil);
end


f:SetBackdrop( {
edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 2,
insets = { left = 0, right = 0, top = 0, bottom = 0 }
});
f:SetBackdropColor(0,0,0,0.9);
f:SetBackdropBorderColor(1,1,1,0.5)

f.header = CreateFrame("Frame", "CommDKP"..name.."Header", f, BackdropTemplateMixin and "BackdropTemplate" or nil)
if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
f.header = CreateFrame("Frame", "CommDKP"..name.."Header", f)
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
f.header = CreateFrame("Frame", "CommDKP"..name.."Header", f, BackdropTemplateMixin and "BackdropTemplate" or nil)
end

f.header:SetBackdrop( {
bgFile = "Textures\\white.blp", tile = true, -- White backdrop allows for black background with 1.0 alpha on low alpha containers
insets = { left = 0, right = 0, top = 0, bottom = 0 }
Expand Down
Loading

0 comments on commit 006ae2d

Please sign in to comment.