public void redrawLine() { ushort lineID = parent.CurrentSelectedId; TransportLine t = TLMController.instance.tm.m_lines.m_buffer[(int)lineID]; int stopsCount = t.CountStops(lineID); int vehicleCount = t.CountVehicles(lineID); Color lineColor = TLMController.instance.tm.GetLineColor(lineID); setLinearMapColor(lineColor); clearStations(); updateSubIconLayer(); setLineNumberCircle(lineID); if (lineID == 0) { var tsd = TransportSystemDefinition.from(parent.CurrentTransportInfo); if (tsd != default(TransportSystemDefinition)) { linearMapLineNumberFormat.backgroundSprite = TLMLineUtils.GetIconForIndex(tsd.toConfigIndex()); } lineStationsPanel.width = 0; return; } ItemClass.SubService ss = TLMCW.getDefinitionForLine(lineID).subService; linearMapLineNumberFormat.backgroundSprite = TLMLineUtils.getIconForLine(lineID); m_autoName = TLMLineUtils.calculateAutoName(lineID, true); linearMapLineNumber.tooltip = m_autoName; string stationName; Vector3 local; string airport, taxi, harbor, regionalStation, cableCarStation; string namePrefix; bool isComplete = (Singleton <TransportManager> .instance.m_lines.m_buffer[TLMController.instance.CurrentSelectedId].m_flags & TransportLine.Flags.Complete) != TransportLine.Flags.None; bool simmetric = TLMLineUtils.CalculateSimmetry(ss, stopsCount, t, out int middle); float addedWidth = 0; lineStationsPanel.width = 0; if (t.Info.m_transportType != TransportInfo.TransportType.Bus && t.Info.m_transportType != TransportInfo.TransportType.Tram && simmetric && !showExtraStopInfo) { int maxIt = middle + stopsCount / 2; for (int j = middle; j <= maxIt; j++) { ushort stationId = t.GetStop(j); local = getStation(lineID, stationId, ss, out stationName, out List <ushort> intersections, out airport, out harbor, out taxi, out regionalStation, out cableCarStation, out namePrefix); addedWidth = addStationToLinearMap(namePrefix, stationName, local, lineStationsPanel.width, intersections, airport, harbor, taxi, regionalStation, cableCarStation, stationId, ss, lineColor, false) + (j == middle + stopsCount / 2 ? 5 : 0); lineStationsPanel.width += addedWidth; } } else { int minI = 0, maxI = stopsCount; if (simmetric) { minI = middle + 1; maxI = stopsCount + middle + 1; } if (showExtraStopInfo) { int j = (minI - 1 + stopsCount) % stopsCount; ushort stationId = t.GetStop(j); local = getStation(lineID, stationId, ss, out stationName, out List <ushort> intersections, out airport, out harbor, out taxi, out regionalStation, out cableCarStation, out namePrefix); lineStationsPanel.width += addStationToLinearMap(namePrefix, stationName, local, lineStationsPanel.width, intersections, airport, harbor, taxi, regionalStation, cableCarStation, stationId, ss, lineColor, true); } else if (TLMSingleton.showDistanceInLinearMap || parent.ForceShowStopsDistances) { minI--; } for (int i = minI; i < maxI; i++) { int j = (i + stopsCount) % stopsCount; ushort stationId = t.GetStop(j); local = getStation(lineID, stationId, ss, out stationName, out List <ushort> intersections, out airport, out harbor, out taxi, out regionalStation, out cableCarStation, out namePrefix); addedWidth = addStationToLinearMap(namePrefix, stationName, local, lineStationsPanel.width, intersections, airport, harbor, taxi, regionalStation, cableCarStation, stationId, ss, lineColor, false); lineStationsPanel.width += addedWidth; } } lineStationsPanel.width -= addedWidth; if (showExtraStopInfo) { vehiclesOnStation.Clear(); for (int v = 0; v < vehicleCount; v++) { ushort vehicleId = t.GetVehicle(v); AddVehicleToLinearMap(lineColor, vehicleId); } } }