Редизайн лобби 3
This commit is contained in:
parent
2990df0108
commit
cdf4e8dae0
13 changed files with 213 additions and 95 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using Content.Client._Sunrise.ServersHub;
|
||||
using Content.Client.Changelog;
|
||||
using Content.Client.Credits;
|
||||
using Content.Client.Stylesheets;
|
||||
using Content.Client.UserInterface.Systems.EscapeMenu;
|
||||
using Content.Client.UserInterface.Systems.Guidebook;
|
||||
using Content.Shared._Sunrise.SunriseCCVars;
|
||||
|
|
@ -22,13 +23,12 @@ namespace Content.Client.Info
|
|||
{
|
||||
var buttons = new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical
|
||||
Orientation = LayoutOrientation.Horizontal,
|
||||
};
|
||||
AddChild(buttons);
|
||||
|
||||
var uriOpener = IoCManager.Resolve<IUriOpener>();
|
||||
_cfg = IoCManager.Resolve<IConfigurationManager>();
|
||||
var serversHubManager = IoCManager.Resolve<ServersHubManager>();
|
||||
|
||||
var rulesButton = new Button() {Text = Loc.GetString("server-info-rules-button")};
|
||||
rulesButton.OnPressed += args => new RulesAndInfoWindow().Open();
|
||||
|
|
@ -39,22 +39,6 @@ namespace Content.Client.Info
|
|||
AddInfoButton("server-info-wiki-button", CCVars.InfoLinksWiki);
|
||||
AddInfoButton("server-info-forum-button", CCVars.InfoLinksForum);
|
||||
|
||||
// Sunrise-Start
|
||||
var roadmapButton = new Button
|
||||
{
|
||||
Disabled = true,
|
||||
Text = Loc.GetString("server-info-roadmap-button"),
|
||||
//StyleClasses = { StyleBase.ButtonCaution }
|
||||
};
|
||||
//roadmapButton.OnPressed += _ => UserInterfaceManager.GetUIController<RoadmapUIController>().ToggleRoadmap();
|
||||
buttons.AddChild(roadmapButton);
|
||||
|
||||
var serversHubButton = new Button() {Text = Loc.GetString("server-info-servers-hub-button")};
|
||||
serversHubButton.OnPressed += args => serversHubManager.OpenServersHub();
|
||||
buttons.AddChild(serversHubButton);
|
||||
|
||||
// Sunrise-End
|
||||
|
||||
var guidebookController = UserInterfaceManager.GetUIController<GuidebookUIController>();
|
||||
var guidebookButton = new Button() { Text = Loc.GetString("server-info-guidebook-button") };
|
||||
guidebookButton.OnPressed += _ =>
|
||||
|
|
@ -67,6 +51,25 @@ namespace Content.Client.Info
|
|||
changelogButton.OnPressed += args => UserInterfaceManager.GetUIController<ChangelogUIController>().ToggleWindow();
|
||||
buttons.AddChild(changelogButton);
|
||||
|
||||
var roadmapButton = new Button
|
||||
{
|
||||
Disabled = true,
|
||||
Text = Loc.GetString("server-info-roadmap-button"),
|
||||
StyleClasses = { StyleBase.ButtonCaution },
|
||||
};
|
||||
// Sunrise-Start
|
||||
//roadmapButton.OnPressed += _ => UserInterfaceManager.GetUIController<RoadmapUIController>().ToggleRoadmap();
|
||||
buttons.AddChild(roadmapButton);
|
||||
|
||||
var donateButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("server-info-donate-button"),
|
||||
Disabled = true,
|
||||
};
|
||||
//donateButton.OnPressed += args =>
|
||||
buttons.AddChild(donateButton);
|
||||
// Sunrise-End
|
||||
|
||||
void AddInfoButton(string loc, CVarDef<string> cVar)
|
||||
{
|
||||
var button = new Button { Text = Loc.GetString(loc) };
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Content.Client._Sunrise.ServersHub;
|
||||
using Robust.Client;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared.Configuration;
|
||||
|
|
@ -19,6 +20,7 @@ namespace Content.Client.Launcher
|
|||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
[Dependency] private readonly ServersHubManager _serversHubManager = default!;
|
||||
|
||||
private LauncherConnectingGui? _control;
|
||||
|
||||
|
|
@ -58,7 +60,7 @@ namespace Content.Client.Launcher
|
|||
|
||||
protected override void Startup()
|
||||
{
|
||||
_control = new LauncherConnectingGui(this, _random, _prototypeManager, _cfg);
|
||||
_control = new LauncherConnectingGui(this, _random, _prototypeManager, _cfg, _serversHubManager);
|
||||
|
||||
_userInterfaceManager.StateRoot.AddChild(_control);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,12 @@
|
|||
</PanelContainer>
|
||||
<PanelContainer StyleClasses="AngleRect" HorizontalExpand="True" Margin="0 10 0 0" Visible="False" Name="ServersHub" MinWidth="600" MinHeight="220">
|
||||
<BoxContainer Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True" Margin="3 3 3 3">
|
||||
<controls:StripeBack>
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Label HorizontalExpand="True" Text="Сейчас играет: 0/0" Name="ServersHubHeaderLabel" VAlign="Center"
|
||||
StyleClasses="LabelHeading" Align="Center"/>
|
||||
</BoxContainer>
|
||||
</controls:StripeBack>
|
||||
<ScrollContainer VerticalExpand="True" HScrollEnabled="False" HorizontalExpand="True">
|
||||
<serversHub:ServersHub Name="ServersHubBody" Access="Public" />
|
||||
</ScrollContainer>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
using System.Linq;
|
||||
using Content.Client._Sunrise.ServersHub;
|
||||
using Content.Client.Stylesheets;
|
||||
using Content.Shared._Sunrise.ServersHub;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Dataset;
|
||||
using Robust.Client.AutoGenerated;
|
||||
|
|
@ -28,14 +30,16 @@ namespace Content.Client.Launcher
|
|||
private readonly IRobustRandom _random;
|
||||
private readonly IPrototypeManager _prototype;
|
||||
private readonly IConfigurationManager _cfg;
|
||||
private readonly ServersHubManager _serversHubManager;
|
||||
|
||||
public LauncherConnectingGui(LauncherConnecting state, IRobustRandom random,
|
||||
IPrototypeManager prototype, IConfigurationManager config)
|
||||
IPrototypeManager prototype, IConfigurationManager config, ServersHubManager serversHubManager)
|
||||
{
|
||||
_state = state;
|
||||
_random = random;
|
||||
_prototype = prototype;
|
||||
_cfg = config;
|
||||
_serversHubManager = serversHubManager;
|
||||
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
|
|
@ -63,6 +67,15 @@ namespace Content.Client.Launcher
|
|||
var edim = IoCManager.Resolve<ExtendedDisconnectInformationManager>();
|
||||
edim.LastNetDisconnectedArgsChanged += LastNetDisconnectedArgsChanged;
|
||||
LastNetDisconnectedArgsChanged(edim.LastNetDisconnectedArgs);
|
||||
|
||||
_serversHubManager.ServersDataListChanged += RefreshServersHubHeader;
|
||||
}
|
||||
|
||||
private void RefreshServersHubHeader(List<ServerHubEntry> servers)
|
||||
{
|
||||
var totalPlayers = servers.Sum(server => server.CurrentPlayers);
|
||||
var maxPlayers = servers.Sum(server => server.MaxPlayers);
|
||||
ServersHubHeaderLabel.Text = $"Сейчас играет: {totalPlayers}/{maxPlayers}";
|
||||
}
|
||||
|
||||
// Just button, there's only one at once anyways :)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using System.Linq;
|
||||
using Content.Client._Sunrise.Latejoin;
|
||||
using Content.Client._Sunrise.ServersHub;
|
||||
using Content.Client.Audio;
|
||||
using Content.Client.GameTicking.Managers;
|
||||
using Content.Client.LateJoin;
|
||||
|
|
@ -15,6 +17,7 @@ using Robust.Shared.Timing;
|
|||
using Robust.Shared.Utility;
|
||||
using Content.Client.Changelog;
|
||||
using Content.Client.Parallax.Managers;
|
||||
using Content.Shared._Sunrise.ServersHub;
|
||||
using Content.Shared._Sunrise.SunriseCCVars;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.ContentPack;
|
||||
|
|
@ -34,6 +37,9 @@ namespace Content.Client.Lobby
|
|||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IVoteManager _voteManager = default!;
|
||||
[Dependency] private readonly IParallaxManager _parallaxManager = default!;
|
||||
[Dependency] private readonly ISerializationManager _serialization = default!;
|
||||
[Dependency] private readonly IResourceManager _resource = default!;
|
||||
[Dependency] private readonly ServersHubManager _serversHubManager = default!;
|
||||
|
||||
private ClientGameTicker _gameTicker = default!;
|
||||
private ContentAudioSystem _contentAudioSystem = default!;
|
||||
|
|
@ -63,6 +69,16 @@ namespace Content.Client.Lobby
|
|||
//Lobby.ServerName.Text = _baseClient.GameInfo?.ServerName; //The eye of refactor gazes upon you...
|
||||
UpdateLobbyUi();
|
||||
|
||||
Lobby!.LocalChangelogBody.CleanChangelog();
|
||||
|
||||
var sunriseChangelog = new ResPath("/Changelog/ChangelogSunrise.yml");
|
||||
|
||||
var yamlData = _resource.ContentFileReadYaml(sunriseChangelog);
|
||||
|
||||
var node = yamlData.Documents[0].RootNode.ToDataNodeCast<MappingDataNode>();
|
||||
var changelog = _serialization.Read<ChangelogManager.Changelog>(node, notNullableOverride: true);
|
||||
Lobby!.LocalChangelogBody.PopulateChangelog(changelog);
|
||||
|
||||
// Sunrise-end
|
||||
|
||||
Lobby.CharacterPreview.CharacterSetupButton.OnPressed += OnSetupPressed;
|
||||
|
|
@ -72,6 +88,8 @@ namespace Content.Client.Lobby
|
|||
_gameTicker.InfoBlobUpdated += UpdateLobbyUi;
|
||||
_gameTicker.LobbyStatusUpdated += LobbyStatusUpdated;
|
||||
_gameTicker.LobbyLateJoinStatusUpdated += LobbyLateJoinStatusUpdated;
|
||||
|
||||
_serversHubManager.ServersDataListChanged += RefreshServersHubHeader;
|
||||
}
|
||||
|
||||
protected override void Shutdown()
|
||||
|
|
@ -90,6 +108,15 @@ namespace Content.Client.Lobby
|
|||
Lobby!.ReadyButton.OnToggled -= OnReadyToggled;
|
||||
|
||||
Lobby = null;
|
||||
|
||||
_serversHubManager.ServersDataListChanged -= RefreshServersHubHeader;
|
||||
}
|
||||
|
||||
private void RefreshServersHubHeader(List<ServerHubEntry> servers)
|
||||
{
|
||||
var totalPlayers = _serversHubManager.ServersDataList.Sum(server => server.CurrentPlayers);
|
||||
var maxPlayers = _serversHubManager.ServersDataList.Sum(server => server.MaxPlayers);
|
||||
Lobby!.ServersHubHeaderLabel.Text = $"Сейчас играет: {totalPlayers}/{maxPlayers}";
|
||||
}
|
||||
|
||||
public void SwitchState(LobbyGui.LobbyGuiState state)
|
||||
|
|
|
|||
|
|
@ -8,25 +8,34 @@
|
|||
xmlns:style="clr-namespace:Content.Client.Stylesheets"
|
||||
xmlns:lobbyUi="clr-namespace:Content.Client.Lobby.UI"
|
||||
xmlns:info="clr-namespace:Content.Client.Info"
|
||||
xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Chat.Widgets">
|
||||
xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Chat.Widgets"
|
||||
xmlns:serversHub="clr-namespace:Content.Client._Sunrise.ServersHub"
|
||||
xmlns:changelog="clr-namespace:Content.Client.Changelog">
|
||||
<!-- Background -->
|
||||
<TextureRect Access="Public" VerticalExpand="True" HorizontalExpand="True" Name="Background" Stretch="KeepAspectCovered" />
|
||||
<BoxContainer Name="MainContainer" VerticalExpand="True" HorizontalExpand="True" Orientation="Horizontal"
|
||||
Margin="10 10 10 10" SeparationOverride="2">
|
||||
<!-- LHS Controls -->
|
||||
<Control Name="DefaultState" VerticalExpand="True" HorizontalExpand="True">
|
||||
<BoxContainer Orientation="Vertical" >
|
||||
<PanelContainer Name="CenterTopSide" StyleClasses="AngleRect" HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||
<BoxContainer Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" >
|
||||
<AnimatedTextureRect Name="LobbyImage" VerticalAlignment="Center" HorizontalAlignment="Center" Access="Public" />
|
||||
</BoxContainer>
|
||||
<BoxContainer Orientation="Vertical" HorizontalAlignment="Left" HorizontalExpand="True">
|
||||
<PanelContainer Name="LeftTopPanel" StyleClasses="AngleRect" >
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||
<Label Name="ServerName" Access="Public" StyleClasses="LabelHeadingBigger" VAlign="Center"
|
||||
HorizontalExpand="True" HorizontalAlignment="Center" Text="Добро пожаловать на Sunrise" />
|
||||
<controls:HLine Color="{x:Static style:StyleNano.NanoGold}" Thickness="2" />
|
||||
<info:LinkBanner Name="LinkBanner" HorizontalAlignment="Center"
|
||||
Margin="3 3 3 3" />
|
||||
<controls:StripeBack>
|
||||
<BoxContainer Orientation="Horizontal" Margin="3 3 3 3"
|
||||
HorizontalExpand="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<cc:UICommandButton Command="observe"
|
||||
Name="ObserveButton"
|
||||
Access="Public"
|
||||
HorizontalExpand="True"
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="{Loc 'ui-lobby-observe-button'}"
|
||||
StyleClasses="ButtonBig"
|
||||
MinWidth="200"
|
||||
|
|
@ -35,11 +44,15 @@
|
|||
Access="Public"
|
||||
ToggleMode="True"
|
||||
MinWidth="200"
|
||||
HorizontalExpand="True"
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="{Loc 'ui-lobby-ready-up-button'}"
|
||||
StyleClasses="ButtonBig" />
|
||||
<cc:CommandButton Command="ghostroles"
|
||||
Name="GhostRolesButton"
|
||||
Access="Public"
|
||||
HorizontalExpand="True"
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="{Loc 'Роли призраков'}"
|
||||
StyleClasses="ButtonBig"
|
||||
MinWidth="200" />
|
||||
|
|
@ -47,14 +60,51 @@
|
|||
</controls:StripeBack>
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
<AnimatedTextureRect Name="LobbyImage" Margin="0 15 0 0" VerticalAlignment="Top" HorizontalAlignment="Center" Access="Public" />
|
||||
<BoxContainer Orientation="Vertical" SeparationOverride="4" Name="VoteContainer"
|
||||
Access="Public" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 8" />
|
||||
</BoxContainer>
|
||||
<BoxContainer Orientation="Vertical" HorizontalAlignment="Right">
|
||||
<PanelContainer StyleClasses="AngleRect" HorizontalAlignment="Right" Name="RightTopPanel" VerticalAlignment="Top">
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True"
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" VerticalAlignment="Bottom" HorizontalAlignment="Left">
|
||||
<PanelContainer Name="LeftBottomPanel" StyleClasses="AngleRect" VerticalExpand="True" SetWidth="500"
|
||||
VerticalAlignment="Bottom" HorizontalExpand="True">
|
||||
<BoxContainer Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"
|
||||
HorizontalExpand="True">
|
||||
<BoxContainer Orientation="Vertical" VerticalExpand="True" VerticalAlignment="Top">
|
||||
<controls:StripeBack>
|
||||
<BoxContainer Orientation="Horizontal" Name="ServersHubHeader" MouseFilter="Pass" >
|
||||
<Label HorizontalExpand="True" Name="ServersHubHeaderLabel" Access="Public"
|
||||
Text="Сейчас играет: 0/0" VAlign="Center" StyleClasses="LabelHeading"
|
||||
Align="Center"/>
|
||||
</BoxContainer>
|
||||
</controls:StripeBack>
|
||||
<BoxContainer Orientation="Vertical" Name="ServersHubContent" HorizontalExpand="True" VerticalExpand="True"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Bottom" MinHeight="150">
|
||||
<serversHub:ServersHub Name="ServersHubBody" Access="Public" HorizontalExpand="True" VerticalExpand="True" />
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
<BoxContainer Orientation="Vertical" VerticalExpand="True" MaxWidth="480" VerticalAlignment="Top">
|
||||
<controls:StripeBack VerticalAlignment="Top">
|
||||
<BoxContainer Orientation="Horizontal" Name="ChangelogHeader" MouseFilter="Pass">
|
||||
<Label HorizontalExpand="True" Text="{Loc 'changelog-sunrise-window-title'}"
|
||||
VAlign="Center" StyleClasses="LabelHeading" Align="Center"/>
|
||||
</BoxContainer>
|
||||
</controls:StripeBack>
|
||||
<BoxContainer Orientation="Vertical" Name="ChangelogContent"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Top" MinHeight="200">
|
||||
<changelog:ChangelogTab Name="LocalChangelogBody" RectClipContent="True" Access="Public" VerticalExpand="True" />
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
<PanelContainer Name="LobbySongPanel" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" HorizontalExpand="True"
|
||||
StyleClasses="AngleRect" VerticalExpand="True" Margin="0 10 0 0">
|
||||
<RichTextLabel Name="LobbySong" Access="Public" HorizontalAlignment="Center" VerticalAlignment="Bottom"
|
||||
VerticalExpand="True" HorizontalExpand="True"/>
|
||||
</PanelContainer>
|
||||
</BoxContainer>
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" HorizontalAlignment="Right">
|
||||
<PanelContainer Name="RightTopPanel" StyleClasses="AngleRect" VerticalAlignment="Top">
|
||||
<BoxContainer Orientation="Horizontal" HorizontalExpand="True"
|
||||
HorizontalAlignment="Right" SizeFlagsStretchRatio="1">
|
||||
<Button Name="DonateButton" Access="Public" Text="{Loc 'server-info-donate-button'}"
|
||||
StyleClasses="ButtonBig" Disabled="True"/>
|
||||
<Button Name="AHelpButton" Access="Public" Text="{Loc 'ui-lobby-ahelp-button'}"
|
||||
StyleClasses="ButtonBig"/>
|
||||
<vote:VoteCallMenuButton Name="CallVoteButton" StyleClasses="ButtonBig" />
|
||||
|
|
@ -64,68 +114,46 @@
|
|||
StyleClasses="ButtonBig"/>
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
</BoxContainer>
|
||||
<BoxContainer Orientation="Vertical" HorizontalAlignment="Left" VerticalExpand="True" HorizontalExpand="True">
|
||||
<PanelContainer StyleClasses="AngleRect" HorizontalAlignment="Left" Name="LeftTopPanel" VerticalAlignment="Top">
|
||||
<info:LinkBanner Name="LinkBanner" VerticalExpand="false" HorizontalAlignment="Center"
|
||||
Margin="3 3 3 3" />
|
||||
</PanelContainer>
|
||||
<BoxContainer Orientation="Vertical" SeparationOverride="4" Name="VoteContainer"
|
||||
Access="Public" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 8" />
|
||||
<PanelContainer Name="LobbySongPanel" HorizontalAlignment="Left" VerticalAlignment="Bottom" HorizontalExpand="True"
|
||||
StyleClasses="AngleRect" VerticalExpand="True" Margin="0 10 0 0">
|
||||
<RichTextLabel Name="LobbySong" Access="Public" HorizontalAlignment="Center" VerticalAlignment="Bottom"
|
||||
VerticalExpand="True" HorizontalExpand="True"/>
|
||||
</PanelContainer>
|
||||
</BoxContainer>
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalAlignment="Bottom" HorizontalAlignment="Right">
|
||||
<PanelContainer Name="ServerInfoPanel" StyleClasses="AngleRect" VerticalExpand="True"
|
||||
<PanelContainer Name="RightBottomPanel" MinWidth="500" StyleClasses="AngleRect" VerticalExpand="True"
|
||||
VerticalAlignment="Bottom" HorizontalExpand="True">
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
|
||||
<controls:StripeBack>
|
||||
<BoxContainer Orientation="Horizontal" Name="ServerInfoHeader" MouseFilter="Pass">
|
||||
<Label HorizontalExpand="True" Text="{Loc 'ui-lobby-server-info-block'}"
|
||||
VAlign="Center" StyleClasses="LabelHeading" Align="Center"/>
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
|
||||
<controls:StripeBack>
|
||||
<BoxContainer Orientation="Horizontal" Name="ServerInfoHeader" MouseFilter="Pass">
|
||||
<Label HorizontalExpand="True" Text="{Loc 'ui-lobby-server-info-block'}"
|
||||
VAlign="Center" StyleClasses="LabelHeading" Align="Center"/>
|
||||
</BoxContainer>
|
||||
</controls:StripeBack>
|
||||
<BoxContainer Orientation="Vertical" Name="ServerInfoContent" >
|
||||
<info:ServerInfo Name="ServerInfo" Access="Public" MinSize="0 30" VerticalExpand="false"
|
||||
Margin="3 3 3 3" MaxWidth="400" HorizontalAlignment="Left" />
|
||||
<Label Name="StationTime" Access="Public" FontColorOverride="{x:Static maths:Color.LightGray}"
|
||||
Margin="3 3 3 3" HorizontalAlignment="Left" />
|
||||
</BoxContainer>
|
||||
</controls:StripeBack>
|
||||
<BoxContainer Orientation="Vertical" Name="ServerInfoContent" Visible="False">
|
||||
<info:ServerInfo Name="ServerInfo" Access="Public" MinSize="0 30" VerticalExpand="false"
|
||||
Margin="3 3 3 3" MaxWidth="400" HorizontalAlignment="Left" />
|
||||
<Label Name="StationTime" Access="Public" FontColorOverride="{x:Static maths:Color.LightGray}"
|
||||
Margin="3 3 3 3" HorizontalAlignment="Left" />
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
<PanelContainer Name="CharacterInfoPanel" StyleClasses="AngleRect" VerticalExpand="True"
|
||||
VerticalAlignment="Bottom" HorizontalExpand="True" Margin="0 10 0 0">
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" HorizontalAlignment="Stretch"
|
||||
VerticalExpand="True" SizeFlagsStretchRatio="2" >
|
||||
<BoxContainer Orientation="Vertical" MinSize="0 40" HorizontalExpand="True"
|
||||
HorizontalAlignment="Stretch" SizeFlagsStretchRatio="3">
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" HorizontalAlignment="Stretch"
|
||||
VerticalExpand="True" >
|
||||
<controls:StripeBack Name="CharacterInfoHeader" MouseFilter="Pass">
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Label HorizontalExpand="True" Text="{Loc 'lobby-character-preview-panel-header'}"
|
||||
VAlign="Center" StyleClasses="LabelHeading" Align="Center"/>
|
||||
</BoxContainer>
|
||||
</controls:StripeBack>
|
||||
<BoxContainer Orientation="Vertical" Name="CharacterInfoContent" Visible="False">
|
||||
<BoxContainer Orientation="Vertical" Name="CharacterInfoContent">
|
||||
<lobbyUi:LobbyCharacterPreviewPanel Name="CharacterPreview" HorizontalExpand="True"
|
||||
HorizontalAlignment="Stretch" Access="Public" />
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
<PanelContainer Name="ChatPanel" StyleClasses="AngleRect" VerticalExpand="True"
|
||||
VerticalAlignment="Bottom" HorizontalExpand="True" Margin="0 10 0 0">
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" >
|
||||
<controls:StripeBack Name="ChatHeader" MouseFilter="Pass">
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Label HorizontalExpand="True" Text="{Loc 'Чат'}"
|
||||
VAlign="Center" StyleClasses="LabelHeading" Align="Center"/>
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" >
|
||||
<controls:StripeBack Name="ChatHeader" MouseFilter="Pass">
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Label HorizontalExpand="True" Text="{Loc 'Чат'}"
|
||||
VAlign="Center" StyleClasses="LabelHeading" Align="Center"/>
|
||||
</BoxContainer>
|
||||
</controls:StripeBack>
|
||||
<BoxContainer Name="ChatContent" HorizontalExpand="True">
|
||||
<widgets:ChatBox Name="Chat" Access="Public" MinWidth="300" MinHeight="300" HorizontalExpand="True" VerticalExpand="True" Margin="3 3 3 3" />
|
||||
</BoxContainer>
|
||||
</controls:StripeBack>
|
||||
<BoxContainer Name="ChatContent" MinWidth="300" MinHeight="300" HorizontalExpand="True" Visible="False">
|
||||
<widgets:ChatBox Name="Chat" Access="Public" HorizontalExpand="True" VerticalExpand="True" Margin="3 3 3 3" />
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
|
|
|
|||
|
|
@ -70,6 +70,22 @@ namespace Content.Client.Lobby.UI
|
|||
CharacterInfoContent.Visible = !CharacterInfoContent.Visible;
|
||||
};
|
||||
|
||||
ServersHubHeader.OnKeyBindUp += args =>
|
||||
{
|
||||
if (args.Function != EngineKeyFunctions.Use)
|
||||
return;
|
||||
|
||||
ServersHubContent.Visible = !ServersHubContent.Visible;
|
||||
};
|
||||
|
||||
ChangelogHeader.OnKeyBindUp += args =>
|
||||
{
|
||||
if (args.Function != EngineKeyFunctions.Use)
|
||||
return;
|
||||
|
||||
ChangelogContent.Visible = !ChangelogContent.Visible;
|
||||
};
|
||||
|
||||
// Sunrise-start
|
||||
Offset = new Vector2(_random.Next(0, 1000), _random.Next(0, 1000));
|
||||
|
||||
|
|
@ -84,15 +100,13 @@ namespace Content.Client.Lobby.UI
|
|||
};
|
||||
_back.SetPatchMargin(StyleBox.Margin.All, 10);
|
||||
|
||||
CenterTopSide.PanelOverride = _back;
|
||||
LeftTopPanel.PanelOverride = _back;
|
||||
|
||||
RightTopPanel.PanelOverride = _back;
|
||||
|
||||
CharacterInfoPanel.PanelOverride = _back;
|
||||
RightBottomPanel.PanelOverride = _back;
|
||||
|
||||
ChatPanel.PanelOverride = _back;
|
||||
|
||||
ServerInfoPanel.PanelOverride = _back;
|
||||
LeftBottomPanel.PanelOverride = _back;
|
||||
|
||||
LeftTopPanel.PanelOverride = _back;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
<Control xmlns="https://spacestation14.io"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls">
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<controls:StripeBack>
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Label HorizontalExpand="True" Name="TotalPlayers" VAlign="Center"
|
||||
StyleClasses="LabelHeading" Align="Center"/>
|
||||
</BoxContainer>
|
||||
</controls:StripeBack>
|
||||
<controls:ListContainer Name="ServersList" Access="Public" HorizontalExpand="True"/>
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
MinSize="300 100">
|
||||
<BoxContainer Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True">
|
||||
<ScrollContainer HScrollEnabled="False" HorizontalExpand="True" VerticalExpand="True">
|
||||
<controls:ListContainer Name="ServersList" Access="Public" VerticalExpand="True" HorizontalExpand="True"/>
|
||||
</ScrollContainer>
|
||||
</BoxContainer>
|
||||
</Control>
|
||||
|
|
|
|||
|
|
@ -45,11 +45,6 @@ namespace Content.Client._Sunrise.ServersHub
|
|||
|
||||
ServersList.PopulateList(sortedServers.Select(info => new ServerListData(info))
|
||||
.ToList());
|
||||
|
||||
var totalPlayers = servers.Sum(server => server.CurrentPlayers);
|
||||
var maxPlayers = servers.Sum(server => server.MaxPlayers);
|
||||
// Очень круто показывать общее количество игроков со всех серверов, сразу видно какой проект бальшой.
|
||||
TotalPlayers.Text = $"Сейчас играет: {totalPlayers}/{maxPlayers}";
|
||||
}
|
||||
|
||||
private int Compare(ServerHubEntry x, ServerHubEntry y)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
using System.Linq;
|
||||
using Content.Shared._Sunrise.ServersHub;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client._Sunrise.ServersHub;
|
||||
|
||||
|
|
@ -26,6 +28,9 @@ public partial class ServersHubManager
|
|||
_menu = new ServersHubUi();
|
||||
_menu.OnClose += _menu.Close;
|
||||
_menu.OpenCentered();
|
||||
var totalPlayers = ServersDataList.Sum(server => server.CurrentPlayers);
|
||||
var maxPlayers = ServersDataList.Sum(server => server.MaxPlayers);
|
||||
_menu!.RefreshHeader(totalPlayers, maxPlayers);
|
||||
}
|
||||
|
||||
private void OnServersDataChanged(MsgFullServerHubList msg)
|
||||
|
|
@ -34,5 +39,8 @@ public partial class ServersHubManager
|
|||
// и его можно было отобразить после отключения или бана.
|
||||
ServersDataList = msg.ServersHubEntries;
|
||||
ServersDataListChanged?.Invoke(ServersDataList);
|
||||
var totalPlayers = ServersDataList.Sum(server => server.CurrentPlayers);
|
||||
var maxPlayers = ServersDataList.Sum(server => server.MaxPlayers);
|
||||
_menu!.RefreshHeader(totalPlayers, maxPlayers);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
<DefaultWindow xmlns="https://spacestation14.io"
|
||||
xmlns:serversHub="clr-namespace:Content.Client._Sunrise.ServersHub"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
Title="Servers Hub"
|
||||
MinSize="650 300">
|
||||
<BoxContainer Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True" Margin="3 3 3 3">
|
||||
<controls:StripeBack>
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Label HorizontalExpand="True" Text="Сейчас играет: 0/0" Name="ServersHubHeaderLabel" VAlign="Center"
|
||||
StyleClasses="LabelHeading" Align="Center"/>
|
||||
</BoxContainer>
|
||||
</controls:StripeBack>
|
||||
<ScrollContainer VerticalExpand="True" HScrollEnabled="False" HorizontalExpand="True" MinWidth="300">
|
||||
<serversHub:ServersHub Name="ServersHubBody" Access="Public" />
|
||||
</ScrollContainer>
|
||||
|
|
|
|||
|
|
@ -13,4 +13,9 @@ public sealed partial class ServersHubUi : DefaultWindow
|
|||
|
||||
// Я не ебу что тут вообще еще должно быть, вся логика один хуй лежит внутри Control
|
||||
}
|
||||
|
||||
public void RefreshHeader(int totalPlayers, int maxPlayers)
|
||||
{
|
||||
ServersHubHeaderLabel.Text = $"Сейчас играет: {totalPlayers}/{maxPlayers}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1470,3 +1470,16 @@
|
|||
id: 111
|
||||
time: '2024-07-05T10:44:44.0000000+00:00'
|
||||
url: https://github.com/space-sunrise/space-station-14/pull/174
|
||||
- author: VigersRay
|
||||
changes:
|
||||
- message: "\u0412\u0435\u0440\u043D\u0443\u043B \u0432 \u043B\u043E\u0431\u0431\
|
||||
\u0438 \u0447\u0435\u0439\u043D\u0436\u043B\u043E\u0433 \u0438 \u0445\u0430\u0431\
|
||||
\ \u0441\u0435\u0440\u0432\u0435\u0440\u043E\u0432."
|
||||
type: Tweak
|
||||
- message: "\u0422\u0435\u043F\u0435\u0440\u044C \u0432\u044B \u043C\u043E\u0436\
|
||||
\u0435\u0442\u0435 \u0441\u0432\u043E\u0440\u0430\u0447\u0438\u0432\u0430\u0442\
|
||||
\u044C \u043D\u0435 \u043D\u0443\u0436\u043D\u044B\u0435 \u0432\u0430\u043C\
|
||||
\ \u043E\u043A\u043D\u0430 \u0432 \u043B\u043E\u0431\u0431\u0438."
|
||||
type: Tweak
|
||||
id: 112
|
||||
time: '2024-07-05T17:02:22.497418+00:00'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue