1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef ITEM_PICKUP_PANEL_H
#define ITEM_PICKUP_PANEL_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui_controls/Panel.h>
#include <vgui_controls/Frame.h>
#include "GameEventListener.h"
#include "basemodel_panel.h"
#include "basemodelpanel.h"
#include "econ_item_inventory.h"
#include "econ_item_view.h"
#include "item_model_panel.h"
#include "vgui_controls/TextEntry.h"
#include "econ_controls.h"
class CEconItemView;
class CBackpackPanel;
#define ITEMPICKUP_NUM_MODELPANELS 5 // 1 in the center of the screen, 2 to each side to handle smooth sliding.
#define ITEMPICKUP_MODELPANEL_CENTER 2 // Panel that's in the center of the queue
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CItemPickupPanel : public vgui::Frame, public CGameEventListener
{
DECLARE_CLASS_SIMPLE( CItemPickupPanel, vgui::Frame );
public:
CItemPickupPanel( Panel *parent );
virtual ~CItemPickupPanel();
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void ApplySettings( KeyValues *inResourceData );
virtual void PerformLayout( void );
virtual void OnCommand( const char *command );
virtual void ShowPanel( bool bShow );
virtual void FireGameEvent( IGameEvent *event );
virtual void OnKeyCodeTyped( vgui::KeyCode code );
virtual void OnKeyCodePressed( vgui::KeyCode code );
void AddItem( CEconItemView *pItem );
void SetReturnToGame( bool bReturn ) { m_bReturnToGame = bReturn; }
#ifdef DEBUG
void DebugRandomizePickupMethods( void ) { m_bRandomizePickupMethods = true; }
#endif
MESSAGE_FUNC_PARAMS( OnConfirmDelete, "ConfirmDlgResult", data );
protected:
virtual void UpdateModelPanels( void );
virtual void AcknowledgeItems ( void );
protected:
int m_iSelectedItem;
struct founditem_t
{
CEconItemView pItem;
bool bDiscarded;
};
CUtlVector<founditem_t> m_aItems;
CItemModelPanel *m_aModelPanels[ITEMPICKUP_NUM_MODELPANELS];
vgui::Button *m_pNextButton;
vgui::Button *m_pPrevButton;
vgui::Button *m_pOpenLoadoutButton;
CExButton *m_pCloseButton;
CExImageButton *m_pDiscardButton;
vgui::Label *m_pItemsFoundLabel;
vgui::Label *m_pItemFoundMethod;
KeyValues *m_pModelPanelsKV;
vgui::EditablePanel *m_pConfirmDeleteDialog;
vgui::Label *m_pDiscardedLabel;
bool m_bRandomizePickupMethods;
CSimplePanelToolTip *m_pToolTip;
bool m_bReturnToGame;
CPanelAnimationVarAliasType( float, m_iModelPanelSpacing, "modelpanels_spacing", "40", "proportional_float" );
CPanelAnimationVarAliasType( float, m_iModelPanelW, "modelpanels_width", "128", "proportional_float" );
CPanelAnimationVarAliasType( float, m_iModelPanelH, "modelpanels_height", "80", "proportional_float" );
CPanelAnimationVarAliasType( float, m_iModelPanelY, "modelpanels_ypos", "120", "proportional_float" );
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CItemDiscardPanel : public vgui::Frame, public CGameEventListener
{
DECLARE_CLASS_SIMPLE( CItemDiscardPanel, vgui::Frame );
public:
CItemDiscardPanel( Panel *parent );
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void PerformLayout( void );
virtual void OnCommand( const char *command );
virtual void ShowPanel( bool bShow );
virtual void FireGameEvent( IGameEvent *event );
virtual void OnKeyCodeTyped( vgui::KeyCode code );
virtual void OnKeyCodePressed( vgui::KeyCode code );
void SetItem( CEconItemView *pItem );
MESSAGE_FUNC_PARAMS( OnConfirmDelete, "ConfirmDlgResult", data );
protected:
CItemModelPanel *m_pModelPanel;
CBackpackPanel *m_pBackpackPanel;
vgui::EditablePanel *m_pConfirmDeleteDialog;
vgui::Label *m_pDiscardedLabel;
vgui::Label *m_pDiscardedLabelCarat;
bool m_bDiscardedNewItem;
bool m_bMadeRoom;
CExButton *m_pDiscardButton;
CExButton *m_pCloseButton;
CSimplePanelToolTip *m_pItemToolTip;
CItemModelPanel *m_pItemMouseOverPanel;
};
#endif // ITEM_PICKUP_PANEL_H
|