From 3bf9df6b2785fa6d951086978a3e66f49427166a Mon Sep 17 00:00:00 2001 From: FluorescentCIAAfricanAmerican <0934gj3049fk@protonmail.com> Date: Wed, 22 Apr 2020 12:56:21 -0400 Subject: 1 --- tracker/AdminServer/DialogAddBan.cpp | 250 +++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 tracker/AdminServer/DialogAddBan.cpp (limited to 'tracker/AdminServer/DialogAddBan.cpp') diff --git a/tracker/AdminServer/DialogAddBan.cpp b/tracker/AdminServer/DialogAddBan.cpp new file mode 100644 index 0000000..5464ea9 --- /dev/null +++ b/tracker/AdminServer/DialogAddBan.cpp @@ -0,0 +1,250 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#include +#include "DialogAddBan.h" + +#include +#include + +#include +#include +#include +#include +#include + +using namespace vgui; + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CDialogAddBan::CDialogAddBan(vgui::Panel *parent) : Frame(parent, "DialogAddBan") +{ + SetSize(320, 200); + SetTitle("#Game_Ban_Add_Title", false); + + m_pIDTextEntry = new TextEntry(this, "IDTextEntry"); + + m_pOkayButton = new Button(this, "OkayButton", "#Okay_Button"); + + m_pPermBanRadio = new RadioButton(this, "PermBanRadio", "#Add_Ban_Time_Permanent"); + m_pTempBanRadio = new RadioButton(this, "TempBanRadio", "#Add_Ban_Time_Temporary"); + m_pPermBanRadio->SetSelected(true); + + m_pTimeTextEntry = new TextEntry(this, "TimeTextEntry"); + m_pTimeCombo = new ComboBox(this, "TimeCombo",3,false); + int defaultItem = m_pTimeCombo->AddItem("#Add_Ban_Period_Minutes", NULL); + m_pTimeCombo->AddItem("#Add_Ban_Period_Hours", NULL); + m_pTimeCombo->AddItem("#Add_Ban_Period_Days", NULL); + m_pTimeCombo->ActivateItem(defaultItem); + + LoadControlSettings("Admin\\DialogAddBan.res", "PLATFORM"); + + SetTitle("#Add_Ban_Title", true); + SetSizeable(false); + + // set our initial position in the middle of the workspace + MoveToCenterOfScreen(); +} + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CDialogAddBan::~CDialogAddBan() +{ +} + + +//----------------------------------------------------------------------------- +// Purpose: initializes the dialog and brings it to the foreground +//----------------------------------------------------------------------------- +void CDialogAddBan::Activate(const char *type,const char *player,const char *authid) +{ + + m_cType=type; + + m_pOkayButton->SetAsDefaultButton(true); + MakePopup(); + MoveToFront(); + + RequestFocus(); + m_pIDTextEntry->RequestFocus(); + SetVisible(true); + + SetTextEntry("PlayerTextEntry",player); + SetTextEntry("IDTextEntry",authid); + + BaseClass::Activate(); +} + +//----------------------------------------------------------------------------- +// Purpose: Sets the text of a labell by name +//----------------------------------------------------------------------------- +void CDialogAddBan::SetLabelText(const char *textEntryName, const char *text) +{ + Label *entry = dynamic_cast