|
Post by damooseneo on Aug 8, 2020 4:20:07 GMT
Can we trigger an update of all fields? Issue: I have a "chain" of fields, all based essentially on one. Update it, it turns others visible, adds text, and determines/updates left/right coordinates and width. Each subsequent entry in the chain depends on the width of each other. As of now, I update the key value and for each field which needs an update I need to click or type a character and it moves each piece into place. I navigate away from the card to a new card, navigate back, and I have to do it all over again.
Quasi-related are set counts. I have a field that displays the count of cards in a set/subset. This is locked into its initial value, it won't auto update; if I "type" into the field it updates, but if its uneditable I obviously cannot. For the style, this text is displayed lower than the card's number font, so unless I can do mixed font sizes in one field I currently don't have a great answer to make the count and its companion set of numbers share a field and net an update that way.
|
|
|
Post by cajun on Aug 8, 2020 8:46:18 GMT
Can we trigger an update of all fields? Issue: I have a "chain" of fields, all based essentially on one. Update it, it turns others visible, adds text, and determines/updates left/right coordinates and width. Each subsequent entry in the chain depends on the width of each other. As of now, I update the key value and for each field which needs an update I need to click or type a character and it moves each piece into place. I navigate away from the card to a new card, navigate back, and I have to do it all over again. Quasi-related are set counts. I have a field that displays the count of cards in a set/subset. This is locked into its initial value, it won't auto update; if I "type" into the field it updates, but if its uneditable I obviously cannot. For the style, this text is displayed lower than the card's number font, so unless I can do mixed font sizes in one field I currently don't have a great answer to make the count and its companion set of numbers share a field and net an update that way. the best practice is to have them all on a reference; ie if one is left: some_variable() width: 10
its better to have the next be
left: some_variable() + 10
than key off card_style.whatever.right ---- i'm not understanding your set count question. if its fully scripted it will auto-update. for fonts, on 2.1.1 you can script multiple fonts in a textbox.
|
|
|
Post by damooseneo on Aug 8, 2020 11:37:19 GMT
Re: Set Count
I'm using some older code of mine, but as far as I know it should be that simple but its not happening; I have two fields right now, one for the card's number and one for the set's number:
card field:
type: text
name: collector_line
script: getCardString()
editable: false
show statistics: false
card field:
type: text
name: collector_line_2
script: getSetString()
editable: false
show statistics: false
And the scripts called are a wrapper which test the card's type for subset counting, calling a function as so:
card_number := {
position (of: card, in: set, filter: { isBattleCard() }, order_by: { sort_index() + card.name }) + 1
}
...
card_count := {
number_of_items(in: set, filter: { isBattleCard() })
}
The card's number updates appropriately, but the card count doesn't automatically update. If the field is uneditable, it just never updates, while if it is editable I have to click into the field to trigger an update. This is quasi-similar to the above in that the field does not automatically update on its own; I have to take an action to see it update.
|
|
|
Post by damooseneo on Aug 9, 2020 3:47:06 GMT
Thanks for the tip regarding the variable; makes things a lot smoother and responds better Still arguing with the numbering though. Borrowed some numbering from MtG, still can't swing the actual auto updates; remains static until I edit the field somehow. Do I need to run it through the combined editor, as in MtG? Is that what's forcing the auto update? Game wants to separate/track the numbering of several subsets, so I can mostly get the filters working in that regard
|
|
|
Post by damooseneo on Aug 20, 2020 16:26:54 GMT
Updating for "Resolution" - I made each of the fields "identifiable" - I added a "sort script" to each of the card number and set number fields These changes seem to force the updates as new cards are added and work out when the set is loaded.
|
|