Files
wwdpublic/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs
metalgearsloth 1dfc592f68 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.

(cherry picked from commit 94e686ca9c37b91c83d18c43f4c5956c2d32b6bc)
2026-02-10 15:25:30 +03:00

49 lines
1.8 KiB
C#

using System.Numerics;
using Content.Client.UserInterface.Systems.Chat.Widgets;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.UserInterface.Screens;
[GenerateTypedNameReferences]
public sealed partial class SeparatedChatGameScreen : InGameScreen
{
public SeparatedChatGameScreen()
{
RobustXamlLoader.Load(this);
AutoscaleMaxResolution = new Vector2i(1080, 770);
SetAnchorPreset(ScreenContainer, LayoutPreset.Wide);
SetAnchorPreset(ViewportContainer, LayoutPreset.Wide);
SetAnchorPreset(MainViewport, LayoutPreset.Wide);
SetAnchorAndMarginPreset(Inventory, LayoutPreset.BottomLeft, margin: 5);
SetAnchorAndMarginPreset(TopLeftContainer, LayoutPreset.TopLeft, margin: 10);
SetAnchorAndMarginPreset(Ghost, LayoutPreset.BottomWide, margin: 80);
SetAnchorAndMarginPreset(Hotbar, LayoutPreset.BottomWide, margin: 5);
SetAnchorAndMarginPreset(Alerts, LayoutPreset.CenterRight, margin: 10);
SetAnchorAndMarginPreset(BottomRight, LayoutPreset.BottomRight, margin: 5); // WD EDIT
ScreenContainer.OnSplitResizeFinished += () =>
OnChatResized?.Invoke(new Vector2(ScreenContainer.SplitFraction, 0));
ViewportContainer.OnResized += ResizeActionContainer; // WD EDIT
}
// WD EDIT START
private void ResizeActionContainer()
{
float indent = 20;
Actions.ActionsContainer.MaxGridWidth = ViewportContainer.Size.X - indent;
}
// WD EDIT END
public override ChatBox ChatBox => GetWidget<ChatBox>()!;
public override void SetChatSize(Vector2 size)
{
ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
}
}