How to detect if the client is WotLK?
See topic. Any idea?
|
There are several ways you can do it.
One of the easiest is to check the TOC version via GetBuildInfo. http://www.wowwiki.com/API_GetBuildInfo Code:
local tocVersion = select(4, GetBuildInfo()) |
This will do the job. Thanks a lot Mikord.
|
I toss this in any addon that needs to do different things in wrath than live, then just test against the global...
Code:
if IS_WRATH_BUILD == nil then IS_WRATH_BUILD = (select(4, GetBuildInfo()) >= 30000) end |
some just do
Code:
local WotLK = not not ToggleAchievementFrame |
GetBuildInfo is much cleaner, what if they remove that toggle function and use something else? I saw them add a togglepanel function of some sort recently, they might decide they should use that.
|
They have added a function for this specifically:
GetAccountExpansionLevel() 1 = Classic Wow 2 = The Burning Crusade 3 = Wrath of the Lich King It'll return the value based on the level of expansions the user has. |
What about users that have the new client, but have not purchased the expansion? It's possible for the user to have 2.4.3, but not BC.
|
Oh I know, was giving another alternative if they are just looking to see if a specific expansion is installed.
I currently use the same code as GetBuildInfo() in my mod, was just snooping through the Interface Kit files and saw this. |
Thanks again for all the replies. There are much more way than expected. :)
Although it doesn't really matter right now (it's all about the different UIDropDown parameters and the UnitAura function) I'll use the patch level (GetBuildInfo). Seems to be most future-proof. |
All times are GMT -6. The time now is 03:33 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI