private void OnVerb(EntityUid uid, DockingComponent component, GetVerbsEvent <InteractionVerb> args) { if (!args.CanInteract || !args.CanAccess) { return; } InteractionVerb?verb; // TODO: Have it open the UI and have the UI do this. if (!component.Docked && TryComp(uid, out PhysicsComponent? body) && TryComp(uid, out TransformComponent? xform)) { DockingComponent?otherDock = null; if (component.Enabled) { otherDock = GetDockable(body, xform); } verb = new InteractionVerb { Disabled = otherDock == null, Text = Loc.GetString("docking-component-dock"), Act = () => { if (otherDock == null) { return; } TryDock(component, otherDock); } }; } else if (component.Docked) { verb = new InteractionVerb { Disabled = !component.Docked, Text = Loc.GetString("docking-component-undock"), Act = () => { if (component.DockedWith == null || !component.Enabled) { return; } Undock(component); } }; } else { return; } args.Verbs.Add(verb); }
private void OnGetInteractionVerbs(EntityUid uid, FireExtinguisherComponent component, GetVerbsEvent <InteractionVerb> args) { if (!args.CanInteract) { return; } var verb = new InteractionVerb { Act = () => ToggleSafety(uid, args.User, component), Text = Loc.GetString("fire-extinguisher-component-verb-text"), }; args.Verbs.Add(verb); }