Skip to content

Commit e791ebf

Browse files
authored
compat for handy compat
1 parent 8bca78a commit e791ebf

File tree

3 files changed

+12
-32
lines changed

3 files changed

+12
-32
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ This mod contains a slightly customisable **keybind** and **colour**. To change
77

88
Holding the keybind while scoring a winning hand will mimic vanilla behaviour, useful in cases where you want to avoid drawing more cards
99

10+
When [Handy](https://github.com/SleepyG11/HandyBalatro) is installed, the keybind is hard-set to '**enter**'
11+
1012
# Installation
1113

1214
Install [Lovely](https://github.com/ethangreen-dev/lovely-injector)
@@ -15,4 +17,4 @@ Install [Lovely](https://github.com/ethangreen-dev/lovely-injector)
1517
Install [Steamodded](https://github.com/Steamopollys/Steamodded) (must be **1.0.0 or higher**)
1618

1719

18-
Download the newest release ([linked here](https://github.com/Toneblock/balatro-NotJustYet/releases/latest)), extract the .zip, and place it into your Mods folder
20+
Download the newest release ([linked here](https://github.com/Toneblock/balatro-NotJustYet/releases/latest)), extract the .zip, and place the folder within into your Mods folder

lovely.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ if not true then
5959
'''
6060
match_indent = true
6161

62-
# actions compat?
62+
# add button
6363
[[patches]]
6464
[patches.pattern]
6565
target = "functions/UI_definitions.lua"
6666
pattern = '''G.SETTINGS.play_button_pos == 1 and play_button or discard_button,'''
6767
position = "after"
6868
payload = '''
69-
GLOBAL_njy_action and {n=G.UIT.C, config={id = 'njy_end_button',align = "tm", padding = 0.3, r = 0.1, minw = 1.3, minh = button_height, hover = true, colour = G.C.GREEN, button = "njy_attempt_endround", one_press = true, shadow = true, func = 'njy_can_endround'}, nodes={
69+
{n=G.UIT.C, config={id = 'njy_end_button',align = "tm", padding = 0.3, r = 0.1, minw = 1.3, minh = button_height, hover = true, colour = G.C.GREEN, button = "njy_attempt_endround", one_press = true, shadow = true, func = 'njy_can_endround'}, nodes={
7070
{n=G.UIT.R, config={align = "cm", padding = 0}, nodes={
7171
{n=G.UIT.T, config={text = "End", scale = text_scale, colour = G.C.UI.TEXT_LIGHT, focus_args = {button = 'y', orientation = 'bm'}, func = 'set_button_pip'}}
7272
}}
73-
}} or nil,
73+
}},
7474
'''
7575
match_indent = true
7676

@@ -81,7 +81,7 @@ target = "game.lua"
8181
pattern = '''config = {align="bm", offset = {x=0,y=0.3},major = G.hand, bond = 'Weak'}'''
8282
position = "at"
8383
payload = '''
84-
config = {align="bm", offset = {x=GLOBAL_njy_action and 0.65 or -0.65,y=0.3},major = G.hand, bond = 'Weak'}
84+
config = {align="bm", offset = {x=0.65,y=0.3},major = G.hand, bond = 'Weak'}
8585
'''
8686
match_indent = true
8787

@@ -152,8 +152,8 @@ match_indent = true
152152
[[patches]]
153153
[patches.pattern]
154154
target = "engine/controller.lua"
155-
pattern = "if key == 'v' then"
156-
position = "before"
155+
pattern = "function Controller:key_press_update(key, dt)"
156+
position = "after"
157157
payload = '''
158158
if key == G.njy_keybind then
159159
GLOBAL_njy_vanilla_override = true

main.lua

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
--- MOD_DESCRIPTION: Prevents scoring from ending the round early
77
--- BADGE_COLOUR: ffffff
88
--- DEPENDENCIES: [Steamodded>=1.0.0~ALPHA-1103a]
9-
--- VERSION: 0.5.0
9+
--- VERSION: 0.5.2
1010
--- PRIORITY: 1
1111

1212
----------------------------------------------
@@ -24,30 +24,6 @@ G.njy_colour = 'GREEN'
2424

2525

2626

27-
--[[
28-
29-
-- attempt at dynamic actions compat... it "works" but occasionally the button loses clickability so it's just permanently in different pos now
30-
31-
if SMODS.Mods["ACT"] then GLOBAL_njy_action = true end
32-
33-
local old_buttons = create_UIBox_buttons
34-
local end_button = {n=G.UIT.C, config={id = 'njy_end_button',align = "tm", padding = 0.3, r = 0.1, minw = 1.3, minh = 1.3, hover = true, colour = G.C.GREEN, button = "njy_attempt_endround", one_press = true, shadow = true, func = 'njy_can_endround'}, nodes={
35-
{n=G.UIT.R, config={align = "cm", padding = 0}, nodes={
36-
{n=G.UIT.T, config={text = "End", scale = 0.45, colour = G.C.UI.TEXT_LIGHT, focus_args = {button = 'y', orientation = 'bm'}, func = 'set_button_pip'}}
37-
}}
38-
}}
39-
function create_UIBox_buttons()
40-
local t = old_buttons()
41-
if not GLOBAL_njy_action then
42-
table.insert(t.nodes, 1, end_button)
43-
end
44-
return t
45-
end
46-
47-
]]
48-
49-
GLOBAL_njy_action = true
50-
5127
G.FUNCS.njy_can_endround = function(e) -- wtf is this talisman check? [[Fixed it! -Math]] ty for fix
5228
if not to_big then
5329
function to_big(x) return x end
@@ -69,6 +45,8 @@ G.FUNCS.njy_attempt_endround = function(e)
6945
end
7046
end
7147

48+
G.FUNCS.njy_endround = true -- apparently handy uses this for detection so... here's the "function" lmao, thankfully it's not used for anything else
49+
7250
SMODS.Atlas({
7351
key = "modicon",
7452
path = "njy_icon.png",

0 commit comments

Comments
 (0)