Merge 9519047948 into 7191ecc418
This commit is contained in:
commit
cc965e902c
|
|
@ -686,6 +686,14 @@ void CClassLoadoutPanel::OnKeyCodePressed( vgui::KeyCode code )
|
|||
OnCommand( VarArgs("change%d", nSelected ) );
|
||||
}
|
||||
}
|
||||
else if ( nButtonCode == KEY_XBUTTON_X || nButtonCode == STEAMCONTROLLER_X )
|
||||
{
|
||||
int nSelected = GetFirstSelectedItemIndex( true );
|
||||
if( nSelected != -1 )
|
||||
{
|
||||
OnCommand( VarArgs("preview%d", nSelected ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseClass::OnKeyCodePressed( code );
|
||||
|
|
@ -930,6 +938,23 @@ void CClassLoadoutPanel::OnItemPanelMouseReleased( vgui::Panel *panel )
|
|||
}
|
||||
}
|
||||
|
||||
void CClassLoadoutPanel::OnItemPanelMouseRightRelease( vgui::Panel *panel )
|
||||
{
|
||||
CItemModelPanel *pItemPanel = dynamic_cast < CItemModelPanel * > ( panel );
|
||||
|
||||
if ( pItemPanel && IsVisible() )
|
||||
{
|
||||
for ( int i = 0; i < m_pItemModelPanels.Count(); i++ )
|
||||
{
|
||||
if ( m_pItemModelPanels[i] == pItemPanel )
|
||||
{
|
||||
OnCommand( VarArgs("preview%d", i) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -1215,6 +1240,22 @@ void CClassLoadoutPanel::OnCommand( const char *command )
|
|||
|
||||
return;
|
||||
}
|
||||
else if ( !V_strnicmp( command, "preview", 7 ) )
|
||||
{
|
||||
const char *pszNum = command+7;
|
||||
if ( pszNum && pszNum[0] )
|
||||
{
|
||||
int iSlot = atoi(pszNum);
|
||||
if ( iSlot >= 0 && iSlot < CLASS_LOADOUT_POSITION_COUNT && m_iCurrentClassIndex != TF_CLASS_UNDEFINED )
|
||||
{
|
||||
if ( m_iCurrentSlotIndex != iSlot )
|
||||
{
|
||||
m_iCurrentSlotIndex = iSlot;
|
||||
UpdateModelPanels();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( !V_strnicmp( command, "options", 7 ) )
|
||||
{
|
||||
const char *pszNum = command + 7;
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ public:
|
|||
CEconItemView *GetItemInSlot( int iSlot );
|
||||
|
||||
MESSAGE_FUNC_PTR( OnItemPanelMouseReleased, "ItemPanelMouseReleased", panel );
|
||||
MESSAGE_FUNC_PTR( OnItemPanelMouseRightRelease, "ItemPanelMouseRightRelease", panel );
|
||||
MESSAGE_FUNC_PARAMS( OnSelectionReturned, "SelectionReturned", data );
|
||||
MESSAGE_FUNC( OnCancelSelection, "CancelSelection" );
|
||||
MESSAGE_FUNC( OnClosing, "Closing" );
|
||||
|
|
|
|||
Loading…
Reference in New Issue