#include <dashboard_panel.h>

Classes | |
| struct | EditorInfo |
Public Member Functions | |
| DashboardPanel (IEditorSwitcher *editor_switcher) | |
| ~DashboardPanel ()=default | |
| void | Draw () |
| void | Show () |
| void | Hide () |
| bool | IsVisible () const |
| bool * | visibility_flag () |
| void | MarkRecentlyUsed (EditorType type) |
| void | LoadRecentEditors () |
| void | SaveRecentEditors () |
| void | ClearRecentEditors () |
Private Member Functions | |
| void | DrawWelcomeHeader () |
| void | DrawRecentEditors () |
| void | DrawEditorGrid () |
| void | DrawEditorPanel (const EditorInfo &info, int index, const ImVec2 &card_size, bool enabled) |
Private Attributes | |
| IEditorSwitcher * | editor_switcher_ |
| gui::PanelWindow | window_ |
| bool | show_ = true |
| bool | has_rom_ = false |
| std::vector< EditorInfo > | editors_ |
| std::vector< EditorType > | recent_editors_ |
Static Private Attributes | |
| static constexpr size_t | kMaxRecentEditors = 5 |
Definition at line 17 of file dashboard_panel.h.
|
explicit |
Definition at line 140 of file dashboard_panel.cc.
References yaze::gui::PanelWindow::Center, editors_, yaze::gui::GetCtrlDisplayName(), ICON_MD_CASTLE, ICON_MD_CHAT_BUBBLE, ICON_MD_CODE, ICON_MD_COLOR_LENS, ICON_MD_DATA_ARRAY, ICON_MD_EMOJI_EMOTIONS, ICON_MD_MAP, ICON_MD_MUSIC_NOTE, ICON_MD_PALETTE, ICON_MD_SMART_TOY, ICON_MD_TV, ICON_MD_VIDEOGAME_ASSET, yaze::editor::kAgent, yaze::editor::kAssembly, yaze::editor::kDungeon, yaze::editor::kEmulator, yaze::editor::kGraphics, yaze::editor::kHex, yaze::editor::kMessage, yaze::editor::kMusic, yaze::editor::kOverworld, yaze::editor::kPalette, yaze::editor::kScreen, yaze::editor::kSprite, LoadRecentEditors(), yaze::gui::PanelWindow::SetDefaultSize(), yaze::gui::PanelWindow::SetPosition(), yaze::gui::PanelWindow::SetSaveSettings(), and window_.
|
default |
| void yaze::editor::DashboardPanel::Draw | ( | ) |
Definition at line 183 of file dashboard_panel.cc.
References yaze::gui::PanelWindow::Begin(), yaze::gui::ConvertColorToImVec4(), DrawEditorGrid(), DrawRecentEditors(), DrawWelcomeHeader(), editor_switcher_, yaze::gui::PanelWindow::End(), yaze::gui::ThemeManager::Get(), yaze::editor::IEditorSwitcher::GetCurrentRom(), yaze::gui::ThemeManager::GetCurrentTheme(), has_rom_, ICON_MD_INFO, yaze::Rom::is_loaded(), recent_editors_, show_, and window_.
|
inline |
Definition at line 24 of file dashboard_panel.h.
References show_.
|
inline |
Definition at line 25 of file dashboard_panel.h.
References show_.
|
inline |
Definition at line 26 of file dashboard_panel.h.
References show_.
|
inline |
Definition at line 27 of file dashboard_panel.h.
References show_.
| void yaze::editor::DashboardPanel::MarkRecentlyUsed | ( | EditorType | type | ) |
Definition at line 585 of file dashboard_panel.cc.
References kMaxRecentEditors, recent_editors_, and SaveRecentEditors().
Referenced by DrawEditorPanel(), and DrawRecentEditors().

| void yaze::editor::DashboardPanel::LoadRecentEditors | ( | ) |
Definition at line 603 of file dashboard_panel.cc.
References kMaxRecentEditors, yaze::editor::kSettings, yaze::util::LoadFileFromConfigDir(), and recent_editors_.
Referenced by DashboardPanel().

| void yaze::editor::DashboardPanel::SaveRecentEditors | ( | ) |
Definition at line 623 of file dashboard_panel.cc.
References recent_editors_, and yaze::util::SaveFile().
Referenced by ClearRecentEditors(), and MarkRecentlyUsed().

| void yaze::editor::DashboardPanel::ClearRecentEditors | ( | ) |
Definition at line 635 of file dashboard_panel.cc.
References recent_editors_, and SaveRecentEditors().

|
private |
Definition at line 226 of file dashboard_panel.cc.
References yaze::gui::ConvertColorToImVec4(), yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), and ICON_MD_EDIT.
Referenced by Draw().

|
private |
Definition at line 240 of file dashboard_panel.cc.
References yaze::gui::ConvertColorToImVec4(), yaze::editor::IEditorSwitcher::DismissEditorSelection(), editor_switcher_, editors_, yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), has_rom_, ICON_MD_HISTORY, MarkRecentlyUsed(), recent_editors_, show_, and yaze::editor::IEditorSwitcher::SwitchToEditor().
Referenced by Draw().
|
private |
Definition at line 330 of file dashboard_panel.cc.
References DrawEditorPanel(), editors_, has_rom_, and ICON_MD_APPS.
Referenced by Draw().

|
private |
Definition at line 374 of file dashboard_panel.cc.
References yaze::gui::ConvertColorToImVec4(), yaze::editor::DashboardPanel::EditorInfo::description, yaze::editor::IEditorSwitcher::DismissEditorSelection(), editor_switcher_, yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), yaze::editor::DashboardPanel::EditorInfo::icon, ICON_MD_KEYBOARD, ICON_MD_STAR, MarkRecentlyUsed(), yaze::editor::DashboardPanel::EditorInfo::name, recent_editors_, yaze::editor::DashboardPanel::EditorInfo::shortcut, show_, yaze::editor::IEditorSwitcher::SwitchToEditor(), and yaze::editor::DashboardPanel::EditorInfo::type.
Referenced by DrawEditorGrid().
|
private |
Definition at line 51 of file dashboard_panel.h.
Referenced by Draw(), DrawEditorPanel(), and DrawRecentEditors().
|
private |
Definition at line 52 of file dashboard_panel.h.
Referenced by DashboardPanel(), and Draw().
|
private |
Definition at line 53 of file dashboard_panel.h.
Referenced by Draw(), DrawEditorPanel(), DrawRecentEditors(), Hide(), IsVisible(), Show(), and visibility_flag().
|
private |
Definition at line 54 of file dashboard_panel.h.
Referenced by Draw(), DrawEditorGrid(), and DrawRecentEditors().
|
private |
Definition at line 56 of file dashboard_panel.h.
Referenced by DashboardPanel(), DrawEditorGrid(), and DrawRecentEditors().
|
private |
Definition at line 57 of file dashboard_panel.h.
Referenced by ClearRecentEditors(), Draw(), DrawEditorPanel(), DrawRecentEditors(), LoadRecentEditors(), MarkRecentlyUsed(), and SaveRecentEditors().
|
staticconstexprprivate |
Definition at line 58 of file dashboard_panel.h.
Referenced by LoadRecentEditors(), and MarkRecentlyUsed().