Hopefully fix Vigor bar not showing up for some types of dragons

Specifically the Algarian Stormrider which has a different flavor of Vigor widget with customized colors. Apparently that's a whole different widget id. So now instead of checking for just the one vigor widget, we look up all widgets in the vigor set and use those to see if any vigor bar is showing.
This commit is contained in:
Parnic
2024-05-11 16:19:00 -05:00
parent 57ddf62f73
commit c425206748
3 changed files with 54 additions and 9 deletions

View File

@ -4,6 +4,7 @@ v1.14.41:
- Fix swapped DK runes in Cataclysm Classic - Fix swapped DK runes in Cataclysm Classic
- Possible fix for castbar flashing sometimes when set to "Never" - Possible fix for castbar flashing sometimes when set to "Never"
- Fix IceHUD Vigor bar not showing up for some types of dragons such as the Algarian Stormrider
v1.14.40: v1.14.40:

View File

@ -11,7 +11,9 @@ local DragonridingBuffs = {
} }
local vigorWidgetSetID = 283 local vigorWidgetSetID = 283
local vigorWidgetID = 4460 local vigorWidgetType = 24
local defaultVigorWidgetID = 4460
local vigorWidgetIDs = nil
local knowsAlternateMountEnum = Enum and Enum.PowerType and Enum.PowerType.AlternateMount local knowsAlternateMountEnum = Enum and Enum.PowerType and Enum.PowerType.AlternateMount
local unitPowerType = Enum and Enum.PowerType and Enum.PowerType.AlternateMount local unitPowerType = Enum and Enum.PowerType and Enum.PowerType.AlternateMount
unitPowerType = unitPowerType or ALTERNATE_POWER_INDEX unitPowerType = unitPowerType or ALTERNATE_POWER_INDEX
@ -51,12 +53,24 @@ function DragonridingVigor.prototype:EnteringWorld()
end end
function DragonridingVigor.prototype:CheckShouldShow(event, unit, info) function DragonridingVigor.prototype:CheckShouldShow(event, unit, info)
if unit ~= "player" then if not vigorWidgetIDs or #vigorWidgetIDs == 0 then
self:PopulateVigorWidgetIDs()
end
if unit ~= "player" or not vigorWidgetIDs then
return return
end end
local info = C_UIWidgetManager.GetFillUpFramesWidgetVisualizationInfo(vigorWidgetID) local shown = false
if not info or info.shownState == 0 then for i=1,#vigorWidgetIDs do
local info = C_UIWidgetManager.GetFillUpFramesWidgetVisualizationInfo(vigorWidgetIDs[i])
if info and info.shownState ~= 0 then
shown = true
break
end
end
if not shown then
self:Show(false) self:Show(false)
self.suppressHideBlizz = true self.suppressHideBlizz = true
if self.moduleSettings.hideBlizz then if self.moduleSettings.hideBlizz then
@ -85,14 +99,43 @@ function DragonridingVigor.prototype:UpdateRunePower(event, arg1, arg2)
DragonridingVigor.super.prototype.UpdateRunePower(self, event, arg1, arg2) DragonridingVigor.super.prototype.UpdateRunePower(self, event, arg1, arg2)
end end
function DragonridingVigor.prototype:PopulateVigorWidgetIDs()
local widgets = C_UIWidgetManager.GetAllWidgetsBySetID(vigorWidgetSetID)
if not widgets then
return
end
for i=1,#widgets do
if widgets[i].widgetType == vigorWidgetType then
if not vigorWidgetIDs then
vigorWidgetIDs = {}
end
table.insert(vigorWidgetIDs, widgets[i].widgetID)
end
end
end
function DragonridingVigor.prototype:UpdateVigorRecharge(event, widget) function DragonridingVigor.prototype:UpdateVigorRecharge(event, widget)
if not vigorWidgetIDs or #vigorWidgetIDs == 0 then
self:PopulateVigorWidgetIDs()
end
if not vigorWidgetIDs or #vigorWidgetIDs == 0 then
return
end
self.partialReady = nil self.partialReady = nil
self.partialReadyPercent = nil self.partialReadyPercent = nil
if event ~= "internal" and (not widget or widget.widgetSetID ~= vigorWidgetSetID) then if event ~= "internal" and (not widget or widget.widgetSetID ~= vigorWidgetSetID) then
return return
end end
local info = C_UIWidgetManager.GetFillUpFramesWidgetVisualizationInfo(vigorWidgetID) local widgetID = defaultVigorWidgetID
if widget then
widgetID = widget.widgetID
end
local info = C_UIWidgetManager.GetFillUpFramesWidgetVisualizationInfo(widgetID)
if not info then if not info then
return return
end end
@ -166,20 +209,20 @@ function DragonridingVigor.prototype:GetPartialRuneAtlas(rune)
end end
function DragonridingVigor.prototype:ShowBlizz() function DragonridingVigor.prototype:ShowBlizz()
local info = C_UIWidgetManager.GetFillUpFramesWidgetVisualizationInfo(vigorWidgetID) local info = C_UIWidgetManager.GetFillUpFramesWidgetVisualizationInfo(defaultVigorWidgetID)
if not info or info.shownState == 0 then if not info or info.shownState == 0 then
return return
end end
UIWidgetPowerBarContainerFrame.widgetFrames[vigorWidgetID]:Show() UIWidgetPowerBarContainerFrame.widgetFrames[defaultVigorWidgetID]:Show()
end end
function DragonridingVigor.prototype:HideBlizz() function DragonridingVigor.prototype:HideBlizz()
if not UIWidgetPowerBarContainerFrame.widgetFrames or not UIWidgetPowerBarContainerFrame.widgetFrames[vigorWidgetID] then if not UIWidgetPowerBarContainerFrame.widgetFrames or not UIWidgetPowerBarContainerFrame.widgetFrames[defaultVigorWidgetID] then
return return
end end
if not self.suppressHideBlizz then if not self.suppressHideBlizz then
UIWidgetPowerBarContainerFrame.widgetFrames[vigorWidgetID]:Hide() UIWidgetPowerBarContainerFrame.widgetFrames[defaultVigorWidgetID]:Hide()
end end
end end

View File

@ -4,6 +4,7 @@ v1.14.41:
- Fix swapped DK runes in Cataclysm Classic - Fix swapped DK runes in Cataclysm Classic
- Possible fix for castbar flashing sometimes when set to "Never" - Possible fix for castbar flashing sometimes when set to "Never"
- Fix IceHUD Vigor bar not showing up for some types of dragons such as the Algarian Stormrider
v1.14.40: v1.14.40: