98 lines
2.5 KiB
C
Raw Normal View History

2023-10-03 17:23:56 +03:00
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
2020-04-22 12:56:21 -04:00
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef VGUITEXTWINDOW_H
#define VGUITEXTWINDOW_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui_controls/Frame.h>
#include <vgui_controls/Button.h>
#include <vgui_controls/HTML.h>
#include <game/client/iviewport.h>
#include "shareddefs.h"
2023-10-03 17:23:56 +03:00
#include "GameEventListener.h"
2020-04-22 12:56:21 -04:00
namespace vgui
{
class TextEntry;
}
2023-10-03 17:23:56 +03:00
enum
{
FADE_STATUS_IN = 0,
FADE_STATUS_HOLD,
FADE_STATUS_OUT,
FADE_STATUS_OFF
};
2020-04-22 12:56:21 -04:00
//-----------------------------------------------------------------------------
// Purpose: displays the MOTD
//-----------------------------------------------------------------------------
2023-10-03 17:23:56 +03:00
class CTextWindow : public vgui::Frame, public IViewPortPanel, public CGameEventListener
2020-04-22 12:56:21 -04:00
{
private:
DECLARE_CLASS_SIMPLE( CTextWindow, vgui::Frame );
public:
CTextWindow(IViewPort *pViewPort);
virtual ~CTextWindow();
virtual const char *GetName( void ) { return PANEL_INFO; }
virtual void SetData(KeyValues *data);
virtual void Reset();
virtual void Update();
2023-10-03 17:23:56 +03:00
virtual void UpdateContents( void );
virtual bool NeedsUpdate( void ) { return true; }
2020-04-22 12:56:21 -04:00
virtual bool HasInputElements( void ) { return true; }
virtual void ShowPanel( bool bShow );
// both vgui::Frame and IViewPortPanel define these, so explicitly define them here as passthroughs to vgui
vgui::VPANEL GetVPanel( void ) { return BaseClass::GetVPanel(); }
virtual bool IsVisible() { return BaseClass::IsVisible(); }
virtual void SetParent( vgui::VPANEL parent ) { BaseClass::SetParent( parent ); }
2023-10-03 17:23:56 +03:00
virtual void FireGameEvent( IGameEvent *event );
virtual bool WantsBackgroundBlurred( void );
2020-04-22 12:56:21 -04:00
public:
2023-10-03 17:23:56 +03:00
virtual void SetData( int type, const char *title, const char *message, const char *command );
virtual void ShowFile( const char *filename);
virtual void ShowText( const char *text);
virtual void ShowURL( const char *URL);
virtual void ShowIndex( const char *entry);
2020-04-22 12:56:21 -04:00
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
protected:
// vgui overrides
2023-10-03 17:23:56 +03:00
virtual void OnCommand( const char *command);
2020-04-22 12:56:21 -04:00
IViewPort *m_pViewPort;
char m_szTitle[255];
char m_szMessage[2048];
2023-10-03 17:23:56 +03:00
char m_szExitCommand[255];
2020-04-22 12:56:21 -04:00
int m_nContentType;
vgui::TextEntry *m_pTextMessage;
2023-10-03 17:23:56 +03:00
vgui::HTML *m_pHTMLMessage;
2020-04-22 12:56:21 -04:00
vgui::Button *m_pOK;
vgui::Label *m_pTitleLabel;
2023-10-03 17:23:56 +03:00
float m_flNextFadeTime;
int m_iFadeStatus;
bool m_bMiniMode;
bool m_bIgnoreMultipleShowRequests;
2020-04-22 12:56:21 -04:00
};
#endif // VGUITEXTWINDOW_H