From 82b8dca0cdbb666055413a2338a2ca3af8a17f55 Mon Sep 17 00:00:00 2001 From: Etherealxx <64251396+etherealxx@users.noreply.github.com> Date: Wed, 26 Feb 2025 11:11:31 +0700 Subject: [PATCH] Fix "Go Online" button shows up on dev builds Previously, the "Go Online" button shows up on dev builds, in which when clicked, will notify the user that official export templates aren't available for dev builds. As per Calinou's suggestion, this commit fix the issue by not showing the button on dev builds (that was built without setting up GODOT_VERSION_STATUS environment variable). This commit also remove unused lines on the header file as per AThousandShips's review. --- editor/export/export_template_manager.cpp | 7 ++++--- editor/export/export_template_manager.h | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/export/export_template_manager.cpp b/editor/export/export_template_manager.cpp index 12869b1f891..a8ea9495961 100644 --- a/editor/export/export_template_manager.cpp +++ b/editor/export/export_template_manager.cpp @@ -57,9 +57,6 @@ enum DownloadsAvailability { static DownloadsAvailability _get_downloads_availability() { const int network_mode = EDITOR_GET("network/connection/network_mode"); - if (network_mode == EditorSettings::NETWORK_OFFLINE) { - return DOWNLOADS_NOT_AVAILABLE_IN_OFFLINE_MODE; - } // Downloadable export templates are only available for stable and official alpha/beta/RC builds // (which always have a number following their status, e.g. "alpha1"). @@ -72,6 +69,10 @@ static DownloadsAvailability _get_downloads_availability() { return DOWNLOADS_NOT_AVAILABLE_FOR_DEV_BUILDS; } + if (network_mode == EditorSettings::NETWORK_OFFLINE) { + return DOWNLOADS_NOT_AVAILABLE_IN_OFFLINE_MODE; + } + return DOWNLOADS_AVAILABLE; } diff --git a/editor/export/export_template_manager.h b/editor/export/export_template_manager.h index 5939c68fdfc..a6e103dc137 100644 --- a/editor/export/export_template_manager.h +++ b/editor/export/export_template_manager.h @@ -37,7 +37,6 @@ class EditorExportPreset; class ExportTemplateVersion; class FileDialog; class HTTPRequest; -class LinkButton; class MenuButton; class OptionButton; class ProgressBar;