示例#1
0
文件: main.c 项目: dervish77/adgf
/* Here is where all redrawing will take place for your program. 
 * When the window needs to be redrawn, this function will be called.
 * When your program starts up for the first time, this function will 
 * be called and you should draw anything you need to draw in here.
 */
void do_redisplay(MyProgram *me, int width, int height) 
{
  int i;
  char *str = "My Cool Program";

  if (me->in_color_mode)
   {
     do_colorstuff();
     return;
   }

  SetBgColor(me->draw_widget, WHITE);
  ClearDrawArea();       /* start with a clean slate */

  SetColor(BLACK);
  SetBgColor(me->draw_widget, GREEN);
  DrawText(str, (width-TextWidth(me->draw_font, str))/2, height/2); 

  SetBgColor(me->draw_widget, WHITE);
  SetColor(me->col1);
  for(i=0; i < width; i+=5)
     DrawLine(0,i, i,height);

  SetColor(me->col2);
  for(i=0; i < width; i+=5)
     DrawLine(width,i, width-i,height);
}
示例#2
0
void CBaseHudChat::ApplySchemeSettings( vgui::IScheme *pScheme )
{
	BaseClass::ApplySchemeSettings( pScheme );

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

	// Put input area at bottom
	if ( m_pChatInput )
	{
		int w, h;
		GetSize( w, h );
		m_pChatInput->SetBounds( 1, h - m_iFontHeight - 1, w-2, m_iFontHeight );
	}

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

}
示例#3
0
void CBaseHudChat::FadeChatHistory( void )
{
	float frac = ( m_flHistoryFadeTime -  gpGlobals->curtime ) / CHAT_HISTORY_FADE_TIME;

	int alpha = frac * CHAT_HISTORY_ALPHA;
	alpha = clamp( alpha, 0, CHAT_HISTORY_ALPHA );

	if ( alpha >= 0 )
	{
		if ( GetChatHistory() )
		{
			if ( IsMouseInputEnabled() )
			{
				SetAlpha( 255 );
				GetChatHistory()->SetBgColor( Color( 0, 0, 0, CHAT_HISTORY_ALPHA - alpha ) );
				m_pChatInput->GetPrompt()->SetAlpha( (CHAT_HISTORY_ALPHA*2) - alpha );
				m_pChatInput->GetInputPanel()->SetAlpha( (CHAT_HISTORY_ALPHA*2) - alpha );
				SetBgColor( Color( GetBgColor().r(), GetBgColor().g(), GetBgColor().b(), CHAT_HISTORY_ALPHA - alpha ) );
				m_pFiltersButton->SetAlpha( (CHAT_HISTORY_ALPHA*2) - alpha );
			}
			else
			{
				GetChatHistory()->SetBgColor( Color( 0, 0, 0, alpha ) );
				SetBgColor( Color( GetBgColor().r(), GetBgColor().g(), GetBgColor().b(), alpha ) );
			
				m_pChatInput->GetPrompt()->SetAlpha( alpha );
				m_pChatInput->GetInputPanel()->SetAlpha( alpha );
				m_pFiltersButton->SetAlpha( alpha );
			}
		}
	}
}
void CCommanderStatusPanel::PaintBackground()
{
	if ( m_flCurrentAlpha <= 0.0f )
		return;

	if ( m_Type == TYPE_INFO )
	{
		int alpha = MAX_FILLED_INFO_ALPHA * m_flCurrentAlpha;

		SetBgColor( Color( 0, 0, 0, alpha ) );

		alpha += ( 255 - alpha ) / 2;

		// hogsy start
		surface()->DrawSetColor(Color(120, 120, 180, alpha));
		// hogsy end
	}
	else
	{
		SetBgColor( Color( 0, 0, 0, 0 ) );
		// hogsy start
		surface()->DrawSetColor(Color(0,0,0,0));
		// hogsy end
	}

	// hogsy start
	int w, h;
	GetSize(w, h);

	surface()->DrawOutlinedRect(0, 0, w, h);
	surface()->DrawOutlinedRect(1, 1, w - 1, h - 1);
	// hogsy end

	BaseClass::PaintBackground();
}
示例#5
0
void PlayerListPanel::ApplySchemeSettings(vgui::IScheme *pScheme)
{
    BaseClass::ApplySchemeSettings(pScheme);

    LoadControlSettings( "resource/ui/PlayerListPanel.res" );

    vgui::HFont DefaultFont = pScheme->GetFont( "Default", IsProportional() );
    m_pPlayerHeader->SetFont(DefaultFont);
    m_pPlayerHeader->SetFgColor(Color(255,255,255,255));
    m_pMarinesHeader->SetFont(DefaultFont);
    m_pMarinesHeader->SetFgColor(Color(255,255,255,255));
    m_pPingHeader->SetFont(DefaultFont);
    m_pPingHeader->SetFgColor(Color(255,255,255,255));
    SetPaintBackgroundEnabled(true);
    SetPaintBackgroundType(0);

    // more translucent when viewed ingame
    if (GetParent() && GetParent()->GetParent() && GetParent()->GetParent() == GetClientMode()->GetViewport())
        SetBgColor(Color(0,0,0,128));
    else
        SetBgColor(Color(0,0,0,220));


    m_pLeaderButtonsBackground->SetPaintBackgroundEnabled(false);	// temp removal of this
    m_pLeaderButtonsBackground->SetPaintBackgroundType(0);
    m_pLeaderButtonsBackground->SetBgColor(Color(0,0,0,128));

    m_pStartSavedCampaignVoteButton->m_pLabel->SetFont(DefaultFont);

    Color col_white(255,255,255,255);
    Color col_grey(128,128,128,255);
    m_pStartSavedCampaignVoteButton->SetColors(col_white, col_grey, col_white, col_grey, col_white);
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CHudLabel::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	Panel::ApplySchemeSettings(pScheme);

	if ( m_bSelected )
	{
		SetBgColor( GetSchemeColor("HudStatusSelectedBgColor", pScheme) );
	}
	else
	{
		SetBgColor( GetSchemeColor("HudStatusBgColor", pScheme) );
	}
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CHudOrder::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	Panel::ApplySchemeSettings(pScheme);

	if ( m_pOrder && m_pOrder->IsPersonalOrder() )
	{
		SetBgColor( GetSchemeColor("HudStatusSelectedBgColor", pScheme) );
	}
	else
	{
		SetBgColor( GetSchemeColor("HudStatusBgColor", pScheme) );
	}
}
void CHudFlagCarrier::Paint ( void )
{
	SetBgColor( Color( GetBgColor().r(), GetBgColor().g(), GetBgColor().b(), 128 ) );

	DisplayText
	(
		m_Text[ TEAM_BLUE ], 
		m_flBlueTextX, 
		m_flBlueTextY,
		m_BlueForegroundColor
	);
	
	DisplayText
	(
		m_Text[ TEAM_RED ], 
		m_flRedTextX,
		m_flRedTextY, 
		m_RedForegroundColor
	);

	if ( m_iTakenByPlayer[ TEAM_RED ] != TAKEN_INVALID_PLAYER )
	{
		m_pAvatar[ TEAM_RED ].Paint();
	}

	if ( m_iTakenByPlayer[ TEAM_BLUE ] != TAKEN_INVALID_PLAYER )
	{
		m_pAvatar[ TEAM_BLUE ].Paint();
	}
}
示例#9
0
Container::Container()
{
	m_transparent = true;
	SetBgColor(Theme::Colors::bg);
	onMouseLeave.connect(sigc::mem_fun(this, &Container::_OnMouseLeave));
	onSetSize.connect(sigc::mem_fun(this, &Container::_OnSetSize));
}
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 );
}
void CASW_Difficulty_Entry::OnThink()
{
	bool bCursorOver = IsCursorOver();
	if (m_bMouseOver != bCursorOver)
	{
		m_bMouseOver = bCursorOver;
		if (m_bMouseOver)
		{
			SetBgColor(Color(75,84,106,255));
		}
		else
		{
			SetBgColor(Color(0,0,0,0));
		}
	}	
}
示例#12
0
void CBaseHudChatInputLine::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings(pScheme);
	
	// FIXME:  Outline
	vgui::HFont hFont = pScheme->GetFont( "ChatFont" );

	m_pPrompt->SetFont( hFont );
	m_pInput->SetFont( hFont );

	m_pInput->SetFgColor( pScheme->GetColor( "Chat.TypingText", pScheme->GetColor( "Panel.FgColor", Color( 255, 255, 255, 255 ) ) ) );

	SetPaintBackgroundEnabled( true );
	m_pPrompt->SetPaintBackgroundEnabled( true );
	m_pPrompt->SetContentAlignment( vgui::Label::a_west );
	m_pPrompt->SetTextInset( 2, 0 );

	m_pInput->SetMouseInputEnabled( true );

#ifdef HL1_CLIENT_DLL
	m_pInput->SetBgColor( Color( 255, 255, 255, 0 ) );
#endif

	SetBgColor( Color( 0, 0, 0, 0) );

}
示例#13
0
void TextWindow::Initialise (HWND hWnd, unsigned int uID)
{	
	// Make the ID global
	m_ID = uID;
	m_parenthwnd = hWnd;
	//m_hwnd = hWnd;

	// Temporary string value for uID
	char szID[SIZE_STRING];
	ZeroMemory (szID, SIZE_STRING);

	SetParentHWND (hWnd);
	SetBgColor (GetSysColor (COLOR_BTNFACE));
	SetCaption (TEXT ("Decrypted Text"));
	SetWindowStyle (FS_STYLESTANDARD);

	// Create the class name
	strcat_s (m_szClassname, SIZE_STRING, "TextWindowClass");
	sprintf_s (szID, SIZE_STRING, "%d", uID);
	strcat_s (m_szClassname, SIZE_STRING, szID);

	if (m_binitialised == false) {
		CreateAppWindow (m_szClassname, 70, 0, 400, 550, true);
		m_uihandler.SetWindowProperties (0, 0, 300, 0, RGB (230, 230, 240));
		SetWindowPosition (FS_CENTER);
		m_binitialised = true;
	}

	Show ();
}
示例#14
0
NS_IMETHODIMP 
HTMLBodyElement::SetBgColor(const nsAString& aBgColor)
{
  ErrorResult rv;
  SetBgColor(aBgColor, rv);
  return rv.StealNSResult();
}
示例#15
0
void FontTestPanel::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings(pScheme);

	SetPaintBackgroundEnabled(true);
	SetPaintBackgroundType(0);
	SetBgColor(Color(0,0,0,255));

	for (int i=0;i<ASW_FONT_TEST_LABELS;i++)
	{
		m_pLabel[i]->SetFgColor(pScheme->GetColor("White", Color(255,255,255,255)));
	}
	int k=0;
	SetLabelFont(pScheme, k++, "Default", "Default 123456 NO", false);
	SetLabelFont(pScheme, k++, "Default", "Default proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultUnderline", "DefaultUnderline 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultUnderline", "DefaultUnderline proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultSmall", "DefaultSmall 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultSmall", "DefaultSmall proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultMedium", "DefaultMedium 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultMedium", "DefaultMedium proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultVerySmall", "DefaultVerySmall 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultVerySmall", "DefaultVerySmall proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultLarge", "DefaultLarge 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultLarge", "DefaultLarge proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultExtraLarge", "DefaultExtraLarge 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultExtraLarge", "DefaultExtraLarge proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "DefaultLarge", "DefaultLarge 123456 NO", false);
	SetLabelFont(pScheme, k++, "DefaultLarge", "DefaultLarge proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman8", "Sansman8 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman8", "Sansman8 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman10", "Sansman10 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman10", "Sansman10 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman12", "Sansman12 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman12", "Sansman12 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman14", "Sansman14 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman14", "Sansman14 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman16", "Sansman16 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman16", "Sansman16 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman18", "Sansman18 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman18", "Sansman18 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Sansman20", "Sansman20 123456 NO", false);
	SetLabelFont(pScheme, k++, "Sansman20", "Sansman20 proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "CleanHUD", "CleanHUD 123456 NO", false);
	SetLabelFont(pScheme, k++, "CleanHUD", "CleanHUD proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Courier", "Courier 123456 NO", false);
	SetLabelFont(pScheme, k++, "Courier", "Courier proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "SmallCourier", "SmallCourier 123456 NO", false);
	SetLabelFont(pScheme, k++, "SmallCourier", "SmallCourier proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "Verdana", "Verdana 123456 NO", false);
	SetLabelFont(pScheme, k++, "Verdana", "Verdana proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "VerdanaSmall", "VerdanaSmall 123456 NO", false);
	SetLabelFont(pScheme, k++, "VerdanaSmall", "VerdanaSmall proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "CampaignTitle", "CampaignTitle 123456 NO", false);
	SetLabelFont(pScheme, k++, "CampaignTitle", "CampaignTitle proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "MainMenu", "MainMenu 123456 NO", false);
	SetLabelFont(pScheme, k++, "MainMenu", "MainMenu proportional 123456 YES", true);
	SetLabelFont(pScheme, k++, "MissionChooserFont", "MissionChooserFont 123456 NO", false);
	SetLabelFont(pScheme, k++, "MissionChooserFont", "MissionChooserFont proportional 123456 YES", true);
}
NS_IMETHODIMP
HTMLTableRowElement::SetBgColor(const nsAString& aBgColor)
{
  ErrorResult rv;
  SetBgColor(aBgColor, rv);
  return rv.ErrorCode();
}
void AboutWindow::Initialise (HWND hWnd, unsigned int uID)
{	
	// Make the ID global
	m_ID = uID;
	m_parenthwnd = hWnd;
	//m_hwnd = hWnd;

	// Temporary string value for uID
	char szID[SIZE_STRING];
	ZeroMemory (szID, SIZE_STRING);

	SetParentHWND (hWnd);
	SetBgColor (GetSysColor (COLOR_BTNFACE));
	SetCaption (TEXT ("About"));
	SetWindowStyle (FS_STYLESTANDARD);

	// Create the class name
	strcat_s (m_szClassname, SIZE_STRING, "ABOUTWindowClass");
	sprintf_s (szID, SIZE_STRING, "%d", uID);
	strcat_s (m_szClassname, SIZE_STRING, szID);


	CreateAppWindow (m_szClassname, 70, 0, 397, 200, true);
	m_uihandler.SetWindowProperties (0, 0, 299, 0, GetSysColor (COLOR_BTNFACE));
	SetWindowPosition (FS_CENTER);
	Show ();
}
CCommanderStatusPanel::CCommanderStatusPanel(const char *pElementName) :
	CHudElement(pElementName), BaseClass( NULL, "CCommanderStatusPanel" )
{
	m_hFont = m_hFontText = 0;
	m_nLeftEdge = 0;
	m_nBottomEdge = 0;
	
	SetBgColor( Color( 0, 0, 0, 100 ) );

	// hogsy start
	vgui::Panel *pParent = g_pClientMode->GetViewport();
	SetParent(pParent);

	SetHiddenBits(HIDEHUD_MISCSTATUS);
	// hogsy end

	// we need updating
	//vgui::ivgui()->AddTickSignal( GetVPanel() );

	InternalClear();

	// hogsy start
	SetAutoDelete(false);
	SetLeftBottom(0, 1 - 10);
	// hogsy end
}
示例#19
0
void CHudChat::ApplySchemeSettings( vgui::IScheme *pScheme )
{
	BaseClass::ApplySchemeSettings( pScheme );

	SetBgColor( Color( 0, 0, 0, 0 ) );
	SetFgColor( Color( 0, 0, 0, 0 ) );
}
示例#20
0
void PlayerListContainerFrame::ApplySchemeSettings(vgui::IScheme *scheme)
{
	BaseClass::ApplySchemeSettings(scheme);

	SetPaintBackgroundEnabled(false);
	SetBgColor(Color(65,74,96,128));
}
void CGUIReportBug::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings( pScheme );

	SetFgColor( pScheme->GetColor( "Modfg", GetFgColor() ) );
	SetBgColor( Color( 0, 0, 0, 0 ) );
	SetBorder( pScheme->GetBorder( "FrameBorder" ) );
}
void CSmartTooltip::ApplySchemeSettings(IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings( pScheme );

	SetBorder( pScheme->GetBorder("ButtonBorder") );

	SetBgColor( Color( 150, 170, 220, 160 ) );
}
示例#23
0
void IconList::AttachedToWindow( void )
{
	SetFgColor( get_default_color( COL_MENU_TEXT ) );
	SetEraseColor( get_default_color( COL_SHINE ) );
	SetBgColor( get_default_color( COL_SHINE ) );

	_Layout();
}
ProtectedMethod void CGUICommunity::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings( pScheme );

	SetFgColor( pScheme->GetColor("Modfg", GetFgColor()) );
	SetBgColor( Color(0, 0, 0, 0) );
	SetBorder( pScheme->GetBorder( "FrameBorder" ) );
}
void CHudVoiceSelfStatus::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings( pScheme );

#ifdef HL2MP
	SetBgColor( Color( 0, 0, 0, 0 ) );
#endif
}
void CASW_VGUI_Computer_Menu::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings(pScheme);

	SetPaintBackgroundType(0);
	SetPaintBackgroundEnabled(false);
	SetBgColor( Color(0,0,0,0) );
	SetMouseInputEnabled(true);

	vgui::HFont LabelFont = pScheme->GetFont( "Default", IsProportional() );
	// hide the menu at first
	Color white(255,255,255,255);
	Color blue(19,20,40, 255);
	for (int i=0;i<ASW_COMPUTER_MAX_MENU_ITEMS;i++)
	{
		//if (!m_bSetAlpha)
		//{
			m_pMenuLabel[i]->SetAlpha(0);
			m_pMenuIcon[i]->SetAlpha(0);
			m_pMenuIconShadow[i]->SetAlpha(0);
		//}
		m_pMenuLabel[i]->SetFont(LabelFont);
		m_pMenuLabel[i]->SetPaintBackgroundEnabled(true);
		m_pMenuLabel[i]->SetContentAlignment(vgui::Label::a_center);
		m_pMenuLabel[i]->SetBgColor(Color(19,20,40,255));
		m_pMenuLabel[i]->SetColors(white, white, white, white, blue);
		m_pMenuLabel[i]->SetBorders("TitleButtonBorder", "TitleButtonBorder");
		m_pMenuLabel[i]->SetPaintBackgroundType(2);
	}
	

	vgui::HFont DefaultFont = pScheme->GetFont( "Default", IsProportional() );
	vgui::HFont XLargeFont = pScheme->GetFont( "DefaultExtraLarge", IsProportional() );

	m_pAccessDeniedLabel->SetFont(XLargeFont);
	m_pAccessDeniedLabel->SetFgColor(Color(255,0,0,255));	
	m_pInsufficientRightsLabel->SetFont(DefaultFont);	
	m_pInsufficientRightsLabel->SetFgColor(Color(255,255,255,255));		

	//if (!m_bSetAlpha)
	//{
		m_pBlackBar[0]->SetAlpha(0);
		m_pBlackBar[1]->SetAlpha(0);
		m_pAccessDeniedLabel->SetAlpha(0);
		m_pInsufficientRightsLabel->SetAlpha(0);		
	//}
	if (!m_bSetAlpha)
	{
		m_bSetAlpha = true;
	}
	else
	{
		if (m_hCurrentPage.Get())
			HideMenu(true);
		else
			ShowMenu();	// makes sure the right things are faded in
	}
}
示例#27
0
void CASW_VGUI_Skip_Intro::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings(pScheme);

	SetPaintBackgroundType(0);
	SetPaintBackgroundEnabled(false);
	SetBgColor( Color(0,0,0,255) );
	SetMouseInputEnabled(true);
}
示例#28
0
void IconList::InnerView::AttachedToWindow( void )
{
	View *pcParent = GetParent();
	SetFgColor( pcParent->GetFgColor() );
	SetEraseColor( pcParent->GetEraseColor() );
	SetBgColor( pcParent->GetBgColor() );

	_Layout();
}
void CASW_VGUI_Computer_Weather::ApplySchemeSettings(vgui::IScheme *pScheme)
{
    BaseClass::ApplySchemeSettings(pScheme);

    SetPaintBackgroundType(0);
    SetPaintBackgroundEnabled(false);
    SetBgColor( Color(0,0,0,0) );
    SetMouseInputEnabled(true);

    vgui::HFont LabelFont = pScheme->GetFont( "Default", IsProportional() );

    m_pWarningLabel->SetFont(LabelFont);
    m_pBackButton->SetPaintBackgroundEnabled(true);

    m_pBackButton->SetFont(LabelFont);
    m_pBackButton->SetPaintBackgroundEnabled(true);
    m_pBackButton->SetContentAlignment(vgui::Label::a_center);
    m_pBackButton->SetBorders("TitleButtonBorder", "TitleButtonBorder");
    Color white(255,255,255,255);
    Color blue(19,20,40, 255);
    m_pBackButton->SetColors(white, white, white, white, blue);
    m_pBackButton->SetPaintBackgroundType(2);

    vgui::HFont LargeTitleFont = pScheme->GetFont( "DefaultLarge", IsProportional() );
    //vgui::HFont TitleFont = pScheme->GetFont("Default");

    m_pTitleLabel->SetFgColor(Color(255,255,255,255));
    m_pTitleLabel->SetFont(LargeTitleFont);
    m_pTitleLabel->SetContentAlignment(vgui::Label::a_center);

    for (int i=0; i<ASW_WEATHER_ENTRIES; i++)
    {
        m_pWeatherLabel[i]->SetFont(LabelFont);
        m_pWeatherValue[i]->SetFont(LabelFont);
        ApplySettingAndFadeLabelIn(m_pWeatherLabel[i]);
        ApplySettingAndFadeLabelIn(m_pWeatherValue[i]);
    }

    ApplySettingAndFadeLabelIn(m_pWarningLabel);

    m_pTitleIcon->SetImage("swarm/Computer/IconWeather");
    m_pTitleIconShadow->SetImage("swarm/Computer/IconWeather");

    // fade them in
    if (!m_bSetAlpha)
    {
        m_bSetAlpha = true;
        m_pBackButton->SetAlpha(0);
        vgui::GetAnimationController()->RunAnimationCommand(m_pBackButton, "Alpha", 255, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);
        m_pTitleIcon->SetAlpha(0);
        m_pTitleIconShadow->SetAlpha(0);
        m_pTitleLabel->SetAlpha(0);
        vgui::GetAnimationController()->RunAnimationCommand(m_pTitleLabel, "Alpha", 255, 0.2f, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);
        vgui::GetAnimationController()->RunAnimationCommand(m_pTitleIcon, "Alpha", 255, 0.2f, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);
        vgui::GetAnimationController()->RunAnimationCommand(m_pTitleIconShadow, "Alpha", 30, 0.2f, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);
    }
}
示例#30
0
void CampaignFrame::ApplySchemeSettings(vgui::IScheme *scheme)
{
	BaseClass::ApplySchemeSettings(scheme);

	SetPaintBackgroundEnabled(false);
	if (ASWGameRules() && ASWGameRules()->IsIntroMap())
	{
		SetBgColor(Color(0,0,0,0));
	}
}