Skip to content

Conversation

@MetaNite64
Copy link
Contributor

SMODS.current_mod.menu_cards is 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 to SMODS.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.

SMODS.current_mod.menu_cards = function()
	return {
		set = "Tarot",
		func = function()
			G.title_top.cards[1]:set_edition("e_negative")
		end
	}
end

Additional Info:

  • I didn't modify api's or I've made a PR to the wiki repo.
  • I didn't modify api's or I've updated lsp definitions.
  • I didn't make new lovely files or all new lovely files have appropriate priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant