mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-12 09:09:09 +00:00
(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
This commit is contained in:
@@ -134,17 +134,17 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
BuildBridgeWindow(const WindowDesc *desc, TileIndex start, TileIndex end, uint32 br_type, GUIBridgeList *bl) : Window(),
|
||||
BuildBridgeWindow(WindowDesc *desc, TileIndex start, TileIndex end, uint32 br_type, GUIBridgeList *bl) : Window(desc),
|
||||
start_tile(start),
|
||||
end_tile(end),
|
||||
type(br_type),
|
||||
bridges(bl)
|
||||
{
|
||||
this->CreateNestedTree(desc);
|
||||
this->CreateNestedTree();
|
||||
this->vscroll = this->GetScrollbar(WID_BBS_SCROLLBAR);
|
||||
/* Change the data, or the caption of the gui. Set it to road or rail, accordingly. */
|
||||
this->GetWidget<NWidgetCore>(WID_BBS_CAPTION)->widget_data = (GB(this->type, 15, 2) == TRANSPORT_ROAD) ? STR_SELECT_ROAD_BRIDGE_CAPTION : STR_SELECT_RAIL_BRIDGE_CAPTION;
|
||||
this->FinishInitNested(desc, GB(br_type, 15, 2)); // Initializes 'this->bridgetext_offset'.
|
||||
this->FinishInitNested(GB(br_type, 15, 2)); // Initializes 'this->bridgetext_offset'.
|
||||
|
||||
this->parent = FindWindowById(WC_BUILD_TOOLBAR, GB(this->type, 15, 2));
|
||||
this->bridges->SetListing(this->last_sorting);
|
||||
@@ -213,7 +213,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
|
||||
virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number)
|
||||
{
|
||||
/* Position the window so hopefully the first bridge from the list is under the mouse pointer. */
|
||||
NWidgetBase *list = this->GetWidget<NWidgetBase>(WID_BBS_BRIDGE_LIST);
|
||||
@@ -351,7 +351,7 @@ static const NWidgetPart _nested_build_bridge_widgets[] = {
|
||||
};
|
||||
|
||||
/** Window definition for the rail bridge selection window. */
|
||||
static const WindowDesc _build_bridge_desc(
|
||||
static WindowDesc _build_bridge_desc(
|
||||
WDP_AUTO, 200, 114,
|
||||
WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR,
|
||||
WDF_CONSTRUCTION,
|
||||
|
Reference in New Issue
Block a user