tukui-org / ElvUI

User Interface replacement AddOn for World of Warcraft.
https://tukui.org
Other
456 stars 152 forks source link

[Feature Request] Display mana bars for healers only on the raid frames #923

Closed WRMSRwasTaken closed 1 year ago

WRMSRwasTaken commented 1 year ago

Is your feature request related to a problem? Please describe. I'd like to see only the power / mana bars for healers / co-healers on the raid frames. There's https://github.com/tukui-org/ElvUI/issues/835, but this is only for text tags, it seems that there's not an option for the bar itself.

Describe the solution you'd like An option for the power bars to display them only for players with the healer role.

Describe alternatives you've considered There seems to be a WeakAura which accomplishes this, but it seems to be buggy and unreliable.

1Botanica1 commented 1 year ago

Duplicate of #835 That does mention a tag - but it is for showing healer mana bar only.

Dahgoth commented 1 year ago

Would like to have it as well since default Blizzard frames has it for some time now image

Azilroka commented 1 year ago

It does have that option.. It also doesn't have a ton of configuration options which will space out if its selected.. So lets say you have the information panel on.. you would have to check to see if they are a healer and display the power then if they aren't you would have to adjust the offsets of the information panel or any other custom texts that is assigned to the frame and adjust every single thing just to support show healer mana only..

Default UnitFrames will not have this issue so it is a simple implementation.

Dahgoth commented 1 year ago

What about to limit this option to show only w/o info panel or just in case with separated mana bars so you don't need to adjuct anything? I mean it's better to have a limited option rather than not have it at all

WRMSRwasTaken commented 11 months ago

For those interested, I was able to make it work, even as an external ElvUI plugin:

Hook the Update_PartyFrames and / or Update_RaidFrames functions from UF and then just call

frame.USE_POWERBAR = true
frame.POWERBAR_HEIGHT = db.power.height
frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)

UF:Configure_HealthBar(frame)
UF:Configure_Power(frame)

frame:UpdateAllElements('ElvUI_UpdateAllElements')

... after your own logic to decide whether to display mana bars or not, for me this would be

local role = UnitGroupRolesAssigned(frame.unit)
if (role ~= 'HEALER') then return end

Seems to work so far for me in test mode and in real groups, even datatexts and icon anchors are getting updated accordingly: grafik

Enabled info panel also has no issues with this as the overall frame heights stay the same.

I am actually thinking about releasing this as a standalone plugin or to make a pull request to Elvui core or Shadow & Light.

Repooc commented 11 months ago

If this works well, i can add this to Shadow & Light if you want. I can make it its own plugin and keep it updated if/when api changes happen as well. Just let me know what you would like me to do as I am sure others will like this option. May just limit this on party/raid frames though to make it easier lol.

WRMSRwasTaken commented 11 months ago

Yeah it works only somewhat for now, found out if people respec or join/leave the group / raid, the information does not get updated. Seems like I need to listen for PLAYER_ROLES_ASSIGNED and GROUP_ROSTER_UPDATE and I have to iterate over every person / frame in the raid to update it (or not, depending on the event payload)... hooking Construct_RaidFrames, Construct_PartyFrames, Update_PartyFrames and Update_RaidFrames as Post-Hook via AceHook-3.0 seems to work for the initial group join, everything is correct there till the above happens.

As the reset comes closer I am not expecting it to work in the next days / weeks or so... but Ima keep you updated here or on Discord if you'd wish. Would be definitely interesting to see this feature in S&L, but also I don't want to rush it and upset people if this turns out to be buggy...

Repooc commented 11 months ago

I may just whip up a small addon for just this and try to test this week during raid myself.

WRMSRwasTaken commented 10 months ago

I've uploaded my stuff here in case this might be interesting: https://github.com/WRMSRwasTaken/ElvUI_HealerMana

Repooc commented 10 months ago

I've uploaded my stuff here in case this might be interesting: https://github.com/WRMSRwasTaken/ElvUI_HealerMana

I did an alpha version, you can check out the repo at https://github.com/Repooc/ElvUI_HealerOnlyPower

WRMSRwasTaken commented 10 months ago

Sweet. Will test!