| 575 | } |
| 576 | |
| 577 | void 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. |
| 633 | int DoMessageBox(const char *title, const char *msg, int type, ddgr_color title_color, ddgr_color text_color) { |
no test coverage detected