コード例 #1
0
CMOD_Build_Map_Frame::CMOD_Build_Map_Frame( vgui::Panel *pParent, 
	const char *pElementName, C_ASW_Player *pPlayer ) :
	vgui::Frame(pParent, pElementName)
{
	m_fCloseWindowTime = 0;
	
	SetDeleteSelfOnClose(true);	
	SetSizeable( false );

	SetTitle("Building map...", true);

	m_pStatusLabel = new vgui::Label(this, "StatusLabel", "#asw_campaign_initializing");
	m_pStatusLabel->SetContentAlignment(vgui::Label::a_northwest);

	m_pProgressBar = new vgui::ProgressBar(this, "ProgressBar");
	m_pProgressBar->SetProgress(0.0f);

	m_pMapBuilder = missionchooser ? missionchooser->MapBuilder() : NULL;
}
コード例 #2
0
ファイル: mainmenu.cpp プロジェクト: NicolasDe/project-9
MainMenu::MainMenu(vgui::Panel* parent) : BaseClass(NULL, "MainMenu")
{
	vgui::HScheme Scheme = vgui::scheme()->LoadSchemeFromFile("resource2/schememainmenu.res", "SchemeMainMenu");
	SetScheme(Scheme);

	SetProportional(false);
	SetPaintBorderEnabled(false);
	SetPaintBackgroundEnabled(false);
	SetDeleteSelfOnClose(true);
	SetSizeable(false);
	SetMoveable(false);
	SetCloseButtonVisible(false);
	SetMenuButtonVisible(false);
	Activate();

	m_bFocused = true;

	m_logoLeft = GameUI2().GetLocalizedString("#GameUI2_LogoLeft");
	m_logoRight = GameUI2().GetLocalizedString("#GameUI2_LogoRight");

	CreateMenu("resource2/mainmenu.res");
}
コード例 #3
0
CDialog_PPEPrecache::CDialog_PPEPrecache( Panel *parent ) : BaseClass( parent, NULL, "dialog_precache_ppeffect" )
{
	SetSizeable( false );
	SetVisible( true );

	SetMouseInputEnabled( true );
	SetKeyBoardInputEnabled( true );
	Activate();

	m_pList_Effects = new PanelListPanel( this, "effect_list" );
	m_pList_Effects->SetNumColumns( 4 );
	m_pList_Effects->SetFirstColumnWidth( 200 );

	FillList();

	LoadControlSettings( "shadereditorui/vgui/dialog_ppe_precache_list.res" );

	SetTitle( "Post processing precache", true );

	DoModal();
	SetDeleteSelfOnClose( true );
	MoveToCenterOfScreen();
}
コード例 #4
0
CDialog_NewCanvas::CDialog_NewCanvas( CNodeView *n, Panel *parent ) : Frame( parent, "newshader" )
{
	pNodeView = n;

	SetSizeable( false );
	SetVisible( true );

	SetMouseInputEnabled( true );
	SetKeyBoardInputEnabled( true );
	SetDeleteSelfOnClose( true );
	Activate();

	DoModal();

	m_pRadBut_Sm2 = new RadioButton( this, "rad_1", "SM 2.0b" );
	m_pRadBut_Sm3 = new RadioButton( this, "rad_2", "SM 3.0" );
	m_pRadBut_Sm2->SetSubTabPosition( 1 );
	m_pRadBut_Sm3->SetSubTabPosition( 1 );
	m_pRadBut_Sm3->SetSelected( true );

	LoadControlSettings("shadereditorui/vgui/dialog_newcanvas.res");

	SetTitle( "New shader", true );
}
コード例 #5
0
//
//	Name: CGUIListenServer
//	Author: Hekar Khani
//	Description: GUI Panel to replace Valve's CreateServer
//	Notes: 
//
CGUIListenServer::CGUIListenServer( vgui::VPANEL parent ) :
	BaseClass( NULL, "GUIListenServer" )
{	
	SetParent( parent );
	vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFile( "resource/SourceScheme.res", "SourceScheme" );
	SetScheme( scheme );
	LoadControlSettings( "Resource/UI/ListenServer.res" );

	SetVisible( false );
	SetSizeable( false );
	SetMoveable( false );
	SetSmallCaption( true );

	SetMaximizeButtonVisible( false );
	SetMinimizeButtonVisible( false );
	SetCloseButtonVisible( false );
	
	SetMenuButtonResponsive( true );
	SetDeleteSelfOnClose( false );

	GetPropertySheet()->SetSmallTabs( false );

	AddPage( new CPanelListenMain( this ), "Main" );
}
コード例 #6
0
//-----------------------------------------------------------------
// Purpose: Send key presses to the dialog's menu
//-----------------------------------------------------------------
void CSessionLobbyDialog::OnKeyCodePressed( vgui::KeyCode code )
{
	CDialogMenu *pMenu = &m_Menus[m_iActiveMenu];
	if ( !pMenu )
		return;

	int idx = pMenu->GetActiveItemIndex();
	int itemCt = pMenu->GetItemCount();

	CPlayerItem *pItem = dynamic_cast< CPlayerItem* >( pMenu->GetItem( idx ) );
	if ( !pItem )
		return;

	SetDeleteSelfOnClose( true );

	switch( code )
	{
	case KEY_XBUTTON_DOWN:
	case KEY_XSTICK1_DOWN:
		if ( idx >= itemCt - 1 )
		{
			ActivateNextMenu();
		}
		else
		{
			pMenu->HandleKeyCode( code );
		}
		break;

	case KEY_XBUTTON_UP:
	case KEY_XSTICK1_UP:
		if ( idx <= 0 )
		{
			ActivatePreviousMenu();
		}
		else
		{
			pMenu->HandleKeyCode( code );
		}
		break;

	case KEY_XBUTTON_A:
#ifdef _X360
		XShowGamerCardUI( XBX_GetPrimaryUserId(), pItem->m_nId );
#endif
		break;

	case KEY_XBUTTON_RIGHT_SHOULDER:
#ifdef _X360
		{
			// Don't allow player reviews in system link games
			CMatchmakingBasePanel *pBase = dynamic_cast< CMatchmakingBasePanel* >( m_pParent );
			if ( pBase && pBase->GetGameType() == GAMETYPE_SYSTEMLINK_MATCH )
				break;
		}

		XShowPlayerReviewUI( XBX_GetPrimaryUserId(), pItem->m_nId );
#endif
		break;

	case KEY_XBUTTON_LEFT_SHOULDER:
		{
			// Don't kick ourselves
			if ( m_bHostLobby )
			{
				if ( pItem && ((CPlayerItem*)pItem)->m_nId != m_nHostId )
				{
					GameUI().ShowMessageDialog( MD_KICK_CONFIRMATION, this );
				}
				else
				{
					vgui::surface()->PlaySound( "player/suit_denydevice.wav" );
				}
			}
		}
		break;

	case KEY_XBUTTON_B:
		GameUI().ShowMessageDialog( MD_EXIT_SESSION_CONFIRMATION, this );

		if ( m_bHostLobby )
		{
			SetStartGame( false );
		}
		break;

	case KEY_XBUTTON_X:
		if ( m_bStartingGame )
		{
			// We think we're loading the game, so play deny sound
			vgui::surface()->PlaySound( "player/suit_denydevice.wav" );
		}
		else
		{
			matchmaking->ChangeTeam( NULL );
		}
		break;

	case KEY_XBUTTON_Y:
		if ( m_bHostLobby )
		{
			// Don't allow settings changes in ranked games
			CMatchmakingBasePanel *pBase = dynamic_cast< CMatchmakingBasePanel* >( m_pParent );
			if ( pBase && pBase->GetGameType() == GAMETYPE_RANKED_MATCH )
				break;

			SetDeleteSelfOnClose( false );
			OnCommand( "SessionOptions_Modify" );
			SetStartGame( false );
		}
		break;

	case KEY_XBUTTON_START:
		SetStartGame( !m_bStartingGame );
		break;

	default:
		pMenu->HandleKeyCode( code );
		break;
	}
}
コード例 #7
0
CCode_Editor::CCode_Editor( CSheet_Base *parent, const char *pName, CSmartText::CodeEditMode_t mode ) : BaseClass( parent, pName )
{
	m_iMode = mode;

	Activate();
	SetVisible( true );

	SetPaintBackgroundEnabled(true);
	SetPaintEnabled(true);

	SetSizeable(true);
	SetMoveable(true);
	SetMinimumSize( 500, 400 );

	SetDeleteSelfOnClose( true );

	m_iLastAppliedCodeIndex = 0;

	m_pCodeWindow = new CSmartText( this, "codewindow", mode );
	m_pCodeWindow->AddActionSignalTarget( this );

	/*
	TextEntry *pT = new TextEntry( this, "codewindow" );
	pT->SetMultiline( true );
	pT->SetEditable( true );
	pT->SetCatchEnterKey( true );
	pT->SetVerticalScrollbar( true );
	*/

	LoadControlSettings( "shadereditorui/vgui/code_editor_Window.res" );

	UpdateButtonEnabled( true, true );
	SetCloseButtonVisible(false);

	int w,t;
	surface()->GetScreenSize( w, t );
	w *= 0.75f;
	t *= 0.75f;
	SetSize( max( w, 500 ), max( t, 400 ) );
	
	//SetKeyBoardInputEnabled( false );
	//SetMouseInputEnabled( true );

	//SetTitle( "Editor", true );
	SetTitle( "", false );

	Panel *pButton = FindChildByName( "button_save" );
	if ( pButton )
		pButton->SetKeyBoardInputEnabled( false );

	pButton = FindChildByName( "button_apply" );
	if ( pButton )
		pButton->SetKeyBoardInputEnabled( false );
	pButton = FindChildByName( "button_cancel" );
	if ( pButton )
		pButton->SetKeyBoardInputEnabled( false );

	DoModal();

	int rx, ry, rsx, rsy;
	if ( pEditorRoot->GetCodeEditorBounds( rx, ry, rsx, rsy ) )
		SetBounds( rx, ry, rsx, rsy );
	else
		MoveToCenterOfScreen();
}
コード例 #8
0
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
COptionsSubGame::COptionsSubGame( vgui::Panel *parent, const char *name ) : BaseClass( parent, name )
{
	SetDeleteSelfOnClose( true );
	LoadControlSettings( "Resource/OptionsSubGame.res" );
}
コード例 #9
0
CDialog_GeneralConfig::CDialog_GeneralConfig( CNodeView *n, Panel *parent ) : Frame( parent, "_config" )
{
	pNodeView = n;
	GenericShaderData *setup = &n->GetDataForModify();

	SetSizeable( false );
	SetVisible( true );

	SetMouseInputEnabled( true );
	SetKeyBoardInputEnabled( true );
	SetAutoDelete( true );
	Activate();

	m_pRadBut_Sm2 = new RadioButton( this, "rad_1", "SM 2.0b" );
	m_pRadBut_Sm3 = new RadioButton( this, "rad_2", "SM 3.0" );
	m_pRadBut_Sm2->SetSubTabPosition( 1 );
	m_pRadBut_Sm3->SetSubTabPosition( 1 );

	m_pCBut_DepthTest = new CheckButton( this, "depthtest", "Depth testing" );
	m_pCBut_DepthWrite = new CheckButton( this, "depthwrite", "Depth writing" );
	m_pCBut_sRGBWrite = new CheckButton( this, "srgbwrite", "write sRGB" );

	m_pCBox_AlphaBlend = new ComboBox( this, "alphablend", numAblendModes, false );
	
	for ( int i = 0; i < numAblendModes; i++ )
		m_pCBox_AlphaBlend->AddItem( blendNames[i], NULL );

	Assert( numAblendModes == m_pCBox_AlphaBlend->GetItemCount() );

	m_pCBox_Cullmode = new ComboBox( this, "cullmode", 5, false );
	m_pCBox_Cullmode->AddItem( "CW", NULL );
	m_pCBox_Cullmode->AddItem( "CCW", NULL );
	//m_pCBox_Cullmode->AddItem( "Double", NULL );
	m_pCBox_Cullmode->AddItem( "Off", NULL );

	LoadControlSettings("shadereditorui/vgui/dialog_config.res");

	if ( setup->shader->iShaderModel == SM_30 )
		m_pRadBut_Sm3->SetSelected( true );
	else
		m_pRadBut_Sm2->SetSelected( true );

	m_pCBut_DepthTest->SetSelected( setup->shader->iDepthtestmode == DEPTHTEST_NORMAL );
	m_pCBut_DepthWrite->SetSelected( setup->shader->iDepthwritemode == DEPTHWRITE_NORMAL );
	m_pCBox_Cullmode->ActivateItem( setup->shader->iCullmode );
	m_pCBut_sRGBWrite->SetSelected( setup->shader->bsRGBWrite );

	for ( int i = 0; i < numAblendModes; i++ )
	{
		if ( blendIDx[i] == setup->shader->iAlphablendmode )
		{
			m_pCBox_AlphaBlend->ActivateItem( i );
			break;
		}
	}

	SetTitle( "Shader settings", true );


	DoModal();

	SetDeleteSelfOnClose( true );
}