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 }
CDialog_RendertargetList::CDialog_RendertargetList( Panel *parent ) : CBaseDiag( parent, NULL, "_rt_list" ) { SetSizeable( false ); SetVisible( true ); SetMouseInputEnabled( true ); SetKeyBoardInputEnabled( true ); Activate(); m_pList_RT = new PanelListPanel( this, "rtlist" ); m_pList_RT->SetNumColumns( 2 ); m_pList_RT->SetFirstColumnWidth( 200 ); FillList(); LoadControlSettings( "shadereditorui/vgui/dialog_rendertarget_list.res" ); SetTitle( "Rendertarget manager", true ); DoModal(); SetDeleteSelfOnClose( true ); MoveToCenterOfScreen(); }
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"); } }
CASW_VGUI_Skip_Intro::CASW_VGUI_Skip_Intro( vgui::Panel *pParent, const char *pElementName) : vgui::Panel( pParent, pElementName ), CASW_VGUI_Ingame_Panel() { SetKeyBoardInputEnabled(true); RequestFocus(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseHudChat::StopMessageMode( void ) { #ifndef _XBOX SetKeyBoardInputEnabled( false ); m_pChatInput->SetVisible( false ); #endif }
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"); }
// Constuctor: Initializes the Panel CVRPanel::CVRPanel(vgui::VPANEL parent) : BaseClass(NULL, "VRPanel") { int w, h; w = ScreenWidth(); h = ScreenHeight(); SetParent( parent ); SetKeyBoardInputEnabled( true ); SetMouseInputEnabled( true ); SetProportional( false ); SetVisible( true ); SetSize(255, 255); SetPos(398, 240); vgui::ivgui()->AddTickSignal( GetVPanel(), 100 ); // Label // Image m_pImage = new vgui::ImagePanel(this, "imgCalibrate"); m_pImage->SetImage("hydra_calibrate"); m_pImage->SetPos(0, 0); m_pImage->SetSize(255, 255); m_pImage->SetShouldScaleImage(true); m_pImage->SetScaleAmount(.75); DevMsg("VRPanel has been constructed\n"); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseHudChat::StopMessageMode( void ) { #ifndef _XBOX engine->ClientCmd_Unrestricted( "gameui_allowescapetoshow\n" ); SetKeyBoardInputEnabled( false ); SetMouseInputEnabled( false ); if ( GetChatHistory() ) { GetChatHistory()->SetPaintBorderEnabled( false ); GetChatHistory()->GotoTextEnd(); GetChatHistory()->SetMouseInputEnabled( false ); GetChatHistory()->SetVerticalScrollbar( false ); GetChatHistory()->ResetAllFades( false, true, CHAT_HISTORY_FADE_TIME ); GetChatHistory()->SelectNoText(); } //Clear the entry since we wont need it anymore. m_pChatInput->ClearEntry(); m_flHistoryFadeTime = gpGlobals->curtime + CHAT_HISTORY_FADE_TIME; #endif }
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 ); }
CSmartTooltip::CSmartTooltip( Panel *parent, const char *pElementname ) : BaseClass( parent, pElementname ) { m_iParamHighlight = 0; m_iMode = STTIPMODE_NORMAL; m_pCurObject = NULL; m_iFont = GetFontCacheHandle()->GetTooltipFont(); //GetFont( GetFontCacheHandle()->fSizeMin() + GetFontCacheHandle()->fStepSize() * 2 ); SetVisible( true ); MakePopup( false ); SetMouseInputEnabled( false ); SetKeyBoardInputEnabled( false ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseHudChat::StartMessageMode( int iMessageModeType ) { #ifndef _XBOX m_nMessageMode = iMessageModeType; m_pChatInput->ClearEntry(); if ( m_nMessageMode == MM_SAY ) { m_pChatInput->SetPrompt( L"Say :" ); } else { m_pChatInput->SetPrompt( L"Say (TEAM) :" ); } if ( GetChatHistory() ) { GetChatHistory()->SetMouseInputEnabled( true ); GetChatHistory()->SetKeyBoardInputEnabled( false ); GetChatHistory()->SetVerticalScrollbar( true ); GetChatHistory()->ResetAllFades( true ); GetChatHistory()->SetPaintBorderEnabled( true ); GetChatHistory()->SetVisible( true ); } vgui::SETUP_PANEL( this ); SetKeyBoardInputEnabled( true ); SetMouseInputEnabled( true ); m_pChatInput->SetVisible( true ); vgui::surface()->CalculateMouseVisible(); m_pChatInput->RequestFocus(); m_pChatInput->SetPaintBorderEnabled( true ); m_pChatInput->SetMouseInputEnabled( true ); //Place the mouse cursor near the text so people notice it. int x, y, w, h; GetChatHistory()->GetBounds( x, y, w, h ); vgui::input()->SetCursorPos( x + ( w/2), y + (h/2) ); m_flHistoryFadeTime = gpGlobals->curtime + CHAT_HISTORY_FADE_TIME; m_pFilterPanel->SetVisible( false ); engine->ClientCmd_Unrestricted( "gameui_preventescapetoshow\n" ); #endif }
CDialog_RendertargetSettings::CDialog_RendertargetSettings( Panel *parent ) : CBaseDiag( parent, NULL, "rtsettings" ) //BaseClass( parent, "rtsettings" ) { m_pRTTarget = NULL; SetMouseInputEnabled( true ); SetKeyBoardInputEnabled( true ); m_pText_RTName = new TextEntry( this, "rt_name" ); m_pText_SizeX = new TextEntry( this, "rt_size_x" ); m_pText_SizeY = new TextEntry( this, "rt_size_y" ); m_pList_Flags = new PanelListPanel( this, "rtlist" ); m_pList_Flags->SetNumColumns( 1 ); m_pList_Flags->SetFirstColumnWidth( 0 ); m_pList_Flags->SetVerticalBufferPixels( 0 ); for ( int i = 0; i < iNumVTFFlags; i++ ) { CheckButton *pCBut = new CheckButton( m_pList_Flags, "", pszVTFFlags[i] ); m_pList_Flags->AddItem( NULL, pCBut ); m_hFlag_Buttons.AddToTail( pCBut ); } m_pCBox_ImgFormat = new ComboBox( this, "cbox_format", 20, false ); for ( int i = 0; i < iNumImgFormatNames; i++ ) m_pCBox_ImgFormat->AddItem( pszImgFormatNames[i], NULL ); m_pCBox_SizeMode = new ComboBox( this, "cbox_sizemode", 20, false ); for ( int i = 0; i < iNumRTSizeModes; i++ ) m_pCBox_SizeMode->AddItem( pszRTSizeModes[i], NULL ); m_pCBox_DepthMode = new ComboBox( this, "cbox_depthmode", 20, false ); for ( int i = 0; i < iNumRTDepthModes; i++ ) m_pCBox_DepthMode->AddItem( pszRTDepthModes[i], NULL ); LoadControlSettings( "shadereditorui/vgui/dialog_rendertarget_settings.res" ); SetSizeable( false ); SetTitle( "Rendertarget properties", true ); SetCloseButtonVisible( false ); DoModal(); MoveToCenterOfScreen(); }
void CEditorRoot::PerformLayout() { BaseClass::PerformLayout(); SetZPos(0); int wide,tall; surface()->GetScreenSize(wide, tall); if ( m_bHalfView ) wide /= 2; SetPos(0,0); SetSize(wide,tall); SetMouseInputEnabled(m_bHasInput); SetKeyBoardInputEnabled(m_bHasInput); m_pLabelTitle->SetVisible( !m_bHalfView ); }
CASW_VGUI_Computer_Frame::CASW_VGUI_Computer_Frame( vgui::Panel *pParent, const char *pElementName, C_ASW_Hack_Computer* pHackComputer ) : vgui::Panel( pParent, pElementName ), CASW_VGUI_Ingame_Panel(), m_pHackComputer( pHackComputer ) { m_bHideLogoffButton = false; SetKeyBoardInputEnabled(true); m_fLastThinkTime = gpGlobals->curtime; m_pCurrentPanel = NULL; m_pMenuPanel = NULL; m_pSplash = NULL; m_bSetAlpha = false; m_pLogoffLabel = new ImageButton(this, "LogoffLabel", ""); m_pLogoffLabel->AddActionSignalTarget(this); KeyValues *msg = new KeyValues("Command"); msg->SetString("command", "Logoff"); m_pLogoffLabel->SetCommand(msg); KeyValues *cmsg = new KeyValues("Command"); cmsg->SetString( "command", "Cancel" ); m_pLogoffLabel->SetCancelCommand( cmsg ); m_pLogoffLabel->SetText("#asw_log_off"); for (int i=0;i<3;i++) { m_pScan[i] = new vgui::ImagePanel(this, "ComputerScan0"); m_pScan[i]->SetShouldScaleImage(true); m_pScan[i]->SetImage("swarm/Computer/ComputerScan"); } m_pBackdropImage = new vgui::ImagePanel(this, "SplashImage"); m_pBackdropImage->SetShouldScaleImage(true); m_iBackdropType = -1; SetBackdrop(0); RequestFocus(); m_bPlayingSplash = !IsPDA(); }
//----------------------------------------------------------------------------- // Purpose: // Input : *parent - // Output : //----------------------------------------------------------------------------- CMessageCharsPanel::CMessageCharsPanel( vgui::VPANEL parent ) : BaseClass( NULL, "CMessageCharsPanel" ) { SetParent( parent ); SetSize( ScreenWidth(), ScreenHeight() ); SetPos( 0, 0 ); SetVisible( true ); SetCursor( null ); SetKeyBoardInputEnabled( false ); SetMouseInputEnabled( false ); m_hFont = vgui::INVALID_FONT; SetFgColor( Color( 0, 0, 0, 255 ) ); SetPaintBackgroundEnabled( false ); Reset(); vgui::ivgui()->AddTickSignal( GetVPanel(), 100 ); }
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"); }
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(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseHudChat::StartMessageMode( int iMessageModeType ) { #ifndef _XBOX m_nMessageMode = iMessageModeType; m_pChatInput->ClearEntry(); if ( m_nMessageMode == MM_SAY ) { m_pChatInput->SetPrompt( L"Say :" ); } else { m_pChatInput->SetPrompt( L"Say (TEAM) :" ); } vgui::SETUP_PANEL( this ); SetKeyBoardInputEnabled( true ); m_pChatInput->SetVisible( true ); vgui::surface()->CalculateMouseVisible(); m_pChatInput->RequestFocus(); #endif }
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 ); }
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 ); }
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 ); }
CASW_VGUI_Info_Message::CASW_VGUI_Info_Message( vgui::Panel *pParent, const char *pElementName, C_ASW_Info_Message* pMessage ) : vgui::Panel( pParent, pElementName ), CASW_VGUI_Ingame_Panel() { //input->MouseEvent(0, false); // unclick all our mouse buttons when this panel pops up (so firing doesn't get stuck on) if (g_hCurrentInfoPanel.Get()) { g_hCurrentInfoPanel->MarkForDeletion(); g_hCurrentInfoPanel->SetVisible(false); } g_hCurrentInfoPanel = this; m_hMessage = pMessage; for (int i=0;i<4;i++) { m_pLine[i] = new vgui::WrappedLabel(this, "InfoMessageLabel", ""); m_pLine[i]->SetContentAlignment(vgui::Label::a_northwest); m_pLine[i]->SetMouseInputEnabled(false); } m_pOkayButton = new ImageButton(this, "OkayButton", "#asw_close"); m_pOkayButton->AddActionSignalTarget(this); KeyValues *msg = new KeyValues("Command"); msg->SetString("command", "OkayButton"); m_pOkayButton->SetCommand(msg); m_pMessageImage = new vgui::ImagePanel(this, "MessageImage"); m_pMessageImage->SetVisible(false); m_pMessageImage->SetShouldScaleImage(true); m_szImageName[0] = '\0'; if (ShouldAddLogButton()) { m_pLogButton = new ImageButton(this, "LogButton", "#asw_message_log"); m_pLogButton->AddActionSignalTarget(this); KeyValues *msg = new KeyValues("Command"); msg->SetString("command", "MessageLog"); m_pLogButton->SetCommand(msg); } else { Msg(" so not adding it\n"); m_pLogButton = NULL; } // find use key bind char lkeybuffer[12]; Q_snprintf(lkeybuffer, sizeof(lkeybuffer), "%s", ASW_FindKeyBoundTo("+use")); Q_strupr(lkeybuffer); // copy the found key into wchar_t format (localize it if it's a token rather than a normal keyname) wchar_t keybuffer[24]; if (lkeybuffer[0] == '#') { const wchar_t *pLocal = g_pVGuiLocalize->Find(lkeybuffer); if (pLocal) wcsncpy(keybuffer, pLocal, 24); else g_pVGuiLocalize->ConvertANSIToUnicode(lkeybuffer, keybuffer, sizeof(keybuffer)); } else g_pVGuiLocalize->ConvertANSIToUnicode(lkeybuffer, keybuffer, sizeof(keybuffer)); // look up close text localised const wchar_t *pLocal = g_pVGuiLocalize->Find("#asw_close"); if (pLocal) { // join use key and close text together wchar_t buffer[ 256 ]; g_pVGuiLocalize->ConstructString( buffer, sizeof(buffer), g_pVGuiLocalize->Find("#asw_use_icon_format"), 2, keybuffer, pLocal ); // set label m_pOkayButton->SetText(buffer); } if (GetControllerFocus()) { GetControllerFocus()->AddToFocusList(m_pOkayButton); GetControllerFocus()->SetFocusPanel(m_pOkayButton); if (m_pLogButton) { GetControllerFocus()->AddToFocusList(m_pLogButton); } } m_bClosingMessage = false; CLocalPlayerFilter filter; // check for a special sound in the info message const char *pszSound = pMessage ? pMessage->GetSound() : NULL; if (pszSound && Q_strlen(pszSound) > 0) { StopInfoMessageSound(); EmitSound_t ep; ep.m_pSoundName = pszSound; ep.m_flVolume = 1.0f; ep.m_nPitch = PITCH_NORM; ep.m_SoundLevel = SNDLVL_NONE; ep.m_nChannel = CHAN_STATIC; C_BaseEntity::EmitSound( filter, SOUND_FROM_LOCAL_PLAYER, ep ); g_LastInfoSoundGUID = enginesound->GetGuidForLastSoundEmitted(); } UpdateMessage(); SetAlpha(0); vgui::GetAnimationController()->RunAnimationCommand(this, "Alpha", 255, 0.0f, 0.3f, vgui::AnimationController::INTERPOLATOR_LINEAR); SetKeyBoardInputEnabled(true); SetMouseInputEnabled(true); RequestFocus(); ASWInput()->SetCameraFixed( true ); g_asw_iGUIWindowsOpen++; }
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 ); }
//----------------------------------------------------------------------------- // Purpose: shows the build menu //----------------------------------------------------------------------------- void CBuildMenu::ShowPanel(bool bShow) { // CBasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer(); if ( BaseClass::IsVisible() == bShow ) return; if ( bShow ) { //TGB: manipmenu cannot be open open as it will conflict m_pViewPort->ShowPanel( PANEL_MANIPULATE, false ); //viewport has to go too, or the build menu can sometimes become unresponsive to commands m_pViewPort->ShowPanel( PANEL_VIEWPORT, false ); //TGB: update costs if necessary /*we print these live from the cvar now if (NeedCostsUpdate()) { LoadControlSettings("Resource/UI/BuildMenu.res"); PrintAllCosts(); //it would be nice to save away the original unprinted strings for easy cost updating without reloading the .res //however, a change of zombiecosts should not happen often at all, at most once for each time you join a server DevMsg("Reloaded buildmenu\n"); }*/ //LAWYER: ZombieFlags stuff CalculateButtonState(); Activate(); SetMouseInputEnabled( true ); SetKeyBoardInputEnabled( zm_menus_use_keyboard.GetBool() ); //// get key bindings if shown if( m_iJumpKey < 0 ) // you need to lookup the jump key AFTER the engine has loaded { m_iJumpKey = gameuifuncs->GetEngineKeyCodeForBind( "jump" ); } //if ( m_iScoreBoardKey < 0 ) //{ // m_iScoreBoardKey = gameuifuncs->GetEngineKeyCodeForBind( "showscores" ); //} } else { SetVisible( false ); SetMouseInputEnabled( false ); //bring viewport back up C_HL2MP_Player *pPlayer = C_HL2MP_Player::GetLocalHL2MPPlayer(); if (pPlayer && pPlayer->IsZM()) { //prevent edge cases with roundrestarts while panel is open m_pViewPort->ShowPanel( PANEL_VIEWPORT, true ); } } //m_pViewPort->ShowBackGround( bShow ); }