Implemented some classes to unlock OLSGameMode's constructor
This commit is contained in:
parent
7415b74e8f
commit
b9b7e5344b
@ -5,27 +5,31 @@
|
||||
|
||||
#include "CommonUserSubsystem.h"
|
||||
#include "GameMapsSettings.h"
|
||||
#include "Characters/OLSCharacter.h"
|
||||
#include "DataAssets/OLSExperienceDefinitionDataAsset.h"
|
||||
#include "DataAssets/OLSPawnDataAsset.h"
|
||||
#include "GameModes/OLSExperienceManagerComponent.h"
|
||||
#include "GameModes/OLSGameState.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Player/OLSPlayerController.h"
|
||||
#include "Player/OLSPlayerState.h"
|
||||
#include "Systems/OLSAssetManager.h"
|
||||
#include "Systems/OLSGameSession.h"
|
||||
#include "UI/OLSHUD.h"
|
||||
|
||||
|
||||
#include UE_INLINE_GENERATED_CPP_BY_NAME(OLSGameMode)
|
||||
|
||||
// AOLSGameMode::AOLSGameMode(const FObjectInitializer& objectInitializer) : Super(objectInitializer)
|
||||
// {
|
||||
// // @TODO: Implement this.
|
||||
// // GameStateClass = ALyraGameState::StaticClass();
|
||||
// // GameSessionClass = ALyraGameSession::StaticClass();
|
||||
// // PlayerControllerClass = ALyraPlayerController::StaticClass();
|
||||
// // ReplaySpectatorPlayerControllerClass = ALyraReplayPlayerController::StaticClass();
|
||||
// // PlayerStateClass = ALyraPlayerState::StaticClass();
|
||||
// // DefaultPawnClass = ALyraCharacter::StaticClass();
|
||||
// // HUDClass = ALyraHUD::StaticClass();
|
||||
// }
|
||||
AOLSGameMode::AOLSGameMode(const FObjectInitializer& objectInitializer) : Super(objectInitializer)
|
||||
{
|
||||
GameStateClass = AOLSGameState::StaticClass();
|
||||
GameSessionClass = AOLSGameSession::StaticClass();
|
||||
PlayerControllerClass = AOLSPlayerController::StaticClass();
|
||||
// ReplaySpectatorPlayerControllerClass = ALyraReplayPlayerController::StaticClass();
|
||||
PlayerStateClass = AOLSPlayerState::StaticClass();
|
||||
DefaultPawnClass = AOLSCharacter::StaticClass();
|
||||
HUDClass = AOLSHUD::StaticClass();
|
||||
}
|
||||
|
||||
const UOLSPawnDataAsset* AOLSGameMode::GetPawnDataForController(const AController* controller) const
|
||||
{
|
||||
|
4
Source/ols/Private/GameModes/OLSGameState.cpp
Normal file
4
Source/ols/Private/GameModes/OLSGameState.cpp
Normal file
@ -0,0 +1,4 @@
|
||||
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
|
||||
|
||||
|
||||
#include "GameModes/OLSGameState.h"
|
@ -3,18 +3,23 @@
|
||||
|
||||
#include "ModularGameplayActors/OLSModularGameMode.h"
|
||||
|
||||
AOLSModularGameModeBase::AOLSModularGameModeBase()
|
||||
#include "ModularGameplayActors/OLSModularCharacter.h"
|
||||
#include "ModularGameplayActors/OLSModularGameState.h"
|
||||
#include "ModularGameplayActors/OLSModularPlayerController.h"
|
||||
#include "ModularGameplayActors/OLSModularPlayerState.h"
|
||||
|
||||
AOLSModularGameModeBase::AOLSModularGameModeBase(const FObjectInitializer& objectInitializer) : Super(objectInitializer)
|
||||
{
|
||||
// GameStateClass = AGSCModularGameStateBase::StaticClass();
|
||||
// PlayerControllerClass = AGSCModularPlayerController::StaticClass();
|
||||
// PlayerStateClass = APlayerState::StaticClass();
|
||||
// DefaultPawnClass = AGSCModularCharacter::StaticClass();
|
||||
GameStateClass = AOLSModularGameStateBase::StaticClass();
|
||||
PlayerControllerClass = AOLSModularPlayerController::StaticClass();
|
||||
PlayerStateClass = AOLSModularPlayerState::StaticClass();
|
||||
DefaultPawnClass = AOLSModularCharacter::StaticClass();
|
||||
}
|
||||
|
||||
AOLSModularGameMode::AOLSModularGameMode()
|
||||
AOLSModularGameMode::AOLSModularGameMode(const FObjectInitializer& objectInitializer) : Super(objectInitializer)
|
||||
{
|
||||
// GameStateClass = AGSCModularGameState::StaticClass();
|
||||
// PlayerControllerClass = AGSCModularPlayerController::StaticClass();
|
||||
// PlayerStateClass = APlayerState::StaticClass();
|
||||
// DefaultPawnClass = AGSCModularCharacter::StaticClass();
|
||||
GameStateClass = AOLSModularGameStateBase::StaticClass();
|
||||
PlayerControllerClass = AOLSModularPlayerController::StaticClass();
|
||||
PlayerStateClass = AOLSModularPlayerState::StaticClass();
|
||||
DefaultPawnClass = AOLSModularCharacter::StaticClass();
|
||||
}
|
||||
|
26
Source/ols/Private/Systems/OLSGameSession.cpp
Normal file
26
Source/ols/Private/Systems/OLSGameSession.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
|
||||
|
||||
|
||||
#include "Systems/OLSGameSession.h"
|
||||
|
||||
|
||||
// Sets default values
|
||||
AOLSGameSession::AOLSGameSession()
|
||||
{
|
||||
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
void AOLSGameSession::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
// Called every frame
|
||||
void AOLSGameSession::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
}
|
||||
|
4
Source/ols/Private/UI/OLSHUD.cpp
Normal file
4
Source/ols/Private/UI/OLSHUD.cpp
Normal file
@ -0,0 +1,4 @@
|
||||
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
|
||||
|
||||
|
||||
#include "UI/OLSHUD.h"
|
@ -8,10 +8,12 @@
|
||||
#include "Interfaces/OLSAnimationInterface.h"
|
||||
#include "Interfaces/OLSMoveableInterface.h"
|
||||
#include "Interfaces/OLSReplicatedMovableInterface.h"
|
||||
#include "ModularGameplayActors/OLSModularCharacter.h"
|
||||
#include "ModularGameplayActors/OLSModularPlayerStateCharacter.h"
|
||||
#include "OLSCharacter.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class OLS_API AOLSCharacter : public ACharacter,
|
||||
class OLS_API AOLSCharacter : public AOLSModularPlayerStateCharacter,
|
||||
public IOLSMoveableInterface,
|
||||
public IOLSAnimationInterface
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ class OLS_API AOLSGameMode : public AOLSModularGameModeBase
|
||||
|
||||
public:
|
||||
|
||||
// AOLSGameMode(const FObjectInitializer& objectInitializer);
|
||||
AOLSGameMode(const FObjectInitializer& objectInitializer);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "OLS|Pawn")
|
||||
const class UOLSPawnDataAsset* GetPawnDataForController(const class AController* controller) const;
|
||||
|
16
Source/ols/Public/GameModes/OLSGameState.h
Normal file
16
Source/ols/Public/GameModes/OLSGameState.h
Normal file
@ -0,0 +1,16 @@
|
||||
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "ModularGameplayActors/OLSModularGameState.h"
|
||||
#include "OLSGameState.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS(Config = Game)
|
||||
class OLS_API AOLSGameState : public AOLSModularGameState
|
||||
{
|
||||
GENERATED_BODY()
|
||||
};
|
@ -15,7 +15,7 @@ class OLS_API AOLSModularGameModeBase : public AGameModeBase
|
||||
|
||||
public:
|
||||
|
||||
AOLSModularGameModeBase();
|
||||
AOLSModularGameModeBase(const FObjectInitializer& objectInitializer);
|
||||
};
|
||||
|
||||
/** Pair this with a ModularGameState */
|
||||
@ -26,5 +26,5 @@ class OLS_API AOLSModularGameMode : public AGameMode
|
||||
|
||||
public:
|
||||
|
||||
AOLSModularGameMode();
|
||||
AOLSModularGameMode(const FObjectInitializer& objectInitializer);
|
||||
};
|
||||
|
25
Source/ols/Public/Systems/OLSGameSession.h
Normal file
25
Source/ols/Public/Systems/OLSGameSession.h
Normal file
@ -0,0 +1,25 @@
|
||||
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/GameSession.h"
|
||||
#include "OLSGameSession.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class OLS_API AOLSGameSession : public AGameSession
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
AOLSGameSession();
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
};
|
16
Source/ols/Public/UI/OLSHUD.h
Normal file
16
Source/ols/Public/UI/OLSHUD.h
Normal file
@ -0,0 +1,16 @@
|
||||
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/HUD.h"
|
||||
#include "OLSHUD.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class OLS_API AOLSHUD : public AHUD
|
||||
{
|
||||
GENERATED_BODY()
|
||||
};
|
Loading…
Reference in New Issue
Block a user