Esempio n. 1
0
void Game::handleKeypress(const Common::Event &event) {
	if (event.kbd.flags & Common::KBD_CTRL) {
		if (_widepipeCtr == 8) {
			// Implement original game cheating keys here someday
		} else {
			if (event.kbd.keycode == (Common::KEYCODE_a +
					(DEBUG_STRING[_widepipeCtr] - 'a'))) {
				if (++_widepipeCtr == 8) {
					MessageDialog *dlg = new MessageDialog(_vm, 2,
						"CHEATING ENABLED", "(for your convenience).");
					dlg->show();
					delete dlg;
				}
			}
		}
	}

	switch (event.kbd.keycode) {
	case Common::KEYCODE_F1:
		_vm->_dialogs->_pendingDialog = DIALOG_GAME_MENU;
		break;
	case Common::KEYCODE_F5:
		_vm->_dialogs->_pendingDialog = DIALOG_SAVE;
		break;
	case Common::KEYCODE_F7:
		_vm->_dialogs->_pendingDialog = DIALOG_RESTORE;
		break;
	default:
		break;
	}
}
void MainWindow::userDoubleClicked(const QString &nick)
{
    if (!usersChatting.contains(nick))
    {
        MessageDialog *msgdlg = new MessageDialog(nick, 0);
        connect(msgdlg, SIGNAL(messageReady(QString,QString)), irc, SLOT(sendMessage(QString,QString)));

        QFont chatfont;
        if (chatfont.fromString(settings.chatfont))
            msgdlg->setFont(chatfont);

        msgdlg->show();
        usersChatting.insert(nick, msgdlg);
    }

    MessageDialog *msgdlg = usersChatting.value(nick);
    if (msgdlg)
        msgdlg->show();
}
Esempio n. 3
0
void Game::handleKeypress(const Common::KeyState &kbd) {
	if (kbd.flags & Common::KBD_CTRL) {
		if (_widepipeCtr == 8) {
			// Implement original game cheating keys here someday
		} else {
			if (kbd.keycode == (Common::KEYCODE_a +
					(DEBUG_STRING[_widepipeCtr] - 'a'))) {
				if (++_widepipeCtr == 8) {
					MessageDialog *dlg = new MessageDialog(_vm, 2,
						"CHEATING ENABLED", "(for your convenience).");
					dlg->show();
					delete dlg;
				}
			}
		}
	}

	Scene &scene = _vm->_game->_scene;
	switch (kbd.keycode) {
	case Common::KEYCODE_F1:
		_vm->_dialogs->_pendingDialog = DIALOG_GAME_MENU;
		break;
	case Common::KEYCODE_F5:
		_vm->_dialogs->_pendingDialog = DIALOG_SAVE;
		break;
	case Common::KEYCODE_F7:
		_vm->_dialogs->_pendingDialog = DIALOG_RESTORE;
		break;
	case Common::KEYCODE_PAGEUP:
		scene._userInterface._scrollbarStrokeType = SCROLLBAR_UP;
		scene._userInterface.changeScrollBar();
		break;
	case Common::KEYCODE_PAGEDOWN:
		scene._userInterface._scrollbarStrokeType = SCROLLBAR_DOWN;
		scene._userInterface.changeScrollBar();
		break;


	default:
		break;
	}
}