summaryrefslogtreecommitdiff
path: root/game/client/tf/vgui/item_quickswitch.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/tf/vgui/item_quickswitch.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/tf/vgui/item_quickswitch.h')
-rw-r--r--game/client/tf/vgui/item_quickswitch.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/game/client/tf/vgui/item_quickswitch.h b/game/client/tf/vgui/item_quickswitch.h
new file mode 100644
index 0000000..5cf8bd8
--- /dev/null
+++ b/game/client/tf/vgui/item_quickswitch.h
@@ -0,0 +1,72 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+
+#ifndef ITEM_QUICKSWITCH_H
+#define ITEM_QUICKSWITCH_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "vgui_controls/ScrollableEditablePanel.h"
+
+class CLoadoutPresetPanel;
+
+class CItemQuickSwitchPanel : public vgui::EditablePanel, public CHudElement
+{
+ DECLARE_CLASS_SIMPLE( CItemQuickSwitchPanel, vgui::EditablePanel );
+public:
+ CItemQuickSwitchPanel( const char *pElementName );
+ virtual ~CItemQuickSwitchPanel();
+
+ void OpenQS( void );
+ void CloseQS( void );
+ bool ShouldDraw( void ) { return IsVisible(); }
+
+ virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
+ virtual void ApplySettings( KeyValues *inResourceData );
+ virtual void PerformLayout( void );
+ virtual void OnTick( void );
+
+ void UpdateEquippedItem( void );
+ bool CalculateClassAndSlot();
+ void UpdateModelPanels( void );
+ void SetButtonToItem( int iButton, CEconItemView *pItem );
+
+ bool IsValid( void );
+
+ virtual void FireGameEvent( IGameEvent *event );
+
+ int HudElementKeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding );
+
+ MESSAGE_FUNC( OnItemPresetLoaded, "ItemPresetLoaded" );
+
+ MESSAGE_FUNC_PTR( OnIPMouseReleased, "ItemPanelMouseReleased", panel );
+ MESSAGE_FUNC_PTR( OnItemPanelEntered, "ItemPanelEntered", panel );
+ MESSAGE_FUNC_PTR( OnItemPanelExited, "ItemPanelExited", panel );
+
+private:
+ int m_iClass; // Class of the player we're selecting an item for
+ int m_iSlot; // Slot on the player that we're selecting an item for
+ bool m_bLoadoutHasChanged;
+
+ vgui::EditablePanel *m_pItemContainer;
+ vgui::ScrollableEditablePanel *m_pItemContainerScroller;
+ vgui::Label *m_pWeaponLabel;
+ vgui::Label *m_pEquipYourClassLabel;
+ vgui::Label *m_pNoItemsToEquipLabel;
+ vgui::Label *m_pEquippedLabel;
+
+ CLoadoutPresetPanel *m_pLoadoutPresetPanel;
+
+ KeyValues *m_pItemKV;
+ CUtlVector<CItemModelPanel *> m_pItemPanels;
+
+ CPanelAnimationVarAliasType( int, m_iItemPanelXPos, "itempanel_xpos", "0", "proportional_int" );
+ CPanelAnimationVarAliasType( int, m_iItemPanelYDelta, "itempanel_ydelta", "0", "proportional_int" );
+};
+
+#endif // ITEM_QUICKSWITCH_H