-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add macOS bundle support + Assets #107
Open
MisutaaAsriel
wants to merge
2
commits into
ethangreen-dev:master
Choose a base branch
from
MisutaaAsriel:macos-bundle
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,15 @@ Lovely is a lua injector which embeds code into a [LÖVE 2d](https://love2d.org/ | |
|
||
### Mac | ||
|
||
#### Bundle Installation (Easy) | ||
1. Download the [latest release](https://github.com/ethangreen-dev/lovely-injector/releases) for Mac. If you have an M-series CPU (M1, M2, etc.) then this will be `lovely-aarch64-apple-darwin-installer.tar.gz`. If you have an Intel CPU then it will be `lovely-x86_64-apple-darwin-installer.tar.gz` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step should explicitly mention the installer variant, not just any one of the mac releases. Some people won't get it otherwise. |
||
2. Open the .zip archive, copy `assets`, `liblovely.dylib` and `install_lovely.sh` into the game directory. You can navigate to the game's directory by right-clicking the game in Steam, hovering "Manage", and selecting "Browse local files". | ||
3. Run `install_lovely.sh`, which will generate an app bundle, `Balatro + Mods.app`, in your user applications directory (`~/Applications`). | ||
4. Put one or more mods into the Mac mod directory (NOT the same as the game directory). This should be `/Users/$USER/Library/Application Support/Balatro/Mods` where `$USER` is your username (if you are modding Balatro).\ | ||
If you can't find this folder, try pressing `Shift-Command-.` (period) to show hidden files in Finder. | ||
5. Open `Balatro + Mods.app`, either directly from `~/Applications`, or from Launchpad, and enjoy. | ||
|
||
#### Classic Installation (Advanced) | ||
1. Download the [latest release](https://github.com/ethangreen-dev/lovely-injector/releases) for Mac. If you have an M-series CPU (M1, M2, etc.) then this will be `lovely-aarch64-apple-darwin.tar.gz`. If you have an Intel CPU then it will be `lovely-x86_64-apple-darwin.tar.gz` | ||
2. Open the .zip archive, copy `liblovely.dylib` and `run_lovely.sh` into the game directory. You can navigate to the game's directory by right-clicking the game in Steam, hovering "Manage", and selecting "Browse local files". | ||
3. Put one or more mods into the Mac mod directory (NOT the same as the game directory). This should be `/Users/$USER/Library/Application Support/Balatro/Mods` where `$USER` is your username (if you are modding Balatro).\ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
gamename="Balatro" | ||
|
||
workingpath=$(cd "$(dirname "$0")"; pwd) | ||
assetpath="${workingpath}/assets/" | ||
|
||
if ! [ -d "${workingpath}/${gamename}.app" ]; then | ||
echo | ||
echo "Balatro not found. Did you place everything in the right directory?" | ||
echo | ||
read -n1 -r -p "Press any key to exit..." key | ||
exit | ||
fi | ||
|
||
gamebundle="${workingpath}/${gamename}.app" | ||
|
||
bundlepath="/Users/$USER/Applications/${gamename} + Mods.app" | ||
contentpath="${bundlepath}/Contents" | ||
|
||
echo | ||
echo "Generating bundle..." | ||
mkdir -p "${contentpath}" | ||
cd "${contentpath}" | ||
mkdir MacOS | ||
mkdir Resources | ||
|
||
echo | ||
echo "Copying assets..." | ||
ln -s "${gamebundle}" ./MacOS/ | ||
mv "${assetpath}/run_lovely.sh" ./MacOS/run_lovely | ||
mv "${assetpath}/info.plist" ./ | ||
mv "${workingpath}/liblovely.dylib" ./MacOS/ | ||
mv "${assetpath}/application.icns" ./Resources/ | ||
|
||
chmod +x ./MacOS/run_lovely | ||
echo "Signing application..." | ||
codesign -s - --deep "${bundlepath}/Contents/MacOS/run_lovely" | ||
|
||
echo | ||
echo "Cleaning up..." | ||
rm "${workingpath}/install_lovely.sh" | ||
rm -rf "${workingpath}/assets" | ||
|
||
echo | ||
read -n1 -r -p "Installation complete! Press any key to exit..." key | ||
open /Users/$USER/Applications | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleExecutable</key> | ||
<string>run_lovely</string> | ||
<key>CFBundleIconFile</key> | ||
<string>application.icns</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.Balatro.localthunk.modded</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>Balatro</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>LoVe</string> | ||
<key>LSApplicationCategoryType</key> | ||
<string>public.app-category.games</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>10.7</string> | ||
<key>NSHighResolutionCapable</key> | ||
<true/> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>© 2024 LocalThunk Inc.</string> | ||
<key>NSPrincipalClass</key> | ||
<string>NSApplication</string> | ||
<key>NSSupportsAutomaticGraphicsSwitching</key> | ||
<false/> | ||
</dict> | ||
</plist> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
gamename="Balatro" | ||
workingpath=$(cd "$(dirname "$0")"; pwd) | ||
|
||
export DYLD_INSERT_LIBRARIES=liblovely.dylib | ||
|
||
cd "${workingpath}" | ||
./$gamename.app/Contents/MacOS/love "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe renaming these to "Mac Installer" would be more attention-grabbing? Furthermore should these be reordered to make the mac installers come first?