Add TriggerActionFactory and related resources for button and logic sequence components
This commit is contained in:
@@ -125,10 +125,12 @@ public partial class HudPresenterComponent : Control, IPresenterComponent
|
||||
var lookingAt = _world.GetComponent<IsLookingAtInteractableComponent>(_playerEntity);
|
||||
if (lookingAt != null)
|
||||
{
|
||||
var door = _world.GetComponent<DoorComponent>(lookingAt.Target);
|
||||
var targetEntity = lookingAt.Target;
|
||||
var interactKey = "F";
|
||||
|
||||
var door = _world.GetComponent<DoorComponent>(targetEntity);
|
||||
if (door != null)
|
||||
{
|
||||
var interactKey = "F";
|
||||
_interactLabel.Text = door.CurrentState switch
|
||||
{
|
||||
DoorComponent.DoorState.Locked => $"[{interactKey}] Interact (Locked)",
|
||||
@@ -140,7 +142,26 @@ public partial class HudPresenterComponent : Control, IPresenterComponent
|
||||
}
|
||||
else
|
||||
{
|
||||
_interactLabel.Visible = false;
|
||||
var button = _world.GetComponent<ButtonComponent>(targetEntity);
|
||||
if (button != null)
|
||||
{
|
||||
if (button.IsOneTimeUse && button.HasBeenUsed)
|
||||
{
|
||||
_interactLabel.Text = "(Used)";
|
||||
}
|
||||
else if (button.IsToggle)
|
||||
{
|
||||
_interactLabel.Text = button.IsPressed ? $"[{interactKey}] Deactivate" : $"[{interactKey}] Activate";
|
||||
}
|
||||
else
|
||||
{
|
||||
_interactLabel.Text = $"[{interactKey}] Press Button";
|
||||
}
|
||||
_interactLabel.Visible = true;
|
||||
} else
|
||||
{
|
||||
_interactLabel.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user