Thread Tools Display Modes
10-06-22, 01:50 PM   #1
muleyo
A Deviate Faerie Dragon
Join Date: Apr 2021
Posts: 12
Short Chat Channelnames

Hi,

I'm currently trying to shorten the channel names of the ingame chat.

I wasn't really successful doing so.

Could someone provide some example code? That'd be awesome! Thanks
  Reply With Quote
10-06-22, 02:27 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,941
This is the nearest I could find to a possible function to override.

I don't know if it will help you or not, but it's a starting point.

https://www.townlong-yak.com/framexm...Frame.lua#2467
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
10-08-22, 02:29 AM   #3
sirpucna
An Aku'mai Servant
Join Date: Nov 2016
Posts: 34
i dont remember who i pulled this off, works in retail and beta.
Code:
local rplc = {"[GEN]","[T]","[WD]","[LD]","[LFG]","[GR]","[i]","[IL]","[G]","[P]","[PL]","[PL]","[O]","[R]","[RL]","[RW]","[%1]"}

local gsub = gsub
local time = _G.time
local newAddMsg = {}
local chn = {
	"%[%d%d?%. General[^%]]*%]",
	"%[%d%d?%. Trade[^%]]*%]",
	"%[%d%d?%. WorldDefense[^%]]*%]",
	"%[%d%d?%. LocalDefense[^%]]*%]",
	"%[%d%d?%. LookingForGroup[^%]]*%]",
	"%[%d%d?%. GuildRecruitment[^%]]*%]",
	gsub(CHAT_INSTANCE_CHAT_GET, ".*%[(.*)%].*", "%%[%1%%]"),
	gsub(CHAT_INSTANCE_CHAT_LEADER_GET, ".*%[(.*)%].*", "%%[%1%%]"),
	gsub(CHAT_GUILD_GET, ".*%[(.*)%].*", "%%[%1%%]"),
	gsub(CHAT_PARTY_GET, ".*%[(.*)%].*", "%%[%1%%]"),
	gsub(CHAT_PARTY_LEADER_GET, ".*%[(.*)%].*", "%%[%1%%]"),
	gsub(CHAT_PARTY_GUIDE_GET, ".*%[(.*)%].*", "%%[%1%%]"),
	gsub(CHAT_OFFICER_GET, ".*%[(.*)%].*", "%%[%1%%]"),
	gsub(CHAT_RAID_GET, ".*%[(.*)%].*", "%%[%1%%]"),
	gsub(CHAT_RAID_LEADER_GET, ".*%[(.*)%].*", "%%[%1%%]"),
	gsub(CHAT_RAID_WARNING_GET, ".*%[(.*)%].*", "%%[%1%%]"),
	"%[(%d%d?)%. ([^%]]+)%]"
}
local AddMessage = function(frame, text, ...)
	for i = 1, 17 do
		text = gsub(text, chn[i], rplc[i])
	end
	text = gsub(text, "%[(%d0?)%. .-%]", "[%1]")
	return newAddMsg[frame:GetName()](frame, text, ...)
end

for i = 1, NUM_CHAT_WINDOWS do
	local f = "ChatFrame"..i
	if i ~= 2 then -- skip combatlog
		newAddMsg[f] = _G[f].AddMessage
		_G[f].AddMessage = AddMessage    
	end
end
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Short Chat Channelnames


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off