Polyphase Game Engine
Loading...
Searching...
No Matches
ProjectSelectWindow.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include <string>
6#include <vector>
7
17class ProjectSelectWindow
18{
19public:
20 ProjectSelectWindow();
21 ~ProjectSelectWindow();
22
23 void Open();
24 void Close();
25 void Draw();
26 bool IsOpen() const { return mIsOpen; }
27
29 void OpenIfNoProject();
30
31private:
32 void DrawRecentProjects();
33 void DrawCreateProject();
34 void DrawCloneFromGit();
35 void DrawTemplates();
36 void DrawAddTemplatePopup();
37
38 void OnOpenProject(const std::string& path);
39 void OnBrowseProject();
40 void OnCreateNewProject();
41 void OnCreateFromTemplate(const std::string& templateId);
42 void OnRemoveRecentProject(const std::string& path);
43 void OnAddTemplateFromGitHub();
44
45 bool mIsOpen = false;
46 int mSelectedTab = 0;
47
48 // Add Template popup state
49 bool mShowAddTemplatePopup = false;
50 char mGitHubUrlBuffer[512] = {};
51 std::string mAddTemplateError;
52
53 // Create New Project state
54 char mProjectNameBuffer[256] = {};
55 char mProjectPathBuffer[512] = {};
56 int mProjectType = 0; // 0 = Lua, 1 = C++
57 bool mInitGitRepo = false;
58 int mSelectedTemplateIndex = -1;
59
60 // Clone From Git state
61 int mCloneUrlMode = 0; // 0 = HTTPS, 1 = SSH
62 char mCloneHttpsUrl[512] = {};
63 char mCloneSshRepoPath[256] = {};
64 char mCloneProjectName[256] = {};
65 char mCloneLocation[512] = {};
66 int mCloneProjectType = 0; // 0 = Lua, 1 = C++
67 int mCloneSshHostIndex = -1;
68 bool mCloneInProgress = false;
69 bool mCloneDone = false;
70 std::string mCloneResult;
71 int mCloneResultLevel = 0;
72
73 // Recent projects removal tracking
74 std::vector<std::string> mProjectsToRemove;
75};
76
77ProjectSelectWindow* GetProjectSelectWindow();
78
79#endif