From c2790f5c2f67210c4e1d92756d2beb3fe7f9ce5c Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 21 Feb 2023 18:26:53 +0100 Subject: [PATCH] Added a dummy entry for prerelease update checks if running a prerelease. --- es-app/src/guis/GuiMenu.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index c68b615c9..855f787d6 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -41,7 +41,8 @@ #include GuiMenu::GuiMenu() - : mMenu {"MAIN MENU"} + : mRenderer {Renderer::getInstance()} + , mMenu {"MAIN MENU"} { bool isFullUI {UIModeController::getInstance()->isUIModeFull()}; @@ -74,8 +75,8 @@ GuiMenu::GuiMenu() addChild(&mMenu); addVersionInfo(); setSize(mMenu.getSize()); - setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f, - std::round(Renderer::getScreenHeight() * 0.13f)); + setPosition((mRenderer->getScreenWidth() - mSize.x) / 2.0f, + std::round(mRenderer->getScreenHeight() * 0.13f)); } GuiMenu::~GuiMenu() @@ -1193,7 +1194,7 @@ void GuiMenu::openConfigInput(GuiSettings* settings) settings->setNeedsSaving(false); std::string message; - if (Renderer::getIsVerticalOrientation()) { + if (mRenderer->getIsVerticalOrientation()) { message = "THE KEYBOARD AND CONTROLLERS ARE\n" "AUTOMATICALLY CONFIGURED, BUT USING\n" "THIS CONFIGURATION TOOL YOU CAN\n" @@ -1434,7 +1435,18 @@ void GuiMenu::openOtherOptions() }); #endif -#if defined(APPLICATION_UPDATER) && !defined(IS_PRERELEASE) +#if defined(APPLICATION_UPDATER) +#if defined(IS_PRERELEASE) + // Add a dummy entry to indicate that this setting is always enabled when running a prerelease. + auto applicationUpdaterPrereleases = std::make_shared(); + applicationUpdaterPrereleases->setState(true); + s->addWithLabel("INCLUDE PRERELEASES IN UPDATE CHECKS", applicationUpdaterPrereleases); + applicationUpdaterPrereleases->setEnabled(false); + applicationUpdaterPrereleases->setOpacity(DISABLED_OPACITY); + applicationUpdaterPrereleases->getParent() + ->getChild(applicationUpdaterPrereleases->getChildIndex() - 1) + ->setOpacity(DISABLED_OPACITY); +#else // Whether to include prereleases when checking for application updates. auto applicationUpdaterPrereleases = std::make_shared(); applicationUpdaterPrereleases->setState( @@ -1449,6 +1461,7 @@ void GuiMenu::openOtherOptions() } }); #endif +#endif #if defined(_WIN64) // Hide taskbar during the program session.