void CharacterCreation::onRaceDialogBack() { selectRace(); MWBase::Environment::get().getWindowManager()->popGuiMode(); MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Name); }
void toMenu() { BITMAP *menuBuffer = NULL; menuBuffer = create_bitmap(1024,768); //Create an empty bitmap. BITMAP *menuBackground = NULL; menuBackground = load_bitmap("Menu Background.bmp", NULL); // Load our picture BITMAP *highlighter = NULL; highlighter = load_bitmap("Menu Highlighter.bmp", NULL); // Load our picture BITMAP *smoke = NULL; smoke = load_bitmap("Menu Smoke.bmp", NULL); // Load our picture MIDI *menuMusic = NULL; menuMusic = load_midi("Soundtrack1.mid"); SAMPLE *menuClick = load_sample("Click.wav"); clear_bitmap(menuBuffer); // Clear the contents of the buffer bitmap int highlightedOption = 1; int inMenu = 1; int smokePosition = 1024; int smokePosition2 = 1024; draw_sprite(menuBuffer, menuBackground, 0, 0); draw_sprite(menuBuffer, highlighter, 6, 186); blit(menuBuffer, screen, 0,0,0,0,1024,768);//Draw the buffer to the screen play_midi(menuMusic, 1); while (inMenu == 1) { draw_sprite(menuBuffer, menuBackground, 0, 0); smokePosition --; smokePosition2 -= 3; if (smokePosition <= -1024) { smokePosition = 0; } readkey(); if(key[KEY_UP]) { play_sample(menuClick, 155, 0, 2000, 0); highlightedOption--; if (highlightedOption <= 0) { highlightedOption = 5; } } else if(key[KEY_DOWN]) { play_sample(menuClick, 155, 0, 2000, 0); highlightedOption++; if (highlightedOption >= 6) { highlightedOption = 1; } } else if(key[KEY_ENTER]) { play_sample(menuClick, 155, 0, 4000, 0); switch (highlightedOption) { case 1: isXenoPatriots = selectRace(); newGame(); startGame(); play_midi(menuMusic, 1); break; case 2: loadGame(); break; case 3: gameOptions(); break; case 4: break; case 5: quitGame(); inMenu ^= 0; return; break; } } switch (highlightedOption) { case 1: draw_sprite(menuBuffer, highlighter, 6, 186); break; case 2: draw_sprite(menuBuffer, highlighter, 6, 278); break; case 3: draw_sprite(menuBuffer, highlighter, 6, 373); break; case 4: draw_sprite(menuBuffer, highlighter, 6, 465); break; case 5: draw_sprite(menuBuffer, highlighter, 6, 629); break; } /*draw_sprite(menuBuffer, smoke, smokePosition, 0); draw_sprite(menuBuffer, smoke, smokePosition + 1024, 0); draw_sprite(menuBuffer, smoke, smokePosition2, 0); draw_sprite(menuBuffer, smoke, smokePosition2 + 1024, 0);*/ blit(menuBuffer, screen, 0,0,0,0,1024,768);//Draw the buffer to the screen } }
void CharacterCreation::onRaceDialogDone(WindowBase* parWindow) { selectRace(); handleDialogDone(CSE_RaceChosen, GM_Class); }