Giter VIP home page Giter VIP logo

Comments (3)

daniel-j avatar daniel-j commented on May 30, 2024 1

But the prefix id is something the Steam client generates for a shortcut. It's not the same every time/for everyone.

from protonfixes.

pchome avatar pchome commented on May 30, 2024

I tried to use a few non-steam games w/ protonfixes a while ago using following hack:

diff --git a/protonfixes/fix.py b/protonfixes/fix.py
index b026a31..30a4036 100755
--- a/protonfixes/fix.py
+++ b/protonfixes/fix.py
@@ -18,9 +18,12 @@ def game_id():
     """ Trys to return the game id from environment variables
     """
 
-    if 'SteamAppId' in os.environ:
+    # For non-steam games we only care about pfx and gamefix ids match
+    is_nonsteam = 'SteamAppId' in os.environ and os.environ['SteamAppId'] == '0'
+
+    if 'SteamAppId' in os.environ and not is_nonsteam:
         return os.environ['SteamAppId']
-    if 'SteamGameId' in os.environ:
+    if 'SteamGameId' in os.environ and not is_nonsteam:
         return os.environ['SteamGameId']
     if 'STEAM_COMPAT_DATA_PATH' in os.environ:
         return re.findall(r'\d+', os.environ['STEAM_COMPAT_DATA_PATH'])[-1]

It will use pfx ID for non-steam game, e.g. if you have .../compatdata/1234567890/ prefix, then the fix name should be 1234567890.py.

from protonfixes.

pchome avatar pchome commented on May 30, 2024

Well, I don't know how this IDs generated, I didn't dig a lot. But for two non-Steam games they was the same across sessions for the same user. So I decided to use them, because this matches protonfixes behaviour for Steam games.

If you want existing gamefix for your non-Steam game -- just symlink it to your localfixes directory.
Or try to add something like

if 'PROTONFIXES_GAME' in os.environ:
   return os.environ['PROTONFIXES_GAME']
...

on top of this code block. Then use PROTONFIXES_GAME=12345 %command%. I doubt you want something like PROTONFIXES_GAME="Guacamelee! Super Turbo Championship Edition" %command%

from protonfixes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.