From d6bf63886e47627944e48fc6826384fc8659b09b Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Fri, 10 Jul 2026 17:30:23 +0900 Subject: [PATCH] feat: warn if background downloads are disabled --- dzgui/api/steam.py | 3 --- dzgui/managers/connection.py | 16 +++++++++++++++- dzgui/views/pages/preconnect.py | 9 +++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/dzgui/api/steam.py b/dzgui/api/steam.py index 002dcce..060e552 100644 --- a/dzgui/api/steam.py +++ b/dzgui/api/steam.py @@ -305,8 +305,6 @@ def _get_running_app() -> int | None: return None -# TODO: write tests -# TODO: consider moving to proc module def get_running_app() -> int | None: PROC_NAME = "steam" SUBPROC_NAME = "reaper" @@ -329,7 +327,6 @@ def get_running_app() -> int | None: return None -# TODO: write tests def get_app_allows_downloads(path: Path, appid: int) -> bool: root_path = get_app_path(path, appid) acf = root_path.joinpath(f"steamapps/appmanifest_{appid}.acf") diff --git a/dzgui/managers/connection.py b/dzgui/managers/connection.py index 95ab69d..896969f 100644 --- a/dzgui/managers/connection.py +++ b/dzgui/managers/connection.py @@ -12,8 +12,11 @@ import dzgui.api.servers as Servers from dzgui.api.steam import ( connect, - get_remote_signatures, + get_app_allows_downloads, + get_app_name, get_needs_update, + get_remote_signatures, + get_running_app, load_to_menu, subscribe, ) @@ -82,6 +85,7 @@ class Prerequisites: mods: list[list[str]] game_mode: bool is_last_server: bool + allows_downloads: tuple[bool, str] class ConnectionManager: @@ -167,6 +171,15 @@ class ConnectionManager: dayz_running = is_dayz_running() + running_app = get_running_app() + if running_app is not None: + allows_dl = get_app_allows_downloads(steam_path, running_app) + running_app_name = get_app_name(running_app) + allows_downloads = (allows_dl, running_app_name) + else: + allows_downloads = (True, "") + + client_name = self.controller.get_steam_client_name() client = self.controller.query_config(Preferences.CLIENT) running = is_steam_running(client) @@ -192,6 +205,7 @@ class ConnectionManager: mods=remote_mods, game_mode=game_mode, is_last_server=is_last, + allows_downloads=allows_downloads, ) func = StoredFunc(self.controller.open_connection_assistant, prereqs) diff --git a/dzgui/views/pages/preconnect.py b/dzgui/views/pages/preconnect.py index 463228d..88499db 100644 --- a/dzgui/views/pages/preconnect.py +++ b/dzgui/views/pages/preconnect.py @@ -272,6 +272,15 @@ class PreConnectionAssistant(Gtk.Box): "It looks like DayZ is already running in the background. Exit DayZ before connecting." ) + allows_dl, running_app = prereqs.allows_downloads + if allows_dl is False: + msg = ( + f"The game '{running_app}' is currently running in Steam, but background downloads are not enabled.\n" + "Either stop the game first, or update your global Steam settings or the game's local settings.\n" + "Otherwise, mods may be queued for download but never update." + ) + warnings.append(msg) + self.add_warnings(warnings) self.add_errors(errors)