author | celestar |
Sat, 29 Jan 2005 19:41:44 +0000 | |
changeset 1217 | ab9f02a224ab |
parent 1209 | a1ac96655b79 |
child 1363 | 01d3de5d8039 |
permissions | -rw-r--r-- |
0 | 1 |
#include "stdafx.h" |
2 |
#include "ttd.h" |
|
507
8aa8100b0b22
(svn r815) Include strings.h only in the files which need it.
tron
parents:
337
diff
changeset
|
3 |
#include "table/strings.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
|
4 |
#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
|
5 |
#include "tile.h" |
0 | 6 |
#include "window.h" |
7 |
#include "gui.h" |
|
8 |
#include "viewport.h" |
|
9 |
#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
|
10 |
#include "sound.h" |
0 | 11 |
#include "command.h" |
568
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
543
diff
changeset
|
12 |
//needed for catchments |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
543
diff
changeset
|
13 |
#include "station.h" |
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
543
diff
changeset
|
14 |
|
0 | 15 |
|
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
|
16 |
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
|
17 |
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
|
18 |
static void ShowRoadDepotPicker(void); |
0 | 19 |
|
20 |
static bool _remove_button_clicked; |
|
21 |
static bool _build_road_flag; |
|
22 |
||
23 |
static byte _place_road_flag; |
|
24 |
||
25 |
static byte _road_depot_orientation; |
|
26 |
static byte _road_station_picker_orientation; |
|
27 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
541
diff
changeset
|
28 |
void CcPlaySound1D(bool success, uint tile, uint32 p1, uint32 p2) |
0 | 29 |
{ |
541 | 30 |
if (success) SndPlayTileFx(SND_1F_SPLAT, tile); |
0 | 31 |
} |
32 |
||
33 |
static void PlaceRoad_NE(uint tile) |
|
34 |
{ |
|
35 |
_place_road_flag = (_tile_fract_coords.y >= 8) + 4; |
|
36 |
VpStartPlaceSizing(tile, VPM_FIX_X); |
|
37 |
} |
|
38 |
||
39 |
static void PlaceRoad_NW(uint tile) |
|
40 |
{ |
|
41 |
_place_road_flag = (_tile_fract_coords.x >= 8) + 0; |
|
42 |
VpStartPlaceSizing(tile, VPM_FIX_Y); |
|
43 |
} |
|
44 |
||
45 |
static void PlaceRoad_Bridge(uint tile) |
|
46 |
{ |
|
47 |
VpStartPlaceSizing(tile, VPM_X_OR_Y); |
|
48 |
} |
|
49 |
||
50 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
541
diff
changeset
|
51 |
void CcBuildRoadTunnel(bool success, uint tile, uint32 p1, uint32 p2) |
0 | 52 |
{ |
53 |
if (success) { |
|
541 | 54 |
SndPlayTileFx(SND_20_SPLAT_2, tile); |
0 | 55 |
ResetObjectToPlace(); |
56 |
} else { |
|
57 |
SetRedErrorSquare(_build_tunnel_endtile); |
|
58 |
} |
|
59 |
} |
|
60 |
||
61 |
static void PlaceRoad_Tunnel(uint tile) |
|
62 |
{ |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
541
diff
changeset
|
63 |
DoCommandP(tile, 0x200, 0, CcBuildRoadTunnel, CMD_BUILD_TUNNEL | CMD_AUTO | CMD_MSG(STR_5016_CAN_T_BUILD_TUNNEL_HERE)); |
0 | 64 |
} |
65 |
||
66 |
static void BuildRoadOutsideStation(uint tile, int direction) |
|
67 |
{ |
|
68 |
static const byte _roadbits_by_dir[4] = {2,1,8,4}; |
|
900 | 69 |
tile += TileOffsByDir(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
|
70 |
// if there is a roadpiece just outside of the station entrance, build a connecting route |
1035
0a170deb6e33
(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents:
987
diff
changeset
|
71 |
if (IsTileType(tile, MP_STREET) && !(_map5[tile] & 0x20)) { |
0 | 72 |
DoCommandP(tile, _roadbits_by_dir[direction], 0, NULL, CMD_BUILD_ROAD); |
73 |
} |
|
74 |
} |
|
75 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
541
diff
changeset
|
76 |
void CcRoadDepot(bool success, uint tile, uint32 p1, uint32 p2) |
0 | 77 |
{ |
78 |
if (success) { |
|
541 | 79 |
SndPlayTileFx(SND_1F_SPLAT, tile); |
0 | 80 |
ResetObjectToPlace(); |
81 |
BuildRoadOutsideStation(tile, (int)p1); |
|
82 |
} |
|
83 |
} |
|
84 |
||
85 |
static void PlaceRoad_Depot(uint tile) |
|
86 |
{ |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
541
diff
changeset
|
87 |
DoCommandP(tile, _road_depot_orientation, 0, CcRoadDepot, CMD_BUILD_ROAD_DEPOT | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_1807_CAN_T_BUILD_ROAD_VEHICLE)); |
0 | 88 |
} |
89 |
||
90 |
static void PlaceRoad_BusStation(uint tile) |
|
91 |
{ |
|
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1209
diff
changeset
|
92 |
DoCommandP(tile, _road_station_picker_orientation, RS_BUS, CcRoadDepot, CMD_BUILD_ROAD_STOP | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_1808_CAN_T_BUILD_BUS_STATION)); |
0 | 93 |
} |
94 |
||
95 |
static void PlaceRoad_TruckStation(uint tile) |
|
96 |
{ |
|
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1209
diff
changeset
|
97 |
DoCommandP(tile, _road_station_picker_orientation, RS_TRUCK, CcRoadDepot, CMD_BUILD_ROAD_STOP | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_1809_CAN_T_BUILD_TRUCK_STATION)); |
0 | 98 |
} |
99 |
||
100 |
static void PlaceRoad_DemolishArea(uint tile) |
|
101 |
{ |
|
102 |
VpStartPlaceSizing(tile, 4); |
|
103 |
} |
|
104 |
||
105 |
typedef void OnButtonClick(Window *w); |
|
106 |
||
107 |
static void BuildRoadClick_NE(Window *w) |
|
108 |
{ |
|
109 |
_build_road_flag = 0; |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
110 |
HandlePlacePushButton(w, 3, 0x51F, 1, PlaceRoad_NE); |
0 | 111 |
} |
112 |
||
113 |
static void BuildRoadClick_NW(Window *w) |
|
114 |
{ |
|
115 |
_build_road_flag = 0; |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
116 |
HandlePlacePushButton(w, 4, 0x520, 1, PlaceRoad_NW); |
0 | 117 |
} |
118 |
||
119 |
||
120 |
static void BuildRoadClick_Demolish(Window *w) |
|
121 |
{ |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
122 |
HandlePlacePushButton(w, 5, ANIMCURSOR_DEMOLISH, 1, PlaceRoad_DemolishArea); |
0 | 123 |
} |
124 |
||
125 |
static void BuildRoadClick_Depot(Window *w) |
|
126 |
{ |
|
661
a0bdbdffb06a
(svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents:
651
diff
changeset
|
127 |
if (_game_mode == GM_EDITOR) return; |
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
128 |
if (HandlePlacePushButton(w, 6, 0x511, 1, PlaceRoad_Depot)) ShowRoadDepotPicker(); |
0 | 129 |
} |
130 |
||
131 |
static void BuildRoadClick_BusStation(Window *w) |
|
132 |
{ |
|
661
a0bdbdffb06a
(svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents:
651
diff
changeset
|
133 |
if (_game_mode == GM_EDITOR) return; |
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
134 |
if (HandlePlacePushButton(w, 7, 0xAA5, 1, PlaceRoad_BusStation)) ShowBusStationPicker(); |
0 | 135 |
} |
136 |
||
137 |
static void BuildRoadClick_TruckStation(Window *w) |
|
138 |
{ |
|
661
a0bdbdffb06a
(svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents:
651
diff
changeset
|
139 |
if (_game_mode == GM_EDITOR) return; |
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
140 |
if (HandlePlacePushButton(w, 8, 0xAA6, 1, PlaceRoad_TruckStation)) ShowTruckStationPicker(); |
0 | 141 |
} |
142 |
||
143 |
static void BuildRoadClick_Bridge(Window *w) |
|
144 |
{ |
|
145 |
_build_road_flag = 0; |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
146 |
HandlePlacePushButton(w, 9, 0xA21, 1, PlaceRoad_Bridge); |
0 | 147 |
} |
148 |
||
149 |
static void BuildRoadClick_Tunnel(Window *w) |
|
150 |
{ |
|
151 |
_build_road_flag = 0; |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
152 |
HandlePlacePushButton(w, 10, 0x981, 3, PlaceRoad_Tunnel); |
0 | 153 |
} |
154 |
||
155 |
static void BuildRoadClick_Remove(Window *w) |
|
156 |
{ |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
157 |
if (w->disabled_state & (1<<11)) |
0 | 158 |
return; |
159 |
SetWindowDirty(w); |
|
541 | 160 |
SndPlayFx(SND_15_BEEP); |
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
161 |
_thd.make_square_red = !!((w->click_state ^= (1 << 11)) & (1<<11)); |
514
7fb7b681f42d
(svn r829) Fix small glitch: Immediately redraw the tile selection square when using the hotkey to toggle removal
tron
parents:
507
diff
changeset
|
162 |
MarkTileDirty(_thd.pos.x, _thd.pos.y); |
0 | 163 |
} |
164 |
||
606
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
165 |
static void BuildRoadClick_Landscaping(Window *w) |
0 | 166 |
{ |
606
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
167 |
ShowTerraformToolbar(); |
0 | 168 |
} |
169 |
||
170 |
static OnButtonClick * const _build_road_button_proc[] = { |
|
171 |
BuildRoadClick_NE, |
|
172 |
BuildRoadClick_NW, |
|
173 |
BuildRoadClick_Demolish, |
|
174 |
BuildRoadClick_Depot, |
|
175 |
BuildRoadClick_BusStation, |
|
176 |
BuildRoadClick_TruckStation, |
|
177 |
BuildRoadClick_Bridge, |
|
178 |
BuildRoadClick_Tunnel, |
|
179 |
BuildRoadClick_Remove, |
|
606
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
180 |
BuildRoadClick_Landscaping, |
0 | 181 |
}; |
182 |
||
183 |
static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) { |
|
184 |
switch(e->event) { |
|
185 |
case WE_PAINT: |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
186 |
w->disabled_state &= ~(1 << 11); |
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
187 |
if (!(w->click_state & ((1<<3)|(1<<4)))) { |
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
188 |
w->disabled_state |= (1 << 11); |
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
189 |
w->click_state &= ~(1<<11); |
0 | 190 |
} |
191 |
DrawWindowWidgets(w); |
|
192 |
break; |
|
193 |
||
194 |
case WE_CLICK: { |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
195 |
if (e->click.widget >= 3) |
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
196 |
_build_road_button_proc[e->click.widget - 3](w); |
0 | 197 |
} break; |
198 |
||
199 |
case WE_KEYPRESS: |
|
200 |
switch(e->keypress.keycode) { |
|
201 |
case '1': BuildRoadClick_NE(w); break; |
|
202 |
case '2': BuildRoadClick_NW(w); break; |
|
203 |
case '3': BuildRoadClick_Demolish(w); break; |
|
606
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
204 |
case '4': BuildRoadClick_Depot(w); break; |
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
205 |
case '5': BuildRoadClick_BusStation(w); break; |
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
206 |
case '6': BuildRoadClick_TruckStation(w); break; |
0 | 207 |
case 'B': BuildRoadClick_Bridge(w); break; |
208 |
case 'T': BuildRoadClick_Tunnel(w); break; |
|
209 |
case 'R': BuildRoadClick_Remove(w); break; |
|
606
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
210 |
case 'L': BuildRoadClick_Landscaping(w); break; |
0 | 211 |
default: |
212 |
return; |
|
213 |
} |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
214 |
MarkTileDirty(_thd.pos.x, _thd.pos.y); // redraw tile selection |
0 | 215 |
e->keypress.cont = false; |
216 |
break; |
|
217 |
||
218 |
case WE_PLACE_OBJ: |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
219 |
_remove_button_clicked = (w->click_state & (1 << 11)) != 0; |
0 | 220 |
_place_proc(e->place.tile); |
221 |
break; |
|
222 |
||
223 |
case WE_ABORT_PLACE_OBJ: |
|
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
224 |
UnclickWindowButtons(w); |
0 | 225 |
SetWindowDirty(w); |
226 |
||
227 |
w = FindWindowById(WC_BUS_STATION, 0); |
|
228 |
if (w != NULL) WP(w,def_d).close=true; |
|
229 |
w = FindWindowById(WC_TRUCK_STATION, 0); |
|
230 |
if (w != NULL) WP(w,def_d).close=true; |
|
231 |
w = FindWindowById(WC_BUILD_DEPOT, 0); |
|
232 |
if (w != NULL) WP(w,def_d).close=true; |
|
233 |
break; |
|
234 |
||
235 |
case WE_PLACE_DRAG: { |
|
236 |
int sel_method; |
|
237 |
if (e->place.userdata == 1) { |
|
238 |
sel_method = VPM_FIX_X; |
|
239 |
_place_road_flag = (_place_road_flag&~2) | ((e->place.pt.y&8)>>2); |
|
240 |
} else if (e->place.userdata == 2) { |
|
241 |
sel_method = VPM_FIX_Y; |
|
242 |
_place_road_flag = (_place_road_flag&~2) | ((e->place.pt.x&8)>>2); |
|
243 |
} else if (e->place.userdata == 4) { |
|
244 |
sel_method = VPM_X_AND_Y; |
|
245 |
} else { |
|
246 |
sel_method = VPM_X_OR_Y; |
|
247 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
248 |
|
0 | 249 |
VpSelectTilesWithMethod(e->place.pt.x, e->place.pt.y, sel_method); |
250 |
return; |
|
251 |
} |
|
252 |
||
253 |
case WE_PLACE_MOUSEUP: |
|
254 |
if (e->place.pt.x != -1) { |
|
255 |
uint start_tile = e->place.starttile; |
|
256 |
uint end_tile = e->place.tile; |
|
257 |
if (e->place.userdata == 0) { |
|
258 |
ResetObjectToPlace(); |
|
259 |
ShowBuildBridgeWindow(start_tile, end_tile, 0x80); |
|
260 |
} else if (e->place.userdata != 4) { |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
261 |
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
|
262 |
_remove_button_clicked ? |
0 | 263 |
CMD_REMOVE_LONG_ROAD | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_1805_CAN_T_REMOVE_ROAD_FROM) : |
264 |
CMD_BUILD_LONG_ROAD | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_1804_CAN_T_BUILD_ROAD_HERE)); |
|
265 |
} else { |
|
266 |
DoCommandP(end_tile, start_tile, _place_road_flag, CcPlaySound10, CMD_CLEAR_AREA | CMD_MSG(STR_00B5_CAN_T_CLEAR_THIS_AREA)); |
|
267 |
} |
|
268 |
} |
|
269 |
break; |
|
270 |
||
271 |
case WE_PLACE_PRESIZE: { |
|
272 |
uint tile = e->place.tile; |
|
273 |
DoCommandByTile(tile, 0x200, 0, DC_AUTO, CMD_BUILD_TUNNEL); |
|
274 |
VpSetPresizeRange(tile, _build_tunnel_endtile==0?tile:_build_tunnel_endtile); |
|
275 |
break; |
|
276 |
} |
|
277 |
} |
|
278 |
} |
|
279 |
||
280 |
static const Widget _build_road_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
281 |
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
282 |
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 227, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
283 |
{ 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
|
284 |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
285 |
{ WWT_PANEL, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_ROAD_NW, STR_180B_BUILD_ROAD_SECTION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
286 |
{ WWT_PANEL, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_ROAD_NE, STR_180B_BUILD_ROAD_SECTION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
287 |
{ WWT_PANEL, RESIZE_NONE, 7, 44, 65, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
288 |
{ WWT_PANEL, RESIZE_NONE, 7, 66, 87, 14, 35, SPR_IMG_ROAD_DEPOT, STR_180C_BUILD_ROAD_VEHICLE_DEPOT}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
289 |
{ WWT_PANEL, RESIZE_NONE, 7, 88, 109, 14, 35, SPR_IMG_BUS_STATION, STR_180D_BUILD_BUS_STATION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
290 |
{ WWT_PANEL, RESIZE_NONE, 7, 110, 131, 14, 35, SPR_IMG_TRUCK_BAY, STR_180E_BUILD_TRUCK_LOADING_BAY}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
291 |
{ WWT_PANEL, RESIZE_NONE, 7, 132, 173, 14, 35, SPR_IMG_BRIDGE, STR_180F_BUILD_ROAD_BRIDGE}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
292 |
{ WWT_PANEL, RESIZE_NONE, 7, 174, 195, 14, 35, SPR_IMG_ROAD_TUNNEL, STR_1810_BUILD_ROAD_TUNNEL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
293 |
{ WWT_PANEL, RESIZE_NONE, 7, 196, 217, 14, 35, SPR_IMG_REMOVE, STR_1811_TOGGLE_BUILD_REMOVE_FOR}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
294 |
{ WWT_PANEL, 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
|
295 |
{ WIDGETS_END}, |
0 | 296 |
}; |
297 |
||
298 |
static const WindowDesc _build_road_desc = { |
|
606
0e507bb0f63a
(svn r1030) Some toolbar icons are arranged differently:
dominik
parents:
568
diff
changeset
|
299 |
640-240, 22, 240, 36, |
0 | 300 |
WC_BUILD_TOOLBAR,0, |
756
d1f1dc31b6f4
(svn r1212) -Feature: sticky windows all build-toolbars
darkvater
parents:
679
diff
changeset
|
301 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, |
0 | 302 |
_build_road_widgets, |
303 |
BuildRoadToolbWndProc |
|
304 |
}; |
|
305 |
||
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
|
306 |
void ShowBuildRoadToolbar(void) |
0 | 307 |
{ |
946
81cf624bbdc5
(svn r1435) Fix: [ 1094092 ] Toolbars accessible via keyboard in spectator mode
dominik
parents:
900
diff
changeset
|
308 |
if (_current_player == OWNER_SPECTATOR) return; |
0 | 309 |
DeleteWindowById(WC_BUILD_TOOLBAR, 0); |
310 |
AllocateWindowDesc(&_build_road_desc); |
|
311 |
} |
|
312 |
||
313 |
static const Widget _build_road_scen_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
314 |
{ WWT_TEXTBTN, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
315 |
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 161, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
316 |
{ WWT_STICKYBOX, RESIZE_NONE, 7, 162, 173, 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
|
317 |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
318 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, 0x51D, STR_180B_BUILD_ROAD_SECTION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
319 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, 0x51E, STR_180B_BUILD_ROAD_SECTION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
320 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 44, 65, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
321 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
322 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
323 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
324 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 66, 107, 14, 35, 0xA22, STR_180F_BUILD_ROAD_BRIDGE}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
325 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 108, 129, 14, 35, 0x97D, STR_1810_BUILD_ROAD_TUNNEL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
326 |
{ WWT_IMGBTN, RESIZE_NONE, 7, 130, 151, 14, 35, 0x2CA, STR_1811_TOGGLE_BUILD_REMOVE_FOR}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
327 |
{ WWT_PANEL, RESIZE_NONE, 7, 152, 173, 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
|
328 |
{ WIDGETS_END}, |
0 | 329 |
}; |
330 |
||
331 |
static const WindowDesc _build_road_scen_desc = { |
|
661
a0bdbdffb06a
(svn r1095) -Fix: scenario editor road-build-gui works again altough shortcuts are screwed.
darkvater
parents:
651
diff
changeset
|
332 |
-1, -1, 174, 36, |
0 | 333 |
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
|
334 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, |
0 | 335 |
_build_road_scen_widgets, |
336 |
BuildRoadToolbWndProc |
|
337 |
}; |
|
338 |
||
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
|
339 |
void ShowBuildRoadScenToolbar(void) |
0 | 340 |
{ |
341 |
AllocateWindowDescFront(&_build_road_scen_desc, 0); |
|
342 |
} |
|
343 |
||
344 |
static void BuildRoadDepotWndProc(Window *w, WindowEvent *e) { |
|
345 |
switch(e->event) { |
|
346 |
case WE_PAINT: |
|
347 |
w->click_state = (1<<3) << _road_depot_orientation; |
|
348 |
DrawWindowWidgets(w); |
|
349 |
||
350 |
DrawRoadDepotSprite(70, 17, 0); |
|
351 |
DrawRoadDepotSprite(70, 69, 1); |
|
352 |
DrawRoadDepotSprite(2, 69, 2); |
|
353 |
DrawRoadDepotSprite(2, 17, 3); |
|
354 |
break; |
|
355 |
||
356 |
case WE_CLICK: { |
|
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
|
357 |
switch (e->click.widget) { |
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
|
358 |
case 3: case 4: case 5: case 6: |
0 | 359 |
_road_depot_orientation = e->click.widget - 3; |
541 | 360 |
SndPlayFx(SND_15_BEEP); |
0 | 361 |
SetWindowDirty(w); |
362 |
break; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
363 |
} |
0 | 364 |
} break; |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
365 |
|
0 | 366 |
case WE_MOUSELOOP: |
367 |
if (WP(w,def_d).close) |
|
368 |
DeleteWindow(w); |
|
369 |
break; |
|
1072
01bf9fc64236
(svn r1573) -Fix: Station and depot building mode is now terminated if the
celestar
parents:
1035
diff
changeset
|
370 |
|
01bf9fc64236
(svn r1573) -Fix: Station and depot building mode is now terminated if the
celestar
parents:
1035
diff
changeset
|
371 |
case WE_DESTROY: |
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
|
372 |
if (!WP(w,def_d).close) |
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
|
373 |
ResetObjectToPlace(); |
1072
01bf9fc64236
(svn r1573) -Fix: Station and depot building mode is now terminated if the
celestar
parents:
1035
diff
changeset
|
374 |
break; |
0 | 375 |
} |
376 |
} |
|
377 |
||
378 |
static const Widget _build_road_depot_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
379 |
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
380 |
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_1806_ROAD_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
381 |
{ WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 121, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
382 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
383 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
384 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
385 |
{ 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
|
386 |
{ WIDGETS_END}, |
0 | 387 |
}; |
388 |
||
389 |
static const WindowDesc _build_road_depot_desc = { |
|
390 |
-1,-1, 140, 122, |
|
391 |
WC_BUILD_DEPOT,WC_BUILD_TOOLBAR, |
|
392 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
|
393 |
_build_road_depot_widgets, |
|
394 |
BuildRoadDepotWndProc |
|
395 |
}; |
|
396 |
||
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
|
397 |
static void ShowRoadDepotPicker(void) |
0 | 398 |
{ |
399 |
AllocateWindowDesc(&_build_road_depot_desc); |
|
400 |
} |
|
401 |
||
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
|
402 |
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
|
403 |
{ |
0 | 404 |
switch(e->event) { |
405 |
case WE_PAINT: { |
|
406 |
int image; |
|
407 |
||
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
|
408 |
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
|
409 |
|
0 | 410 |
w->click_state = ((1<<3) << _road_station_picker_orientation) | |
411 |
((1<<7) << _station_show_coverage); |
|
412 |
DrawWindowWidgets(w); |
|
413 |
||
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
|
414 |
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
|
415 |
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
|
416 |
SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad); |
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
|
417 |
} else |
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
|
418 |
SetTileSelectSize(1, 1); |
0 | 419 |
|
420 |
image = (w->window_class == WC_BUS_STATION) ? 0x47 : 0x43; |
|
421 |
||
422 |
StationPickerDrawSprite(103, 35, 0, image); |
|
423 |
StationPickerDrawSprite(103, 85, 0, image+1); |
|
424 |
StationPickerDrawSprite(35, 85, 0, image+2); |
|
425 |
StationPickerDrawSprite(35, 35, 0, image+3); |
|
426 |
||
427 |
DrawStringCentered(70, 120, STR_3066_COVERAGE_AREA_HIGHLIGHT, 0); |
|
428 |
DrawStationCoverageAreaText(2, 146, |
|
568
6eb7d394fb35
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
543
diff
changeset
|
429 |
((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
|
430 |
3); |
0 | 431 |
|
432 |
} break; |
|
433 |
||
434 |
case WE_CLICK: { |
|
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
|
435 |
switch (e->click.widget) { |
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
|
436 |
case 3: case 4: case 5: case 6: |
0 | 437 |
_road_station_picker_orientation = e->click.widget - 3; |
541 | 438 |
SndPlayFx(SND_15_BEEP); |
0 | 439 |
SetWindowDirty(w); |
440 |
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
|
441 |
case 7: case 8: |
0 | 442 |
_station_show_coverage = e->click.widget - 7; |
541 | 443 |
SndPlayFx(SND_15_BEEP); |
0 | 444 |
SetWindowDirty(w); |
445 |
break; |
|
446 |
} |
|
447 |
} break; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
448 |
|
0 | 449 |
case WE_MOUSELOOP: { |
450 |
if (WP(w,def_d).close) { |
|
451 |
DeleteWindow(w); |
|
452 |
return; |
|
453 |
} |
|
454 |
||
455 |
CheckRedrawStationCoverage(w); |
|
456 |
} break; |
|
1109
1bab892228cd
(svn r1610) Remove trailing whitespace (last time ever, i hope)
tron
parents:
1093
diff
changeset
|
457 |
|
1072
01bf9fc64236
(svn r1573) -Fix: Station and depot building mode is now terminated if the
celestar
parents:
1035
diff
changeset
|
458 |
case WE_DESTROY: |
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
|
459 |
if (!WP(w,def_d).close) |
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
|
460 |
ResetObjectToPlace(); |
1072
01bf9fc64236
(svn r1573) -Fix: Station and depot building mode is now terminated if the
celestar
parents:
1035
diff
changeset
|
461 |
break; |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
462 |
} |
0 | 463 |
} |
464 |
||
465 |
static const Widget _bus_station_picker_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
466 |
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
467 |
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_3042_BUS_STATION_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
468 |
{ WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 176, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
469 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
470 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
471 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
472 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
473 |
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 10, 69, 133, 144, STR_02DB_OFF,STR_3065_DON_T_HIGHLIGHT_COVERAGE}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
474 |
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 70, 129, 133, 144, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
5
diff
changeset
|
475 |
{ WIDGETS_END}, |
0 | 476 |
}; |
477 |
||
478 |
static const WindowDesc _bus_station_picker_desc = { |
|
479 |
-1,-1, 140, 177, |
|
480 |
WC_BUS_STATION,WC_BUILD_TOOLBAR, |
|
481 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
|
482 |
_bus_station_picker_widgets, |
|
483 |
RoadStationPickerWndProc |
|
484 |
}; |
|
485 |
||
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
|
486 |
static void ShowBusStationPicker(void) |
0 | 487 |
{ |
488 |
AllocateWindowDesc(&_bus_station_picker_desc); |
|
489 |
} |
|
490 |
||
491 |
static const Widget _truck_station_picker_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
492 |
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
493 |
{ WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_3043_TRUCK_STATION_ORIENT, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
494 |
{ WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 176, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
495 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
496 |
{ WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
497 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
498 |
{ WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
499 |
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 10, 69, 133, 144, STR_02DB_OFF,STR_3065_DON_T_HIGHLIGHT_COVERAGE}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
787
diff
changeset
|
500 |
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 70, 129, 133, 144, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
5
diff
changeset
|
501 |
{ WIDGETS_END}, |
0 | 502 |
}; |
503 |
||
504 |
static const WindowDesc _truck_station_picker_desc = { |
|
505 |
-1,-1, 140, 177, |
|
506 |
WC_TRUCK_STATION,WC_BUILD_TOOLBAR, |
|
507 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
|
508 |
_truck_station_picker_widgets, |
|
509 |
RoadStationPickerWndProc |
|
510 |
}; |
|
511 |
||
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
|
512 |
static void ShowTruckStationPicker(void) |
0 | 513 |
{ |
514 |
AllocateWindowDesc(&_truck_station_picker_desc); |
|
515 |
} |
|
516 |
||
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
|
517 |
void InitializeRoadGui(void) |
0 | 518 |
{ |
519 |
_road_depot_orientation = 3; |
|
520 |
_road_station_picker_orientation = 3; |
|
521 |
} |