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.
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
VerticalExpand="False"
|
VerticalExpand="False"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
HorizontalAlignment="Center">
|
HorizontalAlignment="Center">
|
||||||
<controls:RecordedSplitContainer Name="ScreenContainer" HorizontalExpand="True"
|
<SplitContainer Name="ScreenContainer" HorizontalExpand="True"
|
||||||
VerticalExpand="True" SplitWidth="0"
|
VerticalExpand="True" SplitWidth="0"
|
||||||
StretchDirection="TopLeft">
|
StretchDirection="TopLeft">
|
||||||
<BoxContainer Orientation="Vertical" VerticalExpand="True" Name="SpawnContainer" MinWidth="200" SetWidth="600">
|
<BoxContainer Orientation="Vertical" VerticalExpand="True" Name="SpawnContainer" MinWidth="200" SetWidth="600">
|
||||||
@@ -82,5 +82,5 @@
|
|||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
</PanelContainer>
|
</PanelContainer>
|
||||||
</LayoutContainer>
|
</LayoutContainer>
|
||||||
</controls:RecordedSplitContainer>
|
</SplitContainer>
|
||||||
</mapping:MappingScreen>
|
</mapping:MappingScreen>
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ public sealed partial class MappingScreen : InGameScreen
|
|||||||
|
|
||||||
public override void SetChatSize(Vector2 size)
|
public override void SetChatSize(Vector2 size)
|
||||||
{
|
{
|
||||||
ScreenContainer.DesiredSplitCenter = size.X;
|
|
||||||
ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
|
ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
using System.Numerics;
|
|
||||||
using Robust.Client.UserInterface.Controls;
|
|
||||||
|
|
||||||
namespace Content.Client.UserInterface.Controls;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A split container that performs an action when the split resizing is finished.
|
|
||||||
/// </summary>
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
VerticalExpand="False"
|
VerticalExpand="False"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
HorizontalAlignment="Center">
|
HorizontalAlignment="Center">
|
||||||
<controls:RecordedSplitContainer Name="ScreenContainer" HorizontalExpand="True" VerticalExpand="True" SplitWidth="0" StretchDirection="TopLeft">
|
<SplitContainer Name="ScreenContainer" HorizontalExpand="True" VerticalExpand="True" SplitWidth="0" StretchDirection="TopLeft">
|
||||||
<LayoutContainer Name="ViewportContainer" HorizontalExpand="True" VerticalExpand="True">
|
<LayoutContainer Name="ViewportContainer" HorizontalExpand="True" VerticalExpand="True">
|
||||||
<controls:MainViewport Name="MainViewport"/>
|
<controls:MainViewport Name="MainViewport"/>
|
||||||
<widgets:GhostGui Name="Ghost" Access="Protected" />
|
<widgets:GhostGui Name="Ghost" Access="Protected" />
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
<alerts:AlertsUI Name="Alerts" Access="Protected" />
|
<alerts:AlertsUI Name="Alerts" Access="Protected" />
|
||||||
</LayoutContainer>
|
</LayoutContainer>
|
||||||
<PanelContainer HorizontalExpand="True" MinWidth="300">
|
<PanelContainer Name="SeparatedChatPanel" MinWidth="300">
|
||||||
<PanelContainer.PanelOverride>
|
<PanelContainer.PanelOverride>
|
||||||
<graphics:StyleBoxFlat BackgroundColor="#2B2C3B" />
|
<graphics:StyleBoxFlat BackgroundColor="#2B2C3B" />
|
||||||
</PanelContainer.PanelOverride>
|
</PanelContainer.PanelOverride>
|
||||||
@@ -36,5 +36,5 @@
|
|||||||
<chat:ChatBox VerticalExpand="True" HorizontalExpand="True" Name="Chat" Access="Protected" MinSize="0 0"/>
|
<chat:ChatBox VerticalExpand="True" HorizontalExpand="True" Name="Chat" Access="Protected" MinSize="0 0"/>
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
</PanelContainer>
|
</PanelContainer>
|
||||||
</controls:RecordedSplitContainer>
|
</SplitContainer>
|
||||||
</screens:SeparatedChatGameScreen>
|
</screens:SeparatedChatGameScreen>
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ public sealed partial class SeparatedChatGameScreen : InGameScreen
|
|||||||
|
|
||||||
public override void SetChatSize(Vector2 size)
|
public override void SetChatSize(Vector2 size)
|
||||||
{
|
{
|
||||||
ScreenContainer.DesiredSplitCenter = size.X;
|
|
||||||
ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
|
ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user