Thread Tools Display Modes
08-16-08, 08:17 AM   #1
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
How to detect if the client is WotLK?

See topic. Any idea?
  Reply With Quote
08-16-08, 08:28 AM   #2
Mikord
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 61
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())
if tocVersion >= 30000 then
 -- It's WotLK....
end
  Reply With Quote
08-16-08, 11:22 AM   #3
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
This will do the job. Thanks a lot Mikord.
  Reply With Quote
08-16-08, 01:52 PM   #4
Tekkub
A Molten Giant
 
Tekkub's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 960
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
  Reply With Quote
08-16-08, 03:21 PM   #5
dafire
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 216
some just do

Code:
local WotLK = not not ToggleAchievementFrame
  Reply With Quote
08-16-08, 04:02 PM   #6
Tekkub
A Molten Giant
 
Tekkub's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 960
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.
  Reply With Quote
08-16-08, 04:48 PM   #7
Fritos
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 4
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.

Last edited by Fritos : 08-16-08 at 04:55 PM.
  Reply With Quote
08-16-08, 04:56 PM   #8
Tekkub
A Molten Giant
 
Tekkub's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 960
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.
  Reply With Quote
08-16-08, 05:04 PM   #9
Fritos
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 4
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.
  Reply With Quote
08-16-08, 05:42 PM   #10
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
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.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » How to detect if the client is WotLK?


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