void Menu::update(gdl::Input &input) { static int i; static int a = 0; if (!_start) { if (_menu_type == COMMON_MENU) { if (i != 0) i = 0; CommonMenu(input); } if (_menu_type == PLAY_MENU) { if (i != 1) { _cursor = 5; i = 1; } PlayMenu(input); } if (_menu_type == LOAD_MENU) LoadMenu(); if (_menu_type == OPTION_MENU) OptionMenu(input); } if (!_start && _cursor == 11 && (_menu_type == LOAD_MENU || _menu_type == PLAY_MENU)) { if (a > 20) _start = true; a++; } }
/**************************************************************************** * Emulator Options Menu * ****************************************************************************/ int Emu_options () { int quit = 0; int ret; int prevmenu = menu; int mcardcount = 6; char mcardmenu[6][20] = { {"Video Options"}, {"SRAM Manager"}, {"STATE Manager"}, {"Game Infos"}, {"View Credits"}, {"Return to previous"} }; menu = 0; while (quit == 0) { strcpy (menutitle, "Emulator Options"); ret = DoMenu(&mcardmenu[0], mcardcount); switch (ret) { case -1: case 5: quit = 1; break; case 0: // Video Options OptionMenu(); break; case 1: // File Manager case 2: if (loadsavemenu(ret-1)) return 1; break; case 3: // ROM Information RomInfo(); break; case 4: // view credits legal(); break; } } menu = prevmenu; return 0; }
int NinmanMenu::MainMenu() { int y = 220; while (true) { readkey(); if (key[KEY_ESC]) return 0; if (key[KEY_DOWN]) { y = y + 55; if (y > 440) y = 220; } if (key[KEY_UP]) { y = y - 55; if (y < 220) y = 440; } if (key[KEY_ENTER]) { if (y == 220) { std::string player; while (player == "") player = TextBox(); if (player != "-1") NinmanGame(player.c_str()); } if (y == 275) { Score(); y = 220; } if (y == 330) { OptionMenu(); y = 220; } if (y == 385) { About(); y = 220; } if (y == 440) break; clear_keybuf(); } DrawMenu(y); } return 0; }
void Engine::play() { while (mode != QUIT && engine->hasScreen()) switch (mode) { case START: Animation(); break; case MENU: Menu(); break; case GAME: Game(); break; case MENU_GAME: MenuInGame(); break; case LOAD: LoadSave(); break; case SAVE: SaveGame(); break; case NEW_GAME: LoadGame(); break; case LAUNCH_GAME: NewGame(); break; case OPTION_MENU: OptionMenu(); break; case OPTION_GAME: MenuInGame(); break; case HIGHSCORE: Highscore(); break; default: mode = QUIT; } }
KVOID Kylin::ClGame::UiLoader() { MiniMapMenu* pMiniMap = KNEW MiniMapMenu(); pMiniMap->Initialize(); ShortcutMenu* pShortcut = KNEW ShortcutMenu(); pShortcut->Initialize(); MonsterInfoMenu* pMonsterInfo = KNEW MonsterInfoMenu(); pMonsterInfo->Initialize(); CharInfoMenu* pCharInfo = KNEW CharInfoMenu(); pCharInfo->Initialize(); KitbagMenu* pKitbag = KNEW KitbagMenu(); pKitbag->Initialize(); HelpMenu* pHelp = KNEW HelpMenu(); pHelp->Initialize(); OptionMenu* pOption = KNEW OptionMenu(); pOption->Initialize(); // 按键冲突处理 TaskTipsMenu* pTaskTip = KNEW TaskTipsMenu(); pTaskTip->Initialize(); ////////////////////////////////////////////////////////////////////////// OgreRoot::GetSingletonPtr()->GetGuiManager()->RegisterGui(pMiniMap); OgreRoot::GetSingletonPtr()->GetGuiManager()->RegisterGui(pShortcut); OgreRoot::GetSingletonPtr()->GetGuiManager()->RegisterGui(pMonsterInfo); OgreRoot::GetSingletonPtr()->GetGuiManager()->RegisterGui(pTaskTip); OgreRoot::GetSingletonPtr()->GetGuiManager()->RegisterGui(pCharInfo); OgreRoot::GetSingletonPtr()->GetGuiManager()->RegisterGui(pKitbag); OgreRoot::GetSingletonPtr()->GetGuiManager()->RegisterGui(pHelp); OgreRoot::GetSingletonPtr()->GetGuiManager()->RegisterGui(pOption); }