summaryrefslogtreecommitdiff
path: root/game/client/tf/vgui/loadout_preset_panel.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/loadout_preset_panel.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/loadout_preset_panel.h')
-rw-r--r--game/client/tf/vgui/loadout_preset_panel.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/game/client/tf/vgui/loadout_preset_panel.h b/game/client/tf/vgui/loadout_preset_panel.h
new file mode 100644
index 0000000..7004832
--- /dev/null
+++ b/game/client/tf/vgui/loadout_preset_panel.h
@@ -0,0 +1,64 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//=======================================================================================//
+
+#ifndef LOADOUT_PRESET_PANEL_H
+#define LOADOUT_PRESET_PANEL_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "vgui_controls/EditablePanel.h"
+#include "vgui_controls/PHandle.h"
+#include "class_loadout_panel.h"
+
+class CExButton;
+class CSelectedItemPreset;
+
+//-----------------------------------------------------------------------------
+// A loadout preset panel, which allows combinations of items to be saved and
+// restored via the GC.
+//-----------------------------------------------------------------------------
+class CLoadoutPresetPanel : public vgui::EditablePanel
+{
+ DECLARE_CLASS_SIMPLE( CLoadoutPresetPanel, vgui::EditablePanel );
+public:
+ CLoadoutPresetPanel( vgui::Panel *pParent, const char *pName ); // name is ignored but needed for DECLARE_BUILD_FACTORY()
+
+ void SetClass( int iClass );
+ void EnableVerticalDisplay( bool bVertical );
+
+ virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
+ virtual void ApplySettings( KeyValues *pInResourceData );
+ virtual void PerformLayout();
+ virtual void OnCommand( const char *command );
+ virtual void OnTick() OVERRIDE;
+
+ bool HandlePresetKeyPressed( vgui::KeyCode code );
+
+private:
+ equipped_preset_t GetSelectedPresetID() const;
+ void UpdatePresetButtonStates();
+ void LoadPreset( int iPresetIndex );
+
+ enum PresetsConsts_t
+ {
+ MAX_PRESETS = 4,
+ };
+
+ int m_iClass;
+ KeyValues *m_pPresetButtonKv;
+ CExButton *m_pPresetButtons[ MAX_PRESETS ];
+ bool m_bDisplayVertical;
+
+ enum PresetButtonColors_t
+ {
+ LOADED = 0, NOTLOADED,
+ FG = 0, BG,
+ DEFAULT = 0, ARMED, DEPRESSED
+ };
+ Color m_aDefaultColors[2][2][3]; // [LOADED|NOTLOADED][FG|BG][DEFAULT|ARMED|DEPRESSED]
+};
+
+
+#endif // LOADOUT_PRESET_PANEL_H