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.

88 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CHOREOEVENTWIDGET_H
  8. #define CHOREOEVENTWIDGET_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "mxbitmaptools.h"
  13. #include "choreowidget.h"
  14. class CChoreoEvent;
  15. class CChoreoChannelWidget;
  16. class CAudioSource;
  17. #define FP_NUM_BITMAPS 20
  18. //-----------------------------------------------------------------------------
  19. // Purpose: Draw event UI element and handle mouse interactions
  20. //-----------------------------------------------------------------------------
  21. class CChoreoEventWidget : public CChoreoWidget
  22. {
  23. public:
  24. typedef CChoreoWidget BaseClass;
  25. // Construction/destruction
  26. CChoreoEventWidget( CChoreoWidget *parent );
  27. virtual ~CChoreoEventWidget( void );
  28. // Create children
  29. virtual void Create( void );
  30. // Redo layout
  31. virtual void Layout( RECT& rc );
  32. // Screen refresh
  33. virtual void redraw(CChoreoWidgetDrawHelper& drawHelper);
  34. virtual void redrawStatus( CChoreoWidgetDrawHelper& drawHelper, RECT& rcClient );
  35. virtual int GetDurationRightEdge( void );
  36. // Access underlying object
  37. CChoreoEvent *GetEvent( void );
  38. void SetEvent( CChoreoEvent *event );
  39. // If the user changes the association of .mdls to actors, then the gender could change and we could need to access a different .wav file
  40. // Call this to reconcile things
  41. void RecomputeWave();
  42. // System wide icons for various event types ( indexed by CChoreEvent::m_fType )
  43. static void LoadImages( void );
  44. static void DestroyImages( void );
  45. static mxbitmapdata_t *GetImage( int type );
  46. static mxbitmapdata_t *GetPauseImage( void );
  47. static mxbitmapdata_t *GetLockImage( void );
  48. private:
  49. COLORREF GrayOutColor( COLORREF clr );
  50. void DrawRelativeTags( CChoreoWidgetDrawHelper& drawHelper, RECT &rcWAV, float length, CChoreoEvent *event );
  51. void DrawAbsoluteTags( CChoreoWidgetDrawHelper& drawHelper, RECT &rcWAV, float length, CChoreoEvent *event );
  52. const char *GetLabelText( void );
  53. void DrawSpeakEvent( CChoreoWidgetDrawHelper& drawHelper, RECT& rcEventLine );
  54. void DrawGestureEvent( CChoreoWidgetDrawHelper& drawHelper, RECT& rcEventLine );
  55. void DrawGenericEvent( CChoreoWidgetDrawHelper& drawHelper, RECT& rcEventLine );
  56. // Parent widget
  57. CChoreoWidget *m_pParent;
  58. // Underlying event
  59. CChoreoEvent *m_pEvent;
  60. int m_nDurationRightEdge;
  61. // For speak events
  62. CAudioSource *m_pWaveFile;
  63. // Bitmaps for drawing event widgets
  64. static mxbitmapdata_t m_Bitmaps[ FP_NUM_BITMAPS ];
  65. static mxbitmapdata_t m_ResumeConditionBitmap;
  66. static mxbitmapdata_t m_LockBodyFacingBitmap;
  67. };
  68. #endif // CHOREOEVENTWIDGET_H