Open LeCuay opened 2 months ago
I like how these feature requests just get more and more complicated.
Honestly not sure how I would pull this off in a graceful manner. I'll have to think about how possible it is and get back to you.
It took a bit of work but...
Now, that being said, I'm not 100% sure I'm happy with this implementation or the jank I had to pull to get this to work. I want nothing more than to give the users of my modules exactly what they want, but I'm not sure the cost of this feature is worth the value it brings.
As it stands, I added a type
for total
. Whatever text is fed into total, gets treated like the type is direct
, however in the background the total is ... totaled and stored elsewhere. During runtime the direct value is displayed, until the bottom of the table where I'm running another loop, similar to how I generate the column headers, that instead generates column totals. This requires added a special field, just the text
that was used in the column, so it can be referenced after it's converted by the direct
parser.
Unfortunately, I'm not sure what I can do about all the extra border lines without adding a ton of customization options and then having to work those in etc.
AND, this really only works for ints. If I make things floats, then I have to worry about precision because if people start using ints, they'll get .00 decimal spots, etc.
I almost want to make a separate section on the popup, with it's own JSON, just to display 'total values' then this might be a lot more clean.
It took a bit of work but...
Now, that being said, I'm not 100% sure I'm happy with this implementation or the jank I had to pull to get this to work. I want nothing more than to give the users of my modules exactly what they want, but I'm not sure the cost of this feature is worth the value it brings.
As it stands, I added a
type
fortotal
. Whatever text is fed into total, gets treated like the type isdirect
, however in the background the total is ... totaled and stored elsewhere. During runtime the direct value is displayed, until the bottom of the table where I'm running another loop, similar to how I generate the column headers, that instead generates column totals. This requires added a special field, just thetext
that was used in the column, so it can be referenced after it's converted by thedirect
parser.Unfortunately, I'm not sure what I can do about all the extra border lines without adding a ton of customization options and then having to work those in etc.
AND, this really only works for ints. If I make things floats, then I have to worry about precision because if people start using ints, they'll get .00 decimal spots, etc.
I almost want to make a separate section on the popup, with it's own JSON, just to display 'total values' then this might be a lot more clean.
Yeah... This one is gonna the most difficult. Not only because of the iteration within the loop but also the information displayed. I recommended to wait for #38 because the solution might go via a single column with full rowspan in order to display party gold
I actually did this work branching from #38
And now that I think about it, I did implement colSpan the same way as rowSpan, so there may be a way track the empty cells then colspan between them and use right-aligned text. Not sure.
Summary
Yet another request 😅.
For total party wealth basically but I think it's a great addition in general.
This could get tricky since it'd require for a single row to iterate all actors in order to retrieve values as array or for adding them to a common property.
It might be a good idea to wait for #38