//-----------------------------------------------------------------------------
// Dismantles the object 
//-----------------------------------------------------------------------------
void CResourcePumpControlPanel::Upgrade( void )
{
	C_BaseObject *pObj = GetOwningObject();
	if (pObj)
	{
		pObj->SendClientCommand( "upgrade" );
	}
}
//-----------------------------------------------------------------------------
// Purpose: Handle clicking on the Occupy button
//-----------------------------------------------------------------------------
void CVehicleFlatbedControlPanel::GetInRam( void )
{
	C_BaseObject *pObj = GetOwningObject();
	if (pObj)
	{
		pObj->SendClientCommand( "toggle_use" );
	}
}
//-----------------------------------------------------------------------------
// Purpose: Handle clicking on the Connect/Disconnect button
//-----------------------------------------------------------------------------
void CBuffStationControlPanel::ConnectToStation( void )
{
	C_BaseObject *pObj = GetOwningObject();
	if (pObj)
	{
		pObj->SendClientCommand( "toggle_connect" );
	}
}
//-----------------------------------------------------------------------------
// Purpose: Handle ammo input to the sentrygun
//-----------------------------------------------------------------------------
void CSentrygunControlPanel::AddAmmo( void )
{
	C_BaseObject *pObj = GetOwningObject();
	if (pObj)
	{
		pObj->SendClientCommand( "addammo" );
	}
}
Пример #5
0
//-----------------------------------------------------------------------------
// Buys stuff
//-----------------------------------------------------------------------------
void CResupplyControlPanel::Buy( ResupplyBuyType_t type )
{
	C_BaseObject *pObj = GetOwningObject();
	if (pObj)
	{
		char szbuf[48];
		Q_snprintf( szbuf, sizeof( szbuf ), "buy %d", type );
		pObj->SendClientCommand( szbuf );
	}
}
void CRotationSlider::OnMouseReleased( vgui::MouseCode code )
{
    BaseClass::OnMouseReleased( code );

    if (code != vgui::MOUSE_LEFT)
        return;

    C_BaseObject *pObj = m_hObject.Get();
    if (pObj)
    {
        char szbuf[48];
        Q_snprintf( szbuf, sizeof( szbuf ), "yaw %0.2f\n",  m_flInitialYaw - m_flYaw );
        pObj->SendClientCommand( szbuf );
        pObj->ActivateYawPreview( false );
        SetValue(0);
        m_flYaw = 0;
    }
}