Skip to content

Commit

Permalink
Updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kkthnx committed Dec 14, 2024
1 parent beea6ce commit 5fd171c
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 59 deletions.
42 changes: 42 additions & 0 deletions KkthnxUI/Developer/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion KkthnxUI/Modules/Load_Modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@
<Include file="Skins\Blizzard\InspectUI.lua" />
<Include file="Skins\Blizzard\ProfessionsBook.lua" />
<Include file="Skins\Blizzard\QuestNavigation.lua" />
<Include file="Skins\Blizzard\TalkingHeadUI.lua" />
<Include file="Skins\Blizzard\TradeSkillUI.lua" />
<!-- Skins FrameXML -->
<Include file="Skins\Blizzard\FrameXML\CharacterFrame.lua" />
Expand Down
33 changes: 18 additions & 15 deletions KkthnxUI/Modules/Skins/Blizzard/FrameXML/ObjectiveTracker.lua
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
32 changes: 0 additions & 32 deletions KkthnxUI/Modules/Skins/Blizzard/TalkingHeadUI.lua

This file was deleted.

31 changes: 20 additions & 11 deletions KkthnxUI/Modules/Skins/Blizzard/TradeSkillUI.lua
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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

0 comments on commit 5fd171c

Please sign in to comment.