• Disabling "CHudChat"
    1 replies, posted
I've been working on a custom chat box based on this guide: Basic Chatbox I've come across an issue though. I've got everything working but when I try to run: hook.Add( "HUDShouldDraw", "noMoreDefault", function( name ) if name == "CHudChat" then return false end end ) (Ignore the broken formatting, FP doesn't like tabs.) to hide the original chatbox, it breaks the escape menu so that I can't get to it through ~ or ESC. Additionally, the chat functions are broken as well despite numerous guides implying or directly stating (as well as the name of the hook) that the only bit that would be disabled would be the rendering of the vanilla chat. Chat code (again, if the formatting looks broken anywhere, its the code tags being borked): local chatH = 200 local chatW = 400 chatBoxThing = {} function ChatBoxSetup()     client = LocalPlayer()     --GAMEMODE:CloseDermaMenus()     chatBoxThing.dFrame = vgui.Create("DFrame")     chatBoxThing.dTextEntry = vgui.Create("DTextEntry", chatBoxThing.dFrame)     chatBoxThing.dRichText = vgui.Create("RichText", chatBoxThing.dFrame)           chatBoxThing.dTextEntry:SetFont("ConvictSansChat")     chatBoxThing.dRichText:SetFontInternal("ConvictSansChat")          chatBoxThing.dFrame:SetPos(20, 50)     chatBoxThing.dFrame:SetSize(chatW,chatH)     chatBoxThing.dFrame:SetDraggable(true)     chatBoxThing.dFrame:ShowCloseButton(true)     chatBoxThing.dFrame:SetTitle("")     chatBoxThing.dFrame.Paint = function( self, w, h )              end     --chatBoxThing.dFrame:MakePopup()          chatBoxThing.dRichText:SetPos(5, 10)     chatBoxThing.dRichText:SetSize(chatW - 10, chatH - 10)     chatBoxThing.dRichText:AppendText("Welcome to Familiar Block Game\n")     function chatBoxThing.dRichText:PerformLayout()         self:SetFontInternal("ConvictSansChat")         self:SetFGColor( Color(255,255,255))     end               chatBoxThing.dTextEntry:SetPos(5,175)     chatBoxThing.dTextEntry:SetSize(chatW - 10,20)     chatBoxThing.dTextEntry.Paint = function( self, w, h )         draw.RoundedBox( 0, 0, 0, w, h, Color(214, 209, 209,50) )         draw.SimpleText("> " .. self:GetValue(), "ConvictSans", 0, -5, Color(255,255,255,255), 0,0)     end          --chatBoxThing.dTextEntry:SetText("")      end hook.Add("Initialize", "RobloxChatBox2", ChatBoxSetup) concommand.Add("reload_chat", function( ply, cmd, args)     ChatBoxSetup() end) hook.Add( "OnPlayerChat", "myChat", function( player, strText, bTeamOnly, bPlayerIsDead )  --local col = GAMEMODE:GetTeamColor( player ) -- Get the player's team color     --chatBoxThing.dRichText:InsertColorChange(col)     local col = team.GetColor(ply:Team())     local r, g, b, a = col.r, col.g, col.b, col.a     chatBoxThing.dRichText:InsertColorChange(r,g,b,a)     chatBoxThing.dRichText:AppendText(player:GetName())     chatBoxThing.dRichText:InsertColorChange(255,255,255,255)     chatBoxThing.dRichText:AppendText(": " .. strText .. "\n")           end ) hook.Add( "ChatTextChanged", "myChat_Update", function( text ) chatBoxThing.dTextEntry:SetText( text ) end)
Update: Turns out fucking with CHudMenu breaks literally everything as confirmed by this antique thread: StartChat not being called Solution for anyone digging through the forums in the future, use this instead: hook.Add("StartChat", "WowThisIsFuckinDumb", function( team )     return true end )
Sorry, you need to Log In to post a reply to this thread.