Add a wait time for the rules popup (#5823)

* Create new rules popup

* Implement accept and quit buttons

* Add rules accept timer

Forces the player to read the rules by making them wait.

Speed reading the rules took me just under 45 seconds which means it'll take longer than that if someone's reading this for the first time.

* Fix info rules header

* Change _rulesPopup to local variable
This commit is contained in:
ShadowCommander
2021-12-24 17:32:33 -08:00
committed by GitHub
parent 944b4fb073
commit be6cb75122
10 changed files with 167 additions and 19 deletions

View File

@@ -6,7 +6,6 @@ using Content.Client.Info;
using Content.Client.Resources;
using Content.Client.Stylesheets;
using Content.Client.Targeting;
using Content.Shared;
using Content.Shared.CCVar;
using Content.Shared.HUD;
using Content.Shared.Input;
@@ -304,8 +303,6 @@ namespace Content.Client.HUD
_rulesAndInfoWindow = new RulesAndInfoWindow();
IoCManager.Resolve<RulesManager>().OpenRulesAndInfoWindow += OpenRulesAndInfoWindow;
_rulesAndInfoWindow.OnClose += () => _buttonInfo.Pressed = false;
_inputManager.SetInputCommand(ContentKeyFunctions.OpenInfo,
@@ -431,12 +428,6 @@ namespace Content.Client.HUD
LC.SetGrowVertical(VoteContainer, LC.GrowDirection.End);
}
private void OpenRulesAndInfoWindow()
{
_rulesAndInfoWindow.OpenCentered();
_buttonInfo.Pressed = true;
}
private void ButtonInfoOnOnToggled()
{
_buttonInfo.StyleClasses.Remove(TopButton.StyleClassRedTopButton);