diff --git a/KkthnxUI/Developer/Core.lua b/KkthnxUI/Developer/Core.lua index 3f94c13b..29e0d6e0 100644 --- a/KkthnxUI/Developer/Core.lua +++ b/KkthnxUI/Developer/Core.lua @@ -121,3 +121,45 @@ function Module:OnEnable() SetupObjectiveTracker() end end + +--[[ ============================================================ + SECTION: Chat Message Blocker + Filters out specific phrases or patterns in chat messages + (e.g., monster emotes) based on a configurable list of patterns. +=============================================================== ]] + +do + -- Cache global references for performance + local string_match = string.match + local string_gsub = string.gsub + local ipairs = ipairs + local ChatFrame_AddMessageEventFilter = ChatFrame_AddMessageEventFilter + + -- Create the ChatFilter object + local ChatFilter = {} + ChatFilter.blockedPatterns = { + "^%s goes into a frenzy!$", + "^%s attempts to run away in fear!$", + } + + -- Check if a message matches any of the blocked patterns + function ChatFilter:IsBlockedMessage(message) + for _, pattern in ipairs(self.blockedPatterns) do + if string_match(message, string_gsub(pattern, "%%s", ".+")) then + return true + end + end + return false + end + + -- Custom chat message filter function + local function MyChatFilter(self, event, msg, sender, ...) + if ChatFilter:IsBlockedMessage(msg) then + return true + end + return false + end + + -- Add the filter for specific chat message events + ChatFrame_AddMessageEventFilter("CHAT_MSG_MONSTER_EMOTE", MyChatFilter) +end diff --git a/KkthnxUI/Modules/Load_Modules.xml b/KkthnxUI/Modules/Load_Modules.xml index 3750925b..5b50d5af 100644 --- a/KkthnxUI/Modules/Load_Modules.xml +++ b/KkthnxUI/Modules/Load_Modules.xml @@ -164,7 +164,6 @@ - diff --git a/KkthnxUI/Modules/Skins/Blizzard/FrameXML/ObjectiveTracker.lua b/KkthnxUI/Modules/Skins/Blizzard/FrameXML/ObjectiveTracker.lua index b8ab41d4..118e9039 100644 --- a/KkthnxUI/Modules/Skins/Blizzard/FrameXML/ObjectiveTracker.lua +++ b/KkthnxUI/Modules/Skins/Blizzard/FrameXML/ObjectiveTracker.lua @@ -1,21 +1,10 @@ local K, C = KkthnxUI[1], KkthnxUI[2] +local _G = _G + local tinsert = table.insert local pairs = pairs -local trackers = { - _G.ScenarioObjectiveTracker, - _G.UIWidgetObjectiveTracker, - _G.CampaignQuestObjectiveTracker, - _G.QuestObjectiveTracker, - _G.AdventureObjectiveTracker, - _G.AchievementObjectiveTracker, - _G.MonthlyActivitiesObjectiveTracker, - _G.ProfessionsRecipeTracker, - _G.BonusObjectiveTracker, - _G.WorldQuestObjectiveTracker, -} - local function SkinOjectiveTrackerHeaders(header) if header and header.Background then header.Background:SetAtlas(nil) @@ -59,7 +48,8 @@ local function HandleTimers(tracker, key) end end -tinsert(C.defaultThemes, function() +-- tinsert(C.defaultThemes, function() +C.themes["Blizzard_ObjectiveTracker"] = function() if C_AddOns.IsAddOnLoaded("!KalielsTracker") then return end @@ -79,9 +69,22 @@ tinsert(C.defaultThemes, function() end end + local trackers = { + _G.ScenarioObjectiveTracker, + _G.UIWidgetObjectiveTracker, + _G.CampaignQuestObjectiveTracker, + _G.QuestObjectiveTracker, + _G.AdventureObjectiveTracker, + _G.AchievementObjectiveTracker, + _G.MonthlyActivitiesObjectiveTracker, + _G.ProfessionsRecipeTracker, + _G.BonusObjectiveTracker, + _G.WorldQuestObjectiveTracker, + } + for _, tracker in pairs(trackers) do SkinOjectiveTrackerHeaders(tracker.Header) hooksecurefunc(tracker, "GetProgressBar", HandleProgressBar) hooksecurefunc(tracker, "GetTimerBar", HandleTimers) end -end) +end diff --git a/KkthnxUI/Modules/Skins/Blizzard/TalkingHeadUI.lua b/KkthnxUI/Modules/Skins/Blizzard/TalkingHeadUI.lua deleted file mode 100644 index 5549b56a..00000000 --- a/KkthnxUI/Modules/Skins/Blizzard/TalkingHeadUI.lua +++ /dev/null @@ -1,32 +0,0 @@ -local K, C = KkthnxUI[1], KkthnxUI[2] - --- C.themes["Blizzard_TalkingHeadUI"] = function() --- local TalkingHeadFrame = TalkingHeadFrame - --- local portraitFrame = TalkingHeadFrame.PortraitFrame --- portraitFrame:StripTextures() --- portraitFrame.Portrait:SetAtlas(nil) --- portraitFrame.Portrait.SetAtlas = K.Noop - --- local model = TalkingHeadFrame.MainFrame.Model --- model:SetPoint("TOPLEFT", 30, -27) --- model:SetSize(100, 100) --- model.PortraitBg:SetAtlas(nil) --- model.PortraitBg.SetAtlas = K.Noop --- model:CreateBorder(nil, nil, C["General"].BorderStyle.Value ~= "KkthnxUI_Pixel" and 32 or nil, nil, C["General"].BorderStyle.Value ~= "KkthnxUI_Pixel" and -10 or nil) - --- local name = TalkingHeadFrame.NameFrame.Name --- name:SetTextColor(1, 0.8, 0) --- name.SetTextColor = K.Noop --- name:SetShadowColor(0, 0, 0, 0) - --- local text = TalkingHeadFrame.TextFrame.Text --- text:SetTextColor(1, 1, 1) --- text.SetTextColor = K.Noop --- text:SetShadowColor(0, 0, 0, 0) - --- local closeButton = TalkingHeadFrame.MainFrame.CloseButton --- closeButton:SkinCloseButton() --- closeButton:ClearAllPoints() --- closeButton:SetPoint("TOPRIGHT", -25, -25) --- end diff --git a/KkthnxUI/Modules/Skins/Blizzard/TradeSkillUI.lua b/KkthnxUI/Modules/Skins/Blizzard/TradeSkillUI.lua index 28535fc8..c38a5a9a 100644 --- a/KkthnxUI/Modules/Skins/Blizzard/TradeSkillUI.lua +++ b/KkthnxUI/Modules/Skins/Blizzard/TradeSkillUI.lua @@ -1,17 +1,25 @@ local K, C = KkthnxUI[1], KkthnxUI[2] -local function SkinTradeSkillFrame() - local rankFrame = TradeSkillFrame.RankFrame - rankFrame:SetStatusBarTexture(K.GetTexture(C["General"].Texture)) - rankFrame:GetStatusBarTexture():SetGradient("VERTICAL", 0.1, 0.3, 0.9, 0.2, 0.4, 1) - rankFrame.SetStatusBarColor = K.Noop - rankFrame.BorderMid:Hide() - rankFrame.BorderLeft:Hide() - rankFrame.BorderRight:Hide() - rankFrame:CreateBorder() - rankFrame.RankText:SetFontObject(K.UIFont) +-- Function to skin the TradeSkillFrame Rank Bar +local function SkinTradeSkillRankBar() + local rankBar = TradeSkillFrame.RankFrame + + local texture = K.GetTexture(C["General"].Texture) + rankBar:SetStatusBarTexture(texture) + rankBar:GetStatusBarTexture():SetGradient("VERTICAL", 0.1, 0.3, 0.9, 0.2, 0.4, 1) + + rankBar.SetStatusBarColor = K.Noop + + rankBar.BorderMid:Hide() + rankBar.BorderLeft:Hide() + rankBar.BorderRight:Hide() + + rankBar:CreateBorder() + + rankBar.RankText:SetFontObject(K.UIFont) end +-- Function to adjust the position of the optional reagent list local function AdjustOptionalReagentListPosition() local reagentList = TradeSkillFrame.OptionalReagentList reagentList:ClearAllPoints() @@ -20,11 +28,12 @@ local function AdjustOptionalReagentListPosition() reagentList:SetPoint("LEFT", TradeSkillFrame, "RIGHT", xOffset, 0) end +-- Main function to apply custom skin for the Blizzard TradeSkill UI C.themes["Blizzard_TradeSkillUI"] = function() if not C["Skins"].BlizzardFrames then return end - SkinTradeSkillFrame() + SkinTradeSkillRankBar() AdjustOptionalReagentListPosition() end