// Movements Parts of the Control Settings void CControlSettingsButtons::refresh() { mapping = false; mCommandName[IC_JUMP] = "Jump: "; mCommandName[IC_POGO] = "Pogo: "; mCommandName[IC_FIRE] = "Fire: "; mCommandName[IC_STATUS] = "Status: "; mCommandName[IC_CAMLEAD] = "Camlead:"; mCommandName[IC_HELP] = "Help: "; mCommandName[IC_BACK] = "Back: "; if(!mpButtonList.empty()) mpButtonList.clear(); std::map<InputCommands, std::string>::iterator it = mCommandName.begin(); for ( ; it != mCommandName.end(); it++ ) { const std::string buf = it->second; const std::string buf2 = gInput.getEventShortName( it->first, mSelectedPlayer-1 ); ReadInputEvent *rie = new ReadInputEvent(mSelectedPlayer, it->first, it->second); GalaxyButton *guiButton = new GalaxyButton( buf+buf2, rie ); rie->setButtonPtr(guiButton); mpButtonList.push_back( guiButton ); mpMenuDialog->addControl( guiButton ); } setMenuLabel("BUTTONMENULABEL"); }
void CControlSettingsMovement::refresh() { mapping = false; mCommandName[IC_LEFT] = "Left: "; mCommandName[IC_RIGHT] = "Right: "; mCommandName[IC_UP] = "Up: "; mCommandName[IC_DOWN] = "Down: "; mCommandName[IC_UPPERLEFT] = "U-left: "; mCommandName[IC_UPPERRIGHT] = "U-right:"; mCommandName[IC_LOWERLEFT] = "D-left: "; mCommandName[IC_LOWERRIGHT] = "D-right:"; if(!mpButtonList.empty()) mpButtonList.clear(); std::map<InputCommands, std::string>::iterator it = mCommandName.begin(); for ( ; it != mCommandName.end(); it++ ) { const std::string buf = it->second; const std::string buf2 = gInput.getEventShortName( it->first, mSelectedPlayer-1 ); ReadInputEvent *rie = new ReadInputEvent(mSelectedPlayer, it->first, it->second); GalaxyButton *guiButton = new GalaxyButton( buf+buf2, rie ); rie->setButtonPtr(guiButton); mpButtonList.push_back( guiButton ); mpMenuDialog->addControl( guiButton ); } setMenuLabel("MOVEMENULABEL"); }
CAudioSettings::CAudioSettings() : VorticonMenu(GsRect<float>(0.075f, 0.24f, 0.85f, 0.4f) ) { mpRate = new ComboSelection( "Rate", g_pSound->getAvailableRateList()); mpMenuDialog->addControl( mpRate ); mpStereo = new Switch( "Stereo" ); mpMenuDialog->addControl( mpStereo ); mpDepth = new ComboSelection( "Depth", filledStrList( 2, "8-bit", "16-bit" ) ); mpMenuDialog->addControl( mpDepth ); mpSBToggle = new ComboSelection( "Card", filledStrList( 2, "PC Speaker", "Soundblaster" ) ); mpMenuDialog->addControl( mpSBToggle ); mpSoundVolume = new NumberControl( "Sound Vol", 0, SDL_MIX_MAXVOLUME, 8, g_pSound->getSoundVolume(), true ); mpMenuDialog->addControl( mpSoundVolume ); mpMusicVolume = new NumberControl( "Music Vol", 0, SDL_MIX_MAXVOLUME, 8, g_pSound->getMusicVolume(), true ); mpMenuDialog->addControl( mpMusicVolume ); setMenuLabel("SNDEFFMENULABEL"); }
CSettingsMenu::CSettingsMenu() : CBaseMenu( CRect<float>(0.25f, 0.24f, 0.5f, 0.32f) ) { mpMenuDialog->addControl(new CGUIButton( "Video", new OpenMenuEvent( new CVideoSettings() ) ) ); mpMenuDialog->addControl(new CGUIButton( "Audio", new OpenMenuEvent( new CAudioSettings() ) ) ); mpMenuDialog->addControl(new CGUIButton( "Options", new OpenMenuEvent( new COptions() ) ) ); /* const int players = ctrlMenu->mSelection; EventContainer.pop_Event(); EventContainer.add( new OpenMenuEvent( new CControlsettings(players) ) ); * * */ #if defined (SINGLEPLAYER) mpMenuDialog->addControl( new CGUIButton( "Controls", new OpenMenuEvent( new CControlsettings(1) ) ) ); #else mpMenuDialog->addControl(new CGUIButton( "Controls", new OpenMenuEvent( new CPlayersSelection<OpenControlMenuEvent>() ) ) ); #endif mpMenuDialog->addControl(new CGUIButton( "Profile", new OpenMenuEvent( new CProfilesMenu() ) ) ); setMenuLabel("CONFIGMENULABEL"); }
CProfilesMenu::CProfilesMenu() : GalaxyMenu( GsRect<float>(0.25f, 0.4f, 0.5f, 0.2f) ) { mpMenuDialog->addControl(new GalaxyButton( "Classic mode", new SetDefaultClassic() ) ); mpMenuDialog->addControl(new GalaxyButton( "Enhanced mode", new SetDefaultEnhanced() ) ); setMenuLabel("OPTIONSMENULABEL"); }
COptions::COptions() : GalaxyMenu( GsRect<float>(0.1f, 0.14f, 0.8f, NUM_OPTIONS*0.07f) ), mpOption(gpBehaviorEngine->m_option) { for( int i = 0 ; i < NUM_OPTIONS ; i++ ) { mpOptionList.push_back( new Switch(mpOption[i].menuname) ); mpMenuDialog->addControl( mpOptionList.back() ); } setMenuLabel("OPTIONSMENULABEL"); }
CSettingsMenu::CSettingsMenu() : CBaseMenu( CRect<float>(0.25f, 0.24f, 0.5f, 0.32f) ) { mpMenuDialog->addControl(new CGUIButton( "Video", new OpenMenuEvent( new CVideoSettings() ) ) ); mpMenuDialog->addControl(new CGUIButton( "Audio", new OpenMenuEvent( new CAudioSettings() ) ) ); mpMenuDialog->addControl(new CGUIButton( "Options", new OpenMenuEvent( new COptions() ) ) ); /* const int players = ctrlMenu->mSelection; EventContainer.pop_Event(); EventContainer.add( new OpenMenuEvent( new CControlsettings(players) ) ); * * */ #if defined (SINGLEPLAYER) mpMenuDialog->addControl( new CGUIButton( "Controls", new OpenMenuEvent( new CControlsettings(1) ) ) ); #else if(g_pBehaviorEngine->getEngine() == ENGINE_GALAXY) { mpMenuDialog->addControl( new CGUIButton( "Controls", new OpenMenuEvent( new CControlsettings(1) ) ) ); } else if(g_pBehaviorEngine->getEngine() == ENGINE_VORTICON) { mpMenuDialog->addControl(new CGUIButton( "Controls", new OpenMenuEvent( new CPlayersSelection<OpenControlMenuEvent>() ) ) ); } #endif #if !defined(EMBEDDED) mpMenuDialog->addControl( new CGUIButton( "Camera", new OpenMenuEvent( new CCameraSettings() ) ) ); #endif mpMenuDialog->addControl(new CGUIButton( "Profile", new OpenMenuEvent( new CProfilesMenu() ) ) ); setMenuLabel("CONFIGMENULABEL"); }
void CMainMenu::createGalaxyMenu( const bool openedGamePlay ) { g_pBehaviorEngine->mPlayers = 1; #if defined (SINGLEPLAYER) g_pBehaviorEngine->mPlayers = 1; CGUIButton *button = new CGUIButton( "New Game", new OpenMenuEvent(new CDifficultySelection) ); #else CGUIButton *button = new CGUIButton( "New Game", new OpenMenuEvent( new CPlayersSelection<NewGamePlayersEvent>(true) ) ); #endif mpMenuDialog->addControl( button ); // TODO: Some items are still disabled, because those are not yet implemented in Galaxy CGUIButton *loadButton = new CGUIButton( "Load", new OpenMenuEvent( new CLoadMenu() ) ); mpMenuDialog->addControl( loadButton ); loadButton->mEnabled = true; CGUIButton *saveButton = new CGUIButton( "Save", new OpenMenuEvent( new CSaveMenu() ) ); mpMenuDialog->addControl( saveButton ); saveButton->mEnabled = openedGamePlay; mpMenuDialog->addControl(new CGUIButton( "Configure", new OpenMenuEvent( new CSettingsMenu() ) ) ); CGUIButton *highscoreButton = new CGUIButton( "High Scores", new StartInfoSceneEvent( new CHighScores ) ); mpMenuDialog->addControl( highscoreButton ); highscoreButton->mEnabled = false; CGUIButton *infoButton = new CGUIButton( "Info", new OpenMenuEvent( new CHelpMenu() ) ); mpMenuDialog->addControl( infoButton ); infoButton->mEnabled = false; mpMenuDialog->addControl(new CGUIButton( "End Game", new EventEndGamePlay() ) ); mpMenuDialog->addControl(new CGUIButton( "Quit", new GMQuit() ) ); setMenuLabel("MAINMENULABEL"); }
CSaveMenu::CSaveMenu() : CBaseMenu(CRect<float>(0.1f, 0.0f, 0.8f, 1.0f) ), mp_OverwriteMenu(NULL), m_overwrite(false) { // Load the state-file list std::vector<std::string> StateFileList = gpSaveGameController->getSlotList(); for(Uint32 i=1; i<=8; i++) { std::string text = EMPTY_TEXT; if(i <= StateFileList.size()) text = StateFileList.at(i-1); mpMenuDialog->addControl(new CGUIInputText( text, CGUIInputText::VORTICON ) ); } setMenuLabel("SAVEMENULABEL"); }
CLoadMenu::CLoadMenu() : CBaseMenu( CRect<float>(0.1f, 0.0f, 0.8f, 1.0f) ) { // Load the state-file list const CGUIControl::Style style = ( g_pBehaviorEngine->getEngine() == ENGINE_GALAXY ) ? CGUIButton::GALAXY_BORDERED : CGUIButton::VORTICON; std::vector<std::string> StateFileList = gpSaveGameController->getSlotList(); std::vector<std::string>::iterator it = StateFileList.begin(); Uint32 i=1; CGUIButton *button; std::string text; for( ; it != StateFileList.end() && i<8 ; i++,it++ ) { text = *it; if( !text.empty() ) { button = new CGUIButton( text, new LoadGameSlotFunctorEvent(i), style ); mpMenuDialog->addControl( button ); button->enable( true ); } } for( int j = i ; j<8 ; j++ ) { text = "Empty"; button = new CGUIButton( text, new LoadGameSlotFunctorEvent(j), style ); mpMenuDialog->addControl( button ); button->enable( false ); } setMenuLabel("LOADMENULABEL"); }
CLoadMenu::CLoadMenu() : VorticonMenu( GsRect<float>(0.1f, 0.0f, 0.8f, 1.0f) ) { // Load the state-file list std::vector<std::string> StateFileList = gpSaveGameController->getSlotList(); std::vector<std::string>::iterator it = StateFileList.begin(); Uint32 i=1; Button *button; std::string text; for( ; it != StateFileList.end() && i<8 ; i++,it++ ) { text = *it; if( !text.empty() ) { button = new Button( text, new LoadGameSlotFunctorEvent(i) ); mpMenuDialog->addControl( button ); button->enable( true ); } } for( int j = i ; j<8 ; j++ ) { text = "Empty"; button = new Button( text, new LoadGameSlotFunctorEvent(j) ); mpMenuDialog->addControl( button ); button->enable( false ); } setMenuLabel("LOADMENULABEL"); }
CControlsettings::CControlsettings( const int selectedPlayer ) : GalaxyMenu( GsRect<float>(0.1f, 0.25f, 0.8f, 0.5f) ), mSelectedPlayer(selectedPlayer) { GsButton *button; button = new GalaxyButton( "Movement", new OpenMovementControlMenuEvent(mSelectedPlayer) ); mpMenuDialog->addControl( button ); button = new GalaxyButton( "Buttons", new OpenButtonsControlMenuEvent(mSelectedPlayer) ); mpMenuDialog->addControl( button ); mpTwoButtonSwitch = new Switch( "Two Button Fire" ); mpTwoButtonSwitch->enable(gInput.getTwoButtonFiring(mSelectedPlayer-1)); mpAnalogSwitch = new Switch( "Analog Movement" ); mpAnalogSwitch->enable(gInput.isAnalog(mSelectedPlayer-1)); mpSuperPogoSwitch = new Switch( "Super Pogo" ); mpSuperPogoSwitch->enable(gInput.SuperPogo(mSelectedPlayer-1)); mpImpPogoSwitch = new Switch( "Impossible Pogo" ); mpImpPogoSwitch->enable(gInput.ImpossiblePogo(mSelectedPlayer-1)); mpAutoGunSwitch = new Switch( "Auto Gun" ); mpAutoGunSwitch->enable(gInput.AutoGun(mSelectedPlayer-1)); mpMenuDialog->addControl( mpTwoButtonSwitch ); mpMenuDialog->addControl( mpAnalogSwitch ); mpMenuDialog->addControl( mpSuperPogoSwitch ); mpMenuDialog->addControl( mpImpPogoSwitch ); mpMenuDialog->addControl( mpAutoGunSwitch ); mpMenuDialog->addControl( new GalaxyButton( "Reset Controls", new ResetInputEvent(mSelectedPlayer-1) ) ); setMenuLabel("KEYBMENULABEL"); }