summaryrefslogtreecommitdiff
path: root/src/goal_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-05-26 19:23:42 +0000
committerfrosch <frosch@openttd.org>2013-05-26 19:23:42 +0000
commit56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b (patch)
treef3e5c225182fce7a451af4e09e943920e0f1cc3c /src/goal_gui.cpp
parentb10a4f151aa534860dcc61ecf8cba7b3589e6281 (diff)
downloadopenttd-56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b.tar.xz
(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
Diffstat (limited to 'src/goal_gui.cpp')
-rw-r--r--src/goal_gui.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp
index cf0e63398..e738617a6 100644
--- a/src/goal_gui.cpp
+++ b/src/goal_gui.cpp
@@ -29,11 +29,11 @@
struct GoalListWindow : Window {
Scrollbar *vscroll;
- GoalListWindow(const WindowDesc *desc, WindowNumber window_number) : Window()
+ GoalListWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc)
{
- this->CreateNestedTree(desc);
+ this->CreateNestedTree();
this->vscroll = this->GetScrollbar(WID_GL_SCROLLBAR);
- this->FinishInitNested(desc, window_number);
+ this->FinishInitNested(window_number);
this->OnInvalidateData(0);
}
@@ -230,7 +230,7 @@ static const NWidgetPart _nested_goals_list_widgets[] = {
EndContainer(),
};
-static const WindowDesc _goals_list_desc(
+static WindowDesc _goals_list_desc(
WDP_AUTO, 500, 127,
WC_GOALS_LIST, WC_NONE,
0,
@@ -250,7 +250,7 @@ struct GoalQuestionWindow : Window {
int button[3];
byte type;
- GoalQuestionWindow(const WindowDesc *desc, WindowNumber window_number, byte type, uint32 button_mask, const char *question) : Window(), type(type)
+ GoalQuestionWindow(WindowDesc *desc, WindowNumber window_number, byte type, uint32 button_mask, const char *question) : Window(desc), type(type)
{
assert(type < GOAL_QUESTION_TYPE_COUNT);
this->question = strdup(question);
@@ -266,9 +266,9 @@ struct GoalQuestionWindow : Window {
this->buttons = n;
assert(this->buttons > 0 && this->buttons < 4);
- this->CreateNestedTree(desc);
+ this->CreateNestedTree();
this->GetWidget<NWidgetStacked>(WID_GQ_BUTTONS)->SetDisplayedPlane(this->buttons - 1);
- this->FinishInitNested(desc, window_number);
+ this->FinishInitNested(window_number);
}
~GoalQuestionWindow()
@@ -359,7 +359,7 @@ static const NWidgetPart _nested_goal_question_widgets[] = {
EndContainer(),
};
-static const WindowDesc _goal_question_list_desc(
+static WindowDesc _goal_question_list_desc(
WDP_CENTER, 0, 0,
WC_GOAL_QUESTION, WC_NONE,
WDF_CONSTRUCTION,