StateMenu::StateMenu() : StateBase() { fontDark = spFontLoad( FONT_GENERAL, MENU_FONT_SIZE ); if ( fontDark ) { spFontAdd( fontDark, SP_FONT_GROUP_ASCII, spGetFastRGB( 0, 0, 0 ) ); spFontAdd( fontDark, SP_FONT_GROUP_GERMAN, spGetFastRGB( 0, 0, 0 ) ); } fontBright = spFontLoad( FONT_GENERAL, MENU_FONT_SIZE ); if ( fontBright ) spFontAdd( fontBright, SP_FONT_GROUP_ASCII, spGetFastRGB( 255, 255, 255 ) ); addMenuEntry( "start game", stLevel ); addMenuEntry( "show scores", stHighscores ); addMenuEntry( "load replay", stReplayLoader ); #ifdef _DEBUG addMenuEntry( "collision test", stCollision ); #endif addMenuEntry( "exit", -1 ); timers.push_back( &inputLag ); text = spCreateSurface( APP_SCREEN_WIDTH, APP_SCREEN_HEIGHT / 2 ); textMode = 1; textIndex = -1; timers.push_back( &textTimer ); lines.push_back( std::make_pair( "A game by", "Janek Schäfer" ) ); lines.push_back( std::make_pair( "Press \""SP_BUTTON_B_NAME"\" or \""SP_BUTTON_START_NAME"\"", "to select an item" ) ); lines.push_back( std::make_pair( "This is a WIP", "A lot left to do" ) ); lines.push_back( std::make_pair( "Use the arrow keys", "to navigate" ) ); lines.push_back( std::make_pair( "Hint: Bombs explode,", "Spikes and Lasers don't" ) ); lines.push_back( std::make_pair( "Hint: Not entering a name,", "will not add a highscore or replay" ) ); lines.push_back( std::make_pair( "Hint: Waves may exceed,", "the max unit limit" ) ); type = stMenu; }
AppWindow::AppWindow ( const char* label, int x, int y, int w, int h ) : GlutWindow ( label, x, y, w, h ) { addMenuEntry ( "Option 0", evOption0 ); addMenuEntry ( "Option 1", evOption1 ); _viewaxis = true; _fovy = GS_TORAD(60.0f); _rotx = gspi/8.0f; _roty = gspi/4.0f; _w = w; _h = h; rt = 0.25f; rb = 0.25f; numfaces = 16; textureChoice = false; blendFactor = 0.75f; _lasttime = gs_time(); _animateinc = 0.1f; _animate = true; _normals = false; _flatn = true; _phong = false; initPrograms (); initTextures (); }
AppWindow::AppWindow ( const char* label, int x, int y, int w, int h ) :GlutWindow ( label, x, y, w, h ) { _markx = 0; _marky = 0; _markx_prev = 0; _marky_prev = 0; addMenuEntry ( "Option 0", evOption0 ); addMenuEntry ( "Option 1", evOption1 ); f = Field(4); f.initialize(); }
AppWindow::AppWindow ( const char* label, int x, int y, int w, int h ) :GlutWindow ( label, x, y, w, h ) { initPrograms (); addMenuEntry ( "Option 0", evOption0 ); addMenuEntry ( "Option 1", evOption1 ); _viewaxis = true; _fovy = GS_TORAD(120.0f); _rotx = _roty = 0; _w = w; _h = h; rotate = 0; speed = 0; _turnlr = 0; xview = 0; yview = 0; animate = false; sunx = 0.5f; suny = 1.0f; sunz = 0.8f; camera = true; sunanim = true; }
void createMenuEntry(menu_s* m, char* execPath, char* name, char* description, char* author, u8* iconData, menuEntryType_s type) { if(!m || !name || !description || !iconData)return; menuEntry_s* me=malloc(sizeof(menuEntry_s)); if(!me)return; initMenuEntry(me, execPath, name, description, author, iconData, type); addMenuEntry(m, me); }
/** No descriptions */ void BtDisplaySettingsButton::repopulateMenu() { bool enable = false; m_popup->clear(); if (!m_modules.isEmpty()) { if (m_modules.first()->type() == CSwordModuleInfo::Bible) { addMenuEntry(m_lineBreakAction, m_displayOptions.lineBreaks); addMenuEntry(m_verseNumbersAction, m_displayOptions.verseNumbers); enable = true; } if (isOptionAvailable(CSwordModuleInfo::headings)) { addMenuEntry(m_headingsAction, m_filterOptions.headings); enable = true; } if (isOptionAvailable(CSwordModuleInfo::redLetterWords)) { addMenuEntry(m_redWordsAction, m_filterOptions.redLetterWords); enable = true; } if (isOptionAvailable(CSwordModuleInfo::hebrewPoints)) { addMenuEntry(m_hebrewPointsAction, m_filterOptions.hebrewPoints); enable = true; } if (isOptionAvailable(CSwordModuleInfo::hebrewCantillation)) { addMenuEntry(m_hebrewCantillationAction, m_filterOptions.hebrewCantillation); enable = true; } if (isOptionAvailable(CSwordModuleInfo::greekAccents)) { addMenuEntry(m_greekAccentsAction, m_filterOptions.greekAccents); enable = true; } if (isOptionAvailable(CSwordModuleInfo::textualVariants)) { addMenuEntry(m_variantAction, m_filterOptions.textualVariants); enable = true; } if (isOptionAvailable(CSwordModuleInfo::scriptureReferences)) { addMenuEntry(m_scriptureReferencesAction, m_filterOptions.scriptureReferences); enable = true; } if (isOptionAvailable(CSwordModuleInfo::footnotes)) { addMenuEntry(m_footnotesAction, m_filterOptions.footnotes); enable = true; } if (isOptionAvailable(CSwordModuleInfo::morphSegmentation)) { addMenuEntry(m_morphSegmentationAction, m_filterOptions.morphSegmentation); enable = true; } } // Disable the settings button if no options are available: setEnabled(enable); retranslateToolTip(); }
// add one cheat menu entry void addCheatMenuEntry(char* str) { char buf[100]; xsprintf(buf, "[ ] %s", str); addMenuEntry(buf); }