Skip to content

Commit

Permalink
v0.5.118
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Oct 20, 2024
1 parent 2f4b29f commit 7826488
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 37 deletions.
2 changes: 1 addition & 1 deletion DarkMode.toc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Interface-Cata: 40400
## Interface: 110002

## Version: 0.5.117
## Version: 0.5.118
## 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_Cata.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 40400
## Version: 0.5.117
## Version: 0.5.118
## 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_TBC.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 20504
## Version: 0.5.117
## Version: 0.5.118
## 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: 11504
## Version: 0.5.117
## Version: 0.5.118
## 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.117
## Version: 0.5.118
## 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
35 changes: 34 additions & 1 deletion core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ function DarkMode:Event(event, ...)
["name"] = "DarkMode",
["icon"] = 136122,
["dbtab"] = DMTAB,
["vTT"] = {{"DarkMode |T136122:16:16:0:0|t", "v|cff3FC7EB0.5.117"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}},
["vTT"] = {{"DarkMode |T136122:16:16:0:0|t", "v|cff3FC7EB0.5.118"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}},
["funcL"] = function()
DarkMode:ToggleSettings()
end,
Expand Down Expand Up @@ -1663,6 +1663,39 @@ function DarkMode:GroupLootUpdate()
end
end

local vigor = CreateFrame("Frame")
vigor:RegisterEvent("PLAYER_MOUNT_DISPLAY_CHANGED")
vigor:RegisterEvent("PLAYER_ENTERING_WORLD")
vigor:SetScript(
"OnEvent",
function(sel, event)
C_Timer.After(
0.02,
function()
local childs = {UIWidgetPowerBarContainerFrame:GetChildren()}
for _, child in pairs(childs) do
if child.DecorLeft and child.DecorLeft.GetAtlas then
local atlas = child.DecorLeft:GetAtlas()
if atlas == "dragonriding_vigor_decor" then
DarkMode:UpdateColor(child.DecorLeft, "ui")
DarkMode:UpdateColor(child.DecorRight, "ui")
end
end

for _, cchild in ipairs({child:GetChildren()}) do
if cchild.Frame and cchild.Frame.GetAtlas then
local atlas = cchild.Frame:GetAtlas()
if atlas == "dragonriding_vigor_frame" then
DarkMode:UpdateColor(cchild.Frame, "ui")
end
end
end
end
end
)
end
)

local f = CreateFrame("Frame")
f:SetScript("OnEvent", DarkMode.Event)
f:RegisterEvent("PLAYER_LOGIN")
Expand Down
4 changes: 2 additions & 2 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function DarkMode:GetUiTable()
return DMUi
end

local DMUiAddons = {"TimerTrackerTimer1StatusBarBorder", "TimerTrackerTimer2StatusBarBorder", "FocusFrame.FocusFrameContainer.FrameTexture", "ArenaPrepFrame1Texture", "ArenaPrepFrame2Texture", "ArenaPrepFrame3Texture", "ArenaPrepFrame4Texture", "ArenaPrepFrame5Texture", "ArenaEnemyFrame1Texture", "ArenaEnemyFrame2Texture", "ArenaEnemyFrame3Texture", "ArenaEnemyFrame4Texture", "ArenaEnemyFrame5Texture",}
local DMUiAddons = {"UIWidgetPowerBarContainerFrame", "TimerTrackerTimer1StatusBarBorder", "TimerTrackerTimer2StatusBarBorder", "FocusFrame.FocusFrameContainer.FrameTexture", "ArenaPrepFrame1Texture", "ArenaPrepFrame2Texture", "ArenaPrepFrame3Texture", "ArenaPrepFrame4Texture", "ArenaPrepFrame5Texture", "ArenaEnemyFrame1Texture", "ArenaEnemyFrame2Texture", "ArenaEnemyFrame3Texture", "ArenaEnemyFrame4Texture", "ArenaEnemyFrame5Texture",}
function DarkMode:GetUiAddonsTable()
return DMUiAddons
end
Expand Down Expand Up @@ -197,7 +197,7 @@ function DarkMode:GetFrameTableSpecial()
return DMFramesSpecial
end

local DMFramesAddons = {"ReadyStatus.Border", "FlightMapFrame.BorderFrame", "CovenantMissionFrame", "GhostFrame", "DeathRecapFrame", "PVPScoreFrameTab1", "PVPScoreFrameTab2", "PVPScoreFrameTab3", "PVPMatchResults.content", "PVPMatchResults", "PVPScoreboardTab1", "PVPScoreboardTab2", "PVPScoreboardTab3", "PVPMatchScoreboard", "PVPMatchScoreboard.Content", "PVPMatchScoreboard.Content.TabContainer.InsetBorderTop", "InspectFrame", "DelvesCompanionConfigurationFrame.CompanionCombatRoleSlot.OptionsList", "DelvesCompanionConfigurationFrame.CompanionCombatTrinketSlot.OptionsList", "DelvesCompanionConfigurationFrame.CompanionUtilityTrinketSlot.OptionsList", "DelvesCompanionConfigurationFrame.Border", "DelvesDifficultyPickerFrame.Border", "MacroPopupFrame.BorderBox", "ReforgingFrameRestoreButton_RightSeparator", "ReforgingFrameRestoreButton_LeftSeparator", "ReforgingFrameButtonFrame", "ReforgingFrame", "WeeklyRewardsFrame", "ItemSocketingFrame", "ChannelFrameBg", "ChannelFrame.ChannelRoster.ScrollFrame.scrollBar", "ChannelFrame", "CommunitiesFrame.ChatTab", "CommunitiesFrame.RosterTab", "CommunitiesFrame.GuildBenefitsTab", "CommunitiesFrame.GuildInfoTab", "CommunitiesFrame.GuildMemberDetailFrame.Border", "WarGameStartButton_RightSeparator", "WarGamesFrame", "WarGamesFrameBGTex", "WarGamesFrameInfoScrollFrameScrollBar", "WarGamesFrameInfoScrollFrame.ScrollBar.Background", "WarGamesFrame.scrollBar", "PVPConquestFrame", "PVPFrameRightButton_LeftSeparator", "PVPHonorFrameBGTex", "PVPHonorFrameInfoScrollFrameScrollBar", "PVPHonorFrameInfoScrollFrame.ScrollBar.Background", "PVPHonorFrame.bgTypeScrollBar", "PVPTeamManagementFrame", "ProfessionsBookFrame", "PlayerSpellsFrame", "ScrappingMachineFrame", "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", "InspectTalentFrame", "InspectTalentFramePointsBar", "InspectPVPFrame", "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", "AchievementFrameTab5", "AchievementFrameTab6", "AchievementFrameTab7", "AchievementFrameTab8", "AchievementFrameCategories", "AchievementFrameSummary", "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 = {"UIWidgetPowerBarContainerFrame", "ReadyStatus.Border", "FlightMapFrame.BorderFrame", "CovenantMissionFrame", "GhostFrame", "DeathRecapFrame", "PVPScoreFrameTab1", "PVPScoreFrameTab2", "PVPScoreFrameTab3", "PVPMatchResults.content", "PVPMatchResults", "PVPScoreboardTab1", "PVPScoreboardTab2", "PVPScoreboardTab3", "PVPMatchScoreboard", "PVPMatchScoreboard.Content", "PVPMatchScoreboard.Content.TabContainer.InsetBorderTop", "InspectFrame", "DelvesCompanionConfigurationFrame.CompanionCombatRoleSlot.OptionsList", "DelvesCompanionConfigurationFrame.CompanionCombatTrinketSlot.OptionsList", "DelvesCompanionConfigurationFrame.CompanionUtilityTrinketSlot.OptionsList", "DelvesCompanionConfigurationFrame.Border", "DelvesDifficultyPickerFrame.Border", "MacroPopupFrame.BorderBox", "ReforgingFrameRestoreButton_RightSeparator", "ReforgingFrameRestoreButton_LeftSeparator", "ReforgingFrameButtonFrame", "ReforgingFrame", "WeeklyRewardsFrame", "ItemSocketingFrame", "ChannelFrameBg", "ChannelFrame.ChannelRoster.ScrollFrame.scrollBar", "ChannelFrame", "CommunitiesFrame.ChatTab", "CommunitiesFrame.RosterTab", "CommunitiesFrame.GuildBenefitsTab", "CommunitiesFrame.GuildInfoTab", "CommunitiesFrame.GuildMemberDetailFrame.Border", "WarGameStartButton_RightSeparator", "WarGamesFrame", "WarGamesFrameBGTex", "WarGamesFrameInfoScrollFrameScrollBar", "WarGamesFrameInfoScrollFrame.ScrollBar.Background", "WarGamesFrame.scrollBar", "PVPConquestFrame", "PVPFrameRightButton_LeftSeparator", "PVPHonorFrameBGTex", "PVPHonorFrameInfoScrollFrameScrollBar", "PVPHonorFrameInfoScrollFrame.ScrollBar.Background", "PVPHonorFrame.bgTypeScrollBar", "PVPTeamManagementFrame", "ProfessionsBookFrame", "PlayerSpellsFrame", "ScrappingMachineFrame", "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", "InspectTalentFrame", "InspectTalentFramePointsBar", "InspectPVPFrame", "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", "AchievementFrameTab5", "AchievementFrameTab6", "AchievementFrameTab7", "AchievementFrameTab8", "AchievementFrameCategories", "AchievementFrameSummary", "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
110 changes: 83 additions & 27 deletions libs/D4Lib/D4Realms.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ local regions = {
["TW"] = 4,
}

local function IsUkrainianLetters(str)
return str:match("[\192-\199]") ~= nil
end

local function IsRussianLetters(str)
return str:match("[\192-\255]") ~= nil
end

local function IsChineseLetters(str)
return str:match("[\228-\233]") ~= nil
end

local function IsKoreanLetters(str)
return str:match("[\234-\237]") ~= nil
end

local missingRegionOnce = true
local missingWoWBuildOnce = true
if D4:GetWoWBuild() == "RETAIL" then
Expand Down Expand Up @@ -3066,6 +3082,17 @@ else
end
end

local withoutSpaces = {}
for name, val in pairs(realms) do
if string.find(name, " ", 1, true) ~= nil then
withoutSpaces[name:gsub(" ", "")] = val
end
end

for name, val in pairs(withoutSpaces) do
realms[name] = val
end

local missingRealmNameOnce = true
local missingRealms = {}
function D4:GetRealmLang(realmName)
Expand All @@ -3080,12 +3107,22 @@ function D4:GetRealmLang(realmName)
end

if realms[realmName] == nil then
if missingRealms[realmName] == nil then
missingRealms[realmName] = true
D4:MSG("[D4] Missing Realmname", realmName)
end
if IsUkrainianLetters(realmName) then
return "ukUA"
elseif IsRussianLetters(realmName) then
return "ruRU"
elseif IsChineseLetters(realmName) then
return "zhCN"
elseif IsKoreanLetters(realmName) then
return "koKR"
else
if missingRealms[realmName] == nil then
missingRealms[realmName] = true
D4:MSG("[D4][GetRealmLang] Missing Realm-Language", realmName)
end

return ""
return ""
end
end

return realms[realmName]
Expand All @@ -3107,21 +3144,40 @@ realmLangs["Lateinamerika"] = "esES"
realmLangs["Latin America"] = "esES"
realmLangs["西班牙"] = "esES"
--[[ enUS ]]
realmLangs["English"] = "enUS"
realmLangs["Englisch"] = "enUS"
realmLangs["영어"] = "enUS"
realmLangs["美國"] = "enUS"
realmLangs["미국"] = "enUS"
realmLangs["Vereinigte Staaten"] = "enUS"
realmLangs["United States"] = "enUS"
realmLangs["Global"] = "enUS"
realmLangs["글로벌"] = "enUS"
realmLangs["全球"] = "enUS"
realmLangs["Saisonbedingt"] = "enUS"
realmLangs["Hardcore"] = "enUS"
realmLangs["Classic-Ära"] = "enUS"
realmLangs["Seasonal"] = "enUS"
realmLangs["Classic Era"] = "enUS"
if region == regions["EU"] then
realmLangs["English"] = "enGB"
realmLangs["Englisch"] = "enGB"
realmLangs["영어"] = "enGB"
realmLangs["美國"] = "enGB"
realmLangs["미국"] = "enGB"
realmLangs["Vereinigte Staaten"] = "enGB"
realmLangs["United States"] = "enGB"
realmLangs["Global"] = "enGB"
realmLangs["글로벌"] = "enGB"
realmLangs["全球"] = "enGB"
realmLangs["Saisonbedingt"] = "enGB"
realmLangs["Hardcore"] = "enGB"
realmLangs["Classic-Ära"] = "enGB"
realmLangs["Seasonal"] = "enGB"
realmLangs["Classic Era"] = "enGB"
else
realmLangs["English"] = "enUS"
realmLangs["Englisch"] = "enUS"
realmLangs["영어"] = "enUS"
realmLangs["美國"] = "enUS"
realmLangs["미국"] = "enUS"
realmLangs["Vereinigte Staaten"] = "enUS"
realmLangs["United States"] = "enUS"
realmLangs["Global"] = "enUS"
realmLangs["글로벌"] = "enUS"
realmLangs["全球"] = "enUS"
realmLangs["Saisonbedingt"] = "enUS"
realmLangs["Hardcore"] = "enUS"
realmLangs["Classic-Ära"] = "enUS"
realmLangs["Seasonal"] = "enUS"
realmLangs["Classic Era"] = "enUS"
end

--[[ enGB ]]
realmLangs["大洋洲"] = "enGB"
realmLangs["오세아니아"] = "enGB"
Expand Down Expand Up @@ -3162,16 +3218,16 @@ function D4:GetRealmFlag(realmName)
local realmLang = D4:GetRealmLang(realmName)
if realmLang == nil then return "" end
if realmLangs[realmLang] == nil then
realmLang = string.trim(realmLang)
end
if realmLang == nil then
if missingRealmLangs[realmLang] == nil then
missingRealmLangs[realmLang] = true
D4:MSG("[D4] Missing realmsLangs", realmName, realmLang)
end

if realmLangs[realmLang] == nil then
if missingRealmLangs[realmLang] == nil then
missingRealmLangs[realmLang] = true
D4:MSG("[D4] Missing realmsLangs", realmName, realmLang)
return ""
end

return ""
return realmLang
end

return realmLangs[realmLang]
Expand Down
4 changes: 2 additions & 2 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ function DarkMode:InitDMSettings()
DMSettings:Hide()
end

DarkMode:SetVersion(AddonName, 136122, "0.5.117")
DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.117"))
DarkMode:SetVersion(AddonName, 136122, "0.5.118")
DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.118"))
DMSettings.CloseButton:SetScript(
"OnClick",
function()
Expand Down

0 comments on commit 7826488

Please sign in to comment.