CogSample: Add a window with the Team of the selection.

This commit is contained in:
Arnaud Jamin
2023-11-05 01:10:22 -04:00
parent c44171b113
commit 34e08a9e2a
4 changed files with 68 additions and 1 deletions
+37
View File
@@ -0,0 +1,37 @@
#include "CogSampleWindow_Team.h"
#if ENABLE_COG
#include "CogImguiHelper.h"
#include "CogWindowHelper.h"
#include "CogWindowWidgets.h"
#include "CogSampleTeamInterface.h"
//--------------------------------------------------------------------------------------------------------------------------
void FCogSampleWindow_Team::Initialize()
{
Super::Initialize();
}
//--------------------------------------------------------------------------------------------------------------------------
void FCogSampleWindow_Team::RenderHelp()
{
ImGui::Text("A window part of the sample project.");
}
//--------------------------------------------------------------------------------------------------------------------------
void FCogSampleWindow_Team::RenderContent()
{
Super::RenderContent();
if (ICogSampleTeamInterface* TeamInterface = Cast<ICogSampleTeamInterface>(GetSelection()))
{
int32 Team = TeamInterface->GetTeam();
if (ImGui::DragInt("Team", &Team, 0.1f, 0, 10))
{
TeamInterface->SetTeam(Team);
}
}
}
#endif //ENABLE_COG