Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Steamopollys/steamodded
Browse files Browse the repository at this point in the history
  • Loading branch information
Steamo committed Feb 26, 2024
2 parents 8a13ccd + e237bc8 commit d9f8142
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,15 @@ poetry.toml
# LSP config files
pyrightconfig.json

## IntelliJ
/.idea/
/shelf/
/workspace.xml
/httpRequests/
/dataSources/
/dataSources.local.xml

# End of https://www.toptal.com/developers/gitignore/api/python

/injector/steamodded_injector.dist/
/injector/steamodded_injector.exe
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ The code is NOT recompiled after injection. It might change in the future but it
#### Linux

- **CLOSE THE GAME !**
- Make sure you have python3, pip3, MPocate/PLocate, p7zip, nd the python requests library.
- Make sure you have python3, pip3, MPocate/PLocate, 7zip-full, and the python requests library.
- run `git clone https://github.com/Steamopollys/Steamodded.git && cd Steamodded/injector && python3 steamodded_injector.py $(/common/Balatro/Balatro.exe | head -n 1)`
- Wait for it to finish
- And that's it! Balatro is now ready to be Modded.

#### Mac

- **CLOSE THE GAME !**
- Make sure you have python3, pip3, MPocate/PLocate, p7zip and the python requests library.
- Make sure you have python3, pip3, MPocate/PLocate, 7zip-full, and the python requests library.
- run `git clone https://github.com/Steamopollys/Steamodded.git && cd Steamodded/injector && python3 steamodded_injector.py` and drag in the Balatro.exe before hitting enter!
- Wait for it to finish
- And that's it! Balatro is now ready to be Modded.
Expand All @@ -86,11 +86,11 @@ The code is NOT recompiled after injection. It might change in the future but it

All the previous depencies are automaticaly downloaded during the injection.

- [pyinstaller](https://pyinstaller.org/en/stable/) - Used to compile the injector
- [Nuitka](https://pypi.org/project/Nuitka/) - Used to compile the injector

## Contributing

This project is open for contribution. Please, feel free to open a merge requeste to do so.
This project is open for contribution. Please, feel free to open a merge request to do so.

Instruction to compile the injector are provided into is dedicated directory.

Expand Down
12 changes: 11 additions & 1 deletion core/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,11 @@ local function concatAuthors(authors)
return authors or "Unknown"
end

SMODS.customUIElements = {}


function SMODS.registerUIElement(modID, uiElements)
SMODS.customUIElements[modID] = uiElements
end

function create_UIBox_mods(arg_736_0)
local var_495_0 = 0.75 -- Scale factor for text
Expand Down Expand Up @@ -254,6 +257,13 @@ function create_UIBox_mods(arg_736_0)
}
})

local customUI = SMODS.customUIElements[G.ACTIVE_MOD_UI.id]
if customUI then
for _, uiElement in ipairs(customUI) do
table.insert(modNodes, uiElement)
end
end

return {
n = G.UIT.ROOT,
config = {
Expand Down
2 changes: 1 addition & 1 deletion example_mods/UltimateRandom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ end

function SMODS.INIT.UltimateRandomDeck()
local loc_def = {
["name"]="Ultime Random",
["name"]="Ultimate Random",
["text"]={
[1]="Start with a Deck",
[2]="full of",
Expand Down
4 changes: 2 additions & 2 deletions injector/fix build.sh to reflect old locations
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Navigate to the script's directory (optional)
cd "$(dirname "$0")"

# Run PyInstaller
nuitka3 --static-libpython=no --standalone --onefile --include-data-dir=core=../core --include-data-dir=debug=../debug --include-data-dir=loader=../loader steamodded_injector.py
# Run Nuitka
nuitka3 --static-libpython=no --standalone --onefile --include-data-dir=core=../core --include-data-dir=debug=../debug --include-data-dir=loader=../loader steamodded_injector.py
2 changes: 1 addition & 1 deletion injector/steamodded_injector.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def modify_game_lua(game_lua_path):
# Check if the SFX archive path is provided
if len(sys.argv) < 2:
print("Please drag and drop the SFX archive onto this executable.")
seven_zip_dir.name.cleanup()
seven_zip_dir.cleanup()
sys.exit(1)

sfx_archive_path = sys.argv[1]
Expand Down

0 comments on commit d9f8142

Please sign in to comment.