Earlier Versions
Name | Size | Uploaded | Game Version | Downloads | |
v1.0-2 release | 3.54 KB | Sep 2, 2022 | 9.2.7 +3 | 197 | Download |
v1.0-1 release | 2.34 KB | Jun 3, 2021 | 9.0.5 | 45 | Download |
Description
LibIsClassic-1.0
A small embeddable library to detect if you’re on Retail or Classic servers.
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()
– 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
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
Add a comment