update UI effect on the sample

This commit is contained in:
Arnaud Jamin committed 2023-10-10 00:20:12 -04:00
1 parent 9ec695e65b
commit 0dca669326
48 files changed
+68 -1

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -80,6 +80,8 @@ void UCogWindow::Render(float DeltaTime)
RenderContent();
ImGui::End();
}
PostRender();
}
//--------------------------------------------------------------------------------------------------------------------------
@@ -3,6 +3,7 @@
#include "CogImguiModule.h"
#include "CogImguiWidget.h"
#include "CogWindowWidgets.h"
#include "CogWindow_Spacing.h"
#include "Engine/Engine.h"
#include "imgui_internal.h"
@@ -27,6 +28,11 @@ void UCogWindowManager::Initialize(UWorld* InWorld, TSharedPtr<SCogImguiWidget>
IniHandler.WriteAllFn = UCogWindowManager::SettingsHandler_WriteAll;
IniHandler.UserData = this;
ImGui::AddSettingsHandler(&IniHandler);
SpaceWindows.Add(CreateWindow<UCogWindow_Spacing>("Space 1", false));
SpaceWindows.Add(CreateWindow<UCogWindow_Spacing>("Space 2", false));
SpaceWindows.Add(CreateWindow<UCogWindow_Spacing>("Space 3", false));
SpaceWindows.Add(CreateWindow<UCogWindow_Spacing>("Space 4", false));
}
//--------------------------------------------------------------------------------------------------------------------------
@@ -66,7 +72,9 @@ void UCogWindowManager::Tick(float DeltaTime)
//--------------------------------------------------------------------------------------------------------------------------
void UCogWindowManager::Render(float DeltaTime)
{
ImGui::DockSpaceOverViewport(0, ImGuiDockNodeFlags_PassthruCentralNode | ImGuiDockNodeFlags_NoDockingInCentralNode);
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0));
ImGui::DockSpaceOverViewport(0, ImGuiDockNodeFlags_PassthruCentralNode | ImGuiDockNodeFlags_NoDockingInCentralNode | ImGuiDockNodeFlags_AutoHideTabBar);
ImGui::PopStyleColor(1);
bool bCompactSaved = bCompactMode;
if (bCompactSaved)
@@ -92,6 +100,8 @@ void UCogWindowManager::Render(float DeltaTime)
{
ImGui::SetNextWindowBgAlpha(0.35f);
}
ImGui::DockSpaceOverViewport(0, ImGuiDockNodeFlags_PassthruCentralNode | ImGuiDockNodeFlags_NoDockingInCentralNode | ImGuiDockNodeFlags_AutoHideTabBar);
Window->Render(DeltaTime);
}
}
@@ -277,6 +287,21 @@ void UCogWindowManager::DrawMainMenu()
ImGui::Separator();
if (ImGui::BeginMenu("Spacing"))
{
for (UCogWindow* SpaceWindow : SpaceWindows)
{
bool bSpaceVisible = SpaceWindow->GetIsVisible();
if (ImGui::MenuItem(TCHAR_TO_ANSI(*SpaceWindow->GetName()), nullptr, &bSpaceVisible))
{
SpaceWindow->SetIsVisible(bSpaceVisible);
}
}
ImGui::EndMenu();
}
ImGui::Separator();
ImGui::MenuItem("Compact Mode", nullptr, &bCompactMode);
ImGui::Text("DPI Scale");
@@ -0,0 +1,13 @@
#include "CogWindow_Spacing.h"
//--------------------------------------------------------------------------------------------------------------------------
void UCogWindow_Spacing::PreRender(ImGuiWindowFlags& WindowFlags)
{
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0));
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogWindow_Spacing::PostRender()
{
ImGui::PopStyleColor(1);
}
@@ -63,6 +63,8 @@ protected:
virtual void PreRender(ImGuiWindowFlags& WindowFlags) {}
virtual void PostRender() {}
virtual void RenderContent() {}
virtual bool CheckEditorVisibility();
@@ -89,6 +89,9 @@ private:
UPROPERTY()
TArray<UCogWindow*> Windows;
UPROPERTY()
TArray<UCogWindow*> SpaceWindows;
UPROPERTY()
TArray<UCogWindow*> MainMenuWidgets;
@@ -0,0 +1,22 @@
#pragma once
#include "CoreMinimal.h"
#include "CogWindow.h"
#include "CogWindow_Spacing.generated.h"
UCLASS()
class COGWINDOW_API UCogWindow_Spacing : public UCogWindow
{
GENERATED_BODY()
public:
protected:
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
virtual void PostRender() override;
private:
};
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.