Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions DeckSkinCrediting.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page should be linked somewhere, otherwise it cannot be accessed on the SMODS wiki.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also considering this not being a dedicated page, and instead all of the details on the functions are on the SMODS.DeckSkin page. Probably better for organization.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

# DeckSkin Crediting
Steammodded now provides built-in methods to force enable card UI in the Customize Deck menu, which allows you to credit the artists for your DeckSkins. Using similar methods to the `generate_ui` function for Centers, modders can use two functions (`has_ds_card_ui` & `generate_ds_card_ui`) to enable UI to show when hovering over specific cards in your DeckSkin preview.

## Enabling the UI (has_ds_card_ui)
For every palette you define in your DeckSkin, there is the `display_ranks` list that defines which ranks will show in the preview, and in what order. When the preview is shown on screen, `has_ds_card_ui` is called for each card. If the return of the function is `true`, then the UI will be enabled for that card.

Utilizing the `card`, `deckskin`, and `palette` args, you can filter out the enabled ui by checking the rank of the cards, checking the key of the current palette, and more.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably mention what these args are specifically. Someone could be confused as to whether the deckskin refers to the SMODS.DeckSkin object this function is defined on or some other SMODS.DeckSkin object.

```lua
has_ds_card_ui = function(card, deckskin, palette)
if card.base.value == "King" then
return true
end
end
```

## Defining the UI (generate_ds_card_ui)
For every card that has its UI enabled by `has_ds_card_ui`, you can define the contents of it with `generate_ds_card_ui`, much like you would define the ui with `generate_ui` in Centers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should link to the generate_ui function documentation.


The following is a simple method for crediting artists with this function, which is used in the code for Steammodded when crediting the original artists for the vanilla Friends of Jimbo DeckSkins. The first localize function creates the header which says "Artist", and the second is for showing the artist, whose name goes in the vars:
```lua
generate_ds_card_ui = function(card, deckskin, palette, info_queue, desc_nodes, specific_vars, full_UI_table)
if card.base.value == "King" then
localize{type = 'other', key = 'artist', nodes = desc_nodes, vars = {}}
localize{type = 'other', key = 'artist_credit', nodes = desc_nodes, vars = { "ARTIST NAME HERE" }}
end
end
```
![Visual example of the default crediting format used in the above code, seen in Balatro: Cardsauce](https://images-ext-1.discordapp.net/external/GKGG7ScABo6P6EzBX4Ih1VePDVXKMkhXhSPbGbIExss/https/i.imgur.com/pZ1XIP2.jpg?format=webp&width=1592&height=1291)
9 changes: 9 additions & 0 deletions SMODS.DeckSkin.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# API Documentation: `SMODS.DeckSkin`
This API extends the game's Friends of Jimbo collabs screen to create new deck skins for all suits, including modded ones.

Expand Down Expand Up @@ -28,3 +29,11 @@ Note: Atlases in this class are not automatically prefixed.
- `loc_txt` or localization entry [(reference)](https://github.com/Steamodded/smods/wiki/Localization)
- `hc_default` (optional): If this is true, use high-contrast textures for unchanged sprites.

## API Methods
- `has_ds_card_ui(card, deckskin, palette)`
- Enable UI on cards in preview
- Called for every currently displayed card in preview
- `generate_ds_card_ui(card, deckskin, palette, info_queue, desc_nodes, specific_vars, full_UI_table)`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both these functions should mention (or link to) the DeckSkin crediting page for extra details.

- Freely define the UI of card descriptions in preview
- Called for every card that has a UI in preview, enabled by `has_ds_card_ui`