Open sevelev opened 9 years ago
I have yet to look at the settings pane. It's kind of scary :stuck_out_tongue:
If you could put that in a pull request we can look at getting it in.
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.
I will see if I can figure out how Settings and Library work, to give you a config option to hook into.
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