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.

66 lines
1.8 KiB

  1. //======= Copyright (c) 1996-2009, Valve Corporation, All rights reserved. ======
  2. //
  3. // CSheetSequencePanel - Panel for selecting one sequence from a sprite sheet
  4. //
  5. //===============================================================================
  6. #ifndef SHEETSEQUENCEPANEL_H
  7. #define SHEETSEQUENCEPANEL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui/MouseCode.h"
  12. #include "vgui_controls/Menu.h"
  13. #include "materialsystem/MaterialSystemUtil.h"
  14. //-----------------------------------------------------------------------------
  15. // Forward declarations
  16. //-----------------------------------------------------------------------------
  17. class CSheetExtended;
  18. namespace vgui
  19. {
  20. class Menu;
  21. }
  22. //-----------------------------------------------------------------------------
  23. class CSheetSequencePanel : public vgui::Menu
  24. {
  25. DECLARE_CLASS_SIMPLE( CSheetSequencePanel, vgui::Menu );
  26. public:
  27. CSheetSequencePanel( vgui::Panel *parent, const char *panelName );
  28. virtual ~CSheetSequencePanel();
  29. virtual void Paint();
  30. virtual void PerformLayout();
  31. virtual void OnCursorMoved(int x, int y);
  32. virtual void OnCursorExited();
  33. virtual void OnMouseReleased( vgui::MouseCode mouseCode );
  34. void SetFromMaterial( IMaterial* pMaterial );
  35. void SetFromMaterialName( const char* pMaterialName );
  36. void SetSecondSequenceView( bool bIsSecondSequenceView );
  37. private:
  38. int SequenceGridCount();
  39. int SequenceGridRows();
  40. int SequenceGridSquareSize();
  41. void PrepareMaterials();
  42. CSheetExtended* m_pSheet;
  43. CMaterialReference m_Material;
  44. int m_nHighlightedSequence;
  45. bool m_bSeparateAlphaColorMaterial;
  46. bool m_bIsSecondSequenceView;
  47. static void EnsureMaterialsExist();
  48. static bool m_sMaterialsInitialized;
  49. static CMaterialReference m_sColorMat;
  50. static CMaterialReference m_sAlphaMat;
  51. };
  52. #endif // VMTPICKER_H