Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions mm/2s2h/BenGui/BenGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "Enhancements/Trackers/TimeSplits/TimesplitsSettings.h"
#include "BenMenu.h"
#include "BenMenuBar.h"
#include "QuickStart.h"
#include "DeveloperTools/HookDebugger.h"
#include "DeveloperTools/SaveEditor.h"
#include "DeveloperTools/ActorViewer.h"
Expand Down Expand Up @@ -61,6 +62,7 @@ std::shared_ptr<DisplayOverlayWindow> mDisplayOverlayWindow;
std::shared_ptr<TimesplitsWindow> mTimesplitsWindow;
std::shared_ptr<TimesplitsSettingsWindow> mTimesplitsSettingsWindow;
std::shared_ptr<BenModalWindow> mModalWindow;
std::shared_ptr<Ship::QuickStart> mQuickStartMenu;

UIWidgets::Colors GetMenuThemeColor() {
return mBenMenu->GetMenuThemeColor();
Expand All @@ -75,13 +77,12 @@ void SetupGuiElements() {
style.Colors[ImGuiCol_MenuBarBg] = UIWidgets::ColorValues.at(UIWidgets::Colors::DarkGray);

mBenMenuBar = std::make_shared<BenMenuBar>(CVAR_MENU_BAR_OPEN, CVarGetInteger(CVAR_MENU_BAR_OPEN, 0));
gui->SetMenuBar(std::reinterpret_pointer_cast<Ship::GuiMenuBar>(mBenMenuBar));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're replacing the menu bar entirely, then we should scrub mBenMenuBar here.


if (!gui->GetMenuBar() && !CVarGetInteger("gSettings.DisableMenuShortcutNotify", 0)) {
#if defined(__SWITCH__) || defined(__WIIU__)
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press - to access enhancements menu");
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press - to access the Quick Start menu");
#else
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press F1 to access enhancements menu");
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press F1 to access the Quick Start menu");
#endif
}

Expand Down Expand Up @@ -164,9 +165,8 @@ void SetupGuiElements() {
"gWindows.CheckTrackerSettings", "Check Tracker Settings");
gui->AddGuiWindow(mRandoCheckTrackerSettingsWindow);

mModalWindow = std::make_shared<BenModalWindow>("gWindows.ModalWindow", "Modal Window");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to completely remove the modal window?

gui->AddGuiWindow(mModalWindow);
mModalWindow->Show();
mQuickStartMenu = std::make_shared<Ship::QuickStart>("gWindows.QuickStart", "QuickStart Menu");
gui->AddGuiWindow(mQuickStartMenu);
}

void Destroy() {
Expand Down Expand Up @@ -194,6 +194,7 @@ void Destroy() {
mAudioEditorWindow = nullptr;
mItemTrackerWindow = nullptr;
mItemTrackerSettingsWindow = nullptr;
mQuickStartMenu = nullptr;
}

void RegisterPopup(std::string title, std::string message, std::string button1, std::string button2,
Expand Down
9 changes: 3 additions & 6 deletions mm/2s2h/BenGui/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,18 +594,15 @@ void Menu::DrawElement() {
ImVec2 pos = window->DC.CursorPos;
float centerX = pos.x + windowWidth / 2 - (style.ItemSpacing.x * (menuEntries.size() + 1));
std::vector<ImVec2> headerSizes;
float headerWidth = style.ItemSpacing.x;
float headerWidth = 0.0f;
bool headerSearch = !CVarGetInteger("gSettings.Menu.SidebarSearch", 0);
if (headerSearch) {
headerWidth += 200.0f + style.ItemSpacing.x + style.FramePadding.x;
headerWidth += 200.0f;
}
for (auto& label : menuOrder) {
ImVec2 size = ImGui::CalcTextSize(label.c_str());
headerSizes.push_back(size);
headerWidth += size.x + style.FramePadding.x * 2;
if (label == headerIndex) {
headerWidth += style.ItemSpacing.x;
}
headerWidth += size.x + style.FramePadding.x * 2 + style.ItemSpacing.x;
}
// Full screen menu with widths below 1280, heights below 800.
// 5% of screen width/height padding on both sides above those resolutions.
Expand Down
Loading