Thread: Chat Categories
View Single Post
06/30/14, 02:11 AM   #3
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by BadVolt View Post
You can do it by yourself.
Ie

Get zone channel ID
Lua Code:
  1. GetChatChannelId("zone")

Get Dynamic chat id:
Lua Code:
  1. local function GetChatId()
  2.     -- search for 100 channels
  3.     for i=1,100 do
  4.         local name=GetDynamicChatChannelName(i)
  5.         if name==GuildName then return i end
  6.     end
  7.     return false
  8. end
I get what you tried to do there. Only the order and the actuall code seems a bit odd.

I will try it with this code later, when I am at my client:
Code:
local function dumpCatageoryNames()
    local result = { }

    for i=1, GetNumChatCtagoeries(), 1 do
      result[i] = { ID = i, name= GetDynamicChatChannelName(i) }
    end

    return result
end
That also means I can now rework UTC to use those constats to save and assign the Categories instead of the numbers (wich could have caused issues if the Order changed between API versions).
  Reply With Quote