private EntityUid?GetShuttleConsole(CargoPilotConsoleComponent component) { var stationUid = _station.GetOwningStation(component.Owner); if (!TryComp <StationCargoOrderDatabaseComponent>(stationUid, out var orderDatabase) || !TryComp <CargoShuttleComponent>(orderDatabase.Shuttle, out var shuttle)) { return(null); } return(GetShuttleConsole(shuttle)); }
private void OnCargoPilotConsoleClose(EntityUid uid, CargoPilotConsoleComponent component, BoundUIClosedEvent args) { component.Entity = null; }
private void OnCargoGetConsole(EntityUid uid, CargoPilotConsoleComponent component, ref ConsoleShuttleEvent args) { args.Console = GetShuttleConsole(component); }
private void OnCargoPilotConsoleOpen(EntityUid uid, CargoPilotConsoleComponent component, AfterActivatableUIOpenEvent args) { component.Entity = GetShuttleConsole(component); }