Ejemplo n.º 1
0
View_Main::View_Main() {
	qDebug() << "View_Main::View_Main() -> BEGIN";
	
	// main window
	setWindowFlags(Qt::Window);
	setWindowTitle("Draughts (shashki)");
	
	// main menu
	QAction *newgameBtn = new QAction("New game", this);
	connect(newgameBtn, SIGNAL(triggered()), SLOT(menuNewgame()));
	QAction *quitBtn = new QAction("Quit", this);
	connect(quitBtn, SIGNAL(triggered()), SLOT(menuQuit()));
	menuBar()->addAction(newgameBtn);
	menuBar()->addAction(quitBtn);
	
	qDebug() << "View_Main::View_Main() -> END";
}
Ejemplo n.º 2
0
void MainMenu::CursorEvent( OguiButtonEvent* eve )
{
	if( abortGame )
	{
		MenuBaseImpl::CursorEvent( eve );
		if( eve->eventType == OGUI_EMASK_CLICK )
		{
			switch( eve->triggerButton->GetId() )
			{
				case COMMANDS_YES:
					menuCollection->newMission();
					break;

				case COMMANDS_NO:
					closeAbortMenu();
					break;
			}
		}
	}
	else 
	{
		MenuBaseImpl::CursorEvent( eve );
		
		if( eve->eventType == OGUI_EMASK_CLICK )
		{
			if( currentActive && eve->triggerButton->GetId() != COMMANDS_CONTINUE )
			{
				currentActive->SetFont( fonts->medium.normal );

				if( currentActive == eve->triggerButton )
				{
					menuCollection->closeMenu();
					return;
				}
				else
				{
					menuCollection->closeMenu();
				}
			}
			
			currentActive = eve->triggerButton;
			if( currentActive )
				currentActive->SetFont( fonts->medium.highlighted );

			switch( eve->triggerButton->GetId() )
			{
			case COMMANDS_RESUME:
				menuResume();
				break;

			case COMMANDS_CONTINUE:
				menuContinue();
				break;

			case COMMANDS_NEW_GAME:
				menuNewGame();
				break;
			case COMMANDS_LOAD_GAME:
				menuLoadGame();
				break;
#ifdef PROJECT_SURVIVOR
			case COMMANDS_SURVIVAL:
				menuSurvival();
				break;
			case COMMANDS_COOP:
				menuCoop();
				break;
#endif
			case COMMANDS_PROFILES:
				menuProfiles();
				break;
			case COMMANDS_OPTIONS:
				menuOptions();
				break;
			
			case COMMANDS_CREDITS:
				menuCredits();
				break;

			case COMMANDS_QUIT:
				menuQuit();
				break;
			
			case COMMANDS_EASY:
			case COMMANDS_NORMAL:
			case COMMANDS_HARD:
				selectDifficultButton( eve->triggerButton->GetId() );
				break;

			default:
				// This should not happen
				assert( false );
				break;
			};
		}
	}

}
Ejemplo n.º 3
0
MainSynthWindow::~MainSynthWindow (void)
{
    menuQuit();
}