A small embeddable library to detect if you're on Retail or Classic servers.
This library is designed to be directly embedded into your addon.
Ace3 method:
MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "LibIsClassic-1.0")
Non-Ace3 method:
local _, MyAddon = ...
MyAddon = LibStub("LibIsClassic-1.0"):Embed(MyAddon)
Standalone method (no embedding):
local LIC = LibStub("LibIsClassic-1.0")
This library provides a few functions for your addon to use. These functions are self-explanatory:
MyAddon:IsRetail()
- returnstrue
on modern retail servers andfalse
on other serversMyAddon:IsClassic()
- returnstrue
on Classic Era (1.13.x) servers andfalse
on other serversMyAddon:IsBurningCrusadeClassic()
- returnstrue
on Burning Crusade Classic (2.5.x) servers andfalse
on other servers
if self:IsRetail() then
-- do stuff that doesn't apply to 1.13.x or 2.5.x
end
if not self:IsBurningCrusadeClassic() then
-- do stuff that only applies to 1.13.x and retail
end