@@ -112,6 +112,30 @@ void building_info_window::fill_employment_details(object_info &c, int text_id)
112
112
}
113
113
114
114
void building_info_window::window_info_background (object_info &c) {
115
+ common_info_window::window_info_background (c);
116
+
117
+ building *b = building_get (c);
118
+ b->dcast ()->window_info_background (c);
119
+
120
+ update_buttons (c);
121
+ }
122
+
123
+ textid building_info_window::get_tooltip (object_info &c) {
124
+ common_info_window::init (c);
125
+
126
+ if (!c.storage_show_special_orders ) {
127
+ return {0 , 0 };
128
+ }
129
+
130
+ building *b = building_get (c);
131
+ if (b->type == BUILDING_STORAGE_YARD) {
132
+ return window_building_get_tooltip_warehouse_orders ();
133
+ }
134
+
135
+ return b->dcast ()->get_tooltip ();
136
+ }
137
+
138
+ void building_info_window::init (object_info &c) {
115
139
g_debug_building_id = c.building_id ;
116
140
building *b = building_get (c);
117
141
@@ -176,25 +200,11 @@ void building_info_window::window_info_background(object_info &c) {
176
200
c.help_id = params.meta .help_id ;
177
201
c.group_id = params.meta .text_id ;
178
202
179
- ui[" title" ] = ui::str (c.group_id , 0 );
180
-
181
- common_info_window::window_info_background (c);
182
- }
183
-
184
- textid building_info_window::get_tooltip (object_info &c) {
185
- if (!c.storage_show_special_orders ) {
186
- return {0 , 0 };
187
- }
188
-
189
- building *b = building_get (c);
190
- if (b->type == BUILDING_STORAGE_YARD) {
191
- return window_building_get_tooltip_warehouse_orders ();
192
- }
193
-
194
- return b->dcast ()->get_tooltip ();
203
+ ui[" title" ] = ui::str (28 , b->type );
195
204
}
196
205
197
206
void building_info_window::update_buttons (object_info &c) {
207
+ common_info_window::update_buttons (c);
198
208
building *b = building_get (c);
199
209
200
210
int workers_needed = model_get_building (b->type )->laborers ;
@@ -233,8 +243,6 @@ void building_info_window::update_buttons(object_info &c) {
233
243
}
234
244
window_invalidate ();
235
245
});
236
-
237
- common_info_window::update_buttons (c);
238
246
}
239
247
240
248
building *building_info_window::building_get (object_info &c) {
0 commit comments