Fix action bar not filling with mappables (#17218)

* Fix action bar not filling with mappables

* Update Content.Client/UserInterface/Systems/Actions/ActionUIController.cs

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Vordenburg
2023-06-15 15:21:52 -04:00
committed by GitHub
parent db1e9ed8d7
commit 18837c305d
3 changed files with 16 additions and 1 deletions

View File

@@ -157,6 +157,7 @@ public sealed class DecalPlacementSystem : EntitySystem
DisplayName = $"{_decalId} ({_decalColor.ToHex()}, {(int) _decalAngle.Degrees})", // non-unique actions may be considered duplicates when saving/loading. DisplayName = $"{_decalId} ({_decalColor.ToHex()}, {(int) _decalAngle.Degrees})", // non-unique actions may be considered duplicates when saving/loading.
Icon = decalProto.Sprite, Icon = decalProto.Sprite,
Repeat = true, Repeat = true,
ClientExclusive = true,
CheckCanAccess = false, CheckCanAccess = false,
CheckCanInteract = false, CheckCanInteract = false,
Range = -1, Range = -1,

View File

@@ -84,6 +84,7 @@ public sealed partial class MappingSystem : EntitySystem
ev.Action = new InstantAction() ev.Action = new InstantAction()
{ {
ClientExclusive = true,
CheckCanInteract = false, CheckCanInteract = false,
Event = actionEvent, Event = actionEvent,
DisplayName = Loc.GetString(tileDef.Name), DisplayName = Loc.GetString(tileDef.Name),
@@ -97,6 +98,7 @@ public sealed partial class MappingSystem : EntitySystem
{ {
ev.Action = new InstantAction() ev.Action = new InstantAction()
{ {
ClientExclusive = true,
CheckCanInteract = false, CheckCanInteract = false,
Event = actionEvent, Event = actionEvent,
DisplayName = "action-name-mapping-erase", DisplayName = "action-name-mapping-erase",
@@ -111,6 +113,7 @@ public sealed partial class MappingSystem : EntitySystem
ev.Action = new InstantAction() ev.Action = new InstantAction()
{ {
ClientExclusive = true,
CheckCanInteract = false, CheckCanInteract = false,
Event = actionEvent, Event = actionEvent,
DisplayName = actionEvent.EntityType, DisplayName = actionEvent.EntityType,

View File

@@ -668,7 +668,18 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
{ {
if (args.Function == EngineKeyFunctions.UIClick) if (args.Function == EngineKeyFunctions.UIClick)
{ {
_menuDragHelper.MouseDown(button); if (button.Action == null)
{
var ev = new FillActionSlotEvent();
EntityManager.EventBus.RaiseEvent(EventSource.Local, ev);
if (ev.Action != null)
SetAction(button, ev.Action);
}
else
{
_menuDragHelper.MouseDown(button);
}
args.Handle(); args.Handle();
} }
else if (args.Function == EngineKeyFunctions.UIRightClick) else if (args.Function == EngineKeyFunctions.UIRightClick)