Store chat size (#14299)

This commit is contained in:
Flipp Syder
2023-03-06 11:06:57 -08:00
committed by GitHub
parent 11d4dec18f
commit ec3a519a46
10 changed files with 224 additions and 19 deletions

View File

@@ -1,11 +1,13 @@
using Content.Client.UserInterface.Systems.Chat.Widgets;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.UserInterface.Screens;
[GenerateTypedNameReferences]
public sealed partial class SeparatedChatGameScreen : UIScreen
public sealed partial class SeparatedChatGameScreen : InGameScreen
{
public SeparatedChatGameScreen()
{
@@ -20,5 +22,16 @@ public sealed partial class SeparatedChatGameScreen : UIScreen
SetAnchorAndMarginPreset(Ghost, LayoutPreset.BottomWide, margin: 80);
SetAnchorAndMarginPreset(Hotbar, LayoutPreset.BottomWide, margin: 5);
SetAnchorAndMarginPreset(Alerts, LayoutPreset.CenterRight, margin: 10);
ScreenContainer.OnSplitResizeFinish += (first, second) =>
OnChatResized?.Invoke(new Vector2(ScreenContainer.SplitFraction, 0));
}
public override ChatBox ChatBox => GetWidget<ChatBox>()!;
public override void SetChatSize(Vector2 size)
{
ScreenContainer.DesiredSplitCenter = size.X;
ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
}
}