libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
GuiMenuBar.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <memory>
6
7namespace Ship {
8class ConsoleVariable;
9class Window;
21class GuiMenuBar : public GuiElement {
22 public:
30 GuiMenuBar(std::shared_ptr<ConsoleVariable> consoleVariable, std::shared_ptr<Window> window,
31 const std::string& visibilityConsoleVariable, bool isVisible);
32
38 GuiMenuBar(const std::string& visibilityConsoleVariable, bool isVisible);
39
44 GuiMenuBar(const std::string& visibilityConsoleVariable);
45
51 void Draw() override;
52
53 protected:
58 void SetVisibility(bool visible) override;
59
60 void OnInit(const nlohmann::json& initArgs = {}) override;
61
62 private:
64 void SyncVisibilityConsoleVariable();
65 std::string mVisibilityConsoleVariable;
66 std::shared_ptr<ConsoleVariable> mConsoleVariable;
67 std::shared_ptr<Window> mWindow;
68};
69} // namespace Ship
Abstract base class for all visible GUI elements (windows, menu bars, overlays).
Definition GuiElement.h:34
The application's main ImGui menu bar rendered at the top of the screen.
Definition GuiMenuBar.h:21
void SetVisibility(bool visible) override
Overrides SetVisibility to also write the new state to the backing CVar.
void OnInit(const nlohmann::json &initArgs={}) override
Component initialization hook.
GuiMenuBar(const std::string &visibilityConsoleVariable, bool isVisible)
Constructs a GuiMenuBar with an explicit initial visibility.
GuiMenuBar(const std::string &visibilityConsoleVariable)
Constructs a GuiMenuBar whose initial visibility is read from the CVar.
GuiMenuBar(std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< Window > window, const std::string &visibilityConsoleVariable, bool isVisible)
Constructs a GuiMenuBar with constructor-injected dependencies and explicit initial visibility.
void Draw() override
Calls ImGui::BeginMainMenuBar(), invokes DrawElement(), and ends the bar.
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14