mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-30 19:19:59 +00:00
chat: add option to customize default brackets
This commit is contained in:
@@ -557,6 +557,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("chat", "text", "input_width", "0")
|
||||
pfUI:UpdateConfig("chat", "text", "input_height", "0")
|
||||
pfUI:UpdateConfig("chat", "text", "outline", "1")
|
||||
pfUI:UpdateConfig("chat", "text", "bracket", "[]")
|
||||
pfUI:UpdateConfig("chat", "text", "time", "0")
|
||||
pfUI:UpdateConfig("chat", "text", "timeformat", "%H:%M:%S")
|
||||
pfUI:UpdateConfig("chat", "text", "timebracket", "[]")
|
||||
|
||||
Vendored
+2
-1
@@ -58,6 +58,7 @@ pfUI_translation["deDE"] = {
|
||||
["Chat Border Color"] = nil,
|
||||
["Chat Border Size"] = nil,
|
||||
["Chat Bubble Transparency"] = nil,
|
||||
["Chat Default Brackets"] = nil,
|
||||
["Chat"] = nil,
|
||||
["Class"] = nil,
|
||||
["Clear Rolls"] = nil,
|
||||
@@ -379,9 +380,9 @@ pfUI_translation["deDE"] = {
|
||||
["Show Players Only"] = nil,
|
||||
["Show Procs as Buff Indicators"] = nil,
|
||||
["Show Procs of all Classes"] = nil,
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Show PvP Icon"] = nil,
|
||||
["Show Self in Group Frames"] = nil,
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Skins"] = nil,
|
||||
["Slow"] = nil,
|
||||
["Small"] = nil,
|
||||
|
||||
Vendored
+2
-1
@@ -58,6 +58,7 @@ pfUI_translation["enUS"] = {
|
||||
["Chat Border Color"] = nil,
|
||||
["Chat Border Size"] = nil,
|
||||
["Chat Bubble Transparency"] = nil,
|
||||
["Chat Default Brackets"] = nil,
|
||||
["Chat"] = nil,
|
||||
["Class"] = nil,
|
||||
["Clear Rolls"] = nil,
|
||||
@@ -379,9 +380,9 @@ pfUI_translation["enUS"] = {
|
||||
["Show Players Only"] = nil,
|
||||
["Show Procs as Buff Indicators"] = nil,
|
||||
["Show Procs of all Classes"] = nil,
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Show PvP Icon"] = nil,
|
||||
["Show Self in Group Frames"] = nil,
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Skins"] = nil,
|
||||
["Slow"] = nil,
|
||||
["Small"] = nil,
|
||||
|
||||
Vendored
+3
-2
@@ -58,6 +58,7 @@ pfUI_translation["esES"] = {
|
||||
["Chat Border Color"] = "Color del Borde de Chat",
|
||||
["Chat Border Size"] = "Tamaño del Borde de Chat",
|
||||
["Chat Bubble Transparency"] = "Transparencia del Bocadillo de Chat",
|
||||
["Chat Default Brackets"] = nil,
|
||||
["Chat"] = nil,
|
||||
["Class"] = "Clase",
|
||||
["Clear Rolls"] = "Borrar los dados",
|
||||
@@ -379,9 +380,9 @@ pfUI_translation["esES"] = {
|
||||
["Show Players Only"] = "Solamente Mostrar Jugadores",
|
||||
["Show Procs as Buff Indicators"] = "Mostrar Ocurrencias aleatorias programadas (Procs) como Indicadores de Buffs",
|
||||
["Show Procs of all Classes"] = "Mostrar Ocurrencias aleatorias programadas (Procs) de Todas las Clases",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Show PvP Icon"] = "Mostrar Icono de JcJ",
|
||||
["Show Self in Group Frames"] = "Mostrar a ti Mismo en los Marcos del Grupo",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Skins"] = "Piel",
|
||||
["Slow"] = "Lento",
|
||||
["Small"] = "Pequeño",
|
||||
@@ -403,7 +404,7 @@ pfUI_translation["esES"] = {
|
||||
["Text Colors"] = "Color del Texto",
|
||||
["Thirdparty"] = "Tercero",
|
||||
["This Session"] = "Esta Sesión",
|
||||
["Timestamp Brackets"] = "Corchetes del Sello de Tiempo",
|
||||
["Timestamp Brackets"] = nil,
|
||||
["Timestamp Color"] = "Color del Sello de Tiempo",
|
||||
["Timestamp Format"] = "Formato del Sello de Tiempo",
|
||||
["Time"] = "Tiempo",
|
||||
|
||||
Vendored
+3
-2
@@ -59,6 +59,7 @@ pfUI_translation["frFR"] = {
|
||||
["Chat Border Size"] = "Taille de la bordure du chat",
|
||||
["Chat Bubble Transparency"] = nil,
|
||||
["Chat"] = "Chat",
|
||||
["Chat Default Brackets"] = nil,
|
||||
["Class"] = "Classe",
|
||||
["Clear Rolls"] = nil,
|
||||
["Click Action"] = "Action au clic",
|
||||
@@ -379,9 +380,9 @@ pfUI_translation["frFR"] = {
|
||||
["Show Players Only"] = "Afficher les joueurs uniquement",
|
||||
["Show Procs as Buff Indicators"] = "Afficher les procs en tant qu'indicateur d'amélioration",
|
||||
["Show Procs of all Classes"] = "Afficher les procs de chaque classe",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Show PvP Icon"] = "Afficher l'icône JcJ",
|
||||
["Show Self in Group Frames"] = "S'afficher dans l'UI Groupe",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Skins"] = nil,
|
||||
["Slow"] = "Doucement",
|
||||
["Small"] = nil,
|
||||
@@ -404,7 +405,7 @@ pfUI_translation["frFR"] = {
|
||||
["Thirdparty"] = "Autres addons",
|
||||
["This Session"] = "Session Actuelle",
|
||||
["Time"] = "Heure",
|
||||
["Timestamp Brackets"] = "Format des horaires des messages",
|
||||
["Timestamp Brackets"] = nil,
|
||||
["Timestamp Color"] = "Couleur des horaires des messages",
|
||||
["Timestamp Format"] = "Format des horaires des messages",
|
||||
["Tiny (PixelPerfect)"] = nil,
|
||||
|
||||
Vendored
+3
-2
@@ -59,6 +59,7 @@ pfUI_translation["koKR"] = {
|
||||
["Chat Border Color"] = "채팅 테두리 색상",
|
||||
["Chat Border Size"] = "채팅 테두리 크기",
|
||||
["Chat Bubble Transparency"] = nil,
|
||||
["Chat Default Brackets"] = nil,
|
||||
["Class"] = "클래스(직업)",
|
||||
["Clear Rolls"] = nil,
|
||||
["Click Action"] = "클릭 액션",
|
||||
@@ -379,9 +380,9 @@ pfUI_translation["koKR"] = {
|
||||
["Show Players Only"] = "플레이어만 보기",
|
||||
["Show Procs as Buff Indicators"] = "무기활성화버프 버프표시기에 보기",
|
||||
["Show Procs of all Classes"] = "모든 클래스 무기활성화 버프 보기",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Show PvP Icon"] = "PvP아이콘 표시",
|
||||
["Show Self in Group Frames"] = nil,
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Skins"] = nil,
|
||||
["Slow"] = "느린",
|
||||
["Small"] = nil,
|
||||
@@ -404,7 +405,7 @@ pfUI_translation["koKR"] = {
|
||||
["Thirdparty"] = "서드파티",
|
||||
["This Session"] = "이번 세션",
|
||||
["Time"] = "시간",
|
||||
["Timestamp Brackets"] = "시간표시 괄호",
|
||||
["Timestamp Brackets"] = nil,
|
||||
["Timestamp Color"] = "시간표시 색상",
|
||||
["Timestamp Format"] = "시간표시 형식",
|
||||
["Tiny (PixelPerfect)"] = nil,
|
||||
|
||||
Vendored
+3
-2
@@ -58,6 +58,7 @@ pfUI_translation["ruRU"] = {
|
||||
["Chat Border Color"] = "Цвет бордюра чата",
|
||||
["Chat Border Size"] = "Размер бордюра чата",
|
||||
["Chat Bubble Transparency"] = "Прозрачность пузыря чата",
|
||||
["Chat Default Brackets"] = nil,
|
||||
["Chat"] = "Чат",
|
||||
["Class"] = "Класс",
|
||||
["Clear Rolls"] = "Очистить броски",
|
||||
@@ -379,9 +380,9 @@ pfUI_translation["ruRU"] = {
|
||||
["Show Players Only"] = "Показать только игроков",
|
||||
["Show Procs as Buff Indicators"] = "Показать проки (Procs) как индикаторы баффов",
|
||||
["Show Procs of all Classes"] = "Показать проки (Procs) всех классов",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Show PvP Icon"] = "Показать PvP иконку",
|
||||
["Show Self in Group Frames"] = "Показать себя в окне группы",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Skins"] = "Оболочки",
|
||||
["Slow"] = "Медленно",
|
||||
["Small"] = "Маленький",
|
||||
@@ -403,7 +404,7 @@ pfUI_translation["ruRU"] = {
|
||||
["Text Colors"] = "Цвета текста",
|
||||
["Thirdparty"] = "Другие аддоны",
|
||||
["This Session"] = "Эта сессия",
|
||||
["Timestamp Brackets"] = "Скобки отметок времени",
|
||||
["Timestamp Brackets"] = nil,
|
||||
["Timestamp Color"] = "Цвет отметок времени",
|
||||
["Timestamp Format"] = "Формат отметок времени",
|
||||
["Time"] = "Время",
|
||||
|
||||
Vendored
+3
-2
@@ -58,6 +58,7 @@ pfUI_translation["zhCN"] = {
|
||||
["Chat Border Color"] = "聊天窗口边框颜色",
|
||||
["Chat Border Size"] = "聊天窗口边框大小",
|
||||
["Chat Bubble Transparency"] = nil,
|
||||
["Chat Default Brackets"] = nil,
|
||||
["Chat"] = "聊天窗口",
|
||||
["Class"] = "职业",
|
||||
["Clear Rolls"] = "清除Roll点",
|
||||
@@ -379,9 +380,9 @@ pfUI_translation["zhCN"] = {
|
||||
["Show Players Only"] = "仅显示自己",
|
||||
["Show Procs as Buff Indicators"] = "在框架的Buff指示器显示触发效果",
|
||||
["Show Procs of all Classes"] = "显示所有职业的触发效果",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Show PvP Icon"] = "显示PVP图标",
|
||||
["Show Self in Group Frames"] = "在小队列表中显示自己",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Skins"] = "皮肤",
|
||||
["Slow"] = "慢速",
|
||||
["Small"] = nil,
|
||||
@@ -403,7 +404,7 @@ pfUI_translation["zhCN"] = {
|
||||
["Text Colors"] = nil,
|
||||
["Thirdparty"] = "第三方插件接口",
|
||||
["This Session"] = "本次登录收益",
|
||||
["Timestamp Brackets"] = "时间戳括弧",
|
||||
["Timestamp Brackets"] = nil,
|
||||
["Timestamp Color"] = "时间戳颜色",
|
||||
["Timestamp Format"] = "时间戳格式",
|
||||
["Time"] = "计时器",
|
||||
|
||||
Vendored
+3
-2
@@ -58,6 +58,7 @@ pfUI_translation["zhTW"] = {
|
||||
["Chat Border Color"] = "聊天窗口邊框顏色",
|
||||
["Chat Border Size"] = "聊天窗口邊框大小",
|
||||
["Chat Bubble Transparency"] = nil,
|
||||
["Chat Default Brackets"] = nil,
|
||||
["Chat"] = "聊天窗口",
|
||||
["Class"] = "職業",
|
||||
["Clear Rolls"] = "清除Roll點",
|
||||
@@ -379,9 +380,9 @@ pfUI_translation["zhTW"] = {
|
||||
["Show Players Only"] = "僅顯示自己",
|
||||
["Show Procs as Buff Indicators"] = "在框架的Buff指示器顯示觸發效果",
|
||||
["Show Procs of all Classes"] = "顯示所有職業的觸發效果",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Show PvP Icon"] = "顯示PVP圖示",
|
||||
["Show Self in Group Frames"] = "在小隊清單中顯示自己",
|
||||
["Show Totems as Buff Indicators"] = nil,
|
||||
["Skins"] = nil,
|
||||
["Slow"] = "慢速",
|
||||
["Small"] = nil,
|
||||
@@ -403,7 +404,7 @@ pfUI_translation["zhTW"] = {
|
||||
["Text Colors"] = nil,
|
||||
["Thirdparty"] = "協力廠商外掛程式介面",
|
||||
["This Session"] = "本次登錄收益",
|
||||
["Timestamp Brackets"] = "時間戳記括弧",
|
||||
["Timestamp Brackets"] = nil,
|
||||
["Timestamp Color"] = "時間戳記顏色",
|
||||
["Timestamp Format"] = "時間戳記格式",
|
||||
["Time"] = "計時器",
|
||||
|
||||
+22
-17
@@ -741,19 +741,27 @@ pfUI:RegisterModule("chat", function ()
|
||||
cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb)
|
||||
wcol = string.format("%02x%02x%02x",cr * 255,cg * 255, cb * 255)
|
||||
|
||||
-- read and parse chat bracket settings
|
||||
local left = string.sub(C.chat.text.bracket, 1, 1)
|
||||
local right = string.sub(C.chat.text.bracket, 2, 2)
|
||||
|
||||
-- read and parse chat time bracket settings
|
||||
local tleft = string.sub(C.chat.text.timebracket, 1, 1)
|
||||
local tright = string.sub(C.chat.text.timebracket, 2, 2)
|
||||
|
||||
-- shorten chat channel indicators
|
||||
local default = " " .. "%s" .. "|r:" .. "\32"
|
||||
_G.CHAT_CHANNEL_GET = "%s" .. "|r:" .. "\32"
|
||||
_G.CHAT_GUILD_GET = '[G]' .. default
|
||||
_G.CHAT_OFFICER_GET = '[O]'.. default
|
||||
_G.CHAT_PARTY_GET = '[P]' .. default
|
||||
_G.CHAT_RAID_GET = '[R]' .. default
|
||||
_G.CHAT_RAID_LEADER_GET = '[RL]' .. default
|
||||
_G.CHAT_RAID_WARNING_GET = '[RW]' .. default
|
||||
_G.CHAT_BATTLEGROUND_GET = '[BG]' .. default
|
||||
_G.CHAT_BATTLEGROUND_LEADER_GET = '[BL]' .. default
|
||||
_G.CHAT_SAY_GET = '[S]' .. default
|
||||
_G.CHAT_YELL_GET = '[Y]' .. default
|
||||
_G.CHAT_GUILD_GET = left .. "G" .. right .. default
|
||||
_G.CHAT_OFFICER_GET = left .. "O" .. right .. default
|
||||
_G.CHAT_PARTY_GET = left .. "P" .. right .. default
|
||||
_G.CHAT_RAID_GET = left .. "R" .. right .. default
|
||||
_G.CHAT_RAID_LEADER_GET = left .. "RL" .. right .. default
|
||||
_G.CHAT_RAID_WARNING_GET = left .. "RW" .. right .. default
|
||||
_G.CHAT_BATTLEGROUND_GET = left .. "BG" .. right .. default
|
||||
_G.CHAT_BATTLEGROUND_LEADER_GET = left .. "BL" .. right .. default
|
||||
_G.CHAT_SAY_GET = left .. "S" .. right .. default
|
||||
_G.CHAT_YELL_GET = left .. "Y" .. right ..default
|
||||
|
||||
if C.chat.global.whispermod == "1" then
|
||||
_G.CHAT_WHISPER_GET = '|cff' .. wcol .. '[W]' .. default
|
||||
@@ -793,29 +801,26 @@ pfUI:RegisterModule("chat", function ()
|
||||
Name = "|cff" .. Color .. Name .. "|r"
|
||||
end
|
||||
end
|
||||
text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "[|Hplayer:%1|h" .. Name .. "|h]" .. "%2")
|
||||
text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "|r" .. left .. "|Hplayer:%1|h" .. Name .. "|h|r" .. right .. "%2")
|
||||
end
|
||||
|
||||
-- reduce channel name to number
|
||||
if C.chat.text.channelnumonly == "1" then
|
||||
local pattern = "%]%s+(.*|Hplayer)"
|
||||
local channel = string.gsub(text, ".*%[(.-)" .. pattern ..".+", "%1")
|
||||
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")
|
||||
text = string.gsub(text, pattern, left .. channel .. right .. " %1")
|
||||
end
|
||||
end
|
||||
|
||||
-- show timestamp in chat
|
||||
if C.chat.text.time == "1" then
|
||||
local left = string.sub(C.chat.text.timebracket, 1, 1)
|
||||
local right = string.sub(C.chat.text.timebracket, 2, 2)
|
||||
|
||||
local r,g,b,a = strsplit(",", C.chat.text.timecolor)
|
||||
local chex = string.format("%02x%02x%02x%02x", a*255, r*255, g*255, b*255)
|
||||
text = "|c" .. chex .. left .. date(C.chat.text.timeformat) .. right .. "|r " .. text
|
||||
text = "|c" .. chex .. tleft .. date(C.chat.text.timeformat) .. tright .. "|r " .. text
|
||||
end
|
||||
|
||||
if C.chat.global.whispermod == "1" then
|
||||
|
||||
@@ -1129,6 +1129,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(nil, this, T["Inputbox Width"], C.chat.text, "input_width")
|
||||
CreateConfig(nil, this, T["Inputbox Height"], C.chat.text, "input_height")
|
||||
CreateConfig(nil, this, T["Enable Text Shadow"], C.chat.text, "outline", "checkbox")
|
||||
CreateConfig(nil, this, T["Chat Default Brackets"], C.chat.text, "bracket", nil, nil, nil, nil, "STRING")
|
||||
CreateConfig(nil, this, T["Enable Timestamps"], C.chat.text, "time", "checkbox")
|
||||
CreateConfig(nil, this, T["Timestamp Format"], C.chat.text, "timeformat", nil, nil, nil, nil, "STRING")
|
||||
CreateConfig(nil, this, T["Timestamp Brackets"], C.chat.text, "timebracket", nil, nil, nil, nil, "STRING")
|
||||
|
||||
Reference in New Issue
Block a user