Skip to content

Commit

Permalink
Classic: Enable PhaseFader, fix PhaseIcon tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
nebularg committed May 3, 2024
1 parent e4e846c commit de1fa1f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ ignore = {
"43.", -- Shadowing an upvalue, an upvalue argument, an upvalue loop variable.
"542", -- An empty if branch
}
files["Modules/PhaseIcon/*"].globals = {
"UnitInPhase",
files["Modules/Phase**"].globals = {
"UnitInPhase", -- classic compat
}
files["Modules/Runes_Classic/*"].globals = {
"GetRuneType",
"GetRuneType", -- classic compat
}
globals = {
-- Third-party
Expand Down
8 changes: 7 additions & 1 deletion Modules/PhaseFader/PhaseFader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
local PitBull4 = _G.PitBull4
local L = PitBull4.L

local wow_cata = PitBull4.wow_cata

local PitBull4_PhaseFader = PitBull4:NewModule("PhaseFader")

PitBull4_PhaseFader:SetModuleType("fader")
Expand All @@ -27,7 +29,11 @@ function PitBull4_PhaseFader:GetOpacity(frame)
return nil
end

if not UnitPhaseReason(unit) then
if wow_cata then
if UnitInPhase(unit) then
return nil
end
elseif not UnitPhaseReason(unit) then
return nil
end

Expand Down
9 changes: 6 additions & 3 deletions Modules/PhaseIcon/PhaseIcon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ function PitBull4_PhaseIcon:GetEnableMouse(frame)
end

function PitBull4_PhaseIcon:OnEnter()
local unit = self:GetParent().unit
local phaseReason = UnitPhaseReason(unit)
local tooltip = PartyUtil.GetPhasedReasonString(phaseReason, unit) or _G.PARTY_PHASED_MESSAGE
local tooltip = _G.PARTY_PHASED_MESSAGE
if not wow_cata then
local unit = self:GetParent().unit
local phaseReason = UnitPhaseReason(unit)
local tooltip = PartyUtil.GetPhasedReasonString(phaseReason, unit) or _G.PARTY_PHASED_MESSAGE
end
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
GameTooltip:SetText(tooltip, nil, nil, nil, nil, true)
GameTooltip:Show()
Expand Down
2 changes: 1 addition & 1 deletion modules_Cata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<Include file="Modules\HostilityFader\load.xml"/>
<Include file="Modules\LeaderIcon\load.xml"/>
<Include file="Modules\LuaTexts\load.xml"/>
<!-- <Include file="Modules\PhaseFader\load.xml"/> -->
<Include file="Modules\PhaseFader\load.xml"/>
<Include file="Modules\PhaseIcon\load.xml"/>
<Include file="Modules\Portrait\load.xml"/>
<Include file="Modules\PowerBar\load.xml"/>
Expand Down

0 comments on commit de1fa1f

Please sign in to comment.