You need to use the ChatTypeGroups, which are the table keys that include the message types themselves.
https://www.townlong-yak.com/framexm...tFrame.lua#131
If you want to add a single message type, use
ChatFrame_AddSingleMessageType. There is no remove single message type function.
As for your code that enforces a chatframe, here's what I use if you want to pick it apart:
Standard docked creation:
Lua Code:
-- 1 is the "default" frame where print() goes
-- 2 is combat log
-- 3 has been taken by the new Voice Text-to-Speech functionality
-- you can still technically use 3, but the tab text is going to be purple
local frame=ChatFrame4
_G[frame:GetName().."Tab"].sizePadding=0
FCF_SetWindowName(frame,"TAB NAME")
FCF_SetWindowColor(frame,0,0,0)
FCF_SetWindowAlpha(frame,0)
FCF_UnDockFrame(frame)
frame:SetClampRectInsets(0,0,0,0)
PixelUtil.SetSize(frame,400,80)
frame:ClearAllPoints()
frame:SetPoint("BOTTOMLEFT",
PixelUtil.GetNearestPixelSize(3,frame:GetEffectiveScale()),
PixelUtil.GetNearestPixelSize(252,frame:GetEffectiveScale())
)
frame:SetUserPlaced(true)
FCF_SavePositionAndDimensions(frame)
FCF_DockFrame(frame,frame:GetID())
frame.isStaticDocked=true
FCF_SetUninteractable(frame,false)
frame:Show()
SetChatWindowShown(frame:GetID(),true)
Standard undocked creation:
Lua Code:
local frame=ChatFrame5
_G[frame:GetName().."Tab"].sizePadding=0
FCF_SetWindowName(frame,"TAB NAME")
FCF_SetWindowColor(frame,0,0,0)
FCF_SetWindowAlpha(frame,0)
FCF_UnDockFrame(frame)
frame:SetClampRectInsets(0,0,0,0)
PixelUtil.SetSize(frame,400,80)
frame:ClearAllPoints()
frame:SetPoint("BOTTOMLEFT",
PixelUtil.GetNearestPixelSize(3,frame:GetEffectiveScale()),
PixelUtil.GetNearestPixelSize(86,frame:GetEffectiveScale())
)
frame:SetUserPlaced(true)
FCF_SavePositionAndDimensions(frame)
FCF_SetLocked(frame,true)
FCF_SetUninteractable(frame,false)
frame:Show()
SetChatWindowShown(frame:GetID(),true)
Along with some other code, including my own border and background, in tandem with Prat, this is what my chat looks like:
Some notes:
- SetClampRectInsets allows the chat to sit right on the edge of the screen. In the screenshot, that is the lower left of my screen. The chatframes are exactly one pixel away from the edge.
- PixelUtil functions automatically figure out the math behind pixel perfect sizing and placement, since my UI scale isn't 1.
- The undock usage right before docking for the docked creation was necessary to prevent some weirdness, but I don't remember how or what since I've been using this setup for several expansions.
- The rest of the functions all copy what the UI does when setting up chat frames, ensuring everything is covered and the frames are accepted.