Ejemplo n.º 1
0
const wchar_t *QuickJoinPanelItem::GetName() const
{
	static CGameUIConVarRef cl_names_debug( "cl_names_debug" );
	if ( cl_names_debug.GetInt() )
		return PLAYER_DEBUG_NAME_UNICODE;

	return m_name;
}
Ejemplo n.º 2
0
//=============================================================================
void MainMenu::OnOpen()
{
	if ( IsPC() && connect_lobby.GetString()[0] )
	{
		// if we were launched with "+connect_lobby <lobbyid>" on the command line, join that lobby immediately
		uint64 nLobbyID = _atoi64( connect_lobby.GetString() );
		if ( nLobbyID != 0 )
		{
			KeyValues *pSettings = KeyValues::FromString(
				"settings",
				" system { "
					" network LIVE "
				" } "
				" options { "
					" action joinsession "
				" } "
				);
			pSettings->SetUint64( "options/sessionid", nLobbyID );
			KeyValues::AutoDelete autodelete( pSettings );

			g_pMatchFramework->MatchSession( pSettings );
		}
		// clear the convar so we don't try to join that lobby every time we return to the main menu
		connect_lobby.SetValue( "" );
	}

	BaseClass::OnOpen();

	SetFooterState();

#ifndef _X360
	bool bSteamCloudVisible = false;

	{
		static CGameUIConVarRef cl_cloud_settings( "cl_cloud_settings" );
		if ( cl_cloud_settings.GetInt() == -1 )
		{
			CBaseModPanel::GetSingleton().OpenWindow( WT_STEAMCLOUDCONFIRM, this, false );
			bSteamCloudVisible = true;
		}
	}

	if ( !bSteamCloudVisible )
	{
		if ( AddonAssociation::CheckAndSeeIfShouldShow() )
		{
			CBaseModPanel::GetSingleton().OpenWindow( WT_ADDONASSOCIATION, this, false );
		}
	}
#endif
}
Ejemplo n.º 3
0
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
COptionsSubKeyboard::COptionsSubKeyboard(vgui::Panel *parent) : EditablePanel(parent, "OptionsSubKeyboard" )
{
	vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFile("resource/GameUIScheme.res", "GameUIScheme");
	SetScheme(scheme);

	Q_memset( m_Bindings, 0, sizeof( m_Bindings ));

	m_nSplitScreenUser = 0;

	// For joystick buttons, controls which user are binding/unbinding
	if ( !IsX360() )
	{
		//HACK HACK:  Probably the entire gameui needs to have a splitscrene context for which player the settings apply to, but this is only
		// on the PC...
		static CGameUIConVarRef in_forceuser( "in_forceuser" );

		if ( in_forceuser.IsValid() )
		{
			m_nSplitScreenUser = clamp( in_forceuser.GetInt(), 0, 1 );
		}
		else
		{
			m_nSplitScreenUser = MAX( 0, engine->GetActiveSplitScreenPlayerSlot() );
		}
	}

	// Copy active config
	Q_strncpy( m_strActiveConfig, cl_active_config.GetString(), MAX_PATH );

	m_drpConfig = NULL;

	// create the key bindings list
	CreateKeyBindingList();
	// Store all current key bindings
	SaveCurrentBindings();
	// Parse default descriptions
	ParseActionDescriptions();
	
	m_pSetBindingButton = new Button(this, "ChangeKeyButton", "");
	m_pClearBindingButton = new Button(this, "ClearKeyButton", "");

	LoadControlSettings("Resource/OptionsSubKeyboard.res");

	m_pSetBindingButton->SetEnabled(false);
	m_pClearBindingButton->SetEnabled(false);
	SetPaintBackgroundEnabled( false );
}