| 323 | TextColour colour{}; ///< Colour of the question text. |
| 324 | |
| 325 | GoalQuestionWindow(WindowDesc &desc, WindowNumber window_number, TextColour colour, uint32_t button_mask, const EncodedString &question) : Window(desc), colour(colour) |
| 326 | { |
| 327 | this->question = question; |
| 328 | |
| 329 | /* Figure out which buttons we have to enable. */ |
| 330 | int n = 0; |
| 331 | for (uint bit : SetBitIterator(button_mask)) { |
| 332 | if (bit >= GOAL_QUESTION_BUTTON_COUNT) break; |
| 333 | this->button[n++] = bit; |
| 334 | if (n == 3) break; |
| 335 | } |
| 336 | this->buttons = n; |
| 337 | assert(this->buttons < 4); |
| 338 | |
| 339 | this->CreateNestedTree(); |
| 340 | if (this->buttons == 0) { |
| 341 | this->GetWidget<NWidgetStacked>(WID_GQ_BUTTONS)->SetDisplayedPlane(SZSP_HORIZONTAL); |
| 342 | } else { |
| 343 | this->GetWidget<NWidgetStacked>(WID_GQ_BUTTONS)->SetDisplayedPlane(this->buttons - 1); |
| 344 | } |
| 345 | this->FinishInitNested(window_number); |
| 346 | } |
| 347 | |
| 348 | |
| 349 | std::string GetWidgetString(WidgetID widget, StringID stringid) const override |
nothing calls this directly
no test coverage detected