Central registry and manager for all editor cards. More...
#include <editor_card_manager.h>
Classes | |
struct | WorkspacePreset |
Public Member Functions | |
void | RegisterCard (const CardInfo &info) |
void | UnregisterCard (const std::string &card_id) |
void | ClearAllCards () |
bool | ShowCard (const std::string &card_id) |
bool | HideCard (const std::string &card_id) |
bool | ToggleCard (const std::string &card_id) |
bool | IsCardVisible (const std::string &card_id) const |
void | ShowAllCardsInCategory (const std::string &category) |
void | HideAllCardsInCategory (const std::string &category) |
void | ShowOnlyCard (const std::string &card_id) |
std::vector< CardInfo > | GetCardsInCategory (const std::string &category) const |
std::vector< std::string > | GetAllCategories () const |
const CardInfo * | GetCardInfo (const std::string &card_id) const |
void | DrawViewMenuSection (const std::string &category) |
void | DrawViewMenuAll () |
void | DrawCompactCardControl (const std::string &category) |
void | DrawInlineCardToggles (const std::string &category) |
void | DrawCardBrowser (bool *p_open) |
void | DrawCardBrowserTable (const char *search_filter, const std::string &category_filter) |
void | DrawPresetsTab () |
void | SavePreset (const std::string &name, const std::string &description="") |
bool | LoadPreset (const std::string &name) |
void | DeletePreset (const std::string &name) |
std::vector< WorkspacePreset > | GetPresets () const |
void | ShowAll () |
void | HideAll () |
void | ResetToDefaults () |
size_t | GetCardCount () const |
size_t | GetVisibleCardCount () const |
Static Public Member Functions | |
static EditorCardManager & | Get () |
Private Member Functions | |
EditorCardManager ()=default | |
~EditorCardManager ()=default | |
EditorCardManager (const EditorCardManager &)=delete | |
EditorCardManager & | operator= (const EditorCardManager &)=delete |
void | SavePresetsToFile () |
void | LoadPresetsFromFile () |
Private Attributes | |
std::unordered_map< std::string, CardInfo > | cards_ |
std::unordered_map< std::string, WorkspacePreset > | presets_ |
Central registry and manager for all editor cards.
This singleton provides:
Design Philosophy:
Usage:
Definition at line 72 of file editor_card_manager.h.
|
privatedefault |
|
privatedefault |
|
privatedelete |
|
static |
Definition at line 14 of file editor_card_manager.cc.
Referenced by yaze::editor::EditorManager::DrawContextSensitiveCardControl(), yaze::editor::GraphicsEditor::Initialize(), yaze::editor::ScreenEditor::Initialize(), yaze::editor::MessageEditor::Initialize(), yaze::editor::OverworldEditor::Initialize(), yaze::editor::SpriteEditor::Initialize(), yaze::editor::EditorManager::Initialize(), yaze::emu::Emulator::Initialize(), yaze::editor::DungeonEditorV2::Initialize(), yaze::editor::AssemblyEditor::Load(), yaze::gui::RegisterCard(), yaze::editor::EditorManager::Update(), and yaze::gui::CardRegistration::~CardRegistration().
void yaze::gui::EditorCardManager::RegisterCard | ( | const CardInfo & | info | ) |
Definition at line 19 of file editor_card_manager.cc.
References yaze::gui::CardInfo::card_id, cards_, and yaze::gui::CardInfo::display_name.
Referenced by yaze::gui::RegisterCard().
void yaze::gui::EditorCardManager::UnregisterCard | ( | const std::string & | card_id | ) |
Definition at line 37 of file editor_card_manager.cc.
References cards_.
Referenced by yaze::gui::CardRegistration::~CardRegistration().
void yaze::gui::EditorCardManager::ClearAllCards | ( | ) |
Definition at line 45 of file editor_card_manager.cc.
References cards_.
bool yaze::gui::EditorCardManager::ShowCard | ( | const std::string & | card_id | ) |
Definition at line 50 of file editor_card_manager.cc.
References cards_.
Referenced by LoadPreset().
bool yaze::gui::EditorCardManager::HideCard | ( | const std::string & | card_id | ) |
Definition at line 69 of file editor_card_manager.cc.
References cards_.
bool yaze::gui::EditorCardManager::ToggleCard | ( | const std::string & | card_id | ) |
Definition at line 88 of file editor_card_manager.cc.
References cards_.
Referenced by DrawViewMenuSection().
bool yaze::gui::EditorCardManager::IsCardVisible | ( | const std::string & | card_id | ) | const |
Definition at line 110 of file editor_card_manager.cc.
References cards_.
void yaze::gui::EditorCardManager::ShowAllCardsInCategory | ( | const std::string & | category | ) |
Definition at line 118 of file editor_card_manager.cc.
References cards_.
Referenced by DrawCompactCardControl(), DrawViewMenuAll(), and yaze::editor::EditorManager::Initialize().
void yaze::gui::EditorCardManager::HideAllCardsInCategory | ( | const std::string & | category | ) |
Definition at line 127 of file editor_card_manager.cc.
References cards_.
Referenced by DrawCompactCardControl(), and DrawViewMenuAll().
void yaze::gui::EditorCardManager::ShowOnlyCard | ( | const std::string & | card_id | ) |
Definition at line 136 of file editor_card_manager.cc.
References cards_.
std::vector< CardInfo > yaze::gui::EditorCardManager::GetCardsInCategory | ( | const std::string & | category | ) | const |
Definition at line 158 of file editor_card_manager.cc.
References cards_.
Referenced by DrawCompactCardControl(), DrawInlineCardToggles(), and DrawViewMenuSection().
std::vector< std::string > yaze::gui::EditorCardManager::GetAllCategories | ( | ) | const |
Definition at line 176 of file editor_card_manager.cc.
References cards_.
Referenced by DrawCardBrowser(), and DrawViewMenuAll().
const CardInfo * yaze::gui::EditorCardManager::GetCardInfo | ( | const std::string & | card_id | ) | const |
Definition at line 189 of file editor_card_manager.cc.
References cards_.
void yaze::gui::EditorCardManager::DrawViewMenuSection | ( | const std::string & | category | ) |
Definition at line 194 of file editor_card_manager.cc.
References GetCardsInCategory(), and ToggleCard().
Referenced by DrawViewMenuAll().
void yaze::gui::EditorCardManager::DrawViewMenuAll | ( | ) |
Definition at line 219 of file editor_card_manager.cc.
References DrawViewMenuSection(), GetAllCategories(), HideAll(), HideAllCardsInCategory(), ICON_MD_DASHBOARD, ICON_MD_VISIBILITY, ICON_MD_VISIBILITY_OFF, ShowAll(), and ShowAllCardsInCategory().
void yaze::gui::EditorCardManager::DrawCompactCardControl | ( | const std::string & | category | ) |
Definition at line 264 of file editor_card_manager.cc.
References GetCardsInCategory(), HideAllCardsInCategory(), ICON_MD_DASHBOARD, ICON_MD_VIEW_MODULE, ICON_MD_VISIBILITY, ICON_MD_VISIBILITY_OFF, and ShowAllCardsInCategory().
void yaze::gui::EditorCardManager::DrawInlineCardToggles | ( | const std::string & | category | ) |
Definition at line 330 of file editor_card_manager.cc.
References GetCardsInCategory(), and ICON_MD_DASHBOARD.
void yaze::gui::EditorCardManager::DrawCardBrowser | ( | bool * | p_open | ) |
Definition at line 354 of file editor_card_manager.cc.
References DrawCardBrowserTable(), DrawPresetsTab(), GetAllCategories(), GetCardCount(), GetVisibleCardCount(), ICON_MD_APPS, ICON_MD_BOOKMARK, ICON_MD_CLEAR, ICON_MD_DASHBOARD, ICON_MD_INFO, and ICON_MD_SEARCH.
Referenced by yaze::editor::EditorManager::Update().
void yaze::gui::EditorCardManager::DrawCardBrowserTable | ( | const char * | search_filter, |
const std::string & | category_filter | ||
) |
Definition at line 417 of file editor_card_manager.cc.
References cards_.
Referenced by DrawCardBrowser().
void yaze::gui::EditorCardManager::DrawPresetsTab | ( | ) |
Definition at line 504 of file editor_card_manager.cc.
References DeletePreset(), GetPresets(), ICON_MD_BOOKMARK, ICON_MD_DELETE, ICON_MD_FOLDER_OPEN, ICON_MD_SAVE, LoadPreset(), and SavePreset().
Referenced by DrawCardBrowser().
void yaze::gui::EditorCardManager::SavePreset | ( | const std::string & | name, |
const std::string & | description = "" |
||
) |
Definition at line 560 of file editor_card_manager.cc.
References cards_, yaze::gui::EditorCardManager::WorkspacePreset::description, yaze::gui::EditorCardManager::WorkspacePreset::name, presets_, SavePresetsToFile(), and yaze::gui::EditorCardManager::WorkspacePreset::visible_cards.
Referenced by DrawPresetsTab().
bool yaze::gui::EditorCardManager::LoadPreset | ( | const std::string & | name | ) |
Definition at line 579 of file editor_card_manager.cc.
References HideAll(), presets_, and ShowCard().
Referenced by DrawPresetsTab().
void yaze::gui::EditorCardManager::DeletePreset | ( | const std::string & | name | ) |
Definition at line 599 of file editor_card_manager.cc.
References presets_, and SavePresetsToFile().
Referenced by DrawPresetsTab().
std::vector< EditorCardManager::WorkspacePreset > yaze::gui::EditorCardManager::GetPresets | ( | ) | const |
Definition at line 608 of file editor_card_manager.cc.
References presets_.
Referenced by DrawPresetsTab().
void yaze::gui::EditorCardManager::ShowAll | ( | ) |
Definition at line 616 of file editor_card_manager.cc.
References cards_.
Referenced by DrawViewMenuAll().
void yaze::gui::EditorCardManager::HideAll | ( | ) |
Definition at line 625 of file editor_card_manager.cc.
References cards_.
Referenced by DrawViewMenuAll(), and LoadPreset().
void yaze::gui::EditorCardManager::ResetToDefaults | ( | ) |
Definition at line 634 of file editor_card_manager.cc.
References cards_.
|
inline |
Definition at line 128 of file editor_card_manager.h.
References cards_.
Referenced by DrawCardBrowser().
size_t yaze::gui::EditorCardManager::GetVisibleCardCount | ( | ) | const |
Definition at line 650 of file editor_card_manager.cc.
References cards_.
Referenced by DrawCardBrowser().
|
privatedelete |
|
private |
Definition at line 660 of file editor_card_manager.cc.
References presets_.
Referenced by DeletePreset(), and SavePreset().
|
private |
Definition at line 666 of file editor_card_manager.cc.
|
private |
Definition at line 137 of file editor_card_manager.h.
Referenced by ClearAllCards(), DrawCardBrowserTable(), GetAllCategories(), GetCardCount(), GetCardInfo(), GetCardsInCategory(), GetVisibleCardCount(), HideAll(), HideAllCardsInCategory(), HideCard(), IsCardVisible(), RegisterCard(), ResetToDefaults(), SavePreset(), ShowAll(), ShowAllCardsInCategory(), ShowCard(), ShowOnlyCard(), ToggleCard(), and UnregisterCard().
|
private |
Definition at line 138 of file editor_card_manager.h.
Referenced by DeletePreset(), GetPresets(), LoadPreset(), SavePreset(), and SavePresetsToFile().