#include <popup_manager.h>

Classes | |
| struct | SaveAsState |
Public Member Functions | |
| PopupManager (EditorManager *editor_manager) | |
| void | Initialize () |
| void | DrawPopups () |
| void | Show (const char *name) |
| void | RegisterPopup (const std::string &name, PopupType type, std::function< void()> draw_function, bool allow_resize=false) |
| void | Hide (const char *name) |
| bool | IsVisible (const char *name) const |
| void | SetStatus (const absl::Status &status) |
| absl::Status | GetStatus () const |
Private Attributes | |
| struct yaze::editor::PopupManager::SaveAsState | save_as_ |
| EditorManager * | editor_manager_ |
| std::unordered_map< std::string, PopupParams > | popups_ |
| uint64_t | next_shown_order_ = 1 |
| absl::Status | status_ |
| bool | show_status_ = false |
| absl::Status | prev_status_ |
Definition at line 116 of file popup_manager.h.
| yaze::editor::PopupManager::PopupManager | ( | EditorManager * | editor_manager | ) |
Definition at line 35 of file popup_manager.cc.
| void yaze::editor::PopupManager::Initialize | ( | ) |
Definition at line 38 of file popup_manager.cc.
References DrawAboutPopup(), DrawAsarIntegrationPopup(), DrawBuildInstructionsPopup(), DrawCLIUsagePopup(), DrawComingFromZScreamPopup(), DrawContributingPopup(), DrawDataIntegrityPopup(), DrawDisplaySettingsPopup(), DrawDungeonPotItemSaveConfirmPopup(), DrawFeatureFlagsPopup(), DrawGettingStartedPopup(), DrawLayoutPresetsPopup(), DrawLayoutResetConfirmPopup(), DrawManageProjectPopup(), DrawNewProjectPopup(), DrawOpenRomHelpPopup(), DrawRomBackupManagerPopup(), DrawRomInfoPopup(), DrawRomWriteConfirmPopup(), DrawSaveAsPopup(), DrawSaveScopePopup(), DrawSessionLimitWarningPopup(), DrawSessionManagerPopup(), DrawSupportedFeaturesPopup(), DrawTroubleshootingPopup(), DrawUnsavedSessionChangesPopup(), DrawWhatsNewPopup(), DrawWorkspaceHelpPopup(), DrawWriteConflictWarningPopup(), yaze::editor::PopupID::kAbout, yaze::editor::PopupID::kAsarIntegration, yaze::editor::PopupID::kBuildInstructions, yaze::editor::PopupID::kCLIUsage, yaze::editor::PopupID::kComingFromZScream, yaze::editor::kConfirmation, yaze::editor::PopupID::kContributing, yaze::editor::PopupID::kDataIntegrity, yaze::editor::PopupID::kDisplaySettings, yaze::editor::PopupID::kDungeonPotItemSaveConfirm, yaze::editor::PopupID::kFeatureFlags, yaze::editor::kFileOperation, yaze::editor::PopupID::kGettingStarted, yaze::editor::kHelp, yaze::editor::kInfo, yaze::editor::PopupID::kLayoutPresets, yaze::editor::PopupID::kLayoutResetConfirm, yaze::editor::PopupID::kManageProject, yaze::editor::PopupID::kNewProject, yaze::editor::PopupID::kOpenRomHelp, yaze::editor::PopupID::kRomBackups, yaze::editor::PopupID::kRomInfo, yaze::editor::PopupID::kRomWriteConfirm, yaze::editor::PopupID::kSaveAs, yaze::editor::PopupID::kSaveScope, yaze::editor::PopupID::kSessionLimitWarning, yaze::editor::PopupID::kSessionManager, yaze::editor::kSettings, yaze::editor::PopupID::kSupportedFeatures, yaze::editor::PopupID::kTroubleshooting, yaze::editor::PopupID::kUnsavedSessionChanges, yaze::editor::kWarning, yaze::editor::PopupID::kWhatsNew, yaze::editor::PopupID::kWorkspaceHelp, yaze::editor::PopupID::kWriteConflictWarning, and popups_.
| void yaze::editor::PopupManager::DrawPopups | ( | ) |
Definition at line 157 of file popup_manager.cc.
References yaze::editor::PopupParams::allow_resize, yaze::editor::PopupParams::draw_function, DrawStatusPopup(), yaze::editor::PopupParams::name, popups_, and yaze::editor::PopupParams::shown_order.
Referenced by yaze::editor::UICoordinator::DrawAllPopups().

| void yaze::editor::PopupManager::Show | ( | const char * | name | ) |
Definition at line 189 of file popup_manager.cc.
References yaze::editor::PopupID::kSaveAs, next_shown_order_, popups_, and ResetSaveAsState().
Referenced by yaze::editor::MenuOrchestrator::AddFileMenuItems(), yaze::editor::RomLifecycleManager::CheckRomWritePolicy(), yaze::editor::UICoordinator::ShowDisplaySettings(), yaze::editor::UICoordinator::ShowPopup(), and yaze::editor::UICoordinator::UICoordinator().

| void yaze::editor::PopupManager::RegisterPopup | ( | const std::string & | name, |
| PopupType | type, | ||
| std::function< void()> | draw_function, | ||
| bool | allow_resize = false ) |
Definition at line 232 of file popup_manager.cc.
References yaze::editor::PopupParams::allow_resize, yaze::editor::PopupParams::draw_function, yaze::editor::PopupParams::name, popups_, and yaze::editor::PopupParams::type.
| void yaze::editor::PopupManager::Hide | ( | const char * | name | ) |
Definition at line 216 of file popup_manager.cc.
References yaze::editor::PopupID::kSaveAs, popups_, and ResetSaveAsState().
Referenced by DrawAboutPopup(), DrawAsarIntegrationPopup(), DrawBuildInstructionsPopup(), DrawCLIUsagePopup(), DrawComingFromZScreamPopup(), DrawContributingPopup(), DrawDataIntegrityPopup(), DrawDisplaySettingsPopup(), DrawDungeonPotItemSaveConfirmPopup(), DrawFeatureFlagsPopup(), DrawGettingStartedPopup(), DrawLayoutPresetsPopup(), DrawLayoutResetConfirmPopup(), DrawManageProjectPopup(), DrawNewProjectPopup(), DrawOpenRomHelpPopup(), DrawRomBackupManagerPopup(), DrawRomInfoPopup(), DrawRomWriteConfirmPopup(), DrawSaveAsPopup(), DrawSaveScopePopup(), DrawSessionLimitWarningPopup(), DrawSessionManagerPopup(), DrawSupportedFeaturesPopup(), DrawTroubleshootingPopup(), DrawUnsavedSessionChangesPopup(), DrawWhatsNewPopup(), DrawWorkspaceHelpPopup(), DrawWriteConflictWarningPopup(), and yaze::editor::UICoordinator::HidePopup().

| bool yaze::editor::PopupManager::IsVisible | ( | const char * | name | ) | const |
Definition at line 243 of file popup_manager.cc.
References popups_.
| void yaze::editor::PopupManager::SetStatus | ( | const absl::Status & | status | ) |
Definition at line 256 of file popup_manager.cc.
References prev_status_, show_status_, and status_.
Referenced by DrawNewProjectPopup().
|
inline |
Definition at line 144 of file popup_manager.h.
References status_.
|
private |
Definition at line 264 of file popup_manager.cc.
Referenced by DrawStatusPopup().
|
private |
Definition at line 297 of file popup_manager.cc.
References editor_manager_, Hide(), yaze::gui::kDefaultModalSize, and yaze::editor::EditorManager::version().
Referenced by Initialize().

|
private |
Definition at line 310 of file popup_manager.cc.
References yaze::gui::ConvertColorToImVec4(), yaze::zelda3::DetectOverworldRomProfile(), editor_manager_, yaze::gui::ThemeManager::Get(), yaze::editor::EditorManager::GetCurrentProject(), yaze::editor::EditorManager::GetCurrentRom(), yaze::editor::EditorManager::GetCurrentRomHash(), yaze::gui::ThemeManager::GetCurrentTheme(), yaze::util::HexLongLong(), Hide(), yaze::editor::EditorManager::IsRomHashMismatch(), yaze::rom::kAbsent, yaze::gui::kDefaultModalSize, yaze::zelda3::OverworldRomProfile::kOlderTailEa, yaze::rom::kValid, yaze::project::RomRoleToString(), and yaze::project::RomWritePolicyToString().
Referenced by Initialize().
|
private |
Definition at line 274 of file popup_manager.cc.
References BeginCentered(), ICON_MD_CONTENT_COPY, ICON_MD_ERROR, yaze::gui::kDefaultModalSize, prev_status_, show_status_, and status_.
Referenced by DrawPopups().

|
private |
Definition at line 371 of file popup_manager.cc.
References editor_manager_, yaze::editor::PopupManager::SaveAsState::error, yaze::editor::PopupManager::SaveAsState::filename, yaze::Rom::filename(), yaze::editor::PopupManager::SaveAsState::folder, yaze::editor::EditorManager::GetCurrentRom(), yaze::editor::EditorManager::GetCurrentSessionId(), Hide(), ICON_MD_CANCEL, ICON_MD_FOLDER_OPEN, ICON_MD_SAVE, ICON_MD_SAVE_AS, yaze::editor::PopupManager::SaveAsState::initialized, yaze::gui::WidgetIdRegistry::Instance(), yaze::Rom::is_loaded(), yaze::gui::kDefaultModalSize, yaze::editor::PopupID::kSaveAs, yaze::gui::WidgetIdRegistry::RegisterWidget(), ResetSaveAsState(), save_as_, yaze::editor::EditorManager::SaveRomAs(), yaze::editor::PopupManager::SaveAsState::session_id, yaze::util::FileDialogWrapper::ShowOpenFolderDialog(), and yaze::editor::PopupManager::SaveAsState::source_path.
Referenced by Initialize().
|
private |
Definition at line 367 of file popup_manager.cc.
References save_as_.
Referenced by DrawSaveAsPopup(), Hide(), and Show().
|
private |
Definition at line 488 of file popup_manager.cc.
References yaze::core::FeatureFlags::get(), Hide(), ICON_MD_SAVE, yaze::gui::kDefaultModalSize, and yaze::editor::PopupID::kSaveScope.
Referenced by Initialize().

|
private |
Definition at line 704 of file popup_manager.cc.
References yaze::editor::EditorManager::CreateNewProjectFromRom(), editor_manager_, yaze::editor::EditorManager::GetCurrentProject(), Hide(), ICON_MD_ADD, ICON_MD_CANCEL, ICON_MD_CODE, ICON_MD_FOLDER, ICON_MD_LABEL, ICON_MD_SAVE, ICON_MD_VIDEOGAME_ASSET, yaze::gui::kDefaultModalSize, yaze::editor::PopupID::kNewProject, yaze::project::YazeProject::labels_filename, yaze::util::MakeRomFileDialogOptions(), yaze::editor::EditorManager::MarkCurrentProjectDirty(), yaze::editor::EditorManager::SaveProject(), SetStatus(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), yaze::util::FileDialogWrapper::ShowOpenFolderDialog(), and yaze::util::FileDialogWrapper::ShowSaveFileDialog().
Referenced by Initialize().
|
private |
Definition at line 807 of file popup_manager.cc.
References yaze::gui::ConvertColorToImVec4(), yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), Hide(), yaze::gui::kDefaultModalSize, and yaze::editor::PopupID::kSupportedFeatures.
Referenced by Initialize().

|
private |
Definition at line 942 of file popup_manager.cc.
References Hide(), and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 958 of file popup_manager.cc.
References Hide(), and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 973 of file popup_manager.cc.
References Hide(), yaze::gui::kDefaultModalSize, and YAZE_VERSION_STRING.
Referenced by Initialize().

|
private |
Definition at line 999 of file popup_manager.cc.
References Hide(), and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 1015 of file popup_manager.cc.
References Hide(), and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 1034 of file popup_manager.cc.
References Hide(), and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 1055 of file popup_manager.cc.
References Hide(), and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 1074 of file popup_manager.cc.
References Hide(), and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 1090 of file popup_manager.cc.
References Hide(), ICON_MD_BUILD, ICON_MD_DESCRIPTION, ICON_MD_EDIT, ICON_MD_PALETTE, ICON_MD_SETTINGS, yaze::gui::kDefaultModalSize, yaze::editor::PopupID::kWhatsNew, and YAZE_VERSION_STRING.
Referenced by Initialize().

|
private |
Definition at line 1146 of file popup_manager.cc.
References Hide(), ICON_MD_APPS, ICON_MD_DASHBOARD, ICON_MD_FOLDER, ICON_MD_LANDSCAPE, ICON_MD_SAVE, yaze::editor::PopupID::kComingFromZScream, and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 1224 of file popup_manager.cc.
References Hide(), and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 1254 of file popup_manager.cc.
References yaze::gui::GetWarningColor(), Hide(), ICON_MD_WARNING, and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 1271 of file popup_manager.cc.
References yaze::gui::GetWarningColor(), Hide(), ICON_MD_WARNING, and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 1288 of file popup_manager.cc.
References editor_manager_, yaze::editor::LayoutPresets::GetAudioEngineerPreset(), yaze::editor::EditorManager::GetCurrentEditor(), yaze::editor::LayoutPresets::GetDesignerPreset(), yaze::editor::LayoutPresets::GetDeveloperPreset(), yaze::editor::LayoutPresets::GetDungeonMasterPreset(), yaze::gui::GetInfoColor(), yaze::editor::LayoutPresets::GetLogicDebuggerPreset(), yaze::editor::LayoutPresets::GetMinimalPreset(), yaze::editor::LayoutPresets::GetModderPreset(), yaze::editor::LayoutPresets::GetOverworldArtistPreset(), Hide(), yaze::editor::WorkspaceWindowManager::HideAll(), ICON_MD_BUG_REPORT, ICON_MD_BUILD, ICON_MD_CROP_FREE, ICON_MD_DASHBOARD, ICON_MD_DOOR_SLIDING, ICON_MD_MAP, ICON_MD_MUSIC_NOTE, ICON_MD_PALETTE, ICON_MD_REFRESH, ICON_MD_SCIENCE, yaze::editor::PopupID::kLayoutPresets, yaze::editor::Editor::type(), and yaze::editor::EditorManager::window_manager().
Referenced by Initialize().
|
private |
Definition at line 1389 of file popup_manager.cc.
References yaze::editor::EditorManager::CreateNewSession(), editor_manager_, yaze::Rom::filename(), yaze::editor::EditorManager::GetActiveSessionCount(), yaze::editor::EditorManager::GetCurrentRom(), yaze::editor::EditorManager::GetCurrentSessionIndex(), yaze::gui::GetInfoColor(), yaze::gui::GetSuccessColor(), Hide(), ICON_MD_ADD, ICON_MD_CHECK_CIRCLE, ICON_MD_TAB, yaze::Rom::is_loaded(), yaze::editor::PopupID::kSessionManager, yaze::editor::EditorManager::RemoveSession(), and yaze::editor::EditorManager::SwitchToSession().
Referenced by Initialize().
|
private |
Definition at line 1477 of file popup_manager.cc.
References yaze::gui::DrawDisplaySettingsForPopup(), yaze::gui::DrawFontManager(), editor_manager_, Hide(), ICON_MD_DISPLAY_SETTINGS, yaze::gui::kDefaultModalSize, yaze::editor::EditorManager::SetFontGlobalScale(), and yaze::gui::TextWithSeparators().
Referenced by Initialize().
|
private |
Definition at line 1520 of file popup_manager.cc.
References yaze::gui::FlagsMenu::DrawDungeonFlags(), yaze::gui::FlagsMenu::DrawOverworldFlags(), yaze::gui::FlagsMenu::DrawResourceFlags(), yaze::gui::FlagsMenu::DrawSystemFlags(), Hide(), yaze::gui::kDefaultModalSize, and yaze::editor::PopupID::kFeatureFlags.
Referenced by Initialize().
|
private |
Definition at line 1560 of file popup_manager.cc.
References yaze::gui::GetSuccessColor(), Hide(), yaze::editor::PopupID::kDataIntegrity, and yaze::gui::kDefaultModalSize.
Referenced by Initialize().

|
private |
Definition at line 1588 of file popup_manager.cc.
References editor_manager_, Hide(), yaze::gui::WidgetIdRegistry::Instance(), yaze::editor::EditorManager::kCancel, yaze::gui::kDefaultModalSize, yaze::editor::PopupID::kDungeonPotItemSaveConfirm, yaze::editor::EditorManager::kSaveWithoutPotItems, yaze::editor::EditorManager::kSaveWithPotItems, yaze::editor::EditorManager::pending_pot_item_total_rooms(), yaze::editor::EditorManager::pending_pot_item_unloaded_rooms(), yaze::gui::WidgetIdRegistry::RegisterWidget(), and yaze::editor::EditorManager::ResolvePotItemSaveConfirmation().
Referenced by Initialize().
|
private |
Definition at line 559 of file popup_manager.cc.
References yaze::editor::EditorManager::DiscardPendingRomBackupRestore(), editor_manager_, yaze::Rom::filename(), yaze::project::YazeProject::GetAbsolutePath(), yaze::editor::EditorManager::GetCurrentProject(), yaze::editor::EditorManager::GetCurrentRom(), yaze::editor::EditorManager::GetRomBackups(), Hide(), ICON_MD_BACKUP, ICON_MD_CONTENT_COPY, ICON_MD_DELETE_SWEEP, ICON_MD_OPEN_IN_NEW, ICON_MD_RESTORE, ICON_MD_UNDO, yaze::Rom::is_loaded(), yaze::editor::EditorManager::IsRomBackupRestorePending(), yaze::gui::kDefaultModalSize, yaze::editor::kError, yaze::editor::PopupID::kRomBackups, yaze::editor::kSuccess, yaze::editor::EditorManager::OpenRomOrProject(), yaze::editor::EditorManager::PruneRomBackups(), yaze::editor::EditorManager::RestoreRomBackup(), and yaze::editor::EditorManager::toast_manager().
Referenced by Initialize().
|
private |
Definition at line 1641 of file popup_manager.cc.
References yaze::editor::EditorManager::CancelRomWriteConfirm(), yaze::editor::EditorManager::ConfirmRomWrite(), editor_manager_, yaze::Rom::filename(), yaze::editor::EditorManager::GetCurrentProject(), yaze::editor::EditorManager::GetCurrentRom(), yaze::editor::EditorManager::GetCurrentRomHash(), yaze::editor::EditorManager::GetProjectExpectedRomHash(), yaze::editor::EditorManager::GetProjectRomRole(), yaze::editor::EditorManager::GetProjectRomWritePolicy(), Hide(), yaze::gui::WidgetIdRegistry::Instance(), yaze::gui::kDefaultModalSize, yaze::editor::kError, yaze::editor::PopupID::kRomWriteConfirm, yaze::gui::WidgetIdRegistry::RegisterWidget(), yaze::editor::EditorManager::ResumePendingRomSave(), yaze::project::RomRoleToString(), yaze::project::RomWritePolicyToString(), and yaze::editor::EditorManager::toast_manager().
Referenced by Initialize().
|
private |
Definition at line 1709 of file popup_manager.cc.
References yaze::core::AddressOwnershipToString(), yaze::editor::EditorManager::BypassWriteConflictOnce(), yaze::editor::EditorManager::ClearPendingWriteConflicts(), editor_manager_, yaze::gui::GetWarningColor(), Hide(), ICON_MD_WARNING, yaze::gui::kDefaultModalSize, yaze::editor::kError, yaze::editor::PopupID::kWriteConflictWarning, yaze::editor::EditorManager::pending_write_conflicts(), yaze::editor::EditorManager::ResumePendingRomSave(), and yaze::editor::EditorManager::toast_manager().
Referenced by Initialize().
|
private |
Definition at line 1781 of file popup_manager.cc.
References yaze::editor::EditorManager::CancelPendingUnsavedSessionAction(), yaze::editor::EditorManager::ConfirmPendingUnsavedSessionActionDiscardAndContinue(), yaze::editor::EditorManager::ConfirmPendingUnsavedSessionActionSaveAndContinue(), editor_manager_, yaze::editor::EditorManager::GetPendingUnsavedSessionActionContinueLabel(), yaze::editor::EditorManager::GetPendingUnsavedSessionActionPrompt(), yaze::editor::EditorManager::GetPendingUnsavedSessionActionSaveLabel(), yaze::editor::EditorManager::HasPendingUnsavedSessionAction(), Hide(), ICON_MD_WARNING, yaze::gui::kDefaultModalSize, and yaze::editor::PopupID::kUnsavedSessionChanges.
Referenced by Initialize().
|
private |
Referenced by DrawSaveAsPopup(), and ResetSaveAsState().
|
private |
Definition at line 214 of file popup_manager.h.
Referenced by DrawAboutPopup(), DrawDisplaySettingsPopup(), DrawDungeonPotItemSaveConfirmPopup(), DrawLayoutPresetsPopup(), DrawNewProjectPopup(), DrawRomBackupManagerPopup(), DrawRomInfoPopup(), DrawRomWriteConfirmPopup(), DrawSaveAsPopup(), DrawSessionManagerPopup(), DrawUnsavedSessionChangesPopup(), and DrawWriteConflictWarningPopup().
|
private |
Definition at line 215 of file popup_manager.h.
Referenced by DrawPopups(), Hide(), Initialize(), IsVisible(), RegisterPopup(), and Show().
|
private |
Definition at line 216 of file popup_manager.h.
Referenced by Show().
|
private |
Definition at line 217 of file popup_manager.h.
Referenced by DrawStatusPopup(), GetStatus(), and SetStatus().
|
private |
Definition at line 218 of file popup_manager.h.
Referenced by DrawStatusPopup(), and SetStatus().
|
private |
Definition at line 219 of file popup_manager.h.
Referenced by DrawStatusPopup(), and SetStatus().