mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-07 08:08:48 +00:00
Fix compling errors on various platforms/consoles
- Fixed some include paths case sensitive - Fixed CogImguiInputHelper.h including itself - Added missing includes - Added missing forward declarations - Fixed enums forward declarations - Fixed "TCHAR_TO_ANSI" and const char* formatting issues - Fixed "sscanf" on Linux
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Templates/IsArrayOrRefOfType.h"
|
#include "Templates/IsArrayOrRefOfType.h"
|
||||||
|
#include "CogDebugSettings.h"
|
||||||
|
|
||||||
#ifndef ENABLE_COG
|
#ifndef ENABLE_COG
|
||||||
#define ENABLE_COG !UE_BUILD_SHIPPING
|
#define ENABLE_COG !UE_BUILD_SHIPPING
|
||||||
@@ -9,7 +10,6 @@
|
|||||||
|
|
||||||
#if ENABLE_COG
|
#if ENABLE_COG
|
||||||
|
|
||||||
#include "CogDebugSettings.h"
|
|
||||||
|
|
||||||
#define IF_COG(expr) { expr; }
|
#define IF_COG(expr) { expr; }
|
||||||
#define COG_LOG_CATEGORY FLogCategoryBase
|
#define COG_LOG_CATEGORY FLogCategoryBase
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "UObject/Interface.h"
|
||||||
#include "CogCommonAllegianceActorInterface.generated.h"
|
#include "CogCommonAllegianceActorInterface.generated.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "UObject/Interface.h"
|
||||||
#include "CogCommonDebugFilteredActorInterface.generated.h"
|
#include "CogCommonDebugFilteredActorInterface.generated.h"
|
||||||
|
|
||||||
UINTERFACE(MinimalAPI, Blueprintable)
|
UINTERFACE(MinimalAPI, Blueprintable)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "UObject/Interface.h"
|
||||||
#include "CogCommonPossessorInterface.generated.h"
|
#include "CogCommonPossessorInterface.generated.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -9,8 +9,13 @@
|
|||||||
#include "CogDebugSettings.h"
|
#include "CogDebugSettings.h"
|
||||||
#include "CogDebugShape.h"
|
#include "CogDebugShape.h"
|
||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
|
#include "Engine/Engine.h"
|
||||||
#include "Engine/SkeletalMesh.h"
|
#include "Engine/SkeletalMesh.h"
|
||||||
#include "VisualLogger/VisualLogger.h"
|
#include "VisualLogger/VisualLogger.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
#include "DrawDebugHelpers.h"
|
||||||
|
#include "ReferenceSkeleton.h"
|
||||||
|
#include "Components/SkeletalMeshComponent.h"
|
||||||
|
|
||||||
#if ENABLE_COG
|
#if ENABLE_COG
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "Components/LineBatchComponent.h"
|
#include "Components/LineBatchComponent.h"
|
||||||
#include "Kismet/KismetSystemLibrary.h"
|
#include "Kismet/KismetSystemLibrary.h"
|
||||||
|
#include "Engine/Engine.h"
|
||||||
|
#include "DrawDebugHelpers.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
#include "CogDebugDraw.h"
|
#include "CogDebugDraw.h"
|
||||||
#include "CogDebugHelper.h"
|
#include "CogDebugHelper.h"
|
||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
|
#include "Engine/Engine.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
|
||||||
FCogDebugPlotEvent FCogDebugPlot::DefaultEvent;
|
FCogDebugPlotEvent FCogDebugPlot::DefaultEvent;
|
||||||
TArray<FCogDebugPlotEntry> FCogDebugPlot::Plots;
|
TArray<FCogDebugPlotEntry> FCogDebugPlot::Plots;
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "CogCommonDebugFilteredActorInterface.h"
|
#include "CogCommonDebugFilteredActorInterface.h"
|
||||||
#include "CogDebugReplicator.h"
|
#include "CogDebugReplicator.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
#include "Engine/Engine.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
TWeakObjectPtr<AActor> FCogDebugSettings::Selection;
|
TWeakObjectPtr<AActor> FCogDebugSettings::Selection;
|
||||||
|
|||||||
@@ -2,7 +2,11 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
|
||||||
namespace EDrawDebugTrace { enum Type; }
|
namespace EDrawDebugTrace { enum Type : int; }
|
||||||
|
|
||||||
|
class UWorld;
|
||||||
|
struct FHitResult;
|
||||||
|
class AActor;
|
||||||
|
|
||||||
class COGDEBUG_API FCogDebugDrawHelper
|
class COGDEBUG_API FCogDebugDrawHelper
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
|
#include "imgui_internal.h"
|
||||||
|
|
||||||
class COGDEBUG_API FCogDebugDrawImGui
|
class COGDEBUG_API FCogDebugDrawImGui
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "CogCommon.h"
|
#include "CogCommon.h"
|
||||||
|
#include "UObject/Object.h"
|
||||||
|
#include "UObject/ObjectPtr.h"
|
||||||
|
|
||||||
#ifdef ENABLE_COG
|
#ifdef ENABLE_COG
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "UObject/WeakObjectPtrTemplates.h"
|
||||||
|
|
||||||
|
class UObject;
|
||||||
|
class AActor;
|
||||||
|
class UWorld;
|
||||||
|
|
||||||
struct COGDEBUG_API FCogDebugSettings
|
struct COGDEBUG_API FCogDebugSettings
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
#include "EngineUtils.h"
|
#include "EngineUtils.h"
|
||||||
#include "Net/Core/PushModel/PushModel.h"
|
#include "Net/Core/PushModel/PushModel.h"
|
||||||
#include "Net/UnrealNetwork.h"
|
#include "Net/UnrealNetwork.h"
|
||||||
|
#include "GameFramework/Pawn.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
#include "Engine/EngineTypes.h"
|
||||||
|
|
||||||
DEFINE_LOG_CATEGORY(LogCogEngine);
|
DEFINE_LOG_CATEGORY(LogCogEngine);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "CogDebugDrawHelper.h"
|
#include "CogDebugDrawHelper.h"
|
||||||
#include "CogDebugSettings.h"
|
#include "CogDebugSettings.h"
|
||||||
#include "CogEngineDataAsset.h"
|
#include "CogEngineDataAsset.h"
|
||||||
#include "CogImGuiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
#include "CogWindowHelper.h"
|
#include "CogWindowHelper.h"
|
||||||
#include "Components/BoxComponent.h"
|
#include "Components/BoxComponent.h"
|
||||||
#include "Components/CapsuleComponent.h"
|
#include "Components/CapsuleComponent.h"
|
||||||
@@ -12,6 +12,9 @@
|
|||||||
#include "Components/SphereComponent.h"
|
#include "Components/SphereComponent.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
#include "DrawDebugHelpers.h"
|
||||||
|
#include "GameFramework/Pawn.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "CogWindowWidgets.h"
|
#include "CogWindowWidgets.h"
|
||||||
#include "GameFramework/PlayerInput.h"
|
#include "GameFramework/PlayerInput.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
|
#include "GameFramework/PlayerController.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_CommandBindings::RenderHelp()
|
void FCogEngineWindow_CommandBindings::RenderHelp()
|
||||||
|
|||||||
@@ -160,19 +160,19 @@ void FCogEngineWindow_Inspector::RenderMenu()
|
|||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
// Current Inspected Object
|
// Current Inspected Object
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
const char* InspectedObjectName = TCHAR_TO_ANSI(*GetNameSafe(InspectedObject.Get()));
|
const auto InspectedObjectName = StringCast<ANSICHAR>(*GetNameSafe(InspectedObject.Get()));
|
||||||
ImVec2 Pos = ImGui::GetCursorScreenPos();
|
ImVec2 Pos = ImGui::GetCursorScreenPos();
|
||||||
{
|
{
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 0.5f));
|
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 0.5f));
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
||||||
if (ImGui::Button(InspectedObjectName, ImVec2(FCogWindowWidgets::GetFontWidth() * 20, 0)))
|
if (ImGui::Button(InspectedObjectName.Get(), ImVec2(FCogWindowWidgets::GetFontWidth() * 20, 0)))
|
||||||
{
|
{
|
||||||
ImGui::OpenPopup("SelectionPopup");
|
ImGui::OpenPopup("SelectionPopup");
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered())
|
if (ImGui::IsItemHovered())
|
||||||
{
|
{
|
||||||
ImGui::SetTooltip("Current Inspected Object: %s", InspectedObjectName);
|
ImGui::SetTooltip("Current Inspected Object: %s", InspectedObjectName.Get());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleVar(1);
|
ImGui::PopStyleVar(1);
|
||||||
@@ -180,7 +180,7 @@ void FCogEngineWindow_Inspector::RenderMenu()
|
|||||||
|
|
||||||
if (ImGui::IsItemHovered())
|
if (ImGui::IsItemHovered())
|
||||||
{
|
{
|
||||||
ImGui::SetTooltip("%s", InspectedObjectName);
|
ImGui::SetTooltip("%s", InspectedObjectName.Get());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleColor(1);
|
ImGui::PopStyleColor(1);
|
||||||
@@ -784,8 +784,8 @@ bool FCogEngineWindow_Inspector::RenderString(const FStrProperty* StrProperty, u
|
|||||||
|
|
||||||
static char Buffer[256] = "";
|
static char Buffer[256] = "";
|
||||||
|
|
||||||
const char* Str = TCHAR_TO_ANSI(*Text);
|
const auto Str = StringCast<ANSICHAR>(*Text);
|
||||||
ImStrncpy(Buffer, Str, IM_ARRAYSIZE(Buffer));
|
ImStrncpy(Buffer, Str.Get(), IM_ARRAYSIZE(Buffer));
|
||||||
|
|
||||||
if (ImGui::InputText("##String", Buffer, IM_ARRAYSIZE(Buffer)))
|
if (ImGui::InputText("##String", Buffer, IM_ARRAYSIZE(Buffer)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
#include "CogDebugSettings.h"
|
#include "CogDebugSettings.h"
|
||||||
#include "CogWindowWidgets.h"
|
#include "CogWindowWidgets.h"
|
||||||
#include "CogDebugLog.h"
|
#include "CogDebugLog.h"
|
||||||
|
#include "DrawDebugHelpers.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
#include "Engine/Engine.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_LogCategories::Initialize()
|
void FCogEngineWindow_LogCategories::Initialize()
|
||||||
@@ -117,8 +120,8 @@ void FCogEngineWindow_LogCategories::RenderContent()
|
|||||||
FLogCategoryBase* Category = CategoryInfo.LogCategory;
|
FLogCategoryBase* Category = CategoryInfo.LogCategory;
|
||||||
|
|
||||||
ImGui::PushID(Index);
|
ImGui::PushID(Index);
|
||||||
const char* CategoryFriendlyName = TCHAR_TO_ANSI(*CategoryInfo.GetDisplayName());
|
const auto CategoryFriendlyName = StringCast<ANSICHAR>(*CategoryInfo.GetDisplayName());
|
||||||
const char* CategoryDescription = TCHAR_TO_ANSI(*CategoryInfo.Description);
|
const auto CategoryDescription = StringCast<ANSICHAR>(*CategoryInfo.Description);
|
||||||
|
|
||||||
if (bShowAllVerbosity == false)
|
if (bShowAllVerbosity == false)
|
||||||
{
|
{
|
||||||
@@ -156,7 +159,7 @@ void FCogEngineWindow_LogCategories::RenderContent()
|
|||||||
{
|
{
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::Text("%s", CategoryDescription);
|
ImGui::Text("%s", CategoryDescription.Get());
|
||||||
ImGui::Text("Server");
|
ImGui::Text("Server");
|
||||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, IsControlDown ? 1.0f : 0.5f), "Very Verbose [CTRL]");
|
ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, IsControlDown ? 1.0f : 0.5f), "Very Verbose [CTRL]");
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
@@ -174,7 +177,7 @@ void FCogEngineWindow_LogCategories::RenderContent()
|
|||||||
ImGui::PushStyleColor(ImGuiCol_CheckMark, IM_COL32(255, 128, 0, 200));
|
ImGui::PushStyleColor(ImGuiCol_CheckMark, IM_COL32(255, 128, 0, 200));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Checkbox(CategoryFriendlyName, &IsActive))
|
if (ImGui::Checkbox(CategoryFriendlyName.Get(), &IsActive))
|
||||||
{
|
{
|
||||||
ELogVerbosity::Type NewVerbosity;
|
ELogVerbosity::Type NewVerbosity;
|
||||||
if (IsControlDown && Verbosity != ELogVerbosity::VeryVerbose)
|
if (IsControlDown && Verbosity != ELogVerbosity::VeryVerbose)
|
||||||
@@ -196,7 +199,7 @@ void FCogEngineWindow_LogCategories::RenderContent()
|
|||||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
|
if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
|
||||||
{
|
{
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text("%s", CategoryDescription);
|
ImGui::Text("%s", CategoryDescription.Get());
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
if (IsClient)
|
if (IsClient)
|
||||||
{
|
{
|
||||||
@@ -231,7 +234,7 @@ void FCogEngineWindow_LogCategories::RenderContent()
|
|||||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
|
if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
|
||||||
{
|
{
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text("%s", CategoryDescription);
|
ImGui::Text("%s", CategoryDescription.Get());
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::Text("Server");
|
ImGui::Text("Server");
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
@@ -261,7 +264,7 @@ void FCogEngineWindow_LogCategories::RenderContent()
|
|||||||
if (IsClient && ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
|
if (IsClient && ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
|
||||||
{
|
{
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text("%s", CategoryDescription);
|
ImGui::Text("%s", CategoryDescription.Get());
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::Text("Local Client");
|
ImGui::Text("Local Client");
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
@@ -269,7 +272,7 @@ void FCogEngineWindow_LogCategories::RenderContent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Text("%s", CategoryFriendlyName);
|
ImGui::Text("%s", CategoryFriendlyName.Get());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
#include "CogWindowWidgets.h"
|
#include "CogWindowWidgets.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_Metrics::Initialize()
|
void FCogEngineWindow_Metrics::Initialize()
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include "Engine/NetConnection.h"
|
#include "Engine/NetConnection.h"
|
||||||
#include "Engine/World.h"
|
#include "Engine/World.h"
|
||||||
#include "GameFramework/PlayerState.h"
|
#include "GameFramework/PlayerState.h"
|
||||||
|
#include "GameFramework/Controller.h"
|
||||||
|
#include "GameFramework/PlayerController.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_NetEmulation::RenderHelp()
|
void FCogEngineWindow_NetEmulation::RenderHelp()
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
#include "CogEngineWindow_Plots.h"
|
#include "CogEngineWindow_Plots.h"
|
||||||
|
|
||||||
#include "CogImGuiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
#include "CogDebugPlot.h"
|
#include "CogDebugPlot.h"
|
||||||
#include "CogWindowWidgets.h"
|
#include "CogWindowWidgets.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "implot_internal.h"
|
#include "implot_internal.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_Plots::Initialize()
|
void FCogEngineWindow_Plots::Initialize()
|
||||||
@@ -142,7 +143,7 @@ void FCogEngineWindow_Plots::RenderPlotsList(TArray<FCogDebugPlotEntry*>& Visibl
|
|||||||
{
|
{
|
||||||
const auto EntryName = StringCast<ANSICHAR>(*Entry.Name.ToString());
|
const auto EntryName = StringCast<ANSICHAR>(*Entry.Name.ToString());
|
||||||
ImGui::SetDragDropPayload("DragAndDrop", EntryName.Get(), EntryName.Length() + 1);
|
ImGui::SetDragDropPayload("DragAndDrop", EntryName.Get(), EntryName.Length() + 1);
|
||||||
ImGui::Text(EntryName.Get());
|
ImGui::Text("%s", EntryName.Get());
|
||||||
ImGui::EndDragDropSource();
|
ImGui::EndDragDropSource();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,7 +247,7 @@ void FCogEngineWindow_Plots::RenderPlots(const TArray<FCogDebugPlotEntry*>& Visi
|
|||||||
ImPlot::SetAxis(Entry.CurrentYAxis);
|
ImPlot::SetAxis(Entry.CurrentYAxis);
|
||||||
|
|
||||||
ImPlot::SetNextLineStyle(IMPLOT_AUTO_COL);
|
ImPlot::SetNextLineStyle(IMPLOT_AUTO_COL);
|
||||||
const char* Label = TCHAR_TO_ANSI(*Entry.Name.ToString());
|
const auto Label = StringCast<ANSICHAR>(*Entry.Name.ToString());
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// Pause the scrolling if the user drag inside
|
// Pause the scrolling if the user drag inside
|
||||||
@@ -271,20 +272,20 @@ void FCogEngineWindow_Plots::RenderPlots(const TArray<FCogDebugPlotEntry*>& Visi
|
|||||||
const bool IsEventPlot = Entry.Events.Num() > 0;
|
const bool IsEventPlot = Entry.Events.Num() > 0;
|
||||||
if (IsEventPlot)
|
if (IsEventPlot)
|
||||||
{
|
{
|
||||||
RenderEvents(Entry, Label, PlotMin, PlotMax);
|
RenderEvents(Entry, Label.Get(), PlotMin, PlotMax);
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// Plot Values
|
// Plot Values
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RenderValues(Entry, Label);
|
RenderValues(Entry, Label.Get());
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// Allow legend item labels to be drag and drop sources
|
// Allow legend item labels to be drag and drop sources
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
if (ImPlot::BeginDragDropSourceItem(Label))
|
if (ImPlot::BeginDragDropSourceItem(Label.Get()))
|
||||||
{
|
{
|
||||||
const auto EntryName = StringCast<ANSICHAR>(*Entry.Name.ToString());
|
const auto EntryName = StringCast<ANSICHAR>(*Entry.Name.ToString());
|
||||||
ImGui::SetDragDropPayload("DragAndDrop", EntryName.Get(), EntryName.Length() + 1);
|
ImGui::SetDragDropPayload("DragAndDrop", EntryName.Get(), EntryName.Length() + 1);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
#include "CogWindowWidgets.h"
|
#include "CogWindowWidgets.h"
|
||||||
#include "Engine/Engine.h"
|
#include "Engine/Engine.h"
|
||||||
|
#include "Scalability.h"
|
||||||
|
|
||||||
|
|
||||||
#define SCALABILITY_NUM_LEVELS 5
|
#define SCALABILITY_NUM_LEVELS 5
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "HAL/IConsoleManager.h"
|
#include "HAL/IConsoleManager.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
#include "Components/PrimitiveComponent.h"
|
||||||
|
|
||||||
FString FCogEngineWindow_Selection::ToggleSelectionModeCommand = TEXT("Cog.ToggleSelectionMode");
|
FString FCogEngineWindow_Selection::ToggleSelectionModeCommand = TEXT("Cog.ToggleSelectionMode");
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include "Components/SkeletalMeshComponent.h"
|
#include "Components/SkeletalMeshComponent.h"
|
||||||
#include "Engine/SkeletalMesh.h"
|
#include "Engine/SkeletalMesh.h"
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
|
#include "DrawDebugHelpers.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_Skeleton::Initialize()
|
void FCogEngineWindow_Skeleton::Initialize()
|
||||||
@@ -138,8 +140,8 @@ void FCogEngineWindow_Skeleton::RenderBoneEntry(int32 BoneIndex, bool OpenAllChi
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* BoneName = TCHAR_TO_ANSI(*BoneInfo.Name.ToString());
|
const auto BoneName = StringCast<ANSICHAR>(*BoneInfo.Name.ToString());
|
||||||
const bool ShowNode = Filter.PassFilter(BoneName);
|
const bool ShowNode = Filter.PassFilter(BoneName.Get());
|
||||||
bool OpenChildren = false;
|
bool OpenChildren = false;
|
||||||
|
|
||||||
if (ShowNode)
|
if (ShowNode)
|
||||||
@@ -235,7 +237,7 @@ void FCogEngineWindow_Skeleton::RenderBoneEntry(int32 BoneIndex, bool OpenAllChi
|
|||||||
//------------------------
|
//------------------------
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImVec4 NameColor = HasCustomVisiblity ? ImVec4(1.0f, 1.0f, 0.0f, 1.0f) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
ImVec4 NameColor = HasCustomVisiblity ? ImVec4(1.0f, 1.0f, 0.0f, 1.0f) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
ImGui::TextColored(NameColor, "%s", BoneName);
|
ImGui::TextColored(NameColor, "%s", BoneName.Get());
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------
|
//------------------------
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include "Engine/NetConnection.h"
|
#include "Engine/NetConnection.h"
|
||||||
#include "GameFramework/PlayerState.h"
|
#include "GameFramework/PlayerState.h"
|
||||||
#include "Net/NetPing.h"
|
#include "Net/NetPing.h"
|
||||||
|
#include "GameFramework/Controller.h"
|
||||||
|
#include "GameFramework/PlayerController.h"
|
||||||
|
|
||||||
ImVec4 StatRedColor(1.0f, 0.4f, 0.3f, 1.0f);
|
ImVec4 StatRedColor(1.0f, 0.4f, 0.3f, 1.0f);
|
||||||
ImVec4 StatOrangeColor(1.0f, 0.7f, 0.4f, 1.0f);
|
ImVec4 StatOrangeColor(1.0f, 0.7f, 0.4f, 1.0f);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/DataAsset.h"
|
#include "Engine/DataAsset.h"
|
||||||
|
#include "Engine/EngineTypes.h"
|
||||||
#include "CogEngineDataAsset.generated.h"
|
#include "CogEngineDataAsset.generated.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "CogWindow.h"
|
#include "CogWindow.h"
|
||||||
#include "CogWindowConfig.h"
|
#include "CogWindowConfig.h"
|
||||||
|
#include "Engine/EngineTypes.h"
|
||||||
#include "CogEngineWindow_Collisions.generated.h"
|
#include "CogEngineWindow_Collisions.generated.h"
|
||||||
|
|
||||||
class UCogEngineConfig_Collisions;
|
class UCogEngineConfig_Collisions;
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public:
|
|||||||
|
|
||||||
bReapplySelection = true;
|
bReapplySelection = true;
|
||||||
bDisplayActorLabel = true;
|
bDisplayActorLabel = true;
|
||||||
SelectionName;
|
SelectionName.Reset();
|
||||||
SelectedClassIndex = 0;
|
SelectedClassIndex = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "CogImguiInputProcessor.h"
|
#include "CogImGuiInputProcessor.h"
|
||||||
|
|
||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
#include "CogImguiInputHelper.h"
|
#include "CogImguiInputHelper.h"
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "CogImguiContext.h"
|
#include "CogImguiContext.h"
|
||||||
#include "GameFramework/PlayerInput.h"
|
#include "GameFramework/PlayerInput.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
|
#include "Framework/Application/SlateApplication.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
FCogImGuiInputProcessor::FCogImGuiInputProcessor(UPlayerInput* InPlayerInput, FCogImguiContext* InContext, SCogImguiWidget* InMainWidget)
|
FCogImGuiInputProcessor::FCogImGuiInputProcessor(UPlayerInput* InPlayerInput, FCogImguiContext* InContext, SCogImguiWidget* InMainWidget)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "CogImGuiConfig.h"
|
#include "CogImguiConfig.h"
|
||||||
|
|
||||||
THIRD_PARTY_INCLUDES_START
|
THIRD_PARTY_INCLUDES_START
|
||||||
#include <imgui.cpp>
|
#include <imgui.cpp>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include "CogImGuiContext.h"
|
#include "CogImguiContext.h"
|
||||||
|
|
||||||
#include "Application/ThrottleManager.h"
|
#include "Application/ThrottleManager.h"
|
||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
#include "CogImguiInputHelper.h"
|
#include "CogImguiInputHelper.h"
|
||||||
#include "CogImguiInputProcessor.h"
|
#include "CogImGuiInputProcessor.h"
|
||||||
#include "CogImguiWidget.h"
|
#include "CogImguiWidget.h"
|
||||||
#include "Engine/Console.h"
|
#include "Engine/Console.h"
|
||||||
#include "Engine/LocalPlayer.h"
|
#include "Engine/LocalPlayer.h"
|
||||||
@@ -17,6 +17,9 @@
|
|||||||
#include "TextureResource.h"
|
#include "TextureResource.h"
|
||||||
#include "Widgets/SViewport.h"
|
#include "Widgets/SViewport.h"
|
||||||
#include "Widgets/SWindow.h"
|
#include "Widgets/SWindow.h"
|
||||||
|
#include "Engine/Engine.h"
|
||||||
|
#include "Engine/GameViewportClient.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
|
||||||
static UPlayerInput* GetPlayerInput(const UWorld* World);
|
static UPlayerInput* GetPlayerInput(const UWorld* World);
|
||||||
|
|
||||||
@@ -79,8 +82,8 @@ void FCogImguiContext::Initialize()
|
|||||||
ViewportData->Context = this;
|
ViewportData->Context = this;
|
||||||
ViewportData->Widget = MainWidget;
|
ViewportData->Widget = MainWidget;
|
||||||
|
|
||||||
const char* InitFilenameTemp = TCHAR_TO_ANSI(*FCogImguiHelper::GetIniFilePath("imgui"));
|
const auto InitFilenameTemp = StringCast<ANSICHAR>(*FCogImguiHelper::GetIniFilePath("imgui"));
|
||||||
ImStrncpy(IniFilename, InitFilenameTemp, IM_ARRAYSIZE(IniFilename));
|
ImStrncpy(IniFilename, InitFilenameTemp.Get(), IM_ARRAYSIZE(IniFilename));
|
||||||
IO.IniFilename = IniFilename;
|
IO.IniFilename = IniFilename;
|
||||||
|
|
||||||
ImGuiPlatformIO& PlatformIO = ImGui::GetPlatformIO();
|
ImGuiPlatformIO& PlatformIO = ImGui::GetPlatformIO();
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "InputCoreTypes.h"
|
#include "InputCoreTypes.h"
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
|
#include "Misc/Paths.h"
|
||||||
|
#include "GenericPlatform/GenericPlatformFile.h"
|
||||||
|
|
||||||
DEFINE_LOG_CATEGORY(LogCogImGui);
|
DEFINE_LOG_CATEGORY(LogCogImGui);
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,11 @@
|
|||||||
#if WITH_EDITOR
|
#if WITH_EDITOR
|
||||||
#include "Kismet2/DebuggerCommands.h"
|
#include "Kismet2/DebuggerCommands.h"
|
||||||
#endif //WITH_EDITOR
|
#endif //WITH_EDITOR
|
||||||
|
#include "Engine/World.h"
|
||||||
|
#include "Input/Events.h"
|
||||||
|
#include "CogImguiKeyInfo.h"
|
||||||
|
#include "Framework/Application/SlateApplication.h"
|
||||||
|
#include "GenericPlatform/GenericApplication.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
APlayerController* FCogImguiInputHelper::GetFirstLocalPlayerController(const UWorld& World)
|
APlayerController* FCogImguiInputHelper::GetFirstLocalPlayerController(const UWorld& World)
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
#include "CogImguiInputHelper.h"
|
#include "CogImguiInputHelper.h"
|
||||||
#include "CogImguiModule.h"
|
#include "CogImguiModule.h"
|
||||||
#include "CogImguiWidget.h"
|
#include "CogImguiWidget.h"
|
||||||
#include "CogImGuiContext.h"
|
#include "CogImguiContext.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "SlateOptMacros.h"
|
#include "SlateOptMacros.h"
|
||||||
|
#include "Engine/GameViewportClient.h"
|
||||||
|
#include "Widgets/SWindow.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
|
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Framework/Application/IInputProcessor.h"
|
#include "Framework/Application/IInputProcessor.h"
|
||||||
|
#include "CogImguiContext.h"
|
||||||
|
|
||||||
class FCogImguiContext;
|
class FCogImguiContext;
|
||||||
class SCogImguiWidget;
|
class SCogImguiWidget;
|
||||||
@@ -42,7 +43,7 @@ protected:
|
|||||||
|
|
||||||
TObjectPtr<FCogImguiContext> Context = nullptr;
|
TObjectPtr<FCogImguiContext> Context = nullptr;
|
||||||
|
|
||||||
TObjectPtr<UPlayerInput> PlayerInput = nullptr;
|
TObjectPtr<UPlayerInput> PlayerInput;
|
||||||
|
|
||||||
TObjectPtr<SCogImguiWidget> MainWidget = nullptr;
|
TObjectPtr<SCogImguiWidget> MainWidget;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Misc/AssertionMacros.h"
|
#include "Misc/AssertionMacros.h"
|
||||||
|
#include "Engine/Texture2D.h"
|
||||||
|
|
||||||
#define IM_ASSERT(Expr) ensure(Expr)
|
#define IM_ASSERT(Expr) ensure(Expr)
|
||||||
|
|
||||||
@@ -10,4 +11,4 @@
|
|||||||
#define IMGUI_DISABLE_DEFAULT_ALLOCATORS
|
#define IMGUI_DISABLE_DEFAULT_ALLOCATORS
|
||||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||||
|
|
||||||
#define ImTextureID class UTexture2D*
|
#define ImTextureID UTexture2D*
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ class SWindow;
|
|||||||
class UGameViewportClient;
|
class UGameViewportClient;
|
||||||
struct FDisplayMetrics;
|
struct FDisplayMetrics;
|
||||||
struct ImPlotContext;
|
struct ImPlotContext;
|
||||||
|
class SWidget;
|
||||||
|
class ULocalPlayer;
|
||||||
|
|
||||||
struct COGIMGUI_API FImGuiViewportData
|
struct COGIMGUI_API FImGuiViewportData
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "Layout/SlateRect.h"
|
#include "Layout/SlateRect.h"
|
||||||
|
#include "Rendering/SlateRenderTransform.h"
|
||||||
|
|
||||||
COGIMGUI_API DECLARE_LOG_CATEGORY_EXTERN(LogCogImGui, Warning, All);
|
COGIMGUI_API DECLARE_LOG_CATEGORY_EXTERN(LogCogImGui, Warning, All);
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "CogImguiInputHelper.h"
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
|
#include "GenericPlatform/ICursor.h"
|
||||||
|
|
||||||
class UPlayerInput;
|
class UPlayerInput;
|
||||||
struct FCogImGuiKeyInfo;
|
struct FCogImGuiKeyInfo;
|
||||||
struct FKeyBind;
|
struct FKeyBind;
|
||||||
|
class UWorld;
|
||||||
|
struct FCogImGuiKeyInfo;
|
||||||
|
struct FKeyEvent;
|
||||||
|
class APlayerController;
|
||||||
|
struct FKey;
|
||||||
|
enum class ECheckBoxState : uint8;
|
||||||
|
|
||||||
class COGIMGUI_API FCogImguiInputHelper
|
class COGIMGUI_API FCogImguiInputHelper
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "InputCoreTypes.h"
|
#include "InputCoreTypes.h"
|
||||||
#include "CogImGuiKeyInfo.generated.h"
|
#include "Styling/SlateTypes.h"
|
||||||
|
|
||||||
|
#include "CogImguiKeyInfo.generated.h"
|
||||||
|
|
||||||
USTRUCT()
|
USTRUCT()
|
||||||
struct COGIMGUI_API FCogImGuiKeyInfo
|
struct COGIMGUI_API FCogImGuiKeyInfo
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
#include "CogWindowWidgets.h"
|
#include "CogWindowWidgets.h"
|
||||||
#include "Engine/World.h"
|
#include "Engine/World.h"
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
|
#include "GameFramework/Pawn.h"
|
||||||
|
#include "GameFramework/PlayerController.h"
|
||||||
|
#include "Engine/LocalPlayer.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogWindow::SetFullName(const FString& InFullName)
|
void FCogWindow::SetFullName(const FString& InFullName)
|
||||||
|
|||||||
@@ -572,7 +572,11 @@ void UCogWindowManager::SettingsHandler_ReadLine(ImGuiContext* Context, ImGuiSet
|
|||||||
if (Entry == (void*)1)
|
if (Entry == (void*)1)
|
||||||
{
|
{
|
||||||
ImGuiID Id;
|
ImGuiID Id;
|
||||||
|
#if PLATFORM_WINDOWS || PLATFORM_MICROSOFT
|
||||||
if (sscanf_s(Line, "0x%08X", &Id) == 1)
|
if (sscanf_s(Line, "0x%08X", &Id) == 1)
|
||||||
|
#else
|
||||||
|
if (sscanf(Line, "0x%08X", &Id) == 1)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
UCogWindowManager* Manager = (UCogWindowManager*)Handler->UserData;
|
UCogWindowManager* Manager = (UCogWindowManager*)Handler->UserData;
|
||||||
if (FCogWindow* Window = Manager->FindWindowByID(Id))
|
if (FCogWindow* Window = Manager->FindWindowByID(Id))
|
||||||
@@ -585,7 +589,11 @@ void UCogWindowManager::SettingsHandler_ReadLine(ImGuiContext* Context, ImGuiSet
|
|||||||
{
|
{
|
||||||
ImGuiID Id;
|
ImGuiID Id;
|
||||||
int32 Visible = false;
|
int32 Visible = false;
|
||||||
|
#if PLATFORM_WINDOWS || PLATFORM_MICROSOFT
|
||||||
if (sscanf_s(Line, "0x%08X %d", &Id, &Visible) == 2)
|
if (sscanf_s(Line, "0x%08X %d", &Id, &Visible) == 2)
|
||||||
|
#else
|
||||||
|
if (sscanf(Line, "0x%08X %d", &Id, &Visible) == 2)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
UCogWindowManager* Manager = (UCogWindowManager*)Handler->UserData;
|
UCogWindowManager* Manager = (UCogWindowManager*)Handler->UserData;
|
||||||
if (FCogWindow* Window = Manager->FindWindowByID(Id))
|
if (FCogWindow* Window = Manager->FindWindowByID(Id))
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
#include "CogWindowWidgets.h"
|
#include "CogWindowWidgets.h"
|
||||||
|
|
||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
#include "CogImGuiKeyInfo.h"
|
#include "CogImguiKeyInfo.h"
|
||||||
#include "CogImguiInputHelper.h"
|
#include "CogImguiInputHelper.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
#include "InputCoreTypes.h"
|
#include "InputCoreTypes.h"
|
||||||
#include "Kismet/KismetMathLibrary.h"
|
#include "Kismet/KismetMathLibrary.h"
|
||||||
|
#include "GameFramework/PlayerInput.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogWindowWidgets::BeginTableTooltip()
|
void FCogWindowWidgets::BeginTableTooltip()
|
||||||
@@ -341,7 +342,7 @@ bool FCogWindowWidgets::ComboboxEnum(const char* Label, UEnum* Enum, int64 Curre
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
bool FCogWindowWidgets::CheckBoxState(const char* Label, ECheckBoxState& State)
|
bool FCogWindowWidgets::CheckBoxState(const char* Label, ECheckBoxState& State)
|
||||||
{
|
{
|
||||||
const char* TooltipText = nullptr;
|
const char* TooltipText = "Invalid";
|
||||||
|
|
||||||
int32 Flags = 0;
|
int32 Flags = 0;
|
||||||
ImVec4 ButtonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button);
|
ImVec4 ButtonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button);
|
||||||
@@ -385,7 +386,7 @@ bool FCogWindowWidgets::CheckBoxState(const char* Label, ECheckBoxState& State)
|
|||||||
|
|
||||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
|
if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
|
||||||
{
|
{
|
||||||
ImGui::SetTooltip(TooltipText);
|
ImGui::SetTooltip("%s", TooltipText);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsPressed)
|
if (IsPressed)
|
||||||
@@ -468,8 +469,8 @@ bool FCogWindowWidgets::KeyBind(FKeyBind& KeyBind)
|
|||||||
{
|
{
|
||||||
static char Buffer[256] = "";
|
static char Buffer[256] = "";
|
||||||
|
|
||||||
const char* Str = TCHAR_TO_ANSI(*KeyBind.Command);
|
const auto Str = StringCast<ANSICHAR>(*KeyBind.Command);
|
||||||
ImStrncpy(Buffer, Str, IM_ARRAYSIZE(Buffer));
|
ImStrncpy(Buffer, Str.Get(), IM_ARRAYSIZE(Buffer));
|
||||||
|
|
||||||
bool HasChanged = false;
|
bool HasChanged = false;
|
||||||
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
|
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
|
||||||
@@ -499,7 +500,7 @@ bool FCogWindowWidgets::ButtonWithTooltip(const char* Text, const char* Tooltip)
|
|||||||
|
|
||||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
|
if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary))
|
||||||
{
|
{
|
||||||
ImGui::SetTooltip(Tooltip);
|
ImGui::SetTooltip("%s", Tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
return IsPressed;
|
return IsPressed;
|
||||||
@@ -560,8 +561,8 @@ bool FCogWindowWidgets::MultiChoiceButtonsInt(TArray<int32>& Values, int32& Valu
|
|||||||
{
|
{
|
||||||
int32 ButtonValue = Values[i];
|
int32 ButtonValue = Values[i];
|
||||||
|
|
||||||
const char* Text = TCHAR_TO_ANSI(*FString::Printf(TEXT("%d"), ButtonValue));
|
const auto Text = StringCast<ANSICHAR>(*FString::Printf(TEXT("%d"), ButtonValue));
|
||||||
if (MultiChoiceButton(Text, ButtonValue == Value, Size))
|
if (MultiChoiceButton(Text.Get(), ButtonValue == Value, Size))
|
||||||
{
|
{
|
||||||
IsPressed = true;
|
IsPressed = true;
|
||||||
Value = ButtonValue;
|
Value = ButtonValue;
|
||||||
@@ -593,8 +594,8 @@ bool FCogWindowWidgets::MultiChoiceButtonsFloat(TArray<float>& Values, float& Va
|
|||||||
{
|
{
|
||||||
float ButtonValue = Values[i];
|
float ButtonValue = Values[i];
|
||||||
|
|
||||||
const char* Text = TCHAR_TO_ANSI(*FString::Printf(TEXT("%g"), ButtonValue).Replace(TEXT("0."), TEXT(".")));
|
const auto Text = StringCast<ANSICHAR>(*FString::Printf(TEXT("%g"), ButtonValue).Replace(TEXT("0."), TEXT(".")));
|
||||||
if (MultiChoiceButton(Text, ButtonValue == Value, Size))
|
if (MultiChoiceButton(Text.Get(), ButtonValue == Value, Size))
|
||||||
{
|
{
|
||||||
IsPressed = true;
|
IsPressed = true;
|
||||||
Value = ButtonValue;
|
Value = ButtonValue;
|
||||||
|
|||||||
@@ -75,14 +75,14 @@ void FCogWindow_Settings::RenderContent()
|
|||||||
Context.SetEnableInput(bEnableInput);
|
Context.SetEnableInput(bEnableInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* ShortcutText = TCHAR_TO_ANSI(*FCogImguiInputHelper::CommandToString(PlayerInput, UCogWindowManager::ToggleInputCommand));
|
const auto ShortcutText = StringCast<ANSICHAR>(*FCogImguiInputHelper::CommandToString(PlayerInput, UCogWindowManager::ToggleInputCommand));
|
||||||
const float ShortcutWidth = (ShortcutText && ShortcutText[0]) ? ImGui::CalcTextSize(ShortcutText, NULL).x : 0.0f;
|
const float ShortcutWidth = (ShortcutText.Get() != nullptr && ShortcutText.Get()[0]) ? ImGui::CalcTextSize(ShortcutText.Get(), NULL).x : 0.0f;
|
||||||
if (ShortcutWidth > 0.0f)
|
if (ShortcutWidth > 0.0f)
|
||||||
{
|
{
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetCursorPosX(ImGui::GetWindowContentRegionMax().x - ShortcutWidth);
|
ImGui::SetCursorPosX(ImGui::GetWindowContentRegionMax().x - ShortcutWidth);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]);
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]);
|
||||||
ImGui::Text(ShortcutText);
|
ImGui::Text("%s", ShortcutText.Get());
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,17 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
|
#include "Templates/SubclassOf.h"
|
||||||
|
#include "UObject/ReflectedTypeAccessors.h"
|
||||||
|
#include "UObject/WeakObjectPtrTemplates.h"
|
||||||
|
|
||||||
class APawn;
|
class APawn;
|
||||||
class APlayerController;
|
class APlayerController;
|
||||||
class UCogWindowConfig;
|
class UCogWindowConfig;
|
||||||
class UCogWindowManager;
|
class UCogWindowManager;
|
||||||
class UWorld;
|
class UWorld;
|
||||||
|
class AActor;
|
||||||
|
class ULocalPlayer;
|
||||||
|
|
||||||
class COGWINDOW_API FCogWindow
|
class COGWINDOW_API FCogWindow
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "AssetRegistry/AssetRegistryModule.h"
|
#include "AssetRegistry/AssetRegistryModule.h"
|
||||||
#include "AssetRegistry/IAssetRegistry.h"
|
#include "AssetRegistry/IAssetRegistry.h"
|
||||||
|
#include "AssetRegistry/AssetData.h"
|
||||||
|
#include "Templates/SubclassOf.h"
|
||||||
|
|
||||||
|
|
||||||
class COGWINDOW_API FCogWindowHelper
|
class COGWINDOW_API FCogWindowHelper
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class UPlayerInput;
|
|||||||
class UWorld;
|
class UWorld;
|
||||||
struct ImGuiSettingsHandler;
|
struct ImGuiSettingsHandler;
|
||||||
struct ImGuiTextBuffer;
|
struct ImGuiTextBuffer;
|
||||||
|
struct FKey;
|
||||||
|
|
||||||
UCLASS(Config = Cog)
|
UCLASS(Config = Cog)
|
||||||
class COGWINDOW_API UCogWindowManager : public UObject
|
class COGWINDOW_API UCogWindowManager : public UObject
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ class UEnum;
|
|||||||
class FEnumProperty;
|
class FEnumProperty;
|
||||||
struct FCogImGuiKeyInfo;
|
struct FCogImGuiKeyInfo;
|
||||||
struct FKeyBind;
|
struct FKeyBind;
|
||||||
|
class UObject;
|
||||||
|
struct FKeyBind;
|
||||||
|
enum class ECheckBoxState : uint8;
|
||||||
|
|
||||||
class COGWINDOW_API FCogWindowWidgets
|
class COGWINDOW_API FCogWindowWidgets
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "CogWindow.h"
|
#include "CogWindow.h"
|
||||||
|
|
||||||
|
class UPlayerInput;
|
||||||
|
|
||||||
class COGWINDOW_API FCogWindow_Layouts : public FCogWindow
|
class COGWINDOW_API FCogWindow_Layouts : public FCogWindow
|
||||||
{
|
{
|
||||||
typedef FCogWindow Super;
|
typedef FCogWindow Super;
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ void FCogAIWindow_BehaviorTree::RenderContent()
|
|||||||
|
|
||||||
if (RootNodeInstanced != nullptr)
|
if (RootNodeInstanced != nullptr)
|
||||||
{
|
{
|
||||||
if (ImGui::CollapsingHeader(TCHAR_TO_ANSI(*GetNameSafe(CurrentTree)), nullptr, ImGuiTreeNodeFlags_DefaultOpen))
|
if (ImGui::CollapsingHeader(StringCast<ANSICHAR>(*GetNameSafe(CurrentTree)).Get(), nullptr, ImGuiTreeNodeFlags_DefaultOpen))
|
||||||
{
|
{
|
||||||
RenderNode(*BehaviorTreeComponent, const_cast<UBTNode*>(RootNodeInstanced), false);
|
RenderNode(*BehaviorTreeComponent, const_cast<UBTNode*>(RootNodeInstanced), false);
|
||||||
}
|
}
|
||||||
@@ -217,8 +217,8 @@ void FCogAIWindow_BehaviorTree::RenderContent()
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogAIWindow_BehaviorTree::RenderNode(UBehaviorTreeComponent& BehaviorTreeComponent, UBTNode* Node, bool OpenAllChildren)
|
void FCogAIWindow_BehaviorTree::RenderNode(UBehaviorTreeComponent& BehaviorTreeComponent, UBTNode* Node, bool OpenAllChildren)
|
||||||
{
|
{
|
||||||
const char* NodeName = TCHAR_TO_ANSI(*Node->GetNodeName());
|
const auto NodeName = StringCast<ANSICHAR>(*Node->GetNodeName());
|
||||||
const bool ShowNode = Filter.PassFilter(NodeName);
|
const bool ShowNode = Filter.PassFilter(NodeName.Get());
|
||||||
|
|
||||||
const UBTCompositeNode* CompositeNode = Cast<UBTCompositeNode>(Node);
|
const UBTCompositeNode* CompositeNode = Cast<UBTCompositeNode>(Node);
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ void FCogAIWindow_BehaviorTree::RenderNode(UBehaviorTreeComponent& BehaviorTreeC
|
|||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::TextColored(TextColor, "Name");
|
ImGui::TextColored(TextColor, "Name");
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text("%s", NodeName);
|
ImGui::Text("%s", NodeName.Get());
|
||||||
|
|
||||||
//------------------------
|
//------------------------
|
||||||
// Static Description
|
// Static Description
|
||||||
@@ -313,7 +313,7 @@ void FCogAIWindow_BehaviorTree::RenderNode(UBehaviorTreeComponent& BehaviorTreeC
|
|||||||
if (RuntimeValue.Split(TEXT(": "), &Left, &Right))
|
if (RuntimeValue.Split(TEXT(": "), &Left, &Right))
|
||||||
{
|
{
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::TextColored(TextColor, TCHAR_TO_ANSI(*Left));
|
ImGui::TextColored(TextColor, "%s", TCHAR_TO_ANSI(*Left));
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text("%s", TCHAR_TO_ANSI(*Right));
|
ImGui::Text("%s", TCHAR_TO_ANSI(*Right));
|
||||||
@@ -323,7 +323,7 @@ void FCogAIWindow_BehaviorTree::RenderNode(UBehaviorTreeComponent& BehaviorTreeC
|
|||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::TextColored(TextColor, "Value");
|
ImGui::TextColored(TextColor, "Value");
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text(TCHAR_TO_ANSI(*RuntimeValue));
|
ImGui::Text("%s", TCHAR_TO_ANSI(*RuntimeValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ void FCogAIWindow_BehaviorTree::RenderNode(UBehaviorTreeComponent& BehaviorTreeC
|
|||||||
//------------------------
|
//------------------------
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
const ImVec4 NameColor = IsActive ? FCogImguiHelper::ToImVec4(Config->ActiveColor) : FCogImguiHelper::ToImVec4(Config->InactiveColor);
|
const ImVec4 NameColor = IsActive ? FCogImguiHelper::ToImVec4(Config->ActiveColor) : FCogImguiHelper::ToImVec4(Config->InactiveColor);
|
||||||
ImGui::TextColored(NameColor, "%s", NodeName);
|
ImGui::TextColored(NameColor, "%s", NodeName.Get());
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------
|
//------------------------
|
||||||
|
|||||||
@@ -141,8 +141,8 @@ void FCogAIWindow_Blackboard::RenderContent()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* KeyName = TCHAR_TO_ANSI(*Key->EntryName.ToString());
|
const auto KeyName = StringCast<ANSICHAR>(*Key->EntryName.ToString());
|
||||||
if (Filter.PassFilter(KeyName) == false)
|
if (Filter.PassFilter(KeyName.Get()) == false)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ void FCogAIWindow_Blackboard::RenderContent()
|
|||||||
// Name
|
// Name
|
||||||
//------------------------
|
//------------------------
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text("%s", KeyName);
|
ImGui::Text("%s", KeyName.Get());
|
||||||
|
|
||||||
//------------------------
|
//------------------------
|
||||||
// Value
|
// Value
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "Engine/DataAsset.h"
|
||||||
#include "CogAIDataAsset.generated.h"
|
#include "CogAIDataAsset.generated.h"
|
||||||
|
|
||||||
UCLASS(Blueprintable)
|
UCLASS(Blueprintable)
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#include "GameplayEffect.h"
|
#include "GameplayEffect.h"
|
||||||
#include "Net/Core/PushModel/PushModel.h"
|
#include "Net/Core/PushModel/PushModel.h"
|
||||||
#include "Net/UnrealNetwork.h"
|
#include "Net/UnrealNetwork.h"
|
||||||
|
#include "GameFramework/PlayerController.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
ACogAbilityReplicator* ACogAbilityReplicator::Spawn(APlayerController* Controller)
|
ACogAbilityReplicator* ACogAbilityReplicator::Spawn(APlayerController* Controller)
|
||||||
|
|||||||
@@ -212,11 +212,11 @@ void FCogAbilityWindow_Abilities::RenderAbilitiesTable(UAbilitySystemComponent&
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AbilityName = TCHAR_TO_ANSI(*GetAbilityName(Ability));
|
const auto AbilityName = StringCast<ANSICHAR>(*GetAbilityName(Ability));
|
||||||
if (Filter.PassFilter(AbilityName) == false)
|
if (Filter.PassFilter(AbilityName.Get()) == false)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
FitleredAbilities.Add(Spec);
|
FitleredAbilities.Add(Spec);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,9 +207,9 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AttributeName = TCHAR_TO_ANSI(*Attribute.GetName());
|
const auto AttributeName = StringCast<ANSICHAR>(*Attribute.GetName());
|
||||||
|
|
||||||
if (Filter.PassFilter(AttributeName) == false)
|
if (Filter.PassFilter(AttributeName.Get()) == false)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -233,7 +233,7 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
|||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text("");
|
ImGui::Text("");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Selectable(AttributeName, Selected == Index, ImGuiSelectableFlags_SpanAllColumns))
|
if (ImGui::Selectable(AttributeName.Get(), Selected == Index, ImGuiSelectableFlags_SpanAllColumns))
|
||||||
{
|
{
|
||||||
Selected = Index;
|
Selected = Index;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,8 +187,8 @@ void FCogAbilityWindow_Effects::RenderEffectRow(const UAbilitySystemComponent& A
|
|||||||
const FActiveGameplayEffect& ActiveEffect = *ActiveEffectPtr;
|
const FActiveGameplayEffect& ActiveEffect = *ActiveEffectPtr;
|
||||||
const UGameplayEffect& Effect = *EffectPtr;
|
const UGameplayEffect& Effect = *EffectPtr;
|
||||||
|
|
||||||
const char* EffectName = TCHAR_TO_ANSI(*GetEffectName(Effect));
|
const auto EffectName = StringCast<ANSICHAR>(*GetEffectName(Effect));
|
||||||
if (Filter.PassFilter(EffectName) == false)
|
if (Filter.PassFilter(EffectName.Get()) == false)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -203,7 +203,7 @@ void FCogAbilityWindow_Effects::RenderEffectRow(const UAbilitySystemComponent& A
|
|||||||
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, FCogImguiHelper::ToImVec4(AlignmentConfig->GetEffectColor(Asset, Effect)));
|
ImGui::PushStyleColor(ImGuiCol_Text, FCogImguiHelper::ToImVec4(AlignmentConfig->GetEffectColor(Asset, Effect)));
|
||||||
|
|
||||||
if (ImGui::Selectable(EffectName, Selected == Index, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap | ImGuiSelectableFlags_AllowDoubleClick))
|
if (ImGui::Selectable(EffectName.Get(), Selected == Index, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap | ImGuiSelectableFlags_AllowDoubleClick))
|
||||||
{
|
{
|
||||||
Selected = Index;
|
Selected = Index;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
class UAbilitySystemComponent;
|
class UAbilitySystemComponent;
|
||||||
class UCogAbilityDataAsset;
|
class UCogAbilityDataAsset;
|
||||||
class UGameplayEffect;
|
class UGameplayEffect;
|
||||||
namespace EGameplayModOp { enum Type; };
|
namespace EGameplayModOp { enum Type : int; };
|
||||||
struct FGameplayAttribute;
|
struct FGameplayAttribute;
|
||||||
struct FGameplayModifierInfo;
|
struct FGameplayModifierInfo;
|
||||||
struct FModifierSpec;
|
struct FModifierSpec;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
class UCogAbilityDataAsset;
|
class UCogAbilityDataAsset;
|
||||||
class UGameplayEffect;
|
class UGameplayEffect;
|
||||||
namespace EGameplayModOp { enum Type; }
|
namespace EGameplayModOp { enum Type : int; }
|
||||||
struct FGameplayTagContainer;
|
struct FGameplayTagContainer;
|
||||||
|
|
||||||
class COGABILITY_API FCogAbilityHelper
|
class COGABILITY_API FCogAbilityHelper
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class UCogAbilityConfig_Alignment;
|
|||||||
class UCogAbilityConfig_Effects;
|
class UCogAbilityConfig_Effects;
|
||||||
class UCogAbilityDataAsset;
|
class UCogAbilityDataAsset;
|
||||||
class UGameplayEffect;
|
class UGameplayEffect;
|
||||||
namespace EGameplayModOp { enum Type; };
|
namespace EGameplayModOp { enum Type : int; };
|
||||||
struct FActiveGameplayEffect;
|
struct FActiveGameplayEffect;
|
||||||
struct FGameplayModifierInfo;
|
struct FGameplayModifierInfo;
|
||||||
struct FModifierSpec;
|
struct FModifierSpec;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "GameFramework/Pawn.h"
|
#include "GameFramework/Pawn.h"
|
||||||
#include "InputAction.h"
|
#include "InputAction.h"
|
||||||
#include "InputMappingContext.h"
|
#include "InputMappingContext.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogInputWindow_Actions::Initialize()
|
void FCogInputWindow_Actions::Initialize()
|
||||||
@@ -116,7 +117,7 @@ void FCogInputWindow_Actions::RenderContent()
|
|||||||
{
|
{
|
||||||
ImGui::PushID(Index);
|
ImGui::PushID(Index);
|
||||||
|
|
||||||
const char* ActionName = TCHAR_TO_ANSI(*ActionInfo.Action->GetName());
|
const auto ActionName = StringCast<ANSICHAR>(*ActionInfo.Action->GetName());
|
||||||
|
|
||||||
FInputActionValue ActionValue = EnhancedInputSubsystem->GetPlayerInput()->GetActionValue(ActionInfo.Action);
|
FInputActionValue ActionValue = EnhancedInputSubsystem->GetPlayerInput()->GetActionValue(ActionInfo.Action);
|
||||||
|
|
||||||
@@ -126,7 +127,7 @@ void FCogInputWindow_Actions::RenderContent()
|
|||||||
{
|
{
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text("%s", ActionName);
|
ImGui::Text("%s", ActionName.Get());
|
||||||
|
|
||||||
const ImVec4 ActiveColor(1, 0.8f, 0, 1);
|
const ImVec4 ActiveColor(1, 0.8f, 0, 1);
|
||||||
const ImVec4 InnactiveColor(0.3f, 0.3f, 0.3f, 1);
|
const ImVec4 InnactiveColor(0.3f, 0.3f, 0.3f, 1);
|
||||||
@@ -148,24 +149,24 @@ void FCogInputWindow_Actions::RenderContent()
|
|||||||
case EInputActionValueType::Axis1D:
|
case EInputActionValueType::Axis1D:
|
||||||
{
|
{
|
||||||
const float Value = ActionValue.Get<float>();
|
const float Value = ActionValue.Get<float>();
|
||||||
DrawAxis("%s", ActionName, Value, &ActionInfo.X);
|
DrawAxis("%s", ActionName.Get(), Value, &ActionInfo.X);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EInputActionValueType::Axis2D:
|
case EInputActionValueType::Axis2D:
|
||||||
{
|
{
|
||||||
const FVector2D Value = ActionValue.Get<FVector2D>();
|
const FVector2D Value = ActionValue.Get<FVector2D>();
|
||||||
DrawAxis("%s X", ActionName, Value.X, &ActionInfo.X);
|
DrawAxis("%s X", ActionName.Get(), Value.X, &ActionInfo.X);
|
||||||
DrawAxis("%s Y", ActionName, Value.Y, &ActionInfo.Y);
|
DrawAxis("%s Y", ActionName.Get(), Value.Y, &ActionInfo.Y);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EInputActionValueType::Axis3D:
|
case EInputActionValueType::Axis3D:
|
||||||
{
|
{
|
||||||
const FVector Value = ActionValue.Get<FVector>();
|
const FVector Value = ActionValue.Get<FVector>();
|
||||||
DrawAxis("%s X", ActionName, Value.X, &ActionInfo.X);
|
DrawAxis("%s X", ActionName.Get(), Value.X, &ActionInfo.X);
|
||||||
DrawAxis("%s Y", ActionName, Value.Y, &ActionInfo.Y);
|
DrawAxis("%s Y", ActionName.Get(), Value.Y, &ActionInfo.Y);
|
||||||
DrawAxis("%s Z", ActionName, Value.Z, &ActionInfo.Z);
|
DrawAxis("%s Z", ActionName.Get(), Value.Z, &ActionInfo.Z);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "EnhancedInputSubsystems.h"
|
#include "EnhancedInputSubsystems.h"
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
#include "InputMappingContext.h"
|
#include "InputMappingContext.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogInputWindow_Gamepad::Initialize()
|
void FCogInputWindow_Gamepad::Initialize()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "Engine/DataAsset.h"
|
||||||
#include "CogInputDataAsset.generated.h"
|
#include "CogInputDataAsset.generated.h"
|
||||||
|
|
||||||
class UInputAction;
|
class UInputAction;
|
||||||
|
|||||||
@@ -4,12 +4,15 @@
|
|||||||
#include "CogInjectActionInfo.h"
|
#include "CogInjectActionInfo.h"
|
||||||
#include "CogWindow.h"
|
#include "CogWindow.h"
|
||||||
#include "CogWindowConfig.h"
|
#include "CogWindowConfig.h"
|
||||||
|
#include "imgui.h"
|
||||||
|
#include "InputCoreTypes.h"
|
||||||
#include "CogInputWindow_Gamepad.generated.h"
|
#include "CogInputWindow_Gamepad.generated.h"
|
||||||
|
|
||||||
class UEnhancedPlayerInput;
|
class UEnhancedPlayerInput;
|
||||||
class UCogInputConfig_Gamepad;
|
class UCogInputConfig_Gamepad;
|
||||||
class UCogInputDataAsset;
|
class UCogInputDataAsset;
|
||||||
struct ImDrawList;
|
struct ImDrawList;
|
||||||
|
struct FKey;
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
class COGINPUT_API FCogInputWindow_Gamepad : public FCogWindow
|
class COGINPUT_API FCogInputWindow_Gamepad : public FCogWindow
|
||||||
|
|||||||
Reference in New Issue
Block a user