Esempio n. 1
0
int MessageDialog::show2(const Common::String &message, const Common::String &btn1Message, const Common::String &btn2Message) {
	MessageDialog *dlg = new MessageDialog(message, btn1Message, btn2Message);
	dlg->draw();

	GfxButton *defaultButton = !btn2Message.empty() ? &dlg->_btn2 : &dlg->_btn1;
	GfxButton *selectedButton = dlg->execute(defaultButton);
	int result =  (selectedButton == defaultButton) ? 1 : 0;

	delete dlg;
	return result;
}
Esempio n. 2
0
void RingworldDemoGame::pauseGame() {
	g_globals->_events.setCursor(CURSOR_ARROW);
	MessageDialog *dlg = new MessageDialog(DEMO_PAUSED_MSG, EXIT_BTN_STRING, DEMO_RESUME_BTN_STRING);
	dlg->draw();

	GfxButton *selectedButton = dlg->execute(&dlg->_btn2);
	bool exitFlag  =  selectedButton != &dlg->_btn2;

	delete dlg;
	g_globals->_events.hideCursor();

	if (exitFlag)
		g_vm->quitGame();
}