I ask a lua question here because I need my addon to find out which client it is loaded in. Is that possible using the API?
Currently I define X-Client in the various toc files and set to either Mainline, BCC, or Classic and then read the field using GetAddOnMetadata(“addon”, “X-Client”) but I think there must be a better way. But is there a better way?
As the last post of this linked thread says, you best use the WOW_PROJECT_ID constant to identify your client: https://wowpedia.fandom.com/wiki/WOW_PROJECT_ID
It’s official and corresponds to the game version. Blizzard increments the first digit (also called ‘major version’) with each new expansion.
So 1 is vanilla, 2 is TBC, 3 is Wrath, 4 is Cataclysm, etc, all the way up to 9 for Shadowlands.
The classic versions of the game reuse this versioning scheme. WoW Classic is 1.13.4, TBC classic is 2.5.2 atm. The original classic and TBC have lower version numbers.