Skip to content

Commit

Permalink
Simplify game version checks
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim committed May 9, 2024
1 parent cba20d6 commit 754b7d8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ local _, _, _, interfaceVersion = GetBuildInfo()
Checks if the current client is running the "retail" version.
--]]
function addon:IsRetail()
return interfaceVersion >= 100000
end

--[[ namespace:IsClassic()
Checks if the current client is running the "classic" version.
--]]
function addon:IsClassic()
return interfaceVersion >= 20000 and interfaceVersion < 100000
return interfaceVersion > 100000
end

--[[ namespace:IsClassicEra()
Expand All @@ -23,6 +16,13 @@ function addon:IsClassicEra()
return interfaceVersion < 20000
end

--[[ namespace:IsClassic()
Checks if the current client is running the "classic" version.
--]]
function addon:IsClassic()
return not addon:IsRetail() and not addon:IsClassicEra()
end

-- easy frame "removal"
local hidden = CreateFrame('Frame')
hidden:Hide()
Expand Down

0 comments on commit 754b7d8

Please sign in to comment.