You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, when "show in combat" is chosen, show the player frame when casting as well so you can see your cast bar when interacting with objects or mounting. I added this code to have the player frame only show when in combat and casting. it also stays visible after combat until the health bar is full:
function VikingUnitFrames:UpdateUnitFrame(tFrame, unit)
tFrame.wndUnitFrame:Show(unit ~= nil)
if unit ~= nil then
self:SetUnit(tFrame, unit)
self:SetUnitName(tFrame, unit:GetName())
self:SetClass(tFrame)
end
local unitPlayer = GameLib.GetPlayerUnit()
local nCasting = unitPlayer:ShouldShowCastBar()
local bInCombat = unitPlayer:IsInCombat()
if unitPlayer == nil then
return
end
if unitPlayer:GetMaxHealth() == unitPlayer:GetHealth() and not bInCombat and not nCasting then
self.tPlayerFrame.wndUnitFrame:Show(false)
else
self.tPlayerFrame.wndUnitFrame:Show(true)
end
end
The text was updated successfully, but these errors were encountered:
I can't get it hooked into the default interface settings for visibility or the Viking settings. I have only figured out how to have it set to show in combat, during casting and when the health isn't full. So, it's not really ready for a pull until someone can figure out how to get the hook working.
Also, when "show in combat" is chosen, show the player frame when casting as well so you can see your cast bar when interacting with objects or mounting. I added this code to have the player frame only show when in combat and casting. it also stays visible after combat until the health bar is full:
function VikingUnitFrames:UpdateUnitFrame(tFrame, unit)
tFrame.wndUnitFrame:Show(unit ~= nil)
if unit ~= nil then
self:SetUnit(tFrame, unit)
self:SetUnitName(tFrame, unit:GetName())
self:SetClass(tFrame)
end
local unitPlayer = GameLib.GetPlayerUnit()
local nCasting = unitPlayer:ShouldShowCastBar()
local bInCombat = unitPlayer:IsInCombat()
if unitPlayer == nil then
return
end
if unitPlayer:GetMaxHealth() == unitPlayer:GetHealth() and not bInCombat and not nCasting then
self.tPlayerFrame.wndUnitFrame:Show(false)
else
self.tPlayerFrame.wndUnitFrame:Show(true)
end
end
The text was updated successfully, but these errors were encountered: