Skip to content

Commit

Permalink
Implement LCS
Browse files Browse the repository at this point in the history
  • Loading branch information
doadin committed Oct 2, 2024
1 parent 64632be commit 3acf3a3
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ jobs:
- name: Package Classic
uses: BigWigsMods/packager@master
with:
args: -g classic
args: -g classic -m .pkgmeta-classic

- name: Package BC Classic
uses: BigWigsMods/packager@master
with:
args: -g bcc
args: -g bcc -m .pkgmeta-classic

- name: Package Wrath Classic
uses: BigWigsMods/packager@master
with:
args: -g wrath
args: -g wrath -m .pkgmeta-classic

- name: Package Cata Classic
uses: BigWigsMods/packager@master
with:
args: -g cata
args: -g cata -m .pkgmeta-classic
34 changes: 34 additions & 0 deletions .pkgmeta-classic
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package-as: MaxDps
enable-nolib-creation: no

externals:
# Ace Libs
Libs/AceAddon-3.0:
url: https://repos.curseforge.com/wow/ace3/trunk/AceAddon-3.0
Libs/AceConsole-3.0:
url: https://repos.curseforge.com/wow/ace3/trunk/AceConsole-3.0
Libs/AceDB-3.0:
url: https://repos.curseforge.com/wow/ace3/trunk/AceDB-3.0
Libs/AceEvent-3.0:
url: https://repos.curseforge.com/wow/ace3/trunk/AceEvent-3.0
Libs/AceTimer-3.0:
url: https://repos.curseforge.com/wow/ace3/trunk/AceTimer-3.0
Libs/CallbackHandler-1.0:
url: https://repos.curseforge.com/wow/ace3/trunk/CallbackHandler-1.0
Libs/LibCustomGlow-1.0:
url: https://github.com/Stanzilla/LibCustomGlow.git
Libs/LibRangeCheck-3.0:
url: https://github.com/WeakAuras/LibRangeCheck-3.0.git
Libs/LibClassicSpecs:
url: https://github.com/Doadin/LibClassicSpecs.git
Libs/LibSharedMedia-3.0:
url: https://repos.curseforge.com/wow/libsharedmedia-3-0/trunk/LibSharedMedia-3.0
Libs/LibStub:
url: https://repos.curseforge.com/wow/ace3/trunk/LibStub

Libs/StdUi:
url: https://github.com/kaminaris/StdUi.git

ignore:
- README.md
- CHANGELOG.md
19 changes: 11 additions & 8 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ local TableIndexOf = tIndexOf
local UnitIsFriend = UnitIsFriend
local IsPlayerSpell = IsPlayerSpell
local UnitClass = UnitClass
local GetSpecialization = GetSpecialization
local CreateFrame = CreateFrame
local GetAddOnInfo = C_AddOns.GetAddOnInfo
local IsAddOnLoaded = C_AddOns.IsAddOnLoaded
Expand Down Expand Up @@ -66,6 +65,16 @@ function MaxDps:IsRetailWow()
return WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
end

local LCS
local GetSpecialization = LCS and LCS.GetSpecialization or GetSpecialization
if MaxDps:IsRetailWow() then
GetSpecialization = GetSpecialization
end
if not MaxDps:IsRetailWow() then
LCS = LibStub("LibClassicSpecs-Doadin")
GetSpecialization = LCS and LCS.GetSpecialization
end

function MaxDps:ShowMainWindow()
if not self.Window then
self.Window = self:GetModule('Window')
Expand Down Expand Up @@ -7163,13 +7172,7 @@ function MaxDps:InitRotations()
self:CountTier()

local _, _, classId = UnitClass('player')
local spec

if MaxDps:IsRetailWow() then
spec = GetSpecialization()
else
spec = GetSpecializationInfoForClassID(classId)
end
local spec = GetSpecialization()

self.ClassId = classId
self.Spec = spec
Expand Down
1 change: 1 addition & 0 deletions MaxDps.toc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Libs\LibCustomGlow-1.0\LibCustomGlow-1.0.lua
Libs\ForAllIndentsAndPurposes.lua
Libs\StdUi\StdUi.xml
Libs\LibRangeCheck-3.0\LibRangeCheck-3.0\LibRangeCheck-3.0.lua
Libs\LibClassicSpecs\LibClassicSpecs.lua

Core.lua
Tier.lua
Expand Down
11 changes: 9 additions & 2 deletions Modules/Custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ local loadstring = loadstring
local pcall = pcall
local GetNumClasses = GetNumClasses
local GetClassInfo = GetClassInfo
local GetNumSpecializationsForClassID = GetNumSpecializationsForClassID
local GetSpecializationInfoForClassID = GetSpecializationInfoForClassID

local LCS

if not MaxDps:IsRetailWow() then
LCS = LibStub("LibClassicSpecs-Doadin")
end

local GetNumSpecializationsForClassID = LCS and LCS.GetNumSpecializationsForClassID or GetNumSpecializationsForClassID
local GetSpecializationInfoForClassID = LCS and LCS.GetSpecializationInfoForClassID or GetSpecializationInfoForClassID

local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS

Expand Down

0 comments on commit 3acf3a3

Please sign in to comment.