Only show Editor if Advanced Settings is enabled

This commit is contained in:
MelonSpeedruns
2026-05-07 12:39:37 -04:00
parent 667cf70fa0
commit d15ed81cd5
4 changed files with 13 additions and 1 deletions
+5 -1
View File
@@ -50,7 +50,11 @@ MenuBar::MenuBar() : Document(kDocumentSource), mRoot(mDocument->GetElementById(
// mTabBar->add_tab("Warp", [] {
// // TODO
// });
mTabBar->add_tab("Editor", [this] { push(std::make_unique<EditorWindow>()); });
if (getSettings().backend.enableAdvancedSettings) {
mTabBar->add_tab("Editor", [this] { push(std::make_unique<EditorWindow>()); });
}
mTabBar->add_tab("Achievements", [this] { push(std::make_unique<AchievementsWindow>()); });
mTabBar->add_tab("Reset", [this] {
mTabBar->set_active_tab(-1);
+2
View File
@@ -14,6 +14,7 @@
#include "pane.hpp"
#include "prelaunch.hpp"
#include "ui.hpp"
#include "menu_bar.hpp"
#include <algorithm>
@@ -871,6 +872,7 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
{
.key = "Enable Advanced Settings",
.helpText = "Show the advanced settings on the menu bar.<br/>Most users should have this disabled.",
.onChange = [](bool value) { get_document_stack()[0] = std::make_unique<MenuBar>(); },
});
});
}
+4
View File
@@ -363,6 +363,10 @@ void push_toast(Toast toast) noexcept {
sToasts.push_back(std::move(toast));
}
std::vector<std::unique_ptr<Document> >& get_document_stack() noexcept {
return sDocumentStack;
}
std::deque<Toast>& get_toasts() noexcept {
return sToasts;
}
+2
View File
@@ -82,6 +82,8 @@ Rml::Element* append(Rml::Element* parent, const Rml::String& tag) noexcept;
NavCommand map_nav_event(const Rml::Event& event) noexcept;
Insets safe_area_insets(Rml::Context* context) noexcept;
std::vector<std::unique_ptr<Document> >& get_document_stack() noexcept;
void push_toast(Toast toast) noexcept;
std::deque<Toast>& get_toasts() noexcept;
void show_menu_notification() noexcept;