yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
popup_manager.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_EDITOR_POPUP_MANAGER_H
2
#define YAZE_APP_EDITOR_POPUP_MANAGER_H
3
4
#include <functional>
5
#include <string>
6
#include <unordered_map>
7
8
#include "absl/status/status.h"
9
10
namespace
yaze
{
11
namespace
editor {
12
13
// Forward declaration
14
class
EditorManager;
15
16
struct
PopupParams
{
17
std::string
name
;
18
bool
is_visible
=
false
;
19
std::function<void()>
draw_function
;
20
};
21
22
// ImGui popup manager.
23
class
PopupManager
{
24
public
:
25
PopupManager
(
EditorManager
* editor_manager);
26
27
// Initialize popups
28
void
Initialize
();
29
30
// Draw all popups
31
void
DrawPopups
();
32
33
// Show a specific popup
34
void
Show
(
const
char
* name);
35
36
// Hide a specific popup
37
void
Hide
(
const
char
* name);
38
39
// Check if a popup is visible
40
bool
IsVisible
(
const
char
* name)
const
;
41
42
// Set the status for status popup
43
void
SetStatus
(
const
absl::Status& status);
44
45
// Get the current status
46
absl::Status
GetStatus
()
const
{
return
status_
; }
47
48
private
:
49
// Helper function to begin a centered popup
50
bool
BeginCentered
(
const
char
* name);
51
52
// Draw the about popup
53
void
DrawAboutPopup
();
54
55
// Draw the ROM info popup
56
void
DrawRomInfoPopup
();
57
58
// Draw the status popup
59
void
DrawStatusPopup
();
60
61
// Draw the save as popup
62
void
DrawSaveAsPopup
();
63
64
// Draw the new project popup
65
void
DrawNewProjectPopup
();
66
67
// Draw the supported features popup
68
void
DrawSupportedFeaturesPopup
();
69
70
// Draw the open ROM help popup
71
void
DrawOpenRomHelpPopup
();
72
73
// Draw the manage project popup
74
void
DrawManageProjectPopup
();
75
76
// v0.3 Help Documentation popups
77
void
DrawGettingStartedPopup
();
78
void
DrawAsarIntegrationPopup
();
79
void
DrawBuildInstructionsPopup
();
80
void
DrawCLIUsagePopup
();
81
void
DrawTroubleshootingPopup
();
82
void
DrawContributingPopup
();
83
void
DrawWhatsNewPopup
();
84
85
// Workspace-related popups
86
void
DrawWorkspaceHelpPopup
();
87
void
DrawSessionLimitWarningPopup
();
88
void
DrawLayoutResetConfirmPopup
();
89
90
// Settings popups (accessible without ROM)
91
void
DrawDisplaySettingsPopup
();
92
93
EditorManager
*
editor_manager_
;
94
std::unordered_map<std::string, PopupParams>
popups_
;
95
absl::Status
status_
;
96
bool
show_status_
=
false
;
97
absl::Status
prev_status_
;
98
};
99
100
}
// namespace editor
101
}
// namespace yaze
102
103
#endif
// YAZE_APP_EDITOR_POPUP_MANAGER_H
yaze::editor::EditorManager
The EditorManager controls the main editor window and manages the various editor classes.
Definition
editor_manager.h:109
yaze::editor::PopupManager
Definition
popup_manager.h:23
yaze::editor::PopupManager::DrawBuildInstructionsPopup
void DrawBuildInstructionsPopup()
Definition
popup_manager.cc:327
yaze::editor::PopupManager::SetStatus
void SetStatus(const absl::Status &status)
Definition
popup_manager.cc:92
yaze::editor::PopupManager::GetStatus
absl::Status GetStatus() const
Definition
popup_manager.h:46
yaze::editor::PopupManager::IsVisible
bool IsVisible(const char *name) const
Definition
popup_manager.cc:84
yaze::editor::PopupManager::DrawPopups
void DrawPopups()
Definition
popup_manager.cc:46
yaze::editor::PopupManager::Show
void Show(const char *name)
Definition
popup_manager.cc:69
yaze::editor::PopupManager::DrawSessionLimitWarningPopup
void DrawSessionLimitWarningPopup()
Definition
popup_manager.cc:470
yaze::editor::PopupManager::Hide
void Hide(const char *name)
Definition
popup_manager.cc:76
yaze::editor::PopupManager::DrawTroubleshootingPopup
void DrawTroubleshootingPopup()
Definition
popup_manager.cc:359
yaze::editor::PopupManager::DrawSupportedFeaturesPopup
void DrawSupportedFeaturesPopup()
Definition
popup_manager.cc:210
yaze::editor::PopupManager::Initialize
void Initialize()
Definition
popup_manager.cc:18
yaze::editor::PopupManager::popups_
std::unordered_map< std::string, PopupParams > popups_
Definition
popup_manager.h:94
yaze::editor::PopupManager::editor_manager_
EditorManager * editor_manager_
Definition
popup_manager.h:93
yaze::editor::PopupManager::DrawStatusPopup
void DrawStatusPopup()
Definition
popup_manager.cc:110
yaze::editor::PopupManager::DrawGettingStartedPopup
void DrawGettingStartedPopup()
Definition
popup_manager.cc:298
yaze::editor::PopupManager::DrawDisplaySettingsPopup
void DrawDisplaySettingsPopup()
Definition
popup_manager.cc:504
yaze::editor::PopupManager::DrawSaveAsPopup
void DrawSaveAsPopup()
Definition
popup_manager.cc:156
yaze::editor::PopupManager::DrawContributingPopup
void DrawContributingPopup()
Definition
popup_manager.cc:373
yaze::editor::PopupManager::prev_status_
absl::Status prev_status_
Definition
popup_manager.h:97
yaze::editor::PopupManager::status_
absl::Status status_
Definition
popup_manager.h:95
yaze::editor::PopupManager::DrawCLIUsagePopup
void DrawCLIUsagePopup()
Definition
popup_manager.cc:344
yaze::editor::PopupManager::BeginCentered
bool BeginCentered(const char *name)
Definition
popup_manager.cc:100
yaze::editor::PopupManager::DrawWhatsNewPopup
void DrawWhatsNewPopup()
Definition
popup_manager.cc:389
yaze::editor::PopupManager::show_status_
bool show_status_
Definition
popup_manager.h:96
yaze::editor::PopupManager::DrawRomInfoPopup
void DrawRomInfoPopup()
Definition
popup_manager.cc:144
yaze::editor::PopupManager::DrawLayoutResetConfirmPopup
void DrawLayoutResetConfirmPopup()
Definition
popup_manager.cc:487
yaze::editor::PopupManager::DrawAboutPopup
void DrawAboutPopup()
Definition
popup_manager.cc:132
yaze::editor::PopupManager::DrawOpenRomHelpPopup
void DrawOpenRomHelpPopup()
Definition
popup_manager.cc:270
yaze::editor::PopupManager::DrawNewProjectPopup
void DrawNewProjectPopup()
Definition
popup_manager.cc:170
yaze::editor::PopupManager::DrawManageProjectPopup
void DrawManageProjectPopup()
Definition
popup_manager.cc:283
yaze::editor::PopupManager::DrawAsarIntegrationPopup
void DrawAsarIntegrationPopup()
Definition
popup_manager.cc:312
yaze::editor::PopupManager::DrawWorkspaceHelpPopup
void DrawWorkspaceHelpPopup()
Definition
popup_manager.cc:441
yaze
Main namespace for the application.
Definition
asar_wrapper.cc:14
yaze::editor::PopupParams
Definition
popup_manager.h:16
yaze::editor::PopupParams::name
std::string name
Definition
popup_manager.h:17
yaze::editor::PopupParams::draw_function
std::function< void()> draw_function
Definition
popup_manager.h:19
yaze::editor::PopupParams::is_visible
bool is_visible
Definition
popup_manager.h:18
src
app
editor
system
popup_manager.h
Generated by
1.9.8