author | glx |
Fri, 13 Jun 2008 15:43:39 +0000 | |
branch | noai |
changeset 10955 | 56b381e5253f |
parent 10776 | 07203fc29812 |
child 11126 | 72d4c9314c72 |
permissions | -rw-r--r-- |
9629 | 1 |
/* $Id$ */ |
2 |
||
10455
22c441f5adf9
(svn r12997) [NoAI] -Sync: with trunk r12895:12996.
rubidium
parents:
10249
diff
changeset
|
3 |
/** @file timetable_gui.cpp GUI for time tabling. */ |
9629 | 4 |
|
5 |
#include "stdafx.h" |
|
6 |
#include "openttd.h" |
|
7 |
#include "variables.h" |
|
9723
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
8 |
#include "command_func.h" |
9629 | 9 |
#include "gui.h" |
9723
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
10 |
#include "window_gui.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
11 |
#include "textbuf_gui.h" |
9629 | 12 |
#include "cargotype.h" |
9723
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
13 |
#include "strings_func.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
14 |
#include "vehicle_base.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
15 |
#include "string_func.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
16 |
#include "gfx_func.h" |
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
17 |
#include "player_func.h" |
10181
54df587fef5d
(svn r12712) [NoAI] -Sync with trunk r12672:12711.
rubidium
parents:
10142
diff
changeset
|
18 |
#include "order_func.h" |
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
19 |
#include "settings_type.h" |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
20 |
|
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
21 |
#include "table/strings.h" |
9629 | 22 |
|
9826
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
23 |
enum TimetableViewWindowWidgets { |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
24 |
TTV_WIDGET_CLOSEBOX = 0, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
25 |
TTV_CAPTION, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
26 |
TTV_ORDER_VIEW, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
27 |
TTV_STICKY, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
28 |
TTV_TIMETABLE_PANEL, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
29 |
TTV_SCROLLBAR, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
30 |
TTV_SUMMARY_PANEL, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
31 |
TTV_CHANGE_TIME, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
32 |
TTV_CLEAR_TIME, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
33 |
TTV_RESET_LATENESS, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
34 |
TTV_AUTOFILL, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
35 |
TTV_EMPTY, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
36 |
TTV_RESIZE, |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
37 |
}; |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
38 |
|
10181
54df587fef5d
(svn r12712) [NoAI] -Sync with trunk r12672:12711.
rubidium
parents:
10142
diff
changeset
|
39 |
void SetTimetableParams(int param1, int param2, uint32 time) |
9629 | 40 |
{ |
10776 | 41 |
if (_settings_client.gui.timetable_in_ticks) { |
9629 | 42 |
SetDParam(param1, STR_TIMETABLE_TICKS); |
43 |
SetDParam(param2, time); |
|
44 |
} else { |
|
45 |
SetDParam(param1, STR_TIMETABLE_DAYS); |
|
46 |
SetDParam(param2, time / DAY_TICKS); |
|
47 |
} |
|
48 |
} |
|
49 |
||
10645 | 50 |
struct TimetableWindow : Window { |
51 |
int sel_index; |
|
9629 | 52 |
|
10645 | 53 |
TimetableWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) |
54 |
{ |
|
55 |
this->caption_color = GetVehicle(window_number)->owner; |
|
56 |
this->vscroll.cap = 8; |
|
57 |
this->resize.step_height = 10; |
|
58 |
this->sel_index = -1; |
|
10715
6bdf79ffb022
(svn r13265) [NoAI] -Sync with trunk r13185:13264.
rubidium
parents:
10645
diff
changeset
|
59 |
|
6bdf79ffb022
(svn r13265) [NoAI] -Sync with trunk r13185:13264.
rubidium
parents:
10645
diff
changeset
|
60 |
this->FindWindowPlacementAndResize(desc); |
9629 | 61 |
} |
62 |
||
10645 | 63 |
int GetOrderFromTimetableWndPt(int y, const Vehicle *v) |
64 |
{ |
|
65 |
/* |
|
66 |
* Calculation description: |
|
67 |
* 15 = 14 (this->widget[TTV_ORDER_VIEW].top) + 1 (frame-line) |
|
68 |
* 10 = order text hight |
|
69 |
*/ |
|
70 |
int sel = (y - 15) / 10; |
|
9629 | 71 |
|
10645 | 72 |
if ((uint)sel >= this->vscroll.cap) return INVALID_ORDER; |
9629 | 73 |
|
10645 | 74 |
sel += this->vscroll.pos; |
9629 | 75 |
|
10645 | 76 |
return (sel <= v->num_orders * 2 && sel >= 0) ? sel : INVALID_ORDER; |
77 |
} |
|
78 |
||
79 |
void OnPaint() |
|
80 |
{ |
|
81 |
const Vehicle *v = GetVehicle(this->window_number); |
|
82 |
int selected = this->sel_index; |
|
83 |
||
84 |
SetVScrollCount(this, v->num_orders * 2); |
|
85 |
||
86 |
if (v->owner == _local_player) { |
|
87 |
if (selected == -1) { |
|
88 |
this->DisableWidget(TTV_CHANGE_TIME); |
|
89 |
this->DisableWidget(TTV_CLEAR_TIME); |
|
90 |
} else if (selected % 2 == 1) { |
|
91 |
this->EnableWidget(TTV_CHANGE_TIME); |
|
92 |
this->EnableWidget(TTV_CLEAR_TIME); |
|
9629 | 93 |
} else { |
10645 | 94 |
const Order *order = GetVehicleOrder(v, (selected + 1) / 2); |
95 |
bool disable = order == NULL || !order->IsType(OT_GOTO_STATION) || (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION); |
|
9629 | 96 |
|
10645 | 97 |
this->SetWidgetDisabledState(TTV_CHANGE_TIME, disable); |
98 |
this->SetWidgetDisabledState(TTV_CLEAR_TIME, disable); |
|
9629 | 99 |
} |
100 |
||
10645 | 101 |
this->EnableWidget(TTV_RESET_LATENESS); |
102 |
this->EnableWidget(TTV_AUTOFILL); |
|
103 |
} else { |
|
104 |
this->DisableWidget(TTV_CHANGE_TIME); |
|
105 |
this->DisableWidget(TTV_CLEAR_TIME); |
|
106 |
this->DisableWidget(TTV_RESET_LATENESS); |
|
107 |
this->DisableWidget(TTV_AUTOFILL); |
|
9629 | 108 |
} |
109 |
||
10645 | 110 |
this->SetWidgetLoweredState(TTV_AUTOFILL, HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)); |
9629 | 111 |
|
10645 | 112 |
SetDParam(0, v->index); |
113 |
this->DrawWidgets(); |
|
9629 | 114 |
|
10645 | 115 |
int y = 15; |
116 |
int i = this->vscroll.pos; |
|
117 |
VehicleOrderID order_id = (i + 1) / 2; |
|
118 |
bool final_order = false; |
|
119 |
||
120 |
const Order *order = GetVehicleOrder(v, order_id); |
|
121 |
||
122 |
while (order != NULL) { |
|
123 |
/* Don't draw anything if it extends past the end of the window. */ |
|
124 |
if (i - this->vscroll.pos >= this->vscroll.cap) break; |
|
125 |
||
126 |
if (i % 2 == 0) { |
|
127 |
DrawOrderString(v, order, order_id, y, i == selected, true); |
|
128 |
||
129 |
order_id++; |
|
130 |
||
131 |
if (order_id >= v->num_orders) { |
|
132 |
order = GetVehicleOrder(v, 0); |
|
133 |
final_order = true; |
|
134 |
} else { |
|
135 |
order = order->next; |
|
136 |
} |
|
137 |
} else { |
|
138 |
StringID string; |
|
139 |
||
140 |
if (order->travel_time == 0) { |
|
141 |
string = STR_TIMETABLE_TRAVEL_NOT_TIMETABLED; |
|
142 |
} else { |
|
143 |
SetTimetableParams(0, 1, order->travel_time); |
|
144 |
string = STR_TIMETABLE_TRAVEL_FOR; |
|
145 |
} |
|
146 |
||
147 |
DrawString(22, y, string, (i == selected) ? TC_WHITE : TC_BLACK); |
|
148 |
||
149 |
if (final_order) break; |
|
150 |
} |
|
151 |
||
152 |
i++; |
|
153 |
y += 10; |
|
9629 | 154 |
} |
155 |
||
10645 | 156 |
y = this->widget[TTV_SUMMARY_PANEL].top + 1; |
157 |
||
158 |
{ |
|
159 |
uint total_time = 0; |
|
160 |
bool complete = true; |
|
161 |
||
162 |
for (const Order *order = GetVehicleOrder(v, 0); order != NULL; order = order->next) { |
|
163 |
total_time += order->travel_time + order->wait_time; |
|
164 |
if (order->travel_time == 0) complete = false; |
|
165 |
if (order->wait_time == 0 && order->IsType(OT_GOTO_STATION) && !(order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION)) complete = false; |
|
166 |
} |
|
167 |
||
168 |
if (total_time != 0) { |
|
169 |
SetTimetableParams(0, 1, total_time); |
|
170 |
DrawString(2, y, complete ? STR_TIMETABLE_TOTAL_TIME : STR_TIMETABLE_TOTAL_TIME_INCOMPLETE, TC_BLACK); |
|
171 |
} |
|
172 |
} |
|
173 |
y += 10; |
|
174 |
||
10776 | 175 |
if (v->lateness_counter == 0 || (!_settings_client.gui.timetable_in_ticks && v->lateness_counter / DAY_TICKS == 0)) { |
10645 | 176 |
DrawString(2, y, STR_TIMETABLE_STATUS_ON_TIME, TC_BLACK); |
177 |
} else { |
|
178 |
SetTimetableParams(0, 1, abs(v->lateness_counter)); |
|
179 |
DrawString(2, y, v->lateness_counter < 0 ? STR_TIMETABLE_STATUS_EARLY : STR_TIMETABLE_STATUS_LATE, TC_BLACK); |
|
9629 | 180 |
} |
181 |
} |
|
182 |
||
10645 | 183 |
static inline uint32 PackTimetableArgs(const Vehicle *v, uint selected) |
184 |
{ |
|
185 |
uint order_number = (selected + 1) / 2; |
|
186 |
uint is_journey = (selected % 2 == 1) ? 1 : 0; |
|
9629 | 187 |
|
10645 | 188 |
if (order_number >= v->num_orders) order_number = 0; |
9629 | 189 |
|
10645 | 190 |
return v->index | (order_number << 16) | (is_journey << 24); |
191 |
} |
|
9629 | 192 |
|
10645 | 193 |
virtual void OnClick(Point pt, int widget) |
194 |
{ |
|
195 |
const Vehicle *v = GetVehicle(this->window_number); |
|
9629 | 196 |
|
10645 | 197 |
switch (widget) { |
198 |
case TTV_ORDER_VIEW: /* Order view button */ |
|
199 |
ShowOrdersWindow(v); |
|
200 |
break; |
|
9629 | 201 |
|
10645 | 202 |
case TTV_TIMETABLE_PANEL: { /* Main panel. */ |
203 |
int selected = GetOrderFromTimetableWndPt(pt.y, v); |
|
204 |
||
205 |
if (selected == INVALID_ORDER || selected == this->sel_index) { |
|
206 |
/* Deselect clicked order */ |
|
207 |
this->sel_index = -1; |
|
208 |
} else { |
|
209 |
/* Select clicked order */ |
|
210 |
this->sel_index = selected; |
|
211 |
} |
|
212 |
} break; |
|
213 |
||
214 |
case TTV_CHANGE_TIME: { /* "Wait For" button. */ |
|
215 |
int selected = this->sel_index; |
|
216 |
VehicleOrderID real = (selected + 1) / 2; |
|
217 |
||
218 |
if (real >= v->num_orders) real = 0; |
|
219 |
||
220 |
const Order *order = GetVehicleOrder(v, real); |
|
221 |
StringID current = STR_EMPTY; |
|
222 |
||
223 |
if (order != NULL) { |
|
224 |
uint time = (selected % 2 == 1) ? order->travel_time : order->wait_time; |
|
10776 | 225 |
if (!_settings_client.gui.timetable_in_ticks) time /= DAY_TICKS; |
10645 | 226 |
|
227 |
if (time != 0) { |
|
228 |
SetDParam(0, time); |
|
229 |
current = STR_CONFIG_PATCHES_INT32; |
|
230 |
} |
|
231 |
} |
|
232 |
||
233 |
ShowQueryString(current, STR_TIMETABLE_CHANGE_TIME, 31, 150, this, CS_NUMERAL); |
|
234 |
} break; |
|
235 |
||
236 |
case TTV_CLEAR_TIME: { /* Clear waiting time button. */ |
|
237 |
uint32 p1 = PackTimetableArgs(v, this->sel_index); |
|
238 |
DoCommandP(0, p1, 0, NULL, CMD_CHANGE_TIMETABLE | CMD_MSG(STR_CAN_T_TIMETABLE_VEHICLE)); |
|
239 |
} break; |
|
240 |
||
241 |
case TTV_RESET_LATENESS: /* Reset the vehicle's late counter. */ |
|
242 |
DoCommandP(0, v->index, 0, NULL, CMD_SET_VEHICLE_ON_TIME | CMD_MSG(STR_CAN_T_TIMETABLE_VEHICLE)); |
|
243 |
break; |
|
244 |
||
245 |
case TTV_AUTOFILL: /* Autofill the timetable. */ |
|
246 |
DoCommandP(0, v->index, HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE) ? 0 : 1, NULL, CMD_AUTOFILL_TIMETABLE | CMD_MSG(STR_CAN_T_TIMETABLE_VEHICLE)); |
|
247 |
break; |
|
248 |
} |
|
249 |
||
250 |
this->SetDirty(); |
|
9629 | 251 |
} |
10645 | 252 |
|
253 |
virtual void OnQueryTextFinished(char *str) |
|
254 |
{ |
|
255 |
if (str == NULL) return; |
|
256 |
||
257 |
const Vehicle *v = GetVehicle(this->window_number); |
|
258 |
||
259 |
uint32 p1 = PackTimetableArgs(v, this->sel_index); |
|
260 |
||
261 |
uint64 time = StrEmpty(str) ? 0 : strtoul(str, NULL, 10); |
|
10776 | 262 |
if (!_settings_client.gui.timetable_in_ticks) time *= DAY_TICKS; |
10645 | 263 |
|
264 |
uint32 p2 = minu(time, MAX_UVALUE(uint16)); |
|
265 |
||
266 |
DoCommandP(0, p1, p2, NULL, CMD_CHANGE_TIMETABLE | CMD_MSG(STR_CAN_T_TIMETABLE_VEHICLE)); |
|
267 |
} |
|
268 |
||
269 |
virtual void OnResize(Point new_size, Point delta) |
|
270 |
{ |
|
271 |
/* Update the scroll + matrix */ |
|
272 |
this->vscroll.cap = (this->widget[TTV_TIMETABLE_PANEL].bottom - this->widget[TTV_TIMETABLE_PANEL].top) / 10; |
|
273 |
} |
|
274 |
}; |
|
9629 | 275 |
|
276 |
static const Widget _timetable_widgets[] = { |
|
9826
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
277 |
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // TTV_WIDGET_CLOSEBOX |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
278 |
{ WWT_CAPTION, RESIZE_RIGHT, 14, 11, 326, 0, 13, STR_TIMETABLE_TITLE, STR_018C_WINDOW_TITLE_DRAG_THIS}, // TTV_CAPTION |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
279 |
{ WWT_PUSHTXTBTN, RESIZE_LR, 14, 327, 387, 0, 13, STR_ORDER_VIEW, STR_ORDER_VIEW_TOOLTIP}, // TTV_ORDER_VIEW |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
280 |
{ WWT_STICKYBOX, RESIZE_LR, 14, 388, 399, 0, 13, STR_NULL, STR_STICKY_BUTTON}, // TTV_STICKY |
9629 | 281 |
|
9826
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
282 |
{ WWT_PANEL, RESIZE_RB, 14, 0, 387, 14, 95, STR_NULL, STR_TIMETABLE_TOOLTIP}, // TTV_TIMETABLE_PANEL |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
283 |
{ WWT_SCROLLBAR, RESIZE_LRB, 14, 388, 399, 14, 95, STR_NULL, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // TTV_SCROLLBAR |
9629 | 284 |
|
9826
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
285 |
{ WWT_PANEL, RESIZE_RTB, 14, 0, 399, 96, 117, STR_NULL, STR_NULL}, // TTV_SUMMARY_PANEL |
9629 | 286 |
|
9826
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
287 |
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 109, 118, 129, STR_TIMETABLE_CHANGE_TIME, STR_TIMETABLE_WAIT_TIME_TOOLTIP}, // TTV_CHANGE_TIME |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
288 |
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 110, 219, 118, 129, STR_CLEAR_TIME, STR_TIMETABLE_CLEAR_TIME_TOOLTIP}, // TTV_CLEAR_TIME |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
289 |
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 220, 337, 118, 129, STR_RESET_LATENESS, STR_TIMETABLE_RESET_LATENESS_TOOLTIP}, // TTV_RESET_LATENESS |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
290 |
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 338, 387, 118, 129, STR_TIMETABLE_AUTOFILL, STR_TIMETABLE_AUTOFILL_TOOLTIP}, // TTV_AUTOFILL |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
291 |
|
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
292 |
{ WWT_PANEL, RESIZE_RTB, 14, 388, 387, 118, 129, STR_NULL, STR_NULL}, // TTV_EMPTY |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9724
diff
changeset
|
293 |
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 388, 399, 118, 129, STR_NULL, STR_RESIZE_BUTTON}, // TTV_RESIZE |
9629 | 294 |
|
295 |
{ WIDGETS_END } |
|
296 |
}; |
|
297 |
||
298 |
static const WindowDesc _timetable_desc = { |
|
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9686
diff
changeset
|
299 |
WDP_AUTO, WDP_AUTO, 400, 130, 400, 130, |
9629 | 300 |
WC_VEHICLE_TIMETABLE, WC_VEHICLE_VIEW, |
301 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE, |
|
302 |
_timetable_widgets, |
|
303 |
}; |
|
304 |
||
305 |
void ShowTimetableWindow(const Vehicle *v) |
|
306 |
{ |
|
10645 | 307 |
AllocateWindowDescFront<TimetableWindow>(&_timetable_desc, v->index); |
9629 | 308 |
} |