Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit Frame - hook into interface options for visibility #27

Open
sevelev opened this issue Oct 16, 2015 · 3 comments
Open

Unit Frame - hook into interface options for visibility #27

sevelev opened this issue Oct 16, 2015 · 3 comments

Comments

@sevelev
Copy link

sevelev commented Oct 16, 2015

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

@mkaito
Copy link
Contributor

mkaito commented Oct 17, 2015

I have yet to look at the settings pane. It's kind of scary 😛

If you could put that in a pull request we can look at getting it in.

@sevelev
Copy link
Author

sevelev commented Oct 17, 2015

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.

@mkaito
Copy link
Contributor

mkaito commented Oct 17, 2015

I will see if I can figure out how Settings and Library work, to give you a config option to hook into.

@mkaito mkaito self-assigned this Oct 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants