diff --git a/DarkMode.toc b/DarkMode.toc index d04b8de..ede7eca 100644 --- a/DarkMode.toc +++ b/DarkMode.toc @@ -3,7 +3,7 @@ ## Interface-Wrath: 30403 ## Interface: 100205 -## Version: 0.5.2 +## Version: 0.5.3 ## Title: DarkMode by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/DarkMode_TBC.toc b/DarkMode_TBC.toc index 3ab539f..ffb8bf7 100644 --- a/DarkMode_TBC.toc +++ b/DarkMode_TBC.toc @@ -1,5 +1,5 @@ ## Interface: 20504 -## Version: 0.5.2 +## Version: 0.5.3 ## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/DarkMode_Vanilla.toc b/DarkMode_Vanilla.toc index dd40121..bd49c0f 100644 --- a/DarkMode_Vanilla.toc +++ b/DarkMode_Vanilla.toc @@ -1,5 +1,5 @@ ## Interface: 11501 -## Version: 0.5.2 +## Version: 0.5.3 ## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/DarkMode_Wrath.toc b/DarkMode_Wrath.toc index aebb172..4ffa2b0 100644 --- a/DarkMode_Wrath.toc +++ b/DarkMode_Wrath.toc @@ -1,5 +1,5 @@ ## Interface: 30403 -## Version: 0.5.2 +## Version: 0.5.3 ## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/data.lua b/data.lua index e1e5a2b..0df2fa1 100644 --- a/data.lua +++ b/data.lua @@ -148,7 +148,7 @@ function DarkMode:GetFrameTable() return DMFrames end -local DMFramesAddons = {"TrinketMenu_MainFrame", "TrinketMenu_Trinket0.NormalTexture", "TrinketMenu_Trinket1.NormalTexture", "ProfessionsCustomerOrdersFrame", "VoidStorageBorderFrame", "VoidStorageFrame.Page1", "VoidStorageFrame.Page2", "VoidStorageFrame.Page3", "WardrobeFrame", "WardrobeCollectionFrame", "ProfessionsFrame", "ProfessionsFrame.CraftingPage", "ProfessionsFrame.TabSystem", "ItemInteractionFrame", "ItemInteractionFrame.ItemConversionFrame", "InspectHonorFrame", "StaticPopup1", "StaticPopup2", "ItemUpgradeFrame", "InspectPaperDollFrame", "InspectFrameTab1", "InspectFrameTab2", "InspectFrameTab3", "EngravingFrame", "EngravingFrame.Border", "EngravingFrameSideInset", "WeakAurasOptions", "GenericTraitFrame.NineSlice", "EditModeManagerFrame.Border", "ClassTrainerFrame", "ClassTrainerListScrollFrame", "ClassTrainerExpandButtonFrame", "KeyBindingFrame", "KeyBindingFrame.header", "MacroFrame", "MacroFrameTab1", "MacroFrameTab2", "MacroFrameTextBackground", "MacroButtonScrollFrame", "MacroFrame.MacroSelector.ScrollBar.Background", "TradeSkillFrame", "CraftFrame", "TradeSkillList", "AuctionFrame", "AuctionFrameTab1", "AuctionFrameTab2", "AuctionFrameTab3", "AuctionFrameTab4", "AuctionFrameTab5", "AuctionFrameTab6", "AuctionFrameTab7", "AuctionFrameTab8", "AuctionFrameTab9", "AuctionFrameTab10", "AuctionFrameTab11", "AuctionFrameTab12", "BrowseBidButton", "BrowseBuyoutButton", "BrowseCloseButton", "BidBidButton", "BidBuyoutButton", "BidCloseButton", "AuctionHouseFrame", "AuctionHouseFrameBuyTab", "AuctionHouseFrameSellTab", "AuctionHouseFrameAuctionsTab", "PlayerTalentFrame", "PlayerTalentFramePointsBar", "PlayerTalentFrameTab1", "PlayerTalentFrameTab2", "PlayerTalentFrameTab3", "PlayerTalentFrameTab4", "PlayerTalentFrameTab5", "ClassTalentFrame", "ClassTalentFrame.TabSystem", "ClassTalentFrame.TalentsTab.BottomBar", "AchievementFrame", "AchievementFrame.Header", "AchievementFrameTab1", "AchievementFrameTab2", "AchievementFrameTab3", "AchievementFrameTab4", "AchievementFrameHeader", "AchievementFrameCategories", "AchievementFrameSummary", "WeeklyRewardsFrame", "CommunitiesFrame", "CommunitiesFrameCommunitiesList", "CommunitiesFrame.MemberList", "CommunitiesFrame.Chat.MessageFrame.ScrollBar", "CollectionsJournal", "CollectionsJournalTab1", "CollectionsJournalTab2", "CollectionsJournalTab3", "CollectionsJournalTab4", "CollectionsJournalTab5", "CollectionsJournalTab6", "WardrobeCollectionFrame", "WardrobeCollectionFrame.ItemsCollectionFrame", "ToyBox", "ToyBox.iconsFrame", "HeirloomsJournal", "HeirloomsJournal.iconsFrame", "EncounterJournal", "EncounterJournalMonthlyActivitiesTab", "EncounterJournalSuggestTab", "EncounterJournalDungeonTab", "EncounterJournalRaidTab", "EncounterJournalLootJournalTab", "EncounterJournalInstanceSelect", "CalendarFrame",} +local DMFramesAddons = {"ECS_StatsFrame", "TrinketMenu_MainFrame", "TrinketMenu_Trinket0.NormalTexture", "TrinketMenu_Trinket1.NormalTexture", "ProfessionsCustomerOrdersFrame", "VoidStorageBorderFrame", "VoidStorageFrame.Page1", "VoidStorageFrame.Page2", "VoidStorageFrame.Page3", "WardrobeFrame", "WardrobeCollectionFrame", "ProfessionsFrame", "ProfessionsFrame.CraftingPage", "ProfessionsFrame.TabSystem", "ItemInteractionFrame", "ItemInteractionFrame.ItemConversionFrame", "InspectHonorFrame", "StaticPopup1", "StaticPopup2", "ItemUpgradeFrame", "InspectPaperDollFrame", "InspectFrameTab1", "InspectFrameTab2", "InspectFrameTab3", "EngravingFrame", "EngravingFrame.Border", "EngravingFrameSideInset", "WeakAurasOptions", "GenericTraitFrame.NineSlice", "EditModeManagerFrame.Border", "ClassTrainerFrame", "ClassTrainerListScrollFrame", "ClassTrainerExpandButtonFrame", "KeyBindingFrame", "KeyBindingFrame.header", "MacroFrame", "MacroFrameTab1", "MacroFrameTab2", "MacroFrameTextBackground", "MacroButtonScrollFrame", "MacroFrame.MacroSelector.ScrollBar.Background", "TradeSkillFrame", "CraftFrame", "TradeSkillList", "AuctionFrame", "AuctionFrameTab1", "AuctionFrameTab2", "AuctionFrameTab3", "AuctionFrameTab4", "AuctionFrameTab5", "AuctionFrameTab6", "AuctionFrameTab7", "AuctionFrameTab8", "AuctionFrameTab9", "AuctionFrameTab10", "AuctionFrameTab11", "AuctionFrameTab12", "BrowseBidButton", "BrowseBuyoutButton", "BrowseCloseButton", "BidBidButton", "BidBuyoutButton", "BidCloseButton", "AuctionHouseFrame", "AuctionHouseFrameBuyTab", "AuctionHouseFrameSellTab", "AuctionHouseFrameAuctionsTab", "PlayerTalentFrame", "PlayerTalentFramePointsBar", "PlayerTalentFrameTab1", "PlayerTalentFrameTab2", "PlayerTalentFrameTab3", "PlayerTalentFrameTab4", "PlayerTalentFrameTab5", "ClassTalentFrame", "ClassTalentFrame.TabSystem", "ClassTalentFrame.TalentsTab.BottomBar", "AchievementFrame", "AchievementFrame.Header", "AchievementFrameTab1", "AchievementFrameTab2", "AchievementFrameTab3", "AchievementFrameTab4", "AchievementFrameHeader", "AchievementFrameCategories", "AchievementFrameSummary", "WeeklyRewardsFrame", "CommunitiesFrame", "CommunitiesFrameCommunitiesList", "CommunitiesFrame.MemberList", "CommunitiesFrame.Chat.MessageFrame.ScrollBar", "CollectionsJournal", "CollectionsJournalTab1", "CollectionsJournalTab2", "CollectionsJournalTab3", "CollectionsJournalTab4", "CollectionsJournalTab5", "CollectionsJournalTab6", "WardrobeCollectionFrame", "WardrobeCollectionFrame.ItemsCollectionFrame", "ToyBox", "ToyBox.iconsFrame", "HeirloomsJournal", "HeirloomsJournal.iconsFrame", "EncounterJournal", "EncounterJournalMonthlyActivitiesTab", "EncounterJournalSuggestTab", "EncounterJournalDungeonTab", "EncounterJournalRaidTab", "EncounterJournalLootJournalTab", "EncounterJournalInstanceSelect", "CalendarFrame",} function DarkMode:GetFrameAddonsTable() return DMFramesAddons end diff --git a/libs/D4Lib/D4Frames.lua b/libs/D4Lib/D4Frames.lua index d1ad162..450540d 100644 --- a/libs/D4Lib/D4Frames.lua +++ b/libs/D4Lib/D4Frames.lua @@ -120,8 +120,27 @@ function D4:CreateFrame(tab) tab.parent = tab.parent or UIParent tab.pTab = tab.pTab or "CENTER" tab.title = tab.title or "" - tab.templates = tab.templates or "BasicFrameTemplateWithInset" - local fra = CreateFrame("FRAME", tab.name, tab.parent, tab.templates) + local fra = nil + if not D4:IsOldWow() then + tab.templates = tab.templates or "BasicFrameTemplateWithInset" + fra = CreateFrame("FRAME", tab.name, tab.parent, tab.templates) + else + fra = CreateFrame("Frame", tab.name, tab.parent) + fra.TitleText = fra:CreateFontString(nil, nil, "GameFontNormal") + fra.TitleText:SetPoint("TOP", fra, "TOP", 0, 0) + fra.CloseButton = CreateFrame("Button", tab.name .. ".CloseButton", fra, "UIPanelButtonTemplate") + fra.CloseButton:SetPoint("TOPRIGHT", fra, "TOPRIGHT", 0, 0) + fra.CloseButton:SetSize(25, 25) + fra.CloseButton:SetText("X") + fra.bg = fra:CreateTexture(tab.name .. ".bg", "ARTWORK") + fra.bg:SetAllPoints(fra) + if fra.bg.SetColorTexture then + fra.bg:SetColorTexture(0.03, 0.03, 0.03, 0.5) + else + fra.bg:SetTexture(0.03, 0.03, 0.03, 0.5) + end + end + fra:SetSize(tab.sw, tab.sh) fra:SetPoint(unpack(tab.pTab)) fra:SetClampedToScreen(true) @@ -131,7 +150,9 @@ function D4:CreateFrame(tab) fra:SetScript("OnDragStart", fra.StartMoving) fra:SetScript("OnDragStop", fra.StopMovingOrSizing) fra:Hide() - fra.TitleText:SetText(tab.title) + if fra.TitleText then + fra.TitleText:SetText(tab.title) + end return fra end \ No newline at end of file diff --git a/libs/D4Lib/D4Lib.lua b/libs/D4Lib/D4Lib.lua index 657642d..780eede 100644 --- a/libs/D4Lib/D4Lib.lua +++ b/libs/D4Lib/D4Lib.lua @@ -19,7 +19,7 @@ function D4:GetWoWBuild() return Build end -local oldWow = false +D4.oldWow = D4.oldWow or false if C_Timer == nil then print("[D4] ADD C_Timer") C_Timer = {} @@ -42,7 +42,7 @@ if C_Timer == nil then tinsert(f.tab, {GetTime() + duration, callback}) end - oldWow = true + D4.oldWow = true end if GetClassColor == nil then @@ -54,11 +54,11 @@ if GetClassColor == nil then return 1, 1, 1, "ffffffff" end - oldWow = true + D4.oldWow = true end function D4:IsOldWow() - return oldWow + return D4.oldWow end --[[ QOL ]] diff --git a/libs/D4Lib/D4MinimapButtons.lua b/libs/D4Lib/D4MinimapButtons.lua index 11babba..11ffe7a 100644 --- a/libs/D4Lib/D4MinimapButtons.lua +++ b/libs/D4Lib/D4MinimapButtons.lua @@ -1,44 +1,54 @@ -local icon = LibStub("LibDBIcon-1.0", true) +local icon = null function D4:GetLibDBIcon() + if not D4:IsOldWow() then + icon = icon or LibStub("LibDBIcon-1.0", true) + end + return icon end function D4:CreateMinimapButton(tab) - local mmbtn = LibStub("LibDataBroker-1.1"):NewDataObject( - tab.name, - { - type = "data source", - text = tab.name, - icon = tab.icon, - OnClick = function(sel, btnName) - if btnName == "LeftButton" and IsShiftKeyDown() and tab.funcSL then - tab:funcSL() - elseif btnName == "RightButton" and IsShiftKeyDown() and tab.funcSR then - tab:funcSR() - elseif btnName == "LeftButton" and tab.funcL then - tab:funcL() - elseif btnName == "RightButton" and tab.funcR then - tab:funcR() - end - end, - OnTooltipShow = function(tooltip) - if not tooltip or not tooltip.AddLine then return end - for i, v in pairs(tab.vTT) do - tooltip:AddLine(v) - end - end, - } - ) + if not D4:IsOldWow() then + local mmbtn = LibStub("LibDataBroker-1.1"):NewDataObject( + tab.name, + { + type = "data source", + text = tab.name, + icon = tab.icon, + OnClick = function(sel, btnName) + if btnName == "LeftButton" and IsShiftKeyDown() and tab.funcSL then + tab:funcSL() + elseif btnName == "RightButton" and IsShiftKeyDown() and tab.funcSR then + tab:funcSR() + elseif btnName == "LeftButton" and tab.funcL then + tab:funcL() + elseif btnName == "RightButton" and tab.funcR then + tab:funcR() + end + end, + OnTooltipShow = function(tooltip) + if not tooltip or not tooltip.AddLine then return end + for i, v in pairs(tab.vTT) do + tooltip:AddLine(v) + end + end, + } + ) - if mmbtn and D4:GetLibDBIcon() then - D4:GetLibDBIcon():Register(tab.name, mmbtn, tab.dbtab) + if mmbtn and D4:GetLibDBIcon() then + D4:GetLibDBIcon():Register(tab.name, mmbtn, tab.dbtab) + end end end function D4:ShowMMBtn(name) - D4:GetLibDBIcon():Show(name) + if not D4:IsOldWow() then + D4:GetLibDBIcon():Show(name) + end end function D4:HideMMBtn(name) - D4:GetLibDBIcon():Hide(name) + if not D4:IsOldWow() then + D4:GetLibDBIcon():Hide(name) + end end \ No newline at end of file diff --git a/settings.lua b/settings.lua index 8efd55a..7cb8990 100644 --- a/settings.lua +++ b/settings.lua @@ -287,8 +287,8 @@ function DarkMode:InitDMSettings() DMSettings:Hide() end - D4:SetVersion(AddonName, 136122, "0.5.2") - DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.2")) + D4:SetVersion(AddonName, 136122, "0.5.3") + DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.3")) DMSettings.CloseButton:SetScript( "OnClick", function()