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