Directly return version if using latest GE-Proton

This commit is contained in:
Mathieu Comandon 2024-03-10 15:50:44 -07:00
parent 07f117a379
commit 355165433c
2 changed files with 8 additions and 3 deletions

View file

@ -736,7 +736,8 @@ class wine(Runner):
"""
if version is None:
version = self.read_version_from_config()
if version == proton.GE_PROTON_LATEST:
return version
wine_path = self.get_path_for_version(version)
if system.path_exists(wine_path):
return wine_path

View file

@ -1,12 +1,16 @@
"""Utility module to deal with Proton and ULWGL"""
import json
import os
from gettext import gettext as _
from typing import Generator, List
from lutris import settings
from lutris.util import system
from lutris.util.steam.config import get_steamapps_dirs
GE_PROTON_LATEST = _("GE-Proton (Latest)")
def is_proton_path(wine_path):
return "Proton" in wine_path and "lutris" not in wine_path
@ -65,7 +69,7 @@ def list_proton_versions() -> List[str]:
ulwgl_path = get_ulwgl_path()
if not ulwgl_path:
return []
versions = ["GE-Proton (Latest)"]
versions = [GE_PROTON_LATEST]
for proton_path in get_proton_paths():
for version in [p for p in os.listdir(proton_path) if "Proton" in p]:
path = os.path.join(proton_path, version, "dist/bin/wine")
@ -93,7 +97,7 @@ def get_proton_path_from_bin(wine_path):
def get_game_id(game):
default_id = "ULWGL-default"
default_id = "ulwgl-default"
games_path = os.path.join(settings.RUNTIME_DIR, "ulwgl-games/ulwgl-games.json")
if not os.path.exists(games_path):
return default_id