コード例 #1
0
ファイル: mainwindow.cpp プロジェクト: Klaim/aos-designer
	void MainWindow::close_edition()
	{
		m_edition_mode = false;

		clear_windows();
		/*
		m_project_view->setVisible(false);
		m_changes_view->setVisible(false);
		m_objects_view->setVisible(false);
		m_libraries_view->setVisible(false);
		m_layers_view->setVisible(false);
		m_toolbox_view->setVisible(false);
		*/
		m_project_view->setEnabled(false);
		m_changes_view->setEnabled(false);
		m_objects_view->setEnabled(false);
		m_libraries_view->setEnabled(false);
		m_layers_view->setEnabled(false);
		m_toolbox_view->setEnabled(false);

	}
コード例 #2
0
ファイル: setup.c プロジェクト: mdutton3/xtank
/*
** Animates a game until it is finished, and then cleans up allocated stuff.
** Returns final status of the game.
*/
int play_game()
{
	unsigned int status;
	int i;
	Boolean newgame;

	if (num_combatants == 0)
		return GAME_FAILED;

	/* In an ultimate game, only reset at the beginning, since we want don't
       want scores to reset after every goal. */
	if (settings.si.game == ULTIMATE_GAME) {
		init_combatants();
		newgame = TRUE;
	}
	do {
#ifdef X11
		button_up(ANIM_WIN, FALSE);
		follow_mouse(ANIM_WIN, FALSE);
#endif
		if (settings.si.game != ULTIMATE_GAME) {
			init_combatants();
			newgame = TRUE;
		}
		if (setup_game(newgame) == GAME_FAILED)
			return GAME_FAILED;
		newgame = FALSE;


		game_running = True;

#ifdef SOUND
		play_all(START_SOUND);
#endif /*SOUND*/

		do {
			status = animate();
		} while (status == GAME_RUNNING);

#ifdef SOUND
		play_all(END_SOUND);
#endif /*SOUND*/

		game_running = False;

		status = display_game_stats(status);

		game_cleanup();			/* nuking all the vehicles here is overkill */
	} while (status == GAME_RESET);

	/* Unmap battle windows and clear all other windows on all the terminals */
	for (i = 0; i < num_terminals; i++) {
		set_terminal(i);
		unmap_battle_windows();
		clear_windows();
	}

	/* Return to terminal 0 for the user interface */
	set_terminal(0);

#ifdef X11
	button_up(ANIM_WIN, TRUE);
	follow_mouse(ANIM_WIN, TRUE);
#endif

	return status;
}