Put Steam's library file beside the game only with co-op on, and look for it off the window's thread.

Every Play ran steamlib.ensure on the Tk thread, co-op on or off. Without the file that walks up to 60,000 folders
of the player's Steam libraries and checks signatures, and the window stood still meanwhile. Play and the Steam
shortcut's start now call it only when co-op is on in the game's settings (steamlib.wanted, read as the game reads
them), and Play runs it on a thread of its own and starts the game from the window's thread when it is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 06:01:44 -05:00
parent 0e76baad36
commit 721da64866
3 changed files with 108 additions and 3 deletions

View File

@@ -197,6 +197,21 @@ def find(steam_folder, signed=signed_by_valve):
return None
def wanted(game_dir):
"""True when co-op is on in the game's settings, read as runtime/cfg.c reads them: NX2NAVI_COOP from the
environment the game inherits first, else nx2navi.ini's coop; empty is the default, off, and any other value but 0
is on (cfg_bool). The launcher puts the library beside the game (ensure) only then: with co-op off the game loads
none, and a Play should not wait for a search of the Steam library. A file that cannot be read counts as off."""
value = os.environ.get('NX2NAVI_COOP')
if value is None:
from . import gameini
try:
value = gameini.get(game_dir, 'coop')
except OSError:
return False
return value not in ('', '0')
_none = set() # game folders for which this run of the launcher found no library: not searched again at each Play