-
Notifications
You must be signed in to change notification settings - Fork 27
DeckSkin Crediting documentation #36
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
```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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should link to the |
||
|
||
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 | ||
``` | ||
 |
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. | ||
|
||
|
@@ -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)` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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` | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.