示例#1
0
CampaignFrame::CampaignFrame(Panel *parent, const char *panelName, bool showTaskbarIcon) :
	vgui::Frame(parent, panelName, showTaskbarIcon)
{
	vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFile("resource/SwarmSchemeNew.res", "SwarmSchemeNew");
	SetScheme(scheme);
	SetSize( ScreenWidth() + 1, ScreenHeight() + 1 );
	SetTitle("Campaign", true );
	SetPos(0,0);
	SetMoveable(false);
	SetSizeable(false);
	SetMenuButtonVisible(false);
	SetMaximizeButtonVisible(false);
	SetMinimizeToSysTrayButtonVisible(false);
	SetCloseButtonVisible(false);
	SetTitleBarVisible(false);
	SetAlpha(0.3f);
	SetPaintBackgroundEnabled(false);

	m_pCampaignPanel = new CampaignPanel( this, "CampaignPanel" );

	RequestFocus();
	SetVisible(true);
	SetEnabled(true);
	SetKeyBoardInputEnabled(false);

	if (GetClientModeASW() && GetClientModeASW()->m_bSpectator)
	{
		engine->ServerCmd("cl_spectating");
	}
}
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *parent - 
//			*action - 
//			newaction - 
//-----------------------------------------------------------------------------
CBaseActionEditDialog::CBaseActionEditDialog( CDemoEditorPanel *parent, CBaseDemoAction *action, bool newaction )
: vgui::Frame( parent, CBaseDemoAction::NameForType( action->GetType() ) ), 
	m_pEditor( parent ),
	m_pAction( action ),
	m_bNewAction( newaction )
{
	if ( m_bNewAction )
	{
		SetTitle( va( "New %s Action", CBaseDemoAction::NameForType( action->GetType() ) ), true );
	}
	else
	{
		SetTitle( va( "Edit %s Action", CBaseDemoAction::NameForType( action->GetType() ) ), true );
	}
	m_pOK = new vgui::Button( this, "OK", "OK" );
	m_pCancel = new vgui::Button( this, "Cancel", "Cancel" );

	m_pActionName = new vgui::TextEntry( this, "ActionName" );
	m_pStart = new vgui::TextEntry( this, "ActionStart" );

	m_pStartType = new vgui::ComboBox( this, "ActionStartType", (int)NUM_TIMING_TYPES, false );

	for ( int i = 0; i < (int)NUM_TIMING_TYPES; i++ )
	{
		m_pStartType->AddItem( CBaseDemoAction::NameForTimingType( (DEMOACTIONTIMINGTYPE)i ), NULL );
	}

	SetSizeable( false );
	SetMoveable( true );
}
PlayerListContainerFrame::PlayerListContainerFrame(Panel *parent, const char *panelName, bool showTaskbarIcon) :
	vgui::Frame(parent, panelName, showTaskbarIcon)
{
	SetMoveable(false);
	SetSizeable(false);
	SetMenuButtonVisible(false);
	SetMaximizeButtonVisible(false);
	SetMinimizeToSysTrayButtonVisible(false);
	SetCloseButtonVisible(true);
	SetTitleBarVisible(false);
}
CASW_VGUI_Edit_Emitter_SaveDialog::CASW_VGUI_Edit_Emitter_SaveDialog( vgui::Panel *pParent, const char *pElementName, CASW_VGUI_Edit_Emitter* pEditFrame ) 
 :	vgui::Frame( pParent, pElementName )
{	
	m_pEditFrame = pEditFrame;
	SetTitle("Save Template", true);
	SetSizeable(false);
	SetMoveable(false);
	SetTall(140);
	SetWide(320);
	SetCloseButtonVisible(false);
	MoveToCenterOfScreen();

	vgui::Label* pPleaseLabel = new vgui::Label(this, "SaveDLabel", "Please enter a name to save this template as:");
	pPleaseLabel->SetPos(20,25);
	pPleaseLabel->SetWide(290);
	pPleaseLabel->SetTall(20);

	//vgui::Label* pLabel = new vgui::Label(this, "SaveDLabel", "Template Name:");
	//pLabel->SetPos(20,45);
	//pLabel->SetWide(220);
	//pLabel->SetTall(20);

	m_pSaveText = new vgui::TextEntry(this, "SaveDText");
	m_pSaveText->SetPos(20,45);
	m_pSaveText->SetWide(220);
	m_pSaveText->SetTall(20);
	char buf[MAX_PATH];
	m_pEditFrame->m_pTemplateCombo->GetText(buf, MAX_PATH);
	m_pSaveText->SetText(buf);

	m_pSaveButton = new vgui::Button(this, "SaveDButton", "Save");
	m_pSaveButton->SetCommand(new KeyValues("SaveDButton"));
	m_pSaveButton->SetWide(60);
	m_pSaveButton->SetTall(20);
	m_pSaveButton->SetPos(190, 115);
	m_pSaveButton->AddActionSignalTarget(this);

	m_pCancelButton = new vgui::Button(this, "CancelDButton", "Cancel");
	m_pCancelButton->SetCommand(new KeyValues("CancelDButton"));
	m_pCancelButton->SetWide(60);
	m_pCancelButton->SetTall(20);
	m_pCancelButton->SetPos(255, 115);
	m_pCancelButton->AddActionSignalTarget(this);

	m_pExistsLabel = new vgui::Label(this, "ExistsLabel", " ");
	m_pExistsLabel->SetPos(20,70);
	m_pExistsLabel->SetWide(300);
	m_pExistsLabel->SetTall(40);

	TextEntryChanged(m_pSaveText);
}
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);
}
示例#6
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");
}
//
//	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" );
}
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();
}
示例#9
0
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CBuildMenu::CBuildMenu(IViewPort *pViewPort) : Frame(NULL, PANEL_BUILD )
{
	gBuildMenu = this;

	m_pViewPort = pViewPort;
	m_iJumpKey = -1; // this is looked up in Activate()
//	m_iScoreBoardKey = -1; // this is looked up in Activate()

	// initialize dialog
	SetTitle("Spawn Menu", true);

	// load the new scheme early!!
	scheme = vgui::scheme()->LoadSchemeFromFile("resource/ZombieMaster.res", "ZombieMaster");
	SetScheme(scheme);
	SetSizeable(false);

	m_hLargeFont = vgui::scheme()->GetIScheme(scheme)->GetFont("Trebuchet18", true);
	m_hMediumFont = vgui::scheme()->GetIScheme(scheme)->GetFont("Trebuchet16", true);

	SetProportional(false);

	LoadControlSettings("Resource/UI/BuildMenu.res");

	vgui::ivgui()->AddTickSignal(GetVPanel(), 150);

	//TGB: moved here because the .res seemed to override it
	SetMoveable(true);
	InvalidateLayout();

	//we fetch a bunch of pointers to various elements here so we can alter them quickly and easily
	info_image = dynamic_cast<vgui::ImagePanel*>(FindChildByName("ZombieImage"));

	info_rescost = dynamic_cast<vgui::Label*>(FindChildByName("CostRes"));
	info_popcost = dynamic_cast<vgui::Label*>(FindChildByName("CostPop"));
	info_description = dynamic_cast<vgui::Label*>(FindChildByName("LabelDescription"));

	removelast =  dynamic_cast<vgui::Button*>(FindChildByName("RemoveLast"));
	clearqueue =  dynamic_cast<vgui::Button*>(FindChildByName("ClearQueue"));

	//prepare a list of our spawn buttons etc so we can easily iterate over them
	for (int i=0; i < TYPE_TOTAL; i++)
	{
		char buffer[25];
		Q_snprintf(buffer, sizeof(buffer), "z_spawn1_%02d", i);
		spawnbuttons[i] = FindChildByName(buffer);

		Q_snprintf(buffer, sizeof(buffer), "z_spawn5_%02d", i);
		spawnfives[i] = FindChildByName(buffer);

		zombieimages[i] = vgui::scheme()->GetImage(TypeToImage[i], true);
		zombiequeue[i] = vgui::scheme()->GetImage(TypeToQueueImage[i], false);
	
	}
	

	KeyValues *kv = new KeyValues("zombiedesc.res");
	if  ( kv->LoadFromFile( (IBaseFileSystem*)filesystem, "resource/zombiedesc.res", "MOD" ) )
	{
		//braaaaaaah, char juggling is pain

		const char *temp = kv->GetString("shambler", "Shambler");
		int length = 128;
		char *saved = new char[length];
		Q_strncpy(saved, temp, strlen(temp) + 1);
		zombiedescriptions[TYPE_SHAMBLER] = saved;

		temp = kv->GetString("banshee", "Banshee");
		saved = new char[length];
		Q_strncpy(saved, temp, strlen(temp) + 1);
		zombiedescriptions[TYPE_BANSHEE] = saved;

		temp = kv->GetString("hulk", "Hulk");
		saved = new char[length];
		Q_strncpy(saved, temp, strlen(temp) + 1);
		zombiedescriptions[TYPE_HULK] = saved;

		temp = kv->GetString("drifter", "Drifter");
		saved = new char[length];
		Q_strncpy(saved, temp, strlen(temp) + 1);
		zombiedescriptions[TYPE_DRIFTER] = saved;

		temp = kv->GetString("immolator", "Immolator");
		saved = new char[length];
		Q_strncpy(saved, temp, strlen(temp) + 1);
		zombiedescriptions[TYPE_IMMOLATOR] = saved;
	}
	//will delete its child keys as well
	kv->deleteThis();

	for (int i=0; i < BM_QUEUE_SIZE; i++)
	{
		char buffer[10];
		Q_snprintf(buffer, sizeof(buffer), "queue%02d", i);
		queueimages[i] = dynamic_cast<vgui::ImagePanel*>(FindChildByName(buffer));
	}
}