MCPcopy Create free account
hub / github.com/EasyRPG/Player / InsertNewPage

Method InsertNewPage

src/window_message.cpp:248–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248void 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

Callers

nothing calls this directly

Calls 15

IsMessageTransparentMethod · 0.80
SetBackOpacityMethod · 0.80
GetMessageFaceNameMethod · 0.80
GetMessageFaceIndexMethod · 0.80
IsMessageFaceFlippedMethod · 0.80
GetChoiceStartLineMethod · 0.80
HasChoicesMethod · 0.80
HasNumberInputMethod · 0.80
dataMethod · 0.80
DebugLogFunction · 0.70

Tested by

no test coverage detected