implement the menu_cards function #1165
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SMODS.current_mod.menu_cardsis a new function that simplifies the process of adding custom cards to the title screen. It should allow many mods to add cards at once without causing the game logo to slide offscreen, and it should also keep the width of the cardarea reasonable so that you don't have a bunch of cards spread out across the whole width of the screen.Usage
SMODS.current_mod.menu_cards()should return a table of tables, where each inner table is set up as if it were the arguments toSMODS.add_card(). If you are only adding one card, you're allowed to not use an inner table and just pass the arguments directly in the outer table. It will automatically handle randomization if you only specify a set and not a key (which is not normally the case on the main menu).The outer table can also contain
func, which should be a function that will be run immediately after all the cards from all mods are added to the title screen. This can be used for e.g. Talisman applying the Gold Seal to the default Ace of Spades, or some sort of niche crossmod interaction.Example
The following code would add a random Tarot card to the title screen and set the leftmost card (likely the vanilla Ace of Spades) to have the Negative edition.
Additional Info: