void CHudChat::ApplySchemeSettings( vgui::IScheme *pScheme )
{
	if ( m_bIntermissionSet )
		LoadControlSettings( "resource/UI/BaseChat_Intermission.res" );
	else
		LoadControlSettings( "resource/UI/BaseChat.res" );

	m_IScheme = pScheme;

	// Skip over the BaseChat so we don't reload non-intermission settings
	EditablePanel::ApplySchemeSettings( pScheme );

	SetPaintBackgroundType( 2 );
	SetPaintBorderEnabled( true );
	SetPaintBackgroundEnabled( true );

	SetKeyBoardInputEnabled( false );
	SetMouseInputEnabled( false );
	m_nVisibleHeight = 0;

	Color cColor = pScheme->GetColor( "DullWhite", GetBgColor() );
	SetBgColor( Color ( cColor.r(), cColor.g(), cColor.b(), CHAT_HISTORY_ALPHA ) );

	GetChatHistory()->SetVerticalScrollbar( false );
}
예제 #2
0
VideoPanel::VideoPanel( unsigned int nXPos, unsigned int nYPos, unsigned int nHeight, unsigned int nWidth ) : 
	BaseClass( NULL, "VideoPanel" ),
	m_BIKHandle( BIKHANDLE_INVALID ),
	m_nPlaybackWidth( 0 ),
	m_nPlaybackHeight( 0 )
{
	vgui::VPANEL pParent = enginevgui->GetPanel( PANEL_GAMEUIDLL );
	SetParent( pParent );
	SetVisible( false );
	
	// Must be passed in, off by default
	m_szExitCommand[0] = '\0';

	m_bBlackBackground = true;

	SetKeyBoardInputEnabled( true );
	SetMouseInputEnabled( false );

	SetProportional( false );
	SetVisible( true );
	SetPaintBackgroundEnabled( false );
	SetPaintBorderEnabled( false );
	
	// Set us up
	SetTall( nHeight );
	SetWide( nWidth );
	SetPos( nXPos, nYPos );

	SetScheme(vgui::scheme()->LoadSchemeFromFile( "resource/VideoPanelScheme.res", "VideoPanelScheme"));
	LoadControlSettings("resource/UI/VideoPanel.res");
}
예제 #3
0
CHudCloseCaption::CHudCloseCaption( const char *pElementName )
    : CHudElement( pElementName ), vgui::Panel( NULL, "HudCloseCaption" )
{
    vgui::Panel *pParent = g_pClientMode->GetViewport();
    SetParent( pParent );

    SetPaintBorderEnabled( false );
    SetPaintBackgroundEnabled( false );

    vgui::ivgui()->AddTickSignal( GetVPanel() );
}
CHudProgressBar::CHudProgressBar( const char *name ) :
	vgui::Panel( NULL, "HudProgressBar" ), CHudElement( name )
{
	vgui::Panel *pParent = g_pClientMode->GetViewport();
	SetParent( pParent );

	SetPaintBorderEnabled( false );
	SetPaintBackgroundEnabled( false );
	
	SetHiddenBits( HIDEHUD_PLAYERDEAD | HIDEHUD_WEAPONSELECTION );
}
void CCommanderStatusPanel::RecomputeBounds( void )
{
	int maxlines = 5;
	int lineheight = vgui::surface()->GetFontTall( m_hFont );

	int height;
	height = lineheight + ( maxlines - 1 ) * vgui::surface()->GetFontTall( m_hFontText );
	height += 4; // 2 pixels top and bottom

	SetBounds( m_nLeftEdge, m_nBottomEdge - height, ScreenWidth() * 0.6, height );
	SetPaintBackgroundEnabled( true );
	SetPaintBorderEnabled( true );
}
void CCommanderStatusPanel::InternalClear( void )
{
	m_Type = TYPE_UNKNOWN;
	m_szText[ 0 ] = 0;
	m_nTitlePos = -1;

	m_flCurrentAlpha = 0.0f;
	m_flGoalAlpha = 0.0f;

	m_bShowTechnology = false;
	m_pTechnology = NULL;

	SetVisible( false );
	SetPaintBackgroundEnabled( false );
	SetPaintBorderEnabled( false );
}
//-----------------------------------------------------------------------------
// C_SDKRootPanel implementation.
//-----------------------------------------------------------------------------
C_SDKRootPanel::C_SDKRootPanel( vgui::VPANEL parent )
	: BaseClass( NULL, "SDK Root Panel" )
{
	SetParent( parent );
	SetPaintEnabled( false );
	SetPaintBorderEnabled( false );
	SetPaintBackgroundEnabled( false );

	// This panel does post child painting
	SetPostChildPaintEnabled( true );

	// Make it screen sized
	SetBounds( 0, 0, ScreenWidth(), ScreenHeight() );

	// Ask for OnTick messages
	vgui::ivgui()->AddTickSignal( GetVPanel() );
}
void Button_Panel::Initialize()
{
	BaseClass::Initialize();
	
#ifdef MFS
	vgui::HScheme Scheme = vgui::scheme()->LoadSchemeFromFile("resource/schemepanel.res", "SchemePanel");
#else
	vgui::HScheme Scheme = vgui::scheme()->LoadSchemeFromFile("resource2/schemepanel.res", "SchemePanel");
#endif
	SetScheme(Scheme);

	SetProportional(false);
	SetPaintBorderEnabled(false);
	SetPaintBackgroundEnabled(false);
	SetEnabled(true);
	SetVisible(false);
}
void CReplayListPanel::ApplySchemeSettings( vgui::IScheme *pScheme )
{
	BaseClass::ApplySchemeSettings( pScheme );

	LoadControlSettings( "resource/ui/replaybrowser/replaylistpanel.res", "GAME" );

#if !defined( TF_CLIENT_DLL )
	SetPaintBorderEnabled( false );
#endif

	MoveScrollBarToTop();

	vgui::ScrollBar *pScrollBar = dynamic_cast< vgui::ScrollBar * >( FindChildByName( "PanelListPanelVScroll" ) );
	pScrollBar->SetScrollbarButtonsVisible( false );
	Color clrButtonColor = GetSchemeColor( "Yellow", Color( 255, 255, 255, 255 ), pScheme );
	Color clrBgColor = GetSchemeColor( "TanDark", Color( 255, 255, 255, 255 ), pScheme );
	const int nWidth = XRES( 5 );
	pScrollBar->SetSize( nWidth, GetTall() );
	pScrollBar->GetSlider()->SetSize( nWidth, GetTall() );
}
예제 #10
0
VideoPanel::VideoPanel( unsigned int nXPos, unsigned int nYPos, unsigned int nHeight, unsigned int nWidth, vgui::VPANEL pParent ) : 
	BaseClass( NULL, "VideoPanel" ),
	m_BIKHandle( BIKHANDLE_INVALID ),
	m_nPlaybackWidth( 0 ),
	m_nPlaybackHeight( 0 )
{
	
	if (pParent == NULL)
	{
		SetParent( enginevgui->GetPanel( PANEL_GAMEUIDLL ) );
	}
	else
	{
		SetParent( pParent );
	}
	
	SetVisible( false );

	m_czLastFile[0] = '\0';
	m_bPlaying = false;
	m_bRepeat = false;

	m_bBlackBackground = true;

	SetKeyBoardInputEnabled( true );
	SetMouseInputEnabled( false );

	SetProportional( false );
	SetVisible( true );
	SetPaintBackgroundEnabled( false );
	SetPaintBorderEnabled( false );
	SetAutoDelete( true );
	
	// Set us up
	SetTall( nHeight );
	SetWide( nWidth );
	SetPos( nXPos, nYPos );

	SetScheme(vgui::scheme()->LoadSchemeFromFile( "resource/VideoPanelScheme.res", "VideoPanelScheme"));
	LoadControlSettings("resource/UI/VideoPanel.res");
}
void CEditorRoot::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings(pScheme);

	SetPaintBackgroundEnabled(true);
	SetPaintBorderEnabled(false);
	SetPaintEnabled(true);
	SetCloseButtonVisible(false);
	SetSizeable(false);
	SetMoveable(false);

	InitColors();

	SetTitle( "", true );
	SetTitleBarVisible( false );
	m_pLabelTitle->SetText( GetEditorTitle() );
	m_pLabelTitle->SetFont( pScheme->GetFont( "UiBold", false ) );

	SetPaintBackgroundType( 0 );
	OnShaderNameChanged();
	GenerateFonts(pScheme);
}
예제 #12
0
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");
}
예제 #13
0
//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
CToolUI::CToolUI( vgui::Panel *pParent, const char *panelName, CBaseToolSystem *pBaseToolSystem ) :
	BaseClass( pParent, panelName ), m_pClientArea( 0 ), m_pBaseToolSystem( pBaseToolSystem )
{
	SetPaintEnabled(false);
	SetPaintBackgroundEnabled(false);
	SetPaintBorderEnabled(false);

	int w, h;
	pParent->GetSize( w, h );
	SetBounds( 0, 0, w, h );

	m_pMenuBar = m_pBaseToolSystem->CreateMenuBar( m_pBaseToolSystem );
	m_pMenuBar->SetParent( this );
	m_pMenuBar->SetSize( w, MENU_HEIGHT );
	// This can be NULL if no status bar should be included
	m_pStatusBar = m_pBaseToolSystem->CreateStatusBar( this );
	m_pStatusBar->SetParent( this );

	m_pClientArea = new vgui::Panel( this, "ClientArea" );
	m_pClientArea->SetMouseInputEnabled( false );
	m_pClientArea->SetCursor( vgui::dc_none );
	m_pClientArea->SetBounds( 0, MENU_HEIGHT, w, h - MENU_HEIGHT );
}
예제 #14
0
VideoPlayerPanel::VideoPlayerPanel( vgui::Panel *parent, const char *panelName, int nXpos, int nYpos, int nWidth, int nHeight, const char *pVideoFile ) : 
	BaseClass( parent, panelName ),
	m_VideoMaterial( NULL ),
	m_VideoFileName( NULL ),
	m_VideoLoaded( false ),
	m_VideoPlaying( false )
{
	Assert( g_pVideo != NULL );

	// init all the video realted member vars
	ClearVideo();

	SetVisible( false );
	
	SetKeyBoardInputEnabled( false );
	SetMouseInputEnabled( false );

	SetProportional( false );
	SetPaintBackgroundEnabled( false );
	SetPaintBorderEnabled( false );
	
	// Set us up
	SetTall( nHeight );
	SetWide( nWidth );
	SetPos( nXpos, nYpos );

	// use defaults for scheme and control settings for now

	// SetScheme( vgui::scheme()->LoadSchemeFromFile( "resource/VideoPlayerPanelScheme.res", "VideoPlayerPanelScheme"));
	//LoadControlSettings("resource/UI/VideoPlayerPanel.res");

	// Assign video file if supplied
	SetVideo( pVideoFile );
	
	SetVisible( true );

}									
예제 #15
0
void CBaseHudChat::ApplySchemeSettings( vgui::IScheme *pScheme )
{
	LoadControlSettings( "resource/UI/BaseChat.res" );

	BaseClass::ApplySchemeSettings( pScheme );

	SetPaintBackgroundType( 2 );
	SetPaintBorderEnabled( true );
	SetPaintBackgroundEnabled( true );

	SetKeyBoardInputEnabled( false );
	SetMouseInputEnabled( false );
	m_nVisibleHeight = 0;

#ifdef HL1_CLIENT_DLL
	SetBgColor( Color( 0, 0, 0, 0 ) );
	SetFgColor( Color( 0, 0, 0, 0 ) );
#endif

	Color cColor = pScheme->GetColor( "DullWhite", GetBgColor() );
	SetBgColor( Color ( cColor.r(), cColor.g(), cColor.b(), CHAT_HISTORY_ALPHA ) );

	GetChatHistory()->SetVerticalScrollbar( false );
}
CEditorRoot::CEditorRoot( const char *pElementName ) : BaseClass( NULL, "editor" )
{
	pEditorRoot = this;
	Q_memset( hFonts, 0, sizeof(hFonts) );
	Q_memset( hFonts2, 0, sizeof(hFonts2) );
//	m_pKV_MainPreviewMat = NULL;
	//m_pMat_MainPreview = NULL;
//	m_pKV_BGPreviewMat = NULL;
	//m_pMat_BGPreview = NULL;
	m_bPainting = false;
	m_bAutoCompile = true;
	m_bAutoFullcompile = false;
	m_bAutoShaderPublish = true;
	m_bAutoPrecacheUpdate = true;
	m_bWarnOnClose = true;

	InitColors();

	pPreview = NULL;
	m_pKV_NodeHelp = NULL;

	m_iNumMaterials = 0;
	m_pszMaterialList = NULL;

	m_pLastFullCompiledShader = NULL;

	//vgui::VPANEL GameUIRoot = enginevgui->GetPanel( PANEL_GAMEUIDLL );
	vgui::VPANEL EngineRoot = enginevgui->GetPanel( PANEL_ROOT );
	//vgui::VPANEL DLLRoot = VGui_GetClientDLLRootPanel();

	vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFile("resource/SourceScheme.res", "SourceScheme");
	SetScheme( scheme );

	m_pLabelTitle = new Label( this, "title_label", "" );

	pNodeSheet = new CFlowGraphSheet( this, "flowgraphsheets", true, true );
	pNodeSheet->AddActionSignalTarget( this );
	pNodeSheet->SetAddTabButtonEnabled( true );
	//pNodeSheet->ShowContextButtons(true);
	/*pNodeView =*/
	AddNewTab();

	//CFlowGraphPage *page = new CFlowGraphPage( this );
	//m_hFlowGraphPages.AddToTail( page );
	//CNodeView *view = new CNodeView( page, this, "main_nodeview" );
	//m_hNodeViews.AddToTail( pNodeView );
	//page->SetFlowGraph( pNodeView );
	//pNodeSheet->AddPage( page, GetDefaultTabName() );

	m_pLabel_Coords = new Label( this, "mouse_node_coords", "" );
	m_pLabel_FrameTime = new Label( this, "framespeed", "" );


	m_pMenuBar = new MenuBar( this, "menu_bar" );
	m_pMBut_File = new MenuButton( this, "mbut_file", "File" );
	m_pMBut_File->AddActionSignalTarget( this );
	Menu *pMenu_File = new Menu( m_pMBut_File, "" );
	pMenu_File->AddMenuItem( "New", new KeyValues("onmenufile","entry",ER_FMENU_NEW), this );
	pMenu_File->AddSeparator();
	pMenu_File->AddMenuItem( "Open", new KeyValues("onmenufile","entry",ER_FMENU_OPEN), this );
	pMenu_File->AddSeparator();
	pMenu_File->AddMenuItem( "Save", new KeyValues("onmenufile","entry",ER_FMENU_SAVE), this );
	pMenu_File->AddMenuItem( "Save as", new KeyValues("onmenufile","entry",ER_FMENU_SAVE_AS), this );
	pMenu_File->AddMenuItem( "Save all", new KeyValues("onmenufile","entry",ER_FMENU_SAVE_ALL), this );
	pMenu_File->AddSeparator();
	pMenu_File->AddMenuItem( "Undo", new KeyValues("onmenufile","entry",ER_FMENU_UNDO), this );
	pMenu_File->AddMenuItem( "Redo", new KeyValues("onmenufile","entry",ER_FMENU_REDO), this );
	pMenu_File->AddSeparator();
	pMenu_File->AddMenuItem( "Take screenshot", new KeyValues("onmenufile","entry",ER_FMENU_SCREENSHOT), this );
	pMenu_File->AddMenuItem( "Editor config", new KeyValues("onmenufile","entry",ER_FMENU_ECONFIG), this );
	m_pMBut_File->SetMenu( pMenu_File );
	m_pMenuBar->AddButton( m_pMBut_File );

	m_pMBut_Shader = new MenuButton( this, "mbut_shader", "Shader" );
	Menu *pMenu_Shader = new Menu( m_pMBut_Shader, "" );
	pMenu_Shader->AddMenuItem( "Shader settings", new KeyValues("onmenushader","entry",ER_SMENU_SCONFIG), this );
	pMenu_Shader->AddMenuItem( "Shader precache", new KeyValues("onmenushader","entry",ER_SMENU_SPRECACHE), this );
	pMenu_Shader->AddSeparator();
	pMenu_Shader->AddMenuItem( "Full compile", new KeyValues("onmenushader","entry",ER_SMENU_FULLCOMPILE), this );
	pMenu_Shader->AddMenuItem( "Compile all precached", new KeyValues("onmenushader","entry",ER_SMENU_ALLCOMPILE), this );
	pMenu_Shader->AddMenuItem( "Terminate compilers", new KeyValues("onmenushader","entry",ER_SMENU_KILLCOMPILER), this );
	pMenu_Shader->AddSeparator();
	pMenu_Shader->AddMenuItem( "Inject shader into world", new KeyValues("onmenushader","entry",ER_SMENU_INJECT), this );
	pMenu_Shader->AddMenuItem( "Paint world", new KeyValues("onmenushader","entry",ER_SMENU_PAINT), this );
	m_pMBut_Shader->SetMenu( pMenu_Shader );
	m_pMenuBar->AddButton( m_pMBut_Shader );

	m_pMBut_PostProc = new MenuButton( this, "mbut_postproc", "Post processing" );
	Menu *pMenu_PostProc = new Menu( m_pMBut_PostProc, "" );
	pMenu_PostProc->AddMenuItem( "Effect settings", new KeyValues("onmenupostprocessing","entry",ER_PMENU_PCONFIG), this );
	pMenu_PostProc->AddMenuItem( "Effect precache", new KeyValues("onmenupostprocessing","entry",ER_PMENU_PPRECACHE), this );
	pMenu_PostProc->AddMenuItem( "Manage rendertargets", new KeyValues("onmenupostprocessing","entry",ER_PMENU_RTS), this );
	m_pMBut_PostProc->SetMenu( pMenu_PostProc );
	m_pMenuBar->AddButton( m_pMBut_PostProc );

	//m_pLabel_CurrentFileName = new Label( this, "filename", "-" );

	LoadControlSettings("shadereditorui/vgui/shadereditor_root.res");
	OnShaderNameChanged();

	Activate();
	SetVisible( true );
	SetPaintBorderEnabled( false );
	SetPaintBackgroundEnabled( true );
	SetPaintEnabled( true );
	SetParent( EngineRoot );

	m_pKV_SelectionCopy = NULL;
	bFontsLoaded = false;

	m_bHalfView = false;
	m_bHasInput = true;
	//m_bNeedsButtonPush = false;

	m_bDraw_Datatypes = true;
	m_bDraw_Shadows = true;
	m_bDraw_AllLimits = true;
	m_bDoTooltips = true;

	//m_szShaderName[0] = '\0';
	px = py = psx = psy = 0;
	cedit_x = cedit_y = cedit_sx = cedit_sy = -1;
	//m_flErrorTime = 0;

	AllocProceduralMaterials();
	UpdateVariablePointer();

	//m_iLastCompileIndex = GetSafeFlowgraph()->GetStackIndex();
}