1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
|
diff --git a/layer.txt b/layer.txt
new file mode 100644
index 000000000..a5947189b
--- /dev/null
+++ b/layer.txt
@@ -0,0 +1,48 @@
+* Card generation (extended card)
+
+VISUALIZATION
+
+* arrange a "shift" of the viewport to select a layer
+- and restriction on movement
++ each viewport has its own layer
+
+LOGICS
+
+dungeon:
+ unavailability:
+* flood
+* landscape change
+* building
+* houses
+* trees
+* water
+* factories
+* bridges
+* tunnels
+* airports
+* roads at the intersection of layers
+? generator
+? rivers, cities
+* edges (independent lifting, void)
+
+activity restriction
+synchronization of landscape changes
+
+GUI
+
+** construction of a two-level station
+- construction of a worm-hole from one layer to a neighbour layer
+** work with the station (construction, removal / blocking of parts / cost)
+* menu template for management / construction
+
++ add selection of number of layers
++ only show layer switches for available layers
+? only show tiles of current layer
++ fix the coordinates in the "help area"
+- fix the coordinates in the start screen
+- signatures, station names (on all layers), effects (on the desired layer)
+
+BAGI
++ station deletion (departure)
+* Expansion of the underground station does not work (when adding cells, a new one is added)
+- GF. "jumps" (the non-editable part of the station changes randomly when the station is modified)
diff --git a/media/baseset/opntitle.dat b/media/baseset/opntitle.dat
index 264aaff60..9793856b7 100644
Binary files a/media/baseset/opntitle.dat and b/media/baseset/opntitle.dat differ
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0a0ac406a..4deaa9fa2 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -205,6 +205,10 @@ add_files(
landscape.h
landscape_type.h
language.h
+ layer.cpp
+ layer_func.h
+ layer_gui.h
+ layer_type.h
livery.h
main_gui.cpp
map.cpp
@@ -442,6 +446,8 @@ add_files(
tunnelbridge.h
tunnelbridge_cmd.cpp
tunnelbridge_map.h
+ underground_gui.cpp
+ underground_gui.h
vehicle.cpp
vehicle_base.h
vehicle_cmd.cpp
diff --git a/src/base_station_base.h b/src/base_station_base.h
index 40543f1b8..ace01445a 100644
--- a/src/base_station_base.h
+++ b/src/base_station_base.h
@@ -26,6 +26,13 @@ struct StationSpecList {
/** StationRect - used to track station spread out rectangle - cheaper than scanning whole map */
+/*
+** Патч "layer"
+** Критическое изменение:
+** "Rect" подразумевает только верхний слой (поверхность)
+** (станция может располагаться на любом слое, --
+** Rect описывает соответствующую часть верхнего слоя)
+*/
struct StationRect : public Rect {
enum StationRectMode
{
@@ -36,7 +43,7 @@ struct StationRect : public Rect {
StationRect();
void MakeEmpty();
- bool PtInExtendedRect(int x, int y, int distance = 0) const;
+ bool PtInExtendedRect(int topx, int topy, int distance = 0) const;
bool IsEmpty() const;
CommandCost BeforeAddTile(TileIndex tile, StationRectMode mode);
CommandCost BeforeAddRect(TileIndex tile, int w, int h, StationRectMode mode);
diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp
index 06953884e..eeaba3f87 100644
--- a/src/clear_cmd.cpp
+++ b/src/clear_cmd.cpp
@@ -12,6 +12,7 @@
#include "command_func.h"
#include "landscape.h"
#include "genworld.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "water.h"
#include "core/random_func.hpp"
@@ -98,8 +99,28 @@ static void DrawClearLandFence(const TileInfo *ti)
EndSpriteCombine();
}
+static void DrawUndergroundTile_Clear(TileInfo *ti)
+{
+
+}
+
static void DrawTile_Clear(TileInfo *ti)
{
+ uint base_tile = TopTile(ti->tile);
+ uint underground_tile = DownTile(base_tile);
+
+ bool self_underground = IsUnderground(ti->tile);
+
+ bool have_canalization = IsTileType(base_tile, MP_HOUSE);
+ bool have_underground = !IsTileType(underground_tile, MP_CLEAR);
+
+ if (self_underground && !have_canalization)
+ DrawGroundSprite(SPR_FLAT_BARE_LAND + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
+
+ if (self_underground && have_canalization)
+ DrawGroundSprite(SPR_FLAT_GRASS_TILE + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
+
+ if (!self_underground)
switch (GetClearGround(ti->tile)) {
case CLEAR_GRASS:
DrawClearLandTile(ti, GetClearDensity(ti->tile));
@@ -124,6 +145,9 @@ static void DrawTile_Clear(TileInfo *ti)
break;
}
+ if (!self_underground && have_underground)
+ DrawGroundSprite(SPR_FLAT_BARE_LAND + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
+
DrawBridgeMiddle(ti);
}
@@ -321,7 +345,7 @@ void GenerateClearTile()
SetGeneratingWorldProgress(GWP_ROUGH_ROCKY, gi + i);
do {
IncreaseGeneratingWorldProgress(GWP_ROUGH_ROCKY);
- tile = RandomTile();
+ tile = TopTile(RandomTile());
if (IsTileType(tile, MP_CLEAR) && !IsClearGround(tile, CLEAR_DESERT)) SetClearGroundDensity(tile, CLEAR_ROUGH, 3);
} while (--i);
@@ -329,7 +353,7 @@ void GenerateClearTile()
i = gi;
do {
uint32 r = Random();
- tile = RandomTileSeed(r);
+ tile = TopTile(RandomTileSeed(r));
IncreaseGeneratingWorldProgress(GWP_ROUGH_ROCKY);
if (IsTileType(tile, MP_CLEAR) && !IsClearGround(tile, CLEAR_DESERT)) {
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index 857dc61ad..388d9acd4 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -25,6 +25,7 @@
#include "screenshot.h"
#include "genworld.h"
#include "strings_func.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "window_func.h"
#include "date_func.h"
@@ -1067,6 +1068,7 @@ DEF_CONSOLE_CMD(ConRestart)
}
/* Don't copy the _newgame pointers to the real pointers, so call SwitchToMode directly */
+ _settings_game.game_creation.layers = FindFirstBit(LayerCount());
_settings_game.game_creation.map_x = MapLogX();
_settings_game.game_creation.map_y = FindFirstBit(MapSizeY());
_switch_mode = SM_RESTARTGAME;
diff --git a/src/disaster_vehicle.cpp b/src/disaster_vehicle.cpp
index 1244f99ab..6d5defaac 100644
--- a/src/disaster_vehicle.cpp
+++ b/src/disaster_vehicle.cpp
@@ -325,7 +325,7 @@ static bool DisasterTick_Ufo(DisasterVehicle *v)
return true;
}
if (++v->age < 6) {
- v->dest_tile = RandomTile();
+ v->dest_tile = TopTile(RandomTile());
return true;
}
v->current_order.SetDestination(1);
@@ -572,12 +572,12 @@ static bool DisasterTick_Big_Ufo(DisasterVehicle *v)
}
if (++v->age < 6) {
- v->dest_tile = RandomTile();
+ v->dest_tile = TopTile(RandomTile());
return true;
}
v->current_order.SetDestination(1);
- TileIndex tile_org = RandomTile();
+ TileIndex tile_org = TopTile(RandomTile());
TileIndex tile = tile_org;
do {
if (IsPlainRailTile(tile) &&
@@ -958,7 +958,7 @@ void ReleaseDisastersTargetingVehicle(VehicleID vehicle)
if (v->current_order.GetDestination() != 0 && v->dest_tile == vehicle) {
/* Revert to target-searching */
v->current_order.SetDestination(0);
- v->dest_tile = RandomTile();
+ v->dest_tile = TopTile(RandomTile());
GetAircraftFlightLevelBounds(v, &v->z_pos, nullptr);
v->age = 0;
}
diff --git a/src/genworld.cpp b/src/genworld.cpp
index c76fe309d..61cbe2b2a 100644
--- a/src/genworld.cpp
+++ b/src/genworld.cpp
@@ -350,6 +350,6 @@ void GenerateWorld(GenWorldMode mode, uint size_x, uint size_y, bool reset_setti
/* Centre the view on the map */
if (FindWindowById(WC_MAIN_WINDOW, 0) != nullptr) {
- ScrollMainWindowToTile(TileXY(MapSizeX() / 2, MapSizeY() / 2), true);
+ ScrollMainWindowToTile(TileXY(MapSizeX() / 2, MapSizeY() / LayerCount() / 2), true);
}
}
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 154097e72..62fa1966e 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -16,6 +16,8 @@
#include "window_func.h"
#include "date_func.h"
#include "sound_func.h"
+#include "map_type.h"
+#include "layer_type.h"
#include "fios.h"
#include "string_func.h"
#include "widgets/dropdown_type.h"
@@ -79,6 +81,7 @@ static const NWidgetPart _nested_generate_landscape_widgets[] = {
/* Left column with labels. */
NWidget(NWID_VERTICAL, NC_EQUALSIZE), SetPIP(0, 4, 0),
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_MAPSIZE, STR_MAPGEN_MAPSIZE_TOOLTIP), SetFill(1, 1),
+ NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_UNDERGROUND_LAYER_COUNT, STR_NULL), SetFill(1, 1),
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_LAND_GENERATOR, STR_NULL), SetFill(1, 1),
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_NUMBER_OF_TOWNS, STR_NULL), SetFill(1, 1),
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_TERRAIN_TYPE, STR_NULL), SetFill(1, 1),
@@ -95,6 +98,7 @@ static const NWidgetPart _nested_generate_landscape_widgets[] = {
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_BY, STR_NULL), SetPadding(1, 0, 0, 0), SetFill(1, 1),
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_MAPSIZE_Y_PULLDOWN), SetDataTip(STR_JUST_INT, STR_MAPGEN_MAPSIZE_TOOLTIP), SetFill(1, 0),
EndContainer(),
+ NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_LAYER_COUNT_PULLDOWN), SetDataTip(STR_JUST_INT, STR_NULL), SetFill(1, 0),
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_LANDSCAPE_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_TOWN_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_TERRAIN_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
@@ -199,6 +203,7 @@ static const NWidgetPart _nested_heightmap_load_widgets[] = {
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_HEIGHTMAP_NAME, STR_NULL), SetFill(1, 1),
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_MAPSIZE, STR_NULL), SetFill(1, 1),
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_HEIGHTMAP_ROTATION, STR_NULL), SetFill(1, 1),
+ NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_UNDERGROUND_LAYER_COUNT, STR_NULL), SetFill(1, 1),
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_NUMBER_OF_TOWNS, STR_NULL), SetFill(1, 1),
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_NUMBER_OF_INDUSTRIES, STR_NULL), SetFill(1, 1),
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_QUANTITY_OF_RIVERS, STR_NULL), SetFill(1, 1),
@@ -216,6 +221,7 @@ static const NWidgetPart _nested_heightmap_load_widgets[] = {
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_MAPSIZE_Y_PULLDOWN), SetDataTip(STR_JUST_INT, STR_NULL), SetFill(1, 0),
EndContainer(),
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_HEIGHTMAP_ROTATION_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
+ NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_LAYER_COUNT_PULLDOWN), SetDataTip(STR_JUST_INT, STR_NULL), SetFill(1, 0),
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_TOWN_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_INDUSTRY_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_RIVER_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
@@ -280,11 +286,11 @@ static void LandscapeGenerationCallback(Window *w, bool confirmed)
if (confirmed) StartGeneratingLandscape((GenerateLandscapeWindowMode)w->window_number);
}
-static DropDownList BuildMapsizeDropDown()
+static DropDownList BuildBitListDropDown(uint min_bits, uint max_bits)
{
DropDownList list;
- for (uint i = MIN_MAP_SIZE_BITS; i <= MAX_MAP_SIZE_BITS; i++) {
+ for (uint i = min_bits; i <= max_bits; i++) {
DropDownListParamStringItem *item = new DropDownListParamStringItem(STR_JUST_INT, i, false);
item->SetParam(0, 1LL << i);
list.emplace_back(item);
@@ -293,6 +299,16 @@ static DropDownList BuildMapsizeDropDown()
return list;
}
+static DropDownList BuildMapsizeDropDown()
+{
+ return BuildBitListDropDown(MIN_MAP_SIZE_BITS, MAX_MAP_SIZE_BITS);
+}
+
+static DropDownList BuildLayerDropDown()
+{
+ return BuildBitListDropDown(MIN_LAYER_COUNT_BITS, MAX_LAYER_COUNT_BITS);
+}
+
static const StringID _elevations[] = {STR_TERRAIN_TYPE_VERY_FLAT, STR_TERRAIN_TYPE_FLAT, STR_TERRAIN_TYPE_HILLY, STR_TERRAIN_TYPE_MOUNTAINOUS, STR_TERRAIN_TYPE_ALPINIST, INVALID_STRING_ID};
static const StringID _sea_lakes[] = {STR_SEA_LEVEL_VERY_LOW, STR_SEA_LEVEL_LOW, STR_SEA_LEVEL_MEDIUM, STR_SEA_LEVEL_HIGH, STR_SEA_LEVEL_CUSTOM, INVALID_STRING_ID};
static const StringID _rivers[] = {STR_RIVERS_NONE, STR_RIVERS_FEW, STR_RIVERS_MODERATE, STR_RIVERS_LOT, INVALID_STRING_ID};
@@ -336,6 +352,7 @@ struct GenerateLandscapeWindow : public Window {
case WID_GL_START_DATE_TEXT: SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); break;
case WID_GL_MAPSIZE_X_PULLDOWN: SetDParam(0, 1LL << _settings_newgame.game_creation.map_x); break;
case WID_GL_MAPSIZE_Y_PULLDOWN: SetDParam(0, 1LL << _settings_newgame.game_creation.map_y); break;
+ case WID_GL_LAYER_COUNT_PULLDOWN: SetDParam(0, 1 << _settings_newgame.game_creation.layers); break;
case WID_GL_MAX_HEIGHTLEVEL_TEXT: SetDParam(0, _settings_newgame.construction.max_heightlevel); break;
case WID_GL_SNOW_LEVEL_TEXT: SetDParam(0, _settings_newgame.game_creation.snow_line_height); break;
@@ -458,6 +475,11 @@ struct GenerateLandscapeWindow : public Window {
*size = maxdim(*size, GetStringBoundingBox(STR_JUST_INT));
break;
+ case WID_GL_LAYER_COUNT_PULLDOWN:
+ SetDParam(0, MAX_LAYER_COUNT);
+ *size = GetStringBoundingBox(STR_JUST_INT);
+ break;
+
case WID_GL_SNOW_LEVEL_TEXT:
SetDParamMaxValue(0, MAX_TILE_HEIGHT);
*size = maxdim(*size, GetStringBoundingBox(STR_JUST_INT));
@@ -544,6 +566,10 @@ struct GenerateLandscapeWindow : public Window {
ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_y, WID_GL_MAPSIZE_Y_PULLDOWN);
break;
+ case WID_GL_LAYER_COUNT_PULLDOWN: // Mapsize Z
+ ShowDropDownList(this, BuildLayerDropDown(), _settings_newgame.game_creation.layers, WID_GL_LAYER_COUNT_PULLDOWN);
+ break;
+
case WID_GL_TOWN_PULLDOWN: // Number of towns
ShowDropDownMenu(this, _num_towns, _settings_newgame.difficulty.number_towns, WID_GL_TOWN_PULLDOWN, 0, 0);
break;
@@ -717,6 +743,7 @@ struct GenerateLandscapeWindow : public Window {
switch (widget) {
case WID_GL_MAPSIZE_X_PULLDOWN: _settings_newgame.game_creation.map_x = index; break;
case WID_GL_MAPSIZE_Y_PULLDOWN: _settings_newgame.game_creation.map_y = index; break;
+ case WID_GL_LAYER_COUNT_PULLDOWN: _settings_newgame.game_creation.layers = index; break;
case WID_GL_TREE_PULLDOWN: _settings_newgame.game_creation.tree_placer = index; break;
case WID_GL_RIVER_PULLDOWN: _settings_newgame.game_creation.amount_of_rivers = index; break;
case WID_GL_SMOOTHNESS_PULLDOWN: _settings_newgame.game_creation.tgen_smoothness = index; break;
@@ -901,6 +928,10 @@ struct CreateScenarioWindow : public Window
SetDParam(0, 1LL << _settings_newgame.game_creation.map_y);
break;
+ case WID_CS_LAYER_COUNT_PULLDOWN:
+ SetDParam(0, 1 << _settings_newgame.game_creation.layers);
+ break;
+
case WID_CS_FLAT_LAND_HEIGHT_TEXT:
SetDParam(0, _settings_newgame.game_creation.se_flat_world_height);
break;
@@ -934,6 +965,10 @@ struct CreateScenarioWindow : public Window
case WID_CS_MAPSIZE_X_PULLDOWN:
case WID_CS_MAPSIZE_Y_PULLDOWN:
SetDParamMaxValue(0, MAX_MAP_SIZE);
+ break;
+
+ case WID_CS_LAYER_COUNT_PULLDOWN:
+ SetDParam(0, MAX_LAYER_COUNT);
break;
case WID_CS_FLAT_LAND_HEIGHT_TEXT:
@@ -967,6 +1002,10 @@ struct CreateScenarioWindow : public Window
ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_y, WID_CS_MAPSIZE_Y_PULLDOWN);
break;
+ case WID_CS_LAYER_COUNT_PULLDOWN: // Mapsize Y
+ ShowDropDownList(this, BuildLayerDropDown(), _settings_newgame.game_creation.layers, WID_CS_LAYER_COUNT_PULLDOWN);
+ break;
+
case WID_CS_EMPTY_WORLD: // Empty world / flat world
StartGeneratingLandscape(GLWM_SCENARIO);
break;
@@ -1029,6 +1068,7 @@ struct CreateScenarioWindow : public Window
switch (widget) {
case WID_CS_MAPSIZE_X_PULLDOWN: _settings_newgame.game_creation.map_x = index; break;
case WID_CS_MAPSIZE_Y_PULLDOWN: _settings_newgame.game_creation.map_y = index; break;
+ case WID_CS_LAYER_COUNT_PULLDOWN: _settings_newgame.game_creation.layers = index; break;
}
this->SetDirty();
}
@@ -1084,6 +1124,7 @@ static const NWidgetPart _nested_create_scenario_widgets[] = {
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_CS_MAPSIZE_X_PULLDOWN), SetDataTip(STR_JUST_INT, STR_NULL), SetPadding(0, 4, 0, 0),
NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_BY, STR_NULL), SetPadding(1, 2, 0, 0),
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_CS_MAPSIZE_Y_PULLDOWN), SetDataTip(STR_JUST_INT, STR_NULL),
+ NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_CS_LAYER_COUNT_PULLDOWN), SetDataTip(STR_JUST_INT, STR_NULL),
EndContainer(),
/* Date. */
NWidget(NWID_HORIZONTAL),
diff --git a/src/gfx_type.h b/src/gfx_type.h
index 6fca2228d..85fae182a 100644
--- a/src/gfx_type.h
+++ b/src/gfx_type.h
@@ -155,6 +155,7 @@ struct DrawPixelInfo {
void *dst_ptr;
int left, top, width, height;
int pitch;
+ int layer;
ZoomLevel zoom;
};
diff --git a/src/heightmap.cpp b/src/heightmap.cpp
index fab93c980..f345f5ee6 100644
--- a/src/heightmap.cpp
+++ b/src/heightmap.cpp
@@ -14,6 +14,7 @@
#include "error.h"
#include "saveload/saveload.h"
#include "bmp.h"
+#include "layer_func.h"
#include "gfx_func.h"
#include "fios.h"
#include "fileio_func.h"
@@ -395,6 +396,9 @@ void FixSlopes()
width = MapSizeX();
height = MapSizeY();
+ /* Layers height correct */
+ FixUndergroundHeights();
+
/* Top and left edge */
for (row = 0; (uint)row < height; row++) {
for (col = 0; (uint)col < width; col++) {
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 443702993..223018bd2 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -12,6 +12,7 @@
#include "industry.h"
#include "station_base.h"
#include "landscape.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "command_func.h"
#include "town.h"
@@ -1438,7 +1439,7 @@ static CommandCost CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTil
IndustryGfx gfx = GetTranslatedIndustryTileID(it.gfx);
TileIndex cur_tile = TileAddWrap(tile, it.ti.x, it.ti.y);
- if (!IsValidTile(cur_tile)) {
+ if (!IsValidTile(cur_tile) || IsUnderground(cur_tile)) {
return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
}
@@ -2013,7 +2014,7 @@ CommandCost CmdBuildIndustry(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
/* We should not have more than one Random() in a function call
* because parameter evaluation order is not guaranteed in the c++ standard
*/
- tile = RandomTile();
+ tile = TopTile(RandomTile());
/* Start with a random layout */
size_t layout = RandomRange((uint32)num_layouts);
/* Check now each layout, starting with the random one */
@@ -2155,7 +2156,7 @@ static Industry *PlaceIndustry(IndustryType type, IndustryAvailabilityCallType c
{
uint tries = try_hard ? 10000u : 2000u;
for (; tries > 0; tries--) {
- Industry *ind = CreateNewIndustry(RandomTile(), type, creation_type);
+ Industry *ind = CreateNewIndustry(TopTile(RandomTile()), type, creation_type);
if (ind != nullptr) return ind;
}
return nullptr;
diff --git a/src/landscape.cpp b/src/landscape.cpp
index f09bdcaff..8607d7aad 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -33,6 +33,7 @@
#include "framerate_type.h"
#include <list>
#include <set>
+#include "layer_func.h"
#include "table/strings.h"
#include "table/sprites.h"
@@ -812,10 +813,10 @@ void RunTileLoop()
0xD8F, 0x1296, 0x2496, 0x4357, 0x8679, 0x1030E, 0x206CD, 0x403FE, 0x807B8, 0x1004B2, 0x2006A8, 0x4004B2, 0x800B87
};
assert_compile(lengthof(feedbacks) == 2 * MAX_MAP_SIZE_BITS - 2 * MIN_MAP_SIZE_BITS + 1);
- const uint32 feedback = feedbacks[MapLogX() + MapLogY() - 2 * MIN_MAP_SIZE_BITS];
+ const uint32 feedback = feedbacks[MapLogX() + MapLogY() - LayerCountLog() - 2 * MIN_MAP_SIZE_BITS];
/* We update every tile every 256 ticks, so divide the map size by 2^8 = 256 */
- uint count = 1 << (MapLogX() + MapLogY() - 8);
+ uint count = 1 << (MapLogX() + MapLogY() - LayerCountLog() - 8);
TileIndex tile = _cur_tileloop_tile;
/* The LFSR cannot have a zeroed state. */
@@ -839,17 +840,23 @@ void RunTileLoop()
void InitializeLandscape()
{
- for (uint y = _settings_game.construction.freeform_edges ? 1 : 0; y < MapMaxY(); y++) {
- for (uint x = _settings_game.construction.freeform_edges ? 1 : 0; x < MapMaxX(); x++) {
- MakeClear(TileXY(x, y), CLEAR_GRASS, 3);
- SetTileHeight(TileXY(x, y), 0);
- SetTropicZone(TileXY(x, y), TROPICZONE_NORMAL);
- ClearBridgeMiddle(TileXY(x, y));
+ uint maxx = LayerMaxX();
+ uint maxy = LayerMaxY();
+ uint sizex = MapSizeX();
+ uint layersize = LayerSize();
+
+ FOR_ALL_LAYERS(layer) {
+ for (uint y = _settings_game.construction.freeform_edges ? 1 : 0; y < LayerMaxY(); y++) {
+ for (uint x = _settings_game.construction.freeform_edges ? 1 : 0; x < LayerMaxX(); x++) {
+ MakeClear(layer * layersize + TileXY(x, y), CLEAR_GRASS, 3);
+ SetTileHeight(layer * layersize + TileXY(x, y), 0);
+ SetTropicZone(layer * layersize + TileXY(x, y), TROPICZONE_NORMAL);
+ ClearBridgeMiddle(layer * layersize + TileXY(x, y));
+ }
+ MakeVoid(layer * layersize + TileXY(LayerMaxX(), y));
}
+ for (uint x = 0; x < LayerSizeX(); x++) MakeVoid(TileXY(x, LayerMaxY()));
}
-
- for (uint x = 0; x < MapSizeX(); x++) MakeVoid(TileXY(x, MapMaxY()));
- for (uint y = 0; y < MapSizeY(); y++) MakeVoid(TileXY(MapMaxX(), y));
}
static const byte _genterrain_tbl_1[5] = { 10, 22, 33, 37, 4 };
@@ -1277,7 +1284,7 @@ static void CreateRivers()
for (; wells != 0; wells--) {
IncreaseGeneratingWorldProgress(GWP_RIVER);
for (int tries = 0; tries < 128; tries++) {
- TileIndex t = RandomTile();
+ TileIndex t = TopTile(RandomTile());
if (!CircularTileSearch(&t, 8, FindSpring, nullptr)) continue;
if (FlowRiver(t, t)) break;
}
diff --git a/src/lang/afrikaans.txt b/src/lang/afrikaans.txt
index c478322ea..080a0fe81 100644
--- a/src/lang/afrikaans.txt
+++ b/src/lang/afrikaans.txt
@@ -2616,7 +2616,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Tremweg
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Spoorweg eienaar: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Plaaslike raad: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Geen
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koördinate: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koördinate: {LTBLUE}{NUM}x{NUM}x{NUM}x-{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Gebou: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Stasie klas: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Stasie tiepe: {LTBLUE}{STRING}
diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt
index 64d049138..293e2ee31 100644
--- a/src/lang/arabic_egypt.txt
+++ b/src/lang/arabic_egypt.txt
@@ -2198,7 +2198,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Щ…Ш§Щ„Щѓ
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Щ…Ш§Щ„Щѓ ШіЩѓШ© Ш§Щ„ШШЇЩЉШЇ: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Ш§Щ„ШіЩ„Ш·Ш© Ш§Щ„Щ…ШЩ„ЩЉШ©: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :ЩЃШ§Ш±Шє
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Ш§Щ„ШЈШШЇШ§Ш«ЩЉШ§ШЄ: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Ш§Щ„ШЈШШЇШ§Ш«ЩЉШ§ШЄ: {LTBLUE}{NUM}x{NUM}x{NUM}x-{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}ШЁЩ†ЩЉ: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK} ЩЃШ¦Ш© Ш§Щ„Щ…ШШ·Ш©: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Щ†Щ€Ш№ Ш§Щ„Щ…ШШ·Ш©: {LTBLUE}{STRING}
diff --git a/src/lang/basque.txt b/src/lang/basque.txt
index 485056787..4b36208dc 100644
--- a/src/lang/basque.txt
+++ b/src/lang/basque.txt
@@ -2474,7 +2474,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Tranbia
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Trenbidearen jabea: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Udaletxea {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Ezer ez
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordenadak: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordenadak: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Eraikia: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Geltoki mota: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Geltoki mota: {LTBLUE}{STRING}
diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt
index 19f88d555..023129584 100644
--- a/src/lang/belarusian.txt
+++ b/src/lang/belarusian.txt
@@ -2942,7 +2942,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Улад
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Уладальнiк чыгункi: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Мясцовая адміністрацыя: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :РќСЏРјР°
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Каардынаты: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Каардынаты: {LTBLUE}{NUM}x{NUM}x{NUM}x-{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Пабудавана: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Кляса станцыі: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Тып станцыi: {LTBLUE}{STRING}
diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt
index 49a1b301c..bab9028ae 100644
--- a/src/lang/brazilian_portuguese.txt
+++ b/src/lang/brazilian_portuguese.txt
@@ -2608,7 +2608,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Dono da
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Dono da linha ferroviГЎria: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Prefeitura: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Nenhum
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenadas: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenadas: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}ConstruГdo: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Classe de Estação: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tipo de Estação: {LTBLUE}{STRING}
diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt
index 5196ae47e..a136f7270 100644
--- a/src/lang/bulgarian.txt
+++ b/src/lang/bulgarian.txt
@@ -2528,7 +2528,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}РЎРѕР±СЃ
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Собственик на железопътната линия: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Община: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Нищо
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Координати: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Координати: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Построен: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Клас на станцията: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Тип на станцията: {LTBLUE}{STRING}
diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt
index d068164d7..d7743c291 100644
--- a/src/lang/catalan.txt
+++ b/src/lang/catalan.txt
@@ -2626,7 +2626,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Propieta
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Propietari del rail: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Autoritat Local: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Cap
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenades: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenades: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}ConstruГЇt: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Classe d'estaciГі: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tipus d'estaciГі: {LTBLUE}{STRING}
diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt
index 1a81252d4..24af796e3 100644
--- a/src/lang/croatian.txt
+++ b/src/lang/croatian.txt
@@ -2721,7 +2721,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Vlasnik
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Vlasnik Еѕeljeznice: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}PodruДЌna nadleЕѕnost: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Nijedan/Nitko/NiЕЎta
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinate: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinate: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}IzgraД‘eno: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Klasa postaje: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Vrsta postaje: {LTBLUE}{STRING}
diff --git a/src/lang/czech.txt b/src/lang/czech.txt
index c00ccfbac..d8a137fe8 100644
--- a/src/lang/czech.txt
+++ b/src/lang/czech.txt
@@ -2718,7 +2718,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Majitel
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Majitel tratД›: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}MГstnГ sprГЎva: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Nic
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}SouЕ™adnice: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}SouЕ™adnice: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Postaveno: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}TЕ™Гda stanice: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Druh stanice: {LTBLUE}{STRING}
diff --git a/src/lang/danish.txt b/src/lang/danish.txt
index b284d0f60..a290ff8eb 100644
--- a/src/lang/danish.txt
+++ b/src/lang/danish.txt
@@ -2625,7 +2625,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Ejer af
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Ejer af jernbane: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Lokal myndighed: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Ingen
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinater: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinater: {LTBLUE}{NUM}x{NUM}x{NUM}x-{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Produceret: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Stationsklasse: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Stationstype: {LTBLUE}{STRING}
diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt
index c1e3acc5d..ead74380e 100644
--- a/src/lang/dutch.txt
+++ b/src/lang/dutch.txt
@@ -2625,7 +2625,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Eigenaar
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Eigenaar van spoorweg: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Gemeente: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Geen
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coördinaten: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coördinaten: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Bouwjaar: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Stationsklasse: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Stationstype: {LTBLUE}{STRING}
diff --git a/src/lang/english.txt b/src/lang/english.txt
index c055f54a0..0050bdb66 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -462,6 +462,18 @@ STR_LANDSCAPING_MENU_PLANT_TREES :Plant trees
STR_LANDSCAPING_MENU_PLACE_SIGN :Place sign
############ range ends here
+############ range for underground menu starts
+STR_LANDSCAPING_MENU_UNDERGROUND :Special constructions
+STR_LANDSCAPING_MENU_LAYER_1 :Surface
+STR_LANDSCAPING_MENU_LAYER_2 :Undergroound (-1)
+STR_LANDSCAPING_MENU_LAYER_3 :Undergroound (-2)
+STR_LANDSCAPING_MENU_LAYER_4 :Undergroound (-3)
+STR_LANDSCAPING_MENU_LAYER_5 :Undergroound (-4)
+STR_LANDSCAPING_MENU_LAYER_6 :Undergroound (-5)
+STR_LANDSCAPING_MENU_LAYER_7 :Undergroound (-6)
+STR_LANDSCAPING_MENU_LAYER_8 :Undergroound (-7)
+############ range ends here
+
############ range for music menu starts
STR_TOOLBAR_SOUND_MUSIC :Sound/music
############ range ends here
@@ -2625,7 +2637,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Tramway
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Railway owner: {LTBLUE}{STRING1}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Local authority: {LTBLUE}{STRING1}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :None
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordinates: {LTBLUE}{NUM} x {NUM} x {NUM} ({RAW_STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordinates: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({RAW_STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Built: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Station class: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Station type: {LTBLUE}{STRING}
@@ -5149,3 +5161,35 @@ STR_PLANE :{BLACK}{PLANE}
STR_SHIP :{BLACK}{SHIP}
STR_TOOLBAR_RAILTYPE_VELOCITY :{STRING} ({VELOCITY})
+
+# underground
+
+# error
+STR_ERROR_UNDERGROUND_CAN_T_BUILD_UNDER_GROUND :{WHITE}Can't build this underground
+STR_ERROR_UNDERGROUND_CAN_T_BUILD_OVER_GROUND :{WHITE}Can't build this on surface
+STR_ERROR_UNDERGROUND_CAN_T_TERRAFORM :{WHITE}Can't terraform underground
+STR_ERROR_UNDERGROUND_CAN_T_BUILD_PART :{WHITE}Can't build escalator here...
+STR_ERROR_UNDERGROUND_CAN_T_BUILD_TOP_PART :{WHITE}Can't build escalator top here...
+STR_ERROR_UNDERGROUND_CAN_T_BUILD_BOTTOM_PART :{WHITE}Can't build escalator bottom here...
+
+# menus
+STR_UNDERGROUND_LAYER_COUNT :{BLACK}Layers count
+STR_UNDERGROUND_BUILD :{WHITE}Underground
+
+# underground land types
+STR_UNDERGROUND_FLAT :Cave
+STR_UNDERGROUND_SOLID :Ground
+STR_UNDERGROUND_ROCKS :Rocks
+STR_UNDERGROUND_HEAVY_ROCKS :Hard rocks
+
+# underground special build types
+STR_UNDERGROUND_ESCALATOR :Escalator
+STR_UNDERGROUND_CONNECT :Connect
+STR_UNDERGROUND_PIPE :Pipe
+
+# underground tool tip
+STR_UNDERGROUND_TOOLTIP_ESCALATOR :{BLACK}Build escalator (underground station connect with surface)
+STR_UNDERGROUND_TOOLTIP_CONNECT :{BLACK}Build connect (underground track connect with surface)
+STR_UNDERGROUND_TOOLTIP_PIPE :{BLACK}Pipe (xm... anything...)
+
+# end underground string
diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt
index 17a9659fb..17784608c 100644
--- a/src/lang/english_AU.txt
+++ b/src/lang/english_AU.txt
@@ -2537,7 +2537,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Tramway
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Railway owner: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Local authority: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :None
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordinates: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordinates: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Built: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Station class: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Station type: {LTBLUE}{STRING}
diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt
index 4eeb8b8fb..9b4d4ba38 100644
--- a/src/lang/english_US.txt
+++ b/src/lang/english_US.txt
@@ -2621,7 +2621,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Streetca
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Railroad owner: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Local authority: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :None
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Co-ordinates: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Co-ordinates: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Built: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Station class: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Station type: {LTBLUE}{STRING}
diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt
index a515912d3..bd069f898 100644
--- a/src/lang/esperanto.txt
+++ b/src/lang/esperanto.txt
@@ -2167,7 +2167,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Posedant
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Posedanto de fervojo: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Lokaj estroj: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Neniu
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}TroviДќo: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}TroviДќo: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Kreite: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Stacioklaso: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Staciotipo: {LTBLUE}{STRING}
diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt
index c74293382..036d5c6d8 100644
--- a/src/lang/estonian.txt
+++ b/src/lang/estonian.txt
@@ -2635,7 +2635,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Trammite
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Raudtee omanik: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Kohalik omavalitsus: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :puudub
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinaadid: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinaadid: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Ehitatud: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Jaama liik: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Jaama rГјhm: {LTBLUE}{STRING}
diff --git a/src/lang/faroese.txt b/src/lang/faroese.txt
index 6ee2502fb..5911db23e 100644
--- a/src/lang/faroese.txt
+++ b/src/lang/faroese.txt
@@ -2305,7 +2305,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Sporvogn
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Jarnbreyta eigari: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Mynduleikar ГЎ staГ°num: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Eingin
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinatar: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinatar: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Bygt: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}StГёГ° klassi: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}StГёГ° slag: {LTBLUE}{STRING}
diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt
index ebf576540..400e9c189 100644
--- a/src/lang/finnish.txt
+++ b/src/lang/finnish.txt
@@ -2625,7 +2625,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Raitioti
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Rautatien omistaja: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Kunta: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Ei mitään
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinaatit: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinaatit: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Rakennettu: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Aseman luokka: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Aseman tyyppi: {LTBLUE}{STRING}
diff --git a/src/lang/french.txt b/src/lang/french.txt
index 226e28b9e..920d1d47e 100644
--- a/src/lang/french.txt
+++ b/src/lang/french.txt
@@ -2626,7 +2626,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}PropriГ©
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}PropriГ©taire des rails{NBSP}: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}MunicipalitГ©{NBSP}: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Aucune
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}CoordonnГ©es{NBSP}: {LTBLUE}{NUM} Г— {NUM} Г— {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}CoordonnГ©es{NBSP}: {LTBLUE}{NUM} Г— {NUM} Г— {NUM} Г— -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Construit le{NBSP}: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Type de station{NBSP}: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Type de station{NBSP}: {LTBLUE}{STRING}
diff --git a/src/lang/gaelic.txt b/src/lang/gaelic.txt
index 0c47be5d2..b14c2aa03 100644
--- a/src/lang/gaelic.txt
+++ b/src/lang/gaelic.txt
@@ -2795,7 +2795,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Seilbhea
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Seilbheadair na rathaid-iarainn: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Г™ghdarras ionadail: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Chan eil gin
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Ionad: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Ionad: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Air a thogail: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}SeГІrsa an stГЁisein: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}SeГІrsa an stГЁisein: {LTBLUE}{STRING}
diff --git a/src/lang/galician.txt b/src/lang/galician.txt
index f4b6779ed..7e34b6027 100644
--- a/src/lang/galician.txt
+++ b/src/lang/galician.txt
@@ -2616,7 +2616,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Propieta
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Propietario da vГa ferroviaria: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Autoridade local: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Ningunha
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenadas: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenadas: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}ConstruГdo: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Clase de estaciГіn: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tipo de estaciГіn: {LTBLUE}{STRING}
diff --git a/src/lang/german.txt b/src/lang/german.txt
index 1599e2b17..2c6e1777f 100644
--- a/src/lang/german.txt
+++ b/src/lang/german.txt
@@ -2602,7 +2602,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}StraГџen
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}GleiseigentГјmer: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Gehört zur Gemeinde: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Keine
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinaten: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinaten: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Errichtet am: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Stationsklasse: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Stationstyp: {LTBLUE}{STRING}
diff --git a/src/lang/greek.txt b/src/lang/greek.txt
index ba8956b94..a92bb49d5 100644
--- a/src/lang/greek.txt
+++ b/src/lang/greek.txt
@@ -2705,7 +2705,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}О™ОґО№Ої
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}О™ОґО№ОїОєП„О®П„О·П‚ П„ОїП… ПѓО№ОґО·ПЃОїОґПЃПЊОјОїП…: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}О¤ОїПЂО№ОєО® О±ПЃП‡О®: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :ОљО±ОјО№О¬
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}ОЈП…ОЅП„ОµП„О±ОіОјООЅОµП‚: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}ОЈП…ОЅП„ОµП„О±ОіОјООЅОµП‚: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}ОљО±П„О±ПѓОєОµП…О®: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}ОљО±П„О·ОіОїПЃОЇО± ПѓП„О±ОёОјОїПЌ: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}О¤ПЌПЂОїП‚ ПѓП„О±ОёОјОїПЌ: {LTBLUE}{STRING}
diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt
index 2f47bf3d6..053443904 100644
--- a/src/lang/hebrew.txt
+++ b/src/lang/hebrew.txt
@@ -2588,7 +2588,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}:Ч‘ЧўЧњ
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Ч‘ЧўЧњЧ™ ЧћЧЎЧ™ЧњЧЄ Ч”ЧЁЧ›Ч‘ЧЄ: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{LTBLUE}{STRING}{BLACK} :ЧЁЧ©Ч•ЧЄ ЧћЧ§Ч•ЧћЧ™ЧЄ
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :ЧђЧ™Чџ
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Ч§Ч•ЧђЧ•ЧЁЧ“Ч™Ч ЧЧ•ЧЄ: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Ч§Ч•ЧђЧ•ЧЁЧ“Ч™Ч ЧЧ•ЧЄ: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{LTBLUE}{DATE_LONG}{BLACK} : ЧЄЧђЧЁЧ™Чљ Ч‘Ч Ч™Ч”
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}{LTBLUE}{STRING}: ЧђЧ•Ч¤Ч™ Ч”ЧЄЧ—Ч Ч”
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK} {LTBLUE}{STRING}: ЧЎЧ•Ч’ Ч”ЧЄЧ—Ч Ч”
diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt
index ff9819d20..5afabd342 100644
--- a/src/lang/hungarian.txt
+++ b/src/lang/hungarian.txt
@@ -2688,7 +2688,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}A villam
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}A vasГєti pГЎlya tulajdonosa: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Helyi Г¶nkormГЎnyzat: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Nincs
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}KoordinГЎtГЎk: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}KoordinГЎtГЎk: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Г‰pГјlt: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}ГЃllomГЎs osztГЎlya: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}ГЃllomГЎs tГpusa: {LTBLUE}{STRING}
diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt
index 02ce07308..59010cf4e 100644
--- a/src/lang/icelandic.txt
+++ b/src/lang/icelandic.txt
@@ -2412,7 +2412,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Eigandi
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Eigandi jГЎrnbrautarspors: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Bæjaryfirvöld: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Enginn
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Hnit: {LTBLUE}{NUM}x{NUM}x{NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Hnit: {LTBLUE}{NUM}x{NUM}x{NUM}x-{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Byggt: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Tegund stöðvar: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tegund stöðvar: {LTBLUE}{STRING}
diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt
index 9ee4f619a..87f83c5b4 100644
--- a/src/lang/indonesian.txt
+++ b/src/lang/indonesian.txt
@@ -2586,7 +2586,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Pemilik
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Pemilik Rel Kereta: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Pemkot setempat: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Kosong
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinat: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinat: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Dibuat: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Kelas Stasiun: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tipe Stasiun: {LTBLUE}{STRING}
diff --git a/src/lang/irish.txt b/src/lang/irish.txt
index 1729a3fcb..da7e2b394 100644
--- a/src/lang/irish.txt
+++ b/src/lang/irish.txt
@@ -2562,7 +2562,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}ГљinГ©ir
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}ГљinГ©ir an iarnrГіid: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}ГљdarГЎs ГЎitiГєil: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Ceann ar bith
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}ComhordanГЎidГ: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}ComhordanГЎidГ: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}TГіgtha: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Aicme an stГЎisiГєin: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}CineГЎl stГЎisiГєin: {LTBLUE}{STRING}
diff --git a/src/lang/italian.txt b/src/lang/italian.txt
index 9855a0150..ee7a732b7 100644
--- a/src/lang/italian.txt
+++ b/src/lang/italian.txt
@@ -2655,7 +2655,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Propriet
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Proprietario ferrovia: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}AutoritГ locale: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Nessuna
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordinate: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordinate: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Costruito il: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Tipo stazione: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tipo stazione: {LTBLUE}{STRING}
diff --git a/src/lang/korean.txt b/src/lang/korean.txt
index 61cac93d6..c08c32d60 100644
--- a/src/lang/korean.txt
+++ b/src/lang/korean.txt
@@ -2626,7 +2626,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}м „м°»
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}мІ лЏ„ м†Њмњ мЈј: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}м§Ђм— л‹№кµ: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :м—†мќЊ
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}мўЊн‘њ: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}мўЊн‘њ: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}к±ґм„¤л‚ м§њ: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}м— л¶„лҐ: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}м— мў…лҐ: {LTBLUE}{STRING}
diff --git a/src/lang/latin.txt b/src/lang/latin.txt
index e1b73679c..07e66a8c6 100644
--- a/src/lang/latin.txt
+++ b/src/lang/latin.txt
@@ -2797,7 +2797,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Possesso
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Possessor ferriviae: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Auctoritas vicinalis: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Nulla
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordinatae: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordinatae: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Dies struendi: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Classis stationis: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Typus stationis: {LTBLUE}{STRING}
diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt
index bb7ee967d..007cc4612 100644
--- a/src/lang/latvian.txt
+++ b/src/lang/latvian.txt
@@ -2630,7 +2630,7 @@ STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Dzelzce
STR_LAND_AREA_INFORMATION_RAIL_OWNER.kas :{BLACK}DzelzceДјa Д«paЕЎniece: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}PaЕЎvaldД«ba: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Neviena
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}KoordinДЃtes: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}KoordinДЃtes: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}UzbЕ«vД“ts: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Stacijas klase: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Stacijas tips: {LTBLUE}{STRING}
diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt
index 930088071..e65f2e99f 100644
--- a/src/lang/lithuanian.txt
+++ b/src/lang/lithuanian.txt
@@ -2781,7 +2781,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Tramvaja
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}GeleЕѕinkelio savininkas: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Vietos valdЕѕia: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :NД—ra
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}KoordinatД—s: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}KoordinatД—s: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Pastatytas: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}StotelД—s rЕ«ЕЎis: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}StotelД—s tipas: {LTBLUE}{STRING}
diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt
index b465025b5..70e87c7c9 100644
--- a/src/lang/luxembourgish.txt
+++ b/src/lang/luxembourgish.txt
@@ -2624,7 +2624,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Tramschi
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}SchinnebesГ«tzer: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Gemeng: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Keng
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinaten: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinaten: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Gebaut: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Statiounsklass: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Statiounstyp: {LTBLUE}{STRING}
diff --git a/src/lang/malay.txt b/src/lang/malay.txt
index 8c8cf0746..bfd9f71ef 100644
--- a/src/lang/malay.txt
+++ b/src/lang/malay.txt
@@ -2309,7 +2309,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Pemilik
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Pemilik landasan keretapi: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Pihak berkuasa: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Tiada
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinat: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinat: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Dibina: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Kelas stesen: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Jenis stesen: {LTBLUE}{STRING}
diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt
index d282e1e54..06cf35a9d 100644
--- a/src/lang/norwegian_bokmal.txt
+++ b/src/lang/norwegian_bokmal.txt
@@ -2617,7 +2617,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Eier av
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Eier av jernbanespor: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Bystyret: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Ingen
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinater: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinater: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Bygget: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Stasjonstype: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Stasjonstype: {LTBLUE}{STRING}
diff --git a/src/lang/norwegian_nynorsk.txt b/src/lang/norwegian_nynorsk.txt
index 5eb0d5b8a..f46f2ff9e 100644
--- a/src/lang/norwegian_nynorsk.txt
+++ b/src/lang/norwegian_nynorsk.txt
@@ -2485,7 +2485,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Trikkesp
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Jernbaneskjene-eigar: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Bystyret: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Ingen
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinatar: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinatar: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Byggd: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Stasjonsklasse: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Stasjontype: {LTBLUE}{STRING}
diff --git a/src/lang/polish.txt b/src/lang/polish.txt
index cd265afca..bf103db8c 100644
--- a/src/lang/polish.txt
+++ b/src/lang/polish.txt
@@ -3005,7 +3005,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}WЕ‚aЕ›ci
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}WlaЕ›ciciel linii kolejowej: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Lokalne wЕ‚adze: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Brak
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}WspГіЕ‚rzД™dne: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}WspГіЕ‚rzД™dne: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Zbudowano: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Rodzaj stacji: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Typ stacji: {LTBLUE}{STRING}
diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt
index d39767aa4..232bba225 100644
--- a/src/lang/portuguese.txt
+++ b/src/lang/portuguese.txt
@@ -2611,7 +2611,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Dono da
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Dono da linha fГ©rrea: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Autoridade local: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Nenhum
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenadas: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenadas: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}ConstruГdo: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Tipo de estação: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tipo de estação: {LTBLUE}{STRING}
diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt
index cbb2f5a28..87930f421 100644
--- a/src/lang/romanian.txt
+++ b/src/lang/romanian.txt
@@ -2549,7 +2549,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Propriet
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Proprietar al cДѓii ferate: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Autoritatea localДѓ: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Nici una
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordonate: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordonate: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Data construcЕЈiei: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Clasa staЕЈiei: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tip staЕЈie: {LTBLUE}{STRING}
diff --git a/src/lang/russian.txt b/src/lang/russian.txt
index 266fdad22..ea9e37b42 100644
--- a/src/lang/russian.txt
+++ b/src/lang/russian.txt
@@ -588,6 +588,18 @@ STR_LANDSCAPING_MENU_PLANT_TREES :Высадка
STR_LANDSCAPING_MENU_PLACE_SIGN :Поставить метку
############ range ends here
+############ range for underground menu starts
+STR_LANDSCAPING_MENU_UNDERGROUND :Спец. конструкции
+STR_LANDSCAPING_MENU_LAYER_1 :Поверхность
+STR_LANDSCAPING_MENU_LAYER_2 :Подземелье (-1)
+STR_LANDSCAPING_MENU_LAYER_3 :Подземелье (-2)
+STR_LANDSCAPING_MENU_LAYER_4 :Подземелье (-3)
+STR_LANDSCAPING_MENU_LAYER_5 :Подземелье (-4)
+STR_LANDSCAPING_MENU_LAYER_6 :Подземелье (-5)
+STR_LANDSCAPING_MENU_LAYER_7 :Подземелье (-6)
+STR_LANDSCAPING_MENU_LAYER_8 :Подземелье (-7)
+############ range ends here
+
############ range for music menu starts
STR_TOOLBAR_SOUND_MUSIC :Звук/музыка
############ range ends here
@@ -2805,7 +2817,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Влад
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Владелец ж/д пути: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Администрация: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Нет
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Координаты: {LTBLUE}{NUM} × {NUM} × {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Координаты: {LTBLUE}{NUM} × {NUM} × {NUM} × -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Построено: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Класс станции: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Тип станции: {LTBLUE}{STRING}
@@ -5378,3 +5390,35 @@ STR_PLANE :{BLACK}{PLANE}
STR_SHIP :{BLACK}{SHIP}
STR_TOOLBAR_RAILTYPE_VELOCITY :{STRING} ({VELOCITY})
+
+# underground
+
+# error
+STR_ERROR_UNDERGROUND_CAN_T_BUILD_UNDER_GROUND :{WHITE}Не может строиться под землей
+STR_ERROR_UNDERGROUND_CAN_T_BUILD_OVER_GROUND :{WHITE}Не может строиться на поверхности
+STR_ERROR_UNDERGROUND_CAN_T_TERRAFORM :{WHITE}Рзменение ландшафта недоступно
+STR_ERROR_UNDERGROUND_CAN_T_BUILD_PART :{WHITE}Нельзя построить эскалатор...
+STR_ERROR_UNDERGROUND_CAN_T_BUILD_TOP_PART :{WHITE}Нельзя построить верхнюю часть эскалатора...
+STR_ERROR_UNDERGROUND_CAN_T_BUILD_BOTTOM_PART :{WHITE}Нельзя построить нижнюю часть эскалатора...
+
+# menus
+STR_UNDERGROUND_LAYER_COUNT :{BLACK}Количество слоев
+STR_UNDERGROUND_BUILD :{WHITE}Подземелье
+
+# underground land types
+STR_UNDERGROUND_FLAT :Пещера
+STR_UNDERGROUND_SOLID :Грунт
+STR_UNDERGROUND_ROCKS :Скалы
+STR_UNDERGROUND_HEAVY_ROCKS :Твердые породы
+
+# underground special build types
+STR_UNDERGROUND_ESCALATOR :Рскалатор
+STR_UNDERGROUND_CONNECT :Соединение
+STR_UNDERGROUND_PIPE :РўСЂСѓР±С‹
+
+# underground tool tip
+STR_UNDERGROUND_TOOLTIP_ESCALATOR :{BLACK}Постройка эскалатора (связь подземной станции с поверхностью)
+STR_UNDERGROUND_TOOLTIP_CONNECT :{BLACK}Постройка подъема (подземные рельсы выходят наружу)
+STR_UNDERGROUND_TOOLTIP_PIPE :{BLACK}Трубы (хм... что-то...)
+
+# end underground string
diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt
index 839269d69..dd13f5d23 100644
--- a/src/lang/serbian.txt
+++ b/src/lang/serbian.txt
@@ -2770,7 +2770,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Vlasnik
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Vlasnik ЕѕelezniДЌke pruge: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Lokalna vlast: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Nema
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinate: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinate: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}SagraД‘eno: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Klasa stanice: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Vrsta stanice: {LTBLUE}{STRING}
diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt
index d3aa2d98b..e966953a5 100644
--- a/src/lang/simplified_chinese.txt
+++ b/src/lang/simplified_chinese.txt
@@ -2625,7 +2625,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}жњ‰иЅЁ
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}й“Ѓи·ЇеЅ’е±ћпјљ{LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}ењ°ж–№ж”їеєњпјљ{LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :жІЎжњ‰
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}еќђж ‡пјљ {LTBLUE}{NUM} Г— {NUM} Г— {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}еќђж ‡пјљ {LTBLUE}{NUM} Г— {NUM} Г— {NUM} Г— -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}е»єйЂ ж—¶й—ґпјљ{LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}车站分类: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}иЅ¦з«™з±»ећ‹: {LTBLUE}{STRING}
diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt
index a4a351ac7..10def8090 100644
--- a/src/lang/slovak.txt
+++ b/src/lang/slovak.txt
@@ -2693,7 +2693,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}VlastnГ
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}VlastnГk Еѕeleznice: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Miestna sprГЎva: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :NeznГЎme
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}SГєradnice: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}SГєradnice: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}PostavenГ©: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Trieda stanice: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Typ stanice: {LTBLUE}{STRING}
diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt
index f07f071ff..bcb8cb21d 100644
--- a/src/lang/slovenian.txt
+++ b/src/lang/slovenian.txt
@@ -2718,7 +2718,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Lastnik
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Lastnik Еѕeleznice: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Lokalna oblast: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Brez
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinate: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinate: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Zgrajeno: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Razred postaje: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Vrsta postaje: {LTBLUE}{STRING}
diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt
index efe012ed1..d771b51ec 100644
--- a/src/lang/spanish.txt
+++ b/src/lang/spanish.txt
@@ -2626,7 +2626,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Propieta
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Propietario del ferrocarril: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Autoridad local: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Ninguna
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenadas: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenadas: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Construido: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Clase de estaciГіn: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tipo de estaciГіn: {LTBLUE}{STRING}
diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt
index 5571c32f5..7efa57540 100644
--- a/src/lang/spanish_MX.txt
+++ b/src/lang/spanish_MX.txt
@@ -2626,7 +2626,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Propieta
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Propietario del ferrocarril: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Ayuntamiento: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Ninguno
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenadas: {LTBLUE}{NUM}Г—{NUM}Г—{NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Coordenadas: {LTBLUE}{NUM}Г—{NUM}Г—{NUM}Г—-{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Construido: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Clase de estaciГіn: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tipo de estaciГіn: {LTBLUE}{STRING}
diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt
index 23f557ec0..a50b0a966 100644
--- a/src/lang/swedish.txt
+++ b/src/lang/swedish.txt
@@ -2625,7 +2625,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Spårvä
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Järnvägens ägare: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Lokala myndigheter: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Ingen
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinater: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinater: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Byggt: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Stationsklass: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Stationstyp: {LTBLUE}{STRING}
diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt
index 0727649df..9de395f85 100644
--- a/src/lang/tamil.txt
+++ b/src/lang/tamil.txt
@@ -2301,7 +2301,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}а®џаЇЌ
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}இரயில்வே உரிமையாளர்: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}а®Ёа®•а®°а®ѕа®џаЇЌа®ља®ї: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :а®’а®©аЇЌа®±аЇЃа®®а®їа®ІаЇЌа®ІаЇ€
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}அச்சுத் தூரங்கள்: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}அச்சுத் தூரங்கள்: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}கட்டப்பட்டது: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}நிலையத்தின் பிரிவு: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}நிலையத்தின் வகை: {LTBLUE}{STRING}
diff --git a/src/lang/thai.txt b/src/lang/thai.txt
index 258be30a1..917bd2e6b 100644
--- a/src/lang/thai.txt
+++ b/src/lang/thai.txt
@@ -2511,7 +2511,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}аёњаё№
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}ผู้ครаёаёљаё„аёЈаёаё‡аё—างรถไฟ: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}ขึ้นตรงกับผู้ดูแลในท้аёаё‡аё–аёґа№€аё™: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :ไม่มี
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}аё•аёіа№Ѓаё«аё™а№€аё‡: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}аё•аёіа№Ѓаё«аё™а№€аё‡: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}สร้างเมื่аё: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}аё›аёЈаё°а№Ђаё аё—аё‚аёаё‡аёЄаё–аёІаё™аёµ: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}аёЈаё№аё›а№Ѓаёљаёљаё‚аёаё‡аёЄаё–аёІаё™аёµ: {LTBLUE}{STRING}
diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt
index d530adbad..7eeeab4c9 100644
--- a/src/lang/traditional_chinese.txt
+++ b/src/lang/traditional_chinese.txt
@@ -2565,7 +2565,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}й›»и»Љ
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}йђµи·Їж‰Ђжњ‰иЂ…пјљ{LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}ењ°ж–№ж”їеєњпјљ{LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :з„Ў
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}еє§жЁ™пјљ{LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}еє§жЁ™пјљ{LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}е»єж–јпјљ{LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}и»Љз«™йўЁж јпјљ{LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}и»Љз«™зЁ®йЎћпјљ{LTBLUE}{STRING}
diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt
index 9d5129571..a9011d5ee 100644
--- a/src/lang/turkish.txt
+++ b/src/lang/turkish.txt
@@ -2626,7 +2626,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Tramvay
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Demiryolu sahibi: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Belediyesi: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Hiçbiri
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinatlar: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Koordinatlar: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}YapД±m: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Д°stasyon sД±nД±fД±: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Д°stasyon tГјrГј: {LTBLUE}{STRING}
diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt
index 012a569f9..64736e421 100644
--- a/src/lang/ukrainian.txt
+++ b/src/lang/ukrainian.txt
@@ -2756,7 +2756,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Влас
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Власник залізниці: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Місцева влада: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Немає
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Координати: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Координати: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Р С–Рє РІРёРїСѓСЃРєСѓ: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Клас станції: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Тип станції: {LTBLUE}{STRING}
diff --git a/src/lang/unfinished/persian.txt b/src/lang/unfinished/persian.txt
index 2865d4e46..69e48496e 100644
--- a/src/lang/unfinished/persian.txt
+++ b/src/lang/unfinished/persian.txt
@@ -2266,7 +2266,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Щ…Ш§Щ„Ъ©
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Щ…Ш§Щ„Ъ© Ш±ЫЊЩ„ Ш±Ш§Щ‡ ШўЩ‡Щ†: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}ЩЃШ±Щ…Ш§Щ†ШЇШ§Ш± Щ…ШЩ„ЫЊ: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Щ‡ЫЊЪ†Ъ©ШЇШ§Щ…
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Щ…Ш®ШЄШµШ§ШЄ: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Щ…Ш®ШЄШµШ§ШЄ: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}ШіШ§Ш®ШЄЩ‡ ШґШЇЩ‡ ШЇШ±: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Ъ©Щ„Ш§Ші Ш§ЫЊШіШЄЪЇШ§Щ‡: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Щ†Щ€Ш№ Ш§ЫЊШіШЄЪЇШ§Щ‡: {LTBLUE}{STRING}
diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt
index 1ce6b766f..7465f508f 100644
--- a/src/lang/vietnamese.txt
+++ b/src/lang/vietnamese.txt
@@ -2615,7 +2615,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Chủ đ
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Chủ đường ray: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Thuб»™c vб»Ѓ Д‘б»‹a phЖ°ЖЎng: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :KhГґng
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}ToбєЎ Д‘б»™: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}ToбєЎ Д‘б»™: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}XГўy lГєc: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}LoбєЎi ga,bбєїn: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Kiб»ѓu ga,bбєїn: {LTBLUE}{STRING}
diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt
index cd5a116d3..29d821c35 100644
--- a/src/lang/welsh.txt
+++ b/src/lang/welsh.txt
@@ -2570,7 +2570,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Perchenn
STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Perchennog rheilffordd: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Awdurdod Lleol: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Dim
-STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Cyfeirnodau: {LTBLUE}{NUM} x {NUM} x {NUM} ({STRING})
+STR_LAND_AREA_INFORMATION_LANDINFO_COORDS :{BLACK}Cyfeirnodau: {LTBLUE}{NUM} x {NUM} x {NUM} x -{NUM} ({STRING})
STR_LAND_AREA_INFORMATION_BUILD_DATE :{BLACK}Adeiladwyd: {LTBLUE}{DATE_LONG}
STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Dosbarth gorsaf: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Math gorsaf: {LTBLUE}{STRING}
diff --git a/src/layer.cpp b/src/layer.cpp
new file mode 100644
index 000000000..aab234e53
--- /dev/null
+++ b/src/layer.cpp
@@ -0,0 +1,136 @@
+/* $Id: map.cpp 23740 2012-01-03 21:32:51Z $ */
+/*
+
+Это модуль, для возможности полноценной игры в трех измерениях
+(подземелье, метро, итп.)
+
+
+Плоское игровое поле выглядит примерно так:
+*-----------*
+| |
+| |
+| |
+*-----------*
+
+Мысленно нарежем его на одинаковые части:
+*---*---*---*
+| | | |
+| | | |
+| | | |
+*---*---*---*
+
+Мысленно соберем части в вертикальную стопочку:
+*---*
+| *---*
+| | *---*
+| | | |
+* | | |
+ * | |
+ *---*
+
+Таким образом имея плоскую карту мы описываем 3д пространство.
+
+Для простоты вся карта делится только по оси Y (разрезы параллельны оси X)
+Деление происходит на 1, 2, 4, или 8 кусочков.
+
+Например было выбрано поле 64х64, с 4-мя слоями:
+Создается карта 64х256, подразумевается, что:
+
+ X Y
+ верхний слой 0--63 0--63
+ второй слой 0--63 64--127
+ третий слой 0--63 128--191
+ четвертый слой 0--63 192--255
+
+
+Обычная карта
+ MapSizeX х (MapSizeY)
+
+Представление в виде слоев
+ LayerSizeX x (LayerSizeY x LayerCount)
+
+Иными словами игровые координаты "плоского" пространства
+
+ MapX, MapY, MapZ
+
+переходят в координаты нового "3д" пространства
+
+ // Константы
+ LayerCount = число кусочков... (1, или 2, или 4, итд.)
+ LayerSizeZ = сдвиг слоя по вертикали (например 1)
+
+ // Аксиомы
+ MapSizeX == LayerSizeX
+ MapSizeY == LayerSizeY * LayerCount
+
+ // Расчет координат
+ LayerIndex = MapY / LayerSizeY
+
+ WorldX = MapX
+ WorldY = MapY - LayerIndex*LayerSizeY
+ WorldZ = MapZ + LayerIndex*LayerSizeZ
+*/
+
+/** @file map.cpp Base functions related to the map and distances on them. */
+
+#include "stdafx.h"
+#include "debug.h"
+#include "core/alloc_func.hpp"
+#include "void_map.h"
+#include "layer_func.h"
+#include "layer_type.h"
+#include "landscape.h"
+
+#if defined(_MSC_VER)
+/* Why the hell is that not in all MSVC headers?? */
+extern "C" _CRTIMP void __cdecl _assert(void *, void *, unsigned);
+#endif
+
+uint _layer_size_x; ///< Size of the map along the X
+uint _layer_size_y; ///< Size of the map along the Y
+uint _layer_count; ///< The number of tiles on the map
+uint _layer_count_log;
+uint _layer_size; ///< Layer size (sizeX * sizeY)
+
+void InstallLayerSystem(uint size_x, uint size_y, uint layer_count)
+{
+ if (!IsInsideMM(layer_count, MIN_LAYER_COUNT, MAX_LAYER_COUNT+1))
+ error("invalid layer count");
+
+ _layer_size_x = size_x;
+ _layer_size_y = size_y;
+ _layer_size = size_x * size_y;
+ _layer_count = layer_count;
+ _layer_count_log = FindFirstBit(layer_count);
+}
+
+void FixUndergroundHeights()
+{
+ uint width = MapSizeX();
+ uint height = MapSizeY();
+
+ /* Layer correct */
+ for (uint row = 0; (uint)row < height; row++) {
+
+ /* Граница между слоями */
+ if (!(row % LayerSizeY()))
+ for (uint x = 0; x < width; x++) MakeVoid(width * row + x);
+
+ for (uint col = 0; (uint)col < width; col++) {
+ uint tile = TileXY(row, col);
+ if (IsUnderground(tile))
+ SetTileHeight(tile, 0);
+ }
+ }
+}
+
+uint8 calculateLayer(const Viewport *vp)
+{
+ // Функция ViewportDoDraw вызывается несколько раз с разными параметрами
+ // Нужно же найти только один слой.
+ // Опираемся на вьюпорт.
+
+ Point pt = InverseRemapCoords(vp->virtual_left+(vp->virtual_width >> 1),vp->virtual_top+(vp->virtual_height >> 1));
+ TileIndex center = TileVirtXY(pt.x, pt.y);
+ return LayerIndex(center);
+}
diff --git a/src/layer_func.h b/src/layer_func.h
new file mode 100644
index 000000000..05022163a
--- /dev/null
+++ b/src/layer_func.h
@@ -0,0 +1,102 @@
+/* $Id: layer_func.h 2012-09-07 18:11:11 constructor $ */
+
+/*
+* Подробое описание см. в layer.cpp
+*/
+
+/** @file layer_func.h Functions related to layer in maps. */
+
+#ifndef LAYER_FUNC_H
+#define LAYER_FUNC_H
+
+#include "map_func.h"
+#include "viewport_type.h"
+
+/*
+*
+* Инициализация "подземелий"
+* Количество слоев "1" равносильно игре без "подземелий"
+*
+*/
+void InstallLayerSystem(uint size_x, uint size_y, uint layer_count);
+
+/* Корректировка "подземных" слоев
+* (в будущем слои могут менять высоты -- в пределах соседей) */
+void FixUndergroundHeights();
+
+#define UNDERGROUND_COST_MULTIPLIER(tile) (1 + 100 * (TileHeight(TopTile(tile))-TileHeight(tile)-LayerIndex(tile)))
+
+#define FOR_ALL_LAYERS(var) for (uint var = 0; var < LayerCount(); var++)
+
+/**
+ * Get the X component of a tile
+ * @param tile the tile to get the X component of
+ * @return the X component
+ */
+static inline uint LayerX(TileIndex tile)
+{
+ return tile & LayerMaxX();
+}
+
+/**
+ * Get the Y component of a tile
+ * @param tile the tile to get the Y component of
+ * @return the Y component
+ */
+static inline uint LayerY(TileIndex tile)
+{
+ return (tile >> MapLogX()) & LayerMaxY();
+}
+
+static inline uint LayerIndex(TileIndex tile)
+{
+ return (tile >> MapLogX()) / LayerSizeY();
+}
+
+static inline bool IsUnderground(TileIndex tile)
+{
+ return LayerIndex(tile) != 0;
+}
+
+/**
+* Размер слоя.
+* Можно прибавить к клетке, чтобы получить клетку ниже
+*/
+static inline uint LayerSize()
+{
+ extern uint _layer_size;
+ return _layer_size;
+}
+
+/**
+ * Ищем клетку поверхности для данной (самую верхнюю клетку)
+ * @param tile the tile to get the Y component of
+ * @return the Y component
+ */
+static inline uint TopTile(TileIndex tile)
+{
+ uint layer = LayerIndex(tile);
+ return (tile - layer * LayerSize());
+}
+
+/* Определить верхняя ли клеточка очень просто */
+static inline bool IsTopTile(TileIndex tile)
+{
+ return (tile < LayerSize());
+}
+
+/* Ищет клетку над данной. (Для самой верхней вернет нижнюю??)
+*/
+static inline uint UpTile(TileIndex tile)
+{
+ return TILE_MASK(tile - LayerSize());
+}
+
+/* Ищет клетку под данной. (Для самой нижней вернет верхнюю??)
+*/
+static inline uint DownTile(TileIndex tile)
+{
+ return TILE_MASK(tile + LayerSize());
+}
+
+#endif /* LAYER_FUNC_H */
diff --git a/src/layer_gui.h b/src/layer_gui.h
new file mode 100644
index 000000000..7b791b7e9
--- /dev/null
+++ b/src/layer_gui.h
@@ -0,0 +1,17 @@
+/* $Id: layer_func.h 2012-09-07 18:11:11 constructor $ */
+
+/*
+* Подробое описание см. в layer.cpp
+*/
+
+/** @file layer_gui.h Functions for visualisation map with support layers */
+
+#ifndef LAYER_GUI_H
+#define LAYER_GUI_H
+
+#include "layer_func.h"
+#include "viewport_type.h"
+
+uint8 calculateLayer(const Viewport *vp);
+
+#endif /* LAYER_GUI_H */
diff --git a/src/layer_type.h b/src/layer_type.h
new file mode 100644
index 000000000..53eafdde6
--- /dev/null
+++ b/src/layer_type.h
@@ -0,0 +1,22 @@
+/* $Id: layer_type.h 21493 2012-09-11 2:21:53Z constructor $ */
+
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/** @file layer_type.h Types related to maps. */
+
+#ifndef LAYER_TYPE_H
+#define LAYER_TYPE_H
+
+/** Minimal and maximal layer counts */
+static const uint MIN_LAYER_COUNT_BITS = 0; ///< Minimal size of map is equal to 2 ^ MIN_LAYER_SIZE_BITS
+static const uint MAX_LAYER_COUNT_BITS = 3; ///< Maximal size of map is equal to 2 ^ MAX_LAYER_SIZE_BITS
+static const uint MIN_LAYER_COUNT = 1 << MIN_LAYER_COUNT_BITS; ///< Minimal layer count = 1
+static const uint MAX_LAYER_COUNT = 1 << MAX_LAYER_COUNT_BITS; ///< Maximal layer count = 8
+
+
+#endif /* LAYER_TYPE_H */
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 5877fb938..7d3babb21 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -33,6 +33,9 @@
#include "guitimer_func.h"
#include "error.h"
#include "news_gui.h"
+#include "gfx_func.h"
+#include "layer_gui.h"
+#include "landscape.h"
#include "saveload/saveload.h"
@@ -104,7 +107,7 @@ bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyl
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
w->SetDirty();
- if (w->IsWidgetLowered(widget)) {
+ if (w->IsWidgetLowered(widget) && mode == _thd.place_mode) {
ResetObjectToPlace();
return false;
}
@@ -199,6 +202,22 @@ void ZoomInOrOutToCursorWindow(bool in, Window *w)
}
}
+void LayerUpOrDownToCursorWindow(bool in, Window *w)
+{
+ assert(w != NULL);
+
+ if (_game_mode != GM_MENU) {
+ int layer = calculateLayer(w->viewport) + (in ? -1 : 1);
+ if ((layer < 0) || (layer >= LayerCount())) return;
+
+ Point pt = RemapCoords(0, (in ? -1 : 1) * LayerSizeY() * TILE_SIZE, 0);
+ w->viewport->dest_scrollpos_x += pt.x;
+ w->viewport->dest_scrollpos_y += pt.y;
+ w->InvalidateData();
+
+ }
+}
+
void FixTitleGameZoom()
{
if (_game_mode != GM_MENU) return;
@@ -456,7 +475,11 @@ struct MainWindow : Window
void OnMouseWheel(int wheel) override
{
if (_settings_client.gui.scrollwheel_scrolling != 2) {
- ZoomInOrOutToCursorWindow(wheel < 0, this);
+ if (_ctrl_pressed) {
+ LayerUpOrDownToCursorWindow(wheel < 0, this);
+ } else {
+ ZoomInOrOutToCursorWindow(wheel < 0, this);
+ }
}
}
diff --git a/src/map.cpp b/src/map.cpp
index 679c445ee..9ad1077c9 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -11,6 +11,7 @@
#include "debug.h"
#include "core/alloc_func.hpp"
#include "water_map.h"
+#include "layer_func.h"
#include "string_func.h"
#include "safeguards.h"
@@ -36,7 +37,7 @@ TileExtended *_me = nullptr; ///< Extended Tiles of the map
* @param size_x the width of the map along the NE/SW edge
* @param size_y the 'height' of the map along the SE/NW edge
*/
-void AllocateMap(uint size_x, uint size_y)
+void AllocateMap(uint size_x, uint size_y, uint layer_count)
{
/* Make sure that the map size is within the limits and that
* size of both axes is a power of 2. */
@@ -47,6 +48,10 @@ void AllocateMap(uint size_x, uint size_y)
error("Invalid map size");
}
+ /* Поскольку слои часть карты, включаем их здесь */
+ InstallLayerSystem(size_x, size_y, layer_count);
+ size_y *= layer_count;
+
DEBUG(map, 1, "Allocating map of size %dx%d", size_x, size_y);
_map_log_x = FindFirstBit(size_x);
@@ -268,6 +273,7 @@ bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, v
/* If tile test is not successful, get one tile up,
* ready for a test in first circle around center tile */
*tile = TileAddByDir(*tile, DIR_N);
+ if (size / 2 == 0) return false;
return CircularTileSearch(tile, size / 2, 1, 1, proc, user_data);
} else {
return CircularTileSearch(tile, size / 2, 0, 0, proc, user_data);
diff --git a/src/map_func.h b/src/map_func.h
index b02ba5777..f0c3edc41 100644
--- a/src/map_func.h
+++ b/src/map_func.h
@@ -41,7 +41,7 @@ extern Tile *_m;
*/
extern TileExtended *_me;
-void AllocateMap(uint size_x, uint size_y);
+void AllocateMap(uint size_x, uint size_y, uint layer_count);
/**
* Logarithm of the map size along the X side.
@@ -113,6 +113,64 @@ static inline uint MapMaxY()
return MapSizeY() - 1;
}
+/**
+ * Get the size of the layer along the X
+ * @return the number of tiles along the X of the layer
+ */
+static inline uint LayerSizeX()
+{
+ extern uint _map_size_x;
+ return _map_size_x;
+}
+
+/**
+ * Get the size of the layer along the Y
+ * @return the number of tiles along the Y of the layer
+ */
+static inline uint LayerSizeY()
+{
+ extern uint _layer_size_y;
+ return _layer_size_y;
+}
+
+/**
+ * Gets the maximum X coordinate within the map, including MP_VOID
+ * @return the maximum X coordinate
+ */
+static inline uint LayerMaxX()
+{
+ return LayerSizeX() - 1;
+}
+
+/**
+ * Gets the maximum Y coordinate within the map, including MP_VOID
+ * @return the maximum Y coordinate
+ */
+static inline uint LayerMaxY()
+{
+ return LayerSizeY() - 1;
+}
+
+/**
+ * Get the layer counts
+ * @return the number of layers
+ */
+static inline uint LayerCount()
+{
+ extern uint _layer_count;
+ return _layer_count;
+}
+
+/**
+ * Get the layer counts
+ * @return the number of layers
+ */
+static inline uint LayerCountLog()
+{
+ extern uint _layer_count_log;
+ return _layer_count_log;
+}
+
/**
* Scales the given value by the map size, where the given value is
* for a 256 by 256 map.
@@ -123,7 +181,7 @@ static inline uint ScaleByMapSize(uint n)
{
/* Subtract 12 from shift in order to prevent integer overflow
* for large values of n. It's safe since the min mapsize is 64x64. */
- return CeilDiv(n << (MapLogX() + MapLogY() - 12), 1 << 4);
+ return CeilDiv(n << (MapLogX() + MapLogY() - LayerCountLog() - 12), 1 << 4);
}
diff --git a/src/misc.cpp b/src/misc.cpp
index dcb04fa02..0e2821630 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -8,6 +8,7 @@
/** @file misc.cpp Misc functions that shouldn't be here. */
#include "stdafx.h"
+#include "layer_func.h"
#include "landscape.h"
#include "news_func.h"
#include "ai/ai.hpp"
@@ -61,7 +62,7 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
* related to the new game we're about to start/load. */
UnInitWindowSystem();
- AllocateMap(size_x, size_y);
+ AllocateMap(size_x, size_y, 1 << _settings_game.game_creation.layers);
_pause_mode = PM_UNPAUSED;
_fast_forward = 0;
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index ff2fc3a23..74b59d294 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -216,10 +216,11 @@ public:
/* Location */
char tmp[16];
seprintf(tmp, lastof(tmp), "0x%.4X", tile);
- SetDParam(0, TileX(tile));
- SetDParam(1, TileY(tile));
+ SetDParam(0, LayerX(tile));
+ SetDParam(1, LayerY(tile));
SetDParam(2, GetTileZ(tile));
- SetDParamStr(3, tmp);
+ SetDParam(3, LayerIndex(tile));
+ SetDParamStr(4, tmp);
GetString(this->landinfo_data[line_nr], STR_LAND_AREA_INFORMATION_LANDINFO_COORDS, lastof(this->landinfo_data[line_nr]));
line_nr++;
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index 3fb61d647..3b08cc637 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -695,7 +695,7 @@ static bool TryBuildLightHouse()
*/
static bool TryBuildTransmitter()
{
- TileIndex tile = RandomTile();
+ TileIndex tile = TopTile(RandomTile());
int h;
if (IsTileType(tile, MP_CLEAR) && IsTileFlat(tile, &h) && h >= 4 && !IsBridgeAbove(tile)) {
TileIndex t = tile;
@@ -759,7 +759,7 @@ void GenerateObjects()
default:
uint8 view = RandomRange(spec->views);
- if (CmdBuildObject(RandomTile(), DC_EXEC | DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, i, view, nullptr).Succeeded()) amount--;
+ if (CmdBuildObject(TopTile(RandomTile()), DC_EXEC | DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, i, view, nullptr).Succeeded()) amount--;
break;
}
}
diff --git a/src/rail.h b/src/rail.h
index d9121d545..ee27f6e17 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -158,7 +158,7 @@ public:
SpriteID signals[SIGTYPE_END][2][2]; ///< signal GUI sprites (type, variant, state)
} gui_sprites;
- struct {
+ struct Cursor {
CursorID rail_ns; ///< Cursor for building rail in N-S direction
CursorID rail_swne; ///< Cursor for building rail in X direction
CursorID rail_ew; ///< Cursor for building rail in E-W direction
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 162fe9779..33cf2b245 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -533,12 +533,12 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u
uint num_new_road_pieces = (road != ROAD_NONE) ? 2 - CountBits(road) : 0;
if (num_new_road_pieces > 0) {
- cost.AddCost(num_new_road_pieces * RoadBuildCost(roadtype_road));
+ cost.AddCost(num_new_road_pieces * RoadBuildCost(roadtype_road) * UNDERGROUND_COST_MULTIPLIER(tile));
}
uint num_new_tram_pieces = (tram != ROAD_NONE) ? 2 - CountBits(tram) : 0;
if (num_new_tram_pieces > 0) {
- cost.AddCost(num_new_tram_pieces * RoadBuildCost(roadtype_tram));
+ cost.AddCost(num_new_tram_pieces * RoadBuildCost(roadtype_tram) * UNDERGROUND_COST_MULTIPLIER(tile));
}
if (flags & DC_EXEC) {
@@ -601,7 +601,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u
YapfNotifyTrackLayoutChange(tile, track);
}
- cost.AddCost(RailBuildCost(railtype));
+ cost.AddCost(RailBuildCost(railtype) * UNDERGROUND_COST_MULTIPLIER(tile));
return cost;
}
@@ -645,7 +645,7 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1,
if (ret.Failed()) return ret;
}
- cost.AddCost(RailClearCost(GetRailType(tile)));
+ cost.AddCost(RailClearCost(GetRailType(tile)) * UNDERGROUND_COST_MULTIPLIER(tile));
if (flags & DC_EXEC) {
if (HasReservedTracks(tile, trackbit)) {
@@ -679,7 +679,7 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1,
if ((present & trackbit) == 0) return_cmd_error(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK);
if (present == (TRACK_BIT_X | TRACK_BIT_Y)) crossing = true;
- cost.AddCost(RailClearCost(GetRailType(tile)));
+ cost.AddCost(RailClearCost(GetRailType(tile)) * UNDERGROUND_COST_MULTIPLIER(tile));
/* Charge extra to remove signals on the track, if they are there */
if (HasSignalOnTrack(tile, track)) {
@@ -994,7 +994,7 @@ CommandCost CmdBuildTrainDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, u
if (!_settings_game.construction.build_on_slopes || !CanBuildDepotByTileh(dir, tileh)) {
return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED);
}
- cost.AddCost(_price[PR_BUILD_FOUNDATION]);
+ cost.AddCost(_price[PR_BUILD_FOUNDATION] * UNDERGROUND_COST_MULTIPLIER(tile));
}
cost.AddCost(DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR));
@@ -1019,8 +1019,8 @@ CommandCost CmdBuildTrainDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, u
YapfNotifyTrackLayoutChange(tile, DiagDirToDiagTrack(dir));
}
- cost.AddCost(_price[PR_BUILD_DEPOT_TRAIN]);
- cost.AddCost(RailBuildCost(railtype));
+ cost.AddCost(_price[PR_BUILD_DEPOT_TRAIN] * UNDERGROUND_COST_MULTIPLIER(tile));
+ cost.AddCost(RailBuildCost(railtype) * UNDERGROUND_COST_MULTIPLIER(tile));
return cost;
}
@@ -1672,7 +1672,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
InvalidateWindowData(WC_BUILD_VEHICLE, tile);
}
found_convertible_track = true;
- cost.AddCost(RailConvertCost(type, totype));
+ cost.AddCost(RailConvertCost(type, totype) * UNDERGROUND_COST_MULTIPLIER(tile));
break;
default: // RAIL_TILE_NORMAL, RAIL_TILE_SIGNALS
@@ -1684,7 +1684,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
}
}
found_convertible_track = true;
- cost.AddCost(RailConvertCost(type, totype) * CountBits(GetTrackBits(tile)));
+ cost.AddCost(RailConvertCost(type, totype) * CountBits(GetTrackBits(tile)) * UNDERGROUND_COST_MULTIPLIER(tile));
break;
}
break;
@@ -1747,7 +1747,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
}
found_convertible_track = true;
- cost.AddCost((GetTunnelBridgeLength(tile, endtile) + 2) * RailConvertCost(type, totype));
+ cost.AddCost((GetTunnelBridgeLength(tile, endtile) + 2) * RailConvertCost(type, totype) * UNDERGROUND_COST_MULTIPLIER(tile));
break;
}
@@ -1758,7 +1758,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
}
found_convertible_track = true;
- cost.AddCost(RailConvertCost(type, totype));
+ cost.AddCost(RailConvertCost(type, totype) * UNDERGROUND_COST_MULTIPLIER(tile));
break;
}
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index b8aee88d6..b3921712e 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -402,7 +402,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec
}
} else {
assert(IsDriveThroughStopTile(tile));
- cost.AddCost(RoadClearCost(existing_rt) * 2);
+ cost.AddCost(RoadClearCost(existing_rt) * 2 * UNDERGROUND_COST_MULTIPLIER(tile));
if (flags & DC_EXEC) {
/* A full diagonal road tile has two road bits. */
UpdateCompanyRoadInfrastructure(existing_rt, GetRoadOwner(tile, rtt), -2);
@@ -883,7 +883,7 @@ do_clear:;
/* Count pieces */
CountBits(pieces);
- cost.AddCost(num_pieces * RoadBuildCost(rt));
+ cost.AddCost(num_pieces * RoadBuildCost(rt) * UNDERGROUND_COST_MULTIPLIER(tile));
if (flags & DC_EXEC) {
switch (GetTileType(tile)) {
@@ -1197,7 +1197,7 @@ CommandCost CmdBuildRoadDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
MarkTileDirtyByTile(tile);
MakeDefaultName(dep);
}
- cost.AddCost(_price[PR_BUILD_DEPOT_ROAD]);
+ cost.AddCost(_price[PR_BUILD_DEPOT_ROAD] * UNDERGROUND_COST_MULTIPLIER(tile));
return cost;
}
diff --git a/src/saveload/map_sl.cpp b/src/saveload/map_sl.cpp
index 51c56684a..184126367 100644
--- a/src/saveload/map_sl.cpp
+++ b/src/saveload/map_sl.cpp
@@ -9,6 +9,7 @@
#include "../stdafx.h"
#include "../map_func.h"
+#include "../layer_func.h"
#include "../core/bitmath_func.hpp"
#include "../fios.h"
#include <array>
@@ -19,10 +20,12 @@
static uint32 _map_dim_x;
static uint32 _map_dim_y;
+static uint32 _layer_count;
static const SaveLoadGlobVarList _map_dimensions[] = {
SLEG_CONDVAR(_map_dim_x, SLE_UINT32, SLV_6, SL_MAX_VERSION),
SLEG_CONDVAR(_map_dim_y, SLE_UINT32, SLV_6, SL_MAX_VERSION),
+ SLEG_CONDVAR(_layer_count, SLE_UINT32, SLV_UNDERGROUND, SL_MAX_VERSION),
SLEG_END()
};
@@ -30,13 +33,16 @@ static void Save_MAPS()
{
_map_dim_x = MapSizeX();
_map_dim_y = MapSizeY();
+ _layer_count = LayerCount();
SlGlobList(_map_dimensions);
}
static void Load_MAPS()
{
SlGlobList(_map_dimensions);
- AllocateMap(_map_dim_x, _map_dim_y);
+ if (IsSavegameVersionBefore(SLV_UNDERGROUND))
+ _layer_count = 1;
+ AllocateMap(_map_dim_x, _map_dim_y/_layer_count, _layer_count);
}
static void Check_MAPS()
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index abd58ea04..16b4fa723 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -302,7 +302,8 @@ enum SaveLoadVersion : uint16 {
SLV_MULTITILE_DOCKS, ///< 216 PR#7380 Multiple docks per station.
SLV_TRADING_AGE, ///< 217 PR#7780 Configurable company trading age.
SLV_ENDING_YEAR, ///< 218 PR#7747 v1.10 Configurable ending year.
- SLV_REMOVE_TOWN_CARGO_CACHE, ///< 219 PR#8258 Remove town cargo acceptance and production caches.
+ SLV_UNDERGROUND, ///< 219 Underground levels.
+ SLV_REMOVE_TOWN_CARGO_CACHE, ///< 220 PR#8258 Remove town cargo acceptance and production caches.
SL_MAX_VERSION, ///< Highest possible saveload version
};
diff --git a/src/script/api/script_window.hpp.in b/src/script/api/script_window.hpp.in
index a1dbb6567..b0c3656dc 100644
--- a/src/script/api/script_window.hpp.in
+++ b/src/script/api/script_window.hpp.in
@@ -65,6 +65,7 @@
#include "../../widgets/town_widget.h"
#include "../../widgets/transparency_widget.h"
#include "../../widgets/tree_widget.h"
+#include "../../widgets/underground_widget.h"
#include "../../widgets/vehicle_widget.h"
#include "../../widgets/viewport_widget.h"
#include "../../widgets/waypoint_widget.h"
diff --git a/src/settings.cpp b/src/settings.cpp
index 505638e94..ae0ccb53f 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -31,6 +31,7 @@
#include "command_func.h"
#include "console_func.h"
#include "pathfinder/pathfinder_type.h"
+#include "layer_type.h"
#include "genworld.h"
#include "train.h"
#include "news_func.h"
diff --git a/src/settings_type.h b/src/settings_type.h
index fdb2b0f86..27708eb73 100644
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -147,6 +147,8 @@ struct GUISettings {
byte starting_colour; ///< default color scheme for the company to start a new game with
bool show_newgrf_name; ///< Show the name of the NewGRF in the build vehicle window
+ uint32 layer_view_type; ///< зарезервировано (тип отображения)
+
uint16 console_backlog_timeout; ///< the minimum amount of time items should be in the console backlog before they will be removed in ~3 seconds granularity.
uint16 console_backlog_length; ///< the minimum amount of items in the console backlog before items will be removed.
@@ -282,6 +284,7 @@ struct GameCreationSettings {
Year ending_year; ///< scoring end date
uint8 map_x; ///< X size of map
uint8 map_y; ///< Y size of map
+ uint8 layers; ///< map layer count
byte land_generator; ///< the landscape generator
byte oil_refinery_limit; ///< distance oil refineries allowed from map edge
byte snow_line_height; ///< the configured snow line height
diff --git a/src/station.cpp b/src/station.cpp
index 6f55574ac..b069ce986 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -11,6 +11,7 @@
#include "company_func.h"
#include "company_base.h"
#include "roadveh.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "viewport_kdtree.h"
#include "date_func.h"
@@ -493,7 +494,7 @@ void StationRect::MakeEmpty()
/**
* Determines whether a given point (x, y) is within a certain distance of
* the station rectangle.
- * @note x and y are in Tile coordinates
+ * @note x and y are in Tile coordinates (in top layer)
* @param x X coordinate
* @param y Y coordinate
* @param distance The maximum distance a point may have (L1 norm)
@@ -512,8 +513,10 @@ bool StationRect::IsEmpty() const
CommandCost StationRect::BeforeAddTile(TileIndex tile, StationRectMode mode)
{
- int x = TileX(tile);
- int y = TileY(tile);
+ /* Станция может находится на любом уровне.
+ * Но охватывает только поверхность */
+ int x = LayerX(tile);
+ int y = LayerY(tile);
if (this->IsEmpty()) {
/* we are adding the first station tile */
if (mode != ADD_TEST) {
@@ -566,28 +569,35 @@ CommandCost StationRect::BeforeAddRect(TileIndex tile, int w, int h, StationRect
*/
/* static */ bool StationRect::ScanForStationTiles(StationID st_id, int left_a, int top_a, int right_a, int bottom_a)
{
- TileArea ta(TileXY(left_a, top_a), TileXY(right_a, bottom_a));
- TILE_AREA_LOOP(tile, ta) {
- if (IsTileType(tile, MP_STATION) && GetStationIndex(tile) == st_id) return true;
+ /* Станция может находится на любом уровне.
+ * Значит надо обойти все слои */
+ TileArea ta(TopTile(TileXY(left_a, top_a)), TopTile(TileXY(right_a, bottom_a)));
+
+ FOR_ALL_LAYERS(layer) {
+ ta.tile = TopTile(ta.tile) + layer * LayerSize();
+ TILE_AREA_LOOP(tile, ta) {
+ if (IsTileType(tile, MP_STATION) && GetStationIndex(tile) == st_id) return true;
+ }
}
-
return false;
}
bool StationRect::AfterRemoveTile(BaseStation *st, TileIndex tile)
{
- int x = TileX(tile);
- int y = TileY(tile);
+ /* Станция может находится на любом уровне.
+ * Но охватывает только поверхность */
+ int x = LayerX(tile);
+ int y = LayerY(tile);
/* look if removed tile was on the bounding rect edge
* and try to reduce the rect by this edge
* do it until we have empty rect or nothing to do */
for (;;) {
/* check if removed tile is on rect edge */
- bool left_edge = (x == this->left);
- bool right_edge = (x == this->right);
- bool top_edge = (y == this->top);
- bool bottom_edge = (y == this->bottom);
+ bool left_edge = (x == TopTile(this->left));
+ bool right_edge = (x == TopTile(this->right));
+ bool top_edge = (y == TopTile(this->top));
+ bool bottom_edge = (y == TopTile(this->bottom));
/* can we reduce the rect in either direction? */
bool reduce_x = ((left_edge || right_edge) && !ScanForStationTiles(st->index, x, this->top, x, this->bottom));
@@ -626,8 +636,13 @@ bool StationRect::AfterRemoveTile(BaseStation *st, TileIndex tile)
bool StationRect::AfterRemoveRect(BaseStation *st, TileArea ta)
{
- assert(this->PtInExtendedRect(TileX(ta.tile), TileY(ta.tile)));
- assert(this->PtInExtendedRect(TileX(ta.tile) + ta.w - 1, TileY(ta.tile) + ta.h - 1));
+ /* Станция может находится на любом уровне.
+ * Но охватывает только поверхность */
+ int topx = LayerX(ta.tile);
+ int topy = LayerY(ta.tile);
+
+ assert(this->PtInExtendedRect(topx, topy));
+ assert(this->PtInExtendedRect(topx + ta.w - 1, topy + ta.h - 1));
bool empty = this->AfterRemoveTile(st, ta.tile);
if (ta.w != 1 || ta.h != 1) empty = empty || this->AfterRemoveTile(st, TILE_ADDXY(ta.tile, ta.w - 1, ta.h - 1));
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 7bce21353..bf1366cb9 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -11,6 +11,7 @@
#include "aircraft.h"
#include "bridge_map.h"
#include "cmd_helper.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "viewport_kdtree.h"
#include "command_func.h"
@@ -100,21 +101,24 @@ bool IsHangar(TileIndex t)
* @return Succeeded command (if zero or one station found) or failed command (for two or more stations found).
*/
template <class T>
-CommandCost GetStationAround(TileArea ta, StationID closest_station, CompanyID company, T **st)
+CommandCost GetStationAround(TileArea ta, StationID closest_station, CompanyID company, T **st, bool layers=false)
{
ta.Expand(1);
/* check around to see if there are any stations there owned by the company */
- TILE_AREA_LOOP(tile_cur, ta) {
- if (IsTileType(tile_cur, MP_STATION)) {
- StationID t = GetStationIndex(tile_cur);
- if (!T::IsValidID(t) || Station::Get(t)->owner != company) continue;
- if (closest_station == INVALID_STATION) {
- closest_station = t;
- } else if (closest_station != t) {
- return_cmd_error(STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING);
+ FOR_ALL_LAYERS(layer) {
+ TILE_AREA_LOOP(tile_cur, ta) {
+ if (IsTileType(tile_cur, MP_STATION)) {
+ StationID t = GetStationIndex(tile_cur);
+ if (!T::IsValidID(t) || Station::Get(t)->owner != company) continue;
+ if (closest_station == INVALID_STATION) {
+ closest_station = t;
+ } else if (closest_station != t) {
+ return_cmd_error(STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING);
+ }
}
}
+ if (!layers) break;
}
*st = (closest_station == INVALID_STATION) ? nullptr : T::Get(closest_station);
return CommandCost();
@@ -811,7 +815,7 @@ CommandCost CheckBuildableTile(TileIndex tile, uint invalid_dirs, int &allowed_z
return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED);
}
}
- cost.AddCost(_price[PR_BUILD_FOUNDATION]);
+ cost.AddCost(_price[PR_BUILD_FOUNDATION] * UNDERGROUND_COST_MULTIPLIER(tile));
}
/* The level of this tile must be equal to allowed_z. */
@@ -1049,7 +1053,7 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags
ret = DoCommand(cur_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
if (ret.Failed()) return ret;
cost.AddCost(ret);
- cost.AddCost(RoadBuildCost(rt) * 2);
+ cost.AddCost(RoadBuildCost(rt) * 2 * UNDERGROUND_COST_MULTIPLIER(cur_tile));
}
}
}
@@ -1069,11 +1073,13 @@ CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta, Axis a
TileArea cur_ta = st->train_station;
/* determine new size of train station region.. */
- int x = min(TileX(cur_ta.tile), TileX(new_ta.tile));
- int y = min(TileY(cur_ta.tile), TileY(new_ta.tile));
- new_ta.w = max(TileX(cur_ta.tile) + cur_ta.w, TileX(new_ta.tile) + new_ta.w) - x;
- new_ta.h = max(TileY(cur_ta.tile) + cur_ta.h, TileY(new_ta.tile) + new_ta.h) - y;
- new_ta.tile = TileXY(x, y);
+ /* Фактически, подземная станция ("эскалатор") больше ширины карты.
+ * Поэтому проверям размер в пределах одного слоя */
+ int topx = min(LayerX(cur_ta.tile), LayerX(new_ta.tile));
+ int topy = min(LayerY(cur_ta.tile), LayerY(new_ta.tile));
+ new_ta.w = max(LayerX(cur_ta.tile) + cur_ta.w, LayerX(new_ta.tile) + new_ta.w) - topx;
+ new_ta.h = max(LayerY(cur_ta.tile) + cur_ta.h, LayerY(new_ta.tile) + new_ta.h) - topy;
+ new_ta.tile = TileXY(topx, topy);
/* make sure the final size is not too big. */
if (new_ta.w > _settings_game.station.station_spread || new_ta.h > _settings_game.station.station_spread) {
@@ -1145,7 +1151,7 @@ void GetStationLayout(byte *layout, int numtracks, int plat_len, const StationSp
* @return command cost with the error or 'okay'
*/
template <class T, StringID error_message>
-CommandCost FindJoiningBaseStation(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, T **st)
+CommandCost FindJoiningBaseStation(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, T **st, bool layers=false)
{
assert(*st == nullptr);
bool check_surrounding = true;
@@ -1171,7 +1177,7 @@ CommandCost FindJoiningBaseStation(StationID existing_station, StationID station
if (check_surrounding) {
/* Make sure there is no more than one other station around us that is owned by us. */
- CommandCost ret = GetStationAround(ta, existing_station, _current_company, st);
+ CommandCost ret = GetStationAround(ta, existing_station, _current_company, st, layers);
if (ret.Failed()) return ret;
}
@@ -1190,9 +1196,9 @@ CommandCost FindJoiningBaseStation(StationID existing_station, StationID station
* @param st 'return' pointer for the found station
* @return command cost with the error or 'okay'
*/
-static CommandCost FindJoiningStation(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, Station **st)
+static CommandCost FindJoiningStation(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, Station **st, bool layers=false)
{
- return FindJoiningBaseStation<Station, STR_ERROR_MUST_REMOVE_RAILWAY_STATION_FIRST>(existing_station, station_to_join, adjacent, ta, st);
+ return FindJoiningBaseStation<Station, STR_ERROR_MUST_REMOVE_RAILWAY_STATION_FIRST>(existing_station, station_to_join, adjacent, ta, st, layers);
}
/**
@@ -1301,8 +1307,8 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32
CommandCost cost = CheckFlatLandRailStation(new_location, flags, axis, &est, rt, affected_vehicles, spec_class, spec_index, plat_len, numtracks);
if (cost.Failed()) return cost;
/* Add construction expenses. */
- cost.AddCost((numtracks * _price[PR_BUILD_STATION_RAIL] + _price[PR_BUILD_STATION_RAIL_LENGTH]) * plat_len);
- cost.AddCost(numtracks * plat_len * RailBuildCost(rt));
+ cost.AddCost((numtracks * _price[PR_BUILD_STATION_RAIL] + _price[PR_BUILD_STATION_RAIL_LENGTH]) * plat_len * UNDERGROUND_COST_MULTIPLIER(tile_org));
+ cost.AddCost(numtracks * plat_len * RailBuildCost(rt) * UNDERGROUND_COST_MULTIPLIER(tile_org));
Station *st = nullptr;
ret = FindJoiningStation(est, station_to_join, adjacent, new_location, &st);
@@ -1342,8 +1348,10 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32
byte numtracks_orig;
Track track;
+ TileIndex top_tile = TopTile(new_location.tile);
st->train_station = new_location;
- st->AddFacility(FACIL_TRAIN, new_location.tile);
+ st->train_station.tile = top_tile;
+ st->AddFacility(FACIL_TRAIN, tile_org);
st->rect.BeforeAddRect(tile_org, w_org, h_org, StationRect::ADD_TRY);
@@ -1583,7 +1591,7 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, std::vector<T *> &affected_st
}
/* If we reached here, the tile is valid so increase the quantity of tiles we will remove */
- quantity++;
+ quantity += UNDERGROUND_COST_MULTIPLIER(tile);
if (keep_rail || IsStationTileBlocked(tile)) {
/* Don't refund the 'steel' of the track when we keep the
@@ -1662,7 +1670,7 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, std::vector<T *> &affected_st
CommandCost CmdRemoveFromRailStation(TileIndex start, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
TileIndex end = p1 == 0 ? start : p1;
- if (start >= MapSize() || end >= MapSize()) return CMD_ERROR;
+ if (start >= MapSize() || end >= MapSize() || (LayerIndex(start) != LayerIndex(end))) return CMD_ERROR;
TileArea ta(start, end);
std::vector<Station *> affected_stations;
@@ -1725,11 +1733,16 @@ CommandCost RemoveRailStation(T *st, DoCommandFlag flags, Money removal_cost)
/* determine width and height of platforms */
TileArea ta = st->train_station;
- assert(ta.w != 0 && ta.h != 0);
+ /* TileArea is top finite area */
+ assert(IsTopTile(ta.tile));
+ assert(ta.IsFinite());
CommandCost cost(EXPENSES_CONSTRUCTION);
+ /* Check all layers */
+ FOR_ALL_LAYERS(layer)
/* clear all areas of the station */
- TILE_AREA_LOOP(tile, ta) {
+ TILE_AREA_LOOP(top_tile, ta) {
+ TileIndex tile = top_tile + layer * LayerSize();
/* only remove tiles that are actually train station tiles */
if (st->TileBelongsToRailStation(tile)) {
std::vector<T*> affected_stations; // dummy
@@ -2095,13 +2108,21 @@ CommandCost CmdRemoveRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
/* Bankrupting company is not supposed to remove roads, there may be road vehicles. */
if (!keep_drive_through_roads && (flags & DC_BANKRUPT)) return CMD_ERROR;
- TileArea roadstop_area(tile, width, height);
+ /* Это территория удаления остановок (НЕ самих остановок) */
+ TileArea roadstop_area(TopTile(tile), width, height);
+
+ /* TileArea is top finite area */
+ assert(IsTopTile(roadstop_area.tile));
+ assert(roadstop_area.IsFinite());
CommandCost cost(EXPENSES_CONSTRUCTION);
CommandCost last_error(STR_ERROR_THERE_IS_NO_STATION);
bool had_success = false;
- TILE_AREA_LOOP(cur_tile, roadstop_area) {
+ /* Check all layers */
+ FOR_ALL_LAYERS(layer)
+ TILE_AREA_LOOP(top_tile, roadstop_area) {
+ TileIndex cur_tile = top_tile + layer * LayerSize();
/* Make sure the specified tile is a road stop of the correct type */
if (!IsTileType(cur_tile, MP_STATION) || !IsRoadStop(cur_tile) || (uint32)GetRoadStopType(cur_tile) != GB(p2, 0, 1)) continue;
@@ -2271,6 +2292,10 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
if (w > _settings_game.station.station_spread || h > _settings_game.station.station_spread) {
return_cmd_error(STR_ERROR_STATION_TOO_SPREAD_OUT);
}
+ /* can't make underground airport */
+ if (IsUnderground(tile)) {
+ return_cmd_error(STR_ERROR_UNDERGROUND_CAN_T_BUILD_UNDER_GROUND);
+ }
AirportTileTableIterator iter(as->table[layout], tile);
CommandCost cost = CheckFlatLandAirport(iter, flags);
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index 66a4605ea..ee6d8df53 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -19,6 +19,7 @@
#include "strings_func.h"
#include "string_func.h"
#include "window_func.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "widgets/dropdown_func.h"
#include "station_base.h"
@@ -2211,20 +2212,27 @@ static const T *FindStationsNearby(TileArea ta, bool distant_join)
_deleted_stations_nearby.clear();
/* Check the inside, to return, if we sit on another station */
- TILE_AREA_LOOP(t, ta) {
- if (t < MapSize() && IsTileType(t, MP_STATION) && T::IsValidID(GetStationIndex(t))) return T::GetByTile(t);
+ FOR_ALL_LAYERS(layer) {
+ TILE_AREA_LOOP(tile, ta) {
+ TileIndex t = TopTile(tile) + layer * LayerSize();
+ if (t < MapSize() && IsTileType(t, MP_STATION) && T::IsValidID(GetStationIndex(t)))
+ {
+ if (t == tile) return T::GetByTile(t);
+ AddNearbyStation<T>(t, &ctx);
+ }
+ }
}
/* Look for deleted stations */
for (const BaseStation *st : BaseStation::Iterate()) {
if (T::IsExpected(st) && !st->IsInUse() && st->owner == _local_company) {
/* Include only within station spread (yes, it is strictly less than) */
- if (max(DistanceMax(ta.tile, st->xy), DistanceMax(TILE_ADDXY(ta.tile, ta.w - 1, ta.h - 1), st->xy)) < _settings_game.station.station_spread) {
+ if (max(DistanceMax(TopTile(ta.tile), TopTile(st->xy)), DistanceMax(TILE_ADDXY(TopTile(ta.tile), ta.w - 1, ta.h - 1), TopTile(st->xy))) < _settings_game.station.station_spread) {
_deleted_stations_nearby.push_back({st->xy, st->index});
/* Add the station when it's within where we're going to build */
- if (IsInsideBS(TileX(st->xy), TileX(ctx.tile), ctx.w) &&
- IsInsideBS(TileY(st->xy), TileY(ctx.tile), ctx.h)) {
+ if (IsInsideBS(LayerX(st->xy), LayerX(ctx.tile), ctx.w) &&
+ IsInsideBS(LayerY(st->xy), LayerY(ctx.tile), ctx.h)) {
AddNearbyStation<T>(st->xy, &ctx);
}
}
@@ -2237,8 +2245,11 @@ static const T *FindStationsNearby(TileArea ta, bool distant_join)
if (distant_join && min(ta.w, ta.h) >= _settings_game.station.station_spread) return nullptr;
uint max_dist = distant_join ? _settings_game.station.station_spread - min(ta.w, ta.h) : 1;
- TileIndex tile = TileAddByDir(ctx.tile, DIR_N);
- CircularTileSearch(&tile, max_dist, ta.w, ta.h, AddNearbyStation<T>, &ctx);
+ FOR_ALL_LAYERS(layer) {
+ ctx.tile = TopTile(ctx.tile) + layer * LayerSize();
+ TileIndex tile = TileAddByDir(ctx.tile, DIR_N);
+ CircularTileSearch(&tile, max_dist, ta.w, ta.h, AddNearbyStation<T>, &ctx);
+ }
return nullptr;
}
diff --git a/src/table/settings.ini b/src/table/settings.ini
index c7dbd2128..50f18c980 100644
--- a/src/table/settings.ini
+++ b/src/table/settings.ini
@@ -1912,6 +1912,15 @@ min = 500
max = 1000000
cat = SC_EXPERT
+[SDT_VAR]
+base = GameSettings
+var = game_creation.layers
+type = SLE_UINT8
+flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def = 1
+min = MIN_LAYER_COUNT_BITS
+max = MAX_LAYER_COUNT_BITS
+
[SDT_BOOL]
base = GameSettings
var = pf.yapf.rail_firstred_twoway_eol
@@ -3240,6 +3249,15 @@ strhelp = STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT
strval = STR_JUST_COMMA
proc = RedrawScreen
+[SDTC_VAR]
+var = gui.layer_view_type
+type = SLE_UINT32
+flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def = 0
+min = 0
+max = UINT32_MAX
+proc = RedrawScreen
+
[SDTC_BOOL]
var = gui.show_newgrf_name
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp
index 85edb7312..5b1268940 100644
--- a/src/terraform_cmd.cpp
+++ b/src/terraform_cmd.cpp
@@ -8,6 +8,7 @@
/** @file terraform_cmd.cpp Commands related to terraforming. */
#include "stdafx.h"
+#include "layer_func.h"
#include "command_func.h"
#include "tunnel_map.h"
#include "bridge_map.h"
@@ -251,6 +252,10 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
if (z_N > z_min) tileh |= SLOPE_N;
if (pass == 0) {
+ /* Terrafrom enable only top layer */
+ if (IsUnderground(tile)) {
+ return_cmd_error(STR_ERROR_UNDERGROUND_CAN_T_TERRAFORM);
+ }
/* Check if bridge would take damage */
if (IsBridgeAbove(tile)) {
int bridge_height = GetBridgeHeight(GetSouthernBridgeEnd(tile));
diff --git a/src/tgp.cpp b/src/tgp.cpp
index fb5c69cf7..feeab2525 100644
--- a/src/tgp.cpp
+++ b/src/tgp.cpp
@@ -12,6 +12,7 @@
#include "clear_map.h"
#include "void_map.h"
#include "genworld.h"
+#include "layer_func.h"
#include "core/random_func.hpp"
#include "landscape_type.h"
@@ -168,6 +169,8 @@ struct HeightMap
int total_size; //< height map total size
int size_x; //< MapSizeX()
int size_y; //< MapSizeY()
+ int map_x; //< MapSizeX()
+ int map_y; //< MapSizeY()
/**
* Height map accessor
@@ -305,8 +308,11 @@ static inline bool AllocHeightMap()
{
height_t *h;
- _height_map.size_x = MapSizeX();
- _height_map.size_y = MapSizeY();
+ _height_map.map_x = MapSizeX();
+ _height_map.map_y = MapSizeY();
+
+ _height_map.size_x = LayerSizeX();
+ _height_map.size_y = LayerSizeY();
/* Allocate memory block for height map row pointers */
_height_map.total_size = (_height_map.size_x + 1) * (_height_map.size_y + 1);
@@ -993,8 +999,8 @@ void GenerateTerrainPerlin()
/* First make sure the tiles at the north border are void tiles if needed. */
if (_settings_game.construction.freeform_edges) {
- for (uint x = 0; x < MapSizeX(); x++) MakeVoid(TileXY(x, 0));
- for (uint y = 0; y < MapSizeY(); y++) MakeVoid(TileXY(0, y));
+ for (uint x = 0; x < _height_map.map_x; x++) MakeVoid(x);
+ for (uint y = 0; y < _height_map.map_y - 1; y++) MakeVoid(_height_map.size_x * y);
}
int max_height = H2I(TGPGetMaxHeight());
diff --git a/src/tile_map.h b/src/tile_map.h
index b6c715e8a..c191ab904 100644
--- a/src/tile_map.h
+++ b/src/tile_map.h
@@ -14,6 +14,7 @@
#include "map_func.h"
#include "core/bitmath_func.hpp"
#include "settings_type.h"
+#include "layer_func.h"
/**
* Returns the height of a tile
@@ -110,10 +111,10 @@ static inline bool IsInnerTile(TileIndex tile)
{
assert(tile < MapSize());
- uint x = TileX(tile);
- uint y = TileY(tile);
+ uint x = LayerX(tile);
+ uint y = LayerY(tile);
- return x < MapMaxX() && y < MapMaxY() && ((x > 0 && y > 0) || !_settings_game.construction.freeform_edges);
+ return x < LayerMaxX() && y < LayerMaxY() && ((x > 0 && y > 0) || !_settings_game.construction.freeform_edges);
}
/**
@@ -134,7 +135,7 @@ static inline void SetTileType(TileIndex tile, TileType type)
/* VOID tiles (and no others) are exactly allowed at the lower left and right
* edges of the map. If _settings_game.construction.freeform_edges is true,
* the upper edges of the map are also VOID tiles. */
- assert(IsInnerTile(tile) == (type != MP_VOID));
+ assert(IsInnerTile(tile) == (type != MP_VOID)); // was commented in <underground>
SB(_m[tile].type, 4, 4, type);
}
diff --git a/src/tilearea_type.h b/src/tilearea_type.h
index 264821985..76971ae48 100644
--- a/src/tilearea_type.h
+++ b/src/tilearea_type.h
@@ -42,6 +42,16 @@ struct OrthogonalTileArea {
this->h = 0;
}
+ inline bool IsEmpty() const
+ {
+ return (w==0 && h==0);
+ }
+
+ inline bool IsFinite() const
+ {
+ return (w!=0 && h!=0);
+ }
+
bool Intersects(const OrthogonalTileArea &ta) const;
bool Contains(TileIndex tile) const;
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 632025ddb..3be7b0c14 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -11,7 +11,10 @@
#include "gui.h"
#include "window_gui.h"
#include "window_func.h"
+#include "layer_gui.h"
+#include "layer_func.h"
#include "viewport_func.h"
+#include "landscape.h"
#include "command_func.h"
#include "vehicle_gui.h"
#include "rail_gui.h"
@@ -21,6 +24,7 @@
#include "vehicle_func.h"
#include "sound_func.h"
#include "terraform_gui.h"
+#include "underground_gui.h"
#include "strings_func.h"
#include "company_func.h"
#include "company_gui.h"
@@ -1006,6 +1010,39 @@ static CallBackFunction MenuClickForest(int index)
return CBF_NONE;
}
+/* --- Underground button menu --- */
+
+/**
+ * Handle click on the entry in the underground menu.
+ *
+ * @param index Menu entry clicked.
+ * @return #CBF_NONE
+ */
+static CallBackFunction MenuClickUnderground(int index)
+{
+ if (index==0) {
+ ShowUndergroundToolbar();
+ return CBF_NONE;
+ }
+ index -= 1;
+ if ((index<0) || (uint(index) >= LayerCount()))
+ return CBF_NONE;
+ Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
+ int delta_layer = calculateLayer(w->viewport) - index;
+ Point pt = RemapCoords(0, -delta_layer * LayerSizeY() * TILE_SIZE, 0);
+ w->viewport->dest_scrollpos_x += pt.x;
+ w->viewport->dest_scrollpos_y += pt.y;
+ w->InvalidateData();
+ return CBF_NONE;
+}
+
+static CallBackFunction ToolbarUndergroundClick(Window *w)
+{
+ PopupMainToolbMenu(w, WID_TN_UNDERGROUND, STR_LANDSCAPING_MENU_UNDERGROUND, 1+LayerCount());
+ if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
+ return CBF_NONE;
+}
+
/* --- Music button menu --- */
static CallBackFunction ToolbarMusicClick(Window *w)
@@ -1316,9 +1353,10 @@ static MenuClickedProc * const _menu_clicked_procs[] = {
MenuClickBuildWater, // 24
MenuClickBuildAir, // 25
MenuClickForest, // 26
- MenuClickMusicWindow, // 27
- MenuClickNewspaper, // 28
- MenuClickHelp, // 29
+ MenuClickUnderground, // 27
+ MenuClickMusicWindow, // 28
+ MenuClickNewspaper, // 29
+ MenuClickHelp, // 30
};
/** Full blown container to make it behave exactly as we want :) */
@@ -1483,7 +1521,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const override
{
static const uint SMALLEST_ARRANGEMENT = 14;
- static const uint BIGGEST_ARRANGEMENT = 20;
+ static const uint BIGGEST_ARRANGEMENT = 21;
/* The number of buttons of each row of the toolbar should match the number of items which we want to be visible.
* The total number of buttons should be equal to arrangable_count * 2.
@@ -1750,6 +1788,67 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
WID_TN_ZOOM_OUT,
WID_TN_SWITCH_BAR,
};
+ static const byte arrange21[] = {
+ WID_TN_PAUSE,
+ WID_TN_FAST_FORWARD,
+ WID_TN_SETTINGS,
+ WID_TN_SMALL_MAP,
+ WID_TN_TOWNS,
+ WID_TN_SUBSIDIES,
+ WID_TN_STATIONS,
+ WID_TN_FINANCES,
+ WID_TN_COMPANIES,
+ WID_TN_STORY,
+ WID_TN_GOAL,
+ WID_TN_GRAPHS,
+ WID_TN_LEAGUE,
+ WID_TN_INDUSTRIES,
+ WID_TN_TRAINS,
+ WID_TN_ROADVEHS,
+ WID_TN_SHIPS,
+ WID_TN_AIRCRAFT,
+ WID_TN_ZOOM_IN,
+ WID_TN_ZOOM_OUT,
+ WID_TN_RAILS,
+ WID_TN_ROADS,
+ WID_TN_WATER,
+ WID_TN_AIR,
+ WID_TN_LANDSCAPE,
+ WID_TN_UNDERGROUND,
+ WID_TN_MUSIC_SOUND,
+ WID_TN_MESSAGES,
+ WID_TN_HELP,
+ // lower toolbar
+ WID_TN_PAUSE,
+ WID_TN_FAST_FORWARD,
+ WID_TN_SAVE,
+ WID_TN_SMALL_MAP,
+ WID_TN_TOWNS,
+ WID_TN_SUBSIDIES,
+ WID_TN_STATIONS,
+ WID_TN_FINANCES,
+ WID_TN_COMPANIES,
+ WID_TN_STORY,
+ WID_TN_GOAL,
+ WID_TN_GRAPHS,
+ WID_TN_LEAGUE,
+ WID_TN_INDUSTRIES,
+ WID_TN_TRAINS,
+ WID_TN_ROADVEHS,
+ WID_TN_SHIPS,
+ WID_TN_AIRCRAFT,
+ WID_TN_ZOOM_IN,
+ WID_TN_ZOOM_OUT,
+ WID_TN_RAILS,
+ WID_TN_ROADS,
+ WID_TN_WATER,
+ WID_TN_AIR,
+ WID_TN_LANDSCAPE,
+ WID_TN_UNDERGROUND,
+ WID_TN_MUSIC_SOUND,
+ WID_TN_MESSAGES,
+ WID_TN_HELP,
+ };
static const byte arrange_all[] = {
WID_TN_PAUSE,
WID_TN_FAST_FORWARD,
@@ -1778,6 +1877,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
WID_TN_WATER,
WID_TN_AIR,
WID_TN_LANDSCAPE,
+ WID_TN_UNDERGROUND,
WID_TN_MUSIC_SOUND,
WID_TN_MESSAGES,
WID_TN_HELP
@@ -1792,7 +1892,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
}
/* Introduce the split toolbar */
- static const byte * const arrangements[] = { arrange14, arrange15, arrange16, arrange17, arrange18, arrange19, arrange20 };
+ static const byte * const arrangements[] = { arrange14, arrange15, arrange16, arrange17, arrange18, arrange19, arrange20, arrange21 };
button_count = arrangable_count = full_buttons;
spacer_count = this->spacers;
@@ -1949,6 +2049,7 @@ static ToolbarButtonProc * const _toolbar_button_procs[] = {
ToolbarBuildWaterClick,
ToolbarBuildAirClick,
ToolbarForestClick,
+ ToolbarUndergroundClick,
ToolbarMusicClick,
ToolbarNewspaperClick,
ToolbarHelpClick,
@@ -2245,6 +2346,7 @@ static NWidgetBase *MakeMainToolbar(int *biggest_index)
SPR_IMG_BUILDWATER, // WID_TN_WATER
SPR_IMG_BUILDAIR, // WID_TN_AIR
SPR_IMG_LANDSCAPING, // WID_TN_LANDSCAPE
+ SPR_IMG_LANDSCAPING, // WID_TN_UNDERGROUND
SPR_IMG_MUSIC, // WID_TN_MUSIC_SOUND
SPR_IMG_MESSAGES, // WID_TN_MESSAGES
SPR_IMG_QUERY, // WID_TN_HELP
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 374601cad..41e5f487a 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -12,6 +12,7 @@
#include "road_internal.h" /* Cleaning up road bits */
#include "road_cmd.h"
#include "landscape.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "viewport_kdtree.h"
#include "cmd_helper.h"
@@ -2016,7 +2017,7 @@ static Town *CreateRandomTown(uint attempts, uint32 townnameparts, TownSize size
do {
/* Generate a tile index not too close from the edge */
- TileIndex tile = AlignTileToGrid(RandomTile(), layout);
+ TileIndex tile = AlignTileToGrid(TopTile(RandomTile()), layout);
/* if we tried to place the town on water, slide it over onto
* the nearest likely-looking spot */
@@ -2192,6 +2193,9 @@ static inline bool CanBuildHouseHere(TileIndex tile, bool noslope)
Slope slope = GetTileSlope(tile);
if ((noslope && slope != SLOPE_FLAT) || IsSteepSlope(slope)) return false;
+ /* Недопустимо строительство объекта под землей */
+ if (IsUnderground(tile)) return false;
+
/* at least one RoadTypes allow building the house here? */
if (!RoadTypesAllowHouseHere(tile)) return false;
@@ -2627,6 +2631,8 @@ CommandCost CmdRenameTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
InvalidateWindowData(WC_TOWN_DIRECTORY, 0, TDIWD_FORCE_RESORT);
ClearAllStationCachedNames();
ClearAllIndustryCachedNames();
+ InvalidateWindowClassesData(WC_TOWN_VIEW);
+ InvalidateWindowClassesData(WC_INDUSTRY_VIEW);
UpdateAllStationVirtCoords();
}
return CommandCost();
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index cdc986920..2e95b25a2 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -11,6 +11,7 @@
#include "clear_map.h"
#include "landscape.h"
#include "tree_map.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "command_func.h"
#include "town.h"
@@ -70,7 +71,8 @@ static bool CanPlantTreesOnTile(TileIndex tile, bool allow_desert)
case MP_CLEAR:
return !IsBridgeAbove(tile) && !IsClearGround(tile, CLEAR_FIELDS) && GetRawClearGround(tile) != CLEAR_ROCKS &&
- (allow_desert || !IsClearGround(tile, CLEAR_DESERT));
+ (allow_desert || !IsClearGround(tile, CLEAR_DESERT))
+ && !IsUnderground(tile);
default: return false;
}
@@ -184,7 +186,7 @@ static void PlaceTree(TileIndex tile, uint32 r)
static void PlaceTreeGroups(uint num_groups)
{
do {
- TileIndex center_tile = RandomTile();
+ TileIndex center_tile = TopTile(RandomTile());
for (uint i = 0; i < DEFAULT_TREE_STEPS; i++) {
uint32 r = Random();
@@ -249,7 +251,7 @@ void PlaceTreesRandomly()
if (_game_mode == GM_EDITOR) i /= EDITOR_TREE_DIV;
do {
uint32 r = Random();
- TileIndex tile = RandomTileSeed(r);
+ TileIndex tile = TopTile(RandomTileSeed(r));
IncreaseGeneratingWorldProgress(GWP_TREE);
@@ -278,7 +280,7 @@ void PlaceTreesRandomly()
do {
uint32 r = Random();
- TileIndex tile = RandomTileSeed(r);
+ TileIndex tile = TopTile(RandomTileSeed(r));
IncreaseGeneratingWorldProgress(GWP_TREE);
@@ -337,6 +339,10 @@ CommandCost CmdPlantTree(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
const byte tree_to_plant = GB(p1, 0, 8); // We cannot use Extract as min and max are climate specific.
if (p2 >= MapSize()) return CMD_ERROR;
+
+ /* tree only top layer */
+ if (IsUnderground(p2)) return CMD_ERROR;
+
/* Check the tree type within the current climate */
if (tree_to_plant != TREE_INVALID && !IsInsideBS(tree_to_plant, _tree_base_by_landscape[_settings_game.game_creation.landscape], _tree_count_by_landscape[_settings_game.game_creation.landscape])) return CMD_ERROR;
@@ -764,7 +770,7 @@ void OnTick_Trees()
/* place a tree at a random rainforest spot */
if (_settings_game.game_creation.landscape == LT_TROPIC &&
- (r = Random(), tile = RandomTileSeed(r), GetTropicZone(tile) == TROPICZONE_RAINFOREST) &&
+ (r = Random(), tile = TopTile(RandomTileSeed(r)), GetTropicZone(tile) == TROPICZONE_RAINFOREST) &&
CanPlantTreesOnTile(tile, false) &&
(tree = GetRandomTreeType(tile, GB(r, 24, 8))) != TREE_INVALID) {
PlantTreesOnTile(tile, tree, 0, 0);
@@ -775,7 +781,7 @@ void OnTick_Trees()
/* place a tree at a random spot */
r = Random();
- tile = RandomTileSeed(r);
+ tile = TopTile(RandomTileSeed(r));
if (CanPlantTreesOnTile(tile, false) && (tree = GetRandomTreeType(tile, GB(r, 24, 8))) != TREE_INVALID) {
PlantTreesOnTile(tile, tree, 0, 0);
}
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 1a66d530f..5b12e7c20 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -13,6 +13,7 @@
#include "stdafx.h"
#include "newgrf_object.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "cmd_helper.h"
#include "command_func.h"
@@ -277,6 +278,10 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u
return_cmd_error(STR_ERROR_CAN_T_START_AND_END_ON);
}
+ if (IsUnderground(tile_start) || IsUnderground(tile_end)) {
+ return_cmd_error(STR_ERROR_UNDERGROUND_CAN_T_BUILD_UNDER_GROUND);
+ }
+
Axis direction;
if (TileX(tile_start) == TileX(tile_end)) {
direction = AXIS_Y;
@@ -670,6 +675,12 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
for (;;) {
end_tile += delta;
if (!IsValidTile(end_tile)) return_cmd_error(STR_ERROR_TUNNEL_THROUGH_MAP_BORDER);
+
+
+ if (IsUnderground(start_tile) || IsUnderground(end_tile)) {
+ return_cmd_error(STR_ERROR_UNDERGROUND_CAN_T_BUILD_UNDER_GROUND);
+ }
+
end_tileh = GetTileSlope(end_tile, &end_z);
if (start_z == end_z) break;
diff --git a/src/underground_gui.cpp b/src/underground_gui.cpp
new file mode 100644
index 000000000..406bd8cb7
--- /dev/null
+++ b/src/underground_gui.cpp
@@ -0,0 +1,321 @@
+/* $Id: terraform_gui.cpp 23547 2011-12-16 18:21:13Z truebrain $ */
+
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/** @file terraform_gui.cpp GUI related to terraforming the map. */
+
+#include "stdafx.h"
+#include "clear_map.h"
+#include "company_func.h"
+#include "company_base.h"
+#include "gui.h"
+#include "window_gui.h"
+#include "window_func.h"
+#include "layer_func.h"
+#include "viewport_func.h"
+#include "command_func.h"
+#include "signs_func.h"
+#include "sound_func.h"
+#include "base_station_base.h"
+#include "textbuf_gui.h"
+#include "genworld.h"
+#include "tree_map.h"
+#include "landscape_type.h"
+#include "tilehighlight_func.h"
+#include "strings_func.h"
+#include "newgrf_object.h"
+#include "newgrf_station.h"
+#include "object.h"
+#include "hotkeys.h"
+#include "engine_base.h"
+
+#include "widgets/underground_widget.h"
+
+#include "table/strings.h"
+#include "error.h"
+
+void ShowError(TileIndex tile, CommandCost res, uint32 cmd)
+{
+ int x = TileX(tile) * TILE_SIZE;
+ int y = TileY(tile) * TILE_SIZE;
+ StringID error_part1 = GB(cmd, 16, 16);
+
+ if (IsLocalCompany() && error_part1 != 0) {
+ ShowErrorMessage(error_part1, res.GetErrorMessage(), WL_INFO, x, y, res.GetTextRefStackGRF(), res.GetTextRefStackSize(), res.GetTextRefStack());
+ }
+}
+
+
+/**
+ * Place a escalator.
+ * @param tile Position to place or start dragging a station.
+ */
+static void PlaceUnderground_Escalator(TileIndex tile)
+{
+ RailType railtype = RAILTYPE_RAIL;
+ Axis orientation = AXIS_X;
+ StationClassID station_class = STAT_CLASS_DFLT;
+ byte station_type = 0;
+
+ uint32 p1 = railtype | orientation << 4 | 1 << 8 | 1 << 16 | _ctrl_pressed << 24;
+ uint32 p2 = station_class | station_type << 8 | INVALID_STATION << 16;
+
+ int w = 1;
+ int h = 1;
+
+ uint top_tile = TopTile(tile);
+ uint base_tile = tile;
+ bool from_top = false; // Строим от верхнего слоя
+
+ if (top_tile == base_tile)
+ {
+ from_top = true;
+ base_tile += LayerSize();
+ };
+
+ uint32 cmdS = CMD_BUILD_RAIL_STATION | CMD_MSG(STR_ERROR_UNDERGROUND_CAN_T_BUILD_PART);
+ uint32 cmdT = CMD_BUILD_RAIL_STATION | CMD_MSG(STR_ERROR_UNDERGROUND_CAN_T_BUILD_TOP_PART);
+ uint32 cmdB = CMD_BUILD_RAIL_STATION | CMD_MSG(STR_ERROR_UNDERGROUND_CAN_T_BUILD_BOTTOM_PART);
+ CommandContainer cmdTop = { top_tile, p1, p2, cmdT, CcStation, "" };
+ CommandContainer cmdBase = { base_tile, p1, p2, cmdB, CcStation, "" };
+
+ DoCommandFlag flags = DC_AUTO | DC_NO_WATER;
+ CommandCost resTop;
+ CommandCost res;
+
+ // Проверяем возможность постройки верха и низа:
+ resTop=DoCommand(&cmdTop, flags | DC_QUERY_COST);
+ if (resTop.Failed())
+ {
+ ShowError(tile, resTop, cmdT);
+ return;
+ }
+
+ res=DoCommand(&cmdBase, flags | DC_QUERY_COST);
+ if (res.Failed())
+ {
+ ShowError(tile, res, cmdB);
+ return;
+ }
+
+ res.AddCost(resTop.GetCost());
+ if (_shift_pressed || !CheckCompanyHasMoney(res))
+ {
+ if (res.Failed()) ShowError(tile, res, cmdS);
+ else ShowEstimatedCostOrIncome(res.GetCost(), TileX(tile) * TILE_SIZE, TileY(tile) * TILE_SIZE);
+ return;
+ }
+
+ // Станции могут быть сверху и снизу.
+ // Чтобы не было конфликта, нужно строить от активного слоя
+ CommandContainer *cmd1 = from_top ? &cmdTop : &cmdBase;
+ CommandContainer *cmd2 = from_top ? &cmdBase : &cmdTop;
+
+ // Строим уровень (в активном слое)
+ res=DoCommand(cmd1, flags | DC_EXEC);
+ assert(!res.Failed());
+
+ // Уточняем параметры
+ StationID station = GetStationIndex(cmd1->tile);
+ cmd2->p2 = station_class | station_type << 8 | station << 16;
+
+ // Строим уровень (в другом слое)
+ res=DoCommand(cmd2, flags | DC_EXEC);
+ assert(!res.Failed());
+}
+
+/** Underground toolbar managing class. */
+struct UndergroundToolbarWindow : Window {
+ int last_user_action; ///< Last started user action.
+
+ UndergroundToolbarWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc)
+ {
+ /* This is needed as we like to have the tree available on OnInit. */
+ this->CreateNestedTree(desc);
+ this->FinishInitNested(window_number);
+ this->last_user_action = WIDGET_LIST_END;
+ }
+
+ ~UndergroundToolbarWindow()
+ {
+ }
+
+ virtual void OnInit()
+ {
+ }
+
+ virtual void OnClick(Point pt, int widget, int click_count)
+ {
+ switch (widget) {
+ case WID_UT_BUILD_ESCALATOR: // WID_TT_BUILD_ESCALATOR
+ HandlePlacePushButton(this, WID_UT_BUILD_ESCALATOR, SPR_CURSOR_RAIL_STATION, HT_RECT);
+ this->last_user_action = widget;
+ break;
+
+ case WID_UT_DEMOLISH: // Demolish aka dynamite button
+ HandlePlacePushButton(this, WID_UT_DEMOLISH, ANIMCURSOR_DEMOLISH, HT_RECT | HT_DIAGONAL);
+ this->last_user_action = widget;
+ break;
+
+ default: NOT_REACHED();
+ }
+ }
+
+ virtual void OnTimeout()
+ {
+ }
+
+ virtual void OnPlaceObject(Point pt, TileIndex tile)
+ {
+ switch (this->last_user_action) {
+ case WID_UT_BUILD_ESCALATOR:
+ PlaceUnderground_Escalator(tile);
+ break;
+
+ case WID_UT_DEMOLISH: // Demolish aka dynamite button
+ PlaceProc_DemolishArea(tile);
+ break;
+
+ default: NOT_REACHED();
+ }
+ }
+
+ virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
+ {
+ VpSelectTilesWithMethod(pt.x, pt.y, select_method);
+ }
+
+ virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
+ {
+ Point pt = GetToolbarAlignedWindowPosition(sm_width);
+ pt.y += sm_height;
+ return pt;
+ }
+
+ virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
+ {
+ if (pt.x != -1) {
+ switch (select_proc) {
+ default: NOT_REACHED();
+ case DDSP_DEMOLISH_AREA:
+ GUIPlaceProcDragXY(select_proc, start_tile, end_tile);
+ break;
+ }
+ }
+ }
+
+ virtual void OnPlaceObjectAbort()
+ {
+ DeleteWindowById(WC_BUILD_OBJECT, 0);
+ this->RaiseButtons();
+ }
+
+ static HotkeyList hotkeys;
+};
+
+/**
+ * Handler for global hotkeys of the UndergroundToolbarWindow.
+ * @param hotkey Hotkey
+ * @return ES_HANDLED if hotkey was accepted.
+ */
+static EventState UndergroundToolbarGlobalHotkeys(int hotkey)
+{
+ if (_game_mode != GM_NORMAL) return ES_NOT_HANDLED;
+/* TODO Window *w = ShowAIDebugWindow(INVALID_COMPANY);
+ if (w == NULL) return ES_NOT_HANDLED;
+ return w->OnHotkey(hotkey); */
+}
+
+EventState UndergroundToolbarGlobalHotkeys(uint16 key, uint16 keycode)
+{
+/* int num = CheckHotkeyMatch<UndergroundToolbarWindow>(_underground_hotkeys, keycode, NULL, true);
+ if (num == -1) return ES_NOT_HANDLED;
+ Window *w = ShowUndergroundToolbar(NULL); TODO
+ if (w == NULL) return ES_NOT_HANDLED;
+ return w->OnKeyPress(key, keycode);
+}
+ int num = CheckHotkeyMatch(underground_hotkeys, keycode, this);
+ if (num == -1) return ES_NOT_HANDLED;
+ this->OnClick(Point(), num, 1);
+ return ES_HANDLED;
++static EventState AIDebugGlobalHotkeys(int hotkey)
++{
++ if (_game_mode != GM_NORMAL) return ES_NOT_HANDLED;
++ Window *w = ShowAIDebugWindow(INVALID_COMPANY);
++ if (w == NULL) return ES_NOT_HANDLED;
++ return w->OnHotkey(hotkey);
++}
+-EventState AIDebugGlobalHotkeys(uint16 key, uint16 keycode)
+-{
+- int num = CheckHotkeyMatch<AIDebugWindow>(_aidebug_hotkeys, keycode, NULL, true);
+- if (num == -1) return ES_NOT_HANDLED;
+- Window *w = ShowAIDebugWindow(INVALID_COMPANY);
+- if (w == NULL) return ES_NOT_HANDLED;
+- return w->OnKeyPress(key, keycode);
+-}
+- */
+ return ES_NOT_HANDLED;
+}
+
+static Hotkey underground_hotkeys[] = {
+ Hotkey('D' | WKC_GLOBAL_HOTKEY, "dynamite", WID_UT_DEMOLISH),
+ Hotkey('0', "placeescalator", WID_UT_BUILD_ESCALATOR),
+ HOTKEY_LIST_END
+};
+HotkeyList UndergroundToolbarWindow::hotkeys("undergroundtoolbar", underground_hotkeys, UndergroundToolbarGlobalHotkeys);
+
+static const NWidgetPart _nested_underground_widgets[] = {
+ NWidget(NWID_HORIZONTAL),
+ NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
+ NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_UNDERGROUND_BUILD, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN),
+ EndContainer(),
+ NWidget(NWID_HORIZONTAL),
+ NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_UT_BUILD_ESCALATOR),
+ SetFill(0, 1), SetMinimalSize(42, 22), SetDataTip(SPR_IMG_RAIL_STATION, STR_UNDERGROUND_TOOLTIP_ESCALATOR),
+ NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetMinimalSize(64, 22), EndContainer(),
+ NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_UT_DEMOLISH), SetMinimalSize(22, 22),
+ SetFill(0, 1), SetDataTip(SPR_IMG_DYNAMITE, STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC),
+ EndContainer(),
+};
+
+static WindowDesc _underground_desc(
+ WDP_MANUAL, "undergroundtoolbar", 0, 0,
+ WC_UNDERGROUND, WC_NONE,
+ WDF_CONSTRUCTION,
+ _nested_underground_widgets, lengthof(_nested_underground_widgets)
+);
+
+/**
+ * Show the toolbar for terraforming in the game.
+ * @param link The toolbar we might want to link to.
+ * @return The allocated toolbar.
+ */
+Window *ShowUndergroundToolbar(Window *link)
+{
+ if (!Company::IsValidID(_local_company)) return NULL;
+
+ Window *w;
+ if (link == NULL) {
+ w = AllocateWindowDescFront<UndergroundToolbarWindow>(&_underground_desc, 0);
+ return w;
+ }
+
+ /* Delete the terraform toolbar to place it again. */
+ DeleteWindowById(WC_UNDERGROUND, 0, true);
+ w = AllocateWindowDescFront<UndergroundToolbarWindow>(&_underground_desc, 0);
+ /* Align the terraform toolbar under the main toolbar. */
+ w->top -= w->height;
+ w->SetDirty();
+ /* Put the linked toolbar to the left / right of it. */
+ link->left = w->left + (_current_text_dir == TD_RTL ? w->width : -link->width);
+ link->top = w->top;
+ link->SetDirty();
+
+ return w;
+}
diff --git a/src/underground_gui.h b/src/underground_gui.h
new file mode 100644
index 000000000..81b119545
--- /dev/null
+++ b/src/underground_gui.h
@@ -0,0 +1,19 @@
+/* $Id: underground_gui.h 21608 2012-09-08 1:13:14 constructor $ */
+
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/** @file underground_gui.h GUI stuff related to terraforming. */
+
+#ifndef UNDERGROUND_GUI_H
+#define UNDERGROUND_GUI_H
+
+#include "window_type.h"
+
+Window *ShowUndergroundToolbar(Window *link = NULL);
+
+#endif /* UNDERGROUND_GUI_H */
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 3ed7cb1b0..55e026465 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -13,6 +13,7 @@
#include "ship.h"
#include "spritecache.h"
#include "timetable.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "news_func.h"
#include "command_func.h"
@@ -1139,6 +1140,7 @@ void ViewportAddVehicles(DrawPixelInfo *dpi)
const Vehicle *v = _vehicle_viewport_hash[x + y]; // already masked & 0xFFF
while (v != nullptr) {
+ if (LayerIndex(v->tile) == dpi->layer)
if (!(v->vehstatus & VS_HIDDEN) &&
l <= v->coord.right &&
t <= v->coord.bottom &&
diff --git a/src/viewport.cpp b/src/viewport.cpp
index e28a2e606..7398d335e 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -62,6 +62,8 @@
#include "stdafx.h"
#include "landscape.h"
+#include "layer_gui.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "station_base.h"
#include "waypoint_base.h"
@@ -1244,24 +1246,27 @@ static void ViewportAddLandscape()
int min_visible_height = viewport_y - (_vd.dpi.top + _vd.dpi.height);
bool tile_visible = min_visible_height <= 0;
- if (tile_type != MP_VOID) {
- /* Is tile with buildings visible? */
- if (min_visible_height < MAX_TILE_EXTENT_TOP) tile_visible = true;
-
- if (IsBridgeAbove(tile_info.tile)) {
- /* Is the bridge visible? */
- TileIndex bridge_tile = GetNorthernBridgeEnd(tile_info.tile);
- int bridge_height = ZOOM_LVL_BASE * (GetBridgePixelHeight(bridge_tile) - TilePixelHeight(tile_info.tile));
- if (min_visible_height < bridge_height + MAX_TILE_EXTENT_TOP) tile_visible = true;
- }
+ /* Валидны только клетки текущего слоя */
+ if (LayerIndex(tile_info.tile) == _vd.dpi.layer) {
+ if (tile_type != MP_VOID) {
+ /* Is tile with buildings visible? */
+ if (min_visible_height < MAX_TILE_EXTENT_TOP) tile_visible = true;
+
+ if (IsBridgeAbove(tile_info.tile)) {
+ /* Is the bridge visible? */
+ TileIndex bridge_tile = GetNorthernBridgeEnd(tile_info.tile);
+ int bridge_height = ZOOM_LVL_BASE * (GetBridgePixelHeight(bridge_tile) - TilePixelHeight(tile_info.tile));
+ if (min_visible_height < bridge_height + MAX_TILE_EXTENT_TOP) tile_visible = true;
+ }
- /* Would a higher bridge on a more southern tile be visible?
- * If yes, we need to loop over more rows to possibly find one. */
- if (min_visible_height < potential_bridge_height + MAX_TILE_EXTENT_TOP) last_row = false;
- } else {
- /* Outside of map. If we are on the north border of the map, there may still be a bridge visible,
- * so we need to loop over more rows to possibly find one. */
- if ((tilecoord.x <= 0 || tilecoord.y <= 0) && min_visible_height < potential_bridge_height + MAX_TILE_EXTENT_TOP) last_row = false;
+ /* Would a higher bridge on a more southern tile be visible?
+ * If yes, we need to loop over more rows to possibly find one. */
+ if (min_visible_height < potential_bridge_height + MAX_TILE_EXTENT_TOP) last_row = false;
+ } else {
+ /* Outside of map. If we are on the north border of the map, there may still be a bridge visible,
+ * so we need to loop over more rows to possibly find one. */
+ if ((tilecoord.x <= 0 || tilecoord.y <= 0) && min_visible_height < potential_bridge_height + MAX_TILE_EXTENT_TOP) last_row = false;
+ }
}
if (tile_visible) {
@@ -1673,6 +1678,9 @@ void ViewportDoDraw(const Viewport *vp, int left, int top, int right, int bottom
_vd.dpi.dst_ptr = BlitterFactory::GetCurrentBlitter()->MoveTo(old_dpi->dst_ptr, x - old_dpi->left, y - old_dpi->top);
+ /* Определение слоя (который будем рисовать) */
+ _vd.dpi.layer = calculateLayer(vp);
+
ViewportAddLandscape();
ViewportAddVehicles(&_vd.dpi);
diff --git a/src/viewport_func.h b/src/viewport_func.h
index 466a24a3b..5aca63aee 100644
--- a/src/viewport_func.h
+++ b/src/viewport_func.h
@@ -31,6 +31,7 @@ void MarkAllViewportsDirty(int left, int top, int right, int bottom);
bool DoZoomInOutWindow(ZoomStateChange how, Window *w);
void ZoomInOrOutToCursorWindow(bool in, Window * w);
+void LayerUpOrDownToCursorWindow(bool in, Window * w);
Point GetTileZoomCenterWindow(bool in, Window * w);
void FixTitleGameZoom();
void HandleZoomMessage(Window *w, const Viewport *vp, byte widget_zoom_in, byte widget_zoom_out);
diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp
index 5047f04f3..3c02f9ab8 100644
--- a/src/viewport_gui.cpp
+++ b/src/viewport_gui.cpp
@@ -14,6 +14,7 @@
#include "strings_func.h"
#include "zoom_func.h"
#include "window_func.h"
+#include "gfx_func.h"
#include "widgets/viewport_widget.h"
@@ -137,7 +138,11 @@ public:
void OnMouseWheel(int wheel) override
{
if (_settings_client.gui.scrollwheel_scrolling != 2) {
- ZoomInOrOutToCursorWindow(wheel < 0, this);
+ if (_ctrl_pressed) {
+ LayerUpOrDownToCursorWindow(wheel < 0, this);
+ } else {
+ ZoomInOrOutToCursorWindow(wheel < 0, this);
+ }
}
}
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 5e37c16dd..29541fb72 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -10,6 +10,7 @@
#include "stdafx.h"
#include "cmd_helper.h"
#include "landscape.h"
+#include "layer_func.h"
#include "viewport_func.h"
#include "command_func.h"
#include "town.h"
@@ -466,6 +467,11 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* can't make water of water! */
if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue;
+ /* can't make underground water */
+ if (IsUnderground(tile)) {
+ return_cmd_error(STR_ERROR_UNDERGROUND_CAN_T_BUILD_UNDER_GROUND);
+ }
+
bool water = IsWaterTile(tile);
ret = DoCommand(tile, 0, 0, flags | DC_FORCE_CLEAR_TILE, CMD_LANDSCAPE_CLEAR);
if (ret.Failed()) return ret;
@@ -1097,6 +1103,9 @@ void DoFloodTile(TileIndex target)
{
assert(!IsTileType(target, MP_WATER));
+ /* Подземная часть карты не заливается */
+ if (IsUnderground(target)) return;
+
bool flooded = false; // Will be set to true if something is changed.
Backup<CompanyID> cur_company(_current_company, OWNER_WATER, FILE_LINE);
@@ -1256,7 +1265,7 @@ void ConvertGroundTilesIntoWaterTiles()
for (TileIndex tile = 0; tile < MapSize(); ++tile) {
Slope slope = GetTileSlope(tile, &z);
- if (IsTileType(tile, MP_CLEAR) && z == 0) {
+ if (IsTileType(tile, MP_CLEAR) && z == 0 && !IsUnderground(tile)) {
/* Make both water for tiles at level 0
* and make shore, as that looks much better
* during the generation. */
diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt
index 18ecd529e..509adda58 100644
--- a/src/widgets/CMakeLists.txt
+++ b/src/widgets/CMakeLists.txt
@@ -55,6 +55,7 @@ add_files(
town_widget.h
transparency_widget.h
tree_widget.h
+ underground_widget.h
vehicle_widget.h
viewport_widget.h
waypoint_widget.h
diff --git a/src/widgets/genworld_widget.h b/src/widgets/genworld_widget.h
index f7bf20e95..f7af296f6 100644
--- a/src/widgets/genworld_widget.h
+++ b/src/widgets/genworld_widget.h
@@ -19,6 +19,7 @@ enum GenerateLandscapeWidgets {
WID_GL_MAPSIZE_X_PULLDOWN, ///< Dropdown 'map X size'.
WID_GL_MAPSIZE_Y_PULLDOWN, ///< Dropdown 'map Y size'.
+ WID_GL_LAYER_COUNT_PULLDOWN, ///< Dropdown 'map layer count'.
WID_GL_TOWN_PULLDOWN, ///< Dropdown 'No. of towns'.
WID_GL_INDUSTRY_PULLDOWN, ///< Dropdown 'No. of industries'.
@@ -67,6 +68,7 @@ enum CreateScenarioWidgets {
WID_CS_RANDOM_WORLD, ///< Generate random land button
WID_CS_MAPSIZE_X_PULLDOWN, ///< Pull-down arrow for x map size.
WID_CS_MAPSIZE_Y_PULLDOWN, ///< Pull-down arrow for y map size.
+ WID_CS_LAYER_COUNT_PULLDOWN, ///< Pull-down arrow for map layer count.
WID_CS_START_DATE_DOWN, ///< Decrease start year (start earlier).
WID_CS_START_DATE_TEXT, ///< Clickable start date value.
WID_CS_START_DATE_UP, ///< Increase start year (start later).
diff --git a/src/widgets/toolbar_widget.h b/src/widgets/toolbar_widget.h
index d68de4970..0b4e53227 100644
--- a/src/widgets/toolbar_widget.h
+++ b/src/widgets/toolbar_widget.h
@@ -41,6 +41,7 @@ enum ToolbarNormalWidgets {
WID_TN_WATER, ///< Water building toolbar.
WID_TN_AIR, ///< Airport building toolbar.
WID_TN_LANDSCAPE, ///< Landscaping toolbar.
+ WID_TN_UNDERGROUND, ///< Landscaping toolbar.
WID_TN_MUSIC_SOUND, ///< Music/sound configuration menu.
WID_TN_MESSAGES, ///< Messages menu.
WID_TN_HELP, ///< Help menu.
diff --git a/src/widgets/underground_widget.h b/src/widgets/underground_widget.h
new file mode 100644
index 000000000..522c9db8b
--- /dev/null
+++ b/src/widgets/underground_widget.h
@@ -0,0 +1,21 @@
+/* $Id: terraform_widget.h 23600 2011-12-19 20:46:17Z truebrain $ */
+
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/** @file terraform_widget.h Types related to the terraform widgets. */
+
+#ifndef WIDGETS_UNDERGROUND_WIDGET_H
+#define WIDGETS_UNDERGROUND_WIDGET_H
+
+/** Widgets of the #TerraformToolbarWindow class. */
+enum UndergroundToolbarWidgets {
+ WID_UT_BUILD_ESCALATOR, ///< Build escalator
+ WID_UT_DEMOLISH, ///< Demolish aka dynamite button.
+};
+
+#endif /* WIDGETS_UNDERGROUND_WIDGET_H */
diff --git a/src/window_type.h b/src/window_type.h
index 86dcc6fb3..02533dd03 100644
--- a/src/window_type.h
+++ b/src/window_type.h
@@ -441,6 +441,12 @@ enum WindowClass {
*/
WC_SCEN_LAND_GEN,
+ /**
+ * Underground (in game); %Window numbers:
+ * - 0 = #UndergroundToolbarWidgets
+ */
+ WC_UNDERGROUND,
+
/**
* Generate landscape (newgame); %Window numbers:
* - GLWM_SCENARIO = #CreateScenarioWidgets
|