Counter Strike : Global Offensive Source Code
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.

182 lines
4.4 KiB

  1. //========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CL_DEMOUIPANEL_H
  8. #define CL_DEMOUIPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/Frame.h>
  13. namespace vgui
  14. {
  15. class Button;
  16. class CheckButton;
  17. class Label;
  18. class ProgressBar;
  19. class FileOpenDialog;
  20. class Slider;
  21. };
  22. class CDemoEditorPanel;
  23. class CDemoSmootherPanel;
  24. //-----------------------------------------------------------------------------
  25. // Purpose:
  26. //-----------------------------------------------------------------------------
  27. class CDemoUIPanel : public vgui::Frame
  28. {
  29. DECLARE_CLASS_SIMPLE( CDemoUIPanel, vgui::Frame );
  30. public:
  31. CDemoUIPanel( vgui::Panel *parent );
  32. ~CDemoUIPanel();
  33. virtual void OnTick();
  34. // Command issued
  35. virtual void OnCommand(const char *command);
  36. virtual void OnMessage(const KeyValues *params, vgui::VPANEL fromPanel);
  37. virtual void OnVDMChanged( void );
  38. virtual bool OverrideView( democmdinfo_t& info, int frame );
  39. virtual void DrawDebuggingInfo();
  40. static void InstallDemoUI( vgui::Panel *parent );
  41. bool IsInDriveMode();
  42. void SetDriveViewPoint( Vector &origin, QAngle &angle );
  43. void GetDriveViewPoint( Vector &origin, QAngle &angle );
  44. protected:
  45. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  46. void HandleInput( bool active );
  47. void SetPlaybackScale( float scale );
  48. float GetPlaybackScale();
  49. void GetCurrentView();
  50. MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath );
  51. void OnEdit();
  52. void OnSmooth();
  53. void OnLoad();
  54. vgui::Button *m_pStop;
  55. vgui::Button *m_pLoad;
  56. // special editor buttons
  57. vgui::Button *m_pEdit;
  58. vgui::Button *m_pSmooth;
  59. vgui::Button *m_pDriveCamera;
  60. // player controls
  61. vgui::Button *m_pPlayPauseResume;
  62. vgui::Button *m_pGoStart;
  63. vgui::Button *m_pGoEnd;
  64. vgui::Button *m_pPrevFrame;
  65. vgui::Button *m_pNextFrame;
  66. vgui::Slider *m_pProgress;
  67. vgui::Label *m_pProgressLabelFrame;
  68. vgui::Label *m_pProgressLabelTime;
  69. vgui::Slider *m_pSpeedScale;
  70. vgui::Label *m_pSpeedScaleLabel;
  71. vgui::DHANDLE< CDemoEditorPanel > m_hDemoEditor;
  72. vgui::DHANDLE< CDemoSmootherPanel > m_hDemoSmoother;
  73. vgui::DHANDLE< vgui::FileOpenDialog > m_hFileOpenDialog;
  74. bool m_bInputActive;
  75. int m_nOldCursor[2];
  76. Vector m_ViewOrigin;
  77. QAngle m_ViewAngles;
  78. };
  79. //#if !defined( LINUX )
  80. extern CDemoUIPanel *g_pDemoUI;
  81. //#endif
  82. //-----------------------------------------------------------------------------
  83. // Purpose: a special demo UI panel that is always visible allowing you
  84. // to interact with the game and adding more features to the old
  85. // demo UI panel.
  86. //-----------------------------------------------------------------------------
  87. class CDemoUIPanel2 : public vgui::Frame
  88. {
  89. DECLARE_CLASS_SIMPLE( CDemoUIPanel2, vgui::Frame );
  90. public:
  91. CDemoUIPanel2( vgui::Panel *pParentBkgnd, vgui::Panel *pParentFgnd, bool bPutToForeground );
  92. ~CDemoUIPanel2();
  93. virtual void OnTick();
  94. // Command issued
  95. virtual void OnCommand(const char *command);
  96. virtual void OnMessage(const KeyValues *params, vgui::VPANEL fromPanel);
  97. virtual void OnVDMChanged( void );
  98. virtual bool OverrideView( democmdinfo_t& info, int frame );
  99. virtual void DrawDebuggingInfo();
  100. static void Install( vgui::Panel *pParentBkgnd, vgui::Panel *pParentFgnd, bool bPutToForeground );
  101. bool IsInDriveMode();
  102. void SetDriveViewPoint( Vector &origin, QAngle &angle );
  103. void GetDriveViewPoint( Vector &origin, QAngle &angle );
  104. void MakePanelForeground( bool bPutToForeground );
  105. protected:
  106. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  107. void HandleInput( bool active );
  108. void SetPlaybackScale( float scale );
  109. float GetPlaybackScale();
  110. MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath );
  111. void OnLoad();
  112. vgui::Button *m_pStop;
  113. vgui::Button *m_pLoad;
  114. // player controls
  115. vgui::Button *m_pPlayPauseResume;
  116. vgui::Button *m_pGoStart;
  117. vgui::Button *m_pGoEnd;
  118. vgui::Button *m_pPrevFrame;
  119. vgui::Button *m_pNextFrame;
  120. vgui::Slider *m_pProgress;
  121. vgui::Label *m_pProgressLabelFrame;
  122. vgui::Label *m_pProgressLabelTime;
  123. vgui::Slider *m_pSpeedScale;
  124. vgui::Label *m_pSpeedScaleLabel;
  125. vgui::DHANDLE< vgui::FileOpenDialog > m_hFileOpenDialog;
  126. bool m_bInputActive;
  127. int m_nOldCursor[2];
  128. // Bkgnd-fgnd switch
  129. vgui::Panel *m_arrParents[2];
  130. bool m_bIsInForeground;
  131. };
  132. #if 0 //!defined( LINUX )
  133. extern CDemoUIPanel2 *g_pDemoUI2;
  134. #endif
  135. #endif // CL_DEMOUIPANEL_H