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

Suggest highlight ability only when buff/debuff aura reaches a certain threshold point #269

Closed
mspykerez opened this issue Feb 15, 2018 · 24 comments

Comments

@mspykerez
Copy link

I play a rogue and I found this addon amazing! There is one thing thou that I do not know how to do and I wish it was possible. I know the addon has a default 'Suggest when your combo points reaches its maximum' for some abilities which work great on some like eviscerate but on others not so much like when you have a almost full duration slice and dice buff to go and the addon is suggesting to use it. So what I really wanted is some kind of slider or something to trigger suggestions only when the buff/debuff aura reaches a certain threshold point. It could work in conjunction with the combo points or not like for example when X aura reaches X seconds left AND your combos is at maximum immediately suggest highlight the ability OR simple when X aura reaches X seconds left immediately suggest highlight the ability regardless of the amount of combo points you have.

Can you please add this feature or tell me how to do it?
Kind regards!

@Rainrider
Copy link
Member

This is doable with custom rules only, meaning you have to code the rule yourself. Please consult the documentation on how to do this. If you need a specific example, feel free to re-open this issue.

@mspykerez
Copy link
Author

I really appreciate if you give me an example for a buff like slice and dice and debuff like rupture that I can use to edit and add whatever spell I like. I wish that the threshold point be around 4s left.

Thank you!

@Rainrider
Copy link
Member

I was thinking about something like that for Slice and Dice.

return Configure {
    "SliceAndDiceExp",
    "Show to good border when Slice and Dice is about to expire",
    5171, -- Slice and Dice
    "player",
    "UNIT_AURA",
    function(_, model)
        local found, _, expiration = GetPlayerBuff("player", 5171)
        if found and ((expiration - GetTime()) <= 4) then
            model.highlight = "good"
        end
    end,
}

However this is not reliable. Sorry for misleading you with my previous answer, I'll look into it.

@Rainrider Rainrider reopened this Feb 17, 2018
@Rainrider
Copy link
Member

Could you please test the version attached below.
AdiButtonAuras.zip
It only supports the border highlight (no hint, no flash for now). The threshold is configurable per spell and is between 0 (disabled) and 10 seconds.

I will probably not have the time to include the other two types of highlight until next weekend. I'm also unsure if this is not better done as an extension to the "Show missing" option, what do you think about it?

@mspykerez
Copy link
Author

It is only working with the border highlight indeed which gave me the idea if possible to have 2 different highlights for the same ability, lets have the border highlight always on but do a flash highlight when it reaches a certain threshold!
I also notice that the highlight is occurring a second to late from the selected value else all seems to be working nicely.

btw have you taken a look at my reply to the other issue #268 that you closed ?

@Rainrider
Copy link
Member

It is only working with the border highlight indeed which gave me the idea if possible to have 2 different highlights for the same ability, lets have the border highlight always on but do a flash highlight when it reaches a certain threshold!

This is why I think that it may make more sense to bind it to the "Show missing" option. However I think that using two different highlights (one for duration and one for missing) creates visual clutter, so I would ideally keep them mutually exclusive, i.e. show the missing highlight this many seconds before the aura expires.

I also notice that the highlight is occurring a second to late from the selected value else all seems to be working nicely.

Adjust the Maximum duration for the "2.7" format setting to your Show highlight threshold value and watch again. It is "below" and not "below or at" the threshold. Maybe I should change the wording in the tooltip.

As for the countdown text, I will reply in the other issue.

@mspykerez
Copy link
Author

Hows the coding going? I was thinking if the threshold could be set as a percentage of the total duration of the ability used, this is for us benefit of the 'pandemic' mechanic which is capped at 30% of the duration, off course that different number of combo points would have different durations so I do not know if this is possible or ...?
https://www.mmo-champion.com/threads/2145373-What-is-Pandemic

@Rainrider
Copy link
Member

Sadly I didn't find time for it this weekend, sorry for that. It may be like that next weekend too, depending on the progress I make with a project I have to deliver next week.

As for the pandemic mechanic, I don't think it is doable without keeping a list of auras max durations. I think something like 'hint 3 secs before it expires' is good enough though.

@mspykerez
Copy link
Author

Maybe allow us to manually enter the max duration so it can auto-calculate 30% of it's running time then? I dunno but there are other addons that support the pandemic mechanic like SPTimers, if they keep a list of the max timers or not that's the question, only a handful of abilities would benefit from it thou.

@Rainrider
Copy link
Member

Could you test https://github.com/AdiAddons/AdiButtonAuras/tree/earlier-missing and tell me what you think? Click on "Clone or download" -> "Download ZIP", rename the folder in the zip file so that it only contains "AdiButtonAuras" and copy it into your Interface\AddOns folder as an ordinary addon.

You can pick the value below which it will display the selected missing highlight method (the range is from 0 to 10). The hint/flash method is complementary to the normal highlight. This is unchanged from the way it is now but means both hint/flash and normal highlight could be visible at the same time. IIRC Adirelle left this possibility on purpose, so I'm unlikely to change this behavior.

@mspykerez
Copy link
Author

At first I did a clean install with the steps you provided but the addon was not configurable in-game even thou I let the configurable folder in the addons folder, then I copy pasted the release version into the addons folder and replaced it with the new one provided and this made it to work again in-game!

Moving on...
With the 'show border' the missing highlight method seems to function well but when we have rules like to show the border when the buff/debuff is found on the target it makes it so the rule does not work as intended (doesn't show any border when the buff/debuff is found on the target) because they have the same highlight option selected and the missing threshold seems to have display priority over the rules, that's why I suggested making a option to select 2 different highlights, one for the missing highlight threshold and one for the rules (for the missing highlight threshold this is already selectable, for the rules not so much, but I guess one can simple select a missing threshold method different from the already present rules method).

Now for when selecting 'flash' and 'hint' as highlights they do not work as intended as in upon reaching the selected missing threshold they show up but when refreshed before reaching 0 it makes it so the 'flash' or 'hint' will always be visible even when the aura is above the selected missing threshold.
Also I noticed that when we select 'Hint' as highlight, when it reaches 0 the 'Flash' highlight is shown instead.

One other thing is that the addon keeps on highlighting the abilities with a missing threshold value set when out of combat, I can only wish there was an option to disable this behavior when out of combat.

Other quality of life changes that I wish were implemented:

  • Increase the missing threshold highlight value above 10s for 15s or so since there are abilities like slice and dice that have a pandemic value above 10s and would be great if the addon could handle it appropriately;
  • Make it so the missing threshold would always be AT the value and not bellow the value for simplicity purposes;
  • As said before it would be great if the missing threshold timer would be set as a % of the total value in addition to the time number option because this will mainly be used for the pandemic mechanic which is always at 30% of the total value. I do not know the best way to implement this besides allowing us to manually input the max timer or have a pre-defined list of spell timers, but I know that other different addons like famous Raven support to enter highlights upon reaching a certain % threshold of a cooldown.

@Rainrider
Copy link
Member

Rainrider commented Mar 8, 2018

Again, missing hint/flash is complementary to the the normal border highlight. If you choose border as a missing highlight method, it is ofc exclusive. This is how it is on the live version now and I'm reluctant to change this. The only thing that (should have) changed is that the missing highlight could be displayed before the aura is missing and you have a per spell option to set up this behavior.

You can hide flashes when out of combat, it is a global option.

Not hiding the missing highlight, if the duration goes up, is a bug, I'll fix this. Be it your way with the 15 sec range for the option. I do not understand why you need a 15 sec long reminder to reapply a buff but I'll change that too.

@Rainrider
Copy link
Member

I pushed the changes to the earlier-missing branch, feel free to test as you did before.

The delay for showing the missing highlight was between 0.001 and 0.009 seconds in my tests. There is also a cost for calling the functions that actually show the missing highlight on top of that.

I myself see a 15 sec long reminder to reapply a (de)buff as totally useless and thus find an option that calculates the missing threshold as a percentage of the max duration not appropriate as it will enforce the timer on me. You can however calculate the value yourself and set the value accordingly (within the limit of 15 sec). Apart from that, the max aura duration is unknown to ABA, so the user will have to input it. This is basically the same as to enter the 0.3 * max duration as the missing threshold for the given spell. Keeping a list of aura durations is also unfeasible in my opinion.

@mspykerez
Copy link
Author

mspykerez commented Mar 10, 2018

What I notice:

  • 'No flash out of combat' global option doesn't work with borders as the threshold highlight to use.
  • When on the 'No selection' menu of spells we still can move the threshold which gives an error, I assume this should be greyed out like the other options or make it to work as a global option for all abilities?
  • When we select 'Hint' as highlight, when it reaches 0 the 'Flash' highlight is shown instead.
  • When we use an ability which the threshold is set higher then the duration of the ability itself the highlight doesn't show. However if we are refreshing the ability which already has an highlight on it it will show even thou the threshold is higher than the ability itself. (this happens when using abilities with low combo points)
  • When border method is selected for the missing threshold highlight it is randomly disappearing.
  • Refreshing an ability before it reaches the threshold highlight causes the next highlight to appear late or not appear at all until it reaches 0.

Suggestion:

  • Make an option to change the color of the border for when it reaches the threshold highlight so it will not be the same as the good or bad border colors therefore no need to be mutually exclusive. And if possible make also an option to change the color of the 'flash' highlight.

@Rainrider
Copy link
Member

'No flash out of combat' global option doesn't work with borders as the threshold highlight to use.

Working as intended. That's why it says flash. Normal borders are meant as a non-obtrusive reminder and combined with the missing option are well suited for stuff you generally want to apply before you start combat. Hints are disabled out of combat per default.

When on the 'No selection' menu of spells we still can move the threshold which gives an error, I assume this should be greyed out like the other options or make it to work as a global option for all abilities?

Fixed

When we select 'Hint' as highlight, when it reaches 0 the 'Flash' highlight is shown instead.

Cannot reproduce. Do you have custom rules for the spell you tested this with? Could it be that the built-in (stock) flash popped up?

When we use an ability which the threshold is set higher then the duration of the ability itself the highlight doesn't show. However if we are refreshing the ability which already has an highlight on it it will show even thou the threshold is higher than the ability itself. (this happens when using abilities with low combo points)

Fixed

When border method is selected for the missing threshold highlight it is randomly disappearing.

Cannot reproduce with the applied fixes. Please test again and provide exact steps on how to reproduce it if it happens again.

Refreshing an ability before it reaches the threshold highlight causes the next highlight to appear late or not appear at all until it reaches 0.

Fixed.

Make an option to change the color of the border for when it reaches the threshold highlight so it will not be the same as the good or bad border colors therefore no need to be mutually exclusive. And if possible make also an option to change the color of the 'flash' highlight.

Not possible/feasible. All types of highlights are applied to all buttons and so are their colors. I could introduce a third type of border beside the good and the bad ones, but this would be the last item on my current todo list for ABA.

@mspykerez
Copy link
Author

My recent tests:

  • When border method is selected for the missing threshold highlight and randomly disappearing appears to be fixed.

  • The 'Hint' as highlight when it reaches 0 the 'Flash' highlight is shown instead issue also happens when you hit the target with a debuff and de-select it afterwards or change to a target which have no debuff active (example of an ability that has this issue is Ghostly Strike). It will also happen when you disable any of the default rules which will lead me to the next issue below.

  • When you untick the default show 'good' or 'bad' border rules it will always show the selected missing highlight threshold method of your chosen at all times bellow or above the selected threshold and you are also unable to see any countdown timer of said abilities. Note that with this when the border method is selected the debuffs that should show a bad border color are always showing a good border color.

What could still be done:

  • A third type of border for the missing highlight threshold sounds like a good idea indeed.

  • The 'Flash' option is good to react on the moment but a bit intrusive for the missing threshold highlight when it reaches 0, therefore I wish it could only show 'Flash' when the buff/debuff is active, meaning if the buff/debuff reaches 0 it will not show the 'flash' anymore instead it could show a less intrusive good/bar border. So an option to 'always show good/bad border when it reaches 0' should be fine.

@Rainrider
Copy link
Member

Showing/hiding the missing highlight when changing targets should be fixed now. I'm still not able to reproduce the case where a flash shows instead of a hint. Could it be that you set "Spell hints" to "Flashing border"? If not, then please share the spell you are using and the exact configuration you have for it.

When you untick the default show 'good' or 'bad' border rules it will always show the selected missing highlight threshold method of your chosen at all times bellow or above the selected threshold and you are also unable to see any countdown timer of said abilities. Note that with this when the border method is selected the debuffs that should show a bad border color are always showing a good border color.

This is a side effect of how ABA handles missing auras and was there before my current additions. We rely on the aura expiration - if it is present and above the missing threshold, we hide the missing highlight and show it else. So if no other rule sets the expiration, it is not present and thus the missing highlight is applied. The display of missing highlights also relies on the highlight type the normal rule would set. We aim to achieve some kind of duality here, not to make every combination possible. If the normal and the missing highlight are of the same type, only the missing will be displayed (duality is present vs. absent). If the highlight types are different then both could be shown when their respective conditions apply (the duality is more prominent vs less prominent). The advantage of this approach is that we are able to adapt to custom rules in a general way. The disadvantage is that it has limitations.

As for how highlights work in ABA and what options are available, read here. If those don't suit you, then I must apologize and suggest you use another addon.

Please consider that I'm doing all of this in my spare time. I would really appreciate it, if we would concentrate on finding and fixing bugs from now on rather than suggesting new features or changing current behavior.

@mspykerez
Copy link
Author

  • The 'Hint' as highlight when it reaches 0 the 'Flash' highlight is shown instead issue appears to be fixed.

  • There is a a new bug with 'show flash' or 'show hint' when chosen for the missing highlight threshold where abilities that reaches or are bellow the threshold highlight will be highlighted multiple times in a row, using another ability different from he one that has the missing threshold enable will also trigger the highlight multiple times.

  • Also found another strange issue with adrenaline rush where after you activate it for the first time it will start the normal 20s countdown, but after it reaches 0 the countdown starts over this time with a 25s countdown...

@Rainrider
Copy link
Member

Also found another strange issue with adrenaline rush where after you activate it for the first time it will start the normal 20s countdown, but after it reaches 0 the countdown starts over this time with a 25s countdown...

This is Loaded Dice, which has a 45 sec duration. Once Adrenaline Rush disappears (20 sec), you see the remaining 25 secs from Loaded Dice.

There is a a new bug with 'show flash' or 'show hint' when chosen for the missing highlight threshold where abilities that reaches or are bellow the threshold highlight will be highlighted multiple times in a row, using another ability different from he one that has the missing threshold enable will also trigger the highlight multiple times.

Ah, this is because the animation is redrawn from the start when the rule conditions are met. Rules are re-evaluated every time a new aura is applied or a relevant unit changes. I do have a quick solution for this, but I'd like to see if it can be done in a better way.

@Rainrider
Copy link
Member

Ok, I made it cleaner code wise and hope all concerns are now gone. Please test again. Thank you for your time investment btw, much appreciated!

@mspykerez
Copy link
Author

Sorry for late reply but Iam travelling for the month and unable to test it.

@Rainrider
Copy link
Member

No worries. I might release it in the mean time. Feel free to re-open the issue any time you get to test this and find any problems.

@mspykerez
Copy link
Author

mspykerez commented Mar 31, 2018

Back to action! I think that the 'show hint' should be changed to rotary star on the dropdown menu of choices of 'show missing', this is because otherwise we need to stick with the global option of 'spell hints' to show the rotary star which will be shown on all situations and not only as the show missing threshold hint of choice. In addition to that when we select the 'show hint' as 'show missing' method it is not mutually exclusive with the show good and bad border choices (I mean the bad and good border have priority over the 'show hint' which is happening the other way around when 'show flash' is the method of choice instead).

I would also like an option to only 'show missing' events and not display any other events on the icon (except rules when selected).

@Rainrider
Copy link
Member

Sorry, in this regard I find it works as intended and is consistent as is. The current settings lead to complicated enough scenarios and I'm rather reluctant to change it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants