mirror of
https://github.com/Ed94/Cog.git
synced 2026-06-13 08:02:23 -07:00
CogSample: Add a window with the Team of the selection.
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "CogInputWindow_Actions.h"
|
||||
#include "CogInputWindow_Gamepad.h"
|
||||
#include "CogSampleLogCategories.h"
|
||||
#include "CogSampleWindow_Team.h"
|
||||
#include "CogWindowManager.h"
|
||||
|
||||
#include "GameFramework/GameUserSettings.h"
|
||||
@@ -181,6 +182,8 @@ void ACogSampleGameState::InitializeCog()
|
||||
|
||||
CogWindowManager->AddWindow<FCogAbilityWindow_OwnedTags>("Gameplay.Owned Tags");
|
||||
|
||||
CogWindowManager->AddWindow<FCogSampleWindow_Team>("Gameplay.Team");
|
||||
|
||||
CogWindowManager->AddWindow<FCogAbilityWindow_Tweaks>("Gameplay.Tweaks");
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "CogCommon.h"
|
||||
|
||||
#if ENABLE_COG
|
||||
|
||||
#include "CogWindow.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
class FCogSampleWindow_Team : public FCogWindow
|
||||
{
|
||||
typedef FCogWindow Super;
|
||||
|
||||
public:
|
||||
|
||||
virtual void Initialize() override;
|
||||
|
||||
protected:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
};
|
||||
|
||||
#endif //ENABLE_COG
|
||||
Reference in New Issue
Block a user