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

Function DoMessageBox

Descent3/newui.cpp:633–663  ·  view source on GitHub ↗

puts up a message box with a title and message.

Source from the content-addressed store, hash-verified

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) {
634 newuiMessageBox mbox;
635 newuiSheet *sheet;
636
637 int old_screen_mode, res;
638 char msgbuf[256];
639
640 // force menu mode
641 old_screen_mode = GetScreenMode();
642
643 textaux_WordWrap(msg, msgbuf, NEWUI_MSGBOX_SHEET_W, MONITOR9_NEWUI_FONT);
644
645 // make message box
646 mbox.Create(title, type);
647
648 sheet = mbox.GetSheet();
649 sheet->NewGroup(NULL, 0, 0);
650 sheet->AddText(msgbuf);
651
652 mbox.Open();
653 res = mbox.DoUI();
654 mbox.Close();
655
656 mbox.Destroy();
657
658 // restore screen
659 SetScreenMode(old_screen_mode);
660
661 // return correct value.
662 return ((res == UID_OK) ? 1 : 0);
663}
664
665// puts up a message box with a title and message.
666// define text for buttons, btn0_title, btn1_title, ..., until NULL.

Callers 15

GameSequencerFunction · 0.85
RunGameMenuFunction · 0.85
PilotSelectFunction · 0.85
PilotCreateFunction · 0.85
PltSelectShipFunction · 0.85
ShipSelectDeleteLogoFunction · 0.85
ShipSelectDeleteTauntFunction · 0.85
ShowPilotPicDialogFunction · 0.85
QuickSaveGameFunction · 0.85
SaveGameDialogFunction · 0.85
LoadGameDialogFunction · 0.85
LoadCurrentSaveGameFunction · 0.85

Calls 11

GetScreenModeFunction · 0.85
textaux_WordWrapFunction · 0.85
SetScreenModeFunction · 0.85
GetSheetMethod · 0.80
NewGroupMethod · 0.80
AddTextMethod · 0.80
CreateMethod · 0.45
OpenMethod · 0.45
DoUIMethod · 0.45
CloseMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected