Improved top menu (#2949)
* #272 proper open sides in menu buttons * #272 WIP, good starting point for making the top menu work well at different UI scales * #272 WIP top menu looking better, but inconsistent size * #272 WIP esc nice and big * #272 consistently sized top buttons * #272 proper highlighting of top menu elements * #272 proper highlighting of top menu elements * #272 nice shiny red tutorial button * #272 better tutorial icon * #272 missed svg changes * #272 consistently sized top menu * #272 better padding / alignment of top bar with other UI sections * #272 fix hamburger menu height to match others * #272 top menu name set based on keybind, use shortened names if possible * #272 top menu name set based on keybind, use shortened names if possible * #272 add top menu actions button * #272 add top menu admin button * #272 fix sandbox top button down status * #272 remove todo
This commit is contained in:
@@ -32,6 +32,7 @@ namespace Content.Client.UserInterface
|
||||
private readonly ActionManager _actionManager;
|
||||
private readonly IEntityManager _entityManager;
|
||||
private readonly IGameTiming _gameTiming;
|
||||
private readonly IGameHud _gameHud;
|
||||
|
||||
private readonly ActionSlot[] _slots;
|
||||
|
||||
@@ -80,13 +81,15 @@ namespace Content.Client.UserInterface
|
||||
_actionManager = IoCManager.Resolve<ActionManager>();
|
||||
_entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
_gameTiming = IoCManager.Resolve<IGameTiming>();
|
||||
_gameHud = IoCManager.Resolve<IGameHud>();
|
||||
_menu = new ActionMenu(_actionsComponent, this);
|
||||
|
||||
LayoutContainer.SetGrowHorizontal(this, LayoutContainer.GrowDirection.End);
|
||||
LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.End);
|
||||
LayoutContainer.SetAnchorTop(this, 0f);
|
||||
LayoutContainer.SetAnchorBottom(this, 0.8f);
|
||||
LayoutContainer.SetMarginLeft(this, 10);
|
||||
LayoutContainer.SetMarginTop(this, 100);
|
||||
LayoutContainer.SetMarginLeft(this, 13);
|
||||
LayoutContainer.SetMarginTop(this, 110);
|
||||
|
||||
SizeFlagsHorizontal = SizeFlags.None;
|
||||
SizeFlagsVertical = SizeFlags.FillExpand;
|
||||
@@ -208,6 +211,9 @@ namespace Content.Client.UserInterface
|
||||
_lockButton.OnPressed += OnLockPressed;
|
||||
_settingsButton.OnPressed += OnToggleActionsMenu;
|
||||
_loadoutContainer.OnKeyBindDown += OnHotbarPaginate;
|
||||
_gameHud.ActionsButtonToggled += OnToggleActionsMenuTopButton;
|
||||
_gameHud.ActionsButtonDown = false;
|
||||
_gameHud.ActionsButtonVisible = true;
|
||||
}
|
||||
|
||||
protected override void ExitedTree()
|
||||
@@ -218,6 +224,9 @@ namespace Content.Client.UserInterface
|
||||
_lockButton.OnPressed -= OnLockPressed;
|
||||
_settingsButton.OnPressed -= OnToggleActionsMenu;
|
||||
_loadoutContainer.OnKeyBindDown -= OnHotbarPaginate;
|
||||
_gameHud.ActionsButtonToggled -= OnToggleActionsMenuTopButton;
|
||||
_gameHud.ActionsButtonDown = false;
|
||||
_gameHud.ActionsButtonVisible = false;
|
||||
}
|
||||
|
||||
protected override Vector2 CalculateMinimumSize()
|
||||
@@ -496,6 +505,13 @@ namespace Content.Client.UserInterface
|
||||
ToggleActionsMenu();
|
||||
}
|
||||
|
||||
|
||||
private void OnToggleActionsMenuTopButton(bool open)
|
||||
{
|
||||
if (open == _menu.IsOpen) return;
|
||||
ToggleActionsMenu();
|
||||
}
|
||||
|
||||
public void ToggleActionsMenu()
|
||||
{
|
||||
if (_menu.IsOpen)
|
||||
|
||||
Reference in New Issue
Block a user