-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
Add percentage support for GenericTrigger trigger.remaining #5264
Conversation
added the ability to activate triggers based on a percent progress of duration
Writing a complex rotation helper in WA is a non-goal. WA is simply not the right tool for that, nor has the right abstractions for that. This does somewhat useful even without the rotation helper background, so I wouldn't be against it. But you have a hardcoded "duration" name in there, which is not generic enough and I don't see a easy way to make that generic. |
@@ -235,7 +235,11 @@ local function singleTest(arg, trigger, name, value, operator, use_exact) | |||
elseif (arg.type == "string" or arg.type == "select") then | |||
return "(".. name .." and "..name.."==" ..(number or ("\""..(tostring(value) or "").."\""))..")"; | |||
elseif (arg.type == "number") then | |||
return "(".. name .." and "..name..(operator or "==")..(number or 0) ..")"; | |||
if numberType == "percent" then | |||
return "(duration == 0 or ("..name.." and "..name..(operator or "==")..(number or 0).."* duration".."))"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This conceptually doesn't work. You are relying on triggers hardcoding a "duration" local, which is not a given, and also means only a single duration can be used per trigger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see. thanks for reading though!
@@ -461,7 +462,7 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum | |||
options[name..suffix] = { | |||
type = "input", | |||
width = arg.noOperator and WeakAuras.normalWidth or WeakAuras.halfWidth, | |||
validate = ValidateNumeric, | |||
validate = (name == "remaining" and ValidateNumericOrPercent) or ValidateNumeric, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are changing all inputs of type number here, without any regard to whether they should or shouldn't support percents
Dynamic remaining time for all GenericTrigger functions based on duration. Makes rotational auras easier to maintain and reduces complexity for auras tracking spells with cooldowns that varies depending on talents. This is something I use for a ton of auras with custom triggers and would appreciate if it was available via standard triggers :)