summaryrefslogtreecommitdiff
path: root/game/client/abuse_report_ui.h
blob: 6cec2d245fcae26c3087bd3db78119494a8e4f76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Generic in-game abuse reporting
//
// $NoKeywords: $
//=============================================================================//

#ifndef ABUSE_REPORT_UI_H
#define ABUSE_REPORT_UI_H
#ifdef _WIN32
#pragma once
#endif

#include "abuse_report.h"
#include <vgui_controls/EditablePanel.h>

class CAvatarImagePanel;
class CCustomTextureImagePanel;
class CAbuseReportScreenShotPanel;

class CAbuseReportDlg : public vgui::EditablePanel
{
	DECLARE_CLASS_SIMPLE( CAbuseReportDlg, vgui::EditablePanel );

public:
	CAbuseReportDlg( vgui::Panel *parent, AbuseIncidentData_t *pIncidentData );
	~CAbuseReportDlg();

	virtual void OnCommand(const char *command);
	virtual void Close();
	virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
	virtual void PerformLayout();

	virtual void MakeModal();

	bool IsAccusingGameServer();
	EAbuseReportContentType GetAbuseContentType();
	EAbuseReportType GetAbuseType();
	int GetAccusedPlayerIndex();
	const AbuseIncidentData_t::PlayerData_t *GetAccusedPlayerPtr();
	int GetUserImageIndex();
	int GetSelectedCustomImage();
	CUtlString GetAbuseDescription();
	bool GetAttachScreenShot();

protected:

	MESSAGE_FUNC_PTR( OnRadioButtonChecked, "RadioButtonChecked", panel );

	virtual const char *GetResFilename();

	vgui::Button *m_pSubmitButton;

	vgui::Button *m_pScreenShot;
	vgui::CheckButton *m_pScreenShotAttachCheckButton;

	vgui::Button *m_pCustomTextureNextButton;
	vgui::Button *m_pCustomTexturePrevButton;
	vgui::Button *m_pOffensiveImage;

	vgui::TextEntry		*m_pDescriptionTextEntry;
	vgui::Panel			*m_pPlayerLabel;
	vgui::RadioButton	*m_pPlayerRadio;
	vgui::RadioButton	*m_pGameServerRadio;
	vgui::ComboBox		*m_pPlayerCombo;
	vgui::Panel			*m_pAbuseContentLabel;
	vgui::ComboBox		*m_pAbuseContentCombo;
	vgui::Panel			*m_pAbuseTypeLabel;
	vgui::ComboBox		*m_pAbuseTypeCombo;

	CAbuseReportScreenShotPanel	*m_pScreenShotBitmap;

	CAvatarImagePanel	*m_pAvatarImage;
	vgui::Panel		*m_pNoAvatarLabel;

	CCustomTextureImagePanel *m_pCustomTextureImagePanel;
	vgui::Panel		*m_pNoCustomTexturesLabel;

	AbuseIncidentData_t *m_pIncidentData;

	int m_iUserImageIndex;

	MESSAGE_FUNC_PTR( OnTextChanged, "TextChanged", panel ); // send by combo box when it changes

	void PopulatePlayerList();
	void UpdateSubmitButton();
	void SetIsAccusingGameServer( bool bAccuseGameServer );
	void PlayerChanged();
	void ContentTypeChanged();
	void UpdateAvatarImage();
	void UpdateCustomTextures();

	virtual void OnSubmitReport();
};

/// Global pointer to the submission dialiog.
/// NULL if it's not displayed
extern vgui::DHANDLE<CAbuseReportDlg> g_AbuseReportDlg;

#endif	// ABUSE_REPORT_UI_H