yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dashboard_panel.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_UI_DASHBOARD_PANEL_H_
2#define YAZE_APP_EDITOR_UI_DASHBOARD_PANEL_H_
3
4#include <functional>
5#include <string>
6#include <vector>
7
8#include "app/editor/editor.h"
10#include "imgui/imgui.h"
11
12namespace yaze {
13namespace editor {
14
15class IEditorSwitcher;
16
18 public:
19 explicit DashboardPanel(IEditorSwitcher* editor_switcher);
20 ~DashboardPanel() = default;
21
22 void Draw();
23
24 void Show() { show_ = true; }
25 void Hide() { show_ = false; }
26 bool IsVisible() const { return show_; }
27 bool* visibility_flag() { return &show_; }
28
30 void LoadRecentEditors();
31 void SaveRecentEditors();
32 void ClearRecentEditors();
33
34 private:
35 struct EditorInfo {
36 std::string name;
37 std::string icon;
38 std::string description;
39 std::string shortcut;
41 bool recently_used = false;
42 bool requires_rom = true;
43 };
44
45 void DrawWelcomeHeader();
46 void DrawRecentEditors();
47 void DrawEditorGrid();
48 void DrawEditorPanel(const EditorInfo& info, int index,
49 const ImVec2& card_size, bool enabled);
50
53 bool show_ = true;
54 bool has_rom_ = false;
55
56 std::vector<EditorInfo> editors_;
57 std::vector<EditorType> recent_editors_;
58 static constexpr size_t kMaxRecentEditors = 5;
59};
60
61} // namespace editor
62} // namespace yaze
63
64#endif // YAZE_APP_EDITOR_UI_DASHBOARD_PANEL_H_
std::vector< EditorInfo > editors_
static constexpr size_t kMaxRecentEditors
std::vector< EditorType > recent_editors_
void MarkRecentlyUsed(EditorType type)
void DrawEditorPanel(const EditorInfo &info, int index, const ImVec2 &card_size, bool enabled)
DashboardPanel(IEditorSwitcher *editor_switcher)
IEditorSwitcher * editor_switcher_
Interface for editor selection and navigation.
Draggable, dockable panel for editor sub-windows.