chat: add option to show channel names

This commit is contained in:
greenya
2017-05-26 16:17:06 +02:00
committed by shagu
parent a7f6e0abe1
commit 83bb05f616
3 changed files with 11 additions and 7 deletions
+1
View File
@@ -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
View File
@@ -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
+1
View File
@@ -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")