diff --git a/CommunityDKP.lua b/CommunityDKP.lua index fb453b65..7479c759 100644 --- a/CommunityDKP.lua +++ b/CommunityDKP.lua @@ -22,7 +22,7 @@ function CommDKP_RestoreFilterOptions() -- restores default filter selections end function CommDKP:Toggle() -- toggles IsShown() state of CommDKP.UIConfig, the entire addon window - core.CommDKPUI = CommDKP.UIConfig or CommDKP:CreateMenu(); + core.CommDKPUI = core.CommDKPUI or CommDKP:CreateMenu(); core.CommDKPUI:SetShown(not core.CommDKPUI:IsShown()) CommDKP.UIConfig:SetFrameLevel(10) CommDKP.UIConfig:SetClampedToScreen(true) @@ -238,8 +238,7 @@ function CommDKP:SortDKPTable(id, reset) -- reorganizes core.WorkingTable end function CommDKP:CreateMenu() - - CommDKP.UIConfig = CreateFrame("Frame", "CommDKPConfig", UIParent, "ShadowOverlaySmallTemplate") --UIPanelDialogueTemplate, ShadowOverlaySmallTemplate + CommDKP.UIConfig = CreateFrame("Frame", "CommDKPConfig", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil) --UIPanelDialogueTemplate, ShadowOverlaySmallTemplate CommDKP.UIConfig:SetPoint("CENTER", UIParent, "CENTER", -250, 100); CommDKP.UIConfig:SetSize(550, 590); CommDKP.UIConfig:SetBackdrop({ @@ -263,8 +262,9 @@ function CommDKP:CreateMenu() if core.BiddingWindow then core.BiddingWindow:SetFrameLevel(2) end end) -- Close Button - CommDKP.UIConfig.closeContainer = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig) + CommDKP.UIConfig.closeContainer = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.UIConfig.closeContainer:SetPoint("CENTER", CommDKP.UIConfig, "TOPRIGHT", -4, 0) + Mixin(CommDKP.UIConfig.closeContainer, BackdropTemplateMixin) CommDKP.UIConfig.closeContainer:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 3, @@ -273,7 +273,7 @@ function CommDKP:CreateMenu() CommDKP.UIConfig.closeContainer:SetBackdropBorderColor(1,1,1,0.2) CommDKP.UIConfig.closeContainer:SetSize(28, 28) - CommDKP.UIConfig.closeBtn = CreateFrame("Button", nil, CommDKP.UIConfig, "UIPanelCloseButton") + CommDKP.UIConfig.closeBtn = CreateFrame("Button", nil, CommDKP.UIConfig, "UIPanelCloseButton", BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.UIConfig.closeBtn:SetPoint("CENTER", CommDKP.UIConfig.closeContainer, "TOPRIGHT", -14, -14) tinsert(UISpecialFrames, CommDKP.UIConfig:GetName()); -- Sets frame to close on "Escape" --------------------------------------- @@ -285,9 +285,10 @@ function CommDKP:CreateMenu() --------------------------------------- -- DKP Table Header and Sort Buttons --------------------------------------- - CommDKP.DKPTable_Headers = CreateFrame("Frame", "CommDKPDKPTableHeaders", CommDKP.UIConfig) + CommDKP.DKPTable_Headers = CreateFrame("Frame", "CommDKPDKPTableHeaders", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.DKPTable_Headers:SetSize(500, 22) CommDKP.DKPTable_Headers:SetPoint("BOTTOMLEFT", CommDKP.DKPTable, "TOPLEFT", 0, 1) + Mixin(CommDKP.DKPTable_Headers, BackdropTemplateMixin) CommDKP.DKPTable_Headers:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 2, @@ -298,9 +299,9 @@ function CommDKP:CreateMenu() --------------------------------------- -- Sort Buttons --------------------------------------- - SortButtons.player = CreateFrame("Button", "$ParentSortButtonPlayer", CommDKP.DKPTable_Headers) - SortButtons.class = CreateFrame("Button", "$ParentSortButtonClass", CommDKP.DKPTable_Headers) - SortButtons.dkp = CreateFrame("Button", "$ParentSortButtonDkp", CommDKP.DKPTable_Headers) + 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) SortButtons.class:SetPoint("BOTTOM", CommDKP.DKPTable_Headers, "BOTTOM", 0, 2) SortButtons.player:SetPoint("RIGHT", SortButtons.class, "LEFT") SortButtons.dkp:SetPoint("LEFT", SortButtons.class, "RIGHT") @@ -395,7 +396,7 @@ function CommDKP:CreateMenu() ------------------------------ -- Search Box ------------------------------ - CommDKP.UIConfig.search = CreateFrame("EditBox", nil, CommDKP.UIConfig) + CommDKP.UIConfig.search = CreateFrame("EditBox", nil, CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.UIConfig.search:SetPoint("BOTTOMLEFT", CommDKP.UIConfig, "BOTTOMLEFT", 50, 18) CommDKP.UIConfig.search:SetAutoFocus(false) CommDKP.UIConfig.search:SetMultiLine(false) @@ -535,7 +536,7 @@ function CommDKP:CreateMenu() --------------------------------------- -- Expand / Collapse Arrow --------------------------------------- - CommDKP.UIConfig.expand = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig) + CommDKP.UIConfig.expand = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.UIConfig.expand:SetPoint("LEFT", CommDKP.UIConfig, "RIGHT", 0, 0) CommDKP.UIConfig.expand:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, @@ -567,7 +568,7 @@ function CommDKP:CreateMenu() end) -- Title Frame (top/center) - CommDKP.UIConfig.TitleBar = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, "ShadowOverlaySmallTemplate") + CommDKP.UIConfig.TitleBar = CreateFrame("Frame", "CommDKPTitle", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.UIConfig.TitleBar:SetPoint("BOTTOM", SortButtons.class, "TOP", 0, 10) CommDKP.UIConfig.TitleBar:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, @@ -586,7 +587,7 @@ function CommDKP:CreateMenu() -- CHANGE LOG WINDOW --------------------------------------- if core.DB.defaults.HideChangeLogs < core.BuildNumber then - CommDKP.ChangeLogDisplay = CreateFrame("Frame", "CommDKP_ChangeLogDisplay", UIParent, "ShadowOverlaySmallTemplate"); + CommDKP.ChangeLogDisplay = CreateFrame("Frame", "CommDKP_ChangeLogDisplay", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil); CommDKP.ChangeLogDisplay:SetPoint("TOP", UIParent, "TOP", 0, -200); CommDKP.ChangeLogDisplay:SetSize(600, 100); @@ -631,7 +632,7 @@ 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) + CommDKP.ChangeLogDisplay.closeContainer = CreateFrame("Frame", "CommDKPChangeLogClose", CommDKP.ChangeLogDisplay, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ChangeLogDisplay.closeContainer:SetPoint("CENTER", CommDKP.ChangeLogDisplay, "TOPRIGHT", -4, 0) CommDKP.ChangeLogDisplay.closeContainer:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, @@ -671,6 +672,7 @@ function CommDKP:CreateMenu() local logHeight = CommDKP.ChangeLogDisplay.ChangeLogHeader:GetHeight() + CommDKP.ChangeLogDisplay.Notes:GetHeight() + CommDKP.ChangeLogDisplay.VerNumber:GetHeight() + CommDKP.ChangeLogDisplay.ChangeLogText:GetHeight(); CommDKP.ChangeLogDisplay:SetSize(800, logHeight); -- resize container + end --------------------------------------- -- VERSION IDENTIFIER diff --git a/ConfigMenuTabs.lua b/ConfigMenuTabs.lua index 708b3792..302d7fec 100644 --- a/ConfigMenuTabs.lua +++ b/ConfigMenuTabs.lua @@ -122,7 +122,7 @@ function CommDKP:ConfigMenuTabs() --------------------------------------- -- TabMenu --------------------------------------- - CommDKP.UIConfig.TabMenu = CreateFrame("Frame", "CommDKPCommDKP.ConfigTabMenu", CommDKP.UIConfig); + CommDKP.UIConfig.TabMenu = CreateFrame("Frame", "CommDKPCommDKP.ConfigTabMenu", CommDKP.UIConfig, BackdropTemplateMixin and "BackdropTemplate" or nil); 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( { @@ -146,11 +146,12 @@ function CommDKP:ConfigMenuTabs() CommDKP.UIConfig.TabMenu.ScrollFrame:SetClipsChildren(false); CommDKP.UIConfig.TabMenu.ScrollFrame:SetScript("OnMouseWheel", ScrollFrame_OnMouseWheel); - CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar:Hide(); - CommDKP.UIConfig.TabMenu.ScrollFrame.ScrollBar = CreateFrame("Slider", nil, CommDKP.UIConfig.TabMenu.ScrollFrame, "UIPanelScrollBarTrimTemplate") - 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.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"]); diff --git a/Core.lua b/Core.lua index df13b520..e5e4bd55 100644 --- a/Core.lua +++ b/Core.lua @@ -246,6 +246,7 @@ function CommDKP:CheckOfficer() -- checks if user is an officer IF core.IsO if not core.InitStart then return end + if core.IsOfficer == nil then -- used as a redundency as it should be set on load in init.lua GUILD_ROSTER_UPDATE event if CommDKP:GetGuildRankIndex(UnitName("player")) == 1 then -- automatically gives permissions above all settings if player is guild leader core.IsOfficer = true @@ -269,6 +270,7 @@ function CommDKP:CheckOfficer() -- checks if user is an officer IF core.IsO core.IsOfficer = false; end end + end function CommDKP:GetGuildRankGroup(index) -- returns all members within a specific rank index as well as their index in the guild list (for use with GuildRosterSetPublicNote(index, "msg") and GuildRosterSetOfficerNote) @@ -436,7 +438,7 @@ function CommDKP:BroadcastTimer(seconds, ...) -- broadcasts timer and star end function CommDKP:CreateContainer(parent, name, header) - local f = CreateFrame("Frame", "CommDKP"..name, parent); + local f = CreateFrame("Frame", "CommDKP"..name, parent, BackdropTemplateMixin and "BackdropTemplate" or nil); 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 } @@ -444,7 +446,7 @@ function CommDKP:CreateContainer(parent, name, header) f:SetBackdropColor(0,0,0,0.9); f:SetBackdropBorderColor(1,1,1,0.5) - f.header = CreateFrame("Frame", "CommDKP"..name.."Header", f) + f.header = CreateFrame("Frame", "CommDKP"..name.."Header", f, BackdropTemplateMixin and "BackdropTemplate" or nil) 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 } diff --git a/Data/TableUpgrades.lua b/Data/TableUpgrades.lua index 153fbe47..0691293b 100644 --- a/Data/TableUpgrades.lua +++ b/Data/TableUpgrades.lua @@ -252,4 +252,4 @@ function CommDKP:RefactorMinBidItemTable(dbTable) end CommDKP:Print("Finished MinBid Table Upgrade!"); return newTable -end \ No newline at end of file +end diff --git a/Localization/Localization.cn.lua b/Localization/Localization.cn.lua index f2df6567..c7c23618 100644 --- a/Localization/Localization.cn.lua +++ b/Localization/Localization.cn.lua @@ -820,8 +820,8 @@ if GetLocale() == "zhCN" then MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.", --TODO TRANSLATE: --TODO TRANSLATE: - CHANGELOG1 = "CommunityDKP - v3.2.4-r62", - CHANGELOG2 = "fixed history display on mouseover", + CHANGELOG1 = "CommunityDKP - v3.2.5-r62", + CHANGELOG2 = " - Hopefully made this work in pre-patch", CHANGELOG3 = "", CHANGELOG4 = "", CHANGELOG5 = "", @@ -830,5 +830,5 @@ if GetLocale() == "zhCN" then CHANGELOG8 = "CommunityDKP Discord: https://discord.gg/dXXK4vH", CHANGELOG9 = "", CHANGELOG10 = "" - } + } end diff --git a/Localization/Localization.de.lua b/Localization/Localization.de.lua index 9337634c..a9ef567e 100644 --- a/Localization/Localization.de.lua +++ b/Localization/Localization.de.lua @@ -814,8 +814,8 @@ if GetLocale() == "deDE" then MIGRATIONCOMPLETED = "Migration abgeschlossen.|n|nBitte deaktivieren Sie MonolithDKP und laden Sie das UI neu. (/reload)", --TODO TRANSLATE: - CHANGELOG1 = "CommunityDKP - v3.2.4-r62", - CHANGELOG2 = "fixed history display on mouseover", + CHANGELOG1 = "CommunityDKP - v3.2.5-r62", + CHANGELOG2 = " - Hopefully made this work in pre-patch", CHANGELOG3 = "", CHANGELOG4 = "", CHANGELOG5 = "", diff --git a/Localization/Localization.en.lua b/Localization/Localization.en.lua index 5e17cdf8..e0184b21 100644 --- a/Localization/Localization.en.lua +++ b/Localization/Localization.en.lua @@ -795,8 +795,8 @@ core.L = { MIGRATIONCANCELED = "Migration canceled.|n|nPlease disable MonolithDKP and /reload the UI if you want to continue with CommunityDKP without using your current tables and settings.", MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.", - CHANGELOG1 = "CommunityDKP - v3.2.4-r62", - CHANGELOG2 = "fixed history display on mouseover", + CHANGELOG1 = "CommunityDKP - v3.2.5-r62", + CHANGELOG2 = " - Hopefully made this work in pre-patch", CHANGELOG3 = "", CHANGELOG4 = "", CHANGELOG5 = "", diff --git a/Localization/Localization.es.lua b/Localization/Localization.es.lua index 8de097b1..072195fb 100644 --- a/Localization/Localization.es.lua +++ b/Localization/Localization.es.lua @@ -818,8 +818,8 @@ if GetLocale() == "esES" or GetLocale() == "esMX" then MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.", --TODO TRANSLATE: --TODO TRANSLATE: - CHANGELOG1 = "CommunityDKP - v3.2.4-r62", - CHANGELOG2 = "fixed history display on mouseover", + CHANGELOG1 = "CommunityDKP - v3.2.5-r62", + CHANGELOG2 = " - Hopefully made this work in pre-patch", CHANGELOG3 = "", CHANGELOG4 = "", CHANGELOG5 = "", diff --git a/Localization/Localization.fr.lua b/Localization/Localization.fr.lua index 512d7370..a62eac14 100644 --- a/Localization/Localization.fr.lua +++ b/Localization/Localization.fr.lua @@ -873,8 +873,8 @@ if GetLocale() == "frFR" then MIGRATIONCOMPLETED = "Migration réussie.|n|nVeuillez désactiver MonolithDKP et recharger votre interface (/reload).", --TODO TRANSLATE: --TODO TRANSLATE: - CHANGELOG1 = "CommunityDKP - v3.2.4-r62", - CHANGELOG2 = "fixed history display on mouseover", + CHANGELOG1 = "CommunityDKP - v3.2.5-r62", + CHANGELOG2 = " - Hopefully made this work in pre-patch", CHANGELOG3 = "", CHANGELOG4 = "", CHANGELOG5 = "", diff --git a/Localization/Localization.kr.lua b/Localization/Localization.kr.lua index 39ffe6e4..b1417955 100644 --- a/Localization/Localization.kr.lua +++ b/Localization/Localization.kr.lua @@ -818,8 +818,8 @@ if GetLocale() == "koKR" then MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.", --TODO TRANSLATE: --TODO TRANSLATE: - CHANGELOG1 = "CommunityDKP - v3.2.4-r62", - CHANGELOG2 = "fixed history display on mouseover", + CHANGELOG1 = "CommunityDKP - v3.2.5-r62", + CHANGELOG2 = " - Hopefully made this work in pre-patch", CHANGELOG3 = "", CHANGELOG4 = "", CHANGELOG5 = "", diff --git a/Localization/Localization.ru.lua b/Localization/Localization.ru.lua index d858c795..ca57ea46 100644 --- a/Localization/Localization.ru.lua +++ b/Localization/Localization.ru.lua @@ -815,8 +815,8 @@ if GetLocale() == "ruRU" then MIGRATIONCOMPLETED = "Миграция завершена.|n|nПожалуйста отключите MonolithDKP и перезагрузите интерфейс.", --TODO TRANSLATE: - CHANGELOG1 = "CommunityDKP - v3.2.4-r62", - CHANGELOG2 = "fixed history display on mouseover", + CHANGELOG1 = "CommunityDKP - v3.2.5-r62", + CHANGELOG2 = " - Hopefully made this work in pre-patch", CHANGELOG3 = "", CHANGELOG4 = "", CHANGELOG5 = "", diff --git a/Localization/Localization.se.lua b/Localization/Localization.se.lua index 430d0aa7..e318858e 100644 --- a/Localization/Localization.se.lua +++ b/Localization/Localization.se.lua @@ -793,8 +793,8 @@ core.L = { MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.", --TODO TRANSLATE: - CHANGELOG1 = "CommunityDKP - v3.2.4-r62", - CHANGELOG2 = "fixed history display on mouseover", + CHANGELOG1 = "CommunityDKP - v3.2.5-r62", + CHANGELOG2 = " - Hopefully made this work in pre-patch", CHANGELOG3 = "", CHANGELOG4 = "", CHANGELOG5 = "", diff --git a/Localization/Localization.tw.lua b/Localization/Localization.tw.lua index c2e9ba57..837d3b28 100644 --- a/Localization/Localization.tw.lua +++ b/Localization/Localization.tw.lua @@ -820,8 +820,8 @@ if GetLocale() == "zhTW" then MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.", --TODO TRANSLATE: --TODO TRANSLATE: - CHANGELOG1 = "CommunityDKP - v3.2.4-r62", - CHANGELOG2 = "fixed history display on mouseover", + CHANGELOG1 = "CommunityDKP - v3.2.5-r62", + CHANGELOG2 = " - Hopefully made this work in pre-patch", CHANGELOG3 = "", CHANGELOG4 = "", CHANGELOG5 = "", diff --git a/Modules/AdjustDKP.lua b/Modules/AdjustDKP.lua index 7f45d959..134ee5d8 100644 --- a/Modules/AdjustDKP.lua +++ b/Modules/AdjustDKP.lua @@ -135,7 +135,7 @@ end local function RaidTimerPopout_Create() if not CommDKP.RaidTimerPopout then - CommDKP.RaidTimerPopout = CreateFrame("Frame", "CommDKP_RaidTimerPopout", UIParent, "ShadowOverlaySmallTemplate"); + CommDKP.RaidTimerPopout = CreateFrame("Frame", "CommDKP_RaidTimerPopout", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil); CommDKP.RaidTimerPopout:SetPoint("RIGHT", UIParent, "RIGHT", -300, 100); CommDKP.RaidTimerPopout:SetSize(100, 50); @@ -155,7 +155,7 @@ local function RaidTimerPopout_Create() CommDKP.RaidTimerPopout:SetScript("OnDragStop", CommDKP.RaidTimerPopout.StopMovingOrSizing); -- Popout Close Button - CommDKP.RaidTimerPopout.closeContainer = CreateFrame("Frame", "CommDKPChangeLogClose", CommDKP.RaidTimerPopout) + CommDKP.RaidTimerPopout.closeContainer = CreateFrame("Frame", "CommDKPChangeLogClose", CommDKP.RaidTimerPopout, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.RaidTimerPopout.closeContainer:SetPoint("CENTER", CommDKP.RaidTimerPopout, "TOPRIGHT", -8, -4) CommDKP.RaidTimerPopout.closeContainer:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, @@ -274,7 +274,7 @@ function CommDKP:AdjustDKPTab_Create() CommDKP.ConfigTab2.reasonHeader:SetText(L["REASONFORADJUSTMENT"]..":") -- Other Reason Editbox. Hidden unless "Other" is selected in dropdown - CommDKP.ConfigTab2.otherReason = CreateFrame("EditBox", nil, CommDKP.ConfigTab2) + CommDKP.ConfigTab2.otherReason = CreateFrame("EditBox", nil, CommDKP.ConfigTab2, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab2.otherReason:SetPoint("TOPLEFT", CommDKP.ConfigTab2.reasonDropDown, "BOTTOMLEFT", 19, 2) CommDKP.ConfigTab2.otherReason:SetAutoFocus(false) CommDKP.ConfigTab2.otherReason:SetMultiLine(false) @@ -382,7 +382,7 @@ function CommDKP:AdjustDKPTab_Create() end -- Add DKP Edit Box - CommDKP.ConfigTab2.addDKP = CreateFrame("EditBox", nil, CommDKP.ConfigTab2) + CommDKP.ConfigTab2.addDKP = CreateFrame("EditBox", nil, CommDKP.ConfigTab2, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab2.addDKP:SetPoint("TOPLEFT", CommDKP.ConfigTab2.reasonDropDown, "BOTTOMLEFT", 20, -44) CommDKP.ConfigTab2.addDKP:SetAutoFocus(false) CommDKP.ConfigTab2.addDKP:SetMultiLine(false) @@ -490,7 +490,7 @@ function CommDKP:AdjustDKPTab_Create() end) -- weekly decay Editbox - CommDKP.ConfigTab2.decayDKP = CreateFrame("EditBox", nil, CommDKP.ConfigTab2) + CommDKP.ConfigTab2.decayDKP = CreateFrame("EditBox", nil, CommDKP.ConfigTab2, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab2.decayDKP:SetPoint("BOTTOMLEFT", CommDKP.ConfigTab2, "BOTTOMLEFT", 21, 70) CommDKP.ConfigTab2.decayDKP:SetAutoFocus(false) CommDKP.ConfigTab2.decayDKP:SetMultiLine(false) @@ -612,7 +612,7 @@ function CommDKP:AdjustDKPTab_Create() end) -- Raid Timer Container - CommDKP.ConfigTab2.RaidTimerContainer = CreateFrame("Frame", nil, CommDKP.ConfigTab2); + CommDKP.ConfigTab2.RaidTimerContainer = CreateFrame("Frame", nil, CommDKP.ConfigTab2, BackdropTemplateMixin and "BackdropTemplate" or nil); CommDKP.ConfigTab2.RaidTimerContainer:SetSize(200, 360); CommDKP.ConfigTab2.RaidTimerContainer:SetPoint("RIGHT", CommDKP.ConfigTab2, "RIGHT", -25, -60) CommDKP.ConfigTab2.RaidTimerContainer:SetBackdrop({ @@ -803,7 +803,7 @@ function CommDKP:AdjustDKPTab_Create() -- Award Interval Editbox if not core.DB.modes.increment then core.DB.modes.increment = 60 end - CommDKP.ConfigTab2.RaidTimerContainer.interval = CreateFrame("EditBox", nil, CommDKP.ConfigTab2.RaidTimerContainer) + CommDKP.ConfigTab2.RaidTimerContainer.interval = CreateFrame("EditBox", nil, CommDKP.ConfigTab2.RaidTimerContainer, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab2.RaidTimerContainer.interval:SetPoint("BOTTOMLEFT", CommDKP.ConfigTab2.RaidTimerContainer, "BOTTOMLEFT", 35, 225) CommDKP.ConfigTab2.RaidTimerContainer.interval:SetAutoFocus(false) CommDKP.ConfigTab2.RaidTimerContainer.interval:SetMultiLine(false) @@ -866,7 +866,7 @@ function CommDKP:AdjustDKPTab_Create() -- Award Value Editbox if not core.DB.DKPBonus.IntervalBonus then core.DB.DKPBonus.IntervalBonus = 15 end - CommDKP.ConfigTab2.RaidTimerContainer.bonusvalue = CreateFrame("EditBox", nil, CommDKP.ConfigTab2.RaidTimerContainer) + CommDKP.ConfigTab2.RaidTimerContainer.bonusvalue = CreateFrame("EditBox", nil, CommDKP.ConfigTab2.RaidTimerContainer, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab2.RaidTimerContainer.bonusvalue:SetPoint("LEFT", CommDKP.ConfigTab2.RaidTimerContainer.interval, "RIGHT", 10, 0) CommDKP.ConfigTab2.RaidTimerContainer.bonusvalue:SetAutoFocus(false) CommDKP.ConfigTab2.RaidTimerContainer.bonusvalue:SetMultiLine(false) diff --git a/Modules/Award.lua b/Modules/Award.lua index 6cb3ca1b..2c68c18d 100644 --- a/Modules/Award.lua +++ b/Modules/Award.lua @@ -238,7 +238,7 @@ local function AwardItem(player, cost, boss, zone, loot, reassign) end local function AwardConfirm_Create() - local f = CreateFrame("Frame", "CommDKP_AwardWindowConfirm", UIParent, "ShadowOverlaySmallTemplate"); + local f = CreateFrame("Frame", "CommDKP_AwardWindowConfirm", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil); f:SetPoint("TOP", UIParent, "TOP", 0, -200); f:SetSize(400, 270); -- + 40 @@ -320,7 +320,7 @@ local function AwardConfirm_Create() f.costHeader:SetPoint("TOPRIGHT", f.lootHeader, "BOTTOMRIGHT", 0, -10); f.costHeader:SetText(L["ITEMCOST"]..":") - f.cost = CreateFrame("EditBox", nil, f) + f.cost = CreateFrame("EditBox", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.cost:SetAutoFocus(false) f.cost:SetMultiLine(false) f.cost:SetPoint("LEFT", f.costHeader, "RIGHT", 5, 0) diff --git a/Modules/BidInterface.lua b/Modules/BidInterface.lua index cd8e731a..598a29f0 100644 --- a/Modules/BidInterface.lua +++ b/Modules/BidInterface.lua @@ -483,7 +483,7 @@ function CommDKP:Bids_Set(entry) end function CommDKP:BidInterface_Create() - local f = CreateFrame("Frame", "CommDKP_BidderWindow", UIParent, "ShadowOverlaySmallTemplate"); + local f = CreateFrame("Frame", "CommDKP_BidderWindow", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil); local mode = core.DB.modes.mode; f:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 700, -200); if mode == "Minimum Bid Values" or (mode == "Zero Sum" and core.DB.modes.ZeroSumBidType == "Minimum Bid") then @@ -525,7 +525,7 @@ function CommDKP:BidInterface_Create() tinsert(UISpecialFrames, f:GetName()); -- Sets frame to close on "Escape" -- Close Button - f.closeContainer = CreateFrame("Frame", "CommDKPBidderWindowCloseButtonContainer", f) + f.closeContainer = CreateFrame("Frame", "CommDKPBidderWindowCloseButtonContainer", f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.closeContainer:SetPoint("CENTER", f, "TOPRIGHT", -4, 0) f.closeContainer:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, @@ -535,13 +535,13 @@ function CommDKP:BidInterface_Create() f.closeContainer:SetBackdropBorderColor(1,1,1,0.2) f.closeContainer:SetSize(28, 28) - f.closeBtn = CreateFrame("Button", nil, f, "UIPanelCloseButton") + f.closeBtn = CreateFrame("Button", nil, f, "UIPanelCloseButton", BackdropTemplateMixin and "BackdropTemplate" or nil) f.closeBtn:SetPoint("CENTER", f.closeContainer, "TOPRIGHT", -14, -14) f.LootTableIcons = {} f.LootTableButtons = {} - f.lootContainer = CreateFrame("Frame", "CommDKP_LootContainer", UIParent); + f.lootContainer = CreateFrame("Frame", "CommDKP_LootContainer", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil); f.lootContainer:SetPoint("TOP", f, "TOP", 0, -40); f.lootContainer:SetSize(35, 35) @@ -611,7 +611,7 @@ function CommDKP:BidInterface_Create() f.BidHeader:SetPoint("TOPRIGHT", f.MinBidHeader, "BOTTOMRIGHT", 0, -20); end - f.Bid = CreateFrame("EditBox", nil, f) + f.Bid = CreateFrame("EditBox", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.Bid:SetPoint("LEFT", f.BidHeader, "RIGHT", 8, 0) f.Bid:SetAutoFocus(false) f.Bid:SetMultiLine(false) @@ -793,12 +793,13 @@ function CommDKP:BidInterface_Create() -------------------------------------------------- f.bidTable = CreateFrame("ScrollFrame", "CommDKP_BiderWindowTable", f, "FauxScrollFrameTemplate") f.bidTable:SetSize(width, height*numrows+3) - f.bidTable:SetBackdrop({ - bgFile = "Textures\\white.blp", tile = true, - edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 2, - }); - f.bidTable:SetBackdropColor(0,0,0,0.2) - f.bidTable:SetBackdropBorderColor(1,1,1,0.4) + + -- f.bidTable:SetBackdrop({ + -- bgFile = "Textures\\white.blp", tile = true, + -- edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 2, + -- }); + -- f.bidTable:SetBackdropColor(0,0,0,0.2) + -- f.bidTable:SetBackdropBorderColor(1,1,1,0.4) f.bidTable.ScrollBar = FauxScrollFrame_GetChildFrames(f.bidTable) f.bidTable.ScrollBar:Hide() f.bidTable.Rows = {} @@ -811,7 +812,7 @@ function CommDKP:BidInterface_Create() end end f.bidTable:SetScript("OnVerticalScroll", function(self, offset) - FauxScrollFrame_OnVerticalScroll(self, offset, height, BidderScrollFrame_Update) + FauxScrollFrame_OnVerticalScroll(self, offset, height, BidderScrollFrame_Update) end) --------------------------------------- @@ -820,7 +821,7 @@ function CommDKP:BidInterface_Create() f.headerButtons = {} mode = core.DB.modes.mode; - f.BidTable_Headers = CreateFrame("Frame", "CommDKPBidderTableHeaders", f.bidTable) + f.BidTable_Headers = CreateFrame("Frame", "CommDKPBidderTableHeaders", f.bidTable, BackdropTemplateMixin and "BackdropTemplate" or nil) f.BidTable_Headers:SetSize(370, 22) f.BidTable_Headers:SetPoint("BOTTOMLEFT", f.bidTable, "TOPLEFT", 0, 1) f.BidTable_Headers:SetBackdrop({ @@ -832,9 +833,9 @@ function CommDKP:BidInterface_Create() f.bidTable:SetPoint("BOTTOM", f, "BOTTOM", 0, 15) f.BidTable_Headers:Show() - f.headerButtons.player = CreateFrame("Button", "$ParentButtonPlayer", f.BidTable_Headers) - f.headerButtons.bid = CreateFrame("Button", "$ParentButtonBid", f.BidTable_Headers) - f.headerButtons.dkp = CreateFrame("Button", "$ParentSuttonDkp", f.BidTable_Headers) + f.headerButtons.player = CreateFrame("Button", "$ParentButtonPlayer", f.BidTable_Headers, BackdropTemplateMixin and "BackdropTemplate" or nil) + f.headerButtons.bid = CreateFrame("Button", "$ParentButtonBid", f.BidTable_Headers, BackdropTemplateMixin and "BackdropTemplate" or nil) + f.headerButtons.dkp = CreateFrame("Button", "$ParentSuttonDkp", f.BidTable_Headers, BackdropTemplateMixin and "BackdropTemplate" or nil) f.headerButtons.player:SetPoint("LEFT", f.BidTable_Headers, "LEFT", 2, 0) f.headerButtons.bid:SetPoint("LEFT", f.headerButtons.player, "RIGHT", 0, 0) diff --git a/Modules/Bidding.lua b/Modules/Bidding.lua index 9bf7bfaa..afc9ee70 100644 --- a/Modules/Bidding.lua +++ b/Modules/Bidding.lua @@ -420,10 +420,7 @@ function CommDKP:ToggleBidWindow(loot, lootIcon, itemName) mode = core.DB.modes.mode; if core.IsOfficer then - if core.BiddingWindow == nil then - print("Bidding Window is Nil") - end - + core.BiddingWindow = core.BiddingWindow or CommDKP:CreateBidWindow(); if core.DB.bidpos then @@ -939,10 +936,11 @@ end function CommDKP:CreateTimer() - local f = CreateFrame("StatusBar", nil, UIParent) + local f = CreateFrame("StatusBar", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil) f:SetSize(300, 25) f:SetFrameStrata("DIALOG") f:SetFrameLevel(18) + f:SetBackdrop({ bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, }); @@ -965,7 +963,7 @@ function CommDKP:CreateTimer() core.DB.timerpos["y"] = yOff; end); - f.border = CreateFrame("Frame", nil, f); + f.border = CreateFrame("Frame", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil); f.border:SetPoint("CENTER", f, "CENTER"); f.border:SetFrameStrata("DIALOG") f.border:SetFrameLevel(19) @@ -1112,7 +1110,6 @@ local function SortBidTable() -- sorts the Loot History Table by dat end function CommDKP:BidScrollFrame_Update() - print("Updating bidscroll"); local numOptions = #Bids_Submitted; local index, row local offset = FauxScrollFrame_GetOffset(core.BiddingWindow.bidTable) or 0 @@ -1196,7 +1193,7 @@ function CommDKP:BidScrollFrame_Update() end function CommDKP:CreateBidWindow() - local f = CreateFrame("Frame", "CommDKP_BiddingWindow", UIParent, "ShadowOverlaySmallTemplate"); + local f = CreateFrame("Frame", "CommDKP_BiddingWindow", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil); mode = core.DB.modes.mode; f:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 300, -200); @@ -1240,7 +1237,7 @@ function CommDKP:CreateBidWindow() tinsert(UISpecialFrames, f:GetName()); -- Sets frame to close on "Escape" -- Close Button - f.closeContainer = CreateFrame("Frame", "CommDKPBiddingWindowCloseButtonContainer", f) + f.closeContainer = CreateFrame("Frame", "CommDKPBiddingWindowCloseButtonContainer", f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.closeContainer:SetPoint("CENTER", f, "TOPRIGHT", -4, 0) f.closeContainer:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, @@ -1260,7 +1257,7 @@ function CommDKP:CreateBidWindow() f.bossHeader:SetPoint("TOPLEFT", f, "TOPLEFT", 85, -25); f.bossHeader:SetText(L["BOSS"]..":") - f.boss = CreateFrame("EditBox", nil, f) + f.boss = CreateFrame("EditBox", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.boss:SetFontObject("CommDKPNormalLeft"); f.boss:SetAutoFocus(false) f.boss:SetMultiLine(false) @@ -1322,7 +1319,7 @@ function CommDKP:CreateBidWindow() -- Min Bid f.minBidHeader:SetText(L["MINIMUMBID"]..": ") - f.minBid = CreateFrame("EditBox", nil, f) + f.minBid = CreateFrame("EditBox", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.minBid:SetPoint("LEFT", f.minBidHeader, "RIGHT", 8, 0) f.minBid:SetAutoFocus(false) f.minBid:SetMultiLine(false) @@ -1383,7 +1380,7 @@ function CommDKP:CreateBidWindow() f.maxBidHeader:SetPoint("TOP", f.minBidHeader, "BOTTOM", -2, -25); f.maxBidHeader:SetText(L["MAXIMUMBID"]..": ") - f.maxBid = CreateFrame("EditBox", nil, f) + f.maxBid = CreateFrame("EditBox", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.maxBid:SetPoint("LEFT", f.maxBidHeader, "RIGHT", 8, 0) f.maxBid:SetAutoFocus(false) f.maxBid:SetMultiLine(false) @@ -1446,7 +1443,7 @@ function CommDKP:CreateBidWindow() end f.bidTimerHeader:SetText(L["BIDTIMER"]..": ") - f.bidTimer = CreateFrame("EditBox", nil, f) + f.bidTimer = CreateFrame("EditBox", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.bidTimer:SetPoint("LEFT", f.bidTimerHeader, "RIGHT", 8, 0) f.bidTimer:SetAutoFocus(false) f.bidTimer:SetMultiLine(false) @@ -1554,7 +1551,7 @@ function CommDKP:CreateBidWindow() -------------------------------------------------- -- Bid Table -------------------------------------------------- - f.bidTable = CreateFrame("ScrollFrame", "CommDKP_BidWindowTable", f, "FauxScrollFrameTemplate") + f.bidTable = CreateFrame("ScrollFrame", "CommDKP_BidWindowTable", f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.bidTable:SetSize(width, height*numrows+3) f.bidTable:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, @@ -1563,7 +1560,7 @@ function CommDKP:CreateBidWindow() f.bidTable:SetBackdropColor(0,0,0,0.2) f.bidTable:SetBackdropBorderColor(1,1,1,0.4) f.bidTable.ScrollBar = FauxScrollFrame_GetChildFrames(f.bidTable) - f.bidTable.ScrollBar:Hide() + --f.bidTable.ScrollBar:Hide() f.bidTable.Rows = {} for i=1, numrows do f.bidTable.Rows[i] = BidWindowCreateRow(f.bidTable, i) @@ -1583,7 +1580,7 @@ function CommDKP:CreateBidWindow() local headerButtons = {} mode = core.DB.modes.mode; - f.BidTable_Headers = CreateFrame("Frame", "CommDKPDKPTableHeaders", f) + f.BidTable_Headers = CreateFrame("Frame", "CommDKPDKPTableHeaders", f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.BidTable_Headers:SetSize(370, 22) f.BidTable_Headers:SetPoint("BOTTOMLEFT", f.bidTable, "TOPLEFT", 0, 1) f.BidTable_Headers:SetBackdrop({ @@ -1661,7 +1658,7 @@ function CommDKP:CreateBidWindow() -- AWARD ITEM ------------------------------------ - f.cost = CreateFrame("EditBox", nil, f) + f.cost = CreateFrame("EditBox", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.cost:SetPoint("TOPLEFT", f.bidTable, "BOTTOMLEFT", 71, -15) f.cost:SetAutoFocus(false) f.cost:SetMultiLine(false) diff --git a/Modules/ClassGraph.lua b/Modules/ClassGraph.lua index 0749de8a..e7b478ea 100644 --- a/Modules/ClassGraph.lua +++ b/Modules/ClassGraph.lua @@ -5,7 +5,7 @@ local L = core.L; function CommDKP:ClassGraph() - local graph = CreateFrame("Frame", "CommDKPClassIcons", CommDKP.ConfigTab1) + local graph = CreateFrame("Frame", "CommDKPClassIcons", CommDKP.ConfigTab1, BackdropTemplateMixin and "BackdropTemplate" or nil) graph:SetPoint("TOPLEFT", CommDKP.ConfigTab1, "TOPLEFT", 0, 0) graph:SetBackdropColor(0,0,0,0) @@ -45,7 +45,7 @@ function CommDKP:ClassGraph() end graph.icons[i]:SetColorTexture(0, 0, 0, 1) graph.icons[i]:SetSize(28, 28); - graph.icons[i].bar = CreateFrame("Frame", "CommDKP"..i.."Graph", graph) + graph.icons[i].bar = CreateFrame("Frame", "CommDKP"..i.."Graph", graph, BackdropTemplateMixin and "BackdropTemplate" or nil) graph.icons[i].bar:SetPoint("BOTTOM", icons[i], "TOP", 0, 5) graph.icons[i].bar:SetBackdropBorderColor(1,1,1,0) graph.icons[i].bar:SetSize(BarWidth, perc_height[i]) diff --git a/Modules/DKPModes.lua b/Modules/DKPModes.lua index 3dfbf9fb..e24fced4 100644 --- a/Modules/DKPModes.lua +++ b/Modules/DKPModes.lua @@ -22,7 +22,7 @@ function CommDKP:ToggleDKPModesWindow() end function CommDKP:DKPModesFrame_Create() - local f = CreateFrame("Frame", "CommDKP_DKPModesFrame", UIParent); + local f = CreateFrame("Frame", "CommDKP_DKPModesFrame", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil); local ActiveMode = core.DB.modes.mode; local ActiveCostType = core.DB.modes.costvalue; @@ -61,7 +61,7 @@ function CommDKP:DKPModesFrame_Create() f.BG:SetTexture("Interface\\AddOns\\CommunityDKP\\Media\\Textures\\menu-bg"); -- TabMenu ScrollFrame and ScrollBar - f.ScrollFrame = CreateFrame("ScrollFrame", nil, f); + f.ScrollFrame = CreateFrame("ScrollFrame", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil); f.ScrollFrame:ClearAllPoints(); f.ScrollFrame:SetPoint("TOPLEFT", f, "TOPLEFT", 4, -8); f.ScrollFrame:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", -3, 4); @@ -77,7 +77,7 @@ function CommDKP:DKPModesFrame_Create() tinsert(UISpecialFrames, f:GetName()); -- Sets frame to close on "Escape" -- Close Button - f.closeContainer = CreateFrame("Frame", "MonDKModesWindowCloseButtonContainer", f) + f.closeContainer = CreateFrame("Frame", "MonDKModesWindowCloseButtonContainer", f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.closeContainer:SetPoint("CENTER", f, "TOPRIGHT", -4, 0) f.closeContainer:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, diff --git a/Modules/LootPriceTab.lua b/Modules/LootPriceTab.lua index f4012900..982abe7f 100644 --- a/Modules/LootPriceTab.lua +++ b/Modules/LootPriceTab.lua @@ -5,7 +5,7 @@ local L = core.L; local function CreateRow(parent, id) -- Create 3 buttons for each row in the list - local f = CreateFrame("Button", "$parentLine"..id, parent) + local f = CreateFrame("Button", "$parentLine"..id, parent, BackdropTemplateMixin and "BackdropTemplate" or nil) f.PriceInfo = {} f:SetSize(core.TableWidth, core.TableRowHeight) f:SetHighlightTexture("Interface\\AddOns\\CommunityDKP\\Media\\Textures\\ListBox-Highlight"); @@ -287,14 +287,15 @@ function CommDKP:PriceTab_Create() CommDKP.ConfigTab7.PriceTable = CreateFrame("ScrollFrame", "CommDKPPriceScrollFrame", CommDKP.ConfigTab7, "FauxScrollFrameTemplate") CommDKP.ConfigTab7.PriceTable:SetSize(core.TableWidth, core.TableRowHeight*numOfRows) CommDKP.ConfigTab7.PriceTable:SetPoint("TOPLEFT", 0, -95) - CommDKP.ConfigTab7.PriceTable:SetBackdrop( { - bgFile = "Textures\\white.blp", tile = true, -- White backdrop allows for black background with 1.0 alpha on low alpha containers - edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 2, - insets = { left = 0, right = 0, top = 0, bottom = 0 } - }); - CommDKP.ConfigTab7.PriceTable:SetBackdropColor(0,0,0,0.4); - CommDKP.ConfigTab7.PriceTable:SetBackdropBorderColor(1,1,1,0.5) + --CommDKP.ConfigTab7.PriceTable:SetBackdrop( { + -- bgFile = "Textures\\white.blp", tile = true, -- White backdrop allows for black background with 1.0 alpha on low alpha containers + -- edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 2, + -- insets = { left = 0, right = 0, top = 0, bottom = 0 } + --}); + + --CommDKP.ConfigTab7.PriceTable:SetBackdropColor(0,0,0,0.4); + --CommDKP.ConfigTab7.PriceTable:SetBackdropBorderColor(1,1,1,0.5) CommDKP.ConfigTab7.PriceTable:SetClipsChildren(false); CommDKP.ConfigTab7.PriceTable.ScrollBar = FauxScrollFrame_GetChildFrames(CommDKP.ConfigTab7.PriceTable) @@ -313,7 +314,7 @@ function CommDKP:PriceTab_Create() FauxScrollFrame_OnVerticalScroll(self, offset, core.TableRowHeight, CommDKP:PriceTable_Update(offset)) end) - CommDKP.ConfigTab7.PriceTable.Headers = CreateFrame("Frame", "CommDKPPriceTableHeaders", CommDKP.ConfigTab7) + CommDKP.ConfigTab7.PriceTable.Headers = CreateFrame("Frame", "CommDKPPriceTableHeaders", CommDKP.ConfigTab7, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab7.PriceTable.Headers:SetSize(500, 22) CommDKP.ConfigTab7.PriceTable.Headers:SetPoint("BOTTOMLEFT", CommDKP.ConfigTab7.PriceTable, "TOPLEFT", 0, 1) CommDKP.ConfigTab7.PriceTable.Headers:SetBackdrop({ diff --git a/Modules/ManageEntries.lua b/Modules/ManageEntries.lua index 600aa823..fdd85aed 100644 --- a/Modules/ManageEntries.lua +++ b/Modules/ManageEntries.lua @@ -1074,7 +1074,7 @@ function CommDKP:ManageEntries() ---------------------------------- -- Team name input box ---------------------------------- - CommDKP.ConfigTab3.TeamNameInput = CreateFrame("EditBox", nil, CommDKP.ConfigTab3) + CommDKP.ConfigTab3.TeamNameInput = CreateFrame("EditBox", nil, CommDKP.ConfigTab3, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab3.TeamNameInput:SetAutoFocus(false) CommDKP.ConfigTab3.TeamNameInput:SetMultiLine(false) CommDKP.ConfigTab3.TeamNameInput:SetSize(160, 24) diff --git a/Modules/Modes/DKPModesMain.lua b/Modules/Modes/DKPModesMain.lua index 86f7e727..95d4d466 100644 --- a/Modules/Modes/DKPModesMain.lua +++ b/Modules/Modes/DKPModesMain.lua @@ -319,7 +319,7 @@ function CommDKP:DKPModes_Main() f.DKPModesMain.MaxBidBehaviorHeader:SetText(L["MAXBIDBEHAVIOR"]) -- AntiSnipe Option - f.DKPModesMain.AntiSnipe = CreateFrame("EditBox", nil, f.DKPModesMain) + f.DKPModesMain.AntiSnipe = CreateFrame("EditBox", nil, f.DKPModesMain, BackdropTemplateMixin and "BackdropTemplate" or nil) f.DKPModesMain.AntiSnipe:SetAutoFocus(false) f.DKPModesMain.AntiSnipe:SetMultiLine(false) f.DKPModesMain.AntiSnipe:SetPoint("TOPLEFT", f.DKPModesMain.RoundDropDown, "BOTTOMLEFT", 18, -15) @@ -495,7 +495,7 @@ function CommDKP:DKPModes_Main() -- Artificial Inflation Editbox if not core.DB.modes.Inflation then core.DB.modes.Inflation = 0 end - f.DKPModesMain.Inflation = CreateFrame("EditBox", nil, f.DKPModesMain) + f.DKPModesMain.Inflation = CreateFrame("EditBox", nil, f.DKPModesMain, BackdropTemplateMixin and "BackdropTemplate" or nil) f.DKPModesMain.Inflation:SetAutoFocus(false) f.DKPModesMain.Inflation:SetMultiLine(false) f.DKPModesMain.Inflation:SetPoint("TOPLEFT", f.DKPModesMain.CostSelection, "BOTTOMLEFT", 20, -15) @@ -676,7 +676,7 @@ function CommDKP:DKPModes_Main() f.DKPModesMain.MaxBidBehaviorDropDown:Hide(); f.DKPModesMain.MaxBidBehaviorHeader:Hide(); core.DB.modes.MaxBehavior = "Max DKP"; -elseif core.DB.modes.mode == "Static Item Values" then + elseif core.DB.modes.mode == "Static Item Values" then f.DKPModesMain.MaxBidBehaviorDropDown:Hide(); f.DKPModesMain.MaxBidBehaviorHeader:Hide(); core.DB.modes.MaxBehavior = "Max DKP"; @@ -761,34 +761,129 @@ elseif core.DB.modes.mode == "Static Item Values" then end + --- -- Roll Container - f.DKPModesMain.RollContainer = CreateFrame("Frame", nil, f.DKPModesMain); - f.DKPModesMain.RollContainer:SetSize(210, 150); - f.DKPModesMain.RollContainer:SetPoint("TOPLEFT", f.DKPModesMain.ChannelsDropDown, "BOTTOMLEFT", -10, -20) - f.DKPModesMain.RollContainer:SetBackdrop({ - bgFile = "Textures\\white.blp", tile = true, - edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 1, edgeSize = 2, - }); - f.DKPModesMain.RollContainer:SetBackdropColor(0,0,0,0.9) - f.DKPModesMain.RollContainer:SetBackdropBorderColor(0.12, 0.12, 0.34, 1) - f.DKPModesMain.RollContainer:Hide(); + --- + f.DKPModesMain.RollContainer = CreateFrame("Frame", nil, f.DKPModesMain, BackdropTemplateMixin and "BackdropTemplate" or nil); + f.DKPModesMain.RollContainer:SetSize(210, 180); + f.DKPModesMain.RollContainer:SetPoint("TOPLEFT", f.DKPModesMain.ChannelsDropDown, "BOTTOMLEFT", -10, -20) + f.DKPModesMain.RollContainer:SetBackdrop({ + bgFile = "Textures\\white.blp", tile = true, + edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 1, edgeSize = 2, + }); + f.DKPModesMain.RollContainer:SetBackdropColor(0,0,0,0.9) + f.DKPModesMain.RollContainer:SetBackdropBorderColor(0.12, 0.12, 0.34, 1) + f.DKPModesMain.RollContainer:Hide(); if core.DB.modes.mode == "Roll Based Bidding" then f.DKPModesMain.RollContainer:Show() end - -- Roll Container Header - f.DKPModesMain.RollContainer.Header = f.DKPModesMain.RollContainer:CreateFontString(nil, "OVERLAY") - f.DKPModesMain.RollContainer.Header:SetFontObject("CommDKPLargeLeft"); - f.DKPModesMain.RollContainer.Header:SetScale(0.6) - f.DKPModesMain.RollContainer.Header:SetPoint("TOPLEFT", f.DKPModesMain.RollContainer, "TOPLEFT", 15, -15); - f.DKPModesMain.RollContainer.Header:SetText(L["ROLLSETTINGS"]) + --- + -- Roll Container Header + --- + f.DKPModesMain.RollContainer.Header = f.DKPModesMain.RollContainer:CreateFontString(nil, "OVERLAY") + f.DKPModesMain.RollContainer.Header:SetFontObject("CommDKPLargeLeft"); + f.DKPModesMain.RollContainer.Header:SetScale(0.6) + f.DKPModesMain.RollContainer.Header:SetPoint("TOPLEFT", f.DKPModesMain.RollContainer, "TOPLEFT", 15, -15); + f.DKPModesMain.RollContainer.Header:SetText(L["ROLLSETTINGS"]) + + --- + -- Roll bidding mode dropdown + --- + + if core.DB.modes.RollMode == nil then + core.DB.modes.RollMode = "Default" + end + f.DKPModesMain.RollContainer.RollBiddingModeDropdown = CreateFrame("FRAME", "CommDKPModeSelectDropDown", f.DKPModesMain.RollContainer, "CommunityDKPUIDropDownMenuTemplate") + + UIDropDownMenu_Initialize( + f.DKPModesMain.RollContainer.RollBiddingModeDropdown, + function(self, level, menuList) + local _rollMode = UIDropDownMenu_CreateInfo() + _rollMode.func = self.SetValue + _rollMode.fontObject = "CommDKPSmallCenter" + _rollMode.text = "Default" + _rollMode.arg1 = "Default" + _rollMode.checked = ("Default" == core.DB.modes.RollMode) + _rollMode.isNotRadio = false + UIDropDownMenu_AddButton(_rollMode) + _rollMode.text = "Ni Karma" + _rollMode.arg1 = "Ni Karma" + _rollMode.checked = ("Ni Karma" == core.DB.modes.RollMode) + _rollMode.isNotRadio = false + UIDropDownMenu_AddButton(_rollMode) + end + ) + + f.DKPModesMain.RollContainer.RollBiddingModeDropdown:SetPoint( + "TOPLEFT", + f.DKPModesMain.RollContainer.Header, + "BOTTOMLEFT", + -10, + -10 + ) + UIDropDownMenu_SetWidth(f.DKPModesMain.RollContainer.RollBiddingModeDropdown, 150) + UIDropDownMenu_SetText(f.DKPModesMain.RollContainer.RollBiddingModeDropdown, core.DB.modes.RollMode) + + -- Dropdown Menu Function + function f.DKPModesMain.RollContainer.RollBiddingModeDropdown:SetValue(arg1) + if arg1 == "Default" then + core.DB.modes.RollMode = "Default" + f.DKPModesMain.RollContainer.UsePerc:Show() + f.DKPModesMain.RollContainer.UsePerc.text:Show() + f.DKPModesMain.RollContainer.AddMax:Show() + f.DKPModesMain.RollContainer.AddMax.Header:Show() + f.DKPModesMain.RollContainer.maxKarma:Hide() + f.DKPModesMain.RollContainer.maxKarma.Header:Hide() + elseif arg1 == "Ni Karma" then + core.DB.modes.RollMode = "Ni Karma" + f.DKPModesMain.RollContainer.UsePerc:Hide() + f.DKPModesMain.RollContainer.UsePerc.text:Hide() + f.DKPModesMain.RollContainer.AddMax:Hide() + f.DKPModesMain.RollContainer.AddMax.Header:Hide() + f.DKPModesMain.RollContainer.maxKarma:Show() + f.DKPModesMain.RollContainer.maxKarma.Header:Show() + end + UIDropDownMenu_SetText(f.DKPModesMain.RollContainer.RollBiddingModeDropdown, core.DB.modes.RollMode); + CloseDropDownMenus() + end + f.DKPModesMain.RollContainer.RollBiddingModeDropdown:SetScript( + "OnEnter", + function(self) + GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); + GameTooltip:SetText(L["ITEMCOSTTYPES"], 0.25, 0.75, 0.90, 1, true); + GameTooltip:AddLine(L["ITEMCOSTTYPESTTDESC"], 1.0, 1.0, 1.0, true); + GameTooltip:Show(); + end + ) + f.DKPModesMain.RollContainer.RollBiddingModeDropdown:SetScript( + "OnLeave", + function(self) + GameTooltip:Hide() + end) + + --- + -- Roll settings sub mode header + --- + + f.DKPModesMain.RollContainer.SubModeHeader = f.DKPModesMain.RollContainer:CreateFontString(nil, "OVERLAY") + f.DKPModesMain.RollContainer.SubModeHeader:SetPoint("BOTTOMLEFT", f.DKPModesMain.RollContainer.RollBiddingModeDropdown, "TOPLEFT", 90, 2); + f.DKPModesMain.RollContainer.SubModeHeader:SetFontObject("CommDKPSmallLeft") + f.DKPModesMain.RollContainer.SubModeHeader:SetText("Roll sub mode") + + --- + -- Default roll sub section + --- + + --- -- Min Roll Editbox - f.DKPModesMain.RollContainer.rollMin = CreateFrame("EditBox", nil, f.DKPModesMain.RollContainer) + --- + f.DKPModesMain.RollContainer.rollMin = CreateFrame("EditBox", nil, f.DKPModesMain.RollContainer, BackdropTemplateMixin and "BackdropTemplate" or nil) f.DKPModesMain.RollContainer.rollMin:SetAutoFocus(false) f.DKPModesMain.RollContainer.rollMin:SetMultiLine(false) - f.DKPModesMain.RollContainer.rollMin:SetPoint("TOPLEFT", f.DKPModesMain.RollContainer, "TOPLEFT", 20, -50) + f.DKPModesMain.RollContainer.rollMin:SetPoint("TOPLEFT", f.DKPModesMain.RollContainer, "TOPLEFT", 20, -80) f.DKPModesMain.RollContainer.rollMin:SetSize(70, 24) f.DKPModesMain.RollContainer.rollMin:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, @@ -801,190 +896,297 @@ elseif core.DB.modes.mode == "Static Item Values" then f.DKPModesMain.RollContainer.rollMin:SetFontObject("CommDKPSmallRight") f.DKPModesMain.RollContainer.rollMin:SetTextInsets(10, 15, 5, 5) f.DKPModesMain.RollContainer.rollMin:SetText(core.DB.modes.rolls.min) - f.DKPModesMain.RollContainer.rollMin:SetScript("OnEscapePressed", function(self) -- clears focus on esc - core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() - core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() - core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() - self:ClearFocus() - end) - f.DKPModesMain.RollContainer.rollMin:SetScript("OnTabPressed", function(self) -- clears focus on esc - core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() - core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() - core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() - f.DKPModesMain.RollContainer.rollMax:SetFocus() - end) - f.DKPModesMain.RollContainer.rollMin:SetScript("OnEnterPressed", function(self) -- clears focus on esc - core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() - core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() - core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() - self:ClearFocus() - end) - f.DKPModesMain.RollContainer.rollMin:SetScript("OnEnter", function(self) - GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); - GameTooltip:SetText(L["MINIMUMROLL"], 0.25, 0.75, 0.90, 1, true); - GameTooltip:AddLine(L["MINIMUMROLLTTDESC"], 1.0, 1.0, 1.0, true); - --GameTooltip:AddLine("The state of this option will persist indefinitely until manually disabled/enabled.", 1.0, 0, 0, true); - GameTooltip:Show(); - end) - f.DKPModesMain.RollContainer.rollMin:SetScript("OnLeave", function(self) - GameTooltip:Hide() - end) - - -- Min Roll Header + f.DKPModesMain.RollContainer.rollMin:SetScript( + "OnEscapePressed", + function(self) -- clears focus on esc + core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() + core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() + core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() + self:ClearFocus() + end + ) + f.DKPModesMain.RollContainer.rollMin:SetScript( + "OnTabPressed", + function(self) -- clears focus on esc + core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() + core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() + core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() + f.DKPModesMain.RollContainer.rollMax:SetFocus() + end + ) + f.DKPModesMain.RollContainer.rollMin:SetScript( + "OnEnterPressed", + function(self) -- clears focus on esc + core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() + core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() + core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() + self:ClearFocus() + end + ) + f.DKPModesMain.RollContainer.rollMin:SetScript( + "OnEnter", + function(self) + GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); + GameTooltip:SetText(L["MINIMUMROLL"], 0.25, 0.75, 0.90, 1, true); + GameTooltip:AddLine(L["MINIMUMROLLTTDESC"], 1.0, 1.0, 1.0, true); + GameTooltip:Show(); + end + ) + f.DKPModesMain.RollContainer.rollMin:SetScript( + "OnLeave", + function(self) + GameTooltip:Hide() + end + ) + + --- + -- Min Roll Header + --- f.DKPModesMain.RollContainer.rollMin.Header = f.DKPModesMain.RollContainer.rollMin:CreateFontString(nil, "OVERLAY") f.DKPModesMain.RollContainer.rollMin.Header:SetFontObject("CommDKPNormalLeft"); f.DKPModesMain.RollContainer.rollMin.Header:SetPoint("BOTTOM", f.DKPModesMain.RollContainer.rollMin, "TOP", -20, 2); f.DKPModesMain.RollContainer.rollMin.Header:SetText(L["MIN"]) - -- Dash Between Rolls - f.DKPModesMain.RollContainer.dash = f.DKPModesMain.RollContainer:CreateFontString(nil, "OVERLAY") - f.DKPModesMain.RollContainer.dash:SetFontObject("CommDKPLargeLeft"); - f.DKPModesMain.RollContainer.dash:SetPoint("LEFT", f.DKPModesMain.RollContainer.rollMin, "RIGHT", 9, 0); - f.DKPModesMain.RollContainer.dash:SetText("-") - - -- Max Roll Editbox - f.DKPModesMain.RollContainer.rollMax = CreateFrame("EditBox", nil, f.DKPModesMain.RollContainer) - f.DKPModesMain.RollContainer.rollMax:SetAutoFocus(false) - f.DKPModesMain.RollContainer.rollMax:SetMultiLine(false) - f.DKPModesMain.RollContainer.rollMax:SetPoint("LEFT", f.DKPModesMain.RollContainer.rollMin, "RIGHT", 24, 0) - f.DKPModesMain.RollContainer.rollMax:SetSize(70, 24) - f.DKPModesMain.RollContainer.rollMax:SetBackdrop({ - bgFile = "Textures\\white.blp", tile = true, - edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 1, edgeSize = 2, - }); - f.DKPModesMain.RollContainer.rollMax:SetBackdropColor(0,0,0,0.9) - f.DKPModesMain.RollContainer.rollMax:SetBackdropBorderColor(0.12, 0.12, 0.34, 1) - f.DKPModesMain.RollContainer.rollMax:SetMaxLetters(6) - f.DKPModesMain.RollContainer.rollMax:SetTextColor(1, 1, 1, 1) - f.DKPModesMain.RollContainer.rollMax:SetFontObject("CommDKPSmallRight") - f.DKPModesMain.RollContainer.rollMax:SetTextInsets(10, 15, 5, 5) - f.DKPModesMain.RollContainer.rollMax:SetText(core.DB.modes.rolls.max) - f.DKPModesMain.RollContainer.rollMax:SetScript("OnEscapePressed", function(self) -- clears focus on esc - core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() - core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() - core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() - self:ClearFocus() - end) - f.DKPModesMain.RollContainer.rollMax:SetScript("OnTabPressed", function(self) -- clears focus on esc + -- Dash Between Rolls + f.DKPModesMain.RollContainer.dash = f.DKPModesMain.RollContainer:CreateFontString(nil, "OVERLAY") + f.DKPModesMain.RollContainer.dash:SetFontObject("CommDKPLargeLeft"); + f.DKPModesMain.RollContainer.dash:SetPoint("LEFT", f.DKPModesMain.RollContainer.rollMin, "RIGHT", 9, 0); + f.DKPModesMain.RollContainer.dash:SetText("-") + + -- Max Roll Editbox + f.DKPModesMain.RollContainer.rollMax = CreateFrame("EditBox", nil, f.DKPModesMain.RollContainer, BackdropTemplateMixin and "BackdropTemplate" or nil) + f.DKPModesMain.RollContainer.rollMax:SetAutoFocus(false) + f.DKPModesMain.RollContainer.rollMax:SetMultiLine(false) + f.DKPModesMain.RollContainer.rollMax:SetPoint("LEFT", f.DKPModesMain.RollContainer.rollMin, "RIGHT", 24, 0) + f.DKPModesMain.RollContainer.rollMax:SetSize(70, 24) + f.DKPModesMain.RollContainer.rollMax:SetBackdrop({ + bgFile = "Textures\\white.blp", tile = true, + edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 1, edgeSize = 2, + }); + f.DKPModesMain.RollContainer.rollMax:SetBackdropColor(0,0,0,0.9) + f.DKPModesMain.RollContainer.rollMax:SetBackdropBorderColor(0.12, 0.12, 0.34, 1) + f.DKPModesMain.RollContainer.rollMax:SetMaxLetters(6) + f.DKPModesMain.RollContainer.rollMax:SetTextColor(1, 1, 1, 1) + f.DKPModesMain.RollContainer.rollMax:SetFontObject("CommDKPSmallRight") + f.DKPModesMain.RollContainer.rollMax:SetTextInsets(10, 15, 5, 5) + f.DKPModesMain.RollContainer.rollMax:SetText(core.DB.modes.rolls.max) + f.DKPModesMain.RollContainer.rollMax:SetScript("OnEscapePressed", function(self) -- clears focus on esc core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() - core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() - core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() - f.DKPModesMain.RollContainer.AddMax:SetFocus() + core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() + core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() + self:ClearFocus() + end) + f.DKPModesMain.RollContainer.rollMax:SetScript("OnTabPressed", function(self) -- clears focus on esc + core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() + core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() + core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() + f.DKPModesMain.RollContainer.AddMax:SetFocus() + end) + f.DKPModesMain.RollContainer.rollMax:SetScript("OnEnterPressed", function(self) -- clears focus on esc + core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() + core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() + core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() + self:ClearFocus() + end) + f.DKPModesMain.RollContainer.rollMax:SetScript("OnEnter", function(self) + GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); + GameTooltip:SetText(L["MAXIMUMROLL"], 0.25, 0.75, 0.90, 1, true); + GameTooltip:AddLine(L["MAXIMUMROLLTTDESC"], 1.0, 1.0, 1.0, true); + GameTooltip:AddLine(L["MAXIMUMROLLTTWARN"], 1.0, 0, 0, true); + GameTooltip:Show(); end) - f.DKPModesMain.RollContainer.rollMax:SetScript("OnEnterPressed", function(self) -- clears focus on esc - core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() - core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() - core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() - self:ClearFocus() + f.DKPModesMain.RollContainer.rollMax:SetScript("OnLeave", function(self) + GameTooltip:Hide() + end) + + -- Max Roll Header + f.DKPModesMain.RollContainer.rollMax.Header = f.DKPModesMain.RollContainer.rollMax:CreateFontString(nil, "OVERLAY") + f.DKPModesMain.RollContainer.rollMax.Header:SetFontObject("CommDKPNormalLeft"); + f.DKPModesMain.RollContainer.rollMax.Header:SetPoint("BOTTOM", f.DKPModesMain.RollContainer.rollMax, "TOP", -20, 2); + f.DKPModesMain.RollContainer.rollMax.Header:SetText(L["MAX"]) + + f.DKPModesMain.RollContainer.rollMin.perc = f.DKPModesMain.RollContainer.rollMin:CreateFontString(nil, "OVERLAY") + f.DKPModesMain.RollContainer.rollMin.perc:SetFontObject("CommDKPSmallLeft"); + f.DKPModesMain.RollContainer.rollMin.perc:SetPoint("LEFT", f.DKPModesMain.RollContainer.rollMin, "RIGHT", -15, 0); + f.DKPModesMain.RollContainer.rollMin.perc:SetText("%") + f.DKPModesMain.RollContainer.rollMin.perc:SetShown(core.DB.modes.rolls.UsePerc); + + f.DKPModesMain.RollContainer.rollMax.perc = f.DKPModesMain.RollContainer.rollMax:CreateFontString(nil, "OVERLAY") + f.DKPModesMain.RollContainer.rollMax.perc:SetFontObject("CommDKPSmallLeft"); + f.DKPModesMain.RollContainer.rollMax.perc:SetPoint("LEFT", f.DKPModesMain.RollContainer.rollMax, "RIGHT", -15, 0); + f.DKPModesMain.RollContainer.rollMax.perc:SetText("%") + f.DKPModesMain.RollContainer.rollMax.perc:SetShown(core.DB.modes.rolls.UsePerc); + + -- Percent Rolls Checkbox + f.DKPModesMain.RollContainer.UsePerc = CreateFrame("CheckButton", nil, f.DKPModesMain.RollContainer, "UICheckButtonTemplate"); + f.DKPModesMain.RollContainer.UsePerc:SetChecked(core.DB.modes.rolls.UsePerc) + f.DKPModesMain.RollContainer.UsePerc:SetScale(0.6); + f.DKPModesMain.RollContainer.UsePerc.text:SetText(" |cff5151de"..L["USEPERCENTAGE"].."|r"); + f.DKPModesMain.RollContainer.UsePerc.text:SetScale(1.5); + f.DKPModesMain.RollContainer.UsePerc.text:SetFontObject("CommDKPSmallLeft") + f.DKPModesMain.RollContainer.UsePerc:SetPoint("TOP", f.DKPModesMain.RollContainer.rollMin, "BOTTOMLEFT", 0, -10); + f.DKPModesMain.RollContainer.UsePerc:SetScript("OnClick", function(self) + core.DB.modes.rolls.UsePerc = self:GetChecked(); + f.DKPModesMain.RollContainer.rollMin.perc:SetShown(self:GetChecked()) + f.DKPModesMain.RollContainer.rollMax.perc:SetShown(self:GetChecked()) + if f.DKPModesMain.RollContainer.rollMax:GetNumber() == 0 then + f.DKPModesMain.RollContainer.rollMax:SetNumber(100) + end + PlaySound(808); end) - f.DKPModesMain.RollContainer.rollMax:SetScript("OnEnter", function(self) - GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); - GameTooltip:SetText(L["MAXIMUMROLL"], 0.25, 0.75, 0.90, 1, true); - GameTooltip:AddLine(L["MAXIMUMROLLTTDESC"], 1.0, 1.0, 1.0, true); - GameTooltip:AddLine(L["MAXIMUMROLLTTWARN"], 1.0, 0, 0, true); - GameTooltip:Show(); - end) - f.DKPModesMain.RollContainer.rollMax:SetScript("OnLeave", function(self) + f.DKPModesMain.RollContainer.UsePerc:SetScript("OnEnter", function(self) + GameTooltip:SetOwner(self, "ANCHOR_LEFT"); + GameTooltip:SetText(L["USEPERCFORROLLS"], 0.25, 0.75, 0.90, 1, true); + GameTooltip:AddLine(L["USEPERCROLLSTTDESC"], 1.0, 1.0, 1.0, true); + GameTooltip:AddLine(L["USEPERCROLLSTTWARN"], 1.0, 0, 0, true); + GameTooltip:Show(); + end) + f.DKPModesMain.RollContainer.UsePerc:SetScript("OnLeave", function(self) GameTooltip:Hide() end) - -- Max Roll Header - f.DKPModesMain.RollContainer.rollMax.Header = f.DKPModesMain.RollContainer.rollMax:CreateFontString(nil, "OVERLAY") - f.DKPModesMain.RollContainer.rollMax.Header:SetFontObject("CommDKPNormalLeft"); - f.DKPModesMain.RollContainer.rollMax.Header:SetPoint("BOTTOM", f.DKPModesMain.RollContainer.rollMax, "TOP", -20, 2); - f.DKPModesMain.RollContainer.rollMax.Header:SetText(L["MAX"]) - - f.DKPModesMain.RollContainer.rollMin.perc = f.DKPModesMain.RollContainer.rollMin:CreateFontString(nil, "OVERLAY") - f.DKPModesMain.RollContainer.rollMin.perc:SetFontObject("CommDKPSmallLeft"); - f.DKPModesMain.RollContainer.rollMin.perc:SetPoint("LEFT", f.DKPModesMain.RollContainer.rollMin, "RIGHT", -15, 0); - f.DKPModesMain.RollContainer.rollMin.perc:SetText("%") - f.DKPModesMain.RollContainer.rollMin.perc:SetShown(core.DB.modes.rolls.UsePerc); - - f.DKPModesMain.RollContainer.rollMax.perc = f.DKPModesMain.RollContainer.rollMax:CreateFontString(nil, "OVERLAY") - f.DKPModesMain.RollContainer.rollMax.perc:SetFontObject("CommDKPSmallLeft"); - f.DKPModesMain.RollContainer.rollMax.perc:SetPoint("LEFT", f.DKPModesMain.RollContainer.rollMax, "RIGHT", -15, 0); - f.DKPModesMain.RollContainer.rollMax.perc:SetText("%") - f.DKPModesMain.RollContainer.rollMax.perc:SetShown(core.DB.modes.rolls.UsePerc); - - -- Percent Rolls Checkbox - f.DKPModesMain.RollContainer.UsePerc = CreateFrame("CheckButton", nil, f.DKPModesMain.RollContainer, "UICheckButtonTemplate"); - f.DKPModesMain.RollContainer.UsePerc:SetChecked(core.DB.modes.rolls.UsePerc) - f.DKPModesMain.RollContainer.UsePerc:SetScale(0.6); - f.DKPModesMain.RollContainer.UsePerc.text:SetText(" |cff5151de"..L["USEPERCENTAGE"].."|r"); - f.DKPModesMain.RollContainer.UsePerc.text:SetScale(1.5); - f.DKPModesMain.RollContainer.UsePerc.text:SetFontObject("CommDKPSmallLeft") - f.DKPModesMain.RollContainer.UsePerc:SetPoint("TOP", f.DKPModesMain.RollContainer.rollMin, "BOTTOMLEFT", 0, -10); - f.DKPModesMain.RollContainer.UsePerc:SetScript("OnClick", function(self) - core.DB.modes.rolls.UsePerc = self:GetChecked(); - f.DKPModesMain.RollContainer.rollMin.perc:SetShown(self:GetChecked()) - f.DKPModesMain.RollContainer.rollMax.perc:SetShown(self:GetChecked()) - if f.DKPModesMain.RollContainer.rollMax:GetNumber() == 0 then - f.DKPModesMain.RollContainer.rollMax:SetNumber(100) + -- Add to Max Editbox + f.DKPModesMain.RollContainer.AddMax = CreateFrame("EditBox", nil, f.DKPModesMain.RollContainer, BackdropTemplateMixin and "BackdropTemplate" or nil) + f.DKPModesMain.RollContainer.AddMax:SetAutoFocus(false) + f.DKPModesMain.RollContainer.AddMax:SetMultiLine(false) + f.DKPModesMain.RollContainer.AddMax:SetPoint("TOP", f.DKPModesMain.RollContainer.rollMax, "BOTTOM", 0, -30) + f.DKPModesMain.RollContainer.AddMax:SetSize(70, 24) + f.DKPModesMain.RollContainer.AddMax:SetBackdrop({ + bgFile = "Textures\\white.blp", tile = true, + edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 1, edgeSize = 2, + }); + f.DKPModesMain.RollContainer.AddMax:SetBackdropColor(0,0,0,0.9) + f.DKPModesMain.RollContainer.AddMax:SetBackdropBorderColor(0.12, 0.12, 0.34, 1) + f.DKPModesMain.RollContainer.AddMax:SetMaxLetters(6) + f.DKPModesMain.RollContainer.AddMax:SetTextColor(1, 1, 1, 1) + f.DKPModesMain.RollContainer.AddMax:SetFontObject("CommDKPSmallRight") + f.DKPModesMain.RollContainer.AddMax:SetTextInsets(10, 15, 5, 5) + f.DKPModesMain.RollContainer.AddMax:SetText(core.DB.modes.rolls.AddToMax) + f.DKPModesMain.RollContainer.AddMax:SetScript("OnEscapePressed", function(self) -- clears focus on esc + core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() + core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() + core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() + self:ClearFocus() + end) + f.DKPModesMain.RollContainer.AddMax:SetScript("OnTabPressed", function(self) -- clears focus on esc + core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() + core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() + core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() + f.DKPModesMain.RollContainer.rollMin:SetFocus() + end) + f.DKPModesMain.RollContainer.AddMax:SetScript("OnEnterPressed", function(self) -- clears focus on esc + core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() + core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() + core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() + self:ClearFocus() + end) + f.DKPModesMain.RollContainer.AddMax:SetScript("OnEnter", function(self) + GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); + GameTooltip:SetText(L["ADDTOMAXROLL"], 0.25, 0.75, 0.90, 1, true); + GameTooltip:AddLine(L["ADDTOMAXROLLTTDESC"], 1.0, 1.0, 1.0, true); + GameTooltip:AddLine(L["ADDTOMAXROLLTTWARN"], 1.0, 0, 0, true); + GameTooltip:Show(); + end) + f.DKPModesMain.RollContainer.AddMax:SetScript("OnLeave", function(self) + GameTooltip:Hide() + end) + + -- Add to Max Header + f.DKPModesMain.RollContainer.AddMax.Header = f.DKPModesMain.RollContainer.rollMax:CreateFontString(nil, "OVERLAY") + f.DKPModesMain.RollContainer.AddMax.Header:SetFontObject("CommDKPSmallRight"); + f.DKPModesMain.RollContainer.AddMax.Header:SetPoint("RIGHT", f.DKPModesMain.RollContainer.AddMax, "LEFT", -5, 0); + f.DKPModesMain.RollContainer.AddMax.Header:SetText(L["ADDTOMAXROLL"]..": ") + + -- hide default roll extra options if Ni Karma is selected + if core.DB.modes.RollMode == "Ni Karma" then + f.DKPModesMain.RollContainer.UsePerc:Hide() + f.DKPModesMain.RollContainer.UsePerc.text:Hide() + f.DKPModesMain.RollContainer.AddMax:Hide() + f.DKPModesMain.RollContainer.AddMax.Header:Hide() end - PlaySound(808); - end) - f.DKPModesMain.RollContainer.UsePerc:SetScript("OnEnter", function(self) - GameTooltip:SetOwner(self, "ANCHOR_LEFT"); - GameTooltip:SetText(L["USEPERCFORROLLS"], 0.25, 0.75, 0.90, 1, true); - GameTooltip:AddLine(L["USEPERCROLLSTTDESC"], 1.0, 1.0, 1.0, true); - GameTooltip:AddLine(L["USEPERCROLLSTTWARN"], 1.0, 0, 0, true); - GameTooltip:Show(); - end) - f.DKPModesMain.RollContainer.UsePerc:SetScript("OnLeave", function(self) - GameTooltip:Hide() - end) - -- Add to Max Editbox - f.DKPModesMain.RollContainer.AddMax = CreateFrame("EditBox", nil, f.DKPModesMain.RollContainer) - f.DKPModesMain.RollContainer.AddMax:SetAutoFocus(false) - f.DKPModesMain.RollContainer.AddMax:SetMultiLine(false) - f.DKPModesMain.RollContainer.AddMax:SetPoint("TOP", f.DKPModesMain.RollContainer.rollMax, "BOTTOM", 0, -30) - f.DKPModesMain.RollContainer.AddMax:SetSize(70, 24) - f.DKPModesMain.RollContainer.AddMax:SetBackdrop({ - bgFile = "Textures\\white.blp", tile = true, - edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 1, edgeSize = 2, - }); - f.DKPModesMain.RollContainer.AddMax:SetBackdropColor(0,0,0,0.9) - f.DKPModesMain.RollContainer.AddMax:SetBackdropBorderColor(0.12, 0.12, 0.34, 1) - f.DKPModesMain.RollContainer.AddMax:SetMaxLetters(6) - f.DKPModesMain.RollContainer.AddMax:SetTextColor(1, 1, 1, 1) - f.DKPModesMain.RollContainer.AddMax:SetFontObject("CommDKPSmallRight") - f.DKPModesMain.RollContainer.AddMax:SetTextInsets(10, 15, 5, 5) - f.DKPModesMain.RollContainer.AddMax:SetText(core.DB.modes.rolls.AddToMax) - f.DKPModesMain.RollContainer.AddMax:SetScript("OnEscapePressed", function(self) -- clears focus on esc - core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() - core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() - core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() - self:ClearFocus() - end) - f.DKPModesMain.RollContainer.AddMax:SetScript("OnTabPressed", function(self) -- clears focus on esc - core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() - core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() - core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() - f.DKPModesMain.RollContainer.rollMin:SetFocus() - end) - f.DKPModesMain.RollContainer.AddMax:SetScript("OnEnterPressed", function(self) -- clears focus on esc - core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() - core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() - core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() - self:ClearFocus() - end) - f.DKPModesMain.RollContainer.AddMax:SetScript("OnEnter", function(self) - GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); - GameTooltip:SetText(L["ADDTOMAXROLL"], 0.25, 0.75, 0.90, 1, true); - GameTooltip:AddLine(L["ADDTOMAXROLLTTDESC"], 1.0, 1.0, 1.0, true); - GameTooltip:AddLine(L["ADDTOMAXROLLTTWARN"], 1.0, 0, 0, true); - GameTooltip:Show(); - end) - f.DKPModesMain.RollContainer.AddMax:SetScript("OnLeave", function(self) - GameTooltip:Hide() - end) + -------------- + + --- + -- Ni Karma sub section + --- + + --- + -- Max Karma + --- + + + + f.DKPModesMain.RollContainer.maxKarma = CreateFrame("EditBox", nil, f.DKPModesMain.RollContainer, BackdropTemplateMixin and "BackdropTemplate" or nil) + f.DKPModesMain.RollContainer.maxKarma:SetAutoFocus(false) + f.DKPModesMain.RollContainer.maxKarma:SetMultiLine(false) + f.DKPModesMain.RollContainer.maxKarma:SetPoint("TOP", f.DKPModesMain.RollContainer.rollMax, "BOTTOM", 0, -30) + f.DKPModesMain.RollContainer.maxKarma:SetSize(70, 24) + f.DKPModesMain.RollContainer.maxKarma:SetBackdrop({ + bgFile = "Textures\\white.blp", tile = true, + edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 1, edgeSize = 2, + }); + f.DKPModesMain.RollContainer.maxKarma:SetBackdropColor(0,0,0,0.9) + f.DKPModesMain.RollContainer.maxKarma:SetBackdropBorderColor(0.12, 0.12, 0.34, 1) + f.DKPModesMain.RollContainer.maxKarma:SetMaxLetters(6) + f.DKPModesMain.RollContainer.maxKarma:SetTextColor(1, 1, 1, 1) + f.DKPModesMain.RollContainer.maxKarma:SetFontObject("CommDKPSmallRight") + f.DKPModesMain.RollContainer.maxKarma:SetTextInsets(10, 15, 5, 5) + if core.DB.modes.rolls.maxKarma == nil then + f.DKPModesMain.RollContainer.maxKarma:SetText("") + else + f.DKPModesMain.RollContainer.maxKarma:SetText(core.DB.modes.rolls.maxKarma) + end + + + f.DKPModesMain.RollContainer.maxKarma:SetScript( + "OnEscapePressed", + function(self) -- clears focus on esc + core.DB.modes.rolls.maxKarma = f.DKPModesMain.RollContainer.maxKarma:GetNumber() + self:ClearFocus() + end + ) + f.DKPModesMain.RollContainer.maxKarma:SetScript( + "OnTabPressed", + function(self) -- clears focus on esc + core.DB.modes.rolls.maxKarma = f.DKPModesMain.RollContainer.maxKarma:GetNumber() + self:ClearFocus() + end + ) + f.DKPModesMain.RollContainer.maxKarma:SetScript( + "OnEnterPressed", + function(self) -- clears focus on esc + core.DB.modes.rolls.maxKarma = f.DKPModesMain.RollContainer.maxKarma:GetNumber() + self:ClearFocus() + end + ) + f.DKPModesMain.RollContainer.maxKarma:SetScript( + "OnEnter", + function(self) + GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); + GameTooltip:SetText(L["MINIMUMROLL"], 0.25, 0.75, 0.90, 1, true); + GameTooltip:AddLine(L["MINIMUMROLLTTDESC"], 1.0, 1.0, 1.0, true); + GameTooltip:Show(); + end + ) + f.DKPModesMain.RollContainer.maxKarma:SetScript( + "OnLeave", + function(self) + GameTooltip:Hide() + end + ) + + -- max karma header + f.DKPModesMain.RollContainer.maxKarma.Header = f.DKPModesMain.RollContainer.rollMax:CreateFontString(nil, "OVERLAY") + f.DKPModesMain.RollContainer.maxKarma.Header:SetFontObject("CommDKPSmallRight"); + f.DKPModesMain.RollContainer.maxKarma.Header:SetPoint("RIGHT", f.DKPModesMain.RollContainer.maxKarma, "LEFT", -5, 0); + f.DKPModesMain.RollContainer.maxKarma.Header:SetText("Max Karma to add"..": ") + + if core.DB.modes.RollMode == "Default" then + f.DKPModesMain.RollContainer.maxKarma:Hide() + f.DKPModesMain.RollContainer.maxKarma.Header:Hide() + end - -- Add to Max Header - f.DKPModesMain.RollContainer.AddMax.Header = f.DKPModesMain.RollContainer.rollMax:CreateFontString(nil, "OVERLAY") - f.DKPModesMain.RollContainer.AddMax.Header:SetFontObject("CommDKPSmallRight"); - f.DKPModesMain.RollContainer.AddMax.Header:SetPoint("RIGHT", f.DKPModesMain.RollContainer.AddMax, "LEFT", -5, 0); - f.DKPModesMain.RollContainer.AddMax.Header:SetText(L["ADDTOMAXROLL"]..": ") -- Broadcast DKP Modes Button f.DKPModesMain.BroadcastSettings = self:CreateButton("BOTTOMRIGHT", f.DKPModesMain, "BOTTOMRIGHT", -30, 30, L["BROADCASTSETTINGS"]); @@ -993,6 +1195,7 @@ elseif core.DB.modes.mode == "Static Item Values" then core.DB.modes.rolls.min = f.DKPModesMain.RollContainer.rollMin:GetNumber() core.DB.modes.rolls.max = f.DKPModesMain.RollContainer.rollMax:GetNumber() core.DB.modes.rolls.AddToMax = f.DKPModesMain.RollContainer.AddMax:GetNumber() + core.DB.modes.rolls.maxKarma = f.DKPModesMain.RollContainer.maxKarma:GetNumber() if (core.DB.modes.rolls.min > core.DB.modes.rolls.max and core.DB.modes.rolls.max ~= 0 and core.DB.modes.rolls.UserPerc == false) or (core.DB.modes.rolls.UsePerc and (core.DB.modes.rolls.min < 0 or core.DB.modes.rolls.max > 100 or core.DB.modes.rolls.min > core.DB.modes.rolls.max)) then StaticPopupDialogs["NOTIFY_ROLLS"] = { diff --git a/Modules/Options.lua b/Modules/Options.lua index d7de1ab9..3913917e 100644 --- a/Modules/Options.lua +++ b/Modules/Options.lua @@ -100,7 +100,7 @@ function CommDKP:Options() CommDKP.ConfigTab4.description:SetText("|CFFcca600"..L["DEFAULTDKPAWARDVALUES"].."|r"); for i=1, 6 do - CommDKP.ConfigTab4.default[i] = CreateFrame("EditBox", nil, CommDKP.ConfigTab4) + CommDKP.ConfigTab4.default[i] = CreateFrame("EditBox", nil, CommDKP.ConfigTab4, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab4.default[i]:SetAutoFocus(false) CommDKP.ConfigTab4.default[i]:SetMultiLine(false) CommDKP.ConfigTab4.default[i]:SetSize(80, 24) @@ -264,7 +264,7 @@ function CommDKP:Options() CommDKP.ConfigTab4.DefaultMinBids.SlotBox = SlotBox; for i=1, 17 do - CommDKP.ConfigTab4.DefaultMinBids.SlotBox[i] = CreateFrame("EditBox", nil, CommDKP.ConfigTab4) + CommDKP.ConfigTab4.DefaultMinBids.SlotBox[i] = CreateFrame("EditBox", nil, CommDKP.ConfigTab4, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab4.DefaultMinBids.SlotBox[i]:SetAutoFocus(false) CommDKP.ConfigTab4.DefaultMinBids.SlotBox[i]:SetMultiLine(false) CommDKP.ConfigTab4.DefaultMinBids.SlotBox[i]:SetSize(60, 24) @@ -531,7 +531,7 @@ function CommDKP:Options() CommDKP.ConfigTab4.DefaultMaxBids.SlotBox = SlotBox; for i=1, 17 do - CommDKP.ConfigTab4.DefaultMaxBids.SlotBox[i] = CreateFrame("EditBox", nil, CommDKP.ConfigTab4) + CommDKP.ConfigTab4.DefaultMaxBids.SlotBox[i] = CreateFrame("EditBox", nil, CommDKP.ConfigTab4, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab4.DefaultMaxBids.SlotBox[i]:SetAutoFocus(false) CommDKP.ConfigTab4.DefaultMaxBids.SlotBox[i]:SetMultiLine(false) CommDKP.ConfigTab4.DefaultMaxBids.SlotBox[i]:SetSize(60, 24) @@ -765,6 +765,13 @@ function CommDKP:Options() end -- Bid Timer Slider CommDKP.ConfigTab4.bidTimerSlider = CreateFrame("SLIDER", "$parentBidTimerSlider", CommDKP.ConfigTab4, "CommDKPOptionsSliderTemplate"); + Mixin(CommDKP.ConfigTab4.bidTimerSlider, BackdropTemplateMixin) + CommDKP.ConfigTab4.bidTimerSlider:SetBackdrop({ + bgFile = "Interface\\Buttons\\UI-SliderBar-Background", + edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", + tile = true, tileSize = 8, edgeSize = 8, + insets = { left = 3, right = 3, top = 6, bottom = 6 } + }) if core.DB.modes.mode == "Minimum Bid Values" or (core.DB.modes.mode == "Zero Sum" and core.DB.modes.ZeroSumBidType == "Minimum Bid") then CommDKP.ConfigTab4.bidTimerSlider:SetPoint("TOPLEFT", CommDKP.ConfigTab4.DefaultMaxBids, "BOTTOMLEFT", 54, -40); else @@ -787,7 +794,7 @@ function CommDKP:Options() CommDKP.ConfigTab4.bidTimerHeader:SetPoint("BOTTOM", CommDKP.ConfigTab4.bidTimerSlider, "TOP", 0, 3); CommDKP.ConfigTab4.bidTimerHeader:SetText(L["BIDTIMER"]) - CommDKP.ConfigTab4.bidTimer = CreateFrame("EditBox", nil, CommDKP.ConfigTab4) + CommDKP.ConfigTab4.bidTimer = CreateFrame("EditBox", nil, CommDKP.ConfigTab4, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab4.bidTimer:SetAutoFocus(false) CommDKP.ConfigTab4.bidTimer:SetMultiLine(false) CommDKP.ConfigTab4.bidTimer:SetSize(50, 18) @@ -821,6 +828,15 @@ function CommDKP:Options() else CommDKP.ConfigTab4.TooltipHistorySlider:SetPoint("TOP", CommDKP.ConfigTab4, "TOP", 1, -107); end + + Mixin(CommDKP.ConfigTab4.TooltipHistorySlider, BackdropTemplateMixin) + CommDKP.ConfigTab4.TooltipHistorySlider:SetBackdrop({ + bgFile = "Interface\\Buttons\\UI-SliderBar-Background", + edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", + tile = true, tileSize = 8, edgeSize = 8, + insets = { left = 3, right = 3, top = 6, bottom = 6 } + }) + CommDKP.ConfigTab4.TooltipHistorySlider:SetMinMaxValues(5, 35); CommDKP.ConfigTab4.TooltipHistorySlider:SetValue(core.DB.defaults.TooltipHistoryCount); CommDKP.ConfigTab4.TooltipHistorySlider:SetValueStep(1); @@ -838,7 +854,7 @@ function CommDKP:Options() CommDKP.ConfigTab4.TooltipHistoryHeader:SetPoint("BOTTOM", CommDKP.ConfigTab4.TooltipHistorySlider, "TOP", 0, 3); CommDKP.ConfigTab4.TooltipHistoryHeader:SetText(L["TTHISTORYCOUNT"]) - CommDKP.ConfigTab4.TooltipHistory = CreateFrame("EditBox", nil, CommDKP.ConfigTab4) + CommDKP.ConfigTab4.TooltipHistory = CreateFrame("EditBox", nil, CommDKP.ConfigTab4, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab4.TooltipHistory:SetAutoFocus(false) CommDKP.ConfigTab4.TooltipHistory:SetMultiLine(false) CommDKP.ConfigTab4.TooltipHistory:SetSize(50, 18) @@ -867,11 +883,21 @@ function CommDKP:Options() -- Loot History Limit Slider CommDKP.ConfigTab4.historySlider = CreateFrame("SLIDER", "$parentHistorySlider", CommDKP.ConfigTab4, "CommDKPOptionsSliderTemplate"); + if CommDKP.ConfigTab4.bidTimer then CommDKP.ConfigTab4.historySlider:SetPoint("TOPLEFT", CommDKP.ConfigTab4.bidTimerSlider, "BOTTOMLEFT", 0, -50); else CommDKP.ConfigTab4.historySlider:SetPoint("TOPRIGHT", CommDKP.ConfigTab4.TooltipHistorySlider, "BOTTOMLEFT", 56, -49); end + + Mixin(CommDKP.ConfigTab4.historySlider, BackdropTemplateMixin) + CommDKP.ConfigTab4.historySlider:SetBackdrop({ + bgFile = "Interface\\Buttons\\UI-SliderBar-Background", + edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", + tile = true, tileSize = 8, edgeSize = 8, + insets = { left = 3, right = 3, top = 6, bottom = 6 } + }) + CommDKP.ConfigTab4.historySlider:SetMinMaxValues(100, 2500); CommDKP.ConfigTab4.historySlider:SetValue(core.DB.defaults.HistoryLimit); CommDKP.ConfigTab4.historySlider:SetValueStep(25); @@ -890,7 +916,7 @@ function CommDKP:Options() CommDKP.ConfigTab4.HistoryHeader:SetPoint("BOTTOM", CommDKP.ConfigTab4.historySlider, "TOP", 0, 3); CommDKP.ConfigTab4.HistoryHeader:SetText(L["LOOTHISTORYLIMIT"]) - CommDKP.ConfigTab4.history = CreateFrame("EditBox", nil, CommDKP.ConfigTab4) + CommDKP.ConfigTab4.history = CreateFrame("EditBox", nil, CommDKP.ConfigTab4, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab4.history:SetAutoFocus(false) CommDKP.ConfigTab4.history:SetMultiLine(false) CommDKP.ConfigTab4.history:SetSize(50, 18) @@ -918,6 +944,13 @@ function CommDKP:Options() -- DKP History Limit Slider CommDKP.ConfigTab4.DKPHistorySlider = CreateFrame("SLIDER", "$parentDKPHistorySlider", CommDKP.ConfigTab4, "CommDKPOptionsSliderTemplate"); + Mixin(CommDKP.ConfigTab4.DKPHistorySlider, BackdropTemplateMixin) + CommDKP.ConfigTab4.DKPHistorySlider:SetBackdrop({ + bgFile = "Interface\\Buttons\\UI-SliderBar-Background", + edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", + tile = true, tileSize = 8, edgeSize = 8, + insets = { left = 3, right = 3, top = 6, bottom = 6 } + }) CommDKP.ConfigTab4.DKPHistorySlider:SetPoint("LEFT", CommDKP.ConfigTab4.historySlider, "RIGHT", 30, 0); CommDKP.ConfigTab4.DKPHistorySlider:SetMinMaxValues(100, 2500); CommDKP.ConfigTab4.DKPHistorySlider:SetValue(core.DB.defaults.DKPHistoryLimit); @@ -937,7 +970,7 @@ function CommDKP:Options() CommDKP.ConfigTab4.DKPHistoryHeader:SetPoint("BOTTOM", CommDKP.ConfigTab4.DKPHistorySlider, "TOP", 0, 3); CommDKP.ConfigTab4.DKPHistoryHeader:SetText(L["DKPHISTORYLIMIT"]) - CommDKP.ConfigTab4.DKPHistory = CreateFrame("EditBox", nil, CommDKP.ConfigTab4) + CommDKP.ConfigTab4.DKPHistory = CreateFrame("EditBox", nil, CommDKP.ConfigTab4, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab4.DKPHistory:SetAutoFocus(false) CommDKP.ConfigTab4.DKPHistory:SetMultiLine(false) CommDKP.ConfigTab4.DKPHistory:SetSize(50, 18) @@ -965,6 +998,13 @@ function CommDKP:Options() -- Bid Timer Size Slider CommDKP.ConfigTab4.TimerSizeSlider = CreateFrame("SLIDER", "$parentBidTimerSizeSlider", CommDKP.ConfigTab4, "CommDKPOptionsSliderTemplate"); + Mixin(CommDKP.ConfigTab4.TimerSizeSlider, BackdropTemplateMixin) + CommDKP.ConfigTab4.TimerSizeSlider:SetBackdrop({ + bgFile = "Interface\\Buttons\\UI-SliderBar-Background", + edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", + tile = true, tileSize = 8, edgeSize = 8, + insets = { left = 3, right = 3, top = 6, bottom = 6 } + }) CommDKP.ConfigTab4.TimerSizeSlider:SetPoint("TOPLEFT", CommDKP.ConfigTab4.historySlider, "BOTTOMLEFT", 0, -50); CommDKP.ConfigTab4.TimerSizeSlider:SetMinMaxValues(0.5, 2.0); CommDKP.ConfigTab4.TimerSizeSlider:SetValue(core.DB.defaults.BidTimerSize); @@ -986,7 +1026,7 @@ function CommDKP:Options() CommDKP.ConfigTab4.DKPHistoryHeader:SetPoint("BOTTOM", CommDKP.ConfigTab4.TimerSizeSlider, "TOP", 0, 3); CommDKP.ConfigTab4.DKPHistoryHeader:SetText(L["TIMERSIZE"]) - CommDKP.ConfigTab4.TimerSize = CreateFrame("EditBox", nil, CommDKP.ConfigTab4) + CommDKP.ConfigTab4.TimerSize = CreateFrame("EditBox", nil, CommDKP.ConfigTab4, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab4.TimerSize:SetAutoFocus(false) CommDKP.ConfigTab4.TimerSize:SetMultiLine(false) CommDKP.ConfigTab4.TimerSize:SetSize(50, 18) @@ -1014,6 +1054,13 @@ function CommDKP:Options() -- UI Scale Size Slider CommDKP.ConfigTab4.CommDKPScaleSize = CreateFrame("SLIDER", "$parentCommDKPScaleSizeSlider", CommDKP.ConfigTab4, "CommDKPOptionsSliderTemplate"); + Mixin(CommDKP.ConfigTab4.CommDKPScaleSize, BackdropTemplateMixin) + CommDKP.ConfigTab4.CommDKPScaleSize:SetBackdrop({ + bgFile = "Interface\\Buttons\\UI-SliderBar-Background", + edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", + tile = true, tileSize = 8, edgeSize = 8, + insets = { left = 3, right = 3, top = 6, bottom = 6 } + }) CommDKP.ConfigTab4.CommDKPScaleSize:SetPoint("TOPLEFT", CommDKP.ConfigTab4.DKPHistorySlider, "BOTTOMLEFT", 0, -50); CommDKP.ConfigTab4.CommDKPScaleSize:SetMinMaxValues(0.5, 2.0); CommDKP.ConfigTab4.CommDKPScaleSize:SetValue(core.DB.defaults.CommDKPScaleSize); @@ -1034,7 +1081,7 @@ function CommDKP:Options() CommDKP.ConfigTab4.DKPHistoryHeader:SetPoint("BOTTOM", CommDKP.ConfigTab4.CommDKPScaleSize, "TOP", 0, 3); CommDKP.ConfigTab4.DKPHistoryHeader:SetText(L["MAINGUISIZE"]) - CommDKP.ConfigTab4.UIScaleSize = CreateFrame("EditBox", nil, CommDKP.ConfigTab4) + CommDKP.ConfigTab4.UIScaleSize = CreateFrame("EditBox", nil, CommDKP.ConfigTab4, BackdropTemplateMixin and "BackdropTemplate" or nil) CommDKP.ConfigTab4.UIScaleSize:SetAutoFocus(false) CommDKP.ConfigTab4.UIScaleSize:SetMultiLine(false) CommDKP.ConfigTab4.UIScaleSize:SetSize(50, 18) diff --git a/Modules/ZeroSumBank.lua b/Modules/ZeroSumBank.lua index 4d3cdb7f..20504d22 100644 --- a/Modules/ZeroSumBank.lua +++ b/Modules/ZeroSumBank.lua @@ -86,7 +86,7 @@ function CommDKP:ZeroSumBank_Update() end function CommDKP:ZeroSumBank_Create() - local f = CreateFrame("Frame", "CommDKP_DKPZeroSumBankFrame", UIParent, "ShadowOverlaySmallTemplate"); + local f = CreateFrame("Frame", "CommDKP_DKPZeroSumBankFrame", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil); if not core.DB.modes.ZeroSumBank then core.DB.modes.ZeroSumBank = 0 end @@ -109,7 +109,7 @@ function CommDKP:ZeroSumBank_Create() f:Hide() -- Close Button - f.closeContainer = CreateFrame("Frame", "CommDKPZeroSumBankWindowCloseButtonContainer", f) + f.closeContainer = CreateFrame("Frame", "CommDKPZeroSumBankWindowCloseButtonContainer", f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.closeContainer:SetPoint("CENTER", f, "TOPRIGHT", -4, 0) f.closeContainer:SetBackdrop({ bgFile = "Textures\\white.blp", tile = true, @@ -119,7 +119,7 @@ function CommDKP:ZeroSumBank_Create() f.closeContainer:SetBackdropBorderColor(1,1,1,0.2) f.closeContainer:SetSize(28, 28) - f.closeBtn = CreateFrame("Button", nil, f, "UIPanelCloseButton") + f.closeBtn = CreateFrame("Button", nil, f, "UIPanelCloseButton", BackdropTemplateMixin and "BackdropTemplate" or nil) f.closeBtn:SetPoint("CENTER", f.closeContainer, "TOPRIGHT", -14, -14) f.BankHeader = f:CreateFontString(nil, "OVERLAY") @@ -138,7 +138,7 @@ function CommDKP:ZeroSumBank_Create() f.Boss.Header:SetPoint("RIGHT", f.Boss, "LEFT", -7, 0); f.Boss.Header:SetText(L["BOSS"]..": ") - f.Balance = CreateFrame("EditBox", nil, f) + f.Balance = CreateFrame("EditBox", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.Balance:SetPoint("TOPLEFT", f, "TOPLEFT", 70, -65) f.Balance:SetAutoFocus(false) f.Balance:SetMultiLine(false) @@ -232,7 +232,7 @@ function CommDKP:ZeroSumBank_Create() end) -- Loot List Frame - f.LootFrame = CreateFrame("Frame", "CommDKPZeroSumBankLootListContainer", f, "ShadowOverlaySmallTemplate") + f.LootFrame = CreateFrame("Frame", "CommDKPZeroSumBankLootListContainer", f, BackdropTemplateMixin and "BackdropTemplate" or nil) f.LootFrame:SetPoint("TOPRIGHT", f.IncludeStandby, "BOTTOM", 95, -5) f.LootFrame:SetSize(305, 190) f.LootFrame:SetBackdrop({ diff --git a/Modules/comm.lua b/Modules/comm.lua index d2fb946c..8871aae9 100644 --- a/Modules/comm.lua +++ b/Modules/comm.lua @@ -249,7 +249,7 @@ function CommDKP.Sync:OnCommReceived(prefix, message, distribution, sender) end end -function CommDKP.Sync:SendData(prefix, data, target, targetTeam) +function CommDKP.Sync:SendData(prefix, data, target, targetTeam, prio) -- 2.3.0 object being sent with almost everything? -- the idea is to envelope the old message into another object and then decode it on receiving end @@ -320,7 +320,13 @@ function CommDKP.Sync:SendData(prefix, data, target, targetTeam) end if prefix == "CommDKPBCastMsg" then - CommDKP:CastMsgSend(prefix, _compressedObj, "RAID"); + + if target == nil then + CommDKP:CastMsgSend(prefix, _compressedObj, target, nil, prio); + else + CommDKP:CastMsgSend(prefix, _compressedObj, "WHISPER", target, prio); + end; + return; end @@ -412,10 +418,10 @@ function CommDKP:AllTabsSend(prefix, commObject, channel) if channel then -- check if we are targeting specific player print("[CommunityDKP] COMMS: You started Full Broadcast for team "..CommDKP:GetTeamName(CommDKP:GetCurrentTeamIndex()).." to player "..channel); - CommDKP.Sync:SendCommMessage(prefix, commObject, "WHISPER", channel, "NORMAL", CommDKP_BroadcastFull_Callback, nil); + CommDKP.Sync:SendCommMessage(prefix, commObject, "WHISPER", channel, "NORMAL", CommDKP_BroadcastFull_Callback, channel); else CommDKP.Sync:SendData("CommDKPPreBroad", prefix, nil); - CommDKP.Sync:SendCommMessage(prefix, commObject, _channel, nil, "NORMAL", CommDKP_BroadcastFull_Callback, nil); + CommDKP.Sync:SendCommMessage(prefix, commObject, _channel, nil, "NORMAL", CommDKP_BroadcastFull_Callback, _channel); end end @@ -542,10 +548,10 @@ function CommDKP:MergeSend(prefix, commObject, channel) if channel then -- check if we are targeting specific player print("[CommunityDKP] COMMS: You started 2-week broadcast for team "..CommDKP:GetTeamName(CommDKP:GetCurrentTeamIndex()).." to player "..channel); - CommDKP.Sync:SendCommMessage(prefix, commObject, "WHISPER", channel, "NORMAL", CommDKP_BroadcastFull_Callback, nil); + CommDKP.Sync:SendCommMessage(prefix, commObject, "WHISPER", channel, "NORMAL", CommDKP_BroadcastFull_Callback, channel); else CommDKP.Sync:SendData("CommDKPPreBroad", prefix, nil); - CommDKP.Sync:SendCommMessage(prefix, commObject, _channel, nil, "NORMAL", CommDKP_BroadcastFull_Callback, nil); + CommDKP.Sync:SendCommMessage(prefix, commObject, _channel, nil, "NORMAL", CommDKP_BroadcastFull_Callback, _channel); end end @@ -988,10 +994,16 @@ end -- CommDKPBCastMsg message HANDLERS ---------- -function CommDKP:CastMsgSend(prefix, commObject, channel) +function CommDKP:CastMsgSend(prefix, commObject, channel, player, prio) local _channel = channel or "RAID"; local _prefix = prefix or "CommDKPBCastMsg"; - CommDKP.Sync:SendCommMessage(_prefix, commObject, _channel); + local _prio = prio or "NORMAL"; + + if player == nil then + CommDKP.Sync:SendCommMessage(_prefix, commObject, _channel, nil, _prio, nil, nil); + else + CommDKP.Sync:SendCommMessage(_prefix, commObject, "WHISPER", player, _prio, nil, nil); + end; end diff --git a/TableFunctions.lua b/TableFunctions.lua index 2bd0dd53..93aa11b8 100644 --- a/TableFunctions.lua +++ b/TableFunctions.lua @@ -906,13 +906,13 @@ function CommDKP:DKPTable_Create() CommDKP.DKPTable = CreateFrame("ScrollFrame", "CommDKPDisplayScrollFrame", CommDKP.UIConfig, "FauxScrollFrameTemplate") CommDKP.DKPTable:SetSize(core.TableWidth, core.TableRowHeight*core.TableNumRows+3) CommDKP.DKPTable:SetPoint("LEFT", 20, 3) - CommDKP.DKPTable:SetBackdrop( { - bgFile = "Textures\\white.blp", tile = true, -- White backdrop allows for black background with 1.0 alpha on low alpha containers - edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 2, - insets = { left = 0, right = 0, top = 0, bottom = 0 } - }); - CommDKP.DKPTable:SetBackdropColor(0,0,0,0.4); - CommDKP.DKPTable:SetBackdropBorderColor(1,1,1,0.5) + --CommDKP.DKPTable:SetBackdrop( { + -- bgFile = "Textures\\white.blp", tile = true, -- White backdrop allows for black background with 1.0 alpha on low alpha containers + -- edgeFile = "Interface\\AddOns\\CommunityDKP\\Media\\Textures\\edgefile.tga", tile = true, tileSize = 1, edgeSize = 2, + -- insets = { left = 0, right = 0, top = 0, bottom = 0 } + --}); + --CommDKP.DKPTable:SetBackdropColor(0,0,0,0.4); + --CommDKP.DKPTable:SetBackdropBorderColor(1,1,1,0.5) CommDKP.DKPTable:SetClipsChildren(false); CommDKP.DKPTable.ScrollBar = FauxScrollFrame_GetChildFrames(CommDKP.DKPTable) diff --git a/init.lua b/init.lua index fdd69fd5..5f982bef 100644 --- a/init.lua +++ b/init.lua @@ -14,7 +14,6 @@ CommDKP.Commands = { ["config"] = function() if core.Initialized then local pass, err = pcall(CommDKP.Toggle) - if not pass then CommDKP:Print(err) core.CommDKPUI:SetShown(false) @@ -275,7 +274,6 @@ local function DoInit(event, arg1) if CommDKP:MonolithMigration() then return -- Legacy MonolithDKP addon detected: don't initialise any further! end - CommDKP:OnInitialize(event, arg1); end @@ -354,7 +352,6 @@ function CommDKP:SendSeedData() end function CommDKP_OnEvent(self, event, arg1, ...) - if event == "ADDON_LOADED" then if (arg1 ~= "CommunityDKP") then return end core.IsOfficer = nil @@ -650,6 +647,8 @@ function CommDKP:OnInitialize(event, name) -- This is the FIRST function to run C_Timer.After(5, function () core.CommDKPUI = CommDKP.UIConfig or CommDKP:CreateMenu(); -- creates main menu after 5 seconds (trying to initialize after raid frames are loaded) core.KeyEventUI = CreateFrame("Frame","KeyEventFrame", UIParent); + + -- on every key down ? really? core.KeyEventUI:SetScript("OnKeyDown", function(self, key) if core.Initialized and core.IsOfficer then if MouseIsOver(MultiBarLeft) or MouseIsOver(MultiBarRight) or MouseIsOver(MultiBarBottomLeft) or MouseIsOver(MultiBarBottomRight) or MouseIsOver(MainMenuBar) then @@ -677,11 +676,12 @@ function CommDKP:OnInitialize(event, name) -- This is the FIRST function to run end end end); + core.KeyEventUI:SetPropagateKeyboardInput(true); end) ------------------------------------------------ -- Verify DB Schemas - ------------------------------------------------ + ------------------------------------------------\ if not CommDKP:VerifyDBSchema(CommDKP_DB) then CommDKP_DB = CommDKP:UpgradeDBSchema(CommDKP_DB, CommDKP_DB, false, "CommDKP_DB") end; -- Verify that the DB table has been initialized. @@ -743,7 +743,6 @@ function CommDKP:OnInitialize(event, name) -- This is the FIRST function to run return a["item"] < b["item"] end) - CommDKP:StartBidTimer("seconds", nil) -- initiates timer frame for use if CommDKP.BidTimer then CommDKP.BidTimer:SetScript("OnUpdate", nil) end