mirror of
https://github.com/Ed94/Cog.git
synced 2026-06-13 08:02:23 -07:00
add possession in selection window
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user