Make the lobby AHelp button red for admins when one is received (#20390)
This commit is contained in:
@@ -1,47 +1,57 @@
|
|||||||
<lobbyUi:LobbyGui xmlns="https://spacestation14.io"
|
<lobbyUi:LobbyGui
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="https://spacestation14.io"
|
||||||
xmlns:maths="clr-namespace:Robust.Shared.Maths;assembly=Robust.Shared.Maths"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
|
xmlns:maths="clr-namespace:Robust.Shared.Maths;assembly=Robust.Shared.Maths"
|
||||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
|
||||||
xmlns:vote="clr-namespace:Content.Client.Voting.UI"
|
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||||
xmlns:style="clr-namespace:Content.Client.Stylesheets"
|
xmlns:vote="clr-namespace:Content.Client.Voting.UI"
|
||||||
xmlns:lobbyUi="clr-namespace:Content.Client.Lobby.UI"
|
xmlns:style="clr-namespace:Content.Client.Stylesheets"
|
||||||
xmlns:info="clr-namespace:Content.Client.Info"
|
xmlns:lobbyUi="clr-namespace:Content.Client.Lobby.UI"
|
||||||
xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Chat.Widgets">
|
xmlns:info="clr-namespace:Content.Client.Info"
|
||||||
|
xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Chat.Widgets">
|
||||||
<!-- Background -->
|
<!-- Background -->
|
||||||
<TextureRect Access="Public" VerticalExpand="True" HorizontalExpand="True" Name = "Background" Stretch="KeepAspectCovered"/>
|
<TextureRect Access="Public" VerticalExpand="True" HorizontalExpand="True" Name="Background"
|
||||||
<BoxContainer Name="MainContainer" VerticalExpand="True" HorizontalExpand="True" Orientation="Horizontal" Margin="10 10 10 10" SeparationOverride="2">
|
Stretch="KeepAspectCovered" />
|
||||||
|
<BoxContainer Name="MainContainer" VerticalExpand="True" HorizontalExpand="True" Orientation="Horizontal"
|
||||||
|
Margin="10 10 10 10" SeparationOverride="2">
|
||||||
<SplitContainer State="Auto" HorizontalExpand="True">
|
<SplitContainer State="Auto" HorizontalExpand="True">
|
||||||
<!-- LHS Controls -->
|
<!-- LHS Controls -->
|
||||||
<BoxContainer Name="LeftSide" Orientation="Vertical" SeparationOverride="4" HorizontalExpand="True">
|
<BoxContainer Name="LeftSide" Orientation="Vertical" SeparationOverride="4" HorizontalExpand="True">
|
||||||
<Control Name="DefaultState" VerticalExpand="True">
|
<Control Name="DefaultState" VerticalExpand="True">
|
||||||
<BoxContainer Name="TopLeft" Orientation="Vertical">
|
<BoxContainer Name="TopLeft" Orientation="Vertical">
|
||||||
<!-- Left Top Panel -->
|
<!-- Left Top Panel -->
|
||||||
<PanelContainer StyleClasses="AngleRect" HorizontalAlignment="Left" Name = "LeftSideTop" VerticalAlignment="Top" >
|
<PanelContainer StyleClasses="AngleRect" HorizontalAlignment="Left" Name="LeftSideTop"
|
||||||
|
VerticalAlignment="Top">
|
||||||
<BoxContainer Orientation="Vertical" HorizontalAlignment="Center" MaxWidth="800">
|
<BoxContainer Orientation="Vertical" HorizontalAlignment="Center" MaxWidth="800">
|
||||||
<info:LinkBanner Name="LinkBanner" VerticalExpand="false" HorizontalAlignment="Center" Margin="3 3 3 3"/>
|
<info:LinkBanner Name="LinkBanner" VerticalExpand="false" HorizontalAlignment="Center"
|
||||||
|
Margin="3 3 3 3" />
|
||||||
<controls:StripeBack>
|
<controls:StripeBack>
|
||||||
<BoxContainer Orientation="Horizontal" SeparationOverride="6" Margin="3 3 3 3">
|
<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}"/>
|
<cc:UICommandButton Command="observe" Name="ObserveButton" Access="Public"
|
||||||
|
Text="{Loc 'ui-lobby-observe-button'}"
|
||||||
|
StyleClasses="ButtonBig"
|
||||||
|
WindowType="{x:Type lobbyUi:ObserveWarningWindow}" />
|
||||||
<Label Name="StartTime"
|
<Label Name="StartTime"
|
||||||
Access="Public"
|
Access="Public"
|
||||||
Align="Left"
|
Align="Left"
|
||||||
FontColorOverride="{x:Static maths:Color.DarkGray}"
|
FontColorOverride="{x:Static maths:Color.DarkGray}"
|
||||||
StyleClasses="LabelBig" HorizontalExpand="True" />
|
StyleClasses="LabelBig" HorizontalExpand="True" />
|
||||||
<Button Name="ReadyButton" Access="Public" ToggleMode="True" Text="{Loc 'ui-lobby-ready-up-button'}"
|
<Button Name="ReadyButton" Access="Public" ToggleMode="True"
|
||||||
StyleClasses="ButtonBig" MinWidth="137"/>
|
Text="{Loc 'ui-lobby-ready-up-button'}"
|
||||||
|
StyleClasses="ButtonBig" MinWidth="137" />
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
</controls:StripeBack>
|
</controls:StripeBack>
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
</PanelContainer>
|
</PanelContainer>
|
||||||
<!-- Voting Popups -->
|
<!-- Voting Popups -->
|
||||||
<BoxContainer Orientation="Vertical" SeparationOverride="4" Name="VoteContainer" Access="Public" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 8"/>
|
<BoxContainer Orientation="Vertical" SeparationOverride="4" Name="VoteContainer"
|
||||||
|
Access="Public" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 8" />
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
<!-- Vertical Padding-->
|
<!-- Vertical Padding-->
|
||||||
<Control VerticalExpand="True"/>
|
<Control VerticalExpand="True" />
|
||||||
<!-- Left Bot Panel -->
|
<!-- Left Bot Panel -->
|
||||||
<BoxContainer Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Bottom">
|
<BoxContainer Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Bottom">
|
||||||
<info:DevInfoBanner Name="DevInfoBanner" VerticalExpand="false" Margin="3 3 3 3"/>
|
<info:DevInfoBanner Name="DevInfoBanner" VerticalExpand="false" Margin="3 3 3 3" />
|
||||||
<PanelContainer StyleClasses="AngleRect">
|
<PanelContainer StyleClasses="AngleRect">
|
||||||
<RichTextLabel Name="LobbySong" Access="Public" HorizontalAlignment="Center" />
|
<RichTextLabel Name="LobbySong" Access="Public" HorizontalAlignment="Center" />
|
||||||
</PanelContainer>
|
</PanelContainer>
|
||||||
@@ -52,36 +62,45 @@
|
|||||||
<Control Access="Public" Visible="False" Name="CharacterSetupState" VerticalExpand="True" />
|
<Control Access="Public" Visible="False" Name="CharacterSetupState" VerticalExpand="True" />
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
<!-- Right Panel -->
|
<!-- Right Panel -->
|
||||||
<PanelContainer Name="RightSide" StyleClasses="AngleRect" HorizontalAlignment= "Right" VerticalExpand="True" VerticalAlignment="Stretch">
|
<PanelContainer Name="RightSide" StyleClasses="AngleRect" HorizontalAlignment="Right" VerticalExpand="True"
|
||||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
|
VerticalAlignment="Stretch">
|
||||||
<!-- Top row -->
|
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
|
||||||
<BoxContainer Orientation="Horizontal" MinSize="0 40" Name="HeaderContainer" Access="Public" SeparationOverride="4">
|
<!-- Top row -->
|
||||||
<Label Margin="8 0 0 0" StyleClasses="LabelHeadingBigger" VAlign="Center" Text="{Loc 'ui-lobby-title'}" />
|
<BoxContainer Orientation="Horizontal" MinSize="0 40" Name="HeaderContainer" Access="Public"
|
||||||
<Label Name="ServerName" Access="Public" StyleClasses="LabelHeadingBigger" VAlign="Center" HorizontalExpand="True" HorizontalAlignment="Center" />
|
SeparationOverride="4">
|
||||||
</BoxContainer>
|
<Label Margin="8 0 0 0" StyleClasses="LabelHeadingBigger" VAlign="Center"
|
||||||
<!-- Gold line -->
|
Text="{Loc 'ui-lobby-title'}" />
|
||||||
<controls:HLine Color="{x:Static style:StyleNano.NanoGold}" Thickness="2"/>
|
<Label Name="ServerName" Access="Public" StyleClasses="LabelHeadingBigger" VAlign="Center"
|
||||||
<controls:HSpacer Spacing="10"/>
|
HorizontalExpand="True" HorizontalAlignment="Center" />
|
||||||
<!-- Voting & misc button bar -->
|
</BoxContainer>
|
||||||
<BoxContainer Orientation="Horizontal" MinSize="0 40" HorizontalAlignment="Right">
|
<!-- Gold line -->
|
||||||
<cc:CommandButton Name = "AHelpButton" Command="openahelp" Access="Public" Text = "{Loc 'ui-lobby-ahelp-button'}" StyleClasses="ButtonBig"/>
|
<controls:HLine Color="{x:Static style:StyleNano.NanoGold}" Thickness="2" />
|
||||||
<vote:VoteCallMenuButton Name="CallVoteButton" StyleClasses="ButtonBig" />
|
<controls:HSpacer Spacing="10" />
|
||||||
<Button Name="OptionsButton" Access="Public" StyleClasses="ButtonBig" Text="{Loc 'ui-lobby-options-button'}" />
|
<!-- Voting & misc button bar -->
|
||||||
<Button Name="LeaveButton" Access="Public" StyleClasses="ButtonBig" Text="{Loc 'ui-lobby-leave-button'}" />
|
<BoxContainer Orientation="Horizontal" MinSize="0 40" HorizontalAlignment="Right">
|
||||||
</BoxContainer>
|
<Button Name="AHelpButton" Access="Public" Text="{Loc 'ui-lobby-ahelp-button'}"
|
||||||
<controls:HSpacer Spacing="10"/>
|
StyleClasses="ButtonBig" />
|
||||||
<!-- Server info -->
|
<vote:VoteCallMenuButton Name="CallVoteButton" StyleClasses="ButtonBig" />
|
||||||
<controls:NanoHeading Text="{Loc 'ui-lobby-server-info-block'}" />
|
<Button Name="OptionsButton" Access="Public" StyleClasses="ButtonBig"
|
||||||
<info:ServerInfo Name="ServerInfo" Access="Public" MinSize="0 30" VerticalExpand="false" Margin="3 3 3 3" MaxWidth="400" HorizontalAlignment="Left"/>
|
Text="{Loc 'ui-lobby-options-button'}" />
|
||||||
<Label Name="StationTime" Access="Public" FontColorOverride="{x:Static maths:Color.LightGray}" Margin="3 3 3 3" HorizontalAlignment="Left"/>
|
<Button Name="LeaveButton" Access="Public" StyleClasses="ButtonBig"
|
||||||
<controls:HSpacer Spacing="5"/>
|
Text="{Loc 'ui-lobby-leave-button'}" />
|
||||||
<lobbyUi:LobbyCharacterPreviewPanel Name="CharacterPreview" Access="Public" />
|
</BoxContainer>
|
||||||
<controls:HSpacer Spacing="5"/>
|
<controls:HSpacer Spacing="10" />
|
||||||
<BoxContainer MinHeight="10"/>
|
<!-- Server info -->
|
||||||
<!-- Gold line -->
|
<controls:NanoHeading Text="{Loc 'ui-lobby-server-info-block'}" />
|
||||||
<controls:HLine Color="{x:Static style:StyleNano.NanoGold}" Thickness="2" Access="Public"/>
|
<info:ServerInfo Name="ServerInfo" Access="Public" MinSize="0 30" VerticalExpand="false"
|
||||||
<controls:HSpacer Spacing="10"/>
|
Margin="3 3 3 3" MaxWidth="400" HorizontalAlignment="Left" />
|
||||||
<widgets:ChatBox Name="Chat" Access="Public" VerticalExpand="True" Margin="3 3 3 3" MinHeight="50" />
|
<Label Name="StationTime" Access="Public" FontColorOverride="{x:Static maths:Color.LightGray}"
|
||||||
|
Margin="3 3 3 3" HorizontalAlignment="Left" />
|
||||||
|
<controls:HSpacer Spacing="5" />
|
||||||
|
<lobbyUi:LobbyCharacterPreviewPanel Name="CharacterPreview" Access="Public" />
|
||||||
|
<controls:HSpacer Spacing="5" />
|
||||||
|
<BoxContainer MinHeight="10" />
|
||||||
|
<!-- Gold line -->
|
||||||
|
<controls:HLine Color="{x:Static style:StyleNano.NanoGold}" Thickness="2" Access="Public" />
|
||||||
|
<controls:HSpacer Spacing="10" />
|
||||||
|
<widgets:ChatBox Name="Chat" Access="Public" VerticalExpand="True" Margin="3 3 3 3" MinHeight="50" />
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
</PanelContainer>
|
</PanelContainer>
|
||||||
</SplitContainer>
|
</SplitContainer>
|
||||||
|
|||||||
@@ -4,7 +4,12 @@ using System.Numerics;
|
|||||||
using Content.Client.Administration.Managers;
|
using Content.Client.Administration.Managers;
|
||||||
using Content.Client.Administration.Systems;
|
using Content.Client.Administration.Systems;
|
||||||
using Content.Client.Administration.UI.Bwoink;
|
using Content.Client.Administration.UI.Bwoink;
|
||||||
|
using Content.Client.Gameplay;
|
||||||
|
using Content.Client.Lobby;
|
||||||
|
using Content.Client.Lobby.UI;
|
||||||
|
using Content.Client.Stylesheets;
|
||||||
using Content.Client.UserInterface.Controls;
|
using Content.Client.UserInterface.Controls;
|
||||||
|
using Content.Client.UserInterface.Systems.MenuBar.Widgets;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -23,7 +28,7 @@ using Robust.Shared.Utility;
|
|||||||
namespace Content.Client.UserInterface.Systems.Bwoink;
|
namespace Content.Client.UserInterface.Systems.Bwoink;
|
||||||
|
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSystem>
|
public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSystem>, IOnStateChanged<GameplayState>, IOnStateChanged<LobbyState>
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IClientAdminManager _adminManager = default!;
|
[Dependency] private readonly IClientAdminManager _adminManager = default!;
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
@@ -31,9 +36,11 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
|
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
|
||||||
|
|
||||||
private BwoinkSystem? _bwoinkSystem;
|
private BwoinkSystem? _bwoinkSystem;
|
||||||
private MenuButton? AhelpButton => UIManager.GetActiveUIWidgetOrNull<MenuBar.Widgets.GameTopMenuBar>()?.AHelpButton;
|
private MenuButton? GameAHelpButton => UIManager.GetActiveUIWidgetOrNull<GameTopMenuBar>()?.AHelpButton;
|
||||||
|
private Button? LobbyAHelpButton => (UIManager.ActiveScreen as LobbyGui)?.AHelpButton;
|
||||||
public IAHelpUIHandler? UIHelper;
|
public IAHelpUIHandler? UIHelper;
|
||||||
private bool _discordRelayActive;
|
private bool _discordRelayActive;
|
||||||
|
private bool _hasUnreadAHelp;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -47,22 +54,20 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
|
|
||||||
public void UnloadButton()
|
public void UnloadButton()
|
||||||
{
|
{
|
||||||
if (AhelpButton == null)
|
if (GameAHelpButton != null)
|
||||||
{
|
GameAHelpButton.OnPressed -= AHelpButtonPressed;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
AhelpButton.OnPressed -= AHelpButtonPressed;
|
if (LobbyAHelpButton != null)
|
||||||
|
LobbyAHelpButton.OnPressed -= AHelpButtonPressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadButton()
|
public void LoadButton()
|
||||||
{
|
{
|
||||||
if (AhelpButton == null)
|
if (GameAHelpButton != null)
|
||||||
{
|
GameAHelpButton.OnPressed += AHelpButtonPressed;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
AhelpButton.OnPressed += AHelpButtonPressed;
|
if (LobbyAHelpButton != null)
|
||||||
|
LobbyAHelpButton.OnPressed += AHelpButtonPressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnAdminStatusUpdated()
|
private void OnAdminStatusUpdated()
|
||||||
@@ -81,7 +86,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
public void OnSystemLoaded(BwoinkSystem system)
|
public void OnSystemLoaded(BwoinkSystem system)
|
||||||
{
|
{
|
||||||
_bwoinkSystem = system;
|
_bwoinkSystem = system;
|
||||||
_bwoinkSystem.OnBwoinkTextMessageRecieved += RecievedBwoink;
|
_bwoinkSystem.OnBwoinkTextMessageRecieved += ReceivedBwoink;
|
||||||
|
|
||||||
CommandBinds.Builder
|
CommandBinds.Builder
|
||||||
.Bind(ContentKeyFunctions.OpenAHelp,
|
.Bind(ContentKeyFunctions.OpenAHelp,
|
||||||
@@ -94,19 +99,26 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
CommandBinds.Unregister<AHelpUIController>();
|
CommandBinds.Unregister<AHelpUIController>();
|
||||||
|
|
||||||
DebugTools.Assert(_bwoinkSystem != null);
|
DebugTools.Assert(_bwoinkSystem != null);
|
||||||
_bwoinkSystem!.OnBwoinkTextMessageRecieved -= RecievedBwoink;
|
_bwoinkSystem!.OnBwoinkTextMessageRecieved -= ReceivedBwoink;
|
||||||
_bwoinkSystem = null;
|
_bwoinkSystem = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetAHelpPressed(bool pressed)
|
private void SetAHelpPressed(bool pressed)
|
||||||
{
|
{
|
||||||
if (AhelpButton == null || AhelpButton.Pressed == pressed)
|
if (GameAHelpButton != null)
|
||||||
return;
|
{
|
||||||
AhelpButton.StyleClasses.Remove(MenuButton.StyleClassRedTopButton);
|
GameAHelpButton.Pressed = pressed;
|
||||||
AhelpButton.Pressed = pressed;
|
}
|
||||||
|
|
||||||
|
if (LobbyAHelpButton != null)
|
||||||
|
{
|
||||||
|
LobbyAHelpButton.Pressed = pressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
UnreadAHelpRead();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RecievedBwoink(object? sender, SharedBwoinkSystem.BwoinkTextMessage message)
|
private void ReceivedBwoink(object? sender, SharedBwoinkSystem.BwoinkTextMessage message)
|
||||||
{
|
{
|
||||||
Logger.InfoS("c.s.go.es.bwoink", $"@{message.UserId}: {message.Text}");
|
Logger.InfoS("c.s.go.es.bwoink", $"@{message.UserId}: {message.Text}");
|
||||||
var localPlayer = _playerManager.LocalPlayer;
|
var localPlayer = _playerManager.LocalPlayer;
|
||||||
@@ -121,10 +133,12 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
}
|
}
|
||||||
|
|
||||||
EnsureUIHelper();
|
EnsureUIHelper();
|
||||||
|
|
||||||
if (!UIHelper!.IsOpen)
|
if (!UIHelper!.IsOpen)
|
||||||
{
|
{
|
||||||
AhelpButton?.StyleClasses.Add(MenuButton.StyleClassRedTopButton);
|
UnreadAHelpReceived();
|
||||||
}
|
}
|
||||||
|
|
||||||
UIHelper!.Receive(message);
|
UIHelper!.Receive(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,11 +172,6 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
SetAHelpPressed(UIHelper.IsOpen);
|
SetAHelpPressed(UIHelper.IsOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
|
||||||
{
|
|
||||||
UIHelper?.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Open()
|
public void Open()
|
||||||
{
|
{
|
||||||
var localPlayer = _playerManager.LocalPlayer;
|
var localPlayer = _playerManager.LocalPlayer;
|
||||||
@@ -226,6 +235,70 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
|
|||||||
helper.Control.PopOut.Disabled = true;
|
helper.Control.PopOut.Disabled = true;
|
||||||
helper.Control.PopOut.Visible = false;
|
helper.Control.PopOut.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UnreadAHelpReceived()
|
||||||
|
{
|
||||||
|
GameAHelpButton?.StyleClasses.Add(MenuButton.StyleClassRedTopButton);
|
||||||
|
LobbyAHelpButton?.StyleClasses.Add(StyleNano.StyleClassButtonColorRed);
|
||||||
|
_hasUnreadAHelp = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UnreadAHelpRead()
|
||||||
|
{
|
||||||
|
GameAHelpButton?.StyleClasses.Remove(MenuButton.StyleClassRedTopButton);
|
||||||
|
LobbyAHelpButton?.StyleClasses.Remove(StyleNano.StyleClassButtonColorRed);
|
||||||
|
_hasUnreadAHelp = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnStateEntered(GameplayState state)
|
||||||
|
{
|
||||||
|
if (GameAHelpButton != null)
|
||||||
|
{
|
||||||
|
GameAHelpButton.OnPressed -= AHelpButtonPressed;
|
||||||
|
GameAHelpButton.OnPressed += AHelpButtonPressed;
|
||||||
|
GameAHelpButton.Pressed = UIHelper?.IsOpen ?? false;
|
||||||
|
|
||||||
|
if (_hasUnreadAHelp)
|
||||||
|
{
|
||||||
|
UnreadAHelpReceived();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UnreadAHelpRead();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnStateExited(GameplayState state)
|
||||||
|
{
|
||||||
|
if (GameAHelpButton != null)
|
||||||
|
GameAHelpButton.OnPressed -= AHelpButtonPressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnStateEntered(LobbyState state)
|
||||||
|
{
|
||||||
|
if (LobbyAHelpButton != null)
|
||||||
|
{
|
||||||
|
LobbyAHelpButton.OnPressed -= AHelpButtonPressed;
|
||||||
|
LobbyAHelpButton.OnPressed += AHelpButtonPressed;
|
||||||
|
LobbyAHelpButton.Pressed = UIHelper?.IsOpen ?? false;
|
||||||
|
|
||||||
|
if (_hasUnreadAHelp)
|
||||||
|
{
|
||||||
|
UnreadAHelpReceived();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UnreadAHelpRead();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnStateExited(LobbyState state)
|
||||||
|
{
|
||||||
|
if (LobbyAHelpButton != null)
|
||||||
|
LobbyAHelpButton.OnPressed -= AHelpButtonPressed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// please kill all this indirection
|
// please kill all this indirection
|
||||||
|
|||||||
Reference in New Issue
Block a user