simons-public / protonfixes

A module for applying fixes at runtime to unsupported games with Steam Proton without changing game installation files
https://simons-public.github.io/protonfixes/
Other
233 stars 114 forks source link

Added engine.py module #89

Closed pchome closed 4 years ago

pchome commented 4 years ago

Very basic, barely tested, written in mc and not checked by ... TRAVIS! :rage4: API implementation.

Should be useful w/ previous PR, for things like -pf_nointro and/or -pf_windowed.

from protonfixes.engine import engine
engine.windowed()

Just a rough attempt to detect game engine and use it's command line parameters to force windowed mode (thanks to recently broken Wine virtual desktop).

Mostly tested on Unity 5 game engine.

simons-public commented 4 years ago

I did some linting, but didn't have too much time to look over it to make sure the linting didn't break anything. Can you check and make sure it still works with your setup?

pchome commented 4 years ago

Can you check and make sure it still works with your setup?

Sure, I switched to master branch and going to test it for a while. Works for "known" engine (Unity), I'll check some different games later.

Patch example, for those wanted to try immediately:

--- a/protonfixes/gamefixes/default.py
+++ b/protonfixes/gamefixes/default.py
@@ -3,6 +3,7 @@

 import sys
 from protonfixes import util
+from protonfixes.engine import engine

 def main():
     """ global defaults
@@ -20,6 +21,10 @@ def main():
                 util.winecfg()
             elif pf_alias == '-pf_regedit':
                 util.regedit()
+            elif pf_alias == '-pf_nointro':
+                engine.nointro()
+            elif pf_alias == '-pf_windowed':
+                engine.windowed()
             elif pf_alias.split('=')[0] == '-pf_tricks':
                 param = str(pf_alias.replace('-pf_tricks=', ''))
                 util.protontricks(param)