yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
welcome_screen.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_UI_WELCOME_SCREEN_H_
2#define YAZE_APP_EDITOR_UI_WELCOME_SCREEN_H_
3
4#include <functional>
5#include <string>
6#include <vector>
7
8#include "imgui/imgui.h"
9
10namespace yaze {
11namespace editor {
12
18 std::string name;
19 std::string filepath;
20 std::string rom_title;
21 std::string last_modified;
22 std::string thumbnail_path; // Optional screenshot
23 int days_ago = 0;
24};
25
31 public:
33
39 bool Show(bool* p_open);
40
44 void SetOpenRomCallback(std::function<void()> callback) {
45 open_rom_callback_ = callback;
46 }
47
51 void SetNewProjectCallback(std::function<void()> callback) {
52 new_project_callback_ = callback;
53 }
54
58 void SetOpenProjectCallback(std::function<void(const std::string&)> callback) {
59 open_project_callback_ = callback;
60 }
61
66
70 void UpdateAnimations();
71
75 bool ShouldShow() const { return !manually_closed_; }
76
81
82 private:
83 void DrawHeader();
84 void DrawQuickActions();
85 void DrawRecentProjects();
86 void DrawProjectCard(const RecentProject& project, int index);
88 void DrawTipsSection();
89 void DrawWhatsNew();
90
91 std::vector<RecentProject> recent_projects_;
92 bool manually_closed_ = false;
93
94 // Callbacks
95 std::function<void()> open_rom_callback_;
96 std::function<void()> new_project_callback_;
97 std::function<void(const std::string&)> open_project_callback_;
98
99 // UI state
101 static constexpr int kMaxRecentProjects = 6;
102
103 // Animation state
104 float animation_time_ = 0.0f;
105 float card_hover_scale_[6] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f};
107
108 // Interactive triforce positions (smooth interpolation)
109 static constexpr int kNumTriforces = 6;
113
114 // Particle system
115 static constexpr int kMaxParticles = 50;
116 struct Particle {
117 ImVec2 position;
118 ImVec2 velocity;
119 float size;
120 float alpha;
121 float lifetime;
123 };
126
127 // Triforce animation settings
130 float triforce_speed_multiplier_ = 0.3f; // Default slower speed
134 float particle_spawn_rate_ = 2.0f; // Particles per second
135};
136
137} // namespace editor
138} // namespace yaze
139
140#endif // YAZE_APP_EDITOR_UI_WELCOME_SCREEN_H_
Modern welcome screen with project grid and quick actions.
std::function< void()> open_rom_callback_
std::function< void()> new_project_callback_
void SetNewProjectCallback(std::function< void()> callback)
Set callback for creating new project.
void MarkManuallyClosed()
Mark as manually closed (don't show again this session)
void RefreshRecentProjects()
Refresh recent projects list from the project manager.
static constexpr int kNumTriforces
std::vector< RecentProject > recent_projects_
bool ShouldShow() const
Check if screen should be shown.
void SetOpenRomCallback(std::function< void()> callback)
Set callback for opening ROM.
ImVec2 triforce_base_positions_[kNumTriforces]
Particle particles_[kMaxParticles]
void UpdateAnimations()
Update animation time for dynamic effects.
static constexpr int kMaxParticles
bool Show(bool *p_open)
Show the welcome screen.
ImVec2 triforce_positions_[kNumTriforces]
static constexpr int kMaxRecentProjects
void SetOpenProjectCallback(std::function< void(const std::string &)> callback)
Set callback for opening project.
std::function< void(const std::string &)> open_project_callback_
void DrawProjectCard(const RecentProject &project, int index)
Main namespace for the application.
Information about a recently used project.