Skip to content

Ravendwyr/LibIsClassic-1.0

Repository files navigation

LibIsClassic-1.0

A small embeddable library to detect if you're on Retail or Classic servers.

Version Tracker


The Quick Intro

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() - returns true on modern retail servers and false on other servers
  • MyAddon:IsClassic() - returns true on Classic Era (1.13.x) servers and false on other servers
  • MyAddon:IsBurningCrusadeClassic() - returns true on Burning Crusade Classic (2.5.x) servers and false on other servers

Example

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

Support

Twitter Discord Sponsor

Twitch Crypto PayPal Coffee