| 246 | } |
| 247 | |
| 248 | void Window_Message::InsertNewPage() { |
| 249 | DebugLog("{}: MSG NEW PAGE"); |
| 250 | // Cancel pending face requests for async |
| 251 | // Otherwise they render on the wrong page |
| 252 | face_request_ids.clear(); |
| 253 | |
| 254 | contents->Clear(); |
| 255 | SetIndex(-1); |
| 256 | SetPause(false); |
| 257 | number_input_window->SetActive(false); |
| 258 | number_input_window->SetVisible(false); |
| 259 | kill_page = false; |
| 260 | line_count = 0; |
| 261 | text_color = Font::ColorDefault; |
| 262 | speed = 1; |
| 263 | kill_page = false; |
| 264 | instant_speed = false; |
| 265 | prev_char_printable = false; |
| 266 | prev_char_waited = true; |
| 267 | |
| 268 | if (GetFont()) { |
| 269 | page_font = GetFont(); |
| 270 | } else { |
| 271 | page_font = Font::Default(); |
| 272 | } |
| 273 | |
| 274 | // Position the message box vertically |
| 275 | // Game_Message::GetRealPosition() specify top/middle/bottom |
| 276 | if (Game_Message::GetRealPosition() == 0) { |
| 277 | y = Player::menu_offset_y; |
| 278 | } |
| 279 | else if (Game_Message::GetRealPosition() == 1) { |
| 280 | y = static_cast<int>((Player::screen_height - MESSAGE_BOX_HEIGHT) / 2.f); |
| 281 | } |
| 282 | else if (Game_Message::GetRealPosition() == 2) { |
| 283 | y = Player::screen_height - Player::menu_offset_y - MESSAGE_BOX_HEIGHT ; |
| 284 | } |
| 285 | |
| 286 | if (Main_Data::game_system->IsMessageTransparent()) { |
| 287 | SetOpacity(0); |
| 288 | gold_window->SetBackOpacity(0); |
| 289 | } else { |
| 290 | SetOpacity(255); |
| 291 | gold_window->SetBackOpacity(GetBackOpacity()); |
| 292 | } |
| 293 | |
| 294 | if (IsFaceEnabled()) { |
| 295 | if (!Main_Data::game_system->IsMessageFaceRightPosition()) { |
| 296 | contents_x = LeftMargin + FaceSize + RightFaceMargin; |
| 297 | DrawFace(Main_Data::game_system->GetMessageFaceName(), Main_Data::game_system->GetMessageFaceIndex(), LeftMargin, TopMargin, Main_Data::game_system->IsMessageFaceFlipped()); |
| 298 | } else { |
| 299 | contents_x = 0; |
| 300 | DrawFace(Main_Data::game_system->GetMessageFaceName(), Main_Data::game_system->GetMessageFaceIndex(), 248, TopMargin, Main_Data::game_system->IsMessageFaceFlipped()); |
| 301 | } |
| 302 | } else { |
| 303 | contents_x = 0; |
| 304 | } |
| 305 |
nothing calls this directly
no test coverage detected