diff --git a/locales/be.tsv b/locales/be.tsv index a5a2c8e..c49bc76 100644 --- a/locales/be.tsv +++ b/locales/be.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Клікніце 2- Aligned angle! (Ctrl+Z to undo) Кут выраўнаваны! (Ctrl+Z для адмены) Vertex snap complete Прывязка вяршыні завершана Align vertex angle Выраўнаваць кут вяршыні +Complete to Дабудаваць да +Complete to: a new piece between the free ends of the selected splines Дабудаваць да: новы кавалак паміж свабоднымі канцамі выбраных сплайнаў +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Новы кавалак тыпу першага выбранага сплайна паміж двума свабоднымі канцамі выбраных сплайнаў, што супадае з абодвума па месцы, кірунку і вышыні; самі яны не мяняюцца. Яшчэ раз: злучаюцца два канцы, што засталіся, кальцо замыкаецца. +The two ends already meet Гэтыя два канцы ўжо сыходзяцца +Select the splines whose free ends are to be joined Выберыце сплайны, свабодныя канцы якіх трэба злучыць +No piece of spline can join these two ends Ніякі кавалак сплайна не злучыць гэтыя два канцы +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Адкрыта копія гэтай карты openMapper у тэчцы змесціва (карта ў тэчцы OMSI 2 не змяняецца) +Read in again, changed on disk by another program: Загружана нанова, зменена на дыску іншай праграмай: +Could not bring the changes over Не ўдалося перанесці змены +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Файлы карты зменены пасля гэтага аўтазахавання (іншай праграмай, напрыклад рэдактарам OMSI 2). Аднаўленне пакладзе старыя тайлы з аўтазахавання па-над гэтымі зменамі. +tile(s) тайл(аў) +the global settings агульныя налады +the timetable расклад +the traffic рух +the descriptions апісанні +Reload from disk Загрузіць з дыска +The map changed on disk Карта змянілася на дыску +Another program changed the map's files where it has changes here not saved yet: Іншая праграма змяніла файлы карты там, дзе тут ёсць незахаваныя змены: +The other changes made on disk were read in already. Астатнія змены з дыска ўжо загружаны. +Keep mine Пакінуць мае +The map changed in OMSI 2's folder Карта змянілася ў тэчцы OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Копія гэтай карты ва ўсталёўцы OMSI 2 зменена пасля захавання копіі openMapper у тэчцы змесціва, напрыклад рэдактарам OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Перанос заменіць гэтыя файлы ў копіі openMapper; замененыя файлы захоўваюцца ў рэзервовай копіі (Файл > Ранейшыя версіі). +Bring the changes over Перанесці змены +Keep openMapper's copy Пакінуць копію openMapper +its way has a gap after path у яго шляху разрыў пасля шляху +its way does not pass яго шлях не праходзіць ля +On demand Па патрабаванні +Not served (checkpoint) Не абслугоўваецца (кантрольны пункт) +Wait for departure time Чакаць часу адпраўлення +Always + wait for departure time Заўсёды + чакаць часу адпраўлення +The bus stops only when somebody waits or wants to get off (the game's default) Аўтобус спыняецца, толькі калі хтосьці чакае або хоча выйсці (так па змаўчанні ў гульні) +The bus always stops here Аўтобус заўсёды тут спыняецца +The bus drives past without stopping: the stop only marks the way (a checkpoint) Аўтобус праязджае, не спыняючыся: прыпынак толькі пазначае шлях (кантрольны пункт) +The bus stops only when it is early, and waits there for its departure time Аўтобус спыняецца, толькі калі ідзе раней часу, і чакае там часу адпраўлення +The bus always stops here, and when it is early it waits for its departure time Аўтобус заўсёды тут спыняецца, а калі ідзе раней часу, чакае часу адпраўлення +All trips Усе рэйсы +Every trip of the map, those no tour drives too Усе рэйсы карты, і тыя, па якіх не ездзіць ніводзін абарот +The line number the trip shows; the line of this number lists it among its trips Нумар лініі, які паказвае рэйс; лінія з гэтым нумарам паказвае яго сярод сваіх рэйсаў +Way picked by hand: Шлях абраны ўручную: +the paths picked do not pass this stop абраныя шляхі не праходзяць ля гэтага прыпынку +Other trips Іншыя рэйсы +The time profile this departure runs to Профіль часу гэтага адпраўлення +Time profile Профіль часу +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to У рэйса можа быць некалькі профіляў (час пік, ноч…): кожнае адпраўленне абарота паказвае, па якім яно ідзе +The profile's name Імя профілю +A new profile, a copy of this one Новы профіль, копія гэтага +Delete this profile (its departures run to the first) Выдаліць гэты профіль (яго адпраўленні пойдуць па першым) +Times from stop to stop Час ад прыпынку да прыпынку +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. У кожнага прыпынку можна задаць час ад папярэдняга: наступныя часы зрушваюцца, а з імі і час рэйса. Незададзеныя часы ідуць за адлегласцю паміж замацаванымі; на замацаваным прыпынку аўтобус, які прыйшоў раней, чакае. +From the stop before Ад папярэдняга +After departure Пасля адпраўлення +Minutes from the stop before to this one Хвіліны ад папярэдняга прыпынку да гэтага +As in OMSI 2's editor. Hover a choice to see what the bus does. Як у рэдактары OMSI 2. Навядзіце на варыянт, каб убачыць, што робіць аўтобус. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Усе рэйсы карты, якая б лінія іх ні паказвала і які б абарот ні ездзіў. Рэйс, па якім не ездзіць ніводзін абарот, захоўваецца: яго можна правіць, даць абароту або выдаліць тут. +trips рэйсаў +driven by no tour без абаротаў +no tour няма абаротаў +departures адпр. +No path there: click a lane of a road (View > AI lanes shows them) Тут няма шляху: пстрыкніце па паласе дарогі (Выгляд > Паласы ШІ паказвае іх) +Done picking paths Гатова +Pick the paths on the map Абраць шляхі на карце +Choose the way yourself, path by path, as in OMSI 2's editor Абярыце шлях самі, шлях за шляхам, як у рэдактары OMSI 2 +Find the way automatically Знайсці шлях аўтаматычна +Forget the paths picked: the way is found along the roads again Забыць абраныя шляхі: шлях зноў знойдзецца па дарогах +The paths were picked by hand: they are kept when the stops change. Шляхі абраны ўручную: яны захоўваюцца пры змене прыпынкаў. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Пстрыкайце шляхі на карце. Шлях пасля канца або перад пачаткам дадаецца разам са шляхамі да яго; шлях збоку замяняе ўчастак, які ён аб'язджае (іншая галіна на скрыжаванні); шлях з маршруту прыбіраецца. Шлях можа ісці і да першага прыпынку, і пасля апошняга. +The way breaks after path Шлях перарываецца пасля шляху +the paths do not join, the bus's GPS loses its way here in the game шляхі не злучаны, GPS аўтобуса ў гульні тут губляе маршрут +Paths of the way Шляхі маршруту +Cut before the first stop Прыбраць да першага прыпынку +Cut after the last stop Прыбраць пасля апошняга прыпынку +path шлях diff --git a/locales/ca.tsv b/locales/ca.tsv index 68027e5..10dc66a 100644 --- a/locales/ca.tsv +++ b/locales/ca.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Feu clic a un 2n pun Aligned angle! (Ctrl+Z to undo) Angle alineat! (Ctrl+Z per desfer) Vertex snap complete Ajust de vèrtex completat Align vertex angle Alinea l'angle del vèrtex +Complete to Completa fins a +Complete to: a new piece between the free ends of the selected splines Completa fins a: un tram nou entre els extrems lliures de les splines seleccionades +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Un tram nou del tipus de la primera spline seleccionada entre dos extrems lliures de les splines seleccionades, que coincideix amb tots dos en posició, direcció i alçada; aquestes no canvien. Un altre cop: s'uneixen els dos extrems que queden i es tanca l'anell. +The two ends already meet Els dos extrems ja es troben +Select the splines whose free ends are to be joined Selecciona les splines els extrems lliures de les quals s'han d'unir +No piece of spline can join these two ends Cap tram de spline no pot unir aquests dos extrems +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) S'ha obert la còpia d'openMapper d'aquest mapa a la carpeta de contingut (la de la carpeta d'OMSI 2 no s'escriu mai) +Read in again, changed on disk by another program: Llegit de nou, canviat al disc per un altre programa: +Could not bring the changes over No s'han pogut portar els canvis +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Els fitxers del mapa es van canviar després d'aquest desament automàtic (per un altre programa, com l'editor d'OMSI 2). Restaurar posa les caselles antigues del desament sobre aquests canvis. +tile(s) casella(es) +the global settings la configuració global +the timetable l'horari +the traffic el trànsit +the descriptions les descripcions +Reload from disk Torna a carregar des del disc +The map changed on disk El mapa ha canviat al disc +Another program changed the map's files where it has changes here not saved yet: Un altre programa ha canviat fitxers del mapa on aquí hi ha canvis sense desar: +The other changes made on disk were read in already. La resta de canvis del disc ja s'han llegit. +Keep mine Conserva els meus +The map changed in OMSI 2's folder El mapa ha canviat a la carpeta d'OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say La còpia d'aquest mapa a la instal·lació es va canviar després de desar la còpia d'openMapper a la carpeta de contingut, per exemple amb l'editor d'OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Portar els canvis substitueix aquests fitxers de la còpia d'openMapper; els fitxers substituïts es guarden en una còpia de seguretat (Fitxer > Versions anteriors). +Bring the changes over Porta els canvis +Keep openMapper's copy Conserva la còpia d'openMapper +its way has a gap after path el seu camí té un buit després del camí +its way does not pass el seu camí no passa per +On demand A demanda +Not served (checkpoint) Sense servei (punt de control) +Wait for departure time Esperar l'hora de sortida +Always + wait for departure time Sempre + esperar l'hora de sortida +The bus stops only when somebody waits or wants to get off (the game's default) L'autobús només para si algú espera o vol baixar (el predeterminat del joc) +The bus always stops here L'autobús sempre para aquí +The bus drives past without stopping: the stop only marks the way (a checkpoint) L'autobús passa sense parar: la parada només marca el camí (un punt de control) +The bus stops only when it is early, and waits there for its departure time L'autobús només para si va avançat, i hi espera la seva hora de sortida +The bus always stops here, and when it is early it waits for its departure time L'autobús sempre para aquí, i si va avançat espera la seva hora de sortida +All trips Tots els viatges +Every trip of the map, those no tour drives too Tots els viatges del mapa, també els que no fa cap torn +The line number the trip shows; the line of this number lists it among its trips El número de línia que mostra el viatge; la línia amb aquest número el mostra entre els seus viatges +Way picked by hand: Camí triat a mà: +the paths picked do not pass this stop els camins triats no passen per aquesta parada +Other trips Altres viatges +The time profile this departure runs to El perfil de temps que segueix aquesta sortida +Time profile Perfil de temps +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Un viatge pot tenir diversos perfils (hora punta, nit…): cada sortida d'un torn diu quin segueix +The profile's name El nom del perfil +A new profile, a copy of this one Un perfil nou, còpia d'aquest +Delete this profile (its departures run to the first) Elimina aquest perfil (les seves sortides segueixen el primer) +Times from stop to stop Temps de parada a parada +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. El temps des de la parada anterior es pot fixar a cada parada: els temps següents es desplacen, i amb ells el temps del viatge. Els temps no fixats segueixen la distància entre els fixats; en una parada fixada, un autobús avançat espera. +From the stop before Des de la parada anterior +After departure Després de la sortida +Minutes from the stop before to this one Minuts des de la parada anterior fins a aquesta +As in OMSI 2's editor. Hover a choice to see what the bus does. Com a l'editor d'OMSI 2. Passeu el ratolí per una opció per veure què fa l'autobús. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Tots els viatges del mapa, sigui quina sigui la línia que els mostra o el torn que els fa. Un viatge que no fa cap torn es conserva, i aquí es pot editar, donar a un torn o eliminar. +trips viatges +driven by no tour sense cap torn +no tour sense torn +departures sortides +No path there: click a lane of a road (View > AI lanes shows them) Aquí no hi ha cap camí: feu clic a un carril d'una carretera (Visualitza > Carrils d'IA els mostra) +Done picking paths Fet +Pick the paths on the map Tria els camins al mapa +Choose the way yourself, path by path, as in OMSI 2's editor Trieu el camí vosaltres, camí a camí, com a l'editor d'OMSI 2 +Find the way automatically Troba el camí automàticament +Forget the paths picked: the way is found along the roads again Oblida els camins triats: el camí es torna a trobar per les carreteres +The paths were picked by hand: they are kept when the stops change. Els camins s'han triat a mà: es conserven quan canvien les parades. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Feu clic a camins a la vista. Un després del final o abans de l'inici s'afegeix, amb els camins fins a ell; un al costat del recorregut ocupa el lloc del tram que envolta (una altra branca en una cruïlla); un camí del recorregut es treu. El recorregut pot començar abans de la primera parada i continuar després de l'última. +The way breaks after path El camí s'interromp després del camí +the paths do not join, the bus's GPS loses its way here in the game els camins no s'uneixen, el GPS de l'autobús s'hi perd en el joc +Paths of the way Camins del recorregut +Cut before the first stop Retalla abans de la primera parada +Cut after the last stop Retalla després de l'última parada +path camí diff --git a/locales/cs.tsv b/locales/cs.tsv index c80d371..69e9f99 100644 --- a/locales/cs.tsv +++ b/locales/cs.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Klikněte na 2. refe Aligned angle! (Ctrl+Z to undo) Úhel zarovnán! (Ctrl+Z pro vrácení zpět) Vertex snap complete Přichycení vrcholu dokončeno Align vertex angle Zarovnat úhel vrcholu +Complete to Dokončit k +Complete to: a new piece between the free ends of the selected splines Dokončit k: nový kus mezi volnými konci vybraných splinů +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Nový kus typu prvního vybraného splinu mezi dvěma volnými konci vybraných splinů, navazující na oba polohou, směrem i výškou; ty samy se nemění. Znovu: spojí se dva zbylé konce a kruh se uzavře. +The two ends already meet Tyto dva konce se už stýkají +Select the splines whose free ends are to be joined Vyberte spliny, jejichž volné konce se mají spojit +No piece of spline can join these two ends Žádný kus splinu tyto dva konce nespojí +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Otevřena kopie této mapy od openMapperu ve složce obsahu (mapa ve složce OMSI 2 se nikdy nezapisuje) +Read in again, changed on disk by another program: Načteno znovu, změněno na disku jiným programem: +Could not bring the changes over Změny se nepodařilo převzít +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Soubory mapy byly změněny po tomto automatickém uložení (jiným programem, např. editorem OMSI 2). Obnovení položí starší dlaždice z uložení přes tyto změny. +tile(s) dlaždice +the global settings globální nastavení +the timetable jízdní řád +the traffic provoz +the descriptions popisy +Reload from disk Znovu načíst z disku +The map changed on disk Mapa se na disku změnila +Another program changed the map's files where it has changes here not saved yet: Jiný program změnil soubory mapy tam, kde jsou zde neuložené změny: +The other changes made on disk were read in already. Ostatní změny z disku už byly načteny. +Keep mine Ponechat moje +The map changed in OMSI 2's folder Mapa se změnila ve složce OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Kopie této mapy v instalaci byla změněna po uložení kopie openMapperu ve složce obsahu, např. editorem OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Převzetí změn nahradí tyto soubory v kopii openMapperu; nahrazené soubory zůstanou v záloze (Soubor > Dřívější verze). +Bring the changes over Převzít změny +Keep openMapper's copy Ponechat kopii openMapperu +its way has a gap after path jeho trasa má mezeru za cestou +its way does not pass jeho trasa nevede kolem +On demand Na znamení +Not served (checkpoint) Neobsluhovaná (kontrolní bod) +Wait for departure time Čekat na čas odjezdu +Always + wait for departure time Vždy + čekat na čas odjezdu +The bus stops only when somebody waits or wants to get off (the game's default) Autobus zastaví, jen když někdo čeká nebo chce vystoupit (výchozí ve hře) +The bus always stops here Autobus tu vždy zastaví +The bus drives past without stopping: the stop only marks the way (a checkpoint) Autobus projede bez zastavení: zastávka jen vyznačuje trasu (kontrolní bod) +The bus stops only when it is early, and waits there for its departure time Autobus zastaví, jen když jede napřed, a čeká tam na čas odjezdu +The bus always stops here, and when it is early it waits for its departure time Autobus tu vždy zastaví, a když jede napřed, čeká na čas odjezdu +All trips Všechny spoje +Every trip of the map, those no tour drives too Každý spoj mapy, i ty, které nejede žádný turnus +The line number the trip shows; the line of this number lists it among its trips Číslo linky, které spoj ukazuje; linka s tímto číslem ho uvádí mezi svými spoji +Way picked by hand: Trasa vybraná ručně: +the paths picked do not pass this stop vybrané cesty nevedou kolem této zastávky +Other trips Ostatní spoje +The time profile this departure runs to Časový profil, podle kterého jede tento odjezd +Time profile Časový profil +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Spoj může mít několik profilů (špička, noc…): každý odjezd turnusu říká, podle kterého jede +The profile's name Název profilu +A new profile, a copy of this one Nový profil, kopie tohoto +Delete this profile (its departures run to the first) Smazat tento profil (jeho odjezdy pojedou podle prvního) +Times from stop to stop Časy od zastávky k zastávce +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. U každé zastávky lze nastavit čas od předchozí: další časy se posunou a s nimi i čas spoje. Nenastavené časy se řídí vzdáleností mezi pevnými; na pevné zastávce autobus, který jede napřed, čeká. +From the stop before Od předchozí zastávky +After departure Po odjezdu +Minutes from the stop before to this one Minuty od předchozí zastávky k této +As in OMSI 2's editor. Hover a choice to see what the bus does. Jako v editoru OMSI 2. Najeďte na volbu a uvidíte, co autobus udělá. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Každý spoj mapy, ať ho ukazuje kterákoli linka nebo jede kterýkoli turnus. Spoj, který nejede žádný turnus, zůstává a lze ho tu upravit, dát turnusu nebo smazat. +trips spojů +driven by no tour nejede žádný turnus +no tour žádný turnus +departures odjezdů +No path there: click a lane of a road (View > AI lanes shows them) Tady není cesta: klikněte na pruh silnice (Zobrazení > Pruhy AI je ukáže) +Done picking paths Hotovo +Pick the paths on the map Vybrat cesty na mapě +Choose the way yourself, path by path, as in OMSI 2's editor Vyberte trasu sami, cestu po cestě, jako v editoru OMSI 2 +Find the way automatically Najít trasu automaticky +Forget the paths picked: the way is found along the roads again Zapomenout vybrané cesty: trasa se znovu najde podél silnic +The paths were picked by hand: they are kept when the stops change. Cesty byly vybrány ručně: při změně zastávek zůstanou. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Klikejte na cesty v pohledu. Cesta za koncem nebo před začátkem se přidá i s cestami k ní; cesta vedle trasy nahradí úsek, který objíždí (jiná větev na křižovatce); cesta z trasy se odebere. Trasa smí začínat před první zastávkou a pokračovat za poslední. +The way breaks after path Trasa se přerušuje za cestou +the paths do not join, the bus's GPS loses its way here in the game cesty na sebe nenavazují, GPS autobusu tu ve hře ztrácí trasu +Paths of the way Cesty trasy +Cut before the first stop Odříznout před první zastávkou +Cut after the last stop Odříznout za poslední zastávkou +path cesta diff --git a/locales/de.tsv b/locales/de.tsv index 2df8b8a..ade7352 100644 --- a/locales/de.tsv +++ b/locales/de.tsv @@ -2816,3 +2816,76 @@ Click a 2nd reference point on the object, or Esc to finish Klicken Sie auf eine Aligned angle! (Ctrl+Z to undo) Winkel ausgerichtet! (Strg+Z zum Rückgängigmachen) Vertex snap complete Scheitelpunkt-Ausrichtung abgeschlossen Align vertex angle Scheitelpunktwinkel ausrichten +Complete to Vervollständigen bis +Complete to: a new piece between the free ends of the selected splines Vervollständigen bis: ein neues Stück zwischen den freien Enden der ausgewählten Splines +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Ein neues Stück vom Typ des zuerst ausgewählten Splines zwischen zwei freien Enden der ausgewählten Splines, das an beide in Lage, Richtung und Höhe anschließt; die beiden selbst bleiben unverändert. Noch einmal: die beiden übrigen Enden werden verbunden, der Ring schließt sich. +The two ends already meet Die beiden Enden treffen sich schon +Select the splines whose free ends are to be joined Die Splines auswählen, deren freie Enden verbunden werden sollen +No piece of spline can join these two ends Kein Splinestück kann diese beiden Enden verbinden +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) openMappers Kopie dieser Karte im Inhaltsordner geöffnet (die im OMSI-2-Ordner wird nie geschrieben) +Read in again, changed on disk by another program: Neu eingelesen, auf der Festplatte von einem anderen Programm geändert: +Could not bring the changes over Die Änderungen konnten nicht übernommen werden +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Die Dateien der Karte wurden nach dieser automatischen Sicherung geändert (von einem anderen Programm, etwa dem OMSI-2-Editor). Die Wiederherstellung legt die älteren Kacheln der Sicherung über diese Änderungen. +tile(s) Kachel(n) +the global settings die globalen Einstellungen +the timetable den Fahrplan +the traffic den Verkehr +the descriptions die Beschreibungen +Reload from disk Von der Festplatte neu laden +The map changed on disk Die Karte wurde auf der Festplatte geändert +Another program changed the map's files where it has changes here not saved yet: Ein anderes Programm hat Dateien der Karte geändert, wo hier ungespeicherte Änderungen sind: +The other changes made on disk were read in already. Die übrigen Änderungen von der Festplatte wurden bereits eingelesen. +Keep mine Meine behalten +The map changed in OMSI 2's folder Die Karte wurde im OMSI-2-Ordner geändert +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Die Kopie dieser Karte in der Installation wurde geändert, nachdem openMappers Kopie im Inhaltsordner gespeichert wurde, etwa vom OMSI-2-Editor +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Die Übernahme ersetzt diese Dateien in openMappers Kopie; die ersetzten Dateien bleiben in einer Sicherung (Datei > Frühere Versionen). +Bring the changes over Änderungen übernehmen +Keep openMapper's copy openMappers Kopie behalten +its way has a gap after path sein Weg hat eine Lücke nach Pfad +its way does not pass sein Weg führt nicht vorbei an +On demand Bei Bedarf +Not served (checkpoint) Nicht bedient (Kontrollpunkt) +Wait for departure time Auf Abfahrtszeit warten +Always + wait for departure time Immer + auf Abfahrtszeit warten +The bus stops only when somebody waits or wants to get off (the game's default) Der Bus hält nur, wenn jemand wartet oder aussteigen will (Vorgabe des Spiels) +The bus always stops here Der Bus hält hier immer +The bus drives past without stopping: the stop only marks the way (a checkpoint) Der Bus fährt ohne Halt vorbei: die Haltestelle markiert nur den Weg (ein Kontrollpunkt) +The bus stops only when it is early, and waits there for its departure time Der Bus hält nur, wenn er zu früh ist, und wartet dort auf seine Abfahrtszeit +The bus always stops here, and when it is early it waits for its departure time Der Bus hält hier immer und wartet, wenn er zu früh ist, auf seine Abfahrtszeit +All trips Alle Fahrten +Every trip of the map, those no tour drives too Jede Fahrt der Karte, auch die, die kein Umlauf fährt +The line number the trip shows; the line of this number lists it among its trips Die Liniennummer, die die Fahrt zeigt; die Linie mit dieser Nummer führt sie unter ihren Fahrten +Way picked by hand: Weg von Hand gewählt: +the paths picked do not pass this stop die gewählten Pfade führen nicht an dieser Haltestelle vorbei +Other trips Andere Fahrten +The time profile this departure runs to Das Zeitprofil, nach dem diese Abfahrt fährt +Time profile Zeitprofil +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Eine Fahrt kann mehrere Profile haben (Hauptverkehrszeit, Nacht…): jede Abfahrt eines Umlaufs sagt, nach welchem sie fährt +The profile's name Der Name des Profils +A new profile, a copy of this one Ein neues Profil, eine Kopie von diesem +Delete this profile (its departures run to the first) Dieses Profil löschen (seine Abfahrten fahren nach dem ersten) +Times from stop to stop Zeiten von Haltestelle zu Haltestelle +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Die Zeit ab der Haltestelle davor lässt sich an jeder Haltestelle setzen: die Zeiten danach verschieben sich mit, und mit ihnen die Fahrzeit. Nicht gesetzte Zeiten richten sich nach der Entfernung zwischen den festen; an einer festen Haltestelle wartet ein Bus, der zu früh ist. +From the stop before Ab der Haltestelle davor +After departure Nach Abfahrt +Minutes from the stop before to this one Minuten von der Haltestelle davor bis zu dieser +As in OMSI 2's editor. Hover a choice to see what the bus does. Wie im Editor von OMSI 2. Mit der Maus über eine Wahl fahren, um zu sehen, was der Bus tut. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Jede Fahrt der Karte, egal welche Linie sie zeigt oder welcher Umlauf sie fährt. Eine Fahrt, die kein Umlauf fährt, bleibt erhalten und lässt sich hier bearbeiten, einem Umlauf geben oder löschen. +trips Fahrten +driven by no tour von keinem Umlauf gefahren +no tour kein Umlauf +departures Abfahrten +No path there: click a lane of a road (View > AI lanes shows them) Hier kein Pfad: auf eine Spur einer Straße klicken (Ansicht > KI-Spuren zeigt sie) +Done picking paths Fertig +Pick the paths on the map Die Pfade auf der Karte wählen +Choose the way yourself, path by path, as in OMSI 2's editor Den Weg selbst wählen, Pfad für Pfad, wie im Editor von OMSI 2 +Find the way automatically Den Weg automatisch finden +Forget the paths picked: the way is found along the roads again Die gewählten Pfade vergessen: der Weg wird wieder entlang der Straßen gefunden +The paths were picked by hand: they are kept when the stops change. Die Pfade wurden von Hand gewählt: sie bleiben, wenn sich die Haltestellen ändern. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Pfade in der Ansicht anklicken. Einer nach dem Ende oder vor dem Anfang kommt hinzu, mit den Pfaden bis dorthin; einer neben dem Weg ersetzt das Stück, das er umfährt (ein anderer Zweig an einer Kreuzung); ein Pfad des Wegs wird herausgenommen. Der Weg darf vor der ersten Haltestelle beginnen und nach der letzten weiterführen. +The way breaks after path Der Weg bricht ab nach Pfad +the paths do not join, the bus's GPS loses its way here in the game die Pfade schließen nicht aneinander an, das GPS des Busses verliert hier im Spiel den Weg +Paths of the way Pfade des Wegs +Cut before the first stop Vor der ersten Haltestelle abschneiden +Cut after the last stop Nach der letzten Haltestelle abschneiden +path Pfad diff --git a/locales/es.tsv b/locales/es.tsv index fabe8b6..1028988 100644 --- a/locales/es.tsv +++ b/locales/es.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Haga clic en un 2.º Aligned angle! (Ctrl+Z to undo) ¡Ángulo alineado! (Ctrl+Z para deshacer) Vertex snap complete Ajuste de vértice completado Align vertex angle Alinear ángulo del vértice +Complete to Completar hasta +Complete to: a new piece between the free ends of the selected splines Completar hasta: una pieza nueva entre los extremos libres de los splines seleccionados +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Una pieza nueva del tipo del primer spline seleccionado entre dos extremos libres de los splines seleccionados, que coincide con ambos en posición, dirección y altura; ellos no cambian. Otra vez: se unen los dos extremos que quedan y se cierra el anillo. +The two ends already meet Los dos extremos ya se encuentran +Select the splines whose free ends are to be joined Selecciona los splines cuyos extremos libres hay que unir +No piece of spline can join these two ends Ninguna pieza de spline puede unir estos dos extremos +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Se abrió la copia de openMapper de este mapa en la carpeta de contenido (la de la carpeta de OMSI 2 nunca se escribe) +Read in again, changed on disk by another program: Leído de nuevo, cambiado en el disco por otro programa: +Could not bring the changes over No se pudieron traer los cambios +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Los archivos del mapa cambiaron después de este autoguardado (por otro programa, como el editor de OMSI 2). Restaurar pone las casillas antiguas del autoguardado sobre esos cambios. +tile(s) casilla(s) +the global settings la configuración global +the timetable el horario +the traffic el tráfico +the descriptions las descripciones +Reload from disk Recargar desde el disco +The map changed on disk El mapa cambió en el disco +Another program changed the map's files where it has changes here not saved yet: Otro programa cambió archivos del mapa donde aquí hay cambios sin guardar: +The other changes made on disk were read in already. Los demás cambios del disco ya se leyeron. +Keep mine Conservar los míos +The map changed in OMSI 2's folder El mapa cambió en la carpeta de OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say La copia de este mapa en la instalación cambió después de guardar la copia de openMapper en la carpeta de contenido, por ejemplo con el editor de OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Traer los cambios reemplaza esos archivos de la copia de openMapper; los reemplazados se guardan en una copia de seguridad (Archivo > Versiones anteriores). +Bring the changes over Traer los cambios +Keep openMapper's copy Conservar la copia de openMapper +its way has a gap after path su camino tiene un hueco tras la ruta +its way does not pass su camino no pasa por +On demand A demanda +Not served (checkpoint) Sin servicio (punto de control) +Wait for departure time Esperar la hora de salida +Always + wait for departure time Siempre + esperar la hora de salida +The bus stops only when somebody waits or wants to get off (the game's default) El autobús solo para si alguien espera o quiere bajar (lo predeterminado en el juego) +The bus always stops here El autobús siempre para aquí +The bus drives past without stopping: the stop only marks the way (a checkpoint) El autobús pasa sin parar: la parada solo marca el camino (un punto de control) +The bus stops only when it is early, and waits there for its departure time El autobús solo para si va adelantado, y espera allí su hora de salida +The bus always stops here, and when it is early it waits for its departure time El autobús siempre para aquí, y si va adelantado espera su hora de salida +All trips Todos los viajes +Every trip of the map, those no tour drives too Todos los viajes del mapa, también los que no hace ningún recorrido +The line number the trip shows; the line of this number lists it among its trips El número de línea que muestra el viaje; la línea con ese número lo muestra entre sus viajes +Way picked by hand: Camino elegido a mano: +the paths picked do not pass this stop las rutas elegidas no pasan por esta parada +Other trips Otros viajes +The time profile this departure runs to El perfil de tiempos que sigue esta salida +Time profile Perfil de tiempos +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Un viaje puede tener varios perfiles (hora punta, noche…): cada salida de un recorrido dice cuál sigue +The profile's name El nombre del perfil +A new profile, a copy of this one Un perfil nuevo, copia de este +Delete this profile (its departures run to the first) Borrar este perfil (sus salidas siguen el primero) +Times from stop to stop Tiempos de parada a parada +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. El tiempo desde la parada anterior se puede fijar en cada parada: los tiempos siguientes se desplazan, y con ellos el tiempo del viaje. Los tiempos no fijados siguen la distancia entre los fijados; en una parada fijada, un autobús adelantado espera. +From the stop before Desde la parada anterior +After departure Tras la salida +Minutes from the stop before to this one Minutos desde la parada anterior hasta esta +As in OMSI 2's editor. Hover a choice to see what the bus does. Como en el editor de OMSI 2. Pasa el ratón por una opción para ver qué hace el autobús. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Todos los viajes del mapa, sea cual sea la línea que los muestra o el recorrido que los hace. Un viaje que no hace ningún recorrido se conserva, y aquí se puede editar, dar a un recorrido o borrar. +trips viajes +driven by no tour sin ningún recorrido +no tour sin recorrido +departures salidas +No path there: click a lane of a road (View > AI lanes shows them) Aquí no hay ruta: haz clic en un carril de una carretera (Ver > Carriles de IA los muestra) +Done picking paths Terminado +Pick the paths on the map Elegir las rutas en el mapa +Choose the way yourself, path by path, as in OMSI 2's editor Elige tú el camino, ruta a ruta, como en el editor de OMSI 2 +Find the way automatically Buscar el camino automáticamente +Forget the paths picked: the way is found along the roads again Olvidar las rutas elegidas: el camino vuelve a buscarse por las carreteras +The paths were picked by hand: they are kept when the stops change. Las rutas se eligieron a mano: se conservan cuando cambian las paradas. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Haz clic en rutas en la vista. Una tras el final o antes del inicio se añade, con las rutas hasta ella; una junto al camino ocupa el lugar del tramo que rodea (otro ramal en un cruce); una ruta del camino se quita. El camino puede empezar antes de la primera parada y seguir tras la última. +The way breaks after path El camino se corta tras la ruta +the paths do not join, the bus's GPS loses its way here in the game las rutas no se unen, el GPS del autobús se pierde aquí en el juego +Paths of the way Rutas del camino +Cut before the first stop Cortar antes de la primera parada +Cut after the last stop Cortar tras la última parada +path ruta diff --git a/locales/fr.tsv b/locales/fr.tsv index f581f1a..85e06e9 100644 --- a/locales/fr.tsv +++ b/locales/fr.tsv @@ -2816,3 +2816,76 @@ Click a 2nd reference point on the object, or Esc to finish Cliquez sur un 2e po Aligned angle! (Ctrl+Z to undo) Angle aligné ! (Ctrl+Z pour annuler) Vertex snap complete Accrochage de sommet terminé Align vertex angle Aligner l'angle du sommet +Complete to Compléter jusqu'à +Complete to: a new piece between the free ends of the selected splines Compléter jusqu'à : un nouveau morceau entre les extrémités libres des splines sélectionnées +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Un nouveau morceau du type de la première spline sélectionnée entre deux extrémités libres des splines sélectionnées, qui les rejoint toutes deux en position, direction et hauteur ; elles ne sont pas modifiées. Encore une fois : les deux extrémités restantes sont jointes et l'anneau se ferme. +The two ends already meet Les deux extrémités se rejoignent déjà +Select the splines whose free ends are to be joined Sélectionnez les splines dont les extrémités libres sont à joindre +No piece of spline can join these two ends Aucun morceau de spline ne peut joindre ces deux extrémités +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Copie openMapper de cette carte ouverte dans le dossier de contenu (celle du dossier d'OMSI 2 n'est jamais écrite) +Read in again, changed on disk by another program: Relu, modifié sur le disque par un autre programme : +Could not bring the changes over Impossible d'importer les modifications +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Les fichiers de la carte ont été modifiés après cette sauvegarde automatique (par un autre programme, l'éditeur d'OMSI 2 par exemple). La restauration remet les tuiles plus anciennes de la sauvegarde par-dessus ces modifications. +tile(s) tuile(s) +the global settings les paramètres globaux +the timetable l'horaire +the traffic le trafic +the descriptions les descriptions +Reload from disk Recharger depuis le disque +The map changed on disk La carte a changé sur le disque +Another program changed the map's files where it has changes here not saved yet: Un autre programme a modifié des fichiers de la carte là où elle a ici des modifications non enregistrées : +The other changes made on disk were read in already. Les autres modifications du disque ont déjà été relues. +Keep mine Garder les miennes +The map changed in OMSI 2's folder La carte a changé dans le dossier d'OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say La copie de cette carte dans l'installation a été modifiée après l'enregistrement de la copie d'openMapper dans le dossier de contenu, par l'éditeur d'OMSI 2 par exemple +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Importer les modifications remplace ces fichiers de la copie d'openMapper ; les fichiers remplacés sont gardés dans une sauvegarde (Fichier > Versions précédentes). +Bring the changes over Importer les modifications +Keep openMapper's copy Garder la copie d'openMapper +its way has a gap after path son chemin a une coupure après la voie +its way does not pass son chemin ne passe pas par +On demand À la demande +Not served (checkpoint) Non desservi (point de contrôle) +Wait for departure time Attendre l'heure de départ +Always + wait for departure time Toujours + attendre l'heure de départ +The bus stops only when somebody waits or wants to get off (the game's default) Le bus ne s'arrête que si quelqu'un attend ou veut descendre (par défaut dans le jeu) +The bus always stops here Le bus s'arrête toujours ici +The bus drives past without stopping: the stop only marks the way (a checkpoint) Le bus passe sans s'arrêter : l'arrêt ne fait que marquer le chemin (un point de contrôle) +The bus stops only when it is early, and waits there for its departure time Le bus ne s'arrête que s'il est en avance, et y attend son heure de départ +The bus always stops here, and when it is early it waits for its departure time Le bus s'arrête toujours ici, et s'il est en avance il attend son heure de départ +All trips Tous les trajets +Every trip of the map, those no tour drives too Chaque trajet de la carte, même ceux qu'aucun service ne fait +The line number the trip shows; the line of this number lists it among its trips Le numéro de ligne affiché par le trajet ; la ligne de ce numéro le liste parmi ses trajets +Way picked by hand: Chemin choisi à la main : +the paths picked do not pass this stop les voies choisies ne passent pas par cet arrêt +Other trips Autres trajets +The time profile this departure runs to Le profil horaire que suit ce départ +Time profile Profil horaire +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Un trajet peut avoir plusieurs profils (heure de pointe, nuit…) : chaque départ d'un service dit lequel il suit +The profile's name Le nom du profil +A new profile, a copy of this one Un nouveau profil, copie de celui-ci +Delete this profile (its departures run to the first) Supprimer ce profil (ses départs suivent le premier) +Times from stop to stop Temps d'arrêt en arrêt +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Le temps depuis l'arrêt précédent peut être fixé à chaque arrêt : les temps suivants se décalent, et la durée du trajet avec eux. Les temps non fixés suivent la distance entre les arrêts fixés ; à un arrêt fixé, un bus en avance attend. +From the stop before Depuis l'arrêt précédent +After departure Après le départ +Minutes from the stop before to this one Minutes de l'arrêt précédent à celui-ci +As in OMSI 2's editor. Hover a choice to see what the bus does. Comme dans l'éditeur d'OMSI 2. Survolez un choix pour voir ce que fait le bus. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Chaque trajet de la carte, quelle que soit la ligne qui l'affiche ou le service qui le fait. Un trajet qu'aucun service ne fait est conservé, et peut être modifié, donné à un service ou supprimé ici. +trips trajets +driven by no tour faits par aucun service +no tour aucun service +departures départs +No path there: click a lane of a road (View > AI lanes shows them) Pas de voie ici : cliquez sur une voie d'une route (Affichage > Voies IA les montre) +Done picking paths Choix terminé +Pick the paths on the map Choisir les voies sur la carte +Choose the way yourself, path by path, as in OMSI 2's editor Choisir le chemin soi-même, voie par voie, comme dans l'éditeur d'OMSI 2 +Find the way automatically Trouver le chemin automatiquement +Forget the paths picked: the way is found along the roads again Oublier les voies choisies : le chemin est de nouveau trouvé le long des routes +The paths were picked by hand: they are kept when the stops change. Les voies ont été choisies à la main : elles sont gardées quand les arrêts changent. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Cliquez sur des voies dans la vue. Une voie après la fin ou avant le début est ajoutée, avec les voies qui y mènent ; une voie à côté du chemin remplace la partie qu'elle contourne (une autre branche à un carrefour) ; une voie du chemin est retirée. Le chemin peut commencer avant le premier arrêt et continuer après le dernier. +The way breaks after path Le chemin s'interrompt après la voie +the paths do not join, the bus's GPS loses its way here in the game les voies ne se rejoignent pas, le GPS du bus perd son chemin ici dans le jeu +Paths of the way Voies du chemin +Cut before the first stop Couper avant le premier arrêt +Cut after the last stop Couper après le dernier arrêt +path voie diff --git a/locales/hi.tsv b/locales/hi.tsv index f8a5902..2c1bab2 100644 --- a/locales/hi.tsv +++ b/locales/hi.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish वस्तु प Aligned angle! (Ctrl+Z to undo) कोण संरेखित! (पूर्ववत करने के लिए Ctrl+Z) Vertex snap complete शीर्ष स्नैप पूर्ण Align vertex angle शीर्ष कोण संरेखित करें +Complete to तक पूरा करें +Complete to: a new piece between the free ends of the selected splines तक पूरा करें: चुनी हुई स्प्लाइनों के खुले सिरों के बीच नया टुकड़ा +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. पहली चुनी हुई स्प्लाइन के प्रकार का नया टुकड़ा, चुनी हुई स्प्लाइनों के दो खुले सिरों के बीच, जो दोनों से जगह, दिशा और ऊँचाई में मिलता है; वे दोनों नहीं बदलतीं। फिर से: बचे हुए दो सिरे जुड़ते हैं और घेरा बंद होता है। +The two ends already meet ये दोनों सिरे पहले से मिलते हैं +Select the splines whose free ends are to be joined वे स्प्लाइनें चुनें जिनके खुले सिरे जोड़ने हैं +No piece of spline can join these two ends स्प्लाइन का कोई टुकड़ा इन दो सिरों को नहीं जोड़ सकता +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) इस मैप की openMapper प्रति कंटेंट फ़ोल्डर में खोली गई (OMSI 2 फ़ोल्डर वाली कभी नहीं लिखी जाती) +Read in again, changed on disk by another program: फिर से पढ़ा गया, डिस्क पर किसी दूसरे प्रोग्राम ने बदला: +Could not bring the changes over बदलाव नहीं लाए जा सके +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. इस ऑटोसेव के बाद मैप की फ़ाइलें बदली गईं (किसी दूसरे प्रोग्राम से, जैसे OMSI 2 का एडिटर)। पुनर्स्थापित करने से ऑटोसेव की पुरानी टाइलें उन बदलावों के ऊपर आ जाएँगी। +tile(s) टाइल +the global settings वैश्विक सेटिंग्स +the timetable समय-सारणी +the traffic ट्रैफ़िक +the descriptions विवरण +Reload from disk डिस्क से फिर लोड करें +The map changed on disk मैप डिस्क पर बदल गया +Another program changed the map's files where it has changes here not saved yet: किसी दूसरे प्रोग्राम ने मैप की फ़ाइलें वहाँ बदलीं जहाँ यहाँ बिना सहेजे बदलाव हैं: +The other changes made on disk were read in already. डिस्क के बाकी बदलाव पहले ही पढ़ लिए गए। +Keep mine मेरे रखें +The map changed in OMSI 2's folder मैप OMSI 2 फ़ोल्डर में बदल गया +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say इंस्टॉलेशन में इस मैप की प्रति, कंटेंट फ़ोल्डर में openMapper की प्रति सहेजे जाने के बाद बदली गई, जैसे OMSI 2 के एडिटर से +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). बदलाव लाने से openMapper की प्रति की वे फ़ाइलें बदल जाएँगी; बदली गई फ़ाइलें बैकअप में रहती हैं (फ़ाइल > पिछले संस्करण)। +Bring the changes over बदलाव लाएँ +Keep openMapper's copy openMapper की प्रति रखें +its way has a gap after path इसके रास्ते में इस पाथ के बाद अंतर है: +its way does not pass इसका रास्ता इसके पास से नहीं जाता: +On demand माँग पर +Not served (checkpoint) सेवा नहीं (चेकपॉइंट) +Wait for departure time डिपार्चर समय का इंतज़ार करें +Always + wait for departure time हमेशा + डिपार्चर समय का इंतज़ार करें +The bus stops only when somebody waits or wants to get off (the game's default) बस तभी रुकती है जब कोई इंतज़ार कर रहा हो या उतरना चाहे (गेम का डिफ़ॉल्ट) +The bus always stops here बस यहाँ हमेशा रुकती है +The bus drives past without stopping: the stop only marks the way (a checkpoint) बस बिना रुके निकल जाती है: स्टॉप केवल रास्ता चिह्नित करता है (चेकपॉइंट) +The bus stops only when it is early, and waits there for its departure time बस तभी रुकती है जब वह जल्दी हो, और वहाँ अपने डिपार्चर समय का इंतज़ार करती है +The bus always stops here, and when it is early it waits for its departure time बस यहाँ हमेशा रुकती है, और जल्दी होने पर अपने डिपार्चर समय का इंतज़ार करती है +All trips सभी ट्रिप +Every trip of the map, those no tour drives too मैप का हर ट्रिप, वे भी जिन्हें कोई टूर नहीं चलाता +The line number the trip shows; the line of this number lists it among its trips ट्रिप जो लाइन नंबर दिखाता है; इस नंबर की लाइन इसे अपने ट्रिप में गिनती है +Way picked by hand: रास्ता हाथ से चुना गया: +the paths picked do not pass this stop चुने गए पाथ इस स्टॉप के पास से नहीं जाते +Other trips दूसरे ट्रिप +The time profile this departure runs to वह टाइम प्रोफ़ाइल जिससे यह डिपार्चर चलता है +Time profile टाइम प्रोफ़ाइल +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to एक ट्रिप की कई प्रोफ़ाइल हो सकती हैं (भीड़ का समय, रात…): टूर का हर डिपार्चर बताता है कि वह किससे चलता है +The profile's name प्रोफ़ाइल का नाम +A new profile, a copy of this one नई प्रोफ़ाइल, इसकी कॉपी +Delete this profile (its departures run to the first) यह प्रोफ़ाइल हटाएँ (इसके डिपार्चर पहली से चलेंगे) +Times from stop to stop स्टॉप से स्टॉप तक का समय +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. हर स्टॉप पर पिछले स्टॉप से समय तय किया जा सकता है: उसके बाद के समय साथ खिसकते हैं, और उनके साथ ट्रिप का समय भी। जो समय तय नहीं हैं वे तय समयों के बीच की दूरी के हिसाब से चलते हैं; तय स्टॉप पर जल्दी पहुँची बस इंतज़ार करती है। +From the stop before पिछले स्टॉप से +After departure डिपार्चर के बाद +Minutes from the stop before to this one पिछले स्टॉप से इस तक मिनट +As in OMSI 2's editor. Hover a choice to see what the bus does. OMSI 2 के एडिटर की तरह। बस क्या करती है यह देखने के लिए किसी विकल्प पर माउस ले जाएँ। +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. मैप का हर ट्रिप, चाहे कोई भी लाइन उसे दिखाए या कोई भी टूर उसे चलाए। जिस ट्रिप को कोई टूर नहीं चलाता वह रखा जाता है, और यहाँ बदला, किसी टूर को दिया या हटाया जा सकता है। +trips ट्रिप +driven by no tour किसी टूर से नहीं +no tour कोई टूर नहीं +departures डिपार्चर +No path there: click a lane of a road (View > AI lanes shows them) वहाँ कोई पाथ नहीं: किसी सड़क की लेन पर क्लिक करें (दृश्य > AI लेन उन्हें दिखाता है) +Done picking paths चुनना पूरा +Pick the paths on the map मैप पर पाथ चुनें +Choose the way yourself, path by path, as in OMSI 2's editor रास्ता खुद चुनें, पाथ दर पाथ, OMSI 2 के एडिटर की तरह +Find the way automatically रास्ता अपने-आप ढूँढें +Forget the paths picked: the way is found along the roads again चुने गए पाथ भूल जाएँ: रास्ता फिर से सड़कों के साथ ढूँढा जाता है +The paths were picked by hand: they are kept when the stops change. पाथ हाथ से चुने गए थे: स्टॉप बदलने पर वे बने रहते हैं। +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. व्यू में पाथ पर क्लिक करें। अंत के बाद या शुरुआत से पहले वाला पाथ, उस तक के पाथों के साथ, जुड़ जाता है; रास्ते के बगल वाला पाथ उस हिस्से की जगह लेता है जिसके चारों ओर वह जाता है (जंक्शन पर दूसरी शाखा); रास्ते का पाथ निकाल दिया जाता है। रास्ता पहले स्टॉप से पहले शुरू हो सकता है और आखिरी के बाद आगे जा सकता है। +The way breaks after path रास्ता इस पाथ के बाद टूटता है: +the paths do not join, the bus's GPS loses its way here in the game पाथ आपस में नहीं जुड़ते, गेम में बस का GPS यहाँ रास्ता खो देता है +Paths of the way रास्ते के पाथ +Cut before the first stop पहले स्टॉप से पहले काटें +Cut after the last stop आखिरी स्टॉप के बाद काटें +path पाथ diff --git a/locales/hu.tsv b/locales/hu.tsv index 6765f13..c7ce3d4 100644 --- a/locales/hu.tsv +++ b/locales/hu.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Kattintson egy 2. re Aligned angle! (Ctrl+Z to undo) Szög igazítva! (Ctrl+Z a visszavonáshoz) Vertex snap complete Csúcspont illesztése kész Align vertex angle Csúcspontszög igazítása +Complete to Kiegészítés eddig +Complete to: a new piece between the free ends of the selected splines Kiegészítés eddig: új darab a kijelölt spline-ok szabad végei között +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Új darab az elsőként kijelölt spline típusából a kijelölt spline-ok két szabad vége között, amely helyben, irányban és magasságban mindkettőhöz illeszkedik; azok nem változnak. Újra: a megmaradt két vég kapcsolódik össze, a gyűrű bezárul. +The two ends already meet A két vég már találkozik +Select the splines whose free ends are to be joined Jelölje ki azokat a spline-okat, amelyek szabad végeit össze kell kötni +No piece of spline can join these two ends Egyetlen spline-darab sem kötheti össze ezt a két véget +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Megnyitva az openMapper másolata erről a térképről a tartalommappában (az OMSI 2 mappájában lévőt sosem írja) +Read in again, changed on disk by another program: Újra beolvasva, egy másik program módosította a lemezen: +Could not bring the changes over Nem sikerült átvenni a módosításokat +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. A térkép fájljai ezen automatikus mentés után módosultak (egy másik programmal, pl. az OMSI 2 szerkesztőjével). A visszaállítás a mentés régebbi csempéit teszi e módosítások fölé. +tile(s) csempe +the global settings a globális beállítások +the timetable a menetrend +the traffic a forgalom +the descriptions a leírások +Reload from disk Újratöltés lemezről +The map changed on disk A térkép megváltozott a lemezen +Another program changed the map's files where it has changes here not saved yet: Egy másik program módosította a térkép fájljait ott, ahol itt nem mentett módosítások vannak: +The other changes made on disk were read in already. A lemez többi módosítása már be lett olvasva. +Keep mine Az enyém marad +The map changed in OMSI 2's folder A térkép megváltozott az OMSI 2 mappájában +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say A térkép telepítésbeli másolata módosult, miután az openMapper másolata a tartalommappában el lett mentve, pl. az OMSI 2 szerkesztőjével +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Az átvétel lecseréli ezeket a fájlokat az openMapper másolatában; a lecserélt fájlok biztonsági mentésbe kerülnek (Fájl > Korábbi verziók). +Bring the changes over Módosítások átvétele +Keep openMapper's copy Az openMapper másolata marad +its way has a gap after path az útjában hézag van ez után az útvonal után: +its way does not pass az útja nem halad el emellett: +On demand Igény szerint +Not served (checkpoint) Nem szolgált ki (ellenőrzőpont) +Wait for departure time Várakozás az indulási időre +Always + wait for departure time Mindig + várakozás az indulási időre +The bus stops only when somebody waits or wants to get off (the game's default) A busz csak akkor áll meg, ha valaki vár vagy le akar szállni (a játék alapértéke) +The bus always stops here A busz itt mindig megáll +The bus drives past without stopping: the stop only marks the way (a checkpoint) A busz megállás nélkül elhalad: a megálló csak az utat jelöli (ellenőrzőpont) +The bus stops only when it is early, and waits there for its departure time A busz csak akkor áll meg, ha korán jár, és ott megvárja az indulási idejét +The bus always stops here, and when it is early it waits for its departure time A busz itt mindig megáll, és ha korán jár, megvárja az indulási idejét +All trips Minden menet +Every trip of the map, those no tour drives too A térkép minden menete, azok is, amelyeket egy forda sem vezet +The line number the trip shows; the line of this number lists it among its trips A menet által mutatott vonalszám; az ilyen számú járat a menetei között sorolja fel +Way picked by hand: Kézzel választott út: +the paths picked do not pass this stop a választott útvonalak nem haladnak el e megálló mellett +Other trips Más menetek +The time profile this departure runs to Az időprofil, amely szerint ez az indulás megy +Time profile Időprofil +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Egy menetnek több profilja lehet (csúcsidő, éjszaka…): a forda minden indulása megmondja, melyik szerint megy +The profile's name A profil neve +A new profile, a copy of this one Új profil, ennek másolata +Delete this profile (its departures run to the first) Profil törlése (az indulásai az első szerint mennek) +Times from stop to stop Idők megállótól megállóig +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Minden megállónál megadható az előző megállótól mért idő: az utána következő idők vele tolódnak, és velük a menet ideje. A meg nem adott idők a rögzítettek közötti távolságot követik; rögzített megállóban a korán érkező busz vár. +From the stop before Az előző megállótól +After departure Indulás után +Minutes from the stop before to this one Percek az előző megállótól eddig +As in OMSI 2's editor. Hover a choice to see what the bus does. Mint az OMSI 2 szerkesztőjében. Vidd az egeret egy lehetőség fölé, hogy lásd, mit tesz a busz. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. A térkép minden menete, bármelyik járat mutatja vagy bármelyik forda vezeti. Az a menet, amelyet egy forda sem vezet, megmarad, és itt szerkeszthető, fordához adható vagy törölhető. +trips menet +driven by no tour forda nélkül +no tour nincs forda +departures indulás +No path there: click a lane of a road (View > AI lanes shows them) Itt nincs útvonal: kattints egy út sávjára (Nézet > MI-sávok mutatja őket) +Done picking paths Kész a választással +Pick the paths on the map Útvonalak kiválasztása a térképen +Choose the way yourself, path by path, as in OMSI 2's editor Válaszd ki magad az utat, útvonalról útvonalra, mint az OMSI 2 szerkesztőjében +Find the way automatically Út automatikus keresése +Forget the paths picked: the way is found along the roads again A választott útvonalak elfelejtése: az út újra az utak mentén keresődik +The paths were picked by hand: they are kept when the stops change. Az útvonalakat kézzel választották: a megállók változásakor megmaradnak. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Kattints útvonalakra a nézetben. A vég után vagy a kezdet előtt lévő hozzáadódik, a hozzá vezető útvonalakkal együtt; az út melletti átveszi annak a szakasznak a helyét, amelyet megkerül (másik ág egy csomópontban); az út egy útvonala kikerül. Az út kezdődhet az első megálló előtt és folytatódhat az utolsó után. +The way breaks after path Az út megszakad ez után az útvonal után: +the paths do not join, the bus's GPS loses its way here in the game az útvonalak nem csatlakoznak, a busz GPS-e itt a játékban elveszti az utat +Paths of the way Az út útvonalai +Cut before the first stop Levágás az első megálló előtt +Cut after the last stop Levágás az utolsó megálló után +path útvonal diff --git a/locales/id.tsv b/locales/id.tsv index 2689f28..7a95868 100644 --- a/locales/id.tsv +++ b/locales/id.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Klik titik referensi Aligned angle! (Ctrl+Z to undo) Sudut disejajarkan! (Ctrl+Z untuk membatalkan) Vertex snap complete Tempel titik sudut selesai Align vertex angle Selaraskan sudut titik +Complete to Lengkapi sampai +Complete to: a new piece between the free ends of the selected splines Lengkapi sampai: bagian baru di antara ujung bebas spline yang dipilih +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Bagian baru dengan tipe spline yang pertama dipilih di antara dua ujung bebas spline yang dipilih, tersambung dengan keduanya dalam posisi, arah, dan ketinggian; keduanya tidak diubah. Sekali lagi: dua ujung yang tersisa disambung, lingkaran tertutup. +The two ends already meet Kedua ujung sudah bertemu +Select the splines whose free ends are to be joined Pilih spline yang ujung bebasnya akan disambung +No piece of spline can join these two ends Tidak ada bagian spline yang dapat menyambung kedua ujung ini +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Salinan openMapper dari peta ini di folder konten dibuka (yang ada di folder OMSI 2 tidak pernah ditulis) +Read in again, changed on disk by another program: Dibaca ulang, diubah di disk oleh program lain: +Could not bring the changes over Tidak dapat membawa perubahan +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. File peta diubah setelah simpan otomatis ini (oleh program lain, misalnya editor OMSI 2). Memulihkan menaruh tile lama dari simpanan di atas perubahan itu. +tile(s) tile +the global settings pengaturan global +the timetable jadwal +the traffic lalu lintas +the descriptions deskripsi +Reload from disk Muat ulang dari disk +The map changed on disk Peta berubah di disk +Another program changed the map's files where it has changes here not saved yet: Program lain mengubah file peta di bagian yang di sini punya perubahan belum disimpan: +The other changes made on disk were read in already. Perubahan lain di disk sudah dibaca. +Keep mine Simpan milik saya +The map changed in OMSI 2's folder Peta berubah di folder OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Salinan peta ini di instalasi diubah setelah salinan openMapper di folder konten disimpan, misalnya oleh editor OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Membawa perubahan mengganti file itu di salinan openMapper; file yang diganti disimpan dalam cadangan (File > Versi sebelumnya). +Bring the changes over Bawa perubahan +Keep openMapper's copy Simpan salinan openMapper +its way has a gap after path rutenya terputus setelah jalur +its way does not pass rutenya tidak melewati +On demand Sesuai permintaan +Not served (checkpoint) Tidak dilayani (titik periksa) +Wait for departure time Tunggu waktu berangkat +Always + wait for departure time Selalu + tunggu waktu berangkat +The bus stops only when somebody waits or wants to get off (the game's default) Bus berhenti hanya jika ada yang menunggu atau ingin turun (bawaan game) +The bus always stops here Bus selalu berhenti di sini +The bus drives past without stopping: the stop only marks the way (a checkpoint) Bus lewat tanpa berhenti: halte hanya menandai rute (titik periksa) +The bus stops only when it is early, and waits there for its departure time Bus berhenti hanya jika datang lebih awal, dan menunggu di sana sampai waktu berangkatnya +The bus always stops here, and when it is early it waits for its departure time Bus selalu berhenti di sini, dan jika datang lebih awal ia menunggu waktu berangkatnya +All trips Semua perjalanan +Every trip of the map, those no tour drives too Setiap perjalanan di peta, juga yang tidak dijalani dinas mana pun +The line number the trip shows; the line of this number lists it among its trips Nomor jalur yang ditampilkan perjalanan; jalur dengan nomor ini mencantumkannya di antara perjalanannya +Way picked by hand: Rute dipilih manual: +the paths picked do not pass this stop jalur yang dipilih tidak melewati halte ini +Other trips Perjalanan lain +The time profile this departure runs to Profil waktu yang diikuti keberangkatan ini +Time profile Profil waktu +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Satu perjalanan bisa punya beberapa profil (jam sibuk, malam…): setiap keberangkatan dinas menyebut profil mana yang diikutinya +The profile's name Nama profil +A new profile, a copy of this one Profil baru, salinan profil ini +Delete this profile (its departures run to the first) Hapus profil ini (keberangkatannya mengikuti yang pertama) +Times from stop to stop Waktu dari halte ke halte +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Waktu dari halte sebelumnya bisa diatur di setiap halte: waktu sesudahnya ikut bergeser, begitu juga waktu perjalanan. Waktu yang tidak diatur mengikuti jarak antara yang tetap; di halte tetap, bus yang datang lebih awal menunggu. +From the stop before Dari halte sebelumnya +After departure Setelah berangkat +Minutes from the stop before to this one Menit dari halte sebelumnya ke halte ini +As in OMSI 2's editor. Hover a choice to see what the bus does. Seperti di editor OMSI 2. Arahkan kursor ke pilihan untuk melihat apa yang dilakukan bus. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Setiap perjalanan di peta, jalur mana pun yang menampilkannya atau dinas mana pun yang menjalaninya. Perjalanan yang tidak dijalani dinas mana pun tetap disimpan, dan di sini bisa diedit, diberikan ke dinas, atau dihapus. +trips perjalanan +driven by no tour tanpa dinas +no tour tanpa dinas +departures keberangkatan +No path there: click a lane of a road (View > AI lanes shows them) Tidak ada jalur di situ: klik lajur sebuah jalan (Tampilan > Lajur AI menampilkannya) +Done picking paths Selesai memilih +Pick the paths on the map Pilih jalur di peta +Choose the way yourself, path by path, as in OMSI 2's editor Pilih rute sendiri, jalur demi jalur, seperti di editor OMSI 2 +Find the way automatically Cari rute otomatis +Forget the paths picked: the way is found along the roads again Lupakan jalur yang dipilih: rute dicari lagi menyusuri jalan +The paths were picked by hand: they are kept when the stops change. Jalur dipilih manual: tetap disimpan saat halte berubah. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Klik jalur di tampilan. Jalur setelah ujung atau sebelum awal ditambahkan, beserta jalur menuju ke sana; jalur di samping rute menggantikan bagian yang dikelilinginya (cabang lain di persimpangan); jalur dari rute dikeluarkan. Rute boleh dimulai sebelum halte pertama dan berlanjut setelah halte terakhir. +The way breaks after path Rute terputus setelah jalur +the paths do not join, the bus's GPS loses its way here in the game jalur tidak tersambung, GPS bus kehilangan arah di sini dalam game +Paths of the way Jalur dari rute +Cut before the first stop Potong sebelum halte pertama +Cut after the last stop Potong setelah halte terakhir +path jalur diff --git a/locales/it.tsv b/locales/it.tsv index 127c375..c14d518 100644 --- a/locales/it.tsv +++ b/locales/it.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Fai clic su un 2° p Aligned angle! (Ctrl+Z to undo) Angolo allineato! (Ctrl+Z per annullare) Vertex snap complete Allineamento vertice completato Align vertex angle Allinea angolo vertice +Complete to Completa fino a +Complete to: a new piece between the free ends of the selected splines Completa fino a: un pezzo nuovo tra le estremità libere delle spline selezionate +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Un pezzo nuovo del tipo della prima spline selezionata tra due estremità libere delle spline selezionate, che le raggiunge entrambe per posizione, direzione e altezza; queste non cambiano. Di nuovo: si uniscono le due estremità rimaste e l'anello si chiude. +The two ends already meet Le due estremità si incontrano già +Select the splines whose free ends are to be joined Seleziona le spline di cui unire le estremità libere +No piece of spline can join these two ends Nessun pezzo di spline può unire queste due estremità +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Aperta la copia di openMapper di questa mappa nella cartella dei contenuti (quella nella cartella di OMSI 2 non viene mai scritta) +Read in again, changed on disk by another program: Riletto, modificato su disco da un altro programma: +Could not bring the changes over Impossibile portare le modifiche +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. I file della mappa sono stati modificati dopo questo salvataggio automatico (da un altro programma, ad esempio l'editor di OMSI 2). Il ripristino mette le tile più vecchie del salvataggio sopra quelle modifiche. +tile(s) tile +the global settings le impostazioni globali +the timetable l'orario +the traffic il traffico +the descriptions le descrizioni +Reload from disk Ricarica dal disco +The map changed on disk La mappa è cambiata su disco +Another program changed the map's files where it has changes here not saved yet: Un altro programma ha modificato file della mappa dove qui ci sono modifiche non salvate: +The other changes made on disk were read in already. Le altre modifiche su disco sono già state rilette. +Keep mine Tieni le mie +The map changed in OMSI 2's folder La mappa è cambiata nella cartella di OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say La copia di questa mappa nell'installazione è stata modificata dopo il salvataggio della copia di openMapper nella cartella dei contenuti, ad esempio dall'editor di OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Portare le modifiche sostituisce quei file della copia di openMapper; i file sostituiti restano in un backup (File > Versioni precedenti). +Bring the changes over Porta le modifiche +Keep openMapper's copy Tieni la copia di openMapper +its way has a gap after path il suo percorso ha un'interruzione dopo il tracciato +its way does not pass il suo percorso non passa per +On demand A richiesta +Not served (checkpoint) Non servita (punto di controllo) +Wait for departure time Attendere l'orario di partenza +Always + wait for departure time Sempre + attendere l'orario di partenza +The bus stops only when somebody waits or wants to get off (the game's default) Il bus si ferma solo se qualcuno aspetta o vuole scendere (il predefinito del gioco) +The bus always stops here Il bus si ferma sempre qui +The bus drives past without stopping: the stop only marks the way (a checkpoint) Il bus passa senza fermarsi: la fermata segna solo il percorso (un punto di controllo) +The bus stops only when it is early, and waits there for its departure time Il bus si ferma solo se è in anticipo, e lì attende il suo orario di partenza +The bus always stops here, and when it is early it waits for its departure time Il bus si ferma sempre qui, e se è in anticipo attende il suo orario di partenza +All trips Tutte le corse +Every trip of the map, those no tour drives too Ogni corsa della mappa, anche quelle che nessun turno fa +The line number the trip shows; the line of this number lists it among its trips Il numero di linea che la corsa mostra; la linea con questo numero la elenca tra le sue corse +Way picked by hand: Percorso scelto a mano: +the paths picked do not pass this stop i tracciati scelti non passano per questa fermata +Other trips Altre corse +The time profile this departure runs to Il profilo orario che segue questa partenza +Time profile Profilo orario +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Una corsa può avere più profili (ora di punta, notte…): ogni partenza di un turno dice quale segue +The profile's name Il nome del profilo +A new profile, a copy of this one Un nuovo profilo, copia di questo +Delete this profile (its departures run to the first) Elimina questo profilo (le sue partenze seguono il primo) +Times from stop to stop Tempi da fermata a fermata +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Il tempo dalla fermata precedente si può fissare a ogni fermata: i tempi successivi si spostano, e con loro il tempo della corsa. I tempi non fissati seguono la distanza tra quelli fissati; a una fermata fissata un bus in anticipo attende. +From the stop before Dalla fermata precedente +After departure Dopo la partenza +Minutes from the stop before to this one Minuti dalla fermata precedente a questa +As in OMSI 2's editor. Hover a choice to see what the bus does. Come nell'editor di OMSI 2. Passa il mouse su una scelta per vedere cosa fa il bus. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Ogni corsa della mappa, qualunque linea la mostri o qualunque turno la faccia. Una corsa che nessun turno fa viene conservata, e qui si può modificare, dare a un turno o eliminare. +trips corse +driven by no tour fatte da nessun turno +no tour nessun turno +departures partenze +No path there: click a lane of a road (View > AI lanes shows them) Nessun tracciato qui: clicca su una corsia di una strada (Visualizza > Corsie IA le mostra) +Done picking paths Fatto +Pick the paths on the map Scegli i tracciati sulla mappa +Choose the way yourself, path by path, as in OMSI 2's editor Scegli tu il percorso, tracciato per tracciato, come nell'editor di OMSI 2 +Find the way automatically Trova il percorso automaticamente +Forget the paths picked: the way is found along the roads again Dimentica i tracciati scelti: il percorso viene di nuovo trovato lungo le strade +The paths were picked by hand: they are kept when the stops change. I tracciati sono stati scelti a mano: restano quando cambiano le fermate. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Clicca i tracciati nella vista. Uno dopo la fine o prima dell'inizio viene aggiunto, con i tracciati fino a esso; uno accanto al percorso prende il posto del tratto che aggira (un altro ramo a un incrocio); un tracciato del percorso viene tolto. Il percorso può iniziare prima della prima fermata e proseguire dopo l'ultima. +The way breaks after path Il percorso si interrompe dopo il tracciato +the paths do not join, the bus's GPS loses its way here in the game i tracciati non si congiungono, il GPS del bus qui nel gioco perde la strada +Paths of the way Tracciati del percorso +Cut before the first stop Taglia prima della prima fermata +Cut after the last stop Taglia dopo l'ultima fermata +path tracciato diff --git a/locales/ja.tsv b/locales/ja.tsv index 02506a9..3a0458e 100644 --- a/locales/ja.tsv +++ b/locales/ja.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish オブジェクト Aligned angle! (Ctrl+Z to undo) 角度を合わせました!(Ctrl+Z で元に戻す) Vertex snap complete 頂点吸着完了 Align vertex angle 頂点の角度を合わせる +Complete to ここまで補完 +Complete to: a new piece between the free ends of the selected splines ここまで補完:選択したスプラインの空いた端の間に新しい部品 +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. 最初に選択したスプラインの種類で、選択したスプラインの空いた二つの端の間に新しい部品を作り、両方と位置・向き・高さを合わせます。元の二つは変わりません。もう一度押すと、残る二つの端がつながり、輪が閉じます。 +The two ends already meet この二つの端はもうつながっています +Select the splines whose free ends are to be joined 空いた端をつなぐスプラインを選択してください +No piece of spline can join these two ends この二つの端をつなげるスプラインの部品がありません +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) このマップの openMapper のコピーをコンテンツフォルダで開きました(OMSI 2 フォルダのものは書き換えません) +Read in again, changed on disk by another program: 読み直しました。別のプログラムがディスク上で変更: +Could not bring the changes over 変更を取り込めませんでした +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. この自動保存の後にマップのファイルが変更されています(別のプログラム、例えば OMSI 2 のエディタによる)。復元すると、自動保存の古いタイルがその変更の上に置かれます。 +tile(s) タイル +the global settings 全体設定 +the timetable 時刻表 +the traffic 交通 +the descriptions 説明 +Reload from disk ディスクから再読み込み +The map changed on disk マップがディスク上で変更されました +Another program changed the map's files where it has changes here not saved yet: ここに未保存の変更がある部分のマップファイルを、別のプログラムが変更しました: +The other changes made on disk were read in already. ディスク上のその他の変更は読み込み済みです。 +Keep mine 自分の変更を残す +The map changed in OMSI 2's folder OMSI 2 フォルダでマップが変更されました +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say コンテンツフォルダの openMapper のコピーを保存した後に、インストール先のこのマップが変更されました(例えば OMSI 2 のエディタで) +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). 取り込むと openMapper のコピーのそれらのファイルが置き換わります。置き換えられたファイルはバックアップに残ります(ファイル > 以前のバージョン)。 +Bring the changes over 変更を取り込む +Keep openMapper's copy openMapper のコピーを残す +its way has a gap after path 経路に途切れがあります。この後のパス: +its way does not pass 経路が通らない停留所: +On demand 要求時 +Not served (checkpoint) 通過(チェックポイント) +Wait for departure time 発車時刻まで待つ +Always + wait for departure time 常に + 発車時刻まで待つ +The bus stops only when somebody waits or wants to get off (the game's default) 誰かが待っているか降りたい時だけ停車します(ゲームの既定) +The bus always stops here ここでは常に停車します +The bus drives past without stopping: the stop only marks the way (a checkpoint) 停車せずに通過します:停留所は経路を示すだけです(チェックポイント) +The bus stops only when it is early, and waits there for its departure time 早着した時だけ停車し、発車時刻まで待ちます +The bus always stops here, and when it is early it waits for its departure time ここでは常に停車し、早着した時は発車時刻まで待ちます +All trips すべての便 +Every trip of the map, those no tour drives too マップのすべての便(どの行路も走らない便も含む) +The line number the trip shows; the line of this number lists it among its trips 便が表示する系統番号。この番号の系統は自分の便の中にこの便を表示します +Way picked by hand: 手動で選んだ経路: +the paths picked do not pass this stop 選んだパスがこの停留所を通りません +Other trips その他の便 +The time profile this departure runs to この出発が従う時間プロファイル +Time profile 時間プロファイル +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to 便は複数のプロファイル(ラッシュ時、夜間…)を持てます。行路の各出発がどれに従うかを指定します +The profile's name プロファイル名 +A new profile, a copy of this one 新しいプロファイル(これのコピー) +Delete this profile (its departures run to the first) このプロファイルを削除(その出発は最初のプロファイルに従います) +Times from stop to stop 停留所間の時間 +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. 各停留所で前の停留所からの時間を設定できます。以降の時間はずれ、便の所要時間も一緒に変わります。設定していない時間は固定した停留所間の距離に従います。固定した停留所では、早着したバスが待ちます。 +From the stop before 前の停留所から +After departure 出発後 +Minutes from the stop before to this one 前の停留所からここまでの分 +As in OMSI 2's editor. Hover a choice to see what the bus does. OMSI 2のエディタと同じです。選択肢にマウスを重ねると、バスの動きが表示されます。 +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. マップのすべての便(どの系統が表示し、どの行路が走るかを問わず)。どの行路も走らない便も残り、ここで編集したり、行路に割り当てたり、削除したりできます。 +trips 便 +driven by no tour 行路なし +no tour 行路なし +departures 出発 +No path there: click a lane of a road (View > AI lanes shows them) ここにパスはありません:道路の車線をクリックしてください(表示 > AI車線 で表示) +Done picking paths 選択完了 +Pick the paths on the map マップでパスを選択 +Choose the way yourself, path by path, as in OMSI 2's editor OMSI 2のエディタと同じく、パスを一つずつ選んで経路を自分で決めます +Find the way automatically 経路を自動で探す +Forget the paths picked: the way is found along the roads again 選んだパスを破棄:経路は再び道路に沿って探されます +The paths were picked by hand: they are kept when the stops change. パスは手動で選ばれました:停留所が変わってもそのまま残ります。 +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. ビューでパスをクリックします。終点の後や始点の前のパスは、そこまでのパスと一緒に追加されます。経路の脇のパスは、それが迂回する区間と置き換わります(交差点の別の分岐)。経路上のパスは外されます。経路は最初の停留所より前から始まり、最後の停留所より後まで続けられます。 +The way breaks after path 経路が途切れています。この後のパス: +the paths do not join, the bus's GPS loses its way here in the game パスがつながっていないため、ゲーム内でバスのGPSがここで経路を見失います +Paths of the way 経路のパス +Cut before the first stop 最初の停留所より前を切る +Cut after the last stop 最後の停留所より後を切る +path パス diff --git a/locales/kk.tsv b/locales/kk.tsv index 7e64af1..6576dab 100644 --- a/locales/kk.tsv +++ b/locales/kk.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Нысанда 2-ш Aligned angle! (Ctrl+Z to undo) Бұрыш тураланды! (Болдырмау үшін Ctrl+Z) Vertex snap complete Төбені бекіту аяқталды Align vertex angle Төбе бұрышын туралау +Complete to Дейін толықтыру +Complete to: a new piece between the free ends of the selected splines Дейін толықтыру: таңдалған сплайндардың бос ұштары арасында жаңа бөлік +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Таңдалған сплайндардың екі бос ұшы арасында бірінші таңдалған сплайн түріндегі жаңа бөлік, екеуімен орны, бағыты және биіктігі бойынша сәйкес келеді; олардың өздері өзгермейді. Тағы бір рет: қалған екі ұш қосылып, сақина тұйықталады. +The two ends already meet Бұл екі ұш бұрыннан түйіседі +Select the splines whose free ends are to be joined Бос ұштарын қосатын сплайндарды таңдаңыз +No piece of spline can join these two ends Бұл екі ұшты ешбір сплайн бөлігі қоса алмайды +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Осы картаның openMapper көшірмесі контент қалтасында ашылды (OMSI 2 қалтасындағы карта өзгертілмейді) +Read in again, changed on disk by another program: Қайта жүктелді, дискіде басқа бағдарлама өзгертті: +Could not bring the changes over Өзгерістерді көшіру мүмкін болмады +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Карта файлдары осы автосақтаудан кейін өзгертілген (басқа бағдарлама, мысалы OMSI 2 редакторы). Қалпына келтіру автосақтаудағы ескі тайлдарды осы өзгерістердің үстіне қояды. +tile(s) тайл +the global settings жалпы баптаулар +the timetable кесте +the traffic қозғалыс +the descriptions сипаттамалар +Reload from disk Дискіден жүктеу +The map changed on disk Карта дискіде өзгерді +Another program changed the map's files where it has changes here not saved yet: Басқа бағдарлама карта файлдарын осында сақталмаған өзгерістер бар жерде өзгертті: +The other changes made on disk were read in already. Дискідегі қалған өзгерістер жүктеліп қойды. +Keep mine Менікін қалдыру +The map changed in OMSI 2's folder Карта OMSI 2 қалтасында өзгерді +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Осы картаның OMSI 2 орнатуындағы көшірмесі openMapper көшірмесі контент қалтасында сақталғаннан кейін өзгертілген, мысалы OMSI 2 редакторымен +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Көшіру openMapper көшірмесіндегі осы файлдарды ауыстырады; ауыстырылған файлдар сақтық көшірмеде қалады (Файл > Алдыңғы нұсқалар). +Bring the changes over Өзгерістерді көшіру +Keep openMapper's copy openMapper көшірмесін қалдыру +its way has a gap after path оның жолында мына жолдан кейін үзіліс бар: +its way does not pass оның жолы мына аялдаманың жанынан өтпейді: +On demand Сұраныс бойынша +Not served (checkpoint) Қызмет көрсетілмейді (бақылау нүктесі) +Wait for departure time Жөнелту уақытын күту +Always + wait for departure time Әрқашан + жөнелту уақытын күту +The bus stops only when somebody waits or wants to get off (the game's default) Автобус біреу күтсе немесе түскісі келсе ғана тоқтайды (ойындағы әдепкі) +The bus always stops here Автобус мұнда әрқашан тоқтайды +The bus drives past without stopping: the stop only marks the way (a checkpoint) Автобус тоқтамай өтеді: аялдама тек жолды белгілейді (бақылау нүктесі) +The bus stops only when it is early, and waits there for its departure time Автобус уақытынан ерте келсе ғана тоқтайды және сонда жөнелту уақытын күтеді +The bus always stops here, and when it is early it waits for its departure time Автобус мұнда әрқашан тоқтайды, ал ерте келсе жөнелту уақытын күтеді +All trips Барлық рейстер +Every trip of the map, those no tour drives too Картаның барлық рейстері, ешбір шығу жүрмейтіндері де +The line number the trip shows; the line of this number lists it among its trips Рейс көрсететін желі нөмірі; осы нөмірлі желі оны өз рейстерінің арасында көрсетеді +Way picked by hand: Жол қолмен таңдалған: +the paths picked do not pass this stop таңдалған жолдар бұл аялдаманың жанынан өтпейді +Other trips Басқа рейстер +The time profile this departure runs to Бұл жөнелтудің уақыт профилі +Time profile Уақыт профилі +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Рейстің бірнеше профилі болуы мүмкін (қарбалас уақыт, түн…): шығудың әр жөнелтуі қайсысымен жүретінін көрсетеді +The profile's name Профиль аты +A new profile, a copy of this one Жаңа профиль, осының көшірмесі +Delete this profile (its departures run to the first) Бұл профильді жою (оның жөнелтулері біріншісімен жүреді) +Times from stop to stop Аялдамадан аялдамаға дейінгі уақыт +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Әр аялдамада алдыңғысынан бергі уақытты беруге болады: кейінгі уақыттар жылжиды, олармен бірге рейс уақыты да. Берілмеген уақыттар бекітілгендердің арасындағы қашықтыққа сай болады; бекітілген аялдамада ерте келген автобус күтеді. +From the stop before Алдыңғы аялдамадан +After departure Жөнелтуден кейін +Minutes from the stop before to this one Алдыңғы аялдамадан осыған дейінгі минуттар +As in OMSI 2's editor. Hover a choice to see what the bus does. OMSI 2 редакторындағыдай. Автобустың не істейтінін көру үшін нұсқаға меңзерді апарыңыз. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Картаның барлық рейстері, оларды қай желі көрсетсе де, қай шығу жүрсе де. Ешбір шығу жүрмейтін рейс сақталады: оны осы жерде өңдеуге, шығуға беруге немесе жоюға болады. +trips рейс +driven by no tour шығусыз +no tour шығу жоқ +departures жөнелту +No path there: click a lane of a road (View > AI lanes shows them) Мұнда жол жоқ: жолдың жолағын басыңыз (Көрініс > ЖИ жолақтары оларды көрсетеді) +Done picking paths Дайын +Pick the paths on the map Жолдарды картадан таңдау +Choose the way yourself, path by path, as in OMSI 2's editor Жолды өзіңіз таңдаңыз, жолма-жол, OMSI 2 редакторындағыдай +Find the way automatically Жолды автоматты түрде табу +Forget the paths picked: the way is found along the roads again Таңдалған жолдарды ұмыту: жол қайтадан көшелер бойымен табылады +The paths were picked by hand: they are kept when the stops change. Жолдар қолмен таңдалған: аялдамалар өзгергенде олар сақталады. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Көріністегі жолдарды басыңыз. Соңынан кейінгі немесе басынан алдыңғы жол оған дейінгі жолдармен бірге қосылады; маршрут жанындағы жол өзі айналып өтетін бөліктің орнын басады (қиылыстағы басқа тармақ); маршруттағы жол алынып тасталады. Маршрут бірінші аялдамаға дейін де, соңғысынан кейін де жүре алады. +The way breaks after path Жол мына жолдан кейін үзіледі: +the paths do not join, the bus's GPS loses its way here in the game жолдар жалғанбаған, ойында автобустың GPS-і мұнда бағытын жоғалтады +Paths of the way Маршрут жолдары +Cut before the first stop Бірінші аялдамаға дейін кесу +Cut after the last stop Соңғы аялдамадан кейін кесу +path жол diff --git a/locales/ko.tsv b/locales/ko.tsv index ac64e3d..cbf0baa 100644 --- a/locales/ko.tsv +++ b/locales/ko.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish 개체에서 2번째 Aligned angle! (Ctrl+Z to undo) 각도 정렬 완료! (Ctrl+Z: 실행 취소) Vertex snap complete 꼭짓점 스냅 완료 Align vertex angle 꼭짓점 각도 정렬 +Complete to 여기까지 완성 +Complete to: a new piece between the free ends of the selected splines 여기까지 완성: 선택한 스플라인의 빈 끝 사이에 새 조각 +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. 처음 선택한 스플라인의 종류로, 선택한 스플라인의 빈 끝 두 곳 사이에 위치·방향·높이가 모두 맞는 새 조각을 만듭니다. 원래 두 조각은 바뀌지 않습니다. 한 번 더: 남은 두 끝이 이어져 고리가 닫힙니다. +The two ends already meet 두 끝이 이미 만납니다 +Select the splines whose free ends are to be joined 빈 끝을 이을 스플라인을 선택하세요 +No piece of spline can join these two ends 이 두 끝을 이을 수 있는 스플라인 조각이 없습니다 +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) 이 맵의 openMapper 사본을 콘텐츠 폴더에서 열었습니다(OMSI 2 폴더의 맵은 절대 기록하지 않음) +Read in again, changed on disk by another program: 다시 읽음, 다른 프로그램이 디스크에서 변경: +Could not bring the changes over 변경 사항을 가져오지 못했습니다 +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. 이 자동 저장 이후 맵 파일이 변경되었습니다(다른 프로그램, 예: OMSI 2 편집기). 복원하면 자동 저장의 오래된 타일이 그 변경 위에 놓입니다. +tile(s) 타일 +the global settings 전역 설정 +the timetable 시간표 +the traffic 교통 +the descriptions 설명 +Reload from disk 디스크에서 다시 불러오기 +The map changed on disk 디스크에서 맵이 변경됨 +Another program changed the map's files where it has changes here not saved yet: 여기에 저장하지 않은 변경이 있는 부분의 맵 파일을 다른 프로그램이 변경했습니다: +The other changes made on disk were read in already. 디스크의 나머지 변경 사항은 이미 읽었습니다. +Keep mine 내 것 유지 +The map changed in OMSI 2's folder OMSI 2 폴더에서 맵이 변경됨 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say 콘텐츠 폴더의 openMapper 사본을 저장한 뒤 설치 폴더의 이 맵이 변경되었습니다(예: OMSI 2 편집기) +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). 가져오면 openMapper 사본의 해당 파일이 바뀝니다. 바뀐 파일은 백업에 보관됩니다(파일 > 이전 버전). +Bring the changes over 변경 사항 가져오기 +Keep openMapper's copy openMapper 사본 유지 +its way has a gap after path 경로가 끊김, 다음 패스 뒤: +its way does not pass 경로가 지나가지 않는 정류장: +On demand 요청 시 +Not served (checkpoint) 정차 안 함(체크포인트) +Wait for departure time 출발 시간까지 대기 +Always + wait for departure time 항상 + 출발 시간까지 대기 +The bus stops only when somebody waits or wants to get off (the game's default) 누군가 기다리거나 내리려 할 때만 정차합니다(게임 기본값) +The bus always stops here 여기서 항상 정차합니다 +The bus drives past without stopping: the stop only marks the way (a checkpoint) 정차하지 않고 지나갑니다. 정류장은 경로만 표시합니다(체크포인트) +The bus stops only when it is early, and waits there for its departure time 일찍 도착했을 때만 정차하고, 그곳에서 출발 시간까지 기다립니다 +The bus always stops here, and when it is early it waits for its departure time 여기서 항상 정차하고, 일찍 도착하면 출발 시간까지 기다립니다 +All trips 모든 운행 +Every trip of the map, those no tour drives too 맵의 모든 운행(어떤 운행 순번도 운행하지 않는 것 포함) +The line number the trip shows; the line of this number lists it among its trips 운행이 표시하는 노선 번호. 이 번호의 노선은 자기 운행 목록에 이 운행을 표시합니다 +Way picked by hand: 직접 고른 경로: +the paths picked do not pass this stop 고른 패스가 이 정류장을 지나지 않습니다 +Other trips 다른 운행 +The time profile this departure runs to 이 출발이 따르는 시간 프로필 +Time profile 시간 프로필 +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to 운행에는 여러 프로필(출퇴근 시간, 야간…)이 있을 수 있습니다. 운행 순번의 각 출발이 어느 것을 따르는지 정합니다 +The profile's name 프로필 이름 +A new profile, a copy of this one 새 프로필(이 프로필의 복사본) +Delete this profile (its departures run to the first) 이 프로필 삭제(그 출발은 첫 번째 프로필을 따릅니다) +Times from stop to stop 정류장 간 시간 +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. 각 정류장에서 이전 정류장부터의 시간을 정할 수 있습니다. 이후 시간이 함께 밀리고, 운행 시간도 따라 바뀝니다. 정하지 않은 시간은 고정된 정류장 사이의 거리를 따릅니다. 고정된 정류장에서는 일찍 도착한 버스가 기다립니다. +From the stop before 이전 정류장부터 +After departure 출발 후 +Minutes from the stop before to this one 이전 정류장부터 여기까지의 분 +As in OMSI 2's editor. Hover a choice to see what the bus does. OMSI 2 에디터와 같습니다. 항목에 마우스를 올리면 버스가 어떻게 하는지 보입니다. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. 맵의 모든 운행(어느 노선이 표시하든, 어느 운행 순번이 운행하든). 어떤 운행 순번도 운행하지 않는 운행도 유지되며, 여기서 편집하거나 운행 순번에 넣거나 삭제할 수 있습니다. +trips 운행 +driven by no tour 운행 순번 없음 +no tour 운행 순번 없음 +departures 출발 +No path there: click a lane of a road (View > AI lanes shows them) 여기에는 패스가 없습니다. 도로의 차선을 클릭하세요(보기 > AI 차선에서 표시) +Done picking paths 선택 완료 +Pick the paths on the map 맵에서 패스 선택 +Choose the way yourself, path by path, as in OMSI 2's editor OMSI 2 에디터처럼 패스를 하나씩 골라 경로를 직접 정합니다 +Find the way automatically 경로 자동 찾기 +Forget the paths picked: the way is found along the roads again 고른 패스 잊기: 경로를 다시 도로를 따라 찾습니다 +The paths were picked by hand: they are kept when the stops change. 패스를 직접 골랐습니다. 정류장이 바뀌어도 유지됩니다. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. 보기에서 패스를 클릭하세요. 끝 다음이나 시작 앞의 패스는 그곳까지의 패스와 함께 추가됩니다. 경로 옆의 패스는 그것이 돌아가는 구간을 대신합니다(교차로의 다른 갈래). 경로에 있는 패스는 빠집니다. 경로는 첫 정류장 앞에서 시작하고 마지막 정류장 뒤까지 이어질 수 있습니다. +The way breaks after path 경로가 끊어짐, 다음 패스 뒤: +the paths do not join, the bus's GPS loses its way here in the game 패스가 이어지지 않아, 게임에서 버스의 GPS가 여기서 경로를 잃습니다 +Paths of the way 경로의 패스 +Cut before the first stop 첫 정류장 앞 자르기 +Cut after the last stop 마지막 정류장 뒤 자르기 +path 패스 diff --git a/locales/ms.tsv b/locales/ms.tsv index 10a1499..38e06e9 100644 --- a/locales/ms.tsv +++ b/locales/ms.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Klik titik rujukan k Aligned angle! (Ctrl+Z to undo) Sudut dijajarkan! (Ctrl+Z untuk membuat asal) Vertex snap complete Lekatan bucu selesai Align vertex angle Jajarkan sudut bucu +Complete to Lengkapkan hingga +Complete to: a new piece between the free ends of the selected splines Lengkapkan hingga: keping baharu antara hujung bebas spline yang dipilih +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Keping baharu jenis spline pertama yang dipilih di antara dua hujung bebas spline yang dipilih, bertemu kedua-duanya pada kedudukan, arah dan ketinggian; kedua-duanya tidak diubah. Sekali lagi: dua hujung yang tinggal dicantum, gelang ditutup. +The two ends already meet Kedua-dua hujung sudah bertemu +Select the splines whose free ends are to be joined Pilih spline yang hujung bebasnya hendak dicantum +No piece of spline can join these two ends Tiada keping spline yang dapat mencantum kedua-dua hujung ini +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Salinan openMapper peta ini dalam folder kandungan dibuka (yang dalam folder OMSI 2 tidak pernah ditulis) +Read in again, changed on disk by another program: Dibaca semula, diubah pada cakera oleh program lain: +Could not bring the changes over Tidak dapat membawa perubahan +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Fail peta diubah selepas simpan automatik ini (oleh program lain, contohnya editor OMSI 2). Memulihkan meletakkan jubin lama simpanan di atas perubahan itu. +tile(s) jubin +the global settings tetapan global +the timetable jadual waktu +the traffic trafik +the descriptions keterangan +Reload from disk Muat semula dari cakera +The map changed on disk Peta berubah pada cakera +Another program changed the map's files where it has changes here not saved yet: Program lain mengubah fail peta di bahagian yang di sini ada perubahan belum disimpan: +The other changes made on disk were read in already. Perubahan lain pada cakera sudah dibaca. +Keep mine Kekalkan milik saya +The map changed in OMSI 2's folder Peta berubah dalam folder OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Salinan peta ini dalam pemasangan diubah selepas salinan openMapper dalam folder kandungan disimpan, contohnya oleh editor OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Membawa perubahan menggantikan fail itu dalam salinan openMapper; fail yang diganti disimpan dalam sandaran (Fail > Versi terdahulu). +Bring the changes over Bawa perubahan +Keep openMapper's copy Kekalkan salinan openMapper +its way has a gap after path lorongnya terputus selepas laluan +its way does not pass lorongnya tidak melalui +On demand Atas permintaan +Not served (checkpoint) Tidak dilayan (titik semak) +Wait for departure time Tunggu masa bertolak +Always + wait for departure time Sentiasa + tunggu masa bertolak +The bus stops only when somebody waits or wants to get off (the game's default) Bas berhenti hanya jika ada yang menunggu atau mahu turun (lalai permainan) +The bus always stops here Bas sentiasa berhenti di sini +The bus drives past without stopping: the stop only marks the way (a checkpoint) Bas melintas tanpa berhenti: perhentian hanya menandakan lorong (titik semak) +The bus stops only when it is early, and waits there for its departure time Bas berhenti hanya jika ia awal, dan menunggu di situ hingga masa bertolaknya +The bus always stops here, and when it is early it waits for its departure time Bas sentiasa berhenti di sini, dan jika ia awal ia menunggu masa bertolaknya +All trips Semua perjalanan +Every trip of the map, those no tour drives too Setiap perjalanan peta, termasuk yang tidak dipandu oleh mana-mana giliran +The line number the trip shows; the line of this number lists it among its trips Nombor laluan yang ditunjukkan perjalanan; laluan dengan nombor ini menyenaraikannya antara perjalanannya +Way picked by hand: Lorong dipilih dengan tangan: +the paths picked do not pass this stop laluan yang dipilih tidak melalui perhentian ini +Other trips Perjalanan lain +The time profile this departure runs to Profil masa yang diikuti perlepasan ini +Time profile Profil masa +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Satu perjalanan boleh ada beberapa profil (waktu puncak, malam…): setiap perlepasan giliran menyatakan profil mana yang diikutinya +The profile's name Nama profil +A new profile, a copy of this one Profil baharu, salinan profil ini +Delete this profile (its departures run to the first) Padam profil ini (perlepasannya mengikut yang pertama) +Times from stop to stop Masa dari perhentian ke perhentian +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Masa dari perhentian sebelumnya boleh ditetapkan di setiap perhentian: masa selepasnya turut beralih, begitu juga masa perjalanan. Masa yang tidak ditetapkan mengikut jarak antara yang tetap; di perhentian tetap, bas yang awal akan menunggu. +From the stop before Dari perhentian sebelumnya +After departure Selepas bertolak +Minutes from the stop before to this one Minit dari perhentian sebelumnya ke perhentian ini +As in OMSI 2's editor. Hover a choice to see what the bus does. Seperti dalam editor OMSI 2. Tuding pada pilihan untuk melihat apa yang dilakukan bas. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Setiap perjalanan peta, tidak kira laluan mana yang menunjukkannya atau giliran mana yang memandunya. Perjalanan yang tidak dipandu oleh mana-mana giliran disimpan, dan boleh diedit, diberi kepada giliran atau dipadam di sini. +trips perjalanan +driven by no tour tanpa giliran +no tour tiada giliran +departures perlepasan +No path there: click a lane of a road (View > AI lanes shows them) Tiada laluan di situ: klik lorong jalan (Paparan > Lorong AI menunjukkannya) +Done picking paths Selesai memilih +Pick the paths on the map Pilih laluan pada peta +Choose the way yourself, path by path, as in OMSI 2's editor Pilih lorong sendiri, laluan demi laluan, seperti dalam editor OMSI 2 +Find the way automatically Cari lorong secara automatik +Forget the paths picked: the way is found along the roads again Lupakan laluan yang dipilih: lorong dicari semula di sepanjang jalan +The paths were picked by hand: they are kept when the stops change. Laluan dipilih dengan tangan: ia kekal apabila perhentian berubah. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Klik laluan dalam paparan. Laluan selepas hujung atau sebelum permulaan ditambah, bersama laluan ke sana; laluan di sebelah lorong mengambil tempat bahagian yang dikelilinginya (cabang lain di simpang); laluan dalam lorong dikeluarkan. Lorong boleh bermula sebelum perhentian pertama dan diteruskan selepas yang terakhir. +The way breaks after path Lorong terputus selepas laluan +the paths do not join, the bus's GPS loses its way here in the game laluan tidak bercantum, GPS bas sesat di sini dalam permainan +Paths of the way Laluan lorong +Cut before the first stop Potong sebelum perhentian pertama +Cut after the last stop Potong selepas perhentian terakhir +path laluan diff --git a/locales/nl.tsv b/locales/nl.tsv index 7acaf90..eb087c8 100644 --- a/locales/nl.tsv +++ b/locales/nl.tsv @@ -2819,3 +2819,76 @@ Aligned angle! (Ctrl+Z om ongedaan te maken) Hoek uitgelijnd! (Ctrl+Z om ongedaa Vertex snap complete Hoekpunt magnetisch uitlijnen voltooid Align vertex angle Hoekpunt uitlijningshoek aanpassen Aligned angle! (Ctrl+Z to undo) Hoek uitgelijnd! (Ctrl+Z om ongedaan te maken) +Complete to Aanvullen tot +Complete to: a new piece between the free ends of the selected splines Aanvullen tot: een nieuw stuk tussen de vrije uiteinden van de geselecteerde splines +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Een nieuw stuk van het type van de eerst geselecteerde spline tussen twee vrije uiteinden van de geselecteerde splines, dat op beide aansluit in plaats, richting en hoogte; die zelf veranderen niet. Nog eens: de twee overgebleven uiteinden worden verbonden en de ring sluit. +The two ends already meet De twee uiteinden raken elkaar al +Select the splines whose free ends are to be joined Selecteer de splines waarvan de vrije uiteinden verbonden moeten worden +No piece of spline can join these two ends Geen stuk spline kan deze twee uiteinden verbinden +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) openMappers kopie van deze kaart in de inhoudsmap geopend (die in de OMSI 2-map wordt nooit beschreven) +Read in again, changed on disk by another program: Opnieuw ingelezen, op schijf gewijzigd door een ander programma: +Could not bring the changes over De wijzigingen konden niet worden overgenomen +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. De bestanden van de kaart zijn na deze automatische opslag gewijzigd (door een ander programma, zoals de OMSI 2-editor). Herstellen legt de oudere tegels uit de opslag over die wijzigingen. +tile(s) tegel(s) +the global settings de algemene instellingen +the timetable de dienstregeling +the traffic het verkeer +the descriptions de beschrijvingen +Reload from disk Opnieuw laden van schijf +The map changed on disk De kaart is op schijf gewijzigd +Another program changed the map's files where it has changes here not saved yet: Een ander programma heeft bestanden van de kaart gewijzigd waar hier niet-opgeslagen wijzigingen zijn: +The other changes made on disk were read in already. De overige wijzigingen op schijf zijn al ingelezen. +Keep mine Mijne behouden +The map changed in OMSI 2's folder De kaart is gewijzigd in de OMSI 2-map +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say De kopie van deze kaart in de installatie is gewijzigd nadat openMappers kopie in de inhoudsmap was opgeslagen, bijvoorbeeld door de OMSI 2-editor +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Overnemen vervangt die bestanden in openMappers kopie; de vervangen bestanden blijven bewaard in een back-up (Bestand > Eerdere versies). +Bring the changes over Wijzigingen overnemen +Keep openMapper's copy openMappers kopie behouden +its way has a gap after path zijn route heeft een gat na pad +its way does not pass zijn route komt niet langs +On demand Op verzoek +Not served (checkpoint) Niet bediend (controlepunt) +Wait for departure time Wachten op vertrektijd +Always + wait for departure time Altijd + wachten op vertrektijd +The bus stops only when somebody waits or wants to get off (the game's default) De bus stopt alleen als iemand wacht of wil uitstappen (de standaard van het spel) +The bus always stops here De bus stopt hier altijd +The bus drives past without stopping: the stop only marks the way (a checkpoint) De bus rijdt door zonder te stoppen: de halte markeert alleen de route (een controlepunt) +The bus stops only when it is early, and waits there for its departure time De bus stopt alleen als hij te vroeg is, en wacht daar op zijn vertrektijd +The bus always stops here, and when it is early it waits for its departure time De bus stopt hier altijd, en als hij te vroeg is wacht hij op zijn vertrektijd +All trips Alle ritten +Every trip of the map, those no tour drives too Elke rit van de kaart, ook die geen omloop rijdt +The line number the trip shows; the line of this number lists it among its trips Het lijnnummer dat de rit toont; de lijn met dit nummer toont hem bij zijn ritten +Way picked by hand: Route met de hand gekozen: +the paths picked do not pass this stop de gekozen paden komen niet langs deze halte +Other trips Andere ritten +The time profile this departure runs to Het tijdprofiel waarnaar dit vertrek rijdt +Time profile Tijdprofiel +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Een rit kan meerdere profielen hebben (spits, nacht…): elk vertrek van een omloop zegt naar welk het rijdt +The profile's name De naam van het profiel +A new profile, a copy of this one Een nieuw profiel, een kopie van dit +Delete this profile (its departures run to the first) Dit profiel verwijderen (zijn vertrekken rijden naar het eerste) +Times from stop to stop Tijden van halte tot halte +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Bij elke halte kan de tijd vanaf de halte ervoor worden ingesteld: de tijden erna schuiven mee, en de rittijd met ze. Niet ingestelde tijden volgen de afstand tussen de vaste; bij een vaste halte wacht een bus die te vroeg is. +From the stop before Vanaf de halte ervoor +After departure Na vertrek +Minutes from the stop before to this one Minuten van de halte ervoor tot deze +As in OMSI 2's editor. Hover a choice to see what the bus does. Zoals in de editor van OMSI 2. Wijs een keuze aan om te zien wat de bus doet. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Elke rit van de kaart, welke lijn hem ook toont of welke omloop hem ook rijdt. Een rit die geen omloop rijdt blijft bewaard, en kan hier worden bewerkt, aan een omloop gegeven of verwijderd. +trips ritten +driven by no tour door geen omloop gereden +no tour geen omloop +departures vertrekken +No path there: click a lane of a road (View > AI lanes shows them) Geen pad hier: klik op een rijstrook van een weg (Beeld > AI-rijstroken toont ze) +Done picking paths Klaar met kiezen +Pick the paths on the map De paden op de kaart kiezen +Choose the way yourself, path by path, as in OMSI 2's editor Kies de route zelf, pad voor pad, zoals in de editor van OMSI 2 +Find the way automatically De route automatisch vinden +Forget the paths picked: the way is found along the roads again De gekozen paden vergeten: de route wordt weer langs de wegen gevonden +The paths were picked by hand: they are kept when the stops change. De paden zijn met de hand gekozen: ze blijven als de haltes veranderen. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Klik paden aan in het beeld. Een na het einde of voor het begin wordt toegevoegd, met de paden ernaartoe; een naast de route neemt de plaats in van het stuk waar het omheen gaat (een andere tak op een kruising); een pad van de route wordt weggehaald. De route mag al voor de eerste halte beginnen en na de laatste doorlopen. +The way breaks after path De route breekt af na pad +the paths do not join, the bus's GPS loses its way here in the game de paden sluiten niet op elkaar aan, de gps van de bus raakt hier in het spel de weg kwijt +Paths of the way Paden van de route +Cut before the first stop Afknippen voor de eerste halte +Cut after the last stop Afknippen na de laatste halte +path pad diff --git a/locales/pl.tsv b/locales/pl.tsv index 4348892..e9b7658 100644 --- a/locales/pl.tsv +++ b/locales/pl.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Kliknij 2. punkt odn Aligned angle! (Ctrl+Z to undo) Kąt wyrównany! (Ctrl+Z, aby cofnąć) Vertex snap complete Przyciąganie wierzchołka zakończone Align vertex angle Wyrównaj kąt wierzchołka +Complete to Dokończ do +Complete to: a new piece between the free ends of the selected splines Dokończ do: nowy odcinek między wolnymi końcami zaznaczonych spline'ów +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Nowy odcinek typu pierwszego zaznaczonego spline'u między dwoma wolnymi końcami zaznaczonych spline'ów, zgodny z oboma położeniem, kierunkiem i wysokością; same one się nie zmieniają. Jeszcze raz: łączą się dwa pozostałe końce i pierścień się zamyka. +The two ends already meet Te dwa końce już się stykają +Select the splines whose free ends are to be joined Zaznacz spline'y, których wolne końce mają zostać połączone +No piece of spline can join these two ends Żaden odcinek spline'u nie połączy tych dwóch końców +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Otwarto kopię tej mapy openMappera w folderze z zawartością (mapa w folderze OMSI 2 nigdy nie jest zapisywana) +Read in again, changed on disk by another program: Wczytano ponownie, zmienione na dysku przez inny program: +Could not bring the changes over Nie udało się przenieść zmian +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Pliki mapy zmieniono po tym autozapisie (innym programem, np. edytorem OMSI 2). Przywrócenie położy starsze kafelki z autozapisu na te zmiany. +tile(s) kafelek(-ki) +the global settings ustawienia globalne +the timetable rozkład jazdy +the traffic ruch +the descriptions opisy +Reload from disk Wczytaj ponownie z dysku +The map changed on disk Mapa zmieniła się na dysku +Another program changed the map's files where it has changes here not saved yet: Inny program zmienił pliki mapy tam, gdzie są tu niezapisane zmiany: +The other changes made on disk were read in already. Pozostałe zmiany z dysku zostały już wczytane. +Keep mine Zachowaj moje +The map changed in OMSI 2's folder Mapa zmieniła się w folderze OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Kopia tej mapy w instalacji została zmieniona po zapisaniu kopii openMappera w folderze z zawartością, np. edytorem OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Przeniesienie zmian zastąpi te pliki w kopii openMappera; zastąpione pliki zostają w kopii zapasowej (Plik > Wcześniejsze wersje). +Bring the changes over Przenieś zmiany +Keep openMapper's copy Zachowaj kopię openMappera +its way has a gap after path jego trasa ma przerwę po ścieżce +its way does not pass jego trasa nie przechodzi przy +On demand Na żądanie +Not served (checkpoint) Nieobsługiwany (punkt kontrolny) +Wait for departure time Czekaj na godzinę odjazdu +Always + wait for departure time Zawsze + czekaj na godzinę odjazdu +The bus stops only when somebody waits or wants to get off (the game's default) Autobus zatrzymuje się tylko, gdy ktoś czeka lub chce wysiąść (domyślnie w grze) +The bus always stops here Autobus zawsze się tu zatrzymuje +The bus drives past without stopping: the stop only marks the way (a checkpoint) Autobus przejeżdża bez zatrzymania: przystanek tylko wyznacza trasę (punkt kontrolny) +The bus stops only when it is early, and waits there for its departure time Autobus zatrzymuje się tylko, gdy jest przed czasem, i czeka tam na godzinę odjazdu +The bus always stops here, and when it is early it waits for its departure time Autobus zawsze się tu zatrzymuje, a gdy jest przed czasem, czeka na godzinę odjazdu +All trips Wszystkie kursy +Every trip of the map, those no tour drives too Każdy kurs mapy, także te, których nie jeździ żadna brygada +The line number the trip shows; the line of this number lists it among its trips Numer linii, który pokazuje kurs; linia o tym numerze pokazuje go wśród swoich kursów +Way picked by hand: Trasa wybrana ręcznie: +the paths picked do not pass this stop wybrane ścieżki nie przechodzą przy tym przystanku +Other trips Inne kursy +The time profile this departure runs to Profil czasowy, według którego jedzie ten odjazd +Time profile Profil czasowy +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Kurs może mieć kilka profili (szczyt, noc…): każdy odjazd brygady mówi, według którego jedzie +The profile's name Nazwa profilu +A new profile, a copy of this one Nowy profil, kopia tego +Delete this profile (its departures run to the first) Usuń ten profil (jego odjazdy pojadą według pierwszego) +Times from stop to stop Czasy od przystanku do przystanku +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Przy każdym przystanku można ustawić czas od poprzedniego: kolejne czasy przesuwają się, a z nimi czas kursu. Nieustawione czasy wynikają z odległości między ustalonymi; na ustalonym przystanku autobus, który jest przed czasem, czeka. +From the stop before Od poprzedniego przystanku +After departure Po odjeździe +Minutes from the stop before to this one Minuty od poprzedniego przystanku do tego +As in OMSI 2's editor. Hover a choice to see what the bus does. Jak w edytorze OMSI 2. Najedź na opcję, aby zobaczyć, co robi autobus. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Każdy kurs mapy, bez względu na to, która linia go pokazuje i która brygada go jeździ. Kurs, którego nie jeździ żadna brygada, zostaje zachowany: można go tu edytować, dać brygadzie lub usunąć. +trips kursów +driven by no tour bez brygady +no tour brak brygady +departures odjazdów +No path there: click a lane of a road (View > AI lanes shows them) Brak tu ścieżki: kliknij pas drogi (Widok > Pasy AI je pokazuje) +Done picking paths Gotowe +Pick the paths on the map Wybierz ścieżki na mapie +Choose the way yourself, path by path, as in OMSI 2's editor Wybierz trasę sam, ścieżka po ścieżce, jak w edytorze OMSI 2 +Find the way automatically Znajdź trasę automatycznie +Forget the paths picked: the way is found along the roads again Zapomnij wybrane ścieżki: trasa znów zostanie znaleziona wzdłuż dróg +The paths were picked by hand: they are kept when the stops change. Ścieżki wybrano ręcznie: zostają, gdy zmieniają się przystanki. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Klikaj ścieżki w widoku. Ścieżka za końcem lub przed początkiem zostaje dodana wraz ze ścieżkami do niej; ścieżka obok trasy zastępuje odcinek, który omija (inna gałąź na skrzyżowaniu); ścieżka z trasy zostaje usunięta. Trasa może zaczynać się przed pierwszym przystankiem i biec dalej za ostatnim. +The way breaks after path Trasa urywa się po ścieżce +the paths do not join, the bus's GPS loses its way here in the game ścieżki się nie łączą, GPS autobusu gubi tu drogę w grze +Paths of the way Ścieżki trasy +Cut before the first stop Obetnij przed pierwszym przystankiem +Cut after the last stop Obetnij za ostatnim przystankiem +path ścieżka diff --git a/locales/pt-pt.tsv b/locales/pt-pt.tsv index 0fc1cf9..827edd2 100644 --- a/locales/pt-pt.tsv +++ b/locales/pt-pt.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Clique num 2º ponto Aligned angle! (Ctrl+Z to undo) Ângulo alinhado! (Ctrl+Z para anular) Vertex snap complete Encaixe de vértice concluído Align vertex angle Alinhar ângulo de vértice +Complete to Completar até +Complete to: a new piece between the free ends of the selected splines Completar até: uma peça nova entre as pontas livres das splines selecionadas +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Uma peça nova do tipo da primeira spline selecionada entre duas pontas livres das splines selecionadas, que coincide com ambas em posição, direção e altura; estas não mudam. Outra vez: as duas pontas que restam são juntas e o anel fecha-se. +The two ends already meet As duas pontas já se encontram +Select the splines whose free ends are to be joined Selecione as splines cujas pontas livres devem ser juntas +No piece of spline can join these two ends Nenhuma peça de spline consegue juntar estas duas pontas +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Aberta a cópia do openMapper deste mapa na pasta de conteúdo (a da pasta do OMSI 2 nunca é escrita) +Read in again, changed on disk by another program: Lido de novo, alterado no disco por outro programa: +Could not bring the changes over Não foi possível trazer as alterações +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Os ficheiros do mapa foram alterados depois desta gravação automática (por outro programa, como o editor do OMSI 2). Restaurar põe os mosaicos antigos da gravação sobre essas alterações. +tile(s) mosaico(s) +the global settings as definições globais +the timetable o horário +the traffic o tráfego +the descriptions as descrições +Reload from disk Recarregar do disco +The map changed on disk O mapa mudou no disco +Another program changed the map's files where it has changes here not saved yet: Outro programa alterou ficheiros do mapa onde aqui há alterações por guardar: +The other changes made on disk were read in already. As outras alterações do disco já foram lidas. +Keep mine Manter as minhas +The map changed in OMSI 2's folder O mapa mudou na pasta do OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say A cópia deste mapa na instalação foi alterada depois de a cópia do openMapper na pasta de conteúdo ser guardada, por exemplo pelo editor do OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Trazer as alterações substitui esses ficheiros da cópia do openMapper; os substituídos ficam numa cópia de segurança (Ficheiro > Versões anteriores). +Bring the changes over Trazer as alterações +Keep openMapper's copy Manter a cópia do openMapper +its way has a gap after path o seu percurso tem uma falha após o caminho +its way does not pass o seu percurso não passa por +On demand A pedido +Not served (checkpoint) Não servida (ponto de controlo) +Wait for departure time Esperar pela hora de partida +Always + wait for departure time Sempre + esperar pela hora de partida +The bus stops only when somebody waits or wants to get off (the game's default) O autocarro só para se alguém espera ou quer sair (o predefinido do jogo) +The bus always stops here O autocarro para sempre aqui +The bus drives past without stopping: the stop only marks the way (a checkpoint) O autocarro passa sem parar: a paragem só marca o percurso (um ponto de controlo) +The bus stops only when it is early, and waits there for its departure time O autocarro só para quando está adiantado, e espera aí pela sua hora de partida +The bus always stops here, and when it is early it waits for its departure time O autocarro para sempre aqui, e quando está adiantado espera pela sua hora de partida +All trips Todas as viagens +Every trip of the map, those no tour drives too Todas as viagens do mapa, também as que nenhum serviço faz +The line number the trip shows; the line of this number lists it among its trips O número de linha que a viagem mostra; a linha com esse número lista-a entre as suas viagens +Way picked by hand: Percurso escolhido à mão: +the paths picked do not pass this stop os caminhos escolhidos não passam por esta paragem +Other trips Outras viagens +The time profile this departure runs to O perfil de tempos que esta partida segue +Time profile Perfil de tempos +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Uma viagem pode ter vários perfis (hora de ponta, noite…): cada partida de um serviço diz qual segue +The profile's name O nome do perfil +A new profile, a copy of this one Um perfil novo, cópia deste +Delete this profile (its departures run to the first) Eliminar este perfil (as suas partidas seguem o primeiro) +Times from stop to stop Tempos de paragem a paragem +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. O tempo desde a paragem anterior pode ser definido em cada paragem: os tempos seguintes deslocam-se, e o tempo da viagem com eles. Os tempos não definidos seguem a distância entre os fixos; numa paragem fixa, um autocarro adiantado espera. +From the stop before Desde a paragem anterior +After departure Após a partida +Minutes from the stop before to this one Minutos da paragem anterior até esta +As in OMSI 2's editor. Hover a choice to see what the bus does. Como no editor do OMSI 2. Passe o rato sobre uma opção para ver o que o autocarro faz. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Todas as viagens do mapa, seja qual for a linha que as mostra ou o serviço que as faz. Uma viagem que nenhum serviço faz é mantida, e pode ser editada, dada a um serviço ou eliminada aqui. +trips viagens +driven by no tour sem nenhum serviço +no tour sem serviço +departures partidas +No path there: click a lane of a road (View > AI lanes shows them) Nenhum caminho aí: clique numa faixa de uma estrada (Ver > Faixas de IA mostra-as) +Done picking paths Escolha concluída +Pick the paths on the map Escolher os caminhos no mapa +Choose the way yourself, path by path, as in OMSI 2's editor Escolha o percurso você mesmo, caminho a caminho, como no editor do OMSI 2 +Find the way automatically Encontrar o percurso automaticamente +Forget the paths picked: the way is found along the roads again Esquecer os caminhos escolhidos: o percurso volta a ser encontrado pelas estradas +The paths were picked by hand: they are kept when the stops change. Os caminhos foram escolhidos à mão: mantêm-se quando as paragens mudam. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Clique em caminhos na vista. Um após o fim ou antes do início é acrescentado, com os caminhos até ele; um ao lado do percurso toma o lugar do troço que contorna (outro ramo num cruzamento); um caminho do percurso é retirado. O percurso pode começar antes da primeira paragem e continuar após a última. +The way breaks after path O percurso interrompe-se após o caminho +the paths do not join, the bus's GPS loses its way here in the game os caminhos não se ligam, o GPS do autocarro perde-se aqui no jogo +Paths of the way Caminhos do percurso +Cut before the first stop Cortar antes da primeira paragem +Cut after the last stop Cortar após a última paragem +path caminho diff --git a/locales/pt.tsv b/locales/pt.tsv index 9f92e3e..5724ce4 100644 --- a/locales/pt.tsv +++ b/locales/pt.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Clique num 2º ponto Aligned angle! (Ctrl+Z to undo) Ângulo alinhado! (Ctrl+Z para anular) Vertex snap complete Encaixe de vértice concluído Align vertex angle Alinhar ângulo de vértice +Complete to Completar até +Complete to: a new piece between the free ends of the selected splines Completar até: um trecho novo entre as pontas livres das splines selecionadas +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Um trecho novo do tipo da primeira spline selecionada entre duas pontas livres das splines selecionadas, que coincide com ambas em posição, direção e altura; elas não mudam. De novo: as duas pontas restantes são unidas e o anel se fecha. +The two ends already meet As duas pontas já se encontram +Select the splines whose free ends are to be joined Selecione as splines cujas pontas livres devem ser unidas +No piece of spline can join these two ends Nenhum trecho de spline consegue unir estas duas pontas +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Aberta a cópia do openMapper deste mapa na pasta de conteúdo (a da pasta do OMSI 2 nunca é escrita) +Read in again, changed on disk by another program: Lido de novo, alterado no disco por outro programa: +Could not bring the changes over Não foi possível trazer as alterações +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Os arquivos do mapa foram alterados depois deste salvamento automático (por outro programa, como o editor do OMSI 2). Restaurar põe os tiles antigos do salvamento sobre essas alterações. +tile(s) tile(s) +the global settings as configurações globais +the timetable o horário +the traffic o tráfego +the descriptions as descrições +Reload from disk Recarregar do disco +The map changed on disk O mapa mudou no disco +Another program changed the map's files where it has changes here not saved yet: Outro programa alterou arquivos do mapa onde aqui há alterações não salvas: +The other changes made on disk were read in already. As outras alterações do disco já foram lidas. +Keep mine Manter as minhas +The map changed in OMSI 2's folder O mapa mudou na pasta do OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say A cópia deste mapa na instalação foi alterada depois que a cópia do openMapper na pasta de conteúdo foi salva, por exemplo pelo editor do OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Trazer as alterações substitui esses arquivos da cópia do openMapper; os substituídos ficam num backup (Arquivo > Versões anteriores). +Bring the changes over Trazer as alterações +Keep openMapper's copy Manter a cópia do openMapper +its way has a gap after path seu caminho tem uma falha após o caminho +its way does not pass seu caminho não passa por +On demand Sob demanda +Not served (checkpoint) Não atendido (ponto de controle) +Wait for departure time Esperar a hora de partida +Always + wait for departure time Sempre + esperar a hora de partida +The bus stops only when somebody waits or wants to get off (the game's default) O ônibus só para se alguém espera ou quer descer (o padrão do jogo) +The bus always stops here O ônibus sempre para aqui +The bus drives past without stopping: the stop only marks the way (a checkpoint) O ônibus passa sem parar: o ponto só marca o caminho (um ponto de controle) +The bus stops only when it is early, and waits there for its departure time O ônibus só para quando está adiantado, e espera ali a sua hora de partida +The bus always stops here, and when it is early it waits for its departure time O ônibus sempre para aqui, e quando está adiantado espera a sua hora de partida +All trips Todas as viagens +Every trip of the map, those no tour drives too Todas as viagens do mapa, também as que nenhuma escala faz +The line number the trip shows; the line of this number lists it among its trips O número de linha que a viagem mostra; a linha com esse número a lista entre suas viagens +Way picked by hand: Caminho escolhido à mão: +the paths picked do not pass this stop os caminhos escolhidos não passam por este ponto +Other trips Outras viagens +The time profile this departure runs to O perfil de tempos que esta partida segue +Time profile Perfil de tempos +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Uma viagem pode ter vários perfis (hora do rush, noite…): cada partida de uma escala diz qual segue +The profile's name O nome do perfil +A new profile, a copy of this one Um perfil novo, cópia deste +Delete this profile (its departures run to the first) Excluir este perfil (suas partidas seguem o primeiro) +Times from stop to stop Tempos de ponto a ponto +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. O tempo desde o ponto anterior pode ser definido em cada ponto: os tempos seguintes se deslocam, e o tempo da viagem com eles. Tempos não definidos seguem a distância entre os fixos; num ponto fixo, um ônibus adiantado espera. +From the stop before Desde o ponto anterior +After departure Após a partida +Minutes from the stop before to this one Minutos do ponto anterior até este +As in OMSI 2's editor. Hover a choice to see what the bus does. Como no editor do OMSI 2. Passe o mouse sobre uma opção para ver o que o ônibus faz. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Todas as viagens do mapa, qualquer que seja a linha que as mostra ou a escala que as faz. Uma viagem que nenhuma escala faz é mantida, e pode ser editada, dada a uma escala ou excluída aqui. +trips viagens +driven by no tour sem nenhuma escala +no tour sem escala +departures partidas +No path there: click a lane of a road (View > AI lanes shows them) Nenhum caminho aí: clique numa faixa de uma estrada (Exibir > Faixas de IA as mostra) +Done picking paths Escolha concluída +Pick the paths on the map Escolher os caminhos no mapa +Choose the way yourself, path by path, as in OMSI 2's editor Escolha o percurso você mesmo, caminho a caminho, como no editor do OMSI 2 +Find the way automatically Achar o caminho automaticamente +Forget the paths picked: the way is found along the roads again Esquecer os caminhos escolhidos: o percurso volta a ser achado pelas estradas +The paths were picked by hand: they are kept when the stops change. Os caminhos foram escolhidos à mão: são mantidos quando os pontos mudam. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Clique em caminhos na vista. Um após o fim ou antes do início é adicionado, com os caminhos até ele; um ao lado do percurso toma o lugar do trecho que contorna (outro ramo num cruzamento); um caminho do percurso é retirado. O percurso pode começar antes do primeiro ponto e seguir após o último. +The way breaks after path O percurso se interrompe após o caminho +the paths do not join, the bus's GPS loses its way here in the game os caminhos não se ligam, o GPS do ônibus se perde aqui no jogo +Paths of the way Caminhos do percurso +Cut before the first stop Cortar antes do primeiro ponto +Cut after the last stop Cortar após o último ponto +path caminho diff --git a/locales/sv.tsv b/locales/sv.tsv index 592941a..fa0a72f 100644 --- a/locales/sv.tsv +++ b/locales/sv.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Klicka på en andra Aligned angle! (Ctrl+Z to undo) Vinkel justerad! (Ctrl+Z för att ångra) Vertex snap complete Hörnfästning slutförd Align vertex angle Justera hörnvinkel +Complete to Komplettera till +Complete to: a new piece between the free ends of the selected splines Komplettera till: en ny del mellan de valda splinernas fria ändar +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. En ny del av den först valda splinens typ mellan två fria ändar på de valda splinerna, som möter båda i läge, riktning och höjd; de själva ändras inte. Igen: de två ändar som är kvar sammanfogas och ringen sluts. +The two ends already meet De två ändarna möts redan +Select the splines whose free ends are to be joined Välj de spliner vars fria ändar ska sammanfogas +No piece of spline can join these two ends Ingen splinedel kan sammanfoga dessa två ändar +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Öppnade openMappers kopia av kartan i innehållsmappen (den i OMSI 2-mappen skrivs aldrig) +Read in again, changed on disk by another program: Inläst igen, ändrad på disken av ett annat program: +Could not bring the changes over Kunde inte föra över ändringarna +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Kartans filer ändrades efter denna autosparning (av ett annat program, t.ex. OMSI 2:s editor). Att återställa lägger autosparningens äldre rutor över de ändringarna. +tile(s) ruta/rutor +the global settings de globala inställningarna +the timetable tidtabellen +the traffic trafiken +the descriptions beskrivningarna +Reload from disk Läs in från disken igen +The map changed on disk Kartan ändrades på disken +Another program changed the map's files where it has changes here not saved yet: Ett annat program ändrade kartans filer där den har osparade ändringar här: +The other changes made on disk were read in already. Övriga ändringar på disken är redan inlästa. +Keep mine Behåll mina +The map changed in OMSI 2's folder Kartan ändrades i OMSI 2-mappen +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Kopian av kartan i installationen ändrades efter att openMappers kopia i innehållsmappen sparades, t.ex. av OMSI 2:s editor +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Att föra över ändringarna ersätter de filerna i openMappers kopia; de ersatta filerna sparas i en säkerhetskopia (Arkiv > Tidigare versioner). +Bring the changes over För över ändringarna +Keep openMapper's copy Behåll openMappers kopia +its way has a gap after path dess väg har ett glapp efter körfält +its way does not pass dess väg passerar inte +On demand Vid behov +Not served (checkpoint) Betjänas inte (kontrollpunkt) +Wait for departure time Vänta på avgångstid +Always + wait for departure time Alltid + vänta på avgångstid +The bus stops only when somebody waits or wants to get off (the game's default) Bussen stannar bara om någon väntar eller vill gå av (spelets standard) +The bus always stops here Bussen stannar alltid här +The bus drives past without stopping: the stop only marks the way (a checkpoint) Bussen kör förbi utan att stanna: hållplatsen markerar bara vägen (en kontrollpunkt) +The bus stops only when it is early, and waits there for its departure time Bussen stannar bara när den är tidig, och väntar där på sin avgångstid +The bus always stops here, and when it is early it waits for its departure time Bussen stannar alltid här, och när den är tidig väntar den på sin avgångstid +All trips Alla turer +Every trip of the map, those no tour drives too Varje tur på kartan, även de som inget omlopp kör +The line number the trip shows; the line of this number lists it among its trips Linjenumret som turen visar; linjen med det numret listar den bland sina turer +Way picked by hand: Väg vald för hand: +the paths picked do not pass this stop de valda körfälten passerar inte den här hållplatsen +Other trips Andra turer +The time profile this departure runs to Tidsprofilen som avgången går efter +Time profile Tidsprofil +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to En tur kan ha flera profiler (rusningstid, natt…): varje avgång i ett omlopp säger vilken den går efter +The profile's name Profilens namn +A new profile, a copy of this one En ny profil, en kopia av den här +Delete this profile (its departures run to the first) Ta bort den här profilen (dess avgångar går efter den första) +Times from stop to stop Tider från hållplats till hållplats +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Tiden från hållplatsen innan kan anges vid varje hållplats: tiderna efter flyttas med, och turens tid med dem. Tider som inte är angivna följer avståndet mellan de fasta; vid en fast hållplats väntar en buss som är tidig. +From the stop before Från hållplatsen innan +After departure Efter avgång +Minutes from the stop before to this one Minuter från hållplatsen innan till den här +As in OMSI 2's editor. Hover a choice to see what the bus does. Som i OMSI 2:s redigerare. Håll muspekaren över ett val för att se vad bussen gör. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Varje tur på kartan, vilken linje som än visar den eller vilket omlopp som än kör den. En tur som inget omlopp kör sparas, och kan redigeras, ges till ett omlopp eller tas bort här. +trips turer +driven by no tour körs av inget omlopp +no tour inget omlopp +departures avgångar +No path there: click a lane of a road (View > AI lanes shows them) Inget körfält där: klicka på ett körfält på en väg (Visa > AI-körfält visar dem) +Done picking paths Klart med valet +Pick the paths on the map Välj körfälten på kartan +Choose the way yourself, path by path, as in OMSI 2's editor Välj vägen själv, körfält för körfält, som i OMSI 2:s redigerare +Find the way automatically Hitta vägen automatiskt +Forget the paths picked: the way is found along the roads again Glöm de valda körfälten: vägen hittas längs vägarna igen +The paths were picked by hand: they are kept when the stops change. Körfälten valdes för hand: de behålls när hållplatserna ändras. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Klicka på körfält i vyn. Ett efter slutet eller före början läggs till, med körfälten dit; ett bredvid vägen ersätter den del det går runt (en annan gren i en korsning); ett körfält i vägen tas ut. Vägen får börja före den första hållplatsen och fortsätta efter den sista. +The way breaks after path Vägen bryts efter körfält +the paths do not join, the bus's GPS loses its way here in the game körfälten hänger inte ihop, bussens GPS tappar vägen här i spelet +Paths of the way Vägens körfält +Cut before the first stop Klipp före den första hållplatsen +Cut after the last stop Klipp efter den sista hållplatsen +path körfält diff --git a/locales/th.tsv b/locales/th.tsv index 73909a3..cbd3dc4 100644 --- a/locales/th.tsv +++ b/locales/th.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish คลิกจุ Aligned angle! (Ctrl+Z to undo) จัดแนวมุมแล้ว! (Ctrl+Z เพื่อเลิกทำ) Vertex snap complete ตรึงจุดยอดเสร็จสมบูรณ์ Align vertex angle จัดแนวมุมของจุดยอด +Complete to ต่อให้ถึง +Complete to: a new piece between the free ends of the selected splines ต่อให้ถึง: ชิ้นใหม่ระหว่างปลายว่างของสไปลน์ที่เลือก +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. ชิ้นใหม่ชนิดเดียวกับสไปลน์ที่เลือกเป็นอันแรก ระหว่างปลายว่างสองปลายของสไปลน์ที่เลือก โดยตรงกับทั้งสองทั้งตำแหน่ง ทิศทาง และความสูง ส่วนสองชิ้นเดิมไม่เปลี่ยน กดอีกครั้ง: ปลายสองปลายที่เหลือจะต่อกันและปิดวง +The two ends already meet ปลายทั้งสองบรรจบกันอยู่แล้ว +Select the splines whose free ends are to be joined เลือกสไปลน์ที่ต้องการต่อปลายว่าง +No piece of spline can join these two ends ไม่มีชิ้นสไปลน์ใดต่อปลายทั้งสองนี้ได้ +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) เปิดสำเนาของ openMapper สำหรับแผนที่นี้ในโฟลเดอร์เนื้อหาแล้ว (แผนที่ในโฟลเดอร์ OMSI 2 จะไม่ถูกเขียนทับ) +Read in again, changed on disk by another program: อ่านใหม่แล้ว โปรแกรมอื่นเปลี่ยนบนดิสก์: +Could not bring the changes over ไม่สามารถนำการเปลี่ยนแปลงมาได้ +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. ไฟล์ของแผนที่ถูกเปลี่ยนหลังการบันทึกอัตโนมัตินี้ (โดยโปรแกรมอื่น เช่น ตัวแก้ไขของ OMSI 2) การกู้คืนจะวางไทล์ที่เก่ากว่าจากการบันทึกทับการเปลี่ยนแปลงเหล่านั้น +tile(s) ไทล์ +the global settings การตั้งค่าทั่วไป +the timetable ตารางเวลา +the traffic การจราจร +the descriptions คำอธิบาย +Reload from disk โหลดใหม่จากดิสก์ +The map changed on disk แผนที่เปลี่ยนบนดิสก์ +Another program changed the map's files where it has changes here not saved yet: โปรแกรมอื่นเปลี่ยนไฟล์ของแผนที่ในส่วนที่ที่นี่มีการเปลี่ยนแปลงที่ยังไม่ได้บันทึก: +The other changes made on disk were read in already. อ่านการเปลี่ยนแปลงอื่นบนดิสก์แล้ว +Keep mine เก็บของฉันไว้ +The map changed in OMSI 2's folder แผนที่เปลี่ยนในโฟลเดอร์ OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say สำเนาของแผนที่นี้ในการติดตั้งถูกเปลี่ยนหลังจากบันทึกสำเนาของ openMapper ในโฟลเดอร์เนื้อหาแล้ว เช่น โดยตัวแก้ไขของ OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). การนำการเปลี่ยนแปลงมาจะแทนที่ไฟล์เหล่านั้นในสำเนาของ openMapper ไฟล์ที่ถูกแทนที่จะเก็บไว้ในข้อมูลสำรอง (ไฟล์ > เวอร์ชันก่อนหน้า) +Bring the changes over นำการเปลี่ยนแปลงมา +Keep openMapper's copy เก็บสำเนาของ openMapper +its way has a gap after path เส้นทางขาดช่วงหลังพาธที่ +its way does not pass เส้นทางไม่ผ่าน +On demand ตามคำขอ +Not served (checkpoint) ไม่จอด (จุดตรวจ) +Wait for departure time รอเวลาออก +Always + wait for departure time เสมอ + รอเวลาออก +The bus stops only when somebody waits or wants to get off (the game's default) รถบัสจอดเฉพาะเมื่อมีคนรอหรือต้องการลง (ค่าเริ่มต้นของเกม) +The bus always stops here รถบัสจอดที่นี่เสมอ +The bus drives past without stopping: the stop only marks the way (a checkpoint) รถบัสวิ่งผ่านโดยไม่จอด: ป้ายเพียงกำหนดเส้นทาง (จุดตรวจ) +The bus stops only when it is early, and waits there for its departure time รถบัสจอดเฉพาะเมื่อมาก่อนเวลา และรอที่นั่นจนถึงเวลาออก +The bus always stops here, and when it is early it waits for its departure time รถบัสจอดที่นี่เสมอ และถ้ามาก่อนเวลาจะรอจนถึงเวลาออก +All trips เที่ยวทั้งหมด +Every trip of the map, those no tour drives too ทุกเที่ยวของแผนที่ รวมถึงเที่ยวที่ไม่มีทัวร์ใดวิ่ง +The line number the trip shows; the line of this number lists it among its trips หมายเลขสายที่เที่ยวแสดง; สายที่มีหมายเลขนี้จะแสดงเที่ยวนี้ในรายการเที่ยวของตน +Way picked by hand: เส้นทางที่เลือกเอง: +the paths picked do not pass this stop พาธที่เลือกไม่ผ่านป้ายนี้ +Other trips เที่ยวอื่น +The time profile this departure runs to โปรไฟล์เวลาที่เที่ยวออกนี้ใช้ +Time profile โปรไฟล์เวลา +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to เที่ยวหนึ่งมีได้หลายโปรไฟล์ (ชั่วโมงเร่งด่วน, กลางคืน…): เที่ยวออกแต่ละเที่ยวของทัวร์ระบุว่าใช้โปรไฟล์ใด +The profile's name ชื่อโปรไฟล์ +A new profile, a copy of this one โปรไฟล์ใหม่ สำเนาของโปรไฟล์นี้ +Delete this profile (its departures run to the first) ลบโปรไฟล์นี้ (เที่ยวออกของมันจะใช้โปรไฟล์แรก) +Times from stop to stop เวลาจากป้ายถึงป้าย +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. ตั้งเวลาจากป้ายก่อนหน้าได้ที่ทุกป้าย: เวลาหลังจากนั้นจะเลื่อนตาม และเวลาของเที่ยวก็เลื่อนตามด้วย เวลาที่ไม่ได้ตั้งจะเป็นไปตามระยะทางระหว่างป้ายที่กำหนดไว้; ที่ป้ายที่กำหนดไว้ รถบัสที่มาก่อนเวลาจะรอ +From the stop before จากป้ายก่อนหน้า +After departure หลังออก +Minutes from the stop before to this one นาทีจากป้ายก่อนหน้าถึงป้ายนี้ +As in OMSI 2's editor. Hover a choice to see what the bus does. เหมือนในเอดิเตอร์ของ OMSI 2 วางเมาส์บนตัวเลือกเพื่อดูว่ารถบัสทำอะไร +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. ทุกเที่ยวของแผนที่ ไม่ว่าสายใดแสดงหรือทัวร์ใดวิ่ง เที่ยวที่ไม่มีทัวร์ใดวิ่งจะถูกเก็บไว้ และแก้ไข มอบให้ทัวร์ หรือลบได้ที่นี่ +trips เที่ยว +driven by no tour ไม่มีทัวร์วิ่ง +no tour ไม่มีทัวร์ +departures เที่ยวออก +No path there: click a lane of a road (View > AI lanes shows them) ไม่มีพาธที่นั่น: คลิกเลนของถนน (มุมมอง > เลน AI แสดงเลนเหล่านั้น) +Done picking paths เลือกเสร็จ +Pick the paths on the map เลือกพาธบนแผนที่ +Choose the way yourself, path by path, as in OMSI 2's editor เลือกเส้นทางเอง ทีละพาธ เหมือนในเอดิเตอร์ของ OMSI 2 +Find the way automatically หาเส้นทางอัตโนมัติ +Forget the paths picked: the way is found along the roads again ลืมพาธที่เลือก: เส้นทางจะถูกหาตามถนนอีกครั้ง +The paths were picked by hand: they are kept when the stops change. พาธถูกเลือกเอง: จะยังคงอยู่เมื่อป้ายเปลี่ยน +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. คลิกพาธในมุมมอง พาธหลังจุดสิ้นสุดหรือก่อนจุดเริ่มต้นจะถูกเพิ่มพร้อมพาธที่ไปถึง; พาธข้างเส้นทางจะแทนที่ส่วนที่มันอ้อม (อีกแยกหนึ่งที่ทางแยก); พาธของเส้นทางจะถูกเอาออก เส้นทางเริ่มก่อนป้ายแรกและวิ่งต่อหลังป้ายสุดท้ายได้ +The way breaks after path เส้นทางขาดหลังพาธที่ +the paths do not join, the bus's GPS loses its way here in the game พาธไม่เชื่อมกัน GPS ของรถบัสในเกมจะหลงทางตรงนี้ +Paths of the way พาธของเส้นทาง +Cut before the first stop ตัดก่อนป้ายแรก +Cut after the last stop ตัดหลังป้ายสุดท้าย +path พาธ diff --git a/locales/tl.tsv b/locales/tl.tsv index f0e861c..55ef397 100644 --- a/locales/tl.tsv +++ b/locales/tl.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Mag-click ng ika-2 s Aligned angle! (Ctrl+Z to undo) Naitugma ang anggulo! (Ctrl+Z upang i-undo) Vertex snap complete Nakumpleto ang snap ng vertex Align vertex angle Itugma ang anggulo ng vertex +Complete to Kumpletuhin hanggang +Complete to: a new piece between the free ends of the selected splines Kumpletuhin hanggang: bagong piraso sa pagitan ng malayang dulo ng mga napiling spline +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Bagong piraso na kauri ng unang napiling spline sa pagitan ng dalawang malayang dulo ng mga napiling spline, tugma sa pareho sa puwesto, direksyon at taas; hindi binabago ang dalawa. Muli: pinagdudugtong ang dalawang natitirang dulo at nasasara ang singsing. +The two ends already meet Nagtatagpo na ang dalawang dulo +Select the splines whose free ends are to be joined Piliin ang mga spline na pagdudugtungin ang malayang dulo +No piece of spline can join these two ends Walang piraso ng spline na makapagdudugtong sa dalawang dulong ito +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Binuksan ang kopya ng openMapper ng mapang ito sa content folder (hindi kailanman sinusulatan ang nasa folder ng OMSI 2) +Read in again, changed on disk by another program: Binasa muli, binago sa disk ng ibang programa: +Could not bring the changes over Hindi madala ang mga pagbabago +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Binago ang mga file ng mapa pagkatapos ng autosave na ito (ng ibang programa, gaya ng editor ng OMSI 2). Ang pagbalik ay maglalagay ng mas lumang tile ng autosave sa ibabaw ng mga pagbabagong iyon. +tile(s) tile +the global settings ang pangkalahatang setting +the timetable ang timetable +the traffic ang trapiko +the descriptions ang mga paglalarawan +Reload from disk I-reload mula sa disk +The map changed on disk Nagbago ang mapa sa disk +Another program changed the map's files where it has changes here not saved yet: Binago ng ibang programa ang mga file ng mapa kung saan may mga hindi pa naseseyb na pagbabago rito: +The other changes made on disk were read in already. Nabasa na ang iba pang pagbabago sa disk. +Keep mine Panatilihin ang akin +The map changed in OMSI 2's folder Nagbago ang mapa sa folder ng OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Binago ang kopya ng mapang ito sa instalasyon pagkatapos maseyb ang kopya ng openMapper sa content folder, halimbawa ng editor ng OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Papalitan ng pagdadala ang mga file na iyon sa kopya ng openMapper; itinatabi ang mga napalitang file sa isang backup (File > Mga naunang bersyon). +Bring the changes over Dalhin ang mga pagbabago +Keep openMapper's copy Panatilihin ang kopya ng openMapper +its way has a gap after path may puwang ang daan nito pagkatapos ng path +its way does not pass hindi dumadaan ang daan nito sa +On demand Kapag may sasakay o bababa +Not served (checkpoint) Hindi hinihintuan (checkpoint) +Wait for departure time Hintayin ang oras ng alis +Always + wait for departure time Palagi + hintayin ang oras ng alis +The bus stops only when somebody waits or wants to get off (the game's default) Humihinto lang ang bus kapag may naghihintay o gustong bumaba (default ng laro) +The bus always stops here Palaging humihinto rito ang bus +The bus drives past without stopping: the stop only marks the way (a checkpoint) Dumadaan ang bus nang hindi humihinto: tanda lang ng daan ang hintuan (checkpoint) +The bus stops only when it is early, and waits there for its departure time Humihinto lang ang bus kapag maaga ito, at doon hinihintay ang oras ng alis nito +The bus always stops here, and when it is early it waits for its departure time Palaging humihinto rito ang bus, at kapag maaga ito hinihintay nito ang oras ng alis +All trips Lahat ng biyahe +Every trip of the map, those no tour drives too Bawat biyahe ng mapa, pati ang mga walang tour na nagmamaneho +The line number the trip shows; the line of this number lists it among its trips Ang numero ng linyang ipinapakita ng biyahe; inililista ito ng linyang may numerong ito sa mga biyahe nito +Way picked by hand: Daang pinili nang manu-mano: +the paths picked do not pass this stop hindi dumadaan sa hintuang ito ang mga napiling path +Other trips Ibang biyahe +The time profile this departure runs to Ang time profile na sinusunod ng departure na ito +Time profile Time profile +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Puwedeng may ilang profile ang biyahe (rush hour, gabi…): sinasabi ng bawat departure ng tour kung alin ang sinusunod nito +The profile's name Ang pangalan ng profile +A new profile, a copy of this one Bagong profile, kopya nito +Delete this profile (its departures run to the first) Burahin ang profile na ito (susunod sa una ang mga departure nito) +Times from stop to stop Oras mula hintuan hanggang hintuan +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Maitatakda sa bawat hintuan ang oras mula sa naunang hintuan: gumagalaw kasabay ang mga oras pagkatapos nito, pati ang oras ng biyahe. Ang mga oras na hindi itinakda ay sumusunod sa layo sa pagitan ng mga nakapirmi; sa nakapirming hintuan, naghihintay ang bus na maaga. +From the stop before Mula sa naunang hintuan +After departure Pagkaalis +Minutes from the stop before to this one Minuto mula sa naunang hintuan hanggang dito +As in OMSI 2's editor. Hover a choice to see what the bus does. Gaya sa editor ng OMSI 2. I-hover ang isang pagpipilian para makita ang ginagawa ng bus. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Bawat biyahe ng mapa, anumang linya ang nagpapakita nito o anumang tour ang nagmamaneho nito. Iniingatan ang biyaheng walang tour na nagmamaneho, at dito ito maaaring i-edit, ibigay sa isang tour o burahin. +trips biyahe +driven by no tour walang tour na nagmamaneho +no tour walang tour +departures departure +No path there: click a lane of a road (View > AI lanes shows them) Walang path diyan: mag-click ng lane ng kalsada (ipinapakita ang mga ito ng Tingnan > Mga AI lane) +Done picking paths Tapos na sa pagpili +Pick the paths on the map Piliin ang mga path sa mapa +Choose the way yourself, path by path, as in OMSI 2's editor Ikaw ang pumili ng daan, isa-isang path, gaya sa editor ng OMSI 2 +Find the way automatically Hanapin ang daan nang awtomatiko +Forget the paths picked: the way is found along the roads again Kalimutan ang mga napiling path: muling hahanapin ang daan sa mga kalsada +The paths were picked by hand: they are kept when the stops change. Pinili nang manu-mano ang mga path: iniingatan ang mga ito kapag nagbago ang mga hintuan. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Mag-click ng mga path sa view. Idinadagdag ang isang path pagkatapos ng dulo o bago ang simula, kasama ang mga path papunta roon; ang isang nasa tabi ng daan ay pumapalit sa bahaging iniikutan nito (ibang sanga sa isang junction); inaalis ang path na nasa daan. Puwedeng magsimula ang daan bago ang unang hintuan at magpatuloy pagkatapos ng huli. +The way breaks after path Napuputol ang daan pagkatapos ng path +the paths do not join, the bus's GPS loses its way here in the game hindi nagdudugtong ang mga path, naliligaw dito ang GPS ng bus sa laro +Paths of the way Mga path ng daan +Cut before the first stop Putulin bago ang unang hintuan +Cut after the last stop Putulin pagkatapos ng huling hintuan +path path diff --git a/locales/tr.tsv b/locales/tr.tsv index a1d9126..c1a3f9c 100644 --- a/locales/tr.tsv +++ b/locales/tr.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Nesne üzerinde 2. r Aligned angle! (Ctrl+Z to undo) Açı hizalandı! (Geri almak için Ctrl+Z) Vertex snap complete Köşe yakalama tamamlandı Align vertex angle Köşe açısını hizala +Complete to Şuraya kadar tamamla +Complete to: a new piece between the free ends of the selected splines Şuraya kadar tamamla: seçili spline'ların serbest uçları arasına yeni parça +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Seçili spline'ların iki serbest ucu arasına, ilk seçilen spline'ın türünde, ikisiyle de konum, yön ve yükseklikte buluşan yeni bir parça; ikisi değişmez. Tekrar: kalan iki uç birleştirilir, halka kapanır. +The two ends already meet İki uç zaten buluşuyor +Select the splines whose free ends are to be joined Serbest uçları birleştirilecek spline'ları seçin +No piece of spline can join these two ends Hiçbir spline parçası bu iki ucu birleştiremez +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Bu haritanın openMapper kopyası içerik klasöründe açıldı (OMSI 2 klasöründeki asla yazılmaz) +Read in again, changed on disk by another program: Yeniden okundu, diskte başka bir program tarafından değiştirildi: +Could not bring the changes over Değişiklikler aktarılamadı +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Haritanın dosyaları bu otomatik kayıttan sonra değiştirildi (başka bir programla, örneğin OMSI 2 editörüyle). Geri yüklemek, kayıttaki eski karoları bu değişikliklerin üzerine koyar. +tile(s) karo +the global settings genel ayarlar +the timetable tarife +the traffic trafik +the descriptions açıklamalar +Reload from disk Diskten yeniden yükle +The map changed on disk Harita diskte değişti +Another program changed the map's files where it has changes here not saved yet: Başka bir program, burada kaydedilmemiş değişiklikler olan yerlerde haritanın dosyalarını değiştirdi: +The other changes made on disk were read in already. Diskteki diğer değişiklikler zaten okundu. +Keep mine Benimkileri tut +The map changed in OMSI 2's folder Harita OMSI 2 klasöründe değişti +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Bu haritanın kurulumdaki kopyası, openMapper'ın içerik klasöründeki kopyası kaydedildikten sonra değiştirildi, örneğin OMSI 2 editörüyle +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Değişiklikleri aktarmak openMapper kopyasındaki bu dosyaları değiştirir; değiştirilen dosyalar bir yedekte tutulur (Dosya > Önceki sürümler). +Bring the changes over Değişiklikleri aktar +Keep openMapper's copy openMapper kopyasını tut +its way has a gap after path güzergâhında şu yoldan sonra boşluk var: +its way does not pass güzergâhı şuradan geçmiyor: +On demand İsteğe bağlı +Not served (checkpoint) Hizmet yok (kontrol noktası) +Wait for departure time Kalkış saatini bekle +Always + wait for departure time Her zaman + kalkış saatini bekle +The bus stops only when somebody waits or wants to get off (the game's default) Otobüs yalnızca biri bekliyorsa ya da inmek istiyorsa durur (oyunun varsayılanı) +The bus always stops here Otobüs burada her zaman durur +The bus drives past without stopping: the stop only marks the way (a checkpoint) Otobüs durmadan geçer: durak yalnızca güzergâhı işaretler (kontrol noktası) +The bus stops only when it is early, and waits there for its departure time Otobüs yalnızca erkense durur ve orada kalkış saatini bekler +The bus always stops here, and when it is early it waits for its departure time Otobüs burada her zaman durur ve erkense kalkış saatini bekler +All trips Tüm seferler +Every trip of the map, those no tour drives too Haritanın her seferi, hiçbir sefer turunun yapmadıkları da +The line number the trip shows; the line of this number lists it among its trips Seferin gösterdiği hat numarası; bu numaralı hat onu kendi seferleri arasında listeler +Way picked by hand: Güzergâh elle seçildi: +the paths picked do not pass this stop seçilen yollar bu duraktan geçmiyor +Other trips Diğer seferler +The time profile this departure runs to Bu kalkışın izlediği zaman profili +Time profile Zaman profili +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Bir seferin birkaç profili olabilir (yoğun saat, gece…): sefer turunun her kalkışı hangisini izlediğini söyler +The profile's name Profilin adı +A new profile, a copy of this one Yeni bir profil, bunun kopyası +Delete this profile (its departures run to the first) Bu profili sil (kalkışları ilkini izler) +Times from stop to stop Duraktan durağa süreler +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Her durakta önceki duraktan süre ayarlanabilir: sonraki süreler kayar, onlarla birlikte seferin süresi de. Ayarlanmamış süreler sabit olanlar arasındaki mesafeyi izler; sabit bir durakta erken gelen otobüs bekler. +From the stop before Önceki duraktan +After departure Kalkıştan sonra +Minutes from the stop before to this one Önceki duraktan buna kadar dakika +As in OMSI 2's editor. Hover a choice to see what the bus does. OMSI 2'nin editöründeki gibi. Otobüsün ne yaptığını görmek için bir seçeneğin üzerine gelin. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Haritanın her seferi, hangi hat gösterirse ya da hangi sefer turu yaparsa yapsın. Hiçbir sefer turunun yapmadığı sefer saklanır; burada düzenlenebilir, bir sefer turuna verilebilir ya da silinebilir. +trips sefer +driven by no tour hiçbir sefer turu yapmıyor +no tour sefer turu yok +departures kalkış +No path there: click a lane of a road (View > AI lanes shows them) Orada yol yok: bir yolun şeridine tıklayın (Görünüm > YZ şeritleri onları gösterir) +Done picking paths Seçim bitti +Pick the paths on the map Yolları haritada seç +Choose the way yourself, path by path, as in OMSI 2's editor Güzergâhı kendiniz seçin, yol yol, OMSI 2'nin editöründeki gibi +Find the way automatically Güzergâhı otomatik bul +Forget the paths picked: the way is found along the roads again Seçilen yolları unut: güzergâh yeniden yollar boyunca bulunur +The paths were picked by hand: they are kept when the stops change. Yollar elle seçildi: duraklar değişince korunur. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Görünümde yollara tıklayın. Sondan sonraki ya da baştan önceki yol, ona giden yollarla birlikte eklenir; güzergâhın yanındaki yol, dolandığı parçanın yerini alır (kavşakta başka bir kol); güzergâhtaki yol çıkarılır. Güzergâh ilk duraktan önce başlayıp son duraktan sonra sürebilir. +The way breaks after path Güzergâh şu yoldan sonra kopuyor: +the paths do not join, the bus's GPS loses its way here in the game yollar birleşmiyor, otobüsün GPS'i oyunda burada yolunu kaybediyor +Paths of the way Güzergâhın yolları +Cut before the first stop İlk duraktan öncesini kes +Cut after the last stop Son duraktan sonrasını kes +path yol diff --git a/locales/uk.tsv b/locales/uk.tsv index 0811e1e..685c140 100644 --- a/locales/uk.tsv +++ b/locales/uk.tsv @@ -2816,3 +2816,76 @@ Click a 2nd reference point on the object, or Esc to finish Клацніть 2- Aligned angle! (Ctrl+Z to undo) Кут вирівняно! (Ctrl+Z для скасування) Vertex snap complete Прив'язку вершини завершено Align vertex angle Вирівняти кут вершини +Complete to Добудувати до +Complete to: a new piece between the free ends of the selected splines Добудувати до: новий шматок між вільними кінцями вибраних сплайнів +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Новий шматок типу першого вибраного сплайна між двома вільними кінцями вибраних сплайнів, що збігається з обома за місцем, напрямком і висотою; самі вони не змінюються. Ще раз: з'єднуються два кінці, що лишилися, кільце замикається. +The two ends already meet Ці два кінці вже сходяться +Select the splines whose free ends are to be joined Виберіть сплайни, вільні кінці яких треба з'єднати +No piece of spline can join these two ends Жоден шматок сплайна не з'єднає ці два кінці +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Відкрито копію цієї карти openMapper у теці вмісту (карта в теці OMSI 2 не змінюється) +Read in again, changed on disk by another program: Завантажено заново, змінено на диску іншою програмою: +Could not bring the changes over Не вдалося перенести зміни +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Файли карти змінено після цього автозбереження (іншою програмою, наприклад редактором OMSI 2). Відновлення покладе старі тайли з автозбереження поверх цих змін. +tile(s) тайл(ів) +the global settings загальні налаштування +the timetable розклад +the traffic трафік +the descriptions описи +Reload from disk Завантажити з диска +The map changed on disk Карта змінилася на диску +Another program changed the map's files where it has changes here not saved yet: Інша програма змінила файли карти там, де тут є незбережені зміни: +The other changes made on disk were read in already. Решту змін з диска вже завантажено. +Keep mine Залишити мої +The map changed in OMSI 2's folder Карта змінилася в теці OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Копію цієї карти в установці OMSI 2 змінено після збереження копії openMapper у теці вмісту, наприклад редактором OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Перенесення замінить ці файли в копії openMapper; замінені файли зберігаються в резервній копії (Файл > Попередні версії). +Bring the changes over Перенести зміни +Keep openMapper's copy Залишити копію openMapper +its way has a gap after path у його шляху розрив після шляху +its way does not pass його шлях не проходить біля +On demand На вимогу +Not served (checkpoint) Не обслуговується (контрольна точка) +Wait for departure time Чекати часу відправлення +Always + wait for departure time Завжди + чекати часу відправлення +The bus stops only when somebody waits or wants to get off (the game's default) Автобус зупиняється, лише якщо хтось чекає або хоче вийти (так за замовчуванням у грі) +The bus always stops here Автобус завжди тут зупиняється +The bus drives past without stopping: the stop only marks the way (a checkpoint) Автобус проїжджає без зупинки: зупинка лише позначає шлях (контрольна точка) +The bus stops only when it is early, and waits there for its departure time Автобус зупиняється, лише якщо йде раніше часу, і чекає там часу відправлення +The bus always stops here, and when it is early it waits for its departure time Автобус завжди тут зупиняється, а якщо йде раніше часу, чекає часу відправлення +All trips Усі рейси +Every trip of the map, those no tour drives too Усі рейси карти, і ті, якими не їздить жоден оборот +The line number the trip shows; the line of this number lists it among its trips Номер лінії, який показує рейс; лінія з цим номером показує його серед своїх рейсів +Way picked by hand: Шлях вибрано вручну: +the paths picked do not pass this stop вибрані шляхи не проходять біля цієї зупинки +Other trips Інші рейси +The time profile this departure runs to Профіль часу цього відправлення +Time profile Профіль часу +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to У рейсу може бути кілька профілів (година пік, ніч…): кожне відправлення обороту вказує, за яким воно йде +The profile's name Назва профілю +A new profile, a copy of this one Новий профіль, копія цього +Delete this profile (its departures run to the first) Видалити цей профіль (його відправлення йтимуть за першим) +Times from stop to stop Час від зупинки до зупинки +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Біля кожної зупинки можна задати час від попередньої: наступні часи зсуваються, а з ними і час рейсу. Незадані часи йдуть за відстанню між закріпленими; на закріпленій зупинці автобус, що прийшов раніше, чекає. +From the stop before Від попередньої +After departure Після відправлення +Minutes from the stop before to this one Хвилини від попередньої зупинки до цієї +As in OMSI 2's editor. Hover a choice to see what the bus does. Як у редакторі OMSI 2. Наведіть на варіант, щоб побачити, що робить автобус. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Усі рейси карти, хоч би яка лінія їх показувала і хоч би який оборот їздив. Рейс, яким не їздить жоден оборот, зберігається: його можна правити, дати обороту або видалити тут. +trips рейсів +driven by no tour без оборотів +no tour немає оборотів +departures відпр. +No path there: click a lane of a road (View > AI lanes shows them) Тут немає шляху: клацніть по смузі дороги (Вигляд > Смуги ШІ показує їх) +Done picking paths Готово +Pick the paths on the map Вибрати шляхи на карті +Choose the way yourself, path by path, as in OMSI 2's editor Виберіть шлях самі, шлях за шляхом, як у редакторі OMSI 2 +Find the way automatically Знайти шлях автоматично +Forget the paths picked: the way is found along the roads again Забути вибрані шляхи: шлях знову знайдеться по дорогах +The paths were picked by hand: they are kept when the stops change. Шляхи вибрано вручну: вони зберігаються, коли змінюються зупинки. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Клацайте шляхи на карті. Шлях після кінця або перед початком додається разом зі шляхами до нього; шлях збоку замінює ділянку, яку він об'їжджає (інша гілка на перехресті); шлях із маршруту прибирається. Шлях може йти і до першої зупинки, і після останньої. +The way breaks after path Шлях переривається після шляху +the paths do not join, the bus's GPS loses its way here in the game шляхи не з'єднані, GPS автобуса в грі тут губить маршрут +Paths of the way Шляхи маршруту +Cut before the first stop Прибрати до першої зупинки +Cut after the last stop Прибрати після останньої зупинки +path шлях diff --git a/locales/vi.tsv b/locales/vi.tsv index c057244..75c36f3 100644 --- a/locales/vi.tsv +++ b/locales/vi.tsv @@ -2818,3 +2818,76 @@ Click a 2nd reference point on the object, or Esc to finish Bấm điểm tham c Aligned angle! (Ctrl+Z to undo) Đã căn chỉnh góc! (Ctrl+Z để hoàn tác) Vertex snap complete Bắt dính đỉnh hoàn tất Align vertex angle Căn chỉnh góc đỉnh +Complete to Hoàn thiện đến +Complete to: a new piece between the free ends of the selected splines Hoàn thiện đến: đoạn mới giữa các đầu tự do của các spline đã chọn +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. Một đoạn mới cùng loại với spline được chọn đầu tiên, nằm giữa hai đầu tự do của các spline đã chọn, khớp với cả hai về vị trí, hướng và độ cao; hai spline đó không bị thay đổi. Làm lại: hai đầu còn lại được nối, khép kín vòng. +The two ends already meet Hai đầu đã gặp nhau +Select the splines whose free ends are to be joined Chọn các spline có đầu tự do cần nối +No piece of spline can join these two ends Không đoạn spline nào nối được hai đầu này +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) Đã mở bản sao của openMapper cho bản đồ này trong thư mục nội dung (bản trong thư mục OMSI 2 không bao giờ bị ghi) +Read in again, changed on disk by another program: Đã đọc lại, bị chương trình khác thay đổi trên đĩa: +Could not bring the changes over Không thể đưa các thay đổi sang +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. Các tệp của bản đồ đã bị thay đổi sau lần tự lưu này (bởi chương trình khác, ví dụ trình soạn thảo OMSI 2). Khôi phục sẽ đặt các ô cũ hơn của bản tự lưu lên trên những thay đổi đó. +tile(s) ô +the global settings cài đặt chung +the timetable thời gian biểu +the traffic giao thông +the descriptions mô tả +Reload from disk Tải lại từ đĩa +The map changed on disk Bản đồ đã thay đổi trên đĩa +Another program changed the map's files where it has changes here not saved yet: Một chương trình khác đã thay đổi tệp của bản đồ ở chỗ tại đây có thay đổi chưa lưu: +The other changes made on disk were read in already. Các thay đổi khác trên đĩa đã được đọc. +Keep mine Giữ của tôi +The map changed in OMSI 2's folder Bản đồ đã thay đổi trong thư mục OMSI 2 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say Bản sao của bản đồ này trong bản cài đặt đã bị thay đổi sau khi bản sao của openMapper trong thư mục nội dung được lưu, ví dụ bởi trình soạn thảo OMSI 2 +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). Đưa thay đổi sang sẽ thay các tệp đó trong bản sao của openMapper; các tệp bị thay được giữ trong bản sao lưu (Tệp > Phiên bản cũ hơn). +Bring the changes over Đưa thay đổi sang +Keep openMapper's copy Giữ bản sao của openMapper +its way has a gap after path đường đi của nó bị hở sau làn +its way does not pass đường đi của nó không qua +On demand Theo yêu cầu +Not served (checkpoint) Không phục vụ (điểm kiểm tra) +Wait for departure time Chờ giờ xuất bến +Always + wait for departure time Luôn luôn + chờ giờ xuất bến +The bus stops only when somebody waits or wants to get off (the game's default) Xe buýt chỉ dừng khi có người chờ hoặc muốn xuống (mặc định của game) +The bus always stops here Xe buýt luôn dừng ở đây +The bus drives past without stopping: the stop only marks the way (a checkpoint) Xe buýt chạy qua không dừng: điểm dừng chỉ đánh dấu đường đi (điểm kiểm tra) +The bus stops only when it is early, and waits there for its departure time Xe buýt chỉ dừng khi đến sớm, và chờ ở đó đến giờ xuất bến +The bus always stops here, and when it is early it waits for its departure time Xe buýt luôn dừng ở đây, và khi đến sớm thì chờ đến giờ xuất bến +All trips Tất cả chuyến +Every trip of the map, those no tour drives too Mọi chuyến của bản đồ, cả những chuyến không lượt nào chạy +The line number the trip shows; the line of this number lists it among its trips Số tuyến mà chuyến hiển thị; tuyến mang số này liệt kê nó trong các chuyến của mình +Way picked by hand: Đường đi chọn bằng tay: +the paths picked do not pass this stop các làn đã chọn không qua điểm dừng này +Other trips Chuyến khác +The time profile this departure runs to Hồ sơ thời gian mà giờ xuất bến này chạy theo +Time profile Hồ sơ thời gian +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to Một chuyến có thể có nhiều hồ sơ (giờ cao điểm, ban đêm…): mỗi giờ xuất bến của lượt cho biết nó chạy theo hồ sơ nào +The profile's name Tên hồ sơ +A new profile, a copy of this one Hồ sơ mới, bản sao của hồ sơ này +Delete this profile (its departures run to the first) Xóa hồ sơ này (các giờ xuất bến của nó chạy theo hồ sơ đầu tiên) +Times from stop to stop Thời gian từ điểm dừng đến điểm dừng +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. Có thể đặt thời gian từ điểm dừng trước ở mỗi điểm dừng: các thời gian sau đó dịch theo, và thời gian chuyến cũng vậy. Thời gian chưa đặt theo khoảng cách giữa các điểm cố định; ở điểm dừng cố định, xe buýt đến sớm sẽ chờ. +From the stop before Từ điểm dừng trước +After departure Sau khi xuất bến +Minutes from the stop before to this one Số phút từ điểm dừng trước đến điểm này +As in OMSI 2's editor. Hover a choice to see what the bus does. Như trong trình soạn thảo của OMSI 2. Di chuột lên một lựa chọn để xem xe buýt làm gì. +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. Mọi chuyến của bản đồ, bất kể tuyến nào hiển thị hay lượt nào chạy. Chuyến không lượt nào chạy vẫn được giữ, và có thể sửa, giao cho một lượt hoặc xóa ở đây. +trips chuyến +driven by no tour không lượt nào chạy +no tour không có lượt +departures giờ xuất bến +No path there: click a lane of a road (View > AI lanes shows them) Không có làn ở đó: hãy bấm vào một làn của đường (Xem > Làn AI hiện chúng) +Done picking paths Xong chọn +Pick the paths on the map Chọn các làn trên bản đồ +Choose the way yourself, path by path, as in OMSI 2's editor Tự chọn đường đi, từng làn một, như trong trình soạn thảo của OMSI 2 +Find the way automatically Tự động tìm đường đi +Forget the paths picked: the way is found along the roads again Quên các làn đã chọn: đường đi lại được tìm theo các con đường +The paths were picked by hand: they are kept when the stops change. Các làn đã được chọn bằng tay: chúng được giữ khi điểm dừng thay đổi. +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. Bấm vào các làn trong khung nhìn. Làn sau điểm cuối hoặc trước điểm đầu được thêm vào, cùng các làn dẫn tới nó; làn bên cạnh đường đi thay cho đoạn mà nó đi vòng (nhánh khác ở giao lộ); làn thuộc đường đi bị bỏ ra. Đường đi có thể bắt đầu trước điểm dừng đầu tiên và tiếp tục sau điểm cuối cùng. +The way breaks after path Đường đi bị đứt sau làn +the paths do not join, the bus's GPS loses its way here in the game các làn không nối nhau, GPS của xe buýt trong game bị lạc ở đây +Paths of the way Các làn của đường đi +Cut before the first stop Cắt trước điểm dừng đầu tiên +Cut after the last stop Cắt sau điểm dừng cuối cùng +path làn diff --git a/locales/zh-tw.tsv b/locales/zh-tw.tsv index 7a64206..b95df01 100644 --- a/locales/zh-tw.tsv +++ b/locales/zh-tw.tsv @@ -2814,3 +2814,76 @@ Click a 2nd reference point on the object, or Esc to finish 點擊物件上的 Aligned angle! (Ctrl+Z to undo) 已對齊角度!(Ctrl+Z 復原) Vertex snap complete 頂點吸附完成 Align vertex angle 對齊頂點角度 +Complete to 補完至 +Complete to: a new piece between the free ends of the selected splines 補完至:在所選Spline的空端之間加一段新的 +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. 在所選Spline的兩個空端之間加一段新的,類型同第一條所選Spline,位置、方向和高度都與兩端吻合;原有兩段不變。再按一次:剩下的兩端相接,環就封閉。 +The two ends already meet 這兩端已經相接 +Select the splines whose free ends are to be joined 請選擇要接合空端的Spline +No piece of spline can join these two ends 沒有任何Spline段能接合這兩端 +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) 已在內容資料夾中開啟此地圖的 openMapper 副本(OMSI 2 資料夾中的地圖從不寫入) +Read in again, changed on disk by another program: 已重新讀取,磁碟上被其他程式變更: +Could not bring the changes over 無法匯入變更 +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. 此自動儲存之後,地圖檔案已被變更(由其他程式,例如 OMSI 2 編輯器)。還原會把自動儲存中較舊的地塊覆蓋到這些變更之上。 +tile(s) 地塊 +the global settings 全域設定 +the timetable 時刻表 +the traffic 交通 +the descriptions 描述 +Reload from disk 從磁碟重新載入 +The map changed on disk 地圖在磁碟上已變更 +Another program changed the map's files where it has changes here not saved yet: 其他程式變更了地圖檔案,而此處這些部分有未儲存的變更: +The other changes made on disk were read in already. 磁碟上的其他變更已讀取。 +Keep mine 保留我的 +The map changed in OMSI 2's folder 地圖在 OMSI 2 資料夾中已變更 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say 在內容資料夾中儲存 openMapper 副本之後,安裝目錄中的此地圖被變更了(例如由 OMSI 2 編輯器) +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). 匯入變更會取代 openMapper 副本中的這些檔案;被取代的檔案保存在備份中(檔案 > 先前的版本)。 +Bring the changes over 匯入變更 +Keep openMapper's copy 保留 openMapper 副本 +its way has a gap after path 其路線有斷口,在路徑之後: +its way does not pass 其路線不經過 +On demand 按需停靠 +Not served (checkpoint) 不停靠(檢查點) +Wait for departure time 等待發車時間 +Always + wait for departure time 永遠 + 等待發車時間 +The bus stops only when somebody waits or wants to get off (the game's default) 僅在有人候車或要下車時停靠(遊戲預設) +The bus always stops here 巴士永遠在此停靠 +The bus drives past without stopping: the stop only marks the way (a checkpoint) 巴士不停駛過:該站只標記路線(檢查點) +The bus stops only when it is early, and waits there for its departure time 僅在巴士早到時停靠,並在此等到發車時間 +The bus always stops here, and when it is early it waits for its departure time 巴士永遠在此停靠,早到時等到發車時間 +All trips 所有班次 +Every trip of the map, those no tour drives too 地圖上的所有班次,包括沒有車班行駛的 +The line number the trip shows; the line of this number lists it among its trips 班次顯示的路線號碼;該號碼的路線在其班次中列出它 +Way picked by hand: 手動選取的路線: +the paths picked do not pass this stop 選取的路徑不經過此站 +Other trips 其他班次 +The time profile this departure runs to 此發車所依照的時間設定檔 +Time profile 時間設定檔 +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to 一個班次可有多個設定檔(尖峰、夜間…):車班的每次發車註明依照哪一個 +The profile's name 設定檔名稱 +A new profile, a copy of this one 新設定檔,複製此設定檔 +Delete this profile (its departures run to the first) 刪除此設定檔(其發車改依第一個設定檔) +Times from stop to stop 站間時間 +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. 可在每個站設定距上一站的時間:其後的時間隨之移動,班次時長也一樣。未設定的時間依固定站之間的距離分配;在固定站,早到的巴士會等待。 +From the stop before 距上一站 +After departure 發車後 +Minutes from the stop before to this one 從上一站到本站的分鐘數 +As in OMSI 2's editor. Hover a choice to see what the bus does. 與 OMSI 2 編輯器相同。將滑鼠停在選項上可查看巴士的行為。 +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. 地圖上的所有班次,無論由哪條路線顯示或哪個車班行駛。沒有車班行駛的班次也會保留,可在此編輯、指派給車班或刪除。 +trips 個班次 +driven by no tour 無車班 +no tour 無車班 +departures 次發車 +No path there: click a lane of a road (View > AI lanes shows them) 此處沒有路徑:請點擊道路的行車線(檢視 > AI 行車線 可顯示行車線) +Done picking paths 選取完成 +Pick the paths on the map 在地圖上選取路徑 +Choose the way yourself, path by path, as in OMSI 2's editor 像 OMSI 2 編輯器那樣,逐條選取路徑來自己決定路線 +Find the way automatically 自動尋找路線 +Forget the paths picked: the way is found along the roads again 忘掉選取的路徑:重新沿道路尋找路線 +The paths were picked by hand: they are kept when the stops change. 路徑是手動選取的:站點改變時會保留。 +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. 在檢視中點擊路徑。終點之後或起點之前的路徑會連同通往它的路徑一起加入;路線旁邊的路徑會取代它繞過的那一段(路口的另一分支);路線上的路徑會被移除。路線可以在第一站之前開始,並在最後一站之後繼續。 +The way breaks after path 路線中斷,在路徑之後: +the paths do not join, the bus's GPS loses its way here in the game 路徑沒有相連,遊戲中巴士的 GPS 在此會迷路 +Paths of the way 路線的路徑 +Cut before the first stop 剪掉第一站之前 +Cut after the last stop 剪掉最後一站之後 +path 路徑 diff --git a/locales/zh.tsv b/locales/zh.tsv index f972adb..2ea0dd5 100644 --- a/locales/zh.tsv +++ b/locales/zh.tsv @@ -2814,3 +2814,76 @@ Click a 2nd reference point on the object, or Esc to finish 点击物体上的 Aligned angle! (Ctrl+Z to undo) 已对齐角度!(Ctrl+Z 撤销) Vertex snap complete 顶点吸附完成 Align vertex angle 对齐顶点角度 +Complete to 补全至 +Complete to: a new piece between the free ends of the selected splines 补全至:在所选Spline线的空端之间加一段新的 +A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring. 在所选Spline线的两个空端之间加一段新的,类型同第一条所选Spline线,位置、方向和高度都与两端吻合;原有两段不变。再按一次:剩下的两端相接,环就闭合。 +The two ends already meet 这两端已经相接 +Select the splines whose free ends are to be joined 请选择要连接空端的Spline线 +No piece of spline can join these two ends 没有任何Spline段能连接这两端 +Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written) 已在内容文件夹中打开此地图的 openMapper 副本(OMSI 2 文件夹中的地图从不写入) +Read in again, changed on disk by another program: 已重新读取,磁盘上被其他程序更改: +Could not bring the changes over 无法导入更改 +The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes. 此自动保存之后,地图文件已被更改(由其他程序,例如 OMSI 2 编辑器)。恢复会把自动保存中较旧的地块覆盖到这些更改之上。 +tile(s) 地块 +the global settings 全局设置 +the timetable 时刻表 +the traffic 交通 +the descriptions 描述 +Reload from disk 从磁盘重新加载 +The map changed on disk 地图在磁盘上已更改 +Another program changed the map's files where it has changes here not saved yet: 其他程序更改了地图文件,而此处这些部分有未保存的更改: +The other changes made on disk were read in already. 磁盘上的其他更改已读取。 +Keep mine 保留我的 +The map changed in OMSI 2's folder 地图在 OMSI 2 文件夹中已更改 +The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say 在内容文件夹中保存 openMapper 副本之后,安装目录中的此地图被更改了(例如由 OMSI 2 编辑器) +Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions). 导入更改会替换 openMapper 副本中的这些文件;被替换的文件保存在备份中(文件 > 早期版本)。 +Bring the changes over 导入更改 +Keep openMapper's copy 保留 openMapper 副本 +its way has a gap after path 其路线有断口,在路径之后: +its way does not pass 其路线不经过 +On demand 按需停靠 +Not served (checkpoint) 不停靠(检查点) +Wait for departure time 等待发车时间 +Always + wait for departure time 始终 + 等待发车时间 +The bus stops only when somebody waits or wants to get off (the game's default) 仅当有人等车或要下车时停靠(游戏默认) +The bus always stops here 巴士总在此停靠 +The bus drives past without stopping: the stop only marks the way (a checkpoint) 巴士不停驶过:该站只标记路线(检查点) +The bus stops only when it is early, and waits there for its departure time 仅当巴士早到时停靠,并在此等到发车时间 +The bus always stops here, and when it is early it waits for its departure time 巴士总在此停靠,早到时等到发车时间 +All trips 所有班次 +Every trip of the map, those no tour drives too 地图上的所有班次,包括没有车次跑的 +The line number the trip shows; the line of this number lists it among its trips 班次显示的线路号;该号码的线路在其班次中列出它 +Way picked by hand: 手动选取的路线: +the paths picked do not pass this stop 选取的路径不经过此站 +Other trips 其他班次 +The time profile this departure runs to 此发车所依照的时间配置 +Time profile 时间配置 +A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to 一个班次可有多个配置(高峰、夜间…):车次的每次发车注明依照哪一个 +The profile's name 配置名称 +A new profile, a copy of this one 新配置,复制此配置 +Delete this profile (its departures run to the first) 删除此配置(其发车改依第一个配置) +Times from stop to stop 站间时间 +The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits. 可在每个站设置距上一站的时间:其后的时间随之移动,班次时长也一样。未设置的时间按固定站之间的距离分配;在固定站,早到的巴士会等待。 +From the stop before 距上一站 +After departure 发车后 +Minutes from the stop before to this one 从上一站到本站的分钟数 +As in OMSI 2's editor. Hover a choice to see what the bus does. 与 OMSI 2 编辑器相同。将鼠标悬停在选项上可查看巴士的行为。 +Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here. 地图上的所有班次,无论由哪条线路显示或哪个车次跑。没有车次跑的班次也会保留,可在此编辑、分配给车次或删除。 +trips 个班次 +driven by no tour 无车次 +no tour 无车次 +departures 次发车 +No path there: click a lane of a road (View > AI lanes shows them) 此处没有路径:请点击道路的车道(视图 > AI 车道 可显示车道) +Done picking paths 选取完成 +Pick the paths on the map 在地图上选取路径 +Choose the way yourself, path by path, as in OMSI 2's editor 像 OMSI 2 编辑器那样,逐条选取路径来自己决定路线 +Find the way automatically 自动查找路线 +Forget the paths picked: the way is found along the roads again 忘掉选取的路径:重新沿道路查找路线 +The paths were picked by hand: they are kept when the stops change. 路径是手动选取的:站点改变时会保留。 +Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last. 在视图中点击路径。终点之后或起点之前的路径会连同通向它的路径一起添加;路线旁边的路径会取代它绕过的那一段(路口的另一分支);路线上的路径会被移除。路线可以在第一站之前开始,并在最后一站之后继续。 +The way breaks after path 路线中断,在路径之后: +the paths do not join, the bus's GPS loses its way here in the game 路径没有相连,游戏中巴士的 GPS 在此会迷路 +Paths of the way 路线的路径 +Cut before the first stop 剪掉第一站之前 +Cut after the last stop 剪掉最后一站之后 +path 路径 diff --git a/src/app.rs b/src/app.rs index 21c311d..588f223 100644 --- a/src/app.rs +++ b/src/app.rs @@ -132,6 +132,8 @@ pub struct App { save_flight: Option>>, /// An autosave left by a session that did not end normally, offered back. recover: Option, + /// The open map kept in step with its files on disk. + sync: crate::ui_sync::MapSync, /// The Lines window. tt: crate::ui_timetable::TimetableUi, /// The Traffic and AI window. @@ -283,6 +285,7 @@ impl App { autosave: Default::default(), save_flight: None, recover: None, + sync: Default::default(), }; crate::logging::stage("looking for OMSI 2 and the content"); app.setup_roots(); @@ -402,6 +405,15 @@ impl App { // (a big map is read and its tiles made ready for the view here, the window waiting: // the log says so if that wait is long enough for the watchdog to write) crate::logging::busy("opening the map"); + // (what other programs wrote since is read: openOMSI's listings of folders start afresh) + omsi_cfg::content_changed(); + // an installation's map that openMapper saved is edited as its copy in the content + // folder; what OMSI 2's editor changed in the installation's since is offered then + let copy = crate::doc::sync::copy_of(roots, cfg); + if copy.is_some() { + self.ed.toast(tr("Opened openMapper's copy of this map in the content folder (the OMSI 2 folder's own is never written)", "Открыта копия этой карты openMapper в папке контента (карта в папке OMSI 2 не изменяется)")); + } + let cfg = copy.as_deref().unwrap_or(cfg); let loaded = Document::load(roots, cfg, |_| {}); match loaded { Ok(doc) => { @@ -440,8 +452,12 @@ impl App { self.prefs.save(); } - fn after_open(&mut self, doc: Document) { + fn after_open(&mut self, mut doc: Document) { self.remember_view(); + // (scaled copies of a name OMSI 2 does not read, made by an earlier openMapper) + if let Some(roots) = &self.roots { + crate::scaled::renew_old_copies(roots, &mut doc); + } // look at the map's middle (or its editor camera) let keys: Vec<_> = doc.tiles.keys().copied().collect(); let mut c = DVec2::ZERO; @@ -481,6 +497,7 @@ impl App { g.renderer.reset_map(); } self.ed.open(doc); + self.sync.rebase(self.ed.doc.as_ref()); self.ed.set_tool(Tool::Select); // (the loaded window of tiles starts round where the map opened) self.stream_at = None; @@ -1218,6 +1235,8 @@ impl App { crate::doc::autosave::clear(&r.content); } self.autosave.reset(); + // (the files written now are the map's own, not a change from outside) + self.sync.rebase(Some(doc)); let cfg = doc.dir.join("global.cfg"); let dir = doc.dir.display().to_string(); let has_start = !doc.global.entry_points.is_empty(); @@ -1235,6 +1254,15 @@ impl App { } } + /// Parts of the map were read from disk again: what the editor kept of the old ones (the + /// selection, the undo steps) goes, the view follows the revisions. + fn read_in_again(&mut self, done: &crate::doc::sync::Changes) { + if let Some(doc) = self.ed.doc.take() { + self.ed.open(doc); + } + self.ed.toast(format!("{} {}", tr("Read in again, changed on disk by another program:", "Загружено заново, изменено на диске другой программой:"), done.describe())); + } + /// Bring an autosave's changes back (or drop them). fn recover_autosave(&mut self, yes: bool, meta: &crate::doc::autosave::Meta) { let Some(roots) = &self.roots else { return }; @@ -1468,7 +1496,7 @@ impl App { } fn do_action(&mut self, a: Action, el: &ActiveEventLoop) { - let guarded = matches!(a, Action::Close | Action::Open(_) | Action::OpenDialog | Action::NewMap { .. } | Action::Quit | Action::RestoreBackup(_)); + let guarded = matches!(a, Action::Close | Action::Open(_) | Action::OpenDialog | Action::NewMap { .. } | Action::Quit | Action::RestoreBackup(_) | Action::ReloadFromDisk); // (the map is about to be left or its files replaced: a save still writing lands first, // so it is not cut short, nor counted as changes to lose) if guarded { @@ -1511,6 +1539,11 @@ impl App { Action::Save => { self.save_smooth(); } + Action::ReloadFromDisk => { + if let Some(dir) = self.ed.doc.as_ref().and_then(crate::doc::sync::read_dir) { + self.open_map(&dir.join("global.cfg")); + } + } Action::RestoreBackup(b) => { let Some(dir) = self.ed.doc.as_ref().map(|d| d.dir.clone()) else { return }; match crate::doc::safe::restore(&dir, &b) { @@ -2347,6 +2380,7 @@ impl App { } Cmd::Ruler => self.ed.toggle_ruler(), Cmd::Knife => self.ed.toggle_cutting(), + Cmd::CompleteTo => self.ed.complete_to(), Cmd::EditMesh => self.toggle_edit_mode(), Cmd::Polygon | Cmd::PolygonClick => { let splines = self.ed.selection().iter().any(|s| matches!(s, Sel::Spline(..))); @@ -2892,6 +2926,7 @@ impl App { let mut view: Option<(egui::Rect, bool)> = None; let gpu_name = g.gpu.adapter_name.clone(); let mut recover_answer = None; + let mut sync_answer = None; let mut restart_now = false; // (the selected object's PBR state for its properties: looked up when it changes) let sel_file = match (self.ed.selected, &self.ed.doc) { @@ -3065,6 +3100,7 @@ impl App { if let Some(m) = &self.recover { recover_answer = crate::doc::autosave::offer(&ctx, m); } + sync_answer = crate::ui_sync::window(&ctx, &self.sync); let unsaved = self.ed.doc.as_ref().map(|d| d.is_dirty()).unwrap_or(false); restart_now = self.updater.frame(&ctx, &mut self.prefs, unsaved) && self.recover.is_none(); }); @@ -3434,6 +3470,20 @@ impl App { // earlier session's autosave is still offered: there is one, it would be written over) let editing = self.mouse.left || self.ed.history.is_open() || self.recover.is_some() || self.chrono.in_session(); self.autosave.tick(self.ed.doc.as_ref(), self.roots.as_ref().map(|r| r.content.as_path()), editing); + // what other programs changed in the map's files read in (not in multiplayer as a + // guest: that map is the host's) + let busy = editing || self.save_flight.is_some() || self.collab.is_guest() || self.shot.is_some(); + if let Some(done) = self.sync.tick(self.ed.doc.as_mut(), self.roots.as_ref(), busy) { + self.read_in_again(&done); + } + if let Some(yes) = sync_answer { + match self.sync.answer(self.ed.doc.as_mut(), yes) { + crate::ui_sync::Answered::Reloaded(done) => self.read_in_again(&done), + crate::ui_sync::Answered::Took(n) => log::info!("{n} file(s) taken from the installation's map"), + crate::ui_sync::Answered::Failed(e) => self.ed.error(format!("{}: {e}", tr("Could not bring the changes over", "Не удалось перенести изменения"))), + crate::ui_sync::Answered::Nothing => {} + } + } } /// A scripted session (`OPENMAPPER_DEMO=`): a new map with roads, objects and @@ -3882,6 +3932,28 @@ impl ApplicationHandler for App { } self.keys.alt = alt; } + WindowEvent::Focused(_) => { + // (keys and buttons let go of in another window, after Alt + Tab, never come + // up here: the camera would fly on by itself. Whatever was held is let go of) + self.keys = Keys::default(); + self.ed.ctrl_held = false; + self.ed.shift_held = false; + self.ed.straight_lock = false; + self.mouse.right = false; + self.mouse.middle = false; + self.mouse.grab = false; + self.mouse.alt_orbit = false; + self.mouse.grab_anchor = None; + self.mouse.look_acc = (0.0, 0.0); + if self.mouse.look_raw { + self.mouse.look_raw = false; + let _ = g.window.set_cursor_grab(winit::window::CursorGrabMode::None); + g.window.set_cursor_visible(true); + } + } + // (a key the system says is down as the window gets the focus: not one pressed + // here, and one stuck down in Windows would fly the camera at every start) + WindowEvent::KeyboardInput { event, is_synthetic: true, .. } if event.state == ElementState::Pressed => {} WindowEvent::KeyboardInput { event, .. } => { let pressed = event.state == ElementState::Pressed; let code = match event.physical_key { diff --git a/src/assets.rs b/src/assets.rs index cf6797e..52f0b8c 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -76,6 +76,9 @@ pub struct ObjectModel { pub holes: Vec, /// Its own lanes (`[path]`: junctions, stops), in its frame. pub paths: Vec, + /// Its `[crossing_heightdeformation]` field: its mesh is draped onto it, and so are its + /// paths when they are laid into the world (`object_paths::world_point`). + pub deform: Option>, /// Not seen in the game (`[onlyeditor]`, a start point, a car park, a help arrow, /// nothing to draw): the editor shows it as a marker that casts no shadow. pub technical: bool, @@ -600,22 +603,15 @@ pub(crate) fn load_object(path: &Path, omsi: &Path, content: &Path) -> Option { - let field = omsi_geometry::mesh_from_o3d(&m); - for part in &mut parts { - for v in part.mesh.positions.iter_mut() { - if let Some(d) = field_height(&field, v.x, v.y) { - v.z += d; - } - } - omsi_geometry::compute_normals_d3d(&mut part.mesh); + let deform = crate::object_paths::load_field(&sco, path); + if let Some(field) = &deform { + for part in &mut parts { + for v in part.mesh.positions.iter_mut() { + if let Some(d) = crate::object_paths::field_height(field, v.x, v.y) { + v.z += d; } } - Err(e) => log::warn!("crossing height deformation {}: {e}", p.display()), + omsi_geometry::compute_normals_d3d(&mut part.mesh); } } let tree = sco.tree.as_ref().map(|t| { @@ -676,7 +672,7 @@ pub(crate) fn load_object(path: &Path, omsi: &Path, content: &Path) -> Option Option { @@ -777,27 +773,6 @@ pub fn tree_mesh() -> MeshData { m } -/// The height of a `[crossing_heightdeformation]` field over (x, y) in the object's frame, -/// where the field reaches (the highest face there; openOMSI's `field_height`). -fn field_height(m: &omsi_geometry::MeshData, x: f32, y: f32) -> Option { - let mut best: Option = None; - for t in m.indices.chunks_exact(3) { - let (a, b, c) = (m.positions[t[0] as usize], m.positions[t[1] as usize], m.positions[t[2] as usize]); - let det = (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y); - if det.abs() < 1e-9 { - continue; - } - let l1 = ((b.x - a.x) * (y - a.y) - (x - a.x) * (b.y - a.y)) / det; - let l2 = ((x - a.x) * (c.y - a.y) - (c.x - a.x) * (y - a.y)) / det; - let l0 = 1.0 - l1 - l2; - if l0 >= -1e-4 && l1 >= -1e-4 && l2 >= -1e-4 { - let h = l0 * a.z + l2 * b.z + l1 * c.z; - best = Some(best.map_or(h, |o: f32| o.max(h))); - } - } - best -} - /// A script variable that only says the time of year (`sommerhalbjahr`): the meshes it /// switches are there most of the time and the editor shows them. fn is_season(var: &str) -> bool { diff --git a/src/check.rs b/src/check.rs index e50d1c0..7343c3e 100644 --- a/src/check.rs +++ b/src/check.rs @@ -824,6 +824,21 @@ fn timetable_issues(d: &Document, roots: &[PathBuf], out: &mut Vec) { let net = crate::timetable::network::Network::build(d, &mut files); for trip in trips { let pos: Vec> = trip.stations.iter().map(|id| crate::timetable::stop_world(d, &mut files, *id)).collect(); + // (the way as saved: where its paths do not join, the game's bus loses it) + if let Some(track) = tt.track(&trip.name) { + let lanes = crate::timetable::way::lanes_of_track(&net, &track.entries, &d.order); + if lanes.iter().all(|l| l.is_some()) { + let lanes: Vec = lanes.into_iter().flatten().collect(); + if let Some(&(k, m)) = crate::timetable::way::gaps(&net, &lanes).first() { + let p = net.lanes[lanes[k]].pts.last().copied(); + out.push(Issue { severity: Severity::Warning, kind: Kind::TripNoRoute, title: trip.name.clone(), detail: format!("{} {} ({m:.1} m)", tr("its way has a gap after path", "в его пути разрыв после пути"), k + 1), at: p.map(|p| p.truncate()), sel: None, fix: None }); + continue; + } + } + } + if tt.by_hand(&trip.name) { + continue; + } let r = crate::timetable::route::find(&net, &pos, d.global.left_hand_traffic, crate::timetable::route::ways_of(tt, &trip.name, &net, &d.order)); if r.ok() { continue; @@ -833,7 +848,8 @@ fn timetable_issues(d: &Document, roots: &[PathBuf], out: &mut Vec) { Some(Problem::NoObject(i)) => (*i, format!("{} {}", tr("the stop has no object:", "у остановки нет объекта:"), stop_name(trip.stations[*i]))), Some(Problem::NoRoad(i)) if r.ways == Some(crate::timetable::route::Ways::Rail) => (*i, format!("{} {}", tr("no track beside", "нет рельсов у"), stop_name(trip.stations[*i]))), Some(Problem::NoRoad(i)) => (*i, format!("{} {}", tr("no road beside", "нет дороги у"), stop_name(trip.stations[*i]))), - Some(Problem::NoWay(i)) => (*i, format!("{} {} -> {}", tr("no way", "нет пути"), stop_name(trip.stations[*i]), trip.stations.get(i + 1).map(|s| stop_name(*s)).unwrap_or_default())), + Some(Problem::OffWay(i)) => (*i, format!("{} {}", tr("its way does not pass", "его путь не проходит у"), stop_name(trip.stations[*i]))), + Some(Problem::NoWay(i)) =>(*i, format!("{} {} -> {}", tr("no way", "нет пути"), stop_name(trip.stations[*i]), trip.stations.get(i + 1).map(|s| stop_name(*s)).unwrap_or_default())), None => (0, tr("no way found", "путь не найден").to_string()), }; let (at, sel) = trip.stations.get(i).map(|id| place(&mut files, *id)).unwrap_or((None, None)); diff --git a/src/complete.rs b/src/complete.rs new file mode 100644 index 0000000..a7e53b6 --- /dev/null +++ b/src/complete.rs @@ -0,0 +1,403 @@ +//! Complete to: a new piece of spline laid between two free ends, leaving the one the way it +//! points, arriving at the other the way that one goes on, at the heights of both and climbing +//! as they climb. The two pieces it joins are not changed (OMSI 2's editor bends the first one +//! round to meet the other): only their links take the new piece in, so a ring of kerbs is +//! closed and can be filled as a shape. +//! +//! The new piece is what OMSI's splines can be: straights and arcs, as few as fit (one arc, two +//! that meet tangentially, or arc, straight, arc), cut at 50 m like a drawn road. Its height is +//! one cubic over the whole length, each spline a `[spline_h]` piece of it, so it meets both +//! ends' heights and gradients exactly. + +use glam::DVec3; +use omsi_map::MapSpline; + +use crate::doc::{tile_of, tile_origin, Document, Sel, TileKey}; +use crate::editor::Editor; +use crate::i18n::tr; +use crate::roads::{self, Seg}; + +/// What Complete to does, for its button. +pub fn help() -> &'static str { + tr( + "A new piece of the first selected spline's type between two free ends of the selected splines, meeting both in place, direction and height; the two are not changed. Again: the two ends left are joined, closing the ring.", + "Новый кусок типа первого выбранного сплайна между двумя свободными концами выбранных сплайнов, совпадающий с обоими по месту, направлению и высоте; сами они не меняются. Ещё раз: соединяются два оставшихся конца, кольцо замыкается." + ) +} + +/// A free end of a spline, as a spline going out of it would continue it. +#[derive(Debug, Clone, Copy)] +pub struct End { + pub key: TileKey, + pub id: i64, + /// The spline's end (else its start). + pub at_end: bool, + pub pos: DVec3, + /// The way out of the spline (degrees). + pub heading: f64, + /// Rise per metre going out. + pub slope: f64, + /// The cant (percent) a spline going out has there. + pub cant: f64, +} + +/// The end of spline `id` (its end, else its start), free or not. +pub fn end_of(doc: &Document, k: TileKey, id: i64, at_end: bool) -> Option { + let s = doc.spline(k, id)?; + let c = omsi_geometry::SplineCurve::from_map(s, tile_origin(k)); + Some(if at_end { + End { key: k, id, at_end, pos: c.end_point(), heading: roads::norm_deg(c.heading_at(s.length)), slope: c.slope_at(s.length), cant: s.cant_end } + } else { + // (going out of its start runs against it: it falls where the spline climbs, and leans + // the other way) + End { key: k, id, at_end, pos: c.point_at(0.0), heading: roads::norm_deg(s.heading + 180.0), slope: -c.slope_at(0.0), cant: -s.cant_start } + }) +} + +/// The free ends of `splines`, in their order. +pub fn free_ends(doc: &Document, splines: &[(TileKey, i64)]) -> Vec { + let mut out = Vec::new(); + for (k, id) in splines { + let Some(s) = doc.spline(*k, *id) else { continue }; + for (free, at_end) in [(s.prev_id == 0, false), (s.next_id == 0, true)] { + if free { + out.extend(end_of(doc, *k, *id, at_end)); + } + } + } + out +} + +/// How far from an end's place and way the planned piece may arrive (m, degrees). +const MISS: f64 = 1e-3; +const MISS_DEG: f64 = 1e-3; + +/// The plan of the piece from `a` to `b`: straights and arcs leaving `a` the way out of it and +/// arriving at `b` against the way out of it. None where none fits. +pub fn plan(a: &End, b: &End) -> Option> { + let p = a.pos.truncate(); + let q = b.pos.truncate(); + let chord = (q - p).length(); + if chord < 0.5 { + return None; + } + let hq = roads::norm_deg(b.heading + 180.0); + let arrives = |segs: &Vec| { + let Some(last) = segs.last() else { return false }; + let off = roads::norm_deg(last.end_heading() - hq); + (last.end() - q).length() < MISS && off.min(360.0 - off) < MISS_DEG + }; + let mut made: Vec> = Vec::new(); + // (one arc, where the two ways allow it) + if let Some(s) = roads::arc_to_any(p, a.heading, q) { + made.push(vec![s]); + } + if let Some(v) = roads::biarc(p, a.heading, q, hq) { + made.push(v); + } + for r in [roads::MIN_RADIUS, crate::join::MIN_PIECE_RADIUS] { + if let Some(v) = crate::join::plan(p, a.heading, q, hq, crate::join::Side::Auto, r) { + made.push(v); + } + } + crate::join::best(made.into_iter().filter(arrives).collect(), chord) +} + +/// The height and gradient (percent) at each joint of `pieces` (one more than there are +/// pieces): one cubic over the whole, from `a`'s height climbing as `a` does out of it, to +/// `b`'s height arriving as `b` climbs into it. +pub fn heights(pieces: &[Seg], a: &End, b: &End) -> Vec<(f64, f64)> { + let total = roads::total_length(pieces).max(1e-6); + let (z0, m0, z1, m1) = (a.pos.z, a.slope, b.pos.z, -b.slope); + let at = |s: f64| { + let t = (s / total).clamp(0.0, 1.0); + let (t2, t3) = (t * t, t * t * t); + let z = (2.0 * t3 - 3.0 * t2 + 1.0) * z0 + (t3 - 2.0 * t2 + t) * total * m0 + (3.0 * t2 - 2.0 * t3) * z1 + (t3 - t2) * total * m1; + let dz = ((6.0 * t2 - 6.0 * t) * z0 + (3.0 * t2 - 4.0 * t + 1.0) * total * m0 + (6.0 * t - 6.0 * t2) * z1 + (3.0 * t2 - 2.0 * t) * total * m1) / total; + (z, dz * 100.0) + }; + let mut out = vec![at(0.0)]; + let mut s = 0.0; + for p in pieces { + s += p.length; + out.push(at(s)); + } + // (the ends exactly) + out[0].0 = z0; + out.last_mut().unwrap().0 = z1; + out +} + +/// The new piece from `a` to `b` put into the map, of the type of `a`'s spline, its pieces +/// linked to each other and to the two ends. Their keys, in order. +pub fn lay(doc: &mut Document, a: &End, b: &End) -> Result, &'static str> { + if (b.pos.truncate() - a.pos.truncate()).length() < 0.5 { + return Err(tr("The two ends already meet", "Эти два конца уже сходятся")); + } + let template = doc.spline(a.key, a.id).cloned().ok_or(tr("Select the splines whose free ends are to be joined", "Выберите сплайны, свободные концы которых нужно соединить"))?; + let segs = plan(a, b).ok_or(tr("No piece of spline can join these two ends", "Никакой кусок сплайна не соединит эти два конца"))?; + let pieces = roads::split(&segs, 50.0); + if pieces.iter().any(|p| !doc.tiles.contains_key(&tile_of(p.start))) { + return Err(tr("The road leaves the map: add tiles there first", "Дорога выходит за карту: сначала добавьте тайлы")); + } + let profile = heights(&pieces, a, b); + let total = roads::total_length(&pieces).max(1e-6); + // (it goes on as the first one looks: run the other way, a spline is drawn mirrored) + let mirror = template.mirror != !a.at_end; + let mut tex = if a.at_end { template.tex_offset + template.length } else { 0.0 }; + let ids: Vec = pieces.iter().map(|_| doc.new_id()).collect(); + let mut made = Vec::new(); + let mut s = 0.0; + for (i, p) in pieces.iter().enumerate() { + let k = tile_of(p.start); + let org = tile_origin(k); + let (za, ga) = profile[i]; + let (zb, gb) = profile[i + 1]; + let cant = |at: f64| a.cant + (-b.cant - a.cant) * at / total; + let sp = MapSpline { + id: ids[i], + prev_id: if i == 0 { a.id } else { ids[i - 1] }, + next_id: if i + 1 == ids.len() { b.id } else { ids[i + 1] }, + pos: [p.start.x - org.x, p.start.y - org.y, za], + heading: p.heading, + length: p.length, + radius: p.radius, + grad_start: ga, + grad_end: gb, + delta_h: Some(zb - za), + is_h: true, + cant_start: cant(s), + cant_end: cant(s + p.length), + skew_start: 0.0, + skew_end: 0.0, + tex_offset: tex, + map_chain_offset: Some(tex), + mirror, + rules: Vec::new(), + deleted: false, + ..template.clone() + }; + s += p.length; + tex += p.length; + let t = doc.tiles.get_mut(&k).unwrap(); + t.tile.splines.push(sp); + t.touch_content(); + made.push((k, ids[i])); + } + // the two ends take the new piece in (their shape stays as it was) + for (e, mine) in [(a, ids[0]), (b, *ids.last().unwrap())] { + if let Some(t) = doc.tiles.get_mut(&e.key) { + if let Some(sp) = t.tile.splines.iter_mut().find(|sp| sp.id == e.id && !sp.deleted) { + if e.at_end { + sp.next_id = mine; + } else { + sp.prev_id = mine; + } + } + t.touch_content(); + } + } + Ok(made) +} + +/// The spline and its neighbours as far as they are linked: the chain it belongs to (a ring +/// counted once). +fn chain_of(doc: &Document, id: i64) -> Vec { + let mut seen = vec![id]; + let mut todo = vec![id]; + while let Some(i) = todo.pop() { + let Some((_, s)) = doc.find_spline(i) else { continue }; + for n in [s.prev_id, s.next_id] { + if n != 0 && !seen.contains(&n) && seen.len() < 100_000 { + seen.push(n); + todo.push(n); + } + } + } + seen +} + +/// The two ends to join among the free ends of `splines`: two of them, as they are; of more, +/// the two of different chains that the shortest piece joins (two of one chain, closing it, +/// only when there is nothing else). The first is of the spline selected first. +pub fn pick(doc: &Document, splines: &[(TileKey, i64)]) -> Option<(End, End)> { + let ends = free_ends(doc, splines); + if ends.len() < 2 { + return None; + } + if ends.len() == 2 { + return Some((ends[0], ends[1])); + } + let chains: Vec> = ends.iter().map(|e| chain_of(doc, e.id)).collect(); + let mut best: Option<(bool, f64, usize, usize)> = None; + for i in 0..ends.len() { + for j in i + 1..ends.len() { + let Some(segs) = plan(&ends[i], &ends[j]) else { continue }; + let closes = chains[i].contains(&ends[j].id); + let len = roads::total_length(&segs); + if best.is_none_or(|(c, l, _, _)| (closes, len) < (c, l)) { + best = Some((closes, len, i, j)); + } + } + } + best.map(|(_, _, i, j)| (ends[i], ends[j])) +} + +impl Editor { + /// Complete to: a new piece between two free ends of the selected splines, of the first + /// one's type; the two are not changed. One undo step; the selection stays, so the same + /// key again joins the two ends left (closing a ring). + pub fn complete_to(&mut self) { + let splines: Vec<(TileKey, i64)> = self.selection().into_iter().filter_map(|s| if let Sel::Spline(k, id) = s { Some((k, id)) } else { None }).collect(); + let Some(doc) = self.doc.as_mut() else { return }; + let Some((a, b)) = pick(doc, &splines) else { + self.toast(tr("Select the splines whose free ends are to be joined", "Выберите сплайны, свободные концы которых нужно соединить")); + return; + }; + self.history.begin(tr("Complete to", "Достроить до")); + let keys: Vec = doc.tiles.keys().copied().collect(); + for k in keys { + self.history.touch_tile(doc, k); + } + self.history.touch_global(doc); + match lay(doc, &a, &b) { + Ok(_) => self.history.commit(), + Err(e) => { + self.history.cancel(); + self.error(e); + } + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::selection::tests::{add_spline, flat_map}; + + /// A piece of spline exactly as it is in the map. + fn curve(doc: &Document, id: i64) -> (MapSpline, omsi_geometry::SplineCurve) { + let (k, s) = doc.find_spline(id).unwrap(); + (s.clone(), omsi_geometry::SplineCurve::from_map(s, tile_origin(k))) + } + + /// The new pieces, from `a`'s end along the links to `b`: each meets the next in place, + /// way and height, and the first and last meet the two ends. + fn check_joined(doc: &Document, made: &[(TileKey, i64)], a: &End, b: &End) { + assert!(!made.is_empty()); + let mut at = a.pos; + let mut way = a.heading; + let mut slope = a.slope; + for (_, id) in made { + let (s, c) = curve(doc, *id); + let start = c.point_at(0.0); + assert!((start - at).length() < 1e-3, "piece {id} starts at {start:?}, not at {at:?}"); + let off = roads::norm_deg(s.heading - way); + assert!(off.min(360.0 - off) < 1e-3, "piece {id} leaves at {} not {way}", s.heading); + assert!((c.slope_at(0.0) - slope).abs() < 1e-6, "piece {id} climbs {} not {slope}", c.slope_at(0.0)); + at = c.end_point(); + way = roads::norm_deg(c.heading_at(s.length)); + slope = c.slope_at(s.length); + } + assert!((at - b.pos).length() < 1e-3, "it ends at {at:?}, not at {:?}", b.pos); + let into = roads::norm_deg(b.heading + 180.0); + let off = roads::norm_deg(way - into); + assert!(off.min(360.0 - off) < 1e-3, "it arrives at {way}, not {into}"); + assert!((slope + b.slope).abs() < 1e-6, "it arrives climbing {slope}, not {}", -b.slope); + } + + /// Two half circles of kerb facing each other, as the issue's island: the first Complete + /// to joins one pair of ends with a straight, the second closes the ring with the other. + #[test] + fn two_half_circles_are_closed_into_a_ring() { + let mut doc = flat_map(1); + // (west: from (100, 120) north round to (100, 100)... as a half circle turning left, + // and east the same turned round) + add_spline(&mut doc, (0, 0), 1, 100.0, 100.0, 270.0, std::f64::consts::PI * 10.0, 0, 0); + add_spline(&mut doc, (0, 0), 2, 200.0, 120.0, 90.0, std::f64::consts::PI * 10.0, 0, 0); + for s in doc.tiles.get_mut(&(0, 0)).unwrap().tile.splines.iter_mut() { + s.radius = 10.0; + s.file = "Splines\\kerb.sli".into(); + s.pos[2] = if s.id == 1 { 2.0 } else { 5.0 }; + s.grad_start = 1.0; + s.grad_end = 3.0; + } + let before: Vec = doc.tiles[&(0, 0)].tile.splines.clone(); + let sel = [((0, 0), 1), ((0, 0), 2)]; + let (a, b) = pick(&doc, &sel).expect("two ends to join"); + assert_eq!(a.id, 1, "from the spline selected first"); + let made = lay(&mut doc, &a, &b).unwrap(); + check_joined(&doc, &made, &a, &b); + // (a straight 100 m across, cut in two) + let (s, _) = curve(&doc, made[0].1); + assert_eq!(s.radius, 0.0); + assert_eq!(s.file, "Splines\\kerb.sli"); + // the second time: the two ends left, closing the ring + let (a2, b2) = pick(&doc, &sel).expect("the other two ends"); + assert!(a2.id == 1 && b2.id == 2 && a2.at_end != a.at_end); + let made2 = lay(&mut doc, &a2, &b2).unwrap(); + check_joined(&doc, &made2, &a2, &b2); + assert!(pick(&doc, &sel).is_none(), "a closed ring has no free end"); + // (the two half circles kept their shape; only their links changed) + for old in &before { + let (now, _) = curve(&doc, old.id); + assert_eq!(MapSpline { prev_id: 0, next_id: 0, ..now.clone() }, MapSpline { prev_id: 0, next_id: 0, ..old.clone() }); + assert!(now.prev_id != 0 && now.next_id != 0); + } + } + + /// Ends that point past each other at an angle, at different heights and gradients: still + /// met exactly, in place, way and climb. + #[test] + fn crooked_ends_are_met_exactly() { + let mut doc = flat_map(1); + add_spline(&mut doc, (0, 0), 1, 50.0, 50.0, 30.0, 20.0, 0, 0); + add_spline(&mut doc, (0, 0), 2, 260.0, 300.0, 200.0, 25.0, 0, 0); + { + let t = doc.tiles.get_mut(&(0, 0)).unwrap(); + t.tile.splines[0].radius = -40.0; + t.tile.splines[0].grad_end = 4.0; + t.tile.splines[1].pos[2] = 7.0; + t.tile.splines[1].radius = 60.0; + t.tile.splines[1].grad_start = -2.0; + t.tile.splines[1].delta_h = Some(-1.0); + t.tile.splines[1].is_h = true; + } + // (from the first one's end to the second's end, both pointing at the gap) + let a = end_of(&doc, (0, 0), 1, true).unwrap(); + let b = end_of(&doc, (0, 0), 2, true).unwrap(); + let made = lay(&mut doc, &a, &b).unwrap(); + check_joined(&doc, &made, &a, &b); + // (and the links: the new first piece's start is the first spline's end, its last + // piece's end the second spline's end, which runs back into it) + assert_eq!(doc.spline((0, 0), 1).unwrap().next_id, made[0].1); + assert_eq!(doc.spline((0, 0), 2).unwrap().next_id, made.last().unwrap().1); + assert_eq!(curve(&doc, made[0].1).0.prev_id, 1); + assert_eq!(curve(&doc, made.last().unwrap().1).0.next_id, 2); + } + + /// From a spline's start the piece runs the other way from it: it is drawn mirrored, so it + /// looks the same as the spline it goes on from. + #[test] + fn going_on_from_a_start_mirrors_the_piece() { + let mut doc = flat_map(1); + add_spline(&mut doc, (0, 0), 1, 100.0, 100.0, 0.0, 20.0, 0, 0); + add_spline(&mut doc, (0, 0), 2, 130.0, 40.0, 0.0, 20.0, 0, 0); + let a = end_of(&doc, (0, 0), 1, false).unwrap(); + let b = end_of(&doc, (0, 0), 2, true).unwrap(); + let made = lay(&mut doc, &a, &b).unwrap(); + check_joined(&doc, &made, &a, &b); + assert!(curve(&doc, made[0].1).0.mirror); + assert_eq!(doc.spline((0, 0), 1).unwrap().prev_id, made[0].1); + } + + #[test] + fn ends_that_meet_are_not_joined() { + let mut doc = flat_map(1); + add_spline(&mut doc, (0, 0), 1, 100.0, 100.0, 0.0, 20.0, 0, 0); + add_spline(&mut doc, (0, 0), 2, 100.0, 120.0, 0.0, 20.0, 0, 0); + let a = end_of(&doc, (0, 0), 1, true).unwrap(); + let b = end_of(&doc, (0, 0), 2, false).unwrap(); + assert!(lay(&mut doc, &a, &b).is_err()); + } +} diff --git a/src/controls.rs b/src/controls.rs index 3636e76..75d7a29 100644 --- a/src/controls.rs +++ b/src/controls.rs @@ -190,6 +190,7 @@ pub enum Cmd { JoinObjects, Ruler, Knife, + CompleteTo, BuildRoad, Confirm, TileGrid, @@ -216,7 +217,7 @@ use Cmd::*; pub const ALL: &[Cmd] = &[ Forward, Back, Left, Right, TurnLeft, TurnRight, LookDown, View2d, Focus, TileGrid, Overview, Assets, Lines, Traffic, Imagery, ToolSelect, ToolRoads, ToolObjects, ToolLogic, - ToolTerrain, ToolPaint, ToolTiles, NewObject, XformMove, XformRotate, XformScale, EditMesh, JoinObjects, Rotate, Ruler, Knife, BuildRoad, Confirm, BrushSmaller, BrushLarger, Delete, Group, Ungroup, Copy, Cut, Paste, Duplicate, SelectAll, Undo, + ToolTerrain, ToolPaint, ToolTiles, NewObject, XformMove, XformRotate, XformScale, EditMesh, JoinObjects, Rotate, Ruler, Knife, CompleteTo, BuildRoad, Confirm, BrushSmaller, BrushLarger, Delete, Group, Ungroup, Copy, Cut, Paste, Duplicate, SelectAll, Undo, Redo, Save, Find, Commands, TestDrive, Picture, Polygon, PolygonClick, ]; @@ -256,6 +257,7 @@ impl Cmd { JoinObjects => "join_objects", Ruler => "ruler", Knife => "knife", + CompleteTo => "complete_to", BuildRoad => "build_road", Confirm => "confirm", TileGrid => "tile_grid", @@ -308,6 +310,7 @@ impl Cmd { Rotate => tr("Turn the object (Shift: the other way)", "Повернуть объект (Shift: в другую сторону)"), Ruler => tr("Ruler", "Линейка"), Knife => tr("Knife", "Нож"), + CompleteTo => tr("Complete to: a new piece between the free ends of the selected splines", "Достроить до: новый кусок между свободными концами выбранных сплайнов"), XformMove => tr("Move handles", "Ручки перемещения"), XformRotate => tr("Rotate handles", "Ручки поворота"), XformScale => tr("Scale handles", "Ручки масштаба"), @@ -370,6 +373,7 @@ impl Cmd { JoinObjects => Chord::ctrl(KeyCode::KeyJ), Ruler => Chord::key(KeyCode::KeyU), Knife => Chord::key(KeyCode::KeyK), + CompleteTo => Chord::key(KeyCode::KeyJ), BuildRoad => Chord::key(KeyCode::Enter), Confirm => Chord::key(KeyCode::NumpadEnter), TileGrid => Chord::key(KeyCode::KeyG), diff --git a/src/doc/autosave.rs b/src/doc/autosave.rs index 709ddc0..47b7540 100644 --- a/src/doc/autosave.rs +++ b/src/doc/autosave.rs @@ -40,6 +40,10 @@ pub struct Meta { pub descriptions: bool, /// Seconds since 1970. pub time: u64, + /// The map's files were written after the autosave (by OMSI 2's editor say): bringing it + /// back puts older tiles over newer ones. + #[serde(skip)] + pub disk_newer: bool, } impl Meta { @@ -152,6 +156,7 @@ fn prepare_from(doc: &Document, known: &std::collections::HashSet, epoc traffic: doc.traffic.dirty, descriptions: doc.descriptions.dirty, time: std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(0), + disk_newer: false, }; Job { target, @@ -184,7 +189,15 @@ impl Job { /// The autosave left by a session that did not end normally. pub fn pending(content: &Path) -> Option { let s = std::fs::read_to_string(dir(content).join(META)).ok()?; - serde_json::from_str(&s).ok() + let mut meta: Meta = serde_json::from_str(&s).ok()?; + meta.disk_newer = !meta.fresh && newer_on_disk(&meta); + Some(meta) +} + +/// Whether a file of the map was written after the autosave was. +fn newer_on_disk(meta: &Meta) -> bool { + let after = meta.time.saturating_add(1).saturating_mul(1_000_000_000); + [Some(meta.dir.clone()), meta.source.clone()].into_iter().flatten().any(|d| super::sync::stamp(&d).files.values().any(|s| s.1 >= after)) } /// Nothing to keep any more (saved, or the changes were dropped). @@ -303,6 +316,10 @@ pub fn offer(ctx: &egui::Context, meta: &Meta) -> Option { meta.age() )); ui.label(egui::RichText::new(tr("The changes kept by the autosave can be brought back. The map itself was not changed.", "Изменения, сохранённые автосохранением, можно вернуть. Сама карта не изменялась.")).small().color(egui::Color32::GRAY)); + if meta.disk_newer { + ui.add_space(4.0); + ui.colored_label(egui::Color32::from_rgb(230, 180, 80), tr("The map's files were changed after this autosave (by another program, OMSI 2's editor say). Restoring puts the autosaved, older tiles over those changes.", "Файлы карты изменены после этого автосохранения (другой программой, например редактором OMSI 2). Восстановление положит старые тайлы из автосохранения поверх этих изменений.")); + } ui.add_space(8.0); ui.horizontal(|ui| { if ui.button(tr("Restore the changes", "Вернуть изменения")).clicked() { @@ -353,6 +370,13 @@ mod tests { // the tile reads back with what was on it let t = omsi_map::Tile::load(&d.join("tile_0_0.map")).unwrap(); assert_eq!(t.objects.len(), 1); + // the map's own files written later: the question says so + assert!(!meta.disk_newer); + std::fs::create_dir_all(&doc.dir).unwrap(); + std::fs::write(doc.dir.join("global.cfg"), "[name]\nM\n").unwrap(); + let mut old = meta.clone(); + old.time -= 60; + assert!(newer_on_disk(&old) && !newer_on_disk(&Meta { time: old.time + 3600, ..old.clone() })); clear(&content); assert!(pending(&content).is_none()); let _ = std::fs::remove_dir_all(&content); diff --git a/src/doc/mod.rs b/src/doc/mod.rs index 2e66efb..c323fc8 100644 --- a/src/doc/mod.rs +++ b/src/doc/mod.rs @@ -3,6 +3,7 @@ pub mod autosave; pub mod safe; +pub mod sync; mod transaction; pub(crate) mod save; #[cfg(test)] diff --git a/src/doc/save.rs b/src/doc/save.rs index fc21852..d0ed5dd 100644 --- a/src/doc/save.rs +++ b/src/doc/save.rs @@ -284,7 +284,7 @@ pub fn tile_file(k: TileKey) -> String { /// The file a tile is kept in: the one global.cfg named when the map was read (a tile not /// edited is not written again, and chrono folders name it so), else `tile_x_y.map`. -fn file_of(doc: &Document, k: TileKey) -> String { +pub(crate) fn file_of(doc: &Document, k: TileKey) -> String { doc.global.tiles.iter().find(|t| (t.x, t.y) == k).map(|t| t.file.clone()).unwrap_or_else(|| tile_file(k)) } @@ -348,7 +348,7 @@ pub(crate) fn global_text_known(doc: &Document, has_tile: &dyn Fn(&TileKey) -> b kw(&mut s, "backgroundimage", &lines); } if g.map_cam.len() == 8 { - kw(&mut s, "mapcam", &g.map_cam.iter().map(|v| num(*v)).collect::>()); + kw(&mut s, "mapcam", &map_cam(doc, has_tile).iter().map(|v| num(*v)).collect::>()); } if !g.money_system.is_empty() { kw(&mut s, "moneysystem", &[g.money_system.clone()]); @@ -415,6 +415,26 @@ pub(crate) fn global_text_known(doc: &Document, has_tile: &dyn Fn(&TileKey) -> b s } +/// The editor camera (`[mapcam]`: tile x, tile y, x, height, y, heading, pitch, distance) on a +/// tile the map has: OMSI 2's editor opens the map there, and on a tile taken away it shows +/// nothing but the sky. Such a camera is moved to the middle of the map's first tile. +fn map_cam(doc: &Document, has_tile: &dyn Fn(&TileKey) -> bool) -> Vec { + let mut mc = doc.global.map_cam.clone(); + let on = (mc[0].round() as i32, mc[1].round() as i32); + if has_tile(&on) { + return mc; + } + if let Some(k) = doc.order.iter().find(|k| has_tile(k)) { + let half = omsi_map::tile_size() / 2.0; + mc[0] = k.0 as f64; + mc[1] = k.1 as f64; + mc[2] = half; + mc[3] = doc.tiles.get(k).map(|t| t.height_at(half, half) as f64).unwrap_or(0.0); + mc[4] = half; + } + mc +} + pub(crate) fn tile_text(t: &Tile) -> String { let mut s = header(); // ([terrain] and [water] carry a line of their own, empty, then the blank line that @@ -449,19 +469,42 @@ pub(crate) fn tile_text(t: &Tile) -> String { let _ = writeln!(s, "Object Nr. {n}"); n += 1; }; + // (the records an [attachObj] may hang on, as they are written) + let mut written: HashSet = HashSet::new(); for o in &t.objects { numbered(&mut s); object(&mut s, o, false); + written.insert(o.id); } for a in &t.spline_attachments { // (its distance stays as it is: it counts from the start of the chain, as the spline's // last number does - a repeater's from a chain begun tiles before. A row whose spline is - // not written keeps the index it had, so the numbers of the records after it hold) - let index = usize::try_from(a.spline_index).ok().and_then(|i| place.get(i).copied().flatten()).unwrap_or(a.spline_index); + // not written names none, -1, as the stock maps write such a row (Berlin-Spandau has + // one): its old index would put it on whichever spline came to have that place) + let index = usize::try_from(a.spline_index).ok().and_then(|i| place.get(i).copied().flatten()).unwrap_or(-1); numbered(&mut s); attachment_at(&mut s, a, index, a.offset[2]); + written.insert(a.id); + } + // (each after what it hangs on, as OMSI 2 reads them: an [attachObj] written before its + // parent is dropped by Omsi.exe. One whose parent is not in the tile goes last, as it was) + let mut left: Vec<&MapObject> = t.attach_objects.iter().collect(); + loop { + let before = left.len(); + left.retain(|o| { + if !o.parent_id.is_some_and(|p| written.contains(&p)) { + return true; + } + numbered(&mut s); + object(&mut s, o, true); + written.insert(o.id); + false + }); + if left.is_empty() || left.len() == before { + break; + } } - for o in &t.attach_objects { + for o in left { numbered(&mut s); object(&mut s, o, true); } @@ -759,6 +802,54 @@ mod tests { assert!(!refused(&back.splines, a)); } + /// An object hung on another one that comes later in the tile's list (hung on a sign put + /// up after it, or brought back by undo) is written after it: Omsi.exe and openOMSI drop + /// an `[attachObj]` written before the record it hangs on, so the editor showed it and the + /// game did not. A row on a spline the tile does not have (one taken away, or an index an + /// earlier save left past the end of the list) names no spline (-1, as the stock maps + /// write such a row) instead of whichever spline came to have its place. + #[test] + fn hung_objects_follow_their_parents_and_a_row_on_no_spline_names_none() { + let mut t = Tile { version: 14, ..Default::default() }; + t.splines.push(MapSpline { file: "Splines\\road.sli".into(), id: 5, length: 20.0, map_chain_offset: Some(0.0), ..Default::default() }); + t.splines.push(MapSpline { file: "Splines\\road.sli".into(), id: 6, length: 20.0, map_chain_offset: Some(0.0), deleted: true, ..Default::default() }); + t.splines.push(MapSpline { file: "Splines\\road.sli".into(), id: 7, length: 20.0, map_chain_offset: Some(0.0), ..Default::default() }); + let row = |id: i64, spline_index: i32| SplineAttachment { file: "Sceneryobjects\\stop.sco".into(), id, spline_index, offset: [3.0, 0.0, 5.0], ..Default::default() }; + // (on a spline that is there, on the deleted one, past the end, and on none) + t.spline_attachments = vec![row(10, 0), row(11, 1), row(12, 7), row(13, -1)]; + t.objects.push(MapObject { file: "Sceneryobjects\\pole.sco".into(), id: 20, ..Default::default() }); + let hang = |id: i64, parent: i64| MapObject { file: "Sceneryobjects\\sign.sco".into(), id, parent_id: Some(parent), ..Default::default() }; + // (a sign on a sign that comes later in the list, signs on a row and an object, one on + // nothing in this tile) + t.attach_objects = vec![hang(30, 31), hang(31, 10), hang(32, 11), hang(33, 20), hang(34, 999)]; + let text = tile_text(&t); + let back = Tile::parse(&omsi_cfg::CfgFile::from_str("tile_0_0.map", &text)); + assert_eq!(back.splines.len(), 2); + let rows: Vec<(i64, i32)> = back.spline_attachments.iter().map(|a| (a.id, a.spline_index)).collect(); + assert_eq!(rows, vec![(10, 0), (11, -1), (12, -1), (13, -1)], "no row lands on spline 7:\n{text}"); + let mut hung: Vec = back.attach_objects.iter().map(|o| o.id).collect(); + hung.sort(); + assert_eq!(hung, vec![30, 31, 32, 33, 34], "every hung object read back, the sign on the later sign too"); + // (in the file, every [attachObj] comes after the record it hangs on) + let at = |id: i64| text.find(&format!("\n{id}\n")).unwrap(); + assert!(at(10) < at(31) && at(31) < at(30)); + } + + /// The editor camera on a tile the map no longer has is put on one it has: OMSI 2's editor + /// opens the map there. + #[test] + fn the_map_camera_stays_on_a_tile_of_the_map() { + let mut doc = crate::selection::tests::flat_map(2); + doc.global.map_cam = vec![7.0, 7.0, 10.0, 0.0, 20.0, 45.0, 30.0, 80.0]; + let text = global_text(&doc); + let back = omsi_map::GlobalCfg::parse(&omsi_cfg::CfgFile::from_str("global.cfg", &text)); + assert_eq!(&back.map_cam[..2], &[0.0, 0.0], "on the first tile: {:?}", back.map_cam); + assert_eq!(&back.map_cam[5..], &[45.0, 30.0, 80.0], "looking as it did"); + doc.global.map_cam = vec![1.0, 0.0, 10.0, 0.0, 20.0, 45.0, 30.0, 80.0]; + let back = omsi_map::GlobalCfg::parse(&omsi_cfg::CfgFile::from_str("global.cfg", &global_text(&doc))); + assert_eq!(back.map_cam, doc.global.map_cam, "one on a tile of the map is kept"); + } + /// `OMSI_ROUNDTRIP_IN= OMSI_ROUNDTRIP_OUT=`: every tile of the /// input is read and written again (to compare with what OMSI's own editor wrote). #[test] diff --git a/src/doc/sync.rs b/src/doc/sync.rs new file mode 100644 index 0000000..970d911 --- /dev/null +++ b/src/doc/sync.rs @@ -0,0 +1,463 @@ +//! The map's files as they are on disk now, against the map open in the editor: what another +//! program (OMSI 2's editor, a tool of its own) changed since openMapper read or saved them, +//! read in again where nothing here waits to be saved. +//! +//! A map of the installation that openMapper saved lives on as its copy in the content folder +//! (the installation's own is never written). OMSI 2's editor keeps working on the +//! installation's, so the copy remembers how the installation's looked when it was taken +//! (`openMapper/twin.json`) and what changed there since can be brought over. + +use std::collections::{BTreeMap, BTreeSet}; +use std::path::{Path, PathBuf}; +use std::time::UNIX_EPOCH; + +use serde::{Deserialize, Serialize}; + +use super::{load_tile, next_rev, Document, TileKey}; + +/// The files of a map folder that make the map: by their path in it (lower case, `/`), their +/// size and when they were last written (nanoseconds since 1970). +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub struct Stamp { + pub files: BTreeMap, +} + +/// The sub-folders whose files are the map's (the others are chrono scenarios, backups, +/// openMapper's own). +const FOLDERS: [&str; 3] = ["ttdata", "car_use", "texture/map"]; + +/// Whether a file directly in the map folder is one of the map's. +fn wanted(name: &str) -> bool { + name.ends_with(".map") || name.contains(".map.") || [".cfg", ".txt", ".dsc", ".hof"].iter().any(|x| name.ends_with(x)) +} + +fn stat(p: &Path) -> Option<(u64, u64)> { + let m = std::fs::metadata(p).ok()?; + let t = m.modified().ok()?.duration_since(UNIX_EPOCH).map(|d| d.as_nanos() as u64).unwrap_or(0); + Some((m.len(), t)) +} + +fn walk(dir: &Path, rel: &str, out: &mut BTreeMap) { + for e in std::fs::read_dir(dir).into_iter().flatten().flatten() { + let name = e.file_name().to_string_lossy().to_lowercase(); + let p = e.path(); + let r = if rel.is_empty() { name.clone() } else { format!("{rel}/{name}") }; + if p.is_dir() { + if FOLDERS.iter().any(|f| *f == r || f.starts_with(&format!("{r}/")) || r.starts_with(&format!("{f}/"))) { + walk(&p, &r, out); + } + } else if (!rel.is_empty() && FOLDERS.iter().any(|f| r.starts_with(&format!("{f}/")))) || (rel.is_empty() && wanted(&name)) { + if let Some(s) = stat(&p) { + out.insert(r, s); + } + } + } +} + +/// Look at a map folder's files now. +pub fn stamp(dir: &Path) -> Stamp { + let mut files = BTreeMap::new(); + walk(dir, "", &mut files); + Stamp { files } +} + +/// The files that came, went or were written since `old`. +pub fn changed_files(old: &Stamp, new: &Stamp) -> Vec { + let mut v: Vec = new.files.iter().filter(|(k, s)| old.files.get(*k) != Some(*s)).map(|(k, _)| k.clone()).collect(); + v.extend(old.files.keys().filter(|k| !new.files.contains_key(*k)).cloned()); + v.sort(); + v +} + +/// The parts of the map some files are. +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct Changes { + pub global: bool, + pub tiles: BTreeSet, + pub timetable: bool, + pub traffic: bool, + pub descriptions: bool, +} + +impl Changes { + pub fn is_empty(&self) -> bool { + *self == Changes::default() + } + + /// What `self` has that `other` has not. + pub fn without(&self, other: &Changes) -> Changes { + Changes { + global: self.global && !other.global, + tiles: self.tiles.difference(&other.tiles).copied().collect(), + timetable: self.timetable && !other.timetable, + traffic: self.traffic && !other.traffic, + descriptions: self.descriptions && !other.descriptions, + } + } + + /// In words, for a question or a note ("3 tiles, the global settings"). + pub fn describe(&self) -> String { + use crate::i18n::tr; + let mut parts: Vec = Vec::new(); + if !self.tiles.is_empty() { + parts.push(format!("{} {}", self.tiles.len(), tr("tile(s)", "тайл(ов)"))); + } + if self.global { + parts.push(tr("the global settings", "общие настройки").to_string()); + } + if self.timetable { + parts.push(tr("the timetable", "расписание").to_string()); + } + if self.traffic { + parts.push(tr("the traffic", "трафик").to_string()); + } + if self.descriptions { + parts.push(tr("the descriptions", "описания").to_string()); + } + parts.join(", ") + } +} + +/// The parts of `doc` the files are (a tile file by the name global.cfg gives it; files that +/// are none of the map's parts, a light map say, are left out). +pub fn classify(doc: &Document, files: &[String]) -> Changes { + // (as global.cfg names them; a tile made here since, by the name its save gives it) + let mut tiles: BTreeMap = doc.tiles.keys().map(|k| (super::save::file_of(doc, *k).replace('\\', "/").to_lowercase(), *k)).collect(); + tiles.extend(doc.global.tiles.iter().map(|t| (t.file.replace('\\', "/").to_lowercase(), (t.x, t.y)))); + let mut c = Changes::default(); + for f in files { + if f == "global.cfg" { + c.global = true; + } else if f.starts_with("ttdata/") || f.starts_with("car_use/") || f == "holidays.txt" { + c.timetable = true; + } else if f.starts_with("global_") && f.ends_with(".dsc") { + c.descriptions = true; + } else if let Some(rest) = f.strip_prefix("texture/map/") { + // (`..dds`) + if let Some(k) = rest.rsplitn(3, '.').nth(2).and_then(|t| tiles.get(t)) { + c.tiles.insert(*k); + } + } else if let Some(k) = tiles.get(f.as_str()).or_else(|| [".terrain", ".water"].iter().find_map(|x| f.strip_suffix(x)).and_then(|t| tiles.get(t))) { + c.tiles.insert(*k); + } else if !f.contains('/') && (f.ends_with(".txt") || f.ends_with(".cfg") || f.ends_with(".hof")) { + c.traffic = true; + } + } + c +} + +/// The parts of `changes` that the map open here has changed too and not saved yet. +/// `global_base`: the global settings as they were read or saved (a map of the installation +/// not saved yet is marked changed while it is only a copy to make). +pub fn conflicts(doc: &Document, changes: &Changes, global_base: &str) -> Changes { + Changes { + global: changes.global && doc.global_dirty && super::global_text(doc) != global_base, + tiles: changes.tiles.iter().filter(|k| doc.tiles.get(k).map(|t| t.dirty).unwrap_or(false)).copied().collect(), + timetable: changes.timetable && doc.timetable.dirty, + traffic: changes.traffic && doc.traffic.dirty, + descriptions: changes.descriptions && doc.descriptions.dirty, + } +} + +/// Read the `changes` parts of the map from `dir` (the folder it is read from) again, in place +/// of what the document has. A tile with changes here not saved yet is left as it is unless +/// `force`. What was read in again. +pub fn reload(doc: &mut Document, dir: &Path, changes: &Changes, force: bool) -> Changes { + let mut done = Changes::default(); + let chrono_dirs = omsi_map::active_chrono_dirs(dir, super::today_code()); + let mut tiles = changes.tiles.clone(); + if changes.global { + if let Ok(global) = omsi_map::GlobalCfg::load(&dir.join("global.cfg")) { + omsi_map::configure_grid(&global); + let listed: BTreeSet = global.tiles.iter().map(|t| (t.x, t.y)).collect(); + // tiles that came: read; tiles that went: gone, but not one with changes here + tiles.extend(listed.iter().filter(|k| !doc.tiles.contains_key(k)).copied()); + let gone: Vec = doc.tiles.iter().filter(|(k, t)| !listed.contains(k) && (force || !t.dirty)).map(|(k, _)| *k).collect(); + for k in gone { + doc.tiles.remove(&k); + done.tiles.insert(k); + } + let mut order = global.raw_tiles.clone(); + order.extend(doc.tiles.keys().filter(|k| !order.contains(k)).copied().collect::>()); + doc.order = order; + doc.global = global; + doc.global_dirty = false; + doc.global_rev = next_rev(); + doc.sync_mask_slots(); + done.global = true; + } + } + for k in tiles { + if doc.tiles.get(&k).map(|t| t.dirty && !force).unwrap_or(false) { + continue; + } + let t = doc.global.tiles.iter().find(|t| (t.x, t.y) == k).cloned().unwrap_or_else(|| omsi_map::MapTileRef { x: k.0, y: k.1, file: super::save::file_of(doc, k), index: 0 }); + match load_tile(dir, &doc.global, &chrono_dirs, &t) { + Some(mut td) => { + if let Some(old) = doc.tiles.get(&k) { + // (the chrono patches shown stay those of the date looked at) + td.chrono = old.chrono.clone(); + } + td.masks.resize(doc.global.ground_textures.len(), None); + doc.tiles.insert(k, td); + } + // (its file went: the tile goes, as a map read now would not have it) + None => { + doc.tiles.remove(&k); + } + } + done.tiles.insert(k); + } + if changes.timetable && (force || !doc.timetable.dirty) { + doc.timetable = crate::timetable::Timetable::load(dir, &doc.order); + done.timetable = true; + } + if changes.traffic && (force || !doc.traffic.dirty) { + doc.traffic = crate::traffic::Traffic::load(dir); + done.traffic = true; + } + if changes.descriptions && (force || !doc.descriptions.dirty) { + doc.descriptions = crate::descriptions::Descriptions::load(dir); + done.descriptions = true; + } + done +} + +/// The folder the open map's files are read from now: its own, or the one it is a copy of +/// until it is first saved. None for a map never saved. +pub fn read_dir(doc: &Document) -> Option { + if doc.fresh { + return None; + } + Some(doc.source.clone().unwrap_or_else(|| doc.dir.clone())) +} + +/// A folder of `parent` by its name, whatever its case. +fn child(parent: &Path, name: &str) -> Option { + let exact = parent.join(name); + if exact.is_dir() { + return Some(exact); + } + std::fs::read_dir(parent).ok()?.flatten().map(|e| e.path()).find(|p| p.is_dir() && p.file_name().map(|f| f.to_string_lossy().eq_ignore_ascii_case(name)).unwrap_or(false)) +} + +/// The installation's map that a map of the content folder is the copy of (the same folder +/// name in the installation's `maps`). +pub fn twin_of(roots: &crate::install::Roots, map_dir: &Path) -> Option { + if !map_dir.starts_with(&roots.content) { + return None; + } + let name = map_dir.file_name()?.to_string_lossy().to_string(); + let twin = child(&child(&roots.omsi, "maps")?, &name)?; + twin.join("global.cfg").is_file().then_some(twin) +} + +/// The copy in the content folder of an installation's map (`cfg` its global.cfg), when +/// openMapper made one: that copy is the map openMapper edits. +pub fn copy_of(roots: &crate::install::Roots, cfg: &Path) -> Option { + let dir = cfg.parent()?; + if dir.starts_with(&roots.content) { + return None; + } + let name = dir.file_name()?.to_string_lossy().to_string(); + let copy = child(&child(&roots.content, "maps")?, &name)?; + copy.join("global.cfg").is_file().then(|| copy.join("global.cfg")) +} + +fn twin_file(copy: &Path) -> PathBuf { + copy.join("openMapper").join("twin.json") +} + +/// How the installation's map looked when its copy last took it in. +pub fn twin_seen(copy: &Path) -> Option { + serde_json::from_str(&std::fs::read_to_string(twin_file(copy)).ok()?).ok() +} + +/// Remember how the installation's map looks now (taken in, or its changes declined). +pub fn set_twin_seen(copy: &Path, twin: &Stamp) { + let p = twin_file(copy); + let _ = std::fs::create_dir_all(p.parent().unwrap_or(copy)); + match serde_json::to_string(twin) { + Ok(s) => { + if let Err(e) = super::safe::write_atomic(&p, s.as_bytes()) { + log::warn!("{}: {e}", p.display()); + } + } + Err(e) => log::warn!("{e}"), + } +} + +/// The installation's map files changed since its copy took it in: against what it +/// remembers, or, for a copy made before it remembered, what was written after the copy's +/// own global.cfg (its last save). +pub fn twin_changes(copy: &Path, twin: &Stamp) -> Vec { + match twin_seen(copy) { + Some(seen) => changed_files(&seen, twin).into_iter().filter(|f| twin.files.contains_key(f)).collect(), + None => { + let saved = stat(©.join("global.cfg")).map(|s| s.1).unwrap_or(u64::MAX); + twin.files.iter().filter(|(_, s)| s.1 > saved).map(|(k, _)| k.clone()).collect() + } + } +} + +/// Copy the installation's changed files over the copy's (what they replace kept in a +/// backup). The copy is then read in again like any change made outside. +pub fn take_from_twin(twin: &Path, copy: &Path, files: &[String]) -> anyhow::Result { + use super::safe::Op; + let mut ops = Vec::new(); + for f in files { + let from = f.split('/').fold(twin.to_path_buf(), |p, c| child(&p, c).unwrap_or_else(|| real_file(&p, c))); + let Ok(bytes) = std::fs::read(&from) else { continue }; + let rel = from.strip_prefix(twin).map(Path::to_path_buf).unwrap_or_else(|_| PathBuf::from(f)); + let to = super::safe::own_path(copy, &rel.to_string_lossy()); + ops.push(Op::Write(to, bytes)); + } + if ops.is_empty() { + return Ok(0); + } + for o in &ops { + if let Some(d) = o.path().parent() { + std::fs::create_dir_all(d)?; + } + } + let kept = super::safe::backup(copy, &ops, &[])?; + super::safe::commit(&ops)?; + if let Some(b) = kept { + log::info!("the files taken from {} replaced ones kept in {}", twin.display(), b.display()); + } + Ok(ops.len()) +} + +/// A file of `dir` by its name, whatever its case (the name as given when there is none). +fn real_file(dir: &Path, name: &str) -> PathBuf { + std::fs::read_dir(dir).ok().and_then(|rd| rd.flatten().map(|e| e.path()).find(|p| p.file_name().map(|f| f.to_string_lossy().eq_ignore_ascii_case(name)).unwrap_or(false))).unwrap_or_else(|| dir.join(name)) +} + +#[cfg(test)] +mod tests { + use super::super::tests::{sample_map, scratch}; + use super::*; + + /// A file written again a little later (file times can be coarse). + fn touch(p: &Path, bytes: &[u8]) { + std::thread::sleep(std::time::Duration::from_millis(20)); + std::fs::write(p, bytes).unwrap(); + } + + #[test] + fn a_change_outside_is_seen_and_an_unchanged_folder_is_not() { + let _map = super::super::one_map(); + let roots = scratch("sync-stamp"); + let mut doc = sample_map(&roots); + super::super::save(&mut doc).unwrap(); + let a = stamp(&doc.dir); + assert!(a.files.contains_key("global.cfg") && a.files.contains_key("tile_0_0.map") && a.files.contains_key("tile_0_0.map.terrain")); + // nothing written: nothing changed + assert!(changed_files(&a, &stamp(&doc.dir)).is_empty()); + // another program saves a tile and the global settings + let tile = std::fs::read(doc.dir.join("tile_1_0.map")).unwrap(); + touch(&doc.dir.join("tile_1_0.map"), &tile); + let cfg = std::fs::read(doc.dir.join("global.cfg")).unwrap(); + touch(&doc.dir.join("global.cfg"), &cfg); + // and leaves a file of its own the map does not read from + std::fs::create_dir_all(doc.dir.join("backup")).unwrap(); + std::fs::write(doc.dir.join("backup").join("x.map"), b"x").unwrap(); + let files = changed_files(&a, &stamp(&doc.dir)); + assert_eq!(files, vec!["global.cfg".to_string(), "tile_1_0.map".to_string()]); + let c = classify(&doc, &files); + assert!(c.global && c.tiles == BTreeSet::from([(1, 0)]) && !c.timetable); + // a painting mask and the timetable count too + let c = classify(&doc, &["texture/map/tile_0_0.map.1.dds".into(), "ttdata/x.ttl".into(), "tile_0_-1.map.terrain".into(), "tile_0_0.map.lm.bmp".into()]); + assert_eq!(c.tiles, BTreeSet::from([(0, 0), (0, -1)])); + assert!(c.timetable && !c.global && !c.traffic); + let _ = std::fs::remove_dir_all(&roots.content); + } + + #[test] + fn a_tile_changed_outside_is_read_again_unless_it_has_changes_here() { + let _map = super::super::one_map(); + let roots = scratch("sync-reload"); + let mut doc = sample_map(&roots); + super::super::save(&mut doc).unwrap(); + let base = stamp(&doc.dir); + let global_base = super::super::global_text(&doc); + // OMSI 2's editor puts an object on tile 1, 0 and on tile 0, 0 and adds a tile + let mut other = Document::load(&roots, &doc.dir.join("global.cfg"), |_| {}).unwrap(); + for k in [(1, 0), (0, 0)] { + other.tiles.get_mut(&k).unwrap().tile.objects.push(omsi_map::MapObject { file: "Sceneryobjects\\new.sco".into(), id: 500 + k.0 as i64, pos: [5.0, 5.0, 0.0], ..Default::default() }); + other.tiles.get_mut(&k).unwrap().touch_content(); + } + other.add_tile((2, 0)); + std::thread::sleep(std::time::Duration::from_millis(20)); + super::super::save(&mut other).unwrap(); + // here tile 0, 0 has a change not saved yet + doc.tiles.get_mut(&(0, 0)).unwrap().tile.objects.push(omsi_map::MapObject { file: "Sceneryobjects\\mine.sco".into(), id: 900, pos: [1.0, 1.0, 0.0], ..Default::default() }); + doc.tiles.get_mut(&(0, 0)).unwrap().touch_content(); + let files = changed_files(&base, &stamp(&doc.dir)); + let changes = classify(&doc, &files); + assert!(changes.global && changes.tiles.contains(&(1, 0)) && changes.tiles.contains(&(0, 0))); + let mine = conflicts(&doc, &changes, &global_base); + assert_eq!(mine.tiles, BTreeSet::from([(0, 0)])); + assert!(!mine.global); + // keep mine: the rest is read in + let dir = doc.dir.clone(); + let done = reload(&mut doc, &dir, &changes, false); + assert!(done.global && done.tiles.contains(&(1, 0)) && done.tiles.contains(&(2, 0)) && !done.tiles.contains(&(0, 0))); + assert!(doc.object((1, 0), 501).is_some() && doc.tiles.contains_key(&(2, 0))); + assert!(doc.object((0, 0), 900).is_some() && doc.object((0, 0), 500).is_none() && doc.tiles[&(0, 0)].dirty); + assert!(!doc.tiles[&(1, 0)].dirty && doc.order.contains(&(2, 0))); + // reload from disk: theirs + reload(&mut doc, &dir, &mine, true); + assert!(doc.object((0, 0), 500).is_some() && doc.object((0, 0), 900).is_none() && !doc.is_dirty()); + let _ = std::fs::remove_dir_all(&roots.content); + } + + #[test] + fn a_copy_finds_what_changed_in_the_installation() { + let _map = super::super::one_map(); + let mut roots = scratch("sync-twin"); + // (an installation beside the content folder, not in it) + roots.omsi = roots.content.with_extension("omsi"); + let _ = std::fs::remove_dir_all(&roots.omsi); + // the installation's map, and openMapper's copy of it + std::fs::create_dir_all(roots.omsi.join("maps")).unwrap(); + let mut doc = sample_map(&roots); + doc.dir = roots.omsi.join("maps").join("Roundtrip"); + super::super::save(&mut doc).unwrap(); + let twin = doc.dir.clone(); + let loaded = Document::load(&roots, &twin.join("global.cfg"), |_| {}).unwrap(); + assert_eq!(copy_of(&roots, &twin.join("global.cfg")), None); + let mut copy = loaded; + super::super::save(&mut copy).unwrap(); + assert_eq!(copy.dir, roots.content.join("maps").join("Roundtrip")); + assert_eq!(copy_of(&roots, &twin.join("global.cfg")), Some(copy.dir.join("global.cfg"))); + assert_eq!(twin_of(&roots, ©.dir), Some(twin.clone())); + // a copy made before it remembered: nothing written after its save, nothing to take + assert!(twin_changes(©.dir, &stamp(&twin)).is_empty()); + set_twin_seen(©.dir, &stamp(&twin)); + assert!(twin_changes(©.dir, &stamp(&twin)).is_empty()); + // OMSI 2's editor changes a tile of the installation's + let mut other = Document::load(&roots, &twin.join("global.cfg"), |_| {}).unwrap(); + other.dir = twin.clone(); + other.source = None; + other.tiles.get_mut(&(1, 0)).unwrap().tile.objects.push(omsi_map::MapObject { file: "Sceneryobjects\\omsi.sco".into(), id: 700, pos: [5.0, 5.0, 0.0], ..Default::default() }); + other.tiles.get_mut(&(1, 0)).unwrap().touch_content(); + std::thread::sleep(std::time::Duration::from_millis(20)); + super::super::save(&mut other).unwrap(); + let now = stamp(&twin); + let files = twin_changes(©.dir, &now); + assert!(files.contains(&"tile_1_0.map".to_string()) && !files.contains(&"tile_0_0.map".to_string())); + // taken over: the copy reads it + let before = stamp(©.dir); + assert!(take_from_twin(&twin, ©.dir, &files).unwrap() > 0); + let changes = classify(©, &changed_files(&before, &stamp(©.dir))); + assert!(changes.tiles.contains(&(1, 0))); + let dir = copy.dir.clone(); + reload(&mut copy, &dir, &changes, false); + assert!(copy.object((1, 0), 700).is_some()); + set_twin_seen(©.dir, &now); + assert!(twin_changes(©.dir, &stamp(&twin)).is_empty()); + let _ = std::fs::remove_dir_all(&roots.content); + let _ = std::fs::remove_dir_all(&roots.omsi); + } +} diff --git a/src/editable.rs b/src/editable.rs index 513dc64..9380f07 100644 --- a/src/editable.rs +++ b/src/editable.rs @@ -179,9 +179,9 @@ pub fn load(roots: &Roots, rel: &str) -> Option { serde_json::from_str(&text).map_err(|e| log::warn!("{rel}: {e}")).ok() } -/// A file name of letters, digits, `_` and `-`. +/// A file name of ASCII letters, digits, `_` and `-`, as OMSI 2 reads it (see `omsi_name`). pub fn safe_name(name: &str) -> String { - let s: String = name.trim().chars().map(|c| if c.is_alphanumeric() || c == '_' || c == '-' { c } else { '_' }).collect(); + let s = crate::omsi_name::ascii_stem(name); if s.is_empty() { "Object".into() } else { diff --git a/src/editor.rs b/src/editor.rs index 21b848b..c86c8fa 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -3782,29 +3782,39 @@ impl Editor { fn snap_end_point(&self, assets: &mut Assets, p: DVec2, within: f64) -> Option<(Anchor, Option)> { let doc = self.doc.as_ref()?; let mut best: Option<(f64, Anchor, String)> = None; + // (the end of a spline without AI paths is caught where it is drawn: `end_snap`) + let new_mid = self.road_type.as_deref().and_then(|r| assets.spline(r)).map(|m| crate::end_snap::profile_middle(&m, false)).unwrap_or(0.0); + let starting = self.road_start.is_none(); for (k, t) in &doc.tiles { let org = tile_origin(*k); for s in t.tile.splines.iter().filter(|s| !s.deleted) { let start = DVec2::new(org.x + s.pos[0], org.y + s.pos[1]); - if !roads::can_reach(start, s.length, p, within) { + // (a kerb is seen up to some metres beside its line) + if !roads::can_reach(start, s.length, p, within + 10.0) { continue; } - if assets.spline(&s.file).map(|m| m.def.only_editor).unwrap_or(false) { + let m = assets.spline(&s.file); + if m.as_ref().map(|m| m.def.only_editor).unwrap_or(false) { continue; } - let link = assets.spline(&s.file).map(|m| !m.joinable()).unwrap_or(false); + let end_mid = m.as_ref().map(|m| crate::end_snap::profile_middle(m, s.mirror)).unwrap_or(0.0); + let link = m.as_ref().map(|m| !m.joinable()).unwrap_or(false); + let same = self.road_type.as_deref().is_some_and(|r| r.eq_ignore_ascii_case(&s.file)); let c = omsi_geometry::SplineCurve::from_map(s, org); - for (free, at_end, q, heading) in [ - (s.prev_id == 0, false, c.point_at(0.0), roads::norm_deg(s.heading + 180.0)), - (s.next_id == 0, true, c.end_point(), roads::norm_deg(c.heading_at(s.length))), + for (free, at_end, q, heading, along) in [ + (s.prev_id == 0, false, c.point_at(0.0), roads::norm_deg(s.heading + 180.0), s.heading), + (s.next_id == 0, true, c.end_point(), roads::norm_deg(c.heading_at(s.length)), c.heading_at(s.length)), ] { if !free { continue; } - let d = (q.truncate() - p).length(); + let (seen, pos) = crate::end_snap::catch(q, along, heading, end_mid, new_mid, starting, same); + let d = (seen.truncate() - p).length(); if d < within && best.as_ref().map(|b| d < b.0).unwrap_or(true) { - let spline = link.then_some((*k, s.id, at_end)); - best = Some((d, Anchor { pos: q, heading, spline, ..Default::default() }, s.file.clone())); + // (linked only where the two lines meet: another kerb put beside the + // line keeps the end's way, not its link) + let spline = (link && (pos - q).length() < 0.01).then_some((*k, s.id, at_end)); + best = Some((d, Anchor { pos, heading, spline, ..Default::default() }, s.file.clone())); } } } @@ -3933,22 +3943,28 @@ impl Editor { // nothing a road joins: the ends of the other splines one sees (a kerb, a wall, a // footpath) are still places to start from, the point only, nothing joined to it let mut end: Option<(f64, Anchor, String)> = None; + // (a kerb's end is caught where it is drawn, the middle of its profile: `end_snap`) + let new_mid = self.road_type.as_deref().and_then(|r| assets.spline(r)).map(|m| crate::end_snap::profile_middle(&m, false)).unwrap_or(0.0); + let starting = self.road_start.is_none(); for (k, t) in &doc.tiles { let org = tile_origin(*k); for s in t.tile.splines.iter().filter(|s| !s.deleted) { let start = DVec2::new(org.x + s.pos[0], org.y + s.pos[1]); - if (start - p).length() > s.length + within { + // (a kerb is seen up to some metres beside its line) + if (start - p).length() > s.length + within + 10.0 { continue; } let Some(m) = assets.spline(&s.file) else { continue }; + let end_mid = crate::end_snap::profile_middle(&m, s.mirror); if m.joinable() || m.def.only_editor || m.is_track() != track { continue; } let c = omsi_geometry::SplineCurve::from_map(s, org); - for (q, heading) in [(c.point_at(0.0), roads::norm_deg(s.heading + 180.0)), (c.end_point(), roads::norm_deg(c.heading_at(s.length)))] { - let d = (q.truncate() - p).length(); + for (q, heading, along) in [(c.point_at(0.0), roads::norm_deg(s.heading + 180.0), s.heading), (c.end_point(), roads::norm_deg(c.heading_at(s.length)), c.heading_at(s.length))] { + let (seen, pos) = crate::end_snap::catch(q, along, heading, end_mid, new_mid, starting, false); + let d = (seen.truncate() - p).length(); if d < within && end.as_ref().map(|b| d < b.0).unwrap_or(true) { - end = Some((d, Anchor { pos: q, heading, spline: None, mid: None }, s.file.clone())); + end = Some((d, Anchor { pos, heading, spline: None, mid: None }, s.file.clone())); } } } @@ -4177,7 +4193,9 @@ impl Editor { // (not joined into the road: the end is the place the new one is drawn to. One of its // own kind keeps that end's direction and is linked; a road's end does not, so the new // one is not bent round onto the road and does not take the road's link) - let laid_on = snap.filter(|_| !joins && !self.drawing_paths() && snap.is_some_and(|a| a.spline.is_none())); + // (a kerb's end that is not linked, the new one put beside its line, keeps its way) + let onto_road = self.road_snap_file.as_deref().and_then(|f| assets.spline(f)).map(|m| m.joinable()).unwrap_or(true); + let laid_on = snap.filter(|_| !joins && !self.drawing_paths() && onto_road && snap.is_some_and(|a| a.spline.is_none())); let mut target = if let Some(a) = laid_on { a.pos.truncate() } else { @@ -5700,6 +5718,7 @@ impl Editor { // (the dots that mark places on the ground are small: they are there to be seen, not to cover) let dw = w * 0.4; x.show_technical = self.show_technical || self.tool == Tool::Logic; + x.lanes_drawn = self.tool == Tool::Logic || self.show_lanes; x.hide = self.hide; // (the crossing being edited draws its own paths below, not the file's) let draft = self.crossing_draft.as_ref().map(|d| (d.0, d.1)); @@ -6096,16 +6115,19 @@ impl Editor { continue; } let c = omsi_geometry::SplineCurve::from_map(s, org); + // (a kerb's end is marked where it is drawn, where the tool catches it) + let mid = assets.spline(&s.file).map(|m| crate::end_snap::profile_middle(&m, s.mirror)).unwrap_or(0.0); + let seen = |q: DVec3, along: f64| crate::end_snap::catch(q, along, along, mid, 0.0, true, true).0; if s.prev_id == 0 { let a = c.point_at(0.0); if (a.truncate() - focus).length() <= reach && free(a) { - disc(&mut x.overlay, cam, a, dw * 2.0, [1.0, 1.0, 1.0, 0.6]); + disc(&mut x.overlay, cam, seen(a, s.heading), dw * 2.0, [1.0, 1.0, 1.0, 0.6]); } } if s.next_id == 0 { let b = c.end_point(); if (b.truncate() - focus).length() <= reach && free(b) { - disc(&mut x.overlay, cam, b, dw * 2.0, [1.0, 1.0, 1.0, 0.6]); + disc(&mut x.overlay, cam, seen(b, c.heading_at(s.length)), dw * 2.0, [1.0, 1.0, 1.0, 0.6]); } } } @@ -11755,10 +11777,7 @@ fn path_ends_at(doc: &Document, assets: &mut Assets, held: &Origin, pos: DVec2, if c.length <= 0.05 { return None; } - let at = |s: f64| { - let q = c.point_at(s); - pose.pos + pose.rot.transform_vector3(Vec3::new(q.x as f32, q.y as f32, q.z as f32)).as_dvec3() - }; + let at = |s: f64| crate::object_paths::world_point(&c, s, &pose, model.deform.as_deref()); let (a, b) = (at(0.0), at(c.length)); let step = (c.length * 0.05).clamp(0.05, 1.0); let ha = roads::heading_of((at(step) - a).truncate()); @@ -12530,6 +12549,63 @@ mod tests { assert_eq!(d.find_spline(linked).unwrap().1.next_id, 2); } + /// A kerb without AI paths whose line lies beside it is caught where it is drawn, the middle + /// of its profile (#55): another kerb of its type goes on from its line and is linked, a fence + /// is drawn to the kerb itself, keeping its way. + #[test] + fn a_kerbs_end_is_caught_where_it_is_drawn() { + let mut doc = flat_map(1); + // (a kerb running north from (100, 100) to (100, 140), drawn 3 to 3.4 m east of its line) + add_spline(&mut doc, (0, 0), 1, 100.0, 100.0, 0.0, 40.0, 0, 0); + doc.tiles.get_mut(&(0, 0)).unwrap().tile.splines[0].file = "Splines\\kerb.sli".into(); + let mut ed = Editor::default(); + ed.open(doc); + ed.set_tool(Tool::Roads); + let mut assets = Assets::new(std::env::temp_dir().join("openmapper-no-omsi"), std::env::temp_dir().join("openmapper-no-content")); + let model = |x0: f32, x1: f32| crate::assets::SplineModel { + def: omsi_scenery::Spline { + profiles: vec![omsi_scenery::SplineProfile { + texture: 0, + points: vec![ + omsi_scenery::SplineProfilePoint { x: x0, z: 0.0, ..Default::default() }, + omsi_scenery::SplineProfilePoint { x: x1, z: 0.0, ..Default::default() }, + ], + }], + ..Default::default() + }, + materials: Vec::new(), + half_width: x0.abs().max(x1.abs()), + }; + assert!(!model(3.0, 3.4).joinable()); + assets.splines.insert("splines\\kerb.sli".into(), crate::assets::Slot::Ready(std::sync::Arc::new(model(3.0, 3.4)))); + assets.splines.insert("splines\\fence.sli".into(), crate::assets::Slot::Ready(std::sync::Arc::new(model(-0.05, 0.05)))); + let lib = crate::library::Library::default(); + let seen = DVec2::new(103.2, 140.0); + // (the same kerb, started near what is drawn: from the line's end, linked) + ed.road_type = Some("Splines\\kerb.sli".into()); + ed.hover_point(&mut assets, &lib, DVec3::new(104.5, 141.0, 0.0)); + let snap = ed.road_snap.expect("the kerb's end was not caught where it is drawn"); + assert!((snap.pos.truncate() - DVec2::new(100.0, 140.0)).length() < 1e-6, "{:?}", snap.pos); + assert_eq!(snap.spline, Some(((0, 0), 1, true))); + // (a fence drawn to it from the north: its line ends on the kerb's middle, arriving + // along the kerb's way) + ed.road_type = Some("Splines\\fence.sli".into()); + ed.road_start = Some((Anchor { pos: DVec3::new(103.2, 180.0, 0.0), ..Default::default() }, false)); + ed.hover_point(&mut assets, &lib, DVec3::new(105.5, 140.5, 0.0)); + let snap = ed.road_snap.expect("the kerb's end was not caught"); + assert!((snap.pos.truncate() - seen).length() < 1e-6, "{:?}", snap.pos); + assert!(snap.spline.is_none(), "beside the kerb's line it is not linked"); + ed.left_press(&mut assets, &lib, false); + let d = ed.doc.as_ref().unwrap(); + assert_eq!(d.spline((0, 0), 1).unwrap().next_id, 0, "the kerb stays as it was"); + let made = d.tiles[&(0, 0)].tile.splines.iter().filter(|s| s.id != 1).collect::>(); + let last = made.iter().find(|s| s.next_id == 0).expect("the fence was not built"); + let c = omsi_geometry::SplineCurve::from_map(last, tile_origin((0, 0))); + assert!((c.end_point().truncate() - seen).length() < 0.01, "{:?}", c.end_point()); + let off = (roads::norm_deg(c.heading_at(last.length)) - 180.0).abs(); + assert!(off < 0.5, "it arrives along the kerb's way: {}", c.heading_at(last.length)); + } + /// A building is what it draws, not the box it was measured with: its box holds its /// courtyard, and the gap between two wings, and it is met before the faces inside it - so /// taking it for the building made a building take the click from the lamp that really diff --git a/src/end_snap.rs b/src/end_snap.rs new file mode 100644 index 0000000..d525d9d --- /dev/null +++ b/src/end_snap.rs @@ -0,0 +1,117 @@ +//! Where the Roads tool catches the end of a spline without AI paths (a kerb, a wall, a fence). +//! +//! A road's line is its middle and its lanes start there, so its end is caught at the line. A +//! kerb's line may lie metres beside what is drawn (it is laid along a road's middle and drawn +//! at the road's edge): its end is caught where it is seen, the middle of its profile. A spline +//! of the same type goes on from the line's end, so the two run on as one; another type is put +//! with the middle of its own profile on that point. + +use glam::DVec3; + +use crate::assets::SplineModel; +use crate::roads; + +/// The middle of what a spline type draws, metres to the right of its line (`mirror`: as a +/// mirrored spline draws it). Nothing for a type with AI paths (its line is its middle) or one +/// that draws nothing. +pub fn profile_middle(m: &SplineModel, mirror: bool) -> f64 { + if !m.def.paths.is_empty() { + return 0.0; + } + let xs = || m.def.profiles.iter().flat_map(|p| p.points.iter()).map(|q| q.x as f64); + let (lo, hi) = (xs().fold(f64::INFINITY, f64::min), xs().fold(f64::NEG_INFINITY, f64::max)); + if !lo.is_finite() || !hi.is_finite() { + return 0.0; + } + let mid = (lo + hi) * 0.5; + if mirror { + -mid + } else { + mid + } +} + +/// A free end caught: where it is seen (what the cursor is measured to) and where the new +/// spline's line goes. +/// +/// `line_end` is the end of the old spline's line, `along` the way that spline runs there (its +/// own heading), `outward` the way out of it (the anchor's heading), `end_mid` the middle of its +/// profile ([`profile_middle`]) and `new_mid` that of the type drawn. `starting`: the new spline +/// leaves from here (else it arrives here). `same_type`: the new spline is of the old one's type +/// and goes on from its line. +pub fn catch(line_end: DVec3, along: f64, outward: f64, end_mid: f64, new_mid: f64, starting: bool, same_type: bool) -> (DVec3, DVec3) { + let r = roads::right(along); + let seen = line_end + DVec3::new(r.x, r.y, 0.0) * end_mid; + if same_type { + return (seen, line_end); + } + // (the way the new spline runs there: out of the end when it starts at it, into it when it + // ends at it. Its profile's middle is that far to the right of its own line) + let travel = if starting { outward } else { roads::norm_deg(outward + 180.0) }; + let n = roads::right(travel); + (seen, seen - DVec3::new(n.x, n.y, 0.0) * new_mid) +} + +#[cfg(test)] +mod tests { + use super::*; + use glam::DVec2; + + fn kerb(x0: f32, x1: f32) -> SplineModel { + SplineModel { + def: omsi_scenery::Spline { + profiles: vec![omsi_scenery::SplineProfile { + texture: 0, + points: vec![ + omsi_scenery::SplineProfilePoint { x: x0, z: 0.0, ..Default::default() }, + omsi_scenery::SplineProfilePoint { x: x1, z: 0.15, ..Default::default() }, + ], + }], + ..Default::default() + }, + materials: Vec::new(), + half_width: x0.abs().max(x1.abs()), + } + } + + #[test] + fn a_kerbs_end_is_where_it_is_drawn() { + let k = kerb(3.0, 3.4); + assert!((profile_middle(&k, false) - 3.2).abs() < 1e-6); + assert!((profile_middle(&k, true) + 3.2).abs() < 1e-6, "a mirrored kerb is drawn on the left"); + // (a kerb running north, its line ending at (0, 10): seen 3.2 m east of it) + let (seen, _) = catch(DVec3::new(0.0, 10.0, 0.0), 0.0, 0.0, 3.2, 0.0, true, false); + assert!((seen.truncate() - DVec2::new(3.2, 10.0)).length() < 1e-9, "{seen:?}"); + } + + #[test] + fn a_road_keeps_its_line() { + let mut road = kerb(-3.5, 3.5); + road.def.paths.push(Default::default()); + assert_eq!(profile_middle(&road, false), 0.0); + } + + #[test] + fn the_same_kerb_goes_on_from_the_line_and_another_meets_its_middle() { + let end = DVec3::new(0.0, 10.0, 0.0); + // (the same type: line to line, so the two run on as one) + let (_, pos) = catch(end, 0.0, 0.0, 3.2, 3.2, true, true); + assert!((pos - end).length() < 1e-9); + // (a fence, drawn on its line, goes on from the kerb's middle) + let (seen, pos) = catch(end, 0.0, 0.0, 3.2, 0.0, true, false); + assert!((pos - seen).length() < 1e-9); + // (another kerb whose middle is 1 m right of its line, going on north: its line 1 m + // left of the old one's middle, so the two middles meet) + let (seen, pos) = catch(end, 0.0, 0.0, 3.2, 1.0, true, false); + assert!((pos.truncate() - DVec2::new(2.2, 10.0)).length() < 1e-9, "{pos:?}"); + let r = roads::right(0.0); + assert!((pos.truncate() + r * 1.0 - seen.truncate()).length() < 1e-9, "the middles meet"); + // (the same kerb drawn to that end, arriving from the north: running south, its middle + // is on its right, the west, so its line lies east of the old middle) + let (seen, pos) = catch(end, 0.0, 0.0, 3.2, 1.0, false, false); + let travel = 180.0; + let r = roads::right(travel); + assert!((pos.truncate() + r * 1.0 - seen.truncate()).length() < 1e-9, "the middles meet: {pos:?} {seen:?}"); + assert!((pos.truncate() - DVec2::new(4.2, 10.0)).length() < 1e-9, "{pos:?}"); + } +} diff --git a/src/gpu.rs b/src/gpu.rs index f839540..8d773a1 100644 --- a/src/gpu.rs +++ b/src/gpu.rs @@ -15,6 +15,16 @@ pub fn take_out_of_memory() -> bool { OUT_OF_MEMORY.swap(false, std::sync::atomic::Ordering::Relaxed) } +/// The graphics memory ran out at some time in this run: a texture or buffer whose creation +/// failed is invalid from then on, and the next upload into it is an echo of that, not a bug. +static RAN_OUT_ONCE: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false); + +/// Whether a wgpu error is only the echo of graphics memory having run out: the use of a +/// resource whose creation failed for want of memory (#62). +fn echo_of_out_of_memory(message: &str) -> bool { + RAN_OUT_ONCE.load(std::sync::atomic::Ordering::Relaxed) && message.contains("is invalid") +} + pub struct Gpu { pub surface: wgpu::Surface<'static>, pub device: wgpu::Device, @@ -164,12 +174,15 @@ impl Gpu { let info = adapter.get_info(); log::info!("GPU: {} ({:?})", info.name, info.backend); // (running out of graphics memory is not a reason to close the editor: the renderer - // frees what it can make again; any other error is fatal, as wgpu has it by default) + // frees what it can make again, and the uses of what failed to be made are passed over; + // any other error is fatal, as wgpu has it by default) device.on_uncaptured_error(Arc::new(|e: wgpu::Error| match e { wgpu::Error::OutOfMemory { source } => { log::error!("graphics memory ran out: {source}"); OUT_OF_MEMORY.store(true, std::sync::atomic::Ordering::Relaxed); + RAN_OUT_ONCE.store(true, std::sync::atomic::Ordering::Relaxed); } + other if echo_of_out_of_memory(&other.to_string()) => log::warn!("after graphics memory ran out: {other}"), other => panic!("wgpu error: {other}"), })); let size = window.inner_size(); @@ -268,6 +281,15 @@ fn targets(device: &wgpu::Device, c: &wgpu::SurfaceConfiguration, scene_format: mod tests { use super::*; + #[test] + fn an_upload_into_a_texture_memory_failed_to_make_is_no_crash() { + let echo = "Validation Error\n In Queue::write_texture\n Texture with 'texture' label is invalid"; + assert!(!echo_of_out_of_memory(echo)); + RAN_OUT_ONCE.store(true, std::sync::atomic::Ordering::Relaxed); + assert!(echo_of_out_of_memory(echo)); + assert!(!echo_of_out_of_memory("Validation Error\n In a set_pipeline command\n Incompatible color attachments")); + } + #[test] fn the_api_asked_for_is_tried_first_and_the_rest_follow() { assert_eq!(attempts(Api::Auto).len(), 3); diff --git a/src/install.rs b/src/install.rs index f31c85d..b70b7cc 100644 --- a/src/install.rs +++ b/src/install.rs @@ -225,9 +225,17 @@ impl Prefs { self.save(); } + /// The camera kept for a map folder, if it is one the camera can take (a broken one in the + /// settings would throw the view about at every start). pub fn last_view(&self, map_dir: &Path) -> Option<[f64; 6]> { let s = map_dir.to_string_lossy(); - self.last_views.iter().find(|(d, _)| *d == s).map(|(_, v)| *v) + let mut v = self.last_views.iter().find(|(d, _)| *d == s).map(|(_, v)| *v)?; + if !v.iter().all(|x| x.is_finite()) { + return None; + } + v[4] = v[4].clamp(-85.0, 89.5); + v[5] = v[5].clamp(0.5, 8000.0); + Some(v) } pub fn push_recent(&mut self, cfg: &Path) { @@ -418,3 +426,21 @@ fn friendly_name(cfg: &Path) -> Option { } name } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn a_broken_camera_kept_in_the_settings_is_not_taken() { + let mut p = Prefs::default(); + p.last_views.push(("a".into(), [1.0, 2.0, 3.0, 20.0, 45.0, 300.0])); + p.last_views.push(("b".into(), [f64::NAN, 2.0, 3.0, 20.0, 45.0, 300.0])); + p.last_views.push(("c".into(), [1.0, 2.0, 3.0, 20.0, 400.0, f64::INFINITY])); + p.last_views.push(("d".into(), [1.0, 2.0, 3.0, 20.0, 400.0, 1e9])); + assert_eq!(p.last_view(Path::new("a")), Some([1.0, 2.0, 3.0, 20.0, 45.0, 300.0])); + assert_eq!(p.last_view(Path::new("b")), None); + assert_eq!(p.last_view(Path::new("c")), None); + assert_eq!(p.last_view(Path::new("d")), Some([1.0, 2.0, 3.0, 20.0, 89.5, 8000.0])); + } +} diff --git a/src/junction.rs b/src/junction.rs index 9183e67..2fdefb1 100644 --- a/src/junction.rs +++ b/src/junction.rs @@ -926,7 +926,7 @@ pub fn make_with(doc: &mut Document, assets: &mut Assets, content: &Path, asphal } } let id = doc.new_id(); - let folder: String = doc.dir.file_name().map(|f| f.to_string_lossy().to_string()).unwrap_or_else(|| "map".into()).chars().map(|c| if c.is_alphanumeric() || c == '-' || c == '_' { c } else { '_' }).collect(); + let folder = folder_name(doc); let sco_root = std::fs::read_dir(content)?.flatten().map(|e| e.path()).find(|p| p.is_dir() && p.file_name().map(|f| f.to_string_lossy().eq_ignore_ascii_case("sceneryobjects")).unwrap_or(false)).unwrap_or_else(|| content.join("Sceneryobjects")); let dir = sco_root.join("openMapper").join(&folder); let tex_dir = dir.join("texture"); @@ -1067,7 +1067,7 @@ pub fn object_dir(content: &Path, folder: &str) -> std::io::Result { /// The name of a map's folder as its junction objects' folder is named. pub fn folder_name(doc: &Document) -> String { - doc.dir.file_name().map(|f| f.to_string_lossy().to_string()).unwrap_or_else(|| "map".into()).chars().map(|c| if c.is_alphanumeric() || c == '-' || c == '_' { c } else { '_' }).collect() + crate::editable::safe_name(&doc.dir.file_name().map(|f| f.to_string_lossy().to_string()).unwrap_or_else(|| "map".into())) } /// A road coming into a drawn junction: its road type, where it ends (in the drawing's frame) diff --git a/src/lanes.rs b/src/lanes.rs index 37c65df..17e84aa 100644 --- a/src/lanes.rs +++ b/src/lanes.rs @@ -4,7 +4,7 @@ //! end on it is where traffic stops dead: the Logic tool shows those, and AI paths are drawn //! snapping to the ends. -use glam::{DVec2, DVec3, Vec3}; +use glam::{DVec2, DVec3}; use omsi_geometry::SplineCurve; use crate::assets::Assets; @@ -261,17 +261,18 @@ pub fn tips_skipping(doc: &Document, assets: &mut Assets, centre: DVec2, radius: continue; } let pose = Pose::of_object(world, o.rot); - let to_world = |q: DVec3| pose.pos + pose.rot.transform_vector3(Vec3::new(q.x as f32, q.y as f32, q.z as f32)).as_dvec3(); + let field = model.deform.as_deref(); for p in &model.paths { let c = object_path_curve(p); if !(c.length > 0.05) { continue; } let d = 1.5_f64.min(c.length * 0.5).max(0.05); - let a0 = to_world(c.point_at(0.0)); - let a1 = to_world(c.point_at(d)); - let b1 = to_world(c.point_at(c.length - d)); - let b0 = to_world(c.point_at(c.length)); + let at = |s: f64| crate::object_paths::world_point(&c, s, &pose, field); + let a0 = at(0.0); + let a1 = at(d); + let b1 = at(c.length - d); + let b0 = at(c.length); push(&mut tips, a0, a1 - a0, false, p.direction, p.kind); push(&mut tips, b0, b0 - b1, true, p.direction, p.kind); } @@ -349,12 +350,8 @@ pub fn near_skipping(doc: &Document, assets: &mut Assets, centre: DVec2, radius: continue; } let n = ((c.length / step).ceil().max(1.0) as usize).min(400); - let pts = (0..=n) - .map(|i| { - let q = c.point_at(c.length * i as f64 / n as f64); - pose.pos + pose.rot.transform_vector3(Vec3::new(q.x as f32, q.y as f32, q.z as f32)).as_dvec3() - }) - .collect(); + // (draped by the object's height field, as its mesh is) + let pts = (0..=n).map(|i| crate::object_paths::world_point(&c, c.length * i as f64 / n as f64, &pose, model.deform.as_deref())).collect(); lanes.push(Lane { pts, kind: p.kind, direction: p.direction, spline: None, object: Some((*k, o.id)), index }); } } @@ -373,7 +370,7 @@ pub fn near_skipping(doc: &Document, assets: &mut Assets, centre: DVec2, radius: for dx in -1..=1 { for &j in grid.get(&(cx + dx, cy + dy)).map(|v| v.as_slice()).unwrap_or(&[]) { let (a, b) = (&ends[i], &ends[j]); - if i != j && a.kind == b.kind && (a.pos.truncate() - b.pos.truncate()).length() < LINK && (a.pos.z - b.pos.z).abs() < 1.5 { + if i != j && a.kind == b.kind && (a.pos.truncate() - b.pos.truncate()).length() < LINK && (a.pos.z - b.pos.z).abs() < crate::timetable::network::LINK_RISE { hit = true; } } diff --git a/src/lanes_edit.rs b/src/lanes_edit.rs index 0f5785c..5d2972d 100644 --- a/src/lanes_edit.rs +++ b/src/lanes_edit.rs @@ -47,7 +47,7 @@ fn textures_of(text: &str) -> Vec { pub fn lane_free_copy(roots: &Roots, rel: &str) -> anyhow::Result { let from = [&roots.content, &roots.omsi].iter().map(|r| omsi_cfg::resolve_path(r, rel)).find(|p| p.is_file()).ok_or_else(|| anyhow::anyhow!("{rel} is not installed"))?; let text = omsi_cfg::decode_text(&std::fs::read(&from)?); - let stem = Path::new(&rel.replace('\\', "/")).file_stem().map(|s| s.to_string_lossy().to_string()).unwrap_or_else(|| "road".into()); + let stem = crate::editable::safe_name(&Path::new(&rel.replace('\\', "/")).file_stem().map(|s| s.to_string_lossy().to_string()).unwrap_or_else(|| "road".into())); let dir = roots.content.join("Splines").join("openMapper"); let tex_dir = dir.join("texture"); std::fs::create_dir_all(&tex_dir)?; diff --git a/src/main.rs b/src/main.rs index e3c9a96..f1609dd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,6 +15,7 @@ mod controls; mod chrono_edit; mod chrono_tt; mod clipboard; +mod complete; mod collab; mod descriptions; mod doc; @@ -29,6 +30,7 @@ mod crossing_edit; mod editable; mod ed_cjunction; mod editor; +mod end_snap; mod gpu; mod heightmap; mod history; @@ -51,8 +53,10 @@ mod meshops; mod library; mod logging; mod models; +mod object_paths; mod pbr_maker; mod onground; +mod omsi_name; mod osm; mod osm_map; mod osm_buildings; @@ -120,6 +124,7 @@ mod ui_roads; mod ui_tex; mod ui_script; mod ui_stops; +mod ui_sync; mod ui_newmap; mod trace; mod ui_timetable; diff --git a/src/mcp/edit.rs b/src/mcp/edit.rs index eed8a1d..5b166df 100644 --- a/src/mcp/edit.rs +++ b/src/mcp/edit.rs @@ -338,6 +338,7 @@ impl Server { "reverse" => e.reverse_selected(), "lay_on_ground" => e.lay_selected_on_ground(), "even_chain" => e.even_selected_chain(), + "complete_to" => e.complete_to(), "continue_spline" => said = json!(e.continue_spline()), "parallel_copy" => e.parallel_copy(c.f64("distance").ok_or("`distance` is needed (m, + right)")?), "level_under_objects" => said = json!(e.level_under_objects(&mut self.assets)), diff --git a/src/mcp/schema.rs b/src/mcp/schema.rs index 9900cf0..fd69dcf 100644 --- a/src/mcp/schema.rs +++ b/src/mcp/schema.rs @@ -118,7 +118,7 @@ impl Server { tool("stroke", "The left button held down along a path for some seconds, with the tool as set: a terrain or paint brush, the plant brush, a drag.", json!({ "path": points("The cursor's way (one point: held still)."), "seconds": { "type": "number", "description": "How long, 1 by default; the brush works as long as it is held." } }), &["path"], false), - tool("command", "One of the editor's commands (menus, keys) on the selection or the map: undo, redo, cancel, confirm, delete, copy, cut, paste, duplicate, select_all, select_none, rotate {degrees}, move {dx, dy}, raise {dz}, reverse, lay_on_ground, even_chain, continue_spline, parallel_copy {distance}, level_under_objects, align_to_roads, turn_objects {random}, lean_objects {lean}, replace_objects {file}, retype_splines {file}, replace_everywhere {from, to, splines}, cut_spline {id, at}, join_with_next {id}, wire_along {file}, paint_along {layer, width, under}, array {count, step:[dx,dy], turn, rows, row_step:[dx,dy]}, group, ungroup, remake_junctions, flatten_terrain, grow_map, align_ground, place_rows, detach_lanes.", json!({ + tool("command", "One of the editor's commands (menus, keys) on the selection or the map: undo, redo, cancel, confirm, delete, copy, cut, paste, duplicate, select_all, select_none, rotate {degrees}, move {dx, dy}, raise {dz}, reverse, lay_on_ground, even_chain, complete_to, continue_spline, parallel_copy {distance}, level_under_objects, align_to_roads, turn_objects {random}, lean_objects {lean}, replace_objects {file}, retype_splines {file}, replace_everywhere {from, to, splines}, cut_spline {id, at}, join_with_next {id}, wire_along {file}, paint_along {layer, width, under}, array {count, step:[dx,dy], turn, rows, row_step:[dx,dy]}, group, ungroup, remake_junctions, flatten_terrain, grow_map, align_ground, place_rows, detach_lanes.", json!({ "name": { "type": "string" }, "args": { "type": "object" } }), &["name"], false), tool("select", "Select objects and splines: by `ids`, or what is within `radius` of `at` (kinds, file filter), or everything like an IDCode (`alike`), or a spline's whole chain (`chain`), or `all` / `none`. `add` keeps what is selected. The selection is what `command`, `delete` and `render` act on or show.", json!({ diff --git a/src/object_paths.rs b/src/object_paths.rs new file mode 100644 index 0000000..852c3c6 --- /dev/null +++ b/src/object_paths.rs @@ -0,0 +1,112 @@ +//! An object's `[path]`s laid into the world as Omsi.exe lays them, the same way its mesh is: +//! the curve in the object's frame, lifted by the object's `[crossing_heightdeformation]` +//! field where it reaches, then turned and moved by the whole placement (heading, pitch, +//! bank, height). A road object whose field drops its plate down a hill had its mesh draped +//! and its lanes left flat at the plate's base height: metres over (or under) the road it +//! drew, and the lanes of the roads below no longer met them (#120). + +use std::path::Path; + +use glam::{DVec3, Vec3}; +use omsi_geometry::{MeshData, SplineCurve}; +use omsi_scenery::SceneryObject; + +use crate::place::Pose; + +/// The object's `[crossing_heightdeformation]` field, read as the object's model reads it: +/// in the model folder's `model` subfolder first, then beside the model. +pub fn load_field(sco: &SceneryObject, sco_path: &Path) -> Option { + let f = sco.crossing_height_deformation.as_ref()?; + let sco_dir = sco_path.parent()?; + let model_dir = match &sco.model_file { + Some(m) => omsi_cfg::resolve_path(sco_dir, m).parent()?.to_path_buf(), + None => sco_dir.to_path_buf(), + }; + let in_model = omsi_cfg::resolve_path(&omsi_cfg::resolve_path(&model_dir, "model"), f); + let p = if omsi_cfg::vfs::is_file(&in_model) { in_model } else { omsi_cfg::resolve_path(&model_dir, f) }; + match omsi_o3d::load_mesh(&p) { + Ok(m) => Some(omsi_geometry::mesh_from_o3d(&m)), + Err(e) => { + log::warn!("crossing height deformation {}: {e}", p.display()); + None + } + } +} + +/// The height of a `[crossing_heightdeformation]` field over (x, y) in the object's frame, +/// where the field reaches (the highest face there; openOMSI's `field_height`). +pub fn field_height(m: &MeshData, x: f32, y: f32) -> Option { + let mut best: Option = None; + for t in m.indices.chunks_exact(3) { + let (a, b, c) = (m.positions[t[0] as usize], m.positions[t[1] as usize], m.positions[t[2] as usize]); + let det = (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y); + if det.abs() < 1e-9 { + continue; + } + let l1 = ((b.x - a.x) * (y - a.y) - (x - a.x) * (b.y - a.y)) / det; + let l2 = ((x - a.x) * (c.y - a.y) - (c.x - a.x) * (y - a.y)) / det; + let l0 = 1.0 - l1 - l2; + if l0 >= -1e-4 && l1 >= -1e-4 && l2 >= -1e-4 { + let h = l0 * a.z + l2 * b.z + l1 * c.z; + best = Some(best.map_or(h, |o: f32| o.max(h))); + } + } + best +} + +/// A path's point `s` metres along it, in the world: lifted by the field where the field +/// reaches (a vertical ray missing it leaves the height as the file gives it, as for the +/// mesh), then placed by the object's pose. +pub fn world_point(c: &SplineCurve, s: f64, pose: &Pose, field: Option<&MeshData>) -> DVec3 { + let q = c.point_at(s); + let mut local = Vec3::new(q.x as f32, q.y as f32, q.z as f32); + if let Some(d) = field.and_then(|f| field_height(f, local.x, local.y)) { + local.z += d; + } + pose.pos + pose.rot.transform_vector3(local).as_dvec3() +} + +#[cfg(test)] +mod tests { + use super::*; + + /// A field that falls 4 m over 20 m along the object's forward axis: a plate laid down + /// a hill, as Städtedreieck's road objects are. + fn slope() -> MeshData { + let mut m = MeshData::default(); + m.positions = vec![Vec3::new(-10.0, -1.0, 0.0), Vec3::new(10.0, -1.0, 0.0), Vec3::new(10.0, 21.0, -4.4), Vec3::new(-10.0, 21.0, -4.4)]; + m.indices = vec![0, 1, 2, 0, 2, 3]; + m + } + + fn straight(length: f64) -> SplineCurve { + crate::lanes::object_path_curve(&omsi_scenery::PathDef { start: [0.0, 0.0, 0.0], end: [0.0, 0.0, length as f32], params: vec![0.0; 8], ..Default::default() }) + } + + #[test] + fn a_path_follows_its_objects_height_field() { + let field = slope(); + let pose = Pose::of_object(DVec3::new(100.0, 200.0, 30.0), [0.0, 0.0, 0.0]); + let c = straight(20.0); + let a = world_point(&c, 0.0, &pose, Some(&field)); + let b = world_point(&c, 20.0, &pose, Some(&field)); + assert!((a.z - 29.8).abs() < 1e-3, "the start is on the field: {}", a.z); + assert!((b.z - 25.8).abs() < 1e-3, "and so is the end, 4 m lower: {}", b.z); + // (without the field the path stays at the plate's own height, as the mesh would) + assert!((world_point(&c, 20.0, &pose, None).z - 30.0).abs() < 1e-6); + } + + #[test] + fn a_path_off_the_field_keeps_its_height_and_the_pose_turns_it() { + let field = slope(); + // (turned 90° clockwise: the object's forward is east; placed 2 m under the ground + // the map gives, the field carries none of that away) + let pose = Pose::of_object(DVec3::new(0.0, 0.0, -2.0), [90.0, 0.0, 0.0]); + let c = straight(40.0); + let mid = world_point(&c, 10.0, &pose, Some(&field)); + assert!((mid.x - 10.0).abs() < 1e-3 && mid.y.abs() < 1e-3, "{mid:?}"); + assert!((mid.z - (-2.0 - 0.2 - 2.0)).abs() < 1e-3, "{}", mid.z); + let far = world_point(&c, 40.0, &pose, Some(&field)); + assert!((far.z + 2.0).abs() < 1e-6, "past the field the path keeps the height it has: {}", far.z); + } +} diff --git a/src/omsi_name.rs b/src/omsi_name.rs new file mode 100644 index 0000000..a55c716 --- /dev/null +++ b/src/omsi_name.rs @@ -0,0 +1,167 @@ +//! Names of the files openMapper makes, as OMSI 2 can open them: OMSI 2 reads its files +//! through the system's 8-bit code page, so a letter outside it (Cyrillic on a Western +//! Windows, an accent on a Russian one) names a file it cannot find, and a name with dots +//! before its extension (`lamp~s1.5_2_1.sco`) was not read either. A name made here has +//! only ASCII letters, digits, `_` and `-`; letters with accents and Cyrillic ones are +//! spelt in Latin letters. + +/// `name` as a file name OMSI 2 reads (without its extension): empty if nothing of it is left. +pub fn ascii_stem(name: &str) -> String { + let mut out = String::new(); + for c in name.trim().chars() { + if c.is_ascii_alphanumeric() || c == '-' || c == '_' { + out.push(c); + } else if let Some(l) = latin(c) { + out.push_str(l); + } else if !out.ends_with('_') { + out.push('_'); + } + } + out.trim_matches('_').to_string() +} + +/// Whether OMSI 2 opens a file of this name on every system (the folders too, `\` or `/` +/// between them): ASCII letters, digits, `_`, `-`, spaces and one dot, before the extension. +#[cfg(test)] +pub fn readable(rel: &str) -> bool { + let file = rel.rsplit(['\\', '/']).next().unwrap_or(rel); + rel.chars().all(|c| c.is_ascii_alphanumeric() || " _-.\\/".contains(c)) && file.matches('.').count() <= 1 +} + +/// The Latin spelling of a letter with an accent or of a Cyrillic letter. +fn latin(c: char) -> Option<&'static str> { + Some(match c { + 'À' | 'Á' | 'Â' | 'Ã' | 'Ä' | 'Å' | 'Ā' | 'Ă' | 'Ą' => "A", + 'à' | 'á' | 'â' | 'ã' | 'ä' | 'å' | 'ā' | 'ă' | 'ą' => "a", + 'Æ' => "AE", + 'æ' => "ae", + 'Ç' | 'Ć' | 'Č' => "C", + 'ç' | 'ć' | 'č' => "c", + 'Ď' | 'Đ' | 'Ð' => "D", + 'ď' | 'đ' | 'ð' => "d", + 'È' | 'É' | 'Ê' | 'Ë' | 'Ē' | 'Ė' | 'Ę' | 'Ě' => "E", + 'è' | 'é' | 'ê' | 'ë' | 'ē' | 'ė' | 'ę' | 'ě' => "e", + 'Ğ' => "G", + 'ğ' => "g", + 'Ì' | 'Í' | 'Î' | 'Ï' | 'Ī' | 'İ' => "I", + 'ì' | 'í' | 'î' | 'ï' | 'ī' | 'ı' => "i", + 'Ł' | 'Ľ' | 'Ĺ' => "L", + 'ł' | 'ľ' | 'ĺ' => "l", + 'Ñ' | 'Ń' | 'Ň' => "N", + 'ñ' | 'ń' | 'ň' => "n", + 'Ò' | 'Ó' | 'Ô' | 'Õ' | 'Ö' | 'Ø' | 'Ō' | 'Ő' => "O", + 'ò' | 'ó' | 'ô' | 'õ' | 'ö' | 'ø' | 'ō' | 'ő' => "o", + 'Œ' => "OE", + 'œ' => "oe", + 'Ř' | 'Ŕ' => "R", + 'ř' | 'ŕ' => "r", + 'Ś' | 'Š' | 'Ş' => "S", + 'ś' | 'š' | 'ş' => "s", + 'ß' => "ss", + 'Ť' | 'Ţ' => "T", + 'ť' | 'ţ' => "t", + 'Þ' => "Th", + 'þ' => "th", + 'Ù' | 'Ú' | 'Û' | 'Ü' | 'Ū' | 'Ů' | 'Ű' => "U", + 'ù' | 'ú' | 'û' | 'ü' | 'ū' | 'ů' | 'ű' => "u", + 'Ý' | 'Ÿ' => "Y", + 'ý' | 'ÿ' => "y", + 'Ź' | 'Ż' | 'Ž' => "Z", + 'ź' | 'ż' | 'ž' => "z", + 'А' => "A", + 'а' => "a", + 'Б' => "B", + 'б' => "b", + 'В' => "V", + 'в' => "v", + 'Г' | 'Ґ' => "G", + 'г' | 'ґ' => "g", + 'Д' => "D", + 'д' => "d", + 'Е' | 'Ё' | 'Э' => "E", + 'е' | 'ё' | 'э' => "e", + 'Є' => "Ye", + 'є' => "ye", + 'Ж' => "Zh", + 'ж' => "zh", + 'З' => "Z", + 'з' => "z", + 'И' | 'І' => "I", + 'и' | 'і' => "i", + 'Ї' => "Yi", + 'ї' => "yi", + 'Й' | 'Ы' => "Y", + 'й' | 'ы' => "y", + 'К' => "K", + 'к' => "k", + 'Л' => "L", + 'л' => "l", + 'М' => "M", + 'м' => "m", + 'Н' => "N", + 'н' => "n", + 'О' => "O", + 'о' => "o", + 'П' => "P", + 'п' => "p", + 'Р' => "R", + 'р' => "r", + 'С' => "S", + 'с' => "s", + 'Т' => "T", + 'т' => "t", + 'У' => "U", + 'у' => "u", + 'Ф' => "F", + 'ф' => "f", + 'Х' => "Kh", + 'х' => "kh", + 'Ц' => "Ts", + 'ц' => "ts", + 'Ч' => "Ch", + 'ч' => "ch", + 'Ш' => "Sh", + 'ш' => "sh", + 'Щ' => "Shch", + 'щ' => "shch", + 'Ъ' | 'ъ' | 'Ь' | 'ь' => "", + 'Ю' => "Yu", + 'ю' => "yu", + 'Я' => "Ya", + 'я' => "ya", + _ => return None, + }) +} + +#[cfg(test)] +mod tests { + #[test] + fn typed_names_come_out_in_ascii() { + assert_eq!(ascii_stem("Main street 4"), "Main_street_4"); + assert_eq!(ascii_stem("Дорога 2+2"), "Doroga_2_2"); + assert_eq!(ascii_stem("Große Straße"), "Grosse_Strasse"); + assert_eq!(ascii_stem(" "), ""); + for n in ["Щёлковское шоссе", "Їжак", "Ъ", "Ünter-Weg_1", "道路"] { + assert!(ascii_stem(n).chars().all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-'), "{n}"); + } + } + + use super::*; + + #[test] + fn names_are_spelt_in_ascii() { + assert_eq!(ascii_stem("Comércio São João"), "Comercio_Sao_Joao"); + assert_eq!(ascii_stem("Остановка №5"), "Ostanovka_5"); + assert_eq!(ascii_stem("lamp~s1.5"), "lamp_s1_5"); + assert_eq!(ascii_stem(" ... "), ""); + assert_eq!(ascii_stem("Straße-2_b"), "Strasse-2_b"); + } + + #[test] + fn a_readable_name_has_one_dot_and_ascii() { + assert!(readable("Sceneryobjects\\Shops\\comercio18.sco")); + assert!(!readable("Sceneryobjects\\Shops\\comercio18~s1.876_1.436_1.876.sco")); + assert!(!readable("Splines\\openMapper\\road_bay_right_3.5m.sli")); + assert!(!readable("Sceneryobjects\\openMapper\\Улица\\a.sco")); + } +} diff --git a/src/plan.rs b/src/plan.rs index e4afcd3..0be71fb 100644 --- a/src/plan.rs +++ b/src/plan.rs @@ -118,7 +118,7 @@ pub fn svg(doc: &Document, lib: &Library, roots: &[PathBuf]) -> String { let mut drawn = false; for trip in tt.trips.iter().filter(|t| t.line.eq_ignore_ascii_case(&line.name) && t.stations.len() >= 2) { let pos: Vec> = trip.stations.iter().map(|id| crate::timetable::stop_world(doc, &mut files, *id)).collect(); - let r = crate::timetable::route::find(&net, &pos, doc.global.left_hand_traffic, crate::timetable::route::ways_of(&doc.timetable, &trip.name, &net, &doc.order)); + let r = crate::timetable::way::of_trip(&net, &doc.timetable, &trip.name, &doc.order, &pos, doc.global.left_hand_traffic); let pts: Vec = r.polyline(&net).iter().map(|p| p.truncate()).collect(); if pts.len() >= 2 { let _ = write!(ways, r#""#, path_d(&pts, &flip)); diff --git a/src/pocket.rs b/src/pocket.rs index c08706a..016f713 100644 --- a/src/pocket.rs +++ b/src/pocket.rs @@ -401,8 +401,9 @@ pub fn bay_type(assets: &mut crate::assets::Assets, content: &std::path::Path, m let side = bay_side(&main, mirrored, left_hand); let text = omsi_cfg::vfs::read_text(&assets.resolve(main_rel)).map_err(|e| e.to_string())?; let sli = bay_sli(&text, side, width).ok_or_else(|| "the road type has no roadway to widen".to_string())?; - let stem: String = std::path::Path::new(&main_rel.replace('\\', "/")).file_stem().map(|s| s.to_string_lossy().to_string()).unwrap_or_default().chars().map(|c| if c.is_alphanumeric() || c == '-' || c == '_' { c } else { '_' }).collect(); - let name = format!("{stem}_bay_{}_{:.1}m", side.name(), width); + let stem = crate::omsi_name::ascii_stem(&std::path::Path::new(&main_rel.replace('\\', "/")).file_stem().map(|s| s.to_string_lossy().to_string()).unwrap_or_default()); + // (no dot but the extension's: OMSI 2 reads no `_3.5m.sli`) + let name = format!("{stem}_bay_{}_{}", side.name(), format!("{width:.1}m").replace('.', "_")); let dir = content.join("Splines").join("openMapper"); let tex_dir = dir.join("texture"); std::fs::create_dir_all(&tex_dir).map_err(|e| e.to_string())?; diff --git a/src/render/mod.rs b/src/render/mod.rs index a21a737..888b7f2 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -174,6 +174,9 @@ pub struct FrameExtras { pub highlight_tile: Option, /// Draw what the game does not show (start points, car parks, AI paths, helpers). pub show_technical: bool, + /// openMapper draws the AI's lanes as lines (the Logic tool, View > lanes): the strips of + /// the invisible AI-path splines would only double them, so they are left out (#66). + pub lanes_drawn: bool, /// Layers left out of the view: trees, other objects, splines (View menu). pub hide: [bool; 3], /// Objects drawn at another size along their own axes (a scale being dragged); zero @@ -1527,6 +1530,7 @@ impl Renderer { let mut key_parts: Vec = doc.tiles.iter().filter(|(k, _)| is_live(k)).flat_map(|(_, t)| [t.content_rev, t.terrain_rev]).collect(); key_parts.push(self.live_rev); key_parts.push(extras.show_technical as u64); + key_parts.push(extras.lanes_drawn as u64); key_parts.extend(extras.hide.map(|h| h as u64)); self.hide_splines = extras.hide[2]; key_parts.push(self.asset_epoch); @@ -2397,7 +2401,7 @@ impl Renderer { let (Some(dynamic), Some(scene)) = (&self.instances, &self.scene_buf) else { return }; // what is in view, the same for both layers let mut splines: Vec<(&GpuMesh, &Vec, u32)> = self.chunks.values().filter(|c| !self.hide_splines && f.sees(&c.bbox) && in_reach(&c.bbox)).filter_map(|c| c.mesh.as_ref().map(|m| (m, &c.materials, c.instance))).collect(); - if extras.show_technical && !self.hide_splines { + if editor_splines_shown(extras) && !self.hide_splines { splines.extend(self.editor_chunks.values().filter(|c| f.sees(&c.bbox) && in_reach(&c.bbox)).filter_map(|c| c.mesh.as_ref().map(|m| (m, &c.materials, c.instance)))); } splines.extend(self.splines.values().filter(|e| !e.hidden && !e.in_chunk && f.sees(&e.bbox) && in_reach(&e.bbox)).filter_map(|e| e.mesh.as_ref().map(|m| (m, &e.materials, e.instance)))); @@ -2873,7 +2877,13 @@ pub fn hidden_layer(model: &ObjectModel, extras: &FrameExtras) -> bool { /// road once that switch is on: `invis_street.sli` has a profile (a 3 m strip of /// `helper_path_cars_1.bmp`), and exactly that strip is what the editor shows. pub fn spline_hidden(technical: bool, extras: &FrameExtras) -> bool { - technical && !extras.show_technical || extras.hide[2] + technical && !editor_splines_shown(extras) || extras.hide[2] +} + +/// The `[onlyeditor]` splines' strips are drawn: what the game does not show is on, and the +/// lanes are not drawn as lines already. +pub fn editor_splines_shown(extras: &FrameExtras) -> bool { + extras.show_technical && !extras.lanes_drawn } /// Which merged mesh a spline belongs in. @@ -3180,6 +3190,9 @@ mod tests { assert!(spline_hidden(true, &extras), "an invisible street is out of the view by default"); extras.show_technical = true; assert!(!spline_hidden(true, &extras), "and is drawn with the editor's switch on"); + let lanes = FrameExtras { show_technical: true, lanes_drawn: true, ..Default::default() }; + assert!(spline_hidden(true, &lanes), "but not under the lanes drawn as lines (#66)"); + assert!(!spline_hidden(false, &lanes)); // (the roads' own layer still takes it away, as it takes every spline) extras.hide[2] = true; assert!(spline_hidden(true, &extras)); diff --git a/src/road_maker.rs b/src/road_maker.rs index f450d30..5cabbef 100644 --- a/src/road_maker.rs +++ b/src/road_maker.rs @@ -405,7 +405,7 @@ impl RoadSpec { /// The file name it is saved as. pub fn file_stem(&self) -> String { - let s: String = self.name.trim().chars().map(|c| if c.is_alphanumeric() || c == '-' || c == '_' { c } else { '_' }).collect(); + let s = crate::omsi_name::ascii_stem(&self.name); if s.is_empty() { "road".into() } else { s } } diff --git a/src/scaled.rs b/src/scaled.rs index ec2966f..312e18b 100644 --- a/src/scaled.rs +++ b/src/scaled.rs @@ -1,7 +1,9 @@ //! Objects at another size. OMSI 2's map says only where an object stands and how it is //! turned, so an object scaled in the view becomes a copy of its type made bigger or smaller: -//! `name~s1.5_1.5_2.sco` beside the original (in the content folder, so the original's -//! textures are found as they are), its meshes, collision mesh, lights and paths scaled. +//! `name_scaled_1500_1500_2000.sco` (the factors in thousandths) beside the original (in the +//! content folder, so the original's textures are found as they are), its meshes, collision +//! mesh, lights and paths scaled. Copies used to be called `name~s1.5_1.5_2.sco`, which +//! OMSI 2 does not read: a map that has them gets copies of the new name when it is opened. use std::fmt::Write as _; use std::path::{Path, PathBuf}; @@ -19,22 +21,55 @@ pub fn base_of(rel: &str) -> (String, DVec3) { None => ("", rel), }; let stem = file.strip_suffix(".sco").or_else(|| file.strip_suffix(".SCO")).unwrap_or(file); - if let Some((base, s)) = stem.rsplit_once("~s") { - let f: Vec = s.split('_').filter_map(|v| v.parse().ok()).collect(); + if let Some((base, s)) = stem.rsplit_once(SCALED) { + let f: Vec = s.split('_').filter_map(thousandths_of).collect(); if f.len() == 3 { return (format!("{dir}{base}.sco"), DVec3::new(f[0], f[1], f[2])); } } + if let Some((base, s)) = old_scale(stem) { + return (format!("{dir}{base}.sco"), s); + } (rel.to_string(), DVec3::ONE) } -fn scaled_name(base_rel: &str, s: DVec3) -> String { - let stem = base_rel.strip_suffix(".sco").unwrap_or(base_rel); +/// What comes between the original's name and the factors. +const SCALED: &str = "_scaled_"; + +/// The base and the scale of a copy of the old name (`lamp~s1.5_2_0.25`). +fn old_scale(stem: &str) -> Option<(&str, DVec3)> { + let (base, s) = stem.rsplit_once("~s")?; + let f: Vec = s.split('_').filter_map(|v| v.parse().ok()).collect(); + (f.len() == 3).then(|| (base, DVec3::new(f[0], f[1], f[2]))) +} + +/// A factor as the name writes it: thousandths, `m` for a negative one (a mirrored copy). +fn thousandths(v: f64) -> String { + let n = (v * 1000.0).round() as i64; + if n < 0 { format!("m{}", -n) } else { n.to_string() } +} + +fn thousandths_of(s: &str) -> Option { + let (sign, digits) = match s.strip_prefix('m') { + Some(d) => (-1.0, d), + None => (1.0, s), + }; + (!digits.is_empty() && digits.bytes().all(|b| b.is_ascii_digit())).then(|| sign * digits.parse::().ok().unwrap_or(0.0) / 1000.0) +} + +/// The factors as people read them (`1.5×2×0.25`). +fn shown(s: DVec3) -> String { let n = |v: f64| { let t = format!("{v:.3}"); t.trim_end_matches('0').trim_end_matches('.').to_string() }; - format!("{stem}~s{}_{}_{}.sco", n(s.x), n(s.y), n(s.z)) + format!("{}×{}×{}", n(s.x), n(s.y), n(s.z)) +} + +/// The copy's name: one dot, ASCII after the original's own name, as OMSI 2 reads it. +fn scaled_name(base_rel: &str, s: DVec3) -> String { + let stem = base_rel.strip_suffix(".sco").unwrap_or(base_rel); + format!("{stem}{SCALED}{}_{}_{}.sco", thousandths(s.x), thousandths(s.y), thousandths(s.z)) } /// The type for an object of `rel` scaled by `factor` along its own axes (on top of any @@ -55,7 +90,7 @@ pub fn variant(roots: &Roots, rel: &str, factor: DVec3) -> anyhow::Result anyhow::Result num(total.z), Scale::Avg => num(avg), Scale::AvgXy => num(avg_xy), - Scale::Name => format!("{} (×{})", v.trim(), suffix.replace('_', "×")), + Scale::Name => format!("{} (×{})", v.trim(), shown(total)), Scale::Mesh => { let file = v.trim(); match scale_mesh(&src_dir, &out_dir, file, total, &suffix) { @@ -110,6 +145,43 @@ pub fn variant(roots: &Roots, rel: &str, factor: DVec3) -> anyhow::Result usize { + let mut made: std::collections::HashMap> = Default::default(); + let mut renamed = 0; + for t in doc.tiles.values_mut() { + let mut changed = false; + let files = t.tile.objects.iter_mut().chain(t.tile.attach_objects.iter_mut()).map(|o| &mut o.file).chain(t.tile.spline_attachments.iter_mut().map(|a| &mut a.file)); + for file in files { + let (dir, name) = file.rsplit_once('\\').unwrap_or(("", file.as_str())); + let stem = name.strip_suffix(".sco").or_else(|| name.strip_suffix(".SCO")).unwrap_or(name); + let Some((base, s)) = old_scale(stem) else { continue }; + let base = if dir.is_empty() { format!("{base}.sco") } else { format!("{dir}\\{base}.sco") }; + let new = made.entry(file.clone()).or_insert_with(|| match variant(roots, &base, s) { + Ok(n) => Some(n), + Err(e) => { + log::warn!("{file}: no copy OMSI 2 reads could be made: {e}"); + None + } + }); + if let Some(n) = new { + *file = n.clone(); + renamed += 1; + changed = true; + } + } + if changed { + t.touch_content(); + } + } + if renamed > 0 { + log::info!("{renamed} scaled objects named as OMSI 2 reads them ({} types)", made.values().flatten().count()); + } + renamed +} + #[derive(Clone, Copy)] enum Scale { Keep, @@ -138,8 +210,8 @@ fn scale_mesh(src_dir: &Path, out_dir: &Path, file: &str, s: DVec3, suffix: &str let in_model = omsi_cfg::resolve_path(&omsi_cfg::resolve_path(src_dir, "model"), file); let path: PathBuf = if omsi_cfg::vfs::is_file(&in_model) { in_model } else { omsi_cfg::resolve_path(src_dir, file) }; let m = omsi_o3d::load_mesh(&path)?; - let stem = Path::new(&file.replace('\\', "/")).file_stem().map(|f| f.to_string_lossy().to_string()).unwrap_or_else(|| "mesh".into()); - let name = format!("{stem}~s{suffix}.x"); + let stem = crate::editable::safe_name(&Path::new(&file.replace('\\', "/")).file_stem().map(|f| f.to_string_lossy().to_string()).unwrap_or_else(|| "mesh".into())); + let name = format!("{stem}{SCALED}{suffix}.x"); let dir = out_dir.join("model"); std::fs::create_dir_all(&dir)?; // (mesh files are in Direct3D's frame: y is up, z forward) @@ -212,11 +284,18 @@ mod tests { #[test] fn a_scaled_name_reads_back_as_its_base_and_scale() { let n = scaled_name("Sceneryobjects\\A\\lamp.sco", DVec3::new(1.5, 2.0, 0.25)); - assert_eq!(n, "Sceneryobjects\\A\\lamp~s1.5_2_0.25.sco"); + assert_eq!(n, "Sceneryobjects\\A\\lamp_scaled_1500_2000_250.sco"); + assert!(crate::omsi_name::readable(&n), "OMSI 2 reads it: {n}"); let (b, s) = base_of(&n); assert_eq!(b, "Sceneryobjects\\A\\lamp.sco"); assert_eq!(s, DVec3::new(1.5, 2.0, 0.25)); assert_eq!(base_of("Sceneryobjects\\A\\lamp.sco").1, DVec3::ONE); + // (a mirrored copy) + assert_eq!(base_of(&scaled_name("Sceneryobjects\\A\\lamp.sco", DVec3::new(-1.0, 1.0, 1.0))).1, DVec3::new(-1.0, 1.0, 1.0)); + // (a copy of the old name, which OMSI 2 did not read, is still known for one) + assert_eq!(base_of("Sceneryobjects\\A\\comercio18~s1.876_1.436_1.876.sco"), ("Sceneryobjects\\A\\comercio18.sco".to_string(), DVec3::new(1.876, 1.436, 1.876))); + // (an object whose own name says "scaled" is not taken for a copy) + assert_eq!(base_of("Sceneryobjects\\A\\tree_scaled_big.sco").1, DVec3::ONE); } #[test] @@ -234,16 +313,31 @@ mod tests { std::fs::write(obj.join("box.sco"), omsi_cfg::encode_text(&sco.replace('\n', "\r\n"))).unwrap(); let roots = Roots { omsi: omsi.clone(), content: content.clone() }; let rel = variant(&roots, "Sceneryobjects\\T\\box.sco", DVec3::new(2.0, 2.0, 2.0)).unwrap(); - assert_eq!(rel, "Sceneryobjects\\T\\box~s2_2_2.sco"); + assert_eq!(rel, "Sceneryobjects\\T\\box_scaled_2000_2000_2000.sco"); let path = omsi_cfg::resolve_path(&content, &rel); let text = omsi_cfg::decode_text(&std::fs::read(&path).unwrap()); - assert!(text.contains("box~s2_2_2.x"), "{text}"); + assert!(text.contains("box_scaled_2000_2000_2000.x"), "{text}"); + assert!(text.contains("Box (×2×2×2)"), "{text}"); assert!(text.contains("\r\n2\r\n4\r\n6\r\n"), "{text}"); - let m = omsi_o3d::load_mesh(&content.join("Sceneryobjects/T/model/box~s2_2_2.x")).unwrap(); + let m = omsi_o3d::load_mesh(&content.join("Sceneryobjects/T/model/box_scaled_2000_2000_2000.x")).unwrap(); let hi = m.vertices.iter().map(|v| v.position.y).fold(f32::MIN, f32::max); assert!((hi - 2.0).abs() < 1e-4); // scaled again by a half: the original back assert_eq!(variant(&roots, &rel, DVec3::splat(0.5)).unwrap(), "Sceneryobjects\\T\\box.sco"); + + // a map saved by an earlier openMapper names a copy OMSI 2 cannot read: opened, it + // names one it can, made beside it + let mut doc = crate::selection::tests::flat_map(1); + let old = "Sceneryobjects\\T\\box~s1.5_1.5_1.5.sco"; + doc.tiles.get_mut(&(0, 0)).unwrap().tile.objects.push(omsi_map::MapObject { file: old.into(), id: 1, ..Default::default() }); + doc.tiles.get_mut(&(0, 0)).unwrap().dirty = false; + assert_eq!(renew_old_copies(&roots, &mut doc), 1); + let t = &doc.tiles[&(0, 0)]; + assert_eq!(t.tile.objects[0].file, "Sceneryobjects\\T\\box_scaled_1500_1500_1500.sco"); + assert!(crate::omsi_name::readable(&t.tile.objects[0].file)); + assert!(omsi_cfg::resolve_path(&content, &t.tile.objects[0].file).is_file(), "the copy is made"); + assert!(t.dirty, "the tile is to be saved with the new name"); + assert_eq!(renew_old_copies(&roots, &mut doc), 0, "once"); let _ = std::fs::remove_dir_all(&dir); } } diff --git a/src/stops.rs b/src/stops.rs index 4254213..fd64554 100644 --- a/src/stops.rs +++ b/src/stops.rs @@ -117,17 +117,33 @@ impl StopKind { } } - /// The kind a station's `[profile_otherstopping]` value stands for. + /// What a station's `[profile_otherstopping]` value has the bus do, in OMSI 2's words. pub fn of_serve(v: i32) -> Option<&'static str> { match v { - 0 => Some(tr("when wanted", "по требованию")), - 1 | 4 => Some(tr("always", "всегда")), - 2 => Some(tr("drive through", "проезжает")), - 3 => Some(tr("when early", "если раньше")), + 0 => Some(tr("On demand", "По требованию")), + 1 => Some(tr("Always", "Всегда")), + 2 => Some(tr("Not served (checkpoint)", "Не обслуживается (контрольная точка)")), + 3 => Some(tr("Wait for departure time", "Ждать времени отправления")), + 4 => Some(tr("Always + wait for departure time", "Всегда + ждать времени отправления")), _ => None, } } + /// The `[profile_otherstopping]` values in the order OMSI 2's editor lists them. + pub const SERVE: [i32; 5] = [1, 3, 2, 0, 4]; + + /// What the value does, said in full. + pub fn serve_hint(v: i32) -> &'static str { + match v { + 0 => tr("The bus stops only when somebody waits or wants to get off (the game's default)", "Автобус останавливается, только если кто-то ждёт или хочет выйти (так по умолчанию в игре)"), + 1 => tr("The bus always stops here", "Автобус всегда здесь останавливается"), + 2 => tr("The bus drives past without stopping: the stop only marks the way (a checkpoint)", "Автобус проезжает, не останавливаясь: остановка лишь отмечает путь (контрольная точка)"), + 3 => tr("The bus stops only when it is early, and waits there for its departure time", "Автобус останавливается, только если идёт раньше времени, и ждёт там времени отправления"), + 4 => tr("The bus always stops here, and when it is early it waits for its departure time", "Автобус всегда здесь останавливается, а если раньше времени: ждёт времени отправления"), + _ => "", + } + } + /// The people a new stop of this kind gets: (most waiting, fewest, getting off). pub fn defaults(self) -> (i32, i32, i32) { match self { diff --git a/src/timetable/mod.rs b/src/timetable/mod.rs index 9e6b973..74b8740 100644 --- a/src/timetable/mod.rs +++ b/src/timetable/mod.rs @@ -6,7 +6,9 @@ pub mod caruse; pub mod network; +pub mod profile; pub mod route; +pub mod way; use std::collections::BTreeSet; use std::path::Path; @@ -49,8 +51,16 @@ pub struct Timetable { pub car_use: Vec, car_changed: BTreeSet, car_removed: BTreeSet, + /// Trips whose paths were picked by hand (lower-case names): their way is kept as it is + /// when their stops change, not found again. Their `.ttr` says so in a line the game + /// passes over ([`BY_HAND`]). + hand: BTreeSet, } +/// The line a track picked by hand carries in its header (text outside a `[keyword]` block, +/// which OMSI 2 and openOMSI pass over). +pub const BY_HAND: &str = "Paths picked by hand in openMapper"; + fn key(name: &str) -> String { name.to_lowercase() } @@ -70,7 +80,28 @@ impl Timetable { // (in the order of the days, as the Lines window lists them) calendar.holidays.sort_by_key(|h| h.date); calendar.ranges.sort_by_key(|r| r.start); - Timetable { stops: d.bus_stops, links: d.stn_links, trips: d.trips, tracks: d.tracks, lines: d.lines, order: order.to_vec(), calendar, car_use: caruse::load_dir(dir), ..Default::default() } + let hand = d.tracks.iter().filter(|t| marked_by_hand(&t.path)).map(|t| key(&track_name(t))).collect(); + Timetable { stops: d.bus_stops, links: d.stn_links, trips: d.trips, tracks: d.tracks, lines: d.lines, order: order.to_vec(), calendar, car_use: caruse::load_dir(dir), hand, ..Default::default() } + } + + /// The trip's paths were picked by hand. + pub fn by_hand(&self, trip: &str) -> bool { + self.hand.contains(&key(trip)) + } + + /// The trip's way as picked by hand (`track`, and the station links between its stops + /// along it), or (None) found along the roads again from now on. + pub fn set_by_hand(&mut self, trip: &str, way: Option<(Vec, Vec)>) { + match way { + Some((track, links)) => { + self.hand.insert(key(trip)); + self.set_route(trip, track, links); + } + None => { + self.hand.remove(&key(trip)); + self.touch_route(trip); + } + } } pub fn trip(&self, name: &str) -> Option<&Trip> { @@ -140,7 +171,8 @@ impl Timetable { /// The same lines, trips, tours and stops (what the Lines window edits; not the routes /// found for them or what is still to be saved). pub fn same_content(&self, o: &Timetable) -> bool { - self.lines == o.lines && self.trips == o.trips && self.stops == o.stops && self.calendar == o.calendar && self.car_use == o.car_use + let hand_tracks = |t: &Timetable| -> Vec { t.tracks.iter().filter(|x| t.hand.contains(&key(&track_name(x)))).cloned().collect() }; + self.lines == o.lines && self.trips == o.trips && self.stops == o.stops && self.calendar == o.calendar && self.car_use == o.car_use && self.hand == o.hand && hand_tracks(self) == hand_tracks(o) } /// A new line (its name made unique). @@ -198,6 +230,9 @@ impl Timetable { if let Some(track) = self.track(&t).map(|x| x.entries.clone()) { self.tracks.push(Track { path: format!("{copy}.ttr").into(), entries: track }); self.changed.insert(key(&format!("{copy}.ttr"))); + if self.by_hand(&t) { + self.hand.insert(key(©)); + } } else { self.reroute.insert(key(©)); } @@ -266,6 +301,9 @@ impl Timetable { t.path = format!("{new}.ttr").into(); self.changed.insert(key(&format!("{new}.ttr"))); } + if self.hand.remove(&key(old)) { + self.hand.insert(key(new)); + } for l in &mut self.lines { let mut hit = false; for t in l.tours.iter_mut().flat_map(|t| t.trips.iter_mut()) { @@ -304,6 +342,7 @@ impl Timetable { self.touch_line(&l); } self.reroute.remove(&key(name)); + self.hand.remove(&key(name)); self.mark(); } @@ -482,7 +521,7 @@ pub fn plan(tt: &mut Timetable, map_dir: &Path, order: &[TileKey]) -> Vec { let text = match ext { "ttl" => tt.lines.iter().find(|l| key(&l.name) == stem).map(|l| (l.name.clone(), line_text(l))), "ttp" => tt.trips.iter().find(|t| key(&t.name) == stem).map(|t| (t.name.clone(), trip_text(t))), - "ttr" => tt.tracks.iter().find(|t| key(&track_name(t)) == stem).map(|t| (track_name(t), track_text(t))), + "ttr" => tt.tracks.iter().find(|t| key(&track_name(t)) == stem).map(|t| (track_name(t), track_text_of(t, tt.hand.contains(stem)))), _ => None, }; if let Some((name, text)) = text { @@ -543,6 +582,18 @@ pub fn save_to(tt: &mut Timetable, map_dir: &Path, order: &[TileKey]) -> anyhow: Ok(()) } +/// The track file says its paths were picked by hand ([`BY_HAND`]). +fn marked_by_hand(path: &Path) -> bool { + let Ok(b) = std::fs::read(path) else { return false }; + let text = if b.starts_with(&[0xFF, 0xFE]) { + String::from_utf16_lossy(&b[2..].chunks_exact(2).map(|c| u16::from_le_bytes([c[0], c[1]])).collect::>()) + } else { + String::from_utf8_lossy(&b).into_owned() + }; + // (in the header, before the first entry) + text.split("[track_entry]").next().unwrap_or_default().contains(BY_HAND) +} + /// A file of the folder by its lower-case name. fn find_file(dir: &Path, lower: &str) -> Option { std::fs::read_dir(dir).ok()?.flatten().map(|e| e.path()).find(|p| p.file_name().map(|n| n.to_string_lossy().to_lowercase() == lower).unwrap_or(false)) @@ -645,7 +696,16 @@ pub fn trip_text(t: &Trip) -> String { } pub fn track_text(t: &Track) -> String { + track_text_of(t, false) +} + +/// The track's text; picked by hand, it says so in its header. +pub fn track_text_of(t: &Track, by_hand: bool) -> String { let mut o = header("Time Table Track File"); + if by_hand { + o.push_str(BY_HAND); + o.push_str("\n\n"); + } for (i, e) in t.entries.iter().enumerate() { o.push_str(&format!(" {i}:\n[track_entry]\n")); for (k, v) in e.values.iter().enumerate() { diff --git a/src/timetable/network.rs b/src/timetable/network.rs index 0628cfd..b899a21 100644 --- a/src/timetable/network.rs +++ b/src/timetable/network.rs @@ -7,7 +7,7 @@ use std::collections::HashMap; use std::path::PathBuf; use std::sync::Arc; -use glam::{DVec2, DVec3, Vec3}; +use glam::{DVec2, DVec3}; use omsi_geometry::SplineCurve; use omsi_scenery::PathDef; @@ -18,6 +18,9 @@ use crate::place::Pose; const LINK: f64 = 1.5; /// How far the headings at a link may differ (degrees). const LINK_TURN: f64 = 40.0; +/// How far apart in height a lane's end and the next one's start may lie (m), as openOMSI +/// links them: a road object's lane a little off the road's still runs on into it. +pub(crate) const LINK_RISE: f64 = 3.0; /// How far apart two lanes of a spline may lie for a bus to change between them (m). const LANE_CHANGE_WIDTH: f64 = 5.0; @@ -30,6 +33,8 @@ const RAIL: i32 = 2; #[derive(Debug, Default)] pub struct FileInfo { pub paths: Vec, + /// An object's `[crossing_heightdeformation]` field, which its paths are draped onto. + pub deform: Option, pub abs_height: bool, pub is_bus_stop: bool, } @@ -65,7 +70,7 @@ impl Files { if key.ends_with(".sli") { omsi_scenery::Spline::load(&p).ok().map(|s| FileInfo { paths: s.paths, ..Default::default() }) } else { - omsi_scenery::SceneryObject::load(&p).ok().map(|o| FileInfo { abs_height: o.absolute_height(), is_bus_stop: o.is_bus_stop, paths: o.paths }) + omsi_scenery::SceneryObject::load(&p).ok().map(|o| FileInfo { abs_height: o.absolute_height(), is_bus_stop: o.is_bus_stop, deform: crate::object_paths::load_field(&o, &p), paths: o.paths }) } }); let info = info.map(Arc::new); @@ -237,12 +242,7 @@ impl Network { continue; } let n = (c.length / 2.0).ceil().clamp(1.0, 200.0) as usize; - let pts = (0..=n) - .map(|i| { - let q = c.point_at(c.length * i as f64 / n as f64); - pose.pos + pose.rot.transform_vector3(Vec3::new(q.x as f32, q.y as f32, q.z as f32)).as_dvec3() - }) - .collect(); + let pts = (0..=n).map(|i| crate::object_paths::world_point(&c, c.length * i as f64 / n as f64, &pose, info.deform.as_ref())).collect(); net.add(PathKey { tile: *k, id: o.id, path: pi }, pts, c.length, internal + pi, p.direction, (false, p.kind == RAIL)); } internal += info.paths.len(); @@ -291,13 +291,23 @@ impl Network { continue; } let d = b.pts[0] - end; - if d.truncate().length() <= LINK && d.z.abs() < 2.0 && h.dot(b.heading_at_start()) >= cos { + if d.truncate().length() <= LINK && d.z.abs() < LINK_RISE && h.dot(b.heading_at_start()) >= cos { next[i].push(j); } } } } } + // a lane reached over a piece shorter than a link spans (a junction's connector) is + // not linked straight on as well: the way drives the piece, it does not jump over it + // to the path after it (#122). (Two branches that start a little apart stay linked + // both, as OMSI 2's own station links have them.) + let skips: Vec> = (0..self.lanes.len()) + .map(|i| next[i].iter().copied().filter(|&b| next[i].iter().any(|&s| s != b && self.lanes[s].length() <= LINK * 2.0 && next[s].contains(&b))).collect()) + .collect(); + for (n, skip) in next.iter_mut().zip(skips) { + n.retain(|b| !skip.contains(b)); + } for (l, n) in self.lanes.iter_mut().zip(next) { l.next = n; } diff --git a/src/timetable/profile.rs b/src/timetable/profile.rs new file mode 100644 index 0000000..fbb80a3 --- /dev/null +++ b/src/timetable/profile.rs @@ -0,0 +1,99 @@ +//! A trip's time profiles (`[profile]` of its `.ttp`): each its time from the first stop to +//! the last and the times fixed at stops between, so the time from one stop to the next can +//! be set. A tour's departure names the profile it runs to by its place in the list. + +use omsi_timetable::TripProfile; + +use super::{stop_times, Timetable}; + +/// The time from stop `i - 1` to stop `i` of profile `p` set to `m` minutes (`legs`: the +/// metres between the stops): the stop before keeps its time, stop `i` and every time after +/// it move by the difference, the trip's time with them. The other stops' legs stay as they +/// were. +pub fn set_leg(p: &mut TripProfile, n: usize, legs: &[f64], i: usize, m: f32) { + if i == 0 || i >= n { + return; + } + let times = stop_times(n, legs, p); + let shown = |k: usize| if k + 1 == n { times[k].0 } else { times[k].1 }; + let start = times[i - 1].1; + let m = m.max(0.0); + let delta = start + m - shown(i); + if delta.abs() < 1e-4 { + return; + } + // (the stop before fixed where it is, so that the leg is the one set) + if i - 1 > 0 && !times[i - 1].2 { + super::set_stop_time(p, n, i - 1, Some(round(times[i - 1].1))); + } + for k in i..n { + if times[k].2 || (k == i && k + 1 < n) { + super::set_stop_time(p, n, k, Some(round(shown(k) + delta))); + } + } + p.factor = round(times[n - 1].0 + delta).max(0.1); + // (the last stop's time is the trip's) + if let Some(a) = p.man_arr_time.iter_mut().find(|a| a.0 as usize + 1 == n) { + a.1 = p.factor; + } +} + +/// The trip's time of profile `p` set to `m` minutes: the times fixed at the stops are kept, +/// the last stop's with it. +pub fn set_total(p: &mut TripProfile, n: usize, m: f32) { + p.factor = m; + let last = n as i32 - 1; + for a in p.man_arr_time.iter_mut().filter(|a| a.0 == last) { + a.1 = m; + } +} + +/// Minutes kept to a hundredth (the file keeps three decimals). +fn round(m: f32) -> f32 { + (m * 100.0).round() / 100.0 +} + +impl Timetable { + /// A new profile of the trip, a copy of profile `from` under a new name: its place. + pub fn add_profile(&mut self, trip: &str, from: usize) -> Option { + let t = self.trip_mut(trip)?; + let mut p = t.profiles.get(from).cloned().unwrap_or_else(|| TripProfile { name: "standard".into(), factor: 10.0, ..Default::default() }); + let base = p.name.trim().to_string(); + p.name = (2..).map(|k| format!("{base} {k}")).find(|n| !t.profiles.iter().any(|x| x.name.trim().eq_ignore_ascii_case(n))).unwrap(); + t.profiles.push(p); + let i = t.profiles.len() - 1; + self.touch_trip(trip); + Some(i) + } + + /// Take the trip's profile `i` away (not its last one): the departures that ran to it run + /// to its first, those to a later one keep theirs. + pub fn remove_profile(&mut self, trip: &str, i: usize) { + let Some(t) = self.trip_mut(trip) else { return }; + if t.profiles.len() < 2 || i >= t.profiles.len() { + return; + } + t.profiles.remove(i); + self.touch_trip(trip); + let mut touched = Vec::new(); + for l in &mut self.lines { + let mut hit = false; + for x in l.tours.iter_mut().flat_map(|t| t.trips.iter_mut()).filter(|x| x.trip.eq_ignore_ascii_case(trip)) { + let k = x.profile.max(0) as usize; + if k == i { + x.profile = 0; + hit = true; + } else if k > i { + x.profile -= 1; + hit = true; + } + } + if hit { + touched.push(l.name.clone()); + } + } + for l in touched { + self.touch_line(&l); + } + } +} diff --git a/src/timetable/route.rs b/src/timetable/route.rs index ee626e8..d032008 100644 --- a/src/timetable/route.rs +++ b/src/timetable/route.rs @@ -17,7 +17,7 @@ const WRONG_SIDE: f64 = 25.0; /// Lanes a stop is tried on. const CANDIDATES: usize = 4; /// What changing to the lane beside costs (m). -const LANE_CHANGE: f64 = 15.0; +pub(crate) const LANE_CHANGE: f64 = 15.0; /// What driving a path against its direction costs: so many times its length and more. const AGAINST_FACTOR: f64 = 4.0; const AGAINST: f64 = 150.0; @@ -59,6 +59,9 @@ pub struct Route { pub against: Vec, /// What it drives on. pub ways: Option, + /// Its paths were picked by hand: the way runs on all of them, before the first stop + /// and after the last as well. + pub by_hand: bool, } #[derive(Debug, Clone, PartialEq)] @@ -69,6 +72,8 @@ pub enum Problem { NoRoad(usize), /// No way from this stop to the next. NoWay(usize), + /// The way picked by hand does not pass the stop (after the one before). + OffWay(usize), } impl Route { @@ -83,6 +88,12 @@ impl Route { /// The route's line in the world, from the first stop to the last (for the view). pub fn polyline(&self, net: &Network) -> Vec { let mut out = Vec::new(); + if self.by_hand { + for &l in &self.lanes { + out.extend(net.lanes[l].pts.iter().copied()); + } + return out; + } let (first, last) = match (self.stops.first(), self.stops.last()) { (Some(a), Some(b)) => (*a, *b), _ => return out, diff --git a/src/timetable/tests.rs b/src/timetable/tests.rs index d315c9e..031532f 100644 --- a/src/timetable/tests.rs +++ b/src/timetable/tests.rs @@ -528,3 +528,178 @@ fn a_tram_trip_runs_on_its_track() { tt.set_route(&trip, r.track(&net, &[tile]), r.links(&net, &[tile], &[10, 11])); assert_eq!(route::ways_of(&tt, &trip, &net, &[tile]), Some(route::Ways::Rail)); } + +/// A road object's lane that ends a couple of metres off the road it meets (laid a little +/// under it, as Städtedreieck's are) still runs on into the road, as openOMSI links them +/// (#120); a road on a bridge over it, 6 m up, does not. +#[test] +fn a_lane_a_little_off_the_road_in_height_runs_on_into_it() { + let tile = (0, 0); + let mut net = Network::default(); + let north = |y0: f64, y1: f64, z: f64| vec![DVec3::new(0.0, y0, z), DVec3::new(0.0, y1, z)]; + net.add(PathKey { tile, id: 1, path: 0 }, north(0.0, 20.0, -2.5), 20.0, 0, 0, (false, false)); + net.add(PathKey { tile, id: 2, path: 0 }, north(20.0, 120.0, 0.0), 100.0, 1, 0, (true, false)); + net.add(PathKey { tile, id: 3, path: 0 }, north(20.0, 120.0, 6.0), 100.0, 2, 0, (true, false)); + net.link(); + let first = net.by_key[&PathKey { tile, id: 1, path: 0 }][0]; + let ids: Vec = net.lanes[first].next.iter().map(|&l| net.lanes[l].key.id).collect(); + assert_eq!(ids, vec![2]); +} + +/// A road north: `A` to y 100, a 1 m piece `S` (a junction's connector), `B` on from y 101 +/// to a junction at y 120 and a detour `D` beside it; on past the junction, and a road +/// leading into `A` from the south. +fn junction_net() -> (Network, std::collections::HashMap) { + let tile = (0, 0); + let mut net = Network::default(); + let p = |pts: &[(f64, f64)]| pts.iter().map(|q| DVec3::new(q.0, q.1, 0.0)).collect::>(); + // (one way each: direction 0, the way the points run) + let mut add = |id: i64, pts: Vec, spline: bool| { + let len: f64 = pts.windows(2).map(|w| (w[1] - w[0]).length()).sum(); + net.add(PathKey { tile, id, path: 0 }, pts, len, id as usize, 0, (spline, false)); + }; + add(1, p(&[(0.0, 0.0), (0.0, 100.0)]), true); + add(2, p(&[(0.0, 100.0), (0.0, 101.0)]), false); + add(3, p(&[(0.0, 101.0), (0.0, 120.0)]), true); + add(4, p(&[(0.0, 101.0), (2.0, 106.0), (2.0, 115.0), (0.0, 120.0)]), false); + add(5, p(&[(0.0, 120.0), (0.0, 220.0)]), true); + add(6, p(&[(0.0, -100.0), (0.0, 0.0)]), true); + net.link(); + let ids = (1..=6).map(|id| (id, net.by_key[&PathKey { tile, id, path: 0 }][0])).collect(); + (net, ids) +} + +/// A short piece between two paths is driven, not jumped over to the path after it: the +/// way found joins all along, as the game's bus needs it to (#122). +#[test] +fn a_short_connector_is_driven_not_jumped() { + let (net, id) = junction_net(); + // (path 3 starts 1 m past path 1's end, within the 1.5 m a link may span) + assert_eq!(net.lanes[id[&1]].next, vec![id[&2]]); + let at = |pts: &[(f64, f64)]| pts.iter().map(|p| Some(DVec3::new(p.0, p.1, 0.0))).collect::>(); + let r = route::find(&net, &at(&[(2.5, 50.0), (2.5, 180.0)]), false, None); + assert!(r.ok(), "{:?}", r.problems); + let ids: Vec = r.lanes.iter().map(|l| net.lanes[*l].key.id).collect(); + assert_eq!(ids, vec![1, 2, 3, 5]); + assert!(way::gaps(&net, &r.lanes).is_empty()); + // the track read back names the same lanes + let track = r.track(&net, &[(0, 0)]); + let back: Vec> = way::lanes_of_track(&net, &track, &[(0, 0)]); + assert_eq!(back, r.lanes.iter().map(|l| Some(*l)).collect::>()); + // a way that leaves the piece out breaks where it is + let broken = vec![id[&1], id[&3], id[&5]]; + let g = way::gaps(&net, &broken); + assert_eq!(g.len(), 1); + assert_eq!(g[0].0, 0); + assert!((g[0].1 - 1.0).abs() < 1e-6); +} + +/// The way picked path by path as in OMSI 2's editor: a path clicked after the end comes +/// with the paths to it, one before the start goes first, another branch at a junction +/// takes the place of the one it goes round, and a path of the way clicked is taken out. +#[test] +fn a_way_picked_by_hand() { + let (net, id) = junction_net(); + let ids = |lanes: &[usize]| lanes.iter().map(|l| net.lanes[*l].key.id).collect::>(); + let mut w = way::with_lane(&net, &[], id[&1]); + assert_eq!(ids(&w), vec![1]); + // after the end: the connector and the straight way filled in + w = way::with_lane(&net, &w, id[&5]); + assert_eq!(ids(&w), vec![1, 2, 3, 5]); + // before the start (a way before the first stop) + w = way::with_lane(&net, &w, id[&6]); + assert_eq!(ids(&w), vec![6, 1, 2, 3, 5]); + // the detour in place of the straight way + w = way::with_lane(&net, &w, id[&4]); + assert_eq!(ids(&w), vec![6, 1, 2, 4, 5]); + assert!(way::gaps(&net, &w).is_empty()); + // the first taken out again + w = way::with_lane(&net, &w, id[&6]); + assert_eq!(ids(&w), vec![1, 2, 4, 5]); + // the stops found along it, the way running on past the last + let at = |pts: &[(f64, f64)]| pts.iter().map(|p| Some(DVec3::new(p.0, p.1, 0.0))).collect::>(); + let r = way::along(&net, &w, &at(&[(2.5, 50.0), (2.5, 150.0)]), false); + assert!(r.ok() && r.by_hand, "{:?}", r.problems); + assert_eq!(r.stops.iter().map(|s| s.0).collect::>(), vec![0, 3]); + assert!((r.legs[0] - (50.0 + 1.0 + net.lanes[id[&4]].length() + 30.0)).abs() < 1e-6, "{:?}", r.legs); + // a stop the way does not pass + let r = way::along(&net, &w, &at(&[(2.5, 50.0), (40.0, 150.0)]), false); + assert_eq!(r.problems, vec![route::Problem::OffWay(1)]); +} + +/// A trip's paths picked by hand are kept as they are when saved and read again: its track +/// says so in a line the game passes over, and it reads back the same. +#[test] +fn a_track_picked_by_hand_reads_back() { + let mut tt = Timetable::default(); + let out = scratch("byhand"); + let line = tt.add_line("4"); + let trip = tt.add_trip(&line, "4_A", vec![1, 2]); + let entries = vec![TrackEntry { values: vec![10.0, 0.0, 0.0, 3.0, 50.0, 0.0] }, TrackEntry { values: vec![11.0, 1.0, 0.0, 7.0, 12.5, 0.0] }]; + tt.set_by_hand(&trip, Some((entries.clone(), Vec::new()))); + assert!(tt.by_hand(&trip)); + save_to(&mut tt, &out, &[]).unwrap(); + let text = std::fs::read_to_string(out.join("TTData").join("4_A.ttr")).unwrap(); + assert!(text.contains(BY_HAND)); + let back = TimetableData::load(&out); + assert!(back.errors.is_empty(), "{:?}", back.errors); + assert_eq!(back.tracks[0].entries, entries); + let again = Timetable::load(&out, &[]); + assert!(again.by_hand("4_a")); + // renamed, it stays picked by hand; found automatically again, it is not + tt.rename_trip(&trip, "4_B").unwrap(); + assert!(tt.by_hand("4_B") && !tt.by_hand("4_A")); + tt.set_by_hand("4_B", None); + assert!(!tt.by_hand("4_B") && tt.reroute.contains("4_b")); + let _ = std::fs::remove_dir_all(&out); +} + +/// The time from stop to stop set in a profile: the stop before keeps its time, the times +/// after move along and the trip's time with them; a second profile, and the departures +/// that ran to a profile taken away run to the first (#116). +#[test] +fn the_time_from_stop_to_stop() { + let mut p = omsi_timetable::TripProfile { name: "standard".into(), factor: 12.0, ..Default::default() }; + let legs = [100.0, 100.0, 100.0]; + // 0, 4, 8, 12: the leg into stop 2 from 4 to 6 minutes + profile::set_leg(&mut p, 4, &legs, 2, 6.0); + let t: Vec = stop_times(4, &legs, &p).iter().map(|x| x.0).collect(); + assert_eq!(t, vec![0.0, 4.0, 10.0, 14.0]); + assert_eq!(p.factor, 14.0); + // the last leg: the trip's time follows, nothing else moves + profile::set_leg(&mut p, 4, &legs, 3, 1.5); + let t: Vec = stop_times(4, &legs, &p).iter().map(|x| x.0).collect(); + assert_eq!(t, vec![0.0, 4.0, 10.0, 11.5]); + assert_eq!(p.factor, 11.5); + // the first leg: the later stops move with it + profile::set_leg(&mut p, 4, &legs, 1, 2.0); + let t: Vec = stop_times(4, &legs, &p).iter().map(|x| x.0).collect(); + assert_eq!(t, vec![0.0, 2.0, 8.0, 9.5]); + profile::set_total(&mut p, 4, 20.0); + assert_eq!(stop_times(4, &legs, &p)[3].0, 20.0); + // a second profile; the departures follow when one is taken away + let mut tt = Timetable::default(); + let line = tt.add_line("9"); + let trip = tt.add_trip(&line, "9_A", vec![1, 2, 3, 4]); + tt.trip_mut(&trip).unwrap().profiles[0] = p.clone(); + assert_eq!(tt.add_profile(&trip, 0), Some(1)); + assert_eq!(tt.add_profile(&trip, 0), Some(2)); + let names: Vec = tt.trip(&trip).unwrap().profiles.iter().map(|p| p.name.clone()).collect(); + assert_eq!(names, vec!["standard", "standard 2", "standard 3"]); + tt.lines[0].tours.push(omsi_timetable::Tour { number: "1".into(), ai_group: String::new(), extra: ALL_DAYS.to_string(), trips: (0..3).map(|k| omsi_timetable::TourTrip { trip: trip.clone(), profile: k, departure: 300.0 + k as f32 * 30.0 }).collect() }); + tt.remove_profile(&trip, 1); + assert_eq!(tt.lines[0].tours[0].trips.iter().map(|x| x.profile).collect::>(), vec![0, 0, 1]); + // the profiles as OMSI 2 reads them + let back = omsi_timetable::Trip::parse(&omsi_cfg::CfgFile::from_str(format!("{trip}.ttp"), &trip_text(tt.trip(&trip).unwrap()))); + assert_eq!(back.profiles, tt.trip(&trip).unwrap().profiles); +} + +/// The ways OMSI 2 serves a stop, each said in its own words. +#[test] +fn every_way_a_stop_is_served_has_a_name() { + let mut names: Vec<&str> = crate::stops::StopKind::SERVE.iter().map(|v| crate::stops::StopKind::of_serve(*v).unwrap()).collect(); + names.sort(); + names.dedup(); + assert_eq!(names.len(), 5); + assert!(crate::stops::StopKind::SERVE.contains(&2)); +} diff --git a/src/timetable/way.rs b/src/timetable/way.rs new file mode 100644 index 0000000..3fe43f1 --- /dev/null +++ b/src/timetable/way.rs @@ -0,0 +1,349 @@ +//! A trip's way as a list of the map's paths, picked by hand as in OMSI 2's editor: the +//! paths a saved track names, where two of them do not join (a gap the game's bus loses its +//! way at), a path clicked put into the way (the paths to it filled in), and the stops found +//! along it. + +use std::collections::{BinaryHeap, HashMap, HashSet}; + +use glam::DVec3; +use omsi_timetable::TrackEntry; + +use super::network::{Network, PathKey}; +use super::route::{Problem, Route, StopOn, Ways, LANE_CHANGE}; +use crate::doc::TileKey; + +/// How far from a stop a path of the way may run to serve it (m). +const REACH: f64 = 15.0; + +/// How far a way is filled in from a path to one clicked (m). +const FILL: f64 = 3000.0; + +/// How far lane `b` starts from where lane `a` ends, where it does not run on from it (m); +/// 0 where it does, or is the lane beside it (a lane change, as OMSI 2's station links make +/// them too). The network links lanes as the game joins paths (see `network`), so a path +/// that is not linked to the one before is where the game's bus loses its way. +pub fn gap(net: &Network, a: usize, b: usize) -> f64 { + let (la, lb) = (&net.lanes[a], &net.lanes[b]); + if la.next.contains(&b) || la.side.contains(&b) { + return 0.0; + } + (lb.pts[0] - *la.pts.last().unwrap()).length().max(0.01) +} + +/// The places along `lanes` where a path does not join the next: (index of the path before +/// it, metres between them). +pub fn gaps(net: &Network, lanes: &[usize]) -> Vec<(usize, f64)> { + lanes.windows(2).enumerate().map(|(i, w)| (i, gap(net, w[0], w[1]))).filter(|(_, d)| *d > 0.0).collect() +} + +/// The lanes a saved track names, as the network holds them (None: a path the network does +/// not have). Each path is taken the way that joins its neighbours best (a two-way path has +/// a lane each way). +pub fn lanes_of_track(net: &Network, entries: &[TrackEntry], order: &[TileKey]) -> Vec> { + let options: Vec> = entries + .iter() + .map(|e| match e.values[..] { + [id, path, tile, ..] => order.get(tile as usize).and_then(|t| net.by_key.get(&PathKey { tile: *t, id: id as i64, path: path as usize })).cloned().unwrap_or_default(), + _ => Vec::new(), + }) + .collect(); + // (the cheapest choice through the whole list: the gaps, a lane against its path's + // direction a little more) + let own = |l: usize| if net.lanes[l].against { 1.0 } else { 0.0 }; + let mut best: Vec> = Vec::with_capacity(options.len()); + for (i, o) in options.iter().enumerate() { + let row: Vec<(f64, usize)> = o + .iter() + .map(|&l| { + let prev = if i > 0 { options[i - 1].iter().enumerate().map(|(k, &p)| (best[i - 1][k].0 + gap(net, p, l).min(50.0), k)).min_by(|a, b| a.0.total_cmp(&b.0)) } else { None }; + let (c, k) = prev.unwrap_or((0.0, usize::MAX)); + (c + own(l), k) + }) + .collect(); + best.push(row); + } + let mut out = vec![None; options.len()]; + let mut pick: Option = None; + for i in (0..options.len()).rev() { + let k = match pick { + Some(k) if k != usize::MAX => k, + _ => match (0..options[i].len()).min_by(|&a, &b| best[i][a].0.total_cmp(&best[i][b].0)) { + Some(k) => k, + None => { + pick = None; + continue; + } + }, + }; + out[i] = Some(options[i][k]); + pick = Some(best[i][k].1); + } + out +} + +/// The way along `lanes` through the stops at `positions`: each stop where the way passes +/// it, after the one before. The way may run on before the first stop and after the last. +pub fn along(net: &Network, lanes: &[usize], positions: &[Option], left_hand: bool) -> Route { + let ways = lanes.first().map(|l| if net.lanes[*l].rail { Ways::Rail } else { Ways::Road }); + let mut r = Route { lanes: lanes.to_vec(), ways, by_hand: true, ..Default::default() }; + let mut from = (0usize, f64::MIN); + let mut found: Vec> = Vec::new(); + for (i, p) in positions.iter().enumerate() { + let Some(p) = p else { + r.problems.push(Problem::NoObject(i)); + found.push(None); + continue; + }; + // the first lanes from where the last stop was that pass it, the nearest of them + let mut pick: Option<(usize, StopOn, f64)> = None; + for k in from.0..lanes.len() { + let lane = &net.lanes[lanes[k]]; + let (a, off, right) = lane.project(p.truncate()); + let ok = off <= REACH && (k > from.0 || a >= from.1); + if !ok { + if pick.is_some() { + break; + } + continue; + } + let score = off + if right != left_hand { 0.0 } else { 25.0 }; + if pick.as_ref().map(|x| score < x.2).unwrap_or(true) { + pick = Some((k, StopOn { lane: lanes[k], along: a, off }, score)); + } + } + match pick { + Some((k, s, _)) => { + from = (k, s.along); + found.push(Some((k, s))); + } + None => { + r.problems.push(Problem::OffWay(i)); + found.push(None); + } + } + } + if found.iter().any(|f| f.is_none()) { + return r; + } + r.stops = found.into_iter().flatten().collect(); + for w in r.stops.windows(2) { + let ((a, sa), (b, sb)) = (w[0], w[1]); + let mut len = sb.along - sa.along; + for &l in &lanes[a..b] { + len += net.lanes[l].length(); + } + r.legs.push(len.max(0.0)); + } + for (k, w) in r.stops.windows(2).enumerate() { + if lanes[w[0].0..=w[1].0].iter().any(|l| net.lanes[*l].against) { + r.against.push(k); + } + } + r +} + +#[derive(PartialEq)] +struct Node(f64, usize); +impl Eq for Node {} +impl PartialOrd for Node { + fn partial_cmp(&self, o: &Self) -> Option { + Some(self.cmp(o)) + } +} +impl Ord for Node { + fn cmp(&self, o: &Self) -> std::cmp::Ordering { + o.0.total_cmp(&self.0) + } +} + +/// What driving a lane costs the filling in (m; against its path's direction far more). +fn cost(net: &Network, l: usize) -> f64 { + let lane = &net.lanes[l]; + if lane.against { + lane.length() * 4.0 + 150.0 + } else { + lane.length() + } +} + +/// The lanes reached from the end of lane `a` within [`FILL`]: (cost to their start, the +/// lane before), on along the lanes or across to the lane beside. +fn search_from(net: &Network, a: usize) -> HashMap { + let mut best: HashMap = HashMap::new(); + let mut heap = BinaryHeap::new(); + let mut done = HashSet::new(); + for &n in net.lanes[a].next.iter().chain(&net.lanes[a].side) { + best.insert(n, (0.0, a)); + heap.push(Node(0.0, n)); + } + while let Some(Node(c, l)) = heap.pop() { + if !done.insert(l) || c > FILL { + continue; + } + let lane = &net.lanes[l]; + let steps = lane.next.iter().map(|&n| (n, c + cost(net, l))).chain(lane.side.iter().map(|&n| (n, c + LANE_CHANGE))); + for (n, cn) in steps { + if best.get(&n).map(|x| cn < x.0).unwrap_or(true) { + best.insert(n, (cn, l)); + heap.push(Node(cn, n)); + } + } + } + best +} + +/// The lanes from whose end lane `b` is reached within [`FILL`]: (cost from their end to +/// `b`'s start, the lane after). +fn search_to(net: &Network, b: usize) -> HashMap { + let mut prev: HashMap> = HashMap::new(); + for (i, l) in net.lanes.iter().enumerate() { + for &n in &l.next { + prev.entry(n).or_default().push((i, false)); + } + for &n in &l.side { + prev.entry(n).or_default().push((i, true)); + } + } + let mut best: HashMap = HashMap::new(); + let mut heap = BinaryHeap::new(); + let mut done = HashSet::new(); + for &(p, _) in prev.get(&b).map(|v| v.as_slice()).unwrap_or(&[]) { + best.insert(p, (0.0, b)); + heap.push(Node(0.0, p)); + } + while let Some(Node(c, l)) = heap.pop() { + if !done.insert(l) || c > FILL { + continue; + } + for &(p, side) in prev.get(&l).map(|v| v.as_slice()).unwrap_or(&[]) { + let cp = c + if side { LANE_CHANGE } else { cost(net, l) }; + if best.get(&p).map(|x| cp < x.0).unwrap_or(true) { + best.insert(p, (cp, l)); + heap.push(Node(cp, p)); + } + } + } + best +} + +/// The lanes between `a` and `b` along a [`search_from`] of `a`. +fn path_from(found: &HashMap, a: usize, b: usize) -> Option> { + let mut out = Vec::new(); + let mut at = found.get(&b)?.1; + while at != a { + out.push(at); + at = found.get(&at)?.1; + if out.len() > 100_000 { + return None; + } + } + out.reverse(); + Some(out) +} + +/// The lanes between `a` and `b` along a [`search_to`] of `b`. +fn path_to(found: &HashMap, a: usize, b: usize) -> Option> { + let mut out = Vec::new(); + let mut at = found.get(&a)?.1; + while at != b { + out.push(at); + at = found.get(&at)?.1; + if out.len() > 100_000 { + return None; + } + } + Some(out) +} + +/// The way with lane `l` (a path clicked) in it, the lanes to it filled in: in place of the +/// lanes it is a way round (another branch at a junction), else after the end or before the +/// start. A lane of the way clicked is taken out (at the ends the way is shorter; in between +/// it leaves a gap to mend). +pub fn with_lane(net: &Network, lanes: &[usize], l: usize) -> Vec { + if let Some(i) = lanes.iter().position(|x| *x == l) { + let mut out = lanes.to_vec(); + out.remove(i); + return out; + } + let Some(&last) = lanes.last() else { return vec![l] }; + let from_l = search_from(net, l); + let to_l = search_to(net, l); + // a way round: from a lane of the way to `l` and on to a later one, as little of the way + // left out as can be (and not more than a detour would be: a click far along a ring road + // adds to the end) + let mut best: Option<(usize, usize)> = None; + let mut reach_before: Option = None; + for j in 0..lanes.len() { + if let Some(i) = reach_before { + if from_l.contains_key(&lanes[j]) && best.map(|b| j - i < b.1 - b.0).unwrap_or(true) { + best = Some((i, j)); + } + } + if to_l.contains_key(&lanes[j]) { + reach_before = Some(j); + } + } + if let Some((i, j)) = best { + let left_out: f64 = lanes[i + 1..j].iter().map(|x| net.lanes[*x].length()).sum(); + let detour = to_l[&lanes[i]].0 + net.lanes[l].length() + from_l[&lanes[j]].0; + if let (true, Some(before), Some(after)) = (left_out <= detour * 2.0 + 300.0, path_to(&to_l, lanes[i], l), path_from(&from_l, l, lanes[j])) { + let mut out = lanes[..=i].to_vec(); + out.extend(before); + out.push(l); + out.extend(after); + out.extend_from_slice(&lanes[j..]); + return out; + } + } + // after the end + if let Some(w) = path_to(&to_l, last, l) { + let mut out = lanes.to_vec(); + out.extend(w); + out.push(l); + return out; + } + // before the start + if let Some(w) = path_from(&from_l, l, lanes[0]) { + let mut out = vec![l]; + out.extend(w); + out.extend_from_slice(lanes); + return out; + } + // nowhere joined: at the end, a gap before it + let mut out = lanes.to_vec(); + out.push(l); + out +} + +/// The lane of the trip's kind of way nearest a point clicked at `p`, within `reach` metres +/// (of a road's two lanes the one whose side of the road `p` lies on). +pub fn lane_at(net: &Network, p: DVec3, reach: f64, ways: Ways, left_hand: bool) -> Option { + let mut best: Option<(usize, f64)> = None; + for (i, l) in net.lanes.iter().enumerate() { + if l.rail != (ways == Ways::Rail) { + continue; + } + let (_, off, right) = l.project(p.truncate()); + if off > reach { + continue; + } + // (the way traffic drives it; a one-way path against its direction only when asked + // for by a click right on it) + let score = off + if right != left_hand { 0.0 } else { 0.5 } + if l.against { 1.0 } else { 0.0 }; + if best.map(|b| score < b.1).unwrap_or(true) { + best = Some((i, score)); + } + } + best.map(|b| b.0) +} + +/// The way of trip `name` through its stops at `positions`: its paths picked by hand where +/// they are, else as found along the roads. +pub fn of_trip(net: &Network, tt: &super::Timetable, name: &str, order: &[TileKey], positions: &[Option], left_hand: bool) -> Route { + if tt.by_hand(name) { + if let Some(lanes) = tt.track(name).and_then(|t| lanes_of_track(net, &t.entries, order).into_iter().collect::>>()) { + return along(net, &lanes, positions, left_hand); + } + } + super::route::find(net, positions, left_hand, super::route::ways_of(tt, name, net, order)) +} diff --git a/src/ui.rs b/src/ui.rs index 892d507..beaac89 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -180,6 +180,8 @@ pub enum Action { /// Put the map's folder back as it was before the save kept in this backup (and the /// later ones), then open it again. RestoreBackup(PathBuf), + /// File > Reload from disk: the map read again from its files. + ReloadFromDisk, /// Open or close the Traffic and AI window. Traffic, /// Open or close the Satellite and terrain window. @@ -818,8 +820,9 @@ pub fn editor(root: &mut egui::Ui, st: &mut UiState, u: EditorUi, actions: &mut tool_panel(ui, st, ed, lib, thumbs, wanted, swatches, wanted_swatches, actions); }); egui::Panel::right("properties").resizable(true).default_size(270.0).size_range(220.0..=420.0).frame(panel_frame()).show(root, |ui| { - // (a road's rows of objects can make it long) - egui::ScrollArea::vertical().id_salt("properties scroll").auto_shrink([false, false]).show(ui, |ui| { + // (a road's rows of objects can make it long; a row wider than the panel scrolls + // sideways instead of widening it: the map view shrank and slid away under the click) + egui::ScrollArea::both().id_salt("properties scroll").auto_shrink([false, false]).show(ui, |ui| { properties(ui, st, ed, lib, actions); }); }); @@ -904,6 +907,9 @@ fn menu_bar(root: &mut egui::Ui, st: &mut UiState, ed: &mut Editor, can_undo: bo if menu_item(ui, Some(Icon::Save), tr("Save", "Сохранить"), "Ctrl+S", true) { actions.push(Action::Save); } + if menu_item(ui, None, tr("Reload from disk", "Загрузить с диска"), "", ed.doc.as_ref().map(|d| !d.fresh).unwrap_or(false)) { + actions.push(Action::ReloadFromDisk); + } if menu_item(ui, Some(Icon::Copy), tr("Export map for sharing…", "Экспорт карты для обмена…"), "", true) { actions.push(Action::Export); } diff --git a/src/ui_edit.rs b/src/ui_edit.rs index 629c5b5..658dfb8 100644 --- a/src/ui_edit.rs +++ b/src/ui_edit.rs @@ -468,6 +468,9 @@ pub fn group_properties(ui: &mut egui::Ui, ed: &mut Editor, lib: &Library, paren if ui.button(tr("Reverse their direction", "Развернуть их направление")).on_hover_text(reverse_help()).clicked() { ed.reverse_selected(); } + if ui.button(icons::labelled(Icon::Route, tr("Complete to", "Достроить до"))).on_hover_text(crate::complete::help()).clicked() { + ed.complete_to(); + } } if splines > 1 { ui.add_space(4.0); diff --git a/src/ui_menu.rs b/src/ui_menu.rs index 10b8881..c3306f4 100644 --- a/src/ui_menu.rs +++ b/src/ui_menu.rs @@ -89,6 +89,11 @@ pub fn show(ctx: &egui::Context, menu: &mut Option, ed: &mut Editor, l done = true; } } + // (two free ends among the selected splines: a new piece between them) + if sels.iter().any(|s| matches!(s, crate::doc::Sel::Spline(..))) && item(ui, Icon::Route, tr("Complete to", "Достроить до"), "J", true) { + ed.complete_to(); + done = true; + } ui.separator(); if item(ui, Icon::Layers, tr("Group", "Сгруппировать"), "Ctrl+G", n >= 2 && group.is_none()) { ed.group_selection(); diff --git a/src/ui_mesh.rs b/src/ui_mesh.rs index 9ba34b9..b3f4598 100644 --- a/src/ui_mesh.rs +++ b/src/ui_mesh.rs @@ -357,7 +357,7 @@ pub fn object_panel(ui: &mut egui::Ui, ed: &mut Editor, bake: &mut BakeChoice, a } }); } - ui.horizontal(|ui| { + ui.horizontal_wrapped(|ui| { let label = if m.editing { tr("Leave the edit mode (Tab)", "Выйти из редактирования (Tab)") } else { tr("Edit the mesh (Tab)", "Редактировать меш (Tab)") }; if ui.add(egui::Button::new(RichText::new(label).strong()).fill(if m.editing { crate::ui::ACCENT } else { Color32::from_rgb(52, 54, 60) })).clicked() { actions.push(Action::Mesh(MeshAction::ToggleEdit)); @@ -369,13 +369,13 @@ pub fn object_panel(ui: &mut egui::Ui, ed: &mut Editor, bake: &mut BakeChoice, a ui.horizontal(|ui| { ui.label(RichText::new(tr("Name", "Имя")).color(DIM)); let mut n = m.src.name.clone(); - let r = ui.text_edit_singleline(&mut n); + let r = ui.add(egui::TextEdit::singleline(&mut n).desired_width(f32::INFINITY)); if r.changed() { m.src.name = n; } touched(m, &r); }); - ui.horizontal(|ui| { + ui.horizontal_wrapped(|ui| { let mut abs = m.src.abs_height; let r = ui.checkbox(&mut abs, tr("Height above sea level", "Высота над уровнем моря")).on_hover_text(tr("Off: its height is kept above the ground under it", "Выкл.: высота считается от земли под ним")); if r.changed() { @@ -595,9 +595,10 @@ pub fn object_panel(ui: &mut egui::Ui, ed: &mut Editor, bake: &mut BakeChoice, a }); } }); - ui.horizontal(|ui| { + ui.horizontal_wrapped(|ui| { ui.label(RichText::new(tr("Texture", "Текстура")).color(DIM)); - ui.label(mat.texture.as_deref().unwrap_or("—")); + let tex = mat.texture.as_deref().unwrap_or("—"); + ui.add(egui::Label::new(tex.rsplit(['\\', '/']).next().unwrap_or(tex)).truncate()).on_hover_text(tex); if ui.small_button(tr("Choose…", "Выбрать…")).clicked() { actions.push(Action::Mesh(MeshAction::PickTexture(i, TexSlot::Color))); } @@ -613,13 +614,13 @@ pub fn object_panel(ui: &mut egui::Ui, ed: &mut Editor, bake: &mut BakeChoice, a } } }); - ui.horizontal(|ui| { + ui.horizontal_wrapped(|ui| { ui.label(RichText::new(tr("Transparency", "Прозрачность")).color(DIM)); for (v, label) in [(0u8, tr("Opaque", "Нет")), (1, tr("Cut out", "Вырез")), (2, tr("Blended", "Смешивание"))] { join(ui.selectable_value(&mut mat.alpha, v, label)); } }); - ui.horizontal(|ui| { + ui.horizontal_wrapped(|ui| { ui.label(RichText::new(tr("Glows", "Свечение")).color(DIM)); join(ui.color_edit_button_rgb(&mut mat.emissive).on_hover_text(tr("Light of its own: black for none", "Собственный свет: чёрный — без свечения"))); ui.label(RichText::new(tr("Shine", "Блеск")).color(DIM)); diff --git a/src/ui_newmap.rs b/src/ui_newmap.rs index a65c2b6..e8b4caa 100644 --- a/src/ui_newmap.rs +++ b/src/ui_newmap.rs @@ -197,7 +197,9 @@ pub fn dialog(ctx: &egui::Context, form: &mut Option, roots: Option< let ok = !f.name.trim().is_empty(); if ui.add_enabled(ok, egui::Button::new(tr("Create", "Создать"))).clicked() || (ok && ui.input(|i| i.key_pressed(egui::Key::Enter) && !i.modifiers.shift)) { let friendly = f.name.trim().to_string(); - let folder: String = friendly.chars().map(|c| if c.is_alphanumeric() || c == ' ' || c == '-' || c == '_' { c } else { '_' }).collect::().trim().to_string(); + // (OMSI 2 opens no map whose folder has a letter outside ASCII) + let folder = friendly.split(' ').map(crate::omsi_name::ascii_stem).filter(|w| !w.is_empty()).collect::>().join(" "); + let folder = if folder.is_empty() { "Map".to_string() } else { folder }; actions.push(Action::NewMap { folder, friendly, size: f.size, options: f.options.clone() }); close = true; } diff --git a/src/ui_palette.rs b/src/ui_palette.rs index deeba79..b4f8c9a 100644 --- a/src/ui_palette.rs +++ b/src/ui_palette.rs @@ -208,6 +208,7 @@ fn commands() -> Vec { ed.set_tool(Tool::Select); ed.toast(tr("Select a track (double-click: all of it): Overhead wire under Parallel copy in its properties", "Выберите путь (двойной клик: весь): «Контактный провод» под «Параллельной копией» в свойствах")); }), + cmd!(Icon::Route, "Complete to", "Достроить до", "join connect close ring loop gap fill splines kerb соединить замкнуть кольцо разрыв сплайны бордюр", "J", |_, ed, _| ed.complete_to()), cmd!(Icon::Road, "Parallel copy of a road", "Параллельная копия дороги", "second track carriageway второй путь проезжая часть", "", |_, ed, _| { ed.set_tool(Tool::Select); ed.toast(tr("Select a road or a chain: Parallel copy in its properties", "Выберите дорогу или цепочку: «Параллельная копия» в свойствах")); diff --git a/src/ui_sync.rs b/src/ui_sync.rs new file mode 100644 index 0000000..c111448 --- /dev/null +++ b/src/ui_sync.rs @@ -0,0 +1,249 @@ +//! The open map kept in step with its files: every two seconds its folder is looked at, and +//! what another program (OMSI 2's editor, another tool) wrote there is read in again. Where +//! the map has changes here not saved yet, the question is asked: the files' or these. +//! A copy of an installation's map also looks at the installation's, which OMSI 2's editor +//! writes, and offers what changed there. + +use std::path::PathBuf; +use std::sync::mpsc::{Receiver, TryRecvError}; +use std::time::{Duration, Instant}; + +use crate::doc::sync::{self, Changes, Stamp}; +use crate::doc::Document; +use crate::i18n::tr; +use crate::install::Roots; + +/// How often the folder is looked at. +const EVERY: Duration = Duration::from_secs(2); + +struct Watched { + /// The folder the map is read from. + dir: PathBuf, + /// Its files as the map has them (None: to be looked at first). + base: Option, + /// A change seen once: it is taken when the next look finds the files the same (a program + /// writes many files one after another). + settling: Option, + /// The global settings as read or saved (see `sync::conflicts`). + global_base: String, + /// The installation's map this one is the copy of, and its change seen once. + twin: Option<(PathBuf, Option)>, +} + +struct Scanned { + generation: u64, + stamp: Stamp, + twin: Option, +} + +/// A question waiting for the user. +pub enum Ask { + /// Changed outside and here too. + Conflict(Changes), + /// The installation's map changed: these files. + Twin { twin: PathBuf, files: Vec, stamp: Stamp }, +} + +#[derive(Default)] +pub struct MapSync { + watched: Option, + scan: Option>, + /// Counts up whenever what is on disk becomes the map's own (read, saved): a look begun + /// before is not wanted. + generation: u64, + last: Option, + pub ask: Option, +} + +/// What an answer did. +pub enum Answered { + Reloaded(Changes), + Took(usize), + Failed(String), + Nothing, +} + +impl MapSync { + /// The map was just read or saved here: its files are as it has them. + pub fn rebase(&mut self, doc: Option<&Document>) { + self.generation += 1; + self.scan = None; + if let Some(w) = &mut self.watched { + w.base = None; + w.settling = None; + if let Some(doc) = doc { + w.global_base = crate::doc::global_text(doc); + } + } + } + + /// Look at the folder now and then. `busy`: a save is writing or an edit is under way + /// (nothing is read in then). Some: parts of the map were read in again. + pub fn tick(&mut self, doc: Option<&mut Document>, roots: Option<&Roots>, busy: bool) -> Option { + let (Some(doc), Some(roots)) = (doc, roots) else { + self.watched = None; + self.ask = None; + return None; + }; + let Some(dir) = sync::read_dir(doc) else { + self.watched = None; + return None; + }; + if self.watched.as_ref().map(|w| w.dir != dir).unwrap_or(true) { + // the first save of an installation's map: its copy remembers the installation's + // as it was read + if let Some(old) = &self.watched { + if let (Some(base), Some(twin)) = (&old.base, sync::twin_of(roots, &doc.dir)) { + if same_dir(&twin, &old.dir) && sync::twin_seen(&doc.dir).is_none() { + sync::set_twin_seen(&doc.dir, base); + } + } + } + let twin = if doc.source.is_none() { sync::twin_of(roots, &doc.dir) } else { None }; + self.watched = Some(Watched { dir, base: None, settling: None, global_base: crate::doc::global_text(doc), twin: twin.map(|t| (t, None)) }); + self.generation += 1; + self.scan = None; + self.ask = None; + } + if let Some(rx) = &self.scan { + match rx.try_recv() { + Ok(s) => { + self.scan = None; + if s.generation == self.generation && !busy { + return self.scanned(doc, s); + } + } + Err(TryRecvError::Empty) => {} + Err(TryRecvError::Disconnected) => self.scan = None, + } + } + if self.scan.is_none() && !busy && self.ask.is_none() && self.last.map(|t| t.elapsed() >= EVERY).unwrap_or(true) { + self.last = Some(Instant::now()); + let w = self.watched.as_ref()?; + let (dir, twin, generation) = (w.dir.clone(), w.twin.as_ref().map(|t| t.0.clone()), self.generation); + let (tx, rx) = std::sync::mpsc::channel(); + // (a big map has thousands of files: they are looked at off the window's thread) + let spawned = std::thread::Builder::new().name("map-sync".into()).spawn(move || { + let _ = tx.send(Scanned { generation, stamp: sync::stamp(&dir), twin: twin.map(|t| sync::stamp(&t)) }); + }); + if spawned.is_ok() { + self.scan = Some(rx); + } + } + None + } + + fn scanned(&mut self, doc: &mut Document, s: Scanned) -> Option { + let w = self.watched.as_mut()?; + let mut out = None; + match &w.base { + None => w.base = Some(s.stamp), + Some(base) if *base == s.stamp => w.settling = None, + Some(base) if w.settling.as_ref() == Some(&s.stamp) => { + let files = sync::changed_files(base, &s.stamp); + log::info!("{}: changed outside openMapper: {}", w.dir.display(), files.join(", ")); + w.base = Some(s.stamp); + w.settling = None; + let changes = sync::classify(doc, &files); + if !changes.is_empty() { + let mine = sync::conflicts(doc, &changes, &w.global_base); + let done = sync::reload(doc, &w.dir, &changes.without(&mine), false); + if done.global { + w.global_base = crate::doc::global_text(doc); + } + if !mine.is_empty() { + self.ask = Some(Ask::Conflict(mine)); + } + out = (!done.is_empty()).then_some(done); + } + } + Some(_) => w.settling = Some(s.stamp), + } + if let (Some((twin, settling)), Some(now)) = (&mut w.twin, s.twin) { + let files = sync::twin_changes(&doc.dir, &now); + if files.is_empty() { + *settling = None; + } else if settling.as_ref() == Some(&now) { + *settling = None; + if self.ask.is_none() { + self.ask = Some(Ask::Twin { twin: twin.clone(), files, stamp: now }); + } + } else { + *settling = Some(now); + } + } + out + } + + /// The question answered: true takes the files' (reload from disk, the installation's + /// changes brought over), false keeps the map as it is here. + pub fn answer(&mut self, doc: Option<&mut Document>, yes: bool) -> Answered { + let (Some(ask), Some(doc)) = (self.ask.take(), doc) else { return Answered::Nothing }; + match ask { + Ask::Conflict(changes) => { + if !yes { + return Answered::Nothing; + } + let Some(w) = self.watched.as_mut() else { return Answered::Nothing }; + let done = sync::reload(doc, &w.dir, &changes, true); + if done.global { + w.global_base = crate::doc::global_text(doc); + } + Answered::Reloaded(done) + } + Ask::Twin { twin, files, stamp } => { + sync::set_twin_seen(&doc.dir, &stamp); + if !yes { + return Answered::Nothing; + } + // (the copy's files change: the next looks read them in, or ask) + self.last = None; + match sync::take_from_twin(&twin, &doc.dir, &files) { + Ok(n) => Answered::Took(n), + Err(e) => Answered::Failed(e.to_string()), + } + } + } + } +} + +fn same_dir(a: &std::path::Path, b: &std::path::Path) -> bool { + a.canonicalize().ok().zip(b.canonicalize().ok()).map(|(a, b)| a == b).unwrap_or(a == b) +} + +/// The question, while there is one: Some(true) the files', Some(false) the map's here. +pub fn window(ctx: &egui::Context, sync: &MapSync) -> Option { + let ask = sync.ask.as_ref()?; + let mut answer = None; + let (title, text, note, yes, no) = match ask { + Ask::Conflict(c) => ( + tr("The map changed on disk", "Карта изменилась на диске"), + format!("{} {}.", tr("Another program changed the map's files where it has changes here not saved yet:", "Другая программа изменила файлы карты там, где здесь есть несохранённые изменения:"), c.describe()), + tr("The other changes made on disk were read in already.", "Остальные изменения с диска уже загружены."), + tr("Reload from disk", "Загрузить с диска"), + tr("Keep mine", "Оставить мои"), + ), + Ask::Twin { files, .. } => ( + tr("The map changed in OMSI 2's folder", "Карта изменилась в папке OMSI 2"), + format!("{} ({} {}).", tr("The installation's own copy of this map was changed after openMapper's copy in the content folder was saved, by OMSI 2's editor say", "Копия этой карты в установке OMSI 2 изменена после сохранения копии openMapper в папке контента, например редактором OMSI 2"), files.len(), tr("files", "файлов")), + tr("Bringing the changes over replaces those files of openMapper's copy; the files replaced are kept in a backup (File > Earlier versions).", "Перенос заменит эти файлы в копии openMapper; заменённые файлы сохраняются в резервной копии (Файл > Прошлые версии)."), + tr("Bring the changes over", "Перенести изменения"), + tr("Keep openMapper's copy", "Оставить копию openMapper"), + ), + }; + egui::Window::new(title).collapsible(false).resizable(false).anchor(egui::Align2::CENTER_CENTER, egui::Vec2::ZERO).show(ctx, |ui| { + ui.set_width(400.0); + ui.label(text); + ui.label(egui::RichText::new(note).small().color(egui::Color32::GRAY)); + ui.add_space(8.0); + ui.horizontal(|ui| { + if ui.button(yes).clicked() { + answer = Some(true); + } + if ui.button(no).clicked() { + answer = Some(false); + } + }); + }); + answer +} diff --git a/src/ui_timetable.rs b/src/ui_timetable.rs index b4c73a2..5bf3ce5 100644 --- a/src/ui_timetable.rs +++ b/src/ui_timetable.rs @@ -21,6 +21,10 @@ use crate::timetable::route::{self, Problem, Route, Ways}; use crate::timetable::{self, clock, Timetable, ALL_DAYS}; use crate::ui::{Action, ACCENT}; +mod times; +mod trips; +mod way; + const TEXT_DIM: Color32 = Color32::from_rgb(140, 143, 150); const WARN: Color32 = Color32::from_rgb(230, 170, 100); const GOOD: Color32 = Color32::from_rgb(120, 200, 130); @@ -85,6 +89,13 @@ pub struct TimetableUi { /// The year the holidays are shown of. holiday_year: i32, holidays_open: bool, + /// Clicking paths in the view puts them into the trip's way (picked by hand). + way_edit: bool, + /// Every trip of the map is listed (not a line's). + all_trips: bool, + trip_filter: String, + /// The trip's time profile shown (its place in the list). + profile: usize, } fn lower(s: &str) -> String { @@ -269,6 +280,18 @@ impl TimetableUi { let names: Vec = std::mem::take(&mut doc.timetable.reroute).into_iter().collect(); for name in names { let Some(trip) = doc.timetable.trip(&name).cloned() else { continue }; + if doc.timetable.by_hand(&name) { + // (paths picked by hand stay: the stops are found along them again) + if let Some(lanes) = way::saved_lanes(net, doc, &name) { + let r = way::keep_by_hand(net, &mut self.files, doc, &name, &lanes); + if r.problems.is_empty() { + self.problems.remove(&name); + } else { + self.problems.insert(name.clone(), r.problems); + } + } + continue; + } if trip.stations.len() < 2 { self.problems.remove(&name); continue; @@ -331,6 +354,11 @@ impl TimetableUi { for s in pts.windows(2) { crate::editor::line(&mut x.overlay, cam, s[0] + lift, s[1] + lift, w * 1.2, ROUTE); } + // where the way breaks + for (k, _) in crate::timetable::way::gaps(net, &r.lanes) { + let end = *net.lanes[r.lanes[k]].pts.last().unwrap(); + crate::editor::disc(&mut x.overlay, cam, end + DVec3::Z * 0.5, w * 7.0, [1.0, 0.25, 0.2, 0.95]); + } let n = stations.len(); for (i, id) in stations.iter().enumerate() { let Some(s) = self.stops.iter().find(|s| s.id == *id) else { continue }; @@ -365,6 +393,7 @@ impl TimetableUi { } if !self.open { self.picking = false; + self.way_edit = false; ed.pick_mode = false; return; } @@ -389,13 +418,14 @@ impl TimetableUi { .id(egui::Id::new("timetable window")) .open(&mut open) .default_pos([310.0, 70.0]) - .default_size([600.0, 700.0]) - .min_width(480.0) + .default_size([760.0, 760.0]) + .min_width(560.0) .resizable(true) .show(ctx, |ui| self.contents(ui, ed, actions)); self.open = open; if !open { self.picking = false; + self.way_edit = false; ed.pick_mode = false; } let doc = ed.doc.as_ref().unwrap(); @@ -411,14 +441,18 @@ impl TimetableUi { /// While picking, a click on the map (the editor's pick mode: nothing is selected or /// moved) adds the stop under the cursor, or the one nearest it, to the trip. fn pick_from_view(&mut self, ed: &mut Editor) { - ed.pick_mode = self.picking; - if !self.picking { + ed.pick_mode = self.picking || self.way_edit; + if !ed.pick_mode { ed.picked = None; return; } if ed.tool != Tool::Select { ed.set_tool(Tool::Select); } + if self.way_edit { + self.click_path(ed); + return; + } let Some((hit, at)) = ed.picked.take() else { return }; let Some(trip) = self.trip.clone() else { return }; let hit = match hit { @@ -451,11 +485,18 @@ impl TimetableUi { return; }; if let Some((n, s, k, _)) = &self.shown { - if n == &trip.name && s == &trip.stations && *k == self.net_key { + if n == &trip.name && s == &trip.stations && *k == self.net_key && !doc.timetable.by_hand(&trip.name) { return; } } let pos: Vec> = trip.stations.iter().map(|id| self.stops.iter().find(|s| s.id == *id).map(|s| s.pos)).collect(); + // (a way picked by hand: as saved, read again every frame, being cheap) + if doc.timetable.by_hand(&trip.name) { + let lanes = way::saved_lanes(net, doc, &trip.name).unwrap_or_default(); + let r = crate::timetable::way::along(net, &lanes, &pos, doc.global.left_hand_traffic); + self.shown = Some((trip.name.clone(), trip.stations.clone(), self.net_key, r)); + return; + } let r = if pos.len() >= 2 { route::find(net, &pos, doc.global.left_hand_traffic, ways_for(&self.ways, doc, net, &trip.name)) } else { Route::default() }; self.shown = Some((trip.name.clone(), trip.stations.clone(), self.net_key, r)); } @@ -485,6 +526,11 @@ impl TimetableUi { self.select_line(&doc.timetable, Some(n)); } } + ui.add_space(6.0); + let all = format!("{} ({})", tr("All trips", "Все рейсы"), doc.timetable.trips.len()); + if ui.add(egui::Button::selectable(self.all_trips, icons::labelled(Icon::Route, &all)).min_size(Vec2::new(140.0, 0.0))).on_hover_text(tr("Every trip of the map, those no tour drives too", "Все рейсы карты, и те, по которым не ездит ни один выход")).clicked() && !self.all_trips { + self.show_all_trips(&doc.timetable); + } }); if ui.button(icons::labelled(Icon::Add, tr("New line", "Новая линия"))).clicked() { let n = (1..).map(|i| i.to_string()).find(|n| !doc.timetable.lines.iter().any(|l| l.name.eq_ignore_ascii_case(n))).unwrap(); @@ -497,6 +543,7 @@ impl TimetableUi { egui::ScrollArea::vertical().id_salt("tt line").show(ui, |ui| { ui.set_min_width(300.0); match self.line.clone() { + _ if self.all_trips => self.all_trips_panel(ui, doc, &mut ed.toasts, actions), Some(l) if doc.timetable.lines.iter().any(|x| x.name == l) => self.line_panel(ui, doc, &l, &mut ed.toasts, actions), _ => { self.line = None; @@ -515,6 +562,7 @@ impl TimetableUi { self.line = name; self.tour = None; self.picking = false; + self.all_trips = false; let first = self.line.as_ref().and_then(|l| tt.lines.iter().find(|x| &x.name == l)).map(|l| line_trips(tt, l)).and_then(|t| t.into_iter().next()); self.select_trip(first); } @@ -523,6 +571,8 @@ impl TimetableUi { self.trip_name = name.clone().unwrap_or_default(); self.trip = name; self.picking = false; + self.way_edit = false; + self.profile = 0; } fn line_panel(&mut self, ui: &mut egui::Ui, doc: &mut Document, line: &str, toasts: &mut Vec, actions: &mut Vec) { @@ -674,6 +724,12 @@ impl TimetableUi { tt.trip_mut(&name).unwrap().terminus = term; tt.touch_trip(&name); } + ui.label(tr("Line", "Линия")).on_hover_text(tr("The line number the trip shows; the line of this number lists it among its trips", "Номер линии, который показывает рейс; линия с этим номером показывает его среди своих рейсов")); + let mut l = t.line.clone(); + if ui.add(egui::TextEdit::singleline(&mut l).desired_width(60.0)).changed() { + tt.trip_mut(&name).unwrap().line = l; + tt.touch_trip(&name); + } }); if !t.stations_legacy.is_empty() { ui.label(RichText::new(tr("This trip runs on a track of its own (a train): its stops are kept as they are.", "Этот рейс идёт по своему пути (поезд): его остановки остаются как есть.")).color(TEXT_DIM)); @@ -799,7 +855,8 @@ impl TimetableUi { // the route ui.add_space(4.0); - let shown = self.shown.as_ref().filter(|(n, s, _, _)| n == &name && s == &stations).map(|x| &x.3); + let shown = self.shown.as_ref().filter(|(n, s, _, _)| n == &name && s == &stations).map(|x| x.3.clone()); + let shown = shown.as_ref(); match shown { _ if stations.len() < 2 => { ui.label(RichText::new(tr("Add two stops or more: the way between them is found along the roads.", "Добавьте две остановки или больше: путь между ними найдётся по дорогам.")).color(TEXT_DIM)); @@ -809,7 +866,8 @@ impl TimetableUi { } Some(r) if r.ok() => { let along = if r.ways == Some(Ways::Rail) { tr("km along the tracks (blue in the view)", "км по рельсам (синим на карте)") } else { tr("km along the roads (blue in the view)", "км по дорогам (синим на карте)") }; - ui.label(RichText::new(format!("{} {:.2} {}", tr("Route found:", "Путь найден:"), r.length() / 1000.0, along)).color(GOOD)); + let what = if r.by_hand { tr("Way picked by hand:", "Путь выбран вручную:") } else { tr("Route found:", "Путь найден:") }; + ui.label(RichText::new(format!("{} {:.2} {}", what, r.length() / 1000.0, along)).color(GOOD)); for &leg in &r.against { let name_of = |i: usize| stations.get(i).map(|id| self.stop_name(tt, *id)).unwrap_or_default(); let text = format!("«{}» – «{}»: {}", name_of(leg), name_of(leg + 1), tr("the way drives a one-way lane against its direction; is a path drawn the wrong way round?", "путь идёт по односторонней полосе против её направления; может, путь нарисован не в ту сторону?")); @@ -822,6 +880,7 @@ impl TimetableUi { let name_of = |i: usize| stations.get(i).map(|id| self.stop_name(tt, *id)).unwrap_or_default(); let text = match p { Problem::NoObject(i) => format!("{} «{}» {}", tr("Stop", "Остановка"), name_of(*i), tr("is not on the map", "нет на карте")), + Problem::OffWay(i) => format!("«{}»: {}", name_of(*i), tr("the paths picked do not pass this stop", "выбранные пути не проходят у этой остановки")), Problem::NoRoad(i) if rail => format!("«{}»: {}", name_of(*i), tr("no track within 15 m", "в 15 м нет рельсов")), Problem::NoRoad(i) => format!("«{}»: {}", name_of(*i), tr("no road with car lanes within 15 m", "в 15 м нет дороги с полосами для машин")), Problem::NoWay(i) if rail => format!("{} «{}» – «{}»: {}", tr("No way", "Нет пути"), name_of(*i), name_of(*i + 1), tr("the tracks are not joined, or run the other way (see View > AI lanes)", "рельсы не соединены или идут в другую сторону (Вид > Полосы ИИ)")), @@ -832,119 +891,17 @@ impl TimetableUi { } } - // the time - let route_len = shown.filter(|r| r.ok()).map(|r| r.length()); - ui.horizontal(|ui| { - ui.label(tr("Trip time", "Время в пути")); - let mut m = minutes(&t); - if ui.add(egui::DragValue::new(&mut m).range(1.0..=600.0).speed(0.25).max_decimals(1).suffix(tr(" min", " мин"))).changed() { - set_minutes(tt, &name, m); - } - if let Some(len) = route_len { - let guess = ((len / 1000.0 / BUS_SPEED * 60.0) + 0.4 * stations.len() as f64).ceil().max(1.0) as f32; - if ui.button(format!("{} {guess:.0}", tr("Guess:", "Оценка:"))).on_hover_text(tr("From the route's length at the pace of a town bus", "По длине пути и темпу городского автобуса")).clicked() { - set_minutes(tt, &name, guess); - } - } - }); + // the way, picked by hand or found + self.way_section(ui, doc, &name, actions); - // the times at the stops - if stations.len() >= 2 { - let legs: Vec = match shown.filter(|r| r.ok()) { - Some(r) => r.legs.clone(), - None => stations.windows(2).map(|w| tt.links.iter().find(|l| l.from_id == w[0] && l.to_id == w[1]).map(|l| l.length).unwrap_or(0.0)).collect(), - }; - let mut p = t.profiles.first().cloned().unwrap_or_default(); - p.factor = minutes(&t); - let n = stations.len(); - let times = timetable::stop_times(n, &legs, &p); - let mut set: Option<(usize, Option)> = None; - let mut clear = false; - egui::CollapsingHeader::new(icons::labelled(Icon::Schedule, tr("Times at the stops", "Время на остановках"))).id_salt(("tt times", name.to_lowercase())).default_open(times.iter().skip(1).any(|t| t.2)).show(ui, |ui| { - ui.label(RichText::new(tr("Minutes after the trip leaves. They follow the distance between the stops; fix one to keep the bus to it (it waits there when early).", "Минуты от отправления рейса. Они следуют расстоянию между остановками; закрепите время, чтобы автобус его держал (если раньше: ждёт).")).small().color(TEXT_DIM)); - egui::Grid::new(("tt stop times", name.to_lowercase())).num_columns(3).spacing(Vec2::new(10.0, 3.0)).show(ui, |ui| { - for (i, (a, d, fixed)) in times.iter().enumerate() { - let label = format!("{:>2}. {}", i + 1, self.stop_name(tt, stations[i])); - ui.allocate_ui_with_layout(Vec2::new(190.0, 18.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { - ui.set_min_width(190.0); - ui.add(egui::Label::new(label).truncate()); - }); - let shown_time = if i + 1 == n { *a } else { *d }; - if *fixed && i > 0 { - let mut m = shown_time; - if ui.add(egui::DragValue::new(&mut m).range(0.0..=600.0).speed(0.1).max_decimals(1).prefix("+").suffix(tr(" min", " мин"))).changed() { - set = Some((i, Some(m))); - } - } else { - ui.label(RichText::new(format!("+{}", mmss(shown_time))).color(if i == 0 { TEXT_DIM } else { Color32::from_gray(220) })); - } - if i > 0 && check(ui, *fixed, tr("fixed", "закреплено")) { - set = Some((i, if *fixed { None } else { Some((shown_time * 2.0).round() / 2.0) })); - } - ui.end_row(); - } - }); - if times.iter().skip(1).any(|t| t.2) && ui.button(tr("Spread all by distance", "Распределить по расстоянию")).clicked() { - clear = true; - } - }); - let mut serve: Option<(usize, i32)> = None; - egui::CollapsingHeader::new(icons::labelled(Icon::Bus, tr("How the stops are served", "Как обслуживаются остановки"))).id_salt(("tt serve", name.to_lowercase())).default_open(false).show(ui, |ui| { - ui.label(RichText::new(tr("Always: the bus stops whoever waits (a compulsory stop, a terminus). When wanted: only if somebody gets on or off (a request stop). Drive through: it does not stop on this trip. When early: it stops only if it is ahead of its time.", "Всегда: автобус останавливается, ждёт ли кто-то или нет (обязательная, конечная). По требованию: только если кто-то садится или выходит. Проезжает: на этом рейсе не останавливается. Если раньше: останавливается, только если идёт раньше времени.")).small().color(TEXT_DIM)); - egui::Grid::new(("tt serve grid", name.to_lowercase())).num_columns(2).spacing(Vec2::new(10.0, 3.0)).show(ui, |ui| { - for i in 0..n { - ui.allocate_ui_with_layout(Vec2::new(190.0, 18.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { - ui.set_min_width(190.0); - ui.add(egui::Label::new(format!("{:>2}. {}", i + 1, self.stop_name(tt, stations[i]))).truncate()); - }); - let cur = p.other_stopping.iter().find(|x| x.0 == i as i32).map(|x| x.1).unwrap_or(0); - let mut v = cur; - egui::ComboBox::from_id_salt(("tt serve one", i)).selected_text(crate::stops::StopKind::of_serve(cur).unwrap_or("?")).width(120.0).show_ui(ui, |ui| { - for k in [1, 0, 2, 3] { - ui.selectable_value(&mut v, k, crate::stops::StopKind::of_serve(k).unwrap_or("?")); - } - }); - if v != cur { - serve = Some((i, v)); - } - ui.end_row(); - } - }); - }); - if let Some((i, v)) = serve { - let tm = tt.trip_mut(&name).unwrap(); - if tm.profiles.is_empty() { - tm.profiles.push(omsi_timetable::TripProfile { name: "standard".into(), factor: minutes(&t), ..Default::default() }); - } - for p in &mut tm.profiles { - p.other_stopping.retain(|x| x.0 != i as i32); - if v != 0 { - p.other_stopping.push((i as i32, v)); - } - p.other_stopping.sort_by_key(|x| x.0); - } - tt.touch_trip(&name); - } - if set.is_some() || clear { - let tm = tt.trip_mut(&name).unwrap(); - if tm.profiles.is_empty() { - tm.profiles.push(omsi_timetable::TripProfile { name: "standard".into(), factor: minutes(&t), ..Default::default() }); - } - let p = &mut tm.profiles[0]; - if clear { - p.man_arr_time.clear(); - p.man_dep_time.clear(); - } - if let Some((i, m)) = set { - timetable::set_stop_time(p, n, i, m); - // (the last stop fixed is the trip's time too) - if let (true, Some(m)) = (i + 1 == n, m) { - p.factor = m; - } - } - tt.touch_trip(&name); - } - } + // the times and how the stops are served + let legs: Vec = match shown.filter(|r| r.ok() && r.legs.len() + 1 == stations.len()) { + Some(r) => r.legs.clone(), + None => stations.windows(2).map(|w| doc.timetable.links.iter().find(|l| l.from_id == w[0] && l.to_id == w[1]).map(|l| l.length).unwrap_or(0.0)).collect(), + }; + let route_len = shown.filter(|r| r.ok()).map(|r| r.length()); + self.times_section(ui, &mut doc.timetable, &name, &stations, &legs, route_len); + self.serve_section(ui, &mut doc.timetable, &name, &stations); } /// Which vehicles drive the line (`car_use/*.ocu`): for a span of dates the types its tours @@ -1222,6 +1179,13 @@ impl TimetableUi { } // trip times, for the arrivals and the next departure let times: HashMap = trips.iter().filter_map(|t| tt.trip(t).map(|x| (lower(t), minutes(x)))).collect(); + // (every trip's profiles: a departure can run any trip of the map, to any of its profiles) + let profiles: HashMap> = tt.trips.iter().map(|t| (lower(&t.name), t.profiles.iter().map(|p| (p.name.trim().to_string(), if p.factor > 0.0 { p.factor } else { 10.0 })).collect())).collect(); + let others: Vec = { + let mut v: Vec = tt.trips.iter().map(|t| t.name.clone()).filter(|n| !trips.iter().any(|x| x.eq_ignore_ascii_case(n))).collect(); + v.sort_by_key(|n| n.to_lowercase()); + v + }; let mut changed = false; let mut resort = false; let mut delete_tour = false; @@ -1286,7 +1250,7 @@ impl TimetableUi { let (trip, dep) = match tour.trips.last() { Some(last) => { let k = trips.iter().position(|t| t.eq_ignore_ascii_case(&last.trip)).unwrap_or(0); - (trips[(k + 1) % trips.len()].clone(), last.departure + times.get(&lower(&last.trip)).copied().unwrap_or(10.0) + self.layover as f32) + (trips[(k + 1) % trips.len()].clone(), last.departure + profiles.get(&lower(&last.trip)).and_then(|p| p.get(last.profile.max(0) as usize).or(p.first())).map(|p| p.1).unwrap_or(10.0) + self.layover as f32) } None => (trips[0].clone(), (self.fill_from.0 * 60 + self.fill_from.1) as f32), }; @@ -1324,7 +1288,7 @@ impl TimetableUi { if count == 0 { ui.label(RichText::new(tr("No departures yet: add them above.", "Отправлений пока нет: добавьте их выше.")).color(TEXT_DIM)); } - egui::Grid::new("tt deps").num_columns(4).spacing(Vec2::new(8.0, 3.0)).show(ui, |ui| { + egui::Grid::new("tt deps").num_columns(5).spacing(Vec2::new(8.0, 3.0)).show(ui, |ui| { for k in 0..count { let tr_ = &mut tour.trips[k]; let mut h = (tr_.departure / 60.0).floor() as i32; @@ -1340,12 +1304,36 @@ impl TimetableUi { changed = true; } }); - egui::ComboBox::from_id_salt(("tt dep trip", k)).selected_text(tr_.trip.clone()).width(140.0).show_ui(ui, |ui| { + egui::ComboBox::from_id_salt(("tt dep trip", k)).selected_text(tr_.trip.clone()).width(160.0).height(360.0).show_ui(ui, |ui| { for t in trips { changed |= ui.selectable_value(&mut tr_.trip, t.clone(), t).changed(); } + if !others.is_empty() { + ui.separator(); + ui.label(RichText::new(tr("Other trips", "Другие рейсы")).small().color(TEXT_DIM)); + for t in &others { + changed |= ui.selectable_value(&mut tr_.trip, t.clone(), t).changed(); + } + } }); - let arrive = times.get(&lower(&tr_.trip)).copied().unwrap_or(0.0); + // the profile it runs to + let ps = profiles.get(&lower(&tr_.trip)).cloned().unwrap_or_default(); + if ps.len() > 1 { + let cur = (tr_.profile.max(0) as usize).min(ps.len() - 1); + egui::ComboBox::from_id_salt(("tt dep profile", k)).selected_text(ps[cur].0.clone()).width(90.0).show_ui(ui, |ui| { + for (i, (n, m)) in ps.iter().enumerate() { + if ui.selectable_label(i == cur, format!("{n} · {}", mmss(*m))).clicked() && i as i32 != tr_.profile { + tr_.profile = i as i32; + changed = true; + } + } + }) + .response + .on_hover_text(tr("The time profile this departure runs to", "Профиль времени этого отправления")); + } else { + ui.label(""); + } + let arrive = ps.get(tr_.profile.max(0) as usize).or(ps.first()).map(|p| p.1).unwrap_or(0.0); ui.label(RichText::new(format!("» {}", clock(tr_.departure + arrive))).color(TEXT_DIM)); if small_button(ui, Icon::Delete, tr("Delete the departure", "Удалить отправление")) { remove = Some(k); @@ -1409,20 +1397,6 @@ fn mmss(m: f32) -> String { format!("{}:{:02}", s / 60, s % 60) } -fn set_minutes(tt: &mut Timetable, trip: &str, m: f32) { - let t = tt.trip_mut(trip).unwrap(); - if t.profiles.is_empty() { - t.profiles.push(omsi_timetable::TripProfile { name: "standard".into(), ..Default::default() }); - } - t.profiles[0].factor = m; - // (a time fixed at the last stop is the trip's time) - let last = t.stations.len() as i32 - 1; - for a in t.profiles[0].man_arr_time.iter_mut().filter(|a| a.0 == last) { - a.1 = m; - } - tt.touch_trip(trip); -} - fn time_edit(ui: &mut egui::Ui, t: &mut (u32, u32)) { ui.spacing_mut().item_spacing.x = 2.0; ui.add(egui::DragValue::new(&mut t.0).range(0..=47).custom_formatter(|v, _| format!("{:02}", v as i32))); diff --git a/src/ui_timetable/times.rs b/src/ui_timetable/times.rs new file mode 100644 index 0000000..b7c84fd --- /dev/null +++ b/src/ui_timetable/times.rs @@ -0,0 +1,190 @@ +//! A trip's time profiles (#116): the trip's time and the time from stop to stop of each, +//! and how each stop is served (#71: OMSI 2's five ways). + +use super::*; +use crate::timetable::profile; + +/// A profile for a trip that has none (OMSI's editor names it so). +fn standard(minutes: f32) -> omsi_timetable::TripProfile { + omsi_timetable::TripProfile { name: "standard".into(), factor: minutes, ..Default::default() } +} + +impl TimetableUi { + /// The trip's profiles, the one shown with its time from stop to stop (`legs`: the metres + /// between the stops; `route_len`: the way's length, to guess the time from). + pub(super) fn times_section(&mut self, ui: &mut egui::Ui, tt: &mut Timetable, name: &str, stations: &[i64], legs: &[f64], route_len: Option) { + let Some(t) = tt.trip(name).cloned() else { return }; + let n = stations.len(); + let count = t.profiles.len().max(1); + if self.profile >= count { + self.profile = 0; + } + let pi = self.profile; + let mut p = t.profiles.get(pi).cloned().unwrap_or_else(|| standard(10.0)); + if !(p.factor > 0.0) { + p.factor = 10.0; + } + let before = p.clone(); + let mut add = false; + let mut remove = false; + ui.add_space(6.0); + ui.horizontal_wrapped(|ui| { + ui.label(tr("Time profile", "Профиль времени")).on_hover_text(tr("A trip can have several profiles (rush hour, night…): each tour's departure says which one it runs to", "У рейса может быть несколько профилей (час пик, ночь…): каждое отправление выхода указывает, по какому оно идёт")); + egui::ComboBox::from_id_salt(("tt profile", lower(name))).selected_text(format!("{} · {}", p.name.trim(), mmss(p.factor))).width(170.0).show_ui(ui, |ui| { + for (k, x) in t.profiles.iter().enumerate() { + if ui.selectable_label(k == pi, format!("{} · {}", x.name.trim(), mmss(x.factor))).clicked() { + self.profile = k; + } + } + }); + ui.add(egui::TextEdit::singleline(&mut p.name).desired_width(90.0)).on_hover_text(tr("The profile's name", "Имя профиля")); + if small_button(ui, Icon::Copy, tr("A new profile, a copy of this one", "Новый профиль, копия этого")) { + add = true; + } + if count > 1 && small_button(ui, Icon::Delete, tr("Delete this profile (its departures run to the first)", "Удалить этот профиль (его отправления пойдут по первому)")) { + remove = true; + } + }); + // the trip's time + ui.horizontal(|ui| { + ui.label(tr("Trip time", "Время в пути")); + let mut m = p.factor; + if ui.add(egui::DragValue::new(&mut m).range(0.5..=600.0).speed(0.25).max_decimals(2).suffix(tr(" min", " мин"))).changed() { + profile::set_total(&mut p, n, m); + } + if let Some(len) = route_len { + let guess = ((len / 1000.0 / BUS_SPEED * 60.0) + 0.4 * n as f64).ceil().max(1.0) as f32; + if ui.button(format!("{} {guess:.0}", tr("Guess:", "Оценка:"))).on_hover_text(tr("From the route's length at the pace of a town bus", "По длине пути и темпу городского автобуса")).clicked() { + profile::set_total(&mut p, n, guess); + } + } + }); + // from stop to stop + if n >= 2 { + let times = timetable::stop_times(n, legs, &p); + let mut set: Option<(usize, Option)> = None; + let mut leg: Option<(usize, f32)> = None; + let mut clear = false; + egui::CollapsingHeader::new(icons::labelled(Icon::Schedule, tr("Times from stop to stop", "Время от остановки до остановки"))).id_salt(("tt times", lower(name))).default_open(true).show(ui, |ui| { + ui.label(RichText::new(tr("The time from the stop before can be set at each stop: the times after it move along, the trip's time with them. Times not set follow the distance between the fixed ones; at a fixed stop a bus that is early waits.", "У каждой остановки можно задать время от предыдущей: следующие времена сдвигаются, а с ними и время рейса. Незаданные времена следуют расстоянию между закреплёнными; на закреплённой остановке автобус, пришедший раньше, ждёт.")).small().color(TEXT_DIM)); + egui::Grid::new(("tt stop times", lower(name))).num_columns(4).striped(true).spacing(Vec2::new(12.0, 3.0)).show(ui, |ui| { + ui.label(RichText::new(tr("Stop", "Остановка")).small().color(TEXT_DIM)); + ui.label(RichText::new(tr("From the stop before", "От предыдущей")).small().color(TEXT_DIM)); + ui.label(RichText::new(tr("After departure", "После отправления")).small().color(TEXT_DIM)); + ui.label(""); + ui.end_row(); + for (i, (a, d, fixed)) in times.iter().enumerate() { + let label = format!("{:>2}. {}", i + 1, self.stop_name(tt, stations[i])); + ui.allocate_ui_with_layout(Vec2::new(220.0, 18.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { + ui.set_min_width(220.0); + ui.add(egui::Label::new(label).truncate()); + }); + let at = if i + 1 == n { *a } else { *d }; + if i > 0 { + let mut m = *a - times[i - 1].1; + if ui.add(egui::DragValue::new(&mut m).range(0.0..=600.0).speed(0.05).max_decimals(2).suffix(tr(" min", " мин"))).on_hover_text(tr("Minutes from the stop before to this one", "Минуты от предыдущей остановки до этой")).changed() { + leg = Some((i, m)); + } + } else { + ui.label(""); + } + ui.label(RichText::new(format!("+{}", mmss(at))).color(if *fixed { Color32::from_gray(235) } else { TEXT_DIM })); + if i > 0 && i + 1 < n && check(ui, *fixed, tr("fixed", "закреплено")) { + set = Some((i, if *fixed { None } else { Some((at * 2.0).round() / 2.0) })); + } else if i == 0 || i + 1 == n { + ui.label(""); + } + ui.end_row(); + } + }); + if times.iter().skip(1).take(n.saturating_sub(2)).any(|t| t.2) && ui.button(tr("Spread all by distance", "Распределить по расстоянию")).clicked() { + clear = true; + } + }); + if clear { + p.man_arr_time.clear(); + p.man_dep_time.clear(); + } + if let Some((i, m)) = set { + timetable::set_stop_time(&mut p, n, i, m); + } + if let Some((i, m)) = leg { + profile::set_leg(&mut p, n, legs, i, m); + } + } + if add { + if let Some(k) = tt.add_profile(name, pi) { + self.profile = k; + } + return; + } + if remove { + tt.remove_profile(name, pi); + self.profile = 0; + return; + } + if p.name.trim().is_empty() { + p.name = before.name.clone(); + } + if p != before { + let tm = tt.trip_mut(name).unwrap(); + if tm.profiles.is_empty() { + tm.profiles.push(standard(10.0)); + } + if let Some(slot) = tm.profiles.get_mut(pi) { + *slot = p; + } + tt.touch_trip(name); + } + } + + /// How the bus serves each stop on this trip (`[profile_otherstopping]`, alike in all its + /// profiles). + pub(super) fn serve_section(&mut self, ui: &mut egui::Ui, tt: &mut Timetable, name: &str, stations: &[i64]) { + let Some(t) = tt.trip(name).cloned() else { return }; + let n = stations.len(); + if n < 2 { + return; + } + let p = t.profiles.get(self.profile).or(t.profiles.first()).cloned().unwrap_or_default(); + let mut serve: Option<(usize, i32)> = None; + egui::CollapsingHeader::new(icons::labelled(Icon::Bus, tr("How the stops are served", "Как обслуживаются остановки"))).id_salt(("tt serve", lower(name))).default_open(false).show(ui, |ui| { + ui.label(RichText::new(tr("As in OMSI 2's editor. Hover a choice to see what the bus does.", "Как в редакторе OMSI 2. Наведите на вариант, чтобы увидеть, что делает автобус.")).small().color(TEXT_DIM)); + egui::Grid::new(("tt serve grid", lower(name))).num_columns(2).striped(true).spacing(Vec2::new(12.0, 3.0)).show(ui, |ui| { + for i in 0..n { + ui.allocate_ui_with_layout(Vec2::new(220.0, 18.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { + ui.set_min_width(220.0); + ui.add(egui::Label::new(format!("{:>2}. {}", i + 1, self.stop_name(tt, stations[i]))).truncate()); + }); + let cur = p.other_stopping.iter().find(|x| x.0 == i as i32).map(|x| x.1).unwrap_or(0); + let mut v = cur; + egui::ComboBox::from_id_salt(("tt serve one", lower(name), i)).selected_text(crate::stops::StopKind::of_serve(cur).unwrap_or("?")).width(250.0).show_ui(ui, |ui| { + for k in crate::stops::StopKind::SERVE { + ui.selectable_value(&mut v, k, crate::stops::StopKind::of_serve(k).unwrap_or("?")).on_hover_text(crate::stops::StopKind::serve_hint(k)); + } + }) + .response + .on_hover_text(crate::stops::StopKind::serve_hint(cur)); + if v != cur { + serve = Some((i, v)); + } + ui.end_row(); + } + }); + }); + if let Some((i, v)) = serve { + let tm = tt.trip_mut(name).unwrap(); + if tm.profiles.is_empty() { + tm.profiles.push(standard(10.0)); + } + for p in &mut tm.profiles { + p.other_stopping.retain(|x| x.0 != i as i32); + if v != 0 { + p.other_stopping.push((i as i32, v)); + } + p.other_stopping.sort_by_key(|x| x.0); + } + tt.touch_trip(name); + } + } +} diff --git a/src/ui_timetable/trips.rs b/src/ui_timetable/trips.rs new file mode 100644 index 0000000..60fa91b --- /dev/null +++ b/src/ui_timetable/trips.rs @@ -0,0 +1,77 @@ +//! Every trip of the map in one list, whichever line or tour drives it (#71): a trip no +//! tour drives stays there to be edited, used or deleted. + +use super::*; + +/// How many departures of the tours drive trip `name`. +fn departures(tt: &Timetable, name: &str) -> usize { + tt.lines.iter().flat_map(|l| l.tours.iter()).flat_map(|t| t.trips.iter()).filter(|x| x.trip.eq_ignore_ascii_case(name)).count() +} + +impl TimetableUi { + pub(super) fn show_all_trips(&mut self, tt: &Timetable) { + self.all_trips = true; + self.line = None; + self.tour = None; + self.picking = false; + self.way_edit = false; + if self.trip.as_ref().map(|t| tt.trip(t).is_none()).unwrap_or(false) { + self.select_trip(None); + } + } + + pub(super) fn all_trips_panel(&mut self, ui: &mut egui::Ui, doc: &mut Document, toasts: &mut Vec, actions: &mut Vec) { + heading(ui, tr("All trips", "Все рейсы")); + ui.label(RichText::new(tr("Every trip of the map, whichever line shows it or tour drives it. A trip no tour drives is kept, and can be edited, given to a tour or deleted here.", "Все рейсы карты, какая бы линия их ни показывала и какой бы выход ни ездил. Рейс, по которому не ездит ни один выход, сохраняется: его можно править, дать выходу или удалить здесь.")).small().color(TEXT_DIM)); + ui.horizontal(|ui| { + ui.add(egui::TextEdit::singleline(&mut self.trip_filter).hint_text(tr("Search", "Поиск")).desired_width(180.0)); + if ui.button(icons::labelled(Icon::Add, tr("New trip", "Новый рейс"))).clicked() { + let name = doc.timetable.add_trip("", tr("Trip", "Рейс"), Vec::new()); + self.select_trip(Some(name)); + self.picking = true; + } + }); + let f = self.trip_filter.to_lowercase(); + let mut names: Vec<(String, String, usize, usize)> = doc + .timetable + .trips + .iter() + .filter(|t| f.is_empty() || t.name.to_lowercase().contains(&f) || t.line.to_lowercase().contains(&f) || t.terminus.to_lowercase().contains(&f)) + .map(|t| (t.name.clone(), t.line.trim().to_string(), t.stations.len().max(t.stations_legacy.len()), departures(&doc.timetable, &t.name))) + .collect(); + names.sort_by_key(|x| x.0.to_lowercase()); + let unused = doc.timetable.trips.iter().filter(|t| departures(&doc.timetable, &t.name) == 0).count(); + ui.label(RichText::new(format!("{} {} · {} {}", doc.timetable.trips.len(), tr("trips", "рейсов"), unused, tr("driven by no tour", "без выходов"))).small().color(TEXT_DIM)); + egui::ScrollArea::vertical().id_salt("tt all trips").max_height(240.0).show(ui, |ui| { + egui::Grid::new("tt all trips grid").num_columns(4).striped(true).spacing(Vec2::new(10.0, 2.0)).show(ui, |ui| { + for (name, line, stops, deps) in &names { + let on = self.trip.as_deref().map(|x| x.eq_ignore_ascii_case(name)).unwrap_or(false); + let warn = self.problems.contains_key(&lower(name)); + if ui.add(egui::Button::selectable(on, icons::labelled(if warn { Icon::Warning } else { Icon::Route }, name))).clicked() && !on { + self.select_trip(Some(name.clone())); + } + ui.label(RichText::new(if line.is_empty() { "–".to_string() } else { format!("{} {line}", tr("line", "линия")) }).color(TEXT_DIM)); + ui.label(RichText::new(format!("{stops} {}", tr("stops", "ост."))).color(TEXT_DIM)); + if *deps == 0 { + ui.label(RichText::new(tr("no tour", "нет выходов")).color(WARN)); + } else { + ui.label(RichText::new(format!("{deps} {}", tr("departures", "отпр."))).color(TEXT_DIM)); + } + ui.end_row(); + } + }); + }); + if let Some(t) = self.trip.clone() { + if doc.timetable.trip(&t).is_some() { + ui.add_space(4.0); + let line = doc.timetable.trip(&t).map(|x| x.line.trim().to_string()).unwrap_or_default(); + egui::Frame::group(ui.style()).show(ui, |ui| { + ui.set_width(ui.available_width()); + self.trip_panel(ui, doc, &line, &t, toasts, actions); + }); + } else { + self.trip = None; + } + } + } +} diff --git a/src/ui_timetable/way.rs b/src/ui_timetable/way.rs new file mode 100644 index 0000000..b38bd69 --- /dev/null +++ b/src/ui_timetable/way.rs @@ -0,0 +1,148 @@ +//! A trip's way picked by hand (#122, #71): the paths clicked in the view one after the +//! other as in OMSI 2's editor, before the first stop and after the last as well, and where +//! two paths of the way do not join (the game's bus loses its way there). + +use super::*; +use crate::timetable::way; + +/// How near a click must be to a path to pick it (m). +const PATH_REACH: f64 = 8.0; + +/// The lanes of the trip's saved track (None: it has none, or a path of it is not on the map). +pub(super) fn saved_lanes(net: &Network, doc: &Document, name: &str) -> Option> { + let track = doc.timetable.track(name)?; + way::lanes_of_track(net, &track.entries, &doc.order).into_iter().collect() +} + +/// The way of a trip along `lanes`, its stops found on it, kept as the trip's (picked by +/// hand): its track, and the station links where every stop lies on it. +pub(super) fn keep_by_hand(net: &Network, files: &mut Files, doc: &mut Document, name: &str, lanes: &[usize]) -> Route { + let stations = doc.timetable.trip(name).map(|t| t.stations.clone()).unwrap_or_default(); + let pos: Vec> = stations.iter().map(|id| timetable::stop_world(doc, files, *id)).collect(); + let r = way::along(net, lanes, &pos, doc.global.left_hand_traffic); + let links = if r.stops.len() == stations.len() && stations.len() >= 2 { r.links(net, &doc.order, &stations) } else { Vec::new() }; + doc.timetable.set_by_hand(name, Some((r.track(net, &doc.order), links))); + r +} + +impl TimetableUi { + /// The lanes the trip drives now: picked by hand, else as found. + fn way_lanes(&self, doc: &Document, name: &str) -> Vec { + let Some(net) = &self.net else { return Vec::new() }; + if doc.timetable.by_hand(name) { + return saved_lanes(net, doc, name).unwrap_or_default(); + } + self.shown.as_ref().filter(|s| s.0.eq_ignore_ascii_case(name) && s.3.ok()).map(|s| s.3.lanes.clone()).unwrap_or_default() + } + + /// The trip's way set to `lanes`, picked by hand from now on. + fn set_way(&mut self, doc: &mut Document, name: &str, lanes: &[usize]) { + let Some(net) = &self.net else { return }; + let r = keep_by_hand(net, &mut self.files, doc, name, lanes); + if r.problems.is_empty() { + self.problems.remove(&lower(name)); + } else { + self.problems.insert(lower(name), r.problems); + } + self.routed.remove(&lower(name)); + self.shown = None; + } + + /// While the paths are being picked, a click in the view puts the path under it into the + /// way, or takes it out (see [`way::with_lane`]). + pub(super) fn click_path(&mut self, ed: &mut Editor) { + let Some((_, at)) = ed.picked.take() else { return }; + let (Some(p), Some(name)) = (at, self.trip.clone()) else { return }; + let Some(doc) = ed.doc.as_mut() else { return }; + let Some(net) = &self.net else { return }; + let ways = self.ways.get(&lower(&name)).copied().or_else(|| self.shown.as_ref().filter(|s| s.0 == name).and_then(|s| s.3.ways)).unwrap_or(Ways::Road); + let Some(l) = way::lane_at(net, p, PATH_REACH, ways, doc.global.left_hand_traffic) else { + ed.toasts.push(crate::editor::Toast { text: tr("No path there: click a lane of a road (View > AI lanes shows them)", "Здесь нет пути: кликните по полосе дороги (Вид > Полосы ИИ показывает их)").into(), at: std::time::Instant::now(), error: true }); + return; + }; + let lanes = self.way_lanes(doc, &name); + let new = way::with_lane(net, &lanes, l); + self.set_way(doc, &name, &new); + } + + /// The trip's way: found along the roads or picked by hand, its paths, and where it breaks. + pub(super) fn way_section(&mut self, ui: &mut egui::Ui, doc: &mut Document, name: &str, actions: &mut Vec) { + let Some(net) = &self.net else { return }; + let hand = doc.timetable.by_hand(name); + let lanes = self.way_lanes(doc, name); + ui.add_space(4.0); + ui.horizontal_wrapped(|ui| { + let label = if self.way_edit { tr("Done picking paths", "Готово") } else { tr("Pick the paths on the map", "Выбрать пути на карте") }; + if ui.add(egui::Button::selectable(self.way_edit, icons::labelled(Icon::Route, label))).on_hover_text(tr("Choose the way yourself, path by path, as in OMSI 2's editor", "Выберите путь сами, путь за путём, как в редакторе OMSI 2")).clicked() { + self.way_edit = !self.way_edit; + self.picking = false; + } + if hand && ui.button(tr("Find the way automatically", "Найти путь автоматически")).on_hover_text(tr("Forget the paths picked: the way is found along the roads again", "Забыть выбранные пути: путь снова найдётся по дорогам")).clicked() { + doc.timetable.set_by_hand(name, None); + self.way_edit = false; + self.shown = None; + } + }); + if hand { + ui.label(RichText::new(tr("The paths were picked by hand: they are kept when the stops change.", "Пути выбраны вручную: они сохраняются при изменении остановок.")).small().color(TEXT_DIM)); + } + if self.way_edit { + ui.label(RichText::new(tr("Click paths in the view. One after the end or before the start is added, with the paths to it; one beside the way takes the place of the part it goes round (another branch at a junction); a path of the way is taken out. The way may run on before the first stop and after the last.", "Кликайте пути на карте. Путь после конца или перед началом добавляется вместе с путями до него; путь в стороне заменяет участок, который он объезжает (другая ветка на перекрёстке); путь из маршрута убирается. Путь может идти и до первой остановки, и после последней.")).small().color(ACCENT)); + } + // where the way breaks + let gaps = way::gaps(net, &lanes); + for &(k, m) in &gaps { + ui.horizontal(|ui| { + let text = format!("{} {} ({:.1} m): {}", tr("The way breaks after path", "Путь прерывается после пути"), k + 1, m, tr("the paths do not join, the bus's GPS loses its way here in the game", "пути не соединены, GPS автобуса в игре здесь теряет маршрут")); + ui.label(coloured(icons::labelled(Icon::Warning, &text), WARN)); + if small_button(ui, Icon::Focus, tr("Show on the map", "Показать на карте")) { + actions.push(Action::LookAt(net.lanes[lanes[k]].pts.last().unwrap().truncate())); + } + }); + } + if lanes.is_empty() { + return; + } + let mut remove: Option> = None; + let shown = self.shown.as_ref().filter(|s| s.0 == name).map(|s| s.3.clone()); + egui::CollapsingHeader::new(format!("{} ({})", tr("Paths of the way", "Пути маршрута"), lanes.len())).id_salt(("tt way paths", lower(name))).default_open(false).show(ui, |ui| { + // (where the stops are, to trim the way before the first and after the last) + let stop_at: Vec = shown.as_ref().filter(|r| r.lanes == lanes).map(|r| r.stops.iter().map(|s| s.0).collect()).unwrap_or_default(); + ui.horizontal(|ui| { + if let (Some(&a), Some(&b)) = (stop_at.first(), stop_at.last()) { + if ui.add_enabled(a > 0, egui::Button::new(tr("Cut before the first stop", "Убрать до первой остановки"))).clicked() { + remove = Some(lanes[a..].to_vec()); + } + if ui.add_enabled(b + 1 < lanes.len(), egui::Button::new(tr("Cut after the last stop", "Убрать после последней остановки"))).clicked() { + remove = Some(lanes[..=b].to_vec()); + } + } + }); + egui::ScrollArea::vertical().id_salt(("tt way list", lower(name))).max_height(260.0).show(ui, |ui| { + for (k, &l) in lanes.iter().enumerate() { + let lane = &net.lanes[l]; + ui.horizontal(|ui| { + let what = if lane.spline { tr("spline", "сплайн") } else { tr("object", "объект") }; + let stop = stop_at.contains(&k); + let text = format!("{:>3}. {} {} · {} {} · {:.0} m{}", k + 1, what, lane.key.id, tr("path", "путь"), lane.key.path, lane.length(), if stop { " ●" } else { "" }); + let broken = gaps.iter().any(|g| g.0 == k); + ui.label(RichText::new(text).monospace().color(if broken { WARN } else { Color32::from_gray(210) })); + ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { + if small_button(ui, Icon::Delete, tr("Take out", "Убрать")) { + let mut v = lanes.clone(); + v.remove(k); + remove = Some(v); + } + if small_button(ui, Icon::Focus, tr("Show on the map", "Показать на карте")) { + actions.push(Action::LookAt(lane.point_at(lane.length() * 0.5).truncate())); + } + }); + }); + } + }); + }); + if let Some(v) = remove { + self.set_way(doc, name, &v); + } + } +} diff --git a/tools/make-installer.sh b/tools/make-installer.sh index 6e14c48..b348b2b 100644 --- a/tools/make-installer.sh +++ b/tools/make-installer.sh @@ -7,6 +7,7 @@ cd "$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)" dist="${1:?folder with openmapper.exe}" out="${2:-target/package/openMapper-setup.exe}" version="${OPENMAPPER_VERSION:-$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)}" +case "$dist" in *arm64*) arch=arm64 ;; *) arch=x64 ;; esac mkdir -p "$(dirname "$out")" -makensis -V2 -NOCD -DDIST="$dist" -DOUT="$out" -DVERSION="$version" tools/windows/installer.nsi +makensis -V2 -NOCD -DDIST="$dist" -DOUT="$out" -DVERSION="$version" -DARCH="$arch" tools/windows/installer.nsi echo "$out" diff --git a/tools/windows/installer.nsi b/tools/windows/installer.nsi index 9379cab..1fcc217 100644 --- a/tools/windows/installer.nsi +++ b/tools/windows/installer.nsi @@ -4,6 +4,7 @@ RequestExecutionLevel user SetCompressor /SOLID lzma !include "MUI2.nsh" +!include "x64.nsh" !define UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\openMapper" @@ -26,6 +27,22 @@ BrandingText "openMapper ${VERSION}" !define MUI_ABORTWARNING !define MUI_FINISHPAGE_RUN "$INSTDIR\openmapper.exe" +; (a program built for the other processor only says "This app can't run on your PC" when +; started: the installer says which package this computer needs instead, #102) +Function .onInit +!if "${ARCH}" == "arm64" + ${IfNot} ${IsNativeARM64} + MessageBox MB_ICONSTOP "This is openMapper for ARM64 processors. This computer has an Intel or AMD processor: download openMapper-${VERSION}-windows-x64-setup.exe instead.$\r$\n$\r$\nЭто openMapper для процессоров ARM64. В этом компьютере процессор Intel или AMD: скачайте openMapper-${VERSION}-windows-x64-setup.exe." + Abort + ${EndIf} +!else + ${IfNot} ${RunningX64} + MessageBox MB_ICONSTOP "openMapper needs a 64-bit Windows 10 or 11; this Windows is 32-bit.$\r$\n$\r$\nopenMapper нужна 64-битная Windows 10 или 11, а эта Windows 32-битная." + Abort + ${EndIf} +!endif +FunctionEnd + !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES