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.

74 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TF_HUD_DISCONNECT_PROMPT_H
  8. #define TF_HUD_DISCONNECT_PROMPT_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "confirm_dialog.h"
  13. #include "tf_gc_client.h"
  14. enum eDisconnectReason
  15. {
  16. REASON_QUIT,
  17. REASON_DISCONNECT
  18. };
  19. class CTFDisconnectConfirmDialog : public CTFGenericConfirmDialog
  20. {
  21. DECLARE_CLASS_SIMPLE( CTFDisconnectConfirmDialog, CTFGenericConfirmDialog );
  22. public:
  23. CTFDisconnectConfirmDialog( const char *pTitle,
  24. const char *pTextKey,
  25. const char *pConfirmBtnText,
  26. const char *pCancelBtnText,
  27. GenericConfirmDialogCallback callback,
  28. vgui::Panel *pParent );
  29. virtual const char *GetResFile();
  30. void SetReason( eDisconnectReason reason );
  31. virtual void OnCommand( const char *command );
  32. void AddConfirmCommand( const char *command );
  33. void AddCancelCommand( const char *command );
  34. private:
  35. CUtlVector< CUtlString > m_confirmCommands;
  36. CUtlVector< CUtlString > m_cancelCommands;
  37. eDisconnectReason m_eReason;
  38. EAbandonGameStatus m_eAbandonStatus;
  39. };
  40. CTFDisconnectConfirmDialog * BuildDisconnectConfirmDialog();
  41. class CTFRejoinConfirmDialog : public CTFGenericConfirmDialog
  42. {
  43. DECLARE_CLASS_SIMPLE( CTFRejoinConfirmDialog, CTFGenericConfirmDialog );
  44. public:
  45. CTFRejoinConfirmDialog( const char *pTitle,
  46. const char *pTextKey,
  47. const char *pConfirmBtnText,
  48. const char *pCancelBtnText,
  49. GenericConfirmDialogCallback callback,
  50. vgui::Panel *pParent );
  51. virtual const char *GetResFile();
  52. void CloseRejoinWindow();
  53. private:
  54. EAbandonGameStatus m_eAbandonStatus;
  55. };
  56. bool HandleDisconnectAttempt();
  57. #endif // TF_HUD_DISCONNECT_PROMPT_H