Slightly improve action ui performance (#20799)
This commit is contained in:
@@ -3,16 +3,18 @@ using Content.Shared.Input;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Input;
|
||||
|
||||
namespace Content.Client.UserInterface.Systems.Actions.Widgets;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class ActionsBar : UIWidget
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entity = default!;
|
||||
|
||||
public ActionsBar()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
var keys = ContentKeyFunctions.GetHotbarBoundKeys();
|
||||
for (var index = 1; index < keys.Length; index++)
|
||||
@@ -24,7 +26,7 @@ public sealed partial class ActionsBar : UIWidget
|
||||
ActionButton MakeButton(int index)
|
||||
{
|
||||
var boundKey = keys[index];
|
||||
var button = new ActionButton();
|
||||
var button = new ActionButton(_entity);
|
||||
button.KeyBind = boundKey;
|
||||
button.Label.Text = index.ToString();
|
||||
return button;
|
||||
|
||||
Reference in New Issue
Block a user