MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DoWaitMessage

Function DoWaitMessage

Descent3/newui.cpp:485–575  ·  view source on GitHub ↗

Displays a 'temporary' dialog with a message for example: ... DoWaitMessage(true,"Please Wait..."); ... //some code DoWaitMessage(false);

Source from the content-addressed store, hash-verified

483// ... //some code
484// DoWaitMessage(false);
485void DoWaitMessage(bool enable, const char *message) {
486 static bool opened = false;
487 static uint8_t cur_pos = 0;
488 float curpos_f;
489
490 // if (1) return;
491
492 if (Dedicated_server)
493 return;
494 if (!enable && !opened)
495 return;
496 if (GetScreenMode() != SM_MENU) {
497 opened = false;
498 return;
499 }
500 if (enable && !opened) {
501 opened = true;
502 cur_pos = -1;
503 }
504 if (!enable && opened) {
505 opened = false;
506 return;
507 }
508
509 // render a ui frame
510 DoUIFrame();
511 cur_pos++;
512 if (cur_pos > 10)
513 cur_pos = 0;
514 curpos_f = (cur_pos / 10.0f);
515
516 // print our downloading data message.
517 g3Point *pntlist[4], points[4];
518 int i, rx, ry, rw, rh;
519
520 StartFrame(0, 0, Max_window_w, Max_window_h);
521 grtext_SetFont(MONITOR9_NEWUI_FONT);
522 rw = Max_window_w;
523 rh = grfont_GetHeight(MONITOR9_NEWUI_FONT) + 8;
524 rx = 0;
525 ry = Max_window_h - rh;
526 points[0].p3_sx = rx;
527 points[0].p3_sy = ry;
528 points[1].p3_sx = rx + rw;
529 points[1].p3_sy = ry;
530 points[2].p3_sx = rx + rw;
531 points[2].p3_sy = ry + rh;
532 points[3].p3_sx = rx;
533 points[3].p3_sy = ry + rh;
534
535 for (i = 0; i < 4; i++) {
536 points[i].p3_z = 0;
537 points[i].p3_flags = PF_PROJECTED;
538 pntlist[i] = &points[i];
539 }
540
541 rend_SetZBufferState(0);
542 rend_SetTextureType(TT_FLAT);

Callers 8

PilotSelectFunction · 0.85
PltSelectShipFunction · 0.85
ShipSelectCallBackFunction · 0.85
OptionsMenuFunction · 0.85
MainMenuFunction · 0.85
count_missionsFunction · 0.85
generate_mission_listboxFunction · 0.85
menu.cppFile · 0.85

Calls 15

GetScreenModeFunction · 0.85
DoUIFrameFunction · 0.85
StartFrameFunction · 0.85
grtext_SetFontFunction · 0.85
grfont_GetHeightFunction · 0.85
rend_DrawPolygon2DFunction · 0.85
grtext_SetAlphaFunction · 0.85
grtext_SetColorFunction · 0.85
grtext_PutsFunction · 0.85
grtext_FlushFunction · 0.85
EndFrameFunction · 0.85
rend_SetZBufferStateFunction · 0.50

Tested by

no test coverage detected