mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-02 12:48:14 +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);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ void FCogEngineWindow_TimeScale::RenderContent()
|
||||
float Value = Replicator->GetTimeDilation();
|
||||
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; }
|
||||
|
||||
UFUNCTION(Server, Reliable)
|
||||
void Server_SetTimeDilation(float Value);
|
||||
void SetTimeDilation(float Value);
|
||||
|
||||
UFUNCTION(Server, Reliable)
|
||||
void Server_Possess(APawn* Pawn);
|
||||
@@ -50,6 +49,9 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
UFUNCTION(Server, Reliable)
|
||||
void Server_SetTimeDilation(float Value);
|
||||
|
||||
UFUNCTION()
|
||||
void OnRep_TimeDilation();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user