mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-29 19:47:48 +03:00
* Hardlight bow rebalance. * Clumsy proof. (cherry picked from commit 8dd06fd71bd100777721bd2cee9b7345c127af41)
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using Content.Shared._Goobstation.Weapons.AmmoSelector;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Client.Input;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Client._Goobstation.AmmoSelector;
|
|
|
|
[UsedImplicitly]
|
|
public sealed class AmmoSelectorMenuBoundUserInterface : BoundUserInterface
|
|
{
|
|
[Dependency] private readonly IClyde _displayManager = default!;
|
|
[Dependency] private readonly IInputManager _inputManager = default!;
|
|
|
|
private AmmoSelectorMenu? _menu;
|
|
|
|
public AmmoSelectorMenuBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
IoCManager.InjectDependencies(this);
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_menu = this.CreateWindow<AmmoSelectorMenu>();
|
|
_menu.SetEntity(Owner);
|
|
_menu.SendAmmoSelectorSystemMessageAction += SendAmmoSelectorSystemMessage;
|
|
|
|
var vpSize = _displayManager.ScreenSize;
|
|
_menu.OpenCenteredAt(_inputManager.MouseScreenPosition.Position / vpSize);
|
|
}
|
|
|
|
public void SendAmmoSelectorSystemMessage(ProtoId<SelectableAmmoPrototype> protoId)
|
|
{
|
|
SendPredictedMessage(new AmmoSelectedMessage(protoId));
|
|
}
|
|
}
|