summaryrefslogtreecommitdiff
path: root/game/client/tf/vgui/tf_layeredmappanel.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/tf_layeredmappanel.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/tf_layeredmappanel.h')
-rw-r--r--game/client/tf/vgui/tf_layeredmappanel.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/game/client/tf/vgui/tf_layeredmappanel.h b/game/client/tf/vgui/tf_layeredmappanel.h
new file mode 100644
index 0000000..e3418fc
--- /dev/null
+++ b/game/client/tf/vgui/tf_layeredmappanel.h
@@ -0,0 +1,106 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Layered Map that contains a background and stateful locations.
+// Each location will support mouse over information
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef TF_LAYEREDMAPPANEL_H
+#define TF_LAYEREDMAPPANEL_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <vgui/IScheme.h>
+#include <vgui_controls/EditablePanel.h>
+#include <vgui_controls/ScalableImagePanel.h>
+#include <vgui_controls/Tooltip.h>
+#include "item_model_panel.h"
+
+class CTFLayeredMapPanel;
+class CTFLayeredMapItemPanel;
+
+//=========================================================
+class CLayeredMapToolTip : public vgui::BaseTooltip
+{
+ DECLARE_CLASS_SIMPLE( CLayeredMapToolTip, vgui::BaseTooltip );
+public:
+ CLayeredMapToolTip(vgui::Panel *parent, const char *text = NULL);
+
+ void SetText(const char *text) { return; }
+ const char *GetText() { return NULL; }
+
+ virtual void PerformLayout();
+ virtual void ShowTooltip( vgui::Panel *currentPanel );
+ virtual void HideTooltip();
+
+ void SetupPanels( CTFLayeredMapPanel *pParentPanel, vgui::EditablePanel *pControlledPanel );
+
+private:
+ void GetPosition( itempanel_tooltippos_t iTooltipPosition, CTFLayeredMapItemPanel *pMapItemPanel, int iItemX, int iItemY, int *iXPos, int *iYPos );
+ bool ValidatePosition( CTFLayeredMapItemPanel *pItemPanel, int iItemX, int iItemY, int *iXPos, int *iYPos );
+
+ vgui::DHANDLE<CTFLayeredMapItemPanel> m_hCurrentPanel;
+
+ CTFLayeredMapPanel *m_pParentPanel;
+ vgui::EditablePanel *m_pControlledPanel;
+};
+
+//=========================================================
+class CTFLayeredMapItemPanel : public vgui::EditablePanel
+{
+ DECLARE_CLASS_SIMPLE( CTFLayeredMapItemPanel, vgui::EditablePanel );
+public:
+ CTFLayeredMapItemPanel( Panel *parent, const char *pName );
+
+ virtual void ApplySettings( KeyValues *inResourceData );
+ virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
+
+ // Button
+ virtual void OnCursorEntered();
+ virtual void OnCursorExited();
+ virtual void OnMousePressed(vgui::MouseCode code);
+
+ //
+ void SetCompletionState( bool bIsCompleted );
+ KeyValues * GetItemKvData () { return m_kvData; }
+
+private:
+
+ vgui::ScalableImagePanel *m_pIsCompleted;
+ vgui::ScalableImagePanel *m_pIsCompletedHighlight;
+
+ vgui::ScalableImagePanel *m_pNotCompleted;
+ vgui::ScalableImagePanel *m_pNotCompletedHighlight;
+
+ bool m_bIsCompleted;
+ bool m_bIsMouseOvered;
+
+ KeyValues *m_kvData;
+};
+
+//=========================================================
+class CTFLayeredMapPanel : public vgui::EditablePanel
+{
+ DECLARE_CLASS_SIMPLE( CTFLayeredMapPanel, vgui::EditablePanel );
+public:
+ CTFLayeredMapPanel( Panel *parent, const char *pName );
+
+ virtual void ApplySettings( KeyValues *inResourceData );
+ virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
+
+
+ //CUtlVector<vgui::ImagePanel*> m_pImages;
+
+private:
+
+ EditablePanel *m_pToolTipPanel;
+ CLayeredMapToolTip *m_pToolTip;
+
+ KeyValues *m_pLayeredMapKv;
+
+ CUtlVector<CTFLayeredMapItemPanel*> m_MapItems;
+};
+
+#endif // TF_LAYEREDIMAGEPANEL_H \ No newline at end of file