diff --git a/Data/Images/splash.png b/Data/Images/splash.png new file mode 100644 index 00000000..afd9885e Binary files /dev/null and b/Data/Images/splash.png differ diff --git a/Editor/Source/Editor/Windows/EditorInterface.cpp b/Editor/Source/Editor/Windows/EditorInterface.cpp index e34d720d..9e763a01 100644 --- a/Editor/Source/Editor/Windows/EditorInterface.cpp +++ b/Editor/Source/Editor/Windows/EditorInterface.cpp @@ -2593,7 +2593,7 @@ namespace Nuake { if (_WelcomeWindow->IsProjectQueued() && frameCount > 0) { // draw splash - LoadingSplash::Get().Draw(); + LoadingSplash::Get().Draw(_WelcomeWindow->queuedProjectPath); frameCount--; if (frameCount == 0) diff --git a/Editor/Source/Editor/Windows/LoadingSplash.cpp b/Editor/Source/Editor/Windows/LoadingSplash.cpp index d47c6848..e8d71556 100644 --- a/Editor/Source/Editor/Windows/LoadingSplash.cpp +++ b/Editor/Source/Editor/Windows/LoadingSplash.cpp @@ -4,7 +4,7 @@ #include #include "Nuake/Window.h" - +#include "Nuake/UI/ImUI.h" #include @@ -16,15 +16,15 @@ using namespace Nuake; LoadingSplash::LoadingSplash() { _NuakeLogo = Nuake::TextureManager::Get()->GetTexture2(NUAKE_LOGO_PATH); + _NuakeSplash = Nuake::TextureManager::Get()->GetTexture2(NUAKE_SPLASH_PATH); Nuake::Window::Get()->SetDecorated(false); - Nuake::Window::Get()->SetSize({ 640, 480 }); + Nuake::Window::Get()->SetSize({ 640, 400 }); Nuake::Window::Get()->Center(); } -void LoadingSplash::Draw() +void LoadingSplash::Draw(const std::string& project) { - // Make viewport fullscreen ImGuiViewport* viewport = ImGui::GetMainViewport(); ImGui::SetNextWindowPos(viewport->Pos); @@ -32,17 +32,22 @@ void LoadingSplash::Draw() ImGui::SetNextWindowViewport(viewport->ID); ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f); - ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(32.0f, 32.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f)); ImGui::Begin("Welcome Screen", 0, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoResize); { - // Draw Nuake logo - { - const Vector2 logoSize = _NuakeLogo->GetSize(); - const ImVec2 imguiSize = ImVec2(logoSize.x, logoSize.y); - ImGui::Image((ImTextureID)_NuakeLogo->GetImGuiDescriptorSet(), imguiSize); - } + const Vector2 splashSize = _NuakeSplash->GetSize(); + const ImVec2 splashImguiSize = ImVec2(splashSize.x, splashSize.y); + ImGui::Image((ImTextureID)_NuakeSplash->GetImGuiDescriptorSet(), splashImguiSize, {0, 1}, {1, 0}); - ImGui::Text("LOADING SCENE..."); + ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 8.0f); + ImGui::SetCursorPosX(8.0f); + { + UIFont font(Fonts::Bold); + ImGui::Text("Loading project... "); + } + ImGui::SetCursorPosX(8.0f); + ImGui::TextColored({ 1.0, 1.0, 1.0, 0.5 }, project.c_str()); + //ImGui::Text(project.c_str()); } ImGui::End(); diff --git a/Editor/Source/Editor/Windows/LoadingSplash.h b/Editor/Source/Editor/Windows/LoadingSplash.h index d06249da..3689d529 100644 --- a/Editor/Source/Editor/Windows/LoadingSplash.h +++ b/Editor/Source/Editor/Windows/LoadingSplash.h @@ -14,8 +14,9 @@ class LoadingSplash { private: const std::string NUAKE_LOGO_PATH = "Resources/Images/logo_white.png"; + const std::string NUAKE_SPLASH_PATH = "Resources/Images/splash.png"; Ref _NuakeLogo; - + Ref _NuakeSplash; public: static LoadingSplash& Get() { @@ -26,5 +27,5 @@ public: LoadingSplash(); ~LoadingSplash() = default; - void Draw(); + void Draw(const std::string& projectPath); }; \ No newline at end of file diff --git a/Editor/Source/Editor/Windows/WelcomeWindow.h b/Editor/Source/Editor/Windows/WelcomeWindow.h index 60229543..a6c943ff 100644 --- a/Editor/Source/Editor/Windows/WelcomeWindow.h +++ b/Editor/Source/Editor/Windows/WelcomeWindow.h @@ -42,10 +42,10 @@ namespace Nuake int32_t SelectedProject = -1; std::vector _Projects; - std::string queuedProjectPath; std::string queuedRemovalPath; public: + std::string queuedProjectPath; WelcomeWindow(Nuake::EditorInterface* editor); ~WelcomeWindow() = default;