Пример #1
0
	void update(GraphicsDevice* gdev, int winWidth, int winHeight, s32& gameRunning)
	{
		if (!s_showUI)
			return;

		UISystem::predraw();
		UISystem::begin();

		DrawTextBuf* text = Draw2D::getDrawText();
		text->color = PACK_RGBA(0xa0, 0xff, 0xff, 0xa0);
		text->font = UISystem::getFont(18);
		text->x = c_leftEdge; text->y = 4;
		sprintf(text->msg, "XL Engine  version %s", Settings::getVersion());

		handleMainIcons();
		handleGameSelection(gdev, winWidth, winHeight, gameRunning);

		if (s_menu == MENU_VIDEO)
		{
			handleVideoMenu(gdev, winWidth, winHeight, gameRunning);
		}
		else if (s_menu == MENU_SETTINGS)
		{
			handleSettingsMenu(gdev, winWidth, winHeight, gameRunning);
		}

		UISystem::finish();
	}
Пример #2
0
QLayout*
GameSelectionWindow::createGameDisplayArea() {
	//  set up game choice widgets

	// maps to hold widgets, ensures alphabetical ordering
	QMap<QString, GameChoiceWidget*> learningGamesMap;
	QMap<QString, GameChoiceWidget*> dockingGamesMap;

	// add each available game to the appropriate list for display
	for (int i = 0; i < ms_gameControllerInstance->NUM_GAMES; ++i) {
		GameController::ExscitechGame game = (GameController::ExscitechGame) i;
		GameChoiceWidget* gameWidget = new GameChoiceWidget(game);

		if (!ms_gameControllerInstance->inOnlineMode()
				&& !GameInfoManager::gameHasOfflineMode(game)) {
			gameWidget->setEnabled(false);
		}

		QObject::connect(gameWidget, SIGNAL(gameChoiceSelected()), this,
				SLOT(handleGameSelection()));

		GameInfoManager::GameType gameType = GameInfoManager::getGameType(game);
		QString gameTitle(GameInfoManager::getGameTitle(game).c_str());
		if (gameType == GameInfoManager::LEARNING_GAME) {
			learningGamesMap.insert(gameTitle, gameWidget);
		} else if (gameType == GameInfoManager::JOB_SUBMIT_GAME) {
			dockingGamesMap.insert(gameTitle, gameWidget);
		}
	}

	// set up gui to hold game choice widgets

	// create layout for entire game selection area
	// area will consist of game type labels and lists of games in scroll panes
	QVBoxLayout* gameSelectionArea = new QVBoxLayout();

	// construct and add 'Learning Games' label
	QLabel* learningGameLabel = new QLabel(tr(ms_learningGamesTitle.c_str()));
	learningGameLabel->setFont(QFont("Times", 14, QFont::Bold));
	gameSelectionArea->addWidget(learningGameLabel, 0, Qt::AlignLeft);

	// construct scroll pane for list of learning games
	GameWidgetScrollArea* learningGamesScrollArea = new GameWidgetScrollArea(
			learningGamesMap);
	gameSelectionArea->addWidget(learningGamesScrollArea, 1);

	// add space between learning and job submit games
	gameSelectionArea->addSpacing(ms_gameListsGapSize);

	// construct and add 'Job Submit Games' label
	QLabel* dockingGameLabel = new QLabel(tr(ms_dockingGamesTitle.c_str()));
	dockingGameLabel->setFont(QFont("Times", 14, QFont::Bold));
	gameSelectionArea->addWidget(dockingGameLabel, 0, Qt::AlignLeft);

	// construct scroll pane for list of job submit games
	GameWidgetScrollArea* dockingGamesScrollArea = new GameWidgetScrollArea(
			dockingGamesMap);
	gameSelectionArea->addWidget(dockingGamesScrollArea, 1);

	return (gameSelectionArea);
}