mirror of
https://github.com/lutris/lutris
synced 2024-10-14 11:42:36 +00:00
Add a GAME_DIRECTORY environment variable for the use of pre-launch and post-exit scripts. Re-comment a little bit to explain who would use this (and 'game_name').
This commit is contained in:
parent
56ebf85177
commit
310ec685b7
|
@ -666,15 +666,20 @@ class Game(GObject.Object):
|
||||||
This method sets the game_runtime_config attribute.
|
This method sets the game_runtime_config attribute.
|
||||||
"""
|
"""
|
||||||
gameplay_info = self.get_gameplay_info(launch_ui_delegate)
|
gameplay_info = self.get_gameplay_info(launch_ui_delegate)
|
||||||
if not gameplay_info: # if user cancelled- not an error
|
if not gameplay_info: # if user cancelled - not an error
|
||||||
return False
|
return False
|
||||||
command, env = get_launch_parameters(self.runner, gameplay_info)
|
command, env = get_launch_parameters(self.runner, gameplay_info)
|
||||||
|
|
||||||
if env.get("WINEARCH") == "win32" and "umu" in " ".join(command):
|
if env.get("WINEARCH") == "win32" and "umu" in " ".join(command):
|
||||||
raise RuntimeError("Proton is not compatible with 32bit prefixes")
|
raise RuntimeError("Proton is not compatible with 32bit prefixes")
|
||||||
env["game_name"] = self.name # What is this used for??
|
|
||||||
env["GAMEID"] = proton.get_game_id(self)
|
env["GAMEID"] = proton.get_game_id(self)
|
||||||
env["STORE"] = self.get_store_name()
|
env["STORE"] = self.get_store_name()
|
||||||
|
|
||||||
|
# Some environment variables for the use of custom pre-launch and post-exit scripts.
|
||||||
|
env["game_name"] = self.name
|
||||||
|
if self.directory:
|
||||||
|
env["GAME_DIRECTORY"] = self.directory
|
||||||
|
|
||||||
self.game_runtime_config = {
|
self.game_runtime_config = {
|
||||||
"args": command,
|
"args": command,
|
||||||
"env": env,
|
"env": env,
|
||||||
|
|
Loading…
Reference in a new issue