Exemple #1
0
void StageDelegator::onJoyButtonUp(SDL_JoyButtonEvent event) 
{
	if (type_stage == "Intro") {
		toMenu();
		stage->init();
	}
	else if (type_stage == "Menu") {
		StageMenu * sm = (StageMenu*)stage;
		if (event.button == A_BUTTON && sm->to_select_plane) {
			toLoading();
			stage->init();
		}
		else {
			stage->onJoyButtonUp(event);
		}
	}
	else if (type_stage == "Loading" && event.button == A_BUTTON) {
		toPlay();
		stage->init();
		game = Game::instance;
	}
	else if (type_stage == "Play") {
		stage->onJoyButtonUp(event);
	}
	else if (type_stage == "Final"  && event.button == A_BUTTON) {
		toMenu();
		init();
	}
}
Exemple #2
0
void CWizActions::buildMenu(QMenu* pMenu, CWizSettings& settings, const QString& strSection)
{
    int index = 0;
    while (true)
    {
        QString strKey = WizIntToStr(index);
        QString strAction = settings.GetString(strSection, strKey);

        if (strAction.isEmpty())
            break;

        if (strAction.startsWith("-"))
        {
            pMenu->addSeparator();
        }
        else if (strAction.startsWith("+"))
        {
            strAction.remove(0, 1);
            pMenu->addMenu(toMenu(pMenu, settings, strAction));
        }
        else
        {
            pMenu->addAction(actionFromName(strAction));
        }

        index++;
    }
}
Exemple #3
0
int main(int argc, char *argv[])
{
    allegro_init();        // Initialize Allegro
    install_keyboard(); // Initialize keyboard routines 
    install_mouse();
    install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL);
    set_color_depth(16); // Set the color depth
    set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 1024,768,0,0); // Change our graphics mode to 1024x768
    mouse = load_bitmap("Mouse.bmp", NULL);
    
    //showCopyrights();
    toMenu();
    //startGame();
    return 0;
}
Exemple #4
0
void StageDelegator::onMouseButton(SDL_MouseButtonEvent event) 
{
	if (type_stage == "Intro") {
		toMenu();
		stage->init();
	}
	else if (type_stage == "Menu") {
		//toLoading();
		//stage->init();
	}
	else if (type_stage == "Loading") {
		//toPlay();
		//stage->init();
	}
	else if (type_stage == "Play") {
		stage->onMouseButton(event);
	}
}
void CWizActions::buildMenu(QMenu* pMenu, CWizSettings& settings, const QString& strSection)
{
    int index = 0;
    while (true)
    {
        QString strKey = WizIntToStr(index);
        QString strAction = settings.GetString(strSection, strKey);

        if (strAction.isEmpty())
            break;

        // no fullscreen mode menu
#ifndef Q_OS_MAC
        if (strAction == WIZACTION_GLOBAL_TOGGLE_FULLSCREEN) {
            index++;
            continue;
        }
#endif

#ifndef QT_DEBUG
        if (strAction == "actionAboutPlugins") {
            index++;
            continue;
        }
#endif

        if (strAction.startsWith("-"))
        {
            pMenu->addSeparator();
        }
        else if (strAction.startsWith("+"))
        {
            strAction.remove(0, 1);
            pMenu->addMenu(toMenu(pMenu, settings, strAction));
        }
        else
        {
            pMenu->addAction(actionFromName(strAction));
        }

        index++;
    }
}
Exemple #6
0
//---------------------------------------------------------------------------------------------------------
void StageDelegator::onKeyPressed(SDL_KeyboardEvent event) 
{
	if (type_stage == "Intro") {
		toMenu();
		stage->init();
	}
	else if (type_stage == "Menu") {
		StageMenu * sm = (StageMenu*)stage;
		if (event.keysym.sym == SDLK_a && sm->to_select_plane) {
			toLoading();
			stage->init();
		}
		else {
			stage->onKeyPressed(event);
		}
	}
	else if (type_stage == "Loading" && (event.keysym.sym == SDLK_SPACE || event.keysym.sym == SDLK_RETURN)) {
		toPlay();
		stage->init();
	}
	else if (type_stage == "Play") {
		stage->onKeyPressed(event);
	}
}