コード例 #1
0
//=============================================================================
void SteamCloudConfirmation::OnCommand(const char *command)
{
	if ( Q_stricmp( command, "OK" ) == 0 )
	{
		static CGameUIConVarRef cl_cloud_settings( "cl_cloud_settings" );

		CBaseModPanel::GetSingleton().PlayUISound( UISOUND_ACCEPT );

		if ( m_pSteamCloudCheckBox )
		{
			if ( m_pSteamCloudCheckBox->IsSelected() )
			{
				cl_cloud_settings.SetValue( STEAMREMOTESTORAGE_CLOUD_ALL );
				// Re-read the configuration
				engine->ReadConfiguration( -1, false );
			}
			else
			{
				cl_cloud_settings.SetValue( 0 );
			}
		}

		Close();
	}
	else
	{
		BaseClass::OnCommand( command );
	}
}
コード例 #2
0
void SliderControl::UpdateConVar()
{
	CGameUIConVarRef* conVar = GetConVarRef();
	if( conVar && conVar->IsValid() )
	{
		conVar->SetValue( GetCurrentValue() );
	}
}