mirror of
https://github.com/Lacustat/Freewood-OctoWoW-Core.git
synced 2026-11-07 09:18:58 +00:00
0.1.228: Kanaele: Ereignis-Handler ohne Owner (Mitglieder kamen leer an), Chatausgabe der Liste zusaetzlich ueber AddMessage unterdruecken [ungeprueft]
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
9d458c6659
commit
442709319e
+24
-4
@@ -216,10 +216,10 @@ local function OnNotice(a1, a2, a3, a4, a5, a6, a7, a8, a9)
|
||||
end
|
||||
end
|
||||
|
||||
FW:RegisterEvent("CHAT_MSG_CHANNEL_LIST", OnList, Ch)
|
||||
FW:RegisterEvent("CHAT_MSG_CHANNEL_JOIN", OnJoin, Ch)
|
||||
FW:RegisterEvent("CHAT_MSG_CHANNEL_LEAVE", OnLeave, Ch)
|
||||
FW:RegisterEvent("CHAT_MSG_CHANNEL_NOTICE", OnNotice, Ch)
|
||||
FW:RegisterEvent("CHAT_MSG_CHANNEL_LIST", OnList)
|
||||
FW:RegisterEvent("CHAT_MSG_CHANNEL_JOIN", OnJoin)
|
||||
FW:RegisterEvent("CHAT_MSG_CHANNEL_LEAVE", OnLeave)
|
||||
FW:RegisterEvent("CHAT_MSG_CHANNEL_NOTICE", OnNotice)
|
||||
|
||||
-- Die Listenausgabe des Spiels soll nicht im Chat landen, solange wir selbst abfragen
|
||||
if type(G.ChatFrame_AddMessageEventFilter) == "function" then
|
||||
@@ -233,6 +233,26 @@ if type(G.ChatFrame_AddMessageEventFilter) == "function" then
|
||||
Ch.filter = true
|
||||
end
|
||||
|
||||
-- Zweiter Weg gegen die Chatausgabe: AddMessage der Chatfenster, solange das Listen-Ereignis laeuft
|
||||
local function Suppressing()
|
||||
if Ch.probe then return false end
|
||||
local now = (G.GetTime and G.GetTime()) or 0
|
||||
return Ch.current ~= nil or (now - Ch.lastSend) < SUPPRESS
|
||||
end
|
||||
local ci = 1
|
||||
while ci <= 10 do
|
||||
local cf = G["ChatFrame" .. ci]
|
||||
if cf and cf.AddMessage and not cf.fwChanWrapped then
|
||||
local orig = cf.AddMessage
|
||||
cf.fwChanWrapped = true
|
||||
cf.AddMessage = function(self, ...)
|
||||
if G.event == "CHAT_MSG_CHANNEL_LIST" and Suppressing() then return end
|
||||
return orig(self, ...)
|
||||
end
|
||||
end
|
||||
ci = ci + 1
|
||||
end
|
||||
|
||||
-- Aktionen (geschuetzt)
|
||||
function Ch.Whisper(name)
|
||||
if type(G.ChatFrame_SendTell) == "function" then pcall(G.ChatFrame_SendTell, name) end
|
||||
|
||||
Reference in New Issue
Block a user