mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-05 23:28:46 +00:00
minor fixes
This commit is contained in:
@@ -96,7 +96,7 @@ void ACogDebugReplicator::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>&
|
|||||||
|
|
||||||
DOREPLIFETIME_WITH_PARAMS_FAST(ACogDebugReplicator, ReplicatedData, Params);
|
DOREPLIFETIME_WITH_PARAMS_FAST(ACogDebugReplicator, ReplicatedData, Params);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void ACogDebugReplicator::TickActor(float DeltaTime, enum ELevelTick TickType, FActorTickFunction& ThisTickFunction)
|
void ACogDebugReplicator::TickActor(float DeltaTime, enum ELevelTick TickType, FActorTickFunction& ThisTickFunction)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -130,6 +130,26 @@ void ACogEngineReplicator::Server_Spawn_Implementation(const FCogEngineSpawnEntr
|
|||||||
#endif // !UE_BUILD_SHIPPING
|
#endif // !UE_BUILD_SHIPPING
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void ACogEngineReplicator::SetTimeDilation(float Value)
|
||||||
|
{
|
||||||
|
#if !UE_BUILD_SHIPPING
|
||||||
|
|
||||||
|
//-------------------------------------
|
||||||
|
// Set local time dilation right away
|
||||||
|
//-------------------------------------
|
||||||
|
TimeDilation = Value;
|
||||||
|
OnRep_TimeDilation();
|
||||||
|
|
||||||
|
//-------------------------------------
|
||||||
|
// Update server time dilation
|
||||||
|
//-------------------------------------
|
||||||
|
Server_SetTimeDilation(Value);
|
||||||
|
|
||||||
|
#endif // !UE_BUILD_SHIPPING
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void ACogEngineReplicator::Server_SetTimeDilation_Implementation(float Value)
|
void ACogEngineReplicator::Server_SetTimeDilation_Implementation(float Value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ void FCogEngineWindow_TimeScale::RenderContent()
|
|||||||
float Value = Replicator->GetTimeDilation();
|
float Value = Replicator->GetTimeDilation();
|
||||||
if (FCogWindowWidgets::MultiChoiceButtonsFloat(TimingScales, Value, ImVec2(3.5f * FCogWindowWidgets::GetFontWidth(), 0)))
|
if (FCogWindowWidgets::MultiChoiceButtonsFloat(TimingScales, Value, ImVec2(3.5f * FCogWindowWidgets::GetFontWidth(), 0)))
|
||||||
{
|
{
|
||||||
Replicator->Server_SetTimeDilation(Value);
|
Replicator->SetTimeDilation(Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ public:
|
|||||||
|
|
||||||
float GetTimeDilation() const { return TimeDilation; }
|
float GetTimeDilation() const { return TimeDilation; }
|
||||||
|
|
||||||
UFUNCTION(Server, Reliable)
|
void SetTimeDilation(float Value);
|
||||||
void Server_SetTimeDilation(float Value);
|
|
||||||
|
|
||||||
UFUNCTION(Server, Reliable)
|
UFUNCTION(Server, Reliable)
|
||||||
void Server_Possess(APawn* Pawn);
|
void Server_Possess(APawn* Pawn);
|
||||||
@@ -50,6 +49,9 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
UFUNCTION(Server, Reliable)
|
||||||
|
void Server_SetTimeDilation(float Value);
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnRep_TimeDilation();
|
void OnRep_TimeDilation();
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include "CogSampleBasicActor.h"
|
#include "CogSampleBasicActor.h"
|
||||||
|
|
||||||
|
#include "GameFramework/GameStateBase.h"
|
||||||
#include "Net/Core/PushModel/PushModel.h"
|
#include "Net/Core/PushModel/PushModel.h"
|
||||||
#include "Net/UnrealNetwork.h"
|
#include "Net/UnrealNetwork.h"
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
ACogSampleBasicActor::ACogSampleBasicActor(const FObjectInitializer& ObjectInitializer)
|
ACogSampleBasicActor::ACogSampleBasicActor(const FObjectInitializer& ObjectInitializer)
|
||||||
{
|
{
|
||||||
@@ -22,6 +22,21 @@ void ACogSampleBasicActor::GetLifetimeReplicatedProps(TArray< FLifetimeProperty
|
|||||||
DOREPLIFETIME_WITH_PARAMS_FAST(ACogSampleBasicActor, Creator, Params);
|
DOREPLIFETIME_WITH_PARAMS_FAST(ACogSampleBasicActor, Creator, Params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void ACogSampleBasicActor::BeginPlay()
|
||||||
|
{
|
||||||
|
//-----------------------------------------------------
|
||||||
|
// Set default creator before Super::BeginPlay()
|
||||||
|
// so component can access it inside they BeginPlay()
|
||||||
|
//-----------------------------------------------------
|
||||||
|
if (Creator == nullptr)
|
||||||
|
{
|
||||||
|
Creator = GetWorld()->GetGameState();
|
||||||
|
}
|
||||||
|
|
||||||
|
Super::BeginPlay();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void ACogSampleBasicActor::SetTeam(int32 Value)
|
void ACogSampleBasicActor::SetTeam(int32 Value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ class ACogSampleBasicActor : public AActor
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
ACogSampleBasicActor(const FObjectInitializer& ObjectInitializer);
|
ACogSampleBasicActor(const FObjectInitializer& ObjectInitializer);
|
||||||
|
|
||||||
|
virtual void BeginPlay();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
virtual int32 GetTeam() const override { return Team; }
|
virtual int32 GetTeam() const override { return Team; }
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
- CogEngine: Add more info in stats tooltip (details, curves, ...)
|
- CogEngine: Add more info in stats tooltip (details, curves, ...)
|
||||||
- CogEngine: Add screen settings (fullscreen, borderless, window and resolution)
|
- CogEngine: Add screen settings (fullscreen, borderless, window and resolution)
|
||||||
- CogEngine: make a better widget for CheckBoxState for input shortcuts
|
- CogEngine: make a better widget for CheckBoxState for input shortcuts
|
||||||
|
- CogEngine: save active log categories
|
||||||
|
|
||||||
- CogSample: Add a custom window in sample (changing the character faction)
|
- CogSample: Add a custom window in sample (changing the character faction)
|
||||||
- CogSample: Create more abilities
|
- CogSample: Create more abilities
|
||||||
|
|||||||
Reference in New Issue
Block a user