Compare commits
No commits in common. "10e902ddcf38cd0c1c37f3f5bf1e7a156831dcb7" and "682cfba2431639a0099285bc923f775f5e69dc7f" have entirely different histories.
10e902ddcf
...
682cfba243
7 changed files with 25 additions and 195 deletions
|
@ -35,14 +35,11 @@ local surface_SetMaterial = surface.SetMaterial
|
||||||
cbox.chatbox = cbox.chatbox or {}
|
cbox.chatbox = cbox.chatbox or {}
|
||||||
cbox.chatbox.tabs = cbox.chatbox.tabs or {}
|
cbox.chatbox.tabs = cbox.chatbox.tabs or {}
|
||||||
cbox.chatbox.panels = cbox.chatbox.panels or {}
|
cbox.chatbox.panels = cbox.chatbox.panels or {}
|
||||||
cbox.chatbox.modes = cbox.chatbox.modes or {}
|
|
||||||
|
|
||||||
local CHATBOX_COLOR = CreateClientConVar("cbox_chatbox_color", "160 160 160", true, false, "Chatbox background color")
|
local CHATBOX_COLOR = CreateClientConVar("cbox_chatbox_color", "160 160 160", true, false, "Chatbox background color")
|
||||||
local CHATBOX_ALPHA = CreateClientConVar("cbox_chatbox_alpha", "128", true, false, "Chatbox background alpha")
|
local CHATBOX_ALPHA = CreateClientConVar("cbox_chatbox_alpha", "128", true, false, "Chatbox background alpha")
|
||||||
local CHATBOX_BLUR = CreateClientConVar("cbox_chatbox_blur", "0", true, false, "Chatbox background is blurred")
|
local CHATBOX_BLUR = CreateClientConVar("cbox_chatbox_blur", "0", true, false, "Chatbox background is blurred")
|
||||||
local CHATBOX_FADE = CreateClientConVar("cbox_chatbox_fade", "1", true, false, "Chatbox fades in and out")
|
local CHATBOX_FADE = CreateClientConVar("cbox_chatbox_fade", "1", true, false, "Chatbox fades in and out")
|
||||||
local CHATBOX_MODE1 = CreateClientConVar("cbox_chatbox_mode1", "say", true, false, "Default mode when pressing messagemode")
|
|
||||||
local CHATBOX_MODE2 = CreateClientConVar("cbox_chatbox_mode2", "say_team", true, false, "Default mode when pressing messagemode2")
|
|
||||||
|
|
||||||
---@param height number
|
---@param height number
|
||||||
---@return number
|
---@return number
|
||||||
|
@ -72,17 +69,6 @@ function cbox.chatbox.AddTab(key, name, icon, callback)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
---Add a new chatbox send mode
|
|
||||||
---@param key string Internal unique name
|
|
||||||
---@param name string Display name
|
|
||||||
---@param callback fun(text) What to do when enter is pressed on this mode
|
|
||||||
function cbox.chatbox.AddMode(key, name, callback)
|
|
||||||
cbox.chatbox.modes[key] = {
|
|
||||||
name = name,
|
|
||||||
callback = callback,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local MATERIAL_BLUR = Material("pp/blurscreen")
|
local MATERIAL_BLUR = Material("pp/blurscreen")
|
||||||
|
|
||||||
local function add_rounded_poly(poly, x, y, rad, seg, offset)
|
local function add_rounded_poly(poly, x, y, rad, seg, offset)
|
||||||
|
@ -99,11 +85,9 @@ local function add_rounded_poly(poly, x, y, rad, seg, offset)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function RoundedBoxPoly(w, h, rad, seg)
|
local function RoundedBoxPoly(x, y, w, h, rad, seg)
|
||||||
local poly = {}
|
local poly = {}
|
||||||
|
|
||||||
local x, y = 0, 0
|
|
||||||
|
|
||||||
add_rounded_poly(poly, x + rad, y + rad, rad, seg, seg)
|
add_rounded_poly(poly, x + rad, y + rad, rad, seg, seg)
|
||||||
|
|
||||||
poly[#poly + 1] = {
|
poly[#poly + 1] = {
|
||||||
|
@ -133,11 +117,9 @@ local function RoundedBoxPoly(w, h, rad, seg)
|
||||||
|
|
||||||
add_rounded_poly(poly, x + rad, y + (h - rad), rad, seg)
|
add_rounded_poly(poly, x + rad, y + (h - rad), rad, seg)
|
||||||
|
|
||||||
return poly
|
surface_DrawPoly(poly)
|
||||||
end
|
end
|
||||||
|
|
||||||
local PREV_W, PREV_H, BACKGROUND_POLY
|
|
||||||
|
|
||||||
local function CreateChatbox()
|
local function CreateChatbox()
|
||||||
if IsValid(cbox.chatbox.panels.frame) then
|
if IsValid(cbox.chatbox.panels.frame) then
|
||||||
cbox.chatbox.panels.frame:Remove()
|
cbox.chatbox.panels.frame:Remove()
|
||||||
|
@ -154,17 +136,11 @@ local function CreateChatbox()
|
||||||
|
|
||||||
-- TODO: make this configurable
|
-- TODO: make this configurable
|
||||||
frame:SetMinWidth(dw)
|
frame:SetMinWidth(dw)
|
||||||
frame:SetMinHeight(dh)
|
frame:SetMinWidth(dh)
|
||||||
|
|
||||||
local x = frame:GetCookie("pos_x", dx)
|
-- TODO: save resizing/moving
|
||||||
local y = frame:GetCookie("pos_y", dy)
|
frame:SetPos(dx, dy)
|
||||||
local w = frame:GetCookie("width", dw)
|
frame:SetSize(dw, dh)
|
||||||
local h = frame:GetCookie("height", dh)
|
|
||||||
frame:SetPos(x, y)
|
|
||||||
frame:SetSize(w, h)
|
|
||||||
PREV_W = w
|
|
||||||
PREV_H = h
|
|
||||||
BACKGROUND_POLY = RoundedBoxPoly(w, h, 8, 24)
|
|
||||||
|
|
||||||
frame:SetVisible(false)
|
frame:SetVisible(false)
|
||||||
|
|
||||||
|
@ -204,12 +180,7 @@ local function CreateChatbox()
|
||||||
|
|
||||||
self.animFade:Run()
|
self.animFade:Run()
|
||||||
|
|
||||||
local w, h = self:GetSize()
|
-- TODO: save position and size
|
||||||
if w ~= PREV_W or h ~= PREV_H then
|
|
||||||
PREV_W = w
|
|
||||||
PREV_H = h
|
|
||||||
BACKGROUND_POLY = RoundedBoxPoly(w, h, 8, 24)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function frame:Paint(w, h)
|
function frame:Paint(w, h)
|
||||||
|
@ -232,7 +203,7 @@ local function CreateChatbox()
|
||||||
|
|
||||||
draw_NoTexture()
|
draw_NoTexture()
|
||||||
surface_SetDrawColor(255, 255, 255)
|
surface_SetDrawColor(255, 255, 255)
|
||||||
surface_DrawPoly(BACKGROUND_POLY)
|
RoundedBoxPoly(0, 0, w, h, 8, 24)
|
||||||
|
|
||||||
-- Only draw things that are in the stencil buffer
|
-- Only draw things that are in the stencil buffer
|
||||||
render_SetStencilCompareFunction( STENCIL_EQUAL )
|
render_SetStencilCompareFunction( STENCIL_EQUAL )
|
||||||
|
@ -260,15 +231,6 @@ local function CreateChatbox()
|
||||||
render_SetStencilEnable(false)
|
render_SetStencilEnable(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
function frame:OnClose()
|
|
||||||
local x, y = frame:GetPos()
|
|
||||||
local w, h = frame:GetSize()
|
|
||||||
frame:SetCookie("pos_x", x)
|
|
||||||
frame:SetCookie("pos_y", y)
|
|
||||||
frame:SetCookie("width", w)
|
|
||||||
frame:SetCookie("height", h)
|
|
||||||
end
|
|
||||||
|
|
||||||
cbox.chatbox.panels.frame = frame
|
cbox.chatbox.panels.frame = frame
|
||||||
|
|
||||||
local tabs = vgui.Create("DPropertySheet", frame, "cbox.chatbox.tabs")
|
local tabs = vgui.Create("DPropertySheet", frame, "cbox.chatbox.tabs")
|
||||||
|
@ -329,8 +291,6 @@ local function CreateChatbox()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function Init()
|
local function Init()
|
||||||
include("cbox/cl_modes.lua")
|
|
||||||
|
|
||||||
local tab_files = file.Find("cbox/tabs/*", "LUA")
|
local tab_files = file.Find("cbox/tabs/*", "LUA")
|
||||||
for _, name in ipairs(tab_files) do
|
for _, name in ipairs(tab_files) do
|
||||||
cbox.utils.RealmPrint("Loading chatbox tab:", name)
|
cbox.utils.RealmPrint("Loading chatbox tab:", name)
|
||||||
|
@ -349,8 +309,6 @@ local function Init()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
hook.Run("cbox.chatbox.Initialize")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---Opens the chatbox
|
---Opens the chatbox
|
||||||
|
@ -392,14 +350,6 @@ function cbox.chatbox.Open(alt)
|
||||||
|
|
||||||
cbox.chatbox.panels.input:RequestFocus()
|
cbox.chatbox.panels.input:RequestFocus()
|
||||||
|
|
||||||
if IsValid(cbox.chatbox.panels.mode_switch) then
|
|
||||||
if alt then
|
|
||||||
cbox.chatbox.panels.mode_switch:UpdateMode(CHATBOX_MODE2:GetString())
|
|
||||||
else
|
|
||||||
cbox.chatbox.panels.mode_switch:UpdateMode(CHATBOX_MODE1:GetString())
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
hook.Run("StartChat")
|
hook.Run("StartChat")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
local CHATPRINT_COLOR = CreateClientConVar("cbox_chatprint_color", "151 211 255", true, false, "Color for system messages")
|
local CHATPRINT_COLOR = CreateClientConVar("cbox_chatprint_color", "151 211 255", true, false, "Color for system messages")
|
||||||
local JOINLEAVE_COLOR = CreateClientConVar("cbox_joinleave_color", "161 255 161", true, false, "Color for join/leave messages")
|
local JOINLEAVE_COLOR = CreateClientConVar("cbox_joinleave_color", "161 255 161", true, false, "Color for join/leave messages")
|
||||||
local TEAM_COLOR = CreateClientConVar("cbox_team_color", "24 161 35", true, false, "Color for the team tag")
|
|
||||||
local DEAD_COLOR = CreateClientConVar("cbox_dead_color", "255 24 35", true, false, "Color for the dead tag")
|
|
||||||
|
|
||||||
local color_white = Color(255, 255, 255)
|
|
||||||
|
|
||||||
local hookTable = {}
|
local hookTable = {}
|
||||||
if cbox.hooks then
|
if cbox.hooks then
|
||||||
|
@ -20,7 +16,6 @@ end
|
||||||
|
|
||||||
---@alias ValidHooks
|
---@alias ValidHooks
|
||||||
---| '"PreChatAddText"' # Runs before the true chat.AddText is called, allows modification to arguments
|
---| '"PreChatAddText"' # Runs before the true chat.AddText is called, allows modification to arguments
|
||||||
---| '"PrePlayerChat"' # Runs before player chat calls chat.AddText
|
|
||||||
|
|
||||||
---Adds a hook
|
---Adds a hook
|
||||||
---@param name ValidHooks
|
---@param name ValidHooks
|
||||||
|
@ -39,6 +34,7 @@ function cbox.hooks.Remove(name, identifier)
|
||||||
hookTable[name][identifier] = nil
|
hookTable[name][identifier] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
cbox.detours = cbox.detours or {}
|
cbox.detours = cbox.detours or {}
|
||||||
|
|
||||||
cbox.detours.chat_AddText = cbox.detours.chat_AddText or chat.AddText
|
cbox.detours.chat_AddText = cbox.detours.chat_AddText or chat.AddText
|
||||||
|
@ -81,67 +77,3 @@ hook.Add("ChatText", "cbox.chattext", function(index, name, text, type)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local function OverrideOnPlayerChat()
|
|
||||||
cbox.detours.OnPlayerChat = cbox.detours.OnPlayerChat or GAMEMODE.OnPlayerChat
|
|
||||||
|
|
||||||
function GAMEMODE:OnPlayerChat(ply, text, is_team, is_dead, ...)
|
|
||||||
local oldChatAddText = chat.AddText
|
|
||||||
local args = {}
|
|
||||||
chat.AddText = function(...)
|
|
||||||
args = {...}
|
|
||||||
end
|
|
||||||
cbox.detours.OnPlayerChat(self, ply, text, is_team, is_dead, ...)
|
|
||||||
chat.AddText = oldChatAddText
|
|
||||||
|
|
||||||
local new_args = {}
|
|
||||||
|
|
||||||
for i, arg in ipairs(args) do
|
|
||||||
new_args[i] = arg
|
|
||||||
|
|
||||||
if isstring(arg) then
|
|
||||||
if arg == "*DEAD* " then
|
|
||||||
new_args[i - 1] = cbox.utils.ParseColorStringToColor(DEAD_COLOR:GetString())
|
|
||||||
elseif arg == "(TEAM) " then
|
|
||||||
new_args[i - 1] = cbox.utils.ParseColorStringToColor(TEAM_COLOR:GetString())
|
|
||||||
elseif arg == "Console" then
|
|
||||||
table.insert(new_args, i, Color(160, 160, 160))
|
|
||||||
elseif arg:StartsWith(": ") and #arg > 2 then
|
|
||||||
local text = arg:sub(3)
|
|
||||||
new_args[i] = ": "
|
|
||||||
table.insert(new_args, i + 1, text)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local hooks = hookTable.PrePlayerChat or {}
|
|
||||||
for id, callback in next, hooks do
|
|
||||||
local function catch(err)
|
|
||||||
cbox.utils.RealmError(("Failed to run callback for PrePlayerChat hook %q:"):format(id), err)
|
|
||||||
end
|
|
||||||
|
|
||||||
local ok, ret = xpcall(callback, catch, new_args)
|
|
||||||
if not ok then continue end
|
|
||||||
|
|
||||||
if ret ~= nil then
|
|
||||||
if not istable(ret) then
|
|
||||||
cbox.utils.RealmError(("Got return for PrePlayerChat hook %q, but it was not a table."):format(id))
|
|
||||||
|
|
||||||
continue
|
|
||||||
end
|
|
||||||
new_args = ret
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
chat.AddText(unpack(new_args))
|
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
hook.Add("Initialize", "cbox.onplayerchat", function()
|
|
||||||
OverrideOnPlayerChat()
|
|
||||||
end)
|
|
||||||
if GAMEMODE then
|
|
||||||
OverrideOnPlayerChat()
|
|
||||||
end
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
cbox.chatbox.AddMode("say", "Say", function(text)
|
|
||||||
RunConsoleCommand("say", text)
|
|
||||||
end)
|
|
||||||
|
|
||||||
cbox.chatbox.AddMode("say_team", "Team", function(text)
|
|
||||||
RunConsoleCommand("say_team", text)
|
|
||||||
end)
|
|
||||||
|
|
||||||
cbox.chatbox.AddMode("cmd", "Console", function(text)
|
|
||||||
local function catch(err)
|
|
||||||
LocalPlayer():ChatPrint("Failed to run command: " .. err)
|
|
||||||
end
|
|
||||||
|
|
||||||
xpcall(function() LocalPlayer():ConCommand(text) end, catch)
|
|
||||||
end)
|
|
|
@ -7,9 +7,11 @@ cbox.hooks.Add("PreChatAddText", "cbox.greentext", function(args)
|
||||||
if not ENABLED:GetBool() then return end
|
if not ENABLED:GetBool() then return end
|
||||||
|
|
||||||
for i, arg in ipairs(args) do
|
for i, arg in ipairs(args) do
|
||||||
local prevArg = args[i - 1]
|
if isstring(arg) and arg:StartsWith(": >") then
|
||||||
if isstring(prevArg) and prevArg == ": " and isstring(arg) and arg:StartsWith(">") then
|
args[i] = arg:sub(3)
|
||||||
table.insert(args, i, cbox.utils.ParseColorStringToColor(COLOR:GetString()))
|
table.insert(args, i, cbox.utils.ParseColorStringToColor(COLOR:GetString()))
|
||||||
|
table.insert(args, i, ": ")
|
||||||
|
table.insert(args, i, color_white)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,7 +8,10 @@ local ALL_MESSAGES = CreateClientConVar("cbox_timestamps_all", "1", true, false,
|
||||||
|
|
||||||
local color_white = Color(255, 255, 255)
|
local color_white = Color(255, 255, 255)
|
||||||
|
|
||||||
local function MakeTimestamp(args)
|
cbox.hooks.Add("PreChatAddText", "cbox.timestamps", function(args)
|
||||||
|
if not ENABLED:GetBool() then return end
|
||||||
|
if not ALL_MESSAGES:GetBool() then return end
|
||||||
|
|
||||||
local use24 = TRUETIME:GetBool()
|
local use24 = TRUETIME:GetBool()
|
||||||
local stamp = ""
|
local stamp = ""
|
||||||
|
|
||||||
|
@ -50,18 +53,4 @@ local function MakeTimestamp(args)
|
||||||
end
|
end
|
||||||
|
|
||||||
return new_args
|
return new_args
|
||||||
end
|
|
||||||
|
|
||||||
cbox.hooks.Add("PreChatAddText", "cbox.timestamps", function(args)
|
|
||||||
if not ENABLED:GetBool() then return end
|
|
||||||
if not ALL_MESSAGES:GetBool() then return end
|
|
||||||
|
|
||||||
return MakeTimestamp(args)
|
|
||||||
end)
|
|
||||||
|
|
||||||
cbox.hooks.Add("PrePlayerChat", "cbox.timestamps", function(args)
|
|
||||||
if not ENABLED:GetBool() then return end
|
|
||||||
if ALL_MESSAGES:GetBool() then return end
|
|
||||||
|
|
||||||
return MakeTimestamp(args)
|
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -7,7 +7,6 @@ include("cbox/sh_utils.lua")
|
||||||
if SERVER then
|
if SERVER then
|
||||||
AddCSLuaFile("cbox/cl_hooks.lua")
|
AddCSLuaFile("cbox/cl_hooks.lua")
|
||||||
AddCSLuaFile("cbox/cl_chatbox.lua")
|
AddCSLuaFile("cbox/cl_chatbox.lua")
|
||||||
AddCSLuaFile("cbox/cl_modes.lua")
|
|
||||||
|
|
||||||
local tab_files = file.Find("cbox/tabs/*", "LUA")
|
local tab_files = file.Find("cbox/tabs/*", "LUA")
|
||||||
for _, name in ipairs(tab_files) do
|
for _, name in ipairs(tab_files) do
|
||||||
|
|
|
@ -45,20 +45,11 @@ cbox.chatbox.AddTab("\1chat", "Chat", "icon16/comments.png", function()
|
||||||
|
|
||||||
local mode_switch = vgui.Create("DButton", input_wrapper)
|
local mode_switch = vgui.Create("DButton", input_wrapper)
|
||||||
mode_switch:SetTextColor(INPUT_TEXT_COLOR)
|
mode_switch:SetTextColor(INPUT_TEXT_COLOR)
|
||||||
|
mode_switch:SetText("Say")
|
||||||
|
mode_switch:SizeToContents()
|
||||||
mode_switch:Dock(LEFT)
|
mode_switch:Dock(LEFT)
|
||||||
cbox.chatbox.panels.mode_switch = mode_switch
|
cbox.chatbox.panels.mode_switch = mode_switch
|
||||||
|
|
||||||
function mode_switch:UpdateMode(mode)
|
|
||||||
local mode_data = cbox.chatbox.modes[mode]
|
|
||||||
if not mode_data then
|
|
||||||
self.current_mode = "say"
|
|
||||||
mode_data = cbox.chatbox.modes.say
|
|
||||||
end
|
|
||||||
|
|
||||||
self.current_mode = mode
|
|
||||||
self:SetText(mode_data.name)
|
|
||||||
end
|
|
||||||
|
|
||||||
function mode_switch:Paint(w, h)
|
function mode_switch:Paint(w, h)
|
||||||
surface_SetDrawColor(0, 0, 0, 128)
|
surface_SetDrawColor(0, 0, 0, 128)
|
||||||
surface_DrawRect(0, 0, w, h)
|
surface_DrawRect(0, 0, w, h)
|
||||||
|
@ -75,31 +66,13 @@ cbox.chatbox.AddTab("\1chat", "Chat", "icon16/comments.png", function()
|
||||||
DLabel.ApplySchemeSettings(self)
|
DLabel.ApplySchemeSettings(self)
|
||||||
end
|
end
|
||||||
mode_switch:SetFont("ChatFont")
|
mode_switch:SetFont("ChatFont")
|
||||||
mode_switch:UpdateMode("say")
|
|
||||||
|
|
||||||
function mode_switch:NextMode()
|
|
||||||
local keys = table.GetKeys(cbox.chatbox.modes)
|
|
||||||
table.sort(keys)
|
|
||||||
|
|
||||||
local _, next_mode = next(keys, table.KeyFromValue(keys, self.current_mode))
|
|
||||||
if not next_mode then next_mode = keys[1] end
|
|
||||||
|
|
||||||
self:UpdateMode(next_mode)
|
|
||||||
end
|
|
||||||
|
|
||||||
function mode_switch:DoClick()
|
function mode_switch:DoClick()
|
||||||
self:NextMode()
|
-- TODO
|
||||||
end
|
end
|
||||||
function mode_switch:DoRightClick()
|
function mode_switch:DoRightClick()
|
||||||
local menu = DermaMenu()
|
-- TODO
|
||||||
|
|
||||||
for mode, data in SortedPairs(cbox.chatbox.modes) do
|
|
||||||
menu:AddOption(data.name, function()
|
|
||||||
self:UpdateMode(mode)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
menu:Open()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function input:OnKeyCodeTyped(key)
|
function input:OnKeyCodeTyped(key)
|
||||||
|
@ -111,17 +84,16 @@ cbox.chatbox.AddTab("\1chat", "Chat", "icon16/comments.png", function()
|
||||||
elseif key == KEY_ENTER then
|
elseif key == KEY_ENTER then
|
||||||
local text = self:GetText():Trim()
|
local text = self:GetText():Trim()
|
||||||
if text ~= "" then
|
if text ~= "" then
|
||||||
cbox.chatbox.modes[mode_switch.current_mode].callback(text)
|
RunConsoleCommand("say", text)
|
||||||
end
|
end
|
||||||
|
|
||||||
cbox.chatbox.Close()
|
cbox.chatbox.Close()
|
||||||
elseif key == KEY_TAB then
|
elseif key == KEY_TAB then
|
||||||
if #self:GetText() == 0 then
|
if #self:GetText() == 0 then
|
||||||
mode_switch:NextMode()
|
-- TODO: mode switch
|
||||||
else
|
else
|
||||||
-- TODO: autocomplete
|
-- TODO: autocomplete
|
||||||
end
|
end
|
||||||
timer.Simple(0, function() self:RequestFocus() end)
|
|
||||||
else
|
else
|
||||||
hook.Run("ChatTextChanged", self:GetText())
|
hook.Run("ChatTextChanged", self:GetText())
|
||||||
end
|
end
|
||||||
|
@ -143,7 +115,8 @@ hook.Add("OnChatAddText", "cbox.chatbox.history", function(args)
|
||||||
history:InsertColorChange(col.r, col.g, col.b, 255)
|
history:InsertColorChange(col.r, col.g, col.b, 255)
|
||||||
history:AppendText(arg:Name())
|
history:AppendText(arg:Name())
|
||||||
else
|
else
|
||||||
history:InsertColorChange(160, 160, 160, 255)
|
local col = cbox.utils.colors.BRAND
|
||||||
|
history:InsertColorChange(col.r, col.g, col.b, 255)
|
||||||
history:AppendText("???")
|
history:AppendText("???")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue