Action container rejig (#20260)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Leon Friedrich
2023-09-23 04:49:39 -04:00
committed by GitHub
parent c80c90ed65
commit 684b334806
50 changed files with 889 additions and 740 deletions

View File

@@ -55,7 +55,7 @@ namespace Content.Client.Ghost
{
base.Initialize();
SubscribeLocalEvent<GhostComponent, ComponentInit>(OnGhostInit);
SubscribeLocalEvent<GhostComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<GhostComponent, ComponentRemove>(OnGhostRemove);
SubscribeLocalEvent<GhostComponent, AfterAutoHandleStateEvent>(OnGhostState);
@@ -72,16 +72,10 @@ namespace Content.Client.Ghost
SubscribeLocalEvent<GhostComponent, ToggleGhostsActionEvent>(OnToggleGhosts);
}
private void OnGhostInit(EntityUid uid, GhostComponent component, ComponentInit args)
private void OnStartup(EntityUid uid, GhostComponent component, ComponentStartup args)
{
if (TryComp(uid, out SpriteComponent? sprite))
{
sprite.Visible = GhostVisibility;
}
_actions.AddAction(uid, ref component.ToggleLightingActionEntity, component.ToggleGhostsAction);
_actions.AddAction(uid, ref component.ToggleFoVActionEntity, component.ToggleFoVAction);
_actions.AddAction(uid, ref component.ToggleGhostsActionEntity, component.ToggleGhostsAction);
}
private void OnToggleLighting(EntityUid uid, GhostComponent component, ToggleLightingActionEvent args)