WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Short Chat Channelnames (https://www.wowinterface.com/forums/showthread.php?t=59248)

muleyo 10-06-22 01:50 PM

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

Xrystal 10-06-22 02:27 PM

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

sirpucna 10-08-22 02:29 AM

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



All times are GMT -6. The time now is 10:30 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI