diff --git a/lovely/fixes.toml b/lovely/fixes.toml index 4b8b68a4..d8f7df9a 100644 --- a/lovely/fixes.toml +++ b/lovely/fixes.toml @@ -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) ''' \ No newline at end of file diff --git a/src/core.lua b/src/core.lua index e7d66760..f9961fae 100644 --- a/src/core.lua +++ b/src/core.lua @@ -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 @@ -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 diff --git a/version.lua b/version.lua index fcda970c..52bb18be 100644 --- a/version.lua +++ b/version.lua @@ -1 +1 @@ -return "1.0.0~ALPHA-1223a-STEAMODDED" +return "1.0.0~ALPHA-1223b-STEAMODDED"