Sleeves API Changes - larswijn/CardSleeves GitHub Wiki

API changes

This page documents all (breaking) API changes in CardSleeves for existing implementations of sleeves, most recent first.

If you are trying to create a new sleeve, this page has no use for you. Check out API Documentation instead.

V1.8.0

Deprecated the sleeve-only shop_final_pass context

This context has been turned obsolete since the introduction of the SMODS starting_shop context from SMODS#469 in SMODS version 1424a. Please use the smods starting_shop context instead.

V1.7.1

Removed get_name()

Removed Sleeve:get_name(). As far I'm aware, no mod actually used this function.

See V1.6.4 API changes for more information.

V1.6.4

Deprecated get_name()

Deprecated Sleeve:get_name(), since it did not respect loc_vars key change.

Use generate_ui instead to get both the description and name.

V1.6.0

unlock_condition.stake changes

Deprecated unlock_condition.stake being an index. A warning will pop up when an index is used instead of a key. This would break when mods would add stakes in-between the vanilla stakes, and shift the stake unlock requirement over.

Keep the key stake, but change it to the stake key instead, e.g. stake = 2 -> stake = "stake_red"; or see this commit.

:calculate

Sleeves now additionally support the steamodded default :calculate, with all its contexts and returns. This still includes CardSleeves' custom contexts.

No worries if your sleeve still uses :trigger_effect, as I probably will support it as long as steamodded is too.

V1.5.5

Removed get_current_deck_name

Permanently removed get_current_deck_name. This function had been deprecated since V1.4.1, and is now removed completely.

See the V1.4.1 API changes for more information.

V1.5.0

Sprite sheet 2 px gap

Sprite sheets should now have a 2 px gap between sprites, and change the px (sprite width) in their sleeve atlas to match. This is because of sprite bleeding in Balatro when there is no gap between sprites. See this PR for a full explanation.

See this commit for an example on what to change.

V1.4.1

Deprecated get_current_deck_name

Deprecated get_current_deck_name. A warning will pop-up when this function is used. Using the deck name for comparisons does not make sense, since it is not a required key nor is it guaranteed to be unique. The deck key will always be populated and is guaranteed to be unique, so it will be used instead.

Use get_current_deck_key instead. See this commit as example on how to use it.

V1.2.0

Replaced all create_[type] contexts with create_card

Regarding :trigger_event() contexts: all create_[type] events have been removed, and replaced by a single create_card event that will trigger whenever any card is created. This was done so modded card types don't all have to get an individual context.

Use card.ability.set to check the card type. See this commit for an example on how to change the code.

V1.0.0

Timemachines

If you somehow had Sleeve code before this version, you must have a timemachine!