]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix lobby votes (#15041)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sat, 1 Apr 2023 14:00:48 +0000 (01:00 +1100)
committerGitHub <noreply@github.com>
Sat, 1 Apr 2023 14:00:48 +0000 (01:00 +1100)
Content.Client/Lobby/LobbyState.cs
Content.Client/Lobby/UI/LobbyGui.xaml
Content.Client/UserInterface/Systems/Vote/VoteUIController.cs

index 02efe0daa1d57a81c74549c3573e60e628f074b5..8774242cc60fddc8fc07f18ae1c5c77fa052d316 100644 (file)
@@ -59,6 +59,8 @@ namespace Content.Client.Lobby
             _lobby.CharacterSetupState.AddChild(_characterSetup);
             chatController.SetMainChat(true);
 
+            _voteManager.SetPopupContainer(_lobby.VoteContainer);
+
             _characterSetup.CloseButton.OnPressed += _ =>
             {
                 _lobby.SwitchState(LobbyGui.LobbyGuiState.Default);
@@ -91,6 +93,8 @@ namespace Content.Client.Lobby
             _gameTicker.LobbyStatusUpdated -= LobbyStatusUpdated;
             _gameTicker.LobbyLateJoinStatusUpdated -= LobbyLateJoinStatusUpdated;
 
+            _lobby!.VoteContainer.Orphan();
+
             _lobby!.CharacterPreview.CharacterSetupButton.OnPressed -= OnSetupPressed;
             _lobby!.ReadyButton.OnPressed -= OnReadyPressed;
             _lobby!.ReadyButton.OnToggled -= OnReadyToggled;
index 77c79e96d207d272b5ea13f4776f5a1c5b6291d0..8dbef0632a0c03f5125b83b27d931ef1c0116f3b 100644 (file)
             <!-- LHS Controls -->
             <BoxContainer Name="LeftSide" Orientation="Vertical" SeparationOverride="4" HorizontalExpand="True">
                 <Control Name="DefaultState" VerticalExpand="True">
-                    <!-- Left Top Panel -->
-                    <PanelContainer StyleClasses="AngleRect" HorizontalAlignment="Left" Name = "LeftSideTop" VerticalAlignment="Top" >
-                        <BoxContainer Orientation="Vertical" HorizontalAlignment="Center" MaxWidth="800">
-                            <info:LinkBanner Name="LinkBanner" VerticalExpand="false" HorizontalAlignment="Center" Margin="3 3 3 3"/>
-                            <controls:StripeBack>
-                                <BoxContainer Orientation="Horizontal" SeparationOverride="6" Margin="3 3 3 3">
-                                    <cc:UICommandButton Command="observe" Name="ObserveButton" Access="Public" Text="{Loc 'ui-lobby-observe-button'}" StyleClasses="ButtonBig"  WindowType="{x:Type lobbyUi:ObserveWarningWindow}"/>
-                                    <Label Name="StartTime"
-                                           Access="Public"
-                                           Align="Left"
-                                           FontColorOverride="{x:Static maths:Color.DarkGray}"
-                                           StyleClasses="LabelBig" HorizontalExpand="True" />
-                                    <Button Name="ReadyButton" Access="Public" ToggleMode="True" Text="{Loc 'ui-lobby-ready-up-button'}"
-                                            StyleClasses="ButtonBig" MinWidth="137"/>
-                                </BoxContainer>
-                            </controls:StripeBack>
-                        </BoxContainer>
-                    </PanelContainer>
-                    <!-- Voting Popups -->
-                    <BoxContainer Orientation="Vertical" SeparationOverride="4" Name="VoteContainer" Access="Public" HorizontalAlignment="Left" VerticalAlignment="Top"/>
+                    <BoxContainer Name="TopLeft" Orientation="Vertical">
+                        <!-- Left Top Panel -->
+                        <PanelContainer StyleClasses="AngleRect" HorizontalAlignment="Left" Name = "LeftSideTop" VerticalAlignment="Top" >
+                            <BoxContainer Orientation="Vertical" HorizontalAlignment="Center" MaxWidth="800">
+                                <info:LinkBanner Name="LinkBanner" VerticalExpand="false" HorizontalAlignment="Center" Margin="3 3 3 3"/>
+                                <controls:StripeBack>
+                                    <BoxContainer Orientation="Horizontal" SeparationOverride="6" Margin="3 3 3 3">
+                                        <cc:UICommandButton Command="observe" Name="ObserveButton" Access="Public" Text="{Loc 'ui-lobby-observe-button'}" StyleClasses="ButtonBig"  WindowType="{x:Type lobbyUi:ObserveWarningWindow}"/>
+                                        <Label Name="StartTime"
+                                               Access="Public"
+                                               Align="Left"
+                                               FontColorOverride="{x:Static maths:Color.DarkGray}"
+                                               StyleClasses="LabelBig" HorizontalExpand="True" />
+                                        <Button Name="ReadyButton" Access="Public" ToggleMode="True" Text="{Loc 'ui-lobby-ready-up-button'}"
+                                                StyleClasses="ButtonBig" MinWidth="137"/>
+                                    </BoxContainer>
+                                </controls:StripeBack>
+                            </BoxContainer>
+                        </PanelContainer>
+                        <!-- Voting Popups -->
+                        <BoxContainer Orientation="Vertical" SeparationOverride="4" Name="VoteContainer" Access="Public" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 8"/>
+                    </BoxContainer>
                     <!-- Vertical Padding-->
                     <Control VerticalExpand="True"/>
                     <!-- Left Bot Panel -->
index 809134bbb2283fde5c9cfbb7d8b8afb4ed9d9fa4..52d0348b798baed6ea6e5a097bc467f826b75ece 100644 (file)
@@ -1,10 +1,12 @@
 using Content.Client.UserInterface.Screens;
 using Content.Client.UserInterface.Systems.Gameplay;
 using Content.Client.Voting;
+using JetBrains.Annotations;
 using Robust.Client.UserInterface.Controllers;
 
 namespace Content.Client.UserInterface.Systems.Vote;
 
+[UsedImplicitly]
 public sealed class VoteUIController : UIController
 {
     [Dependency] private readonly IVoteManager _votes = default!;