* attempt at moving MainViewport to UIWidget

* oldchat (prototype)

* separate oldchat and default ss14 HUD into their own files

* restores original default game screen logic and adds that logic into separated chat game screen

* hand reloading, several tweaks to port oldchat to main ss14 branch

oldchat is currently not selectable

* screen type cvar, gameplay state screen reloading/loading

* reload screen on ui layout cvar change

* fixes up basic reloading (HUD switching is still very bad)

* some UI widget reloading for main UI screen switching

* alert sync on screen change

* inventory reload

* hotbar margin fix

* chat bubbles above viewport

* whoops

* fixes ordering of speech bubble root

* should fix the chat focus issue (at least in-game, not lobby yet)

* should fix up the lobby/game chat focus

* fixes chat for lobby, turns lobby into a UI state

* viewport UI controller

* viewport ratio selection

* whoops

* adds the /tg/ widescreen ratio

* removes warning from inventory UI controller, adds background to separated chat game screen's chat portion

* menu button reload

* unload menu buttons only from gameplay state shutdown

* bugfix

* character button fix

* adds config options for viewport width/UI layout

* variable naming changes, get or null instead of get to avoid exceptions

* moves entity system get into controller
This commit is contained in:
Flipp Syder
2022-10-17 15:13:41 -07:00
committed by GitHub
parent 730eddf0ab
commit a3dafd88dc
37 changed files with 910 additions and 208 deletions

View File

@@ -7,14 +7,18 @@
xmlns:alerts="clr-namespace:Content.Client.UserInterface.Systems.Alerts.Widgets"
xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Ghost.Widgets"
xmlns:hotbar="clr-namespace:Content.Client.UserInterface.Systems.Hotbar.Widgets"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Name="DefaultHud"
VerticalExpand="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<LayoutContainer Name="ViewportContainer" HorizontalExpand="True" VerticalExpand="True">
<controls:MainViewport Name="MainViewport"/>
</LayoutContainer>
<menuBar:GameTopMenuBar Name="TopBar" Access="Protected" />
<widgets:GhostGui Name="Ghost" Access="Protected" />
<hotbar:HotbarGui Name="Hotbar" Access="Protected" />
<actions:ActionsBar Name="Actions" Access="Protected" />
<chat:ResizableChatBox Name="Chat" Access="Protected" Main="True" />
<chat:ResizableChatBox Name="Chat" Access="Protected" />
<alerts:AlertsUI Name="Alerts" Access="Protected" />
</screens:DefaultGameScreen>

View File

@@ -13,6 +13,8 @@ public sealed partial class DefaultGameScreen : UIScreen
AutoscaleMaxResolution = new Vector2i(1080, 770);
SetAnchorPreset(MainViewport, LayoutPreset.Wide);
SetAnchorPreset(ViewportContainer, LayoutPreset.Wide);
SetAnchorAndMarginPreset(TopBar, LayoutPreset.TopLeft, margin: 10);
SetAnchorAndMarginPreset(Actions, LayoutPreset.BottomLeft, margin: 10);
SetAnchorAndMarginPreset(Ghost, LayoutPreset.BottomWide, margin: 80);

View File

@@ -0,0 +1,13 @@
namespace Content.Client.UserInterface.Screens;
public enum ScreenType
{
/// <summary>
/// The modern SS14 user interface.
/// </summary>
Default,
/// <summary>
/// The classic SS13 user interface.
/// </summary>
Separated
}

View File

@@ -0,0 +1,35 @@
<screens:SeparatedChatGameScreen
xmlns="https://spacestation14.io"
xmlns:screens="clr-namespace:Content.Client.UserInterface.Screens"
xmlns:menuBar="clr-namespace:Content.Client.UserInterface.Systems.MenuBar.Widgets"
xmlns:actions="clr-namespace:Content.Client.UserInterface.Systems.Actions.Widgets"
xmlns:chat="clr-namespace:Content.Client.UserInterface.Systems.Chat.Widgets"
xmlns:alerts="clr-namespace:Content.Client.UserInterface.Systems.Alerts.Widgets"
xmlns:hotbar="clr-namespace:Content.Client.UserInterface.Systems.Hotbar.Widgets"
xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Ghost.Widgets"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
Name="SeparatedChatHud"
VerticalExpand="False"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<SplitContainer Name="ScreenContainer" HorizontalExpand="True" VerticalExpand="True">
<LayoutContainer Name="ViewportContainer" HorizontalExpand="True" VerticalExpand="True">
<controls:MainViewport Name="MainViewport"/>
<widgets:GhostGui Name="Ghost" Access="Protected" />
<hotbar:HotbarGui Name="Hotbar" Access="Protected" />
<actions:ActionsBar Name="Actions" Access="Protected" />
<alerts:AlertsUI Name="Alerts" Access="Protected" />
</LayoutContainer>
<PanelContainer HorizontalExpand="True">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="#2B2C3B" />
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical" HorizontalExpand="True" MinWidth="300" SeparationOverride="10" Margin="10">
<menuBar:GameTopMenuBar Name="TopBar" HorizontalExpand="True" Access="Protected" />
<chat:ChatBox VerticalExpand="True" HorizontalExpand="True" Name="Chat" Access="Protected" />
</BoxContainer>
</PanelContainer>
</SplitContainer>
</screens:SeparatedChatGameScreen>

View File

@@ -0,0 +1,24 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.UserInterface.Screens;
[GenerateTypedNameReferences]
public sealed partial class SeparatedChatGameScreen : UIScreen
{
public SeparatedChatGameScreen()
{
RobustXamlLoader.Load(this);
AutoscaleMaxResolution = new Vector2i(1080, 770);
SetAnchorPreset(ScreenContainer, LayoutPreset.Wide);
SetAnchorPreset(ViewportContainer, LayoutPreset.Wide);
SetAnchorPreset(MainViewport, LayoutPreset.Wide);
SetAnchorAndMarginPreset(Actions, LayoutPreset.BottomLeft, margin: 10);
SetAnchorAndMarginPreset(Ghost, LayoutPreset.BottomWide, margin: 80);
SetAnchorAndMarginPreset(Hotbar, LayoutPreset.BottomWide, margin: 5);
SetAnchorAndMarginPreset(Alerts, LayoutPreset.CenterRight, margin: 10);
}
}