mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Better splash screen
This commit is contained in:
BIN
Data/Images/splash.png
Normal file
BIN
Data/Images/splash.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 170 KiB |
@@ -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)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <Nuake/Core/Maths.h>
|
||||
#include "Nuake/Window.h"
|
||||
|
||||
#include "Nuake/UI/ImUI.h"
|
||||
|
||||
#include <imgui/imgui.h>
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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<Nuake::VulkanImage> _NuakeLogo;
|
||||
|
||||
Ref<Nuake::VulkanImage> _NuakeSplash;
|
||||
public:
|
||||
static LoadingSplash& Get()
|
||||
{
|
||||
@@ -26,5 +27,5 @@ public:
|
||||
LoadingSplash();
|
||||
~LoadingSplash() = default;
|
||||
|
||||
void Draw();
|
||||
void Draw(const std::string& projectPath);
|
||||
};
|
||||
@@ -42,10 +42,10 @@ namespace Nuake
|
||||
|
||||
int32_t SelectedProject = -1;
|
||||
std::vector<ProjectPreview> _Projects;
|
||||
std::string queuedProjectPath;
|
||||
std::string queuedRemovalPath;
|
||||
|
||||
public:
|
||||
std::string queuedProjectPath;
|
||||
WelcomeWindow(Nuake::EditorInterface* editor);
|
||||
~WelcomeWindow() = default;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user