diff options
| author | Pepe20129 <72659707+Pepe20129@users.noreply.github.com> | 2025-10-03 00:45:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-02 15:45:58 -0700 |
| commit | 5cac826f97525a7de8b2d7ef8913d560ca50183e (patch) | |
| tree | f594f8a8f90829ffc03d6eda7a1e2508717f6b2c | |
| parent | 545cc396b4340035ff1b42b68a4b50ef44772d31 (diff) | |
Add a warning for disabled network (#5629)
* Update SohMenu.cpp
* clang
* Prevent warning from appearing in release builds
| -rw-r--r-- | soh/soh/SohGui/SohMenu.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/soh/soh/SohGui/SohMenu.cpp b/soh/soh/SohGui/SohMenu.cpp index d5c2c0c1f..547025391 100644 --- a/soh/soh/SohGui/SohMenu.cpp +++ b/soh/soh/SohGui/SohMenu.cpp @@ -81,14 +81,33 @@ SohMenu::SohMenu(const std::string& consoleVariable, const std::string& name) : Menu(consoleVariable, name, 0, UIWidgets::Colors::LightBlue) { } +#ifndef ENABLE_REMOTE_CONTROL +void SohMenu::AddMenuNetwork() { +#ifndef _DEBUG + // in release builds, the tab doesn't even show + return; +#endif + + // Add Network Menu + AddMenuEntry("Network", CVAR_SETTING("Menu.NetworkSidebarSection")); + + WidgetPath path = { "Network", "Info", SECTION_COLUMN_1 }; + AddSidebarEntry("Network", path.sidebarName, 2); + + AddWidget(path, + ICON_FA_EXCLAMATION_TRIANGLE " The Network features are unavailable because SoH was compiled without " + "network support (\"ENABLE_REMOTE_CONTROL\" build flag).", + WIDGET_TEXT) + .Options(TextOptions().Color(Colors::Orange)); +} +#endif + void SohMenu::InitElement() { Ship::Menu::InitElement(); AddMenuSettings(); AddMenuEnhancements(); AddMenuRandomizer(); -#ifdef ENABLE_REMOTE_CONTROL AddMenuNetwork(); -#endif AddMenuDevTools(); if (CVarGetInteger(CVAR_SETTING("Menu.SidebarSearch"), 0)) { |
