mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
fix(proton-run): follow a removed DroidDeck-Proton build to the newest one (#2223)
Battle.net, store games and desktop programs start through droiddeck-proton-run without the Steam client. When the Proton auto-update replaced the DroidDeck-Proton build that Steam's default or a title's mapping named, the name no longer matched an installed tool and the run fell back to Valve's Proton Experimental ARM64, which lacks DroidDeck-Proton's patches. World of Warcraft then hung at launch. A removed DroidDeck-Proton build now resolves to the newest installed one, the same successor steam-compatibility moves Steam's mappings to.
This commit is contained in:
1 parent
4cb3a89483
commit
d5f3d1a0d5
2 files changed
+31
-2
No files matched your search
@@ -98,13 +98,25 @@ def state_default():
|
||||
return None
|
||||
|
||||
|
||||
def newest_own(available):
|
||||
c = compat()
|
||||
builds = c["own_builds"]([{"name": name, "dir": os.path.basename(folder)} for name, (folder, _) in available.items()])
|
||||
return max(builds, key=lambda t: (c["build_key"](t["dir"]), t["dir"]))["name"] if builds else None
|
||||
|
||||
|
||||
def choose_tool(appid, current, available):
|
||||
c = compat()
|
||||
newest = newest_own(available)
|
||||
for key, why in ((appid, "Steam's choice for this title"), ("0", "Steam's default")):
|
||||
name = current.get(key)
|
||||
if name in available:
|
||||
return name, why
|
||||
c = compat()
|
||||
for name in (state_default(), c["TOOL"], c["TOOL_11"]):
|
||||
if newest and isinstance(name, str) and name.startswith(c["OWN_PROTON"]):
|
||||
return newest, "%s, replacing the removed %s" % (why, name)
|
||||
default = state_default()
|
||||
if newest and isinstance(default, str) and default.startswith(c["OWN_PROTON"]) and default not in available:
|
||||
return newest, "the default, replacing the removed %s" % default
|
||||
for name in (default, c["TOOL"], c["TOOL_11"]):
|
||||
if name in available:
|
||||
return name, "the default ARM64 Proton"
|
||||
return (sorted(available)[0], "the only one installed") if available else (None, None)
|
||||
|
||||
Reference in new issue
Block a user