| 1126 | } |
| 1127 | |
| 1128 | void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override |
| 1129 | { |
| 1130 | switch (widget) { |
| 1131 | case WID_Q_YES: { |
| 1132 | /* in the Generate New World window, clicking 'Yes' causes |
| 1133 | * CloseNonVitalWindows() to be called - we shouldn't be in a window then */ |
| 1134 | QueryCallbackProc *proc = this->proc; |
| 1135 | Window *parent = this->parent; |
| 1136 | /* Prevent the destructor calling the callback function */ |
| 1137 | this->proc = nullptr; |
| 1138 | this->Close(); |
| 1139 | if (proc != nullptr) { |
| 1140 | proc(parent, true); |
| 1141 | proc = nullptr; |
| 1142 | } |
| 1143 | break; |
| 1144 | } |
| 1145 | case WID_Q_NO: |
| 1146 | this->Close(); |
| 1147 | break; |
| 1148 | } |
| 1149 | } |
| 1150 | |
| 1151 | EventState OnKeyPress([[maybe_unused]] char32_t key, uint16_t keycode) override |
| 1152 | { |