-
-
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 warband currency support #5229
Conversation
ee62f78
to
995a03c
Compare
995a03c
to
5881517
Compare
|
I still plan on updating this with the feedback from code review, but I'm just enjoying playing the game a bit too much right now :D |
That's not a problem. I can also take a look at some of the changes I suggested, but similarly not now.. |
387ddad
to
2cd1484
Compare
I finaly had some time to come around to this PR again. |
Thanks, I'll take a look at it asap. |
WeakAuras/Prototypes.lua
Outdated
if cloneActive and tostring(%s) ~= %q then cloneActive = false end | ||
]]):format(check.condition, tristateValue)) | ||
end | ||
end |
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.
So while what you are doing for quantityConditions, tristateCondition and cloneConditions to generate the checks is fine, I do think that the code would be easier to understand if it weren't so data-driven, and instead used simple functions, e.g. (And I haven't tested this)
local function createQuantityCheck(property, operator, value, primary)
local ret = [[
if not primaryCheckFailed and currencyInfo[%s] %s %s then
active = false
%s
end
]]
return ret:format(property, operator, value, primary and "primaryCheck = false" or "")
end
And then in triggerFunc
table.insert(quantityChecks, createQuantityCheck("quantity", trigger.value_operator, trigger.value, true))
table.insert(quantityChecks, createQuantityCheck("realCharacterQuantity", trigger.realCharacterQuantity_operator, trigger.realCharacterQuantity, true))
table.insert(quantityChecks, createQuantityCheck("accountQuantity", trigger.accountQuantity_operator, trigger.accountQuantity))
etc..
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.
I've reworked the creation of checkstrings in a seperate commit, see bb422f6
Re-request the account data in the situation where API says the account data is ready but the fetch call returns nil.
The code is so much more readable now compared to a couple days ago 😄 |
Description
TWW brings warband currencies that can be transferred over to other characters within your warband.
The C_CurrencyInfo API contains currencyData for all warband characters, and so we're able to create a cloning trigger that shows currency info for each character in the warband.
This is a full rework of the currency trigger prototype as this needs to use
statesParameter = "full"
.Several state values for account wide currencies have been added:
Example