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.

100 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Generic in-game abuse reporting
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef ABUSE_REPORT_UI_H
  8. #define ABUSE_REPORT_UI_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "abuse_report.h"
  13. #include <vgui_controls/EditablePanel.h>
  14. class CAvatarImagePanel;
  15. class CCustomTextureImagePanel;
  16. class CAbuseReportScreenShotPanel;
  17. class CAbuseReportDlg : public vgui::EditablePanel
  18. {
  19. DECLARE_CLASS_SIMPLE( CAbuseReportDlg, vgui::EditablePanel );
  20. public:
  21. CAbuseReportDlg( vgui::Panel *parent, AbuseIncidentData_t *pIncidentData );
  22. ~CAbuseReportDlg();
  23. virtual void OnCommand(const char *command);
  24. virtual void Close();
  25. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  26. virtual void PerformLayout();
  27. virtual void MakeModal();
  28. bool IsAccusingGameServer();
  29. EAbuseReportContentType GetAbuseContentType();
  30. EAbuseReportType GetAbuseType();
  31. int GetAccusedPlayerIndex();
  32. const AbuseIncidentData_t::PlayerData_t *GetAccusedPlayerPtr();
  33. int GetUserImageIndex();
  34. int GetSelectedCustomImage();
  35. CUtlString GetAbuseDescription();
  36. bool GetAttachScreenShot();
  37. protected:
  38. MESSAGE_FUNC_PTR( OnRadioButtonChecked, "RadioButtonChecked", panel );
  39. virtual const char *GetResFilename();
  40. vgui::Button *m_pSubmitButton;
  41. vgui::Button *m_pScreenShot;
  42. vgui::CheckButton *m_pScreenShotAttachCheckButton;
  43. vgui::Button *m_pCustomTextureNextButton;
  44. vgui::Button *m_pCustomTexturePrevButton;
  45. vgui::Button *m_pOffensiveImage;
  46. vgui::TextEntry *m_pDescriptionTextEntry;
  47. vgui::Panel *m_pPlayerLabel;
  48. vgui::RadioButton *m_pPlayerRadio;
  49. vgui::RadioButton *m_pGameServerRadio;
  50. vgui::ComboBox *m_pPlayerCombo;
  51. vgui::Panel *m_pAbuseContentLabel;
  52. vgui::ComboBox *m_pAbuseContentCombo;
  53. vgui::Panel *m_pAbuseTypeLabel;
  54. vgui::ComboBox *m_pAbuseTypeCombo;
  55. CAbuseReportScreenShotPanel *m_pScreenShotBitmap;
  56. CAvatarImagePanel *m_pAvatarImage;
  57. vgui::Panel *m_pNoAvatarLabel;
  58. CCustomTextureImagePanel *m_pCustomTextureImagePanel;
  59. vgui::Panel *m_pNoCustomTexturesLabel;
  60. AbuseIncidentData_t *m_pIncidentData;
  61. int m_iUserImageIndex;
  62. MESSAGE_FUNC_PTR( OnTextChanged, "TextChanged", panel ); // send by combo box when it changes
  63. void PopulatePlayerList();
  64. void UpdateSubmitButton();
  65. void SetIsAccusingGameServer( bool bAccuseGameServer );
  66. void PlayerChanged();
  67. void ContentTypeChanged();
  68. void UpdateAvatarImage();
  69. void UpdateCustomTextures();
  70. virtual void OnSubmitReport();
  71. };
  72. /// Global pointer to the submission dialiog.
  73. /// NULL if it's not displayed
  74. extern vgui::DHANDLE<CAbuseReportDlg> g_AbuseReportDlg;
  75. #endif // ABUSE_REPORT_UI_H