mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-04 14:48:45 +00:00
Add help
This commit is contained in:
@@ -12,30 +12,19 @@
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
UCogEngineWindow_Collisions::UCogEngineWindow_Collisions()
|
||||
void UCogEngineWindow_Collisions::RenderHelp()
|
||||
{
|
||||
ObjectTypesToQuery = 0;
|
||||
ImGui::Text("This window is used to inspect collisions by performing a collision query with the selected channels. "
|
||||
"The query can be configured in the options. "
|
||||
"The displayed collision channels can be configured in the '%s' data asset. "
|
||||
, TCHAR_TO_ANSI(*GetNameSafe(CollisionsAsset.Get()))
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Collisions::SetCollisionsAsset(const UCogEngineDataAsset_Collisions* Asset)
|
||||
void UCogEngineWindow_Collisions::PreRender(ImGuiWindowFlags& WindowFlags)
|
||||
{
|
||||
if (Asset == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (FChannel& Channel : Channels)
|
||||
{
|
||||
Channel.IsValid = false;
|
||||
}
|
||||
|
||||
for (const FCogCollisionChannel& AssetChannel : Asset->Channels)
|
||||
{
|
||||
FChannel& Channel = Channels[(uint8)AssetChannel.Channel];
|
||||
Channel.IsValid = true;
|
||||
Channel.Color = AssetChannel.Color.ToFColor(true);
|
||||
}
|
||||
WindowFlags = ImGuiWindowFlags_MenuBar;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -60,6 +49,60 @@ void UCogEngineWindow_Collisions::RenderContent()
|
||||
return;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// Menu
|
||||
//-------------------------------------------------
|
||||
if (ImGui::BeginMenuBar())
|
||||
{
|
||||
if (ImGui::BeginMenu("Options"))
|
||||
{
|
||||
//-------------------------------------------------
|
||||
// Query Mode
|
||||
//-------------------------------------------------
|
||||
ImGui::Combo("Query", &QueryType,
|
||||
"Sphere\0"
|
||||
"Raycast Crosshair\0"
|
||||
"Raycast Cursor\0"
|
||||
"\0"
|
||||
);
|
||||
|
||||
//-------------------------------------------------
|
||||
// Query Distance
|
||||
//-------------------------------------------------
|
||||
ImGui::SliderFloat("Distance", &QueryDistance, 0.0f, 20000.0f, "%0.f");
|
||||
|
||||
//-------------------------------------------------
|
||||
// Query Thickness
|
||||
//-------------------------------------------------
|
||||
if (QueryType == 1 || QueryType == 2)
|
||||
{
|
||||
ImGui::SliderFloat("Thickness", &QueryThickness, 0.0f, 1000.0f, "%0.f");
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// Query Use Complex Collisions
|
||||
//-------------------------------------------------
|
||||
ImGui::Checkbox("Use Complex Collisions", &UseComplexCollisions);
|
||||
|
||||
//-------------------------------------------------
|
||||
// Show Names
|
||||
//-------------------------------------------------
|
||||
ImGui::Checkbox("Show Actors Names", &ShowActorsNames);
|
||||
|
||||
//-------------------------------------------------
|
||||
// Show Query
|
||||
//-------------------------------------------------
|
||||
ImGui::Checkbox("Show Query", &ShowQuery);
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// Profile
|
||||
//-------------------------------------------------
|
||||
const FCollisionResponseTemplate* SelectedProfile = CollisionProfile->GetProfileByIndex(ProfileIndex);
|
||||
FName SelectedProfileName = SelectedProfile != nullptr ? SelectedProfile->Name : FName("Custom");
|
||||
|
||||
@@ -89,7 +132,6 @@ void UCogEngineWindow_Collisions::RenderContent()
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
//-------------------------------------------------
|
||||
@@ -128,52 +170,6 @@ void UCogEngineWindow_Collisions::RenderContent()
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
//-------------------------------------------------
|
||||
// Query Mode
|
||||
//-------------------------------------------------
|
||||
static int QueryType = 0;
|
||||
ImGui::Combo("Query", &QueryType,
|
||||
"Sphere\0"
|
||||
"Raycast Crosshair\0"
|
||||
"Raycast Cursor\0"
|
||||
"\0"
|
||||
);
|
||||
|
||||
//-------------------------------------------------
|
||||
// Query Distance
|
||||
//-------------------------------------------------
|
||||
static float QueryDistance = 5000.0f;
|
||||
ImGui::SliderFloat("Distance", &QueryDistance, 0.0f, 20000.0f, "%0.f");
|
||||
|
||||
//-------------------------------------------------
|
||||
// Query Thickness
|
||||
//-------------------------------------------------
|
||||
static float QueryThickness = 0.0f;
|
||||
if (QueryType == 1 || QueryType == 2)
|
||||
{
|
||||
ImGui::SliderFloat("Thickness", &QueryThickness, 0.0f, 1000.0f, "%0.f");
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// Query Use Complex Collisions
|
||||
//-------------------------------------------------
|
||||
static bool UseComplexCollisions = false;
|
||||
ImGui::Checkbox("Use Complex Collisions", &UseComplexCollisions);
|
||||
|
||||
//-------------------------------------------------
|
||||
// Show Names
|
||||
//-------------------------------------------------
|
||||
static bool ShowActorsNames = false;
|
||||
ImGui::Checkbox("Show Actors Names", &ShowActorsNames);
|
||||
|
||||
//-------------------------------------------------
|
||||
// Show Query
|
||||
//-------------------------------------------------
|
||||
static bool ShowQuery = false;
|
||||
ImGui::Checkbox("Show Query", &ShowQuery);
|
||||
|
||||
//-------------------------------------------------
|
||||
// Perform Query
|
||||
//-------------------------------------------------
|
||||
@@ -182,8 +178,6 @@ void UCogEngineWindow_Collisions::RenderContent()
|
||||
return;
|
||||
}
|
||||
|
||||
UWorld* World = GetWorld();
|
||||
|
||||
FVector QueryStart;
|
||||
FVector QueryEnd;
|
||||
float QueryRadius = 0.0f;
|
||||
@@ -235,6 +229,7 @@ void UCogEngineWindow_Collisions::RenderContent()
|
||||
QueryShape.SetSphere(QueryRadius);
|
||||
|
||||
TArray<FHitResult> QueryHits;
|
||||
UWorld* World = GetWorld();
|
||||
World->SweepMultiByObjectType(
|
||||
QueryHits,
|
||||
QueryStart,
|
||||
@@ -371,3 +366,24 @@ void UCogEngineWindow_Collisions::RenderContent()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Collisions::SetCollisionsAsset(const UCogEngineDataAsset_Collisions* Asset)
|
||||
{
|
||||
if (Asset == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (FChannel& Channel : Channels)
|
||||
{
|
||||
Channel.IsValid = false;
|
||||
}
|
||||
|
||||
for (const FCogCollisionChannel& AssetChannel : Asset->Channels)
|
||||
{
|
||||
FChannel& Channel = Channels[(uint8)AssetChannel.Channel];
|
||||
Channel.IsValid = true;
|
||||
Channel.Color = AssetChannel.Color.ToFColor(true);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,12 @@
|
||||
#include "CogWindowWidgets.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
UCogEngineWindow_DebugSettings::UCogEngineWindow_DebugSettings()
|
||||
void UCogEngineWindow_DebugSettings::RenderHelp()
|
||||
{
|
||||
ImGui::Text(
|
||||
"This window can be used to setup how the debug display is drawn. "
|
||||
"Check each item for more info. "
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -41,64 +45,62 @@ void UCogEngineWindow_DebugSettings::RenderContent()
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("Show a shadow below debug text.");
|
||||
|
||||
const float ItemsWidth = FCogWindowWidgets::TextBaseWidth * 10;
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::Checkbox("Fade 2D", &FCogDebugSettings::Fade2D);
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("Does the 2D debug is fading out.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragFloat("Duration", &FCogDebugSettings::Duration, 0.01f, 0.0f, 100.0f, "%.1f");
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("The duration of debug elements.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragFloat("Thickness", &FCogDebugSettings::Thickness, 0.05f, 0.0f, 5.0f, "%.1f");
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("The thickness of debug lines.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragFloat("Server Thickness", &FCogDebugSettings::ServerThickness, 0.05f, 0.0f, 5.0f, "%.1f");
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("The thickness the server debug lines.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragFloat("Server Color Mult", &FCogDebugSettings::ServerColorMultiplier, 0.01f, 0.0f, 1.0f, "%.1f");
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("The color multiplier applied to the server debug lines.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragInt("Depth Priority", &FCogDebugSettings::DepthPriority, 0.1f, 0, 100);
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("The depth priority of debug elements.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragInt("Segments", &FCogDebugSettings::Segments, 0.1f, 4, 20.0f);
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("The number of segments used for circular shapes.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragFloat("Axes Scale", &FCogDebugSettings::AxesScale, 0.1f, 0, 10.0f, "%.1f");
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("The scaling debug axis.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragFloat("Arrow Size", &FCogDebugSettings::ArrowSize, 1.0f, 0.0f, 200.0f, "%.0f");
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("The size of debug arrows.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragFloat("Gradient Intensity", &FCogDebugSettings::GradientColorIntensity, 0.01f, 0.0f, 1.0f, "%.2f");
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("How much the debug elements color should be changed by a gradient color over time.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragFloat("Gradient Speed", &FCogDebugSettings::GradientColorSpeed, 0.1f, 0.0f, 10.0f, "%.1f");
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("The speed of the gradient color change.");
|
||||
|
||||
ImGui::SetNextItemWidth(ItemsWidth);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
ImGui::DragFloat("Text Size", &FCogDebugSettings::TextSize, 0.1f, 0.1f, 5.0f, "%.1f");
|
||||
ImGui::SameLine();
|
||||
FCogWindowWidgets::HelpMarker("The size of the debug texts.");
|
||||
|
||||
@@ -4,6 +4,19 @@
|
||||
#include "CogWindowWidgets.h"
|
||||
#include "CogDebugLogCategoryManager.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_LogCategories::RenderHelp()
|
||||
{
|
||||
ImGui::Text(
|
||||
"This window can be used to activate and deactivate log categories."
|
||||
"Activating a log category set its verbosity to VeryVerbose. "
|
||||
"Deactivating a log category set its verbosity to Warning. "
|
||||
"The detailed verbosity of each log category can shown by using the Option menu. "
|
||||
"On a client, both the client and the server verbosity can be modified. "
|
||||
"The log categories are used to display both output log and debug display in the world. "
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_LogCategories::PreRender(ImGuiWindowFlags& WindowFlags)
|
||||
{
|
||||
@@ -145,7 +158,7 @@ void UCogEngineWindow_LogCategories::RenderContent()
|
||||
if (IsClient)
|
||||
{
|
||||
ELogVerbosity::Type CurrentVerbosity = FCogDebugLogCategoryManager::GetServerVerbosity(CategoryName);
|
||||
ImGui::SetNextItemWidth(FCogWindowWidgets::TextBaseWidth * 12);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::BeginCombo("##Server", FCogDebugHelper::VerbosityToString(CurrentVerbosity)))
|
||||
{
|
||||
for (int32 i = (int32)ELogVerbosity::Error; i <= (int32)ELogVerbosity::VeryVerbose; ++i)
|
||||
@@ -173,7 +186,7 @@ void UCogEngineWindow_LogCategories::RenderContent()
|
||||
|
||||
{
|
||||
ELogVerbosity::Type CurrentVerbosity = Category->GetVerbosity();
|
||||
ImGui::SetNextItemWidth(FCogWindowWidgets::TextBaseWidth * 12);
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::BeginCombo("##Local", FCogDebugHelper::VerbosityToString(CurrentVerbosity)))
|
||||
{
|
||||
for (int32 i = (int32)ELogVerbosity::Error; i <= (int32)ELogVerbosity::VeryVerbose; ++i)
|
||||
|
||||
@@ -4,6 +4,14 @@
|
||||
#include "CogImguiHelper.h"
|
||||
#include "imgui.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Metrics::RenderHelp()
|
||||
{
|
||||
ImGui::Text(
|
||||
"This window gather events generated by the selected actor to compute how much output it produces or receives per second. "
|
||||
"This is typically useful to compute the damage dealt per second, the damage received per second, etc. "
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Metrics::PostLoad()
|
||||
@@ -107,19 +115,19 @@ void UCogEngineWindow_Metrics::DrawMetric(FCogDebugMetricEntry& Metric)
|
||||
}
|
||||
|
||||
ImGui::Text("Crits");
|
||||
ImGui::SameLine(FCogWindowWidgets::TextBaseWidth * 20);
|
||||
ImGui::SameLine(FCogWindowWidgets::GetFontWidth() * 20);
|
||||
FCogWindowWidgets::ProgressBarCentered(Metric.Count == 0 ? 0.0f : Metric.Crits / (float)Metric.Count, ImVec2(-1, 0), TCHAR_TO_ANSI(*FString::Printf(TEXT("%d / %d"), Metric.Crits, Metric.Count)));
|
||||
|
||||
if (FCogDebugMetric::MaxDurationSetting > 0.0f)
|
||||
{
|
||||
ImGui::Text("Timer");
|
||||
ImGui::SameLine(FCogWindowWidgets::TextBaseWidth * 20);
|
||||
ImGui::SameLine(FCogWindowWidgets::GetFontWidth() * 20);
|
||||
FCogWindowWidgets::ProgressBarCentered(Metric.Timer / (float)FCogDebugMetric::MaxDurationSetting, ImVec2(-1, 0), TCHAR_TO_ANSI(*FString::Printf(TEXT("%0.1f / %0.1f"), Metric.Timer, FCogDebugMetric::MaxDurationSetting)));
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::Text("Timer");
|
||||
ImGui::SameLine(FCogWindowWidgets::TextBaseWidth * 20);
|
||||
ImGui::SameLine(FCogWindowWidgets::GetFontWidth() * 20);
|
||||
ImGui::Text("%0.1f", Metric.Timer);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,58 @@
|
||||
#include "GameFramework/PlayerState.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void DrawControls(UWorld* World)
|
||||
void UCogEngineWindow_NetEmulation::RenderHelp()
|
||||
{
|
||||
FWorldContext& WorldContext = GEngine->GetWorldContextFromWorldChecked(World);
|
||||
ImGui::Text("This window is used to configure the network emulation.");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_NetEmulation::RenderContent()
|
||||
{
|
||||
Super::RenderContent();
|
||||
|
||||
DrawStats();
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
DrawControls();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_NetEmulation::DrawStats()
|
||||
{
|
||||
const APlayerController* PlayerController = GetLocalPlayerController();
|
||||
if (PlayerController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (const APlayerState* PlayerState = PlayerController->GetPlayerState<APlayerState>())
|
||||
{
|
||||
const float Ping = PlayerState->GetPingInMilliseconds();
|
||||
ImGui::Text("Ping ");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextColored(UCogEngineWindow_Stats::GetPingColor(Ping), "%0.0fms", Ping);
|
||||
}
|
||||
|
||||
if (UNetConnection* Connection = PlayerController->GetNetConnection())
|
||||
{
|
||||
const float OutPacketLost = Connection->GetOutLossPercentage().GetAvgLossPercentage() * 100.0f;
|
||||
ImGui::Text("Packet Loss Out ");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextColored(UCogEngineWindow_Stats::GetPacketLossColor(OutPacketLost), "%0.0f%%", OutPacketLost);
|
||||
|
||||
const float InPacketLost = Connection->GetInLossPercentage().GetAvgLossPercentage() * 100.0f;
|
||||
ImGui::Text("Packet Loss In ");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextColored(UCogEngineWindow_Stats::GetPacketLossColor(InPacketLost), "%0.0f%%", InPacketLost);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_NetEmulation::DrawControls()
|
||||
{
|
||||
FWorldContext& WorldContext = GEngine->GetWorldContextFromWorldChecked(GetWorld());
|
||||
|
||||
if (WorldContext.ActiveNetDrivers.Num() == 0)
|
||||
{
|
||||
@@ -30,6 +79,7 @@ void DrawControls(UWorld* World)
|
||||
return;
|
||||
}
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::BeginCombo("Driver", TCHAR_TO_ANSI(*SelectedNetDriver->NetDriver->GetName())))
|
||||
{
|
||||
int i = 0;
|
||||
@@ -60,6 +110,7 @@ void DrawControls(UWorld* World)
|
||||
FPacketSimulationSettings Settings = SelectedNetDriver->NetDriver->PacketSimulationSettings;
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::DragInt("Lag Min", &Settings.PktLagMin, 1.0f, 0, INT_MAX, "%d ms"))
|
||||
{
|
||||
SelectedNetDriver->NetDriver->SetPacketSimulationSettings(Settings);
|
||||
@@ -71,6 +122,7 @@ void DrawControls(UWorld* World)
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::DragInt("Lag Max", &Settings.PktLagMax, 1.0f, 0, INT_MAX, "%d ms"))
|
||||
{
|
||||
SelectedNetDriver->NetDriver->SetPacketSimulationSettings(Settings);
|
||||
@@ -81,6 +133,8 @@ void DrawControls(UWorld* World)
|
||||
"If set lag values will randomly fluctuate between Min and Max.");
|
||||
}
|
||||
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::SliderInt("Packet Loss", &Settings.PktLoss, 0, 100, "%d%%"))
|
||||
{
|
||||
SelectedNetDriver->NetDriver->SetPacketSimulationSettings(Settings);
|
||||
@@ -96,6 +150,7 @@ void DrawControls(UWorld* World)
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::SliderInt("Packet Order", &Settings.PktOrder, 0, 100, "%d%%"))
|
||||
{
|
||||
SelectedNetDriver->NetDriver->SetPacketSimulationSettings(Settings);
|
||||
@@ -110,6 +165,7 @@ void DrawControls(UWorld* World)
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::SliderInt("Packet Dup", &Settings.PktDup, 0, 100, "%d%%"))
|
||||
{
|
||||
SelectedNetDriver->NetDriver->SetPacketSimulationSettings(Settings);
|
||||
@@ -127,6 +183,7 @@ void DrawControls(UWorld* World)
|
||||
ImGui::Separator();
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::DragInt("Incoming Lag Min", &Settings.PktIncomingLagMin, 1.0f, 0, INT_MAX, "%d ms"))
|
||||
{
|
||||
SelectedNetDriver->NetDriver->SetPacketSimulationSettings(Settings);
|
||||
@@ -138,6 +195,7 @@ void DrawControls(UWorld* World)
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::DragInt("Incoming Lag Max", &Settings.PktIncomingLagMax, 1.0f, 0, INT_MAX, "%d ms"))
|
||||
{
|
||||
SelectedNetDriver->NetDriver->SetPacketSimulationSettings(Settings);
|
||||
@@ -149,6 +207,7 @@ void DrawControls(UWorld* World)
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::SliderInt("Incoming Packet Loss", &Settings.PktIncomingLoss, 0, 100, "%d%%"))
|
||||
{
|
||||
SelectedNetDriver->NetDriver->SetPacketSimulationSettings(Settings);
|
||||
@@ -159,43 +218,4 @@ void DrawControls(UWorld* World)
|
||||
"The ratio of incoming packets that will be dropped to simulate packet loss");
|
||||
}
|
||||
|
||||
#endif //DO_ENABLE_NET_TEST
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_NetEmulation::RenderContent()
|
||||
{
|
||||
Super::RenderContent();
|
||||
|
||||
const APlayerController* PlayerController = GetLocalPlayerController();
|
||||
if (PlayerController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (const APlayerState* PlayerState = PlayerController->GetPlayerState<APlayerState>())
|
||||
{
|
||||
const float Ping = PlayerState->GetPingInMilliseconds();
|
||||
ImGui::Text("Ping ");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextColored(UCogEngineWindow_Stats::GetPingColor(Ping), "%0.0fms", Ping);
|
||||
}
|
||||
|
||||
if (UNetConnection* Connection = PlayerController->GetNetConnection())
|
||||
{
|
||||
const float OutPacketLost = Connection->GetOutLossPercentage().GetAvgLossPercentage() * 100.0f;
|
||||
ImGui::Text("Packet Loss Out ");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextColored(UCogEngineWindow_Stats::GetPacketLossColor(OutPacketLost), "%0.0f%%", OutPacketLost);
|
||||
|
||||
const float InPacketLost = Connection->GetInLossPercentage().GetAvgLossPercentage() * 100.0f;
|
||||
ImGui::Text("Packet Loss In ");
|
||||
ImGui::SameLine();
|
||||
ImGui::TextColored(UCogEngineWindow_Stats::GetPacketLossColor(InPacketLost), "%0.0f%%", InPacketLost);
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
DrawControls(GetWorld());
|
||||
}
|
||||
#endif //DO_ENABLE_NET_TEST
|
||||
@@ -40,6 +40,15 @@ UCogEngineWindow_OutputLog::UCogEngineWindow_OutputLog()
|
||||
OutputDevice.OutputLog = this;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_OutputLog::RenderHelp()
|
||||
{
|
||||
ImGui::Text(
|
||||
"This window output the log based on each log categories verbosity. "
|
||||
"The verbosity of each log category can be configured in the 'Log Categories' window. "
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_OutputLog::Clear()
|
||||
{
|
||||
@@ -169,13 +178,6 @@ void UCogEngineWindow_OutputLog::RenderContent()
|
||||
ImGui::Checkbox("Show Verbosity", &ShowVerbosity);
|
||||
ImGui::Checkbox("Show As Table", &ShowAsTable);
|
||||
|
||||
//if (ImGui::SmallButton("Add Log"))
|
||||
//{
|
||||
// AddLog(TEXT("ABCD"), ELogVerbosity::Verbose, FName("Test"));
|
||||
// AddLog(TEXT("EFGH"), ELogVerbosity::Warning, FName("Test"));
|
||||
// AddLog(TEXT("WXYZ"), ELogVerbosity::Error, FName("Test"));
|
||||
//}
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
@@ -222,17 +224,17 @@ void UCogEngineWindow_OutputLog::RenderContent()
|
||||
IsTableShown = true;
|
||||
if (ShowFrame)
|
||||
{
|
||||
ImGui::TableSetupColumn("Frame", ImGuiTableColumnFlags_WidthFixed, FCogWindowWidgets::TextBaseWidth * 4);
|
||||
ImGui::TableSetupColumn("Frame", ImGuiTableColumnFlags_WidthFixed, FCogWindowWidgets::GetFontWidth() * 4);
|
||||
}
|
||||
|
||||
if (ShowCategory)
|
||||
{
|
||||
ImGui::TableSetupColumn("Category", ImGuiTableColumnFlags_WidthFixed, FCogWindowWidgets::TextBaseWidth * 10);
|
||||
ImGui::TableSetupColumn("Category", ImGuiTableColumnFlags_WidthFixed, FCogWindowWidgets::GetFontWidth() * 10);
|
||||
}
|
||||
|
||||
if (ShowVerbosity)
|
||||
{
|
||||
ImGui::TableSetupColumn("Verbosity", ImGuiTableColumnFlags_WidthFixed, FCogWindowWidgets::TextBaseWidth * 10);
|
||||
ImGui::TableSetupColumn("Verbosity", ImGuiTableColumnFlags_WidthFixed, FCogWindowWidgets::GetFontWidth() * 10);
|
||||
}
|
||||
|
||||
ImGui::TableSetupColumn("Message", ImGuiTableColumnFlags_WidthStretch);
|
||||
|
||||
@@ -8,8 +8,11 @@
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
UCogEngineWindow_Plots::UCogEngineWindow_Plots()
|
||||
void UCogEngineWindow_Plots::RenderHelp()
|
||||
{
|
||||
ImGui::Text(
|
||||
"This window plots values overtime. When applicable, only the values of the selected actor are displayed."
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -29,7 +32,7 @@ void UCogEngineWindow_Plots::RenderContent()
|
||||
|
||||
if (ImGui::BeginTable("PlotTable", 2, ImGuiTableFlags_RowBg | ImGuiTableFlags_Resizable))
|
||||
{
|
||||
ImGui::TableSetupColumn("Settings", ImGuiTableColumnFlags_WidthFixed, FCogWindowWidgets::TextBaseWidth * 20.0f);
|
||||
ImGui::TableSetupColumn("Settings", ImGuiTableColumnFlags_WidthFixed, FCogWindowWidgets::GetFontWidth() * 20.0f);
|
||||
ImGui::TableSetupColumn("Graph", ImGuiTableColumnFlags_WidthStretch, 0.0f);
|
||||
ImGui::TableNextRow();
|
||||
|
||||
|
||||
@@ -6,9 +6,13 @@
|
||||
|
||||
#define SCALABILITY_NUM_LEVELS 5
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
UCogEngineWindow_Scalability::UCogEngineWindow_Scalability()
|
||||
void UCogEngineWindow_Scalability::RenderHelp()
|
||||
{
|
||||
ImGui::Text(
|
||||
"This window can be used to configure the rendering quality."
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -18,6 +22,7 @@ void UCogEngineWindow_Scalability::RenderContent()
|
||||
|
||||
Scalability::FQualityLevels Levels = Scalability::GetQualityLevels();
|
||||
FString CurrentQualityName = Scalability::GetQualityLevelText(Levels.GetMinQualityLevel(), SCALABILITY_NUM_LEVELS).ToString();
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
if (ImGui::BeginCombo("Scalability", TCHAR_TO_ANSI(*CurrentQualityName)))
|
||||
{
|
||||
for (int32 i = 0; i < SCALABILITY_NUM_LEVELS; ++i)
|
||||
@@ -38,58 +43,44 @@ void UCogEngineWindow_Scalability::RenderContent()
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
if (ImGui::SliderFloat("Resolution", &Levels.ResolutionQuality, 10.0f, 100.0f, "%0.f"))
|
||||
bool Modified = false;
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderFloat("Resolution", &Levels.ResolutionQuality, 10.0f, 100.0f, "%0.f");
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderInt("View Distance", &Levels.ViewDistanceQuality, 0, SCALABILITY_NUM_LEVELS - 1);
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderInt("Anti Aliasing", &Levels.AntiAliasingQuality, 0, SCALABILITY_NUM_LEVELS - 1);
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderInt("Shadow", &Levels.ShadowQuality, 0, SCALABILITY_NUM_LEVELS - 1);
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderInt("Global Illumination", &Levels.GlobalIlluminationQuality, 0, SCALABILITY_NUM_LEVELS - 1);
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderInt("Reflection", &Levels.ReflectionQuality, 0, SCALABILITY_NUM_LEVELS - 1);
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderInt("Post Process", &Levels.PostProcessQuality, 0, SCALABILITY_NUM_LEVELS - 1);
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderInt("Texture", &Levels.TextureQuality, 0, SCALABILITY_NUM_LEVELS - 1);
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderInt("Effects", &Levels.EffectsQuality, 0, SCALABILITY_NUM_LEVELS - 1);
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderInt("Foliage", &Levels.FoliageQuality, 0, SCALABILITY_NUM_LEVELS - 1);
|
||||
|
||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||
Modified |= ImGui::SliderInt("Shading", &Levels.ShadingQuality, 0, SCALABILITY_NUM_LEVELS - 1);
|
||||
|
||||
if (Modified)
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("View Distance", &Levels.ViewDistanceQuality, 0, SCALABILITY_NUM_LEVELS - 1))
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("Anti Aliasing", &Levels.AntiAliasingQuality, 0, SCALABILITY_NUM_LEVELS - 1))
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("Shadow", &Levels.ShadowQuality, 0, SCALABILITY_NUM_LEVELS - 1))
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("Global Illumination", &Levels.GlobalIlluminationQuality, 0, SCALABILITY_NUM_LEVELS - 1))
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("Reflection", &Levels.ReflectionQuality, 0, SCALABILITY_NUM_LEVELS - 1))
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("Post Process", &Levels.PostProcessQuality, 0, SCALABILITY_NUM_LEVELS - 1))
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("Texture", &Levels.TextureQuality, 0, SCALABILITY_NUM_LEVELS - 1))
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("Effects", &Levels.EffectsQuality, 0, SCALABILITY_NUM_LEVELS - 1))
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("Foliage", &Levels.FoliageQuality, 0, SCALABILITY_NUM_LEVELS - 1))
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("Shading", &Levels.ShadingQuality, 0, SCALABILITY_NUM_LEVELS - 1))
|
||||
{
|
||||
Scalability::SetQualityLevels(Levels);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,14 @@
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
UCogEngineWindow_Selection::UCogEngineWindow_Selection()
|
||||
void UCogEngineWindow_Selection::RenderHelp()
|
||||
{
|
||||
ImGui::Text(
|
||||
"This window can be used to select an actor either by picking an actor in the world, "
|
||||
"or by selecting an actor in the actor list. "
|
||||
"The actor list can be filtered by actor type (Actor, Character, etc). "
|
||||
"The current selection is used by various debug windows to filter out their content"
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -200,7 +206,7 @@ void UCogEngineWindow_Selection::DrawActorContextMenu(AActor* Actor)
|
||||
//------------------------
|
||||
// ContextMenu
|
||||
//------------------------
|
||||
ImGui::SetNextWindowSize(ImVec2(FCogWindowWidgets::TextBaseWidth * 20, 0));
|
||||
ImGui::SetNextWindowSize(ImVec2(FCogWindowWidgets::GetFontWidth() * 20, 0));
|
||||
if (ImGui::BeginPopupContextItem())
|
||||
{
|
||||
if (ImGui::Button("Reset Selection", ImVec2(-1, 0)))
|
||||
@@ -387,9 +393,9 @@ bool UCogEngineWindow_Selection::ComputeBoundingBoxScreenPosition(const APlayerC
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Selection::DrawMainMenuWidget(bool Draw, float& Width)
|
||||
{
|
||||
const float PickButtonWidth = FCogWindowWidgets::TextBaseWidth * 5;
|
||||
const float SelectionButtonWidth = FCogWindowWidgets::TextBaseWidth * 30;
|
||||
const float ResetButtonWidth = FCogWindowWidgets::TextBaseWidth * 2;
|
||||
const float PickButtonWidth = FCogWindowWidgets::GetFontWidth() * 5;
|
||||
const float SelectionButtonWidth = FCogWindowWidgets::GetFontWidth() * 30;
|
||||
const float ResetButtonWidth = FCogWindowWidgets::GetFontWidth() * 2;
|
||||
Width = PickButtonWidth + SelectionButtonWidth + ResetButtonWidth;
|
||||
|
||||
if (Draw == false)
|
||||
@@ -399,7 +405,7 @@ void UCogEngineWindow_Selection::DrawMainMenuWidget(bool Draw, float& Width)
|
||||
|
||||
if (ImGui::BeginPopup("SelectionPopup"))
|
||||
{
|
||||
ImGui::BeginChild("Popup", ImVec2(Width, FCogWindowWidgets::TextBaseWidth * 40), false);
|
||||
ImGui::BeginChild("Popup", ImVec2(Width, FCogWindowWidgets::GetFontWidth() * 40), false);
|
||||
|
||||
if (DrawSelectionCombo())
|
||||
{
|
||||
|
||||
@@ -105,7 +105,7 @@ void UCogEngineWindow_Skeleton::RenderContent()
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, FCogWindowWidgets::TextBaseWidth);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, FCogWindowWidgets::GetFontWidth());
|
||||
|
||||
HoveredBoneIndex = INDEX_NONE;
|
||||
DrawBoneEntry(0, false);
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
#include "CogEngineWindow_Spawns.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Spawns::RenderHelp()
|
||||
{
|
||||
ImGui::Text(
|
||||
"This window can be used to spawn new actors in the world. "
|
||||
"The spawn list can be configured in the '%s' data asset. "
|
||||
, TCHAR_TO_ANSI(*GetNameSafe(SpawnAsset))
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Spawns::PreRender(ImGuiWindowFlags& WindowFlags)
|
||||
{
|
||||
@@ -11,12 +21,12 @@ void UCogEngineWindow_Spawns::RenderContent()
|
||||
{
|
||||
Super::RenderContent();
|
||||
|
||||
if (Asset == nullptr)
|
||||
if (SpawnAsset == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (const FCogEngineSpawnGroup& SpawnGroup : Asset->SpawnGroups)
|
||||
for (const FCogEngineSpawnGroup& SpawnGroup : SpawnAsset->SpawnGroups)
|
||||
{
|
||||
RenderSpawnGroup(SpawnGroup);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,14 @@ ImVec4 StatRedColor(1.0f, 0.4f, 0.3f, 1.0f);
|
||||
ImVec4 StatOrangeColor(1.0f, 0.7f, 0.4f, 1.0f);
|
||||
ImVec4 StatGreenColor(0.5f, 1.0f, 0.6f, 1.0f);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Stats::RenderHelp()
|
||||
{
|
||||
ImGui::Text(
|
||||
"This window display engine stats such as FPS, Ping, Packet Loss. "
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Stats::RenderContent()
|
||||
{
|
||||
@@ -46,7 +54,7 @@ void UCogEngineWindow_Stats::RenderContent()
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Stats::DrawMainMenuWidget(bool Draw, float& Width)
|
||||
{
|
||||
Width = FCogWindowWidgets::TextBaseWidth * 25;
|
||||
Width = FCogWindowWidgets::GetFontWidth() * 25;
|
||||
|
||||
if (Draw == false)
|
||||
{
|
||||
|
||||
+39
-30
@@ -1,42 +1,20 @@
|
||||
#include "CogEngineWindow_Time.h"
|
||||
#include "CogEngineWindow_TimeScale.h"
|
||||
|
||||
#include "CogEngineReplicator.h"
|
||||
#include "Engine/Engine.h"
|
||||
#include "Engine/World.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void DrawTimeButton(ACogEngineReplicator* Replicator, float Value)
|
||||
void UCogEngineWindow_TimeScale::RenderHelp()
|
||||
{
|
||||
const bool IsSelected = FMath::IsNearlyEqual(Replicator->GetTimeDilation(), Value, 0.0001f);
|
||||
if (IsSelected)
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, IM_COL32(128, 128, 128, 50));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, IM_COL32(128, 128, 128, 100));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, IM_COL32(128, 128, 128, 150));
|
||||
}
|
||||
|
||||
const char* Text = TCHAR_TO_ANSI(*FString::Printf(TEXT("%g"), Value).Replace(TEXT("0."), TEXT(".")));
|
||||
if (ImGui::Button(Text, ImVec2(3.5f * FCogWindowWidgets::TextBaseWidth, 0)))
|
||||
{
|
||||
Replicator->Server_SetTimeDilation(Value);
|
||||
}
|
||||
|
||||
if (IsSelected)
|
||||
{
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::PopStyleColor(3);
|
||||
}
|
||||
ImGui::Text(
|
||||
"This window can be used to change the game global time scale. "
|
||||
"If changed on a client the time scale is also modified on the game server. "
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
UCogEngineWindow_Time::UCogEngineWindow_Time()
|
||||
UCogEngineWindow_TimeScale::UCogEngineWindow_TimeScale()
|
||||
{
|
||||
TimingScales.Add(0.00f);
|
||||
TimingScales.Add(0.01f);
|
||||
@@ -49,7 +27,7 @@ UCogEngineWindow_Time::UCogEngineWindow_Time()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Time::RenderContent()
|
||||
void UCogEngineWindow_TimeScale::RenderContent()
|
||||
{
|
||||
Super::RenderContent();
|
||||
|
||||
@@ -74,3 +52,34 @@ void UCogEngineWindow_Time::RenderContent()
|
||||
ImGui::PopStyleColor(1);
|
||||
ImGui::PopStyleVar(3);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_TimeScale::DrawTimeButton(ACogEngineReplicator* Replicator, float Value)
|
||||
{
|
||||
const bool IsSelected = FMath::IsNearlyEqual(Replicator->GetTimeDilation(), Value, 0.0001f);
|
||||
if (IsSelected)
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, IM_COL32(128, 128, 128, 50));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, IM_COL32(128, 128, 128, 100));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, IM_COL32(128, 128, 128, 150));
|
||||
}
|
||||
|
||||
const char* Text = TCHAR_TO_ANSI(*FString::Printf(TEXT("%g"), Value).Replace(TEXT("0."), TEXT(".")));
|
||||
if (ImGui::Button(Text, ImVec2(3.5f * FCogWindowWidgets::GetFontWidth(), 0)))
|
||||
{
|
||||
Replicator->Server_SetTimeDilation(Value);
|
||||
}
|
||||
|
||||
if (IsSelected)
|
||||
{
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::PopStyleColor(3);
|
||||
}
|
||||
}
|
||||
@@ -12,14 +12,17 @@ class COGENGINE_API UCogEngineWindow_Collisions : public UCogWindow
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UCogEngineWindow_Collisions();
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
void SetCollisionsAsset(const UCogEngineDataAsset_Collisions* Asset);
|
||||
|
||||
private:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
struct FChannel
|
||||
{
|
||||
bool IsValid = false;
|
||||
@@ -31,8 +34,26 @@ private:
|
||||
FChannel Channels[ECC_MAX];
|
||||
|
||||
UPROPERTY(Config)
|
||||
int32 ObjectTypesToQuery;
|
||||
int32 ObjectTypesToQuery = 0;
|
||||
|
||||
UPROPERTY(Config)
|
||||
int32 ProfileIndex = 0;
|
||||
|
||||
UPROPERTY(Config)
|
||||
int QueryType = 0;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float QueryDistance = 5000.0f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float QueryThickness = 0.0f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
bool UseComplexCollisions = false;
|
||||
|
||||
UPROPERTY(Config)
|
||||
bool ShowActorsNames = false;
|
||||
|
||||
UPROPERTY(Config)
|
||||
bool ShowQuery = false;
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ class COGENGINE_API UCogEngineWindow_DebugSettings : public UCogWindow
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UCogEngineWindow_DebugSettings();
|
||||
virtual void RenderHelp()override;
|
||||
|
||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ class COGENGINE_API UCogEngineWindow_LogCategories : public UCogWindow
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
@@ -15,7 +15,9 @@ class COGENGINE_API UCogEngineWindow_Metrics : public UCogWindow
|
||||
public:
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void PostLoad() override;
|
||||
|
||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
||||
|
||||
@@ -9,10 +9,16 @@ class COGENGINE_API UCogEngineWindow_NetEmulation : public UCogWindow
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
protected:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
virtual void DrawStats();
|
||||
|
||||
virtual void DrawControls();
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
@@ -27,8 +27,13 @@ class COGENGINE_API UCogEngineWindow_OutputLog : public UCogWindow
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
UCogEngineWindow_OutputLog();
|
||||
|
||||
protected:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
@@ -4,15 +4,14 @@
|
||||
#include "CogWindow.h"
|
||||
#include "CogEngineWindow_Plots.generated.h"
|
||||
|
||||
class UCogEngineDataAsset_Collisions;
|
||||
|
||||
UCLASS()
|
||||
class COGENGINE_API UCogEngineWindow_Plots : public UCogWindow
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UCogEngineWindow_Plots();
|
||||
protected:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void RenderTick(float DeltaTime) override;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class COGENGINE_API UCogEngineWindow_Scalability : public UCogWindow
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UCogEngineWindow_Scalability();
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
};
|
||||
|
||||
@@ -11,23 +11,6 @@ class COGENGINE_API UCogEngineWindow_Selection : public UCogWindow
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UCogEngineWindow_Selection();
|
||||
|
||||
virtual void RenderTick(float DeltaTime);
|
||||
|
||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
virtual void DrawMainMenuWidget(bool Draw, float& Width) override;
|
||||
|
||||
bool DrawSelectionCombo();
|
||||
|
||||
void DrawActorContextMenu(AActor* Actor);
|
||||
|
||||
void ActivateSelectionMode();
|
||||
|
||||
void HackWaitInputRelease();
|
||||
|
||||
bool GetIsSelecting() const { return bSelectionModeActive; }
|
||||
|
||||
@@ -43,6 +26,26 @@ public:
|
||||
|
||||
void SetTraceType(ETraceTypeQuery Value) { TraceType = Value; }
|
||||
|
||||
protected:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void RenderTick(float DeltaTime) override;
|
||||
|
||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
virtual void DrawMainMenuWidget(bool Draw, float& Width) override;
|
||||
|
||||
bool DrawSelectionCombo();
|
||||
|
||||
void DrawActorContextMenu(AActor* Actor);
|
||||
|
||||
void ActivateSelectionMode();
|
||||
|
||||
void HackWaitInputRelease();
|
||||
|
||||
private:
|
||||
|
||||
void TickSelectionMode();
|
||||
@@ -53,8 +56,6 @@ private:
|
||||
|
||||
void DrawActorFrame(const AActor* Actor);
|
||||
|
||||
//void DrawActorDebug(const AActor* Actor);
|
||||
|
||||
bool ComputeBoundingBoxScreenPosition(const APlayerController* PlayerController, const FVector& Origin, const FVector& Extent, FVector2D& Min, FVector2D& Max);
|
||||
|
||||
FVector LastSelectedActorLocation = FVector::ZeroVector;
|
||||
|
||||
@@ -14,9 +14,9 @@ class COGENGINE_API UCogEngineWindow_Spawns : public UCogWindow
|
||||
|
||||
public:
|
||||
|
||||
const UCogEngineDataAsset_Spawns* GetSpawnsAsset() const { return Asset; }
|
||||
const UCogEngineDataAsset_Spawns* GetSpawnsAsset() const { return SpawnAsset; }
|
||||
|
||||
void SetSpawnsAsset(const UCogEngineDataAsset_Spawns* Value) { Asset = Value; }
|
||||
void SetSpawnsAsset(const UCogEngineDataAsset_Spawns* Value) { SpawnAsset = Value; }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -30,5 +30,5 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
const UCogEngineDataAsset_Spawns* Asset = nullptr;
|
||||
const UCogEngineDataAsset_Spawns* SpawnAsset = nullptr;
|
||||
};
|
||||
|
||||
@@ -11,10 +11,17 @@ class COGENGINE_API UCogEngineWindow_Stats : public UCogWindow
|
||||
|
||||
public:
|
||||
|
||||
virtual void RenderContent() override;
|
||||
virtual void DrawMainMenuWidget(bool Draw, float& Width) override;
|
||||
|
||||
static ImVec4 GetFpsColor(float Value, float Good = 50.0f, float Medium = 30.0f);
|
||||
|
||||
static ImVec4 GetPingColor(float Value, float Good = 100.0f, float Medium = 200.0f);
|
||||
|
||||
static ImVec4 GetPacketLossColor(float Value, float Good = 10.0f, float Medium = 20.0f);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
virtual void DrawMainMenuWidget(bool Draw, float& Width) override;
|
||||
};
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "CogWindow.h"
|
||||
#include "CogEngineWindow_Time.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class COGENGINE_API UCogEngineWindow_Time : public UCogWindow
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UCogEngineWindow_Time();
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
TArray<float> TimingScales;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "CogWindow.h"
|
||||
#include "CogEngineWindow_TimeScale.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class COGENGINE_API UCogEngineWindow_TimeScale : public UCogWindow
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
UCogEngineWindow_TimeScale();
|
||||
|
||||
protected:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
virtual void DrawTimeButton(ACogEngineReplicator* Replicator, float Value);
|
||||
|
||||
TArray<float> TimingScales;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user