reset config

This commit is contained in:
Arnaud Jamin
2023-10-11 21:59:44 -04:00
parent 88481c3dcc
commit bfaf0c0058
20 changed files with 143 additions and 2 deletions
@@ -28,6 +28,17 @@ UCogAbilityWindow_Attributes::UCogAbilityWindow_Attributes()
bHasMenu = true;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogAbilityWindow_Attributes::ResetConfig()
{
Super::ResetConfig();
bSortByNameSetting = true;
bGroupByAttributeSetSetting = false;
bGroupByCategorySetting = false;
bShowOnlyModified = false;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogAbilityWindow_Attributes::RenderContent()
{
@@ -31,6 +31,15 @@ UCogAbilityWindow_Cheats::UCogAbilityWindow_Cheats()
bHasMenu = true;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogAbilityWindow_Cheats::ResetConfig()
{
Super::ResetConfig();
bReapplyCheatsBetweenPlays = true;
bReapplyCheatsBetweenLaunches = true;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogAbilityWindow_Cheats::SetAsset(const UCogAbilityDataAsset* Value)
{
@@ -19,6 +19,8 @@ public:
protected:
virtual void ResetConfig() override;
virtual void RenderHelp() override;
virtual void RenderContent() override;
@@ -23,6 +23,8 @@ public:
protected:
virtual void ResetConfig() override;
virtual void RenderHelp() override;
virtual void RenderContent() override;
@@ -29,7 +29,21 @@ UCogEngineWindow_Collisions::UCogEngineWindow_Collisions()
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogEngineWindow_Collisions::ResetConfig()
{
Super::ResetConfig();
ObjectTypesToQuery = 0;
ProfileIndex = 0;
QueryType = 0;
QueryDistance = 5000.0f;
QueryThickness = 0.0f;
UseComplexCollisions = false;
ShowActorsNames = false;
ShowQuery = false;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogEngineWindow_Collisions::RenderContent()
{
Super::RenderContent();
@@ -12,6 +12,28 @@ void UCogEngineWindow_DebugSettings::RenderHelp()
);
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogEngineWindow_DebugSettings::ResetConfig()
{
Super::ResetConfig();
FilterBySelection = true;
Persistent = false;
TextShadow = true;
Fade2D = true;
Duration = 3.0f;
DepthPriority = 0;
Segments = 12;
Thickness = 0.0f;
ServerThickness = 2.0f;
ServerColorMultiplier = 0.8f;
ArrowSize = 10.0f;
AxesScale = 1.0f;
GradientColorIntensity = 0.0f;
GradientColorSpeed = 2.0f;
TextSize = 1.0f;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogEngineWindow_DebugSettings::PostInitProperties()
{
@@ -23,6 +23,14 @@ UCogEngineWindow_LogCategories::UCogEngineWindow_LogCategories()
bHasMenu = true;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogEngineWindow_LogCategories::ResetConfig()
{
Super::ResetConfig();
FCogDebugLog::DeactivateAllLogCateories(*GetWorld());
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogEngineWindow_LogCategories::RenderContent()
{
@@ -13,6 +13,16 @@ void UCogEngineWindow_Metrics::RenderHelp()
);
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogEngineWindow_Metrics::ResetConfig()
{
Super::ResetConfig();
MaxDurationSetting = 0.0f;
RestartDelaySetting = 5.0f;
PostInitProperties();
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogEngineWindow_Metrics::PostInitProperties()
{
@@ -23,6 +23,17 @@ void UCogEngineWindow_OutputLog::RenderHelp()
"The verbosity of each log category can be configured in the 'Log Categories' window. "
);
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogEngineWindow_OutputLog::ResetConfig()
{
Super::ResetConfig();
AutoScroll = true;
ShowFrame = true;
ShowCategory = true;
ShowVerbosity = false;
ShowAsTable = false;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogEngineWindow_OutputLog::Clear()
@@ -19,6 +19,8 @@ public:
private:
virtual void ResetConfig() override;
virtual void RenderHelp() override;
virtual void RenderContent() override;
@@ -15,6 +15,8 @@ public:
protected:
virtual void ResetConfig() override;
virtual void RenderHelp() override;
virtual void PreSaveConfig() override;
@@ -13,6 +13,8 @@ public:
UCogEngineWindow_LogCategories();
virtual void ResetConfig() override;
virtual void RenderHelp() override;
virtual void RenderContent() override;
@@ -18,6 +18,8 @@ public:
protected:
virtual void ResetConfig() override;
virtual void PostInitProperties() override;
virtual void PreSaveConfig() override;
@@ -40,6 +40,8 @@ protected:
virtual void RenderHelp() override;
virtual void ResetConfig() override;
virtual void RenderContent() override;
private:
@@ -24,6 +24,22 @@ void UCogInputWindow_Gamepad::PreRender(ImGuiWindowFlags& WindowFlags)
}
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogInputWindow_Gamepad::ResetConfig()
{
Super::ResetConfig();
bShowAsOverlay = false;
bInvertRightStickY = false;
bInvertLeftStickY = false;
BackgroundColor = FVector4f(0.03f, 0.03f, 0.03f, 1.0f);
ButtonColor = FVector4f(0.2f, 0.2f, 0.2f, 1.0f);
BorderColor = FVector4f(0.03f, 0.03f, 0.03f, 1.0f);
PressedColor = FVector4f(0.6f, 0.6f, 0.6f, 1.0f);
InjectColor = FVector4f(1.0f, 0.5f, 0.0f, 0.5f);
Border = 0.02f;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogInputWindow_Gamepad::InputContextMenu(const FKey& Key, FCogInjectActionInfo* ActionInfoButton, FCogInjectActionInfo* ActionInfo2D)
{
@@ -17,14 +17,18 @@ public:
UCogInputWindow_Gamepad();
TWeakObjectPtr<const UCogInputDataAsset> Asset;
protected:
virtual void ResetConfig() override;
virtual void PreRender(ImGuiWindowFlags& WindowFlags) override;
virtual void RenderContent() override;
virtual void RenderTick(float DeltaSeconds) override;
TWeakObjectPtr<const UCogInputDataAsset> Asset;
private:
void AddButton(const FKey& Key, const ImVec2& Position, const ImVec2& Size, const ImVec2& Alignment, float Rounding, ImDrawFlags Flags = 0);
@@ -472,3 +472,12 @@ void UCogWindowManager::SetDPIScale(float Value)
DPIScale = Value;
bRefreshDPIScale = true;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogWindowManager::ResetAllWindowsConfig()
{
for (UCogWindow* Window : Windows)
{
Window->ResetConfig();
}
}
@@ -90,4 +90,13 @@ void UCogWindow_Settings::RenderContent()
{
FCogImguiModule::Get().SetToggleInputKey(ToggleInputKey);
}
ImGui::Separator();
ImGui::Spacing();
ImGui::Spacing();
if (ImGui::Button("Reset All Windows Config"))
{
GetOwner()->ResetAllWindowsConfig();
}
}
@@ -17,6 +17,8 @@ public:
virtual void Initialize() {}
virtual void ResetConfig() {}
virtual void PreSaveConfig() {}
/** Called every frame with a valid imgui context if the window is visible. */
@@ -72,6 +72,8 @@ public:
void SetPreviewWindowsInMenu(bool Value) { bShowWindowsInMainMenu = Value; }
void ResetAllWindowsConfig();
protected:
friend class UCogWindow_Settings;