add possession in selection window

This commit is contained in:
Arnaud Jamin
2023-10-10 17:24:27 -04:00
parent 87acfc5a94
commit 83d756252a
43 changed files with 374 additions and 276 deletions
+19
View File
@@ -136,6 +136,8 @@ void ACogSampleGameState::TickCog(float DeltaSeconds)
//--------------------------------------------------------------------------------------------------------------------------
void ACogSampleGameState::InitializeCog()
{
RegisterCommand(TEXT("Cog.ToggleInput"), TEXT(""), FConsoleCommandWithArgsDelegate::CreateUObject(this, &ACogSampleGameState::CogToggleInput));
TSharedPtr<SCogImguiWidget> Widget = FCogImguiModule::Get().CreateImGuiViewport(GEngine->GameViewport, [this](float DeltaTime) { RenderCog(DeltaTime); });
FCogImguiModule::Get().SetToggleInputKey(FCogImGuiKeyInfo(EKeys::Insert));
@@ -225,4 +227,21 @@ void ACogSampleGameState::RenderCog(float DeltaTime)
FCogDebugDrawImGui::Draw();
}
//--------------------------------------------------------------------------------------------------------------------------
void ACogSampleGameState::RegisterCommand(const TCHAR* Name, const TCHAR* Help, const FConsoleCommandWithArgsDelegate& Command)
{
IConsoleManager& ConsoleManager = IConsoleManager::Get();
if (!ConsoleManager.FindConsoleObject(Name))
{
ConsoleManager.RegisterConsoleCommand(Name, Help, Command, ECVF_Cheat);
}
}
//--------------------------------------------------------------------------------------------------------------------------
void ACogSampleGameState::CogToggleInput(const TArray<FString>& Args)
{
FCogImguiModule::Get().ToggleEnableInput();
}
#endif //USE_COG