mirror of
https://github.com/lutris/lutris
synced 2024-09-04 23:13:35 +00:00
Add heuristics to predict the runner for Lutris service games
Pretty simple; if there's just one platform, and it is Windows or Linux or MS-DOS, we guess 'wine' or 'linux' or 'dosbox'; otherwise we just give up. Sadly most Lutris service games seem to have multiple platforms. Darn you, portability, darn you to heck! We can tweak this to be more opinionated later, if desired.
This commit is contained in:
parent
fc4753464a
commit
d0a45f17bf
|
@ -126,6 +126,23 @@ class LutrisService(OnlineService):
|
||||||
application = Gio.Application.get_default()
|
application = Gio.Application.get_default()
|
||||||
application.show_installer_window(installers)
|
application.show_installer_window(installers)
|
||||||
|
|
||||||
|
def get_installed_runner_name(self, db_game):
|
||||||
|
platforms = self.get_game_platforms(db_game)
|
||||||
|
|
||||||
|
if platforms and len(platforms) == 1:
|
||||||
|
platform = platforms[0].casefold()
|
||||||
|
|
||||||
|
if platform == "windows":
|
||||||
|
return "wine"
|
||||||
|
|
||||||
|
if platform == "linux":
|
||||||
|
return "linux"
|
||||||
|
|
||||||
|
if platform == "ms-dos":
|
||||||
|
return "dosbox"
|
||||||
|
|
||||||
|
return ""
|
||||||
|
|
||||||
def get_game_platforms(self, db_game):
|
def get_game_platforms(self, db_game):
|
||||||
details = db_game.get("details")
|
details = db_game.get("details")
|
||||||
if details:
|
if details:
|
||||||
|
|
Loading…
Reference in a new issue