diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/econ/tool_items/rename_tool_ui.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/econ/tool_items/rename_tool_ui.h')
| -rw-r--r-- | game/client/econ/tool_items/rename_tool_ui.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/game/client/econ/tool_items/rename_tool_ui.h b/game/client/econ/tool_items/rename_tool_ui.h new file mode 100644 index 0000000..c65c09c --- /dev/null +++ b/game/client/econ/tool_items/rename_tool_ui.h @@ -0,0 +1,74 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef RENAME_TOOL_UI_H +#define RENAME_TOOL_UI_H +#ifdef _WIN32 +#pragma once +#endif + +#include "tool_items.h" + +class CNameToolUsageDialog : public CBaseToolUsageDialog +{ + DECLARE_CLASS_SIMPLE( CNameToolUsageDialog, CBaseToolUsageDialog ); + +public: + CNameToolUsageDialog( vgui::Panel *pParent, const char* pszName, CEconItemView *pTool, CEconItemView *pToolSubject, bool bDescription ); + virtual int GetMaxLength(); + virtual int GetMaxDBSize(); + +protected: + bool m_bDescription; +}; + +//----------------------------------------------------------------------------- +// Purpose: A dialog used to input a Tool's name payload +//----------------------------------------------------------------------------- +class CRequestNameDialog : public CNameToolUsageDialog +{ + DECLARE_CLASS_SIMPLE( CRequestNameDialog, CNameToolUsageDialog ); + +public: + CRequestNameDialog( vgui::Panel *pParent, const char* pszName, CEconItemView *pTool, CEconItemView *pToolSubject, bool bDescription ); + + virtual void MoveToFront(); + virtual void ApplySchemeSettings( vgui::IScheme *pScheme ); + virtual void Apply( void ); + + MESSAGE_FUNC_PTR( OnItemPanelEntered, "ItemPanelEntered", panel ); + +private: + vgui::TextEntry *m_pCustomNameEntry; + vgui::Label *m_pOldNameLabel; + vgui::Label *m_pOldName; + vgui::Label *m_pNewNameLabel; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Confirm name and commit or reject +//----------------------------------------------------------------------------- +class CConfirmNameDialog : public CNameToolUsageDialog +{ + DECLARE_CLASS_SIMPLE( CConfirmNameDialog, CNameToolUsageDialog ); + +public: + CConfirmNameDialog( vgui::Panel *pParent, const char* pszName, CEconItemView *pTool, CEconItemView *pToolSubject, const wchar_t *name, bool bDescription ); + + virtual void ApplySchemeSettings( vgui::IScheme *scheme ); + virtual void Apply( void ); + virtual void OnCommand( const char *command ); + +private: + wchar_t m_name[ MAX_ITEM_CUSTOM_DESC_LENGTH+1 ]; + + bool IsNameValid( void ) const; +}; + + +#endif // RENAME_TOOL_UI_H |