This commit is contained in:
FluorescentCIAAfricanAmerican
2020-04-22 12:56:21 -04:00
commit 3bf9df6b27
15370 changed files with 5489726 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+424
View File
@@ -0,0 +1,424 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef STORE_PAGE_H
#define STORE_PAGE_H
#ifdef _WIN32
#pragma once
#endif
#include <game/client/iviewport.h>
#include "vgui_controls/PropertyPage.h"
#include <vgui_controls/Button.h>
#include <vgui_controls/ComboBox.h>
#include <vgui_controls/ImagePanel.h>
#include "econ_controls.h"
#include "econ_ui.h"
#include "econ_store.h"
#include "item_model_panel.h"
#include "econ_storecategory.h"
class CItemModelPanel;
class CItemModelPanelToolTip;
class CStorePreviewItemPanel;
class CStoreItemControlsPanel;
#define FILTER_ALL_ITEMS 0
//-----------------------------------------------------------------------------
// Purpose: Base class for the preview icons in the store's item preview panel
//-----------------------------------------------------------------------------
class CBaseStorePreviewIcon : public vgui::EditablePanel
{
DECLARE_CLASS_SIMPLE( CBaseStorePreviewIcon, vgui::EditablePanel );
public:
CBaseStorePreviewIcon( vgui::Panel *parent, const char *name ) : vgui::EditablePanel(parent,name)
{
REGISTER_COLOR_AS_OVERRIDABLE( m_colPanelBG, "panel_bgcolor" );
REGISTER_COLOR_AS_OVERRIDABLE( m_colPanelBGMouseover, "panel_bgcolor_mouseover" );
m_bHover = false;
m_bSelected = false;
}
void SetSelected( bool bSelected )
{
m_bSelected = bSelected;
UpdateBgColor();
}
void ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
SetBgColor( m_colPanelBG );
}
virtual void PerformLayout( void )
{
BaseClass::PerformLayout();
int iWide = GetWide() - (m_iImageIndent * 2);
int iTall = GetTall() - (m_iImageIndent * 2);
SetInternalImageBounds( m_iImageIndent, m_iImageIndent, iWide, iTall );
}
virtual void OnCursorEntered()
{
BaseClass::OnCursorEntered();
m_bHover = true;
UpdateBgColor();
}
virtual void OnCursorExited()
{
BaseClass::OnCursorExited();
m_bHover = false;
UpdateBgColor();
}
virtual void SetInternalImageBounds( int iX, int iY, int iWide, int iTall ) = 0;
private:
Color m_colPanelBG;
Color m_colPanelBGMouseover;
CPanelAnimationVarAliasType( int, m_iImageIndent, "image_indent", "0", "proportional_int" );
bool m_bHover;
bool m_bSelected;
void UpdateBgColor()
{
if ( m_bHover || m_bSelected )
{
SetBgColor( m_colPanelBGMouseover );
}
else
{
SetBgColor( m_colPanelBG );
}
}
};
//-----------------------------------------------------------------------------
// Purpose: An item preview icon in the store's item preview panel
//-----------------------------------------------------------------------------
class CStorePreviewItemIcon : public CBaseStorePreviewIcon
{
DECLARE_CLASS_SIMPLE( CStorePreviewItemIcon, CBaseStorePreviewIcon );
public:
CStorePreviewItemIcon( vgui::Panel *parent, const char *name ) : CBaseStorePreviewIcon(parent,name)
{
m_pItemPanel = new CItemModelPanel( this, "itempanel" );
m_pItemPanel->AddActionSignalTarget( this );
m_pItemPanel->SendPanelEnterExits( true );
m_pItemPanel->SetActAsButton( true, true );
}
virtual void ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
vgui::EditablePanel *pTmp = dynamic_cast<vgui::EditablePanel*>( FindChildByName("bgblockout") );
if ( pTmp )
{
pTmp->SetMouseInputEnabled( false );
}
}
virtual void OnCursorEntered()
{
BaseClass::OnCursorEntered();
PostActionSignal(new KeyValues("ShowItemIconMouseover", "icon", m_iIconIndex));
}
virtual void OnCursorExited()
{
BaseClass::OnCursorExited();
PostActionSignal(new KeyValues("HideItemIconMouseover"));
}
virtual void OnMouseReleased(vgui::MouseCode code)
{
BaseClass::OnMouseReleased(code);
PostActionSignal(new KeyValues("ItemIconSelected", "icon", m_iIconIndex));
}
MESSAGE_FUNC_PTR( OnItemPanelMouseReleased, "ItemPanelMouseReleased", panel );
virtual void SetInternalImageBounds( int iX, int iY, int iWide, int iTall )
{
m_pItemPanel->SetBounds( iX, iY, iWide, iTall );
}
MESSAGE_FUNC_PTR( OnItemPanelEntered, "ItemPanelEntered", panel )
{
BaseClass::OnCursorEntered();
}
MESSAGE_FUNC_PTR( OnItemPanelExited, "ItemPanelExited", panel )
{
BaseClass::OnCursorExited();
}
void SetItem( int iIconIndex, int iItemDef )
{
m_iIconIndex = iIconIndex;
CEconItemView itemData;
itemData.Init( iItemDef, AE_UNIQUE, AE_USE_SCRIPT_VALUE, true );
m_pItemPanel->SetItem( &itemData );
}
void SetItem( int iIconIndex, CEconItemView *pItem )
{
m_iIconIndex = iIconIndex;
m_pItemPanel->SetItem( pItem );
}
CItemModelPanel *GetItemPanel( void ) { return m_pItemPanel; }
private:
CItemModelPanel *m_pItemPanel;
int m_iIconIndex;
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CStoreItemControlsPanel;
class CStoreItemControlsPanel : public vgui::EditablePanel
{
public:
DECLARE_CLASS_SIMPLE( CStoreItemControlsPanel, vgui::EditablePanel );
CStoreItemControlsPanel( vgui::Panel *pParent, const char *pPanelName, CItemModelPanel *pItemModelPanel );
virtual ~CStoreItemControlsPanel() {}
void SetMouseHoverHandler( Panel *pHandler );
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
const econ_store_entry_t *GetItem() const;
void SetItem( const econ_store_entry_t *pEntry );
void SetButtonsVisible( bool bVisible );
virtual void OnCursorEntered();
virtual void OnCursorExited();
void OnItemPanelEntered();
void OnItemPanelExited();
virtual void OnThink();
virtual void OnCommand( const char *command );
CItemModelPanel *GetItemModelPanel() { return m_pItemModelPanel; }
protected:
CItemModelPanel *m_pItemModelPanel;
const econ_store_entry_t *m_pEntry;
bool m_bButtonsVisible;
bool m_bItemPanelEntered;
vgui::DHANDLE< Panel > m_pMouseHoverHandler;
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CStorePricePanel : public vgui::EditablePanel
{
public:
DECLARE_CLASS_SIMPLE( CStorePricePanel, vgui::EditablePanel );
CStorePricePanel( vgui::Panel *pParent, const char *pPanelName );
virtual ~CStorePricePanel();
virtual const char* GetPanelResFile();
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void PerformLayout();
void SetPriceText( int iPrice, const char *pVariable, const econ_store_entry_t *pEntry );
virtual void SetItem( const econ_store_entry_t *pEntry );
MESSAGE_FUNC_PARAMS( OnStoreItemControlsPanelHover, "StoreItemControlsPanelHover", data );
protected:
bool m_bOldDiscountVisibility;
CExLabel *m_pPrice;
CExLabel *m_pDiscount;
CExLabel *m_pNew;
CExLabel *m_pHighlighted;
CExLabel *m_pSale;
EditablePanel *m_pSaleBorder;
CExLabel *m_pOGPrice;
Panel *m_pCrossout;
Panel *m_pLimited;
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CStorePage : public vgui::PropertyPage, public CGameEventListener
{
DECLARE_CLASS_SIMPLE( CStorePage, vgui::PropertyPage );
public:
CStorePage( Panel *parent, const CEconStoreCategoryManager::StoreCategory_t *pPageData, const char *pPreviewItemResFile = NULL );
virtual ~CStorePage();
virtual void OnPostCreate();
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void ApplySettings( KeyValues *inResourceData );
virtual void OnCommand( const char *command );
virtual void PerformLayout( void );
virtual void FireGameEvent( IGameEvent *event );
virtual void OnMouseWheeled( int delta );
virtual CStorePricePanel* CreatePricePanel( int iIndex );
void SetBorderForItem( CItemModelPanel *pItemPanel, bool bMouseOver );
void CalculateItemButtonPos( CItemModelPanel *pItemPanel, int x, int y, int *iXPos, int *iYPos );
int AssignItemToPanel( CItemModelPanel *pPanel, int iIndex );
void PositionItemPanel( CItemModelPanel *pPanel, int iIndex );
void UpdateModelPanels( void );
virtual void UpdateSelectionInfoPanel( void );
void UpdateCart( void );
void AddSelectionToCart( void );
void PreviewSelectionItem( void );
void DoPreviewItem( item_definition_index_t usItemDef );
const econ_store_entry_t *GetSelectedEntry( void );
int GetNumItemPanels( void ) { return m_iItemPanels; }
int GetNumColumns( void ) { return m_iItemColumns; }
int GetNumPages( void );
virtual void ShowPreview( int iClass, const econ_store_entry_t* pEntry );
void SetDetailsVisible( bool bVisible );
const char* GetPageName( void ) { return m_pPageData ? m_pPageData->m_pchName : NULL; }
virtual bool FindAndSelectEntry( const econ_store_entry_t *pEntry );
CItemModelPanelToolTip *GetItemTooltip( void ) { return m_pMouseOverTooltip; }
MESSAGE_FUNC( OnPageShow, "PageShow" );
MESSAGE_FUNC_PTR( OnItemPanelMouseReleased, "ItemPanelMouseReleased", panel ); // Comes from CStoreItemControlsPanel
MESSAGE_FUNC_PTR( OnItemPanelMouseDoublePressed, "ItemPanelMouseDoublePressed", panel );
MESSAGE_FUNC_PTR( OnItemPanelEntered, "ItemPanelEntered", panel );
MESSAGE_FUNC_PTR( OnItemPanelExited, "ItemPanelExited", panel );
MESSAGE_FUNC_PTR( OnItemAddToCart, "ItemAddToCart", panel );
MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", data );
MESSAGE_FUNC_PARAMS( OnPreviewItem, "PreviewItem", data );
virtual const char *GetPageResFile();
virtual CStorePreviewItemPanel *CreatePreviewPanel( void );
protected:
// Filtering
virtual bool DoesEntryFilterPassSecondaryFilter( const econ_store_entry_t *pEntry ) { return true; } // Allow derived classes to add an additional
virtual void UpdateFilteredItems( void );
virtual int GetNumPrimaryFilters( void ) { return 1; } // All Items
void SetFilter( int iFilter );
virtual void UpdateFilterComboBox( void );
virtual void GetFiltersForDef( GameItemDefinition_t *pDef, CUtlVector<int> *pVecFilters ) { pVecFilters->AddToTail( FILTER_ALL_ITEMS ); }
static int ItemDisplayOrderSort_UseSortOverride( const econ_store_entry_t *const *ppA, const econ_store_entry_t *const *ppB );
virtual void OrderItemsForDisplay( CUtlVector<const econ_store_entry_t *>& vecItems ) const;
protected:
void CreateItemPanels( void );
void DeSelectAllItemPanels( void );
void ToggleSelectItemPanel( CItemModelPanel *pPanel );
void SelectItemPanel( CItemModelPanel *pPanel );
void UpdateBackpackLabel( void );
bool IsHomePage( void ) { return m_pPageData && m_pPageData->m_bIsHome; }
protected:
const CEconStoreCategoryManager::StoreCategory_t *m_pPageData;
CStorePreviewItemPanel *m_pPreviewPanel;
const char *m_pPreviewItemResFile;
vgui::EditablePanel *m_pItemDetailsButtonPanel;
vgui::EditablePanel *m_pItemPreviewButtonPanel;
// Filtering
CUtlVector< const econ_store_entry_t* > m_FilteredEntries;
vgui::ComboBox *m_pFilterComboBox;
int m_iCurrentFilter;
// Selection info panel
int m_iSelectedItemDef;
int m_iOldSelectedItemDef;
int m_iSelectDefOnPageShow;
int m_iSelectPageOnPageShow;
CItemModelPanel *m_pSelectedPanel;
CItemModelPanel *m_pFeaturedItemPanel;
Color m_colBackpackOrg;
// Item model panels
struct item_panel
{
CItemModelPanel* m_pItemModelPanel;
CStorePricePanel* m_pStorePricePanel;
CStoreItemControlsPanel* m_pItemControlsPanel;
};
CUtlVector<item_panel> m_vecItemPanels;
CUtlVector<int> m_EntryIndices; // Easy lookup for which model panel is mapped to which entry index
CItemModelPanel *m_pMouseOverItemPanel;
CItemModelPanelToolTip *m_pMouseOverTooltip;
KeyValues *m_pItemModelPanelKVs;
KeyValues *m_pModelPanelLabelsKVs;
bool m_bReapplyItemKVs;
// Cart display
CExButton *m_pCartButton;
CUtlVector<CItemModelPanel*> m_pCartModelPanels;
KeyValues *m_pCartModelPanelKVs;
CUtlVector<CExLabel*> m_pCartQuantityLabels;
KeyValues *m_pCartQuantityLabelKVs;
vgui::ImagePanel *m_pCartFeaturedItemImage;
// Pages
int m_iCurrentPage;
vgui::Label *m_pCurPageLabel;
CExButton *m_pNextPageButton;
CExButton *m_pPrevPageButton;
CExButton *m_pCheckoutButton;
CExButton *m_pPreviewItemButton;
vgui::EditablePanel *m_pAddToCartButtonPanel;
vgui::Label *m_pBackpackLabel;
vgui::EditablePanel *m_pItemBackdropPanel;
bool m_bShouldDeletePreviewPanel; // Set to true by derived classes if the preview panel's panel should be deleted, which is necessary if its parent is NULL
CPanelAnimationVarAliasType( int, m_iItemOffcenterX, "item_offcenter_x", "0", "proportional_int" );
CPanelAnimationVarAliasType( int, m_iItemXDelta, "item_xdelta", "0", "proportional_int" );
CPanelAnimationVarAliasType( int, m_iItemYDelta, "item_ydelta", "0", "proportional_int" );
CPanelAnimationVarAliasType( int, m_iItemXPos, "item_xpos", "0", "proportional_int" );
CPanelAnimationVarAliasType( int, m_iItemYPos, "item_ypos", "0", "proportional_int" );
CPanelAnimationVar( int, m_iItemPanels, "item_panels", "35" );
CPanelAnimationVar( int, m_iItemColumns, "item_columns", "7" );
CPanelAnimationVar( bool, m_bShowItemBgPanel, "show_item_backdrop", "0" );
CPanelAnimationVarAliasType( int, m_iItemBackdropLeftMargin, "item_backdrop_left_margin", "20", "proportional_xpos" );
CPanelAnimationVarAliasType( int, m_iItemBackdropRightMargin, "item_backdrop_right_margin", "20", "proportional_xpos" );
CPanelAnimationVarAliasType( int, m_iItemBackdropTopMargin, "item_backdrop_top_margin", "20", "proportional_ypos" );
CPanelAnimationVarAliasType( int, m_iItemBackdropBottomMargin, "item_backdrop_bottom_margin", "20", "proportional_ypos" );
CPanelAnimationVar( int, m_iItemBackdropPaintBackgroundType, "item_backdrop_paintbackgroundtype", "50" );
CPanelAnimationVar( int, m_iItemBackdropZPos, "item_backdrop_zpos", "0" );
CPanelAnimationVarAliasType( int, m_iItemControlsXOffset, "item_controls_xoffset", "5", "proportional_xpos" );
CPanelAnimationVarAliasType( int, m_iItemControlsYOffset, "item_controls_yoffset", "5", "proportional_xpos" );
CPanelAnimationVar( int, m_iMaxCartModelPanels, "max_cart_model_panels", "10" );
Color m_colItemPanelBG;
Color m_colItemPanelBGMouseover;
Color m_colItemPanelBGSelected;
Color m_colItemBackdropPanel;
// The number of items in each filter options
CUtlVector<int> m_vecFilterCounts;
bool m_bFilterDirty;
};
void AddItemToCartHelper( const char *pszContext, const econ_store_entry_t *pEntry, ECartItemType eSelectedCartItemType );
void AddItemToCartHelper( const char *pszContext, item_definition_index_t unItemDef, ECartItemType eSelectedCartItemType );
#endif // STORE_PAGE_H
@@ -0,0 +1,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 );
}
@@ -0,0 +1,49 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef STORE_PAGE_SPECIALPROMO_H
#define STORE_PAGE_SPECIALPROMO_H
#ifdef _WIN32
#pragma once
#endif
#include "store/v1/tf_store_page.h"
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CTFStorePage_SpecialPromo : public CTFStorePage1
{
DECLARE_CLASS_SIMPLE( CTFStorePage_SpecialPromo, CTFStorePage1 );
public:
CTFStorePage_SpecialPromo( Panel *parent, const CEconStoreCategoryManager::StoreCategory_t *pPageData );
virtual const char* GetPageResFile() { return pszResFile; }
protected:
// virtual void OrderItemsForDisplay( CUtlVector<const econ_store_entry_t *>& vecItems ) const;
private:
const char* pszResFile;
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CTFStorePage_Popular : public CTFStorePage1
{
DECLARE_CLASS_SIMPLE( CTFStorePage_Popular, CTFStorePage1 );
public:
CTFStorePage_Popular( Panel *parent, const CEconStoreCategoryManager::StoreCategory_t *pPageData );
protected:
virtual void UpdateFilteredItems( void );
};
#endif // STORE_PAGE_SPECIALPROMO_H
+232
View File
@@ -0,0 +1,232 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
#include "store_page_new.h"
#include "vgui/ISurface.h"
#include "vgui/IInput.h"
#include "vgui/ILocalize.h"
#include "gamestringpool.h"
#include "econ_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"
// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>
using namespace vgui;
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CStorePricePanel_New::CStorePricePanel_New( vgui::Panel *pParent, const char *pPanelName )
: CStorePricePanel( pParent, pPanelName )
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePricePanel_New::SetItem( const econ_store_entry_t *pEntry )
{
BaseClass::SetItem( pEntry );
CExLabel *pNew = dynamic_cast< CExLabel* >( FindChildByName( "New" ) );
if ( pNew )
{
pNew->SetVisible( false );
}
pNew = dynamic_cast< CExLabel* >( FindChildByName( "NewLarge" ) );
if ( pNew )
{
int contentWidth, contentHeight;
pNew->GetContentSize( contentWidth, contentHeight );
int iTextInsetX, iTextInsetY;
pNew->GetTextInset( &iTextInsetX, &iTextInsetY );
pNew->SetWide( contentWidth + iTextInsetX );
int iPosX, iPosY;
pNew->GetPos( iPosX, iPosY );
pNew->SetPos( GetWide() - pNew->GetWide(), iPosY );
pNew->SetVisible( true );
}
vgui::Panel* pLimited = FindChildByName( "LimitedLarge" );
if ( pLimited )
{
int iPosX, iPosY;
pLimited->GetPos( iPosX, iPosY );
if ( pNew && pEntry->m_bLimited )
{
iPosY = pNew->GetTall() + YRES( 3 );
}
pLimited->SetPos( GetWide() - pLimited->GetWide() - XRES( 3 ), iPosY );
pLimited->SetVisible( pEntry->m_bLimited );
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CStorePricePanel_Bundles::CStorePricePanel_Bundles( vgui::Panel *pParent, const char *pPanelName )
: CStorePricePanel( pParent, pPanelName ),
m_pLimitedLarge( NULL )
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePricePanel_Bundles::SetItem( const econ_store_entry_t *pEntry )
{
BaseClass::SetItem( pEntry );
if ( m_pLimitedLarge )
{
m_pLimitedLarge->SetVisible( pEntry->m_bLimited );
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePricePanel_Bundles::ApplySchemeSettings( IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
m_pLimitedLarge = dynamic_cast<ImagePanel *>( FindChildByName( "LimitedLarge" ) );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePricePanel_Bundles::PerformLayout()
{
BaseClass::PerformLayout();
if ( m_pLimitedLarge )
{
int aPos[2];
m_pLimitedLarge->GetPos( aPos[0], aPos[1] );
if ( m_pNew && m_pNew->IsVisible() )
{
aPos[1] = m_pNew->GetTall() + YRES( 3 );
}
m_pLimitedLarge->SetPos( GetWide() - m_pLimitedLarge->GetWide(), aPos[1] );
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CStorePricePanel_Jumbo::CStorePricePanel_Jumbo( vgui::Panel *pParent, const char *pPanelName )
: CStorePricePanel( pParent, pPanelName )
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CStorePricePanel_Popular::CStorePricePanel_Popular( vgui::Panel *pParent, const char *pPanelName, int iPopularityRank )
: CStorePricePanel( pParent, pPanelName )
, m_iPopularityRank( iPopularityRank )
{
m_pNewLarge = NULL;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePricePanel_Popular::ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
m_pNewLarge = dynamic_cast< CExLabel* >( FindChildByName( "NewLarge" ) );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePricePanel_Popular::PerformLayout()
{
BaseClass::PerformLayout();
if ( m_pNewLarge )
{
int contentWidth, contentHeight;
m_pNewLarge->GetContentSize( contentWidth, contentHeight );
int iTextInsetX, iTextInsetY;
m_pNewLarge->GetTextInset( &iTextInsetX, &iTextInsetY );
m_pNewLarge->SetWide( contentWidth + iTextInsetX );
int iPosX, iPosY;
m_pNewLarge->GetPos( iPosX, iPosY );
m_pNewLarge->SetPos( GetWide() - m_pNewLarge->GetWide(), iPosY );
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePricePanel_Popular::SetItem( const econ_store_entry_t *pEntry )
{
BaseClass::SetItem( pEntry );
CExLabel *pNew = dynamic_cast< CExLabel* >( FindChildByName( "New" ) );
if ( pNew )
{
pNew->SetVisible( false );
}
if ( m_pNewLarge )
{
if ( pEntry->m_bNew )
{
m_pNewLarge->SetVisible( true );
}
else
{
m_pNewLarge->SetVisible( false );
}
}
vgui::Panel* pLimited = FindChildByName( "LimitedLarge" );
if ( pLimited && m_pNewLarge )
{
int iPosX, iPosY;
pLimited->GetPos( iPosX, iPosY );
if ( pEntry->m_bLimited && pEntry->m_bNew )
{
iPosY = m_pNewLarge->GetTall() + YRES( 3 );
}
pLimited->SetPos( GetWide() - m_pNewLarge->GetWide() - 14, iPosY );
pLimited->SetVisible( pEntry->m_bLimited );
}
wchar_t wszRank[10];
_snwprintf( wszRank, ARRAYSIZE( wszRank ), L"%d", m_iPopularityRank );
wchar_t wszText[8];
g_pVGuiLocalize->ConstructString_safe( wszText, g_pVGuiLocalize->Find( "TF_Popularity_Rank" ), 1, wszRank );
SetDialogVariable( "rank1", wszText );
SetDialogVariable( "rank2", wszText );
// Show rank or rank2 based on old store/new store
CExLabel *pRank = dynamic_cast<CExLabel *>( FindChildByName( CFmtStr( "Rank%i", GetStoreVersion() ).Access() ) );
if ( pRank )
{
pRank->SetVisible( true );
}
}
+107
View File
@@ -0,0 +1,107 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef STORE_PAGE_NEW_H
#define STORE_PAGE_NEW_H
#ifdef _WIN32
#pragma once
#endif
#include <game/client/iviewport.h>
#include "vgui_controls/PropertyPage.h"
#include <vgui_controls/Button.h>
#include <vgui_controls/ComboBox.h>
#include <vgui_controls/ImagePanel.h>
#include "econ_controls.h"
#include "econ_store.h"
#include "item_model_panel.h"
#include "store_page.h"
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CStorePricePanel_New : public CStorePricePanel
{
public:
DECLARE_CLASS_SIMPLE( CStorePricePanel_New, CStorePricePanel );
CStorePricePanel_New( vgui::Panel *pParent, const char *pPanelName );
virtual const char *GetPanelResFile()
{
return "Resource/UI/econ/store/v1/StorePrice_New.res";
}
virtual void SetItem( const econ_store_entry_t *pEntry );
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CStorePricePanel_Bundles : public CStorePricePanel
{
public:
DECLARE_CLASS_SIMPLE( CStorePricePanel_Bundles, CStorePricePanel );
CStorePricePanel_Bundles( vgui::Panel *pParent, const char *pPanelName );
virtual const char *GetPanelResFile()
{
return "Resource/UI/econ/store/v1/StorePrice_Bundles.res";
}
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void PerformLayout();
virtual void SetItem( const econ_store_entry_t *pEntry );
private:
vgui::ImagePanel *m_pLimitedLarge;
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CStorePricePanel_Jumbo : public CStorePricePanel
{
public:
DECLARE_CLASS_SIMPLE( CStorePricePanel_Jumbo, CStorePricePanel );
CStorePricePanel_Jumbo( vgui::Panel *pParent, const char *pPanelName );
virtual const char *GetPanelResFile()
{
return "Resource/UI/econ/store/v1/StorePrice_Jumbo.res";
}
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CStorePricePanel_Popular : public CStorePricePanel
{
public:
DECLARE_CLASS_SIMPLE( CStorePricePanel_Popular, CStorePricePanel );
CStorePricePanel_Popular( vgui::Panel *pParent, const char *pPanelName, int iPopularityRank );
virtual const char *GetPanelResFile()
{
return "Resource/UI/econ/store/v1/StorePrice_Popular.res";
}
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void PerformLayout();
virtual void SetItem( const econ_store_entry_t *pEntry );
private:
int m_iPopularityRank;
CExLabel *m_pNewLarge;
};
#endif // STORE_PAGE_NEW_H
File diff suppressed because it is too large Load Diff
+236
View File
@@ -0,0 +1,236 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef STORE_PANEL_H
#define STORE_PANEL_H
#ifdef _WIN32
#pragma once
#endif
#include "vgui_controls/PropertyDialog.h"
#include "econ_ui.h"
#include "GameEventListener.h"
#include "store_page.h"
#include "econ_store.h"
#include "econ_gcmessages.h"
#include "steam/isteamuser.h"
#define MAX_CART_ITEMS 256
#define STOREPANEL_SHOW_UPGRADESTEPS -1
class CStorePage;
// An "item" in the cart.
struct cart_item_t
{
const econ_store_entry_t *pEntry;
int iQuantity;
ECartItemType eType;
item_price_t GetDisplayPrice() const;
};
//-----------------------------------------------------------------------------
// Purpose: The cart that contains items the player is purchasing
//-----------------------------------------------------------------------------
class CStoreCart
{
public:
CStoreCart( void );
void AddToCart( const econ_store_entry_t *pEntry, const char* pszPageName, ECartItemType eCartItemType );
void RemoveFromCart( int iEntryIndex );
void EmptyCart( void );
// Returns the total number of items in the cart
int GetTotalItems( void ) const;
int GetTotalConcreteItems( void ) const;
// Returns the number of different entries in the cart (ignoring quantities)
int GetNumEntries( void ) const { return m_Items.Count(); }
cart_item_t *GetItem( int iIndex ) { return ( ( GetNumEntries() > 0 ) ? &m_Items[iIndex] : NULL ); }
item_price_t GetTotalPrice( void ) const;
bool ContainsHolidayRestrictedItems() const;
bool ContainsItemDefinition( item_definition_index_t unItemDef ) const;
private:
int GetIndexForEntry( const econ_store_entry_t *pEntry, ECartItemType eCartItemType ) const;
private:
CUtlVector<cart_item_t> m_Items;
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CStorePanel : public vgui::PropertyDialog, public CGameEventListener
{
DECLARE_CLASS_SIMPLE( CStorePanel, vgui::PropertyDialog );
public:
CStorePanel( Panel *parent );
virtual ~CStorePanel();
#ifdef _DEBUG
void ReAddPage( int iPage );
#endif
// UI Layout
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void PerformLayout( void );
virtual void OnCommand( const char *command );
virtual void ShowPanel( bool bShow );
virtual void OnKeyCodeTyped(vgui::KeyCode code);
virtual void FireGameEvent( IGameEvent *event );
void SetPreventClosure( bool bPrevent ) { m_bPreventClosure = bPrevent; }
void StartAtItemDef( int iItemDef, bool bAddToCart ) { m_iStartItemDef = iItemDef; m_bAddStartItemDefToCart = bAddToCart; };
virtual void OnTick();
// Steam Interaction
STEAM_CALLBACK( CStorePanel, OnMicroTransactionAuthResponse, MicroTxnAuthorizationResponse_t, m_CallbackMicroTransactionAuthResponse );
// GC Management
static bool CheckMessageResult( EPurchaseResult msgResult );
void FinalizeTransaction( void );
virtual void PostTransactionCompleted( void ) { return; }
// Cart Management
CStoreCart *GetCart( void ) { return &m_Cart; }
void ShowStorePanel( void );
bool ShouldUpsellStamps( void );
bool HasValidUpsellStamps( void );
void UpsellStamps( void );
static void ConfirmUpsellStamps( bool bConfirmed, CSchemaItemDefHandle hItemDef, int nSecondsVisible );
void InitiateCheckout( bool bSkipUpsell );
void CheckoutCancel( void );
virtual void OnAddToCart( void ) {}
void AddToCartAndCheckoutImmediately( item_definition_index_t nDefIndex );
// Pricesheet Management
static bool IsPricesheetLoaded( void ) { return CStorePanel::m_bPricesheetLoaded; }
static bool ShouldShowWarnings( void ) { return CStorePanel::m_bShowWarnings; }
static void SetShouldShowWarnings( bool bShow ) { CStorePanel::m_bShowWarnings = bShow; }
static void RequestPricesheet( void );
const CEconStorePriceSheet *GetPriceSheet( void ) { return &m_StoreSheet; }
CEconStorePriceSheet *GetPriceSheetForEdit( void ) { return &m_StoreSheet; }
bool LoadPricesheet( KeyValuesAD* pKVPricesheet );
void SetCurrency( ECurrency in_currency );
ECurrency GetCurrency( void ) { return m_eCurrency; }
void SetCountryCode( const char* in_country );
char* GetCountryCode( void ) { return m_rgchCountry; }
const econ_store_entry_t *GetFeaturedEntry( void );
void SetMostRecentSuccessfulTransactionID( uint64 inID ) { m_unMostRecentSuccessfulTransaction = inID; }
uint64 GetMostRecentSuccessfulTransactionID() const { return m_unMostRecentSuccessfulTransaction; }
virtual void SetTransactionID( uint64 inID ) { m_unTransactionID = inID; }
uint64 GetTransactionID( void ) { return m_unTransactionID; }
int GetCheckoutAttempts() { return m_iCheckoutAttempts; }
void SetLastPurchaseAttemptPrice( int totalPrice ) { m_iLastPurchaseAttemptPrice = totalPrice; }
int GetLastPurchaseAttemptPrice() { return m_iLastPurchaseAttemptPrice; }
void ClearPopularItems( void ) { m_vPopularItems.Purge(); }
void AddPopularItem( uint32 iItemDef ) { m_vPopularItems.AddToTail(iItemDef); }
const CUtlVector<uint32>& GetPopularItems( void ) const { return m_vPopularItems; }
MESSAGE_FUNC( OnStartShopping, "StartShopping" );
MESSAGE_FUNC( OnFindAndSelectFeaturedItem, "FindAndSelectFeaturedItem" );
MESSAGE_FUNC_PARAMS( OnItemLinkClicked, "URLClicked", pParams );
MESSAGE_FUNC_PARAMS( OnJumpToItem, "JumpToItem", pParams );
MESSAGE_FUNC( DoCheckout, "DoCheckout" );
protected:
void ParseStoreKV( void );
CStorePage *AddPageFromPriceSheet( int iPage );
void FindAndSelectEntry( const econ_store_entry_t *pEntry );
const econ_store_entry_t *FindEntryForItemDef( int iItemDef ) { return m_StoreSheet.GetEntry( iItemDef ); }
virtual CStorePage *CreateStorePage( const CEconStoreCategoryManager::StoreCategory_t *pPageData );
bool ShouldShowDx8PurchaseWarning( ) const;
protected:
static void ConfirmCheckout( bool bConfirmed, void *pContext );
static bool m_bPricesheetLoaded;
static bool m_bShowWarnings;
bool m_bPreventClosure;
int m_iStartItemDef;
bool m_bAddStartItemDefToCart;
CStoreCart m_Cart;
CEconStorePriceSheet m_StoreSheet;
ECurrency m_eCurrency;
char m_rgchCountry[3]; // This will change to an enum soon.
uint64 m_unTransactionID;
uint64 m_unMostRecentSuccessfulTransaction;
bool m_bShouldFinalize;
bool m_bOGSLogging;
int m_iCheckoutAttempts;
int m_iLastPurchaseAttemptPrice;
CUtlVector<uint32> m_vPopularItems;
};
void OpenStoreStatusDialog( vgui::Panel *pParent, const char *pszText, bool bAllowClose, bool bShowOnExit, bool bCancel=false );
void CloseStoreStatusDialog( void );
//-----------------------------------------------------------------------------
// Purpose: Asynchronous job for getting the price sheet from the GC
//-----------------------------------------------------------------------------
class CGCClientJobGetUserData : public GCSDK::CGCClientJob
{
public:
CGCClientJobGetUserData( GCSDK::CGCClient *pGCClient, RTime32 rTimeVersion ) : GCSDK::CGCClientJob( pGCClient ), m_RTimeVersion( rTimeVersion ) {}
virtual bool BYieldingRunJob( void *pvStartParam );
private:
RTime32 m_RTimeVersion;
};
//-----------------------------------------------------------------------------
// Purpose: Asynchronous job for initiating a checkout from the Steam store.
//-----------------------------------------------------------------------------
class CGCClientJobInitPurchase : public GCSDK::CGCClientJob
{
public:
CGCClientJobInitPurchase( GCSDK::CGCClient *pGCClient ) : GCSDK::CGCClientJob( pGCClient ) {}
virtual bool BYieldingRunJob( void *pvStartParam );
};
//-----------------------------------------------------------------------------
// Purpose: Asynchronous job for canceling a purchase in progress.
//-----------------------------------------------------------------------------
class CGCClientJobCancelPurchase : public GCSDK::CGCClientJob
{
public:
CGCClientJobCancelPurchase( GCSDK::CGCClient *pGCClient, uint64 ulTxnID ) : GCSDK::CGCClientJob( pGCClient ), m_ulTxnID( ulTxnID ) {}
virtual bool BYieldingRunJob( void *pvStartParam );
private:
uint64 m_ulTxnID;
};
//-----------------------------------------------------------------------------
// Purpose: Asynchronous job for finalizing a purchase with the GC.
//-----------------------------------------------------------------------------
class CGCClientJobFinalizePurchase : public GCSDK::CGCClientJob
{
public:
CGCClientJobFinalizePurchase( GCSDK::CGCClient *pGCClient, uint64 ulTxnID ) : GCSDK::CGCClientJob( pGCClient ), m_ulTxnID( ulTxnID ) {}
virtual bool BYieldingRunJob( void *pvStartParam );
private:
uint64 m_ulTxnID;
};
#endif // STORE_PANEL_H
@@ -0,0 +1,418 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
#include "store_page.h"
#include "vgui/ISurface.h"
#include "vgui/IInput.h"
#include "vgui/ILocalize.h"
#include "gamestringpool.h"
#include "econ_item_inventory.h"
#include "econ_item_system.h"
#include "store_preview_item.h"
#include "item_model_panel.h"
#include "econ_ui.h"
#include "store/store_panel.h"
// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>
DECLARE_BUILD_FACTORY_DEFAULT_TEXT( CPreviewRotButton, CPreviewRotButton );
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CStorePreviewItemPanel::CStorePreviewItemPanel( vgui::Panel *pParent, const char *pResFile, const char *pPanelName, CStorePage *pOwner )
: EditablePanel( pParent, "storepreviewitem" )
{
m_pOwner = pOwner;
m_pResFile = pResFile != NULL ? pResFile : ( ShouldUseNewStore() ? "Resource/UI/econ/store/v2/StorePreviewItemPanel.res" : "Resource/UI/econ/store/v1/StorePreviewItemPanel.res" );
m_pDataTextRichText = NULL;
m_iCurrentIconPosition = 0;
m_iState = PS_ITEM;
m_pIconsMoveLeftButton = NULL;
m_pIconsMoveRightButton = NULL;
m_pItemFullImage = new CItemModelPanel( this, "PreviewItemModelPanel" );
SetDialogVariable("selectiontitle", g_pVGuiLocalize->Find("#TF_NoSelection") );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CStorePreviewItemPanel::~CStorePreviewItemPanel()
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePreviewItemPanel::ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
LoadControlSettings( m_pResFile );
// Apply attribute changes to CItemModelPanel
m_pItemFullImage->UpdatePanels();
m_pIconsMoveLeftButton = dynamic_cast<CExButton*>( FindChildByName("IconsMoveLeftButton") );
if ( m_pIconsMoveLeftButton )
{
m_pIconsMoveLeftButton->AddActionSignalTarget( this );
}
m_pIconsMoveRightButton = dynamic_cast<CExButton*>( FindChildByName("IconsMoveRightButton") );
if ( m_pIconsMoveRightButton )
{
m_pIconsMoveRightButton->AddActionSignalTarget( this );
}
m_pDataTextRichText = dynamic_cast<CEconItemDetailsRichText*>( FindChildByName( "DetailsRichText" ) );
if ( m_pDataTextRichText )
{
m_pDataTextRichText->SetURLClickedHandler( EconUI()->GetStorePanel() );
m_pDataTextRichText->AllowItemSetLinks( true );
}
// Then find all our item icons
m_pItemIcons.Purge();
CStorePreviewItemIcon *pItemIcon = NULL;
int iIcon = 1;
do
{
pItemIcon = dynamic_cast<CStorePreviewItemIcon*>( FindChildByName( VarArgs("ItemIcon%d",iIcon)) );
if ( pItemIcon )
{
m_pItemIcons.AddToTail( pItemIcon );
if ( m_pOwner )
{
pItemIcon->GetItemPanel()->SetTooltip( m_pOwner->GetItemTooltip(), "" );
}
}
iIcon++;
} while ( pItemIcon );
// Update our item icons. Hide them all first. The code below will unhide ones used.
for ( int i = 0; i < m_pItemIcons.Count(); i++ )
{
m_pItemIcons[i]->SetVisible( false );
}
// Start with the item itself showing
SetState( PS_ITEM );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePreviewItemPanel::PerformLayout( void )
{
BaseClass::PerformLayout();
// center the icons
int iNumItemIcons = 0;
FOR_EACH_VEC( m_pItemIcons, i )
{
if ( m_pItemIcons[i]->IsVisible() )
{
++iNumItemIcons;
}
}
if ( iNumItemIcons )
{
int iCenterX = GetWide() / 2;
int interval = XRES(2);
int totalWidth = (iNumItemIcons * m_pItemIcons[0]->GetWide()) + (interval * (iNumItemIcons - 1));
int iX = iCenterX - ( totalWidth / 2 );
int posX, posY;
m_pItemIcons[0]->GetPos( posX, posY );
int iButton = 0;
for ( int i = 0; i < m_pItemIcons.Count(); i++ )
{
if ( m_pItemIcons[i]->IsVisible() )
{
m_pItemIcons[i]->SetPos( iX, posY );
iX += m_pItemIcons[i]->GetWide() + interval;
iButton++;
}
}
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePreviewItemPanel::OnCommand( const char *command )
{
if ( !Q_strnicmp( command, "close", 5 ) )
{
PostActionSignal(new KeyValues("HidePreview"));
SetVisible( false );
return;
}
else if ( !Q_stricmp( command, "icons_left" ) )
{
m_iCurrentIconPosition = MAX( m_iCurrentIconPosition - 1, 0 );
UpdateIcons();
}
else if ( !Q_stricmp( command, "icons_right" ) )
{
// It's only visible if we can still move right.
m_iCurrentIconPosition++;
UpdateIcons();
}
else
{
engine->ClientCmd( const_cast<char *>( command ) );
}
BaseClass::OnCommand( command );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePreviewItemPanel::OnRotButtonDown( KeyValues *data )
{
int iRotDelta = data->GetInt( "rot", 0 );
m_iCurrentRotation = iRotDelta;
vgui::ivgui()->AddTickSignal( GetVPanel(), 33 );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePreviewItemPanel::OnRotButtonUp( void )
{
m_iCurrentRotation = 0;
vgui::ivgui()->RemoveTickSignal( GetVPanel() );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePreviewItemPanel::PreviewItem( int iClass, CEconItemView *pItem, const econ_store_entry_t* pEntry /*= NULL*/ )
{
m_iCurrentIconPosition = 0;
m_item = *pItem;
if ( m_item.IsValid() )
{
m_pItemFullImage->SetItem( &m_item );
if ( m_pDataTextRichText )
{
m_pDataTextRichText->SetLimitedItem( pEntry && pEntry->m_bLimited );
m_pDataTextRichText->UpdateDetailsForItem( m_item.GetItemDefinition() );
}
SetDialogVariable("selectiontitle", m_item.GetItemName() );
CExButton *pButton = dynamic_cast<CExButton*>( FindChildByName( "AddToCartButton" ) );
if ( pButton )
{
const CEconStorePriceSheet *pPriceSheet = EconUI()->GetStorePanel()->GetPriceSheet();
if ( pPriceSheet )
{
const econ_store_entry_t *pStoreEntry = pPriceSheet->GetEntry( pItem->GetItemDefIndex() );
if ( pStoreEntry->m_bIsMarketItem )
{
SetDialogVariable( "storeaddtocart", g_pVGuiLocalize->Find( "#Store_ViewMarket" ) );
}
else
{
SetDialogVariable( "storeaddtocart", g_pVGuiLocalize->Find( "#Store_AddToCart" ) );
}
}
}
}
InvalidateLayout();
UpdateIcons();
if ( m_iState == PS_PLAYER )
{
SetState( PS_ITEM );
}
Panel *pAddToCart = FindChildByName( "AddToCartButton" );
if ( pAddToCart )
{
pAddToCart->RequestFocus();
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePreviewItemPanel::SetState( preview_state_t iState )
{
// Only reset the position when moving from to items/details
if ( iState == PS_DETAILS || iState == PS_ITEM )
{
m_iCurrentIconPosition = 0;
}
m_iState = iState;
if ( m_pDataTextRichText )
{
m_pDataTextRichText->SetVisible( m_iState == PS_DETAILS );
}
m_pItemFullImage->SetVisible( m_iState == PS_ITEM );
UpdateIcons();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePreviewItemPanel::UpdateIcons( void )
{
bool bAdditionalIcons = false;
// Do the item icons first
if ( m_iState == PS_DETAILS )
{
// Show as many of the items in the bundle as possible
const CEconItemDefinition *pItemData = m_item.GetItemDefinition();
if ( pItemData )
{
const bundleinfo_t *pBundleInfo = pItemData->GetBundleInfo();
if ( pBundleInfo )
{
FOR_EACH_VEC( m_pItemIcons, i )
{
// If we haven't scrolled, the first item is the bundle itself
if ( m_iCurrentIconPosition == 0 && i == 0 )
{
m_pItemIcons[0]->SetItem( 0, &m_item );
continue;
}
int iItemPos = (i - 1 + m_iCurrentIconPosition);
if ( pBundleInfo->vecItemDefs.Count() > iItemPos && pBundleInfo->vecItemDefs[iItemPos] )
{
m_pItemIcons[i]->SetItem( i, pBundleInfo->vecItemDefs[iItemPos]->GetDefinitionIndex() );
m_pItemIcons[i]->SetVisible( true );
}
else
{
m_pItemIcons[i]->SetVisible( false );
}
}
bAdditionalIcons = (m_iCurrentIconPosition + m_pItemIcons.Count()) <= pBundleInfo->vecItemDefs.Count();
}
else if ( m_pItemIcons.Count() > 0 )
{
m_pItemIcons[0]->SetVisible( true );
m_pItemIcons[0]->SetItem( 0, &m_item );
FOR_EACH_VEC( m_pItemIcons, i )
{
if ( i != 0 )
{
m_pItemIcons[i]->SetVisible( false );
}
}
}
}
}
else
{
// Hide all item icons first (but not the first if we haven't scrolled)
FOR_EACH_VEC( m_pItemIcons, i )
{
m_pItemIcons[i]->SetVisible( m_iCurrentIconPosition == 0 && i == 0 );
}
// First icon is always the store entry (item/bundle), if we haven't scrolled right
if ( m_iCurrentIconPosition == 0 && m_pItemIcons.Count() )
{
m_pItemIcons[0]->SetItem( 0, &m_item );
}
}
if( m_pIconsMoveLeftButton )
m_pIconsMoveLeftButton->SetVisible( (m_iCurrentIconPosition > 0) );
if( m_pIconsMoveRightButton )
m_pIconsMoveRightButton->SetVisible( bAdditionalIcons );
InvalidateLayout();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePreviewItemPanel::OnTick( void )
{
BaseClass::OnTick();
if ( !IsVisible() )
{
vgui::ivgui()->RemoveTickSignal( GetVPanel() );
return;
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStorePreviewItemPanel::OnItemIconSelected( KeyValues *data )
{
if ( m_iState == PS_DETAILS )
{
int iIcon = data->GetInt( "icon", 0 );
CEconItemView *pItem = m_pItemIcons[iIcon]->GetItemPanel()->GetItem();
if ( pItem )
{
if ( m_pDataTextRichText )
{
m_pDataTextRichText->UpdateDetailsForItem( pItem->GetStaticData() );
}
SetDialogVariable("selectiontitle", pItem->GetItemName() );
}
}
else
{
SetState( PS_ITEM );
}
}
//================================================================================================================
// PREVIEW ROT BUTTON
//================================================================================================================
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPreviewRotButton::OnMousePressed(vgui::MouseCode code)
{
BaseClass::OnMousePressed( code );
if ( IsSelected() )
{
KeyValues *pCommand = GetCommand();
PostActionSignal(new KeyValues("RotButtonDown", "rot", pCommand->GetString("command", "0") ));
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPreviewRotButton::OnMouseReleased(vgui::MouseCode code)
{
if ( IsSelected() )
{
PostActionSignal(new KeyValues("RotButtonUp"));
}
BaseClass::OnMouseReleased( code );
}
+100
View File
@@ -0,0 +1,100 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef STORE_PREVIEW_ITEM_H
#define STORE_PREVIEW_ITEM_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui_controls/Panel.h>
#include "econ_controls.h"
#include "store_page.h"
enum preview_state_t
{
PS_ITEM,
PS_PLAYER,
PS_DETAILS,
};
//-----------------------------------------------------------------------------
// Purpose: Button that handles the rotation of the preview model.
//-----------------------------------------------------------------------------
class CPreviewRotButton : public CExButton
{
DECLARE_CLASS_SIMPLE( CPreviewRotButton, CExButton );
public:
CPreviewRotButton( vgui::Panel *parent, const char *name, const char *text, vgui::Panel *pActionSignalTarget = NULL, const char *cmd = NULL ) :
CExButton( parent, name, text, pActionSignalTarget, cmd )
{
}
CPreviewRotButton( vgui::Panel *parent, const char *name, const wchar_t *wszText, vgui::Panel *pActionSignalTarget = NULL, const char *cmd = NULL ) :
CExButton( parent, name, wszText, pActionSignalTarget, cmd )
{
}
virtual void OnMousePressed(vgui::MouseCode code);
virtual void OnMouseReleased(vgui::MouseCode code);
// Our fire action signal does nothing, because it's all done in mouse pressed/released
virtual void FireActionSignal( void ) { return; }
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CStorePreviewItemPanel : public vgui::EditablePanel
{
DECLARE_CLASS_SIMPLE( CStorePreviewItemPanel, vgui::EditablePanel );
public:
CStorePreviewItemPanel( vgui::Panel *pParent, const char *pResFile, const char *pPanelName, CStorePage *pOwner );
virtual ~CStorePreviewItemPanel();
CStorePage *GetOwningStorePage() { return m_pOwner; }
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void OnCommand( const char *command );
virtual void PerformLayout( void );
virtual void OnTick( void );
virtual void PreviewItem( int iClass, CEconItemView *pItem, const econ_store_entry_t* pEntry=NULL );
virtual void SetState( preview_state_t iState );
// Subclass interface.
virtual int GetPreviewTeam() const { return 0; }
MESSAGE_FUNC_PARAMS( OnRotButtonDown, "RotButtonDown", data );
MESSAGE_FUNC( OnRotButtonUp, "RotButtonUp" );
MESSAGE_FUNC_PARAMS( OnItemIconSelected, "ItemIconSelected", data );
protected:
virtual void UpdateIcons( void );
protected:
const char *m_pResFile;
CUtlVector<CStorePreviewItemIcon*> m_pItemIcons;
int m_iCurrentIconPosition;
CEconItemDetailsRichText *m_pDataTextRichText;
CItemModelPanel *m_pItemFullImage;
CEconItemView m_item;
preview_state_t m_iState;
int m_iCurrentRotation;
CExButton *m_pIconsMoveLeftButton;
CExButton *m_pIconsMoveRightButton;
CStorePage *m_pOwner;
};
#endif // STORE_PREVIEW_ITEM_H
+387
View File
@@ -0,0 +1,387 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
#include "store_viewcart.h"
#include "vgui/IInput.h"
#include "baseviewport.h"
#include "iclientmode.h"
#include "ienginevgui.h"
#include "econ_item_inventory.h"
#include <vgui/ILocalize.h>
#include "econ_item_system.h"
#include "item_model_panel.h"
#include "vgui_controls/ScrollBarSlider.h"
// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>
DECLARE_BUILD_FACTORY( CCartViewItemEntry );
//-----------------------------------------------------------------------------
// Purpose: Basic help dialog
//-----------------------------------------------------------------------------
CStoreViewCartPanel::CStoreViewCartPanel( Panel *parent ) : Frame(parent, "store_viewcart_panel")
{
// Store is parented to the game UI panel
vgui::VPANEL gameuiPanel = enginevgui->GetPanel( PANEL_GAMEUIDLL );
SetParent( gameuiPanel );
// We don't want the gameui to delete us, or things get messy
SetAutoDelete( false );
SetMoveable( false );
SetSizeable( false );
vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFileEx( enginevgui->GetPanel( PANEL_CLIENTDLL ), "resource/ClientScheme.res", "ClientScheme");
SetScheme(scheme);
SetProportional( true );
ListenForGameEvent( "gameui_hidden" );
ListenForGameEvent( "cart_updated" );
m_pItemEntryKVs = NULL;
m_pClientArea = new EditablePanel(this, "ClientArea");
m_pItemListContainer = new vgui::EditablePanel( this, "ItemListContainer" );
m_pItemListContainerScroller = new vgui::ScrollableEditablePanel( m_pClientArea, m_pItemListContainer, "ItemListContainerScroller" );
m_pPurchaseFooter = new EditablePanel(m_pItemListContainer, "PurchaseFooter");
m_pEmptyCartLabel = NULL;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CStoreViewCartPanel::~CStoreViewCartPanel()
{
if ( m_pItemEntryKVs )
{
m_pItemEntryKVs->deleteThis();
m_pItemEntryKVs = NULL;
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStoreViewCartPanel::ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
LoadControlSettings( ShouldUseNewStore() ? "Resource/UI/econ/store/v2/StoreViewCartPanel.res" : "Resource/UI/econ/store/v1/StoreViewCartPanel.res" );
m_bReapplyItemKVs = true;
m_pItemListContainerScroller->GetScrollbar()->SetAutohideButtons( true );
m_pEmptyCartLabel = dynamic_cast<vgui::Label*>( m_pClientArea->FindChildByName("EmptyCartLabel") );
m_pFeaturedItemImage = dynamic_cast<vgui::ImagePanel*>( m_pItemListContainer->FindChildByName("FeaturedItemSymbol") );
if ( m_pFeaturedItemImage )
{
m_pFeaturedItemImage->SetMouseInputEnabled( false );
m_pFeaturedItemImage->SetKeyBoardInputEnabled( false );
}
CExButton *pCheckoutButton = dynamic_cast<CExButton*>( m_pClientArea->FindChildByName("CheckoutButton") );
if ( pCheckoutButton )
{
pCheckoutButton->AddActionSignalTarget( this );
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStoreViewCartPanel::ApplySettings( KeyValues *inResourceData )
{
BaseClass::ApplySettings( inResourceData );
KeyValues *pItemKV = inResourceData->FindKey( "item_entry_kv" );
if ( pItemKV )
{
if ( m_pItemEntryKVs )
{
m_pItemEntryKVs->deleteThis();
}
m_pItemEntryKVs = new KeyValues("item_entry_kv");
pItemKV->CopySubkeys( m_pItemEntryKVs );
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStoreViewCartPanel::PerformLayout( void )
{
if ( GetVParent() )
{
int w,h;
vgui::ipanel()->GetSize( GetVParent(), w, h );
SetBounds(0,0,w,h);
}
if ( m_bReapplyItemKVs )
{
m_bReapplyItemKVs = false;
if ( m_pItemEntryKVs )
{
FOR_EACH_VEC( m_pItemEntries, i )
{
m_pItemEntries[i]->ApplySettings( m_pItemEntryKVs );
m_pItemEntries[i]->InvalidateLayout();
}
}
}
BaseClass::PerformLayout();
if ( m_pItemEntries.Count() )
{
int iTall = m_pItemEntries[0]->GetTall();
m_pItemListContainer->SetSize( m_pItemListContainer->GetWide(), (iTall * m_pItemEntries.Count()) + m_pPurchaseFooter->GetTall() );
m_pItemListContainerScroller->InvalidateLayout( true );
m_pItemListContainerScroller->GetScrollbar()->InvalidateLayout( true );
int iX,iY;
m_pItemEntries[0]->GetPos( iX, iY );
FOR_EACH_VEC( m_pItemEntries, i )
{
iY = (iTall * i);
m_pItemEntries[i]->SetPos( iX, iY );
}
m_pPurchaseFooter->SetVisible( true );
m_pPurchaseFooter->SetPos( 0, iTall * m_pItemEntries.Count() );
}
else
{
m_pItemListContainer->SetSize( m_pItemListContainer->GetWide(), 100 );
m_pItemListContainer->InvalidateLayout( true );
m_pItemListContainerScroller->InvalidateLayout( true );
m_pPurchaseFooter->SetVisible( false );
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStoreViewCartPanel::ShowPanel(bool bShow)
{
if ( bShow )
{
InvalidateLayout( false, true );
Activate();
CExButton *pCloseButton = dynamic_cast<CExButton*>( FindChildByName("CloseButton") );
if ( pCloseButton )
{
pCloseButton->RequestFocus();
}
// don't display the WA sales tax outside of the US
vgui::Panel *pPanel = FindChildByName( "WashingtonStateSalesTaxLabel", true );
if ( pPanel )
{
pPanel->SetVisible( FStrEq( EconUI()->GetStorePanel()->GetCountryCode(), "US" ) == true );
}
}
SetVisible( bShow );
if ( bShow )
{
UpdateCartItemList();
m_pItemListContainerScroller->GetScrollbar()->SetValue( 0 );
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStoreViewCartPanel::FireGameEvent( IGameEvent *event )
{
const char * type = event->GetName();
if ( Q_strcmp(type, "gameui_hidden") == 0 )
{
ShowPanel( false );
}
else if ( Q_strcmp(type, "cart_updated") == 0 )
{
UpdateCartItemList();
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStoreViewCartPanel::UpdateCartItemList( void )
{
CStoreCart *pCart = EconUI()->GetStorePanel()->GetCart();
int iNumEntriesInCart = pCart->GetNumEntries();
// Update the item count
wchar_t wszCount[16];
_snwprintf( wszCount, ARRAYSIZE( wszCount ), L"%d", pCart->GetTotalItems() );
wchar_t wzLocalized[32];
g_pVGuiLocalize->ConstructString_safe( wzLocalized, g_pVGuiLocalize->Find( "#Store_CartItems" ), 1, wszCount );
m_pClientArea->SetDialogVariable("storecart", wzLocalized );
// Create / Update all the item entries
if ( m_pItemEntries.Count() < iNumEntriesInCart )
{
for ( int i = m_pItemEntries.Count(); i < iNumEntriesInCart; i++ )
{
CCartViewItemEntry *pPanel = vgui::SETUP_PANEL( new CCartViewItemEntry( m_pItemListContainer, VarArgs("itementry%d", i) ) );
pPanel->ApplySettings( m_pItemEntryKVs );
m_pItemEntries.AddToTail( pPanel );
}
}
else
{
for ( int i = m_pItemEntries.Count()-1; i >= iNumEntriesInCart; i-- )
{
m_pItemEntries[i]->MarkForDeletion();
m_pItemEntries.Remove( i );
}
}
if ( m_pEmptyCartLabel )
{
m_pEmptyCartLabel->SetVisible( iNumEntriesInCart == 0 );
}
InvalidateLayout( true );
if ( !iNumEntriesInCart )
return;
bool bFeaturedImagePanelVisible = false;
// Set all the entries up
FOR_EACH_VEC( m_pItemEntries, i )
{
if ( i >= iNumEntriesInCart )
{
m_pItemEntries[i]->SetVisible( false );
continue;
}
cart_item_t *pCartItem = pCart->GetItem(i);
m_pItemEntries[i]->SetEntry( pCartItem, i );
m_pItemEntries[i]->SetVisible( true );
// If we're the featured item, show it
if ( pCartItem && pCartItem->pEntry == EconUI()->GetStorePanel()->GetFeaturedEntry() )
{
bFeaturedImagePanelVisible = true;
int iX, iY;
m_pItemEntries[i]->GetPos( iX, iY );
m_pFeaturedItemImage->SetPos( iX, iY + m_pItemEntries[i]->GetTall() - m_pFeaturedItemImage->GetTall() );
}
}
if ( m_pFeaturedItemImage->IsVisible() != bFeaturedImagePanelVisible )
{
m_pFeaturedItemImage->SetVisible( bFeaturedImagePanelVisible );
}
// Update total price
item_price_t unTotalPrice = pCart->GetTotalPrice();
wchar_t wzLocalizedPrice[ kLocalizedPriceSizeInChararacters ];
MakeMoneyString( wzLocalizedPrice, ARRAYSIZE( wzLocalizedPrice ), unTotalPrice, EconUI()->GetStorePanel()->GetCurrency() );
m_pPurchaseFooter->SetDialogVariable( "totalprice", wzLocalizedPrice );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CStoreViewCartPanel::OnCommand( const char *command )
{
if ( !Q_stricmp( command, "close" ) )
{
ShowPanel( false );
}
else if ( !Q_strnicmp( command, "remove", 6 ) )
{
int iIndex = atoi(command+6);
if ( iIndex >= 0 && iIndex < m_pItemEntries.Count() )
{
CStoreCart *pCart = EconUI()->GetStorePanel()->GetCart();
pCart->RemoveFromCart( iIndex );
}
return;
}
else if ( !Q_stricmp( command, "checkout" ) )
{
EconUI()->GetStorePanel()->InitiateCheckout( false );
}
else
{
engine->ClientCmd( const_cast<char *>( command ) );
}
BaseClass::OnCommand( command );
}
static vgui::DHANDLE<CStoreViewCartPanel> g_StoreViewCartPanel;
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CStoreViewCartPanel *OpenStoreViewCartPanel( void )
{
if (!g_StoreViewCartPanel.Get())
{
g_StoreViewCartPanel = vgui::SETUP_PANEL( new CStoreViewCartPanel( NULL ) );
g_StoreViewCartPanel->InvalidateLayout( false, true );
}
engine->ClientCmd_Unrestricted( "gameui_activate" );
g_StoreViewCartPanel->ShowPanel( true );
return g_StoreViewCartPanel;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CStoreViewCartPanel *GetStoreViewCartPanel( void )
{
return g_StoreViewCartPanel.Get();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CCartViewItemEntry::SetEntry( cart_item_t *pEntry, int iEntryIndex )
{
m_pEntry = pEntry;
SetDialogVariable( "quantity", pEntry->iQuantity );
int iSubTotal = pEntry->GetDisplayPrice();
wchar_t wzLocalizedPrice[ kLocalizedPriceSizeInChararacters ];
MakeMoneyString( wzLocalizedPrice, ARRAYSIZE( wzLocalizedPrice ), iSubTotal, EconUI()->GetStorePanel()->GetCurrency() );
SetDialogVariable("price", wzLocalizedPrice );
CItemModelPanel *pItemPanel = dynamic_cast<CItemModelPanel*>( FindChildByName("itempanel") );
if ( pItemPanel )
{
CEconItemView ItemData;
ItemData.Init( pEntry->pEntry->GetItemDefinitionIndex(), AE_UNIQUE, AE_USE_SCRIPT_VALUE, true );
pItemPanel->SetItem( &ItemData );
}
CExButton *pRemoveButton = dynamic_cast<CExButton*>( FindChildByName("RemoveButton") );
if ( pRemoveButton )
{
pRemoveButton->SetCommand( VarArgs("remove%d",iEntryIndex) );
pRemoveButton->AddActionSignalTarget( GetStoreViewCartPanel() );
}
}
+75
View File
@@ -0,0 +1,75 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef STORE_VIEWCART_H
#define STORE_VIEWCART_H
#ifdef _WIN32
#pragma once
#endif
#include "vgui_controls/Frame.h"
#include "vgui_controls/ScrollableEditablePanel.h"
#include "GameEventListener.h"
#include "store/store_panel.h"
//-----------------------------------------------------------------------------
// Purpose: Shows a single item in the cart
//-----------------------------------------------------------------------------
class CCartViewItemEntry : public vgui::EditablePanel
{
DECLARE_CLASS_SIMPLE( CCartViewItemEntry, vgui::EditablePanel );
public:
CCartViewItemEntry( vgui::Panel *parent, const char *name ) : vgui::EditablePanel(parent,name)
{
m_pEntry = NULL;
}
void SetEntry( cart_item_t *pEntry, int iEntryIndex );
cart_item_t *GetEntry( void ) { return m_pEntry; }
private:
cart_item_t *m_pEntry;
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CStoreViewCartPanel : public vgui::Frame, public CGameEventListener
{
DECLARE_CLASS_SIMPLE( CStoreViewCartPanel, vgui::Frame );
public:
CStoreViewCartPanel( Panel *parent );
virtual ~CStoreViewCartPanel();
virtual void ApplySettings( KeyValues *inResourceData );
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 );
void UpdateCartItemList( void );
private:
vgui::EditablePanel *m_pClientArea;
vgui::EditablePanel *m_pPurchaseFooter;
KeyValues *m_pItemEntryKVs;
bool m_bReapplyItemKVs;
vgui::Label *m_pEmptyCartLabel;
vgui::ImagePanel *m_pFeaturedItemImage;
vgui::EditablePanel *m_pItemListContainer;
vgui::ScrollableEditablePanel *m_pItemListContainerScroller;
CUtlVector<CCartViewItemEntry*> m_pItemEntries;
CPanelAnimationVar( int, m_iSheetInsetBottom, "sheetinset_bottom", "32" );
};
CStoreViewCartPanel *OpenStoreViewCartPanel( void );
CStoreViewCartPanel *GetStoreViewCartPanel( void );
#endif // STORE_VIEWCART_H