-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrated Classic support #184
base: master
Are you sure you want to change the base?
Conversation
- Seperate .toc which does not load HelpTips and some widgets - adjusted constants and defaults - removes unsupported widgets from builder - removes unsupported health formats - helper functions for missing AuraUtil - seperate aura tooltip handling - several util functions
Yeah, the lua ci runner does not seem to approve my changes. I'm not too sure if I can fix those myself, but I'll take a look and learn about it. 😅 |
I will try to take a look over this later today - but changing enums to classes is a big no-no. Enums essentially describe an input to be x value out of y enum table. So if you have a function that expects a string to be one of the entries in an enum, then you can type it as such, but if it becomes a class, then it would expect it to be a table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, lots of stuff going on here. Overall the direction you went with this PR is in the right one.
There are things that need to addressed and changed however.
As for typing I've tried to point out the areas where it went wrong and how to resolve them.
As for the HelpTips - The file should still be loaded, but just make dummy functions for Acknowledge and Show funcs so we can reduce complexity. Could also just be a HelpTipVanilla.lua file.
I have some reservations about how the Defaults are handled, but that's not really something that I'm that concerned with atm.
If you have any questions about any of the comments feel free to ask them.
# Widgets/Bars/HealAbsorb.lua | ||
|
||
Widgets/Icons/RaidIcon.lua | ||
# Widgets/Icons/RoleIcon.lua # this could get reintegrated via LibGroupInfo support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why this would be turned off, since it doesn't actually use a lib, but UnitGroupRolesAssigned
, which should be functional in classic.
https://warcraft.wiki.gg/wiki/API_UnitGroupRolesAssigned
CUF.vars.isRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE | ||
CUF.vars.isVanilla = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC | ||
CUF.vars.isBCC = WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC and LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_BURNING_CRUSADE | ||
CUF.vars.isWrath = WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC | ||
CUF.vars.isCata = WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC | ||
CUF.vars.isTWW = LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_WAR_WITHIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make more sense to have these be set in Init.lua
.
if CUF.vars.isRetail then | ||
CUF.HelpTips:Acknowledge(tagHint, L.HelpTip_TagHintButton) | ||
end | ||
end) | ||
|
||
CUF.HelpTips:Show(tagHint, { | ||
text = L.HelpTip_TagHintButton, | ||
dbKey = "tagHintButton_Builder", | ||
buttonStyle = HelpTip.ButtonStyle.None, | ||
alignment = HelpTip.Alignment.Center, | ||
targetPoint = HelpTip.Point.LeftEdgeCenter, | ||
}) | ||
if CUF.vars.isRetail then | ||
CUF.HelpTips:Show(tagHint, { | ||
text = L.HelpTip_TagHintButton, | ||
dbKey = "tagHintButton_Builder", | ||
buttonStyle = HelpTip.ButtonStyle.None, | ||
alignment = HelpTip.Alignment.Center, | ||
targetPoint = HelpTip.Point.LeftEdgeCenter, | ||
}) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in regards to HelpTips, that it would be better to simply create dummy functions instead of adding all of these if statements across the codebase.
Would also make any future implementation easier.
|
||
if CUF.vars.isRetail then | ||
Builder.MenuOptions.ClassBarOptions = 22; | ||
Builder.MenuOptions.CastBarEmpower = 26; | ||
Builder.MenuOptions.ShieldBarOptions = 30; | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unnecessary to gate these behind flavor, since they'll only be used if the widget for them are enabled.
So better to avoid the added complexity, and having to deal with typing issues.
self:ShowBlizzardFramesPopup() | ||
CUF.HelpTips:Acknowledge(self.blizzardFramesButton, L.HelpTip_BlizzardFramesToggle) | ||
if CUF.vars.isRetail then | ||
CUF.HelpTips:Acknowledge(self.blizzardFramesButton, L.HelpTip_BlizzardFramesToggle) | ||
end | ||
end) | ||
self.blizzardFramesButton:SetPoint("TOPLEFT", self.useScalingCB, "BOTTOMLEFT", 0, -10) | ||
|
||
CUF.HelpTips:Show(self.blizzardFramesButton, { | ||
text = L.HelpTip_BlizzardFramesToggle, | ||
dbKey = "blizzardFramesToggle", | ||
buttonStyle = HelpTip.ButtonStyle.None, | ||
alignment = HelpTip.Alignment.Center, | ||
targetPoint = HelpTip.Point.TopEdgeCenter, | ||
}) | ||
if CUF.vars.isRetail then | ||
CUF.HelpTips:Show(self.blizzardFramesButton, { | ||
text = L.HelpTip_BlizzardFramesToggle, | ||
dbKey = "blizzardFramesToggle", | ||
buttonStyle = HelpTip.ButtonStyle.None, | ||
alignment = HelpTip.Alignment.Center, | ||
targetPoint = HelpTip.Point.TopEdgeCenter, | ||
}) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, remove guard clause.
castBar.channeling = event == "UNIT_SPELLCAST_CHANNEL_START" | ||
castBar.empowering = event == "UNIT_SPELLCAST_EMPOWER_START" | ||
|
||
if castBar.empowering then | ||
endTime = endTime + GetUnitEmpowerHoldAtMaxTime(unit) | ||
if CUF.vars.isRetail then | ||
castBar.empowering = event == "UNIT_SPELLCAST_EMPOWER_START" | ||
if castBar.empowering then | ||
endTime = endTime + GetUnitEmpowerHoldAtMaxTime(unit) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary guard clause since the event can never trigger in non mainline flavor.
|
||
if castBar.empowering then | ||
if CUF.vars.isRetail and castBar.empowering then | ||
castBar:AddStages(numStages) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, unnecessary guard clause.
if CUF.vars.isRetail then | ||
---@type ShieldBarWidgetTable | ||
Defaults.Widgets.shieldBar = { | ||
enabled = false, | ||
frameLevel = 9, | ||
point = "RIGHT", | ||
reverseFill = false, | ||
overShield = false, | ||
} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't Class bar and heal absorb also be gated here?
|
||
-- Focus was introduced with TBC | ||
if not CUF.vars.isVanilla then | ||
Defaults.Layouts.focus = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to use the const to make the typing happy, it's a bit dumb xd
Defaults.Layouts.focus = { | |
Defaults.Layouts[CUF.constants.UNIT.FOCUS] |
|
||
-- Focus was introduced with TBC | ||
if not CUF.vars.isVanilla then | ||
table.insert(const.BlizzardFrameTypes, CUF.constants.UNIT.FOCUS) | ||
end | ||
|
||
-- Boss frames were intoduced with Wrath | ||
if not CUF.vars.isVanilla and not CUF.vars.isBCC then | ||
table.insert(const.BlizzardFrameTypes, CUF.constants.UNIT.BOSS) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: inserting like this will mess up the order in which they are displayed.
Awesome feedback, thanks! |
I also think you should add |
Native support for Classic this time.
HelpTips and several widgets will not get loaded for Classic, via exclusion from it's .toc.
Unsupported frames (focus/boss) are excluded for Classic.
Exclusion of these features from the baseline const, defaults and builder tables & conditionally adding them in for the Retail version.
Some util functions are added in esp. regarding auras.
I spent quite some time researching how to retrieve the buff index needed for the aura tooltips in Classic, an on demand util function seemed reasonable, as the alternative requires constantly mapping the index on every buff change.
Following this approach now only available features will be visible in the addon menu.
Role icons are disabled for Classic for now, as their LibGroupInfo requirement from Cell is not loaded for Classic. This should be able to get reimplemented fairly easily.
Typings: definitely not my strongsuit. Had to change some enums to classes as they have keys included conditionally. At least that's what my LuaLS suggested, I hope thats the correct approach. These changes will definitely add some warnings.
Retail: every feature I took out for Classic worked for me in Retail. I don't think there should be any regression/breaking changes in this.
I think this approach is way healthier than my last one, I'm happy I redid this (and will keep working on it if it's not up to standard)!
TLDR/Commit Message: