/** Process a menu action. */ int DoAction() { switch(GetMenuAction()) { case MENU_START: HideMenu(); EventLoop(); ShowMenu(); return 1; case MENU_EXIT: HideMenu(); return 0; default: return 1; } }
// activates the menu option we clicked on void CASW_VGUI_Computer_Menu::SetHackOption(int iOption) { Msg("CASW_VGUI_Computer_Menu::SetHackOption %d\n", iOption); if (!m_pHackComputer) return; C_ASW_Computer_Area *pArea = m_pHackComputer->GetComputerArea(); if (!pArea) return; if ( iOption == 0 && m_hCurrentPage.Get() ) { DoFadeCurrentPage(); if (m_iPreviousHackOption == ASW_HACK_OPTION_OVERRIDE) // finished a hack? { CLocalPlayerFilter filter; C_BaseEntity::EmitSound( filter, -1 /*SOUND_FROM_LOCAL_PLAYER*/, "ASWComputer.HackComplete" ); } return; } else { if (m_iPreviousHackOption == ASW_HACK_OPTION_OVERRIDE) // finished a hack? { m_iAutodownload = iOption; DoFadeCurrentPage(); return; } } m_iPrepareHackOption = iOption; HideMenu(true); }
void FPlatformerLevelSelect::OnUIPlayStreets() { if (GEngine) { SetOnHiddenHandler<FPlatformerLevelSelect>(this, &FPlatformerLevelSelect::OnMenuHidden); HideMenu(); } }
void CASW_VGUI_Computer_Menu::ApplySchemeSettings(vgui::IScheme *pScheme) { BaseClass::ApplySchemeSettings(pScheme); SetPaintBackgroundType(0); SetPaintBackgroundEnabled(false); SetBgColor( Color(0,0,0,0) ); SetMouseInputEnabled(true); vgui::HFont LabelFont = pScheme->GetFont( "Default", IsProportional() ); // hide the menu at first Color white(255,255,255,255); Color blue(19,20,40, 255); for (int i=0;i<ASW_COMPUTER_MAX_MENU_ITEMS;i++) { //if (!m_bSetAlpha) //{ m_pMenuLabel[i]->SetAlpha(0); m_pMenuIcon[i]->SetAlpha(0); m_pMenuIconShadow[i]->SetAlpha(0); //} m_pMenuLabel[i]->SetFont(LabelFont); m_pMenuLabel[i]->SetPaintBackgroundEnabled(true); m_pMenuLabel[i]->SetContentAlignment(vgui::Label::a_center); m_pMenuLabel[i]->SetBgColor(Color(19,20,40,255)); m_pMenuLabel[i]->SetColors(white, white, white, white, blue); m_pMenuLabel[i]->SetBorders("TitleButtonBorder", "TitleButtonBorder"); m_pMenuLabel[i]->SetPaintBackgroundType(2); } vgui::HFont DefaultFont = pScheme->GetFont( "Default", IsProportional() ); vgui::HFont XLargeFont = pScheme->GetFont( "DefaultExtraLarge", IsProportional() ); m_pAccessDeniedLabel->SetFont(XLargeFont); m_pAccessDeniedLabel->SetFgColor(Color(255,0,0,255)); m_pInsufficientRightsLabel->SetFont(DefaultFont); m_pInsufficientRightsLabel->SetFgColor(Color(255,255,255,255)); //if (!m_bSetAlpha) //{ m_pBlackBar[0]->SetAlpha(0); m_pBlackBar[1]->SetAlpha(0); m_pAccessDeniedLabel->SetAlpha(0); m_pInsufficientRightsLabel->SetAlpha(0); //} if (!m_bSetAlpha) { m_bSetAlpha = true; } else { if (m_hCurrentPage.Get()) HideMenu(true); else ShowMenu(); // makes sure the right things are faded in } }
//----------------------------------------------------------------------------- // Purpose: Message handler for ShowMenu message // takes four values: // short: a bitfield of keys that are valid input // char : the duration, in seconds, the menu should stay up. -1 means is stays until something is chosen. // byte : a boolean, TRUE if there is more string yet to be received before displaying the menu, false if it's the last string // string: menu string to display // if this message is never received, then scores will simply be the combined totals of the players. //----------------------------------------------------------------------------- void CHudMenu::MsgFunc_ShowMenu( bf_read &msg) { m_bitsValidSlots = (short)msg.ReadWord(); int DisplayTime = msg.ReadChar(); int NeedMore = msg.ReadByte(); if ( DisplayTime > 0 ) { m_flShutoffTime = m_flOpenCloseTime + DisplayTime + gpGlobals->realtime; } else { m_flShutoffTime = -1; } if ( m_bitsValidSlots ) { char szString[2048]; msg.ReadString( szString, sizeof(szString) ); if ( !m_fWaitingForMore ) // this is the start of a new menu { Q_strncpy( g_szPrelocalisedMenuString, szString, sizeof( g_szPrelocalisedMenuString ) ); } else { // append to the current menu string Q_strncat( g_szPrelocalisedMenuString, szString, sizeof( g_szPrelocalisedMenuString ), COPY_ALL_CHARACTERS ); } if ( !NeedMore ) { GetClientMode()->GetViewportAnimationController()->StartAnimationSequence("MenuOpen"); m_nSelectedItem = -1; // we have the whole string, so we can localise it now char szMenuString[MAX_MENU_STRING]; Q_strncpy( szMenuString, ConvertCRtoNL( hudtextmessage->BufferedLocaliseTextString( g_szPrelocalisedMenuString ) ), sizeof( szMenuString ) ); g_pVGuiLocalize->ConvertANSIToUnicode( szMenuString, g_szMenuString, sizeof( g_szMenuString ) ); ProcessText(); } m_bMenuDisplayed = true; m_bMenuTakesInput = true; m_flSelectionTime = gpGlobals->curtime; } else { HideMenu(); } m_fWaitingForMore = NeedMore; }
void APacmanMainMenuHUD::EndPlay(const EEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndPlayReason); while (DisplayedMenuStack.Num() > 2) { HideMenu(); } GEngine->GameViewport->RemoveViewportWidgetContent(MainMenuWidget.ToSharedRef()); MainMenuWidget.Reset(); }
void InputEvents::ProcessMenuTimer() { if (CommonInterface::main_window.HasDialog()) /* no menu updates while a dialog is visible */ return; if (MenuTimeOut == CommonInterface::GetUISettings().menu_timeout) HideMenu(); // refresh visible buttons if still visible drawButtons(getModeID()); MenuTimeOut++; }
void GlobalSettings::CreateSettingsMenu(int menuNr) { Settings Settings; if(CurrentMenu) return; int Idx = 0; //! GUI Settings if(menuNr == Idx++) { HideMenu(); MainWindow::Instance()->ResumeGui(); CurrentMenu = new GuiSettingsMenu(); Append(CurrentMenu); } //! Sound else if(menuNr == Idx++) { HideMenu(); MainWindow::Instance()->ResumeGui(); CurrentMenu = new SoundSettingsMenu(); Append(CurrentMenu); } //! Custom Paths else if(menuNr == Idx++) { HideMenu(); MainWindow::Instance()->ResumeGui(); CurrentMenu = new CustomPathsSM(); Append(CurrentMenu); } //! WiiTDB if(menuNr == Idx++) { HideMenu(); MainWindow::Instance()->ResumeGui(); CurrentMenu = new WiiTDBSettingsMenu(); Append(CurrentMenu); } //! Update else if(menuNr == Idx++) { HideMenu(); MainWindow::Instance()->ResumeGui(); CurrentMenu = new UpdateSettingsMenu(); Append(CurrentMenu); } //! Default Settings else if(menuNr == Idx++) { int choice = WindowPrompt(tr( "Reset Settings" ), tr("Are you sure ?"), tr( "Yes" ), tr( "Cancel" )); if (choice == 1) { MainWindow::Instance()->HaltGui(); Settings.SetDefault(); bgMusic->Load(cfg.BgMusicPath); bgMusic->SetLoop(cfg.BgMusicLoop); bgMusic->SetVolume(cfg.MusicVolume); bgMusic->Play(); Settings.LoadLanguage(NULL, APP_DEFAULT); returnMenu = MENU_SETTINGS; MainWindow::Instance()->ResumeGui(); } } //! Credits else if(menuNr == Idx++) { HideMenu(); Remove(backBtn); MainWindow::Instance()->ResumeGui(); ShowCredits(); Append(backBtn); ShowMenu(); } }
void FPlatformerIngameMenu::CloseAndExit() { HideMenu(); SetOnHiddenHandler<FPlatformerIngameMenu>(this, &FPlatformerIngameMenu::ReturnToMainMenu); }
// ----------------------------------------------------------------------------- // CTestSettingPage::TestHideMenu // ----------------------------------------------------------------------------- // void CTestSettingPage::TestHideMenu() { HideMenu(); }