-
Notifications
You must be signed in to change notification settings - Fork 42
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
[Feature Request] Programmatic override of Card Count #138
Comments
Card Count OverrideMy gut reaction is that anything messing with card counts really should be handled outside of the application. The count of cards within an individual row is handled as part of reference reading. The rows are actually duplicated in the DeckReader for use with things like the What are the use cases where you found that overriding the card count would be helpful? Card Count On Layouts (without references)Not sure if you were thinking of any specific use for overriding this one. nocarddrawThat's an interesting one. On export this just wouldn't create a file? What would this do in-app on the Canvas, possibly render of message indicating that the card won't be exported? |
So my use case for either of them is really just to reduce the count to 0, to disable the card from performing the rendering or the file output. So in my SubLayout world, and a few other times (I can't remember off the top of my head) it has seemed useful to cancel the processing of a particular line in the excel spreadsheet, but to do it programmatically. For a SubLayout, for example, if I invoke the SubLayout through a ParentLayout, and it's signaling that it wants to use an override card instead of a default card, then each one can check for the request of the custom card and "disable"/"not disable" based on that. So If I have 10 base cards, and 50 custom ones, I don't have to make all 60 cards for my SubLayout (which I'm perfectly fine doing), I can have each one check against the contents of the PrimaryLayout fields and perform a I think having As an extension of the previous example, technically being able to increase/augment the Count based on a calculation would be more streamlined than having to pre-calculate it by hand. So for example we want to just change 1 value from "Flip over @[Cards_To_Draw] cards" to "Flip over @[Cards_To_Draw] cards" but elsewhere it uses that value to change the actual number of cards that get printed, having programmatic control over card counts would be sweet. |
I found another use for the #nocarddraw, debugging layouts: |
Breaking things down to discrete pieces of functionality I'm considering: Translation for the Card Count ColumnCard counts are currently read as static numbers. They can only be manually adjusted. At the time of reference read the defines are available. A simple translation in the card count column could be easily (well hopefully) supported. This way a define set could look like this:
And a Reference could look like this:
#nocarddrawI am definitely leaning away from this because by the time there is element translation taking place the reference and card counts have already been applied. Alternative: Defines Passed Into SubLayoutsWith the Translation for the Card Count Column item above combined with Passing defines through to the SubLayout (or Passing custom defines to a SubLayout) mentioned in #141 The count of a given row could technically be controlled by the parent layout. AcknowledgementThe proposals here will not be used by many users of the application. They can be extremely complex and require a lot of planning and understanding for a user. I always take some caution when implementing these special functions as the stack of things I have to support grows each time the application expands. With hundreds/thousands of existing project files out there the last thing I want to do is break everyone! 💥 |
So I don't particularly see a problem with when the #nocarddraw is actually eventually executed. For example, let the full incept translator run on all columns, and if any of them ever turn up the #nocarddraw, then we can store it in a similar way to #nodraw for an individual element. The only time that #nocarddraw would ever come up is during the rendering phase, where the card would be skipped in rendering/saving, but would otherwise NOT impact card count totals etc. This means if we had #nocarddraw on every even card, we would have When some of my cards are currently taking 10-15 seconds (for the rendering/saving phases together), but the incept translation is milliseconds, then the goal is merely to fix the most processor-intensive parts. I don't think anyone would expect #nocarddraw to function differently, it would literally be a "skip me" type of command, where the card is ignored after all translations are performed, but also after all other card indices/positions/counts are finalized. I can understand wanting to avoid programmatically changing the card count, but #nocarddraw would pay dividends in processing time, and it would just be 1 check of an if statement (then continue) at the beginning of the loop which does each card's final rendering output. |
Ah, okay thanks for the clarification! 👍 As long as the counts and otherwise aren't impacted then I definitely support the idea and can add it to my todo list. As rendering on screen itself probably wouldn't be impacted much is there another name that might better describe what will happen? |
I give a thumbs up to #noexport. :) |
Initial submission of There are likely some positioning bugs related to stitched image exports and pdf exports. Definitely more cleanup in a future commit. |
Testing the #noexport works great! (for my suggested purposes) Additional request
Currently it seems to be running even in preview mode |
Certainly could let it render the whole card on the Canvas. I was planning on adding an indicator that a card is being marked as |
|
This functionality is now in (very lightly tested): Translation for the Card Count ColumnCard counts are currently read as static numbers. They can only be manually adjusted. At the time of reference read the defines are available. A simple translation in the card count column could be easily (well hopefully) supported. This way a define set could look like this:
And a Reference could look like this:
Coming up next (when time permits)When specifying a sublayout in the sublayout element provide a way to specify in-line defines (key+value). This way you can customize a card count using the above functionality. |
Submitted but still play around with overriding defines when specifying a layout in the SubLayout element: 933d945 Also attempted a fix to the display of It's a slightly risky change... SubLayout Elements (Previously)Specify the name of the layout: SubLayout Elements (Now)Along with the normal functionality above it also supports specifying parameters and a set of override defines.
Full example:
Using the above example -- Now a SubLayout can have its card count driven in-reference by |
I'll check it out! |
Known issue (update coming): The translation of the SubLayout element should be performed with each row, not just once during export setup. Updated: e91b250 Translates per-row (necessary, but slightly more processing... can always be optimized later) |
Count logic was added initially with sublayouts https://github.com/nhmkdev/cardmaker/releases/tag/v.1.4.0.0-unstable.v.a2 |
Lately I've been going through different parts of the software (as a user) and I was wondering if it would ever be possible to have a setter for the count of cards to print, such as: $[count:15]. This would pay dividends during the SubLayouts as well, because we could also ignore things programmatically, but from time to time I've found myself wanting to be able to change the card count independently of the spreadsheet. Is this even remotely possible? Additionally/alternatively, we have a #nodraw for a given element, could we get #nocarddraw for the entire card to just get ignored if it ever finds that value?
The text was updated successfully, but these errors were encountered: