|
|
|
@ -109,6 +109,8 @@ public:
|
|
|
|
|
~WaypointWindow()
|
|
|
|
|
{
|
|
|
|
|
DeleteWindowById(GetWindowClassForVehicleType(this->vt), VehicleListIdentifier(VL_STATION_LIST, this->vt, this->owner, this->window_number).Pack(), false);
|
|
|
|
|
|
|
|
|
|
SetViewportCatchmentWaypoint(Waypoint::Get(this->window_number), false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetStringParameters(int widget) const override
|
|
|
|
@ -116,6 +118,15 @@ public:
|
|
|
|
|
if (widget == WID_W_CAPTION) SetDParam(0, this->wp->index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OnPaint() override
|
|
|
|
|
{
|
|
|
|
|
extern const Waypoint *_viewport_highlight_waypoint;
|
|
|
|
|
this->SetWidgetDisabledState(WID_W_CATCHMENT, !this->wp->IsInUse());
|
|
|
|
|
this->SetWidgetLoweredState(WID_W_CATCHMENT, _viewport_highlight_waypoint == this->wp);
|
|
|
|
|
|
|
|
|
|
this->DrawWidgets();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OnClick(Point pt, int widget, int click_count) override
|
|
|
|
|
{
|
|
|
|
|
switch (widget) {
|
|
|
|
@ -140,6 +151,10 @@ public:
|
|
|
|
|
ShowWaypointDepartures((StationID)this->wp->index);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case WID_W_CATCHMENT:
|
|
|
|
|
SetViewportCatchmentWaypoint(Waypoint::Get(this->window_number), !this->IsWidgetLowered(WID_W_CATCHMENT));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case WID_W_TOGGLE_HIDDEN:
|
|
|
|
|
DoCommandP(0, this->window_number, HasBit(this->wp->waypoint_flags, WPF_HIDE_LABEL) ? 0 : 1, CMD_SET_WAYPOINT_LABEL_HIDDEN | CMD_MSG(STR_ERROR_CAN_T_CHANGE_WAYPOINT_NAME));
|
|
|
|
|
break;
|
|
|
|
@ -219,7 +234,8 @@ static const NWidgetPart _nested_waypoint_view_widgets[] = {
|
|
|
|
|
EndContainer(),
|
|
|
|
|
EndContainer(),
|
|
|
|
|
NWidget(NWID_HORIZONTAL),
|
|
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_W_DEPARTURES), SetMinimalSize(100, 12), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_STATION_VIEW_DEPARTURES_BUTTON, STR_STATION_VIEW_DEPARTURES_TOOLTIP),
|
|
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_W_DEPARTURES), SetMinimalSize(50, 12), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_STATION_VIEW_DEPARTURES_BUTTON, STR_STATION_VIEW_DEPARTURES_TOOLTIP),
|
|
|
|
|
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_W_CATCHMENT), SetMinimalSize(50, 12), SetResize(1, 0), SetFill(1, 1), SetDataTip(STR_BUTTON_CATCHMENT, STR_TOOLTIP_CATCHMENT),
|
|
|
|
|
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_W_TOGGLE_HIDDEN_SEL),
|
|
|
|
|
NWidget(WWT_IMGBTN, COLOUR_GREY, WID_W_TOGGLE_HIDDEN), SetMinimalSize(15, 12), SetDataTip(SPR_MISC_GUI_BASE, STR_WAYPOINT_VIEW_HIDE_VIEWPORT_LABEL),
|
|
|
|
|
EndContainer(),
|
|
|
|
|