mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 06:00:00 +00:00
chat: add option to show channel names
This commit is contained in:
@@ -172,6 +172,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("chat", "text", "timeformat", "%H:%M:%S")
|
||||
pfUI:UpdateConfig("chat", "text", "timebracket", "[]")
|
||||
pfUI:UpdateConfig("chat", "text", "timecolor", ".8,.8,.8,1")
|
||||
pfUI:UpdateConfig("chat", "text", "channelnumonly", "1")
|
||||
pfUI:UpdateConfig("chat", "text", "detecturl", "1")
|
||||
pfUI:UpdateConfig("chat", "text", "classcolor", "1")
|
||||
pfUI:UpdateConfig("chat", "left", "width", "380")
|
||||
|
||||
+9
-7
@@ -702,13 +702,15 @@ pfUI:RegisterModule("chat", function ()
|
||||
text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "[|Hplayer:%1|h" .. Name .. "|h]" .. "%2")
|
||||
end
|
||||
|
||||
local pattern = "%]%s+(.*|Hplayer)"
|
||||
local channel = string.gsub(text, ".*%[(.-)" .. pattern ..".+", "%1")
|
||||
if string.find(channel, "%d+%. ") then
|
||||
channel = string.gsub(channel, "(%d+)%..*", "channel%1")
|
||||
channel = string.gsub(channel, "channel", "")
|
||||
pattern = "%[%d+%..-" .. pattern
|
||||
text = string.gsub(text, pattern, "["..channel.."] ".."%1")
|
||||
if C.chat.text.channelnumonly == "1" then
|
||||
local pattern = "%]%s+(.*|Hplayer)"
|
||||
local channel = string.gsub(text, ".*%[(.-)" .. pattern ..".+", "%1")
|
||||
if string.find(channel, "%d+%. ") then
|
||||
channel = string.gsub(channel, "(%d+)%..*", "channel%1")
|
||||
channel = string.gsub(channel, "channel", "")
|
||||
pattern = "%[%d+%..-" .. pattern
|
||||
text = string.gsub(text, pattern, "["..channel.."] ".."%1")
|
||||
end
|
||||
end
|
||||
|
||||
-- show timestamp in chat
|
||||
|
||||
@@ -985,6 +985,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Timestamp Format", C.chat.text, "timeformat")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Timestamp Brackets", C.chat.text, "timebracket")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Timestamp Color", C.chat.text, "timecolor", "color")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Hide Channel Names", C.chat.text, "channelnumonly", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Enable URL Detection", C.chat.text, "detecturl", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Enable Class Colors", C.chat.text, "classcolor", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.chat, "Left Chat Width", C.chat.left, "width")
|
||||
|
||||
Reference in New Issue
Block a user