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

Add percentage support for GenericTrigger trigger.remaining #5264

Closed
wants to merge 5 commits into from

Conversation

potat0nerd
Copy link
Contributor

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 :)

@InfusOnWoW
Copy link
Contributor

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".."))";
Copy link
Contributor

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.

Copy link
Contributor Author

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,
Copy link
Contributor

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

@potat0nerd potat0nerd closed this Jul 27, 2024
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

Successfully merging this pull request may close these issues.

2 participants