2024-04-12 23:31:49 -07:00
|
|
|
|
#pragma once
|
2024-04-22 22:10:02 -07:00
|
|
|
|
#include "GasaCommon.h"
|
|
|
|
|
#include "Engine/Engine.h"
|
2024-04-12 23:31:49 -07:00
|
|
|
|
|
|
|
|
|
#include "Engine/LevelScriptActor.h"
|
2024-04-22 22:10:02 -07:00
|
|
|
|
#include "Networking/GasaNetLibrary.h"
|
2024-04-13 02:32:52 -07:00
|
|
|
|
|
2024-04-12 23:31:49 -07:00
|
|
|
|
#include "GasaLevelScriptActor.generated.h"
|
|
|
|
|
|
|
|
|
|
UCLASS(Blueprintable)
|
|
|
|
|
class GASA_API AGasaLevelScriptActor : public ALevelScriptActor
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
public:
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Post Process")
|
|
|
|
|
TObjectPtr<APostProcessVolume> GlobalPPV;
|
|
|
|
|
|
2024-04-22 22:10:02 -07:00
|
|
|
|
AGasaLevelScriptActor();
|
|
|
|
|
|
|
|
|
|
#pragma region GameFramework
|
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
|
2024-04-23 15:54:17 -07:00
|
|
|
|
bool bOverrideGameFrameworkReady = false;
|
2024-04-22 22:10:02 -07:00
|
|
|
|
|
|
|
|
|
UFUNCTION()
|
|
|
|
|
void OnGameFrameworkInitialized();
|
|
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, meta=(DisplayName="On Game Framework Initialized"))
|
|
|
|
|
void BP_OnGameFrameworkInitialized();
|
|
|
|
|
#pragma endregion GameFramework
|
|
|
|
|
|
|
|
|
|
#pragma region NetSlime
|
|
|
|
|
// NetSlime interface is generated by GasaGen/GasaGen_NetSlime.cpp
|
|
|
|
|
FORCEINLINE ENetworkMode GetNetworkMode() const { return Gasa::GetNetworkMode( this ); }
|
|
|
|
|
FORCEINLINE bool IsClient() const { return Gasa::IsClient( this ); }
|
|
|
|
|
FORCEINLINE bool IsListenServer() const { return Gasa::IsListenServer( this ); }
|
|
|
|
|
FORCEINLINE bool IsNetOwner() const { return Gasa::IsNetOwner( this ); }
|
|
|
|
|
FORCEINLINE bool IsServer() const { return Gasa::IsServer( this ); }
|
|
|
|
|
FORCEINLINE bool IsSimulatedProxy() const { return Gasa::IsSimulatedProxy( this ); }
|
|
|
|
|
FORCEINLINE void NetLog(
|
|
|
|
|
FString Message,
|
|
|
|
|
EGasaVerbosity Verbosity = EGasaVerbosity::Log,
|
|
|
|
|
FLogCategoryBase& Category = LogGasaNet,
|
|
|
|
|
bool DumpStack = false,
|
|
|
|
|
int32 Line = __builtin_LINE(),
|
|
|
|
|
ANSICHAR const* File = __builtin_FILE(),
|
|
|
|
|
ANSICHAR const* Func = __builtin_FUNCTION()
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
Gasa::NetLog( this, Message, Verbosity, Category, DumpStack, Line, File, Func );
|
|
|
|
|
}
|
|
|
|
|
#pragma endregion NetSlime
|
|
|
|
|
|
2024-04-12 23:31:49 -07:00
|
|
|
|
#pragma region Actor
|
|
|
|
|
void BeginPlay() override;
|
2024-04-24 07:07:23 -07:00
|
|
|
|
#pragma endregion endActor
|
2024-04-12 23:31:49 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
namespace Gasa
|
|
|
|
|
{
|
|
|
|
|
inline
|
|
|
|
|
AGasaLevelScriptActor* GetLevelActor(UObject* Context, ULevel* OwnerLevel = nullptr) {
|
2024-04-13 02:32:52 -07:00
|
|
|
|
UWorld* World = GEngine->GetWorldFromContextObject(Context, EGetWorldErrorMode::LogAndReturnNull);
|
|
|
|
|
if (World == nullptr)
|
|
|
|
|
{
|
|
|
|
|
Log("World is null... are you running in a proper context?", ELogV::Error);
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
2024-04-12 23:31:49 -07:00
|
|
|
|
return Cast<AGasaLevelScriptActor>(World->GetLevelScriptActor(OwnerLevel));
|
|
|
|
|
}
|
|
|
|
|
}
|