Holdout_Wave_Announce_Panel::Holdout_Wave_Announce_Panel( vgui::Panel *parent, const char *name ) : vgui::EditablePanel( parent, name ) { SetProportional( true ); m_pWaveAnnounceLabel = new vgui::Label( this, "WaveAnnounceLabel", "" ); m_pGetReadyLabel = new vgui::Label( this, "GetReadyLabel", "" ); m_flWaveNumberSoundTime = 0.0f; m_flGetReadySoundTime = 0.0f; m_flGetReadySlideSoundTime = 0.0f; }
//============================================================================= ControllerOptionsButtons::ControllerOptionsButtons(Panel *parent, const char *panelName): BaseClass(parent, panelName) { SetProportional( true ); SetUpperGarnishEnabled(true); SetLowerGarnishEnabled(true); m_bActivateOnFirstThink = true; m_nRecalculateLabelsTicks = -1; UpdateFooter(); }
//----------------------------------------------------------------------------- // Purpose: Constructor //----------------------------------------------------------------------------- CDoDHudHealth::CDoDHudHealth( vgui::Panel *parent, const char *name ) : vgui::EditablePanel( parent, name ) { SetProportional( true ); m_pHealthBar = new CDoDHudHealthBar( this, "HealthBar" ); m_pClassImageBG = new vgui::ImagePanel( this, "HealthClassImageBG" ); m_pClassImage = new vgui::ImagePanel( this, "HealthClassImage" ); m_nPrevClass = PLAYERCLASS_UNDEFINED; m_nPrevTeam = TEAM_INVALID; // load control settings... LoadControlSettings( "resource/UI/HudPlayerStatusHealth.res" ); }
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); }
//----------------------------------------------------------------------------- // Purpose: Constructor //----------------------------------------------------------------------------- CHudViewport::CHudViewport(vgui::Panel *parent, const char *name) : BaseClass( parent, "ClientModeHLNormal" ) { SetCursor( m_hCursorNone ); // use a custom scheme for the hud vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFile("resource/ClientScheme.res", "ViewPort"); SetScheme(scheme); SetProportional(true); // create our animation controller m_pAnimController = new vgui::AnimationController(this); m_pAnimController->SetScheme(scheme); m_pAnimController->SetProportional(true); if (!m_pAnimController->SetScriptFile("scripts/HudAnimations.txt")) { Assert(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 CIOSUpdatePanel::ApplySchemeSettings( IScheme *pScheme ) { m_pScheme = pScheme; BaseClass::ApplySchemeSettings( pScheme ); SetTitle("IOS Updater", false); SetProportional(false); SetSizeable(false); SetBounds(0, 0, PANEL_WIDTH, PANEL_HEIGHT); //SetBgColor(Color(0, 0, 0, 255)); SetPaintBackgroundEnabled(true); SetCloseButtonVisible(false); MoveToCenterOfScreen(); m_pContent->SetBounds(PADDING, PADDING + TOP_PADDING, GetWide() - 2 * PADDING, GetTall() - 2 * PADDING - TOP_PADDING); m_pUpdateButton->SetBounds(m_pContent->GetWide() / 2 - UPDATE_BUTTON_WIDTH / 2, m_pContent->GetTall() - UPDATE_BUTTON_HEIGHT - BUTTON_MARGIN - BUTTON_HEIGHT, UPDATE_BUTTON_WIDTH, UPDATE_BUTTON_HEIGHT); m_pUpdateButton->SetContentAlignment(Label::a_center); m_pCloseButton->SetBounds(m_pContent->GetWide() / 2 - BUTTON_WIDTH / 2, m_pContent->GetTall() - BUTTON_HEIGHT, BUTTON_WIDTH, BUTTON_HEIGHT); m_pCloseButton->SetContentAlignment(Label::a_center); m_pInfoText->SetBounds(PADDING, 3 * PADDING, m_pContent->GetWide() - 2 * PADDING, INFO_HEIGHT); m_pInfoText->SetFont(pScheme->GetFont("DefaultBig")); m_pInfoText->SetContentAlignment(Label::a_center); m_pInfoText->SetFgColor(Color(255, 255, 255, 255)); m_pExtraInfoText->SetBounds(PADDING, 3 * PADDING + INFO_HEIGHT + PADDING, m_pContent->GetWide() - 2 * PADDING, INFO_HEIGHT); m_pExtraInfoText->SetFont(pScheme->GetFont("DefaultBig")); m_pExtraInfoText->SetContentAlignment(Label::a_center); m_pExtraInfoText->SetFgColor(Color(255, 255, 255, 255)); m_pExtraInfoText2->SetBounds(PADDING, 3 * PADDING + 2 * (INFO_HEIGHT + PADDING), m_pContent->GetWide() - 2 * PADDING, INFO_HEIGHT); m_pExtraInfoText2->SetFont(pScheme->GetFont("DefaultBig")); m_pExtraInfoText2->SetContentAlignment(Label::a_center); m_pExtraInfoText2->SetFgColor(Color(255, 255, 255, 255)); m_pProgressBar->SetBounds(m_pContent->GetWide() / 2 - PROGRESSBAR_WIDTH / 2, 3 * PADDING + 3 * (INFO_HEIGHT + PADDING), PROGRESSBAR_WIDTH, PROGRESSBAR_HEIGHT); m_pChangelog->SetBounds(m_pContent->GetWide() / 2 - CHANGELOG_WIDTH / 2, 4 * PADDING + 3 * (INFO_HEIGHT + PADDING) + PROGRESSBAR_HEIGHT, CHANGELOG_WIDTH, CHANGELOG_HEIGHT); }
CASW_Mission_Chooser_Frame::CASW_Mission_Chooser_Frame( vgui::Panel *pParent, const char *pElementName, int iHostType, int iChooserType, IASW_Mission_Chooser_Source *pMissionSource) : Frame(pParent, pElementName) { SetProportional( false ); m_pMissionSource = pMissionSource; // create a propertysheet m_pSheet = new vgui::PropertySheet(this, "MissionChooserSheet"); m_pSheet->SetProportional( false ); m_pSheet->SetVisible(true); // create our 3 lists and put them in as pages in the property sheet m_pChooserList = new CASW_Mission_Chooser_List(m_pSheet, "CampaignList", iChooserType, iHostType, pMissionSource); //m_pCampaignList = new CASW_Mission_Chooser_List(m_pSheet, "CampaignList", ASW_CHOOSER_CAMPAIGN, iHostType); //m_pSavedCampaignList = new CASW_Mission_Chooser_List(m_pSheet, "SavedCampaignList", ASW_CHOOSER_SAVED_CAMPAIGN, iHostType); //m_pSingleMissionList = new CASW_Mission_Chooser_List(m_pSheet, "MissionList", ASW_CHOOSER_SINGLE_MISSION, iHostType); if (iChooserType == ASW_CHOOSER_CAMPAIGN) m_pSheet->AddPage(m_pChooserList, "#asw_start_campaign"); else if (iChooserType == ASW_CHOOSER_SAVED_CAMPAIGN) m_pSheet->AddPage(m_pChooserList, "#asw_load_campaign"); else if (iChooserType == ASW_CHOOSER_SINGLE_MISSION) m_pSheet->AddPage(m_pChooserList, "#asw_single_mission"); if (iHostType == ASW_HOST_TYPE_CREATESERVER) { m_pOptionsPanel = new ServerOptionsPanel(this, "OptionsPanel"); m_pSheet->AddPage(m_pOptionsPanel, "#asw_server_options"); m_pChooserList->m_pServerOptions = m_pOptionsPanel; } else // no need for server options if they're just playing singleplayer { m_pOptionsPanel = NULL; } m_bMadeModal = false; m_bAvoidTranslucency = false; Msg("CASW_Mission_Chooser_Frame\n"); }
//----------------------------------------------------------------------------- // Purpose: Constructor //----------------------------------------------------------------------------- CLoadingDiscPanel::CLoadingDiscPanel( vgui::VPANEL parent ) : BaseClass( NULL, "CLoadingDiscPanel" ) { int w, h; w = ScreenWidth(); h = ScreenHeight(); SetParent( parent ); SetProportional( true ); SetScheme( "ClientScheme" ); SetVisible( false ); SetCursor( NULL ); m_pLoadingLabel = vgui::SETUP_PANEL(new vgui::Label( this, "LoadingLabel", "" )); m_pLoadingLabel->SetPaintBackgroundEnabled( false ); LoadControlSettings( "resource/LoadingDiscPanel.res" ); // center the dialog int wide, tall; GetSize( wide, tall ); SetPos( ( w - wide ) / 2, ( h - tall ) / 2 ); }
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"); }
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 ); }
//----------------------------------------------------------------------------- // 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)); } }