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.

168 lines
4.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Contains the CMessageDialog declaration
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef MESSAGEDIALOG_H
  8. #define MESSAGEDIALOG_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. // styles
  13. #define MD_WARNING 0x0001
  14. #define MD_ERROR 0x0002
  15. // button configurations
  16. #define MD_OK 0x0004 // 1 button - OK
  17. #define MD_CANCEL 0x0008 // 1 button - CANCEL
  18. #define MD_OKCANCEL 0x0010 // 2 buttons - OK and CANCEL
  19. #define MD_YESNO 0x0020 // 2 buttons - YES and NO
  20. // behavior
  21. #define MD_SIMPLEFRAME 0x0100 // legacy corners
  22. #define MD_COMMANDAFTERCLOSE 0x0200 // send command at dialog termination (i.e. after fade)
  23. #define MD_RESTRICTPAINT 0x0400 // only paint this dialog (hide any other ui elements)
  24. #define MD_COMMANDONFORCECLOSE 0x0800 // send command when the dialog is closed assuming A input
  25. // dialog type
  26. enum EDialogType
  27. {
  28. MD_SAVE_BEFORE_QUIT,
  29. MD_QUIT_CONFIRMATION,
  30. MD_QUIT_CONFIRMATION_TF,
  31. MD_KICK_CONFIRMATION,
  32. MD_CLIENT_KICKED,
  33. MD_LOST_HOST,
  34. MD_LOST_SERVER,
  35. MD_SEARCHING_FOR_GAMES,
  36. MD_CREATING_GAME,
  37. MD_MODIFYING_SESSION,
  38. MD_SESSION_SEARCH_FAILED,
  39. MD_SESSION_CREATE_FAILED,
  40. MD_SESSION_CONNECTING,
  41. MD_SESSION_CONNECT_NOTAVAILABLE,
  42. MD_SESSION_CONNECT_SESSIONFULL,
  43. MD_SESSION_CONNECT_FAILED,
  44. MD_EXIT_SESSION_CONFIRMATION,
  45. MD_STORAGE_DEVICES_NEEDED,
  46. MD_STORAGE_DEVICES_CHANGED,
  47. MD_STORAGE_DEVICES_TOO_FULL,
  48. MD_NOT_ONLINE_ENABLED,
  49. MD_NOT_ONLINE_SIGNEDIN,
  50. MD_DEFAULT_CONTROLS_CONFIRM,
  51. MD_AUTOSAVE_EXPLANATION,
  52. MD_COMMENTARY_EXPLANATION,
  53. MD_COMMENTARY_EXPLANATION_MULTI,
  54. MD_COMMENTARY_CHAPTER_UNLOCK_EXPLANATION,
  55. MD_SAVE_BEFORE_LANGUAGE_CHANGE,
  56. MD_SAVE_BEFORE_NEW_GAME,
  57. MD_SAVE_BEFORE_LOAD,
  58. MD_DELETE_SAVE_CONFIRM,
  59. MD_SAVE_OVERWRITE,
  60. MD_SAVING_WARNING,
  61. MD_SAVE_COMPLETE,
  62. MD_STANDARD_SAMPLE,
  63. MD_WARNING_SAMPLE,
  64. MD_ERROR_SAMPLE,
  65. MD_PROMPT_SIGNIN,
  66. MD_PROMPT_SIGNIN_REQUIRED,
  67. MD_PROMPT_STORAGE_DEVICE,
  68. MD_PROMPT_STORAGE_DEVICE_REQUIRED,
  69. MD_DISCONNECT_CONFIRMATION,
  70. MD_DISCONNECT_CONFIRMATION_HOST,
  71. MD_LOAD_FAILED_WARNING,
  72. MD_OPTION_CHANGE_FROM_X360_DASHBOARD,
  73. MD_STORAGE_DEVICES_CORRUPT,
  74. MD_CHECKING_STORAGE_DEVICE,
  75. //=============================================================================
  76. // HPE_BEGIN:
  77. // [mhansen] Added some new messages.
  78. //=============================================================================
  79. MD_PROFILE_READ_FAILED,
  80. MD_PROFILE_READ_FAILED_CRC,
  81. MD_PROFILE_WRITE_FAILED,
  82. MD_PROFILE_RESET,
  83. MD_PROFILE_RESET_CONFIRM,
  84. MD_QUIT_CONFIRMATION_TEAM_MENU,
  85. //=============================================================================
  86. // HPE_END
  87. //=============================================================================
  88. };
  89. #include "vgui_controls/Frame.h"
  90. #include "vgui_controls/Label.h"
  91. #include "vgui_controls/AnimatingImagePanel.h"
  92. #include "vgui_controls/ImagePanel.h"
  93. //-----------------------------------------------------------------------------
  94. // Purpose: Simple modal dialog box for Xbox 360 warnings and messages
  95. //-----------------------------------------------------------------------------
  96. class CMessageDialog : public vgui::Frame
  97. {
  98. DECLARE_CLASS_SIMPLE( CMessageDialog, vgui::Frame );
  99. public:
  100. CMessageDialog( vgui::Panel *parent, const uint nType, const char *pTitle, const char *pMsg, const char *pCmdA, const char *pCmdB, vgui::Panel *pParent, bool bShowActivity );
  101. ~CMessageDialog();
  102. enum
  103. {
  104. BTN_INVALID = -1,
  105. BTN_B,
  106. BTN_A,
  107. MAX_BUTTONS,
  108. };
  109. struct ButtonLabel_s
  110. {
  111. vgui::Label *pIcon;
  112. vgui::Label *pText;
  113. int nWide;
  114. bool bCreated;
  115. };
  116. virtual void OnKeyCodePressed( vgui::KeyCode code );
  117. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  118. virtual void ApplySettings( KeyValues *inResourceData );
  119. virtual void PaintBackground();
  120. uint GetType( void );
  121. void SetControlSettingsKeys( KeyValues *pKeys );
  122. private:
  123. void CreateButtonLabel( ButtonLabel_s *pButton, const char *pIcon, const char *pText );
  124. void DoCommand( int button );
  125. vgui::Panel *m_pCreator;
  126. vgui::Label *m_pTitle;
  127. vgui::Label *m_pMsg;
  128. vgui::ImagePanel *m_pBackground;
  129. vgui::AnimatingImagePanel *m_pAnimatingPanel;
  130. vgui::HFont m_hButtonFont;
  131. vgui::HFont m_hTextFont;
  132. uint m_nType;
  133. Color m_ButtonTextColor;
  134. int m_ButtonPressed;
  135. KeyValues *m_pControlSettings;
  136. int m_FooterTall;
  137. int m_ButtonMargin;
  138. Color m_clrNotSimpleBG;
  139. Color m_clrNotSimpleBGBlack;
  140. int m_ButtonIconLabelSpace;
  141. int m_ActivityIndent;
  142. bool m_bShowActivity; // should we show an animating image panel?
  143. ButtonLabel_s m_Buttons[MAX_BUTTONS];
  144. char *m_pCommands[MAX_BUTTONS];
  145. };
  146. #endif // MESSAGEDIALOG_H