Flyff

源码添加可拖拽大小背包【5】

2018-5-6 09:09 | 发布者: admin

+ add in WndField.cpp
Code:
#ifdef _INVENTORY_RESIZEABLE
    saveOriginRects();
#endif // _INVENTORY_RESIZEABLE
= before
Code:
	CRect rectRoot = m_pWndRoot->GetLayoutRect();
	CRect rectWindow = GetWindowRect();
	CPoint point( rectRoot.right - rectWindow.Width(), 112 + 48 );
	Move( point );
+ add in WndField.cpp
Code:
#ifdef _INVENTORY_RESIZEABLE
    CPoint cpSizeDiff;

    cpSizeDiff.x = (cx - arOriginalSizes[0].rect.Width());
    cpSizeDiff.y = (cy - arOriginalSizes[0].rect.Height());

    m_wndItemCtrl.OnMouseWheel(0, 0, CPoint(0, 0)); // reset scrollbar

    for(size_t i = 1; i < arOriginalSizes.size(); i++)
    {
        switch(arOriginalSizes[i].type)
        {
        case STATIC:
            GetDlgItem(arOriginalSizes[i].id)->SetWndRect(getItemRect(arOriginalSizes[i].id, cpSizeDiff));
            break;

        case CUSTOM:
            GetWndCtrl(arOriginalSizes[i].id)->rect = getItemRect(arOriginalSizes[i].id, cpSizeDiff);
            break;

        case CHECKBOX:
#ifdef __SYS_280514
            m_awndCheckHide[arOriginalSizes[i].id].SetWndRect(getItemRect(arOriginalSizes[i].id, cpSizeDiff, CHECKBOX));
#endif // __SYS_280514
            break;
        }
    }

    refreshItemRects();
#endif // _INVENTORY_RESIZEABLE
= at bottom of CWndInventory::OnSize, before
Code:
    CWndNeuz::OnSize(nType, cx, cy);
}
+ modify in WndField.cpp
Code:
BOOL CWndInventory::OnSetCursor ( CWndBase* pWndBase, UINT nHitTest, UINT message )
{
    if(!SetEnchantCursor())
    {
#ifdef _INVENTORY_RESIZEABLE
        CWndNeuz::OnSetCursor(pWndBase, nHitTest, message);
#endif // _INVENTORY_RESIZEABLE
    }

	return TRUE;
}

bool CWndInventory::SetEnchantCursor()
{
    bool bRet = false;

	// Àκ¥Ã¢ÀÌ ¿*·ÁÀÖ°í ÀÎþƮ ¸ðµåÀ̸é Ä¿¼*¸ð¾ç º¯°æ
	if( m_bIsUpgradeMode )
	{
		SetMouseCursor( CUR_HAMMER );
        bRet = true;
	}
	else
	{
		SetMouseCursor( CUR_BASE );		
	}

    return bRet;
}
= replacing
Code:
BOOL CWndInventory::OnSetCursor ( CWndBase* pWndBase, UINT nHitTest, UINT message )
{
	SetEnchantCursor();

	return TRUE;
}

void CWndInventory::SetEnchantCursor()
{
	// Àκ¥Ã¢ÀÌ ¿*·ÁÀÖ°í ÀÎþƮ ¸ðµåÀ̸é Ä¿¼*¸ð¾ç º¯°æ
	if( m_bIsUpgradeMode )
	{
		SetMouseCursor( CUR_HAMMER );
	}
	else
	{
		SetMouseCursor( CUR_BASE );		
	}
}
+ add in WndField.cpp
Code:
#ifdef _INVENTORY_RESIZEABLE
    if(m_nResizeDir)
    {
        return;
    }
#endif // _INVENTORY_RESIZEABLE
= below
Code:
void CWndInventory::OnMouseMove(UINT nFlags, CPoint point)
{
发布者: admin

老飞飞收集站  

GMT+8, 2019-9-23 08:41 , Processed in 1.062507 second(s), 7 queries , File On.

Copyright © 2018和平玩家

Powered by 作死联萌! ZSLM!

返回顶部