From 80ca244ae52ff3f67c350ed52eb2850ced0222d1 Mon Sep 17 00:00:00 2001 From: Casimir Eisenach Date: Wed, 26 Feb 2025 00:39:09 +0100 Subject: [PATCH 1/3] Document SMODS.DrawStep --- _Sidebar.md | 1 + 1 file changed, 1 insertion(+) diff --git a/_Sidebar.md b/_Sidebar.md index a8f58ff..7ca708e 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -15,6 +15,7 @@ Game Objects * [SMODS.Voucher](https://github.com/Steamodded/smods/wiki/SMODS.Voucher) * [SMODS.Challenge](https://github.com/Steamodded/smods/wiki/SMODS.Challenge) * [SMODS.DeckSkin](https://github.com/Steamodded/smods/wiki/SMODS.DeckSkin) + * [SMODS.DrawStep](https://github.com/Steamodded/smods/wiki/SMODS.DrawStep) * [SMODS.https](https://github.com/Steamodded/smods/wiki/SMODS.https) * [SMODS.Keybind](https://github.com/Steamodded/smods/wiki/SMODS.Keybind) * [SMODS.Language](https://github.com/Steamodded/smods/wiki/SMODS.Language) From ea491ab20558468b69e07f33b0491d7f65f2bf72 Mon Sep 17 00:00:00 2001 From: Casimir Eisenach Date: Wed, 26 Feb 2025 00:39:30 +0100 Subject: [PATCH 2/3] -am doesn't work like that --- SMODS.DrawStep.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 SMODS.DrawStep.md diff --git a/SMODS.DrawStep.md b/SMODS.DrawStep.md new file mode 100644 index 0000000..130cc88 --- /dev/null +++ b/SMODS.DrawStep.md @@ -0,0 +1,11 @@ +# API Documentation: `SMODS.DrawStep` +This class offers a standardized way of drawing sprites and shaders on cards instead of having to rely on patching `Card:draw()`. +- **Required parameters:** + - `key` + - `order`: Sets an order for this step. All draw steps are executed in order from lowest to highest. Refer to `src/card_draw.lua` in Steamodded's source code for the order values of base draw steps. + - `func(card, layer)`: Handles the drawing logic of this `DrawStep`. + - `card` is the card being drawn. + - `layer` is one of `'card'`, `'shadow'`, `'both'`. +- **Optional parameters** *(defaults)*: + - `layers = { both = true, card = true }`: Determines which values of the `layer` argument this `DrawStep` should be executed for. Unless you are defining custom types of layers and calling `Card:draw()` with them, you should only ever need to change this to `{ both = true, shadow = true }` when you are drawing a shadow. + - `prefix_config, dependencies` [(reference)](https://github.com/Steamodded/smods/wiki/API-Documentation#common-parameters) From 97b28c74a6045b378caeb1cff8d46f26ea0ca47b Mon Sep 17 00:00:00 2001 From: Casimir Eisenach Date: Fri, 28 Feb 2025 22:42:31 +0100 Subject: [PATCH 3/3] Add conditions --- SMODS.DrawStep.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SMODS.DrawStep.md b/SMODS.DrawStep.md index 130cc88..340f26a 100644 --- a/SMODS.DrawStep.md +++ b/SMODS.DrawStep.md @@ -8,4 +8,7 @@ This class offers a standardized way of drawing sprites and shaders on cards ins - `layer` is one of `'card'`, `'shadow'`, `'both'`. - **Optional parameters** *(defaults)*: - `layers = { both = true, card = true }`: Determines which values of the `layer` argument this `DrawStep` should be executed for. Unless you are defining custom types of layers and calling `Card:draw()` with them, you should only ever need to change this to `{ both = true, shadow = true }` when you are drawing a shadow. + - `conditions = {}`: Defines additonal conditions for when this draw step should or shouldn't run. This table accepts the following keys: + - `vortex = `: Checks for a `vortex` property of the drawn card. This is true only for splash cards on the game's splash screen. + - `facing`: Checks for the facing direction of the card. Valid values are `'front'` and `'back'`. - `prefix_config, dependencies` [(reference)](https://github.com/Steamodded/smods/wiki/API-Documentation#common-parameters)