InventoryWnd.cpp
上传用户:cydong117
上传日期:2009-11-10
资源大小:638k
文件大小:40k
- /******************************************************************************************************************
-
- 葛碘疙:
-
- 累己磊:
- 累己老:
-
- [老磊][荐沥磊] : 荐沥 郴侩
-
- *******************************************************************************************************************/
- #include "StdAfx.h"
- /******************************************************************************************************************
- CInventoryWnd Class
- *******************************************************************************************************************/
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::CInventoryWnd()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 :
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- CInventoryWnd::CInventoryWnd()
- {
- Init();
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::~CInventoryWnd()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 :
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- CInventoryWnd::~CInventoryWnd()
- {
- Destroy();
- }
- VOID CInventoryWnd::Init()
- {
- INT nCnt;
- CGameWnd::Init();
- m_nStartLineNum = 0;
- ZeroMemory(m_rcInvenCell, sizeof(RECT) *_INVEN_MAX_CELL);
- ZeroMemory(m_rcBeltCell, sizeof(RECT) *_BELT_MAX_CELL );
- ZeroMemory(m_stInventoryItem, sizeof(ITEMSET)*_MAX_INVEN_ITEM);
- ZeroMemory(m_stBeltItem, sizeof(ITEMSET)*_MAX_BELT_ITEM );
- m_xInvenScrlBar.Init();
- for ( nCnt = 0; nCnt < _MAX_INVEN_BTN; nCnt++ )
- {
- m_xInventoryBtn[nCnt].Init();
- }
- }
- VOID CInventoryWnd::Destroy()
- {
- INT nCnt;
- CGameWnd::Destroy();
- for ( nCnt = 0; nCnt < _MAX_INVEN_BTN; nCnt++ )
- {
- m_xInventoryBtn[nCnt].Destroy();
- }
- Init();
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::CreateInventoryWnd()
- 累己磊 :
- 累己老 :
- 格利 :
- 涝仿 : INT nID
- CWHWilImageData* pxWndImage
- INT nFrameImgIdx
- INT nStartX
- INT nStartY
- INT nWidth
- INT nHeight
- BOOL bCanMove
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::CreateInventoryWnd(INT nID, CWHWilImageData* pxWndImage, INT nFrameImgIdx, INT nStartX, INT nStartY, INT nWidth, INT nHeight, BOOL bCanMove)
- {
- // 扩档快 积己.
- CreateGameWnd(nID, pxWndImage, nFrameImgIdx, bCanMove, nStartX, nStartY, nWidth, nHeight);
- // 滚瓢积己.
- m_xInventoryBtn[_BTN_ID_INVENCLOSE ].CreateGameBtn(pxWndImage, 280, 281, nStartX+255, nStartY+291);
- // m_xInventoryBtn[_BTN_ID_INVENSCRLUP ].CreateGameBtn(pxWndImage, 74, 75, nStartX+247, nStartY+ 20);
- // m_xInventoryBtn[_BTN_ID_INVENSCRLDOWN].CreateGameBtn(pxWndImage, 74, 75, nStartX+247, nStartY+167);
-
- m_xInvenScrlBar.CreateScrlBar(pxWndImage, 270, _INVEN_MAX_CELL_YCNT, 10, 218, 10);
- // 牢亥配府 伎康开狼 Set.
- for ( INT nYCnt = 0; nYCnt < _INVEN_CELL_YCNT; nYCnt++ )
- {
- for ( INT nXCnt = 0; nXCnt < _INVEN_CELL_XCNT; nXCnt++ )
- {
- SetRect(&m_rcInvenCell[nXCnt+nYCnt*_INVEN_CELL_XCNT],
- _INVEN_CELL_XSTART+(nXCnt*_INVENTORY_CELL_WIDTH),
- _INVEN_CELL_YSTART+(nYCnt*_INVENTORY_CELL_HEIGHT),
- _INVEN_CELL_XSTART+(nXCnt*_INVENTORY_CELL_WIDTH) +_INVENTORY_CELL_WIDTH,
- _INVEN_CELL_YSTART+(nYCnt*_INVENTORY_CELL_HEIGHT)+_INVENTORY_CELL_HEIGHT);
- }
- }
- // 骇飘 伎康开狼 Set.
- for ( INT nCnt = 0; nCnt < _MAX_BELT_ITEM; nCnt++ )
- {
- SetRect(&m_rcBeltCell[nCnt],
- _BELT_CELL_XSTART+(nCnt*_BELT_CELL_XGAP),
- _BELT_CELL_YSTART,
- _BELT_CELL_XSTART+(nCnt*_BELT_CELL_XGAP)+_INVENTORY_CELL_WIDTH,
- _BELT_CELL_YSTART+_INVENTORY_CELL_HEIGHT);
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::SetInvenBtnInit()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::SetInvenBtnInit()
- {
- for( INT nCnt = 0; nCnt < _MAX_INVEN_BTN; nCnt++ )
- {
- m_xInventoryBtn[nCnt].SetBtnState(_BTN_STATE_NORMAL);
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::ShowInventoryWnd()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::ShowInventoryWnd()
- {
- INT nCnt;
- // 扩档快 官帕弊府扁.
- ShowGameWnd();
- RECT rcTitle = {m_rcWnd.left+31, m_rcWnd.top+27, m_rcWnd.left+133, m_rcWnd.top+43};
- g_xMainWnd.PutsHan(NULL, rcTitle, RGB(200, 200, 255), RGB(0, 0, 0), "[啊规芒]", g_xMainWnd.CreateGameFont("泵辑眉", 10, 0, FW_BOLD));
- // 胶农费官.
- m_xInvenScrlBar.ShowScrlBar(m_rcWnd.left+254, m_rcWnd.top-165, m_nStartLineNum, 12);
-
- // 牢亥配府 酒捞袍 弊府扁.
- for ( nCnt = 0; nCnt < _MAX_INVEN_ITEM; nCnt++ )
- {
- if ( m_stInventoryItem[nCnt].bSetted )
- {
- INT nStartX, nStartY;
- if ( nCnt >= m_nStartLineNum*_INVEN_CELL_XCNT && nCnt < (m_nStartLineNum+_INVEN_CELL_YCNT)*_INVEN_CELL_XCNT )
- {
- nStartX = m_rcWnd.left+m_rcInvenCell[nCnt-(m_nStartLineNum*_INVEN_CELL_XCNT)].left;
- nStartY = m_rcWnd.top +m_rcInvenCell[nCnt-(m_nStartLineNum*_INVEN_CELL_XCNT)].top;
- // m_stInventoryItem[nCnt].xItem.m_stItemInfo.stStdItem.wLooks = 4;
- m_stInventoryItem[nCnt].xItem.DrawItem(nStartX, nStartY);
- // RECT rc = {nStartX, nStartY, nStartX+_INVENTORY_CELL_WIDTH, nStartY+_INVENTORY_CELL_HEIGHT};
- // g_xMainWnd.DrawWithGDI(rc, NULL, RGB(255, 0, 255), 1);
- }
- }
- }
- // 骇飘 酒捞袍 弊府扁.
- for ( nCnt = 0; nCnt < _MAX_BELT_ITEM; nCnt++ )
- {
- if ( m_stBeltItem[nCnt].bSetted )
- {
- INT nStartX, nStartY;
- nStartX = m_rcWnd.left+m_rcBeltCell[nCnt].left;
- nStartY = m_rcWnd.top+m_rcBeltCell[nCnt].top;
- m_stBeltItem[nCnt].xItem.DrawItem(nStartX, nStartY);
- }
- }
- // 牢亥配府 扩档快 滚瓢 弊府扁.
- for ( nCnt = 0; nCnt < _MAX_INVEN_BTN; nCnt++ )
- {
- m_xInventoryBtn[nCnt].ShowGameBtn();
- }
- // 酒捞袍狼 惑怕摹 焊咯林扁.
- ShowInvenItemState();
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::ShowInvenItemState()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::ShowInvenItemState()
- {
- /* INT nInventoryNum = GetInvenNum(g_xGameProc.m_ptMousePos);
- if ( nInventoryNum != -1 )
- {
- if ( m_stInventoryItem[nInventoryNum].bSetted )
- {
- m_stInventoryItem[nInventoryNum].xItem.ShowItemStatus(m_rcWnd.left+95, m_rcWnd.top+250);
- }
- }
- */
- INT nInventoryNum = GetInvenNum(g_xGameProc.m_ptMousePos);
- if ( nInventoryNum != -1 )
- {
- if ( m_stInventoryItem[nInventoryNum].bSetted )
- {
- INT nStartX, nStartY;
- if ( nInventoryNum >= m_nStartLineNum*_INVEN_CELL_XCNT && nInventoryNum < (m_nStartLineNum+_INVEN_CELL_YCNT)*_INVEN_CELL_XCNT )
- {
- nStartX = m_rcWnd.left+m_rcInvenCell[nInventoryNum-(m_nStartLineNum*_INVEN_CELL_XCNT)].left;
- nStartY = m_rcWnd.top +m_rcInvenCell[nInventoryNum-(m_nStartLineNum*_INVEN_CELL_XCNT)].top;
- m_stInventoryItem[nInventoryNum].xItem.ShowItemStatus(nStartX+15, nStartY+15);
- }
- }
- }
- INT nBeltInventoryNum = GetBeltNum(g_xGameProc.m_ptMousePos);
- if ( nBeltInventoryNum != -1 )
- {
- if ( m_stBeltItem[nBeltInventoryNum].bSetted )
- {
- m_stBeltItem[nBeltInventoryNum].xItem.ShowItemStatus(m_rcWnd.left+95, m_rcWnd.top+250);
- }
- }
- }
- /******************************************************************************************************************
- 酒捞袍 持绊哗扁 包访, 牢亥配府困摹 历厘颇老 技捞宏棺 肺靛.(牢亥配府 棺 骇飘)
- *******************************************************************************************************************/
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::CheckItemPos()
- 累己磊 :
- 累己老 :
- 格利 :
- 涝仿 : CHAR* szName
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInventoryWnd::CheckItemPos(CHAR* szName)
- {
- HANDLE hFile;
- CHAR szItemFile[MAX_PATH];
- INT nCnt1, nCnt2;
- ITEMSET stInvenItem[_MAX_INVEN_ITEM]; // 烙矫单捞鸥 肺靛侩函荐.
- ITEMSET stBeltItem[_MAX_BELT_ITEM];
- ITEMSET stCheckedInvenItem[_MAX_INVEN_ITEM]; // 八荤等 单捞鸥 焊包侩函荐.
- ITEMSET stCehckedBeltItem[_MAX_BELT_ITEM];
- ZeroMemory(szItemFile, MAX_PATH);
- g_xMainWnd.StringPlus(szItemFile, ".\Data\", szName, ".itm", "");
- hFile = CreateFile(szItemFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- ZeroMemory(stInvenItem, sizeof(ITEMSET)*_MAX_INVEN_ITEM);
- ZeroMemory(stCheckedInvenItem, sizeof(ITEMSET)*_MAX_INVEN_ITEM);
- ZeroMemory(stBeltItem , sizeof(ITEMSET)*_MAX_BELT_ITEM );
- ZeroMemory(stCehckedBeltItem, sizeof(ITEMSET)*_MAX_BELT_ITEM);
- if ( hFile != INVALID_HANDLE_VALUE )
- {
- DWORD dwReadLen;
- ReadFile(hFile, &stInvenItem, sizeof(ITEMSET)*_MAX_INVEN_ITEM, &dwReadLen, NULL);
- ReadFile(hFile, &stBeltItem , sizeof(ITEMSET)*_MAX_BELT_ITEM , &dwReadLen, NULL);
- // 辑滚俊辑 罐篮 牢亥配府单捞鸥客 努扼捞攫飘俊辑 付瘤阜俊 历厘矫挪 骇飘芒单捞鸥甫 厚背窍搁辑 嘎绰 困摹俊 硅沥矫挪促.
- for ( nCnt1 = 0; nCnt1 < _MAX_BELT_ITEM; nCnt1++ )
- {
- if ( stBeltItem[nCnt1].bSetted )
- {
- for ( nCnt2 = 0; nCnt2 < _MAX_INVEN_ITEM; nCnt2++ )
- {
- if ( m_stInventoryItem[nCnt2].bSetted )
- {
- // 鞍篮酒捞袍牢瘤甫 惶酒辰促.
- if ( stBeltItem[nCnt1].xItem.m_stItemInfo.nMakeIndex != m_stInventoryItem[nCnt2].xItem.m_stItemInfo.nMakeIndex &&
- !strcmp(stBeltItem[nCnt1].xItem.m_stItemInfo.stStdItem.szName, m_stInventoryItem[nCnt2].xItem.m_stItemInfo.stStdItem.szName) &&
- (stBeltItem[nCnt1].xItem.m_stItemInfo.nDura == m_stInventoryItem[nCnt2].xItem.m_stItemInfo.nDura ) &&
- (stBeltItem[nCnt1].xItem.m_stItemInfo.nDuraMax == m_stInventoryItem[nCnt2].xItem.m_stItemInfo.nDuraMax) )
- {
- stCehckedBeltItem[nCnt1] = m_stInventoryItem[nCnt2];
- ZeroMemory(&stBeltItem[nCnt1], sizeof(ITEMSET));
- DeleteInvenItem(nCnt2);
- break;
- }
- }
- }
- }
- }
- memcpy(m_stBeltItem, stCehckedBeltItem, sizeof(ITEMSET)*_MAX_BELT_ITEM);
- // 牢亥配府.
- for ( nCnt1 = 0; nCnt1 < _MAX_INVEN_ITEM; nCnt1++ )
- {
- if ( stInvenItem[nCnt1].bSetted )
- {
- for ( nCnt2 = 0; nCnt2 < _MAX_INVEN_ITEM; nCnt2++ )
- {
- if ( m_stInventoryItem[nCnt2].bSetted )
- {
- // 鞍篮酒捞袍牢瘤甫 惶酒辰促.
- if ( stInvenItem[nCnt1].xItem.m_stItemInfo.nMakeIndex != m_stInventoryItem[nCnt2].xItem.m_stItemInfo.nMakeIndex &&
- !strcmp(stInvenItem[nCnt1].xItem.m_stItemInfo.stStdItem.szName, m_stInventoryItem[nCnt2].xItem.m_stItemInfo.stStdItem.szName) &&
- (stInvenItem[nCnt1].xItem.m_stItemInfo.nDura == m_stInventoryItem[nCnt2].xItem.m_stItemInfo.nDura ) &&
- (stInvenItem[nCnt1].xItem.m_stItemInfo.nDuraMax == m_stInventoryItem[nCnt2].xItem.m_stItemInfo.nDuraMax ) )
- {
- stCheckedInvenItem[nCnt1] = m_stInventoryItem[nCnt2];
- ZeroMemory(&stInvenItem[nCnt1], sizeof(ITEMSET));
- DeleteInvenItem(nCnt2);
- break;
- }
- }
- }
- }
- }
- for ( nCnt1 = 0; nCnt1 < _MAX_INVEN_ITEM; nCnt1++ )
- {
- if ( m_stInventoryItem[nCnt1].bSetted )
- {
- for ( nCnt2 = 0; nCnt2 < _MAX_INVEN_ITEM; nCnt2++ )
- {
- if ( !stCheckedInvenItem[nCnt2].bSetted )
- {
- stCheckedInvenItem[nCnt2] = m_stInventoryItem[nCnt1];
- break;
- }
- }
- }
- }
- memcpy(m_stInventoryItem, stCheckedInvenItem, sizeof(ITEMSET)*_MAX_INVEN_ITEM);
- CloseHandle(hFile);
- return TRUE;
- }
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::SaveItemPos()
- 累己磊 :
- 累己老 :
- 格利 :
- 涝仿 : CHAR* szName
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInventoryWnd::SaveItemPos(CHAR* szName)
- {
- HANDLE hFile;
- CHAR szItemFile[MAX_PATH];
- ZeroMemory(szItemFile, MAX_PATH);
- g_xMainWnd.StringPlus(szItemFile, ".\Data\", szName, ".itm", "");
- hFile = CreateFile(szItemFile, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- if ( hFile != INVALID_HANDLE_VALUE )
- {
- DWORD dwWriteLen;
- WriteFile(hFile, m_stInventoryItem, sizeof(ITEMSET)*_MAX_INVEN_ITEM, &dwWriteLen, NULL);
- WriteFile(hFile, m_stBeltItem, sizeof(ITEMSET)*_MAX_BELT_ITEM , &dwWriteLen, NULL);
- CloseHandle(hFile);
- return TRUE;
- }
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::GetInvenNum()
- 累己磊 :
- 累己老 :
- 格利 : 付快胶 困摹俊辑 泅犁 牢亥配府狼 伎锅龋甫 掘绢柯促.
- 涝仿 : POINT ptMouse
- 免仿 : INT
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- INT CInventoryWnd::GetInvenNum(POINT ptMouse)
- {
- RECT rc;
- for ( INT nCnt = 0; nCnt < _INVEN_MAX_CELL; nCnt++ )
- {
- SetRect(&rc, m_rcWnd.left+m_rcInvenCell[nCnt].left, m_rcWnd.top+m_rcInvenCell[nCnt].top,
- m_rcWnd.left+m_rcInvenCell[nCnt].left+_INVENTORY_CELL_WIDTH, m_rcWnd.top+m_rcInvenCell[nCnt].top+_INVENTORY_CELL_HEIGHT);
- if ( PtInRect(&rc, ptMouse) )
- {
- return (nCnt+m_nStartLineNum*_INVEN_CELL_XCNT);
- }
- }
- return -1;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::GetBeltNum()
- 累己磊 :
- 累己老 :
- 格利 : 付快胶 困摹俊辑 泅犁 骇飘狼 伎锅龋甫 掘绢柯促.
- 涝仿 : POINT ptMouse
- 免仿 : INT
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- INT CInventoryWnd::GetBeltNum(POINT ptMouse)
- {
- RECT rc;
- for ( INT nCnt = 0; nCnt < _MAX_BELT_ITEM; nCnt++ )
- {
- SetRect(&rc, m_rcWnd.left+m_rcBeltCell[nCnt].left, m_rcWnd.top+m_rcBeltCell[nCnt].top,
- m_rcWnd.left+m_rcBeltCell[nCnt].left+_INVENTORY_CELL_WIDTH, m_rcWnd.top+m_rcBeltCell[nCnt].top+_INVENTORY_CELL_HEIGHT);
- if ( PtInRect(&rc, ptMouse) )
- {
- return (nCnt);
- }
- }
- return -1;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::DeleteInventoryCurrItem()
- 累己磊 :
- 累己老 :
- 格利 : 牢亥配府狼 秦寸伎 酒捞袍阑 瘤款促.
- 涝仿 : INT nInventoryNum
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::DeleteInvenItem(INT nInventoryNum)
- {
- ZeroMemory(&m_stInventoryItem[nInventoryNum], sizeof(ITEMSET));
- }
- VOID CInventoryWnd::DeleteInvenItem(INT nMakeIndex, CHAR* szName)
- {
- for ( INT nCnt = 0; nCnt < _MAX_INVEN_ITEM; nCnt++ )
- {
- if ( m_stInventoryItem[nCnt].bSetted )
- {
- if ( m_stInventoryItem[nCnt].xItem.m_stItemInfo.nMakeIndex == nMakeIndex )
- {
- if ( !strcmp(m_stInventoryItem[nCnt].xItem.m_stItemInfo.stStdItem.szName, szName) )
- {
- DeleteInvenItem(nCnt);
- break;
- }
- }
- }
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::DeleteInventoryAllItem()
- 累己磊 :
- 累己老 :
- 格利 : 牢亥配府狼 葛电 酒捞袍阑 瘤款促.
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::DeleteAllInvenItem()
- {
- for ( INT nCnt = 0; nCnt < _MAX_INVEN_ITEM; nCnt++ )
- {
- ZeroMemory(&m_stInventoryItem[nCnt], sizeof(ITEMSET));
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::DeleteCurrBeltItemList()
- 累己磊 :
- 累己老 :
- 格利 : 骇飘狼 秦寸伎 酒捞袍阑 瘤款促.
- 涝仿 : INT nBeltInventoryNum
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::DeleteBeltItem(INT nBeltInventoryNum)
- {
- ZeroMemory(&m_stBeltItem[nBeltInventoryNum], sizeof(ITEMSET));
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::DeleteAllBeltItemList()
- 累己磊 :
- 累己老 :
- 格利 : 骇飘狼 葛电 酒捞袍阑 瘤款促.
- 涝仿 : INT nBeltInventoryNum
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::DeleteAllBeltItem()
- {
- for ( INT nCnt = 0; nCnt < _MAX_BELT_ITEM; nCnt++ )
- {
- ZeroMemory(&m_stBeltItem[nCnt], sizeof(ITEMSET));
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::AddInvenItem()
- 累己磊 :
- 累己老 :
- 格利 : 牢亥配府俊 酒捞袍阑 持绰促.
- 涝仿 : CItem xItem
- INT nInvenNum
- BOOL bUseInvenNum
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInventoryWnd::AddInvenItem(CItem xItem, INT nInvenNum, BOOL bUseInvenNum)
- {
- if ( bUseInvenNum )
- {
- if ( !m_stInventoryItem[nInvenNum].bSetted )
- {
- m_stInventoryItem[nInvenNum].bSetted = TRUE;
- m_stInventoryItem[nInvenNum].xItem = xItem;
- return TRUE;
- }
- }
- for ( INT nCnt = 0; nCnt < _MAX_INVEN_ITEM; nCnt++ )
- {
- if ( !m_stInventoryItem[nCnt].bSetted )
- {
- m_stInventoryItem[nCnt].bSetted = TRUE;
- m_stInventoryItem[nCnt].xItem = xItem;
- return TRUE;
- }
- }
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::AddBeltItem()
- 累己磊 :
- 累己老 :
- 格利 : 骇飘俊 酒捞袍阑 持绰促.
- 涝仿 : CItem xItem
- INT nBeltNum
- BOOL bUseBeltNum
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInventoryWnd::AddBeltItem(CItem xItem, INT nBeltNum, BOOL bUseBeltNum)
- {
- if ( bUseBeltNum )
- {
- if ( !m_stBeltItem[nBeltNum].bSetted )
- {
- m_stBeltItem[nBeltNum].bSetted = TRUE;
- m_stBeltItem[nBeltNum].xItem = xItem;
- return TRUE;
- }
- }
- for ( INT nCnt = 0; nCnt < _MAX_BELT_ITEM; nCnt++ )
- {
- if ( !m_stBeltItem[nCnt].bSetted )
- {
- m_stBeltItem[nCnt].bSetted = TRUE;
- m_stBeltItem[nCnt].xItem = xItem;
- return TRUE;
- }
- }
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::ExtractInvenItem()
- 累己磊 :
- 累己老 :
- 格利 : 牢亥配府俊辑 泅犁 锅龋狼 酒捞袍阑 惶酒柯促.
- 涝仿 : CItem* pxItem
- INT nInventoryNum
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInventoryWnd::ExtractInvenItem(CItem* pxItem, INT nInventoryNum)
- {
- if ( m_stInventoryItem[nInventoryNum].bSetted )
- {
- memcpy(pxItem, &m_stInventoryItem[nInventoryNum].xItem, sizeof(CItem));
- DeleteInvenItem(nInventoryNum);
-
- return TRUE;
- }
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::ExtractBeltItem()
- 累己磊 :
- 累己老 :
- 格利 : 啊规芒俊辑 泅犁 锅龋狼 酒捞袍阑 惶酒柯促.
- 涝仿 : CItem* pxItem
- INT nBeltInventoryNum
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInventoryWnd::ExtractBeltItem(CItem* pxItem, INT nBeltInventoryNum)
- {
- if ( m_stBeltItem[nBeltInventoryNum].bSetted )
- {
- memcpy(pxItem, &m_stBeltItem[nBeltInventoryNum].xItem, sizeof(CItem));
- DeleteBeltItem(nBeltInventoryNum);
-
- return TRUE;
- }
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::ChangeInvenWithCommon()
- 累己磊 :
- 累己老 :
- 格利 : 牢亥配府狼 酒捞袍苞 傍烹(付快胶)酒捞袍阑 官槽促.
- 涝仿 : INT nInventoryNum
- LPCOMMONITEMSET pstCommonItemSet
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::ChangeInvenWithCommon(INT nInventoryNum, LPCOMMONITEMSET pstCommonItemSet)
- {
- if ( pstCommonItemSet->bSetted )
- {
- CItem xInvenItem;
- if ( ExtractInvenItem(&xInvenItem, nInventoryNum) )
- {
- AddInvenItem(pstCommonItemSet->xItem, nInventoryNum, TRUE);
- pstCommonItemSet->bSetted = TRUE;
- pstCommonItemSet->xItem = xInvenItem;
- pstCommonItemSet->bWaitResponse = FALSE;
- pstCommonItemSet->bIsEquipItem = FALSE;
- pstCommonItemSet->bIsHideItem = FALSE;
- pstCommonItemSet->bIsBeltItem = FALSE;
- pstCommonItemSet->xItem.m_shCellNum = nInventoryNum;
- }
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::ChangeBeltWithCommon()
- 累己磊 :
- 累己老 :
- 格利 : 骇飘狼 酒捞袍苞 傍烹(付快胶)酒捞袍阑 官槽促.
- 涝仿 : INT nBeltInventoryNum
- LPCOMMONITEMSET pstCommonItemSet
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::ChangeBeltWithCommon(INT nBeltInventoryNum, LPCOMMONITEMSET pstCommonItemSet)
- {
- if ( pstCommonItemSet->bSetted )
- {
- CItem xBeltItem;
- if ( ExtractBeltItem(&xBeltItem, nBeltInventoryNum) )
- {
- AddBeltItem(pstCommonItemSet->xItem, nBeltInventoryNum, TRUE);
- pstCommonItemSet->bSetted = TRUE;
- pstCommonItemSet->xItem = xBeltItem;
- pstCommonItemSet->bWaitResponse = FALSE;
- pstCommonItemSet->bIsEquipItem = FALSE;
- pstCommonItemSet->bIsHideItem = FALSE;
- pstCommonItemSet->bIsBeltItem = TRUE;
- pstCommonItemSet->xItem.m_shCellNum = nBeltInventoryNum;
- }
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::SetCommonFromInven()
- 累己磊 :
- 累己老 :
- 格利 : 牢亥配府狼 秦寸锅龋 酒捞袍阑 傍烹(付快胶)酒捞袍栏肺 技泼茄促.
- 涝仿 : INT nInventoryNum
- LPCOMMONITEMSET pstCommonItemSet
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::SetCommonFromInven(INT nInventoryNum, LPCOMMONITEMSET pstCommonItemSet)
- {
- CItem xInvenItem;
- if ( ExtractInvenItem(&xInvenItem, nInventoryNum) )
- {
- pstCommonItemSet->bSetted = TRUE;
- pstCommonItemSet->xItem = xInvenItem;
- pstCommonItemSet->bWaitResponse = FALSE;
- pstCommonItemSet->bIsEquipItem = FALSE;
- pstCommonItemSet->bIsHideItem = FALSE;
- pstCommonItemSet->bIsBeltItem = FALSE;
- pstCommonItemSet->xItem.m_shCellNum = nInventoryNum;
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::SetCommonFromBelt()
- 累己磊 :
- 累己老 :
- 格利 : 骇飘芒狼 秦寸锅龋 酒捞袍阑 傍烹(付快胶)酒捞袍栏肺 技泼茄促.
- 涝仿 : INT nBeltInventoryNum
- LPCOMMONITEMSET pstCommonItemSet
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::SetCommonFromBelt(INT nBeltInventoryNum, LPCOMMONITEMSET pstCommonItemSet)
- {
- CItem xBeltItem;
- if ( ExtractBeltItem(&xBeltItem, nBeltInventoryNum) )
- {
- pstCommonItemSet->bSetted = TRUE;
- pstCommonItemSet->xItem = xBeltItem;
- pstCommonItemSet->bWaitResponse = FALSE;
- pstCommonItemSet->bIsEquipItem = FALSE;
- pstCommonItemSet->bIsHideItem = FALSE;
- pstCommonItemSet->bIsBeltItem = TRUE;
- pstCommonItemSet->xItem.m_shCellNum = nBeltInventoryNum;
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::SetInvenFromCommon()
- 累己磊 :
- 累己老 :
- 格利 : 傍烹(付快胶)酒捞袍阑 牢亥配府狼 秦寸锅龋肺 技泼茄促.
- 涝仿 : INT nInventoryNum
- LPCOMMONITEMSET pstCommonItemSet
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::SetInvenFromCommon(INT nInventoryNum, LPCOMMONITEMSET pstCommonItemSet)
- {
- if ( pstCommonItemSet->bSetted )
- {
- pstCommonItemSet->xItem.m_shCellNum = nInventoryNum;
- AddInvenItem(pstCommonItemSet->xItem, nInventoryNum, TRUE);
- ZeroMemory(pstCommonItemSet, sizeof(COMMONITEMSET));
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::SetBeltFromCommon()
- 累己磊 :
- 累己老 :
- 格利 : 傍烹(付快胶)酒捞袍阑 骇飘芒狼 秦寸锅龋肺 技泼茄促.
- 涝仿 : INT nBeltInventoryNum
- LPCOMMONITEMSET pstCommonItemSet
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::SetBeltFromCommon(INT nBeltInventoryNum, LPCOMMONITEMSET pstCommonItemSet)
- {
- if ( pstCommonItemSet->bSetted )
- {
- pstCommonItemSet->xItem.m_shCellNum = nBeltInventoryNum;
- AddBeltItem(pstCommonItemSet->xItem, nBeltInventoryNum);
- ZeroMemory(pstCommonItemSet, sizeof(LPCOMMONITEMSET));
- }
- }
- VOID CInventoryWnd::AddNewBeltItem(LPCOMMONITEMSET pstCommonItemSet)
- {
- INT nCnt;
- if ( pstCommonItemSet->bSetted && pstCommonItemSet->bIsBeltItem )
- {
- if ( /*pstCommonItemSet->xItem.m_stItemInfo.szMakeIndex[0] == 'G' && */
- (pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode == 0 || pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode == 3) )
- {
- for ( nCnt = 0; nCnt < _MAX_INVEN_ITEM; nCnt++ )
- {
- if ( m_stInventoryItem[nCnt].bSetted &&
- m_stInventoryItem[nCnt].xItem.m_stItemInfo.stStdItem.bStdMode == pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode &&
- m_stInventoryItem[nCnt].xItem.m_stItemInfo.stStdItem.bShape == pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bShape &&
- m_stInventoryItem[nCnt].xItem.m_stItemInfo.nDura == pstCommonItemSet->xItem.m_stItemInfo.nDura &&
- m_stInventoryItem[nCnt].xItem.m_stItemInfo.nDuraMax == pstCommonItemSet->xItem.m_stItemInfo.nDuraMax )
-
- {
- if ( !m_stBeltItem[pstCommonItemSet->xItem.m_shCellNum].bSetted )
- {
- m_stBeltItem[pstCommonItemSet->xItem.m_shCellNum].xItem = m_stInventoryItem[nCnt].xItem;
- m_stBeltItem[pstCommonItemSet->xItem.m_shCellNum].bSetted = TRUE;
- DeleteInvenItem(nCnt);
- }
- break;
- }
- }
- }
- }
- }
- /******************************************************************************************************************
- Message Function.(付快胶涝仿)
- *******************************************************************************************************************/
- BOOL CInventoryWnd::OnKeyUp(LPCOMMONITEMSET pstCommonItemSet, WPARAM wParam, LPARAM lParam)
- {
- INT nBeltInventoryNum;
- nBeltInventoryNum = -1;
-
- switch ( wParam )
- {
- case '1': nBeltInventoryNum = 0; break;
- case '2': nBeltInventoryNum = 1; break;
- case '3': nBeltInventoryNum = 2; break;
- case '4': nBeltInventoryNum = 3; break;
- case '5': nBeltInventoryNum = 4; break;
- case '6': nBeltInventoryNum = 5; break;
- }
- if ( nBeltInventoryNum != -1 )
- {
- if ( m_stBeltItem[nBeltInventoryNum].bSetted )
- {
- if ( !pstCommonItemSet->bSetted )
- {
- SetCommonFromBelt(nBeltInventoryNum, pstCommonItemSet);
- }
- else if ( pstCommonItemSet->bSetted && !pstCommonItemSet->bWaitResponse && !pstCommonItemSet->bIsEquipItem )
- {
- if ( /*pstCommonItemSet->xItem.m_stItemInfo.szMakeIndex[0] == 'G' && */
- (pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode == 0 || pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode == 3) )
- ChangeBeltWithCommon(nBeltInventoryNum, pstCommonItemSet);
- }
- }
- else
- {
- if ( pstCommonItemSet->bSetted && !pstCommonItemSet->bWaitResponse && !pstCommonItemSet->bIsEquipItem )
- {
- if ( /*pstCommonItemSet->xItem.m_stItemInfo.szMakeIndex[0] == 'G' && */
- (pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode == 0 || pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode == 3) )
- SetBeltFromCommon(nBeltInventoryNum, pstCommonItemSet);
- }
- }
- if ( pstCommonItemSet->bSetted && !pstCommonItemSet->bWaitResponse && !pstCommonItemSet->bIsEquipItem )
- {
- pstCommonItemSet->bWaitResponse = TRUE;
- pstCommonItemSet->bIsHideItem = TRUE;
- g_xClientSocket.SendItemIndex(CM_EAT, pstCommonItemSet->xItem.m_stItemInfo.nMakeIndex, pstCommonItemSet->xItem.m_stItemInfo.stStdItem.szName);
- return TRUE;
- }
- }
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::OnLButtonDown()
- 累己磊 :
- 累己老 :
- 格利 :
- 涝仿 : POINT ptMouse
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInventoryWnd::OnLButtonDown(LPCOMMONITEMSET pstCommonItemSet, POINT ptMouse)
- {
- INT nCnt, nInventoryNum, nBeltInventoryNum;
- m_xInventoryBtn[_BTN_ID_INVENCLOSE ].ChangeRect(m_rcWnd.left+255, m_rcWnd.top+291);
- // m_xInventoryBtn[_BTN_ID_INVENSCRLUP ].ChangeRect(m_rcWnd.left+247, m_rcWnd.top+ 20);
- // m_xInventoryBtn[_BTN_ID_INVENSCRLDOWN].ChangeRect(m_rcWnd.left+247, m_rcWnd.top+167);
- if ( m_xInvenScrlBar.OnLButtonDown(ptMouse) )
- {
- FLOAT fScrlRate;
- fScrlRate = m_xInvenScrlBar.GetScrlRate();
- m_nStartLineNum = 11*fScrlRate;
- return FALSE;
- }
- for( nCnt = 0; nCnt < _MAX_INVEN_BTN; nCnt++ )
- {
- if ( m_xInventoryBtn[nCnt].OnLButtonDown(ptMouse) )
- return TRUE;
- }
- nInventoryNum = GetInvenNum(ptMouse);
- nBeltInventoryNum = GetBeltNum(ptMouse);
- if ( (nInventoryNum == -1 && nBeltInventoryNum == -1) ) m_bCanMove = TRUE;
- else
- {
- if ( nInventoryNum != -1 )
- {
- if ( m_stInventoryItem[nInventoryNum].bSetted ) m_bCanMove = FALSE;
- else m_bCanMove = TRUE;
- }
- else if ( nBeltInventoryNum != -1 )
- {
- if ( m_stBeltItem[nInventoryNum].bSetted ) m_bCanMove = FALSE;
- else m_bCanMove = TRUE;
- }
- }
-
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::OnLButtonUp()
- 累己磊 :
- 累己老 :
- 格利 :
- 涝仿 : LPCOMMONITEMSET pstCommonItemSet
- POINT ptMouse
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInventoryWnd::OnLButtonUp(LPCOMMONITEMSET pstCommonItemSet, POINT ptMouse)
- {
- INT nInventoryNum, nBeltInventoryNum;
- m_xInventoryBtn[_BTN_ID_INVENCLOSE ].ChangeRect(m_rcWnd.left+255, m_rcWnd.top+291);
- // m_xInventoryBtn[_BTN_ID_INVENSCRLUP ].ChangeRect(m_rcWnd.left+247, m_rcWnd.top+ 20);
- // m_xInventoryBtn[_BTN_ID_INVENSCRLDOWN].ChangeRect(m_rcWnd.left+247, m_rcWnd.top+167);
- if ( m_xInvenScrlBar.OnLButtonUp(ptMouse) )
- {
- return TRUE;
- }
- // 牢亥配府 扩档快甫 促绰促.
- if ( m_xInventoryBtn[_BTN_ID_INVENCLOSE].OnLButtonUp(ptMouse) )
- return TRUE;
- // 胶农费 Up, Down贸府.
- // m_xInventoryBtn[_BTN_ID_INVENSCRLUP ].OnLButtonUp(ptMouse);
- // m_xInventoryBtn[_BTN_ID_INVENSCRLDOWN].OnLButtonUp(ptMouse);
- nInventoryNum = GetInvenNum(ptMouse);
- nBeltInventoryNum = GetBeltNum(ptMouse);
- // 傍烹(付快胶)酒捞袍俊 厘馒芒俊辑 柯 酒捞袍捞 乐绊, 辑滚肺何磐 览翠脚龋甫 扁促府绰 吝捞 酒聪扼搁, 酒捞袍 馒侩阑 Off矫挪促.
- if ( pstCommonItemSet->bSetted && pstCommonItemSet->bIsEquipItem && !pstCommonItemSet->bWaitResponse )
- {
- nInventoryNum = GetInvenNum(ptMouse);
- if ( nInventoryNum != -1 )
- {
- g_xClientSocket.SendTakeOnOffItem(CM_TAKEOFFITEM, pstCommonItemSet->xItem.m_shCellNum, pstCommonItemSet->xItem.m_stItemInfo.stStdItem.szName, pstCommonItemSet->xItem.m_stItemInfo.nMakeIndex);
- pstCommonItemSet->bWaitResponse = TRUE;
- return FALSE;
- }
- }
- // 牢亥配府 伎康开俊辑 努腐茄版快.
- if ( nInventoryNum != -1 )
- {
- // 努腐茄牢亥配府俊 酒捞袍捞 乐阑版快.
- if ( m_stInventoryItem[nInventoryNum].bSetted )
- {
- // 傍烹(付快胶)酒捞袍悸捞 厚绢乐栏搁,
- if ( !pstCommonItemSet->bSetted )
- {
- // 付快胶俊 酒捞袍阑 嘿牢促.
- SetCommonFromInven(nInventoryNum, pstCommonItemSet);
- }
- // 傍烹(付快胶)酒捞袍悸篮 乐绊, 辑滚肺何磐 览翠脚龋甫 扁促府绰 吝捞 酒聪哥, 厘馒酒捞袍捞 酒匆锭俊.
- else if ( pstCommonItemSet->bSetted && !pstCommonItemSet->bWaitResponse && !pstCommonItemSet->bIsEquipItem )
- {
- ChangeInvenWithCommon(nInventoryNum, pstCommonItemSet);
- }
- }
- // 努腐茄 牢亥配府俊 酒捞袍捞 绝阑版快.
- else
- {
- // 傍烹(付快胶)酒捞袍悸篮 乐绊, 辑滚肺何磐 览翠脚龋甫 扁促府绰 吝捞 酒聪搁,
- if ( pstCommonItemSet->bSetted && !pstCommonItemSet->bWaitResponse && !pstCommonItemSet->bIsEquipItem )
- {
- SetInvenFromCommon(nInventoryNum, pstCommonItemSet);
- }
- }
- }
- if ( nBeltInventoryNum != -1 )
- {
- if ( m_stBeltItem[nBeltInventoryNum].bSetted )
- {
- if ( !pstCommonItemSet->bSetted )
- {
- SetCommonFromBelt(nBeltInventoryNum, pstCommonItemSet);
- }
- else if ( pstCommonItemSet->bSetted && !pstCommonItemSet->bWaitResponse && !pstCommonItemSet->bIsEquipItem )
- {
- if ( /*pstCommonItemSet->xItem.m_stItemInfo.szMakeIndex[0] == 'G' && */
- (pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode == 0 || pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode == 3) )
- ChangeBeltWithCommon(nBeltInventoryNum, pstCommonItemSet);
- }
- }
- else
- {
- if ( pstCommonItemSet->bSetted && !pstCommonItemSet->bWaitResponse && !pstCommonItemSet->bIsEquipItem )
- {
- if ( /*pstCommonItemSet->xItem.m_stItemInfo.szMakeIndex[0] == 'G' && */
- (pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode == 0 || pstCommonItemSet->xItem.m_stItemInfo.stStdItem.bStdMode == 3) )
- SetBeltFromCommon(nBeltInventoryNum, pstCommonItemSet);
- }
- }
- }
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::OnLButtonDoubleClick()
- 累己磊 :
- 累己老 :
- 格利 :
- 涝仿 : LPCOMMONITEMSET pstCommonItemSet
- POINT ptMouse
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInventoryWnd::OnLButtonDoubleClick(LPCOMMONITEMSET pstCommonItemSet, POINT ptMouse)
- {
- INT nInventoryNum = GetInvenNum(ptMouse);
- INT nBeltInventoryNum = GetBeltNum(ptMouse);
- if ( nInventoryNum != -1 )
- {
- // 努腐茄牢亥配府俊 酒捞袍捞 乐阑版快.
- if ( m_stInventoryItem[nInventoryNum].bSetted )
- {
- // 傍烹(付快胶)酒捞袍悸捞 厚绢乐栏搁,
- if ( !pstCommonItemSet->bSetted )
- {
- // 付快胶俊 酒捞袍阑 嘿牢促.
- SetCommonFromInven(nInventoryNum, pstCommonItemSet);
- }
- // 傍烹(付快胶)酒捞袍悸篮 乐绊, 辑滚肺何磐 览翠脚龋甫 扁促府绰 吝捞 酒聪搁,
- else if ( pstCommonItemSet->bSetted && !pstCommonItemSet->bWaitResponse && !pstCommonItemSet->bIsEquipItem )
- {
- ChangeInvenWithCommon(nInventoryNum, pstCommonItemSet);
- }
- }
- }
- if ( nBeltInventoryNum != -1 )
- {
- if ( m_stBeltItem[nBeltInventoryNum].bSetted )
- {
- if ( !pstCommonItemSet->bSetted )
- {
- SetCommonFromBelt(nBeltInventoryNum, pstCommonItemSet);
- }
- else if ( pstCommonItemSet->bSetted && !pstCommonItemSet->bWaitResponse && !pstCommonItemSet->bIsEquipItem )
- {
- ChangeBeltWithCommon(nBeltInventoryNum, pstCommonItemSet);
- }
- }
- }
- if ( pstCommonItemSet->bSetted && !pstCommonItemSet->bWaitResponse && !pstCommonItemSet->bIsEquipItem )
- {
- pstCommonItemSet->bWaitResponse = TRUE;
- g_xClientSocket.SendItemIndex(CM_EAT, pstCommonItemSet->xItem.m_stItemInfo.nMakeIndex, pstCommonItemSet->xItem.m_stItemInfo.stStdItem.szName);
- }
- return TRUE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::OnMouseMove()
- 累己磊 :
- 累己老 :
- 格利 :
- 涝仿 : POINT ptMouse
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::OnMouseMove(POINT ptMouse)
- {
- m_xInventoryBtn[_BTN_ID_INVENCLOSE ].ChangeRect(m_rcWnd.left+255, m_rcWnd.top+291);
- // m_xInventoryBtn[_BTN_ID_INVENSCRLUP ].ChangeRect(m_rcWnd.left+247, m_rcWnd.top+ 20);
- // m_xInventoryBtn[_BTN_ID_INVENSCRLDOWN].ChangeRect(m_rcWnd.left+247, m_rcWnd.top+167);
- for( INT nCnt = 0; nCnt < _MAX_INVEN_BTN; nCnt++ )
- m_xInventoryBtn[nCnt].OnMouseMove(ptMouse);
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::OnScrollDown()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::OnScrollDown()
- {
- if ( m_nStartLineNum > 0 ) m_nStartLineNum--;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInventoryWnd::OnScrollUp()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInventoryWnd::OnScrollUp()
- {
- // if ( m_nStartLineNum < _INVEN_MAX_CELL_YCNT - _INVEN_CELL_YCNT ) m_nStartLineNum++;
- if ( m_nStartLineNum < (_INVEN_MAX_CELL_YCNT-1) )
- {
- m_nStartLineNum++;
- }
- }