Use pop-up message box about death from radiation

This commit is contained in:
Alexander Batalov 2022-08-19 20:25:14 +03:00
parent b89d6dfd72
commit e71447a3d3
3 changed files with 51 additions and 1 deletions

View File

@ -607,7 +607,8 @@ void _process_rads(Object* obj, int radiationLevel, bool isHealing)
// You have died from radiation sickness. // You have died from radiation sickness.
messageListItem.num = 1006; messageListItem.num = 1006;
if (messageListGetItem(&gMiscMessageList, &messageListItem)) { if (messageListGetItem(&gMiscMessageList, &messageListItem)) {
displayMonitorAddMessage(messageListItem.text); // SFALL: Display a pop-up message box about death from radiation.
gameShowDeathDialog(messageListItem.text);
} }
} }
} }

View File

@ -1332,3 +1332,50 @@ static void showSplash()
configSetInt(&gGameConfig, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_SPLASH_KEY, splash + 1); 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;
}

View File

@ -28,4 +28,6 @@ int _game_state_request(int a1);
void _game_state_update(); void _game_state_update();
int showQuitConfirmationDialog(); int showQuitConfirmationDialog();
int gameShowDeathDialog(const char* message);
#endif /* GAME_H */ #endif /* GAME_H */