author | glx |
Mon, 24 Sep 2007 03:08:47 +0000 | |
branch | 0.5 |
changeset 5545 | f42dc59a45f5 |
parent 5542 | c719509fb0b7 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
0 | 3 |
#include "stdafx.h" |
1891
92a3b0aa0946
(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents:
1363
diff
changeset
|
4 |
#include "openttd.h" |
4212
0308ef21b4e1
(svn r5723) - Move the declaration of DrawRoadDepotSprite() out of functions.h (but I'm not too happy with the new header)
tron
parents:
4171
diff
changeset
|
5 |
#include "road_cmd.h" |
3150
025fe8cd7104
(svn r3773) Shove some semantics down ottd's throat by replacing ints and magic numbers by enums and some related changes
tron
parents:
3132
diff
changeset
|
6 |
#include "road_map.h" |
1363
01d3de5d8039
(svn r1867) Include tables/sprites.h only in files which need it
tron
parents:
1217
diff
changeset
|
7 |
#include "table/sprites.h" |
507
8aa8100b0b22
(svn r815) Include strings.h only in the files which need it.
tron
parents:
337
diff
changeset
|
8 |
#include "table/strings.h" |
2163
637ec3c361f5
(svn r2673) Include functions.h directly, not globally via openttd.h
tron
parents:
2159
diff
changeset
|
9 |
#include "functions.h" |
679
e959706a3e4d
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
661
diff
changeset
|
10 |
#include "map.h" |
1209
a1ac96655b79
(svn r1713) Split off several functions which query/set information about a single tile from map.h and put them into a seperate file tile.h
tron
parents:
1116
diff
changeset
|
11 |
#include "tile.h" |
0 | 12 |
#include "window.h" |
13 |
#include "gui.h" |
|
14 |
#include "viewport.h" |
|
15 |
#include "gfx.h" |
|
337
66647f97e7c0
(svn r513) Merge revisions 402, 416, 417, 478, 479, 511, 512 from map to trunk
tron
parents:
193
diff
changeset
|
16 |
#include "sound.h" |
0 | 17 |
#include "command.h" |
2159
3b634157c3b2
(svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents:
2049
diff
changeset
|
18 |
#include "variables.h" |
568
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
543
diff
changeset
|
19 |
//needed for catchments |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
543
diff
changeset
|
20 |
#include "station.h" |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
543
diff
changeset
|
21 |
|
0 | 22 |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1072
diff
changeset
|
23 |
static void ShowBusStationPicker(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1072
diff
changeset
|
24 |
static void ShowTruckStationPicker(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1072
diff
changeset
|
25 |
static void ShowRoadDepotPicker(void); |
0 | 26 |
|
27 |
static bool _remove_button_clicked; |
|
28 |
||
29 |
static byte _place_road_flag; |
|
30 |
||
31 |
static byte _road_depot_orientation; |
|
32 |
static byte _road_station_picker_orientation; |
|
33 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
34 |
void CcPlaySound1D(bool success, TileIndex tile, uint32 p1, uint32 p2) |
0 | 35 |
{ |
541 | 36 |
if (success) SndPlayTileFx(SND_1F_SPLAT, tile); |
0 | 37 |
} |
38 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
39 |
static void PlaceRoad_NE(TileIndex tile) |
0 | 40 |
{ |
41 |
_place_road_flag = (_tile_fract_coords.y >= 8) + 4; |
|
42 |
VpStartPlaceSizing(tile, VPM_FIX_X); |
|
43 |
} |
|
44 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
45 |
static void PlaceRoad_NW(TileIndex tile) |
0 | 46 |
{ |
47 |
_place_road_flag = (_tile_fract_coords.x >= 8) + 0; |
|
48 |
VpStartPlaceSizing(tile, VPM_FIX_Y); |
|
49 |
} |
|
50 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
51 |
static void PlaceRoad_Bridge(TileIndex tile) |
0 | 52 |
{ |
53 |
VpStartPlaceSizing(tile, VPM_X_OR_Y); |
|
54 |
} |
|
55 |
||
56 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
57 |
void CcBuildRoadTunnel(bool success, TileIndex tile, uint32 p1, uint32 p2) |
0 | 58 |
{ |
59 |
if (success) { |
|
541 | 60 |
SndPlayTileFx(SND_20_SPLAT_2, tile); |
0 | 61 |
ResetObjectToPlace(); |
62 |
} else { |
|
63 |
SetRedErrorSquare(_build_tunnel_endtile); |
|
64 |
} |
|
65 |
} |
|
66 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
67 |
static void PlaceRoad_Tunnel(TileIndex tile) |
0 | 68 |
{ |
5542
c719509fb0b7
(svn r11074) [0.5] -Backport from trunk (r11040):
rubidium
parents:
5379
diff
changeset
|
69 |
DoCommandP(tile, 0x200, 0, CcBuildRoadTunnel, CMD_BUILD_TUNNEL | CMD_MSG(STR_5016_CAN_T_BUILD_TUNNEL_HERE)); |
0 | 70 |
} |
71 |
||
3151 | 72 |
static void BuildRoadOutsideStation(TileIndex tile, DiagDirection direction) |
0 | 73 |
{ |
4559
c853d2440065
(svn r6406) -Codechange: Rename TileOffsByDir to TileOffsByDiagDir because it accepts
Darkvater
parents:
4435
diff
changeset
|
74 |
tile += TileOffsByDiagDir(direction); |
5
539c9743d999
(svn r6) -Fix [1006530] BuildRoadOutsideStation fix. Fix bug [994720] road depot - bus/lorry station (Truelight+Darkvater :P )
darkvater
parents:
0
diff
changeset
|
75 |
// if there is a roadpiece just outside of the station entrance, build a connecting route |
3793
33cdb5bf7b21
(svn r4789) - Codechange: rename RoadType to RoadTileType and ROAD_{NORMAL,CROSSING,DEPOT} to ROAD_TILE_* for consistency
rubidium
parents:
3491
diff
changeset
|
76 |
if (IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_NORMAL) { |
3151 | 77 |
DoCommandP(tile, DiagDirToRoadBits(ReverseDiagDir(direction)), 0, NULL, CMD_BUILD_ROAD); |
0 | 78 |
} |
79 |
} |
|
80 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
81 |
void CcRoadDepot(bool success, TileIndex tile, uint32 p1, uint32 p2) |
0 | 82 |
{ |
83 |
if (success) { |
|
541 | 84 |
SndPlayTileFx(SND_1F_SPLAT, tile); |
0 | 85 |
ResetObjectToPlace(); |
3151 | 86 |
BuildRoadOutsideStation(tile, p1); |
0 | 87 |
} |
88 |
} |
|
89 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
90 |
static void PlaceRoad_Depot(TileIndex tile) |
0 | 91 |
{ |
5542
c719509fb0b7
(svn r11074) [0.5] -Backport from trunk (r11040):
rubidium
parents:
5379
diff
changeset
|
92 |
DoCommandP(tile, _road_depot_orientation, 0, CcRoadDepot, CMD_BUILD_ROAD_DEPOT | CMD_NO_WATER | CMD_MSG(STR_1807_CAN_T_BUILD_ROAD_VEHICLE)); |
0 | 93 |
} |
94 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
95 |
static void PlaceRoad_BusStation(TileIndex tile) |
0 | 96 |
{ |
5542
c719509fb0b7
(svn r11074) [0.5] -Backport from trunk (r11040):
rubidium
parents:
5379
diff
changeset
|
97 |
DoCommandP(tile, _road_station_picker_orientation, RS_BUS, CcRoadDepot, CMD_BUILD_ROAD_STOP | CMD_NO_WATER | CMD_MSG(STR_1808_CAN_T_BUILD_BUS_STATION)); |
0 | 98 |
} |
99 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
100 |
static void PlaceRoad_TruckStation(TileIndex tile) |
0 | 101 |
{ |
5542
c719509fb0b7
(svn r11074) [0.5] -Backport from trunk (r11040):
rubidium
parents:
5379
diff
changeset
|
102 |
DoCommandP(tile, _road_station_picker_orientation, RS_TRUCK, CcRoadDepot, CMD_BUILD_ROAD_STOP | CMD_NO_WATER | CMD_MSG(STR_1809_CAN_T_BUILD_TRUCK_STATION)); |
0 | 103 |
} |
104 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
105 |
static void PlaceRoad_DemolishArea(TileIndex tile) |
0 | 106 |
{ |
107 |
VpStartPlaceSizing(tile, 4); |
|
108 |
} |
|
109 |
||
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
110 |
|
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
111 |
enum { |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
112 |
RTW_ROAD_X = 3, |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
113 |
RTW_ROAD_Y = 4, |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
114 |
RTW_DEMOLISH = 5, |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
115 |
RTW_DEPOT = 6, |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
116 |
RTW_BUS_STATION = 7, |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
117 |
RTW_TRUCK_STATION = 8, |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
118 |
RTW_BUILD_BRIDGE = 9, |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
119 |
RTW_BUILD_TUNNEL = 10, |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
120 |
RTW_REMOVE = 11 |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
121 |
}; |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
122 |
|
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
123 |
|
0 | 124 |
typedef void OnButtonClick(Window *w); |
125 |
||
126 |
static void BuildRoadClick_NE(Window *w) |
|
127 |
{ |
|
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
128 |
HandlePlacePushButton(w, RTW_ROAD_X, SPR_CURSOR_ROAD_NESW, 1, PlaceRoad_NE); |
0 | 129 |
} |
130 |
||
131 |
static void BuildRoadClick_NW(Window *w) |
|
132 |
{ |
|
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
133 |
HandlePlacePushButton(w, RTW_ROAD_Y, SPR_CURSOR_ROAD_NWSE, 1, PlaceRoad_NW); |
0 | 134 |
} |
135 |
||
136 |
||
137 |
static void BuildRoadClick_Demolish(Window *w) |
|
138 |
{ |
|
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
139 |
HandlePlacePushButton(w, RTW_DEMOLISH, ANIMCURSOR_DEMOLISH, 1, PlaceRoad_DemolishArea); |
0 | 140 |
} |
141 |
||
142 |
static void BuildRoadClick_Depot(Window *w) |
|
143 |
{ |
|
661
a0bdbdffb06a
(svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents:
651
diff
changeset
|
144 |
if (_game_mode == GM_EDITOR) return; |
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
145 |
if (HandlePlacePushButton(w, RTW_DEPOT, SPR_CURSOR_ROAD_DEPOT, 1, PlaceRoad_Depot)) ShowRoadDepotPicker(); |
0 | 146 |
} |
147 |
||
148 |
static void BuildRoadClick_BusStation(Window *w) |
|
149 |
{ |
|
661
a0bdbdffb06a
(svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents:
651
diff
changeset
|
150 |
if (_game_mode == GM_EDITOR) return; |
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
151 |
if (HandlePlacePushButton(w, RTW_BUS_STATION, SPR_CURSOR_BUS_STATION, 1, PlaceRoad_BusStation)) ShowBusStationPicker(); |
0 | 152 |
} |
153 |
||
154 |
static void BuildRoadClick_TruckStation(Window *w) |
|
155 |
{ |
|
661
a0bdbdffb06a
(svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents:
651
diff
changeset
|
156 |
if (_game_mode == GM_EDITOR) return; |
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
157 |
if (HandlePlacePushButton(w, RTW_TRUCK_STATION, SPR_CURSOR_TRUCK_STATION, 1, PlaceRoad_TruckStation)) ShowTruckStationPicker(); |
0 | 158 |
} |
159 |
||
160 |
static void BuildRoadClick_Bridge(Window *w) |
|
161 |
{ |
|
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
162 |
HandlePlacePushButton(w, RTW_BUILD_BRIDGE, SPR_CURSOR_BRIDGE, 1, PlaceRoad_Bridge); |
0 | 163 |
} |
164 |
||
165 |
static void BuildRoadClick_Tunnel(Window *w) |
|
166 |
{ |
|
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
167 |
HandlePlacePushButton(w, RTW_BUILD_TUNNEL, SPR_CURSOR_ROAD_TUNNEL, 3, PlaceRoad_Tunnel); |
0 | 168 |
} |
169 |
||
170 |
static void BuildRoadClick_Remove(Window *w) |
|
171 |
{ |
|
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
172 |
if (IsWindowWidgetDisabled(w, RTW_REMOVE)) return; |
0 | 173 |
SetWindowDirty(w); |
541 | 174 |
SndPlayFx(SND_15_BEEP); |
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
175 |
ToggleWidgetLoweredState(w, RTW_REMOVE); |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
176 |
SetSelectionRed(IsWindowWidgetLowered(w, RTW_REMOVE)); |
0 | 177 |
} |
178 |
||
606
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
179 |
static void BuildRoadClick_Landscaping(Window *w) |
0 | 180 |
{ |
606
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
181 |
ShowTerraformToolbar(); |
0 | 182 |
} |
183 |
||
2639 | 184 |
static OnButtonClick* const _build_road_button_proc[] = { |
0 | 185 |
BuildRoadClick_NE, |
186 |
BuildRoadClick_NW, |
|
187 |
BuildRoadClick_Demolish, |
|
188 |
BuildRoadClick_Depot, |
|
189 |
BuildRoadClick_BusStation, |
|
190 |
BuildRoadClick_TruckStation, |
|
191 |
BuildRoadClick_Bridge, |
|
192 |
BuildRoadClick_Tunnel, |
|
193 |
BuildRoadClick_Remove, |
|
606
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
194 |
BuildRoadClick_Landscaping, |
0 | 195 |
}; |
196 |
||
4171 | 197 |
static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) |
2639 | 198 |
{ |
199 |
switch (e->event) { |
|
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
200 |
case WE_CREATE: DisableWindowWidget(w, RTW_REMOVE); break; |
5105
4332193c0aec
(svn r7176) -Fix: remove button was not always disabled when it should have been (rail/road build toolbar)
glx
parents:
5072
diff
changeset
|
201 |
|
0 | 202 |
case WE_PAINT: |
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
203 |
if (IsWindowWidgetLowered(w, RTW_ROAD_X) || IsWindowWidgetLowered(w, RTW_ROAD_Y)) { |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
204 |
EnableWindowWidget(w, RTW_REMOVE); |
0 | 205 |
} |
206 |
DrawWindowWidgets(w); |
|
207 |
break; |
|
208 |
||
209 |
case WE_CLICK: { |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
210 |
if (e->we.click.widget >= 3) _build_road_button_proc[e->we.click.widget - 3](w); |
0 | 211 |
} break; |
212 |
||
213 |
case WE_KEYPRESS: |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
214 |
switch (e->we.keypress.keycode) { |
2631
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
215 |
case '1': BuildRoadClick_NE(w); break; |
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
216 |
case '2': BuildRoadClick_NW(w); break; |
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
217 |
case '3': BuildRoadClick_Demolish(w); break; |
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
218 |
case '4': BuildRoadClick_Depot(w); break; |
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
219 |
case '5': BuildRoadClick_BusStation(w); break; |
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
220 |
case '6': BuildRoadClick_TruckStation(w); break; |
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
221 |
case 'B': BuildRoadClick_Bridge(w); break; |
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
222 |
case 'T': BuildRoadClick_Tunnel(w); break; |
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
223 |
case 'R': BuildRoadClick_Remove(w); break; |
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
224 |
case 'L': BuildRoadClick_Landscaping(w); break; |
13daba67f217
(svn r3173) Use the trinary operator and switch to improve readability
tron
parents:
2619
diff
changeset
|
225 |
default: return; |
0 | 226 |
} |
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
227 |
MarkTileDirty(_thd.pos.x, _thd.pos.y); // redraw tile selection |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
228 |
e->we.keypress.cont = false; |
0 | 229 |
break; |
230 |
||
231 |
case WE_PLACE_OBJ: |
|
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
232 |
_remove_button_clicked = IsWindowWidgetLowered(w, RTW_REMOVE); |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
233 |
_place_proc(e->we.place.tile); |
0 | 234 |
break; |
235 |
||
236 |
case WE_ABORT_PLACE_OBJ: |
|
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
237 |
RaiseWindowButtons(w); |
5147
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
238 |
DisableWindowWidget(w, RTW_REMOVE); |
db717cde801d
(svn r7239) Enumerate the widgets in the airport, dock, rail and road toolbars
tron
parents:
5105
diff
changeset
|
239 |
InvalidateWidget(w, RTW_REMOVE); |
0 | 240 |
|
241 |
w = FindWindowById(WC_BUS_STATION, 0); |
|
2639 | 242 |
if (w != NULL) WP(w,def_d).close = true; |
0 | 243 |
w = FindWindowById(WC_TRUCK_STATION, 0); |
2639 | 244 |
if (w != NULL) WP(w,def_d).close = true; |
0 | 245 |
w = FindWindowById(WC_BUILD_DEPOT, 0); |
2639 | 246 |
if (w != NULL) WP(w,def_d).close = true; |
0 | 247 |
break; |
248 |
||
249 |
case WE_PLACE_DRAG: { |
|
250 |
int sel_method; |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
251 |
switch (e->we.place.userdata) { |
4435
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
252 |
case 1: |
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
253 |
sel_method = VPM_FIX_X; |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
254 |
_place_road_flag = (_place_road_flag & ~2) | ((e->we.place.pt.y & 8) >> 2); |
4435
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
255 |
break; |
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
256 |
|
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
257 |
case 2: |
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
258 |
sel_method = VPM_FIX_Y; |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
259 |
_place_road_flag = (_place_road_flag & ~2) | ((e->we.place.pt.x & 8) >> 2); |
4435
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
260 |
break; |
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
261 |
|
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
262 |
case 4: |
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
263 |
sel_method = VPM_X_AND_Y; |
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
264 |
break; |
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
265 |
|
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
266 |
default: |
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
267 |
sel_method = VPM_X_OR_Y; |
cde1d8fc5c8f
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
belugas
parents:
4434
diff
changeset
|
268 |
break; |
0 | 269 |
} |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
270 |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
271 |
VpSelectTilesWithMethod(e->we.place.pt.x, e->we.place.pt.y, sel_method); |
0 | 272 |
return; |
273 |
} |
|
274 |
||
275 |
case WE_PLACE_MOUSEUP: |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
276 |
if (e->we.place.pt.x != -1) { |
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
277 |
TileIndex start_tile = e->we.place.starttile; |
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
278 |
TileIndex end_tile = e->we.place.tile; |
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
279 |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
280 |
if (e->we.place.userdata == 0) { |
0 | 281 |
ResetObjectToPlace(); |
282 |
ShowBuildBridgeWindow(start_tile, end_tile, 0x80); |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
283 |
} else if (e->we.place.userdata != 4) { |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
284 |
DoCommandP(end_tile, start_tile, _place_road_flag, CcPlaySound1D, |
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
285 |
_remove_button_clicked ? |
5542
c719509fb0b7
(svn r11074) [0.5] -Backport from trunk (r11040):
rubidium
parents:
5379
diff
changeset
|
286 |
CMD_REMOVE_LONG_ROAD | CMD_NO_WATER | CMD_MSG(STR_1805_CAN_T_REMOVE_ROAD_FROM) : |
c719509fb0b7
(svn r11074) [0.5] -Backport from trunk (r11040):
rubidium
parents:
5379
diff
changeset
|
287 |
CMD_BUILD_LONG_ROAD | CMD_NO_WATER | CMD_MSG(STR_1804_CAN_T_BUILD_ROAD_HERE)); |
0 | 288 |
} else { |
4008
68cc4bba4c2b
(svn r5219) CMD_CLEAR_AREA doesn't use p2, so don't pass anything seemingly meaningful
tron
parents:
4000
diff
changeset
|
289 |
DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_CLEAR_AREA | CMD_MSG(STR_00B5_CAN_T_CLEAR_THIS_AREA)); |
0 | 290 |
} |
291 |
} |
|
292 |
break; |
|
293 |
||
294 |
case WE_PLACE_PRESIZE: { |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
295 |
TileIndex tile = e->we.place.tile; |
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1914
diff
changeset
|
296 |
|
3491
4c8427796c64
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
tron
parents:
3151
diff
changeset
|
297 |
DoCommand(tile, 0x200, 0, DC_AUTO, CMD_BUILD_TUNNEL); |
4000
bab1ebc37da0
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3793
diff
changeset
|
298 |
VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); |
0 | 299 |
break; |
300 |
} |
|
2619
c2f488e400b1
(svn r3157) - Feature: Added patch option to link the terraform toolbar to the rail, road, water and airport toolbars. If enabled, the terraform toolbar will open and close with those toolbars.
peter1138
parents:
2186
diff
changeset
|
301 |
|
c2f488e400b1
(svn r3157) - Feature: Added patch option to link the terraform toolbar to the rail, road, water and airport toolbars. If enabled, the terraform toolbar will open and close with those toolbars.
peter1138
parents:
2186
diff
changeset
|
302 |
case WE_DESTROY: |
c2f488e400b1
(svn r3157) - Feature: Added patch option to link the terraform toolbar to the rail, road, water and airport toolbars. If enabled, the terraform toolbar will open and close with those toolbars.
peter1138
parents:
2186
diff
changeset
|
303 |
if (_patches.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0); |
c2f488e400b1
(svn r3157) - Feature: Added patch option to link the terraform toolbar to the rail, road, water and airport toolbars. If enabled, the terraform toolbar will open and close with those toolbars.
peter1138
parents:
2186
diff
changeset
|
304 |
break; |
0 | 305 |
} |
306 |
} |
|
307 |
||
308 |
static const Widget _build_road_widgets[] = { |
|
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
309 |
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
310 |
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 227, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
311 |
{ WWT_STICKYBOX, RESIZE_NONE, 7, 228, 239, 0, 13, 0x0, STR_STICKY_BUTTON}, |
606
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
312 |
|
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
313 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_ROAD_NW, STR_180B_BUILD_ROAD_SECTION}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
314 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_ROAD_NE, STR_180B_BUILD_ROAD_SECTION}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
315 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 44, 65, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
316 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 66, 87, 14, 35, SPR_IMG_ROAD_DEPOT, STR_180C_BUILD_ROAD_VEHICLE_DEPOT}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
317 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 88, 109, 14, 35, SPR_IMG_BUS_STATION, STR_180D_BUILD_BUS_STATION}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
318 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 110, 131, 14, 35, SPR_IMG_TRUCK_BAY, STR_180E_BUILD_TRUCK_LOADING_BAY}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
319 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 132, 173, 14, 35, SPR_IMG_BRIDGE, STR_180F_BUILD_ROAD_BRIDGE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
320 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 174, 195, 14, 35, SPR_IMG_ROAD_TUNNEL, STR_1810_BUILD_ROAD_TUNNEL}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
321 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 196, 217, 14, 35, SPR_IMG_REMOVE, STR_1811_TOGGLE_BUILD_REMOVE_FOR}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
322 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 218, 239, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
5
diff
changeset
|
323 |
{ WIDGETS_END}, |
0 | 324 |
}; |
325 |
||
326 |
static const WindowDesc _build_road_desc = { |
|
5072
df5bde83a4bc
(svn r7130) -Codechange: Handle the positioning of windows through the desc->left/top settings with
Darkvater
parents:
5070
diff
changeset
|
327 |
WDP_ALIGN_TBR, 22, 240, 36, |
5070
0bbf5264bfb7
(svn r7128) -Codechange: Replace magic numbers by magic enums (windowdesc positioning WDP_AUTO = -1)
Darkvater
parents:
5005
diff
changeset
|
328 |
WC_BUILD_TOOLBAR, 0, |
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
329 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, |
0 | 330 |
_build_road_widgets, |
331 |
BuildRoadToolbWndProc |
|
332 |
}; |
|
333 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1072
diff
changeset
|
334 |
void ShowBuildRoadToolbar(void) |
0 | 335 |
{ |
5005
21e84e53c732
(svn r7022) -Fix [FS#292]: Properly guard against viewing company-sensitive information from
Darkvater
parents:
4938
diff
changeset
|
336 |
if (!IsValidPlayer(_current_player)) return; |
21e84e53c732
(svn r7022) -Fix [FS#292]: Properly guard against viewing company-sensitive information from
Darkvater
parents:
4938
diff
changeset
|
337 |
|
0 | 338 |
DeleteWindowById(WC_BUILD_TOOLBAR, 0); |
339 |
AllocateWindowDesc(&_build_road_desc); |
|
2619
c2f488e400b1
(svn r3157) - Feature: Added patch option to link the terraform toolbar to the rail, road, water and airport toolbars. If enabled, the terraform toolbar will open and close with those toolbars.
peter1138
parents:
2186
diff
changeset
|
340 |
if (_patches.link_terraform_toolbar) ShowTerraformToolbar(); |
0 | 341 |
} |
342 |
||
343 |
static const Widget _build_road_scen_widgets[] = { |
|
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
344 |
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
5379 | 345 |
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 140, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
346 |
{ WWT_STICKYBOX, RESIZE_NONE, 7, 141, 152, 0, 13, 0x0, STR_STICKY_BUTTON}, |
|
661
a0bdbdffb06a
(svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents:
651
diff
changeset
|
347 |
|
4937
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4848
diff
changeset
|
348 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_ROAD_NW, STR_180B_BUILD_ROAD_SECTION}, |
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4848
diff
changeset
|
349 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_ROAD_NE, STR_180B_BUILD_ROAD_SECTION}, |
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4848
diff
changeset
|
350 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 44, 65, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
351 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
352 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
353 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
4937
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4848
diff
changeset
|
354 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 66, 107, 14, 35, SPR_IMG_BRIDGE, STR_180F_BUILD_ROAD_BRIDGE}, |
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4848
diff
changeset
|
355 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 108, 129, 14, 35, SPR_IMG_ROAD_TUNNEL, STR_1810_BUILD_ROAD_TUNNEL}, |
a525d56a8d40
(svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names.
Darkvater
parents:
4848
diff
changeset
|
356 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 130, 151, 14, 35, SPR_IMG_REMOVE, STR_1811_TOGGLE_BUILD_REMOVE_FOR}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
5
diff
changeset
|
357 |
{ WIDGETS_END}, |
0 | 358 |
}; |
359 |
||
360 |
static const WindowDesc _build_road_scen_desc = { |
|
5379 | 361 |
WDP_AUTO, WDP_AUTO, 152, 36, |
362 |
WC_SCEN_BUILD_ROAD, 0, |
|
777
3d7798da0f10
(svn r1243) -Fix: Scenario road-building toolbar also stickified. Thx for the notice teeone
darkvater
parents:
756
diff
changeset
|
363 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, |
0 | 364 |
_build_road_scen_widgets, |
365 |
BuildRoadToolbWndProc |
|
366 |
}; |
|
367 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1072
diff
changeset
|
368 |
void ShowBuildRoadScenToolbar(void) |
0 | 369 |
{ |
370 |
AllocateWindowDescFront(&_build_road_scen_desc, 0); |
|
371 |
} |
|
372 |
||
4171 | 373 |
static void BuildRoadDepotWndProc(Window *w, WindowEvent *e) |
2639 | 374 |
{ |
375 |
switch (e->event) { |
|
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
376 |
case WE_CREATE: LowerWindowWidget(w, _road_depot_orientation + 3); break; |
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
377 |
|
0 | 378 |
case WE_PAINT: |
379 |
DrawWindowWidgets(w); |
|
380 |
||
4212
0308ef21b4e1
(svn r5723) - Move the declaration of DrawRoadDepotSprite() out of functions.h (but I'm not too happy with the new header)
tron
parents:
4171
diff
changeset
|
381 |
DrawRoadDepotSprite(70, 17, DIAGDIR_NE); |
0308ef21b4e1
(svn r5723) - Move the declaration of DrawRoadDepotSprite() out of functions.h (but I'm not too happy with the new header)
tron
parents:
4171
diff
changeset
|
382 |
DrawRoadDepotSprite(70, 69, DIAGDIR_SE); |
0308ef21b4e1
(svn r5723) - Move the declaration of DrawRoadDepotSprite() out of functions.h (but I'm not too happy with the new header)
tron
parents:
4171
diff
changeset
|
383 |
DrawRoadDepotSprite( 2, 69, DIAGDIR_SW); |
0308ef21b4e1
(svn r5723) - Move the declaration of DrawRoadDepotSprite() out of functions.h (but I'm not too happy with the new header)
tron
parents:
4171
diff
changeset
|
384 |
DrawRoadDepotSprite( 2, 17, DIAGDIR_NW); |
0 | 385 |
break; |
386 |
||
387 |
case WE_CLICK: { |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
388 |
switch (e->we.click.widget) { |
1116
a38aed715c95
(svn r1617) -Fix: Ugly hack to only call ResetObjectToPlaceon childwindows of build-toolbar if the window is closed manually (with 'X'); if not checked ResetObjectToPlace is called twice resulting in undesired actions (eg. clicked button is unclicked immediately).
darkvater
parents:
1109
diff
changeset
|
389 |
case 3: case 4: case 5: case 6: |
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
390 |
RaiseWindowWidget(w, _road_depot_orientation + 3); |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
391 |
_road_depot_orientation = e->we.click.widget - 3; |
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
392 |
LowerWindowWidget(w, _road_depot_orientation + 3); |
541 | 393 |
SndPlayFx(SND_15_BEEP); |
0 | 394 |
SetWindowDirty(w); |
395 |
break; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
396 |
} |
0 | 397 |
} break; |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
398 |
|
0 | 399 |
case WE_MOUSELOOP: |
2639 | 400 |
if (WP(w,def_d).close) DeleteWindow(w); |
0 | 401 |
break; |
1072
01bf9fc64236
(svn r1573) -Fix: Station and depot building mode is now terminated if the
celestar
parents:
1035
diff
changeset
|
402 |
|
01bf9fc64236
(svn r1573) -Fix: Station and depot building mode is now terminated if the
celestar
parents:
1035
diff
changeset
|
403 |
case WE_DESTROY: |
2639 | 404 |
if (!WP(w,def_d).close) ResetObjectToPlace(); |
1072
01bf9fc64236
(svn r1573) -Fix: Station and depot building mode is now terminated if the
celestar
parents:
1035
diff
changeset
|
405 |
break; |
0 | 406 |
} |
407 |
} |
|
408 |
||
409 |
static const Widget _build_road_depot_widgets[] = { |
|
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
410 |
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
411 |
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_1806_ROAD_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
412 |
{ WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 121, 0x0, STR_NULL}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
413 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
414 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
415 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
416 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
5
diff
changeset
|
417 |
{ WIDGETS_END}, |
0 | 418 |
}; |
419 |
||
420 |
static const WindowDesc _build_road_depot_desc = { |
|
5070
0bbf5264bfb7
(svn r7128) -Codechange: Replace magic numbers by magic enums (windowdesc positioning WDP_AUTO = -1)
Darkvater
parents:
5005
diff
changeset
|
421 |
WDP_AUTO, WDP_AUTO, 140, 122, |
0bbf5264bfb7
(svn r7128) -Codechange: Replace magic numbers by magic enums (windowdesc positioning WDP_AUTO = -1)
Darkvater
parents:
5005
diff
changeset
|
422 |
WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, |
0 | 423 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
424 |
_build_road_depot_widgets, |
|
425 |
BuildRoadDepotWndProc |
|
426 |
}; |
|
427 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1072
diff
changeset
|
428 |
static void ShowRoadDepotPicker(void) |
0 | 429 |
{ |
430 |
AllocateWindowDesc(&_build_road_depot_desc); |
|
431 |
} |
|
432 |
||
987
ea47ad079de8
(svn r1485) -Fix: [1031451] Catchment area shows when buying sign. Catchment area wasn't reset when road station window was unselected
darkvater
parents:
946
diff
changeset
|
433 |
static void RoadStationPickerWndProc(Window *w, WindowEvent *e) |
ea47ad079de8
(svn r1485) -Fix: [1031451] Catchment area shows when buying sign. Catchment area wasn't reset when road station window was unselected
darkvater
parents:
946
diff
changeset
|
434 |
{ |
2952 | 435 |
switch (e->event) { |
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
436 |
case WE_CREATE: |
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
437 |
LowerWindowWidget(w, _road_station_picker_orientation + 3); |
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
438 |
LowerWindowWidget(w, _station_show_coverage + 7); |
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
439 |
break; |
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
440 |
|
0 | 441 |
case WE_PAINT: { |
442 |
int image; |
|
443 |
||
987
ea47ad079de8
(svn r1485) -Fix: [1031451] Catchment area shows when buying sign. Catchment area wasn't reset when road station window was unselected
darkvater
parents:
946
diff
changeset
|
444 |
if (WP(w,def_d).close) return; |
ea47ad079de8
(svn r1485) -Fix: [1031451] Catchment area shows when buying sign. Catchment area wasn't reset when road station window was unselected
darkvater
parents:
946
diff
changeset
|
445 |
|
0 | 446 |
DrawWindowWidgets(w); |
447 |
||
987
ea47ad079de8
(svn r1485) -Fix: [1031451] Catchment area shows when buying sign. Catchment area wasn't reset when road station window was unselected
darkvater
parents:
946
diff
changeset
|
448 |
if (_station_show_coverage) { |
ea47ad079de8
(svn r1485) -Fix: [1031451] Catchment area shows when buying sign. Catchment area wasn't reset when road station window was unselected
darkvater
parents:
946
diff
changeset
|
449 |
int rad = _patches.modified_catchment ? CA_TRUCK /* = CA_BUS */ : 4; |
ea47ad079de8
(svn r1485) -Fix: [1031451] Catchment area shows when buying sign. Catchment area wasn't reset when road station window was unselected
darkvater
parents:
946
diff
changeset
|
450 |
SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad); |
4077
d3022f976946
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
tron
parents:
4008
diff
changeset
|
451 |
} else { |
987
ea47ad079de8
(svn r1485) -Fix: [1031451] Catchment area shows when buying sign. Catchment area wasn't reset when road station window was unselected
darkvater
parents:
946
diff
changeset
|
452 |
SetTileSelectSize(1, 1); |
4077
d3022f976946
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
tron
parents:
4008
diff
changeset
|
453 |
} |
0 | 454 |
|
455 |
image = (w->window_class == WC_BUS_STATION) ? 0x47 : 0x43; |
|
456 |
||
457 |
StationPickerDrawSprite(103, 35, 0, image); |
|
458 |
StationPickerDrawSprite(103, 85, 0, image+1); |
|
459 |
StationPickerDrawSprite(35, 85, 0, image+2); |
|
460 |
StationPickerDrawSprite(35, 35, 0, image+3); |
|
461 |
||
462 |
DrawStationCoverageAreaText(2, 146, |
|
568
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
543
diff
changeset
|
463 |
((w->window_class == WC_BUS_STATION) ? (1<<CT_PASSENGERS) : ~(1<<CT_PASSENGERS)), |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
543
diff
changeset
|
464 |
3); |
0 | 465 |
|
466 |
} break; |
|
467 |
||
468 |
case WE_CLICK: { |
|
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
469 |
switch (e->we.click.widget) { |
1116
a38aed715c95
(svn r1617) -Fix: Ugly hack to only call ResetObjectToPlaceon childwindows of build-toolbar if the window is closed manually (with 'X'); if not checked ResetObjectToPlace is called twice resulting in undesired actions (eg. clicked button is unclicked immediately).
darkvater
parents:
1109
diff
changeset
|
470 |
case 3: case 4: case 5: case 6: |
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
471 |
RaiseWindowWidget(w, _road_station_picker_orientation + 3); |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
472 |
_road_station_picker_orientation = e->we.click.widget - 3; |
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
473 |
LowerWindowWidget(w, _road_station_picker_orientation + 3); |
541 | 474 |
SndPlayFx(SND_15_BEEP); |
0 | 475 |
SetWindowDirty(w); |
476 |
break; |
|
1116
a38aed715c95
(svn r1617) -Fix: Ugly hack to only call ResetObjectToPlaceon childwindows of build-toolbar if the window is closed manually (with 'X'); if not checked ResetObjectToPlace is called twice resulting in undesired actions (eg. clicked button is unclicked immediately).
darkvater
parents:
1109
diff
changeset
|
477 |
case 7: case 8: |
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
478 |
RaiseWindowWidget(w, _station_show_coverage + 7); |
4634
897461a3e9ca
(svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents:
4559
diff
changeset
|
479 |
_station_show_coverage = e->we.click.widget - 7; |
4719
413b21513ef7
(svn r6631) -Codechange: Use accessors for click_state.
belugas
parents:
4709
diff
changeset
|
480 |
LowerWindowWidget(w, _station_show_coverage + 7); |
541 | 481 |
SndPlayFx(SND_15_BEEP); |
0 | 482 |
SetWindowDirty(w); |
483 |
break; |
|
484 |
} |
|
485 |
} break; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
486 |
|
0 | 487 |
case WE_MOUSELOOP: { |
488 |
if (WP(w,def_d).close) { |
|
489 |
DeleteWindow(w); |
|
490 |
return; |
|
491 |
} |
|
492 |
||
493 |
CheckRedrawStationCoverage(w); |
|
494 |
} break; |
|
1109
1bab892228cd
(svn r1610) Remove trailing whitespace (last time ever, i hope)
tron
parents:
1093
diff
changeset
|
495 |
|
1072
01bf9fc64236
(svn r1573) -Fix: Station and depot building mode is now terminated if the
celestar
parents:
1035
diff
changeset
|
496 |
case WE_DESTROY: |
2639 | 497 |
if (!WP(w,def_d).close) ResetObjectToPlace(); |
1072
01bf9fc64236
(svn r1573) -Fix: Station and depot building mode is now terminated if the
celestar
parents:
1035
diff
changeset
|
498 |
break; |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
499 |
} |
0 | 500 |
} |
501 |
||
502 |
static const Widget _bus_station_picker_widgets[] = { |
|
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
503 |
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
504 |
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_3042_BUS_STATION_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
505 |
{ WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 176, 0x0, STR_NULL}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
506 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
507 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
508 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
509 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
510 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 10, 69, 133, 144, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4212
diff
changeset
|
511 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 70, 129, 133, 144, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA}, |
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
512 |
{ WWT_LABEL, RESIZE_NONE, 7, 0, 139, 120, 133, STR_3066_COVERAGE_AREA_HIGHLIGHT, STR_NULL}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
5
diff
changeset
|
513 |
{ WIDGETS_END}, |
0 | 514 |
}; |
515 |
||
516 |
static const WindowDesc _bus_station_picker_desc = { |
|
5070
0bbf5264bfb7
(svn r7128) -Codechange: Replace magic numbers by magic enums (windowdesc positioning WDP_AUTO = -1)
Darkvater
parents:
5005
diff
changeset
|
517 |
WDP_AUTO, WDP_AUTO, 140, 177, |
0bbf5264bfb7
(svn r7128) -Codechange: Replace magic numbers by magic enums (windowdesc positioning WDP_AUTO = -1)
Darkvater
parents:
5005
diff
changeset
|
518 |
WC_BUS_STATION, WC_BUILD_TOOLBAR, |
0 | 519 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
520 |
_bus_station_picker_widgets, |
|
521 |
RoadStationPickerWndProc |
|
522 |
}; |
|
523 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1072
diff
changeset
|
524 |
static void ShowBusStationPicker(void) |
0 | 525 |
{ |
526 |
AllocateWindowDesc(&_bus_station_picker_desc); |
|
527 |
} |
|
528 |
||
529 |
static const Widget _truck_station_picker_widgets[] = { |
|
4345
dd12549ad473
(svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
belugas
parents:
4344
diff
changeset
|
530 |
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
dd12549ad473
(svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
belugas
parents:
4344
diff
changeset
|
531 |
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_3043_TRUCK_STATION_ORIENT, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
dd12549ad473
(svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
belugas
parents:
4344
diff
changeset
|
532 |
{ WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 176, 0x0, STR_NULL}, |
dd12549ad473
(svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
belugas
parents:
4344
diff
changeset
|
533 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, |
dd12549ad473
(svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
belugas
parents:
4344
diff
changeset
|
534 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, |
dd12549ad473
(svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
belugas
parents:
4344
diff
changeset
|
535 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, |
dd12549ad473
(svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
belugas
parents:
4344
diff
changeset
|
536 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, |
dd12549ad473
(svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
belugas
parents:
4344
diff
changeset
|
537 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 10, 69, 133, 144, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE}, |
dd12549ad473
(svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
belugas
parents:
4344
diff
changeset
|
538 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 70, 129, 133, 144, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA}, |
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
539 |
{ WWT_LABEL, RESIZE_NONE, 7, 0, 139, 120, 133, STR_3066_COVERAGE_AREA_HIGHLIGHT, STR_NULL}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
5
diff
changeset
|
540 |
{ WIDGETS_END}, |
0 | 541 |
}; |
542 |
||
543 |
static const WindowDesc _truck_station_picker_desc = { |
|
5070
0bbf5264bfb7
(svn r7128) -Codechange: Replace magic numbers by magic enums (windowdesc positioning WDP_AUTO = -1)
Darkvater
parents:
5005
diff
changeset
|
544 |
WDP_AUTO, WDP_AUTO, 140, 177, |
0bbf5264bfb7
(svn r7128) -Codechange: Replace magic numbers by magic enums (windowdesc positioning WDP_AUTO = -1)
Darkvater
parents:
5005
diff
changeset
|
545 |
WC_TRUCK_STATION, WC_BUILD_TOOLBAR, |
0 | 546 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
547 |
_truck_station_picker_widgets, |
|
548 |
RoadStationPickerWndProc |
|
549 |
}; |
|
550 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1072
diff
changeset
|
551 |
static void ShowTruckStationPicker(void) |
0 | 552 |
{ |
553 |
AllocateWindowDesc(&_truck_station_picker_desc); |
|
554 |
} |
|
555 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1072
diff
changeset
|
556 |
void InitializeRoadGui(void) |
0 | 557 |
{ |
558 |
_road_depot_orientation = 3; |
|
559 |
_road_station_picker_orientation = 3; |
|
560 |
} |