From 94e686ca9c37b91c83d18c43f4c5956c2d32b6bc Mon Sep 17 00:00:00 2001
From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Date: Tue, 29 Oct 2024 16:07:57 +1100
Subject: [PATCH] Fix separated game screen bumping (#33046)
I don't really understand why RecordedSplitContainer exists but removing it looks identical and fixes the panel bumping occasionally.
---
Content.Client/Mapping/MappingScreen.xaml | 4 +--
Content.Client/Mapping/MappingScreen.xaml.cs | 1 -
.../Controls/RecordedSplitContainer.cs | 29 -------------------
.../Screens/SeparatedChatGameScreen.xaml | 6 ++--
.../Screens/SeparatedChatGameScreen.xaml.cs | 1 -
5 files changed, 5 insertions(+), 36 deletions(-)
delete mode 100644 Content.Client/UserInterface/Controls/RecordedSplitContainer.cs
diff --git a/Content.Client/Mapping/MappingScreen.xaml b/Content.Client/Mapping/MappingScreen.xaml
index 9cc3e734f0..bad492e7e4 100644
--- a/Content.Client/Mapping/MappingScreen.xaml
+++ b/Content.Client/Mapping/MappingScreen.xaml
@@ -8,7 +8,7 @@
VerticalExpand="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
-
@@ -82,5 +82,5 @@
-
+
diff --git a/Content.Client/Mapping/MappingScreen.xaml.cs b/Content.Client/Mapping/MappingScreen.xaml.cs
index 46c0e51fad..20e2528a44 100644
--- a/Content.Client/Mapping/MappingScreen.xaml.cs
+++ b/Content.Client/Mapping/MappingScreen.xaml.cs
@@ -197,7 +197,6 @@ public sealed partial class MappingScreen : InGameScreen
public override void SetChatSize(Vector2 size)
{
- ScreenContainer.DesiredSplitCenter = size.X;
ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
}
diff --git a/Content.Client/UserInterface/Controls/RecordedSplitContainer.cs b/Content.Client/UserInterface/Controls/RecordedSplitContainer.cs
deleted file mode 100644
index fd217bc7e8..0000000000
--- a/Content.Client/UserInterface/Controls/RecordedSplitContainer.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System.Numerics;
-using Robust.Client.UserInterface.Controls;
-
-namespace Content.Client.UserInterface.Controls;
-
-///
-/// A split container that performs an action when the split resizing is finished.
-///
-public sealed class RecordedSplitContainer : SplitContainer
-{
- public double? DesiredSplitCenter;
-
- protected override Vector2 ArrangeOverride(Vector2 finalSize)
- {
- if (ResizeMode == SplitResizeMode.RespectChildrenMinSize
- && DesiredSplitCenter != null
- && !finalSize.Equals(Vector2.Zero))
- {
- SplitFraction = (float) DesiredSplitCenter.Value;
-
- if (!Size.Equals(Vector2.Zero))
- {
- DesiredSplitCenter = null;
- }
- }
-
- return base.ArrangeOverride(finalSize);
- }
-}
diff --git a/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml b/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml
index 7f1d1bcd5b..653302fae4 100644
--- a/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml
+++ b/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml
@@ -14,7 +14,7 @@
VerticalExpand="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
-
+
@@ -26,7 +26,7 @@
-
+
@@ -36,5 +36,5 @@
-
+
diff --git a/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs b/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs
index e04d377d32..2892ca4425 100644
--- a/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs
+++ b/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs
@@ -40,7 +40,6 @@ public sealed partial class SeparatedChatGameScreen : InGameScreen
public override void SetChatSize(Vector2 size)
{
- ScreenContainer.DesiredSplitCenter = size.X;
ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
}
}