Swap the positions of AHelp and Rules in the main interface (#7957)

suggested by Kaylie
This commit is contained in:
20kdc
2022-05-06 04:46:33 +01:00
committed by GitHub
parent d332c829e8
commit 330fb13b25
7 changed files with 26 additions and 62 deletions

View File

@@ -2,6 +2,7 @@ using System;
using System.Linq;
using Content.Client.HUD.UI;
using Content.Client.Info;
using Content.Client.Administration;
using Content.Client.Resources;
using Content.Client.Targeting;
using Content.Shared.CCVar;
@@ -55,7 +56,6 @@ namespace Content.Client.HUD
internal sealed partial class GameHud : IGameHud
{
private RulesAndInfoWindow _rulesAndInfoWindow = default!;
private TargetingDoll _targetingDoll = default!;
private BoxContainer _combatPanelContainer = default!;
private BoxContainer _topNotificationContainer = default!;
@@ -129,13 +129,10 @@ namespace Content.Client.HUD
RootControl.AddChild(GenerateButtonBar(_resourceCache, _inputManager));
InventoryButtonToggled += down => TopInventoryQuickButtonContainer.Visible = down;
InfoButtonToggled += _ => ButtonInfoOnOnToggled();
_rulesAndInfoWindow = new RulesAndInfoWindow();
_rulesAndInfoWindow.OnClose += () => InfoButtonDown = false;
InfoButtonPressed += () => ButtonInfoOnPressed();
_inputManager.SetInputCommand(ContentKeyFunctions.OpenInfo,
InputCmdHandler.FromDelegate(s => ButtonInfoOnOnToggled()));
InputCmdHandler.FromDelegate(s => ButtonInfoOnPressed()));
_combatPanelContainer = new BoxContainer
{
@@ -256,25 +253,16 @@ namespace Content.Client.HUD
LC.SetGrowVertical(VoteContainer, LC.GrowDirection.End);
}
private void ButtonInfoOnOnToggled()
private void ButtonInfoOnPressed()
{
if (_rulesAndInfoWindow.IsOpen)
var bwoinkSystem = EntitySystem.Get<BwoinkSystem>();
if (bwoinkSystem.IsOpen)
{
if (!_rulesAndInfoWindow.IsAtFront())
{
_rulesAndInfoWindow.MoveToFront();
InfoButtonDown = true;
}
else
{
_rulesAndInfoWindow.Close();
InfoButtonDown = false;
}
bwoinkSystem.Close();
}
else
{
_rulesAndInfoWindow.OpenCentered();
InfoButtonDown = true;
bwoinkSystem.Open();
}
}