2023-07-08 14:08:32 +10:00
|
|
|
using System.Numerics;
|
2023-03-06 11:06:57 -08:00
|
|
|
using Content.Client.UserInterface.Systems.Chat.Widgets;
|
2022-10-17 15:13:41 -07:00
|
|
|
using Robust.Client.AutoGenerated;
|
2023-03-06 11:06:57 -08:00
|
|
|
using Robust.Client.UserInterface.Controls;
|
2022-10-17 15:13:41 -07:00
|
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.UserInterface.Screens;
|
|
|
|
|
|
|
|
|
|
[GenerateTypedNameReferences]
|
2023-03-06 11:06:57 -08:00
|
|
|
public sealed partial class SeparatedChatGameScreen : InGameScreen
|
2022-10-17 15:13:41 -07:00
|
|
|
{
|
|
|
|
|
public SeparatedChatGameScreen()
|
|
|
|
|
{
|
|
|
|
|
RobustXamlLoader.Load(this);
|
|
|
|
|
|
|
|
|
|
AutoscaleMaxResolution = new Vector2i(1080, 770);
|
|
|
|
|
|
|
|
|
|
SetAnchorPreset(ScreenContainer, LayoutPreset.Wide);
|
|
|
|
|
SetAnchorPreset(ViewportContainer, LayoutPreset.Wide);
|
|
|
|
|
SetAnchorPreset(MainViewport, LayoutPreset.Wide);
|
2023-12-23 01:32:23 -05:00
|
|
|
SetAnchorAndMarginPreset(Inventory, LayoutPreset.BottomLeft, margin: 5);
|
2023-11-16 00:12:47 -05:00
|
|
|
SetAnchorAndMarginPreset(TopLeftContainer, LayoutPreset.TopLeft, margin: 10);
|
2022-10-17 15:13:41 -07:00
|
|
|
SetAnchorAndMarginPreset(Ghost, LayoutPreset.BottomWide, margin: 80);
|
|
|
|
|
SetAnchorAndMarginPreset(Hotbar, LayoutPreset.BottomWide, margin: 5);
|
|
|
|
|
SetAnchorAndMarginPreset(Alerts, LayoutPreset.CenterRight, margin: 10);
|
2023-03-06 11:06:57 -08:00
|
|
|
|
2023-10-09 03:28:04 +11:00
|
|
|
ScreenContainer.OnSplitResizeFinished += () =>
|
2023-03-06 11:06:57 -08:00
|
|
|
OnChatResized?.Invoke(new Vector2(ScreenContainer.SplitFraction, 0));
|
2024-09-02 22:12:11 +03:00
|
|
|
|
|
|
|
|
ViewportContainer.OnResized += ResizeActionContainer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ResizeActionContainer()
|
|
|
|
|
{
|
|
|
|
|
float indent = 20;
|
|
|
|
|
Actions.ActionsContainer.MaxGridWidth = ViewportContainer.Size.X - indent;
|
2023-03-06 11:06:57 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override ChatBox ChatBox => GetWidget<ChatBox>()!;
|
|
|
|
|
|
|
|
|
|
public override void SetChatSize(Vector2 size)
|
|
|
|
|
{
|
|
|
|
|
ScreenContainer.DesiredSplitCenter = size.X;
|
|
|
|
|
ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
|
2022-10-17 15:13:41 -07:00
|
|
|
}
|
|
|
|
|
}
|