From 4fd986bd072546cf8ee41e9d233d5e7fe7501680 Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 9 Jan 2024 18:38:30 +0000 Subject: [PATCH 1/9] Update: Translations from eints english (au): 7 changes by krysclarke english (us): 7 changes by 2TallTyler chinese (simplified): 6 changes by WenSimEHRP serbian: 39 changes by DoLoop216 russian: 3 changes by Ln-Wolf finnish: 4 changes by hpiirai portuguese: 10 changes by azulcosta polish: 34 changes by pAter-exe --- src/lang/english_AU.txt | 13 ++++---- src/lang/english_US.txt | 13 ++++---- src/lang/finnish.txt | 7 +++-- src/lang/polish.txt | 56 ++++++++++++++++++++------------- src/lang/portuguese.txt | 16 ++++++---- src/lang/russian.txt | 5 +-- src/lang/serbian.txt | 39 +++++++++++++++++++++++ src/lang/simplified_chinese.txt | 11 ++++--- 8 files changed, 110 insertions(+), 50 deletions(-) diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index 2a3e4bfcac..ceeec96b0c 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -771,7 +771,7 @@ STR_SMALLMAP_LEGENDA_AIRCRAFT :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_TRANSPORT_ROUTES :{TINY_FONT}{BLACK}Transport Routes STR_SMALLMAP_LEGENDA_FOREST :{TINY_FONT}{BLACK}Forest STR_SMALLMAP_LEGENDA_RAILROAD_STATION :{TINY_FONT}{BLACK}Railway Station -STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY :{TINY_FONT}{BLACK}Truck Loading Bay +STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY :{TINY_FONT}{BLACK}Lorry Station STR_SMALLMAP_LEGENDA_BUS_STATION :{TINY_FONT}{BLACK}Bus Station STR_SMALLMAP_LEGENDA_AIRPORT_HELIPORT :{TINY_FONT}{BLACK}Airport/Heliport STR_SMALLMAP_LEGENDA_DOCK :{TINY_FONT}{BLACK}Dock @@ -1002,6 +1002,7 @@ STR_GAME_OPTIONS_CURRENCY_HKD :Hong Kong Dolla STR_GAME_OPTIONS_CURRENCY_INR :Indian Rupee STR_GAME_OPTIONS_CURRENCY_IDR :Indonesian Rupiah STR_GAME_OPTIONS_CURRENCY_MYR :Malaysian Ringgit +STR_GAME_OPTIONS_CURRENCY_LVL :Latvian Lats STR_GAME_OPTIONS_AUTOSAVE_FRAME :{BLACK}Autosave STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Select interval between automatic game saves @@ -2723,9 +2724,9 @@ STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :Maglev Construc STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Build railway track. Ctrl toggles build/remove for railway construction. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Build railway track using the Autorail mode. Ctrl toggles build/remove for railway construction. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Build train depot (for buying and servicing trains). Shift toggles building/showing cost estimate -STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Convert rail to waypoint. Ctrl enables joining waypoints. Shift toggles building/showing cost estimate +STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Build waypoint on railway. Ctrl enables joining waypoints. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Build railway station. Ctrl enables joining stations. Shift toggles building/showing cost estimate -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Build railway signals. Ctrl toggles semaphore/light signals{}Dragging builds signals along a straight stretch of rail. Ctrl builds signals till the next junction{}Ctrl+Click toggles opening the signal selection window. Shift toggles building/showing cost estimate +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Build signal on railway. Ctrl toggles semaphore/light signals{}Dragging builds signals along a straight stretch of rail. Ctrl builds signals up to the next junction or signal{}Ctrl+Click toggles opening the signal selection window. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Build railway bridge. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Build railway tunnel. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR :{BLACK}Toggle build/remove for railway track, signals, waypoints and stations. Hold Ctrl to also remove the rail of waypoints and stations @@ -2813,7 +2814,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Build ro STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Build tram vehicle depot (for buying and servicing vehicles). Shift toggles building/showing cost estimate STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Build bus station. Ctrl enables joining stations. Shift toggles building/showing cost estimate STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Build passenger tram station. Ctrl enables joining stations. Shift toggles building/showing cost estimate -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Build Truck loading bay. Ctrl enables joining stations. Shift toggles building/showing cost estimate +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Build lorry station. Ctrl enables joining stations. Shift toggles building/showing cost estimate STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Build freight tram station. Ctrl enables joining stations. Shift toggles building/showing cost estimate STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_ONE_WAY_ROAD :{BLACK}Activate/Deactivate one way roads STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Build road bridge. Shift toggles building/showing cost estimate @@ -2838,7 +2839,7 @@ STR_BUILD_DEPOT_TRAM_ORIENTATION_SELECT_TOOLTIP :{BLACK}Select t STR_STATION_BUILD_BUS_ORIENTATION :{WHITE}Bus Station Orientation STR_STATION_BUILD_BUS_ORIENTATION_TOOLTIP :{BLACK}Select bus station orientation STR_STATION_BUILD_TRUCK_ORIENTATION :{WHITE}Truck Station Orientation -STR_STATION_BUILD_TRUCK_ORIENTATION_TOOLTIP :{BLACK}Select Truck loading bay orientation +STR_STATION_BUILD_TRUCK_ORIENTATION_TOOLTIP :{BLACK}Select lorry station orientation STR_STATION_BUILD_PASSENGER_TRAM_ORIENTATION :{WHITE}Passenger Tram Station Orientation STR_STATION_BUILD_PASSENGER_TRAM_ORIENTATION_TOOLTIP :{BLACK}Select passenger tram station orientation STR_STATION_BUILD_CARGO_TRAM_ORIENTATION :{WHITE}Freight Tram Station Orientation @@ -3082,7 +3083,7 @@ STR_LAI_TREE_NAME_CACTUS_PLANTS :Cactus plants STR_LAI_STATION_DESCRIPTION_RAILROAD_STATION :Railway station STR_LAI_STATION_DESCRIPTION_AIRCRAFT_HANGAR :Aircraft hangar STR_LAI_STATION_DESCRIPTION_AIRPORT :Airport -STR_LAI_STATION_DESCRIPTION_TRUCK_LOADING_AREA :Truck loading area +STR_LAI_STATION_DESCRIPTION_TRUCK_LOADING_AREA :Lorry station STR_LAI_STATION_DESCRIPTION_BUS_STATION :Bus station STR_LAI_STATION_DESCRIPTION_SHIP_DOCK :Ship dock STR_LAI_STATION_DESCRIPTION_BUOY :Buoy diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 2e6aded8b2..74201473de 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -771,7 +771,7 @@ STR_SMALLMAP_LEGENDA_AIRCRAFT :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_TRANSPORT_ROUTES :{TINY_FONT}{BLACK}Transport Routes STR_SMALLMAP_LEGENDA_FOREST :{TINY_FONT}{BLACK}Forest STR_SMALLMAP_LEGENDA_RAILROAD_STATION :{TINY_FONT}{BLACK}Railroad Station -STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY :{TINY_FONT}{BLACK}Truck Loading Bay +STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY :{TINY_FONT}{BLACK}Truck Station STR_SMALLMAP_LEGENDA_BUS_STATION :{TINY_FONT}{BLACK}Bus Station STR_SMALLMAP_LEGENDA_AIRPORT_HELIPORT :{TINY_FONT}{BLACK}Airport/Heliport STR_SMALLMAP_LEGENDA_DOCK :{TINY_FONT}{BLACK}Dock @@ -1002,6 +1002,7 @@ STR_GAME_OPTIONS_CURRENCY_HKD :Hong Kong Dolla STR_GAME_OPTIONS_CURRENCY_INR :Indian Rupee STR_GAME_OPTIONS_CURRENCY_IDR :Indonesian Rupiah STR_GAME_OPTIONS_CURRENCY_MYR :Malaysian Ringgit +STR_GAME_OPTIONS_CURRENCY_LVL :Latvian Lats STR_GAME_OPTIONS_AUTOSAVE_FRAME :{BLACK}Autosave STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Select interval between automatic game saves @@ -2723,9 +2724,9 @@ STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :Maglev Construc STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Build railroad track. Ctrl toggles build/remove for railroad construction. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Build railroad track using the Autorail mode. Ctrl toggles build/remove for railroad construction. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Build train depot (for buying and maintaining trains). Shift toggles building/showing cost estimate -STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Convert rail to waypoint. Ctrl enables joining waypoints. Shift toggles building/showing cost estimate +STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Build waypoint on railway. Ctrl enables joining waypoints. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Build railroad station. Ctrl enables joining stations. Shift toggles building/showing cost estimate -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Build railroad signals. Ctrl toggles semaphore/light signals{}Dragging builds signals along a straight stretch of track. Ctrl builds signals up to the next junction or signal{}Ctrl+Click toggles opening the signal selection window. Shift toggles building/showing cost estimate +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Build signal on railway. Ctrl toggles semaphore/light signals{}Dragging builds signals along a straight stretch of rail. Ctrl builds signals up to the next junction or signal{}Ctrl+Click toggles opening the signal selection window. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Build railroad bridge. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Build railroad tunnel. Shift toggles building/showing cost estimate STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR :{BLACK}Toggle build/remove for railroad track, signals, waypoints and stations. Hold Ctrl to also remove the rail of waypoints and stations @@ -2813,7 +2814,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Build ro STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Build tram vehicle depot (for buying and servicing vehicles). Shift toggles building/showing cost estimate STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Build bus station. Ctrl enables joining stations. Shift toggles building/showing cost estimate STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Build passenger streetcar station. Ctrl enables joining stations. Shift toggles building/showing cost estimate -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Build truck loading bay. Ctrl enables joining stations. Shift toggles building/showing cost estimate +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Build truck station. Ctrl enables joining stations. Shift toggles building/showing cost estimate STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Build freight streetcar station. Ctrl enables joining stations. Shift toggles building/showing cost estimate STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_ONE_WAY_ROAD :{BLACK}Activate/Deactivate one way roads STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Build road bridge. Shift toggles building/showing cost estimate @@ -2838,7 +2839,7 @@ STR_BUILD_DEPOT_TRAM_ORIENTATION_SELECT_TOOLTIP :{BLACK}Select s STR_STATION_BUILD_BUS_ORIENTATION :{WHITE}Bus Station Orientation STR_STATION_BUILD_BUS_ORIENTATION_TOOLTIP :{BLACK}Select bus station orientation STR_STATION_BUILD_TRUCK_ORIENTATION :{WHITE}Truck Station Orientation -STR_STATION_BUILD_TRUCK_ORIENTATION_TOOLTIP :{BLACK}Select truck loading bay orientation +STR_STATION_BUILD_TRUCK_ORIENTATION_TOOLTIP :{BLACK}Select truck station orientation STR_STATION_BUILD_PASSENGER_TRAM_ORIENTATION :{WHITE}Passenger Streetcar Station Orientation STR_STATION_BUILD_PASSENGER_TRAM_ORIENTATION_TOOLTIP :{BLACK}Select passenger streetcar station orientation STR_STATION_BUILD_CARGO_TRAM_ORIENTATION :{WHITE}Freight Streetcar Station Orientation @@ -3082,7 +3083,7 @@ STR_LAI_TREE_NAME_CACTUS_PLANTS :Cactuses STR_LAI_STATION_DESCRIPTION_RAILROAD_STATION :Railroad station STR_LAI_STATION_DESCRIPTION_AIRCRAFT_HANGAR :Aircraft hangar STR_LAI_STATION_DESCRIPTION_AIRPORT :Airport -STR_LAI_STATION_DESCRIPTION_TRUCK_LOADING_AREA :Truck loading area +STR_LAI_STATION_DESCRIPTION_TRUCK_LOADING_AREA :Truck station STR_LAI_STATION_DESCRIPTION_BUS_STATION :Bus station STR_LAI_STATION_DESCRIPTION_SHIP_DOCK :Ship dock STR_LAI_STATION_DESCRIPTION_BUOY :Buoy diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index 379a33a741..e89aed2e72 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -1002,6 +1002,7 @@ STR_GAME_OPTIONS_CURRENCY_HKD :Hongkongin doll STR_GAME_OPTIONS_CURRENCY_INR :Intian rupia STR_GAME_OPTIONS_CURRENCY_IDR :Indonesian rupia STR_GAME_OPTIONS_CURRENCY_MYR :Malesian ringgit +STR_GAME_OPTIONS_CURRENCY_LVL :Latvian lati STR_GAME_OPTIONS_AUTOSAVE_FRAME :{BLACK}Automaattitallennus STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Valitse aikaväli automaattisille pelitallennuksille @@ -2723,9 +2724,9 @@ STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :Maglevin rakent STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Rakenna rautateitä. Ctrl vaihtaa rakennus-/poistotilan välillä. Shift vaihtaa rakennustilan ja kustannusarvion välillä STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Rakenna rautatietä automaattisesti valittuun suuntaan. Ctrl vaihtaa rakennus-/poistotilan välillä. Shift vaihtaa rakennustilan ja kustannusarvion välillä STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Rakenna veturitalli (junien ostamista ja huoltoa varten). Shift vaihtaa rakennustilan ja kustannusarvion välillä -STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Muunna raide reittipisteeksi. Ctrl liittää reittipisteet. Shift vaihtaa muuntotilan ja kustannusarvion välillä +STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Rakenna reittipiste rautatielle. Ctrl mahdollistaa reittipisteiden yhdistämisen. Shift vaihtaa rakennustilan ja kustannusarvion välillä STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Rakenna rautatieasema. Ctrl liittää asemat. Shift vaihtaa rakennustilan ja kustannusarvion välillä -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Rakenna opastimia. Ctrl vaihtaa siipi- ja valo-opastimien välillä{}Vetäminen rakentaa opastimia suoralle rataosuudelle. Ctrl rakentaa opastimia seuraavaan risteykseen tai opastimeen saakka{}Ctrl+napsautus avaa opastimenvalintaikkunan. Shift vaihtaa rakennustilan ja kustannusarvion välillä +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Rakenna opastin rautatielle. Ctrl vaihtaa siipi- ja valo-opastimien välillä{}Vetäminen rakentaa opastimia suoralle rataosuudelle. Ctrl rakentaa opastimia seuraavaan risteykseen tai opastimeen saakka{}Ctrl+napsautus avaa opastimenvalintaikkunan. Shift vaihtaa rakennustilan ja kustannusarvion välillä STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Rakenna rautatiesilta. Shift vaihtaa rakennustilan ja kustannusarvion välillä STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Rakenna rautatietunneli. Shift vaihtaa rakennustilan ja kustannusarvion välillä STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR :{BLACK}Rautatien, opastimien, reittipisteiden ja asemien rakentaminen/poisto päälle/pois. Pidä pohjassa Ctrl-näppäintä poistaaksesi myös aseman tai reittipisteen alla olevat raiteet @@ -2813,7 +2814,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Rakenna STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Rakenna raitiotievarikko (vaunujen ostamiseen ja korjaamiseen). Shift vaihtaa rakennustilan ja kustannusarvion välillä STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Rakenna linja-autoasema. Ctrl liittää asemat. Shift vaihtaa rakennustilan ja kustannusarvion välillä STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Rakenna raitiotien matkustaja-asema. Ctrl liittää asemat. Shift vaihtaa rakennustilan ja kustannusarvion välillä -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Rakenna lastauslaituri. Ctrl liittää asemat. Shift vaihtaa rakennustilan ja kustannusarvion välillä +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Rakenna lastauslaituri. Ctrl mahdollistaa laitureiden yhdistämisen yhdeksi asemaksi. Shift vaihtaa rakennustilan ja kustannusarvion välillä STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Rakenna raitiotien rahtiasema. Ctrl liittää asemat. Shift vaihtaa rakennustilan ja kustannusarvion välillä STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_ONE_WAY_ROAD :{BLACK}Ota yksisuuntaiset tiet käyttöön/pois käytöstä STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Rakenna maantiesilta. Shift vaihtaa rakennustilan ja kustannusarvion välillä diff --git a/src/lang/polish.txt b/src/lang/polish.txt index dbe8982667..7308ec4b87 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -1151,7 +1151,7 @@ STR_SMALLMAP_LEGENDA_TRANSPORT_ROUTES :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_FOREST :{G=m}{TINY_FONT}{BLACK}Las STR_SMALLMAP_LEGENDA_FOREST.d :{TINY_FONT}{BLACK}Lasu STR_SMALLMAP_LEGENDA_RAILROAD_STATION :{TINY_FONT}{BLACK}Stacja kolejowa -STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY :{TINY_FONT}{BLACK}Załadunek ciężarówek +STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY :{TINY_FONT}{BLACK}Stacja ciężarówek STR_SMALLMAP_LEGENDA_BUS_STATION :{TINY_FONT}{BLACK}Przystanek STR_SMALLMAP_LEGENDA_AIRPORT_HELIPORT :{TINY_FONT}{BLACK}Lotnisko STR_SMALLMAP_LEGENDA_DOCK :{TINY_FONT}{BLACK}Port @@ -1382,6 +1382,7 @@ STR_GAME_OPTIONS_CURRENCY_HKD :Dolar hongkońs STR_GAME_OPTIONS_CURRENCY_INR :Rupia Indyjska STR_GAME_OPTIONS_CURRENCY_IDR :Rupia Indonezyjska STR_GAME_OPTIONS_CURRENCY_MYR :Ringgit malezyjski +STR_GAME_OPTIONS_CURRENCY_LVL :Łat łotewski STR_GAME_OPTIONS_AUTOSAVE_FRAME :{BLACK}Autozapis STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Częstotliwość automatycznego zapisu stanu gry @@ -1748,7 +1749,7 @@ STR_CONFIG_SETTING_SHOWFINANCES_HELPTEXT :Jeśli włączo STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT :Nowe polecenia są domyślnie „bez zatrzymywania się”: {STRING} STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT_HELPTEXT :Normalnie pojazd zatrzyma się na każdej stacji, przez którą przejeżdża. Po włączeniu tej opcji, pojazd przejedzie do swojego celu bez zatrzymywania się. Zwróć uwagę na to, że to ustawienie ma wpływ tylko na nowe polecenia. Pojedyncze polecenia mogą być ustalane bez względu na wartość tej opcji -STR_CONFIG_SETTING_STOP_LOCATION :Nowe rozkazy pociągu kończą się domyślnie na {STRING} peronu +STR_CONFIG_SETTING_STOP_LOCATION :Nowe polecenia pociągu domyślnie kończą się na {STRING} peronu STR_CONFIG_SETTING_STOP_LOCATION_HELPTEXT :Miejsce, w którym pociąg domyślnie zatrzyma się na peronie. „Początek” oznacza blisko wjazdu, „środek” oznacza środkową część peronu, a „koniec” oznacza daleko od wjazdu. Pamiętaj, że to ustawienie określa tylko domyślną wartość dla nowych poleceń. Miejsce zatrzymania poszczególnych poleceń można ustawić, klikając na tekst danego polecenia ###length 3 STR_CONFIG_SETTING_STOP_LOCATION_NEAR_END :początku @@ -1817,7 +1818,7 @@ STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Ostrzeż, jeśl STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT :Pokazuj wiadomości o pojazdach, które nie są w stanie znaleźć ścieżki do swoich wyznaczonych celów STR_CONFIG_SETTING_ORDER_REVIEW :Kontroluj polecenia pojazdów: {STRING} -STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :Kiedy włączone, rozkazy wszystkich pojazdów są sprawdzane co jakiś czas, a wykryte nieprawidłowości są zgłaszane w oknach wiadomości +STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :Kiedy włączone, polecenia wszystkich pojazdów są sprawdzane co jakiś czas, a wykryte nieprawidłowości są zgłaszane w oknach wiadomości ###length 3 STR_CONFIG_SETTING_ORDER_REVIEW_OFF :Nie STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :Tak, ale wyklucz zatrzymane @@ -1871,7 +1872,7 @@ STR_CONFIG_SETTING_LAND_GENERATOR_ORIGINAL :Oryginalny STR_CONFIG_SETTING_LAND_GENERATOR_TERRA_GENESIS :TerraGenesis STR_CONFIG_SETTING_TERRAIN_TYPE :Typ terenu: {STRING} -STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :Określa ukształtowanie terenu (tylko dla TerraGenesis) +STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :Wybierz wysokość wzgórz i gór w krajobrazie STR_CONFIG_SETTING_INDUSTRY_DENSITY :Liczba przedsiębiorstw: {STRING} STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Określa liczbę przedsiębiorstw na początku i w trakcie gry @@ -1880,18 +1881,18 @@ STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maksymalna odle STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Rafinerie są budowane tylko w pobliżu krawędzi map, to znaczy na wybrzeżach dla map wyspiarskich. To ustawienie pozwala ograniczyć jak daleko od krawędzi mapy mogą być budowane rafinerie i platformy wiertnicze. Na mapach większych niż 256 pól, wartość ta jest skalowana w górę. STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Wysokość granicy wiecznych śniegów: {STRING} -STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Wysokość linii śniegu w klimacie arktycznym. Poziom pokrywy śnieżnej wpływa na rozmieszczenie przedsiębiorstw i na warunki rozwoju miast. Może być zmodyfikowana poprzez Edytor Scenariuszy, w innym przypadku jest obliczana za pomocą ustawienia „pokrycie śniegiem” +STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Wybierz, na jakiej wysokości zaczyna zalegać śnieg w krajobrazie arktycznym. Poziom pokrywy śnieżnej wpływa na rozmieszczenie przedsiębiorstw i na warunki rozwoju miast. Może być zmodyfikowana poprzez Edytor Scenariuszy, w innym przypadku jest obliczana za pomocą ustawienia „pokrycie śniegiem” STR_CONFIG_SETTING_SNOW_COVERAGE :Pokrycie śniegiem: {STRING} -STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT :Ustawia przybliżoną ilość śniegu w krajobrazie arktycznym. Śnieg wpływa również wpływa na rozmieszczenie przedsiębiorstw i na warunki rozwoju miast. Używane tylko podczas generowania mapy. Teren tuż ponad poziomem morza jest zawsze bez śniegu +STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT :Wybierz przybliżoną ilość śniegu w krajobrazie arktycznym. Śnieg wpływa również wpływa na rozmieszczenie przedsiębiorstw i na warunki rozwoju miast. Używane tylko podczas generowania mapy. Teren tuż ponad poziomem wody jest zawsze bez śniegu STR_CONFIG_SETTING_SNOW_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_DESERT_COVERAGE :Pokrycie pustynią: {STRING} -STR_CONFIG_SETTING_DESERT_COVERAGE_HELPTEXT :Ustawia przybliżoną ilość pustyni w krajobrazie tropikalnym. Pustynia wpływa również wpływa na rozmieszczenie przedsiębiorstw i na warunki rozwoju miast. Używane tylko podczas generowania mapy. +STR_CONFIG_SETTING_DESERT_COVERAGE_HELPTEXT :Wybierz przybliżoną ilość pustyni w krajobrazie tropikalnym. Pustynia wpływa również na rozmieszczenie przedsiębiorstw i na warunki rozwoju miast. Używane tylko podczas generowania mapy STR_CONFIG_SETTING_DESERT_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Gładkość terenu: {STRING} -STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :(Tylko dla TerraGenesis) Określa liczbę wzgórz na mapie. Łagodne krajobrazy posiadają nieliczne, bardzo rozległe wzgórza, natomiast na terenach pofałdowanych jest ich znacznie więcej i mogą wyglądać podobnie +STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :Wybierz kształt i ilość wzniesień. Łagodny teren ma mniejszą liczbę szerszych wzniesień, natomiast teren pofałdowany ma więcej mniejszych wzniesień. ###length 4 STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :Bardzo łagodny STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH :Łagodny @@ -1899,7 +1900,7 @@ STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH :Pofałdowany STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH :Bardzo pofałdowany STR_CONFIG_SETTING_VARIETY :Różnorodność terenu: {STRING} -STR_CONFIG_SETTING_VARIETY_HELPTEXT :(Tylko dla TerraGenesis) Umożliwia jednoczesne występowanie obszarów górskich i płaskich. Działa na zasadzie obniżania powierzchni, dlatego inny parametr powinien definiować teren górzysty +STR_CONFIG_SETTING_VARIETY_HELPTEXT :Wybierz, czy mapa ma zawierać zarówno obszary górskie, jak i płaskie. Im większa różnorodność, tym większe różnice wysokości między obszarami górskimi i płaskimi. STR_CONFIG_SETTING_RIVER_AMOUNT :Liczba rzek: {STRING} STR_CONFIG_SETTING_RIVER_AMOUNT_HELPTEXT :Określa liczbę rzek na mapie @@ -2435,14 +2436,17 @@ STR_CONFIG_SETTING_ACCOUNTING :Finanse STR_CONFIG_SETTING_VEHICLES :Pojazdy STR_CONFIG_SETTING_VEHICLES_PHYSICS :Fizyka STR_CONFIG_SETTING_VEHICLES_ROUTING :Wyznaczanie trasy +STR_CONFIG_SETTING_VEHICLES_ORDERS :Polecenia STR_CONFIG_SETTING_LIMITATIONS :Ograniczenia STR_CONFIG_SETTING_ACCIDENTS :Awarie i katastrofy STR_CONFIG_SETTING_GENWORLD :Tworzenie mapy STR_CONFIG_SETTING_ENVIRONMENT :Środowisko +STR_CONFIG_SETTING_ENVIRONMENT_TIME :Czas STR_CONFIG_SETTING_ENVIRONMENT_AUTHORITIES :Władze lokalne STR_CONFIG_SETTING_ENVIRONMENT_TOWNS :Miasta STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :Przedsiębiorstwa STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :Dystrybucja ładunków +STR_CONFIG_SETTING_ENVIRONMENT_TREES :Drzewa STR_CONFIG_SETTING_AI :Rywale STR_CONFIG_SETTING_AI_NPC :Gracze komputerowi STR_CONFIG_SETTING_NETWORK :Sieć @@ -2579,12 +2583,20 @@ STR_LIVERY_TRAIN_TOOLTIP :{BLACK}Pokaż s STR_LIVERY_ROAD_VEHICLE_TOOLTIP :{BLACK}Pokaż schematy koloru pojazdów STR_LIVERY_SHIP_TOOLTIP :{BLACK}Pokaż schematy koloru statków STR_LIVERY_AIRCRAFT_TOOLTIP :{BLACK}Pokaż schematy koloru samolotów +STR_LIVERY_TRAIN_GROUP_TOOLTIP :{BLACK}Pokaż kolory grup pociągów +STR_LIVERY_ROAD_VEHICLE_GROUP_TOOLTIP :{BLACK}Pokaż kolory grup pojazdów +STR_LIVERY_SHIP_GROUP_TOOLTIP :{BLACK}Pokaż kolory grup statków +STR_LIVERY_AIRCRAFT_GROUP_TOOLTIP :{BLACK}Pokaż kolory grup samolotów STR_LIVERY_PRIMARY_TOOLTIP :{BLACK}Wybierz główny kolor dla wybranego schematu. Ctrl+klik ustawi ten kolor dla wszystkich schematów STR_LIVERY_SECONDARY_TOOLTIP :{BLACK}Wybierz dodatkowy kolor dla wybranego schematu. Ctrl+klik ustawi ten kolor dla wszystkich schematów STR_LIVERY_PANEL_TOOLTIP :{BLACK}Wybierz schemat kolorów do zmiany, albo wiele schematów z CTRL+klik. Kliknij na okienku aby wł./wył. używanie schematu. +STR_LIVERY_TRAIN_GROUP_EMPTY :Nie utworzono żadnych grup pociągów +STR_LIVERY_ROAD_VEHICLE_GROUP_EMPTY :Nie utworzono żadnych grup pojazdów +STR_LIVERY_SHIP_GROUP_EMPTY :Nie utworzono żadnych grup statków +STR_LIVERY_AIRCRAFT_GROUP_EMPTY :Nie utworzono żadnych grup samolotów ###length 23 -STR_LIVERY_DEFAULT :Standardowy wygląd +STR_LIVERY_DEFAULT :Domyślne malowanie STR_LIVERY_STEAM :Parowóz STR_LIVERY_DIESEL :Lokomotywa spalinowa STR_LIVERY_ELECTRIC :Lokomotywa elektryczna @@ -3092,9 +3104,9 @@ STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :Konstrukcja lin STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Budowa torów kolejowych. Ctrl przełącza buduj/usuń dla konstrukcji kolejowych. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Zbuduj tory kolejowe za pomocą trybu Autotory. Ctrl przełącza buduj/usuń dla konstrukcji kolejowych. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Budowa warsztatów (do kupowania i serwisowania pociągów). Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów -STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Zamiana torów na posterunek. Ctrl umożliwia łączenie posterunków. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów +STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Zbuduj posterunek na torach. Ctrl umożliwia łączenie posterunków. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Zbuduj stację kolejową. Ctrl umożliwia łączenie stacji. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Zbuduj sygnały kolejowe. Ctrl przełącza semafory/sygnały świetlne{}Przeciągnięcie pozwala na budowę sygnałów wzdłuż prostej linii torów. Ctrl pozwala na budowę sygnałów do następnego skrzyżowania{}Ctrl+klik przełącza do okna wyboru sygnałów. Shift przełącza pomiędzy budowaniem a szacowaniem kosztów +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Zbuduj sygnały na torach. Ctrl przełącza semafory/sygnały świetlne{}Przeciąganie buduje sygnały wzdłuż prostej linii torów, z Ctrl buduje sygnały aż do najbliższego skrzyżowania lub sygnału{}Ctrl+klik przełącza wyświetlanie okna wyboru sygnałów. Shift przełącza pomiędzy budowaniem a szacowaniem jego kosztów STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Zbuduj most kolejowy. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Zbuduj tunel kolejowy. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR :{BLACK}Przełącz buduj/usuń dla torów kolejowych, sygnałów, posterunków i stacji. Przetrzymanie Ctrl usuwa także tory kolejowe z posterunków i stacji @@ -3182,7 +3194,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Wybuduj STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Wybuduj zajezdnię tramwajową (do kupowania i serwisowania pojazdów). Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Zbuduj przystanek autobusowy. Ctrl umożliwia łączenie stacji. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Zbuduj pasażerski przystanek tramwajowy. Ctrl umożliwia łączenie stacji. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Zbuduj stację załadunku ciężarówek. Ctrl umożliwia łączenie stacji. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Zbuduj stację ciężarówek. Ctrl umożliwia łączenie stacji. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Zbuduj tramwajową stację załadunkową. Ctrl umożliwia łączenie stacji. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_ONE_WAY_ROAD :{BLACK}Włącz/wyłącz drogi jednokierunkowe STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Zbuduj most drogowy. Shift przełącza pomiędzy trybem budowania a szacowaniem jego kosztów @@ -3207,7 +3219,7 @@ STR_BUILD_DEPOT_TRAM_ORIENTATION_SELECT_TOOLTIP :{BLACK}Wybierz STR_STATION_BUILD_BUS_ORIENTATION :{WHITE}Ukierunkowanie przystanku STR_STATION_BUILD_BUS_ORIENTATION_TOOLTIP :{BLACK}Wybierz ukierunkowanie przystanku STR_STATION_BUILD_TRUCK_ORIENTATION :{WHITE}Ukierunkowanie stacji załadunku ciężarówek -STR_STATION_BUILD_TRUCK_ORIENTATION_TOOLTIP :{BLACK}Wybierz ukierunkowanie stacji załadunku ciężarówek +STR_STATION_BUILD_TRUCK_ORIENTATION_TOOLTIP :{BLACK}Wybierz ukierunkowanie stacji ciężarówek STR_STATION_BUILD_PASSENGER_TRAM_ORIENTATION :{WHITE}Ukierunkowanie przystanku tramwajowego STR_STATION_BUILD_PASSENGER_TRAM_ORIENTATION_TOOLTIP :{BLACK}Wybierz ukierunkowanie przystanku tramwajowego STR_STATION_BUILD_CARGO_TRAM_ORIENTATION :{WHITE}Ukierunkowanie tramwajowej stacji załadunkowej @@ -3451,7 +3463,7 @@ STR_LAI_TREE_NAME_CACTUS_PLANTS :Kaktusy STR_LAI_STATION_DESCRIPTION_RAILROAD_STATION :Stacja kolejowa STR_LAI_STATION_DESCRIPTION_AIRCRAFT_HANGAR :Hangar STR_LAI_STATION_DESCRIPTION_AIRPORT :Lotnisko -STR_LAI_STATION_DESCRIPTION_TRUCK_LOADING_AREA :Stacja załadunku ciężarówek +STR_LAI_STATION_DESCRIPTION_TRUCK_LOADING_AREA :Stacja ciężarówek STR_LAI_STATION_DESCRIPTION_BUS_STATION :Przystanek STR_LAI_STATION_DESCRIPTION_SHIP_DOCK :Port STR_LAI_STATION_DESCRIPTION_BUOY :Boja @@ -4948,21 +4960,21 @@ STR_ORDER_STOP_LOCATION_FAR_END :[dalszy koniec] STR_ORDER_OUT_OF_RANGE :{RED} (Kolejny punkt docelowy jest poza zasięgiem) -STR_ORDER_CONDITIONAL_UNCONDITIONAL :Skocz do rozkazu {COMMA} -STR_ORDER_CONDITIONAL_NUM :Skocz do rozkazu {COMMA} kiedy {STRING} {STRING} {COMMA} -STR_ORDER_CONDITIONAL_TRUE_FALSE :Skocz do rozkazu {0:COMMA} kiedy {2:STRING} że {1:STRING} +STR_ORDER_CONDITIONAL_UNCONDITIONAL :Skocz do polecenia {COMMA} +STR_ORDER_CONDITIONAL_NUM :Skocz do polecenia {COMMA}, kiedy {STRING} {STRING} {COMMA} +STR_ORDER_CONDITIONAL_TRUE_FALSE :Skocz do polecenia {0:COMMA}, kiedy {2:STRING}, że {1:STRING} STR_INVALID_ORDER :{RED} (Błędne polecenie) # Time table window STR_TIMETABLE_TITLE :{WHITE}{VEHICLE} (Rozkład jazdy) -STR_TIMETABLE_ORDER_VIEW :{BLACK}Rozkazy +STR_TIMETABLE_ORDER_VIEW :{BLACK}Polecenia STR_TIMETABLE_ORDER_VIEW_TOOLTIP :{BLACK}Przełącz do okna poleceń STR_TIMETABLE_TOOLTIP :{BLACK}Rozkład jazdy - kliknij na poleceniu aby je zaznaczyć STR_TIMETABLE_NO_TRAVEL :Nie podróżuje -STR_TIMETABLE_NOT_TIMETABLEABLE :Podróż (automatycznie; zaplanowana przez następny ręczny rozkaz) +STR_TIMETABLE_NOT_TIMETABLEABLE :Podróż (automatycznie; zaplanowana przez następne ręczne polecenie) STR_TIMETABLE_TRAVEL_NOT_TIMETABLED :Przejazd (bez ustalonego czasu) STR_TIMETABLE_TRAVEL_NOT_TIMETABLED_SPEED :Podróżuj (poza rozkładem) z maksymalną prędkością {2:VELOCITY} STR_TIMETABLE_TRAVEL_FOR :Przejazd przez {STRING} @@ -5319,7 +5331,7 @@ STR_ERROR_DRIVE_THROUGH_JUNCTION :{WHITE}... przy STR_ERROR_CAN_T_REMOVE_PART_OF_STATION :{WHITE}Nie można usunąć części stacji... STR_ERROR_MUST_REMOVE_RAILWAY_STATION_FIRST :{WHITE}Należy najpierw usunąć stację kolejową STR_ERROR_CAN_T_REMOVE_BUS_STATION :{WHITE}Nie można usunąć przystanku... -STR_ERROR_CAN_T_REMOVE_TRUCK_STATION :{WHITE}Nie można usunąć stacji załadunkowej... +STR_ERROR_CAN_T_REMOVE_TRUCK_STATION :{WHITE}Nie można usunąć stacji ciężarówek... STR_ERROR_CAN_T_REMOVE_PASSENGER_TRAM_STATION :{WHITE}Nie można usunąć przystanku tramwajowego... STR_ERROR_CAN_T_REMOVE_CARGO_TRAM_STATION :{WHITE}Nie można usunąć tramwajowej stacji załadunkowej... STR_ERROR_MUST_REMOVE_ROAD_STOP_FIRST :{WHITE}Należy najpierw usunąć przystanek @@ -5556,7 +5568,7 @@ STR_ERROR_CAN_T_SKIP_ORDER :{WHITE}Nie moż STR_ERROR_CAN_T_SKIP_TO_ORDER :{WHITE}Nie można przejść do wybranego polecenia... STR_ERROR_CAN_T_COPY_SHARE_ORDER :{WHITE}... pojazd nie może jechać do wszystkich stacji STR_ERROR_CAN_T_ADD_ORDER :{WHITE}... pojazd nie może jechać do tej stacji -STR_ERROR_CAN_T_ADD_ORDER_SHARED :{WHITE}... pojazd dzielący ten rozkaz nie może jechać do tej stacji +STR_ERROR_CAN_T_ADD_ORDER_SHARED :{WHITE}... pojazd współdzielący to polecenie nie może jechać do tej stacji STR_ERROR_CAN_T_COPY_ORDER_VEHICLE_LIST :{WHITE}... nie wszystkie pojazdy mają takie same polecenia STR_ERROR_CAN_T_SHARE_ORDER_VEHICLE_LIST :{WHITE}... nie wszystkie pojazdy współdzielą polecenia diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index 6cf54e73b7..b8f669a30c 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -772,7 +772,7 @@ STR_SMALLMAP_LEGENDA_AIRCRAFT :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_TRANSPORT_ROUTES :{TINY_FONT}{BLACK}Rotas de Transporte STR_SMALLMAP_LEGENDA_FOREST :{TINY_FONT}{BLACK}Floresta STR_SMALLMAP_LEGENDA_RAILROAD_STATION :{TINY_FONT}{BLACK}Estação Ferroviária -STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY :{TINY_FONT}{BLACK}Área de Carregamento de Camiões +STR_SMALLMAP_LEGENDA_TRUCK_LOADING_BAY :{TINY_FONT}{BLACK}Estação de Camiões STR_SMALLMAP_LEGENDA_BUS_STATION :{TINY_FONT}{BLACK}Estação de Autocarros STR_SMALLMAP_LEGENDA_AIRPORT_HELIPORT :{TINY_FONT}{BLACK}Aeroporto/Heliporto STR_SMALLMAP_LEGENDA_DOCK :{TINY_FONT}{BLACK}Doca @@ -1003,6 +1003,7 @@ STR_GAME_OPTIONS_CURRENCY_HKD :Dólar de Hong STR_GAME_OPTIONS_CURRENCY_INR :Rupia Indiana STR_GAME_OPTIONS_CURRENCY_IDR :Rupia Indonésia STR_GAME_OPTIONS_CURRENCY_MYR :Ringgit da Malásia +STR_GAME_OPTIONS_CURRENCY_LVL :Lats da Letónia STR_GAME_OPTIONS_AUTOSAVE_FRAME :{BLACK}Guardar automaticamente STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Seleccionar o intervalo para guardar automático @@ -2056,14 +2057,17 @@ STR_CONFIG_SETTING_ACCOUNTING :Contabilidade STR_CONFIG_SETTING_VEHICLES :Veículos STR_CONFIG_SETTING_VEHICLES_PHYSICS :Física STR_CONFIG_SETTING_VEHICLES_ROUTING :Em rota +STR_CONFIG_SETTING_VEHICLES_ORDERS :Ordens STR_CONFIG_SETTING_LIMITATIONS :Limitações STR_CONFIG_SETTING_ACCIDENTS :Desastres / Acidentes STR_CONFIG_SETTING_GENWORLD :Geração do mundo STR_CONFIG_SETTING_ENVIRONMENT :Meio Ambiente +STR_CONFIG_SETTING_ENVIRONMENT_TIME :Tempo STR_CONFIG_SETTING_ENVIRONMENT_AUTHORITIES :Autoridades STR_CONFIG_SETTING_ENVIRONMENT_TOWNS :Localidades STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :Industrias STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :Distribuição de Carga +STR_CONFIG_SETTING_ENVIRONMENT_TREES :Árvores STR_CONFIG_SETTING_AI :Oponentes STR_CONFIG_SETTING_AI_NPC :Jogadores Computador STR_CONFIG_SETTING_NETWORK :Rede @@ -2721,9 +2725,9 @@ STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :Construir Magle STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Construir linha férrea. Ctrl alterna a construção/remoção de linha férrea. Shift alterna construir/mostrar custo estimado STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Construir caminhos-de-ferro usando o modo automático. Ctrl alterna a construção/remoção de caminhos-de-ferro. Shift alterna construir/mostrar custo estimado STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Construir depósito ferroviário (para compra e manutenção de comboios). Shift alterna construir/mostrar custo estimado -STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Converter linha em ponto de controlo. Ctrl permite juntar pontos de controlo. Shift alterna construir/mostrar custo estimado +STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Construir ponto de controlo na ferrovia. Ctrl permite juntar pontos de controlo. Shift alterna construir/mostrar custo estimado STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Construir estação ferroviária. Ctrl permite juntar estações. Shift alterna construir/mostrar custo estimado -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Construir sinais ferroviários. Ctrl alterna entre semáforos/sinais elétricos{}Arrastar constrói sinais ao longo de uma linha reta de carris. Ctrl constrói sinais até a próxima junção ou sinal{}Ctrl+Clique alterna entre abrir a janela de seleção de sinais. Shift alterna construir/mostrar custo estimado +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Construir sinais na ferrovia. Ctrl alterna entre semáforos/sinais elétricos{}Arrastar constrói sinais ao longo de uma linha reta de carris. Ctrl constrói sinais até a próxima junção ou sinal{}Ctrl+Clique alterna entre abrir a janela de seleção de sinais. Shift alterna construir/mostrar custo estimado STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Construir ponte ferroviária. Shift alterna construir/mostrar custo estimado STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Construir túnel ferroviário. Shift alterna construir/mostrar custo estimado STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR :{BLACK}Alternar entre construir/remover linha férrea, sinais, pontos de passagem e estações. Fixar o Ctrl também remove a linha férrea de pontos de passagem e estações @@ -2811,7 +2815,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Construi STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Construir garagem para elétricos (para compra e manutenção). Shift alterna construir/mostrar custo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Construir estação de autocarros. Ctrl permite juntar estações. Shift alterna construir/mostrar custo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Construir paragem de elétricos para passageiros. Ctrl permite juntar estações. Shift alterna construir/mostrar custo estimado -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Construir área de carregamento de camiões. Ctrl permite juntar estações. Shift alterna construir/mostrar custo estimado +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Construir estação de camiões. Ctrl permite juntar estações. Shift alterna construir/mostrar custo estimado STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Construir paragem de elétricos para carga. Ctrl permite juntar estações. Shift alterna construir/mostrar custo estimado STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_ONE_WAY_ROAD :{BLACK}Ativar/Desativar estradas de sentido único STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Construir ponte rodoviária. Shift alterna construir/mostrar custo estimado @@ -2836,7 +2840,7 @@ STR_BUILD_DEPOT_TRAM_ORIENTATION_SELECT_TOOLTIP :{BLACK}Selecion STR_STATION_BUILD_BUS_ORIENTATION :{WHITE}Orientação da estação de autocarros STR_STATION_BUILD_BUS_ORIENTATION_TOOLTIP :{BLACK}Seleccionar a orientação da estação de autocarros STR_STATION_BUILD_TRUCK_ORIENTATION :{WHITE}Orientação da estação de carga -STR_STATION_BUILD_TRUCK_ORIENTATION_TOOLTIP :{BLACK}Seleccionar a orientação da estação de carregamento de camiões +STR_STATION_BUILD_TRUCK_ORIENTATION_TOOLTIP :{BLACK}Selecionar a orientação da estação de camiões STR_STATION_BUILD_PASSENGER_TRAM_ORIENTATION :{WHITE}Orientação da Estação de Eléctricos de Passageiros STR_STATION_BUILD_PASSENGER_TRAM_ORIENTATION_TOOLTIP :{BLACK}Seleccionar orientação da estação de eléctricos STR_STATION_BUILD_CARGO_TRAM_ORIENTATION :{WHITE}Orientação da Estação de Eléctricos @@ -3080,7 +3084,7 @@ STR_LAI_TREE_NAME_CACTUS_PLANTS :Cactos STR_LAI_STATION_DESCRIPTION_RAILROAD_STATION :Estação ferroviária STR_LAI_STATION_DESCRIPTION_AIRCRAFT_HANGAR :Hangar STR_LAI_STATION_DESCRIPTION_AIRPORT :Aeroporto -STR_LAI_STATION_DESCRIPTION_TRUCK_LOADING_AREA :Área de carregamento de camiões +STR_LAI_STATION_DESCRIPTION_TRUCK_LOADING_AREA :Estação de camiões STR_LAI_STATION_DESCRIPTION_BUS_STATION :Estação de autocarros STR_LAI_STATION_DESCRIPTION_SHIP_DOCK :Doca STR_LAI_STATION_DESCRIPTION_BUOY :Bóia diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 6d34830537..91fbac0e58 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1147,6 +1147,7 @@ STR_GAME_OPTIONS_CURRENCY_HKD :Гонконг STR_GAME_OPTIONS_CURRENCY_INR :Индийская рупия STR_GAME_OPTIONS_CURRENCY_IDR :Индонезийская рупия STR_GAME_OPTIONS_CURRENCY_MYR :Малайзийский ринггит +STR_GAME_OPTIONS_CURRENCY_LVL :Латвийский лат STR_GAME_OPTIONS_AUTOSAVE_FRAME :{BLACK}Автосохранение STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Интервал автосохранения игры @@ -2886,9 +2887,9 @@ STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :Магнитн STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Строительство железной дороги. При нажатом Ctrl - удаление путей. При нажатом Shift - оценка стоимости строительства. STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Строительство ж/д путей в автоматическом режиме. При нажатом Ctrl - удаление путей. При нажатом Shift - оценка стоимости строительства. STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Строительство депо (для приобретения и обслуживания поездов). При нажатом Shift - оценка стоимости строительства. -STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Установка на рельсах точек пути. Нажатие Ctrl позволяет объединять точки. При нажатом Shift - оценка стоимости строительства. +STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Установка на рельсах маршрутных точек. Нажатие Ctrl позволяет объединять точки. При нажатом Shift - оценка стоимости строительства. STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Строительство ж/д станций. Нажатие Ctrl позволяет объединять станции. При нажатом Shift - оценка стоимости строительства. -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Установка сигналов. Ctrl переключает семафоры/светофоры.{}Перетаскиванием можно строить сигналы на прямом участке пути. С нажатым Ctrl - строительство сигналов до ближайшего пересечения или сигнала.{}Ctrl+щелчок переключает открытие окна выбора сигналов. При нажатом Shift - оценка стоимости строительства. +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Установка сигналов на ж/д путях. Ctrl переключает семафоры/светофоры.{}Перетаскиванием можно строить сигналы на прямом участке пути. С нажатым Ctrl - строительство сигналов до ближайшего пересечения или сигнала.{}Ctrl+щелчок переключает открытие окна выбора сигналов. При нажатом Shift - оценка стоимости строительства. STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Строительство ж/д мостов. При нажатом Shift - оценка стоимости строительства. STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Строительство ж/д туннелей. При нажатом Shift - оценка стоимости строительства. STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR :{BLACK}Переключение между строительством и удалением ж/д путей, сигналов, станций. При нажатом Ctrl убирает станции с рельсами. diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index 91a63834a9..4b400335d2 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -379,6 +379,10 @@ STR_COLOUR_WHITE :Bela STR_COLOUR_RANDOM :Nasumična ###length 17 +STR_COLOUR_SECONDARY_GREEN :Zelena +STR_COLOUR_SECONDARY_ORANGE :Narandžasta +STR_COLOUR_SECONDARY_BROWN :Braon +STR_COLOUR_SECONDARY_SAME_AS_PRIMARY :Identično primarnom # Units used in OpenTTD @@ -678,6 +682,7 @@ STR_NEWS_MENU_DELETE_ALL_MESSAGES :Obriši sve por # About menu STR_ABOUT_MENU_LAND_BLOCK_INFO :Podaci o zemljištu +STR_ABOUT_MENU_HELP :Pomoć & priručnici STR_ABOUT_MENU_TOGGLE_CONSOLE :Uključi/isključi konzolu STR_ABOUT_MENU_AI_DEBUG :Korekcija VI / skripte igre STR_ABOUT_MENU_SCREENSHOT :Sačuvaj sliku @@ -1106,12 +1111,16 @@ STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT :{BLACK}Kopiraj # Game options window STR_GAME_OPTIONS_CAPTION :{WHITE}Opcije +STR_GAME_OPTIONS_TAB_GRAPHICS :Grrafika +STR_GAME_OPTIONS_SFX_VOLUME :Zvučni efekti +STR_GAME_OPTIONS_VOLUME_0 :0% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valuta STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Izbor valute +STR_GAME_OPTIONS_CURRENCY_CODE :{STRING} ({STRING}) ###length 43 STR_GAME_OPTIONS_CURRENCY_GBP :Britanska funta @@ -1163,6 +1172,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Izbor vr # Autosave dropdown ###length 5 STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_OFF :Isključeno +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_10_MINUTES :Svakih 10 minuta STR_GAME_OPTIONS_LANGUAGE :{BLACK}Jezik STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Odaberi jezik za interfejs @@ -1199,6 +1209,7 @@ STR_GAME_OPTIONS_GUI_SCALE_3X :3x STR_GAME_OPTIONS_GUI_SCALE_4X :4x STR_GAME_OPTIONS_GUI_SCALE_5X :5x +STR_GAME_OPTIONS_PARTICIPATE_SURVEY_LINK_TOOLTIP :{BLACK}Ovo otvara pretraživač sa više informacija o automatskim anketama STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafike @@ -1219,6 +1230,7 @@ STR_GAME_OPTIONS_BASE_MUSIC :{BLACK}Osnovni STR_GAME_OPTIONS_BASE_MUSIC_TOOLTIP :{BLACK}Odaberi željeni skup osnovne muzike STR_GAME_OPTIONS_BASE_MUSIC_DESCRIPTION_TOOLTIP :{BLACK}Dodatni podaci o osnovnom skupu muzike +STR_BASESET_STATUS :{STRING} {RED}({NUM} fajl{P '' a ovi} nedostaj{P e e u}/{P je su su} korumpiran{P '' a i} STR_ERROR_RESOLUTION_LIST_FAILED :{WHITE}Neuspešno dobijanje spiska podržanih rezolucija STR_ERROR_FULLSCREEN_FAILED :{WHITE}Neuspešno prebacivanje u ceo ekran @@ -1381,9 +1393,11 @@ STR_CONFIG_SETTING_HORIZONTAL_POS_LEFT :Levo STR_CONFIG_SETTING_HORIZONTAL_POS_CENTER :Sredina STR_CONFIG_SETTING_HORIZONTAL_POS_RIGHT :Desno +STR_CONFIG_SETTING_SECONDS_VALUE :{COMMA}{NBSP}sekund{P a e e} STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN :Najveći zajam na početku: {STRING} STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_HELPTEXT :Najveći iznos koji preduzeće može da pozajmi (ne uzimajući u obzir inflaciju) +STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_VALUE :{CURRENCY_LONG} ###setting-zero-is-special STR_CONFIG_SETTING_INTEREST_RATE :Kamatna stopa: {STRING} @@ -1790,6 +1804,8 @@ STR_CONFIG_SETTING_ADVANCED_VEHICLE_LISTS_HELPTEXT :Omogući upotre STR_CONFIG_SETTING_LOADING_INDICATORS :Koristiti pokazatelj utovarivanja: {STRING} STR_CONFIG_SETTING_LOADING_INDICATORS_HELPTEXT :Odaberi da li će se prikazati indikatori utovara i istovara iznad vozila +STR_CONFIG_SETTING_TIMETABLE_MODE :Jedinica vremena za red vožnje: {STRING} +STR_CONFIG_SETTING_TIMETABLE_MODE_HELPTEXT :Izaberi jedinicu vremena koja se koristi za redove vožnje ###length 3 STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :Prikazivanje polaska i dolaska u rasporedima: {STRING} @@ -2123,6 +2139,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_IMPERIAL :Imperijalne mer STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_METRIC :Metričke mere (km/h) STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_SI :SI (m/s) STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_GAMEUNITS :Jedinice igre (pločica/dan) +STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_KNOTS :Čvorovi STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER :Mere za snagu vozila: {STRING} STR_CONFIG_SETTING_LOCALISATION_UNITS_POWER_HELPTEXT :Kada je prikazana snaga vozila u korisničkom interfejsu, prikaži je u odabranim jedinicama @@ -2176,10 +2193,12 @@ STR_CONFIG_SETTING_LIMITATIONS :Ograničenja STR_CONFIG_SETTING_ACCIDENTS :Katastrofe / Nezgode STR_CONFIG_SETTING_GENWORLD :Stvaranje sveta STR_CONFIG_SETTING_ENVIRONMENT :Okoliš +STR_CONFIG_SETTING_ENVIRONMENT_TIME :Vreme STR_CONFIG_SETTING_ENVIRONMENT_AUTHORITIES :Vlasti STR_CONFIG_SETTING_ENVIRONMENT_TOWNS :Naselja STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :Fabrike STR_CONFIG_SETTING_ENVIRONMENT_CARGODIST :Distribucija tereta +STR_CONFIG_SETTING_ENVIRONMENT_TREES :Drveće STR_CONFIG_SETTING_AI :Suparnici STR_CONFIG_SETTING_AI_NPC :Računar STR_CONFIG_SETTING_NETWORK :Mreža @@ -2221,6 +2240,7 @@ STR_CONFIG_ERROR_SPRITECACHE_TOO_BIG :{WHITE}Dodela { # Video initalization errors STR_VIDEO_DRIVER_ERROR :{WHITE}Greška sa podešavanjima videa... STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}... kompatibilan GPU nije pronađen. Hardversko ubrzanje je isključeno +STR_VIDEO_DRIVER_ERROR_HARDWARE_ACCELERATION_CRASH :{WHITE}... GPU drajver je oborio igru. Hardversko ubrzanje je onemogućeno # Intro window STR_INTRO_CAPTION :{WHITE}OpenTTD {REV} @@ -2277,6 +2297,9 @@ STR_ABANDON_GAME_QUERY :{YELLOW}Da li z STR_ABANDON_SCENARIO_QUERY :{YELLOW}Da li zaista želiš da napustiš ovaj scenario? # Help window +STR_HELP_WINDOW_DOCUMENTS :{BLACK}Dokumenti +STR_HELP_WINDOW_KNOWN_BUGS :{BLACK}Poznati Bagovi +STR_HELP_WINDOW_LICENSE :{BLACK}Licenca # Cheat window STR_CHEATS :{WHITE}Varanja @@ -2301,9 +2324,11 @@ STR_LIVERY_TRAIN_TOOLTIP :{BLACK}Prikaži STR_LIVERY_ROAD_VEHICLE_TOOLTIP :{BLACK}Prikaži šeme boja drumskih vozila STR_LIVERY_SHIP_TOOLTIP :{BLACK}Prikaži šeme boja brodova STR_LIVERY_AIRCRAFT_TOOLTIP :{BLACK}Prikaži šeme boja letelica +STR_LIVERY_SHIP_GROUP_TOOLTIP :{BLACK}Prikaži boje grupa brodova STR_LIVERY_PRIMARY_TOOLTIP :{BLACK}Izaberi osnovnu boju za označenu kategoriju. Ctrl+klik će izabrati ovu boju za sve kategorije STR_LIVERY_SECONDARY_TOOLTIP :{BLACK}Izaberi dodatnu boju za označenu kategoriju. Ctrl+klik će izabrati ovu boju za sve kategorije STR_LIVERY_PANEL_TOOLTIP :{BLACK}Označi šemu boja za izmenu, ili više njih koristeći Ctrl+klik. Klikom na kutijicu aktivira se upotreba date šeme +STR_LIVERY_AIRCRAFT_GROUP_EMPTY :Nijedna grupa letelica nije formirana ###length 23 STR_LIVERY_DEFAULT :Uobičajene boje @@ -2525,6 +2550,7 @@ STR_NETWORK_CLIENT_LIST_NEW_COMPANY :(novo preduzeć STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP :{BLACK}Napravi novo preduzeće i pridruži mu se STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP :{BLACK}Ovo si ti STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP :{BLACK}Ovo je domaćin igre +STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT :{BLACK}{NUM} klijen{P t ata ata} - {NUM}/{NUM} preduzeć{P e a a} # Matches ConnectionType ###length 5 @@ -2551,6 +2577,9 @@ STR_NETWORK_ASK_RELAY_NO :{BLACK}Ne STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Da, jednom STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Da, ne pitaj ponovo +STR_NETWORK_ASK_SURVEY_TEXT :Da li želiš da učestvuješ u automatskoj anketi?{}OpenTTD će slati anketu kada izlaziš iz igre.{}Možeš promentiti ovo podešavanje u bilo kom trenutku pod "Opcijama igre". +STR_NETWORK_ASK_SURVEY_PREVIEW :Pregledaj rezultate ankete +STR_NETWORK_ASK_SURVEY_LINK :O anketi i privatnosti STR_NETWORK_SPECTATORS :Posmatrači @@ -2867,6 +2896,8 @@ STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Povećav STR_SELECT_RAIL_BRIDGE_CAPTION :{WHITE}Izbor železničkog mosta STR_SELECT_ROAD_BRIDGE_CAPTION :{WHITE}Izbor drumskog mosta STR_SELECT_BRIDGE_SELECTION_TOOLTIP :{BLACK}Izbor mosta - gradnja se potvrđuje klikom na željeni most +STR_SELECT_BRIDGE_INFO_NAME :{GOLD}{STRING} +STR_SELECT_BRIDGE_INFO_NAME_MAX_SPEED :{GOLD}{STRING},{} {VELOCITY} STR_BRIDGE_NAME_SUSPENSION_STEEL :Viseći, čelični STR_BRIDGE_NAME_GIRDER_STEEL :Gredni, čelični STR_BRIDGE_NAME_CANTILEVER_STEEL :Obešeni, čelični @@ -3298,6 +3329,7 @@ STR_MAPGEN_MAPSIZE :{BLACK}Veličin STR_MAPGEN_MAPSIZE_TOOLTIP :{BLACK}Izaberi veličinu mape u pločicama. Broj dostupnih pločica će biti neznatno manji STR_MAPGEN_BY :{BLACK}* STR_MAPGEN_NUMBER_OF_TOWNS :{BLACK}Broj naselja: +STR_MAPGEN_NUMBER_OF_TOWNS_TOOLTIP :{BLACK}Izaberi gustinu gradova, ili unesi broj STR_MAPGEN_TOWN_NAME_LABEL :{BLACK}Imena naselja: STR_MAPGEN_TOWN_NAME_DROPDOWN_TOOLTIP :{BLACK}Izaberi stil imena naselja STR_MAPGEN_DATE :{BLACK}Datum: @@ -3319,6 +3351,7 @@ STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Broj rek STR_MAPGEN_SMOOTHNESS :{BLACK}Postepenost: STR_MAPGEN_VARIETY :{BLACK}Raznolikost: STR_MAPGEN_GENERATE :{WHITE}Napravi +STR_MAPGEN_GENERATE_TOOLTIP :{BLACK}Kreiraj svet i igraj OpenTTD! STR_MAPGEN_NEWGRF_SETTINGS :{BLACK}Podešavanja NewGRF STR_MAPGEN_NEWGRF_SETTINGS_TOOLTIP :{BLACK}Prikazuje podešavanja NewGRF STR_MAPGEN_AI_SETTINGS :{BLACK}Podešavanja VI @@ -4677,6 +4710,7 @@ STR_TIMETABLE_STATUS_ON_TIME :{BLACK}Vozilo t STR_TIMETABLE_STATUS_LATE :{BLACK}Vozilo trenutno kasni za {STRING} od rasporeda STR_TIMETABLE_STATUS_EARLY :{BLACK}Vozilo trenutno žuri za {STRING} od rasporeda STR_TIMETABLE_STATUS_NOT_STARTED :{BLACK}Ovaj raspored još nije počeo +STR_TIMETABLE_STATUS_START_IN_SECONDS :{BLACK}Ovaj red vožnje će započeti za {COMMA} sekund{P u e e} @@ -4702,6 +4736,7 @@ STR_TIMETABLE_EXPECTED :{BLACK}Očekiva STR_TIMETABLE_SCHEDULED :{BLACK}Po planu STR_TIMETABLE_EXPECTED_TOOLTIP :{BLACK}Prebacivanje između prikaza očekivanog i po planu +STR_TIMETABLE_DEPARTURE_SECONDS_IN_FUTURE :D: {COLOUR}{COMMA} sek # Date window (for timetable) @@ -4793,6 +4828,7 @@ STR_AI_SETTINGS_SETTING :{STRING}: {ORAN # Textfile window +STR_TEXTFILE_JUMPLIST_ITEM :{WHITE}{STRING} STR_TEXTFILE_WRAP_TEXT :{WHITE}Prelomiti tekst STR_TEXTFILE_WRAP_TEXT_TOOLTIP :{BLACK} Prelomiti tekst prozora tako da stane bez potrebe skrolovanja STR_TEXTFILE_VIEW_README :{BLACK}Prikaži uputstvo @@ -4802,6 +4838,7 @@ STR_TEXTFILE_VIEW_LICENCE :{BLACK}Licenca STR_TEXTFILE_README_CAPTION :{WHITE}{STRING} uputstvo za {STRING} STR_TEXTFILE_CHANGELOG_CAPTION :{WHITE}{STRING} izmene od {STRING} STR_TEXTFILE_LICENCE_CAPTION :{WHITE}{STRING} licenca od {STRING} +STR_TEXTFILE_GAME_MANUAL_CAPTION :{WHITE}OpenTTD dokument '{STRING}' # Vehicle loading indicators @@ -5240,6 +5277,7 @@ STR_ERROR_TOO_FAR_FROM_PREVIOUS_DESTINATION :{WHITE}... prev STR_ERROR_AIRCRAFT_NOT_ENOUGH_RANGE :{WHITE}... letelica nema dovoljan domet # Extra messages which go on the third line of errors, explaining why orders failed +STR_ERROR_NO_BUS_STATION :{WHITE}Nema autobuske stanice # Timetable related errors STR_ERROR_CAN_T_TIMETABLE_VEHICLE :{WHITE}Raspored se ne može dodeliti vozilu... @@ -5729,6 +5767,7 @@ STR_JUST_COMMA :{COMMA} STR_JUST_CURRENCY_SHORT :{CURRENCY_SHORT} STR_JUST_CURRENCY_LONG :{CURRENCY_LONG} STR_JUST_CARGO_LIST :{CARGO_LIST} +STR_JUST_DECIMAL :{DECIMAL} STR_JUST_INT :{NUM} STR_JUST_DATE_TINY :{DATE_TINY} STR_JUST_DATE_SHORT :{DATE_SHORT} diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index a057359b54..de399c5706 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -207,7 +207,7 @@ STR_COLOUR_SECONDARY_ORANGE :橘黄色 STR_COLOUR_SECONDARY_BROWN :棕 色 STR_COLOUR_SECONDARY_GREY :浅灰色 STR_COLOUR_SECONDARY_WHITE :白 色 -STR_COLOUR_SECONDARY_SAME_AS_PRIMARY :与主色调相同 +STR_COLOUR_SECONDARY_SAME_AS_PRIMARY :主色调 # Units used in OpenTTD @@ -1002,6 +1002,7 @@ STR_GAME_OPTIONS_CURRENCY_HKD :港币 STR_GAME_OPTIONS_CURRENCY_INR :印度卢布 STR_GAME_OPTIONS_CURRENCY_IDR :印尼盾 STR_GAME_OPTIONS_CURRENCY_MYR :马来西亚林吉特 +STR_GAME_OPTIONS_CURRENCY_LVL :拉脱维亚拉特 STR_GAME_OPTIONS_AUTOSAVE_FRAME :{BLACK}自动保存 STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}选择自动保存的周期 @@ -1359,7 +1360,7 @@ STR_CONFIG_SETTING_SIGNALSIDE :显示信号灯 STR_CONFIG_SETTING_SIGNALSIDE_HELPTEXT :选择在铁路哪一边放置信号灯 ###length 3 STR_CONFIG_SETTING_SIGNALSIDE_LEFT :在左边 -STR_CONFIG_SETTING_SIGNALSIDE_DRIVING_SIDE :在前进方向 +STR_CONFIG_SETTING_SIGNALSIDE_DRIVING_SIDE :道路通行方向 STR_CONFIG_SETTING_SIGNALSIDE_RIGHT :在右侧 STR_CONFIG_SETTING_SHOWFINANCES :在年终显示财务报表:{STRING} @@ -1549,8 +1550,8 @@ STR_CONFIG_SETTING_SE_FLAT_WORLD_HEIGHT :由水面场景 STR_CONFIG_SETTING_EDGES_NOT_EMPTY :{WHITE}一个或多个北边的地块不是闲置的 STR_CONFIG_SETTING_EDGES_NOT_WATER :{WHITE}一个或多个地图某边的地块不是水域 -STR_CONFIG_SETTING_STATION_SPREAD :车站占地上限格数: {STRING} -STR_CONFIG_SETTING_STATION_SPREAD_HELPTEXT :设置车站最大占地面积,注意:太大影响游戏速度 +STR_CONFIG_SETTING_STATION_SPREAD :最大车站范围: {STRING} +STR_CONFIG_SETTING_STATION_SPREAD_HELPTEXT :设置车站的最大范围,即最大长宽。请注意较高数值会使游戏变慢。 STR_CONFIG_SETTING_SERVICEATHELIPAD :直升机在降落平台自动保养:{STRING} STR_CONFIG_SETTING_SERVICEATHELIPAD_HELPTEXT :直升飞机在降落平台自动保养,即使机场没有机库 @@ -2723,7 +2724,7 @@ STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :磁悬浮铁路 STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}建设轨道。按住 Ctrl 键切换建设/移除轨道。按住 Shift 键显示预计费用。 STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}使用多向路轨工具铺设轨道。按住 Ctrl 键切换建设/移除轨道。按住 Shift 键显示预计费用。 STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}建设列车车库(可以购买或维护列车)按住 Shift 键显示预计费用。 -STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}将铁路变为路点。按住 Ctrl 键允许合并路点。按住 Shift 键显示预计费用。 +STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}建设铁路路点。按住 Ctrl 键允许合并路点。按住 Shift 键显示预计费用。 STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}建设火车站。按住 Ctrl 键允许合并站台。按住 Shift 键显示预计费用。 STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}建造铁路信号。{} 按住 Ctrl 键点选铁路,系统会切换悬臂式/电子式信号灯,或者更改被点选信号灯的种类{} 在一段直线铁路上拖拽,系统会依照设置的信号间距,沿铁路建立信号灯。如果按住 Ctrl 键拖拽,系统会建造信号灯至拖拽方向前的下一个道岔{} 如果按住 Shift 键点击铁路或在铁路上拖拽,系统会显示建置成本但不设置信号灯{} 如果按住 Ctrl 键点击此键,系统会切换信号灯选择窗口的显示状态 STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}建设铁路桥梁。按住 Shift 键显示预计费用。 From 952d111b94279f9a5eac36e8faaed69cd8f377c2 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 6 Jan 2024 15:15:37 +0000 Subject: [PATCH 2/9] Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO. INVALID_CARGO is a CargoID and should be used for most purposes in game. CT_INVALID is a CargoType used for defining default properties. --- src/articulated_vehicles.cpp | 8 ++-- src/autoreplace_cmd.cpp | 10 ++--- src/build_vehicle_gui.cpp | 10 ++--- src/cargo_type.h | 6 ++- src/cargotype.cpp | 14 +++---- src/engine.cpp | 4 +- src/engine_base.h | 2 +- src/engine_gui.cpp | 6 +-- src/industry_cmd.cpp | 8 ++-- src/industry_gui.cpp | 58 +++++++++++++-------------- src/linkgraph/linkgraph.h | 2 +- src/linkgraph/linkgraph_gui.h | 2 +- src/linkgraph/refresh.cpp | 2 +- src/linkgraph/refresh.h | 2 +- src/newgrf.cpp | 56 +++++++++++++------------- src/newgrf_airporttiles.h | 4 +- src/newgrf_cargo.cpp | 6 +-- src/newgrf_engine.cpp | 6 +-- src/newgrf_roadstop.cpp | 2 +- src/newgrf_roadstop.h | 4 +- src/newgrf_station.cpp | 4 +- src/newgrf_station.h | 6 +-- src/saveload/afterload.cpp | 4 +- src/script/api/script_cargo.hpp | 2 +- src/script/api/script_engine.cpp | 4 +- src/script/api/script_event_types.cpp | 4 +- src/script/api/script_industry.hpp | 4 +- src/script/api/script_subsidy.cpp | 2 +- src/script/api/script_vehicle.cpp | 2 +- src/station_gui.cpp | 2 +- src/subsidy_base.h | 2 +- src/train_gui.cpp | 2 +- src/vehicle.cpp | 2 +- src/vehicle_cmd.cpp | 4 +- src/vehicle_gui.cpp | 2 +- src/vehicle_gui_base.h | 2 +- 36 files changed, 131 insertions(+), 129 deletions(-) diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp index cefac74dcb..1f3a8a54b2 100644 --- a/src/articulated_vehicles.cpp +++ b/src/articulated_vehicles.cpp @@ -107,7 +107,7 @@ uint CountArticulatedParts(EngineID engine_type, bool purchase_window) static inline uint16_t GetVehicleDefaultCapacity(EngineID engine, CargoID *cargo_type) { const Engine *e = Engine::Get(engine); - CargoID cargo = (e->CanCarryCargo() ? e->GetDefaultCargoType() : (CargoID)CT_INVALID); + CargoID cargo = (e->CanCarryCargo() ? e->GetDefaultCargoType() : INVALID_CARGO); if (cargo_type != nullptr) *cargo_type = cargo; if (!IsValidCargoID(cargo)) return 0; return e->GetDisplayDefaultCapacity(); @@ -259,13 +259,13 @@ CargoTypes GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial * Get cargo mask of all cargoes carried by an articulated vehicle. * Note: Vehicles not carrying anything are ignored * @param v the first vehicle in the chain - * @param cargo_type returns the common CargoID if needed. (CT_INVALID if no part is carrying something or they are carrying different things) + * @param cargo_type returns the common CargoID if needed. (INVALID_CARGO if no part is carrying something or they are carrying different things) * @return cargo mask, may be 0 if the no vehicle parts have cargo capacity */ CargoTypes GetCargoTypesOfArticulatedVehicle(const Vehicle *v, CargoID *cargo_type) { CargoTypes cargoes = 0; - CargoID first_cargo = CT_INVALID; + CargoID first_cargo = INVALID_CARGO; do { if (IsValidCargoID(v->cargo_type) && v->GetEngine()->CanCarryCargo()) { @@ -273,7 +273,7 @@ CargoTypes GetCargoTypesOfArticulatedVehicle(const Vehicle *v, CargoID *cargo_ty if (!IsValidCargoID(first_cargo)) first_cargo = v->cargo_type; if (first_cargo != v->cargo_type) { if (cargo_type != nullptr) { - *cargo_type = CT_INVALID; + *cargo_type = INVALID_CARGO; cargo_type = nullptr; } } diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 18883d009e..1bd89e3f1a 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -227,7 +227,7 @@ static int GetIncompatibleRefitOrderIdForAutoreplace(const Vehicle *v, EngineID * @param part_of_chain The vehicle is part of a train * @return The cargo type to replace to * CT_NO_REFIT is returned if no refit is needed - * CT_INVALID is returned when both old and new vehicle got cargo capacity and refitting the new one to the old one's cargo type isn't possible + * INVALID_CARGO is returned when both old and new vehicle got cargo capacity and refitting the new one to the old one's cargo type isn't possible */ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type, bool part_of_chain) { @@ -244,7 +244,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type, bool return CT_NO_REFIT; // engine_type is already a mixed cargo type which matches the incoming vehicle by default, no refit required } - return CT_INVALID; // We cannot refit to mixed cargoes in an automated way + return INVALID_CARGO; // We cannot refit to mixed cargoes in an automated way } if (!IsValidCargoID(cargo_type)) { @@ -263,9 +263,9 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type, bool return CT_NO_REFIT; // We failed to find a cargo type on the old vehicle and we will not refit the new one } else { - if (!HasBit(available_cargo_types, cargo_type)) return CT_INVALID; // We can't refit the vehicle to carry the cargo we want + if (!HasBit(available_cargo_types, cargo_type)) return INVALID_CARGO; // We can't refit the vehicle to carry the cargo we want - if (part_of_chain && !VerifyAutoreplaceRefitForOrders(v, engine_type)) return CT_INVALID; // Some refit orders lose their effect + if (part_of_chain && !VerifyAutoreplaceRefitForOrders(v, engine_type)) return INVALID_CARGO; // Some refit orders lose their effect return cargo_type; } @@ -352,7 +352,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic /* Build the new vehicle */ VehicleID new_veh_id; - std::tie(cost, new_veh_id, std::ignore, std::ignore, std::ignore) = Command::Do(DC_EXEC | DC_AUTOREPLACE, old_veh->tile, e, true, CT_INVALID, INVALID_CLIENT_ID); + std::tie(cost, new_veh_id, std::ignore, std::ignore, std::ignore) = Command::Do(DC_EXEC | DC_AUTOREPLACE, old_veh->tile, e, true, INVALID_CARGO, INVALID_CLIENT_ID); if (cost.Failed()) return cost; Vehicle *new_veh = Vehicle::Get(new_veh_id); diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 10f27330d0..8fdde0c771 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -95,7 +95,7 @@ static const NWidgetPart _nested_build_vehicle_widgets[] = { /** Special cargo filter criteria */ static const CargoID CF_ANY = CT_NO_REFIT; ///< Show all vehicles independent of carried cargo (i.e. no filtering) -static const CargoID CF_NONE = CT_INVALID; ///< Show only vehicles which do not carry cargo (e.g. train engines) +static const CargoID CF_NONE = INVALID_CARGO; ///< Show only vehicles which do not carry cargo (e.g. train engines) static const CargoID CF_ENGINES = CT_AUTO_REFIT; ///< Show only engines (for rail vehicles only) bool _engine_sort_direction; ///< \c false = descending, \c true = ascending. @@ -908,7 +908,7 @@ void TestedEngineDetails::FillDefaultCapacities(const Engine *e) this->all_capacities[this->cargo] = this->capacity; this->all_capacities[CT_MAIL] = this->mail_capacity; } - if (this->all_capacities.GetCount() == 0) this->cargo = CT_INVALID; + if (this->all_capacities.GetCount() == 0) this->cargo = INVALID_CARGO; } /** @@ -954,7 +954,7 @@ int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number, int new_y = DrawCargoCapacityInfo(left, right, y, te, refittable); if (new_y == y) { - SetDParam(0, CT_INVALID); + SetDParam(0, INVALID_CARGO); SetDParam(2, STR_EMPTY); DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY); y += GetCharacterHeight(FS_NORMAL); @@ -1293,7 +1293,7 @@ struct BuildVehicleWindow : Window { void SelectEngine(EngineID engine) { CargoID cargo = this->cargo_filter_criteria; - if (cargo == CF_ANY || cargo == CF_ENGINES || cargo == CF_NONE) cargo = CT_INVALID; + if (cargo == CF_ANY || cargo == CF_ENGINES || cargo == CF_NONE) cargo = INVALID_CARGO; this->sel_engine = engine; this->SetBuyVehicleText(); @@ -1652,7 +1652,7 @@ struct BuildVehicleWindow : Window { EngineID sel_eng = this->sel_engine; if (sel_eng != INVALID_ENGINE) { CargoID cargo = this->cargo_filter_criteria; - if (cargo == CF_ANY || cargo == CF_ENGINES || cargo == CF_NONE) cargo = CT_INVALID; + if (cargo == CF_ANY || cargo == CF_ENGINES || cargo == CF_NONE) cargo = INVALID_CARGO; if (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) { Command::Post(GetCmdBuildVehMsg(this->vehicle_type), CcBuildWagon, this->window_number, sel_eng, true, cargo, INVALID_CLIENT_ID); } else { diff --git a/src/cargo_type.h b/src/cargo_type.h index f9f8550b95..78d0a05d56 100644 --- a/src/cargo_type.h +++ b/src/cargo_type.h @@ -69,10 +69,12 @@ enum CargoType { CT_INVALID = 0xFF, ///< Invalid cargo type. }; +static const CargoID INVALID_CARGO = UINT8_MAX; + /** Test whether cargo type is not CT_INVALID */ inline bool IsValidCargoType(CargoType t) { return t != CT_INVALID; } -/** Test whether cargo type is not CT_INVALID */ -inline bool IsValidCargoID(CargoID t) { return t != CT_INVALID; } +/** Test whether cargo type is not INVALID_CARGO */ +inline bool IsValidCargoID(CargoID t) { return t != INVALID_CARGO; } typedef uint64_t CargoTypes; diff --git a/src/cargotype.cpp b/src/cargotype.cpp index 08c56bc535..925b8a98f4 100644 --- a/src/cargotype.cpp +++ b/src/cargotype.cpp @@ -88,13 +88,13 @@ Dimension GetLargestCargoIconSize() * Get the cargo ID of a default cargo, if present. * @param l Landscape * @param ct Default cargo type. - * @return ID number if the cargo exists, else #CT_INVALID + * @return ID number if the cargo exists, else #INVALID_CARGO */ CargoID GetDefaultCargoID(LandscapeID l, CargoType ct) { assert(l < lengthof(_default_climate_cargo)); - if (!IsValidCargoType(ct)) return CT_INVALID; + if (!IsValidCargoType(ct)) return INVALID_CARGO; assert(ct < lengthof(_default_climate_cargo[0])); CargoLabel cl = _default_climate_cargo[l][ct]; @@ -109,7 +109,7 @@ CargoID GetDefaultCargoID(LandscapeID l, CargoType ct) /** * Get the cargo ID by cargo label. * @param cl Cargo type to get. - * @return ID number if the cargo exists, else #CT_INVALID + * @return ID number if the cargo exists, else #INVALID_CARGO */ CargoID GetCargoIDByLabel(CargoLabel cl) { @@ -118,25 +118,25 @@ CargoID GetCargoIDByLabel(CargoLabel cl) } /* No matching label was found, so it is invalid */ - return CT_INVALID; + return INVALID_CARGO; } /** * Find the CargoID of a 'bitnum' value. * @param bitnum 'bitnum' to find. - * @return First CargoID with the given bitnum, or #CT_INVALID if not found or if the provided \a bitnum is invalid. + * @return First CargoID with the given bitnum, or #INVALID_CARGO if not found or if the provided \a bitnum is invalid. */ CargoID GetCargoIDByBitnum(uint8_t bitnum) { - if (bitnum == INVALID_CARGO_BITNUM) return CT_INVALID; + if (bitnum == INVALID_CARGO_BITNUM) return INVALID_CARGO; for (const CargoSpec *cs : CargoSpec::Iterate()) { if (cs->bitnum == bitnum) return cs->Index(); } /* No matching label was found, so it is invalid */ - return CT_INVALID; + return INVALID_CARGO; } /** diff --git a/src/engine.cpp b/src/engine.cpp index 417a52b087..7de1525c1c 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -85,8 +85,8 @@ Engine::Engine(VehicleType type, EngineID base) this->info.base_life = 0xFF; /* Set road vehicle tractive effort to the default value */ if (type == VEH_ROAD) this->u.road.tractive_effort = 0x4C; - /* Aircraft must have CT_INVALID as default, as there is no property */ - if (type == VEH_AIRCRAFT) this->info.cargo_type = CT_INVALID; + /* Aircraft must have INVALID_CARGO as default, as there is no property */ + if (type == VEH_AIRCRAFT) this->info.cargo_type = INVALID_CARGO; /* Set visual effect to the default value */ switch (type) { case VEH_TRAIN: this->u.rail.visual_effect = VE_DEFAULT; break; diff --git a/src/engine_base.h b/src/engine_base.h index b578eb854e..f52d3bd3b7 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -88,7 +88,7 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> { * Usually a valid cargo is returned, even though the vehicle has zero capacity, and can therefore not carry anything. But the cargotype is still used * for livery selection etc.. * - * Vehicles with CT_INVALID as default cargo are usually not available, but it can appear as default cargo of articulated parts. + * Vehicles with INVALID_CARGO as default cargo are usually not available, but it can appear as default cargo of articulated parts. * * @return The default cargo type. * @see CanCarryCargo diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 97b3bd4be4..14866db3f7 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -183,7 +183,7 @@ static StringID GetTrainEngineInfoString(const Engine *e) SetDParam(5, e->GetDefaultCargoType()); SetDParam(6, capacity); } else { - SetDParam(5, CT_INVALID); + SetDParam(5, INVALID_CARGO); } return (_settings_game.vehicle.train_acceleration_model != AM_ORIGINAL && GetRailTypeInfo(e->u.rail.railtype)->acceleration_type != 2) ? STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE : STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER; } @@ -224,7 +224,7 @@ static StringID GetRoadVehEngineInfoString(const Engine *e) SetDParam(2, e->GetDefaultCargoType()); SetDParam(3, capacity); } else { - SetDParam(2, CT_INVALID); + SetDParam(2, INVALID_CARGO); } SetDParam(4, e->GetRunningCost()); return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST; @@ -242,7 +242,7 @@ static StringID GetRoadVehEngineInfoString(const Engine *e) SetDParam(5, e->GetDefaultCargoType()); SetDParam(6, capacity); } else { - SetDParam(5, CT_INVALID); + SetDParam(5, INVALID_CARGO); } return STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE; } diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 59a726d7ff..92861e29ec 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -424,7 +424,7 @@ static void AddAcceptedCargo_Industry(TileIndex tile, CargoArray &acceptance, Ca auto pos = std::find(std::begin(accepts_cargo), std::end(accepts_cargo), a.cargo); if (pos == std::end(accepts_cargo)) { /* Not found, insert */ - pos = std::find(std::begin(accepts_cargo), std::end(accepts_cargo), CT_INVALID); + pos = std::find(std::begin(accepts_cargo), std::end(accepts_cargo), INVALID_CARGO); if (pos == std::end(accepts_cargo)) continue; // nowhere to place, give up on this one *pos = a.cargo; } @@ -436,7 +436,7 @@ static void AddAcceptedCargo_Industry(TileIndex tile, CargoArray &acceptance, Ca /* Try callback for accepts list, if success override all existing accepts */ uint16_t res = GetIndustryTileCallback(CBID_INDTILE_ACCEPT_CARGO, 0, 0, gfx, Industry::GetByTile(tile), tile); if (res != CALLBACK_FAILED) { - accepts_cargo.fill(CT_INVALID); + accepts_cargo.fill(INVALID_CARGO); for (uint i = 0; i < 3; i++) accepts_cargo[i] = GetCargoTranslation(GB(res, i * 5, 5), itspec->grf_prop.grffile); } } @@ -1838,7 +1838,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, if (HasBit(indspec->callback_mask, CBM_IND_INPUT_CARGO_TYPES)) { /* Clear all input cargo types */ - for (auto &a : i->accepted) a.cargo = CT_INVALID; + for (auto &a : i->accepted) a.cargo = INVALID_CARGO; /* Query actual types */ uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? static_cast(i->accepted.size()) : 3; for (uint j = 0; j < maxcargoes; j++) { @@ -1870,7 +1870,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, if (HasBit(indspec->callback_mask, CBM_IND_OUTPUT_CARGO_TYPES)) { /* Clear all output cargo types */ - for (auto &p : i->produced) p.cargo = CT_INVALID; + for (auto &p : i->produced) p.cargo = INVALID_CARGO; /* Query actual types */ uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? static_cast(i->produced.size()) : 2; for (uint j = 0; j < maxcargoes; j++) { diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 51a271da56..a0f899c799 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -148,7 +148,7 @@ enum CargoSuffixInOut { * @param ind the industry (nullptr if in fund window) * @param ind_type the industry type * @param indspec the industry spec - * @param cargoes array with cargotypes. for CT_INVALID no suffix will be determined + * @param cargoes array with cargotypes. for INVALID_CARGO no suffix will be determined * @param suffixes is filled with the suffixes */ template @@ -197,7 +197,7 @@ static inline void GetAllCargoSuffixes(CargoSuffixInOut use_input, CargoSuffixTy * @param ind the industry (nullptr if in fund window) * @param ind_type the industry type * @param indspec the industry spec - * @param cargo cargotype. for CT_INVALID no suffix will be determined + * @param cargo cargotype. for INVALID_CARGO no suffix will be determined * @param slot accepts/produced slot number, used for old-style 3-in/2-out industries. * @param suffix is filled with the suffix */ @@ -1248,7 +1248,7 @@ typedef GUIListtype = CFT_INDUSTRY; this->u.industry.ind_type = ind_type; - std::fill(std::begin(this->u.industry.other_accepted), std::end(this->u.industry.other_accepted), CT_INVALID); - std::fill(std::begin(this->u.industry.other_produced), std::end(this->u.industry.other_produced), CT_INVALID); + std::fill(std::begin(this->u.industry.other_accepted), std::end(this->u.industry.other_accepted), INVALID_CARGO); + std::fill(std::begin(this->u.industry.other_produced), std::end(this->u.industry.other_produced), INVALID_CARGO); } /** @@ -2079,7 +2079,7 @@ struct CargoesField { /** * Make a piece of cargo column. - * @param cargoes Array of #CargoID (may contain #CT_INVALID). + * @param cargoes Array of #CargoID (may contain #INVALID_CARGO). * @param length Number of cargoes in \a cargoes. * @param count Number of cargoes to display (should be at least the number of valid cargoes, or \c -1 to let the method compute it). * @param top_end This is the first cargo field of this column. @@ -2099,16 +2099,16 @@ struct CargoesField { this->u.cargo.num_cargoes = (count < 0) ? static_cast(insert - std::begin(this->u.cargo.vertical_cargoes)) : count; CargoIDComparator comparator; std::sort(std::begin(this->u.cargo.vertical_cargoes), insert, comparator); - std::fill(insert, std::end(this->u.cargo.vertical_cargoes), CT_INVALID); + std::fill(insert, std::end(this->u.cargo.vertical_cargoes), INVALID_CARGO); this->u.cargo.top_end = top_end; this->u.cargo.bottom_end = bottom_end; - std::fill(std::begin(this->u.cargo.supp_cargoes), std::end(this->u.cargo.supp_cargoes), CT_INVALID); - std::fill(std::begin(this->u.cargo.cust_cargoes), std::end(this->u.cargo.cust_cargoes), CT_INVALID); + std::fill(std::begin(this->u.cargo.supp_cargoes), std::end(this->u.cargo.supp_cargoes), INVALID_CARGO); + std::fill(std::begin(this->u.cargo.cust_cargoes), std::end(this->u.cargo.cust_cargoes), INVALID_CARGO); } /** * Make a field displaying cargo type names. - * @param cargoes Array of #CargoID (may contain #CT_INVALID). + * @param cargoes Array of #CargoID (may contain #INVALID_CARGO). * @param length Number of cargoes in \a cargoes. * @param left_align ALign texts to the left (else to the right). */ @@ -2117,7 +2117,7 @@ struct CargoesField { this->type = CFT_CARGO_LABEL; uint i; for (i = 0; i < MAX_CARGOES && i < length; i++) this->u.cargo_label.cargoes[i] = cargoes[i]; - for (; i < MAX_CARGOES; i++) this->u.cargo_label.cargoes[i] = CT_INVALID; + for (; i < MAX_CARGOES; i++) this->u.cargo_label.cargoes[i] = INVALID_CARGO; this->u.cargo_label.left_align = left_align; } @@ -2290,7 +2290,7 @@ struct CargoesField { * @param left Left industry neighbour if available (else \c nullptr should be supplied). * @param right Right industry neighbour if available (else \c nullptr should be supplied). * @param pt Click position in the cargo field. - * @return Cargo clicked at, or #CT_INVALID if none. + * @return Cargo clicked at, or #INVALID_CARGO if none. */ CargoID CargoClickedAt(const CargoesField *left, const CargoesField *right, Point pt) const { @@ -2309,11 +2309,11 @@ struct CargoesField { int vpos = vert_inter_industry_space / 2 + CargoesField::cargo_border.width; uint row; for (row = 0; row < MAX_CARGOES; row++) { - if (pt.y < vpos) return CT_INVALID; + if (pt.y < vpos) return INVALID_CARGO; if (pt.y < vpos + GetCharacterHeight(FS_NORMAL)) break; vpos += GetCharacterHeight(FS_NORMAL) + CargoesField::cargo_space.width; } - if (row == MAX_CARGOES) return CT_INVALID; + if (row == MAX_CARGOES) return INVALID_CARGO; /* row = 0 -> at first horizontal row, row = 1 -> second horizontal row, 2 = 3rd horizontal row. */ if (col == 0) { @@ -2322,7 +2322,7 @@ struct CargoesField { if (left->type == CFT_INDUSTRY) return left->u.industry.other_produced[row]; if (left->type == CFT_CARGO_LABEL && !left->u.cargo_label.left_align) return left->u.cargo_label.cargoes[row]; } - return CT_INVALID; + return INVALID_CARGO; } if (col == this->u.cargo.num_cargoes) { if (IsValidCargoID(this->u.cargo.cust_cargoes[row])) return this->u.cargo.vertical_cargoes[this->u.cargo.cust_cargoes[row]]; @@ -2330,7 +2330,7 @@ struct CargoesField { if (right->type == CFT_INDUSTRY) return right->u.industry.other_accepted[row]; if (right->type == CFT_CARGO_LABEL && right->u.cargo_label.left_align) return right->u.cargo_label.cargoes[row]; } - return CT_INVALID; + return INVALID_CARGO; } if (row >= col) { /* Clicked somewhere in-between vertical cargo connection. @@ -2338,17 +2338,17 @@ struct CargoesField { * ensures we are left-below the main diagonal, thus at the supplying side. */ if (IsValidCargoID(this->u.cargo.supp_cargoes[row])) return this->u.cargo.vertical_cargoes[this->u.cargo.supp_cargoes[row]]; - return CT_INVALID; + return INVALID_CARGO; } /* Clicked at a customer connection. */ if (IsValidCargoID(this->u.cargo.cust_cargoes[row])) return this->u.cargo.vertical_cargoes[this->u.cargo.cust_cargoes[row]]; - return CT_INVALID; + return INVALID_CARGO; } /** * Decide what cargo the user clicked in the cargo label field. * @param pt Click position in the cargo label field. - * @return Cargo clicked at, or #CT_INVALID if none. + * @return Cargo clicked at, or #INVALID_CARGO if none. */ CargoID CargoLabelClickedAt(Point pt) const { @@ -2357,11 +2357,11 @@ struct CargoesField { int vpos = vert_inter_industry_space / 2 + CargoesField::cargo_border.height; uint row; for (row = 0; row < MAX_CARGOES; row++) { - if (pt.y < vpos) return CT_INVALID; + if (pt.y < vpos) return INVALID_CARGO; if (pt.y < vpos + GetCharacterHeight(FS_NORMAL)) break; vpos += GetCharacterHeight(FS_NORMAL) + CargoesField::cargo_space.height; } - if (row == MAX_CARGOES) return CT_INVALID; + if (row == MAX_CARGOES) return INVALID_CARGO; return this->u.cargo_label.cargoes[row]; } @@ -2416,7 +2416,7 @@ struct CargoesRow { CargoesField *cargo_fld = this->columns + column + 1; assert(ind_fld->type == CFT_INDUSTRY && cargo_fld->type == CFT_CARGO); - std::fill(std::begin(ind_fld->u.industry.other_produced), std::end(ind_fld->u.industry.other_produced), CT_INVALID); + std::fill(std::begin(ind_fld->u.industry.other_produced), std::end(ind_fld->u.industry.other_produced), INVALID_CARGO); if (ind_fld->u.industry.ind_type < NUM_INDUSTRYTYPES) { CargoID others[MAX_CARGOES]; // Produced cargoes not carried in the cargo column. @@ -2450,7 +2450,7 @@ struct CargoesRow { void MakeCargoLabel(int column, bool accepting) { CargoID cargoes[MAX_CARGOES]; - std::fill(std::begin(cargoes), std::end(cargoes), CT_INVALID); + std::fill(std::begin(cargoes), std::end(cargoes), INVALID_CARGO); CargoesField *label_fld = this->columns + column; CargoesField *cargo_fld = this->columns + (accepting ? column - 1 : column + 1); @@ -2474,7 +2474,7 @@ struct CargoesRow { CargoesField *cargo_fld = this->columns + column - 1; assert(ind_fld->type == CFT_INDUSTRY && cargo_fld->type == CFT_CARGO); - std::fill(std::begin(ind_fld->u.industry.other_accepted), std::end(ind_fld->u.industry.other_accepted), CT_INVALID); + std::fill(std::begin(ind_fld->u.industry.other_accepted), std::end(ind_fld->u.industry.other_accepted), INVALID_CARGO); if (ind_fld->u.industry.ind_type < NUM_INDUSTRYTYPES) { CargoID others[MAX_CARGOES]; // Accepted cargoes not carried in the cargo column. @@ -3157,7 +3157,7 @@ struct IndustryCargoesWindow : public Window { if (!CalculatePositionInWidget(pt, &fieldxy, &xy)) return false; const CargoesField *fld = this->fields[fieldxy.y].columns + fieldxy.x; - CargoID cid = CT_INVALID; + CargoID cid = INVALID_CARGO; switch (fld->type) { case CFT_CARGO: { CargoesField *lft = (fieldxy.x > 0) ? this->fields[fieldxy.y].columns + fieldxy.x - 1 : nullptr; diff --git a/src/linkgraph/linkgraph.h b/src/linkgraph/linkgraph.h index 12f32a2885..e9c346a4ff 100644 --- a/src/linkgraph/linkgraph.h +++ b/src/linkgraph/linkgraph.h @@ -189,7 +189,7 @@ public: } /** Bare constructor, only for save/load. */ - LinkGraph() : cargo(CT_INVALID), last_compression(0) {} + LinkGraph() : cargo(INVALID_CARGO), last_compression(0) {} /** * Real constructor. * @param cargo Cargo the link graph is about. diff --git a/src/linkgraph/linkgraph_gui.h b/src/linkgraph/linkgraph_gui.h index 9e2d064285..e86a38b84b 100644 --- a/src/linkgraph/linkgraph_gui.h +++ b/src/linkgraph/linkgraph_gui.h @@ -21,7 +21,7 @@ * Only the cargo type of the most saturated linkgraph is taken into account. */ struct LinkProperties { - LinkProperties() : cargo(CT_INVALID), capacity(0), usage(0), planned(0), shared(false) {} + LinkProperties() : cargo(INVALID_CARGO), capacity(0), usage(0), planned(0), shared(false) {} /** Return the usage of the link to display. */ uint Usage() const { return std::max(this->usage, this->planned); } diff --git a/src/linkgraph/refresh.cpp b/src/linkgraph/refresh.cpp index 98fdaeba46..8cb6c81ec3 100644 --- a/src/linkgraph/refresh.cpp +++ b/src/linkgraph/refresh.cpp @@ -67,7 +67,7 @@ bool LinkRefresher::Hop::operator<(const Hop &other) const * @param is_full_loading If the vehicle is full loading. */ LinkRefresher::LinkRefresher(Vehicle *vehicle, HopSet *seen_hops, bool allow_merge, bool is_full_loading) : - vehicle(vehicle), seen_hops(seen_hops), cargo(CT_INVALID), allow_merge(allow_merge), + vehicle(vehicle), seen_hops(seen_hops), cargo(INVALID_CARGO), allow_merge(allow_merge), is_full_loading(is_full_loading) { memset(this->capacities, 0, sizeof(this->capacities)); diff --git a/src/linkgraph/refresh.h b/src/linkgraph/refresh.h index 3c1fe40ecf..1d2b26ae65 100644 --- a/src/linkgraph/refresh.h +++ b/src/linkgraph/refresh.h @@ -56,7 +56,7 @@ protected: struct Hop { OrderID from; ///< Last order where vehicle could interact with cargo or absolute first order. OrderID to; ///< Next order to be processed. - CargoID cargo; ///< Cargo the consist is probably carrying or CT_INVALID if unknown. + CargoID cargo; ///< Cargo the consist is probably carrying or INVALID_CARGO if unknown. /** * Default constructor should not be called but has to be visible for diff --git a/src/newgrf.cpp b/src/newgrf.cpp index b1268a4249..38788801d2 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1140,15 +1140,15 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop if (ctype == 0xFF) { /* 0xFF is specified as 'use first refittable' */ - ei->cargo_type = CT_INVALID; + ei->cargo_type = INVALID_CARGO; } else if (_cur.grffile->grf_version >= 8) { - /* Use translated cargo. Might result in CT_INVALID (first refittable), if cargo is not defined. */ + /* Use translated cargo. Might result in INVALID_CARGO (first refittable), if cargo is not defined. */ ei->cargo_type = GetCargoTranslation(ctype, _cur.grffile); } else if (ctype < NUM_CARGO) { /* Use untranslated cargo. */ ei->cargo_type = ctype; } else { - ei->cargo_type = CT_INVALID; + ei->cargo_type = INVALID_CARGO; GrfMsg(2, "RailVehicleChangeInfo: Invalid cargo type {}, using first refittable", ctype); } break; @@ -1401,15 +1401,15 @@ static ChangeInfoResult RoadVehicleChangeInfo(uint engine, int numinfo, int prop if (ctype == 0xFF) { /* 0xFF is specified as 'use first refittable' */ - ei->cargo_type = CT_INVALID; + ei->cargo_type = INVALID_CARGO; } else if (_cur.grffile->grf_version >= 8) { - /* Use translated cargo. Might result in CT_INVALID (first refittable), if cargo is not defined. */ + /* Use translated cargo. Might result in INVALID_CARGO (first refittable), if cargo is not defined. */ ei->cargo_type = GetCargoTranslation(ctype, _cur.grffile); } else if (ctype < NUM_CARGO) { /* Use untranslated cargo. */ ei->cargo_type = ctype; } else { - ei->cargo_type = CT_INVALID; + ei->cargo_type = INVALID_CARGO; GrfMsg(2, "RailVehicleChangeInfo: Invalid cargo type {}, using first refittable", ctype); } break; @@ -1596,15 +1596,15 @@ static ChangeInfoResult ShipVehicleChangeInfo(uint engine, int numinfo, int prop if (ctype == 0xFF) { /* 0xFF is specified as 'use first refittable' */ - ei->cargo_type = CT_INVALID; + ei->cargo_type = INVALID_CARGO; } else if (_cur.grffile->grf_version >= 8) { - /* Use translated cargo. Might result in CT_INVALID (first refittable), if cargo is not defined. */ + /* Use translated cargo. Might result in INVALID_CARGO (first refittable), if cargo is not defined. */ ei->cargo_type = GetCargoTranslation(ctype, _cur.grffile); } else if (ctype < NUM_CARGO) { /* Use untranslated cargo. */ ei->cargo_type = ctype; } else { - ei->cargo_type = CT_INVALID; + ei->cargo_type = INVALID_CARGO; GrfMsg(2, "ShipVehicleChangeInfo: Invalid cargo type {}, using first refittable", ctype); } break; @@ -2588,7 +2588,7 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt housespec->accepts_cargo[i] = GetCargoTranslation(buf->ReadByte(), _cur.grffile); housespec->cargo_acceptance[i] = buf->ReadByte(); } else { - housespec->accepts_cargo[i] = CT_INVALID; + housespec->accepts_cargo[i] = INVALID_CARGO; housespec->cargo_acceptance[i] = 0; } } @@ -3306,7 +3306,7 @@ static ChangeInfoResult IndustrytilesChangeInfo(uint indtid, int numinfo, int pr /* Tile acceptance can be negative to counteract the INDTILE_SPECIAL_ACCEPTS_ALL_CARGO flag */ tsp->acceptance[i] = (int8_t)buf->ReadByte(); } else { - tsp->accepts_cargo[i] = CT_INVALID; + tsp->accepts_cargo[i] = INVALID_CARGO; tsp->acceptance[i] = 0; } } @@ -3753,7 +3753,7 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop, CargoID cargo = GetCargoTranslation(buf->ReadByte(), _cur.grffile); indsp->produced_cargo[i] = cargo; } else { - indsp->produced_cargo[i] = CT_INVALID; + indsp->produced_cargo[i] = INVALID_CARGO; } } break; @@ -3771,7 +3771,7 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop, CargoID cargo = GetCargoTranslation(buf->ReadByte(), _cur.grffile); indsp->accepts_cargo[i] = cargo; } else { - indsp->accepts_cargo[i] = CT_INVALID; + indsp->accepts_cargo[i] = INVALID_CARGO; } } break; @@ -5515,7 +5515,7 @@ static CargoID TranslateCargo(uint8_t feature, uint8_t ctype) /* No cargo table, so use bitnum values */ if (ctype >= 32) { GrfMsg(1, "TranslateCargo: Cargo bitnum {} out of range (max 31), skipping.", ctype); - return CT_INVALID; + return INVALID_CARGO; } for (const CargoSpec *cs : CargoSpec::Iterate()) { @@ -5526,30 +5526,30 @@ static CargoID TranslateCargo(uint8_t feature, uint8_t ctype) } GrfMsg(5, "TranslateCargo: Cargo bitnum {} not available in this climate, skipping.", ctype); - return CT_INVALID; + return INVALID_CARGO; } /* Check if the cargo type is out of bounds of the cargo translation table */ if (ctype >= _cur.grffile->cargo_list.size()) { GrfMsg(1, "TranslateCargo: Cargo type {} out of range (max {}), skipping.", ctype, (unsigned int)_cur.grffile->cargo_list.size() - 1); - return CT_INVALID; + return INVALID_CARGO; } /* Look up the cargo label from the translation table */ CargoLabel cl = _cur.grffile->cargo_list[ctype]; if (cl == 0) { GrfMsg(5, "TranslateCargo: Cargo type {} not available in this climate, skipping.", ctype); - return CT_INVALID; + return INVALID_CARGO; } - ctype = GetCargoIDByLabel(cl); - if (!IsValidCargoID(ctype)) { + CargoID cid = GetCargoIDByLabel(cl); + if (!IsValidCargoID(cid)) { GrfMsg(5, "TranslateCargo: Cargo '{:c}{:c}{:c}{:c}' unsupported, skipping.", GB(cl, 24, 8), GB(cl, 16, 8), GB(cl, 8, 8), GB(cl, 0, 8)); - return CT_INVALID; + return INVALID_CARGO; } - GrfMsg(6, "TranslateCargo: Cargo '{:c}{:c}{:c}{:c}' mapped to cargo type {}.", GB(cl, 24, 8), GB(cl, 16, 8), GB(cl, 8, 8), GB(cl, 0, 8), ctype); - return ctype; + GrfMsg(6, "TranslateCargo: Cargo '{:c}{:c}{:c}{:c}' mapped to cargo type {}.", GB(cl, 24, 8), GB(cl, 16, 8), GB(cl, 8, 8), GB(cl, 0, 8), cid); + return cid; } @@ -5612,8 +5612,8 @@ static void VehicleMapSpriteGroup(ByteReader *buf, byte feature, uint8_t idcount GrfMsg(8, "VehicleMapSpriteGroup: * [{}] Cargo type 0x{:X}, group id 0x{:02X}", c, ctype, groupid); - ctype = TranslateCargo(feature, ctype); - if (!IsValidCargoID(ctype)) continue; + CargoID cid = TranslateCargo(feature, ctype); + if (!IsValidCargoID(cid)) continue; for (uint i = 0; i < idcount; i++) { EngineID engine = engines[i]; @@ -5621,9 +5621,9 @@ static void VehicleMapSpriteGroup(ByteReader *buf, byte feature, uint8_t idcount GrfMsg(7, "VehicleMapSpriteGroup: [{}] Engine {}...", i, engine); if (wagover) { - SetWagonOverrideSprites(engine, ctype, _cur.spritegroups[groupid], last_engines, last_engines_count); + SetWagonOverrideSprites(engine, cid, _cur.spritegroups[groupid], last_engines, last_engines_count); } else { - SetCustomEngineSprites(engine, ctype, _cur.spritegroups[groupid]); + SetCustomEngineSprites(engine, cid, _cur.spritegroups[groupid]); } } } @@ -9055,12 +9055,12 @@ static void CalculateRefitMasks() } /* Clear invalid cargoslots (from default vehicles or pre-NewCargo GRFs) */ - if (IsValidCargoID(ei->cargo_type) && !HasBit(_cargo_mask, ei->cargo_type)) ei->cargo_type = CT_INVALID; + if (IsValidCargoID(ei->cargo_type) && !HasBit(_cargo_mask, ei->cargo_type)) ei->cargo_type = INVALID_CARGO; /* Ensure that the vehicle is either not refittable, or that the default cargo is one of the refittable cargoes. * Note: Vehicles refittable to no cargo are handle differently to vehicle refittable to a single cargo. The latter might have subtypes. */ if (!only_defaultcargo && (e->type != VEH_SHIP || e->u.ship.old_refittable) && IsValidCargoID(ei->cargo_type) && !HasBit(ei->refit_mask, ei->cargo_type)) { - ei->cargo_type = CT_INVALID; + ei->cargo_type = INVALID_CARGO; } /* Check if this engine's cargo type is valid. If not, set to the first refittable diff --git a/src/newgrf_airporttiles.h b/src/newgrf_airporttiles.h index 9a46030a33..2362cfe110 100644 --- a/src/newgrf_airporttiles.h +++ b/src/newgrf_airporttiles.h @@ -85,8 +85,8 @@ private: }; void AnimateAirportTile(TileIndex tile); -void AirportTileAnimationTrigger(Station *st, TileIndex tile, AirpAnimationTrigger trigger, CargoID cargo_type = CT_INVALID); -void AirportAnimationTrigger(Station *st, AirpAnimationTrigger trigger, CargoID cargo_type = CT_INVALID); +void AirportTileAnimationTrigger(Station *st, TileIndex tile, AirpAnimationTrigger trigger, CargoID cargo_type = INVALID_CARGO); +void AirportAnimationTrigger(Station *st, AirpAnimationTrigger trigger, CargoID cargo_type = INVALID_CARGO); bool DrawNewAirportTile(TileInfo *ti, Station *st, const AirportTileSpec *airts); #endif /* NEWGRF_AIRPORTTILES_H */ diff --git a/src/newgrf_cargo.cpp b/src/newgrf_cargo.cpp index 75e9885130..ffd1c44269 100644 --- a/src/newgrf_cargo.cpp +++ b/src/newgrf_cargo.cpp @@ -74,13 +74,13 @@ uint16_t GetCargoCallback(CallbackID callback, uint32_t param1, uint32_t param2, * @param usebit Defines the meaning of \a cargo for GRF version < 7. * If true, then \a cargo is a bitnum. If false, then \a cargo is a cargoslot. * For GRF version >= 7 \a cargo is always a translated cargo bit. - * @return CargoID or CT_INVALID if the cargo is not available. + * @return CargoID or INVALID_CARGO if the cargo is not available. */ CargoID GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit) { /* Pre-version 7 uses the 'climate dependent' ID in callbacks and properties, i.e. cargo is the cargo ID */ if (grffile->grf_version < 7 && !usebit) { - if (cargo >= CargoSpec::GetArraySize() || !CargoSpec::Get(cargo)->IsValid()) return CT_INVALID; + if (cargo >= CargoSpec::GetArraySize() || !CargoSpec::Get(cargo)->IsValid()) return INVALID_CARGO; return cargo; } @@ -94,5 +94,5 @@ CargoID GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit) /* Else the cargo value is a 'climate independent' 'bitnum' */ return GetCargoIDByBitnum(cargo); } - return CT_INVALID; + return INVALID_CARGO; } diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index bea6c1d2e8..2c3ee33af2 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -451,8 +451,8 @@ static uint32_t VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *objec /* Pick the most common cargo type */ auto cargo_it = std::max_element(std::begin(common_cargoes), std::end(common_cargoes)); - /* Return CT_INVALID if nothing is carried */ - CargoID common_cargo_type = (*cargo_it == 0) ? (CargoID)CT_INVALID : static_cast(std::distance(std::begin(common_cargoes), cargo_it)); + /* Return INVALID_CARGO if nothing is carried */ + CargoID common_cargo_type = (*cargo_it == 0) ? INVALID_CARGO : static_cast(std::distance(std::begin(common_cargoes), cargo_it)); /* Count subcargo types of common_cargo_type */ std::array common_subtypes{}; @@ -486,7 +486,7 @@ static uint32_t VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *objec * And this is only done by CheckCaches(). */ const GRFFile *grffile = object->ro.grffile; - uint8_t common_bitnum = (common_cargo_type == CT_INVALID) ? 0xFF : + uint8_t common_bitnum = (common_cargo_type == INVALID_CARGO) ? 0xFF : (grffile == nullptr || grffile->grf_version < 8) ? CargoSpec::Get(common_cargo_type)->bitnum : grffile->cargo_map[common_cargo_type]; return (v->grf_cache.consist_cargo_information & 0xFFFF00FF) | common_bitnum << 8; diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp index 9fe9bf3af3..2f8c0cc99c 100644 --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -347,7 +347,7 @@ void TriggerRoadStopAnimation(BaseStation *st, TileIndex trigger_tile, StationAn if (ss != nullptr && HasBit(ss->animation.triggers, trigger)) { CargoID cargo; if (!IsValidCargoID(cargo_type)) { - cargo = CT_INVALID; + cargo = INVALID_CARGO; } else { cargo = ss->grf_prop.grffile->cargo_map[cargo_type]; } diff --git a/src/newgrf_roadstop.h b/src/newgrf_roadstop.h index eda86054d9..bcea002c87 100644 --- a/src/newgrf_roadstop.h +++ b/src/newgrf_roadstop.h @@ -169,8 +169,8 @@ uint16_t GetRoadStopCallback(CallbackID callback, uint32_t param1, uint32_t para void AnimateRoadStopTile(TileIndex tile); uint8_t GetRoadStopTileAnimationSpeed(TileIndex tile); -void TriggerRoadStopAnimation(BaseStation *st, TileIndex tile, StationAnimationTrigger trigger, CargoID cargo_type = CT_INVALID); -void TriggerRoadStopRandomisation(Station *st, TileIndex tile, RoadStopRandomTrigger trigger, CargoID cargo_type = CT_INVALID); +void TriggerRoadStopAnimation(BaseStation *st, TileIndex tile, StationAnimationTrigger trigger, CargoID cargo_type = INVALID_CARGO); +void TriggerRoadStopRandomisation(Station *st, TileIndex tile, RoadStopRandomTrigger trigger, CargoID cargo_type = INVALID_CARGO); bool GetIfNewStopsByType(RoadStopType rs, RoadType roadtype); bool GetIfClassHasNewStopsByType(RoadStopClass *roadstopclass, RoadStopType rs, RoadType roadtype); diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index 167eeb2af1..6bfaa637a8 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -495,7 +495,7 @@ uint32_t Waypoint::GetNewGRFVariable(const ResolverObject &, byte variable, [[ma const Station *st = Station::From(this->station_scope.st); switch (this->station_scope.cargo_type) { - case CT_INVALID: + case INVALID_CARGO: case CT_DEFAULT_NA: case CT_PURCHASE: cargo = 0; @@ -887,7 +887,7 @@ void TriggerStationAnimation(BaseStation *st, TileIndex trigger_tile, StationAni if (ss != nullptr && HasBit(ss->animation.triggers, trigger)) { CargoID cargo; if (!IsValidCargoID(cargo_type)) { - cargo = CT_INVALID; + cargo = INVALID_CARGO; } else { cargo = ss->grf_prop.grffile->cargo_map[cargo_type]; } diff --git a/src/newgrf_station.h b/src/newgrf_station.h index 885af41e27..eae3a42522 100644 --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -36,7 +36,7 @@ struct StationScopeResolver : public ScopeResolver { * @param tile %Tile of the station. */ StationScopeResolver(ResolverObject &ro, const StationSpec *statspec, BaseStation *st, TileIndex tile) - : ScopeResolver(ro), tile(tile), st(st), statspec(statspec), cargo_type(CT_INVALID), axis(INVALID_AXIS) + : ScopeResolver(ro), tile(tile), st(st), statspec(statspec), cargo_type(INVALID_CARGO), axis(INVALID_AXIS) { } @@ -198,8 +198,8 @@ void DeallocateSpecFromStation(BaseStation *st, byte specindex); bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID sclass, uint station); void AnimateStationTile(TileIndex tile); -void TriggerStationAnimation(BaseStation *st, TileIndex tile, StationAnimationTrigger trigger, CargoID cargo_type = CT_INVALID); -void TriggerStationRandomisation(Station *st, TileIndex tile, StationRandomTrigger trigger, CargoID cargo_type = CT_INVALID); +void TriggerStationAnimation(BaseStation *st, TileIndex tile, StationAnimationTrigger trigger, CargoID cargo_type = INVALID_CARGO); +void TriggerStationRandomisation(Station *st, TileIndex tile, StationRandomTrigger trigger, CargoID cargo_type = INVALID_CARGO); void StationUpdateCachedTriggers(BaseStation *st); #endif /* NEWGRF_STATION_H */ diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 368bafa9be..06a4f440c5 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -3029,13 +3029,13 @@ bool AfterLoadGame() /* Make sure added industry cargo slots are cleared */ for (Industry *i : Industry::Iterate()) { for (auto it = std::begin(i->produced) + 2; it != std::end(i->produced); ++it) { - it->cargo = CT_INVALID; + it->cargo = INVALID_CARGO; it->waiting = 0; it->rate = 0; it->history = {}; } for (auto it = std::begin(i->accepted) + 3; it != std::end(i->accepted); ++it) { - it->cargo = CT_INVALID; + it->cargo = INVALID_CARGO; it->waiting = 0; } /* Make sure last_cargo_accepted_at is copied to elements for every valid input cargo. diff --git a/src/script/api/script_cargo.hpp b/src/script/api/script_cargo.hpp index 7d4b207ed6..5ac669ed03 100644 --- a/src/script/api/script_cargo.hpp +++ b/src/script/api/script_cargo.hpp @@ -57,7 +57,7 @@ public: /* Note: these values represent part of the in-game CargoTypes enum */ CT_AUTO_REFIT = ::CT_AUTO_REFIT, ///< Automatically choose cargo type when doing auto-refitting. CT_NO_REFIT = ::CT_NO_REFIT, ///< Do not refit cargo of a vehicle. - CT_INVALID = ::CT_INVALID, ///< An invalid cargo type. + CT_INVALID = ::INVALID_CARGO, ///< An invalid cargo type. }; /** diff --git a/src/script/api/script_engine.cpp b/src/script/api/script_engine.cpp index bce5816251..c142c5fd30 100644 --- a/src/script/api/script_engine.cpp +++ b/src/script/api/script_engine.cpp @@ -52,12 +52,12 @@ /* static */ CargoID ScriptEngine::GetCargoType(EngineID engine_id) { - if (!IsValidEngine(engine_id)) return CT_INVALID; + if (!IsValidEngine(engine_id)) return INVALID_CARGO; CargoArray cap = ::GetCapacityOfArticulatedParts(engine_id); auto it = std::max_element(std::cbegin(cap), std::cend(cap)); - if (*it == 0) return CT_INVALID; + if (*it == 0) return INVALID_CARGO; return CargoID(std::distance(std::cbegin(cap), it)); } diff --git a/src/script/api/script_event_types.cpp b/src/script/api/script_event_types.cpp index 48d6405e57..6344c907ca 100644 --- a/src/script/api/script_event_types.cpp +++ b/src/script/api/script_event_types.cpp @@ -39,11 +39,11 @@ std::optional ScriptEventEnginePreview::GetName() CargoID ScriptEventEnginePreview::GetCargoType() { - if (!this->IsEngineValid()) return CT_INVALID; + if (!this->IsEngineValid()) return INVALID_CARGO; CargoArray cap = ::GetCapacityOfArticulatedParts(this->engine); auto it = std::max_element(std::cbegin(cap), std::cend(cap)); - if (*it == 0) return CT_INVALID; + if (*it == 0) return INVALID_CARGO; return CargoID(std::distance(std::cbegin(cap), it)); } diff --git a/src/script/api/script_industry.hpp b/src/script/api/script_industry.hpp index ea9bc7f9d8..3bca023d56 100644 --- a/src/script/api/script_industry.hpp +++ b/src/script/api/script_industry.hpp @@ -257,9 +257,9 @@ public: /** * Get the last date this industry accepted any cargo delivery. * @param industry_id The index of the industry. - * @param cargo_type The cargo to query, or CT_INVALID to query latest of all accepted cargoes. + * @param cargo_type The cargo to query, or INVALID_CARGO to query latest of all accepted cargoes. * @pre IsValidIndustry(industry_id). - * @pre IsValidCargo(cargo_type) || cargo_type == CT_INVALID. + * @pre IsValidCargo(cargo_type) || cargo_type == INVALID_CARGO. * @return Date the industry last received cargo from a delivery, or ScriptDate::DATE_INVALID on error. * @api -ai */ diff --git a/src/script/api/script_subsidy.cpp b/src/script/api/script_subsidy.cpp index afc6eef14b..14b964878e 100644 --- a/src/script/api/script_subsidy.cpp +++ b/src/script/api/script_subsidy.cpp @@ -67,7 +67,7 @@ /* static */ CargoID ScriptSubsidy::GetCargoType(SubsidyID subsidy_id) { - if (!IsValidSubsidy(subsidy_id)) return CT_INVALID; + if (!IsValidSubsidy(subsidy_id)) return INVALID_CARGO; return ::Subsidy::Get(subsidy_id)->cargo_type; } diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp index 4b1c3c2baf..05d02a79bf 100644 --- a/src/script/api/script_vehicle.cpp +++ b/src/script/api/script_vehicle.cpp @@ -89,7 +89,7 @@ /* static */ VehicleID ScriptVehicle::BuildVehicle(TileIndex depot, EngineID engine_id) { - return _BuildVehicleInternal(depot, engine_id, CT_INVALID); + return _BuildVehicleInternal(depot, engine_id, INVALID_CARGO); } /* static */ VehicleID ScriptVehicle::BuildVehicleWithRefit(TileIndex depot, EngineID engine_id, CargoID cargo) diff --git a/src/station_gui.cpp b/src/station_gui.cpp index eac09d48bc..ce1f877871 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -1750,7 +1750,7 @@ struct StationViewWindow : public Window { * @param cargo Current cargo being drawn (if cargo column has been passed). * @return row (in "pos" counting) after the one we have last drawn to. */ - int DrawEntries(CargoDataEntry *entry, const Rect &r, int pos, int maxrows, int column, CargoID cargo = CT_INVALID) + int DrawEntries(CargoDataEntry *entry, const Rect &r, int pos, int maxrows, int column, CargoID cargo = INVALID_CARGO) { if (this->sortings[column] == CargoSortType::AsGrouping) { if (this->groupings[column] != GR_CARGO) { diff --git a/src/subsidy_base.h b/src/subsidy_base.h index 5f72a25898..77f8730f4e 100644 --- a/src/subsidy_base.h +++ b/src/subsidy_base.h @@ -20,7 +20,7 @@ extern SubsidyPool _subsidy_pool; /** Struct about subsidies, offered and awarded */ struct Subsidy : SubsidyPool::PoolItem<&_subsidy_pool> { - CargoID cargo_type; ///< Cargo type involved in this subsidy, CT_INVALID for invalid subsidy + CargoID cargo_type; ///< Cargo type involved in this subsidy, INVALID_CARGO for invalid subsidy uint16_t remaining; ///< Remaining months when this subsidy is valid CompanyID awarded; ///< Subsidy is awarded to this company; INVALID_COMPANY if it's not awarded to anyone SourceType src_type; ///< Source of subsidised path (SourceType::Industry or SourceType::Town) diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 7048c0b818..4eda2a351b 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -273,7 +273,7 @@ static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary &su if (!v->GetEngine()->CanCarryCargo()) continue; CargoSummaryItem new_item; - new_item.cargo = v->cargo_cap > 0 ? v->cargo_type : (CargoID)CT_INVALID; + new_item.cargo = v->cargo_cap > 0 ? v->cargo_type : INVALID_CARGO; new_item.subtype = GetCargoSubtypeText(v); if (!IsValidCargoID(new_item.cargo) && new_item.subtype == STR_EMPTY) continue; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index b4b6a53de0..a383de7a44 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1902,7 +1902,7 @@ bool CanBuildVehicleInfrastructure(VehicleType type, byte subtype) */ LiveryScheme GetEngineLiveryScheme(EngineID engine_type, EngineID parent_engine_type, const Vehicle *v) { - CargoID cargo_type = v == nullptr ? (CargoID)CT_INVALID : v->cargo_type; + CargoID cargo_type = v == nullptr ? INVALID_CARGO : v->cargo_type; const Engine *e = Engine::Get(engine_type); switch (e->type) { default: NOT_REACHED(); diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 549bd189c4..67cdd4bcb7 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -874,7 +874,7 @@ std::tuple CmdCloneVehicle(DoCommandFlag flags, TileInde if ((flags & DC_EXEC) && !v->IsPrimaryVehicle()) build_flags |= DC_AUTOREPLACE; CommandCost cost; - std::tie(cost, new_veh_id, std::ignore, std::ignore, std::ignore) = Command::Do(build_flags, tile, v->engine_type, false, CT_INVALID, INVALID_CLIENT_ID); + std::tie(cost, new_veh_id, std::ignore, std::ignore, std::ignore) = Command::Do(build_flags, tile, v->engine_type, false, INVALID_CARGO, INVALID_CLIENT_ID); if (cost.Failed()) { /* Can't build a part, then sell the stuff we already made; clear up the mess */ @@ -953,7 +953,7 @@ std::tuple CmdCloneVehicle(DoCommandFlag flags, TileInde } } else { const Engine *e = v->GetEngine(); - CargoID initial_cargo = (e->CanCarryCargo() ? e->GetDefaultCargoType() : (CargoID)CT_INVALID); + CargoID initial_cargo = (e->CanCarryCargo() ? e->GetDefaultCargoType() : INVALID_CARGO); if (v->cargo_type != initial_cargo && IsValidCargoID(initial_cargo)) { bool dummy; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index a135557cc2..57bf13708d 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -779,7 +779,7 @@ struct RefitWindow : public Window { { size_t scroll_row = 0; size_t rows = 0; - CargoID cargo = this->selected_refit == nullptr ? (CargoID)CT_INVALID : this->selected_refit->cargo; + CargoID cargo = this->selected_refit == nullptr ? INVALID_CARGO : this->selected_refit->cargo; for (const auto &pair : this->refit_list) { if (pair.first == cargo) { diff --git a/src/vehicle_gui_base.h b/src/vehicle_gui_base.h index 9f9981caf2..21e7b74cb4 100644 --- a/src/vehicle_gui_base.h +++ b/src/vehicle_gui_base.h @@ -75,7 +75,7 @@ struct BaseVehicleListWindow : public Window { /** Special cargo filter criteria */ enum CargoFilterSpecialType { - CF_NONE = CT_INVALID, ///< Show only vehicles which do not carry cargo (e.g. train engines) + CF_NONE = INVALID_CARGO, ///< Show only vehicles which do not carry cargo (e.g. train engines) CF_ANY = CT_NO_REFIT, ///< Show all vehicles independent of carried cargo (i.e. no filtering) CF_FREIGHT = CT_AUTO_REFIT, ///< Show only vehicles which carry any freight (non-passenger) cargo }; From 400ae65ff2ba83a0834ee211f177933a8ecb7a3d Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 6 Jan 2024 15:29:48 +0000 Subject: [PATCH 3/9] Codechange: Redefine some cargo-related values in terms of CargoID instead of CargoType. Values used as special filter types are now defined as offsets from NUM_CARGO instead of confusingly reusing CARGO_NO_REFIT/CARGO_AUTO_REFIT types. --- src/autoreplace_cmd.cpp | 14 +++++----- src/build_vehicle_gui.cpp | 36 ++++++++++++-------------- src/cargo_type.h | 23 +++++++++++++---- src/economy.cpp | 4 +-- src/industry_gui.cpp | 46 ++++++++++++++------------------- src/order_base.h | 8 +++--- src/order_cmd.cpp | 18 ++++++------- src/order_gui.cpp | 4 +-- src/saveload/afterload.cpp | 4 +-- src/script/api/script_cargo.hpp | 4 +-- src/script/api/script_order.cpp | 10 +++---- src/vehicle_gui.cpp | 24 ++++++++--------- src/vehicle_gui_base.h | 7 ----- 13 files changed, 99 insertions(+), 103 deletions(-) diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 1bd89e3f1a..c67f3b4092 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -226,7 +226,7 @@ static int GetIncompatibleRefitOrderIdForAutoreplace(const Vehicle *v, EngineID * @param engine_type The EngineID of the vehicle that is being replaced to * @param part_of_chain The vehicle is part of a train * @return The cargo type to replace to - * CT_NO_REFIT is returned if no refit is needed + * CARGO_NO_REFIT is returned if no refit is needed * INVALID_CARGO is returned when both old and new vehicle got cargo capacity and refitting the new one to the old one's cargo type isn't possible */ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type, bool part_of_chain) @@ -234,23 +234,23 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type, bool CargoTypes available_cargo_types, union_mask; GetArticulatedRefitMasks(engine_type, true, &union_mask, &available_cargo_types); - if (union_mask == 0) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity + if (union_mask == 0) return CARGO_NO_REFIT; // Don't try to refit an engine with no cargo capacity CargoID cargo_type; CargoTypes cargo_mask = GetCargoTypesOfArticulatedVehicle(v, &cargo_type); if (!HasAtMostOneBit(cargo_mask)) { CargoTypes new_engine_default_cargoes = GetCargoTypesOfArticulatedParts(engine_type); if ((cargo_mask & new_engine_default_cargoes) == cargo_mask) { - return CT_NO_REFIT; // engine_type is already a mixed cargo type which matches the incoming vehicle by default, no refit required + return CARGO_NO_REFIT; // engine_type is already a mixed cargo type which matches the incoming vehicle by default, no refit required } return INVALID_CARGO; // We cannot refit to mixed cargoes in an automated way } if (!IsValidCargoID(cargo_type)) { - if (v->type != VEH_TRAIN) return CT_NO_REFIT; // If the vehicle does not carry anything at all, every replacement is fine. + if (v->type != VEH_TRAIN) return CARGO_NO_REFIT; // If the vehicle does not carry anything at all, every replacement is fine. - if (!part_of_chain) return CT_NO_REFIT; + if (!part_of_chain) return CARGO_NO_REFIT; /* the old engine didn't have cargo capacity, but the new one does * now we will figure out what cargo the train is carrying and refit to fit this */ @@ -261,7 +261,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type, bool if (HasBit(available_cargo_types, v->cargo_type)) return v->cargo_type; } - return CT_NO_REFIT; // We failed to find a cargo type on the old vehicle and we will not refit the new one + return CARGO_NO_REFIT; // We failed to find a cargo type on the old vehicle and we will not refit the new one } else { if (!HasBit(available_cargo_types, cargo_type)) return INVALID_CARGO; // We can't refit the vehicle to carry the cargo we want @@ -359,7 +359,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic *new_vehicle = new_veh; /* Refit the vehicle if needed */ - if (refit_cargo != CT_NO_REFIT) { + if (refit_cargo != CARGO_NO_REFIT) { byte subtype = GetBestFittingSubType(old_veh, new_veh, refit_cargo); cost.AddCost(std::get<0>(Command::Do(DC_EXEC, new_veh->index, refit_cargo, subtype, false, false, 0))); diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 8fdde0c771..aacd9f1c05 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -93,16 +93,12 @@ static const NWidgetPart _nested_build_vehicle_widgets[] = { EndContainer(), }; -/** Special cargo filter criteria */ -static const CargoID CF_ANY = CT_NO_REFIT; ///< Show all vehicles independent of carried cargo (i.e. no filtering) -static const CargoID CF_NONE = INVALID_CARGO; ///< Show only vehicles which do not carry cargo (e.g. train engines) -static const CargoID CF_ENGINES = CT_AUTO_REFIT; ///< Show only engines (for rail vehicles only) bool _engine_sort_direction; ///< \c false = descending, \c true = ascending. byte _engine_sort_last_criteria[] = {0, 0, 0, 0}; ///< Last set sort criteria, for each vehicle type. bool _engine_sort_last_order[] = {false, false, false, false}; ///< Last set direction of the sort order, for each vehicle type. bool _engine_sort_show_hidden_engines[] = {false, false, false, false}; ///< Last set 'show hidden engines' setting for each vehicle type. -static CargoID _engine_sort_last_cargo_criteria[] = {CF_ANY, CF_ANY, CF_ANY, CF_ANY}; ///< Last set filter criteria, for each vehicle type. +static CargoID _engine_sort_last_cargo_criteria[] = {CargoFilterCriteria::CF_ANY, CargoFilterCriteria::CF_ANY, CargoFilterCriteria::CF_ANY, CargoFilterCriteria::CF_ANY}; ///< Last set filter criteria, for each vehicle type. /** * Determines order of engines by engineID @@ -543,13 +539,13 @@ const StringID _engine_sort_listing[][12] = {{ /** Filters vehicles by cargo and engine (in case of rail vehicle). */ static bool CDECL CargoAndEngineFilter(const GUIEngineListItem *item, const CargoID cid) { - if (cid == CF_ANY) { + if (cid == CargoFilterCriteria::CF_ANY) { return true; - } else if (cid == CF_ENGINES) { + } else if (cid == CargoFilterCriteria::CF_ENGINES) { return Engine::Get(item->engine_id)->GetPower() != 0; } else { CargoTypes refit_mask = GetUnionOfArticulatedRefitMasks(item->engine_id, true) & _standard_cargo_mask; - return (cid == CF_NONE ? refit_mask == 0 : HasBit(refit_mask, cid)); + return (cid == CargoFilterCriteria::CF_NONE ? refit_mask == 0 : HasBit(refit_mask, cid)); } } @@ -1146,7 +1142,7 @@ struct BuildVehicleWindow : Window { { NWidgetCore *widget = this->GetWidget(WID_BV_BUILD); - bool refit = this->sel_engine != INVALID_ENGINE && this->cargo_filter_criteria != CF_ANY && this->cargo_filter_criteria != CF_NONE; + bool refit = this->sel_engine != INVALID_ENGINE && this->cargo_filter_criteria != CargoFilterCriteria::CF_ANY && this->cargo_filter_criteria != CargoFilterCriteria::CF_NONE; if (refit) refit = Engine::Get(this->sel_engine)->GetDefaultCargoType() != this->cargo_filter_criteria; if (refit) { @@ -1272,9 +1268,9 @@ struct BuildVehicleWindow : Window { StringID GetCargoFilterLabel(CargoID cid) const { switch (cid) { - case CF_ANY: return STR_PURCHASE_INFO_ALL_TYPES; - case CF_ENGINES: return STR_PURCHASE_INFO_ENGINES_ONLY; - case CF_NONE: return STR_PURCHASE_INFO_NONE; + case CargoFilterCriteria::CF_ANY: return STR_PURCHASE_INFO_ALL_TYPES; + case CargoFilterCriteria::CF_ENGINES: return STR_PURCHASE_INFO_ENGINES_ONLY; + case CargoFilterCriteria::CF_NONE: return STR_PURCHASE_INFO_NONE; default: return CargoSpec::Get(cid)->name; } } @@ -1284,16 +1280,16 @@ struct BuildVehicleWindow : Window { { /* Set the last cargo filter criteria. */ this->cargo_filter_criteria = _engine_sort_last_cargo_criteria[this->vehicle_type]; - if (this->cargo_filter_criteria < NUM_CARGO && !HasBit(_standard_cargo_mask, this->cargo_filter_criteria)) this->cargo_filter_criteria = CF_ANY; + if (this->cargo_filter_criteria < NUM_CARGO && !HasBit(_standard_cargo_mask, this->cargo_filter_criteria)) this->cargo_filter_criteria = CargoFilterCriteria::CF_ANY; this->eng_list.SetFilterFuncs(_filter_funcs); - this->eng_list.SetFilterState(this->cargo_filter_criteria != CF_ANY); + this->eng_list.SetFilterState(this->cargo_filter_criteria != CargoFilterCriteria::CF_ANY); } void SelectEngine(EngineID engine) { CargoID cargo = this->cargo_filter_criteria; - if (cargo == CF_ANY || cargo == CF_ENGINES || cargo == CF_NONE) cargo = INVALID_CARGO; + if (cargo == CargoFilterCriteria::CF_ANY || cargo == CargoFilterCriteria::CF_ENGINES || cargo == CargoFilterCriteria::CF_NONE) cargo = INVALID_CARGO; this->sel_engine = engine; this->SetBuyVehicleText(); @@ -1567,14 +1563,14 @@ struct BuildVehicleWindow : Window { DropDownList list; /* Add item for disabling filtering. */ - list.push_back(std::make_unique(this->GetCargoFilterLabel(CF_ANY), CF_ANY, false)); + list.push_back(std::make_unique(this->GetCargoFilterLabel(CargoFilterCriteria::CF_ANY), CargoFilterCriteria::CF_ANY, false)); /* Specific filters for trains. */ if (this->vehicle_type == VEH_TRAIN) { /* Add item for locomotives only in case of trains. */ - list.push_back(std::make_unique(this->GetCargoFilterLabel(CF_ENGINES), CF_ENGINES, false)); + list.push_back(std::make_unique(this->GetCargoFilterLabel(CargoFilterCriteria::CF_ENGINES), CargoFilterCriteria::CF_ENGINES, false)); /* Add item for vehicles not carrying anything, e.g. train engines. * This could also be useful for eyecandy vehicles of other types, but is likely too confusing for joe, */ - list.push_back(std::make_unique(this->GetCargoFilterLabel(CF_NONE), CF_NONE, false)); + list.push_back(std::make_unique(this->GetCargoFilterLabel(CargoFilterCriteria::CF_NONE), CargoFilterCriteria::CF_NONE, false)); } /* Add cargos */ @@ -1652,7 +1648,7 @@ struct BuildVehicleWindow : Window { EngineID sel_eng = this->sel_engine; if (sel_eng != INVALID_ENGINE) { CargoID cargo = this->cargo_filter_criteria; - if (cargo == CF_ANY || cargo == CF_ENGINES || cargo == CF_NONE) cargo = INVALID_CARGO; + if (cargo == CargoFilterCriteria::CF_ANY || cargo == CargoFilterCriteria::CF_ENGINES || cargo == CargoFilterCriteria::CF_NONE) cargo = INVALID_CARGO; if (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) { Command::Post(GetCmdBuildVehMsg(this->vehicle_type), CcBuildWagon, this->window_number, sel_eng, true, cargo, INVALID_CLIENT_ID); } else { @@ -1857,7 +1853,7 @@ struct BuildVehicleWindow : Window { this->cargo_filter_criteria = index; _engine_sort_last_cargo_criteria[this->vehicle_type] = this->cargo_filter_criteria; /* deactivate filter if criteria is 'Show All', activate it otherwise */ - this->eng_list.SetFilterState(this->cargo_filter_criteria != CF_ANY); + this->eng_list.SetFilterState(this->cargo_filter_criteria != CargoFilterCriteria::CF_ANY); this->eng_list.ForceRebuild(); this->SelectEngine(this->sel_engine); } diff --git a/src/cargo_type.h b/src/cargo_type.h index 78d0a05d56..871f958790 100644 --- a/src/cargo_type.h +++ b/src/cargo_type.h @@ -61,16 +61,29 @@ enum CargoType { CT_PLASTIC = 10, CT_FIZZY_DRINKS = 11, - NUM_ORIGINAL_CARGO = 12, - NUM_CARGO = 64, ///< Maximal number of cargo types in a game. - - CT_AUTO_REFIT = 0xFD, ///< Automatically choose cargo type when doing auto refitting. - CT_NO_REFIT = 0xFE, ///< Do not refit cargo of a vehicle (used in vehicle orders and auto-replace/auto-new). CT_INVALID = 0xFF, ///< Invalid cargo type. }; +static const CargoID NUM_ORIGINAL_CARGO = 12; ///< Original number of cargo types. +static const CargoID NUM_CARGO = 64; ///< Maximum number of cargo types in a game. + +/* CARGO_AUTO_REFIT and CARGO_NO_REFIT are stored in save-games for refit-orders, so should not be changed. */ +static const CargoID CARGO_AUTO_REFIT = 0xFD; ///< Automatically choose cargo type when doing auto refitting. +static const CargoID CARGO_NO_REFIT = 0xFE; ///< Do not refit cargo of a vehicle (used in vehicle orders and auto-replace/auto-renew). + static const CargoID INVALID_CARGO = UINT8_MAX; +/** + * Special cargo filter criteria. + * These are used by user interface code only and must not be assigned to any entity. Not all values are valid for every UI filter. + */ +namespace CargoFilterCriteria { + static constexpr CargoID CF_ANY = NUM_CARGO; ///< Show all items independent of carried cargo (i.e. no filtering) + static constexpr CargoID CF_NONE = NUM_CARGO + 1; ///< Show only items which do not carry cargo (e.g. train engines) + static constexpr CargoID CF_ENGINES = NUM_CARGO + 2; ///< Show only engines (for rail vehicles only) + static constexpr CargoID CF_FREIGHT = NUM_CARGO + 3; ///< Show only vehicles which carry any freight (non-passenger) cargo +}; + /** Test whether cargo type is not CT_INVALID */ inline bool IsValidCargoType(CargoType t) { return t != CT_INVALID; } /** Test whether cargo type is not INVALID_CARGO */ diff --git a/src/economy.cpp b/src/economy.cpp index 75c7905d24..8d15c7504a 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1500,7 +1500,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station /* Remove old capacity from consist capacity and collect refit mask. */ IterateVehicleParts(v_start, PrepareRefitAction(consist_capleft, refit_mask)); - bool is_auto_refit = new_cid == CT_AUTO_REFIT; + bool is_auto_refit = new_cid == CARGO_AUTO_REFIT; if (is_auto_refit) { /* Get a refittable cargo type with waiting cargo for next_station or INVALID_STATION. */ new_cid = v_start->cargo_type; @@ -1636,7 +1636,7 @@ static void LoadUnloadVehicle(Vehicle *front) Station *st = Station::Get(last_visited); StationIDStack next_station = front->GetNextStoppingStation(); - bool use_autorefit = front->current_order.IsRefit() && front->current_order.GetRefitCargo() == CT_AUTO_REFIT; + bool use_autorefit = front->current_order.IsRefit() && front->current_order.GetRefitCargo() == CARGO_AUTO_REFIT; CargoArray consist_capleft{}; if (_settings_game.order.improved_load && use_autorefit ? front->cargo_payment == nullptr : (front->current_order.GetLoadType() & OLFB_FULL_LOAD) != 0) { diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index a0f899c799..0c887ebf73 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1245,12 +1245,6 @@ static const NWidgetPart _nested_industry_directory_widgets[] = { typedef GUIList &> GUIIndustryList; -/** Special cargo filter criteria */ -enum CargoFilterSpecialType { - CF_ANY = CT_NO_REFIT, ///< Show all industries (i.e. no filtering) - CF_NONE = INVALID_CARGO, ///< Show only industries which do not produce/accept cargo -}; - /** Cargo filter functions */ /** * Check whether an industry accepts and produces a certain cargo pair. @@ -1266,11 +1260,11 @@ static bool CDECL CargoFilter(const Industry * const *industry, const std::pair< bool accepted_cargo_matches; switch (accepted_cargo) { - case CF_ANY: + case CargoFilterCriteria::CF_ANY: accepted_cargo_matches = true; break; - case CF_NONE: + case CargoFilterCriteria::CF_NONE: accepted_cargo_matches = !(*industry)->IsCargoAccepted(); break; @@ -1282,11 +1276,11 @@ static bool CDECL CargoFilter(const Industry * const *industry, const std::pair< bool produced_cargo_matches; switch (produced_cargo) { - case CF_ANY: + case CargoFilterCriteria::CF_ANY: produced_cargo_matches = true; break; - case CF_NONE: + case CargoFilterCriteria::CF_NONE: produced_cargo_matches = !(*industry)->IsCargoProduced(); break; @@ -1344,7 +1338,7 @@ protected: if (this->produced_cargo_filter_criteria != cid) { this->produced_cargo_filter_criteria = cid; /* deactivate filter if criteria is 'Show All', activate it otherwise */ - bool is_filtering_necessary = this->produced_cargo_filter_criteria != CF_ANY || this->accepted_cargo_filter_criteria != CF_ANY; + bool is_filtering_necessary = this->produced_cargo_filter_criteria != CargoFilterCriteria::CF_ANY || this->accepted_cargo_filter_criteria != CargoFilterCriteria::CF_ANY; this->industries.SetFilterState(is_filtering_necessary); this->industries.SetFilterType(0); @@ -1361,7 +1355,7 @@ protected: if (this->accepted_cargo_filter_criteria != cid) { this->accepted_cargo_filter_criteria = cid; /* deactivate filter if criteria is 'Show All', activate it otherwise */ - bool is_filtering_necessary = this->produced_cargo_filter_criteria != CF_ANY || this->accepted_cargo_filter_criteria != CF_ANY; + bool is_filtering_necessary = this->produced_cargo_filter_criteria != CargoFilterCriteria::CF_ANY || this->accepted_cargo_filter_criteria != CargoFilterCriteria::CF_ANY; this->industries.SetFilterState(is_filtering_necessary); this->industries.SetFilterType(0); @@ -1372,8 +1366,8 @@ protected: StringID GetCargoFilterLabel(CargoID cid) const { switch (cid) { - case CF_ANY: return STR_INDUSTRY_DIRECTORY_FILTER_ALL_TYPES; - case CF_NONE: return STR_INDUSTRY_DIRECTORY_FILTER_NONE; + case CargoFilterCriteria::CF_ANY: return STR_INDUSTRY_DIRECTORY_FILTER_ALL_TYPES; + case CargoFilterCriteria::CF_NONE: return STR_INDUSTRY_DIRECTORY_FILTER_NONE; default: return CargoSpec::Get(cid)->name; } } @@ -1383,12 +1377,12 @@ protected: */ void SetCargoFilterArray() { - this->produced_cargo_filter_criteria = CF_ANY; - this->accepted_cargo_filter_criteria = CF_ANY; + this->produced_cargo_filter_criteria = CargoFilterCriteria::CF_ANY; + this->accepted_cargo_filter_criteria = CargoFilterCriteria::CF_ANY; this->industries.SetFilterFuncs(_filter_funcs); - bool is_filtering_necessary = this->produced_cargo_filter_criteria != CF_ANY || this->accepted_cargo_filter_criteria != CF_ANY; + bool is_filtering_necessary = this->produced_cargo_filter_criteria != CargoFilterCriteria::CF_ANY || this->accepted_cargo_filter_criteria != CargoFilterCriteria::CF_ANY; this->industries.SetFilterState(is_filtering_necessary); } @@ -1462,11 +1456,11 @@ protected: static int GetCargoTransportedSortValue(const Industry *i) { CargoID filter = IndustryDirectoryWindow::produced_cargo_filter; - if (filter == CF_NONE) return 0; + if (filter == CargoFilterCriteria::CF_NONE) return 0; int percentage = 0, produced_cargo_count = 0; for (const auto &p : i->produced) { - if (filter == CF_ANY) { + if (filter == CargoFilterCriteria::CF_ANY) { int transported = GetCargoTransportedPercentsIfValid(p); if (transported != -1) { produced_cargo_count++; @@ -1506,10 +1500,10 @@ protected: /** Sort industries by production and name */ static bool IndustryProductionSorter(const Industry * const &a, const Industry * const &b, const CargoID &filter) { - if (filter == CF_NONE) return IndustryTypeSorter(a, b, filter); + if (filter == CargoFilterCriteria::CF_NONE) return IndustryTypeSorter(a, b, filter); uint prod_a = 0, prod_b = 0; - if (filter == CF_ANY) { + if (filter == CargoFilterCriteria::CF_ANY) { for (const auto &pa : a->produced) { if (IsValidCargoID(pa.cargo)) prod_a += pa.history[LAST_MONTH].production; } @@ -1585,7 +1579,7 @@ protected: /* If the produced cargo filter is active then move the filtered cargo to the beginning of the list, * because this is the one the player interested in, and that way it is not hidden in the 'n' more cargos */ const CargoID cid = this->produced_cargo_filter_criteria; - if (cid != CF_ANY && cid != CF_NONE) { + if (cid != CargoFilterCriteria::CF_ANY && cid != CargoFilterCriteria::CF_NONE) { auto filtered_ci = std::find_if(cargos.begin(), cargos.end(), [cid](const CargoInfo &ci) -> bool { return ci.cargo_id == cid; }); @@ -1693,7 +1687,7 @@ public: const CargoID acf_cid = this->accepted_cargo_filter_criteria; for (uint i = this->vscroll->GetPosition(); i < this->industries.size(); i++) { TextColour tc = TC_FROMSTRING; - if (acf_cid != CF_ANY && acf_cid != CF_NONE) { + if (acf_cid != CargoFilterCriteria::CF_ANY && acf_cid != CargoFilterCriteria::CF_NONE) { Industry *ind = const_cast(this->industries[i]); if (IndustryTemporarilyRefusesCargo(ind, acf_cid)) { tc = TC_GREY | TC_FORCED; @@ -1748,9 +1742,9 @@ public: DropDownList list; /* Add item for disabling filtering. */ - list.push_back(std::make_unique(this->GetCargoFilterLabel(CF_ANY), CF_ANY, false)); + list.push_back(std::make_unique(this->GetCargoFilterLabel(CargoFilterCriteria::CF_ANY), CargoFilterCriteria::CF_ANY, false)); /* Add item for industries not producing anything, e.g. power plants */ - list.push_back(std::make_unique(this->GetCargoFilterLabel(CF_NONE), CF_NONE, false)); + list.push_back(std::make_unique(this->GetCargoFilterLabel(CargoFilterCriteria::CF_NONE), CargoFilterCriteria::CF_NONE, false)); /* Add cargos */ Dimension d = GetLargestCargoIconSize(); @@ -1906,7 +1900,7 @@ const StringID IndustryDirectoryWindow::sorter_names[] = { INVALID_STRING_ID }; -CargoID IndustryDirectoryWindow::produced_cargo_filter = CF_ANY; +CargoID IndustryDirectoryWindow::produced_cargo_filter = CargoFilterCriteria::CF_ANY; /** Window definition of the industry directory gui */ diff --git a/src/order_base.h b/src/order_base.h index 577dbe4c47..4e8e8bd818 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -58,7 +58,7 @@ private: public: Order *next; ///< Pointer to next order. If nullptr, end of list - Order() : flags(0), refit_cargo(CT_NO_REFIT), wait_time(0), travel_time(0), max_speed(UINT16_MAX) {} + Order() : flags(0), refit_cargo(CARGO_NO_REFIT), wait_time(0), travel_time(0), max_speed(UINT16_MAX) {} ~Order(); Order(uint32_t packed); @@ -79,7 +79,7 @@ public: void Free(); void MakeGoToStation(StationID destination); - void MakeGoToDepot(DepotID destination, OrderDepotTypeFlags order, OrderNonStopFlags non_stop_type = ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS, OrderDepotActionFlags action = ODATF_SERVICE_ONLY, CargoID cargo = CT_NO_REFIT); + void MakeGoToDepot(DepotID destination, OrderDepotTypeFlags order, OrderNonStopFlags non_stop_type = ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS, OrderDepotActionFlags action = ODATF_SERVICE_ONLY, CargoID cargo = CARGO_NO_REFIT); void MakeGoToWaypoint(StationID destination); void MakeLoading(bool ordered); void MakeLeaveStation(); @@ -115,14 +115,14 @@ public: * @pre IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION) * @return true if a refit should happen. */ - inline bool IsRefit() const { return this->refit_cargo < NUM_CARGO || this->refit_cargo == CT_AUTO_REFIT; } + inline bool IsRefit() const { return this->refit_cargo < NUM_CARGO || this->refit_cargo == CARGO_AUTO_REFIT; } /** * Is this order a auto-refit order. * @pre IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION) * @return true if a auto-refit should happen. */ - inline bool IsAutoRefit() const { return this->refit_cargo == CT_AUTO_REFIT; } + inline bool IsAutoRefit() const { return this->refit_cargo == CARGO_AUTO_REFIT; } /** * Get the cargo to to refit to. diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index b64275314f..f6ad069995 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -237,7 +237,7 @@ Order::Order(uint32_t packed) this->flags = GB(packed, 8, 8); this->dest = GB(packed, 16, 16); this->next = nullptr; - this->refit_cargo = CT_NO_REFIT; + this->refit_cargo = CARGO_NO_REFIT; this->wait_time = 0; this->travel_time = 0; this->max_speed = UINT16_MAX; @@ -719,7 +719,7 @@ CommandCost CmdInsertOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID se if (ret.Failed()) return ret; /* Validate properties we don't want to have different from default as they are set by other commands. */ - if (new_order.GetRefitCargo() != CT_NO_REFIT || new_order.GetWaitTime() != 0 || new_order.GetTravelTime() != 0 || new_order.GetMaxSpeed() != UINT16_MAX) return CMD_ERROR; + if (new_order.GetRefitCargo() != CARGO_NO_REFIT || new_order.GetWaitTime() != 0 || new_order.GetTravelTime() != 0 || new_order.GetMaxSpeed() != UINT16_MAX) return CMD_ERROR; /* Check if the inserted order is to the correct destination (owner, type), * and has the correct flags if any */ @@ -1326,7 +1326,7 @@ CommandCost CmdModifyOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID se case MOF_NON_STOP: order->SetNonStopType((OrderNonStopFlags)data); if (data & ONSF_NO_STOP_AT_DESTINATION_STATION) { - order->SetRefit(CT_NO_REFIT); + order->SetRefit(CARGO_NO_REFIT); order->SetLoadType(OLF_LOAD_IF_POSSIBLE); order->SetUnloadType(OUF_UNLOAD_IF_POSSIBLE); } @@ -1342,7 +1342,7 @@ CommandCost CmdModifyOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID se case MOF_LOAD: order->SetLoadType((OrderLoadFlags)data); - if (data & OLFB_NO_LOAD) order->SetRefit(CT_NO_REFIT); + if (data & OLFB_NO_LOAD) order->SetRefit(CARGO_NO_REFIT); break; case MOF_DEPOT_ACTION: { @@ -1355,13 +1355,13 @@ CommandCost CmdModifyOrder(DoCommandFlag flags, VehicleID veh, VehicleOrderID se case DA_SERVICE: order->SetDepotOrderType((OrderDepotTypeFlags)(order->GetDepotOrderType() | ODTFB_SERVICE)); order->SetDepotActionType((OrderDepotActionFlags)(order->GetDepotActionType() & ~ODATFB_HALT)); - order->SetRefit(CT_NO_REFIT); + order->SetRefit(CARGO_NO_REFIT); break; case DA_STOP: order->SetDepotOrderType((OrderDepotTypeFlags)(order->GetDepotOrderType() & ~ODTFB_SERVICE)); order->SetDepotActionType((OrderDepotActionFlags)(order->GetDepotActionType() | ODATFB_HALT)); - order->SetRefit(CT_NO_REFIT); + order->SetRefit(CARGO_NO_REFIT); break; default: @@ -1618,7 +1618,7 @@ CommandCost CmdCloneOrder(DoCommandFlag flags, CloneOptions action, VehicleID ve */ CommandCost CmdOrderRefit(DoCommandFlag flags, VehicleID veh, VehicleOrderID order_number, CargoID cargo) { - if (cargo >= NUM_CARGO && cargo != CT_NO_REFIT && cargo != CT_AUTO_REFIT) return CMD_ERROR; + if (cargo >= NUM_CARGO && cargo != CARGO_NO_REFIT && cargo != CARGO_AUTO_REFIT) return CMD_ERROR; const Vehicle *v = Vehicle::GetIfValid(veh); if (v == nullptr || !v->IsPrimaryVehicle()) return CMD_ERROR; @@ -1630,7 +1630,7 @@ CommandCost CmdOrderRefit(DoCommandFlag flags, VehicleID veh, VehicleOrderID ord if (order == nullptr) return CMD_ERROR; /* Automatic refit cargo is only supported for goto station orders. */ - if (cargo == CT_AUTO_REFIT && !order->IsType(OT_GOTO_STATION)) return CMD_ERROR; + if (cargo == CARGO_AUTO_REFIT && !order->IsType(OT_GOTO_STATION)) return CMD_ERROR; if (order->GetLoadType() & OLFB_NO_LOAD) return CMD_ERROR; @@ -1638,7 +1638,7 @@ CommandCost CmdOrderRefit(DoCommandFlag flags, VehicleID veh, VehicleOrderID ord order->SetRefit(cargo); /* Make the depot order an 'always go' order. */ - if (cargo != CT_NO_REFIT && order->IsType(OT_GOTO_DEPOT)) { + if (cargo != CARGO_NO_REFIT && order->IsType(OT_GOTO_DEPOT)) { order->SetDepotOrderType((OrderDepotTypeFlags)(order->GetDepotOrderType() & ~ODTFB_SERVICE)); order->SetDepotActionType((OrderDepotActionFlags)(order->GetDepotActionType() & ~ODATFB_HALT)); } diff --git a/src/order_gui.cpp b/src/order_gui.cpp index dc0ddb1ff0..ac481afd2d 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -749,10 +749,10 @@ private: { if (_ctrl_pressed) { /* Cancel refitting */ - Command::Post(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), CT_NO_REFIT); + Command::Post(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), CARGO_NO_REFIT); } else { if (i == 1) { // Auto-refit to available cargo type. - Command::Post(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), CT_AUTO_REFIT); + Command::Post(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), CARGO_AUTO_REFIT); } else { ShowVehicleRefitWindow(this->vehicle, this->OrderGetSel(), this, auto_refit); } diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 06a4f440c5..22a0ca811b 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -1462,11 +1462,11 @@ bool AfterLoadGame() /* Setting no refit flags to all orders in savegames from before refit in orders were added */ if (IsSavegameVersionBefore(SLV_36)) { for (Order *order : Order::Iterate()) { - order->SetRefit(CT_NO_REFIT); + order->SetRefit(CARGO_NO_REFIT); } for (Vehicle *v : Vehicle::Iterate()) { - v->current_order.SetRefit(CT_NO_REFIT); + v->current_order.SetRefit(CARGO_NO_REFIT); } } diff --git a/src/script/api/script_cargo.hpp b/src/script/api/script_cargo.hpp index 5ac669ed03..40977df165 100644 --- a/src/script/api/script_cargo.hpp +++ b/src/script/api/script_cargo.hpp @@ -55,8 +55,8 @@ public: */ enum SpecialCargoID { /* Note: these values represent part of the in-game CargoTypes enum */ - CT_AUTO_REFIT = ::CT_AUTO_REFIT, ///< Automatically choose cargo type when doing auto-refitting. - CT_NO_REFIT = ::CT_NO_REFIT, ///< Do not refit cargo of a vehicle. + CT_AUTO_REFIT = ::CARGO_AUTO_REFIT, ///< Automatically choose cargo type when doing auto-refitting. + CT_NO_REFIT = ::CARGO_NO_REFIT, ///< Do not refit cargo of a vehicle. CT_INVALID = ::INVALID_CARGO, ///< An invalid cargo type. }; diff --git a/src/script/api/script_order.cpp b/src/script/api/script_order.cpp index 307b4b851a..554e3ecfab 100644 --- a/src/script/api/script_order.cpp +++ b/src/script/api/script_order.cpp @@ -372,11 +372,11 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr /* static */ CargoID ScriptOrder::GetOrderRefit(VehicleID vehicle_id, OrderPosition order_position) { - if (!IsValidVehicleOrder(vehicle_id, order_position)) return CT_NO_REFIT; - if (order_position != ORDER_CURRENT && !IsGotoStationOrder(vehicle_id, order_position) && !IsGotoDepotOrder(vehicle_id, order_position)) return CT_NO_REFIT; + if (!IsValidVehicleOrder(vehicle_id, order_position)) return CARGO_NO_REFIT; + if (order_position != ORDER_CURRENT && !IsGotoStationOrder(vehicle_id, order_position) && !IsGotoDepotOrder(vehicle_id, order_position)) return CARGO_NO_REFIT; const Order *order = ::ResolveOrder(vehicle_id, order_position); - return order->IsRefit() ? order->GetRefitCargo() : (CargoID)CT_NO_REFIT; + return order->IsRefit() ? order->GetRefitCargo() : CARGO_NO_REFIT; } /* static */ bool ScriptOrder::SetOrderJumpTo(VehicleID vehicle_id, OrderPosition order_position, OrderPosition jump_to) @@ -441,8 +441,8 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr { EnforceCompanyModeValid(false); EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position)); - EnforcePrecondition(false, IsGotoStationOrder(vehicle_id, order_position) || (IsGotoDepotOrder(vehicle_id, order_position) && refit_cargo != CT_AUTO_REFIT)); - EnforcePrecondition(false, ScriptCargo::IsValidCargo(refit_cargo) || refit_cargo == CT_AUTO_REFIT || refit_cargo == CT_NO_REFIT); + EnforcePrecondition(false, IsGotoStationOrder(vehicle_id, order_position) || (IsGotoDepotOrder(vehicle_id, order_position) && refit_cargo != CARGO_AUTO_REFIT)); + EnforcePrecondition(false, ScriptCargo::IsValidCargo(refit_cargo) || refit_cargo == CARGO_AUTO_REFIT || refit_cargo == CARGO_NO_REFIT); return ScriptObject::Command::Do(0, vehicle_id, ScriptOrderPositionToRealOrderPosition(vehicle_id, ScriptOrder::ResolveOrderPosition(vehicle_id, order_position)), refit_cargo); } diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 57bf13708d..f8711f474f 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -245,16 +245,16 @@ void BaseVehicleListWindow::BuildVehicleList() */ static bool CargoFilterSingle(const Vehicle *v, const CargoID cid) { - if (cid == BaseVehicleListWindow::CF_ANY) { + if (cid == CargoFilterCriteria::CF_ANY) { return true; - } else if (cid == BaseVehicleListWindow::CF_NONE) { + } else if (cid == CargoFilterCriteria::CF_NONE) { for (const Vehicle *w = v; w != nullptr; w = w->Next()) { if (w->cargo_cap > 0) { return false; } } return true; - } else if (cid == BaseVehicleListWindow::CF_FREIGHT) { + } else if (cid == CargoFilterCriteria::CF_FREIGHT) { bool have_capacity = false; for (const Vehicle *w = v; w != nullptr; w = w->Next()) { if (w->cargo_cap > 0) { @@ -308,7 +308,7 @@ void BaseVehicleListWindow::SetCargoFilter(CargoID cid) if (this->cargo_filter_criteria != cid) { this->cargo_filter_criteria = cid; /* Deactivate filter if criteria is 'Show All', activate it otherwise. */ - this->vehgroups.SetFilterState(this->cargo_filter_criteria != CF_ANY); + this->vehgroups.SetFilterState(this->cargo_filter_criteria != CargoFilterCriteria::CF_ANY); this->vehgroups.SetFilterType(0); this->vehgroups.ForceRebuild(); } @@ -319,9 +319,9 @@ void BaseVehicleListWindow::SetCargoFilter(CargoID cid) */ void BaseVehicleListWindow::SetCargoFilterArray() { - this->cargo_filter_criteria = CF_ANY; + this->cargo_filter_criteria = CargoFilterCriteria::CF_ANY; this->vehgroups.SetFilterFuncs(_filter_funcs); - this->vehgroups.SetFilterState(this->cargo_filter_criteria != CF_ANY); + this->vehgroups.SetFilterState(this->cargo_filter_criteria != CargoFilterCriteria::CF_ANY); } /** @@ -372,9 +372,9 @@ void BaseVehicleListWindow::OnInit() StringID BaseVehicleListWindow::GetCargoFilterLabel(CargoID cid) const { switch (cid) { - case CF_ANY: return STR_CARGO_TYPE_FILTER_ALL; - case CF_FREIGHT: return STR_CARGO_TYPE_FILTER_FREIGHT; - case CF_NONE: return STR_CARGO_TYPE_FILTER_NONE; + case CargoFilterCriteria::CF_ANY: return STR_CARGO_TYPE_FILTER_ALL; + case CargoFilterCriteria::CF_FREIGHT: return STR_CARGO_TYPE_FILTER_FREIGHT; + case CargoFilterCriteria::CF_NONE: return STR_CARGO_TYPE_FILTER_NONE; default: return CargoSpec::Get(cid)->name; } } @@ -389,11 +389,11 @@ DropDownList BaseVehicleListWindow::BuildCargoDropDownList(bool full) const DropDownList list; /* Add item for disabling filtering. */ - list.push_back(std::make_unique(this->GetCargoFilterLabel(CF_ANY), CF_ANY, false)); + list.push_back(std::make_unique(this->GetCargoFilterLabel(CargoFilterCriteria::CF_ANY), CargoFilterCriteria::CF_ANY, false)); /* Add item for freight (i.e. vehicles with cargo capacity and with no passenger capacity). */ - list.push_back(std::make_unique(this->GetCargoFilterLabel(CF_FREIGHT), CF_FREIGHT, false)); + list.push_back(std::make_unique(this->GetCargoFilterLabel(CargoFilterCriteria::CF_FREIGHT), CargoFilterCriteria::CF_FREIGHT, false)); /* Add item for vehicles not carrying anything, e.g. train engines. */ - list.push_back(std::make_unique(this->GetCargoFilterLabel(CF_NONE), CF_NONE, false)); + list.push_back(std::make_unique(this->GetCargoFilterLabel(CargoFilterCriteria::CF_NONE), CargoFilterCriteria::CF_NONE, false)); /* Add cargos */ Dimension d = GetLargestCargoIconSize(); diff --git a/src/vehicle_gui_base.h b/src/vehicle_gui_base.h index 21e7b74cb4..c4ca5f5000 100644 --- a/src/vehicle_gui_base.h +++ b/src/vehicle_gui_base.h @@ -73,13 +73,6 @@ struct BaseVehicleListWindow : public Window { GB_END, }; - /** Special cargo filter criteria */ - enum CargoFilterSpecialType { - CF_NONE = INVALID_CARGO, ///< Show only vehicles which do not carry cargo (e.g. train engines) - CF_ANY = CT_NO_REFIT, ///< Show all vehicles independent of carried cargo (i.e. no filtering) - CF_FREIGHT = CT_AUTO_REFIT, ///< Show only vehicles which carry any freight (non-passenger) cargo - }; - GroupBy grouping; ///< How we want to group the list. VehicleList vehicles; ///< List of vehicles. This is the buffer for `vehgroups` to point into; if this is structurally modified, `vehgroups` must be rebuilt. GUIVehicleGroupList vehgroups; ///< List of (groups of) vehicles. This stores iterators of `vehicles`, and should be rebuilt if `vehicles` is structurally changed. From 97e2bc612c40c0d4b0624e163ab3948bc3a9ca64 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 8 Jan 2024 21:40:09 +0000 Subject: [PATCH 4/9] Codechange: Rename and move SpriteGroup-specific cargo types into a namespace. These 'cargo types' have special defined uses and must not be used elsewhere. This makes it clearer that they are special. --- src/newgrf.cpp | 12 ++++++------ src/newgrf_cargo.h | 13 ++++++++++--- src/newgrf_engine.cpp | 10 +++++----- src/newgrf_roadstop.cpp | 6 +++--- src/newgrf_station.cpp | 12 ++++++------ 5 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 38788801d2..064f438189 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -5508,8 +5508,8 @@ static void NewSpriteGroup(ByteReader *buf) static CargoID TranslateCargo(uint8_t feature, uint8_t ctype) { /* Special cargo types for purchase list and stations */ - if ((feature == GSF_STATIONS || feature == GSF_ROADSTOPS) && ctype == 0xFE) return CT_DEFAULT_NA; - if (ctype == 0xFF) return CT_PURCHASE; + if ((feature == GSF_STATIONS || feature == GSF_ROADSTOPS) && ctype == 0xFE) return SpriteGroupCargo::SG_DEFAULT_NA; + if (ctype == 0xFF) return SpriteGroupCargo::SG_PURCHASE; if (_cur.grffile->cargo_list.empty()) { /* No cargo table, so use bitnum values */ @@ -5637,9 +5637,9 @@ static void VehicleMapSpriteGroup(ByteReader *buf, byte feature, uint8_t idcount EngineID engine = engines[i]; if (wagover) { - SetWagonOverrideSprites(engine, CT_DEFAULT, _cur.spritegroups[groupid], last_engines, last_engines_count); + SetWagonOverrideSprites(engine, SpriteGroupCargo::SG_DEFAULT, _cur.spritegroups[groupid], last_engines, last_engines_count); } else { - SetCustomEngineSprites(engine, CT_DEFAULT, _cur.spritegroups[groupid]); + SetCustomEngineSprites(engine, SpriteGroupCargo::SG_DEFAULT, _cur.spritegroups[groupid]); SetEngineGRF(engine, _cur.grffile); } } @@ -5722,7 +5722,7 @@ static void StationMapSpriteGroup(ByteReader *buf, uint8_t idcount) continue; } - statspec->grf_prop.spritegroup[CT_DEFAULT] = _cur.spritegroups[groupid]; + statspec->grf_prop.spritegroup[SpriteGroupCargo::SG_DEFAULT] = _cur.spritegroups[groupid]; statspec->grf_prop.grffile = _cur.grffile; statspec->grf_prop.local_id = station; StationClass::Assign(statspec); @@ -6092,7 +6092,7 @@ static void RoadStopMapSpriteGroup(ByteReader *buf, uint8_t idcount) continue; } - roadstopspec->grf_prop.spritegroup[CT_DEFAULT] = _cur.spritegroups[groupid]; + roadstopspec->grf_prop.spritegroup[SpriteGroupCargo::SG_DEFAULT] = _cur.spritegroups[groupid]; roadstopspec->grf_prop.grffile = _cur.grffile; roadstopspec->grf_prop.local_id = roadstop; RoadStopClass::Assign(roadstopspec); diff --git a/src/newgrf_cargo.h b/src/newgrf_cargo.h index 54c9e6e834..d65a06a5b1 100644 --- a/src/newgrf_cargo.h +++ b/src/newgrf_cargo.h @@ -14,9 +14,16 @@ #include "cargo_type.h" #include "gfx_type.h" -static const CargoID CT_DEFAULT = NUM_CARGO + 0; -static const CargoID CT_PURCHASE = NUM_CARGO + 1; -static const CargoID CT_DEFAULT_NA = NUM_CARGO + 2; +/** + * Sprite Group Cargo types. + * These special cargo types are used when resolving sprite groups when non-cargo-specific sprites or callbacks are needed, + * e.g. in purchase lists, or if no specific cargo type sprite group is supplied. + */ +namespace SpriteGroupCargo { + static constexpr CargoID SG_DEFAULT = NUM_CARGO; ///< Default type used when no more-specific cargo matches. + static constexpr CargoID SG_PURCHASE = NUM_CARGO + 1; ///< Used in purchase lists before an item exists. + static constexpr CargoID SG_DEFAULT_NA = NUM_CARGO + 2; ///< Used only by stations and roads when no more-specific cargo matches. +}; /* Forward declarations of structs used */ struct CargoSpec; diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 2c3ee33af2..703858ccc1 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -31,7 +31,7 @@ void SetWagonOverrideSprites(EngineID engine, CargoID cargo, const SpriteGroup * { Engine *e = Engine::Get(engine); - assert(cargo < NUM_CARGO + 2); // Include CT_DEFAULT and CT_PURCHASE pseudo cargoes. + assert(cargo < NUM_CARGO + 2); // Include SpriteGroupCargo::SG_DEFAULT and SpriteGroupCargo::SG_PURCHASE pseudo cargoes. WagonOverride *wo = &e->overrides.emplace_back(); wo->group = group; @@ -44,7 +44,7 @@ const SpriteGroup *GetWagonOverrideSpriteSet(EngineID engine, CargoID cargo, Eng const Engine *e = Engine::Get(engine); for (const WagonOverride &wo : e->overrides) { - if (wo.cargo != cargo && wo.cargo != CT_DEFAULT) continue; + if (wo.cargo != cargo && wo.cargo != SpriteGroupCargo::SG_DEFAULT) continue; if (std::find(wo.engines.begin(), wo.engines.end(), overriding_engine) != wo.engines.end()) return wo.group; } return nullptr; @@ -1044,7 +1044,7 @@ VehicleResolverObject::VehicleResolverObject(EngineID engine_type, const Vehicle cached_relative_count(0) { if (wagon_override == WO_SELF) { - this->root_spritegroup = GetWagonOverrideSpriteSet(engine_type, CT_DEFAULT, engine_type); + this->root_spritegroup = GetWagonOverrideSpriteSet(engine_type, SpriteGroupCargo::SG_DEFAULT, engine_type); } else { if (wagon_override != WO_NONE && v != nullptr && v->IsGroundVehicle()) { assert(v->engine_type == engine_type); // overrides make little sense with fake scopes @@ -1061,9 +1061,9 @@ VehicleResolverObject::VehicleResolverObject(EngineID engine_type, const Vehicle if (this->root_spritegroup == nullptr) { const Engine *e = Engine::Get(engine_type); - CargoID cargo = v != nullptr ? v->cargo_type : CT_PURCHASE; + CargoID cargo = v != nullptr ? v->cargo_type : SpriteGroupCargo::SG_PURCHASE; assert(cargo < lengthof(e->grf_prop.spritegroup)); - this->root_spritegroup = e->grf_prop.spritegroup[cargo] != nullptr ? e->grf_prop.spritegroup[cargo] : e->grf_prop.spritegroup[CT_DEFAULT]; + this->root_spritegroup = e->grf_prop.spritegroup[cargo] != nullptr ? e->grf_prop.spritegroup[cargo] : e->grf_prop.spritegroup[SpriteGroupCargo::SG_DEFAULT]; } } } diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp index 2f8c0cc99c..ea2e260742 100644 --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -196,11 +196,11 @@ RoadStopResolverObject::RoadStopResolverObject(const RoadStopSpec *roadstopspec, this->town_scope = nullptr; - CargoID ctype = CT_DEFAULT_NA; + CargoID ctype = SpriteGroupCargo::SG_DEFAULT_NA; if (st == nullptr) { /* No station, so we are in a purchase list */ - ctype = CT_PURCHASE; + ctype = SpriteGroupCargo::SG_PURCHASE; } else if (Station::IsExpected(st)) { const Station *station = Station::From(st); /* Pick the first cargo that we have waiting */ @@ -214,7 +214,7 @@ RoadStopResolverObject::RoadStopResolverObject(const RoadStopSpec *roadstopspec, } if (roadstopspec->grf_prop.spritegroup[ctype] == nullptr) { - ctype = CT_DEFAULT; + ctype = SpriteGroupCargo::SG_DEFAULT; } /* Remember the cargo type we've picked */ diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index 6bfaa637a8..4cb6049475 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -496,12 +496,12 @@ uint32_t Waypoint::GetNewGRFVariable(const ResolverObject &, byte variable, [[ma switch (this->station_scope.cargo_type) { case INVALID_CARGO: - case CT_DEFAULT_NA: - case CT_PURCHASE: + case SpriteGroupCargo::SG_DEFAULT_NA: + case SpriteGroupCargo::SG_PURCHASE: cargo = 0; break; - case CT_DEFAULT: + case SpriteGroupCargo::SG_DEFAULT: for (const GoodsEntry &ge : st->goods) { cargo += ge.cargo.TotalCount(); } @@ -557,11 +557,11 @@ StationResolverObject::StationResolverObject(const StationSpec *statspec, BaseSt /* Invalidate all cached vars */ _svc.valid = 0; - CargoID ctype = CT_DEFAULT_NA; + CargoID ctype = SpriteGroupCargo::SG_DEFAULT_NA; if (this->station_scope.st == nullptr) { /* No station, so we are in a purchase list */ - ctype = CT_PURCHASE; + ctype = SpriteGroupCargo::SG_PURCHASE; } else if (Station::IsExpected(this->station_scope.st)) { const Station *st = Station::From(this->station_scope.st); /* Pick the first cargo that we have waiting */ @@ -575,7 +575,7 @@ StationResolverObject::StationResolverObject(const StationSpec *statspec, BaseSt } if (this->station_scope.statspec->grf_prop.spritegroup[ctype] == nullptr) { - ctype = CT_DEFAULT; + ctype = SpriteGroupCargo::SG_DEFAULT; } /* Remember the cargo type we've picked */ From c1b421c0c38b9a2f839986aacba5a106eba62811 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 9 Jan 2024 08:59:44 +0000 Subject: [PATCH 5/9] Fix: Clear one way state when removing road from road+tram tile --- src/road_cmd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 592edd1b58..69f540d43d 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -467,6 +467,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec const Town *town = CalcClosestTownFromTile(tile); SetTownIndex(tile, town == nullptr ? INVALID_TOWN : town->index); } + if (rtt == RTT_ROAD) SetDisallowedRoadDirections(tile, DRD_NONE); SetRoadBits(tile, ROAD_NONE, rtt); SetRoadType(tile, rtt, INVALID_ROADTYPE); MarkTileDirtyByTile(tile); From 09eefd6e959091f6a651e67698423ddef62f8eda Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 9 Jan 2024 17:10:50 +0000 Subject: [PATCH 6/9] Cleanup: Remove unused constant YAPF_SHIP_PATH_CACHE_LENGTH --- src/pathfinder/pathfinder_type.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/pathfinder/pathfinder_type.h b/src/pathfinder/pathfinder_type.h index 379297adfc..a7e6228a93 100644 --- a/src/pathfinder/pathfinder_type.h +++ b/src/pathfinder/pathfinder_type.h @@ -39,9 +39,6 @@ static const int YAPF_TILE_CORNER_LENGTH = 71; */ static const int YAPF_INFINITE_PENALTY = 1000 * YAPF_TILE_LENGTH; -/** Maximum length of ship path cache */ -static const int YAPF_SHIP_PATH_CACHE_LENGTH = 32; - /** Maximum segments of road vehicle path cache */ static const int YAPF_ROADVEH_PATH_CACHE_SEGMENTS = 8; From 8f2266f0ed30f442cb58c5704539002bafb22fdb Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 9 Jan 2024 22:36:09 +0000 Subject: [PATCH 7/9] Codechange: Use range-for when validating and finalising industries. (#11744) --- src/newgrf.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 064f438189..8332c3d0c7 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3433,8 +3433,8 @@ static bool ValidateIndustryLayout(const IndustryTileLayout &layout) } bool have_regular_tile = false; - for (size_t i = 0; i < size; i++) { - if (layout[i].gfx != GFX_WATERTILE_SPECIALCHECK) { + for (const auto &tilelayout : layout) { + if (tilelayout.gfx != GFX_WATERTILE_SPECIALCHECK) { have_regular_tile = true; break; } @@ -9382,15 +9382,14 @@ static void FinaliseIndustriesArray() } } - for (uint j = 0; j < NUM_INDUSTRYTYPES; j++) { - IndustrySpec *indsp = &_industry_specs[j]; - if (indsp->enabled && indsp->grf_prop.grffile != nullptr) { - for (uint i = 0; i < 3; i++) { - indsp->conflicting[i] = MapNewGRFIndustryType(indsp->conflicting[i], indsp->grf_prop.grffile->grfid); + for (auto &indsp : _industry_specs) { + if (indsp.enabled && indsp.grf_prop.grffile != nullptr) { + for (auto &conflicting : indsp.conflicting) { + conflicting = MapNewGRFIndustryType(conflicting, indsp.grf_prop.grffile->grfid); } } - if (!indsp->enabled) { - indsp->name = STR_NEWGRF_INVALID_INDUSTRYTYPE; + if (!indsp.enabled) { + indsp.name = STR_NEWGRF_INVALID_INDUSTRYTYPE; } } } From 86b046cd26a67c1a216e5487ff72c91f80d8e4d0 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 10 Jan 2024 00:20:34 +0000 Subject: [PATCH 8/9] Fix: Incorrect assertion in GetTileIndexFromLocalCoordinate (#11747) --- src/pathfinder/water_regions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pathfinder/water_regions.cpp b/src/pathfinder/water_regions.cpp index 5a6e25a776..2bda5aa1cf 100644 --- a/src/pathfinder/water_regions.cpp +++ b/src/pathfinder/water_regions.cpp @@ -191,7 +191,7 @@ std::vector _water_regions; TileIndex GetTileIndexFromLocalCoordinate(int region_x, int region_y, int local_x, int local_y) { - assert(local_x >= 0 && local_y < WATER_REGION_EDGE_LENGTH); + assert(local_x >= 0 && local_x < WATER_REGION_EDGE_LENGTH); assert(local_y >= 0 && local_y < WATER_REGION_EDGE_LENGTH); return TileXY(WATER_REGION_EDGE_LENGTH * region_x + local_x, WATER_REGION_EDGE_LENGTH * region_y + local_y); } From f7bd70baec83b97e8b4e91f1425b2b105d3ac9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Wed, 10 Jan 2024 16:23:36 +0100 Subject: [PATCH 9/9] Fix #11748: Incorrect clamping of negative service interval values (#11749) --- src/order_cmd.cpp | 2 +- src/order_func.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index f6ad069995..d6e1748f90 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1849,7 +1849,7 @@ void DeleteVehicleOrders(Vehicle *v, bool keep_orderlist, bool reset_order_indic * @param interval proposed service interval * @return Clamped service interval */ -uint16_t GetServiceIntervalClamped(uint interval, bool ispercent) +uint16_t GetServiceIntervalClamped(int interval, bool ispercent) { return ispercent ? Clamp(interval, MIN_SERVINT_PERCENT, MAX_SERVINT_PERCENT) : Clamp(interval, MIN_SERVINT_DAYS, MAX_SERVINT_DAYS); } diff --git a/src/order_func.h b/src/order_func.h index c879a2a30d..f8771b09dc 100644 --- a/src/order_func.h +++ b/src/order_func.h @@ -37,6 +37,6 @@ static const uint DEF_SERVINT_PERCENT = 50; static const uint MIN_SERVINT_PERCENT = 5; static const uint MAX_SERVINT_PERCENT = 90; -uint16_t GetServiceIntervalClamped(uint interval, bool ispercent); +uint16_t GetServiceIntervalClamped(int interval, bool ispercent); #endif /* ORDER_FUNC_H */