blob: a039b4daec1121d33a6b558acdce82919707bf62 (
plain) (
blame)
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
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
#include "store/store_page_halloween.h"
#include "vgui/ISurface.h"
#include "vgui/IInput.h"
#include "vgui/ILocalize.h"
#include "c_tf_player.h"
#include "gamestringpool.h"
#include "tf_item_inventory.h"
#include "econ_item_system.h"
#include "item_model_panel.h"
#include "store/store_panel.h"
#include "store_preview_item.h"
#include "store_viewcart.h"
#include "c_tf_gamestats.h"
// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CTFStorePage_SpecialPromo::CTFStorePage_SpecialPromo( Panel *parent, const CEconStoreCategoryManager::StoreCategory_t *pPageData ) : BaseClass( parent, pPageData )
{
pszResFile = pPageData->m_pchPageRes;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
/*
void CTFStorePage_SpecialPromo::OrderItemsForDisplay( CUtlVector<const econ_store_entry_t *>& vecItems ) const
{
vecItems.Sort( &ItemDisplayOrderSort_UseSortOverride );
}
*/
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CTFStorePage_Popular::CTFStorePage_Popular( Panel *parent, const CEconStoreCategoryManager::StoreCategory_t *pPageData ) : BaseClass( parent, pPageData )
{
}
//-----------------------------------------------------------------------------
// Purpose: The popular page draws its list of items from the overall popular items list.
//-----------------------------------------------------------------------------
void CTFStorePage_Popular::UpdateFilteredItems( void )
{
m_FilteredEntries.Purge();
m_vecFilterCounts.SetCount( GetNumPrimaryFilters() );
if ( !m_vecFilterCounts.Count() )
return;
FOR_EACH_VEC( m_vecFilterCounts, i )
{
m_vecFilterCounts[i] = 0;
}
CStorePanel *pStorePanel = EconUI()->GetStorePanel();
if ( !pStorePanel )
return;
// Add all popular items
const CUtlVector<uint32>& popularItems = pStorePanel->GetPopularItems();
for ( int i=0; i<popularItems.Count(); ++i )
{
const econ_store_entry_t *pEntry = pStorePanel->GetPriceSheet()->GetEntry( popularItems[i] );
m_FilteredEntries.AddToTail( pEntry );
}
FOR_EACH_VEC( m_vecItemPanels, idx )
{
m_vecItemPanels[idx].m_pItemModelPanel->SetShowQuantity( false );
}
m_pFilterComboBox->SetVisible( false );
}
|