Quantcast

update lib oUF and HealComm

rawoil [01-20-22 - 03:59]
update lib oUF and HealComm
Filename
oUF/elements/castbar.lua
oUF/elements/healthprediction.lua
oUF/elements/powerprediction.lua
oUF/elements/raidroleindicator.lua
oUF/init.lua
oUF/libs/LibHealComm-4.0/LibHealComm-4.0.lua
oUF/libs/LibHealComm-4.0/LibHealComm-4.0.xml
diff --git a/oUF/elements/castbar.lua b/oUF/elements/castbar.lua
index 3b3ee09..f43797f 100644
--- a/oUF/elements/castbar.lua
+++ b/oUF/elements/castbar.lua
@@ -110,11 +110,6 @@ local function CastStart(self, event, unit)
 		name, _, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo(unit)
 		event = 'UNIT_SPELLCAST_CHANNEL_START'
 	end
-
-	if not oUF.Retail then
-		spellID = notInterruptible
-		notInterruptible = nil
-	end

 	if(not name or (isTradeSkill and element.hideTradeSkills)) then
 		resetAttributes(element)
@@ -395,8 +390,8 @@ local function Enable(self, unit)
 		self:RegisterEvent('UNIT_SPELLCAST_CHANNEL_UPDATE', CastUpdate)
 		self:RegisterEvent('UNIT_SPELLCAST_FAILED', CastFail)
 		self:RegisterEvent('UNIT_SPELLCAST_INTERRUPTED', CastFail)
-
-		if oUF.Retail then
+
+		if oUF.isRetail then
 			self:RegisterEvent('UNIT_SPELLCAST_INTERRUPTIBLE', CastInterruptible)
 			self:RegisterEvent('UNIT_SPELLCAST_NOT_INTERRUPTIBLE', CastInterruptible)
 		end
@@ -448,8 +443,8 @@ local function Disable(self)
 		self:UnregisterEvent('UNIT_SPELLCAST_CHANNEL_STOP', CastStop)
 		self:UnregisterEvent('UNIT_SPELLCAST_FAILED', CastFail)
 		self:UnregisterEvent('UNIT_SPELLCAST_INTERRUPTED', CastFail)
-
-		if oUF.Retail then
+
+		if oUF.isRetail then
 			self:UnregisterEvent('UNIT_SPELLCAST_INTERRUPTIBLE', CastInterruptible)
 			self:UnregisterEvent('UNIT_SPELLCAST_NOT_INTERRUPTIBLE', CastInterruptible)
 		end
diff --git a/oUF/elements/healthprediction.lua b/oUF/elements/healthprediction.lua
index ce19261..56f7f08 100644
--- a/oUF/elements/healthprediction.lua
+++ b/oUF/elements/healthprediction.lua
@@ -83,9 +83,9 @@ local oUF = ns.oUF
 local myGUID = UnitGUID('player')
 local HealComm, ALL_PENDING_HEALS, ALL_OVERTIME_HEALS, HEAL_TICK_INTERVAL

-if oUF.BCC then
+if not oUF.isRetail then
 	HealComm = LibStub("LibHealComm-4.0")
-
+
 	ALL_PENDING_HEALS = bit.bor(HealComm.DIRECT_HEALS, HealComm.BOMB_HEALS)
 	ALL_OVERTIME_HEALS = bit.bor(HealComm.CHANNEL_HEALS, HealComm.HOT_HEALS)
 	HEAL_TICK_INTERVAL = 3
@@ -118,8 +118,8 @@ local function Update(self, event, unit)
 	local guid = UnitGUID(unit)
 	local currentTime = GetTime()
 	local isSmoothedEvent = event == "UNIT_MAXHEALTH" or event == "UNIT_HEALTH_FREQUENT" or event == "UNIT_HEALTH"
-	local myIncomingHeal = oUF.BCC and GetHealAmount(guid, currentTime, myGUID) or UnitGetIncomingHeals(unit, 'player') or 0
-	local allIncomingHeal = oUF.BCC and GetHealAmount(guid, currentTime, nil) or UnitGetIncomingHeals(unit) or 0
+	local myIncomingHeal = not oUF.isRetail and GetHealAmount(guid, currentTime, myGUID) or UnitGetIncomingHeals(unit, 'player') or 0
+	local allIncomingHeal = not oUF.isRetail and GetHealAmount(guid, currentTime, nil) or UnitGetIncomingHeals(unit) or 0
 	local absorb = oUF.Retail and UnitGetTotalAbsorbs(unit) or 0
 	local healAbsorb = oUF.Retail and UnitGetTotalHealAbsorbs(unit) or 0
 	local health, maxHealth = UnitHealth(unit), UnitHealthMax(unit)
@@ -261,15 +261,15 @@ local function Enable(self)
 	if(element) then
 		element.__owner = self
 		element.ForceUpdate = ForceUpdate
-
-		if oUF.Retail then
+
+		if oUF.isRetail then
 			self:RegisterEvent('UNIT_HEALTH', Path)
 			self:RegisterEvent('UNIT_HEAL_PREDICTION', Path)
 			self:RegisterEvent('UNIT_ABSORB_AMOUNT_CHANGED', Path)
 			self:RegisterEvent('UNIT_HEAL_ABSORB_AMOUNT_CHANGED', Path)
 		else
 			self:RegisterEvent('UNIT_HEALTH_FREQUENT', Path)
-
+
 			local function UpdateHeal(event, casterGUID, spellID, healType, _, ...)
 				Path(self, event, ...)
 			end
@@ -277,7 +277,7 @@ local function Enable(self)
 			local function UpdateModifier(event, guid)
 				Path(self, event, guid)
 			end
-
+
 			HealComm.RegisterCallback(self, "HealComm_HealStarted", UpdateHeal)
 			HealComm.RegisterCallback(self, "HealComm_HealUpdated", UpdateHeal)
 			HealComm.RegisterCallback(self, "HealComm_HealDelayed", UpdateHeal)
@@ -285,7 +285,7 @@ local function Enable(self)
 			HealComm.RegisterCallback(self, "HealComm_ModifierChanged", UpdateModifier)
 			HealComm.RegisterCallback(self, "HealComm_GUIDDisappeared", UpdateModifier)
 		end
-
+
 		self:RegisterEvent('UNIT_MAXHEALTH', Path)

 		if(not element.maxOverflow) then
@@ -297,7 +297,7 @@ local function Enable(self)
                 element.myBar.SetSmoothedValue = SmoothStatusBarMixin.SetSmoothedValue
                 element.myBar.SetMinMaxSmoothedValue = SmoothStatusBarMixin.SetMinMaxSmoothedValue
             end
-
+
 			if(element.myBar:IsObjectType('StatusBar') and not element.myBar:GetStatusBarTexture()) then
 				element.myBar:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]])
 			end
@@ -308,7 +308,7 @@ local function Enable(self)
                 element.otherBar.SetSmoothedValue = SmoothStatusBarMixin.SetSmoothedValue
                 element.otherBar.SetMinMaxSmoothedValue = SmoothStatusBarMixin.SetMinMaxSmoothedValue
             end
-
+
 			if(element.otherBar:IsObjectType('StatusBar') and not element.otherBar:GetStatusBarTexture()) then
 				element.otherBar:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]])
 			end
diff --git a/oUF/elements/powerprediction.lua b/oUF/elements/powerprediction.lua
index e643cc2..be28e42 100644
--- a/oUF/elements/powerprediction.lua
+++ b/oUF/elements/powerprediction.lua
@@ -68,14 +68,10 @@ local function Update(self, event, unit)
 	local mainPowerType = UnitPowerType(unit)
 	local hasAltManaBar = oUF.Retail and ALT_MANA_BAR_PAIR_DISPLAY_INFO[playerClass] and ALT_MANA_BAR_PAIR_DISPLAY_INFO[playerClass][mainPowerType]
 	local mainCost, altCost = 0, 0
-
-	if oUF.BCC then
-		spellID = notInterruptible
-	end

 	if(event == 'UNIT_SPELLCAST_START' and startTime ~= endTime) then
 		local costTable = GetSpellPowerCost(spellID)
-
+
 		-- hasRequiredAura is always false if there's only 1 subtable
 		local checkRequiredAura = #costTable > 1

diff --git a/oUF/elements/raidroleindicator.lua b/oUF/elements/raidroleindicator.lua
index 6bdb92c..d22915b 100644
--- a/oUF/elements/raidroleindicator.lua
+++ b/oUF/elements/raidroleindicator.lua
@@ -42,10 +42,7 @@ local function Update(self, event)
 	end

 	local role, isShown
-	--[[ classic disabled
 	if(UnitInRaid(unit) and not UnitHasVehicleUI(unit)) then
-	]]
-	if UnitInRaid(unit) then
 		if(GetPartyAssignment('MAINTANK', unit)) then
 			isShown = true
 			element:SetTexture(MAINTANK_ICON)
diff --git a/oUF/init.lua b/oUF/init.lua
index 46aef44..2e2672f 100644
--- a/oUF/init.lua
+++ b/oUF/init.lua
@@ -1,3 +1,8 @@
 local parent, ns = ...
 ns.oUF = {}
 ns.oUF.Private = {}
+
+ns.oUF.isRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
+ns.oUF.isClassic = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
+ns.oUF.isTBC = WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC
+ns.oUF.isWotLK = false
diff --git a/oUF/libs/LibHealComm-4.0/LibHealComm-4.0.lua b/oUF/libs/LibHealComm-4.0/LibHealComm-4.0.lua
index 933d809..21bf729 100644
--- a/oUF/libs/LibHealComm-4.0/LibHealComm-4.0.lua
+++ b/oUF/libs/LibHealComm-4.0/LibHealComm-4.0.lua
@@ -1,7 +1,7 @@
 if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then return end

 local major = "LibHealComm-4.0"
-local minor = 99
+local minor = 100
 assert(LibStub, format("%s requires LibStub.", major))

 local HealComm = LibStub:NewLibrary(major, minor)
@@ -723,35 +723,25 @@ end

 --[[
 	What the different callbacks do:
-
 	AuraHandler: Specific aura tracking needed for this class, who has Beacon up on them and such
-
 	ResetChargeData: Due to spell "queuing" you can't always rely on aura data for buffs that last one or two casts, for example Divine Favor (+100% crit, one spell)
 	if you cast Holy Light and queue Flash of Light the library would still see they have Divine Favor and give them crits on both spells. The reset means that the flag that indicates
 	they have the aura can be killed and if they interrupt the cast then it will call this and let you reset the flags.
-
 	What happens in terms of what the client thinks and what actually is, is something like this:
-
 	UNIT_SPELLCAST_START, Holy Light -> Divine Favor up
 	UNIT_SPELLCAST_SUCCEEDED, Holy Light -> Divine Favor up (But it was really used)
 	UNIT_SPELLCAST_START, Flash of Light -> Divine Favor up (It's not actually up but auras didn't update)
 	UNIT_AURA -> Divine Favor up (Split second where it still thinks it's up)
 	UNIT_AURA -> Divine Favor faded (Client catches up and realizes it's down)
-
 	CalculateHealing: Calculates the healing value, does all the formula calculations talent modifiers and such
-
 	CalculateHotHealing: Used specifically for calculating the heals of hots
-
 	GetHealTargets: Who the heal is going to hit, used for setting extra targets for Beacon of Light + Paladin heal or Prayer of Healing.
 	The returns should either be:
-
 	"compressedGUID1,compressedGUID2,compressedGUID3,compressedGUID4", healthAmount
 	Or if you need to set specific healing values for one GUID it should be
 	"compressedGUID1,healthAmount1,compressedGUID2,healAmount2,compressedGUID3,healAmount3", -1
-
 	The latter is for cases like Glyph of Healing Wave where you need a heal for 1,000 on A and a heal for 200 on the player for B without sending 2 events.
 	The -1 tells the library to look in the GUId list for the heal amounts
-
 	**NOTE** Any GUID returned from GetHealTargets must be compressed through a call to compressGUID[guid]
 ]]

@@ -1143,7 +1133,10 @@ if( playerClass == "PRIEST" ) then
 		hotData[Renew] = {coeff = 1, interval = 3, ticks = 5, levels = {8, 14, 20, 26, 32, 38, 44, 50, 56, 60, 65, 70}, averages = {
 			45, 100, 175, 245, 315, 400, 510, 650, 810, 970, 1010, 1110 }}
 		hotData[GreaterHealHot] = hotData[Renew]
-		hotData[Renewal] = {coeff = 0, interval = 3, ticks = 3, levels = {70}, averages = {150}}
+
+		if Renewal then
+			hotData[Renewal] = {coeff = 0, interval = 3, ticks = 3, levels = {70}, averages = {150}}
+		end

 		spellData[FlashHeal] = {coeff = 1.5 / 3.5, levels = {20, 26, 32, 38, 44, 50, 56, 61, 67}, averages = {
 			{avg(193, 237), avg(194, 239), avg(196, 241), avg(198, 243),  avg(200, 245), avg(202, 247)},
@@ -2862,4 +2855,4 @@ if( not IsLoggedIn() ) then
 	HealComm.eventFrame:RegisterEvent("PLAYER_LOGIN")
 else
 	HealComm:PLAYER_LOGIN()
-end
+end
\ No newline at end of file
diff --git a/oUF/libs/LibHealComm-4.0/LibHealComm-4.0.xml b/oUF/libs/LibHealComm-4.0/LibHealComm-4.0.xml
index 6342b2d..730fcb3 100644
--- a/oUF/libs/LibHealComm-4.0/LibHealComm-4.0.xml
+++ b/oUF/libs/LibHealComm-4.0/LibHealComm-4.0.xml
@@ -2,4 +2,4 @@
 ..\FrameXML\UI.xsd">
 	<Script file="ChatThrottleLib.lua"/>
 	<Script file="LibHealComm-4.0.lua"/>
-</Ui>
+</Ui>
\ No newline at end of file