当前位置: 首页>>代码示例>>C++>>正文


C++ FlyoutMenu::SetListener方法代码示例

本文整理汇总了C++中FlyoutMenu::SetListener方法的典型用法代码示例。如果您正苦于以下问题:C++ FlyoutMenu::SetListener方法的具体用法?C++ FlyoutMenu::SetListener怎么用?C++ FlyoutMenu::SetListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FlyoutMenu的用法示例。


在下文中一共展示了FlyoutMenu::SetListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Activate

//=============================================================================
void Cloud::Activate()
{
	BaseClass::Activate();

	if ( m_drpCloud )
	{
		CGameUIConVarRef cl_cloud_settings( "cl_cloud_settings" );

		int iCloudSettings = cl_cloud_settings.GetInt();

		if ( iCloudSettings == -1 || iCloudSettings != 0 )
		{
			m_bCloudEnabled = true;
			m_drpCloud->SetCurrentSelection( "SteamCloudEnabled" );
		}
		else
		{
			m_bCloudEnabled = false;
			m_drpCloud->SetCurrentSelection( "SteamCloudDisabled" );
		}

		FlyoutMenu *pFlyout = m_drpCloud->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	UpdateFooter();

	if ( m_drpCloud )
	{
		if ( m_ActiveControl )
		{
			m_ActiveControl->NavigateFrom( );
		}

		m_drpCloud->NavigateTo();
		m_ActiveControl = m_drpCloud;
	}
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:42,代码来源:vcloud.cpp

示例2: Activate

//=============================================================================
void KeyboardMouse::Activate()
{
	BaseClass::Activate();

	if ( m_drpMouseYInvert )
	{
		CGameUIConVarRef m_pitch("m_pitch");

		if ( m_pitch.GetFloat() > 0.0f )
		{
			m_drpMouseYInvert->SetCurrentSelection( "MouseYInvertDisabled" );
		}
		else
		{
			m_drpMouseYInvert->SetCurrentSelection( "MouseYInvertEnabled" );
		}

		FlyoutMenu *pFlyout = m_drpMouseYInvert->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_drpMouseFilter )
	{
		CGameUIConVarRef m_filter("m_filter");

		if ( !m_filter.GetBool() )
		{
			m_drpMouseFilter->SetCurrentSelection( "MouseFilterDisabled" );
		}
		else
		{
			m_drpMouseFilter->SetCurrentSelection( "MouseFilterEnabled" );
		}

		FlyoutMenu *pFlyout = m_drpMouseFilter->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_sldMouseSensitivity )
	{
		m_sldMouseSensitivity->Reset();
	}

	if ( m_drpDeveloperConsole )
	{
		CGameUIConVarRef con_enable("con_enable");

		if ( !con_enable.GetBool() )
		{
			m_drpDeveloperConsole->SetCurrentSelection( "DeveloperConsoleDisabled" );
		}
		else
		{
			m_drpDeveloperConsole->SetCurrentSelection( "DeveloperConsoleEnabled" );
		}

		FlyoutMenu *pFlyout = m_drpDeveloperConsole->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	CGameUIConVarRef joystick("joystick");

	if ( m_drpGamepadEnable )
	{
		if ( !joystick.GetBool() )
		{
			m_drpGamepadEnable->SetCurrentSelection( "GamepadDisabled" );
		}
		else
		{
			m_drpGamepadEnable->SetCurrentSelection( "GamepadEnabled" );
		}

		FlyoutMenu *pFlyout = m_drpGamepadEnable->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_sldGamepadHSensitivity )
	{
		m_sldGamepadHSensitivity->Reset();

		m_sldGamepadHSensitivity->SetEnabled( joystick.GetBool() );
	}

	if ( m_sldGamepadVSensitivity )
	{
		m_sldGamepadVSensitivity->Reset();
//.........这里部分代码省略.........
开发者ID:Randdalf,项目名称:bliink,代码行数:101,代码来源:vkeyboardmouse.cpp

示例3: Activate

//=============================================================================
void AudioVideo::Activate()
{
	BaseClass::Activate();

#ifdef _X360
	CGameUIConVarRef mat_xbox_ishidef( "mat_xbox_ishidef" );
	CGameUIConVarRef mat_xbox_iswidescreen( "mat_xbox_iswidescreen" );
#endif

	if ( m_sldBrightness )
	{
		m_sldBrightness->Reset();
		m_sldBrightness->NavigateTo();
	}

	if ( m_drpColorMode )
	{
		CGameUIConVarRef mat_monitorgamma_tv_enabled( "mat_monitorgamma_tv_enabled" );

		if ( mat_monitorgamma_tv_enabled.GetBool() )
		{
			m_drpColorMode->SetCurrentSelection( "#L4D360UI_ColorMode_Television" );
		}
		else
		{
			m_drpColorMode->SetCurrentSelection( "#L4D360UI_ColorMode_LCD" );
		}

		FlyoutMenu *pFlyout = m_drpColorMode->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_sldFilmGrain )
	{
		m_sldFilmGrain->Reset();

#ifdef _X360
		if ( !mat_xbox_ishidef.GetBool() )
		{
			m_sldFilmGrain->SetEnabled( false );
		}
#endif
	}

	if ( m_drpSplitScreenDirection )
	{
		bool bWidescreen = false;
#ifdef _X360
		bWidescreen = mat_xbox_iswidescreen.GetBool();
#endif

		if ( !bWidescreen )
		{
			m_drpSplitScreenDirection->SetEnabled( false );
			m_drpSplitScreenDirection->SetCurrentSelection( "#L4D360UI_SplitScreenDirection_Horizontal" );
		}
		else
		{
			CGameUIConVarRef ss_splitmode( "ss_splitmode" );
			int iSplitMode = ss_splitmode.GetInt();

			switch ( iSplitMode )
			{
			case 1:
				m_drpSplitScreenDirection->SetCurrentSelection( "#L4D360UI_SplitScreenDirection_Horizontal" );
				break;
			case 2:
				m_drpSplitScreenDirection->SetCurrentSelection( "#L4D360UI_SplitScreenDirection_Vertical" );
				break;
			default:
				m_drpSplitScreenDirection->SetCurrentSelection( "#L4D360UI_SplitScreenDirection_Default" );
			}
		}

		FlyoutMenu *pFlyout = m_drpSplitScreenDirection->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_sldGameVolume )
	{
		m_sldGameVolume->Reset();
	}

	if ( m_sldMusicVolume )
	{
		m_sldMusicVolume->Reset();
	}

	if ( m_drpCaptioning )
	{
		CGameUIConVarRef closecaption("closecaption");
		CGameUIConVarRef cc_subtitles("cc_subtitles");

//.........这里部分代码省略.........
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:101,代码来源:vaudiovideo.cpp

示例4: OnCommand

//=============================================================================
void InGameChapterSelect::OnCommand(const char *command)
{
	if ( const char* szMissionItem = StringAfterPrefix( command, "cmd_campaign_" ) )
	{
		if ( !Q_stricmp( szMissionItem, m_chCampaign ) )
			return;	// Setting to same mission

		Q_strncpy( m_chCampaign, szMissionItem, ARRAYSIZE( m_chCampaign ) );

		// Determine current game settings
		KeyValues *pGameSettings = g_pMatchFramework->GetMatchNetworkMsgController()->GetActiveServerGameDetails( NULL );
		KeyValues::AutoDelete autodelete_pGameSettings( pGameSettings );
		if ( !pGameSettings )
			return;

		DropDownMenu *pMissionDropDown = dynamic_cast< DropDownMenu* >( FindChildByName( "DrpMission" ) );
		if( pMissionDropDown ) //we should become a listener for events pertaining to the mission flyout
		{
			FlyoutMenu* missionFlyout = pMissionDropDown->GetCurrentFlyout();
			if( missionFlyout )
			{
				missionFlyout->SetListener( this );
				if ( vgui::Button *pAddonBtn = missionFlyout->FindChildButtonByCommand( "cmd_addoncampaign" ) )
				{
					pAddonBtn->SetEnabled( false );
				}

				// Disable all other campaigns that cannot be used for a vote
				for ( int k = 0, kNum = missionFlyout->GetChildCount(); k < kNum; ++ k )
				{
					Panel *child = missionFlyout->GetChild( k );
					if ( BaseModHybridButton* button = dynamic_cast< BaseModHybridButton* >( child ) )
					{
						if ( const char* commandValue = button->GetCommand()->GetString( "command", NULL ) )
						{
							if ( char const *szMissionName = StringAfterPrefix( commandValue, "cmd_campaign_" ) )
							{
								pGameSettings->SetString( "game/campaign", szMissionName );
								pGameSettings->SetInt( "game/chapter", 1 );
								if ( !g_pMatchExtSwarm->GetMapInfo( pGameSettings ) )
								{
									button->SetEnabled( false );
								}
							}
						}
					}
				}
			}
		}

	}
	else if ( char const *szChapterSelected = StringAfterPrefix( command, "#L4D360UI_Chapter_" ) )
	{
		m_nChapter = atoi( szChapterSelected );
		UpdateChapterImage( m_chCampaign, m_nChapter );
	}
	else if ( !Q_stricmp( command, "Select" ) )
	{
		KeyValues *pGameSettings = g_pMatchFramework->GetMatchNetworkMsgController()->GetActiveServerGameDetails( NULL );
		KeyValues::AutoDelete autodelete_pGameSettings( pGameSettings );

		if ( !GameModeIsSingleChapter( pGameSettings->GetString( "game/mode" ) ) )
			m_nChapter = 1;

		pGameSettings->SetString( "game/campaign", m_chCampaign );
		pGameSettings->SetInt( "game/chapter", m_nChapter );

		char const *szVoteCommand = "ChangeChapter";

		int iUser = GetGameUIActiveSplitScreenPlayerSlot();
		GAMEUI_ACTIVE_SPLITSCREEN_PLAYER_GUARD( iUser );

		Panel *pDrpChapter = FindChildByName( "DrpChapter" );
		if ( !pDrpChapter || !pDrpChapter->IsEnabled() )
		{
			szVoteCommand = "ChangeMission";
			m_nChapter = 1;

			engine->ClientCmd( CFmtStr( "callvote %s %s;", szVoteCommand, m_chCampaign ) );
		}
		else if ( KeyValues *pInfoMap = g_pMatchExtSwarm->GetMapInfo( pGameSettings ) )
		{
			engine->ClientCmd( CFmtStr( "callvote %s %s;", szVoteCommand, pInfoMap->GetString( "map" ) ) );
		}

		GameUI().AllowEngineHideGameUI();
		engine->ClientCmd( "gameui_hide" );
		Close();
	}	
	else if ( !Q_strcmp( command, "Cancel" ) )
	{
		GameUI().AllowEngineHideGameUI();
		engine->ClientCmd("gameui_hide");
		Close();
	}
}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:97,代码来源:vingamechapterselect.cpp

示例5: ResetControlValues

//=============================================================================
void ControllerOptions::ResetControlValues( void )
{
    // labels for button config and stick config
    CGameUIConVarRef joy_cfg_preset( "joy_cfg_preset" );
    int iButtonSetting = clamp( joy_cfg_preset.GetInt(), 0, 3 );
    if ( m_pEditButtons )
    {
        m_pEditButtons->SetDropdownSelection( pszButtonSettingsDisplayName[iButtonSetting] );
    }

    CGameUIConVarRef joy_movement_stick("joy_movement_stick");
    int iStickSetting = ( joy_movement_stick.GetInt() > 0 ) ? 1 : 0;
    if ( m_pEditSticks )
    {
        static CGameUIConVarRef s_joy_legacy( "joy_legacy" );
        if ( s_joy_legacy.IsValid() && s_joy_legacy.GetBool() )
        {
            iStickSetting += 2; // Go to the legacy version of the default/southpaw string.
        }

        m_pEditSticks->SetDropdownSelection( pszStickSettingsDisplayName[iStickSetting] );
    }

    if( m_pVerticalSensitivity )
    {
        m_pVerticalSensitivity->Reset();
    }

    if( m_pHorizontalSensitivity )
    {
        m_pHorizontalSensitivity->Reset();
    }

    if( m_pLookType )
    {
        m_pLookType->SetFlyout( "FlmLookType" );

        CGameUIConVarRef joy_inverty("joy_inverty");

        int iInvert = ( joy_inverty.GetInt() > 0 ) ? CONTROLLER_LOOK_TYPE_INVERTED : CONTROLLER_LOOK_TYPE_NORMAL;
        m_pLookType->SetCurrentSelection( pszLookTypes[iInvert] );

        FlyoutMenu *pFlyout = m_pLookType->GetCurrentFlyout();
        if ( pFlyout )
        {
            pFlyout->SetListener( this );
        }
    }

    if( m_pDuckMode )
    {
        m_pDuckMode->SetFlyout( "FlmDuckMode" );

        CGameUIConVarRef option_duck_method("option_duck_method");

        int iDuckMode = ( option_duck_method.GetInt() > 0 ) ? DUCK_MODE_TOGGLE : DUCK_MODE_HOLD;
        m_pDuckMode->SetCurrentSelection( pszDuckModes[iDuckMode] );

        FlyoutMenu *pFlyout = m_pDuckMode->GetCurrentFlyout();
        if ( pFlyout )
        {
            pFlyout->SetListener( this );
        }
    }
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:66,代码来源:vcontrolleroptions.cpp

示例6: Activate

//=============================================================================
void Audio::Activate()
{
	BaseClass::Activate();

	if ( m_sldGameVolume )
	{
		m_sldGameVolume->Reset();
	}

	if ( m_sldMusicVolume )
	{
		m_sldMusicVolume->Reset();
	}

	if ( m_drpSpeakerConfiguration )
	{
		CGameUIConVarRef snd_surround_speakers("Snd_Surround_Speakers");

		switch ( snd_surround_speakers.GetInt() )
		{
		case 2:
			m_drpSpeakerConfiguration->SetCurrentSelection( "#GameUI_2Speakers" );
			break;
		case 4:
			m_drpSpeakerConfiguration->SetCurrentSelection( "#GameUI_4Speakers" );
			break;
		case 5:
			m_drpSpeakerConfiguration->SetCurrentSelection( "#GameUI_5Speakers" );
			break;
		case 0:
		default:
			m_drpSpeakerConfiguration->SetCurrentSelection( "#GameUI_Headphones" );
			break;
		}

		FlyoutMenu *pFlyout = m_drpSpeakerConfiguration->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_drpSoundQuality )
	{
		CGameUIConVarRef Snd_PitchQuality("Snd_PitchQuality");
		CGameUIConVarRef dsp_slow_cpu("dsp_slow_cpu");

		int quality = 0;
		if ( dsp_slow_cpu.GetBool() == false )
		{
			quality = 1;
		}
		if ( Snd_PitchQuality.GetBool() )
		{
			quality = 2;
		}

		switch ( quality )
		{
		case 1:
			m_drpSoundQuality->SetCurrentSelection( "#GameUI_Medium" );
			break;
		case 2:
			m_drpSoundQuality->SetCurrentSelection( "#GameUI_High" );
			break;
		case 0:
		default:
			m_drpSoundQuality->SetCurrentSelection( "#GameUI_Low" );
			break;
		}

		FlyoutMenu *pFlyout = m_drpSoundQuality->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_drpCaptioning )
	{
		CGameUIConVarRef closecaption("closecaption");
		CGameUIConVarRef cc_subtitles("cc_subtitles");

		if ( !closecaption.GetBool() )
		{
			m_drpCaptioning->SetCurrentSelection( "#L4D360UI_AudioOptions_CaptionOff" );
		}
		else
		{
			if ( cc_subtitles.GetBool() )
			{
				m_drpCaptioning->SetCurrentSelection( "#L4D360UI_AudioOptions_CaptionSubtitles" );
			}
			else
			{
				m_drpCaptioning->SetCurrentSelection( "#L4D360UI_AudioOptions_CaptionOn" );
			}
		}

//.........这里部分代码省略.........
开发者ID:Muini,项目名称:Nag-asw,代码行数:101,代码来源:vaudio.cpp

示例7: Activate

//=============================================================================
void Multiplayer::Activate()
{
	BaseClass::Activate();

	if ( m_drpAllowLanGames )
	{
		CGameUIConVarRef net_allow_multicast( "net_allow_multicast" );

		m_drpAllowLanGames->SetCurrentSelection( CFmtStr( "MpLanGames%sabled", net_allow_multicast.GetBool() ? "En" : "Dis" ) );

		FlyoutMenu *pFlyout = m_drpAllowLanGames->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_drpAllowCustomContent )
	{
		CGameUIConVarRef cl_downloadfilter( "cl_downloadfilter" );
		m_drpAllowCustomContent->SetCurrentSelection( CFmtStr( "#GameUI_DownloadFilter_%s", cl_downloadfilter.GetString() ) );

		FlyoutMenu *pFlyout = m_drpAllowCustomContent->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_drpColorBlind )
	{
		CGameUIConVarRef cl_colorblind( "cl_colorblind" );
		m_drpColorBlind->SetCurrentSelection( CFmtStr( "ColorBlind%d", cl_colorblind.GetInt() ) );

		FlyoutMenu *pFlyout = m_drpColorBlind->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_drpGameInstructor )
	{
		CGameUIConVarRef gameinstructor_enable( "gameinstructor_enable" );

		if ( gameinstructor_enable.GetBool() )
		{
			m_drpGameInstructor->SetCurrentSelection( "GameInstructorEnabled" );
		}
		else
		{
			m_drpGameInstructor->SetCurrentSelection( "GameInstructorDisabled" );
		}

		FlyoutMenu *pFlyout = m_drpGameInstructor->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_drpAllowFreeLook )
	{
		CGameUIConVarRef spec_allowroaming( "spec_allowroaming" );

		if ( spec_allowroaming.GetBool() )
		{
			m_drpAllowFreeLook->SetCurrentSelection( "AllowFreeLookEnabled" );
		}
		else
		{
			m_drpAllowFreeLook->SetCurrentSelection( "AllowFreeLookDisabled" );
		}

		FlyoutMenu *pFlyout = m_drpAllowFreeLook->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_drpSpraypaint )
	{
		InitLogoList();

		FlyoutMenu *pFlyout = m_drpSpraypaint->GetCurrentFlyout();
		if ( pFlyout )
		{
			pFlyout->SetListener( this );
		}
	}

	if ( m_drpAllowLanGames )
	{
		if ( m_ActiveControl )
			m_ActiveControl->NavigateFrom( );
		m_drpAllowLanGames->NavigateTo();
		m_ActiveControl = m_drpAllowLanGames;
	}
//.........这里部分代码省略.........
开发者ID:Randdalf,项目名称:bliink,代码行数:101,代码来源:vmultiplayer.cpp


注:本文中的FlyoutMenu::SetListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。