Skip to content

Commit

Permalink
nevermind, this is the real fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelius7309 committed Dec 23, 2024
1 parent be6910e commit 2a280d5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
20 changes: 20 additions & 0 deletions lovely/fixes.toml
Original file line number Diff line number Diff line change
Expand Up @@ -534,4 +534,24 @@ if effects[ii].h_chips then
update_hand_text({delay = 0}, {chips = hand_chips})
card_eval_status_text(effects[ii].card, 'chips', effects[ii].h_chips, percent)
end
'''

# Fixes Steam API not loading on unix
[[patches]]
[patches.pattern]
target = 'main.lua'
match_indent = true
position = 'after'
pattern = '--To control when steam communication happens, make sure to send updates to steam as little as possible'
payload = '''local cwd = NFS.getWorkingDirectory()
NFS.setWorkingDirectory(love.filesystem.getSourceBaseDirectory())
'''

[[patches]]
[patches.pattern]
target = 'main.lua'
match_indent = true
position = 'before'
pattern = '--Set up the render window and the stage for the splash screen, then enter the gameloop with :update'
payload = '''NFS.setWorkingDirectory(cwd)
'''
5 changes: 3 additions & 2 deletions src/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ NFS = nativefs
-- respects symlink/.. combos
NFS.setWorkingDirectory(lovely_mod_dir)
lovely_mod_dir = NFS.getWorkingDirectory()
-- ! Changing the CWD here causes the Steam API to fail on some UNIX platforms (#345)
-- NFS.setWorkingDirectory(love.filesystem.getSaveDirectory())
-- make sure NFS behaves the same as love.filesystem
NFS.setWorkingDirectory(love.filesystem.getSaveDirectory())

JSON = json

Expand All @@ -33,6 +33,7 @@ local function set_mods_dir()
if lovely_mod_dir:sub(1, #love_dir) == love_dir then
-- relative path from love_dir
SMODS.MODS_DIR = lovely_mod_dir:sub(#love_dir+2)
NFS.setWorkingDirectory(love_dir)
return
end
end
Expand Down
2 changes: 1 addition & 1 deletion version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return "1.0.0~ALPHA-1223a-STEAMODDED"
return "1.0.0~ALPHA-1223b-STEAMODDED"

0 comments on commit 2a280d5

Please sign in to comment.