From 7872502bf8f0eeca0a4a04f14171b5a6a412e6c2 Mon Sep 17 00:00:00 2001 From: rhailrake <49613070+rhailrake@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:54:38 +0000 Subject: [PATCH] - add: new lobby and ui tweaks. (#7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * base * arrow pointer for buttons * some progress for text buttons, need cleaning * fixed observe button, remove fraction * just for now * ui tweaks * more ui tweaks * feat: ченджлог в лобби --------- Co-authored-by: Remuchi --- Content.Client/Access/AccessOverlay.cs | 2 +- .../Administration/AdminNameOverlay.cs | 2 +- .../UI/CustomControls/HSeparator.cs | 2 +- .../CustomControls/PlayerListControl.xaml.cs | 2 +- .../UI/CustomControls/VSeparator.cs | 2 +- .../SpawnExplosion/ExplosionDebugOverlay.cs | 2 +- .../UI/Tabs/PlayerTab/PlayerTab.xaml.cs | 4 +- Content.Client/Content.Client.csproj | 4 - Content.Client/Fluids/PuddleOverlay.cs | 2 +- Content.Client/Lobby/LobbyState.cs | 180 ++++++++++---- .../Lobby/UI/LobbyCharacterPreviewPanel.cs | 33 +-- Content.Client/Lobby/UI/LobbyGui.xaml | 233 +++++++++++------- Content.Client/Lobby/UI/LobbyGui.xaml.cs | 40 +-- Content.Client/NPC/HTN/HTNOverlay.cs | 2 +- .../NodeContainer/NodeVisualizationOverlay.cs | 2 +- .../PDA/PdaNavigationButton.xaml.cs | 2 +- Content.Client/PDA/PdaProgramItem.xaml.cs | 2 +- Content.Client/PDA/PdaSettingsButton.xaml.cs | 2 +- .../UI/ParticleAcceleratorControlMenu.cs | 2 +- Content.Client/Popups/PopupOverlay.cs | 6 +- .../Preferences/UI/CharacterSetupGui.xaml.cs | 2 +- .../UI/HumanoidProfileEditor.xaml.cs | 4 +- .../Overlays/RadiationDebugOverlay.cs | 2 +- Content.Client/Stylesheets/StyleBase.cs | 27 +- Content.Client/Stylesheets/StyleNano.cs | 97 +++++--- Content.Client/Stylesheets/StyleSpace.cs | 37 +-- .../UserInterface/Controls/MenuButton.cs | 10 +- .../Systems/Atmos/GasTank/GasTankWindow.cs | 2 +- .../Chat/Controls/ChannelFilterButton.cs | 6 +- .../Systems/Chat/Widgets/ChatBox.xaml | 2 +- Content.Client/Wires/UI/WiresMenu.cs | 2 +- .../_Ohio/Buttons/OhioCommandButton.cs | 34 +++ .../_Ohio/Buttons/OhioLobbyButton.cs | 211 ++++++++++++++++ .../_Ohio/Buttons/OhioLobbyTextButtons.cs | 132 ++++++++++ .../_Ohio/Buttons/OhioUICommandButton.cs | 18 ++ .../_Ohio/UI/AnimatedBackgroundControl.cs | 91 +++++++ Content.Client/_Ohio/UI/OhioRichTextLabel.cs | 30 +++ .../_White/Rules/RulesWikiSection.xaml | 2 +- Content.Server/Content.Server.csproj | 1 + .../GameTicking/GameTicker.Spawning.cs | 6 +- Content.Shared/CCVar/CCVars.cs | 6 +- Content.Shared/Chat/ChatChannelExtensions.cs | 2 +- Resources/Audio/Lobby/bobby.ogg | Bin 0 -> 806211 bytes .../Fonts/IBMPlexMono/IBMPlexMono-Bold.ttf | Bin 0 -> 135932 bytes .../IBMPlexMono/IBMPlexMono-BoldItalic.ttf | Bin 0 -> 142636 bytes .../Fonts/IBMPlexMono/IBMPlexMono-Italic.ttf | Bin 0 -> 142032 bytes .../Fonts/IBMPlexMono/IBMPlexMono-Regular.ttf | Bin 0 -> 133720 bytes Resources/Fonts/IBMPlexMono/LICENSE_OFL.txt | 93 +++++++ .../en-US/changelog/changelog-window.ftl | 1 + Resources/Locale/ru-RU/chat/ui/chat-box.ftl | 2 +- .../Locale/ru-RU/game-ticking/game-ticker.ftl | 6 +- Resources/Locale/ru-RU/info/rules.ftl | 4 +- .../Prototypes/SoundCollections/lobby.yml | 3 +- Resources/Prototypes/fonts.yml | 8 +- .../Interface/Nano/chat_sub_background.png | Bin 140 -> 88 bytes .../Interface/Nano/checkbox_checked.svg | 53 +++- .../Nano/checkbox_checked.svg.96dpi.png | Bin 247 -> 333 bytes .../Interface/Nano/checkbox_unchecked.svg | 39 ++- .../Nano/checkbox_unchecked.svg.96dpi.png | Bin 204 -> 252 bytes .../Nano/light_panel_background_bordered.png | Bin 140 -> 88 bytes .../Textures/Interface/Nano/lineedit.png | Bin 163 -> 139 bytes .../Textures/Interface/Nano/lobby_gay.png | Bin 0 -> 1023 bytes .../Textures/Interface/Nano/stripeback.svg | 42 ++-- .../Interface/Nano/stripeback.svg.96dpi.png | Bin 202 -> 251 bytes .../Interface/Nano/tabcontainer_panel.png | Bin 155 -> 123 bytes Resources/Textures/Interface/Nano/tooltip.png | Bin 155 -> 102 bytes ...transparent_window_background_bordered.png | Bin 147 -> 88 bytes Resources/Textures/Interface/Nano/whisper.png | Bin 1643 -> 103 bytes .../Interface/Nano/window_background.png | Bin 141 -> 105 bytes .../Nano/window_background_bordered.png | Bin 140 -> 88 bytes .../Textures/Interface/Nano/window_header.png | Bin 131 -> 81 bytes .../Interface/Nano/window_header_alert.png | Bin 131 -> 85 bytes Resources/Textures/Ohio/Lobby/anim.rsi/1.png | Bin 0 -> 930828 bytes .../Textures/Ohio/Lobby/anim.rsi/meta.json | 21 ++ Resources/Textures/Ohio/Lobby/arrow.png | Bin 0 -> 200 bytes .../Lobby/character_setup/character_setup.png | Bin 0 -> 27742 bytes .../character_setup_highlighted.png | Bin 0 -> 27744 bytes .../character_setup_pressed.png | Bin 0 -> 27744 bytes Resources/Textures/Ohio/Lobby/disabled.png | Bin 0 -> 451 bytes .../Textures/Ohio/Lobby/join/join_game.png | Bin 0 -> 27483 bytes .../Ohio/Lobby/join/join_game_highlighted.png | Bin 0 -> 27487 bytes .../Ohio/Lobby/join/join_game_pressed.png | Bin 0 -> 27487 bytes Resources/Textures/Ohio/Lobby/moon.png | Bin 0 -> 2658 bytes .../Textures/Ohio/Lobby/observe/observe.png | Bin 0 -> 27471 bytes .../Ohio/Lobby/observe/observe_disabled.png | Bin 0 -> 26574 bytes .../Lobby/observe/observe_highlighted.png | Bin 0 -> 27473 bytes .../Ohio/Lobby/observe/observe_pressed.png | Bin 0 -> 27473 bytes .../Textures/Ohio/Lobby/ready/not_ready.png | Bin 0 -> 27513 bytes .../Lobby/ready/not_ready_highlighted.png | Bin 0 -> 27515 bytes .../Ohio/Lobby/ready/not_ready_pressed.png | Bin 0 -> 27515 bytes Resources/Textures/Ohio/Lobby/ready/ready.png | Bin 0 -> 27440 bytes .../Ohio/Lobby/ready/ready_highlighted.png | Bin 0 -> 27440 bytes .../Ohio/Lobby/ready/ready_pressed.png | Bin 0 -> 27440 bytes .../Textures/Ohio/Lobby/settings/settings.png | Bin 0 -> 27343 bytes .../Lobby/settings/settings_highlighted.png | Bin 0 -> 27344 bytes .../Ohio/Lobby/settings/settings_pressed.png | Bin 0 -> 27344 bytes Resources/manifest.yml | 4 +- 97 files changed, 1187 insertions(+), 339 deletions(-) create mode 100644 Content.Client/_Ohio/Buttons/OhioCommandButton.cs create mode 100644 Content.Client/_Ohio/Buttons/OhioLobbyButton.cs create mode 100644 Content.Client/_Ohio/Buttons/OhioLobbyTextButtons.cs create mode 100644 Content.Client/_Ohio/Buttons/OhioUICommandButton.cs create mode 100644 Content.Client/_Ohio/UI/AnimatedBackgroundControl.cs create mode 100644 Content.Client/_Ohio/UI/OhioRichTextLabel.cs create mode 100644 Resources/Audio/Lobby/bobby.ogg create mode 100644 Resources/Fonts/IBMPlexMono/IBMPlexMono-Bold.ttf create mode 100644 Resources/Fonts/IBMPlexMono/IBMPlexMono-BoldItalic.ttf create mode 100644 Resources/Fonts/IBMPlexMono/IBMPlexMono-Italic.ttf create mode 100644 Resources/Fonts/IBMPlexMono/IBMPlexMono-Regular.ttf create mode 100644 Resources/Fonts/IBMPlexMono/LICENSE_OFL.txt create mode 100644 Resources/Textures/Interface/Nano/lobby_gay.png create mode 100644 Resources/Textures/Ohio/Lobby/anim.rsi/1.png create mode 100644 Resources/Textures/Ohio/Lobby/anim.rsi/meta.json create mode 100644 Resources/Textures/Ohio/Lobby/arrow.png create mode 100644 Resources/Textures/Ohio/Lobby/character_setup/character_setup.png create mode 100644 Resources/Textures/Ohio/Lobby/character_setup/character_setup_highlighted.png create mode 100644 Resources/Textures/Ohio/Lobby/character_setup/character_setup_pressed.png create mode 100644 Resources/Textures/Ohio/Lobby/disabled.png create mode 100644 Resources/Textures/Ohio/Lobby/join/join_game.png create mode 100644 Resources/Textures/Ohio/Lobby/join/join_game_highlighted.png create mode 100644 Resources/Textures/Ohio/Lobby/join/join_game_pressed.png create mode 100644 Resources/Textures/Ohio/Lobby/moon.png create mode 100644 Resources/Textures/Ohio/Lobby/observe/observe.png create mode 100644 Resources/Textures/Ohio/Lobby/observe/observe_disabled.png create mode 100644 Resources/Textures/Ohio/Lobby/observe/observe_highlighted.png create mode 100644 Resources/Textures/Ohio/Lobby/observe/observe_pressed.png create mode 100644 Resources/Textures/Ohio/Lobby/ready/not_ready.png create mode 100644 Resources/Textures/Ohio/Lobby/ready/not_ready_highlighted.png create mode 100644 Resources/Textures/Ohio/Lobby/ready/not_ready_pressed.png create mode 100644 Resources/Textures/Ohio/Lobby/ready/ready.png create mode 100644 Resources/Textures/Ohio/Lobby/ready/ready_highlighted.png create mode 100644 Resources/Textures/Ohio/Lobby/ready/ready_pressed.png create mode 100644 Resources/Textures/Ohio/Lobby/settings/settings.png create mode 100644 Resources/Textures/Ohio/Lobby/settings/settings_highlighted.png create mode 100644 Resources/Textures/Ohio/Lobby/settings/settings_pressed.png diff --git a/Content.Client/Access/AccessOverlay.cs b/Content.Client/Access/AccessOverlay.cs index 2be3d07e90..3cb90158f3 100644 --- a/Content.Client/Access/AccessOverlay.cs +++ b/Content.Client/Access/AccessOverlay.cs @@ -22,7 +22,7 @@ public sealed class AccessOverlay : Overlay _lookup = lookup; _xform = xform; - _font = cache.GetFont("/Fonts/NotoSans/NotoSans-Regular.ttf", 12); + _font = cache.GetFont("/Fonts/IBMPlexMono/IBMPlexMono-Regular.ttf", 12); } protected override void Draw(in OverlayDrawArgs args) diff --git a/Content.Client/Administration/AdminNameOverlay.cs b/Content.Client/Administration/AdminNameOverlay.cs index c21ba2e32c..2f17a49fed 100644 --- a/Content.Client/Administration/AdminNameOverlay.cs +++ b/Content.Client/Administration/AdminNameOverlay.cs @@ -24,7 +24,7 @@ namespace Content.Client.Administration _eyeManager = eyeManager; _entityLookup = entityLookup; ZIndex = 200; - _font = new VectorFont(resourceCache.GetResource("/Fonts/NotoSans/NotoSans-Regular.ttf"), 10); + _font = new VectorFont(resourceCache.GetResource("/Fonts/IBMPlexMono/IBMPlexMono-Regular.ttf"), 10); } public override OverlaySpace Space => OverlaySpace.ScreenSpace; diff --git a/Content.Client/Administration/UI/CustomControls/HSeparator.cs b/Content.Client/Administration/UI/CustomControls/HSeparator.cs index 2dfb0b27fe..d0575a4ede 100644 --- a/Content.Client/Administration/UI/CustomControls/HSeparator.cs +++ b/Content.Client/Administration/UI/CustomControls/HSeparator.cs @@ -7,7 +7,7 @@ namespace Content.Client.Administration.UI.CustomControls; public sealed class HSeparator : Control { - private static readonly Color SeparatorColor = Color.FromHex("#3D4059"); + private static readonly Color SeparatorColor = Color.FromHex("#191919"); public HSeparator(Color color) { diff --git a/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs b/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs index 84ce30c9a2..1ab55052f8 100644 --- a/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs +++ b/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs @@ -42,7 +42,7 @@ namespace Content.Client.Administration.UI.CustomControls PopulateList(_adminSystem.PlayerList); FilterLineEdit.OnTextChanged += _ => FilterList(); _adminSystem.PlayerListChanged += PopulateList; - BackgroundPanel.PanelOverride = new StyleBoxFlat {BackgroundColor = new Color(32, 48, 32)}; + BackgroundPanel.PanelOverride = new StyleBoxFlat {BackgroundColor = new Color(20, 20, 20)}; } private void PlayerListItemPressed(BaseButton.ButtonEventArgs? args, ListData? data) diff --git a/Content.Client/Administration/UI/CustomControls/VSeparator.cs b/Content.Client/Administration/UI/CustomControls/VSeparator.cs index 0ab8a88c7b..422a44fba5 100644 --- a/Content.Client/Administration/UI/CustomControls/VSeparator.cs +++ b/Content.Client/Administration/UI/CustomControls/VSeparator.cs @@ -7,7 +7,7 @@ namespace Content.Client.Administration.UI.CustomControls; public sealed class VSeparator : PanelContainer { - private static readonly Color SeparatorColor = Color.FromHex("#3D4059"); + private static readonly Color SeparatorColor = Color.FromHex("#191919"); public VSeparator(Color color) { diff --git a/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs b/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs index eede3a6217..f6ecbfaeca 100644 --- a/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs +++ b/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs @@ -35,7 +35,7 @@ public sealed class ExplosionDebugOverlay : Overlay IoCManager.InjectDependencies(this); var cache = IoCManager.Resolve(); - _font = new VectorFont(cache.GetResource("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8); + _font = new VectorFont(cache.GetResource("/Fonts/IBMPlexMono/IBMPlexMono-Regular.ttf"), 8); } protected override void Draw(in OverlayDrawArgs args) diff --git a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs index 33a1d2361f..222ee83324 100644 --- a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs @@ -19,8 +19,8 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab private const string ArrowUp = "↑"; private const string ArrowDown = "↓"; - private readonly Color _altColor = Color.FromHex("#292B38"); - private readonly Color _defaultColor = Color.FromHex("#2F2F3B"); + private readonly Color _altColor = Color.FromHex("#141414"); + private readonly Color _defaultColor = Color.FromHex("#191919"); private readonly AdminSystem _adminSystem; private IReadOnlyList _players = new List(); diff --git a/Content.Client/Content.Client.csproj b/Content.Client/Content.Client.csproj index fc03fd8cec..666b91913c 100644 --- a/Content.Client/Content.Client.csproj +++ b/Content.Client/Content.Client.csproj @@ -23,10 +23,6 @@ - - - - diff --git a/Content.Client/Fluids/PuddleOverlay.cs b/Content.Client/Fluids/PuddleOverlay.cs index 8c8b13a1ef..2fbf11675e 100644 --- a/Content.Client/Fluids/PuddleOverlay.cs +++ b/Content.Client/Fluids/PuddleOverlay.cs @@ -28,7 +28,7 @@ public sealed class PuddleOverlay : Overlay IoCManager.InjectDependencies(this); _debugOverlaySystem = _entitySystemManager.GetEntitySystem(); var cache = IoCManager.Resolve(); - _font = new VectorFont(cache.GetResource("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8); + _font = new VectorFont(cache.GetResource("/Fonts/IBMPlexMono/IBMPlexMono-Regular.ttf"), 8); } protected override void Draw(in OverlayDrawArgs args) diff --git a/Content.Client/Lobby/LobbyState.cs b/Content.Client/Lobby/LobbyState.cs index 457163a5b5..b0680bae46 100644 --- a/Content.Client/Lobby/LobbyState.cs +++ b/Content.Client/Lobby/LobbyState.cs @@ -1,9 +1,14 @@ +using System.Linq; +using System.Numerics; +using Content.Client._Ohio.Buttons; +using Content.Client.Changelog; using Content.Client.GameTicking.Managers; using Content.Client.LateJoin; using Content.Client.Lobby.UI; using Content.Client.Message; using Content.Client.Preferences; using Content.Client.Preferences.UI; +using Content.Client.Resources; using Content.Client.UserInterface.Systems.Chat; using Content.Client.Voting; using Robust.Client; @@ -14,7 +19,7 @@ using Robust.Client.UserInterface.Controls; using Robust.Shared.Configuration; using Robust.Shared.Prototypes; using Robust.Shared.Timing; - +using Robust.Shared.Utility; namespace Content.Client.Lobby { @@ -30,12 +35,14 @@ namespace Content.Client.Lobby [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IVoteManager _voteManager = default!; [Dependency] private readonly IConfigurationManager _configurationManager = default!; + [Dependency] private readonly ChangelogManager _changelog = default!; [ViewVariables] private CharacterSetupGui? _characterSetup; private ClientGameTicker _gameTicker = default!; protected override Type? LinkedScreenType { get; } = typeof(LobbyGui); + private LobbyGui? _lobby; protected override void Startup() @@ -48,12 +55,16 @@ namespace Content.Client.Lobby _lobby = (LobbyGui) _userInterfaceManager.ActiveScreen; var chatController = _userInterfaceManager.GetUIController(); + _gameTicker = _entityManager.System(); + _characterSetup = new CharacterSetupGui(_entityManager, _resourceCache, _preferencesManager, _prototypeManager, _configurationManager); + LayoutContainer.SetAnchorPreset(_characterSetup, LayoutContainer.LayoutPreset.Wide); _lobby.CharacterSetupState.AddChild(_characterSetup); + chatController.SetMainChat(true); _voteManager.SetPopupContainer(_lobby.VoteContainer); @@ -66,14 +77,16 @@ namespace Content.Client.Lobby _characterSetup.SaveButton.OnPressed += _ => { _characterSetup.Save(); - _lobby.CharacterPreview.UpdateUI(); + //_lobby.CharacterPreview.UpdateUI(); }; LayoutContainer.SetAnchorPreset(_lobby, LayoutContainer.LayoutPreset.Wide); + _lobby.ServerName.Text = _baseClient.GameInfo?.ServerName; //The eye of refactor gazes upon you... + UpdateLobbyUi(); - _lobby.CharacterPreview.CharacterSetupButton.OnPressed += OnSetupPressed; + _lobby.CharacterSetupButton.OnPressed += OnSetupPressed; _lobby.ReadyButton.OnPressed += OnReadyPressed; _lobby.ReadyButton.OnToggled += OnReadyToggled; @@ -83,20 +96,23 @@ namespace Content.Client.Lobby _preferencesManager.OnServerDataLoaded += PreferencesDataLoaded; - _lobby.CharacterPreview.UpdateUI(); + //_lobby.CharacterPreview.UpdateUI(); + PopulateChangelog(); } protected override void Shutdown() { var chatController = _userInterfaceManager.GetUIController(); + chatController.SetMainChat(false); + _gameTicker.InfoBlobUpdated -= UpdateLobbyUi; _gameTicker.LobbyStatusUpdated -= LobbyStatusUpdated; _gameTicker.LobbyLateJoinStatusUpdated -= LobbyLateJoinStatusUpdated; _voteManager.ClearPopupContainer(); - _lobby!.CharacterPreview.CharacterSetupButton.OnPressed -= OnSetupPressed; + _lobby!.CharacterSetupButton.OnPressed -= OnSetupPressed; _lobby!.ReadyButton.OnPressed -= OnReadyPressed; _lobby!.ReadyButton.OnToggled -= OnReadyToggled; @@ -110,7 +126,7 @@ namespace Content.Client.Lobby private void PreferencesDataLoaded() { - _lobby?.CharacterPreview.UpdateUI(); + //_lobby?.CharacterPreview.UpdateUI(); } private void OnSetupPressed(BaseButton.ButtonEventArgs args) @@ -140,11 +156,12 @@ namespace Content.Client.Lobby { _lobby!.StartTime.Text = string.Empty; var roundTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan); - _lobby!.StationTime.Text = Loc.GetString("lobby-state-player-status-round-time", ("hours", roundTime.Hours), ("minutes", roundTime.Minutes)); + _lobby!.StationTime.Text = Loc.GetString("lobby-state-player-status-round-time", + ("hours", roundTime.Hours), ("minutes", roundTime.Minutes)); + return; } - _lobby!.StationTime.Text = Loc.GetString("lobby-state-player-status-round-not-started"); string text; if (_gameTicker.Paused) @@ -162,7 +179,9 @@ namespace Content.Client.Lobby var seconds = difference.TotalSeconds; if (seconds < 0) { - text = Loc.GetString(seconds < -5 ? "lobby-state-right-now-question" : "lobby-state-right-now-confirmation"); + text = Loc.GetString(seconds < -5 + ? "lobby-state-right-now-question" + : "lobby-state-right-now-confirmation"); } else { @@ -175,7 +194,6 @@ namespace Content.Client.Lobby private void LobbyStatusUpdated() { - UpdateLobbyBackground(); UpdateLobbyUi(); } @@ -188,7 +206,7 @@ namespace Content.Client.Lobby { if (_gameTicker.IsGameStarted) { - _lobby!.ReadyButton.Text = Loc.GetString("lobby-state-ready-button-join-state"); + MakeButtonJoinGame(_lobby!.ReadyButton); _lobby!.ReadyButton.ToggleMode = false; _lobby!.ReadyButton.Pressed = false; _lobby!.ObserveButton.Disabled = false; @@ -196,7 +214,12 @@ namespace Content.Client.Lobby else { _lobby!.StartTime.Text = string.Empty; - _lobby!.ReadyButton.Text = Loc.GetString(_lobby!.ReadyButton.Pressed ? "lobby-state-player-status-ready": "lobby-state-player-status-not-ready"); + + if (_lobby!.ReadyButton.Pressed) + MakeButtonReady(_lobby!.ReadyButton); + else + MakeButtonUnReady(_lobby!.ReadyButton); + _lobby!.ReadyButton.ToggleMode = true; _lobby!.ReadyButton.Disabled = false; _lobby!.ReadyButton.Pressed = _gameTicker.AreWeReady; @@ -208,41 +231,9 @@ namespace Content.Client.Lobby _lobby!.ServerInfo.SetInfoBlob(_gameTicker.ServerInfoBlob); } - if (_gameTicker.LobbySong == null) - { - _lobby!.LobbySong.SetMarkup(Loc.GetString("lobby-state-song-no-song-text")); - } - else if (_resourceCache.TryGetResource(_gameTicker.LobbySong, out var lobbySongResource)) - { - var lobbyStream = lobbySongResource.AudioStream; - - var title = string.IsNullOrEmpty(lobbyStream.Title) ? - Loc.GetString("lobby-state-song-unknown-title") : - lobbyStream.Title; - - var artist = string.IsNullOrEmpty(lobbyStream.Artist) ? - Loc.GetString("lobby-state-song-unknown-artist") : - lobbyStream.Artist; - - var markup = Loc.GetString("lobby-state-song-text", - ("songTitle", title), - ("songArtist", artist)); - - _lobby!.LobbySong.SetMarkup(markup); - } - } - - private void UpdateLobbyBackground() - { - if (_gameTicker.LobbyBackground != null) - { - _lobby!.Background.Texture = _resourceCache.GetResource(_gameTicker.LobbyBackground ); - } - else - { - _lobby!.Background.Texture = null; - } - + _lobby!.LabelName.SetMarkup("[font=\"Bedstead\" size=20] Green Miracle [/font]"); + _lobby!.Version.SetMarkup("Version: 1.0"); + _lobby!.ChangelogLabel.SetMarkup("Список изменений:"); } private void SetReady(bool newReady) @@ -254,5 +245,100 @@ namespace Content.Client.Lobby _consoleHost.ExecuteCommand($"toggleready {newReady}"); } + + private void MakeButtonReady(OhioLobbyTextButton button) + { + button.ButtonText = "Ready"; + } + + private void MakeButtonUnReady(OhioLobbyTextButton button) + { + button.ButtonText = "Not Ready"; + } + + private void MakeButtonJoinGame(OhioLobbyTextButton button) + { + button.ButtonText = "Join Game"; + } + + private async void PopulateChangelog() + { + _lobby!.ChangelogContainer.Children.Clear(); + + var changelogs = await _changelog.LoadChangelog(); + var whiteChangelog = changelogs.Find(cl => cl.Name == "ChangelogWhite"); + + if (whiteChangelog is null) + { + _lobby!.ChangelogContainer.Children.Add( + new RichTextLabel().SetMarkup("Не удалось загрузить список изменений")); + + return; + } + + var entries = whiteChangelog.Entries + .OrderByDescending(c => c.Time) + .Take(5); + + foreach (var entry in entries) + { + var box = new BoxContainer + { + Orientation = BoxContainer.LayoutOrientation.Vertical, + HorizontalAlignment = Control.HAlignment.Left, + Children = + { + new Label + { + Align = Label.AlignMode.Left, + Text = $"{entry.Author} {entry.Time.ToShortDateString()}", + FontColorOverride = Color.FromHex("#888"), + Margin = new Thickness(0, 10) + } + } + }; + + foreach (var change in entry.Changes) + { + var container = new BoxContainer + { + Orientation = BoxContainer.LayoutOrientation.Horizontal, + HorizontalAlignment = Control.HAlignment.Left + }; + + var text = new RichTextLabel(); + text.SetMessage(FormattedMessage.FromMarkup(change.Message)); + text.MaxWidth = 350; + + container.AddChild(GetIcon(change.Type)); + container.AddChild(text); + + box.AddChild(container); + } + + _lobby!.ChangelogContainer.AddChild(box); + } + } + + private TextureRect GetIcon(ChangelogManager.ChangelogLineType type) + { + var (file, color) = type switch + { + ChangelogManager.ChangelogLineType.Add => ("plus.svg.192dpi.png", "#6ED18D"), + ChangelogManager.ChangelogLineType.Remove => ("minus.svg.192dpi.png", "#D16E6E"), + ChangelogManager.ChangelogLineType.Fix => ("bug.svg.192dpi.png", "#D1BA6E"), + ChangelogManager.ChangelogLineType.Tweak => ("wrench.svg.192dpi.png", "#6E96D1"), + _ => throw new ArgumentOutOfRangeException(nameof(type), type, null) + }; + + return new TextureRect + { + Texture = _resourceCache.GetTexture(new ResPath($"/Textures/Interface/Changelog/{file}")), + VerticalAlignment = Control.VAlignment.Top, + TextureScale = new Vector2(0.5f, 0.5f), + Margin = new Thickness(2, 4, 6, 2), + ModulateSelfOverride = Color.FromHex(color) + }; + } } } diff --git a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs index f9481caa3b..daceefc479 100644 --- a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs +++ b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs @@ -1,16 +1,13 @@ using System.Linq; using System.Numerics; -using Content.Client.Alerts; using Content.Client.Humanoid; using Content.Client.Inventory; using Content.Client.Preferences; using Content.Client.UserInterface.Controls; using Content.Shared.GameTicking; using Content.Shared.Humanoid.Prototypes; -using Content.Shared.Inventory; using Content.Shared.Preferences; using Content.Shared.Roles; -using Robust.Client.GameObjects; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.Map; @@ -40,12 +37,12 @@ namespace Content.Client.Lobby.UI Text = Loc.GetString("lobby-character-preview-panel-header") }; - CharacterSetupButton = new Button - { - Text = Loc.GetString("lobby-character-preview-panel-character-setup-button"), - HorizontalAlignment = HAlignment.Center, - Margin = new Thickness(0, 5, 0, 0), - }; + // CharacterSetupButton = new Button + // { + // Text = Loc.GetString("lobby-character-preview-panel-character-setup-button"), + // HorizontalAlignment = HAlignment.Center, + // Margin = new Thickness(0, 5, 0, 0), + // }; _summaryLabel = new Label { @@ -69,12 +66,12 @@ namespace Content.Client.Lobby.UI Orientation = LayoutOrientation.Horizontal, HorizontalAlignment = HAlignment.Center, }; - var _vSpacer = new VSpacer(); + var vSpacer = new VSpacer(); _loaded.AddChild(_summaryLabel); _loaded.AddChild(_viewBox); - _loaded.AddChild(_vSpacer); - _loaded.AddChild(CharacterSetupButton); + _loaded.AddChild(vSpacer); + //_loaded.AddChild(CharacterSetupButton); vBox.AddChild(header); vBox.AddChild(_loaded); @@ -84,14 +81,18 @@ namespace Content.Client.Lobby.UI UpdateUI(); } - public Button CharacterSetupButton { get; } + // public Button CharacterSetupButton { get; } protected override void Dispose(bool disposing) { base.Dispose(disposing); - if (!disposing) return; - if (_previewDummy != null) _entityManager.DeleteEntity(_previewDummy.Value); + if (!disposing) + return; + + if (_previewDummy != null) + _entityManager.DeleteEntity(_previewDummy.Value); + _previewDummy = default; } @@ -134,7 +135,7 @@ namespace Content.Client.Lobby.UI { var protoMan = IoCManager.Resolve(); var entMan = IoCManager.Resolve(); - var invSystem = EntitySystem.Get(); + var invSystem = entMan.System(); var highPriorityJob = profile.JobPriorities.FirstOrDefault(p => p.Value == JobPriority.High).Key; diff --git a/Content.Client/Lobby/UI/LobbyGui.xaml b/Content.Client/Lobby/UI/LobbyGui.xaml index e5e2adafaa..80df70d8fc 100644 --- a/Content.Client/Lobby/UI/LobbyGui.xaml +++ b/Content.Client/Lobby/UI/LobbyGui.xaml @@ -1,116 +1,183 @@ - + + - + + + - - - - - - - - - - - - -