diff --git a/README.md b/README.md index 07a9f03..7f2c2e8 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Please let me know of mods that add consumable cards that may need additional su # Installation -0. This mod is made for [**Steammodded 1.x**](https://github.com/Steamodded/smods) and [lovely](https://github.com/ethangreen-dev/lovely-injector) so you will need to install them first [as explained here](https://github.com/Steamodded/smods/wiki). **Disclaimer:** You will want to use the newest [tagged release of Steammodded](https://github.com/Steamodded/smods/releases) as the version on `main` might be broken/unstable. +0. This mod is made for [lovely](https://github.com/ethangreen-dev/lovely-injector) so you will need to install it first [as explained here](https://github.com/Steamodded/smods/wiki). It has optional support for [**Steamodded 1.x**](https://github.com/Steamodded/smods) and you will want to use the newest [tagged release of Steamodded](https://github.com/Steamodded/smods/releases) as the version on `main` might be broken/unstable. 1. Download the newest version of the mod from the [Releases tab](https://github.com/eramdam/balatro-mods/releases) 2. Extract the .zip file and move the `sticky-fingers` folder into your Mods file 3. Launch Balatro and enable the mod in the `Mods` panel diff --git a/lovely/misc_functions.lua b/lovely/misc_functions.lua index 8e632ac..f8f080c 100644 --- a/lovely/misc_functions.lua +++ b/lovely/misc_functions.lua @@ -17,7 +17,7 @@ function create_drag_target_from_card(_card) P_switch = Moveable { T = { x = G.deck.T.x + 0.2, y = G.deck.T.y - 5.1, w = G.deck.T.w - 0.1, h = 4.5 } }, } - if DTM.config.vanilla_joker_sell == false then + if DTM and DTM.config.vanilla_joker_sell == false then G.DRAG_TARGETS.J_sell = Moveable { T = { x = G.deck.T.x + 0.2, y = G.deck.T.y - 5.1, w = G.deck.T.w - 0.1, h = 4.5 } } else G.DRAG_TARGETS.J_sell = G.DRAG_TARGETS.J_sell_vanilla @@ -91,7 +91,7 @@ function create_drag_target_from_card(_card) -- is the card in a pack? if _card.area == G.pack_cards then - local is_consumeable_card_in_crazy_reverie_pack = Reverie and SMODS.OPENED_BOOSTER.label == 'Pack' and + local is_consumeable_card_in_crazy_reverie_pack = Reverie and SMODS and SMODS.OPENED_BOOSTER.label == 'Pack' and _card.ability.consumeable and _card.area == G.pack_cards -- is the card a consumeable? @@ -116,7 +116,7 @@ function create_drag_target_from_card(_card) local needs_areas = true -- Pokermon has a "Super Rod" voucher that lets the player save any consumeable from packs and not just Energy/Item cards. - local pokermon_has_save_all = G.GAME.poke_save_all and not SMODS.OPENED_BOOSTER.label:find("Wish") + local pokermon_has_save_all = SMODS and G.GAME.poke_save_all and not SMODS.OPENED_BOOSTER.label:find("Wish") -- Cryptid's "Code" cards inside packs. if Cryptid and _card.ability.consumeable and _card.ability.set == 'Code' then diff --git a/main.lua b/main.lua index 5fdfe8f..7c80e91 100644 --- a/main.lua +++ b/main.lua @@ -1,3 +1,5 @@ +if not SMODS then return end + if SMODS.Atlas then SMODS.Atlas({ key = "modicon", @@ -7,7 +9,6 @@ if SMODS.Atlas then }) end - DTM = SMODS.current_mod DTM.save_config = function(self)