Skip to content

Commit

Permalink
v0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Mar 12, 2024
1 parent 5ef4fe9 commit a249734
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 44 deletions.
2 changes: 1 addition & 1 deletion DarkMode.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_TBC.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Vanilla.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Wrath.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 24 additions & 3 deletions libs/D4Lib/D4Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
8 changes: 4 additions & 4 deletions libs/D4Lib/D4Lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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
Expand All @@ -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 ]]
Expand Down
70 changes: 40 additions & 30 deletions libs/D4Lib/D4MinimapButtons.lua
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a249734

Please sign in to comment.