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.

114 lines
3.2 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef NEWGAMEDIALOG_H
  8. #define NEWGAMEDIALOG_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "vgui_controls/Frame.h"
  13. #include "vgui_controls/footerpanel.h"
  14. #include "utlvector.h"
  15. class CGameChapterPanel;
  16. class CSkillSelectionDialog;
  17. // Slot indices in new game menu
  18. #define INVALID_INDEX -1
  19. #define SLOT_OFFLEFT 0
  20. #define SLOT_LEFT 1
  21. #define SLOT_CENTER 2
  22. #define SLOT_RIGHT 3
  23. #define SLOT_OFFRIGHT 4
  24. #define NUM_SLOTS 5
  25. //-----------------------------------------------------------------------------
  26. // Purpose: Handles starting a new game, skill and chapter selection
  27. //-----------------------------------------------------------------------------
  28. class CNewGameDialog : public vgui::Frame
  29. {
  30. DECLARE_CLASS_SIMPLE( CNewGameDialog, vgui::Frame );
  31. public:
  32. MESSAGE_FUNC( FinishScroll, "FinishScroll" );
  33. MESSAGE_FUNC( StartGame, "StartGame" );
  34. CNewGameDialog(vgui::Panel *parent, bool bCommentaryMode );
  35. ~CNewGameDialog();
  36. virtual void Activate( void );
  37. virtual void ApplySettings( KeyValues *inResourceData );
  38. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  39. virtual void OnCommand( const char *command );
  40. virtual void OnClose( void );
  41. virtual void PaintBackground();
  42. void SetSelectedChapterIndex( int index );
  43. void SetSelectedChapter( const char *chapter );
  44. void UpdatePanelLockedStatus( int iUnlockedChapter, int i, CGameChapterPanel *pChapterPanel );
  45. void SetCommentaryMode( bool bCommentary ) { m_bCommentaryMode = bCommentary; }
  46. // Xbox: Defined values are also used to shift the slot indices
  47. enum EScrollDirection
  48. {
  49. SCROLL_RIGHT = -1,
  50. SCROLL_NONE = 0,
  51. SCROLL_LEFT = 1
  52. };
  53. EScrollDirection m_ScrollDirection;
  54. private:
  55. int m_iSelectedChapter;
  56. CUtlVector<CGameChapterPanel *> m_ChapterPanels;
  57. vgui::DHANDLE<CSkillSelectionDialog> m_hSkillSelectionDialog;
  58. vgui::Button *m_pPlayButton;
  59. vgui::Button *m_pNextButton;
  60. vgui::Button *m_pPrevButton;
  61. vgui::Panel *m_pCenterBg;
  62. vgui::Label *m_pChapterTitleLabels[2];
  63. vgui::Label *m_pBonusSelection;
  64. vgui::ImagePanel *m_pBonusSelectionBorder;
  65. vgui::CFooterPanel *m_pFooter;
  66. bool m_bCommentaryMode;
  67. vgui::Label *m_pCommentaryLabel;
  68. // Xbox
  69. void ScrollSelectionPanels( EScrollDirection dir );
  70. void ScrollBonusSelection( EScrollDirection dir );
  71. void PreScroll( EScrollDirection dir );
  72. void PostScroll( EScrollDirection dir );
  73. void SetFastScroll( bool fast );
  74. void ContinueScrolling( void );
  75. void AnimateSelectionPanels( void );
  76. void ShiftPanelIndices( int offset );
  77. bool IsValidPanel( const int idx );
  78. void InitPanelIndexForDisplay( const int idx );
  79. void UpdateMenuComponents( EScrollDirection dir );
  80. void UpdateBonusSelection( void );
  81. int m_PanelXPos[ NUM_SLOTS ];
  82. int m_PanelYPos[ NUM_SLOTS ];
  83. float m_PanelAlpha[ NUM_SLOTS ];
  84. int m_PanelIndex[ NUM_SLOTS ];
  85. float m_ScrollSpeed;
  86. int m_ButtonPressed;
  87. int m_ScrollCt;
  88. bool m_bScrolling;
  89. char m_ActiveTitleIdx;
  90. bool m_bMapStarting;
  91. int m_iBonusSelection;
  92. bool m_bScrollToFirstBonusMap;
  93. struct BonusMapDescription_t *m_pBonusMapDescription;
  94. };
  95. #endif // NEWGAMEDIALOG_H