void COutlookFrame::ResetRoots() { MenuRootC::CloseAllUI(); // if this isn't called the other roots will appear blank // eg. after AutoField -- sequence Plot/Process is blank ResetInterface(Interface::GetInterface()->GetDocument(), false); }
byte InitLevel(byte map) { JamulSoundPurge(); // each level, that should be good if (curWorld.numMaps <= map) return 0; // can't go to illegal map // make a copy of the map to be played curMap = new Map(curWorld.map[map]); curMapFlags = curMap->flags; switch (PlayerGetMusicSettings()) { case MUSIC_OFF: CDStop(); // in case it's playing for some reason break; case MUSIC_ON: CDPlay(curMap->song); break; case MUSIC_RAND: break; // do nothing- if there is a song currently playing, let it finish, else a new // one will automatically start at the next call to CDPlayerUpdate } gameStartTime = timeGetTime(); tickerTime = timeGetTime(); updFrameCount = 0; visFrameCount = 0; numRunsToMakeUp = 0; frmRate = 30.0f; visFrms = 0; if (msgFromOtherModules != MSG_NEWFEATURE) msgFromOtherModules = 0; InitGuys(256); InitBullets(); InitPlayer(INIT_LEVEL, 0, map); InitMessage(); NewBigMessage(curMap->name, 100); InitParticles(512); lastKey = 0; curMap->Init(&curWorld); windingDown = 0; windingUp = 30; ResetInterface(); InitCheater(); SetGiveUpText((byte) (map != 0)); return 1; }
void cScreenGetInput::CheckEvents_ConfirmExit() { if (g_InitWin) { Focused(); g_InitWin = false; } if (g_InterfaceEvents.GetNumEvents() == 0 && !g_EnterKey) { return; } if (g_InterfaceEvents.CheckButton(id_btn_cancel)) { g_ReturnText = ""; g_InitWin = true; g_WinManager.Pop(); return; } if (g_InterfaceEvents.CheckButton(id_btn_ok) || g_EnterKey) { g_EnterKey = false; g_ReturnText = ""; g_InitWin = true; g_WinManager.Pop(); g_WinManager.Pop(); ResetInterface(); // Schedule Quit Event -- To quit //SDL_Event ev; //ev->type = SDL_QUIT; //if (!SDL_PushEvent(ev)) // g_LogFile.write("SDL Quit Re-Scheduled!"); } }
INT_PTR CALLBACK ResetDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { case WM_INITDIALOG: CenterWindow(hDlg); hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MAMEUI_ICON)); SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); hBrush = CreateSolidBrush(RGB(240, 240, 240)); DisableVisualStylesReset(hDlg); return true; case WM_CTLCOLORDLG: return (LRESULT) hBrush; case WM_CTLCOLORSTATIC: case WM_CTLCOLORBTN: hDC = (HDC)wParam; SetBkMode(hDC, TRANSPARENT); SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT)); return (LRESULT) hBrush; case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { case IDOK: { bool resetFilters = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_FILTERS)); bool resetGames = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_GAMES)); bool resetDefaults = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_DEFAULT)); bool resetUI = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_UI)); bool resetInternalUI = Button_GetCheck(GetDlgItem(hDlg, IDC_RESET_MAME_UI)); if (resetFilters || resetGames || resetUI || resetDefaults || resetInternalUI) { char temp[512]; strcpy(temp, MAMEUINAME); strcat(temp, " will now reset the following\n"); strcat(temp, "to the default settings:\n\n"); if (resetDefaults) strcat(temp, "Global games options\n"); if (resetInternalUI) strcat(temp, "Internal MAME interface options\n"); if (resetGames) strcat(temp, "Individual game options\n"); if (resetFilters) strcat(temp, "Custom folder filters\n"); if (resetUI) { strcat(temp, "User interface settings\n\n"); strcat(temp, "Resetting the user interface options\n"); strcat(temp, "requires exiting "); strcat(temp, MAMEUINAME); strcat(temp, ".\n"); } strcat(temp, "\nDo you wish to continue?"); if (win_message_box_utf8(hDlg, temp, "Restore settings", MB_ICONQUESTION | MB_YESNO) == IDYES) { DestroyIcon(hIcon); DeleteObject(hBrush); if (resetFilters) ResetFilters(); if (resetGames) ResetAllGameOptions(); if (resetDefaults) ResetGameDefaults(); if (resetInternalUI) ResetInternalUI(); // This is the only case we need to exit and restart for. if (resetUI) { ResetInterface(); EndDialog(hDlg, 1); return true; } else { EndDialog(hDlg, 0); return true; } } else // Give the user a chance to change what they want to reset. break; } } // Nothing was selected but OK, just fall through case IDCANCEL: DeleteObject(hBrush); DestroyIcon(hIcon); EndDialog(hDlg, 0); return true; } break; } return false; }