Skip to content

Commit

Permalink
Merge pull request #10 from SBence/master
Browse files Browse the repository at this point in the history
Add new patches, hide in-game CRT filter settings in no-crt
  • Loading branch information
antipatico authored May 21, 2024
2 parents 78565ee + ff0e2cb commit a8c0455
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 5 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ Name Platforms Description
---------------- ----------- ----------------------------------------------------------------------------------------------- ---------------------------
basic android Basic set of patches needed to make the game run on mobile blake502,TheCatRiX,PGgamer2
external-storage android Save game files under /sdcard/Android [Works well for Android < 13] blake502
fix-beta-langs android,ios Make beta langs selectable on mobile SBence,antipatico
fps android,ios Cap the FPS limit to the FPS limit of the screen PGgamer2
landscape android,ios Forces the game to always stay in landscape mode, ignoring the screeen orentation of the device blake502
landscape-hidpi ios Forces the game to always stay in landscape mode and apply hidpi fix for iOS blake502
max-volume android,ios Set master volume to 100 by default SBence
no-background android,ios Disable background animations and effects. From PortMaster nkahoang,rancossack
no-crt android,ios Disable CRT effect [Fixes blackscreen bug on Pixels and other devices] blake502
no-crt android,ios Disable CRT effect [Fixes blackscreen bug on Pixels and other devices] blake502,SBence
nunito-font android,ios Replace the main font used with nunito, optimized for smaller displays. From PortMaster nkahoang,rancossack
shaders-flames android,ios Fix the flames shaders for mobile PGgamer2
simple-fx android,ios Disable gameplay visible behind menu background, shadows, and bloom effects. From PortMaster nkahoang,rancossack
Expand Down Expand Up @@ -88,7 +90,8 @@ options:
--output OUTPUT, -o OUTPUT
Output path for apk (default: balatro-GAME_VERSION.apk)
--patches PATCHES, -p PATCHES
Comma-separated list of patches to apply (default: basic,landscape,no-crt,fps,external-storage,shaders-flames)
Comma-separated list of patches to apply (default: basic,landscape,no-crt,fps,external-storage,shaders-flames,fix-beta-langs,
max-volume)
--skip-sign, -s Skip signing the apk file with Uber Apk Signer (default: False)
--display-name DISPLAY_NAME
Change application display name (default: Balatro Mobile (unofficial))
Expand Down
2 changes: 1 addition & 1 deletion balatromobile/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__="0.4.0"
__version__="0.5.0"
2 changes: 1 addition & 1 deletion balatromobile/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path
from .resources import get_patch, get_artifact, list_patches

DEFAULT_PATCHES = "basic,landscape,no-crt,fps,external-storage,shaders-flames"
DEFAULT_PATCHES = "basic,landscape,no-crt,fps,external-storage,shaders-flames,fix-beta-langs,max-volume"


class Patch:
Expand Down
22 changes: 22 additions & 0 deletions balatromobile/patches/fix-beta-langs.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
description = "Make beta langs selectable on mobile"
authors = ["SBence", "antipatico"]
supported_platforms = ["android", "ios"]

[[patch_lists]]
version = 0
# supported_game_versions = all NOT TESTED

[[patch_lists.patch_files]]
target_file = "functions/button_callbacks.lua"
[[patch_lists.patch_files.patches]]
search_string = "if (_infotip_object.config.set ~= e.config.ref_table.label) and (not G.F_NO_ACHIEVEMENTS) then"
patch_content = "if (_infotip_object.config.set ~= e.config.ref_table.label) then"

### Alternative patch (removes alert):

# target_file = "functions/UI_definitions.lua"
# [[patch_lists.patch_files.patches]]
# search_string = """_row[#_row+1] = {n=G.UIT.C, config={align = "cm", func = 'beta_lang_alert', padding = 0.05, r = 0.1, minh = 0.7, minw = 4.5, button = v.beta and 'warn_lang' or 'change_lang', ref_table = v, colour = v.beta and G.C.RED or G.C.BLUE, hover = true, shadow = true, focus_args = {snap_to = (k == 1)}}, nodes={"""
# patch_content = """
# _row[#_row+1] = {n=G.UIT.C, config={align = "cm", func = 'beta_lang_alert', padding = 0.05, r = 0.1, minh = 0.7, minw = 4.5, button = 'change_lang', ref_table = v, colour = v.beta and G.C.RED or G.C.BLUE, hover = true, shadow = true, focus_args = {snap_to = (k == 1)}}, nodes={
# """
14 changes: 14 additions & 0 deletions balatromobile/patches/max-volume.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description = "Set master volume to 100 by default"
authors = ["SBence"]
supported_platforms = ["android", "ios"]

[[patch_lists]]
version = 0
# supported_game_versions = ALL
[[patch_lists.patch_files]]
target_file = "globals.lua"
[[patch_lists.patch_files.patches]]
search_string = "volume = 50"
patch_content = """
volume = 100,
"""
14 changes: 13 additions & 1 deletion balatromobile/patches/no-crt.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description = "Disable CRT effect [Fixes blackscreen bug on Pixels and other devices]"
authors = ["blake502"]
authors = ["blake502", "SBence"]
supported_platforms = ["android", "ios"]

[[patch_lists]]
Expand All @@ -16,4 +16,16 @@ supported_platforms = ["android", "ios"]
target_file = "game.lua"
[[patch_lists.patch_files.patches]]
search_string = "G.SHADERS['CRT'])"
# patch_content = ""

[[patch_lists.patch_files]]
target_file = "functions/UI_definitions.lua"
[[patch_lists.patch_files.patches]]
search_string = "create_slider({label = localize('b_set_CRT'),w = 4, h = 0.4, ref_table = G.SETTINGS.GRAPHICS, ref_value = 'crt', min = 0, max = 100})"
# patch_content = ""

[[patch_lists.patch_files]]
target_file = "functions/UI_definitions.lua"
[[patch_lists.patch_files.patches]]
search_string = "create_option_cycle({w = 4,scale = 0.8, label = localize(\"b_set_CRT_bloom\"),options = localize('ml_bloom_opt'), opt_callback = 'change_crt_bloom', current_option = G.SETTINGS.GRAPHICS.bloom})"
# patch_content = ""

0 comments on commit a8c0455

Please sign in to comment.