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

Function DoWaitPopup

Descent3/newui.cpp:577–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575}
576
577void DoWaitPopup(bool enable, const char *message) {
578#define FDWM_HEIGHT 128
579#define FDWM_WIDTH 256
580
581 static newuiTiledWindow *msgbox = NULL;
582 static UIText text;
583 static bool opened = false;
584 newuiSheet *sheet;
585
586 if (opened == enable) {
587 Int3();
588 }
589
590 opened = enable;
591
592 if (enable) {
593 msgbox = new newuiTiledWindow;
594
595 if (msgbox) {
596
597 msgbox->Create(NULL, 0, 0, FDWM_WIDTH, FDWM_HEIGHT);
598
599 sheet = msgbox->GetSheet();
600 if (message) {
601 char msg[512];
602 int w, h;
603 textaux_WordWrap(message, msg, FDWM_WIDTH, MONITOR9_NEWUI_FONT);
604 grtext_SetFont(MONITOR9_NEWUI_FONT);
605 w = grtext_GetTextLineWidth(msg);
606 h = grtext_GetTextHeight(msg);
607 UITextItem item{MONITOR9_NEWUI_FONT, msg, NEWUI_MONITORFONT_COLOR};
608 text.Create(msgbox, &item, (msgbox->W() - w) / 2, (msgbox->H() - h) / 2);
609
610 // sheet->NewGroup(NULL, , 25);
611 // sheet->AddText(msg);
612 }
613
614 msgbox->Open();
615 // sheet->Realize();
616
617 // fake a DoUI
618 DoUIFrame();
619 rend_Flip();
620 }
621 } else {
622
623 if (msgbox) {
624 msgbox->Close();
625 msgbox->Destroy();
626 delete msgbox;
627 }
628 msgbox = NULL;
629 }
630}
631
632// puts up a message box with a title and message.
633int DoMessageBox(const char *title, const char *msg, int type, ddgr_color title_color, ddgr_color text_color) {

Callers 1

RunGameMenuFunction · 0.85

Calls 13

textaux_WordWrapFunction · 0.85
grtext_SetFontFunction · 0.85
grtext_GetTextLineWidthFunction · 0.85
grtext_GetTextHeightFunction · 0.85
DoUIFrameFunction · 0.85
GetSheetMethod · 0.80
WMethod · 0.80
HMethod · 0.80
rend_FlipFunction · 0.50
CreateMethod · 0.45
OpenMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected