mirror of
https://github.com/Ed94/Cog.git
synced 2026-07-30 03:10:05 +00:00
add a new heroes push back abilities
This commit is contained in:
@@ -24,19 +24,6 @@ void FCogEngineModule::SetLocalReplicator(ACogEngineReplicator* Value)
|
||||
LocalReplicator = Value;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
ACogEngineReplicator* FCogEngineModule::GetRemoteReplicator(const APlayerController* PlayerController)
|
||||
{
|
||||
for (ACogEngineReplicator* Replicator : RemoteReplicators)
|
||||
{
|
||||
if (Replicator->GetPlayerController() == PlayerController)
|
||||
{
|
||||
return Replicator;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void FCogEngineModule::AddRemoteReplicator(ACogEngineReplicator* Value)
|
||||
{
|
||||
|
||||
@@ -12,6 +12,50 @@ void UCogEngineWindow_DebugSettings::RenderHelp()
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_DebugSettings::PostInitProperties()
|
||||
{
|
||||
Super::PostInitProperties();
|
||||
|
||||
FCogDebugSettings::FilterBySelection = FilterBySelection;
|
||||
FCogDebugSettings::Persistent = Persistent;
|
||||
FCogDebugSettings::TextShadow = TextShadow;
|
||||
FCogDebugSettings::Fade2D = Fade2D;
|
||||
FCogDebugSettings::Duration = Duration;
|
||||
FCogDebugSettings::DepthPriority = DepthPriority;
|
||||
FCogDebugSettings::Segments = Segments;
|
||||
FCogDebugSettings::Thickness = Thickness;
|
||||
FCogDebugSettings::ServerThickness = ServerThickness;
|
||||
FCogDebugSettings::ServerColorMultiplier = ServerColorMultiplier;
|
||||
FCogDebugSettings::ArrowSize = ArrowSize;
|
||||
FCogDebugSettings::AxesScale = AxesScale;
|
||||
FCogDebugSettings::GradientColorIntensity = GradientColorIntensity;
|
||||
FCogDebugSettings::GradientColorSpeed = GradientColorSpeed;
|
||||
FCogDebugSettings::TextSize = TextSize;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_DebugSettings::PreSaveConfig()
|
||||
{
|
||||
Super::PreSaveConfig();
|
||||
|
||||
FilterBySelection = FCogDebugSettings::FilterBySelection;
|
||||
Persistent = FCogDebugSettings::Persistent;
|
||||
TextShadow = FCogDebugSettings::TextShadow;
|
||||
Fade2D = FCogDebugSettings::Fade2D;
|
||||
Duration = FCogDebugSettings::Duration;
|
||||
DepthPriority = FCogDebugSettings::DepthPriority;
|
||||
Segments = FCogDebugSettings::Segments;
|
||||
Thickness = FCogDebugSettings::Thickness;
|
||||
ServerThickness = FCogDebugSettings::ServerThickness;
|
||||
ServerColorMultiplier = FCogDebugSettings::ServerColorMultiplier;
|
||||
ArrowSize = FCogDebugSettings::ArrowSize;
|
||||
AxesScale = FCogDebugSettings::AxesScale;
|
||||
GradientColorIntensity = FCogDebugSettings::GradientColorIntensity;
|
||||
GradientColorSpeed = FCogDebugSettings::GradientColorSpeed;
|
||||
TextSize = FCogDebugSettings::TextSize;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_DebugSettings::PreRender(ImGuiWindowFlags& WindowFlags)
|
||||
{
|
||||
|
||||
@@ -81,6 +81,11 @@ void UCogEngineWindow_LogCategories::RenderContent()
|
||||
{
|
||||
FName CategoryName = Entry.Key;
|
||||
const FCogDebugLogCategoryInfo& CategoryInfo = Entry.Value;
|
||||
if (CategoryInfo.bVisible == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
FLogCategoryBase* Category = CategoryInfo.LogCategory;
|
||||
|
||||
ImGui::PushID(Index);
|
||||
@@ -102,7 +107,7 @@ void UCogEngineWindow_LogCategories::RenderContent()
|
||||
if (ImGui::Checkbox("##Server", &IsActive))
|
||||
{
|
||||
ELogVerbosity::Type NewVerbosity = IsActive ? (IsControlDown ? ELogVerbosity::VeryVerbose : ELogVerbosity::Verbose) : ELogVerbosity::Warning;
|
||||
FCogDebugLogCategoryManager::SetServerVerbosity(CategoryName, NewVerbosity);
|
||||
FCogDebugLogCategoryManager::SetServerVerbosity(*World, CategoryName, NewVerbosity);
|
||||
}
|
||||
|
||||
if (Verbosity == ELogVerbosity::VeryVerbose)
|
||||
@@ -168,7 +173,7 @@ void UCogEngineWindow_LogCategories::RenderContent()
|
||||
|
||||
if (ImGui::Selectable(FCogDebugHelper::VerbosityToString(Verbosity), IsSelected))
|
||||
{
|
||||
FCogDebugLogCategoryManager::SetServerVerbosity(CategoryName, Verbosity);
|
||||
FCogDebugLogCategoryManager::SetServerVerbosity(*World, CategoryName, Verbosity);
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
|
||||
@@ -14,12 +14,23 @@ void UCogEngineWindow_Metrics::RenderHelp()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Metrics::PostLoad()
|
||||
void UCogEngineWindow_Metrics::PostInitProperties()
|
||||
{
|
||||
Super::PostInitProperties();
|
||||
|
||||
FCogDebugMetric::MaxDurationSetting = MaxDurationSetting;
|
||||
FCogDebugMetric::RestartDelaySetting = RestartDelaySetting;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Metrics::PreSaveConfig()
|
||||
{
|
||||
Super::PreSaveConfig();
|
||||
|
||||
MaxDurationSetting = FCogDebugMetric::MaxDurationSetting;
|
||||
RestartDelaySetting = FCogDebugMetric::RestartDelaySetting;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void UCogEngineWindow_Metrics::PreRender(ImGuiWindowFlags& WindowFlags)
|
||||
{
|
||||
@@ -47,17 +58,11 @@ void UCogEngineWindow_Metrics::RenderContent()
|
||||
bool bSettingModified = false;
|
||||
|
||||
FCogWindowWidgets::PushStyleCompact();
|
||||
if (ImGui::DragFloat("Auto Restart Delay", &RestartDelaySetting, 0.1f, 0.0f, FLT_MAX, "%0.1f"))
|
||||
{
|
||||
FCogDebugMetric::RestartDelaySetting = RestartDelaySetting;
|
||||
}
|
||||
ImGui::DragFloat("Auto Restart Delay", &FCogDebugMetric::RestartDelaySetting, 0.1f, 0.0f, FLT_MAX, "%0.1f");
|
||||
FCogWindowWidgets::PopStyleCompact();
|
||||
|
||||
FCogWindowWidgets::PushStyleCompact();
|
||||
if (ImGui::DragFloat("Max Time", &MaxDurationSetting, 0.1f, 0.0f, FLT_MAX, "%0.1f"))
|
||||
{
|
||||
FCogDebugMetric::MaxDurationSetting = MaxDurationSetting;
|
||||
}
|
||||
ImGui::DragFloat("Max Time", &FCogDebugMetric::MaxDurationSetting, 0.1f, 0.0f, FLT_MAX, "%0.1f");
|
||||
FCogWindowWidgets::PopStyleCompact();
|
||||
|
||||
ImGui::EndMenu();
|
||||
|
||||
@@ -20,8 +20,6 @@ public:
|
||||
|
||||
void SetLocalReplicator(ACogEngineReplicator* Value);
|
||||
|
||||
ACogEngineReplicator* GetRemoteReplicator(const APlayerController* PlayerController);
|
||||
|
||||
TArray<TObjectPtr<ACogEngineReplicator>> GetRemoteReplicators() const { return RemoteReplicators; }
|
||||
|
||||
void AddRemoteReplicator(ACogEngineReplicator* Value);
|
||||
|
||||
@@ -4,15 +4,67 @@
|
||||
#include "CogWindow.h"
|
||||
#include "CogEngineWindow_DebugSettings.generated.h"
|
||||
|
||||
UCLASS()
|
||||
UCLASS(Config = Cog)
|
||||
class COGENGINE_API UCogEngineWindow_DebugSettings : public UCogWindow
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
virtual void RenderHelp()override;
|
||||
protected:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void PreSaveConfig() override;
|
||||
|
||||
virtual void PostInitProperties() override;
|
||||
|
||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
||||
|
||||
virtual void RenderContent() override;
|
||||
|
||||
private:
|
||||
|
||||
UPROPERTY(Config)
|
||||
bool FilterBySelection = true;
|
||||
|
||||
UPROPERTY(Config)
|
||||
bool Persistent = false;
|
||||
|
||||
UPROPERTY(Config)
|
||||
bool TextShadow = true;
|
||||
|
||||
UPROPERTY(Config)
|
||||
bool Fade2D = true;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float Duration = 3.0f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
int DepthPriority = 0;
|
||||
|
||||
UPROPERTY(Config)
|
||||
int Segments = 12;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float Thickness = 0.0f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float ServerThickness = 2.0f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float ServerColorMultiplier = 0.8f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float ArrowSize = 10.0f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float AxesScale = 1.0f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float GradientColorIntensity = 0.0f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float GradientColorSpeed = 2.0f;
|
||||
|
||||
UPROPERTY(Config)
|
||||
float TextSize = 1.0f;
|
||||
};
|
||||
|
||||
@@ -16,9 +16,11 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
virtual void PostInitProperties() override;
|
||||
|
||||
virtual void PostLoad() override;
|
||||
virtual void PreSaveConfig() override;
|
||||
|
||||
virtual void RenderHelp() override;
|
||||
|
||||
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user