9.0 compatibility updates - initial attempt

This commit is contained in:
Parnic
2020-10-13 08:46:41 -05:00
parent 53bf76c58a
commit a18144aec0
16 changed files with 39 additions and 27 deletions

View File

@ -1040,7 +1040,7 @@ end
-- Creates the actual bar
function IceBarElement.prototype:CreateBar()
self.barFrame = self:BarFactory(self.barFrame, "LOW", "ARTWORK")
self.barFrame = self:BarFactory(self.barFrame, "LOW", "ARTWORK", "Bar")
self:SetBarCoord(self.barFrame)
self.barFrame.bar:SetBlendMode(self.settings.barBlendMode)
@ -1050,9 +1050,9 @@ end
-- Returns a barFrame & barFrame.bar
-- Rokiyo: Currently keeping old behaviour of running through bar creation on every Redraw, but I'm not convinced we need to.
function IceBarElement.prototype:BarFactory(barFrame, frameStrata, textureLayer)
function IceBarElement.prototype:BarFactory(barFrame, frameStrata, textureLayer, nameSuffix)
if not (barFrame) then
barFrame = CreateFrame("Frame", nil, self.frame)
barFrame = CreateFrame("Frame", "IceHUD_"..self.elementName.."_"..(nameSuffix or "Bar"), self.frame)
end
barFrame:SetFrameStrata(frameStrata and frameStrata or "LOW")
@ -1584,7 +1584,7 @@ function IceBarElement.prototype:CreateMarker(idx)
self.Markers[idx] = nil
end
self.Markers[idx] = self:BarFactory(self.Markers[idx], "MEDIUM", "OVERLAY")
self.Markers[idx] = self:BarFactory(self.Markers[idx], "MEDIUM", "OVERLAY", "Marker"..idx)
local color = self.moduleSettings.markers[idx].color
self.Markers[idx].bar:SetVertexColor(color.r, color.g, color.b, self.alpha)

View File

@ -69,7 +69,7 @@ function IceElement.prototype:Create(parent)
self.parent = parent
if not self.masterFrame then
self.masterFrame = CreateFrame("Frame", nil, self.parent)
self.masterFrame = CreateFrame("Frame", "IceHUD_Element_"..self.elementName, self.parent)
self.masterFrame:SetFrameStrata("MEDIUM")
end
self:CreateFrame()

View File

@ -259,6 +259,10 @@ function IceHUD:NotifyOptionsChange()
end
function IceHUD:OnEnable(isFirst)
-- if isFirst then
self:SetDebugging(self.IceCore:GetDebug())
self.debugFrame = ChatFrame1
-- end
self:Debug("IceHUD:OnEnable()")
if self.db.profile.enable then
@ -274,11 +278,6 @@ function IceHUD:OnEnable(isFirst)
--@debug@
IceHUD_Options:OnLoad()
--@end-debug@
-- if isFirst then
self:SetDebugging(self.IceCore:GetDebug())
self.debugFrame = ChatFrame1
-- end
end
-- add settings changes/updates here so that existing users don't lose their settings
@ -367,7 +366,11 @@ function IceHUD:Debug(...)
for n=1,select('#', ...) do
msg = msg .. tostring(select(n, ...)) .. " "
end
self.debugFrame:AddMessage(msg)
if self.debugFrame then
self.debugFrame:AddMessage(msg)
else
print(msg)
end
end
end

View File

@ -1,4 +1,4 @@
## Interface: 80300
## Interface: 90001
## Author: Parnic, originally created by Iceroth
## Name: IceHUD
## Title: IceHUD |cff7fff7f-Ace3-|r
@ -9,7 +9,7 @@
## X-Category: HUDs
## X-Website: https://www.wowace.com/projects/ice-hud
## X-WoWI-ID: 8149
## X-Compatible-With: 11302
## X-Compatible-With: 11305
#@no-lib-strip@
# Libraries

View File

@ -1,4 +1,4 @@
## Interface: 80300
## Interface: 90001
## Title: IceHUD |cff7fff7f-Options-|r
## Author: Parnic
## Version: @project-version@

View File

@ -171,7 +171,7 @@ end
-- Creates the low amount warning frame
function IceUnitBar.prototype:CreateFlashFrame()
if not (self.flashFrame) then
self.flashFrame = CreateFrame("Frame", nil, self.frame)
self.flashFrame = CreateFrame("Frame", "IceHUD_"..self.elementName.."_Flash", self.frame)
end
self.flashFrame:SetFrameStrata("BACKGROUND")

View File

@ -1,3 +1,8 @@
v1.13.0:
- Made compatible with 9.0
- Improved frame naming/debuggability
- Updated TOC for 9.0
v1.12.15:
- (Classic) Fixed reported issue with the Threat bar throwing errors sometimes.

View File

@ -398,7 +398,7 @@ end
function CastBar.prototype:CreateLagBar()
if self.lagBar == nil then
self.lagBar = self:BarFactory(self.lagBar, "LOW", "OVERLAY")
self.lagBar = self:BarFactory(self.lagBar, "LOW", "OVERLAY", "Lag")
end
local r, g, b = self:GetColor("CastLag")

View File

@ -107,7 +107,7 @@ function EclipseBar.prototype:CreateFrame()
end
function EclipseBar.prototype:CreateSolarBar()
self.solarBar = self:BarFactory(self.solarBar,"BACKGROUND", "ARTWORK")
self.solarBar = self:BarFactory(self.solarBar,"BACKGROUND", "ARTWORK", "Solar")
self:SetBarCoord(self.solarBar, 0.5, true)
self.solarBar.bar:SetVertexColor(self:GetColor("EclipseSolar", 1))

View File

@ -255,7 +255,7 @@ function GlobalCoolDown.prototype:CreateFrame()
end
function GlobalCoolDown.prototype:CreateLagBar()
self.lagBar = self:BarFactory(self.lagBar, "LOW", "OVERLAY")
self.lagBar = self:BarFactory(self.lagBar, "LOW", "OVERLAY", "Lag")
local r, g, b = self:GetColor("CastLag")
if (self.settings.backgroundToggle) then

View File

@ -49,7 +49,9 @@ function PetHealth.prototype:Enable(core)
self:RegisterEvent("UNIT_PET", "CheckPet");
self:RegisterEvent("UNIT_HEALTH", "UpdateEvent")
self:RegisterEvent("UNIT_HEALTH_FREQUENT", "UpdateEvent")
if IceHUD.WowVer < 90000 then
self:RegisterEvent("UNIT_HEALTH_FREQUENT", "UpdateEvent")
end
self:RegisterEvent("UNIT_MAXHEALTH", "UpdateEvent")
if UnitHasVehicleUI then

View File

@ -68,7 +68,9 @@ function PlayerHealth.prototype:Enable(core)
PlayerHealth.super.prototype.Enable(self, core)
self:RegisterEvent("UNIT_HEALTH", "UpdateEvent")
self:RegisterEvent("UNIT_HEALTH_FREQUENT", "UpdateEvent")
if IceHUD.WowVer < 90000 then
self:RegisterEvent("UNIT_HEALTH_FREQUENT", "UpdateEvent")
end
self:RegisterEvent("UNIT_MAXHEALTH", "UpdateEvent")
self:RegisterEvent("PLAYER_ENTERING_WORLD", "EnteringWorld")
@ -934,7 +936,7 @@ function PlayerHealth.prototype:CreateBackground(redraw)
end
function PlayerHealth.prototype:CreateHealBar()
self.healFrame = self:BarFactory(self.healFrame, "LOW","BACKGROUND")
self.healFrame = self:BarFactory(self.healFrame, "LOW","BACKGROUND", "Heal")
self.healFrame.bar:SetVertexColor(self:GetColor("PlayerHealthHealAmount", self.alpha * self.moduleSettings.healAlpha))
@ -946,7 +948,7 @@ function PlayerHealth.prototype:CreateHealBar()
end
function PlayerHealth.prototype:CreateAbsorbBar()
self.absorbFrame = self:BarFactory(self.absorbFrame, "LOW","BACKGROUND")
self.absorbFrame = self:BarFactory(self.absorbFrame, "LOW","BACKGROUND", "Absorb")
self.absorbFrame.bar:SetVertexColor(self:GetColor("PlayerHealthAbsorbAmount", self.alpha * self.moduleSettings.absorbAlpha))

View File

@ -186,7 +186,7 @@ function RollTheBones.prototype:CreateFrame()
end
function RollTheBones.prototype:CreateDurationBar()
self.durationFrame = self:BarFactory(self.durationFrame, "BACKGROUND","ARTWORK")
self.durationFrame = self:BarFactory(self.durationFrame, "BACKGROUND","ARTWORK", "Duration")
-- Rokiyo: Do we need to call this here?
self.CurrScale = 0

View File

@ -182,7 +182,7 @@ function SliceAndDice.prototype:CreateFrame()
end
function SliceAndDice.prototype:CreateDurationBar()
self.durationFrame = self:BarFactory(self.durationFrame, "BACKGROUND","ARTWORK")
self.durationFrame = self:BarFactory(self.durationFrame, "BACKGROUND","ARTWORK", "Duration")
-- Rokiyo: Do we need to call this here?
self.CurrScale = 0

View File

@ -137,7 +137,7 @@ function StaggerBar.prototype:CreateFrame()
end
function StaggerBar.prototype:CreateTimerBar()
self.timerFrame = self:BarFactory(self.timerFrame, "MEDIUM","ARTWORK")
self.timerFrame = self:BarFactory(self.timerFrame, "MEDIUM","ARTWORK", "Timer")
self.CurrScale = 0

View File

@ -231,7 +231,7 @@ end
-- create the aggro range indicator bar
function IceThreat.prototype:CreateAggroBar()
self.aggroBar = self:BarFactory(self.aggroBar, "BACKGROUND","ARTWORK")
self.aggroBar = self:BarFactory(self.aggroBar, "BACKGROUND","ARTWORK", "Aggro")
local r, g, b = self:GetColor("ThreatPullAggro")
if (self.settings.backgroundToggle) then
@ -243,7 +243,7 @@ function IceThreat.prototype:CreateAggroBar()
end
function IceThreat.prototype:CreateSecondThreatBar()
self.secondThreatBar = self:BarFactory(self.secondThreatBar, "MEDIUM", "OVERLAY")
self.secondThreatBar = self:BarFactory(self.secondThreatBar, "MEDIUM", "OVERLAY", "SecondThreat")
self.secondThreatBar.bar:SetVertexColor(self:GetColor("ThreatSecondPlace", self.alpha * self.moduleSettings.secondPlaceThreatAlpha))