annotate src/waypoint_gui.cpp @ 10831:31f766ee053b draft

(svn r15166) -Codechange: reduce number of includes in afterload.cpp
author smatz <smatz@openttd.org>
date Tue, 20 Jan 2009 13:56:35 +0000
parents 45ca88a8de7d
children a4e5b5d2837c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9953
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
1 /* $Id$ */
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
2
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
3 /** @file waypoint_gui.cpp Handling of waypoints gui. */
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
4
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
5 #include "stdafx.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
6 #include "openttd.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
7 #include "window_gui.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
8 #include "gui.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
9 #include "textbuf_gui.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
10 #include "vehicle_gui.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
11 #include "waypoint.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
12 #include "viewport_func.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
13 #include "string_func.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
14 #include "strings_func.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
15 #include "gfx_func.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
16 #include "command_func.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
17 #include "functions.h"
10120
e429d7f88beb (svn r14304) -Fix (r14104): waypoint train list wasn't closed with the waypoint window (crashes since r14296)
smatz <smatz@openttd.org>
parents: 9986
diff changeset
18 #include "window_func.h"
9953
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
19
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
20 #include "table/strings.h"
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
21
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
22 struct WaypointWindow : Window {
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
23 private:
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
24 Waypoint *wp;
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
25
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
26 enum WaypointViewWidget {
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
27 WAYPVW_CLOSEBOX = 0,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
28 WAYPVW_CAPTION,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
29 WAYPVW_STICKY,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
30 WAYPVW_VIEWPORTPANEL,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
31 WAYPVW_SPACER,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
32 WAYPVW_CENTERVIEW,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
33 WAYPVW_RENAME,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
34 WAYPVW_SHOW_TRAINS,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
35 };
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
36
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
37 public:
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
38 WaypointWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
39 {
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
40 this->wp = GetWaypoint(this->window_number);
9978
793681882d37 (svn r14135) -Codechange: Add owner to waypoints. Previously, it was guessed from rail underneath it.
belugas <belugas@openttd.org>
parents: 9970
diff changeset
41 this->caption_color = this->wp->owner;
9953
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
42
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
43 this->flags4 |= WF_DISABLE_VP_SCROLL;
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
44 InitializeWindowViewport(this, 3, 17, 254, 86, this->wp->xy, ZOOM_LVL_MIN);
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
45
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
46 this->FindWindowPlacementAndResize(desc);
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
47 }
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
48
10120
e429d7f88beb (svn r14304) -Fix (r14104): waypoint train list wasn't closed with the waypoint window (crashes since r14296)
smatz <smatz@openttd.org>
parents: 9986
diff changeset
49 ~WaypointWindow()
e429d7f88beb (svn r14304) -Fix (r14104): waypoint train list wasn't closed with the waypoint window (crashes since r14296)
smatz <smatz@openttd.org>
parents: 9986
diff changeset
50 {
e429d7f88beb (svn r14304) -Fix (r14104): waypoint train list wasn't closed with the waypoint window (crashes since r14296)
smatz <smatz@openttd.org>
parents: 9986
diff changeset
51 DeleteWindowById(WC_TRAINS_LIST, (this->window_number << 16) | (VEH_TRAIN << 11) | VLW_WAYPOINT_LIST | this->wp->owner);
e429d7f88beb (svn r14304) -Fix (r14104): waypoint train list wasn't closed with the waypoint window (crashes since r14296)
smatz <smatz@openttd.org>
parents: 9986
diff changeset
52 }
e429d7f88beb (svn r14304) -Fix (r14104): waypoint train list wasn't closed with the waypoint window (crashes since r14296)
smatz <smatz@openttd.org>
parents: 9986
diff changeset
53
9953
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
54 virtual void OnPaint()
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
55 {
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
56 /* You can only change your own waypoints */
9978
793681882d37 (svn r14135) -Codechange: Add owner to waypoints. Previously, it was guessed from rail underneath it.
belugas <belugas@openttd.org>
parents: 9970
diff changeset
57 this->SetWidgetDisabledState(WAYPVW_RENAME, !CheckOwnership(this->wp->owner));
9953
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
58 SetDParam(0, this->wp->index);
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
59 this->DrawWidgets();
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
60
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
61 this->DrawViewport();
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
62 }
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
63
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
64 virtual void OnClick(Point pt, int widget)
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
65 {
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
66 switch (widget) {
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
67 case WAYPVW_CENTERVIEW: /* scroll to location */
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
68 if (_ctrl_pressed) {
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
69 ShowExtraViewPortWindow(this->wp->xy);
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
70 } else {
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
71 ScrollMainWindowToTile(this->wp->xy);
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
72 }
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
73 break;
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
74
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
75 case WAYPVW_RENAME: /* rename */
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
76 SetDParam(0, this->wp->index);
10148
81642658c8be (svn r14334) -Feature: ability to reset name to default/automatic value (for vehicles, engines, towns, groups, stations, waypoints, managers and companies)
smatz <smatz@openttd.org>
parents: 10145
diff changeset
77 ShowQueryString(STR_WAYPOINT_RAW, STR_EDIT_WAYPOINT_NAME, MAX_LENGTH_WAYPOINT_NAME_BYTES, MAX_LENGTH_WAYPOINT_NAME_PIXELS, this, CS_ALPHANUMERAL, QSF_ENABLE_DEFAULT);
9953
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
78 break;
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
79
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
80 case WAYPVW_SHOW_TRAINS: /* show list of trains having this waypoint in their orders*/
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
81 ShowVehicleListWindow(this->wp);
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
82 break;
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
83 }
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
84 }
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
85
9986
c218d2656349 (svn r14143) -Codechange: Recenter viewport of waypoint window when relocating the waypoint.
frosch <frosch@openttd.org>
parents: 9978
diff changeset
86 virtual void OnInvalidateData(int data)
c218d2656349 (svn r14143) -Codechange: Recenter viewport of waypoint window when relocating the waypoint.
frosch <frosch@openttd.org>
parents: 9978
diff changeset
87 {
c218d2656349 (svn r14143) -Codechange: Recenter viewport of waypoint window when relocating the waypoint.
frosch <frosch@openttd.org>
parents: 9978
diff changeset
88 int x = TileX(this->wp->xy) * TILE_SIZE;
c218d2656349 (svn r14143) -Codechange: Recenter viewport of waypoint window when relocating the waypoint.
frosch <frosch@openttd.org>
parents: 9978
diff changeset
89 int y = TileY(this->wp->xy) * TILE_SIZE;
c218d2656349 (svn r14143) -Codechange: Recenter viewport of waypoint window when relocating the waypoint.
frosch <frosch@openttd.org>
parents: 9978
diff changeset
90 ScrollWindowTo(x,y, this);
c218d2656349 (svn r14143) -Codechange: Recenter viewport of waypoint window when relocating the waypoint.
frosch <frosch@openttd.org>
parents: 9978
diff changeset
91 }
c218d2656349 (svn r14143) -Codechange: Recenter viewport of waypoint window when relocating the waypoint.
frosch <frosch@openttd.org>
parents: 9978
diff changeset
92
9953
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
93 virtual void OnQueryTextFinished(char *str)
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
94 {
10148
81642658c8be (svn r14334) -Feature: ability to reset name to default/automatic value (for vehicles, engines, towns, groups, stations, waypoints, managers and companies)
smatz <smatz@openttd.org>
parents: 10145
diff changeset
95 if (str == NULL) return;
81642658c8be (svn r14334) -Feature: ability to reset name to default/automatic value (for vehicles, engines, towns, groups, stations, waypoints, managers and companies)
smatz <smatz@openttd.org>
parents: 10145
diff changeset
96
10499
45ca88a8de7d (svn r14754) -Codechange: get rid of _cmd_text and just pass it as (optional) parameter.
rubidium <rubidium@openttd.org>
parents: 10148
diff changeset
97 DoCommandP(0, this->window_number, 0, CMD_RENAME_WAYPOINT | CMD_MSG(STR_CANT_CHANGE_WAYPOINT_NAME), NULL, str);
9953
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
98 }
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
99
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
100 };
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
101
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
102 static const Widget _waypoint_view_widgets[] = {
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
103 { WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // WAYPVW_CLOSEBOX
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
104 { WWT_CAPTION, RESIZE_NONE, COLOUR_GREY, 11, 247, 0, 13, STR_WAYPOINT_VIEWPORT, STR_018C_WINDOW_TITLE_DRAG_THIS}, // WAYPVW_CAPTION
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
105 { WWT_STICKYBOX, RESIZE_NONE, COLOUR_GREY, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, // WAYPVW_STICKY
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
106 { WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 259, 14, 105, 0x0, STR_NULL}, // WAYPVW_VIEWPORTPANEL
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
107 { WWT_INSET, RESIZE_NONE, COLOUR_GREY, 2, 257, 16, 103, 0x0, STR_NULL}, // WAYPVW_SPACER
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
108 { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 0, 121, 106, 117, STR_00E4_LOCATION, STR_3053_CENTER_MAIN_VIEW_ON_STATION}, // WAYPVW_CENTERVIEW
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
109 { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 122, 244, 106, 117, STR_0130_RENAME, STR_CHANGE_WAYPOINT_NAME}, // WAYPVW_RENAME
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
110 { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 245, 259, 106, 117, STR_TRAIN, STR_SCHEDULED_TRAINS_TIP }, // WAYPVW_SHOW_TRAINS
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
111 { WIDGETS_END},
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
112 };
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
113
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
114 static const WindowDesc _waypoint_view_desc = {
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
115 WDP_AUTO, WDP_AUTO, 260, 118, 260, 118,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
116 WC_WAYPOINT_VIEW, WC_NONE,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
117 WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
118 _waypoint_view_widgets,
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
119 };
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
120
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
121 void ShowWaypointWindow(const Waypoint *wp)
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
122 {
9970
043f2b16901d (svn r14127) -Feature(ette): Give the the player's colour to the waypoint window been shown
belugas <belugas@openttd.org>
parents: 9953
diff changeset
123 if (!wp->IsValid()) return; // little safety
9953
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
124 AllocateWindowDescFront<WaypointWindow>(&_waypoint_view_desc, wp->index);
9f5e3b4f4caf (svn r14108) -Fix(r14104): Give a more consistent naming of the new gui file
belugas <belugas@openttd.org>
parents:
diff changeset
125 }