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