summaryrefslogtreecommitdiff
path: root/game/client/econ/tool_items/tool_items.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/econ/tool_items/tool_items.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/econ/tool_items/tool_items.h')
-rw-r--r--game/client/econ/tool_items/tool_items.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/game/client/econ/tool_items/tool_items.h b/game/client/econ/tool_items/tool_items.h
new file mode 100644
index 0000000..14bfb36
--- /dev/null
+++ b/game/client/econ/tool_items/tool_items.h
@@ -0,0 +1,58 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef TOOL_ITEMS_H
+#define TOOL_ITEMS_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "item_model_panel.h"
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+class CBaseToolUsageDialog : public vgui::EditablePanel
+{
+ DECLARE_CLASS_SIMPLE( CBaseToolUsageDialog, vgui::EditablePanel );
+
+public:
+ CBaseToolUsageDialog( vgui::Panel *pParent, const char *panelName, CEconItemView *pTool, CEconItemView *pToolSubject );
+
+ virtual void ApplySchemeSettings( vgui::IScheme *scheme );
+ virtual void PerformLayout();
+ virtual void OnCommand( const char *command );
+ virtual void OnKeyCodeTyped( vgui::KeyCode code ) OVERRIDE;
+ virtual void OnKeyCodePressed( vgui::KeyCode code ) OVERRIDE;
+
+ virtual void Apply( void ) { return; }
+
+ inline CEconItemView *GetToolItem() { return m_pToolModelPanel->GetItem(); };
+ inline CEconItemView *GetSubjectItem() { return m_pSubjectModelPanel->GetItem(); };
+
+protected:
+ CItemModelPanel *m_pToolModelPanel;
+ CItemModelPanel *m_pSubjectModelPanel;
+ CItemModelPanel *m_pMouseOverItemPanel;
+ CItemModelPanelToolTip *m_pMouseOverTooltip;
+ vgui::Label *m_pTitleLabel;
+
+ const char *m_pszInternalPanelName;
+};
+
+
+// Utility function for tool dialogs.
+void MakeModalAndBringToFront( vgui::EditablePanel *dialog );
+
+bool ToolCanApplyTo( CEconItemView *pTool, CEconItemView *pToolSubject );
+
+// Given a tool and an item to apply the tool's effects upon,
+// gather required information from the user and
+// send a change request to the GC.
+bool ApplyTool( vgui::Panel *pParent, CEconItemView *pTool, CEconItemView *pToolSubject );
+
+#endif // TOOL_ITEMS_H