mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-04 06:38:45 +00:00
Merge branch 'main' into pr/50
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
float FCogDebugDrawImGui::Time = 0;
|
||||||
TArray<FCogDebugDrawImGui::FLine> FCogDebugDrawImGui::Lines;
|
TArray<FCogDebugDrawImGui::FLine> FCogDebugDrawImGui::Lines;
|
||||||
TArray<FCogDebugDrawImGui::FTriangle> FCogDebugDrawImGui::Triangles;
|
TArray<FCogDebugDrawImGui::FTriangle> FCogDebugDrawImGui::Triangles;
|
||||||
TArray<FCogDebugDrawImGui::FTriangle> FCogDebugDrawImGui::TrianglesFilled;
|
TArray<FCogDebugDrawImGui::FTriangle> FCogDebugDrawImGui::TrianglesFilled;
|
||||||
@@ -22,7 +23,7 @@ void FCogDebugDrawImGui::AddLine(const ImVec2& P1, const ImVec2& P2, ImU32 Color
|
|||||||
Line.P2 = P2;
|
Line.P2 = P2;
|
||||||
Line.Color = Color;
|
Line.Color = Color;
|
||||||
Line.Thickness = Thickness;
|
Line.Thickness = Thickness;
|
||||||
Line.Time = ImGui::GetCurrentContext()->Time;
|
Line.Time = Time;
|
||||||
Line.Duration = Duration;
|
Line.Duration = Duration;
|
||||||
Line.FadeColor = FadeColor;
|
Line.FadeColor = FadeColor;
|
||||||
Lines.Add_GetRef(Line);
|
Lines.Add_GetRef(Line);
|
||||||
@@ -37,7 +38,7 @@ void FCogDebugDrawImGui::AddRect(const ImVec2& Min, const ImVec2& Max, ImU32 Col
|
|||||||
Rectangle.Color = Color;
|
Rectangle.Color = Color;
|
||||||
Rectangle.Rounding = Rounding;
|
Rectangle.Rounding = Rounding;
|
||||||
Rectangle.Thickness = Thickness;
|
Rectangle.Thickness = Thickness;
|
||||||
Rectangle.Time = ImGui::GetCurrentContext()->Time;
|
Rectangle.Time = Time;
|
||||||
Rectangle.Duration = Duration;
|
Rectangle.Duration = Duration;
|
||||||
Rectangle.FadeColor = FadeColor;
|
Rectangle.FadeColor = FadeColor;
|
||||||
Rectangles.Add_GetRef(Rectangle);
|
Rectangles.Add_GetRef(Rectangle);
|
||||||
@@ -52,7 +53,7 @@ void FCogDebugDrawImGui::AddRectFilled(const ImVec2& Min, const ImVec2& Max, ImU
|
|||||||
Rectangle.Color = Color;
|
Rectangle.Color = Color;
|
||||||
Rectangle.Rounding = Rounding;
|
Rectangle.Rounding = Rounding;
|
||||||
Rectangle.Thickness = 0.0f;
|
Rectangle.Thickness = 0.0f;
|
||||||
Rectangle.Time = ImGui::GetCurrentContext()->Time;
|
Rectangle.Time = Time;
|
||||||
Rectangle.Duration = Duration;
|
Rectangle.Duration = Duration;
|
||||||
Rectangle.FadeColor = FadeColor;
|
Rectangle.FadeColor = FadeColor;
|
||||||
RectanglesFilled.Add_GetRef(Rectangle);
|
RectanglesFilled.Add_GetRef(Rectangle);
|
||||||
@@ -68,7 +69,7 @@ void FCogDebugDrawImGui::AddQuad(const ImVec2& P1, const ImVec2& P2, const ImVec
|
|||||||
Quad.P4 = P4;
|
Quad.P4 = P4;
|
||||||
Quad.Color = Color;
|
Quad.Color = Color;
|
||||||
Quad.Thickness = Thickness;
|
Quad.Thickness = Thickness;
|
||||||
Quad.Time = ImGui::GetCurrentContext()->Time;
|
Quad.Time = Time;
|
||||||
Quad.Duration = Duration;
|
Quad.Duration = Duration;
|
||||||
Quad.FadeColor = FadeColor;
|
Quad.FadeColor = FadeColor;
|
||||||
Quads.Add_GetRef(Quad);
|
Quads.Add_GetRef(Quad);
|
||||||
@@ -84,7 +85,7 @@ void FCogDebugDrawImGui::AddQuadFilled(const ImVec2& P1, const ImVec2& P2, const
|
|||||||
Quad.P4 = P4;
|
Quad.P4 = P4;
|
||||||
Quad.Color = Color;
|
Quad.Color = Color;
|
||||||
Quad.Thickness = 0.0f;
|
Quad.Thickness = 0.0f;
|
||||||
Quad.Time = ImGui::GetCurrentContext()->Time;
|
Quad.Time = Time;
|
||||||
Quad.Duration = Duration;
|
Quad.Duration = Duration;
|
||||||
Quad.FadeColor = FadeColor;
|
Quad.FadeColor = FadeColor;
|
||||||
QuadsFilled.Add_GetRef(Quad);
|
QuadsFilled.Add_GetRef(Quad);
|
||||||
@@ -99,7 +100,7 @@ void FCogDebugDrawImGui::AddTriangle(const ImVec2& P1, const ImVec2& P2, const I
|
|||||||
Triangle.P3 = P3;
|
Triangle.P3 = P3;
|
||||||
Triangle.Color = Color;
|
Triangle.Color = Color;
|
||||||
Triangle.Thickness = Thickness;
|
Triangle.Thickness = Thickness;
|
||||||
Triangle.Time = ImGui::GetCurrentContext()->Time;
|
Triangle.Time = Time;
|
||||||
Triangle.Duration = Duration;
|
Triangle.Duration = Duration;
|
||||||
Triangle.FadeColor = FadeColor;
|
Triangle.FadeColor = FadeColor;
|
||||||
Triangles.Add_GetRef(Triangle);
|
Triangles.Add_GetRef(Triangle);
|
||||||
@@ -114,7 +115,7 @@ void FCogDebugDrawImGui::AddTriangleFilled(const ImVec2& P1, const ImVec2& P2, c
|
|||||||
Triangle.P3 = P3;
|
Triangle.P3 = P3;
|
||||||
Triangle.Color = Color;
|
Triangle.Color = Color;
|
||||||
Triangle.Thickness = 0.0f;
|
Triangle.Thickness = 0.0f;
|
||||||
Triangle.Time = ImGui::GetCurrentContext()->Time;
|
Triangle.Time = Time;
|
||||||
Triangle.Duration = Duration;
|
Triangle.Duration = Duration;
|
||||||
Triangle.FadeColor = FadeColor;
|
Triangle.FadeColor = FadeColor;
|
||||||
TrianglesFilled.Add_GetRef(Triangle);
|
TrianglesFilled.Add_GetRef(Triangle);
|
||||||
@@ -123,13 +124,14 @@ void FCogDebugDrawImGui::AddTriangleFilled(const ImVec2& P1, const ImVec2& P2, c
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogDebugDrawImGui::AddCircle(const ImVec2& Center, float Radius, ImU32 Color, int Segments /*= 0*/, float Thickness /*= 1.0f*/, float Duration /*= 0.0f*/, bool FadeColor /*= false*/)
|
void FCogDebugDrawImGui::AddCircle(const ImVec2& Center, float Radius, ImU32 Color, int Segments /*= 0*/, float Thickness /*= 1.0f*/, float Duration /*= 0.0f*/, bool FadeColor /*= false*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
FCircle Circle;
|
FCircle Circle;
|
||||||
Circle.Center = Center;
|
Circle.Center = Center;
|
||||||
Circle.Radius = Radius > 0.0f ? Radius : 1.0f;
|
Circle.Radius = Radius > 0.0f ? Radius : 1.0f;
|
||||||
Circle.Color = Color;
|
Circle.Color = Color;
|
||||||
Circle.Segments = Segments;
|
Circle.Segments = Segments;
|
||||||
Circle.Thickness = Thickness;
|
Circle.Thickness = Thickness;
|
||||||
Circle.Time = ImGui::GetCurrentContext()->Time;
|
Circle.Time = Time;
|
||||||
Circle.Duration = Duration;
|
Circle.Duration = Duration;
|
||||||
Circle.FadeColor = FadeColor;
|
Circle.FadeColor = FadeColor;
|
||||||
Circles.Add_GetRef(Circle);
|
Circles.Add_GetRef(Circle);
|
||||||
@@ -144,7 +146,7 @@ void FCogDebugDrawImGui::AddCircleFilled(const ImVec2& Center, float Radius, ImU
|
|||||||
Circle.Color = Color;
|
Circle.Color = Color;
|
||||||
Circle.Segments = Segments;
|
Circle.Segments = Segments;
|
||||||
Circle.Thickness = 0.0f;
|
Circle.Thickness = 0.0f;
|
||||||
Circle.Time = ImGui::GetCurrentContext()->Time;
|
Circle.Time = Time;
|
||||||
Circle.Duration = Duration;
|
Circle.Duration = Duration;
|
||||||
Circle.FadeColor = FadeColor;
|
Circle.FadeColor = FadeColor;
|
||||||
CirclesFilled.Add_GetRef(Circle);
|
CirclesFilled.Add_GetRef(Circle);
|
||||||
@@ -157,7 +159,7 @@ void FCogDebugDrawImGui::AddText(const ImVec2& Pos, const FString& Text, ImU32 C
|
|||||||
TextElement.Pos = Pos;
|
TextElement.Pos = Pos;
|
||||||
TextElement.Text = Text;
|
TextElement.Text = Text;
|
||||||
TextElement.Color = Color;
|
TextElement.Color = Color;
|
||||||
TextElement.Time = ImGui::GetCurrentContext()->Time;
|
TextElement.Time = Time;
|
||||||
TextElement.Duration = Duration;
|
TextElement.Duration = Duration;
|
||||||
TextElement.FadeColor = FadeColor;
|
TextElement.FadeColor = FadeColor;
|
||||||
Texts.Add_GetRef(TextElement);
|
Texts.Add_GetRef(TextElement);
|
||||||
@@ -169,7 +171,7 @@ void FCogDebugDrawImGui::AddText(const ImVec2& Pos, const FString& Text, ImU32 C
|
|||||||
ShadowTextElement.Text = Text;
|
ShadowTextElement.Text = Text;
|
||||||
const float Alpha = ImGui::ColorConvertU32ToFloat4(Color).w; // Keep original Alpha and set to black
|
const float Alpha = ImGui::ColorConvertU32ToFloat4(Color).w; // Keep original Alpha and set to black
|
||||||
ShadowTextElement.Color = ImGui::ColorConvertFloat4ToU32(ImVec4(0, 0, 0, Alpha));
|
ShadowTextElement.Color = ImGui::ColorConvertFloat4ToU32(ImVec4(0, 0, 0, Alpha));
|
||||||
ShadowTextElement.Time = ImGui::GetCurrentContext()->Time;
|
ShadowTextElement.Time = Time;
|
||||||
ShadowTextElement.Duration = Duration;
|
ShadowTextElement.Duration = Duration;
|
||||||
ShadowTextElement.FadeColor = FadeColor;
|
ShadowTextElement.FadeColor = FadeColor;
|
||||||
Texts.Add_GetRef(ShadowTextElement);
|
Texts.Add_GetRef(ShadowTextElement);
|
||||||
@@ -181,6 +183,7 @@ void FCogDebugDrawImGui::AddText(const ImVec2& Pos, const FString& Text, ImU32 C
|
|||||||
void FCogDebugDrawImGui::Draw()
|
void FCogDebugDrawImGui::Draw()
|
||||||
{
|
{
|
||||||
ImDrawList* DrawList = ImGui::GetBackgroundDrawList();
|
ImDrawList* DrawList = ImGui::GetBackgroundDrawList();
|
||||||
|
Time = ImGui::GetCurrentContext()->Time;
|
||||||
|
|
||||||
DrawShapes(Lines, [DrawList](const FLine& Line, const ImColor Color) { DrawList->AddLine(Line.P1, Line.P2, Color, Line.Thickness); });
|
DrawShapes(Lines, [DrawList](const FLine& Line, const ImColor Color) { DrawList->AddLine(Line.P1, Line.P2, Color, Line.Thickness); });
|
||||||
DrawShapes(Rectangles, [DrawList](const FRectangle& Rectangle, const ImColor Color) { DrawList->AddRect(Rectangle.Min, Rectangle.Max, Color, Rectangle.Rounding, Rectangle.Thickness); });
|
DrawShapes(Rectangles, [DrawList](const FRectangle& Rectangle, const ImColor Color) { DrawList->AddRect(Rectangle.Min, Rectangle.Max, Color, Rectangle.Rounding, Rectangle.Thickness); });
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
static float Time;
|
||||||
static TArray<FLine> Lines;
|
static TArray<FLine> Lines;
|
||||||
static TArray<FTriangle> Triangles;
|
static TArray<FTriangle> Triangles;
|
||||||
static TArray<FTriangle> TrianglesFilled;
|
static TArray<FTriangle> TrianglesFilled;
|
||||||
@@ -92,8 +93,6 @@ private:
|
|||||||
template<typename TShape, typename TDrawFunction>
|
template<typename TShape, typename TDrawFunction>
|
||||||
static void DrawShapes(TArray<TShape>& Shapes, TDrawFunction DrawFunction)
|
static void DrawShapes(TArray<TShape>& Shapes, TDrawFunction DrawFunction)
|
||||||
{
|
{
|
||||||
const double Time = ImGui::GetCurrentContext()->Time;
|
|
||||||
|
|
||||||
for (int32 i = 0; i < Shapes.Num(); i++)
|
for (int32 i = 0; i < Shapes.Num(); i++)
|
||||||
{
|
{
|
||||||
const TShape& Shape = Shapes[i];
|
const TShape& Shape = Shapes[i];
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class CogEngine : ModuleRules
|
|||||||
"NetCore",
|
"NetCore",
|
||||||
"Slate",
|
"Slate",
|
||||||
"SlateCore",
|
"SlateCore",
|
||||||
|
"BuildSettings",
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Target.bBuildEditor)
|
if (Target.bBuildEditor)
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
#include "CogEngineWindow_BuildInfo.h"
|
||||||
|
|
||||||
|
#include "CogImguiHelper.h"
|
||||||
|
#include "imgui.h"
|
||||||
|
#include "BuildSettings.h"
|
||||||
|
#include "GenericPlatform/GenericPlatformMisc.h"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogEngineWindow_BuildInfo::Initialize()
|
||||||
|
{
|
||||||
|
FCogWindow::Initialize();
|
||||||
|
|
||||||
|
Config = GetConfig<UCogEngineConfig_BuildInfo>();
|
||||||
|
|
||||||
|
BuildText();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogEngineWindow_BuildInfo::RenderHelp()
|
||||||
|
{
|
||||||
|
ImGui::Text(
|
||||||
|
"This window can be used to display the build information such as the build version, changelist, date, target, and so on."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogEngineWindow_BuildInfo::RenderTick(float DeltaTime)
|
||||||
|
{
|
||||||
|
FCogWindow::RenderTick(DeltaTime);
|
||||||
|
|
||||||
|
if (FApp::GetBuildTargetType() == EBuildTargetType::Editor)
|
||||||
|
{
|
||||||
|
if (Config->ShowInEditor == false)
|
||||||
|
{ return; }
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Config->ShowInPackage == false)
|
||||||
|
{ return;}
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto TextStr = StringCast<ANSICHAR>(*Text);
|
||||||
|
ImDrawList* DrawList = Config->ShowInForeground ? ImGui::GetForegroundDrawList() : ImGui::GetBackgroundDrawList();
|
||||||
|
const ImVec2 WindowPadding = ImGui::GetStyle().WindowPadding;
|
||||||
|
const ImVec2 TextSize = ImGui::CalcTextSize(TextStr.Get(), nullptr, false);
|
||||||
|
const ImVec2 RectSize = TextSize + WindowPadding * 2;
|
||||||
|
const ImVec2 Pos = FCogWindowWidgets::ComputeScreenCornerLocation(Config->Alignment, Config->Padding);
|
||||||
|
const ImVec2 AlignedPos = Pos - (FCogImguiHelper::ToImVec2(Config->Alignment) * RectSize);
|
||||||
|
|
||||||
|
DrawList->AddRectFilled(AlignedPos, AlignedPos + RectSize, FCogImguiHelper::ToImU32(Config->BackgroundColor), Config->Rounding);
|
||||||
|
DrawList->AddRect(AlignedPos, AlignedPos + RectSize, FCogImguiHelper::ToImU32(Config->BorderColor), Config->Rounding);
|
||||||
|
DrawList->AddText(AlignedPos + WindowPadding, FCogImguiHelper::ToImU32(Config->TextColor), TextStr.Get());
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogEngineWindow_BuildInfo::RenderContent()
|
||||||
|
{
|
||||||
|
Super::RenderContent();
|
||||||
|
|
||||||
|
FCogWindowWidgets::ThinSeparatorText("Build Properties");
|
||||||
|
|
||||||
|
if (ImGui::BeginChild("Settings", ImVec2(-1, 100 * GetDpiScale()), ImGuiChildFlags_FrameStyle | ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeY))
|
||||||
|
{
|
||||||
|
if (ImGui::Checkbox("Branch Name", &Config->ShowBranchName)) { BuildText(); }
|
||||||
|
if (ImGui::Checkbox("Build Date", &Config->ShowBuildDate)) { BuildText(); }
|
||||||
|
if (ImGui::Checkbox("Build Configuration", &Config->ShowBuildConfiguration)) { BuildText(); }
|
||||||
|
if (ImGui::Checkbox("Build User", &Config->ShowBuildUser)) { BuildText(); }
|
||||||
|
if (ImGui::Checkbox("Build Machine", &Config->ShowBuildMachine)) { BuildText(); }
|
||||||
|
if (ImGui::Checkbox("Build Target Type", &Config->ShowBuildTargetType)) { BuildText(); }
|
||||||
|
if (ImGui::Checkbox("Current Change list", &Config->ShowCurrentChangelist)) { BuildText(); }
|
||||||
|
if (ImGui::Checkbox("Compatible Change list", &Config->ShowCompatibleChangelist)) { BuildText(); }
|
||||||
|
}
|
||||||
|
ImGui::EndChild();
|
||||||
|
|
||||||
|
FCogWindowWidgets::ThinSeparatorText("Display");
|
||||||
|
|
||||||
|
ImGui::Checkbox("Show In Editor", &Config->ShowInEditor);
|
||||||
|
ImGui::Checkbox("Show In Package", &Config->ShowInPackage);
|
||||||
|
ImGui::Checkbox("Show In Foreground", &Config->ShowInForeground);
|
||||||
|
|
||||||
|
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||||
|
ImGui::SliderFloat2("Alignment", &Config->Alignment.X, 0, 1.0f, "%.2f");
|
||||||
|
|
||||||
|
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||||
|
ImGui::SliderInt2("Padding", &Config->Padding.X, 0, 100);
|
||||||
|
|
||||||
|
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||||
|
ImGui::SliderInt("Rounding", &Config->Rounding, 0, 12);
|
||||||
|
|
||||||
|
constexpr ImGuiColorEditFlags ColorEditFlags = ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_AlphaPreviewHalf;
|
||||||
|
FCogImguiHelper::ColorEdit4("Background Color", Config->BackgroundColor, ColorEditFlags);
|
||||||
|
FCogImguiHelper::ColorEdit4("Border Color", Config->BorderColor, ColorEditFlags);
|
||||||
|
FCogImguiHelper::ColorEdit4("Text Color", Config->TextColor, ColorEditFlags);
|
||||||
|
|
||||||
|
ImGui::Separator();
|
||||||
|
|
||||||
|
if (ImGui::Button("Reset Settings", ImVec2(-1, 0)))
|
||||||
|
{
|
||||||
|
ResetConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogEngineWindow_BuildInfo::BuildText()
|
||||||
|
{
|
||||||
|
FStringBuilderBase S;
|
||||||
|
if (Config->ShowBranchName) { S.Append(BuildSettings::GetBranchName()); S.Append(" "); }
|
||||||
|
if (Config->ShowBuildDate) { S.Append(BuildSettings::GetBuildDate()); S.Append(" "); }
|
||||||
|
if (Config->ShowBuildConfiguration) { S.Append(LexToString(FApp::GetBuildConfiguration())); S.Append(" "); }
|
||||||
|
if (Config->ShowBuildTargetType) { S.Append(LexToString(FApp::GetBuildTargetType())); S.Append(" "); }
|
||||||
|
if (Config->ShowBuildUser) { S.Append(BuildSettings::GetBuildUser()); S.Append(" "); }
|
||||||
|
if (Config->ShowBuildMachine) { S.Append(BuildSettings::GetBuildMachine()); S.Append(" "); }
|
||||||
|
if (Config->ShowCurrentChangelist) { S.Appendf(TEXT("%d"), BuildSettings::GetCurrentChangelist()); S.Append(" "); }
|
||||||
|
if (Config->ShowCompatibleChangelist) { S.Appendf(TEXT("%d"),BuildSettings::GetCompatibleChangelist()); }
|
||||||
|
|
||||||
|
Text = FString(S).TrimEnd();
|
||||||
|
}
|
||||||
@@ -19,7 +19,6 @@ void FCogEngineWindow_Console::Initialize()
|
|||||||
|
|
||||||
Config = GetConfig<UCogEngineConfig_Console>();
|
Config = GetConfig<UCogEngineConfig_Console>();
|
||||||
|
|
||||||
bNoPadding = true;
|
|
||||||
bHasMenu = true;
|
bHasMenu = true;
|
||||||
bHasWidget = true;
|
bHasWidget = true;
|
||||||
bIsWidgetVisible = true;
|
bIsWidgetVisible = true;
|
||||||
@@ -29,9 +28,16 @@ void FCogEngineWindow_Console::Initialize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_Console::PreRender(ImGuiWindowFlags& WindowFlags)
|
void FCogEngineWindow_Console::PreBegin(ImGuiWindowFlags& WindowFlags)
|
||||||
{
|
{
|
||||||
WindowFlags |= ImGuiWindowFlags_NoScrollbar;
|
WindowFlags |= ImGuiWindowFlags_NoScrollbar;
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogEngineWindow_Console::PostBegin()
|
||||||
|
{
|
||||||
|
ImGui::PopStyleVar();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ void FCogEngineWindow_Notifications::Initialize()
|
|||||||
{
|
{
|
||||||
Super::Initialize();
|
Super::Initialize();
|
||||||
|
|
||||||
OutputDevice.Notifications = this;
|
|
||||||
|
|
||||||
Config = GetConfig<UCogEngineConfig_Notifications>();
|
Config = GetConfig<UCogEngineConfig_Notifications>();
|
||||||
|
|
||||||
|
OutputDevice.Notifications = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -46,6 +46,9 @@ void FCogEngineWindow_Notifications::AddNotification(const TCHAR* InMessage, ELo
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_Notifications::OnLogReceived(const TCHAR* InMessage, ELogVerbosity::Type InVerbosity, const class FName& InCategory)
|
void FCogEngineWindow_Notifications::OnLogReceived(const TCHAR* InMessage, ELogVerbosity::Type InVerbosity, const class FName& InCategory)
|
||||||
{
|
{
|
||||||
|
if (Config == nullptr)
|
||||||
|
{ return; }
|
||||||
|
|
||||||
if (Config->DisableNotifications)
|
if (Config->DisableNotifications)
|
||||||
{ return; }
|
{ return; }
|
||||||
|
|
||||||
@@ -84,22 +87,17 @@ void FCogEngineWindow_Notifications::RenderNotifications()
|
|||||||
| ImGuiWindowFlags_AlwaysAutoResize
|
| ImGuiWindowFlags_AlwaysAutoResize
|
||||||
| ImGuiWindowFlags_NoSavedSettings
|
| ImGuiWindowFlags_NoSavedSettings
|
||||||
| ImGuiWindowFlags_NoFocusOnAppearing
|
| ImGuiWindowFlags_NoFocusOnAppearing
|
||||||
| ImGuiWindowFlags_NoNav;
|
| ImGuiWindowFlags_NoNav
|
||||||
|
| ImGuiWindowFlags_NoInputs;
|
||||||
|
|
||||||
const ImGuiViewport* Viewport = ImGui::GetMainViewport();
|
const ImGuiViewport* Viewport = ImGui::GetMainViewport();
|
||||||
const ImVec2 ViewportPos = Viewport->WorkPos;
|
|
||||||
const ImVec2 ViewportSize = Viewport->WorkSize;
|
const float DpiScale = GetDpiScale();
|
||||||
|
|
||||||
|
ImVec2 WindowPos = FCogWindowWidgets::ComputeScreenCornerLocation(Config->Alignment, Config->Padding);
|
||||||
const ImVec2 WindowPadding = ImGui::GetStyle().WindowPadding;
|
const ImVec2 WindowPadding = ImGui::GetStyle().WindowPadding;
|
||||||
const ImVec2 ItemSpacing = ImGui::GetStyle().ItemSpacing;
|
const ImVec2 ItemSpacing = ImGui::GetStyle().ItemSpacing;
|
||||||
|
const float MaxHeight = Config->MaxHeight * DpiScale + WindowPadding.y * 2;
|
||||||
const bool IsRight = static_cast<int32>(Config->Location) & 1;
|
|
||||||
const bool IsBottom = static_cast<int32>(Config->Location) & 2;
|
|
||||||
|
|
||||||
ImVec2 WindowPos;
|
|
||||||
WindowPos.x = ViewportPos.x + (IsRight ? ViewportSize.x - Config->Padding : Config->Padding);
|
|
||||||
WindowPos.y = ViewportPos.y + (IsBottom ? ViewportSize.y - Config->Padding : Config->Padding);
|
|
||||||
|
|
||||||
const ImVec2 WindowPosPivot(IsRight ? 1.0f : 0.0f, IsBottom ? 1.0f : 0.0f);
|
|
||||||
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, Config->Rounding);
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, Config->Rounding);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, Config->ShowBorder);
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, Config->ShowBorder);
|
||||||
@@ -157,13 +155,13 @@ void FCogEngineWindow_Notifications::RenderNotifications()
|
|||||||
ImGui::PushStyleColor(ImGuiCol_Text, TextColor);
|
ImGui::PushStyleColor(ImGuiCol_Text, TextColor);
|
||||||
|
|
||||||
const auto Message = StringCast<ANSICHAR>(*Notification.Message);
|
const auto Message = StringCast<ANSICHAR>(*Notification.Message);
|
||||||
const float WrapWidth = Config->TextWrapping * ImGui::GetFontSize();
|
const float WrapWidth = Config->TextWrapping * DpiScale;
|
||||||
|
|
||||||
ImGui::SetNextWindowViewport(Viewport->ID);
|
ImGui::SetNextWindowViewport(Viewport->ID);
|
||||||
ImGui::SetNextWindowPos(WindowPos, ImGuiCond_Always, WindowPosPivot);
|
ImGui::SetNextWindowPos(WindowPos, ImGuiCond_Always, FCogImguiHelper::ToImVec2(Config->Alignment));
|
||||||
if (Config->UseFixedWidth)
|
if (Config->UseFixedWidth)
|
||||||
{
|
{
|
||||||
ImGui::SetNextWindowSizeConstraints(ImVec2(WrapWidth, 0) + WindowPadding * 2, ImVec2(WrapWidth, Config->MaxHeight * ImGui::GetFontSize()) + WindowPadding * 2);
|
ImGui::SetNextWindowSizeConstraints(ImVec2(WrapWidth + WindowPadding.x * 2, 0), ImVec2(WrapWidth + WindowPadding.x * 2, MaxHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Begin(StringCast<ANSICHAR>(*Notification.Id).Get(), nullptr, Flags))
|
if (ImGui::Begin(StringCast<ANSICHAR>(*Notification.Id).Get(), nullptr, Flags))
|
||||||
@@ -180,8 +178,8 @@ void FCogEngineWindow_Notifications::RenderNotifications()
|
|||||||
// maybe because the real window size is computed the next frame.
|
// maybe because the real window size is computed the next frame.
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
const ImVec2 TextSize = ImGui::CalcTextSize(Message.Get(), nullptr, false, WrapWidth);
|
const ImVec2 TextSize = ImGui::CalcTextSize(Message.Get(), nullptr, false, WrapWidth);
|
||||||
const float WindowHeight = TextSize.y + (WindowPadding.y * 2);
|
const float WindowHeight = FMath::Min(MaxHeight, TextSize.y + (WindowPadding.y * 2));
|
||||||
WindowPos.y += (WindowHeight + ItemSpacing.y) * (IsBottom ? -1 : 1);
|
WindowPos.y += (WindowHeight + ItemSpacing.y) * (Config->Alignment.Y > 0.5f ? -1 : 1);
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,18 +232,18 @@ void FCogEngineWindow_Notifications::RenderSettings()
|
|||||||
FCogWindowWidgets::ThinSeparatorText("Location & Size");
|
FCogWindowWidgets::ThinSeparatorText("Location & Size");
|
||||||
|
|
||||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||||
FCogWindowWidgets::ComboboxEnum("Location", Config->Location);
|
ImGui::SliderFloat2("Alignment", &Config->Alignment.X, 0, 1.0f, "%.2f");
|
||||||
|
|
||||||
|
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||||
|
ImGui::SliderInt2("Padding", &Config->Padding.X, 0, 100);
|
||||||
|
|
||||||
ImGui::Checkbox("Use Fixed Width", &Config->UseFixedWidth);
|
ImGui::Checkbox("Use Fixed Width", &Config->UseFixedWidth);
|
||||||
|
|
||||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||||
ImGui::DragInt("Text Wrapping", &Config->TextWrapping, 1, 0, INT_MAX);
|
ImGui::SliderInt("Text Wrapping", &Config->TextWrapping, 1, 500);
|
||||||
|
|
||||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||||
ImGui::DragInt("Max Height", &Config->MaxHeight, 1, 0, INT_MAX);
|
ImGui::SliderInt("Max Height", &Config->MaxHeight, 0, 500);
|
||||||
|
|
||||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
|
||||||
ImGui::DragInt("Padding", &Config->Padding, 1, 0, INT_MAX);
|
|
||||||
|
|
||||||
FCogWindowWidgets::ThinSeparatorText("Display");
|
FCogWindowWidgets::ThinSeparatorText("Display");
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ void FCogEngineWindow_OutputLog::AddLog(const TCHAR* InMessage, ELogVerbosity::T
|
|||||||
|
|
||||||
FLogInfo& LogInfo = LogInfos.AddDefaulted_GetRef();
|
FLogInfo& LogInfo = LogInfos.AddDefaulted_GetRef();
|
||||||
LogInfo.Frame = GFrameCounter;
|
LogInfo.Frame = GFrameCounter;
|
||||||
LogInfo.Time = Config->UseUTCTime ? FDateTime::UtcNow() : FDateTime::Now();
|
LogInfo.Time = Config != nullptr && Config->UseUTCTime ? FDateTime::UtcNow() : FDateTime::Now();
|
||||||
LogInfo.Verbosity = InVerbosity;
|
LogInfo.Verbosity = InVerbosity;
|
||||||
LogInfo.Category = InCategory;
|
LogInfo.Category = InCategory;
|
||||||
LogInfo.LineStart = TextBuffer.size();
|
LogInfo.LineStart = TextBuffer.size();
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ void FCogEngineWindow_Plots::Initialize()
|
|||||||
Super::Initialize();
|
Super::Initialize();
|
||||||
|
|
||||||
bHasMenu = true;
|
bHasMenu = true;
|
||||||
bNoPadding = true;
|
|
||||||
|
|
||||||
Config = GetConfig<UCogEngineConfig_Plots>();
|
Config = GetConfig<UCogEngineConfig_Plots>();
|
||||||
|
|
||||||
@@ -48,6 +47,18 @@ void FCogEngineWindow_Plots::RenderTick(float DeltaTime)
|
|||||||
FCogDebugPlot::IsVisible = GetIsVisible();
|
FCogDebugPlot::IsVisible = GetIsVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogEngineWindow_Plots::PreBegin(ImGuiWindowFlags& WindowFlags)
|
||||||
|
{
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogEngineWindow_Plots::PostBegin()
|
||||||
|
{
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_Plots::RenderContent()
|
void FCogEngineWindow_Plots::RenderContent()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "CogWindow.h"
|
||||||
|
#include "CogWindowWidgets.h"
|
||||||
|
#include "CogEngineWindow_BuildInfo.generated.h"
|
||||||
|
|
||||||
|
class UCogEngineConfig_BuildInfo;
|
||||||
|
|
||||||
|
class COGENGINE_API FCogEngineWindow_BuildInfo : public FCogWindow
|
||||||
|
{
|
||||||
|
typedef FCogWindow Super;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual void Initialize() override;
|
||||||
|
|
||||||
|
virtual void RenderHelp() override;
|
||||||
|
|
||||||
|
virtual void RenderTick(float DeltaTime) override;
|
||||||
|
|
||||||
|
virtual void RenderContent() override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
void BuildText();
|
||||||
|
|
||||||
|
TWeakObjectPtr<UCogEngineConfig_BuildInfo> Config;
|
||||||
|
|
||||||
|
FString Text;
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
UCLASS(Config = Cog)
|
||||||
|
class UCogEngineConfig_BuildInfo : public UCogCommonConfig
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowInEditor = false;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowInPackage = true;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowBranchName = false;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowBuildDate = true;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowCurrentChangelist = true;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowCompatibleChangelist = false;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowBuildConfiguration = true;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowBuildUser = false;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowBuildMachine = false;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowBuildTargetType = true;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
bool ShowInForeground = true;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
FVector2f Alignment = { 0, 1 };
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
FIntVector2 Padding = { 10, 10 };
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
int32 Rounding = 6;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
FColor BackgroundColor = FColor(0, 0, 0, 80);
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
FColor BorderColor = FColor(255, 255, 255, 50);
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
FColor TextColor = FColor(255, 255, 255, 100);
|
||||||
|
|
||||||
|
virtual void Reset() override
|
||||||
|
{
|
||||||
|
Super::Reset();
|
||||||
|
|
||||||
|
ShowInEditor = false;
|
||||||
|
ShowInPackage = true;
|
||||||
|
ShowInForeground = true;
|
||||||
|
ShowBranchName = false;
|
||||||
|
ShowBuildDate = true;
|
||||||
|
ShowCurrentChangelist = true;
|
||||||
|
ShowCompatibleChangelist = false;
|
||||||
|
ShowBuildConfiguration = true;
|
||||||
|
ShowBuildUser = false;
|
||||||
|
ShowBuildMachine = false;
|
||||||
|
ShowBuildTargetType = true;
|
||||||
|
Alignment = { 0, 1 };
|
||||||
|
Padding = { 10, 10 };
|
||||||
|
Rounding = 6;
|
||||||
|
BackgroundColor = FColor(0, 0, 0, 80);
|
||||||
|
BorderColor = FColor(255, 255, 255, 50);
|
||||||
|
TextColor = FColor(255, 255, 255, 100);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -17,7 +17,9 @@ protected:
|
|||||||
|
|
||||||
virtual void Initialize() override;
|
virtual void Initialize() override;
|
||||||
|
|
||||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) override;
|
||||||
|
|
||||||
|
virtual void PostBegin() override;
|
||||||
|
|
||||||
virtual void RenderMainMenuWidget() override;
|
virtual void RenderMainMenuWidget() override;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "CogCommonConfig.h"
|
#include "CogCommonConfig.h"
|
||||||
#include "CogWindow.h"
|
#include "CogWindow.h"
|
||||||
|
#include "CogWindowWidgets.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "Misc/OutputDevice.h"
|
#include "Misc/OutputDevice.h"
|
||||||
#include "CogEngineWindow_Notifications.generated.h"
|
#include "CogEngineWindow_Notifications.generated.h"
|
||||||
@@ -23,16 +24,6 @@ public:
|
|||||||
FCogEngineWindow_Notifications* Notifications = nullptr;
|
FCogEngineWindow_Notifications* Notifications = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
|
||||||
UENUM()
|
|
||||||
enum class ECogEngineNotificationLocation : uint8
|
|
||||||
{
|
|
||||||
TopLeft = 0,
|
|
||||||
TopRight = 1,
|
|
||||||
BottomLeft = 2,
|
|
||||||
BottomRight = 3,
|
|
||||||
};
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
class COGENGINE_API FCogEngineWindow_Notifications : public FCogWindow
|
class COGENGINE_API FCogEngineWindow_Notifications : public FCogWindow
|
||||||
{
|
{
|
||||||
@@ -126,19 +117,19 @@ public:
|
|||||||
FColor TextErrorColor = FColor::White;
|
FColor TextErrorColor = FColor::White;
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
ECogEngineNotificationLocation Location = ECogEngineNotificationLocation::BottomRight;
|
FVector2f Alignment = FVector2f(1.0f, 1.0f);
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
int Padding = 10;
|
FIntVector2 Padding = FIntVector2(10, 10);
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
bool UseFixedWidth = true;
|
bool UseFixedWidth = true;
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
int32 MaxHeight = 10;
|
int32 MaxHeight = 100;
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
int32 TextWrapping = 20;
|
int32 TextWrapping = 200;
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
int32 Rounding = 6;
|
int32 Rounding = 6;
|
||||||
@@ -166,11 +157,11 @@ public:
|
|||||||
BorderWarningColor = FColor(255, 200, 0, 100);
|
BorderWarningColor = FColor(255, 200, 0, 100);
|
||||||
BorderErrorColor = FColor(240, 77, 77, 100);
|
BorderErrorColor = FColor(240, 77, 77, 100);
|
||||||
|
|
||||||
Location = ECogEngineNotificationLocation::BottomRight;
|
Alignment = { 1, 1 };
|
||||||
Padding = 10;
|
Padding = { 10, 10 };
|
||||||
UseFixedWidth = true;
|
UseFixedWidth = true;
|
||||||
TextWrapping = 20;
|
TextWrapping = 200;
|
||||||
MaxHeight = 10;
|
MaxHeight = 100;
|
||||||
Rounding = 6;
|
Rounding = 6;
|
||||||
ShowBorder = true;
|
ShowBorder = true;
|
||||||
Duration = 5.0f;
|
Duration = 5.0f;
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ protected:
|
|||||||
|
|
||||||
virtual void RenderTick(float DeltaTime) override;
|
virtual void RenderTick(float DeltaTime) override;
|
||||||
|
|
||||||
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) override;
|
||||||
|
|
||||||
|
virtual void PostBegin() override;
|
||||||
|
|
||||||
virtual void RenderContent() override;
|
virtual void RenderContent() override;
|
||||||
|
|
||||||
virtual void RenderAllEntriesNames(const ImVec2& InSize);
|
virtual void RenderAllEntriesNames(const ImVec2& InSize);
|
||||||
|
|||||||
@@ -87,6 +87,17 @@ ImVec2 FCogImguiHelper::ToImVec2(const FVector2D& Value)
|
|||||||
return ImVec2(Value.X, Value.Y);
|
return ImVec2(Value.X, Value.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
ImVec2 FCogImguiHelper::ToImVec2(const FIntVector2& Value)
|
||||||
|
{
|
||||||
|
return ImVec2(Value.X, Value.Y);
|
||||||
|
}
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
ImVec2 FCogImguiHelper::ToImVec2(const FVector2f& Value)
|
||||||
|
{
|
||||||
|
return ImVec2(Value.X, Value.Y);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
ImColor FCogImguiHelper::ToImColor(const FColor& Value)
|
ImColor FCogImguiHelper::ToImColor(const FColor& Value)
|
||||||
{
|
{
|
||||||
@@ -118,11 +129,16 @@ ImVec4 FCogImguiHelper::ToImVec4(const FVector4f& Value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
ImU32 FCogImguiHelper::ToImU32(const FColor& Value)
|
ImU32 FCogImguiHelper::ToImU32(const FLinearColor& Value)
|
||||||
{
|
{
|
||||||
return (ImU32)ToImColor(Value);
|
return ToImColor(Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
ImU32 FCogImguiHelper::ToImU32(const FColor& Value)
|
||||||
|
{
|
||||||
|
return ToImColor(Value);
|
||||||
|
}
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
ImU32 FCogImguiHelper::ToImU32(const FVector4f& Value)
|
ImU32 FCogImguiHelper::ToImU32(const FVector4f& Value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ public:
|
|||||||
|
|
||||||
static ImVec2 ToImVec2(const FVector2D& Value);
|
static ImVec2 ToImVec2(const FVector2D& Value);
|
||||||
|
|
||||||
|
static ImVec2 ToImVec2(const FIntVector2& Value);
|
||||||
|
|
||||||
|
static ImVec2 ToImVec2(const FVector2f& Value);
|
||||||
|
|
||||||
static ImColor ToImColor(const FColor& Value);
|
static ImColor ToImColor(const FColor& Value);
|
||||||
|
|
||||||
static ImColor ToImColor(const FLinearColor& Value);
|
static ImColor ToImColor(const FLinearColor& Value);
|
||||||
@@ -46,6 +50,8 @@ public:
|
|||||||
|
|
||||||
static ImVec4 ToImVec4(const FVector4f& Value);
|
static ImVec4 ToImVec4(const FVector4f& Value);
|
||||||
|
|
||||||
|
static ImU32 ToImU32(const FLinearColor& Value);
|
||||||
|
|
||||||
static ImU32 ToImU32(const FColor& Value);
|
static ImU32 ToImU32(const FColor& Value);
|
||||||
|
|
||||||
static ImU32 ToImU32(const FVector4f& Value);
|
static ImU32 ToImU32(const FVector4f& Value);
|
||||||
|
|||||||
@@ -59,6 +59,12 @@ bool FCogWindow::CheckEditorVisibility()
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogWindow::RenderContextMenu()
|
void FCogWindow::RenderContextMenu()
|
||||||
|
{
|
||||||
|
RenderSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogWindow::RenderSettings()
|
||||||
{
|
{
|
||||||
if (bHasMenu)
|
if (bHasMenu)
|
||||||
{
|
{
|
||||||
@@ -75,46 +81,32 @@ void FCogWindow::RenderContextMenu()
|
|||||||
void FCogWindow::Render(float DeltaTime)
|
void FCogWindow::Render(float DeltaTime)
|
||||||
{
|
{
|
||||||
ImGuiWindowFlags WindowFlags = 0;
|
ImGuiWindowFlags WindowFlags = 0;
|
||||||
PreRender(WindowFlags);
|
|
||||||
|
|
||||||
const FString WindowTitle = GetTitle() + "##" + Name;
|
|
||||||
|
|
||||||
if (bHasMenu && bShowMenu)
|
if (bHasMenu && bShowMenu)
|
||||||
{
|
{
|
||||||
WindowFlags |= ImGuiWindowFlags_MenuBar;
|
WindowFlags |= ImGuiWindowFlags_MenuBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bNoPadding)
|
PreBegin(WindowFlags);
|
||||||
{
|
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui::Begin(TCHAR_TO_ANSI(*WindowTitle), &bIsVisible, WindowFlags))
|
const FString WindowTitle = GetTitle() + "##" + Name;
|
||||||
|
const bool IsOpen = ImGui::Begin(StringCast<ANSICHAR>(*WindowTitle).Get(), &bIsVisible, WindowFlags);
|
||||||
|
|
||||||
|
PostBegin();
|
||||||
|
|
||||||
|
if (IsOpen)
|
||||||
{
|
{
|
||||||
if (bNoPadding)
|
RenderContent();
|
||||||
{
|
|
||||||
ImGui::PopStyleVar(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui::BeginPopupContextWindow())
|
if (ImGui::BeginPopupContextWindow())
|
||||||
{
|
{
|
||||||
RenderContextMenu();
|
RenderContextMenu();
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderContent();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (bNoPadding)
|
|
||||||
{
|
|
||||||
ImGui::PopStyleVar(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
PostRender();
|
PostEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -240,3 +232,9 @@ bool FCogWindow::IsWindowRenderedInMainMenu()
|
|||||||
return Owner->IsRenderingMainMenu();
|
return Owner->IsRenderingMainMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
float FCogWindow::GetDpiScale() const
|
||||||
|
{
|
||||||
|
return GetOwner()->GetContext().GetDpiScale();
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1365,3 +1365,24 @@ bool FCogWindowWidgets::PickButton(const char* InLabel, const ImVec2& InSize, Im
|
|||||||
|
|
||||||
return pressed;
|
return pressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
ImVec2 FCogWindowWidgets::ComputeScreenCornerLocation(const FVector2f& InAlignment, const FIntVector2& InPadding)
|
||||||
|
{
|
||||||
|
return ComputeScreenCornerLocation(FCogImguiHelper::ToImVec2(InAlignment), FCogImguiHelper::ToImVec2(InPadding));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
ImVec2 FCogWindowWidgets::ComputeScreenCornerLocation(const ImVec2& InAlignment, const ImVec2& InPadding)
|
||||||
|
{
|
||||||
|
const ImGuiViewport* Viewport = ImGui::GetMainViewport();
|
||||||
|
if (Viewport == nullptr)
|
||||||
|
{ return ImVec2(0, 0); }
|
||||||
|
|
||||||
|
// +Padding for left, 0 for center, -Padding for left
|
||||||
|
// +Padding for top, 0 for center, -Padding for bottom
|
||||||
|
const ImVec2 Offset = (InAlignment * 2 - ImVec2(1.0f, 1.0f)) * InPadding;
|
||||||
|
|
||||||
|
ImVec2 Position = Viewport->WorkPos + (InAlignment * Viewport->WorkSize) - Offset;
|
||||||
|
return Position;
|
||||||
|
}
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ void FCogWindow_Settings::SetDPIScale(float Value) const
|
|||||||
{
|
{
|
||||||
Config->DPIScale = Value;
|
Config->DPIScale = Value;
|
||||||
GetOwner()->GetContext().SetDPIScale(Config->DPIScale);
|
GetOwner()->GetContext().SetDPIScale(Config->DPIScale);
|
||||||
COG_NOTIFY(TEXT("DPI Scale: %0.2f"), Value);
|
//COG_NOTIFY(TEXT("DPI Scale: %0.2f"), Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
#include "CogWindow_Spacing.h"
|
#include "CogWindow_Spacing.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogWindow_Spacing::PreRender(ImGuiWindowFlags& WindowFlags)
|
void FCogWindow_Spacing::PreBegin(ImGuiWindowFlags& WindowFlags)
|
||||||
{
|
{
|
||||||
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0));
|
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogWindow_Spacing::PostRender()
|
void FCogWindow_Spacing::PostBegin()
|
||||||
{
|
{
|
||||||
ImGui::PopStyleColor(1);
|
ImGui::PopStyleColor(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public:
|
|||||||
|
|
||||||
/** */
|
/** */
|
||||||
virtual void RenderMainMenuWidget();
|
virtual void RenderMainMenuWidget();
|
||||||
|
void RenderSettings();
|
||||||
|
|
||||||
ImGuiID GetID() const { return ID; }
|
ImGuiID GetID() const { return ID; }
|
||||||
|
|
||||||
@@ -72,6 +73,8 @@ public:
|
|||||||
|
|
||||||
UCogWindowManager* GetOwner() const { return Owner; }
|
UCogWindowManager* GetOwner() const { return Owner; }
|
||||||
|
|
||||||
|
float GetDpiScale() const;
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
T* GetConfig(bool InResetConfigOnRequest = true) const { return Cast<T>(GetConfig(T::StaticClass(), InResetConfigOnRequest)); }
|
T* GetConfig(bool InResetConfigOnRequest = true) const { return Cast<T>(GetConfig(T::StaticClass(), InResetConfigOnRequest)); }
|
||||||
|
|
||||||
@@ -92,9 +95,11 @@ protected:
|
|||||||
|
|
||||||
virtual void RenderHelp();
|
virtual void RenderHelp();
|
||||||
|
|
||||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) {}
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) {}
|
||||||
|
|
||||||
virtual void PostRender() {}
|
virtual void PostBegin() {}
|
||||||
|
|
||||||
|
virtual void PostEnd() {}
|
||||||
|
|
||||||
virtual void RenderContent() {}
|
virtual void RenderContent() {}
|
||||||
|
|
||||||
@@ -118,8 +123,6 @@ protected:
|
|||||||
|
|
||||||
bool bShowMenu = true;
|
bool bShowMenu = true;
|
||||||
|
|
||||||
bool bNoPadding = false;
|
|
||||||
|
|
||||||
bool bHasMenu = false;
|
bool bHasMenu = false;
|
||||||
|
|
||||||
bool bIsVisible = false;
|
bool bIsVisible = false;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ struct FKeyBind;
|
|||||||
|
|
||||||
using FCogWindowActorContextMenuFunction = TFunction<void(AActor& Actor)>;
|
using FCogWindowActorContextMenuFunction = TFunction<void(AActor& Actor)>;
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
class COGWINDOW_API FCogWindowWidgets
|
class COGWINDOW_API FCogWindowWidgets
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -153,6 +154,10 @@ public:
|
|||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static bool ScalarArray(const char* InLabel, ImGuiDataType InDataType, TArray<T>& InArray, int32 InMaxEntries = 0, const ImVec2& Size = ImVec2(0, 0));
|
static bool ScalarArray(const char* InLabel, ImGuiDataType InDataType, TArray<T>& InArray, int32 InMaxEntries = 0, const ImVec2& Size = ImVec2(0, 0));
|
||||||
|
|
||||||
|
static ImVec2 ComputeScreenCornerLocation(const FVector2f& InAlignment, const FIntVector2& InPadding);
|
||||||
|
|
||||||
|
static ImVec2 ComputeScreenCornerLocation(const ImVec2& InAlignment, const ImVec2& InPadding);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename EnumType>
|
template<typename EnumType>
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ class COGWINDOW_API FCogWindow_Spacing : public FCogWindow
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) override;
|
||||||
|
|
||||||
virtual void PostRender() override;
|
virtual void PostBegin() override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ void FCogAIWindow_Blackboard::Initialize()
|
|||||||
Super::Initialize();
|
Super::Initialize();
|
||||||
|
|
||||||
bHasMenu = true;
|
bHasMenu = true;
|
||||||
bNoPadding = true;
|
|
||||||
|
|
||||||
Config = GetConfig<UCogAIConfig_Blackboard>();
|
Config = GetConfig<UCogAIConfig_Blackboard>();
|
||||||
}
|
}
|
||||||
@@ -25,6 +24,19 @@ void FCogAIWindow_Blackboard::RenderHelp()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAIWindow_Blackboard::PreBegin(ImGuiWindowFlags& WindowFlags)
|
||||||
|
{
|
||||||
|
WindowFlags |= ImGuiWindowFlags_NoScrollbar;
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAIWindow_Blackboard::PostBegin()
|
||||||
|
{
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogAIWindow_Blackboard::RenderContent()
|
void FCogAIWindow_Blackboard::RenderContent()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ protected:
|
|||||||
|
|
||||||
virtual void RenderHelp() override;
|
virtual void RenderHelp() override;
|
||||||
|
|
||||||
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) override;
|
||||||
|
|
||||||
|
virtual void PostBegin() override;
|
||||||
|
|
||||||
virtual void RenderContent() override;
|
virtual void RenderContent() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ void FCogAbilityWindow_Abilities::Initialize()
|
|||||||
Super::Initialize();
|
Super::Initialize();
|
||||||
|
|
||||||
bHasMenu = true;
|
bHasMenu = true;
|
||||||
bNoPadding = true;
|
|
||||||
|
|
||||||
Asset = GetAsset<UCogAbilityDataAsset>();
|
Asset = GetAsset<UCogAbilityDataAsset>();
|
||||||
Config = GetConfig<UCogAbilityConfig_Abilities>();
|
Config = GetConfig<UCogAbilityConfig_Abilities>();
|
||||||
@@ -35,6 +34,19 @@ void FCogAbilityWindow_Abilities::RenderHelp()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAbilityWindow_Abilities::PreBegin(ImGuiWindowFlags& WindowFlags)
|
||||||
|
{
|
||||||
|
WindowFlags |= ImGuiWindowFlags_NoScrollbar;
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAbilityWindow_Abilities::PostBegin()
|
||||||
|
{
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogAbilityWindow_Abilities::RenderTick(float DeltaTime)
|
void FCogAbilityWindow_Abilities::RenderTick(float DeltaTime)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ void FCogAbilityWindow_Attributes::Initialize()
|
|||||||
Super::Initialize();
|
Super::Initialize();
|
||||||
|
|
||||||
bHasMenu = true;
|
bHasMenu = true;
|
||||||
bNoPadding = true;
|
|
||||||
|
|
||||||
Config = GetConfig<UCogAbilityConfig_Attributes>();
|
Config = GetConfig<UCogAbilityConfig_Attributes>();
|
||||||
AlignmentConfig = GetConfig<UCogAbilityConfig_Alignment>();
|
AlignmentConfig = GetConfig<UCogAbilityConfig_Alignment>();
|
||||||
@@ -35,6 +34,18 @@ void FCogAbilityWindow_Attributes::RenderHelp()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAbilityWindow_Attributes::PreBegin(ImGuiWindowFlags& WindowFlags)
|
||||||
|
{
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAbilityWindow_Attributes::PostBegin()
|
||||||
|
{
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogAbilityWindow_Attributes::RenderTick(float DeltaTime)
|
void FCogAbilityWindow_Attributes::RenderTick(float DeltaTime)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ void FCogAbilityWindow_Effects::Initialize()
|
|||||||
Super::Initialize();
|
Super::Initialize();
|
||||||
|
|
||||||
bHasMenu = true;
|
bHasMenu = true;
|
||||||
bNoPadding = true;
|
|
||||||
|
|
||||||
Asset = GetAsset<UCogAbilityDataAsset>();
|
Asset = GetAsset<UCogAbilityDataAsset>();
|
||||||
Config = GetConfig<UCogAbilityConfig_Effects>();
|
Config = GetConfig<UCogAbilityConfig_Effects>();
|
||||||
@@ -40,6 +39,19 @@ void FCogAbilityWindow_Effects::RenderTick(float DeltaTime)
|
|||||||
RenderOpenEffects();
|
RenderOpenEffects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAbilityWindow_Effects::PreBegin(ImGuiWindowFlags& WindowFlags)
|
||||||
|
{
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAbilityWindow_Effects::PostBegin()
|
||||||
|
{
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogAbilityWindow_Effects::RenderContent()
|
void FCogAbilityWindow_Effects::RenderContent()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ void FCogAbilityWindow_Tags::Initialize()
|
|||||||
Super::Initialize();
|
Super::Initialize();
|
||||||
|
|
||||||
bHasMenu = true;
|
bHasMenu = true;
|
||||||
bNoPadding = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -20,6 +19,18 @@ void FCogAbilityWindow_Tags::RenderHelp()
|
|||||||
ImGui::Text("This window displays gameplay tags of the selected actor. ");
|
ImGui::Text("This window displays gameplay tags of the selected actor. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAbilityWindow_Tags::PreBegin(ImGuiWindowFlags& WindowFlags)
|
||||||
|
{
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAbilityWindow_Tags::PostBegin()
|
||||||
|
{
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogAbilityWindow_Tags::RenderContent()
|
void FCogAbilityWindow_Tags::RenderContent()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ void FCogAbilityWindow_Tasks::Initialize()
|
|||||||
Super::Initialize();
|
Super::Initialize();
|
||||||
|
|
||||||
bHasMenu = true;
|
bHasMenu = true;
|
||||||
bNoPadding = true;
|
|
||||||
|
|
||||||
Config = GetConfig<UCogAbilityConfig_Tasks>();
|
Config = GetConfig<UCogAbilityConfig_Tasks>();
|
||||||
}
|
}
|
||||||
@@ -27,9 +26,15 @@ void FCogAbilityWindow_Tasks::RenderHelp()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogAbilityWindow_Tasks::RenderTick(float DeltaTime)
|
void FCogAbilityWindow_Tasks::PreBegin(ImGuiWindowFlags& WindowFlags)
|
||||||
{
|
{
|
||||||
Super::RenderTick(DeltaTime);
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAbilityWindow_Tasks::PostBegin()
|
||||||
|
{
|
||||||
|
ImGui::PopStyleVar();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ protected:
|
|||||||
|
|
||||||
virtual void RenderHelp() override;
|
virtual void RenderHelp() override;
|
||||||
|
|
||||||
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) override;
|
||||||
|
|
||||||
|
virtual void PostBegin() override;
|
||||||
|
|
||||||
virtual void RenderTick(float DeltaTime) override;
|
virtual void RenderTick(float DeltaTime) override;
|
||||||
|
|
||||||
virtual void RenderContent() override;
|
virtual void RenderContent() override;
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ protected:
|
|||||||
|
|
||||||
virtual void RenderHelp() override;
|
virtual void RenderHelp() override;
|
||||||
|
|
||||||
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) override;
|
||||||
|
|
||||||
|
virtual void PostBegin() override;
|
||||||
|
|
||||||
virtual void RenderTick(float DeltaTime) override;
|
virtual void RenderTick(float DeltaTime) override;
|
||||||
|
|
||||||
virtual void RenderContent() override;
|
virtual void RenderContent() override;
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ protected:
|
|||||||
|
|
||||||
virtual void RenderTick(float DeltaTime) override;
|
virtual void RenderTick(float DeltaTime) override;
|
||||||
|
|
||||||
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) override;
|
||||||
|
|
||||||
|
virtual void PostBegin() override;
|
||||||
|
|
||||||
virtual void RenderEffectsTable();
|
virtual void RenderEffectsTable();
|
||||||
|
|
||||||
virtual void RenderEffectRow(UAbilitySystemComponent& AbilitySystemComponent, const FActiveGameplayEffectHandle& ActiveHandle, int32 Index, int32& Selected);
|
virtual void RenderEffectRow(UAbilitySystemComponent& AbilitySystemComponent, const FActiveGameplayEffectHandle& ActiveHandle, int32 Index, int32& Selected);
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ protected:
|
|||||||
|
|
||||||
virtual void RenderHelp() override;
|
virtual void RenderHelp() override;
|
||||||
|
|
||||||
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) override;
|
||||||
|
|
||||||
|
virtual void PostBegin() override;
|
||||||
|
|
||||||
virtual void RenderContent() override;
|
virtual void RenderContent() override;
|
||||||
|
|
||||||
virtual void RenderTagContainer(const UAbilitySystemComponent& AbilitySystemComponent, FGameplayTagContainer& TagContainer);
|
virtual void RenderTagContainer(const UAbilitySystemComponent& AbilitySystemComponent, FGameplayTagContainer& TagContainer);
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ protected:
|
|||||||
|
|
||||||
virtual void RenderHelp() override;
|
virtual void RenderHelp() override;
|
||||||
|
|
||||||
virtual void RenderTick(float DeltaTime) override;
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) override;
|
||||||
|
|
||||||
|
virtual void PostBegin() override;
|
||||||
|
|
||||||
virtual void RenderContent() override;
|
virtual void RenderContent() override;
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "CogAbilityWindow_Tweaks.h"
|
#include "CogAbilityWindow_Tweaks.h"
|
||||||
#include "CogAIWindow_BehaviorTree.h"
|
#include "CogAIWindow_BehaviorTree.h"
|
||||||
#include "CogAIWindow_Blackboard.h"
|
#include "CogAIWindow_Blackboard.h"
|
||||||
|
#include "CogEngineWindow_BuildInfo.h"
|
||||||
#include "CogEngineWindow_Cheats.h"
|
#include "CogEngineWindow_Cheats.h"
|
||||||
#include "CogEngineWindow_CollisionTester.h"
|
#include "CogEngineWindow_CollisionTester.h"
|
||||||
#include "CogEngineWindow_CollisionViewer.h"
|
#include "CogEngineWindow_CollisionViewer.h"
|
||||||
@@ -45,6 +46,8 @@ void Cog::AddAllWindows(UCogWindowManager& CogWindowManager)
|
|||||||
//---------------------------------------
|
//---------------------------------------
|
||||||
// Engine
|
// Engine
|
||||||
//---------------------------------------
|
//---------------------------------------
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_BuildInfo>("Engine.Build Info");
|
||||||
|
|
||||||
CogWindowManager.AddWindow<FCogEngineWindow_CollisionTester>("Engine.Collision Tester");
|
CogWindowManager.AddWindow<FCogEngineWindow_CollisionTester>("Engine.Collision Tester");
|
||||||
|
|
||||||
CogWindowManager.AddWindow<FCogEngineWindow_CollisionViewer>("Engine.Collision Viewer");
|
CogWindowManager.AddWindow<FCogEngineWindow_CollisionViewer>("Engine.Collision Viewer");
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ void FCogInputWindow_Gamepad::Initialize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogInputWindow_Gamepad::PreRender(ImGuiWindowFlags& WindowFlags)
|
void FCogInputWindow_Gamepad::PreBegin(ImGuiWindowFlags& WindowFlags)
|
||||||
{
|
{
|
||||||
if (Config->bShowAsOverlay)
|
if (Config->bShowAsOverlay)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
virtual void PreBegin(ImGuiWindowFlags& WindowFlags) override;
|
||||||
|
|
||||||
virtual void RenderContent() override;
|
virtual void RenderContent() override;
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,13 @@ Displays the blackboard of the selected actor.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### Build Info
|
||||||
|
Display the build information such as the build version, changelist, date, target, and so on.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### Cheats
|
### Cheats
|
||||||
Used to apply cheats to the selected actor.
|
Used to apply cheats to the selected actor.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user