yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::WelcomeScreen Class Reference

Modern welcome screen with project grid and quick actions. More...

#include <welcome_screen.h>

Collaboration diagram for yaze::editor::WelcomeScreen:

Classes

struct  Particle
 

Public Member Functions

 WelcomeScreen ()
 
bool Show (bool *p_open)
 Show the welcome screen.
 
void SetOpenRomCallback (std::function< void()> callback)
 Set callback for opening ROM.
 
void SetNewProjectCallback (std::function< void()> callback)
 Set callback for creating new project.
 
void SetNewProjectWithTemplateCallback (std::function< void(const std::string &)> callback)
 Set callback for creating project with template.
 
void SetOpenProjectCallback (std::function< void(const std::string &)> callback)
 Set callback for opening project.
 
void SetOpenAgentCallback (std::function< void()> callback)
 Set callback for opening AI Agent.
 
void SetOpenPrototypeResearchCallback (std::function< void()> callback)
 Open the graphics editor focused on prototype research (no ROM).
 
void SetOpenAssemblyEditorNoRomCallback (std::function< void()> callback)
 Open the assembly editor for file/folder work (no ROM required).
 
void SetOpenProjectDialogCallback (std::function< void()> callback)
 Set callback for opening the project file dialog.
 
void SetOpenProjectManagementCallback (std::function< void()> callback)
 Set callback for showing project management.
 
void SetOpenProjectFileEditorCallback (std::function< void()> callback)
 Set callback for showing the project file editor.
 
void RefreshRecentProjects (bool force=false)
 Refresh recent projects list from the project manager.
 
void UpdateAnimations ()
 Update animation time for dynamic effects.
 
bool ShouldShow () const
 Check if screen should be shown.
 
void MarkManuallyClosed ()
 Mark as manually closed (don't show again this session)
 
void SetLayoutOffsets (float left, float right)
 Set layout offsets for sidebar awareness.
 
void SetContextState (bool has_rom, bool has_project)
 Set context state for gating actions.
 
void SetUserSettings (UserSettings *settings)
 Wire persisted user settings so animation tweaks survive restart.
 
RecentProjectsModelrecent_projects ()
 Accessor used by command-palette wiring so the same recent list drives both the visual cards and the palette's per-entry actions.
 
const RecentProjectsModelrecent_projects () const
 

Private Types

enum class  RecentAnnotationKind { None , Rename , EditNotes }
 

Private Member Functions

void DrawHeader ()
 
void DrawQuickActions ()
 
void DrawRecentProjects ()
 
void DrawProjectPanel (const RecentProject &project, int index, const ImVec2 &card_size)
 
void DrawTemplatesSection ()
 
void DrawTipsSection ()
 
void DrawWhatsNew ()
 
void DrawFirstRunGuide ()
 
void DrawRecentAnnotationPopup ()
 
void DrawUndoRemovalBanner ()
 
void PersistAnimationSettings ()
 

Private Attributes

RecentProjectsModel recent_projects_model_
 
bool manually_closed_ = false
 
std::function< void()> open_rom_callback_
 
std::function< void()> new_project_callback_
 
std::function< void(const std::string &) open_project_callback_ )
 
std::function< void(const std::string &) new_project_with_template_callback_ )
 
std::function< void()> open_agent_callback_
 
std::function< void()> open_prototype_research_callback_
 
std::function< void()> open_assembly_editor_no_rom_callback_
 
std::function< void()> open_project_dialog_callback_
 
std::function< void()> open_project_management_callback_
 
std::function< void()> open_project_file_editor_callback_
 
int selected_template_ = 0
 
float animation_time_ = 0.0f
 
float card_hover_scale_ [6] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}
 
int hovered_card_ = -1
 
bool entry_animations_started_ = false
 
float entry_time_ = 0.0f
 
ImVec2 triforce_positions_ [kNumTriforces] = {}
 
ImVec2 triforce_base_positions_ [kNumTriforces] = {}
 
bool triforce_positions_initialized_ = false
 
Particle particles_ [kMaxParticles] = {}
 
int active_particle_count_ = 0
 
float particle_spawn_accumulator_ = 0.0f
 
bool show_triforce_settings_ = false
 
float triforce_alpha_multiplier_ = 1.0f
 
float triforce_speed_multiplier_ = 0.3f
 
float triforce_size_multiplier_ = 1.0f
 
bool triforce_mouse_repel_enabled_ = true
 
bool particles_enabled_ = true
 
float particle_spawn_rate_ = 2.0f
 
float left_offset_ = 0.0f
 
float right_offset_ = 0.0f
 
bool has_rom_ = false
 
bool has_project_ = false
 
RecentAnnotationKind pending_annotation_kind_ = RecentAnnotationKind::None
 
std::string pending_annotation_path_
 
char rename_buffer_ [256] = {}
 
char notes_buffer_ [1024] = {}
 
UserSettingsuser_settings_ = nullptr
 

Static Private Attributes

static constexpr float kEntryAnimDuration = 0.4f
 
static constexpr float kEntryStaggerDelay = 0.08f
 
static constexpr int kNumTriforces = 6
 
static constexpr int kMaxParticles = 50
 

Detailed Description

Modern welcome screen with project grid and quick actions.

Definition at line 20 of file welcome_screen.h.

Member Enumeration Documentation

◆ RecentAnnotationKind

Enumerator
None 
Rename 
EditNotes 

Definition at line 247 of file welcome_screen.h.

Constructor & Destructor Documentation

◆ WelcomeScreen()

yaze::editor::WelcomeScreen::WelcomeScreen ( )

Definition at line 270 of file welcome_screen.cc.

References RefreshRecentProjects().

Here is the call graph for this function:

Member Function Documentation

◆ Show()

◆ SetOpenRomCallback()

void yaze::editor::WelcomeScreen::SetOpenRomCallback ( std::function< void()> callback)
inline

Set callback for opening ROM.

Definition at line 34 of file welcome_screen.h.

References open_rom_callback_.

Referenced by yaze::editor::EditorManager::SetupWelcomeScreenCallbacks().

◆ SetNewProjectCallback()

void yaze::editor::WelcomeScreen::SetNewProjectCallback ( std::function< void()> callback)
inline

Set callback for creating new project.

Definition at line 41 of file welcome_screen.h.

References new_project_callback_.

Referenced by yaze::editor::EditorManager::SetupWelcomeScreenCallbacks().

◆ SetNewProjectWithTemplateCallback()

void yaze::editor::WelcomeScreen::SetNewProjectWithTemplateCallback ( std::function< void(const std::string &)> callback)
inline

Set callback for creating project with template.

Definition at line 48 of file welcome_screen.h.

References new_project_with_template_callback_.

Referenced by yaze::editor::EditorManager::SetupWelcomeScreenCallbacks().

◆ SetOpenProjectCallback()

void yaze::editor::WelcomeScreen::SetOpenProjectCallback ( std::function< void(const std::string &)> callback)
inline

Set callback for opening project.

Definition at line 56 of file welcome_screen.h.

References open_project_callback_.

Referenced by yaze::editor::EditorManager::SetupWelcomeScreenCallbacks().

◆ SetOpenAgentCallback()

void yaze::editor::WelcomeScreen::SetOpenAgentCallback ( std::function< void()> callback)
inline

Set callback for opening AI Agent.

Definition at line 64 of file welcome_screen.h.

References open_agent_callback_.

Referenced by yaze::editor::EditorManager::SetupWelcomeScreenCallbacks().

◆ SetOpenPrototypeResearchCallback()

void yaze::editor::WelcomeScreen::SetOpenPrototypeResearchCallback ( std::function< void()> callback)
inline

Open the graphics editor focused on prototype research (no ROM).

Definition at line 71 of file welcome_screen.h.

References open_prototype_research_callback_.

Referenced by yaze::editor::EditorManager::SetupWelcomeScreenCallbacks().

◆ SetOpenAssemblyEditorNoRomCallback()

void yaze::editor::WelcomeScreen::SetOpenAssemblyEditorNoRomCallback ( std::function< void()> callback)
inline

Open the assembly editor for file/folder work (no ROM required).

Definition at line 78 of file welcome_screen.h.

References open_assembly_editor_no_rom_callback_.

Referenced by yaze::editor::EditorManager::SetupWelcomeScreenCallbacks().

◆ SetOpenProjectDialogCallback()

void yaze::editor::WelcomeScreen::SetOpenProjectDialogCallback ( std::function< void()> callback)
inline

Set callback for opening the project file dialog.

Definition at line 85 of file welcome_screen.h.

References open_project_dialog_callback_.

Referenced by yaze::editor::EditorManager::SetupWelcomeScreenCallbacks().

◆ SetOpenProjectManagementCallback()

void yaze::editor::WelcomeScreen::SetOpenProjectManagementCallback ( std::function< void()> callback)
inline

Set callback for showing project management.

Definition at line 92 of file welcome_screen.h.

References open_project_management_callback_.

Referenced by yaze::editor::EditorManager::SetupWelcomeScreenCallbacks().

◆ SetOpenProjectFileEditorCallback()

void yaze::editor::WelcomeScreen::SetOpenProjectFileEditorCallback ( std::function< void()> callback)
inline

Set callback for showing the project file editor.

Definition at line 99 of file welcome_screen.h.

References open_project_file_editor_callback_.

Referenced by yaze::editor::EditorManager::SetupWelcomeScreenCallbacks().

◆ RefreshRecentProjects()

void yaze::editor::WelcomeScreen::RefreshRecentProjects ( bool force = false)

Refresh recent projects list from the project manager.

Cheap on the no-op path: compares the RecentFilesManager generation counter against a cached value and short-circuits when unchanged. Pass force=true to bypass the cache (e.g. on manual "Refresh").

Definition at line 680 of file welcome_screen.cc.

References recent_projects_model_, and yaze::editor::RecentProjectsModel::Refresh().

Referenced by WelcomeScreen().

Here is the call graph for this function:

◆ UpdateAnimations()

void yaze::editor::WelcomeScreen::UpdateAnimations ( )

Update animation time for dynamic effects.

Definition at line 666 of file welcome_screen.cc.

References animation_time_, card_hover_scale_, and hovered_card_.

Referenced by Show().

◆ ShouldShow()

bool yaze::editor::WelcomeScreen::ShouldShow ( ) const
inline

Check if screen should be shown.

Definition at line 120 of file welcome_screen.h.

References manually_closed_.

◆ MarkManuallyClosed()

void yaze::editor::WelcomeScreen::MarkManuallyClosed ( )
inline

Mark as manually closed (don't show again this session)

Definition at line 125 of file welcome_screen.h.

References manually_closed_.

◆ SetLayoutOffsets()

void yaze::editor::WelcomeScreen::SetLayoutOffsets ( float left,
float right )
inline

Set layout offsets for sidebar awareness.

Parameters
leftLeft sidebar width (0 if hidden)
rightRight panel width (0 if hidden)

Definition at line 132 of file welcome_screen.h.

References left_offset_, and right_offset_.

◆ SetContextState()

void yaze::editor::WelcomeScreen::SetContextState ( bool has_rom,
bool has_project )
inline

Set context state for gating actions.

Definition at line 140 of file welcome_screen.h.

References has_project_, and has_rom_.

◆ SetUserSettings()

void yaze::editor::WelcomeScreen::SetUserSettings ( UserSettings * settings)

Wire persisted user settings so animation tweaks survive restart.

Call once after construction (from UICoordinator). Animation sliders then load initial values from the preferences and write back + trigger Save() whenever the user adjusts them.

Definition at line 274 of file welcome_screen.cc.

References particles_enabled_, yaze::editor::UserSettings::prefs(), triforce_alpha_multiplier_, triforce_mouse_repel_enabled_, triforce_size_multiplier_, triforce_speed_multiplier_, user_settings_, and yaze::editor::UserSettings::Preferences::welcome_triforce_alpha.

Here is the call graph for this function:

◆ recent_projects() [1/2]

RecentProjectsModel & yaze::editor::WelcomeScreen::recent_projects ( )
inline

Accessor used by command-palette wiring so the same recent list drives both the visual cards and the palette's per-entry actions.

Definition at line 158 of file welcome_screen.h.

References recent_projects_model_.

◆ recent_projects() [2/2]

const RecentProjectsModel & yaze::editor::WelcomeScreen::recent_projects ( ) const
inline

Definition at line 159 of file welcome_screen.h.

References recent_projects_model_.

◆ DrawHeader()

void yaze::editor::WelcomeScreen::DrawHeader ( )
private

◆ DrawQuickActions()

◆ DrawRecentProjects()

void yaze::editor::WelcomeScreen::DrawRecentProjects ( )
private

Definition at line 1015 of file welcome_screen.cc.

References yaze::editor::GetStaggeredEntryProgress(), yaze::gui::GetTextSecondaryVec4(), ICON_MD_DELETE_SWEEP, ICON_MD_EXPLORE, ICON_MD_FOLDER_SPECIAL, and ICON_MD_HISTORY.

Referenced by Show().

Here is the call graph for this function:

◆ DrawProjectPanel()

◆ DrawTemplatesSection()

◆ DrawTipsSection()

void yaze::editor::WelcomeScreen::DrawTipsSection ( )
private

Definition at line 1791 of file welcome_screen.cc.

References yaze::editor::GetStaggeredEntryProgress(), ICON_MD_CLOSE, and ICON_MD_LIGHTBULB.

Referenced by Show().

Here is the call graph for this function:

◆ DrawWhatsNew()

◆ DrawFirstRunGuide()

void yaze::editor::WelcomeScreen::DrawFirstRunGuide ( )
private

◆ DrawRecentAnnotationPopup()

void yaze::editor::WelcomeScreen::DrawRecentAnnotationPopup ( )
private

Definition at line 1140 of file welcome_screen.cc.

References yaze::gui::GetTextSecondaryVec4(), ICON_MD_CHECK, ICON_MD_CLOSE, ICON_MD_EDIT, and ICON_MD_NOTE.

Here is the call graph for this function:

◆ DrawUndoRemovalBanner()

void yaze::editor::WelcomeScreen::DrawUndoRemovalBanner ( )
private

Definition at line 1217 of file welcome_screen.cc.

References yaze::gui::ConvertColorToImVec4(), yaze::gui::ThemeManager::Get(), ICON_MD_CLOSE, ICON_MD_INFO, and ICON_MD_UNDO.

Here is the call graph for this function:

◆ PersistAnimationSettings()

Member Data Documentation

◆ recent_projects_model_

RecentProjectsModel yaze::editor::WelcomeScreen::recent_projects_model_
private

◆ manually_closed_

bool yaze::editor::WelcomeScreen::manually_closed_ = false
private

Definition at line 177 of file welcome_screen.h.

Referenced by MarkManuallyClosed(), and ShouldShow().

◆ open_rom_callback_

std::function<void()> yaze::editor::WelcomeScreen::open_rom_callback_
private

Definition at line 180 of file welcome_screen.h.

Referenced by DrawQuickActions(), and SetOpenRomCallback().

◆ new_project_callback_

std::function<void()> yaze::editor::WelcomeScreen::new_project_callback_
private

Definition at line 181 of file welcome_screen.h.

Referenced by SetNewProjectCallback().

◆ open_project_callback_

std::function<void(const std::string&) yaze::editor::WelcomeScreen::open_project_callback_)
private

Definition at line 182 of file welcome_screen.h.

Referenced by DrawQuickActions(), and SetOpenProjectCallback().

◆ new_project_with_template_callback_

std::function<void(const std::string&) yaze::editor::WelcomeScreen::new_project_with_template_callback_)
private

Definition at line 183 of file welcome_screen.h.

Referenced by SetNewProjectWithTemplateCallback().

◆ open_agent_callback_

std::function<void()> yaze::editor::WelcomeScreen::open_agent_callback_
private

Definition at line 184 of file welcome_screen.h.

Referenced by SetOpenAgentCallback().

◆ open_prototype_research_callback_

std::function<void()> yaze::editor::WelcomeScreen::open_prototype_research_callback_
private

Definition at line 185 of file welcome_screen.h.

Referenced by DrawQuickActions(), and SetOpenPrototypeResearchCallback().

◆ open_assembly_editor_no_rom_callback_

std::function<void()> yaze::editor::WelcomeScreen::open_assembly_editor_no_rom_callback_
private

Definition at line 186 of file welcome_screen.h.

Referenced by DrawQuickActions(), and SetOpenAssemblyEditorNoRomCallback().

◆ open_project_dialog_callback_

std::function<void()> yaze::editor::WelcomeScreen::open_project_dialog_callback_
private

Definition at line 187 of file welcome_screen.h.

Referenced by SetOpenProjectDialogCallback().

◆ open_project_management_callback_

std::function<void()> yaze::editor::WelcomeScreen::open_project_management_callback_
private

Definition at line 188 of file welcome_screen.h.

Referenced by SetOpenProjectManagementCallback().

◆ open_project_file_editor_callback_

std::function<void()> yaze::editor::WelcomeScreen::open_project_file_editor_callback_
private

Definition at line 189 of file welcome_screen.h.

Referenced by SetOpenProjectFileEditorCallback().

◆ selected_template_

int yaze::editor::WelcomeScreen::selected_template_ = 0
private

Definition at line 192 of file welcome_screen.h.

◆ animation_time_

float yaze::editor::WelcomeScreen::animation_time_ = 0.0f
private

Definition at line 195 of file welcome_screen.h.

Referenced by Show(), and UpdateAnimations().

◆ card_hover_scale_

float yaze::editor::WelcomeScreen::card_hover_scale_[6] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}
private

Definition at line 196 of file welcome_screen.h.

Referenced by UpdateAnimations().

◆ hovered_card_

int yaze::editor::WelcomeScreen::hovered_card_ = -1
private

Definition at line 197 of file welcome_screen.h.

Referenced by UpdateAnimations().

◆ entry_animations_started_

bool yaze::editor::WelcomeScreen::entry_animations_started_ = false
private

Definition at line 200 of file welcome_screen.h.

Referenced by Show().

◆ entry_time_

float yaze::editor::WelcomeScreen::entry_time_ = 0.0f
private

Definition at line 201 of file welcome_screen.h.

Referenced by DrawFirstRunGuide(), DrawHeader(), DrawQuickActions(), and Show().

◆ kEntryAnimDuration

constexpr float yaze::editor::WelcomeScreen::kEntryAnimDuration = 0.4f
staticconstexprprivate

Definition at line 202 of file welcome_screen.h.

Referenced by DrawFirstRunGuide(), DrawHeader(), and DrawQuickActions().

◆ kEntryStaggerDelay

constexpr float yaze::editor::WelcomeScreen::kEntryStaggerDelay = 0.08f
staticconstexprprivate

Definition at line 203 of file welcome_screen.h.

Referenced by DrawFirstRunGuide(), DrawHeader(), and DrawQuickActions().

◆ kNumTriforces

constexpr int yaze::editor::WelcomeScreen::kNumTriforces = 6
staticconstexprprivate

Definition at line 206 of file welcome_screen.h.

Referenced by Show().

◆ triforce_positions_

ImVec2 yaze::editor::WelcomeScreen::triforce_positions_[kNumTriforces] = {}
private

Definition at line 207 of file welcome_screen.h.

Referenced by Show().

◆ triforce_base_positions_

ImVec2 yaze::editor::WelcomeScreen::triforce_base_positions_[kNumTriforces] = {}
private

Definition at line 208 of file welcome_screen.h.

Referenced by Show().

◆ triforce_positions_initialized_

bool yaze::editor::WelcomeScreen::triforce_positions_initialized_ = false
private

Definition at line 209 of file welcome_screen.h.

Referenced by Show().

◆ kMaxParticles

constexpr int yaze::editor::WelcomeScreen::kMaxParticles = 50
staticconstexprprivate

Definition at line 212 of file welcome_screen.h.

Referenced by Show().

◆ particles_

Particle yaze::editor::WelcomeScreen::particles_[kMaxParticles] = {}
private

Definition at line 221 of file welcome_screen.h.

Referenced by Show().

◆ active_particle_count_

int yaze::editor::WelcomeScreen::active_particle_count_ = 0
private

Definition at line 222 of file welcome_screen.h.

Referenced by Show().

◆ particle_spawn_accumulator_

float yaze::editor::WelcomeScreen::particle_spawn_accumulator_ = 0.0f
private

Definition at line 226 of file welcome_screen.h.

Referenced by Show().

◆ show_triforce_settings_

bool yaze::editor::WelcomeScreen::show_triforce_settings_ = false
private

Definition at line 229 of file welcome_screen.h.

◆ triforce_alpha_multiplier_

float yaze::editor::WelcomeScreen::triforce_alpha_multiplier_ = 1.0f
private

Definition at line 230 of file welcome_screen.h.

Referenced by PersistAnimationSettings(), SetUserSettings(), and Show().

◆ triforce_speed_multiplier_

float yaze::editor::WelcomeScreen::triforce_speed_multiplier_ = 0.3f
private

Definition at line 231 of file welcome_screen.h.

Referenced by PersistAnimationSettings(), SetUserSettings(), and Show().

◆ triforce_size_multiplier_

float yaze::editor::WelcomeScreen::triforce_size_multiplier_ = 1.0f
private

Definition at line 232 of file welcome_screen.h.

Referenced by PersistAnimationSettings(), SetUserSettings(), and Show().

◆ triforce_mouse_repel_enabled_

bool yaze::editor::WelcomeScreen::triforce_mouse_repel_enabled_ = true
private

Definition at line 233 of file welcome_screen.h.

Referenced by PersistAnimationSettings(), SetUserSettings(), and Show().

◆ particles_enabled_

bool yaze::editor::WelcomeScreen::particles_enabled_ = true
private

Definition at line 234 of file welcome_screen.h.

Referenced by PersistAnimationSettings(), SetUserSettings(), and Show().

◆ particle_spawn_rate_

float yaze::editor::WelcomeScreen::particle_spawn_rate_ = 2.0f
private

Definition at line 235 of file welcome_screen.h.

Referenced by Show().

◆ left_offset_

float yaze::editor::WelcomeScreen::left_offset_ = 0.0f
private

Definition at line 238 of file welcome_screen.h.

Referenced by SetLayoutOffsets(), and Show().

◆ right_offset_

float yaze::editor::WelcomeScreen::right_offset_ = 0.0f
private

Definition at line 239 of file welcome_screen.h.

Referenced by SetLayoutOffsets(), and Show().

◆ has_rom_

bool yaze::editor::WelcomeScreen::has_rom_ = false
private

Definition at line 242 of file welcome_screen.h.

Referenced by DrawFirstRunGuide(), and SetContextState().

◆ has_project_

bool yaze::editor::WelcomeScreen::has_project_ = false
private

Definition at line 243 of file welcome_screen.h.

Referenced by SetContextState().

◆ pending_annotation_kind_

RecentAnnotationKind yaze::editor::WelcomeScreen::pending_annotation_kind_ = RecentAnnotationKind::None
private

Definition at line 248 of file welcome_screen.h.

◆ pending_annotation_path_

std::string yaze::editor::WelcomeScreen::pending_annotation_path_
private

Definition at line 249 of file welcome_screen.h.

◆ rename_buffer_

char yaze::editor::WelcomeScreen::rename_buffer_[256] = {}
private

Definition at line 250 of file welcome_screen.h.

◆ notes_buffer_

char yaze::editor::WelcomeScreen::notes_buffer_[1024] = {}
private

Definition at line 251 of file welcome_screen.h.

◆ user_settings_

UserSettings* yaze::editor::WelcomeScreen::user_settings_ = nullptr
private

Definition at line 255 of file welcome_screen.h.

Referenced by PersistAnimationSettings(), and SetUserSettings().


The documentation for this class was generated from the following files: