Interface.cpp
上传用户:cydong117
上传日期:2009-11-10
资源大小:638k
文件大小:53k
- /******************************************************************************************************************
-
- 葛碘疙:
-
- 累己磊:
- 累己老:
-
- [老磊][荐沥磊] : 荐沥 郴侩
-
- *******************************************************************************************************************/
- #include "StdAfx.h"
- /******************************************************************************************************************
- 窃荐疙 : CInterface::CInterface()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 :
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- CInterface::CInterface()
- {
- Init();
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::~CInterface()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 :
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- CInterface::~CInterface()
- {
- Destroy();
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::Init()
- 累己磊 :
- 累己老 :
- 格利 : 牢磐其捞胶包访 函荐棺, 按眉檬扁拳.
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::Init()
- {
- m_nIdxMsgBox = 0;
- m_nFstLine = 0;
- m_shBeltHeight = 0;
- m_bShowKey = FALSE;
- m_bMoveFocusedWnd = FALSE;
- m_bBeltState = _BELT_STATE_STAY;
- SetRect(&m_rcMain, 0, 0, 0, 0);
- SetRect(&m_rcChat, 0, 0, 0, 0);
- ZeroMemory(&m_stCommonItem, sizeof(ITEMSET));
- m_xClientSysMsg.Init();
- m_pxInterImg = NULL;
- m_xInterImgEx.Init();
- m_xStatusWnd.Init();
- m_xStoreWnd.Init();
- m_xGuildWnd.Init();
- m_xGroupWnd.Init();
- m_xChatPopWnd.Init();
- m_xExchangeWnd.Init();
- m_xGroupPopWnd.Init();
- m_xInventoryWnd.Init();
- m_xGuildMasterWnd.Init();
- for ( INT nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++ )
- {
- m_xInterBtn[nCnt].Init();
- }
- m_xScrlBar.Init();
- m_xChat.ClearAllNodes();
- m_xWndOrderList.ClearAllNodes();
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::Destroy()
- 累己磊 :
- 累己老 :
- 格利 : 牢磐其捞胶包访 函荐, 按眉狼 家戈棺, 檬扁拳.
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::Destroy()
- {
- m_xClientSysMsg.Destroy();
- m_xInterImgEx.Destroy();
- m_pxInterImg = NULL;
- m_xInventoryWnd.Destroy();
- m_xStoreWnd.Destroy();
- m_xStatusWnd.Destroy();
- m_xGuildWnd.Destroy();
- m_xGroupWnd.Destroy();
- m_xExchangeWnd.Destroy();
- m_xGuildMasterWnd.Destroy();
- m_xGroupPopWnd.Destroy();
- m_xChatPopWnd.Destroy();
- for ( INT nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++ )
- {
- m_xInterBtn[nCnt].Destroy();
- }
- m_xChat.ClearAllNodes();
- m_xWndOrderList.ClearAllNodes();
- Init();
- }
- VOID CInterface::CreateInterface(CImageHandler* pxImgHandler)
- {
- m_pxInterImg = &(pxImgHandler->m_xImageList[_IMAGE_INTER]);
- //------------------------------------------------------------------------------------------------------------
- // 盲泼俊叼飘 扩档快 困摹瘤沥.
- MoveWindow(g_xChatEditBox.GetSafehWnd(),
- g_xMainWnd.m_rcWindow.left+_INPUT_EDITWND_XPOS, g_xMainWnd.m_rcWindow.top+_INPUT_EDITWND_YPOS,
- _INPUT_EDITWND_WIDTH, _INPUT_EDITWND_HEIGHT, TRUE);
- //------------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------------
- // 牢磐其捞胶 捞固瘤 肺靛.
- m_pxInterImg->NewLoad(".\Data\gameinter.wil");
- m_xInterImgEx.NewLoad(".\Data\interfacec2.wil");
- //------------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------------
- // 皋牢牢磐其捞胶 康开汲沥.
- if ( m_pxInterImg->NewSetIndex(_WNDIMGIDX_MAIN) )
- {
- SetRect(&m_rcMain,
- 0, (600-m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight),
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, 600);
- }
- //------------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------------
- // 盲泼 康开汲沥.
- SetRect(&m_rcChat, 224, 471, 578, 545);
- //------------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------------
- // 扩档快甸 积己.
- m_xInventoryWnd.CreateInventoryWnd(_WND_ID_INVENTORY, m_pxInterImg, _WNDIMGIDX_INVENTORY, 0, 0, 0, 0, TRUE);
- m_xStatusWnd.CreateStatusWnd(_WND_ID_STATUS, m_pxInterImg, _WNDIMGIDX_ITEMSET, 510, 0, 0, 0, TRUE);
- m_xStoreWnd.CreateStoreWnd(_WND_ID_STORE, m_pxInterImg, _WNDIMGIDX_STORE, 0, 0, 0, 0, TRUE);
- m_xExchangeWnd.CreateExchangeWnd(_WND_ID_EXCHANGE, m_pxInterImg, _WNDIMGIDX_EXCHANGE, 0, 0, 0, 0, TRUE);
- m_xGuildMasterWnd.CreateGuildMasterWnd(_WND_ID_GUILDMASTER, m_pxInterImg, _WNDIMGIDX_GUILDMASTER, 0, 0, 0, 0, TRUE);
- m_xGuildWnd.CreateGuildWnd(_WND_ID_GUILD, &m_xInterImgEx, _WNDIMGIDX_GUILD, 0, 0, 540, 442, TRUE);
- m_xGroupWnd.CreateGroupWnd(_WND_ID_GROUP, m_pxInterImg, _WNDIMGIDX_GROUP, 0, 0, 0, 0, TRUE);
- m_xGroupPopWnd.CreateGroupPopWnd(_WND_ID_GROUPPOP, &m_xInterImgEx, _WNDIMGIDX_GROUPPOP, 0, 0, 260, 114, TRUE);
- m_xChatPopWnd.CreateChatPopWnd(_WND_ID_CHATPOP, m_pxInterImg, _WNDIMGIDX_CHATPOP, 0, 0, 0, 0, TRUE);
- m_xOptionWnd.CreateOptionWnd(_WND_ID_OPTION, m_pxInterImg, _WNDIMGIDX_OPTION, 0, 0, 0, 0, TRUE);
- m_xQuestWnd.CreateQuestWnd(_WND_ID_QUEST, m_pxInterImg, _WNDIMGIDX_QUEST, 0, 0, 0, 0, TRUE);
- m_xHorseWnd.CreateHorseWnd(_WND_ID_HORSE, m_pxInterImg, _WNDIMGIDX_HORSE, 0, 0, 0, 0, TRUE);
- m_xNPCWnd.CreateNPCChatWnd(_WND_ID_NPCCHAT, m_pxInterImg, _WNDIMGIDX_NPCCHAT, 0, 0, 0, 0, TRUE); // 侩扁
- //------------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------------
- // 滚瓢 檬扁拳.
- m_xInterBtn[ 0].CreateGameBtn(m_pxInterImg, 80, 81, m_rcMain.left+204, m_rcMain.top+0); // 背券芒.
- m_xInterBtn[ 1].CreateGameBtn(m_pxInterImg, 82, 83, m_rcMain.left+228, m_rcMain.top+0); // 固聪甘.
- m_xInterBtn[ 2].CreateGameBtn(m_pxInterImg, 84, 85, m_rcMain.left+252, m_rcMain.top+0); // 公傍芒.
- m_xInterBtn[ 3].CreateGameBtn(m_pxInterImg, 90, 91, m_rcMain.left+161, m_rcMain.top+65); // 霸烙辆丰.
- m_xInterBtn[ 4].CreateGameBtn(m_pxInterImg, 92, 93, m_rcMain.left+161, m_rcMain.top+101); // 肺弊酒眶.
- m_xInterBtn[ 5].CreateGameBtn(m_pxInterImg, 94, 95, m_rcMain.left+616, m_rcMain.top+66); // 弊缝.
- m_xInterBtn[ 6].CreateGameBtn(m_pxInterImg, 96, 97, m_rcMain.left+616, m_rcMain.top+102); // 巩颇.
- m_xInterBtn[ 7].CreateGameBtn(m_pxInterImg, 52, 53, m_rcMain.left+397, m_rcMain.top+13); // 骇飘 UP, DOWN.
- m_xInterBtn[ 8].CreateGameBtn(m_pxInterImg,100, 101, m_rcMain.left+703, m_rcMain.top+34); // 胶懦芒.
- m_xInterBtn[ 9].CreateGameBtn(m_pxInterImg,102, 103, m_rcMain.left+718, m_rcMain.top+50); // 盲泼扑诀.
- m_xInterBtn[10].CreateGameBtn(m_pxInterImg,104, 105, m_rcMain.left+718, m_rcMain.top+88); // 涅胶飘.
- m_xInterBtn[11].CreateGameBtn(m_pxInterImg,106, 107, m_rcMain.left+703, m_rcMain.top+103); // 可记.
- m_xInterBtn[12].CreateGameBtn(m_pxInterImg,108, 109, m_rcMain.left+664, m_rcMain.top+104); // 档框富.
- m_xInterBtn[13].CreateGameBtn(m_pxInterImg,110, 111, m_rcMain.left+648, m_rcMain.top+88); // 富芒.
- m_xInterBtn[14].CreateGameBtn(m_pxInterImg,112, 113, m_rcMain.left+648, m_rcMain.top+50); // 啊规芒.
- m_xInterBtn[15].CreateGameBtn(m_pxInterImg,114, 115, m_rcMain.left+665, m_rcMain.top+34); // 惑怕芒.
- //------------------------------------------------------------------------------------------------------------
- m_xScrlBar.CreateScrlBar(m_pxInterImg, 68, _MAX_CHATLINE, 12, 84, 12);
- m_xMsgBox.Load(&m_xInterImgEx); // 侩扁
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::MsgAdd()
- 累己磊 :
- 累己老 :
- 格利 :
- 涝仿 : DWORD dwFontColor
- DWORD dwFontBackColor
- CHAR* pszMsg
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::MsgAdd(DWORD dwFontColor, DWORD dwFontBackColor, CHAR* pszMsg)
- {
- if ( pszMsg )
- {
- if ( pszMsg[0] != NULL )
- {
- INT nCnt;
- CHAT stChat;
- INT nLineCnt;
- CHAR pszDivied[MAX_PATH*2];
- CHAR pszArg[5][MAX_PATH];
- m_xChatPopWnd.MsgAdd(dwFontColor, dwFontBackColor, pszMsg);
- ZeroMemory(pszDivied, MAX_PATH*2);
- ZeroMemory(pszArg, MAX_PATH*5);
- g_xMainWnd.StringDivide(m_rcChat.right-m_rcChat.left, nLineCnt, pszMsg, pszDivied);
- sscanf(pszDivied, "%[^`]%*c %[^`]%*c %[^`]%*c %[^`]%*c %[^`]%*c", pszArg[0], pszArg[1], pszArg[2], pszArg[3], pszArg[4]);
- if ( nLineCnt > 5 )
- {
- nLineCnt = 5;
- }
- // 巩磊凯 火涝.
- for ( nCnt = 0; nCnt < nLineCnt; nCnt++ )
- {
- // 沫捞 促澜栏肺 哎炼扒.
- if ( m_xChat.GetCounter() - m_nFstLine == _MAX_CHATLINE )
- {
- m_nFstLine++;
- }
- stChat.dwFontColor = dwFontColor;
- stChat.dwBackColor = dwFontBackColor;
- strcpy(stChat.pszChat, pszArg[nCnt]);
- m_xChat.AddNode(stChat);
- }
- // 弥措历厘扼牢 八荤秦辑 弊捞惑捞搁 昏力茄促.
- while ( m_xChat.GetCounter() >= 50 )
- {
- m_xChat.MoveCurrentToTop();
- m_xChat.DeleteCurrentNode();
- if ( m_nFstLine > 0 )
- m_nFstLine--;
- }
- }
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::ShowWndList()
- 累己磊 :
- 累己老 :
- 格利 : Active登绢乐绰 扩档快狼 府胶飘甫 焊咯霖促.
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::ShowWndList()
- {
- if ( m_xWndOrderList.GetCounter() != 0 )
- {
- m_xWndOrderList.MoveCurrentToTop();
- INT* pnCurrID;
- for ( INT nCnt = 0; nCnt < m_xWndOrderList.GetCounter(); nCnt++ )
- {
- pnCurrID = m_xWndOrderList.GetCurrentData();
- switch ( *pnCurrID )
- {
- case _WND_ID_INVENTORY:
- m_xInventoryWnd.ShowInventoryWnd();
- break;
- case _WND_ID_STATUS:
- m_xStatusWnd.ShowStatusWnd();
- break;
- case _WND_ID_STORE:
- m_xStoreWnd.ShowStoreWnd();
- break;
- case _WND_ID_EXCHANGE:
- m_xExchangeWnd.ShowExchangeWnd();
- break;
- case _WND_ID_GUILDMASTER:
- m_xGuildMasterWnd.ShowGuildMasterWnd();
- break;
- case _WND_ID_GUILD:
- m_xGuildWnd.ShowGuildWnd();
- break;
- case _WND_ID_GROUP:
- m_xGroupWnd.ShowGroupWnd();
- break;
- case _WND_ID_GROUPPOP:
- m_xGroupPopWnd.ShowGroupPopWnd();
- break;
- case _WND_ID_CHATPOP:
- m_xChatPopWnd.ShowChatPopWnd();
- break;
- case _WND_ID_NPCCHAT: // 侩扁
- m_xNPCWnd.ShowNPCChatWnd();
- break;
- case _WND_ID_QUEST:
- m_xQuestWnd.ShowQuestWnd();
- break;
- case _WND_ID_OPTION:
- m_xOptionWnd.ShowOptionWnd();
- break;
- case _WND_ID_HORSE:
- m_xHorseWnd.ShowHorseWnd();
- break;
- }
- m_xWndOrderList.MoveNextNode();
- }
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::ShowChatList()
- 累己磊 :
- 累己老 :
- 格利 : 盲泼 府胶飘甫 焊咯霖促.
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::ShowChatList()
- {
- if ( !m_xChat.CheckEmpty() )
- {
- INT nCnt, nShowLine;
- LPCHAT pstChat;
- m_xChat.MoveCurrentToTop();
- m_xChat.MoveNode(m_nFstLine);
- nShowLine = ((m_xChat.GetCounter() - m_nFstLine ) >= _MAX_CHATLINE) ? _MAX_CHATLINE : m_xChat.GetCounter() - m_nFstLine;
-
- for ( nCnt = 0; nCnt < nShowLine; nCnt++ )
- {
- pstChat = m_xChat.GetCurrentData();
- g_xMainWnd.PutsHan(g_xMainWnd.GetBackBuffer(),
- m_rcChat.left, m_rcChat.top+nCnt*15,
- pstChat->dwBackColor, pstChat->dwFontColor, pstChat->pszChat);
- m_xChat.MoveNextNode();
- }
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::RenderInterface()
- 累己磊 :
- 累己老 :
- 格利 :
- 涝仿 : INT nLoopTime
- POINT ptMousePos
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::RenderInterface(INT nLoopTime, POINT ptMousePos)
- {
- INT nX, nY, nCnt;
- // 扩档快.
- ShowWndList();
- // 付快胶 酒捞袍.
- if ( m_stCommonItem.bSetted && !m_stCommonItem.bIsHideItem )
- {
- nX = ptMousePos.x - _INVENTORY_CELL_WIDTH /2;
- nY = ptMousePos.y - _INVENTORY_CELL_HEIGHT/2;
- m_stCommonItem.xItem.DrawItem(nX, nY);
- }
- // 骇飘酒捞袍.
- ShowBeltItem();
- // 皋牢牢磐其捞胶.
- if ( m_pxInterImg->NewSetIndex(_WNDIMGIDX_MAIN) )
- {
- g_xMainWnd.DrawWithImageForCompClipRgn(m_rcMain.left, m_rcMain.top, m_rcMain.right-m_rcMain.left, m_rcMain.bottom-m_rcMain.top,
- (WORD*)m_pxInterImg->m_pbCurrImage, _CLIP_WIDTH, 600);
- }
- // 盲泼府胶飘.
- ShowChatList();
- // 惑怕摹.
- ShowGameStatus();
- // 滚瓢.
- for ( nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++)
- {
- m_xInterBtn[nCnt].ShowGameBtn();
- }
- // 胶农费官.
- m_xScrlBar.ShowScrlBar(584, 404, m_nFstLine, m_xChat.GetCounter());
- // 努扼捞攫飘皋矫瘤(哭率惑窜).
- m_xClientSysMsg.ShowSysMsg(nLoopTime, 30, 30);
- // 侩扁
- m_xMsgBox.RenderMessageBox(0);
- ShowMagicKey();
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::ShowBeltItem()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::ShowBeltItem()
- {
- INT nX, nY;
- if ( m_bBeltState == _BELT_STATE_UP )
- {
- m_shBeltHeight += 10;
- if ( m_shBeltHeight >= 46 )
- {
- m_shBeltHeight = 46;
- }
- }
- else if ( m_bBeltState == _BELT_STATE_DOWN )
- {
- m_shBeltHeight -= 10;
- if ( m_shBeltHeight <= 0 )
- {
- m_shBeltHeight = 0;
- m_bBeltState = _BELT_STATE_STAY;
- }
- }
- if ( m_bBeltState != _BELT_STATE_STAY )
- {
- if ( m_pxInterImg->NewSetIndex(_IMGIDX_BELT) )
- {
- g_xMainWnd.DrawWithImageForCompClipRgn(275, 457-m_shBeltHeight,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
- (WORD*)m_pxInterImg->m_pbCurrImage, _CLIP_WIDTH, 600);
- // 骇飘 酒捞袍 弊府扁.
- for ( INT nCnt = 0; nCnt < _MAX_BELT_ITEM; nCnt++ )
- {
- if ( m_xInventoryWnd.m_stBeltItem[nCnt].bSetted )
- {
- nX = 275 + 8 + nCnt*40;
- nY = 411 + 6 + 46 - m_shBeltHeight;
- m_xInventoryWnd.m_stBeltItem[nCnt].xItem.DrawItem(nX, nY);
- }
- }
- }
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::ShowGameStatus()
- 累己磊 :
- 累己老 :
- 格利 :
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::ShowGameStatus()
- {
- FLOAT fMyHPRate;
- FLOAT fMyMPRate;
- FLOAT fMyWetRate;
- FLOAT fMyExpRate;
- WORD wJobIcon;
- WORD wImgNum;
- CHAR pszBuff[MAX_PATH];
- RECT rcStats;
- DWORD dwFntClr;
- BYTE bMyJob = g_xGameProc.m_xMyHero.m_bJob;
- BYTE bMyLevel= g_xGameProc.m_xMyHero.m_stAbility.bLevel;
- WORD wMyAC = g_xGameProc.m_xMyHero.m_stAbility.wAC;
- WORD wMyDC = g_xGameProc.m_xMyHero.m_stAbility.wDC;
- WORD wMyMC = g_xGameProc.m_xMyHero.m_stAbility.wMC;
- WORD wMySC = g_xGameProc.m_xMyHero.m_stAbility.wSC;
- BYTE bDay = g_xGameProc.m_bDayState;
- WORD wHP = g_xGameProc.m_xMyHero.m_stAbility.wHP;
- WORD wMP = g_xGameProc.m_xMyHero.m_stAbility.wMP;
- WORD wWet = g_xGameProc.m_xMyHero.m_stAbility.wWeight;
- DWORD dwExp = g_xGameProc.m_xMyHero.m_stAbility.dwExp;
- BYTE bJob = g_xGameProc.m_xMyHero.m_bJob;
-
- // 窍风狼 惑怕摹(广, 撤, 历翅, 货寒)
- switch ( bDay )
- {
- case _DAYSTATE_DAY:
- wImgNum = 130;
- break;
- case _DAYSTATE_DUSK:
- wImgNum = 131;
- break;
- case _DAYSTATE_NIGHT:
- wImgNum = 132;
- break;
- case _DAYSTATE_DAWN:
- wImgNum = 133;
- break;
- }
- if ( m_pxInterImg->NewSetIndex(wImgNum) )
- {
- g_xMainWnd.DrawWithImageForComp(m_rcMain.left+684, m_rcMain.top+70,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
- (WORD*)m_pxInterImg->m_pbCurrImage, _CLIP_WIDTH, 600);
- }
- // HP, MP嘛扁.
- // 厚啦八荤.
- if ( wHP )
- {
- fMyHPRate = (FLOAT)((FLOAT)wHP/(FLOAT)g_xGameProc.m_xMyHero.m_stAbility.wMaxHP);
- if ( fMyHPRate > 1.0f )
- {
- fMyHPRate = 1.0f;
- }
- }
- else
- {
- fMyHPRate = 0;
- }
- if ( wMP )
- {
- fMyMPRate = (FLOAT)((FLOAT)wMP/(FLOAT)g_xGameProc.m_xMyHero.m_stAbility.wMaxMP);
- if ( fMyMPRate > 1.0f )
- {
- fMyMPRate = 1.0f;
- }
- }
- else
- {
- fMyMPRate = 0;
- }
- if ( dwExp )
- {
- fMyExpRate = (FLOAT)((FLOAT)dwExp/(FLOAT)g_xGameProc.m_xMyHero.m_stAbility.dwMaxExp);
- if ( fMyExpRate > 1.0f )
- {
- fMyExpRate = 1.0f;
- }
- }
- else
- {
- fMyExpRate = 0;
- }
- if ( wWet )
- {
- fMyWetRate = (FLOAT)((FLOAT)wWet /(FLOAT)g_xGameProc.m_xMyHero.m_stAbility.wMaxWeight);
- if ( fMyWetRate > 1.0f )
- {
- fMyWetRate = 1.0f;
- }
- }
- else
- {
- fMyWetRate = 0;
- }
- if ( m_pxInterImg->NewSetIndex(60) )
- {
- RECT rcHP = { 0, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight-(m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight*fMyHPRate),
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight };
- g_xMainWnd.DrawWithImageForComp(m_rcMain.left+46, m_rcMain.top+34, rcHP, (WORD*)m_pxInterImg->m_pbCurrImage);
- }
- if ( m_pxInterImg->NewSetIndex(61) )
- {
- RECT rcMP = { 0, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight-(m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight*fMyMPRate),
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight };
- g_xMainWnd.DrawWithImageForComp(m_rcMain.left+104, m_rcMain.top+34, rcMP, (WORD*)m_pxInterImg->m_pbCurrImage);
- }
- // EXP, WET 嘛扁.
- if ( m_pxInterImg->NewSetIndex(63) )
- {
- RECT rcEXP = { 0, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight-(m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight*fMyExpRate),
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight };
- g_xMainWnd.DrawWithImageForComp(m_rcMain.left+76, m_rcMain.top+35, rcEXP, (WORD*)m_pxInterImg->m_pbCurrImage);
- }
- if ( m_pxInterImg->NewSetIndex(67) )
- {
- RECT rcWET = { 0, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight-(m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight*fMyWetRate),
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight };
- g_xMainWnd.DrawWithImageForComp(m_rcMain.left+211, m_rcMain.top+35, rcWET, (WORD*)m_pxInterImg->m_pbCurrImage);
- }
- dwFntClr = RGB(225, 225, 0);
- // 饭骇嘛6扁.
- sprintf(pszBuff, "%d", g_xGameProc.m_xMyHero.m_stAbility.bLevel);
- SetRect(&rcStats, 693, 528, 709, 544);
- g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff, g_xMainWnd.CreateGameFont("泵辑眉", 10, 0, FW_BOLD));
- dwFntClr = RGB(255, 255, 200);
- // 甘捞抚 棺 谅钎嘛扁.
- sprintf(pszBuff, "%s : [%d,%d]", g_xGameProc.m_szMapName, g_xGameProc.m_xMyHero.m_wPosX, g_xGameProc.m_xMyHero.m_wPosY);
- SetRect(&rcStats, 219, 584, 379, 599);
- g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff);
- dwFntClr = RGB(255, 200, 50);
- // 流诀喊 酒捞能棺 漂己摹 嘛扁.
- sprintf(pszBuff, "%d-%d", LOBYTE(wMyAC), HIBYTE(wMyAC));
- SetRect(&rcStats, 422, 584, 483, 599);
- g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff);
- SetRect(&rcStats, 520, 584, 581, 599);
- switch ( bJob )
- {
- case _JOB_DOSA:
- {
- wJobIcon = 66;
- wImgNum = 123;
- sprintf(pszBuff, "%d-%d", LOBYTE(wMySC), HIBYTE(wMySC));
- g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff);
- }
- break;
- case _JOB_SULSA:
- {
- wJobIcon = 65;
- wImgNum = 124;
- sprintf(pszBuff, "%d-%d", LOBYTE(wMyMC), HIBYTE(wMyMC));
- g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff);
- }
- break;
- case _JOB_JUNSA:
- {
- wJobIcon = 64;
- wImgNum = 122;
- sprintf(pszBuff, "%d-%d", LOBYTE(wMyDC), HIBYTE(wMyDC));
- g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff);
- }
- break;
- }
- if ( m_pxInterImg->NewSetIndex(wJobIcon) )
- {
- g_xMainWnd.DrawWithImageForComp(m_rcMain.left+82, m_rcMain.top+71,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
- (WORD*)m_pxInterImg->m_pbCurrImage);
- }
- // AC嘛扁.
- if ( m_pxInterImg->NewSetIndex(120) )
- {
- g_xMainWnd.DrawWithImageForComp(m_rcMain.left+391, m_rcMain.top+136,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
- (WORD*)m_pxInterImg->m_pbCurrImage);
- }
- // DC, MC, SC
- if ( m_pxInterImg->NewSetIndex(wImgNum) )
- {
- g_xMainWnd.DrawWithImageForComp(m_rcMain.left+487, m_rcMain.top+136,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
- (WORD*)m_pxInterImg->m_pbCurrImage);
- }
- }
- VOID CInterface::ShowMagicKey()
- {
- if ( m_bShowKey )
- {
- INT nCnt;
- for ( nCnt = 0; nCnt < 8; nCnt++ )
- {
- if ( m_pxInterImg->NewSetIndex(70+nCnt) )
- {
- g_xMainWnd.DrawWithABlendCompDataWithBackBuffer(nCnt*m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, 0,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
- m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
- (WORD*)m_pxInterImg->m_pbCurrImage, _CLIP_WIDTH, 600);
- }
- }
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // 扩档快 包府何盒/////////////////////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /******************************************************************************************************************
- 窃荐疙 : CInterface::GetWindowInMousePos()
- 累己磊 :
- 累己老 :
- 格利 : 付快胶 器牢磐甫 康开救俊 啊瘤绊 乐绰 扩档快府胶飘吝 盖贸澜 扩档快狼 ID甫 府畔茄促.
- 涝仿 : POINT ptMouse
- 免仿 :
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- INT CInterface::GetWindowInMousePos(POINT ptMouse)
- {
- if ( m_xWndOrderList.GetCounter() != 0 )
- {
- RECT rcWnd;
- INT* pnCurrID;
- m_xWndOrderList.MoveCurrentToTail();
- for ( INT nCnt = m_xWndOrderList.GetCounter()-1; nCnt >= 0 ; nCnt-- )
- {
- pnCurrID = m_xWndOrderList.GetCurrentData();
- switch ( *pnCurrID )
- {
- case _WND_ID_INVENTORY:
- rcWnd = m_xInventoryWnd.GetGameWndRect();
- break;
- case _WND_ID_STATUS:
- rcWnd = m_xStatusWnd.GetGameWndRect();
- break;
- case _WND_ID_STORE:
- rcWnd = m_xStoreWnd.GetGameWndRect();
- break;
- case _WND_ID_EXCHANGE:
- rcWnd = m_xExchangeWnd.GetGameWndRect();
- break;
- case _WND_ID_GUILDMASTER:
- rcWnd = m_xGuildMasterWnd.GetGameWndRect();
- break;
- case _WND_ID_GUILD:
- rcWnd = m_xGuildWnd.GetGameWndRect();
- break;
- case _WND_ID_GROUP:
- rcWnd = m_xGroupWnd.GetGameWndRect();
- break;
- case _WND_ID_GROUPPOP:
- rcWnd = m_xGroupPopWnd.GetGameWndRect();
- break;
- case _WND_ID_CHATPOP:
- rcWnd = m_xChatPopWnd.GetGameWndRect();
- break;
- case _WND_ID_NPCCHAT: // 侩扁
- rcWnd = m_xNPCWnd.GetGameWndRect();
- break;
- case _WND_ID_QUEST:
- rcWnd = m_xQuestWnd.GetGameWndRect();
- break;
- case _WND_ID_OPTION:
- rcWnd = m_xOptionWnd.GetGameWndRect();
- break;
- case _WND_ID_HORSE:
- rcWnd = m_xHorseWnd.GetGameWndRect();
- break;
- }
- if ( PtInRect(&rcWnd, ptMouse) )
- {
- return *pnCurrID;
- }
- m_xWndOrderList.MovePreviousNode();
- }
- }
- return -1;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::AddWindowToList()
- 累己磊 :
- 累己老 :
- 格利 : 扩档快府胶飘狼 盖 付瘤阜俊 泅犁 涝仿罐篮 酒捞叼啊 nID牢 扩档快甫 眠啊茄促.
- 涝仿 : INT nID
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::AddWindowToList(INT nID)
- {
- m_xWndOrderList.AddNode(nID);
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::DeleteWindowToList()
- 累己磊 :
- 累己老 :
- 格利 : nID狼 酒捞叼甫 啊柳 扩档快甫 府胶飘惑俊辑 昏力茄促.
- 涝仿 : INT nID
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::DeleteWindowToList(INT nID)
- {
- if ( m_xWndOrderList.GetCounter() != 0 )
- {
- m_xWndOrderList.MoveCurrentToTop();
- INT* pnCurrID;
- for ( INT nCnt = 0; nCnt < m_xWndOrderList.GetCounter(); nCnt++ )
- {
- pnCurrID = m_xWndOrderList.GetCurrentData();
- if ( *pnCurrID == nID )
- {
- m_xWndOrderList.DeleteCurrentNode();
- break;
- }
- m_xWndOrderList.MoveNextNode();
- }
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::WindowActivate()
- 累己磊 :
- 累己老 :
- 格利 : nID牢 扩档快甫 扩档快府胶飘俊 眠啊矫虐芭唱 昏力矫虐哥, 眠啊狼 版快, 扩档快狼 惑怕甫 弥惑困 惑怕肺 技泼茄促.
- 扩档快啊 虐涝仿阑 罐酒辑 拳搁俊 唱棵锭 龋免窍绰 窃荐捞促.
- 涝仿 : INT nID
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInterface::WindowActivate(INT nID)
- {
- // 货肺款 扩档快俊 器目胶甫 林扁困秦辑 葛电 扩档快狼 器目胶甫 FALSE矫难霖促.
- BOOL bRet = FALSE;
- AllWindowsFocusOff();
- switch ( nID )
- {
- case _WND_ID_INVENTORY:
- {
- if ( m_xInventoryWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_INVENTORY);
- m_xInventoryWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_INVENTORY);
- m_xInventoryWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_STATUS:
- {
- if ( m_xStatusWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_STATUS);
- m_xStatusWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_STATUS);
- m_xStatusWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_STORE:
- {
- if ( m_xStoreWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_STORE);
- m_xStoreWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_STORE);
- m_xStoreWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_EXCHANGE:
- {
- if ( m_xExchangeWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_EXCHANGE);
- m_xExchangeWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_EXCHANGE);
- m_xExchangeWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_QUEST:
- {
- if ( m_xQuestWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_QUEST);
- m_xQuestWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_QUEST);
- m_xQuestWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_OPTION:
- {
- if ( m_xOptionWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_OPTION);
- m_xOptionWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_OPTION);
- m_xOptionWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_HORSE:
- {
- if ( m_xHorseWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_HORSE);
- m_xHorseWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_HORSE);
- m_xHorseWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_GUILDMASTER:
- {
- if ( m_xGuildMasterWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_GUILDMASTER);
- m_xGuildMasterWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_GUILDMASTER);
- m_xGuildMasterWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_GUILD:
- {
- if ( m_xGuildWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_GUILD);
- m_xGuildWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_GUILD);
- m_xGuildWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_GROUP:
- {
- if ( m_xGroupWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_GROUP);
- m_xGroupWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_GROUP);
- m_xGroupWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_GROUPPOP:
- {
- if ( m_xGroupPopWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_GROUPPOP);
- m_xGroupPopWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- AddWindowToList(_WND_ID_GROUPPOP);
- m_xGroupPopWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_CHATPOP:
- {
- if ( m_xChatPopWnd.GetGameWndActive() )
- {
- MoveWindow(g_xChatEditBox.GetSafehWnd(), g_xMainWnd.m_rcWindow.left+_INPUT_EDITWND_XPOS,
- g_xMainWnd.m_rcWindow.top+_INPUT_EDITWND_YPOS, _INPUT_EDITWND_WIDTH, _INPUT_EDITWND_HEIGHT, TRUE);
- DeleteWindowToList(_WND_ID_CHATPOP);
- m_xChatPopWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- MoveWindow(g_xChatEditBox.GetSafehWnd(), g_xMainWnd.m_rcWindow.left + m_xChatPopWnd.m_rcWnd.left + m_xChatPopWnd.m_rcEditBoxFrame.left,
- g_xMainWnd.m_rcWindow.top + m_xChatPopWnd.m_rcWnd.top + m_xChatPopWnd.m_rcEditBoxFrame.top,
- m_xChatPopWnd.m_rcEditBoxFrame.right - m_xChatPopWnd.m_rcEditBoxFrame.left,
- m_xChatPopWnd.m_rcEditBoxFrame.bottom - m_xChatPopWnd.m_rcEditBoxFrame.top, TRUE);
- SetFocus(g_xChatEditBox.GetSafehWnd());
- AddWindowToList(_WND_ID_CHATPOP);
- m_xChatPopWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- case _WND_ID_NPCCHAT: // 侩扁
- {
- if ( m_xNPCWnd.GetGameWndActive() )
- {
- DeleteWindowToList(_WND_ID_NPCCHAT);
- // m_xNPCWnd.CloseWnd();
- m_xNPCWnd.SetGameWndActive(FALSE);
- bRet = FALSE;
- }
- else
- {
- // 烙矫
- AddWindowToList(_WND_ID_NPCCHAT);
- // m_xNPCWnd.SetNPCStr("窍疵阑 快矾矾 茄痢 何掺烦 绝扁甫 蕾技俊捞绰 官恩俊档 唱绰 鲍肺况 沁促 <喊/@STAR>阑 畴贰窍绰 付澜栏肺 葛电 磷绢 啊绰巴阑 <荤尔/@LOVE>秦具瘤 弊府绊 肚 唱俊霸 林况 柳辨阑 吧绢 啊具 摆促. 坷疵 广俊档 喊捞 官恩俊 胶摹款促. 悼秦拱苞 归滴魂捞 付福绊 催配废 窍蠢丛捞 焊快窍荤 快府唱扼 父技 公泵拳 伙玫府 拳妨碍魂 措茄荤恩 措茄栏肺 辨捞 焊傈窍技. 矫阁 呈绰 酒蠢衬 辫逛 糠备府 避绰 家府绰 矫阁 呈绰 酒蠢衬 避带 糠备府 磐瘤绰 家府甫 呈公唱档 酒抚促款 弊家府甫 沥惩 呈绰 葛福绰 巴捞衬n <巩颇甫 积己秦杭鳖?/@@buildguildnow> n <辆丰/@end>",0);
- m_xNPCWnd.SetGameWndActive(TRUE);
- bRet = TRUE;
- }
- }
- break;
- }
- return bRet;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::MoveTopWindow()
- 累己磊 :
- 累己老 :
- 格利 : 盖困狼 扩档快甫 付快胶 谅钎肺 捞悼矫挪促.
- 涝仿 : POINT ptMouse
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::MoveTopWindow(POINT ptMouse)
- {
- if ( m_xWndOrderList.GetCounter() != 0 )
- {
- INT* pnCurrID;
- m_xWndOrderList.MoveCurrentToTail();
- pnCurrID = m_xWndOrderList.GetCurrentData();
- if ( m_bMoveFocusedWnd )
- {
- switch ( *pnCurrID )
- {
- case _WND_ID_INVENTORY:
- m_xInventoryWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_STATUS:
- m_xStatusWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_STORE:
- m_xStoreWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_EXCHANGE:
- m_xExchangeWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_GUILDMASTER:
- m_xGuildMasterWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_GUILD:
- m_xGuildWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_GROUP:
- m_xGroupWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_GROUPPOP:
- m_xGroupPopWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_CHATPOP:
- m_xChatPopWnd.MoveGameWnd(ptMouse);
- ShowWindow(g_xChatEditBox.GetSafehWnd(), SW_HIDE);
- break;
- case _WND_ID_NPCCHAT: // 侩扁
- m_xNPCWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_QUEST:
- m_xQuestWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_OPTION:
- m_xOptionWnd.MoveGameWnd(ptMouse);
- break;
- case _WND_ID_HORSE:
- m_xHorseWnd.MoveGameWnd(ptMouse);
- break;
- }
- }
- }
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::WindowFocusChanged()
- 累己磊 :
- 累己老 :
- 格利 : 扩档快 康开栏肺 付快胶 努腐捞 登搁 泅犁 Top 扩档快甫 付快胶 努腐 扩档快肺 官层林绊 弊扩档快肺 器目胶甫 嘎苗霖促.
- 涝仿 : INT nID
- 免仿 : VOID
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- VOID CInterface::WindowFocusChangedAndSetReadyMove(INT nID, POINT ptMouse)
- {
- if ( m_xWndOrderList.GetCounter() != 0 )
- {
- AllWindowsFocusOff();
- DeleteWindowToList(nID);
- AddWindowToList(nID);
- // 付快胶 努腐捞 等惑怕捞搁 捞悼矫懦 霖厚啊 等惑怕捞促.
- m_bMoveFocusedWnd = TRUE;
- switch ( nID )
- {
- case _WND_ID_INVENTORY:
- m_xInventoryWnd.SetGameWndFocused(TRUE);
- m_xInventoryWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_STATUS:
- m_xStatusWnd.SetGameWndFocused(TRUE);
- m_xStatusWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_STORE:
- m_xStoreWnd.SetGameWndFocused(TRUE);
- m_xStoreWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_EXCHANGE:
- m_xExchangeWnd.SetGameWndFocused(TRUE);
- m_xExchangeWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_GUILDMASTER:
- m_xGuildMasterWnd.SetGameWndFocused(TRUE);
- m_xGuildMasterWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_GUILD:
- m_xGuildWnd.SetGameWndFocused(TRUE);
- m_xGuildWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_GROUP:
- m_xGroupWnd.SetGameWndFocused(TRUE);
- m_xGroupWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_GROUPPOP:
- m_xGroupPopWnd.SetGameWndFocused(TRUE);
- m_xGroupPopWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_CHATPOP:
- m_xChatPopWnd.SetGameWndFocused(TRUE);
- m_xChatPopWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_NPCCHAT: // 侩扁
- m_xNPCWnd.SetGameWndFocused(TRUE);
- m_xNPCWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_QUEST:
- m_xQuestWnd.SetGameWndFocused(TRUE);
- m_xQuestWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_OPTION:
- m_xOptionWnd.SetGameWndFocused(TRUE);
- m_xOptionWnd.SetReadyMove(ptMouse);
- break;
- case _WND_ID_HORSE:
- m_xHorseWnd.SetGameWndFocused(TRUE);
- m_xHorseWnd.SetReadyMove(ptMouse);
- break;
- }
- }
- }
- VOID CInterface::AllWindowsFocusOff()
- {
- if ( m_xWndOrderList.GetCounter() != 0 )
- {
- m_xWndOrderList.MoveCurrentToTop();
- INT* pnCurrID;
- for ( INT nCnt = 0; nCnt < m_xWndOrderList.GetCounter(); nCnt++ )
- {
- pnCurrID = m_xWndOrderList.GetCurrentData();
- switch ( *pnCurrID )
- {
- case _WND_ID_INVENTORY:
- m_xInventoryWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_STATUS:
- m_xStatusWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_STORE:
- m_xStoreWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_EXCHANGE:
- m_xExchangeWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_GUILDMASTER:
- m_xGuildMasterWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_GUILD:
- m_xGuildWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_GROUP:
- m_xGroupWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_GROUPPOP:
- m_xGroupPopWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_CHATPOP:
- m_xChatPopWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_NPCCHAT: // 侩扁
- m_xNPCWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_QUEST:
- m_xQuestWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_OPTION:
- m_xOptionWnd.SetGameWndFocused(FALSE);
- break;
- case _WND_ID_HORSE:
- m_xHorseWnd.SetGameWndFocused(FALSE);
- break;
- }
- m_xWndOrderList.MoveNextNode();
- }
- }
- }
- BOOL CInterface::IsTopWindow(INT nID)
- {
- if ( m_xWndOrderList.GetCounter() != 0 )
- {
- INT* pnCurrID;
- m_xWndOrderList.MoveCurrentToTail();
- pnCurrID = m_xWndOrderList.GetCurrentData();
- if ( nID == *pnCurrID )
- return TRUE;
- }
- return FALSE;
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // 皋矫瘤 涝仿包访何盒/////////////////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /******************************************************************************************************************
- 窃荐疙 : CInterface::OnLButtonDown()
- 累己磊 :
- 累己老 :
- 格利 : Mouse LButtonDown捞 老绢车阑锭 牢磐其捞胶俊辑 且老阑 沥狼茄促.
- 涝仿 : POINT ptMouse
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInterface::OnLButtonDown(POINT ptMouse)
- {
- if(m_xMsgBox.IsActive()) // 侩扁
- {
- m_xMsgBox.OnButtonDown(ptMouse);
- return TRUE;
- }
- else
- {
- if ( m_xScrlBar.OnLButtonDown(ptMouse) )
- {
- FLOAT fScrlRate;
- fScrlRate = m_xScrlBar.GetScrlRate();
- m_nFstLine = (m_xChat.GetCounter()-1)*fScrlRate;
- return TRUE;
- }
- for( INT nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++ )
- {
- if ( m_xInterBtn[nCnt].OnLButtonDown(ptMouse) )
- return TRUE;
- }
- INT nInterfaceWndInRect;
- nInterfaceWndInRect = GetWindowInMousePos(ptMouse);
- if ( nInterfaceWndInRect != -1 )
- {
- switch ( nInterfaceWndInRect )
- {
- case _WND_ID_INVENTORY:
- if ( !m_xInventoryWnd.OnLButtonDown(&m_stCommonItem, ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_STATUS:
- if ( !m_xStatusWnd.OnLButtonDown(&m_stCommonItem, ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_STORE:
- if ( !m_xStoreWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_EXCHANGE:
- if ( !m_xExchangeWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_GUILDMASTER:
- if ( !m_xGuildMasterWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_GUILD:
- if ( !m_xGuildWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_GROUP:
- if ( !m_xGroupWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_GROUPPOP:
- if ( !m_xGroupPopWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_CHATPOP:
- if ( !m_xChatPopWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_NPCCHAT: // 侩扁
- if ( !m_xNPCWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_QUEST:
- if ( !m_xQuestWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_OPTION:
- if ( !m_xOptionWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- case _WND_ID_HORSE:
- if ( !m_xHorseWnd.OnLButtonDown(ptMouse) )
- WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
- break;
- }
- return TRUE;
- }
- else
- AllWindowsFocusOff();
- }
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::OnLButtonUp()
- 累己磊 :
- 累己老 :
- 格利 : Mouse LButtonUp捞 老绢车阑锭 牢磐其捞胶俊辑 且老阑 沥狼茄促.
- 涝仿 : POINT ptMouse
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInterface::OnLButtonUp(POINT ptMouse)
- {
- m_bMoveFocusedWnd = FALSE;
- if ( m_xMsgBox.IsActive() ) // 侩扁
- {
- HRESULT hResult;
- hResult = m_xMsgBox.OnButtonUp(ptMouse);
- if ( hResult != 0 )
- {
- switch ( m_nIdxMsgBox )
- {
- case 12:
- {
- switch ( hResult ) // 俊叼飘 冠胶啊 绝澜.
- {
- case 2:
- {
- DWORD dwCurrTick = timeGetTime();
- if ( (dwCurrTick - g_xGameProc.m_xMyHero.m_dwLastPKStruckTime> 10000) &&
- (dwCurrTick - g_xGameProc.m_xMyHero.m_dwLastMagicTime > 10000) &&
- (dwCurrTick - g_xGameProc.m_xMyHero.m_dwLastHitTime > 10000) ||
- (g_xGameProc.m_xMyHero.m_bCurrMtn == _MT_DIE ) )
- SendMessage(g_xMainWnd.GetSafehWnd(), WM_DESTROY, NULL, NULL);
- else
- {
- DWORD dwFont, dwBack;
- dwFont = GetChatColor(3);
- dwBack = GetChatColor(2);
- MsgAdd(dwFont, dwBack, "傈捧吝俊绰 立加阑 谗阑 荐 绝嚼聪促.");
- }
- }
- break;
- case 4:
- m_xMsgBox.HideMessageBox();
- break;
- }
- }
- break;
- }
- }
- }
- else
- {
- if ( m_xScrlBar.OnLButtonUp(ptMouse) )
- {
- return TRUE;
- }
- for( INT nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++ )
- {
- if ( m_xInterBtn[nCnt].OnLButtonUp(ptMouse) )
- {
- switch ( nCnt )
- {
- case _BTN_ID_QUEST: WindowActivate(_WND_ID_QUEST); break;
- case _BTN_ID_OPTION: WindowActivate(_WND_ID_OPTION); break;
- case _BTN_ID_HORSE: WindowActivate(_WND_ID_HORSE); break;
- case _BTN_ID_CHANGE: WindowActivate(_WND_ID_EXCHANGE); break;
- case _BTN_ID_GUILD:
- g_xClientSocket.SendGuildHome();
- break;
- case _BTN_ID_GROUP: WindowActivate(_WND_ID_GROUP); break;
- case _BTN_ID_POPUP: WindowActivate(_WND_ID_CHATPOP); break;
- case _BTN_ID_BAG: WindowActivate(_WND_ID_INVENTORY); break;
- case _BTN_ID_MUGONG: m_bShowKey = !m_bShowKey; break;
- case _BTN_ID_BELT:
- {
- if ( m_shBeltHeight >= 46 )
- {
- m_shBeltHeight = 46;
- }
- else if ( m_shBeltHeight <= 0 )
- {
- m_shBeltHeight = 0;
- }
- if ( m_shBeltHeight == 46 )
- {
- m_bBeltState = _BELT_STATE_DOWN;
- }
- else if ( m_shBeltHeight == 0 )
- {
- m_bBeltState = _BELT_STATE_UP;
- }
- }
- break;
- case _BTN_ID_EXIT:
- {
- CHAR szMsg[MAX_PATH];
- HINSTANCE hLib;
- m_nIdxMsgBox = 12;
- hLib = LoadLibrary("Ats.dll"); // Load Dll
- LoadString(hLib,m_nIdxMsgBox,szMsg, MAX_PATH);
- FreeLibrary(hLib);
- m_xMsgBox.ShowMessageBox(szMsg, 2); // YES/No ?
- }
- break;
- case _BTN_ID_MAGIC:
- if ( m_xStatusWnd.GetStatusWndType() != _TYPE_SETMAGIC )
- {
- if ( !WindowActivate(_WND_ID_STATUS) ) WindowActivate(_WND_ID_STATUS);
- }
- else
- WindowActivate(_WND_ID_STATUS);
- m_xStatusWnd.SetStatusWndType(_TYPE_SETMAGIC);
- break;
- case _BTN_ID_CHAR:
- if ( m_xStatusWnd.GetStatusWndType() != _TYPE_EQUIP )
- {
- if ( !WindowActivate(_WND_ID_STATUS) ) WindowActivate(_WND_ID_STATUS);
- }
- else
- WindowActivate(_WND_ID_STATUS);
- m_xStatusWnd.SetStatusWndType(_TYPE_EQUIP);
- break;
- }
- }
- }
- INT nInterfaceWndInRect;
- nInterfaceWndInRect = GetWindowInMousePos(ptMouse);
- // 阿 扩档快狼 OnLButtonUp狼 府畔蔼捞 TRUE捞搁 扩档快令绰 Close等促.
- if ( nInterfaceWndInRect != -1 )
- {
- switch ( nInterfaceWndInRect )
- {
- case _WND_ID_INVENTORY: if ( m_xInventoryWnd.OnLButtonUp(&m_stCommonItem, ptMouse) ) WindowActivate(_WND_ID_INVENTORY); break;
- case _WND_ID_STATUS: if ( m_xStatusWnd.OnLButtonUp(&m_stCommonItem, ptMouse) ) WindowActivate(_WND_ID_STATUS); break;
- case _WND_ID_STORE: if ( m_xStoreWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_STORE); break;
- case _WND_ID_EXCHANGE: if ( m_xExchangeWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_EXCHANGE); break;
- case _WND_ID_GUILDMASTER:
- {
- if ( m_xGuildMasterWnd.OnLButtonUp(ptMouse) )
- WindowActivate(_WND_ID_EXCHANGE);
- break;
- }
- case _WND_ID_GUILD: if ( m_xGuildWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_GUILD); break;
- case _WND_ID_GROUP: if ( m_xGroupWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_GROUP); break;
- case _WND_ID_GROUPPOP: if ( m_xGroupPopWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_GROUPPOP); break;
- case _WND_ID_CHATPOP: if ( m_xChatPopWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_CHATPOP); break;
- case _WND_ID_QUEST: if ( m_xQuestWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_QUEST); break;
- case _WND_ID_OPTION: if ( m_xOptionWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_OPTION); break;
- case _WND_ID_HORSE: if ( m_xHorseWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_HORSE); break;
- case _WND_ID_NPCCHAT: if ( m_xNPCWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_NPCCHAT); break; // 侩扁
- }
- return TRUE;
- }
- }
- return FALSE;
- }
- /******************************************************************************************************************
- 窃荐疙 : CInterface::OnMouseMove()
- 累己磊 :
- 累己老 :
- 格利 : Mouse Move啊 老绢车阑锭 牢磐其捞胶俊辑 且老阑 沥狼茄促.
- 涝仿 : POINT ptMouse
- 免仿 : BOOL
- [老磊][荐沥磊] : 荐沥郴侩
- *******************************************************************************************************************/
- BOOL CInterface::OnMouseMove(POINT ptMouse)
- {
- MoveTopWindow(ptMouse);
- if ( m_xScrlBar.OnMouseMove(ptMouse) )
- {
- FLOAT fScrlRate;
- fScrlRate = m_xScrlBar.GetScrlRate();
- m_nFstLine = (m_xChat.GetCounter()-1)*fScrlRate;
- return TRUE;
- }
- for( INT nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++ )
- m_xInterBtn[nCnt].OnMouseMove(ptMouse);
- INT nInterfaceWndInRect;
- nInterfaceWndInRect = GetWindowInMousePos(ptMouse);
- if ( nInterfaceWndInRect != -1 )
- {
- switch ( nInterfaceWndInRect )
- {
- case _WND_ID_INVENTORY:
- m_xInventoryWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_STATUS:
- m_xStatusWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_STORE:
- m_xStoreWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_EXCHANGE:
- m_xExchangeWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_GUILDMASTER:
- m_xGuildMasterWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_GUILD:
- m_xGuildWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_GROUP:
- m_xGroupWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_GROUPPOP:
- m_xGroupPopWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_CHATPOP:
- m_xChatPopWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_QUEST:
- m_xQuestWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_OPTION:
- m_xOptionWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_HORSE:
- m_xHorseWnd.OnMouseMove(ptMouse);
- break;
- case _WND_ID_NPCCHAT: // 侩扁
- m_xNPCWnd.OnMouseMove(ptMouse);
- break;
- }
- return TRUE;
- }
- else
- {
- m_xStatusWnd.SetStatusBtnInit();
- m_xInventoryWnd.SetInvenBtnInit();
- m_xChatPopWnd.SetStatusBtnInit();
- m_xGuildMasterWnd.SetStatusBtnInit();
- m_xOptionWnd.SetStatusBtnInit();
- m_xQuestWnd.SetStatusBtnInit();
- m_xHorseWnd.SetStatusBtnInit();
- m_xExchangeWnd.SetStatusBtnInit();
- }
- return FALSE;
- }
- BOOL CInterface::OnScrollDown()
- {
- if ( IsTopWindow(m_xInventoryWnd.m_nID) )
- {
- m_xInventoryWnd.OnScrollDown();
- }
- else if ( IsTopWindow(m_xStatusWnd.m_nID) )
- {
- m_xStatusWnd.OnScrollDown();
- }
- else if (IsTopWindow(m_xNPCWnd.m_nID)) // 侩扁
- {
- m_xNPCWnd.OnScrollDown();
- }
- else
- {
- if ( !m_xChatPopWnd.m_bActive )
- {
- if ( m_nFstLine > 0 )
- {
- m_nFstLine--;
- }
- }
- else
- {
- m_xChatPopWnd.OnScrollDown();
- }
- }
- return TRUE;
- }
- BOOL CInterface::OnScrollUp()
- {
- if ( IsTopWindow(m_xInventoryWnd.m_nID) )
- {
- m_xInventoryWnd.OnScrollUp();
- }
- else if ( IsTopWindow(m_xStatusWnd.m_nID) )
- {
- m_xStatusWnd.OnScrollUp();
- }
- else if (IsTopWindow(m_xNPCWnd.m_nID)) // 侩扁
- {
- m_xNPCWnd.OnScrollUp();
- }
- else
- {
- if ( !m_xChatPopWnd.m_bActive )
- {
- if ( m_nFstLine < (m_xChat.GetCounter()-1) )
- {
- m_nFstLine++;
- }
- }
- else
- {
- m_xChatPopWnd.OnScrollUp();
- }
- }
- return TRUE;
- }
- BOOL CInterface::OnLButtonDoubleClick(POINT ptMouse)
- {
- if ( IsTopWindow(m_xInventoryWnd.m_nID) )
- m_xInventoryWnd.OnLButtonDoubleClick(&m_stCommonItem, ptMouse);
- return TRUE;
- }
- BOOL CInterface::OnKeyUp(WPARAM wParam, LPARAM lParam)
- {
- if ( m_xInventoryWnd.OnKeyUp(&m_stCommonItem, wParam, lParam) )
- {
- return TRUE;
- }
- return FALSE;
- }
- BOOL CInterface::OnKeyDown(WPARAM wParam, LPARAM lParam)
- {
- switch ( wParam )
- {
- case VK_RETURN:
- break;
- case VK_F9:
- WindowActivate(_WND_ID_INVENTORY);
- break;
- case VK_F11:
- if ( m_xStatusWnd.GetStatusWndType() != _TYPE_SETMAGIC )
- {
- if ( !WindowActivate(_WND_ID_STATUS) )
- WindowActivate(_WND_ID_STATUS);
- }
- else
- WindowActivate(_WND_ID_STATUS);
- m_xStatusWnd.SetStatusWndType(_TYPE_SETMAGIC);
- break;
- }
- INT nInterfaceWndInRect;
- nInterfaceWndInRect = GetWindowInMousePos(g_xGameProc.m_ptMousePos);
- if ( nInterfaceWndInRect != -1 )
- {
- if ( nInterfaceWndInRect == _WND_ID_STATUS )
- {
- if ( m_xStatusWnd.OnKeyDown(wParam, lParam, g_xGameProc.m_ptMousePos) )
- return TRUE;
- }
- }
-
- return FALSE;
- }
- VOID CInterface::OnSysKeyDown()
- {
- // F10 Key 喘啡阑锭.
- if ( m_xStatusWnd.GetStatusWndType() != _TYPE_EQUIP )
- {
- if ( !WindowActivate(_WND_ID_STATUS) )
- WindowActivate(_WND_ID_STATUS);
- }
- else
- WindowActivate(_WND_ID_STATUS);
- m_xStatusWnd.SetStatusWndType(_TYPE_EQUIP);
- }
- LRESULT CInterface::OnMsgInputted(WPARAM wParam, LPARAM lParam)
- {
- if ( m_xNPCWnd.OnMsgInputted() )
- return TRUE;
- return 0L;
- }