Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef COMMENTARY_MODELVIEWER_H
  8. #define COMMENTARY_MODELVIEWER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/Frame.h>
  13. #include <game/client/iviewport.h>
  14. #include "basemodelpanel.h"
  15. //-----------------------------------------------------------------------------
  16. // Purpose:
  17. //-----------------------------------------------------------------------------
  18. class CCommentaryModelPanel : public CModelPanel
  19. {
  20. public:
  21. DECLARE_CLASS_SIMPLE( CCommentaryModelPanel, CModelPanel );
  22. CCommentaryModelPanel( vgui::Panel *parent, const char *name );
  23. };
  24. //-----------------------------------------------------------------------------
  25. // Purpose:
  26. //-----------------------------------------------------------------------------
  27. class CCommentaryModelViewer : public vgui::Frame, public IViewPortPanel
  28. {
  29. DECLARE_CLASS_SIMPLE( CCommentaryModelViewer, vgui::Frame );
  30. public:
  31. CCommentaryModelViewer(IViewPort *pViewPort);
  32. virtual ~CCommentaryModelViewer();
  33. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  34. virtual void PerformLayout( void );
  35. virtual void OnCommand( const char *command );
  36. virtual void OnKeyCodePressed( vgui::KeyCode code );
  37. virtual void OnThink( void );
  38. void SetModel( const char *pszName, const char *pszAttached );
  39. void HandleMovementInput( void );
  40. // IViewPortPanel
  41. public:
  42. virtual const char *GetName( void ) { return PANEL_COMMENTARY_MODELVIEWER; }
  43. virtual void SetData(KeyValues *data) {};
  44. virtual void Reset() {};
  45. virtual void Update() {};
  46. virtual bool NeedsUpdate( void ) { return false; }
  47. virtual bool HasInputElements( void ) { return true; }
  48. virtual void ShowPanel( bool bShow );
  49. // both vgui::Frame and IViewPortPanel define these, so explicitly define them here as passthroughs to vgui
  50. vgui::VPANEL GetVPanel( void ) { return BaseClass::GetVPanel(); }
  51. virtual bool IsVisible() { return BaseClass::IsVisible(); }
  52. virtual void SetParent( vgui::VPANEL parent ) { BaseClass::SetParent( parent ); }
  53. virtual GameActionSet_t GetPreferredActionSet() { return GAME_ACTION_SET_MENUCONTROLS; }
  54. private:
  55. IViewPort *m_pViewPort;
  56. CCommentaryModelPanel *m_pModelPanel;
  57. Vector m_vecResetPos;
  58. Vector m_vecResetAngles;
  59. bool m_bTranslating;
  60. float m_flYawSpeed;
  61. float m_flZoomSpeed;
  62. };
  63. #endif // COMMENTARY_MODELVIEWER_H