WOW PROJECT ID

From Wowpedia
Jump to: navigation, search

WOW_PROJECT_ID is a global variable that lets you write conditional code for classic versus mainline [1]

WOW_PROJECT_ID == WOW_PROJECT_MAINLINE == 1 -- for BfA / main line / retail
WOW_PROJECT_ID == WOW_PROJECT_CLASSIC == 2 -- for WoW Classic

Examples

if _G.WOW_PROJECT_ID == _G.WOW_PROJECT_CLASSIC then
  -- classic specific stuff here
else
  -- bfa/mainline stuff here
end

or

MyAddon.IsClassic = (_G.WOW_PROJECT_ID == _G.WOW_PROJECT_CLASSIC)
if MyAddon.IsClassic then ...

See also