//----------------------------------------------------------------------------- // Purpose: Text chat input/output hud element //----------------------------------------------------------------------------- CBaseHudChat::CBaseHudChat( const char *pElementName ) : CHudElement( pElementName ), BaseClass( NULL, "HudChat" ) { vgui::Panel *pParent = g_pClientMode->GetViewport(); SetParent( pParent ); vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFileEx( enginevgui->GetPanel( PANEL_CLIENTDLL ), "resource/ClientScheme.res", "ClientScheme"); SetScheme(scheme); m_nMessageMode = 0; CBaseHudChatLine *line = m_ChatLines[ 0 ]; if ( line ) { vgui::HFont font = line->GetFont(); m_iFontHeight = vgui::surface()->GetFontTall( font ) + 2; // Put input area at bottom int w, h; GetSize( w, h ); m_pChatInput->SetBounds( 1, h - m_iFontHeight - 1, w-2, m_iFontHeight ); } if ( IsPC() ) { vgui::ivgui()->AddTickSignal( GetVPanel() ); } // (We don't actually want input until they bring up the chat line). MakePopup(); SetZPos( -30 ); SetHiddenBits( HIDEHUD_CHAT ); }
void CASWSelectOverlayPulse::Initialize() { vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFile("resource/swarm/SwarmSchemeNew.res", "SwarmSchemeNew"); SetScheme(scheme); m_pOverlayLabel = new vgui::ImagePanel( this, "SelectOverlayImage" ); m_fStartTime = gpGlobals->curtime; int x, y; m_pParent->GetPos( x, y ); int w, h; m_pParent->GetSize( w, h ); SetSize( w * m_fScale, h * m_fScale ); SetPos( x - ( GetWide() - w ) / 2, y - ( GetTall() - h ) / 2 ); SetZPos( 100 ); if ( m_pOverlayLabel ) { m_pOverlayLabel->SetImage( "inventory/item_select_glow" ); m_pOverlayLabel->SetShouldScaleImage( true ); m_pOverlayLabel->SetAlpha( 255 ); m_pOverlayLabel->SetPos( 0, 0 ); m_pOverlayLabel->SetSize( w * m_fScale, h * m_fScale ); m_bStarted = true; } }
void CHudChat::Init( void ) { BaseClass::Init(); SetZPos( 2 ); m_pHudGameplay = GET_HUDELEMENT( CHudGameplay ); HOOK_HUD_MESSAGE( CHudChat, SayText ); HOOK_HUD_MESSAGE( CHudChat, SayText2 ); HOOK_HUD_MESSAGE( CHudChat, TextMsg ); }
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 ); }
GlassRpc::GlassRpc(int moduleId, std::string rpcName, double xPos, double yPos, double zPos, double theta, int startId) { SetDxDyDTheta(xPos,yPos,theta); SetDetectorType("GLASS"); Scintillator::SetStartingId(startId); Scintillator::SetStartingStripNum(); int numOfPlanes = 2; SetNumOfPlanes(numOfPlanes); SetName(rpcName); SetZPos(zPos); SetLBH(100,100,1); Initialize(); /*for(int i = 0 ; i < numOfPlanes ; i++){ InsertPlane(new ScintillatorPlane(moduleId,32,zPos,GetLength(),GetBreadth())); }*/ InsertPlane(new ScintillatorPlane(moduleId,32,xPos,yPos,zPos,theta,GetLength(),GetBreadth(),GetHeight(),0.,true)); InsertPlane(new ScintillatorPlane(moduleId,32,xPos,yPos,zPos,theta,GetLength(),GetBreadth(),GetHeight(),0.,false)); }
void CASW_VGUI_Computer_Splash::PerformLayout() { m_fScale = ScreenHeight() / 768.0f; int w = GetParent()->GetWide(); int h = GetParent()->GetTall(); SetWide(w); SetTall(h); SetPos(ScreenWidth()*0.5f - w*0.5f, ScreenHeight()*0.5f - h*0.5f); m_pLogoImage->SetShouldScaleImage(true); m_pLogoImage->SetPos(w*0.25f,h*0.15f); m_pLogoImage->SetSize(w*0.5f, h*0.5f); m_pLogoImage->SetImage("swarm/Computer/SynTekLogo2"); m_pLogoImage->SetZPos(160); m_pLogoGlitchImage->SetShouldScaleImage(true); m_pLogoGlitchImage->SetPos(w*0.25f,h*0.25f); m_pLogoGlitchImage->SetSize(w*0.5f, h*0.5f); m_pLogoGlitchImage->SetImage("swarm/Computer/SynTekLogo2"); m_pLogoGlitchImage->SetZPos(159); m_pSloganLabel->SetSize(w, h * 0.2f); m_pSloganLabel->SetContentAlignment(vgui::Label::a_center); m_pSloganLabel->SetPos(0, h*0.75f); m_pSloganLabel->SetZPos(160); m_pSynTekLabel->SetSize(w, h * 0.2f); m_pSynTekLabel->SetContentAlignment(vgui::Label::a_center); m_pSynTekLabel->SetPos(0, h*0.65f); m_pSynTekLabel->SetZPos(160); for (int i=0;i<ASW_SPLASH_SCROLL_LINES;i++) { m_pScrollLine[i]->SetSize(w, h * 0.2f); m_pScrollLine[i]->SetContentAlignment(vgui::Label::a_northwest); } if (m_bSlidOut) { m_pLogoImage->SetBounds( w*0.05f, h*0.05f, w*0.13f, h*0.13f); m_pSynTekLabel->SetPos(0, 0); } SetZPos(161); }
//----------------------------------------------------------------------------- // Purpose: Text chat input/output hud element //----------------------------------------------------------------------------- CBaseHudChat::CBaseHudChat( const char *pElementName ) : CHudElement( pElementName ), BaseClass( NULL, "HudChat" ) { vgui::Panel *pParent = g_pClientMode->GetViewport(); SetParent( pParent ); vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFileEx( enginevgui->GetPanel( PANEL_CLIENTDLL ), "resource/ChatScheme.res", "ChatScheme" ); SetScheme(scheme); g_pVGuiLocalize->AddFile( "resource/chat_%language%.txt" ); m_nMessageMode = 0; vgui::ivgui()->AddTickSignal( GetVPanel() ); // (We don't actually want input until they bring up the chat line). MakePopup(); SetZPos( -30 ); SetHiddenBits( HIDEHUD_CHAT ); m_pFiltersButton = new CHudChatFilterButton( this, "ChatFiltersButton", "Filters" ); if ( m_pFiltersButton ) { m_pFiltersButton->SetScheme( scheme ); m_pFiltersButton->SetVisible( true ); m_pFiltersButton->SetEnabled( true ); m_pFiltersButton->SetMouseInputEnabled( true ); m_pFiltersButton->SetKeyBoardInputEnabled( false ); } m_pChatHistory = new CHudChatHistory( this, "HudChatHistory" ); CreateChatLines(); CreateChatInputLine(); GetChatFilterPanel(); m_iFilterFlags = cl_chatfilters.GetInt(); }
DetectorFactory::DetectorFactory() { // TODO Auto-generated constructor stub #if(0) SetDetectorType("GLASS"); Scintillator::SetStartingId(startId); Scintillator::SetStartingStripNum(); int numOfPlanes = 2; SetNumOfPlanes(numOfPlanes); SetName(rpcName); SetZPos(zPos); SetLBH(100,100,1); Initialize(); if(numOfPlanes==1){ //This will be used to create top and bottom scintillator plane InsertPlane(new ScintillatorPlane(moduleId,32,zPos,GetLength(),GetBreadth(),GetHeight(),0.,true)); } if(numOfPlanes==2){ //This will be used to create Detectors InsertPlane(new ScintillatorPlane(moduleId,32,zPos,GetLength(),GetBreadth(),GetHeight(),0.,true)); InsertPlane(new ScintillatorPlane(moduleId,32,zPos,GetLength(),GetBreadth(),GetHeight(),0.,false)); } SetClusterSize(2); #endif }
// // ICWindow::HandleEvent // // Handle input events // U32 ICWindow::HandleEvent(Event &e) { if (e.type == Input::EventID()) { // Input events switch (e.subType) { case Input::MOUSEBUTTONDOWN: { if (e.input.code == Input::LeftButtonCode()) { if (InWindow(Point<S32>(e.input.mouseX, e.input.mouseY))) { // Raise window SendNotify(this, ICWindowMsg::Raise, FALSE); // Handled return (TRUE); } } break; } case Input::KEYDOWN: case Input::KEYREPEAT: { switch (e.input.code) { case DIK_TAB: { // If nothing has the focus then activate the first tab stop control if (IFace::GetFocus() == NULL) { SetTabStop(NULL, TRUE); // Handled return (TRUE); } // Not handled break; } case DIK_ESCAPE: { // If modal then issue the Window::Close notification if ((controlStyle & STYLE_MODAL) && !(windowStyle & STYLE_NOSYSBUTTONS)) { // Close window SendNotify(this, ICWindowMsg::Close, FALSE); // Handled return (TRUE); } // Not handled break; } } // Not handled break; } } } else if (e.type == IFace::EventID()) { switch (e.subType) { // Notification events case IFace::NOTIFY: { switch (e.iface.p1) { case ICWindowMsg::Raise: { // Raise the window SetZPos(0); // Handled return (TRUE); } case ICWindowMsg::Close: { // Close window Deactivate(); // Handled return (TRUE); } case ICWindowMsg::Maximize: case ICWindowMsg::Minimize: { // Not implemented break; } case ICWindowMsg::Destroy: { // Mark for deletion MarkForDeletion(); // Handled return (TRUE); } } // Not handled break; } } } // This event can't be handled by this control, so pass it to the parent class return (IControl::HandleEvent(e)); }