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 SetOpenProjectCallback (std::function< void(const std::string &)> callback)
 Set callback for opening project.
 
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 SetOpenProjectManagementCallback (std::function< void()> callback)
 Set callback for showing project management.
 
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)
 Set whether a ROM is currently loaded for first-run guidance.
 
void SetUserSettings (UserSettings *settings)
 Load persisted Welcome-screen animation preferences.
 
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 DrawFooterBar ()
 
void DrawFirstRunGuide ()
 
void DrawRecentAnnotationPopup ()
 
void DrawUndoRemovalBanner ()
 

Static Private Member Functions

static bool ShouldUseStackedLayout (float content_width, float content_height, float layout_scale)
 
static int CalculateVisibleRecentCount (int entry_count, float available_height, float row_height, float row_gap, float more_line_height)
 
static const RecentProjectFindResumeProject (const std::vector< RecentProject > &entries)
 

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()> open_prototype_research_callback_
 
std::function< void()> open_assembly_editor_no_rom_callback_
 
std::function< void()> open_project_management_callback_
 
float animation_time_ = 0.0f
 
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
 
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 release_notes_open_failed_ = false
 
RecentAnnotationKind pending_annotation_kind_ = RecentAnnotationKind::None
 
std::string pending_annotation_path_
 
char rename_buffer_ [256] = {}
 
char notes_buffer_ [1024] = {}
 

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
 

Friends

class WelcomeScreenTestPeer
 

Detailed Description

Modern welcome screen with project grid and quick actions.

Definition at line 21 of file welcome_screen.h.

Member Enumeration Documentation

◆ RecentAnnotationKind

Enumerator
None 
Rename 
EditNotes 

Definition at line 209 of file welcome_screen.h.

Constructor & Destructor Documentation

◆ WelcomeScreen()

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

Definition at line 212 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 35 of file welcome_screen.h.

References open_rom_callback_.

◆ SetNewProjectCallback()

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

Set callback for creating new project.

Definition at line 42 of file welcome_screen.h.

References new_project_callback_.

◆ SetOpenProjectCallback()

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

Set callback for opening project.

Definition at line 49 of file welcome_screen.h.

References open_project_callback_.

◆ SetOpenPrototypeResearchCallback()

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

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

Definition at line 57 of file welcome_screen.h.

References open_prototype_research_callback_.

◆ 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 64 of file welcome_screen.h.

References open_assembly_editor_no_rom_callback_.

◆ SetOpenProjectManagementCallback()

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

Set callback for showing project management.

Definition at line 71 of file welcome_screen.h.

References open_project_management_callback_.

◆ 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 584 of file welcome_screen.cc.

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

Referenced by DrawRecentProjects(), DrawUndoRemovalBanner(), and WelcomeScreen().

Here is the call graph for this function:

◆ UpdateAnimations()

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

Update animation time for dynamic effects.

Definition at line 577 of file welcome_screen.cc.

References animation_time_.

Referenced by Show().

◆ ShouldShow()

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

Check if screen should be shown.

Definition at line 92 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 97 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 104 of file welcome_screen.h.

References left_offset_, and right_offset_.

◆ SetContextState()

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

Set whether a ROM is currently loaded for first-run guidance.

Definition at line 112 of file welcome_screen.h.

References has_rom_.

◆ SetUserSettings()

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

◆ 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 123 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 124 of file welcome_screen.h.

References recent_projects_model_.

◆ DrawHeader()

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

Definition at line 588 of file welcome_screen.cc.

References entry_time_, yaze::editor::GetStaggeredEntryProgress(), yaze::gui::GetTextSecondaryVec4(), ICON_MD_CASTLE, kEntryAnimDuration, and kEntryStaggerDelay.

Referenced by Show().

Here is the call graph for this function:

◆ DrawQuickActions()

◆ DrawRecentProjects()

◆ DrawProjectPanel()

◆ DrawFooterBar()

◆ DrawFirstRunGuide()

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

◆ DrawRecentAnnotationPopup()

◆ DrawUndoRemovalBanner()

◆ ShouldUseStackedLayout()

bool yaze::editor::WelcomeScreen::ShouldUseStackedLayout ( float content_width,
float content_height,
float layout_scale )
staticprivate

Definition at line 227 of file welcome_screen.cc.

Referenced by Show().

◆ CalculateVisibleRecentCount()

int yaze::editor::WelcomeScreen::CalculateVisibleRecentCount ( int entry_count,
float available_height,
float row_height,
float row_gap,
float more_line_height )
staticprivate

Definition at line 979 of file welcome_screen.cc.

Referenced by DrawRecentProjects().

◆ FindResumeProject()

const RecentProject * yaze::editor::WelcomeScreen::FindResumeProject ( const std::vector< RecentProject > & entries)
staticprivate

Definition at line 881 of file welcome_screen.cc.

References yaze::editor::RecentProject::recent_index.

Referenced by DrawQuickActions().

Friends And Related Symbol Documentation

◆ WelcomeScreenTestPeer

friend class WelcomeScreenTestPeer
friend

Definition at line 129 of file welcome_screen.h.

Member Data Documentation

◆ recent_projects_model_

◆ manually_closed_

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

Definition at line 150 of file welcome_screen.h.

Referenced by DrawFooterBar(), MarkManuallyClosed(), and ShouldShow().

◆ open_rom_callback_

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

Definition at line 153 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 154 of file welcome_screen.h.

Referenced by DrawQuickActions(), and SetNewProjectCallback().

◆ open_project_callback_

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

Definition at line 155 of file welcome_screen.h.

Referenced by DrawProjectPanel(), DrawQuickActions(), and SetOpenProjectCallback().

◆ open_prototype_research_callback_

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

Definition at line 156 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 157 of file welcome_screen.h.

Referenced by DrawQuickActions(), and SetOpenAssemblyEditorNoRomCallback().

◆ open_project_management_callback_

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

Definition at line 158 of file welcome_screen.h.

Referenced by DrawRecentProjects(), and SetOpenProjectManagementCallback().

◆ animation_time_

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

Definition at line 161 of file welcome_screen.h.

Referenced by Show(), and UpdateAnimations().

◆ entry_animations_started_

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

Definition at line 163 of file welcome_screen.h.

Referenced by Show().

◆ entry_time_

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

◆ kEntryAnimDuration

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

◆ kEntryStaggerDelay

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

◆ kNumTriforces

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

Definition at line 169 of file welcome_screen.h.

Referenced by Show().

◆ triforce_positions_

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

Definition at line 170 of file welcome_screen.h.

Referenced by Show().

◆ triforce_base_positions_

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

Definition at line 171 of file welcome_screen.h.

Referenced by Show().

◆ triforce_positions_initialized_

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

Definition at line 172 of file welcome_screen.h.

Referenced by Show().

◆ kMaxParticles

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

Definition at line 175 of file welcome_screen.h.

Referenced by Show().

◆ particles_

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

Definition at line 184 of file welcome_screen.h.

Referenced by Show().

◆ active_particle_count_

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

Definition at line 185 of file welcome_screen.h.

Referenced by Show().

◆ particle_spawn_accumulator_

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

Definition at line 189 of file welcome_screen.h.

Referenced by Show().

◆ triforce_alpha_multiplier_

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

Definition at line 192 of file welcome_screen.h.

Referenced by SetUserSettings(), and Show().

◆ triforce_speed_multiplier_

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

Definition at line 193 of file welcome_screen.h.

Referenced by SetUserSettings(), and Show().

◆ triforce_size_multiplier_

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

Definition at line 194 of file welcome_screen.h.

Referenced by SetUserSettings(), and Show().

◆ triforce_mouse_repel_enabled_

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

Definition at line 195 of file welcome_screen.h.

Referenced by SetUserSettings(), and Show().

◆ particles_enabled_

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

Definition at line 196 of file welcome_screen.h.

Referenced by SetUserSettings(), and Show().

◆ particle_spawn_rate_

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

Definition at line 197 of file welcome_screen.h.

Referenced by Show().

◆ left_offset_

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

Definition at line 200 of file welcome_screen.h.

Referenced by SetLayoutOffsets(), and Show().

◆ right_offset_

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

Definition at line 201 of file welcome_screen.h.

Referenced by SetLayoutOffsets(), and Show().

◆ has_rom_

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

Definition at line 204 of file welcome_screen.h.

Referenced by DrawFirstRunGuide(), and SetContextState().

◆ release_notes_open_failed_

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

Definition at line 205 of file welcome_screen.h.

Referenced by DrawFooterBar().

◆ pending_annotation_kind_

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

Definition at line 210 of file welcome_screen.h.

Referenced by DrawProjectPanel(), and DrawRecentAnnotationPopup().

◆ pending_annotation_path_

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

Definition at line 211 of file welcome_screen.h.

Referenced by DrawProjectPanel(), and DrawRecentAnnotationPopup().

◆ rename_buffer_

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

Definition at line 212 of file welcome_screen.h.

Referenced by DrawProjectPanel(), and DrawRecentAnnotationPopup().

◆ notes_buffer_

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

Definition at line 213 of file welcome_screen.h.

Referenced by DrawProjectPanel(), and DrawRecentAnnotationPopup().


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