diff --git a/src/critter.cc b/src/critter.cc index edfb375..9d98601 100644 --- a/src/critter.cc +++ b/src/critter.cc @@ -607,7 +607,8 @@ void _process_rads(Object* obj, int radiationLevel, bool isHealing) // You have died from radiation sickness. messageListItem.num = 1006; if (messageListGetItem(&gMiscMessageList, &messageListItem)) { - displayMonitorAddMessage(messageListItem.text); + // SFALL: Display a pop-up message box about death from radiation. + gameShowDeathDialog(messageListItem.text); } } } diff --git a/src/game.cc b/src/game.cc index 38ae806..5368c73 100644 --- a/src/game.cc +++ b/src/game.cc @@ -1332,3 +1332,50 @@ static void showSplash() configSetInt(&gGameConfig, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_SPLASH_KEY, splash + 1); } + +int gameShowDeathDialog(const char* message) +{ + bool isoWasEnabled = isoDisable(); + + bool gameMouseWasVisible; + if (isoWasEnabled) { + gameMouseWasVisible = gameMouseObjectsIsVisible(); + } else { + gameMouseWasVisible = false; + } + + if (gameMouseWasVisible) { + gameMouseObjectsHide(); + } + + bool cursorWasHidden = cursorIsHidden(); + if (cursorWasHidden) { + mouseShowCursor(); + } + + int oldCursor = gameMouseGetCursor(); + gameMouseSetCursor(MOUSE_CURSOR_ARROW); + + int oldUserWantsToQuit = _game_user_wants_to_quit; + _game_user_wants_to_quit = 0; + + int rc = showDialogBox(message, 0, 0, 169, 117, _colorTable[32328], NULL, _colorTable[32328], DIALOG_BOX_LARGE); + + _game_user_wants_to_quit = oldUserWantsToQuit; + + gameMouseSetCursor(oldCursor); + + if (cursorWasHidden) { + mouseHideCursor(); + } + + if (gameMouseWasVisible) { + gameMouseObjectsShow(); + } + + if (isoWasEnabled) { + isoEnable(); + } + + return rc; +} diff --git a/src/game.h b/src/game.h index e4301d8..ea6111e 100644 --- a/src/game.h +++ b/src/game.h @@ -28,4 +28,6 @@ int _game_state_request(int a1); void _game_state_update(); int showQuitConfirmationDialog(); +int gameShowDeathDialog(const char* message); + #endif /* GAME_H */