Interface.cpp
上传用户:cydong117
上传日期:2009-11-10
资源大小:638k
文件大小:53k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. /******************************************************************************************************************
  2.                                                                                                                    
  3. 葛碘疙:
  4. 累己磊:
  5. 累己老:
  6. [老磊][荐沥磊] : 荐沥 郴侩
  7.                                                                                                                    
  8. *******************************************************************************************************************/
  9. #include "StdAfx.h"
  10. /******************************************************************************************************************
  11. 窃荐疙 : CInterface::CInterface()
  12. 累己磊 : 
  13. 累己老 : 
  14. 格利   : 
  15. 免仿   : 
  16. [老磊][荐沥磊] : 荐沥郴侩
  17. *******************************************************************************************************************/
  18. CInterface::CInterface()
  19. {
  20. Init();
  21. }
  22. /******************************************************************************************************************
  23. 窃荐疙 : CInterface::~CInterface()
  24. 累己磊 : 
  25. 累己老 : 
  26. 格利   : 
  27. 免仿   : 
  28. [老磊][荐沥磊] : 荐沥郴侩
  29. *******************************************************************************************************************/
  30. CInterface::~CInterface()
  31. {
  32. Destroy();
  33. }
  34. /******************************************************************************************************************
  35. 窃荐疙 : CInterface::Init()
  36. 累己磊 : 
  37. 累己老 : 
  38. 格利   : 牢磐其捞胶包访 函荐棺, 按眉檬扁拳.
  39. 免仿   : VOID 
  40. [老磊][荐沥磊] : 荐沥郴侩
  41. *******************************************************************************************************************/
  42. VOID CInterface::Init()
  43. {
  44. m_nIdxMsgBox = 0;
  45. m_nFstLine = 0;
  46. m_shBeltHeight = 0;
  47. m_bShowKey = FALSE;
  48. m_bMoveFocusedWnd = FALSE;
  49. m_bBeltState = _BELT_STATE_STAY;
  50. SetRect(&m_rcMain,  0, 0, 0, 0);
  51. SetRect(&m_rcChat,  0, 0, 0, 0);
  52. ZeroMemory(&m_stCommonItem, sizeof(ITEMSET));
  53. m_xClientSysMsg.Init();
  54. m_pxInterImg = NULL;
  55. m_xInterImgEx.Init();
  56. m_xStatusWnd.Init();
  57. m_xStoreWnd.Init();
  58. m_xGuildWnd.Init();
  59. m_xGroupWnd.Init();
  60. m_xChatPopWnd.Init();
  61. m_xExchangeWnd.Init();
  62. m_xGroupPopWnd.Init();
  63. m_xInventoryWnd.Init();
  64. m_xGuildMasterWnd.Init();
  65. for ( INT nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++ )
  66. {
  67. m_xInterBtn[nCnt].Init();
  68. }
  69. m_xScrlBar.Init();
  70. m_xChat.ClearAllNodes();
  71. m_xWndOrderList.ClearAllNodes();
  72. }
  73. /******************************************************************************************************************
  74. 窃荐疙 : CInterface::Destroy()
  75. 累己磊 : 
  76. 累己老 : 
  77. 格利   : 牢磐其捞胶包访 函荐, 按眉狼 家戈棺, 檬扁拳.
  78. 免仿   : VOID 
  79. [老磊][荐沥磊] : 荐沥郴侩
  80. *******************************************************************************************************************/
  81. VOID CInterface::Destroy()
  82. {
  83. m_xClientSysMsg.Destroy();
  84. m_xInterImgEx.Destroy();
  85. m_pxInterImg = NULL;
  86. m_xInventoryWnd.Destroy();
  87. m_xStoreWnd.Destroy();
  88. m_xStatusWnd.Destroy();
  89. m_xGuildWnd.Destroy();
  90. m_xGroupWnd.Destroy();
  91. m_xExchangeWnd.Destroy();
  92. m_xGuildMasterWnd.Destroy();
  93. m_xGroupPopWnd.Destroy();
  94. m_xChatPopWnd.Destroy();
  95. for ( INT nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++ )
  96. {
  97. m_xInterBtn[nCnt].Destroy();
  98. }
  99. m_xChat.ClearAllNodes();
  100. m_xWndOrderList.ClearAllNodes();
  101. Init();
  102. }
  103. VOID CInterface::CreateInterface(CImageHandler* pxImgHandler)
  104. {
  105. m_pxInterImg = &(pxImgHandler->m_xImageList[_IMAGE_INTER]);
  106. //------------------------------------------------------------------------------------------------------------
  107. // 盲泼俊叼飘 扩档快 困摹瘤沥.
  108. MoveWindow(g_xChatEditBox.GetSafehWnd(), 
  109.    g_xMainWnd.m_rcWindow.left+_INPUT_EDITWND_XPOS, g_xMainWnd.m_rcWindow.top+_INPUT_EDITWND_YPOS,
  110.    _INPUT_EDITWND_WIDTH, _INPUT_EDITWND_HEIGHT, TRUE);
  111. //------------------------------------------------------------------------------------------------------------
  112. //------------------------------------------------------------------------------------------------------------
  113. // 牢磐其捞胶 捞固瘤 肺靛.
  114. m_pxInterImg->NewLoad(".\Data\gameinter.wil");
  115. m_xInterImgEx.NewLoad(".\Data\interfacec2.wil");
  116. //------------------------------------------------------------------------------------------------------------
  117. //------------------------------------------------------------------------------------------------------------
  118. // 皋牢牢磐其捞胶 康开汲沥.
  119. if ( m_pxInterImg->NewSetIndex(_WNDIMGIDX_MAIN) )
  120. {
  121. SetRect(&m_rcMain, 
  122. 0, (600-m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight), 
  123. m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, 600);
  124. }
  125. //------------------------------------------------------------------------------------------------------------
  126. //------------------------------------------------------------------------------------------------------------
  127. // 盲泼 康开汲沥.
  128. SetRect(&m_rcChat, 224, 471, 578, 545);
  129. //------------------------------------------------------------------------------------------------------------
  130. //------------------------------------------------------------------------------------------------------------
  131. // 扩档快甸 积己.
  132. m_xInventoryWnd.CreateInventoryWnd(_WND_ID_INVENTORY, m_pxInterImg, _WNDIMGIDX_INVENTORY, 0, 0, 0, 0, TRUE);
  133. m_xStatusWnd.CreateStatusWnd(_WND_ID_STATUS, m_pxInterImg, _WNDIMGIDX_ITEMSET, 510, 0, 0, 0, TRUE);
  134. m_xStoreWnd.CreateStoreWnd(_WND_ID_STORE, m_pxInterImg, _WNDIMGIDX_STORE, 0, 0, 0, 0, TRUE);
  135. m_xExchangeWnd.CreateExchangeWnd(_WND_ID_EXCHANGE, m_pxInterImg, _WNDIMGIDX_EXCHANGE, 0, 0, 0, 0, TRUE);
  136. m_xGuildMasterWnd.CreateGuildMasterWnd(_WND_ID_GUILDMASTER, m_pxInterImg, _WNDIMGIDX_GUILDMASTER, 0, 0, 0, 0, TRUE);
  137. m_xGuildWnd.CreateGuildWnd(_WND_ID_GUILD, &m_xInterImgEx, _WNDIMGIDX_GUILD, 0, 0, 540, 442, TRUE);
  138. m_xGroupWnd.CreateGroupWnd(_WND_ID_GROUP, m_pxInterImg, _WNDIMGIDX_GROUP, 0, 0, 0, 0, TRUE);
  139. m_xGroupPopWnd.CreateGroupPopWnd(_WND_ID_GROUPPOP, &m_xInterImgEx, _WNDIMGIDX_GROUPPOP, 0, 0, 260, 114, TRUE);
  140. m_xChatPopWnd.CreateChatPopWnd(_WND_ID_CHATPOP, m_pxInterImg, _WNDIMGIDX_CHATPOP, 0, 0, 0, 0, TRUE);
  141. m_xOptionWnd.CreateOptionWnd(_WND_ID_OPTION, m_pxInterImg, _WNDIMGIDX_OPTION, 0, 0, 0, 0, TRUE);
  142. m_xQuestWnd.CreateQuestWnd(_WND_ID_QUEST, m_pxInterImg, _WNDIMGIDX_QUEST, 0, 0, 0, 0, TRUE);
  143. m_xHorseWnd.CreateHorseWnd(_WND_ID_HORSE, m_pxInterImg, _WNDIMGIDX_HORSE, 0, 0, 0, 0, TRUE);
  144. m_xNPCWnd.CreateNPCChatWnd(_WND_ID_NPCCHAT, m_pxInterImg, _WNDIMGIDX_NPCCHAT, 0, 0, 0, 0, TRUE); // 侩扁
  145. //------------------------------------------------------------------------------------------------------------
  146. //------------------------------------------------------------------------------------------------------------
  147. // 滚瓢 檬扁拳.
  148. m_xInterBtn[ 0].CreateGameBtn(m_pxInterImg, 80, 81, m_rcMain.left+204, m_rcMain.top+0); // 背券芒.
  149. m_xInterBtn[ 1].CreateGameBtn(m_pxInterImg, 82, 83, m_rcMain.left+228, m_rcMain.top+0); // 固聪甘.
  150. m_xInterBtn[ 2].CreateGameBtn(m_pxInterImg, 84, 85, m_rcMain.left+252, m_rcMain.top+0); // 公傍芒.
  151. m_xInterBtn[ 3].CreateGameBtn(m_pxInterImg, 90, 91, m_rcMain.left+161, m_rcMain.top+65); // 霸烙辆丰.
  152. m_xInterBtn[ 4].CreateGameBtn(m_pxInterImg, 92, 93, m_rcMain.left+161, m_rcMain.top+101); // 肺弊酒眶.
  153. m_xInterBtn[ 5].CreateGameBtn(m_pxInterImg, 94, 95, m_rcMain.left+616, m_rcMain.top+66); // 弊缝.
  154. m_xInterBtn[ 6].CreateGameBtn(m_pxInterImg, 96, 97, m_rcMain.left+616, m_rcMain.top+102); // 巩颇.
  155. m_xInterBtn[ 7].CreateGameBtn(m_pxInterImg, 52, 53, m_rcMain.left+397, m_rcMain.top+13); // 骇飘 UP, DOWN.
  156. m_xInterBtn[ 8].CreateGameBtn(m_pxInterImg,100, 101, m_rcMain.left+703, m_rcMain.top+34); // 胶懦芒.
  157. m_xInterBtn[ 9].CreateGameBtn(m_pxInterImg,102, 103, m_rcMain.left+718, m_rcMain.top+50); // 盲泼扑诀.
  158. m_xInterBtn[10].CreateGameBtn(m_pxInterImg,104, 105, m_rcMain.left+718, m_rcMain.top+88); // 涅胶飘.
  159. m_xInterBtn[11].CreateGameBtn(m_pxInterImg,106, 107, m_rcMain.left+703, m_rcMain.top+103); // 可记.
  160. m_xInterBtn[12].CreateGameBtn(m_pxInterImg,108, 109, m_rcMain.left+664, m_rcMain.top+104); // 档框富.
  161. m_xInterBtn[13].CreateGameBtn(m_pxInterImg,110, 111, m_rcMain.left+648, m_rcMain.top+88); // 富芒.
  162. m_xInterBtn[14].CreateGameBtn(m_pxInterImg,112, 113, m_rcMain.left+648, m_rcMain.top+50); // 啊规芒.
  163. m_xInterBtn[15].CreateGameBtn(m_pxInterImg,114, 115, m_rcMain.left+665, m_rcMain.top+34); // 惑怕芒.
  164. //------------------------------------------------------------------------------------------------------------
  165. m_xScrlBar.CreateScrlBar(m_pxInterImg, 68, _MAX_CHATLINE, 12, 84, 12);
  166. m_xMsgBox.Load(&m_xInterImgEx); // 侩扁
  167. }
  168. /******************************************************************************************************************
  169. 窃荐疙 : CInterface::MsgAdd()
  170. 累己磊 : 
  171. 累己老 : 
  172. 格利   : 
  173. 涝仿   : DWORD dwFontColor
  174.          DWORD dwFontBackColor
  175.          CHAR* pszMsg
  176. 免仿   : VOID 
  177. [老磊][荐沥磊] : 荐沥郴侩
  178. *******************************************************************************************************************/
  179. VOID CInterface::MsgAdd(DWORD dwFontColor, DWORD dwFontBackColor, CHAR* pszMsg)
  180. {
  181. if ( pszMsg )
  182. {
  183. if ( pszMsg[0] != NULL )
  184. {
  185. INT  nCnt;
  186. CHAT stChat;
  187. INT  nLineCnt;
  188. CHAR pszDivied[MAX_PATH*2];
  189. CHAR pszArg[5][MAX_PATH];
  190. m_xChatPopWnd.MsgAdd(dwFontColor, dwFontBackColor, pszMsg);
  191. ZeroMemory(pszDivied, MAX_PATH*2);
  192. ZeroMemory(pszArg,   MAX_PATH*5);
  193. g_xMainWnd.StringDivide(m_rcChat.right-m_rcChat.left, nLineCnt, pszMsg, pszDivied);
  194. sscanf(pszDivied, "%[^`]%*c %[^`]%*c %[^`]%*c %[^`]%*c %[^`]%*c", pszArg[0], pszArg[1], pszArg[2], pszArg[3], pszArg[4]);
  195. if ( nLineCnt > 5 )
  196. {
  197. nLineCnt = 5;
  198. }
  199. // 巩磊凯 火涝.
  200. for ( nCnt = 0; nCnt < nLineCnt; nCnt++ )
  201. {
  202. // 沫捞 促澜栏肺 哎炼扒.
  203. if ( m_xChat.GetCounter() - m_nFstLine == _MAX_CHATLINE )
  204. {
  205. m_nFstLine++;
  206. }
  207. stChat.dwFontColor = dwFontColor;
  208. stChat.dwBackColor = dwFontBackColor;
  209. strcpy(stChat.pszChat, pszArg[nCnt]);
  210. m_xChat.AddNode(stChat);
  211. }
  212. // 弥措历厘扼牢 八荤秦辑 弊捞惑捞搁 昏力茄促.
  213. while ( m_xChat.GetCounter() >= 50 )
  214. {
  215. m_xChat.MoveCurrentToTop();
  216. m_xChat.DeleteCurrentNode();
  217. if ( m_nFstLine > 0 )
  218. m_nFstLine--;
  219. }
  220. }
  221. }
  222. }
  223. /******************************************************************************************************************
  224. 窃荐疙 : CInterface::ShowWndList()
  225. 累己磊 : 
  226. 累己老 : 
  227. 格利   : Active登绢乐绰 扩档快狼 府胶飘甫 焊咯霖促.
  228. 免仿   : VOID 
  229. [老磊][荐沥磊] : 荐沥郴侩
  230. *******************************************************************************************************************/
  231. VOID CInterface::ShowWndList()
  232. {
  233. if ( m_xWndOrderList.GetCounter() != 0 )
  234. {
  235. m_xWndOrderList.MoveCurrentToTop();
  236. INT* pnCurrID;
  237. for ( INT nCnt = 0; nCnt < m_xWndOrderList.GetCounter(); nCnt++ )
  238. {
  239. pnCurrID = m_xWndOrderList.GetCurrentData();
  240. switch ( *pnCurrID )
  241. {
  242. case _WND_ID_INVENTORY:
  243. m_xInventoryWnd.ShowInventoryWnd();
  244. break;
  245. case _WND_ID_STATUS:
  246. m_xStatusWnd.ShowStatusWnd();
  247. break;
  248. case _WND_ID_STORE:
  249. m_xStoreWnd.ShowStoreWnd();
  250. break;
  251. case _WND_ID_EXCHANGE:
  252. m_xExchangeWnd.ShowExchangeWnd();
  253. break;
  254. case _WND_ID_GUILDMASTER:
  255. m_xGuildMasterWnd.ShowGuildMasterWnd();
  256. break;
  257. case _WND_ID_GUILD:
  258. m_xGuildWnd.ShowGuildWnd();
  259. break;
  260. case _WND_ID_GROUP:
  261. m_xGroupWnd.ShowGroupWnd();
  262. break;
  263. case _WND_ID_GROUPPOP:
  264. m_xGroupPopWnd.ShowGroupPopWnd();
  265. break;
  266. case _WND_ID_CHATPOP:
  267. m_xChatPopWnd.ShowChatPopWnd();
  268. break;
  269. case _WND_ID_NPCCHAT: // 侩扁
  270. m_xNPCWnd.ShowNPCChatWnd();
  271. break;
  272. case _WND_ID_QUEST:
  273. m_xQuestWnd.ShowQuestWnd();
  274. break;
  275. case _WND_ID_OPTION:
  276. m_xOptionWnd.ShowOptionWnd();
  277. break;
  278. case _WND_ID_HORSE:
  279. m_xHorseWnd.ShowHorseWnd();
  280. break;
  281. }
  282. m_xWndOrderList.MoveNextNode();
  283. }
  284. }
  285. }
  286. /******************************************************************************************************************
  287. 窃荐疙 : CInterface::ShowChatList()
  288. 累己磊 : 
  289. 累己老 : 
  290. 格利   : 盲泼 府胶飘甫 焊咯霖促.
  291. 免仿   : VOID 
  292. [老磊][荐沥磊] : 荐沥郴侩
  293. *******************************************************************************************************************/
  294. VOID CInterface::ShowChatList()
  295. {
  296. if ( !m_xChat.CheckEmpty() )
  297. {
  298. INT nCnt, nShowLine;
  299. LPCHAT pstChat;
  300. m_xChat.MoveCurrentToTop();
  301. m_xChat.MoveNode(m_nFstLine);
  302. nShowLine = ((m_xChat.GetCounter() - m_nFstLine ) >= _MAX_CHATLINE) ?  _MAX_CHATLINE : m_xChat.GetCounter() - m_nFstLine;
  303. for ( nCnt = 0; nCnt < nShowLine; nCnt++ )
  304. {
  305. pstChat = m_xChat.GetCurrentData();
  306. g_xMainWnd.PutsHan(g_xMainWnd.GetBackBuffer(),
  307.    m_rcChat.left, m_rcChat.top+nCnt*15,
  308.    pstChat->dwBackColor, pstChat->dwFontColor, pstChat->pszChat);
  309. m_xChat.MoveNextNode();
  310. }
  311. }
  312. }
  313. /******************************************************************************************************************
  314. 窃荐疙 : CInterface::RenderInterface()
  315. 累己磊 : 
  316. 累己老 : 
  317. 格利   : 
  318. 涝仿   : INT nLoopTime
  319.          POINT ptMousePos
  320. 免仿   : VOID 
  321. [老磊][荐沥磊] : 荐沥郴侩
  322. *******************************************************************************************************************/
  323. VOID CInterface::RenderInterface(INT nLoopTime, POINT ptMousePos)
  324. {
  325. INT nX, nY, nCnt;
  326. // 扩档快.
  327. ShowWndList();
  328. // 付快胶 酒捞袍.
  329. if ( m_stCommonItem.bSetted && !m_stCommonItem.bIsHideItem )
  330. {
  331. nX = ptMousePos.x - _INVENTORY_CELL_WIDTH /2;
  332. nY = ptMousePos.y - _INVENTORY_CELL_HEIGHT/2;
  333. m_stCommonItem.xItem.DrawItem(nX, nY);
  334. }
  335. // 骇飘酒捞袍.
  336. ShowBeltItem();
  337. // 皋牢牢磐其捞胶.
  338. if ( m_pxInterImg->NewSetIndex(_WNDIMGIDX_MAIN) )
  339. {
  340.   g_xMainWnd.DrawWithImageForCompClipRgn(m_rcMain.left, m_rcMain.top, m_rcMain.right-m_rcMain.left, m_rcMain.bottom-m_rcMain.top,
  341.    (WORD*)m_pxInterImg->m_pbCurrImage, _CLIP_WIDTH, 600);
  342. }
  343. // 盲泼府胶飘.
  344. ShowChatList();
  345. // 惑怕摹.
  346. ShowGameStatus();
  347. // 滚瓢.
  348. for ( nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++)
  349. {
  350. m_xInterBtn[nCnt].ShowGameBtn();
  351. }
  352. // 胶农费官.
  353. m_xScrlBar.ShowScrlBar(584, 404, m_nFstLine, m_xChat.GetCounter());
  354. // 努扼捞攫飘皋矫瘤(哭率惑窜).
  355. m_xClientSysMsg.ShowSysMsg(nLoopTime, 30, 30);
  356. // 侩扁
  357. m_xMsgBox.RenderMessageBox(0);
  358. ShowMagicKey();
  359. }
  360. /******************************************************************************************************************
  361. 窃荐疙 : CInterface::ShowBeltItem()
  362. 累己磊 : 
  363. 累己老 : 
  364. 格利   : 
  365. 免仿   : VOID 
  366. [老磊][荐沥磊] : 荐沥郴侩
  367. *******************************************************************************************************************/
  368. VOID CInterface::ShowBeltItem()
  369. {
  370. INT nX, nY;
  371. if ( m_bBeltState == _BELT_STATE_UP )
  372. {
  373. m_shBeltHeight += 10;
  374. if ( m_shBeltHeight >= 46 )
  375. {
  376. m_shBeltHeight = 46;
  377. }
  378. }
  379. else if ( m_bBeltState == _BELT_STATE_DOWN )
  380. {
  381. m_shBeltHeight -= 10;
  382. if ( m_shBeltHeight <= 0 )
  383. {
  384. m_shBeltHeight = 0;
  385. m_bBeltState   = _BELT_STATE_STAY;
  386. }
  387. }
  388. if ( m_bBeltState != _BELT_STATE_STAY )
  389. {
  390. if ( m_pxInterImg->NewSetIndex(_IMGIDX_BELT) )
  391. {
  392.   g_xMainWnd.DrawWithImageForCompClipRgn(275, 457-m_shBeltHeight,
  393.    m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
  394.    m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
  395.    (WORD*)m_pxInterImg->m_pbCurrImage, _CLIP_WIDTH, 600);
  396. // 骇飘 酒捞袍 弊府扁.
  397. for ( INT nCnt = 0; nCnt < _MAX_BELT_ITEM; nCnt++ )
  398. {
  399. if ( m_xInventoryWnd.m_stBeltItem[nCnt].bSetted )
  400. {
  401. nX = 275 + 8 + nCnt*40;
  402. nY = 411 + 6 + 46 - m_shBeltHeight;
  403. m_xInventoryWnd.m_stBeltItem[nCnt].xItem.DrawItem(nX, nY);
  404. }
  405. }
  406. }
  407. }
  408. }
  409. /******************************************************************************************************************
  410. 窃荐疙 : CInterface::ShowGameStatus()
  411. 累己磊 : 
  412. 累己老 : 
  413. 格利   : 
  414. 免仿   : BOOL 
  415. [老磊][荐沥磊] : 荐沥郴侩
  416. *******************************************************************************************************************/
  417. VOID CInterface::ShowGameStatus()
  418. {
  419. FLOAT fMyHPRate;
  420. FLOAT fMyMPRate;
  421. FLOAT fMyWetRate;
  422. FLOAT fMyExpRate;
  423. WORD wJobIcon;
  424. WORD wImgNum;
  425. CHAR pszBuff[MAX_PATH];
  426. RECT rcStats;
  427. DWORD dwFntClr;
  428. BYTE bMyJob  = g_xGameProc.m_xMyHero.m_bJob;
  429. BYTE bMyLevel= g_xGameProc.m_xMyHero.m_stAbility.bLevel;
  430. WORD wMyAC   = g_xGameProc.m_xMyHero.m_stAbility.wAC;
  431. WORD wMyDC   = g_xGameProc.m_xMyHero.m_stAbility.wDC;
  432. WORD wMyMC   = g_xGameProc.m_xMyHero.m_stAbility.wMC;
  433. WORD wMySC   = g_xGameProc.m_xMyHero.m_stAbility.wSC;
  434. BYTE bDay = g_xGameProc.m_bDayState;
  435. WORD wHP = g_xGameProc.m_xMyHero.m_stAbility.wHP;
  436. WORD wMP = g_xGameProc.m_xMyHero.m_stAbility.wMP;
  437. WORD wWet = g_xGameProc.m_xMyHero.m_stAbility.wWeight;
  438. DWORD dwExp = g_xGameProc.m_xMyHero.m_stAbility.dwExp;
  439. BYTE bJob = g_xGameProc.m_xMyHero.m_bJob;
  440. // 窍风狼 惑怕摹(广, 撤, 历翅, 货寒)
  441. switch ( bDay )
  442. {
  443. case _DAYSTATE_DAY:
  444. wImgNum = 130;
  445. break;
  446. case _DAYSTATE_DUSK:
  447. wImgNum = 131;
  448. break;
  449. case _DAYSTATE_NIGHT:
  450. wImgNum = 132;
  451. break;
  452. case _DAYSTATE_DAWN:
  453. wImgNum = 133;
  454. break;
  455. }
  456. if ( m_pxInterImg->NewSetIndex(wImgNum) )
  457. {
  458.   g_xMainWnd.DrawWithImageForComp(m_rcMain.left+684, m_rcMain.top+70,
  459. m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
  460. m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
  461. (WORD*)m_pxInterImg->m_pbCurrImage, _CLIP_WIDTH, 600);
  462. }
  463. // HP, MP嘛扁.
  464. // 厚啦八荤.
  465. if ( wHP )
  466. {
  467. fMyHPRate = (FLOAT)((FLOAT)wHP/(FLOAT)g_xGameProc.m_xMyHero.m_stAbility.wMaxHP);
  468. if ( fMyHPRate > 1.0f ) 
  469. {
  470. fMyHPRate = 1.0f;
  471. }
  472. }
  473. else
  474. {
  475. fMyHPRate = 0;
  476. }
  477. if ( wMP )
  478. {
  479. fMyMPRate = (FLOAT)((FLOAT)wMP/(FLOAT)g_xGameProc.m_xMyHero.m_stAbility.wMaxMP);
  480. if ( fMyMPRate > 1.0f ) 
  481. {
  482. fMyMPRate = 1.0f;
  483. }
  484. }
  485. else
  486. {
  487. fMyMPRate = 0;
  488. }
  489. if ( dwExp )
  490. {
  491. fMyExpRate = (FLOAT)((FLOAT)dwExp/(FLOAT)g_xGameProc.m_xMyHero.m_stAbility.dwMaxExp);
  492. if ( fMyExpRate > 1.0f ) 
  493. {
  494. fMyExpRate = 1.0f;
  495. }
  496. }
  497. else
  498. {
  499. fMyExpRate = 0;
  500. }
  501. if ( wWet )
  502. {
  503. fMyWetRate = (FLOAT)((FLOAT)wWet /(FLOAT)g_xGameProc.m_xMyHero.m_stAbility.wMaxWeight);
  504. if ( fMyWetRate > 1.0f ) 
  505. {
  506. fMyWetRate = 1.0f;
  507. }
  508. }
  509. else
  510. {
  511. fMyWetRate = 0;
  512. }
  513. if ( m_pxInterImg->NewSetIndex(60) )
  514. {
  515. RECT rcHP = { 0, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight-(m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight*fMyHPRate), 
  516.   m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight };
  517.   g_xMainWnd.DrawWithImageForComp(m_rcMain.left+46, m_rcMain.top+34, rcHP, (WORD*)m_pxInterImg->m_pbCurrImage);
  518. }
  519. if ( m_pxInterImg->NewSetIndex(61) )
  520. {
  521. RECT rcMP = { 0, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight-(m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight*fMyMPRate), 
  522.   m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight };
  523.   g_xMainWnd.DrawWithImageForComp(m_rcMain.left+104, m_rcMain.top+34, rcMP, (WORD*)m_pxInterImg->m_pbCurrImage);
  524. }
  525. // EXP, WET 嘛扁.
  526. if ( m_pxInterImg->NewSetIndex(63) )
  527. {
  528. RECT rcEXP = { 0, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight-(m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight*fMyExpRate), 
  529.    m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight };
  530.   g_xMainWnd.DrawWithImageForComp(m_rcMain.left+76, m_rcMain.top+35, rcEXP, (WORD*)m_pxInterImg->m_pbCurrImage);
  531. }
  532. if ( m_pxInterImg->NewSetIndex(67) )
  533. {
  534. RECT rcWET = { 0, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight-(m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight*fMyWetRate), 
  535.   m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight };
  536.   g_xMainWnd.DrawWithImageForComp(m_rcMain.left+211, m_rcMain.top+35, rcWET, (WORD*)m_pxInterImg->m_pbCurrImage);
  537. }
  538. dwFntClr = RGB(225, 225, 0);
  539. // 饭骇嘛6扁.
  540. sprintf(pszBuff, "%d", g_xGameProc.m_xMyHero.m_stAbility.bLevel);
  541. SetRect(&rcStats, 693, 528, 709, 544);
  542. g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff, g_xMainWnd.CreateGameFont("泵辑眉", 10, 0, FW_BOLD));
  543. dwFntClr = RGB(255, 255, 200);
  544. // 甘捞抚 棺 谅钎嘛扁.
  545. sprintf(pszBuff, "%s : [%d,%d]", g_xGameProc.m_szMapName, g_xGameProc.m_xMyHero.m_wPosX, g_xGameProc.m_xMyHero.m_wPosY);
  546. SetRect(&rcStats, 219, 584, 379, 599);
  547. g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff);
  548. dwFntClr = RGB(255, 200, 50);
  549. // 流诀喊 酒捞能棺 漂己摹 嘛扁.
  550. sprintf(pszBuff, "%d-%d", LOBYTE(wMyAC), HIBYTE(wMyAC));
  551. SetRect(&rcStats, 422, 584, 483, 599);
  552. g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff);
  553. SetRect(&rcStats, 520, 584, 581, 599);
  554. switch ( bJob )
  555. {
  556. case _JOB_DOSA:
  557. {
  558. wJobIcon = 66;
  559. wImgNum  = 123;
  560. sprintf(pszBuff, "%d-%d", LOBYTE(wMySC), HIBYTE(wMySC));
  561. g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff);
  562. }
  563. break;
  564. case _JOB_SULSA:
  565. {
  566. wJobIcon = 65;
  567. wImgNum  = 124;
  568. sprintf(pszBuff, "%d-%d", LOBYTE(wMyMC), HIBYTE(wMyMC));
  569. g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff);
  570. }
  571. break;
  572. case _JOB_JUNSA:
  573. {
  574. wJobIcon = 64;
  575. wImgNum  = 122;
  576. sprintf(pszBuff, "%d-%d", LOBYTE(wMyDC), HIBYTE(wMyDC));
  577. g_xMainWnd.PutsHan(NULL, rcStats, dwFntClr, RGB(0, 0, 0), pszBuff);
  578. }
  579. break;
  580. }
  581. if ( m_pxInterImg->NewSetIndex(wJobIcon) )
  582. {
  583.   g_xMainWnd.DrawWithImageForComp(m_rcMain.left+82, m_rcMain.top+71,
  584. m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
  585. m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
  586. (WORD*)m_pxInterImg->m_pbCurrImage);
  587. }
  588. // AC嘛扁.
  589. if ( m_pxInterImg->NewSetIndex(120) )
  590. {
  591.   g_xMainWnd.DrawWithImageForComp(m_rcMain.left+391, m_rcMain.top+136,
  592. m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
  593. m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
  594. (WORD*)m_pxInterImg->m_pbCurrImage);
  595. }
  596. // DC, MC, SC
  597. if ( m_pxInterImg->NewSetIndex(wImgNum) )
  598. {
  599.   g_xMainWnd.DrawWithImageForComp(m_rcMain.left+487, m_rcMain.top+136,
  600. m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
  601. m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
  602. (WORD*)m_pxInterImg->m_pbCurrImage);
  603. }
  604. }
  605. VOID CInterface::ShowMagicKey()
  606. {
  607. if ( m_bShowKey )
  608. {
  609. INT nCnt;
  610. for ( nCnt = 0; nCnt < 8; nCnt++ )
  611. {
  612. if ( m_pxInterImg->NewSetIndex(70+nCnt) )
  613. {
  614.   g_xMainWnd.DrawWithABlendCompDataWithBackBuffer(nCnt*m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth, 0,
  615. m_pxInterImg->m_lpstNewCurrWilImageInfo->shWidth,
  616. m_pxInterImg->m_lpstNewCurrWilImageInfo->shHeight,
  617. (WORD*)m_pxInterImg->m_pbCurrImage, _CLIP_WIDTH, 600);
  618. }
  619. }
  620. }
  621. }
  622. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
  623. // 扩档快 包府何盒/////////////////////////////////////////////////////////////////////////////////////////////
  624. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
  625. /******************************************************************************************************************
  626. 窃荐疙 : CInterface::GetWindowInMousePos()
  627. 累己磊 : 
  628. 累己老 : 
  629. 格利   : 付快胶 器牢磐甫 康开救俊 啊瘤绊 乐绰 扩档快府胶飘吝 盖贸澜 扩档快狼 ID甫 府畔茄促.
  630. 涝仿   : POINT ptMouse
  631. 免仿   : 
  632. [老磊][荐沥磊] : 荐沥郴侩
  633. *******************************************************************************************************************/
  634. INT CInterface::GetWindowInMousePos(POINT ptMouse)
  635. {
  636. if ( m_xWndOrderList.GetCounter() != 0 )
  637. {
  638. RECT rcWnd;
  639. INT* pnCurrID;
  640. m_xWndOrderList.MoveCurrentToTail();
  641. for ( INT nCnt = m_xWndOrderList.GetCounter()-1; nCnt >= 0 ; nCnt-- )
  642. {
  643. pnCurrID = m_xWndOrderList.GetCurrentData();
  644. switch ( *pnCurrID )
  645. {
  646. case _WND_ID_INVENTORY:
  647. rcWnd = m_xInventoryWnd.GetGameWndRect();
  648. break;
  649. case _WND_ID_STATUS:
  650. rcWnd = m_xStatusWnd.GetGameWndRect();
  651. break;
  652. case _WND_ID_STORE:
  653. rcWnd = m_xStoreWnd.GetGameWndRect();
  654. break;
  655. case _WND_ID_EXCHANGE:
  656. rcWnd = m_xExchangeWnd.GetGameWndRect();
  657. break;
  658. case _WND_ID_GUILDMASTER:
  659. rcWnd = m_xGuildMasterWnd.GetGameWndRect();
  660. break;
  661. case _WND_ID_GUILD:
  662. rcWnd = m_xGuildWnd.GetGameWndRect();
  663. break;
  664. case _WND_ID_GROUP:
  665. rcWnd = m_xGroupWnd.GetGameWndRect();
  666. break;
  667. case _WND_ID_GROUPPOP:
  668. rcWnd = m_xGroupPopWnd.GetGameWndRect();
  669. break;
  670. case _WND_ID_CHATPOP:
  671. rcWnd = m_xChatPopWnd.GetGameWndRect();
  672. break;
  673. case _WND_ID_NPCCHAT: // 侩扁
  674. rcWnd = m_xNPCWnd.GetGameWndRect();
  675. break;
  676. case _WND_ID_QUEST:
  677. rcWnd = m_xQuestWnd.GetGameWndRect();
  678. break;
  679. case _WND_ID_OPTION:
  680. rcWnd = m_xOptionWnd.GetGameWndRect();
  681. break;
  682. case _WND_ID_HORSE:
  683. rcWnd = m_xHorseWnd.GetGameWndRect();
  684. break;
  685. }
  686. if ( PtInRect(&rcWnd, ptMouse) )
  687. {
  688. return *pnCurrID;
  689. }
  690. m_xWndOrderList.MovePreviousNode();
  691. }
  692. }
  693. return -1;
  694. }
  695. /******************************************************************************************************************
  696. 窃荐疙 : CInterface::AddWindowToList()
  697. 累己磊 : 
  698. 累己老 : 
  699. 格利   : 扩档快府胶飘狼 盖 付瘤阜俊 泅犁 涝仿罐篮 酒捞叼啊 nID牢 扩档快甫 眠啊茄促.
  700. 涝仿   : INT nID
  701. 免仿   : VOID 
  702. [老磊][荐沥磊] : 荐沥郴侩
  703. *******************************************************************************************************************/
  704. VOID CInterface::AddWindowToList(INT nID)
  705. {
  706. m_xWndOrderList.AddNode(nID);
  707. }
  708. /******************************************************************************************************************
  709. 窃荐疙 : CInterface::DeleteWindowToList()
  710. 累己磊 : 
  711. 累己老 : 
  712. 格利   : nID狼 酒捞叼甫 啊柳 扩档快甫 府胶飘惑俊辑 昏力茄促.
  713. 涝仿   : INT nID
  714. 免仿   : VOID 
  715. [老磊][荐沥磊] : 荐沥郴侩
  716. *******************************************************************************************************************/
  717. VOID CInterface::DeleteWindowToList(INT nID)
  718. {
  719. if ( m_xWndOrderList.GetCounter() != 0 )
  720. {
  721. m_xWndOrderList.MoveCurrentToTop();
  722. INT* pnCurrID;
  723. for ( INT nCnt = 0; nCnt < m_xWndOrderList.GetCounter(); nCnt++ )
  724. {
  725. pnCurrID = m_xWndOrderList.GetCurrentData();
  726. if ( *pnCurrID == nID )
  727. {
  728. m_xWndOrderList.DeleteCurrentNode();
  729. break;
  730. }
  731. m_xWndOrderList.MoveNextNode();
  732. }
  733. }
  734. }
  735. /******************************************************************************************************************
  736. 窃荐疙 : CInterface::WindowActivate()
  737. 累己磊 : 
  738. 累己老 : 
  739. 格利   : nID牢 扩档快甫 扩档快府胶飘俊 眠啊矫虐芭唱 昏力矫虐哥, 眠啊狼 版快, 扩档快狼 惑怕甫 弥惑困 惑怕肺 技泼茄促.
  740.  扩档快啊 虐涝仿阑 罐酒辑 拳搁俊 唱棵锭 龋免窍绰 窃荐捞促.
  741. 涝仿   : INT nID
  742. 免仿   : VOID 
  743. [老磊][荐沥磊] : 荐沥郴侩
  744. *******************************************************************************************************************/
  745. BOOL CInterface::WindowActivate(INT nID)
  746. {
  747. // 货肺款 扩档快俊 器目胶甫 林扁困秦辑 葛电 扩档快狼 器目胶甫 FALSE矫难霖促.
  748. BOOL bRet = FALSE;
  749. AllWindowsFocusOff();
  750. switch ( nID )
  751. {
  752. case _WND_ID_INVENTORY:
  753. {
  754. if ( m_xInventoryWnd.GetGameWndActive() )
  755. {
  756. DeleteWindowToList(_WND_ID_INVENTORY);
  757. m_xInventoryWnd.SetGameWndActive(FALSE);
  758. bRet = FALSE;
  759. }
  760. else
  761. {
  762. AddWindowToList(_WND_ID_INVENTORY);
  763. m_xInventoryWnd.SetGameWndActive(TRUE);
  764. bRet = TRUE;
  765. }
  766. }
  767. break;
  768. case _WND_ID_STATUS:
  769. {
  770. if ( m_xStatusWnd.GetGameWndActive() )
  771. {
  772. DeleteWindowToList(_WND_ID_STATUS);
  773. m_xStatusWnd.SetGameWndActive(FALSE);
  774. bRet = FALSE;
  775. }
  776. else
  777. {
  778. AddWindowToList(_WND_ID_STATUS);
  779. m_xStatusWnd.SetGameWndActive(TRUE);
  780. bRet = TRUE;
  781. }
  782. }
  783. break;
  784. case _WND_ID_STORE:
  785. {
  786. if ( m_xStoreWnd.GetGameWndActive() )
  787. {
  788. DeleteWindowToList(_WND_ID_STORE);
  789. m_xStoreWnd.SetGameWndActive(FALSE);
  790. bRet = FALSE;
  791. }
  792. else
  793. {
  794. AddWindowToList(_WND_ID_STORE);
  795. m_xStoreWnd.SetGameWndActive(TRUE);
  796. bRet = TRUE;
  797. }
  798. }
  799. break;
  800. case _WND_ID_EXCHANGE:
  801. {
  802. if ( m_xExchangeWnd.GetGameWndActive() )
  803. {
  804. DeleteWindowToList(_WND_ID_EXCHANGE);
  805. m_xExchangeWnd.SetGameWndActive(FALSE);
  806. bRet = FALSE;
  807. }
  808. else
  809. {
  810. AddWindowToList(_WND_ID_EXCHANGE);
  811. m_xExchangeWnd.SetGameWndActive(TRUE);
  812. bRet = TRUE;
  813. }
  814. }
  815. break;
  816. case _WND_ID_QUEST:
  817. {
  818. if ( m_xQuestWnd.GetGameWndActive() )
  819. {
  820. DeleteWindowToList(_WND_ID_QUEST);
  821. m_xQuestWnd.SetGameWndActive(FALSE);
  822. bRet = FALSE;
  823. }
  824. else
  825. {
  826. AddWindowToList(_WND_ID_QUEST);
  827. m_xQuestWnd.SetGameWndActive(TRUE);
  828. bRet = TRUE;
  829. }
  830. }
  831. break;
  832. case _WND_ID_OPTION:
  833. {
  834. if ( m_xOptionWnd.GetGameWndActive() )
  835. {
  836. DeleteWindowToList(_WND_ID_OPTION);
  837. m_xOptionWnd.SetGameWndActive(FALSE);
  838. bRet = FALSE;
  839. }
  840. else
  841. {
  842. AddWindowToList(_WND_ID_OPTION);
  843. m_xOptionWnd.SetGameWndActive(TRUE);
  844. bRet = TRUE;
  845. }
  846. }
  847. break;
  848. case _WND_ID_HORSE:
  849. {
  850. if ( m_xHorseWnd.GetGameWndActive() )
  851. {
  852. DeleteWindowToList(_WND_ID_HORSE);
  853. m_xHorseWnd.SetGameWndActive(FALSE);
  854. bRet = FALSE;
  855. }
  856. else
  857. {
  858. AddWindowToList(_WND_ID_HORSE);
  859. m_xHorseWnd.SetGameWndActive(TRUE);
  860. bRet = TRUE;
  861. }
  862. }
  863. break;
  864. case _WND_ID_GUILDMASTER:
  865. {
  866. if ( m_xGuildMasterWnd.GetGameWndActive() )
  867. {
  868. DeleteWindowToList(_WND_ID_GUILDMASTER);
  869. m_xGuildMasterWnd.SetGameWndActive(FALSE);
  870. bRet = FALSE;
  871. }
  872. else
  873. {
  874. AddWindowToList(_WND_ID_GUILDMASTER);
  875. m_xGuildMasterWnd.SetGameWndActive(TRUE);
  876. bRet = TRUE;
  877. }
  878. }
  879. break;
  880. case _WND_ID_GUILD:
  881. {
  882. if ( m_xGuildWnd.GetGameWndActive() )
  883. {
  884. DeleteWindowToList(_WND_ID_GUILD);
  885. m_xGuildWnd.SetGameWndActive(FALSE);
  886. bRet = FALSE;
  887. }
  888. else
  889. {
  890. AddWindowToList(_WND_ID_GUILD);
  891. m_xGuildWnd.SetGameWndActive(TRUE);
  892. bRet = TRUE;
  893. }
  894. }
  895. break;
  896. case _WND_ID_GROUP:
  897. {
  898. if ( m_xGroupWnd.GetGameWndActive() )
  899. {
  900. DeleteWindowToList(_WND_ID_GROUP);
  901. m_xGroupWnd.SetGameWndActive(FALSE);
  902. bRet = FALSE;
  903. }
  904. else
  905. {
  906. AddWindowToList(_WND_ID_GROUP);
  907. m_xGroupWnd.SetGameWndActive(TRUE);
  908. bRet = TRUE;
  909. }
  910. }
  911. break;
  912. case _WND_ID_GROUPPOP:
  913. {
  914. if ( m_xGroupPopWnd.GetGameWndActive() )
  915. {
  916. DeleteWindowToList(_WND_ID_GROUPPOP);
  917. m_xGroupPopWnd.SetGameWndActive(FALSE);
  918. bRet = FALSE;
  919. }
  920. else
  921. {
  922. AddWindowToList(_WND_ID_GROUPPOP);
  923. m_xGroupPopWnd.SetGameWndActive(TRUE);
  924. bRet = TRUE;
  925. }
  926. }
  927. break;
  928. case _WND_ID_CHATPOP:
  929. {
  930. if ( m_xChatPopWnd.GetGameWndActive() )
  931. {
  932. MoveWindow(g_xChatEditBox.GetSafehWnd(), g_xMainWnd.m_rcWindow.left+_INPUT_EDITWND_XPOS, 
  933.      g_xMainWnd.m_rcWindow.top+_INPUT_EDITWND_YPOS, _INPUT_EDITWND_WIDTH, _INPUT_EDITWND_HEIGHT, TRUE);
  934. DeleteWindowToList(_WND_ID_CHATPOP);
  935. m_xChatPopWnd.SetGameWndActive(FALSE);
  936. bRet = FALSE;
  937. }
  938. else
  939. {
  940. MoveWindow(g_xChatEditBox.GetSafehWnd(), g_xMainWnd.m_rcWindow.left + m_xChatPopWnd.m_rcWnd.left + m_xChatPopWnd.m_rcEditBoxFrame.left, 
  941.      g_xMainWnd.m_rcWindow.top + m_xChatPopWnd.m_rcWnd.top + m_xChatPopWnd.m_rcEditBoxFrame.top, 
  942.    m_xChatPopWnd.m_rcEditBoxFrame.right - m_xChatPopWnd.m_rcEditBoxFrame.left, 
  943.    m_xChatPopWnd.m_rcEditBoxFrame.bottom - m_xChatPopWnd.m_rcEditBoxFrame.top, TRUE);
  944. SetFocus(g_xChatEditBox.GetSafehWnd());
  945. AddWindowToList(_WND_ID_CHATPOP);
  946. m_xChatPopWnd.SetGameWndActive(TRUE);
  947. bRet = TRUE;
  948. }
  949. }
  950. break;
  951. case _WND_ID_NPCCHAT: // 侩扁
  952. {
  953. if ( m_xNPCWnd.GetGameWndActive() )
  954. {
  955. DeleteWindowToList(_WND_ID_NPCCHAT);
  956. // m_xNPCWnd.CloseWnd();
  957. m_xNPCWnd.SetGameWndActive(FALSE);
  958. bRet = FALSE;
  959. }
  960. else
  961. {
  962. // 烙矫
  963. AddWindowToList(_WND_ID_NPCCHAT);
  964. // m_xNPCWnd.SetNPCStr("窍疵阑 快矾矾 茄痢 何掺烦 绝扁甫 蕾技俊捞绰 官恩俊档 唱绰 鲍肺况 沁促 <喊/@STAR>阑 畴贰窍绰 付澜栏肺 葛电 磷绢 啊绰巴阑 <荤尔/@LOVE>秦具瘤 弊府绊 肚 唱俊霸 林况 柳辨阑 吧绢 啊具 摆促. 坷疵 广俊档 喊捞 官恩俊 胶摹款促. 悼秦拱苞 归滴魂捞 付福绊 催配废 窍蠢丛捞 焊快窍荤 快府唱扼 父技 公泵拳 伙玫府 拳妨碍魂 措茄荤恩 措茄栏肺 辨捞 焊傈窍技. 矫阁 呈绰 酒蠢衬 辫逛 糠备府 避绰 家府绰  矫阁 呈绰 酒蠢衬 避带 糠备府 磐瘤绰 家府甫 呈公唱档 酒抚促款 弊家府甫 沥惩 呈绰 葛福绰 巴捞衬n <巩颇甫 积己秦杭鳖?/@@buildguildnow>  n <辆丰/@end>",0);
  965. m_xNPCWnd.SetGameWndActive(TRUE);
  966. bRet = TRUE;
  967. }
  968. }
  969. break;
  970. }
  971. return bRet;
  972. }
  973. /******************************************************************************************************************
  974. 窃荐疙 : CInterface::MoveTopWindow()
  975. 累己磊 : 
  976. 累己老 : 
  977. 格利   : 盖困狼 扩档快甫 付快胶 谅钎肺 捞悼矫挪促.
  978. 涝仿   : POINT ptMouse
  979. 免仿   : VOID 
  980. [老磊][荐沥磊] : 荐沥郴侩
  981. *******************************************************************************************************************/
  982. VOID CInterface::MoveTopWindow(POINT ptMouse)
  983. {
  984. if ( m_xWndOrderList.GetCounter() != 0 )
  985. {
  986. INT* pnCurrID;
  987. m_xWndOrderList.MoveCurrentToTail();
  988. pnCurrID = m_xWndOrderList.GetCurrentData();
  989. if ( m_bMoveFocusedWnd )
  990. {
  991. switch ( *pnCurrID )
  992. {
  993. case _WND_ID_INVENTORY:
  994. m_xInventoryWnd.MoveGameWnd(ptMouse);
  995. break;
  996. case _WND_ID_STATUS:
  997. m_xStatusWnd.MoveGameWnd(ptMouse);
  998. break;
  999. case _WND_ID_STORE:
  1000. m_xStoreWnd.MoveGameWnd(ptMouse);
  1001. break;
  1002. case _WND_ID_EXCHANGE:
  1003. m_xExchangeWnd.MoveGameWnd(ptMouse);
  1004. break;
  1005. case _WND_ID_GUILDMASTER:
  1006. m_xGuildMasterWnd.MoveGameWnd(ptMouse);
  1007. break;
  1008. case _WND_ID_GUILD:
  1009. m_xGuildWnd.MoveGameWnd(ptMouse);
  1010. break;
  1011. case _WND_ID_GROUP:
  1012. m_xGroupWnd.MoveGameWnd(ptMouse);
  1013. break;
  1014. case _WND_ID_GROUPPOP:
  1015. m_xGroupPopWnd.MoveGameWnd(ptMouse);
  1016. break;
  1017. case _WND_ID_CHATPOP:
  1018. m_xChatPopWnd.MoveGameWnd(ptMouse);
  1019. ShowWindow(g_xChatEditBox.GetSafehWnd(), SW_HIDE);
  1020. break;
  1021. case _WND_ID_NPCCHAT: // 侩扁
  1022. m_xNPCWnd.MoveGameWnd(ptMouse);
  1023. break;
  1024. case _WND_ID_QUEST:
  1025. m_xQuestWnd.MoveGameWnd(ptMouse);
  1026. break;
  1027. case _WND_ID_OPTION:
  1028. m_xOptionWnd.MoveGameWnd(ptMouse);
  1029. break;
  1030. case _WND_ID_HORSE:
  1031. m_xHorseWnd.MoveGameWnd(ptMouse);
  1032. break;
  1033. }
  1034. }
  1035. }
  1036. }
  1037. /******************************************************************************************************************
  1038. 窃荐疙 : CInterface::WindowFocusChanged()
  1039. 累己磊 : 
  1040. 累己老 : 
  1041. 格利   : 扩档快 康开栏肺 付快胶 努腐捞 登搁 泅犁 Top 扩档快甫 付快胶 努腐 扩档快肺 官层林绊 弊扩档快肺 器目胶甫 嘎苗霖促.
  1042. 涝仿   : INT nID
  1043. 免仿   : VOID 
  1044. [老磊][荐沥磊] : 荐沥郴侩
  1045. *******************************************************************************************************************/
  1046. VOID CInterface::WindowFocusChangedAndSetReadyMove(INT nID, POINT ptMouse)
  1047. {
  1048. if ( m_xWndOrderList.GetCounter() != 0 )
  1049. {
  1050. AllWindowsFocusOff();
  1051. DeleteWindowToList(nID);
  1052. AddWindowToList(nID);
  1053. // 付快胶 努腐捞 等惑怕捞搁 捞悼矫懦 霖厚啊 等惑怕捞促.
  1054. m_bMoveFocusedWnd = TRUE;
  1055. switch ( nID )
  1056. {
  1057. case _WND_ID_INVENTORY:
  1058. m_xInventoryWnd.SetGameWndFocused(TRUE);
  1059. m_xInventoryWnd.SetReadyMove(ptMouse);
  1060. break;
  1061. case _WND_ID_STATUS:
  1062. m_xStatusWnd.SetGameWndFocused(TRUE);
  1063. m_xStatusWnd.SetReadyMove(ptMouse);
  1064. break;
  1065. case _WND_ID_STORE:
  1066. m_xStoreWnd.SetGameWndFocused(TRUE);
  1067. m_xStoreWnd.SetReadyMove(ptMouse);
  1068. break;
  1069. case _WND_ID_EXCHANGE:
  1070. m_xExchangeWnd.SetGameWndFocused(TRUE);
  1071. m_xExchangeWnd.SetReadyMove(ptMouse);
  1072. break;
  1073. case _WND_ID_GUILDMASTER:
  1074. m_xGuildMasterWnd.SetGameWndFocused(TRUE);
  1075. m_xGuildMasterWnd.SetReadyMove(ptMouse);
  1076. break;
  1077. case _WND_ID_GUILD:
  1078. m_xGuildWnd.SetGameWndFocused(TRUE);
  1079. m_xGuildWnd.SetReadyMove(ptMouse);
  1080. break;
  1081. case _WND_ID_GROUP:
  1082. m_xGroupWnd.SetGameWndFocused(TRUE);
  1083. m_xGroupWnd.SetReadyMove(ptMouse);
  1084. break;
  1085. case _WND_ID_GROUPPOP:
  1086. m_xGroupPopWnd.SetGameWndFocused(TRUE);
  1087. m_xGroupPopWnd.SetReadyMove(ptMouse);
  1088. break;
  1089. case _WND_ID_CHATPOP:
  1090. m_xChatPopWnd.SetGameWndFocused(TRUE);
  1091. m_xChatPopWnd.SetReadyMove(ptMouse);
  1092. break;
  1093. case _WND_ID_NPCCHAT: // 侩扁
  1094. m_xNPCWnd.SetGameWndFocused(TRUE);
  1095. m_xNPCWnd.SetReadyMove(ptMouse);
  1096. break;
  1097. case _WND_ID_QUEST:
  1098. m_xQuestWnd.SetGameWndFocused(TRUE);
  1099. m_xQuestWnd.SetReadyMove(ptMouse);
  1100. break;
  1101. case _WND_ID_OPTION:
  1102. m_xOptionWnd.SetGameWndFocused(TRUE);
  1103. m_xOptionWnd.SetReadyMove(ptMouse);
  1104. break;
  1105. case _WND_ID_HORSE:
  1106. m_xHorseWnd.SetGameWndFocused(TRUE);
  1107. m_xHorseWnd.SetReadyMove(ptMouse);
  1108. break;
  1109. }
  1110. }
  1111. }
  1112. VOID CInterface::AllWindowsFocusOff()
  1113. {
  1114. if ( m_xWndOrderList.GetCounter() != 0 )
  1115. {
  1116. m_xWndOrderList.MoveCurrentToTop();
  1117. INT* pnCurrID;
  1118. for ( INT nCnt = 0; nCnt < m_xWndOrderList.GetCounter(); nCnt++ )
  1119. {
  1120. pnCurrID = m_xWndOrderList.GetCurrentData();
  1121. switch ( *pnCurrID )
  1122. {
  1123. case _WND_ID_INVENTORY:
  1124. m_xInventoryWnd.SetGameWndFocused(FALSE);
  1125. break;
  1126. case _WND_ID_STATUS:
  1127. m_xStatusWnd.SetGameWndFocused(FALSE);
  1128. break;
  1129. case _WND_ID_STORE:
  1130. m_xStoreWnd.SetGameWndFocused(FALSE);
  1131. break;
  1132. case _WND_ID_EXCHANGE:
  1133. m_xExchangeWnd.SetGameWndFocused(FALSE);
  1134. break;
  1135. case _WND_ID_GUILDMASTER:
  1136. m_xGuildMasterWnd.SetGameWndFocused(FALSE);
  1137. break;
  1138. case _WND_ID_GUILD:
  1139. m_xGuildWnd.SetGameWndFocused(FALSE);
  1140. break;
  1141. case _WND_ID_GROUP:
  1142. m_xGroupWnd.SetGameWndFocused(FALSE);
  1143. break;
  1144. case _WND_ID_GROUPPOP:
  1145. m_xGroupPopWnd.SetGameWndFocused(FALSE);
  1146. break;
  1147. case _WND_ID_CHATPOP:
  1148. m_xChatPopWnd.SetGameWndFocused(FALSE);
  1149. break;
  1150. case _WND_ID_NPCCHAT: // 侩扁
  1151. m_xNPCWnd.SetGameWndFocused(FALSE);
  1152. break;
  1153. case _WND_ID_QUEST:
  1154. m_xQuestWnd.SetGameWndFocused(FALSE);
  1155. break;
  1156. case _WND_ID_OPTION:
  1157. m_xOptionWnd.SetGameWndFocused(FALSE);
  1158. break;
  1159. case _WND_ID_HORSE:
  1160. m_xHorseWnd.SetGameWndFocused(FALSE);
  1161. break;
  1162. }
  1163. m_xWndOrderList.MoveNextNode();
  1164. }
  1165. }
  1166. }
  1167. BOOL CInterface::IsTopWindow(INT nID)
  1168. {
  1169. if ( m_xWndOrderList.GetCounter() != 0 )
  1170. {
  1171. INT* pnCurrID;
  1172. m_xWndOrderList.MoveCurrentToTail();
  1173. pnCurrID = m_xWndOrderList.GetCurrentData();
  1174. if ( nID == *pnCurrID )
  1175. return TRUE;
  1176. }
  1177. return FALSE;
  1178. }
  1179. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1180. // 皋矫瘤 涝仿包访何盒/////////////////////////////////////////////////////////////////////////////////////////
  1181. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1182. /******************************************************************************************************************
  1183. 窃荐疙 : CInterface::OnLButtonDown()
  1184.   累己磊 : 
  1185. 累己老 : 
  1186. 格利   : Mouse LButtonDown捞 老绢车阑锭 牢磐其捞胶俊辑 且老阑 沥狼茄促.
  1187. 涝仿   : POINT ptMouse
  1188. 免仿   : BOOL 
  1189. [老磊][荐沥磊] : 荐沥郴侩
  1190. *******************************************************************************************************************/
  1191. BOOL CInterface::OnLButtonDown(POINT ptMouse)
  1192. {
  1193. if(m_xMsgBox.IsActive()) // 侩扁
  1194. {
  1195. m_xMsgBox.OnButtonDown(ptMouse);
  1196. return TRUE;
  1197. }
  1198. else
  1199. {
  1200. if ( m_xScrlBar.OnLButtonDown(ptMouse) )
  1201. {
  1202. FLOAT fScrlRate;
  1203. fScrlRate = m_xScrlBar.GetScrlRate();
  1204. m_nFstLine  = (m_xChat.GetCounter()-1)*fScrlRate;
  1205. return TRUE;
  1206. }
  1207. for( INT nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++ )
  1208. {
  1209. if ( m_xInterBtn[nCnt].OnLButtonDown(ptMouse) )
  1210. return TRUE;
  1211. }
  1212. INT nInterfaceWndInRect;
  1213. nInterfaceWndInRect = GetWindowInMousePos(ptMouse);
  1214. if ( nInterfaceWndInRect != -1 )
  1215. {
  1216. switch ( nInterfaceWndInRect )
  1217. {
  1218. case _WND_ID_INVENTORY:
  1219. if ( !m_xInventoryWnd.OnLButtonDown(&m_stCommonItem, ptMouse) )
  1220. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1221. break;
  1222. case _WND_ID_STATUS:
  1223. if ( !m_xStatusWnd.OnLButtonDown(&m_stCommonItem, ptMouse) )
  1224. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1225. break;
  1226. case _WND_ID_STORE:
  1227. if ( !m_xStoreWnd.OnLButtonDown(ptMouse) )
  1228. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1229. break;
  1230. case _WND_ID_EXCHANGE:
  1231. if ( !m_xExchangeWnd.OnLButtonDown(ptMouse) )
  1232. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1233. break;
  1234. case _WND_ID_GUILDMASTER:
  1235. if ( !m_xGuildMasterWnd.OnLButtonDown(ptMouse) )
  1236. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1237. break;
  1238. case _WND_ID_GUILD:
  1239. if ( !m_xGuildWnd.OnLButtonDown(ptMouse) )
  1240. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1241. break;
  1242. case _WND_ID_GROUP:
  1243. if ( !m_xGroupWnd.OnLButtonDown(ptMouse) )
  1244. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1245. break;
  1246. case _WND_ID_GROUPPOP:
  1247. if ( !m_xGroupPopWnd.OnLButtonDown(ptMouse) )
  1248. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1249. break;
  1250. case _WND_ID_CHATPOP:
  1251. if ( !m_xChatPopWnd.OnLButtonDown(ptMouse) )
  1252. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1253. break;
  1254. case _WND_ID_NPCCHAT: // 侩扁
  1255. if ( !m_xNPCWnd.OnLButtonDown(ptMouse) )
  1256. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1257. break;
  1258. case _WND_ID_QUEST:
  1259. if ( !m_xQuestWnd.OnLButtonDown(ptMouse) )
  1260. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1261. break;
  1262. case _WND_ID_OPTION:
  1263. if ( !m_xOptionWnd.OnLButtonDown(ptMouse) )
  1264. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1265. break;
  1266. case _WND_ID_HORSE:
  1267. if ( !m_xHorseWnd.OnLButtonDown(ptMouse) )
  1268. WindowFocusChangedAndSetReadyMove(nInterfaceWndInRect, ptMouse);
  1269. break;
  1270. }
  1271. return TRUE;
  1272. }
  1273. else
  1274. AllWindowsFocusOff();
  1275. }
  1276. return FALSE;
  1277. }
  1278. /******************************************************************************************************************
  1279. 窃荐疙 : CInterface::OnLButtonUp()
  1280. 累己磊 : 
  1281. 累己老 : 
  1282. 格利   : Mouse LButtonUp捞 老绢车阑锭 牢磐其捞胶俊辑 且老阑 沥狼茄促.
  1283. 涝仿   : POINT ptMouse
  1284. 免仿   : BOOL 
  1285. [老磊][荐沥磊] : 荐沥郴侩
  1286. *******************************************************************************************************************/
  1287. BOOL CInterface::OnLButtonUp(POINT ptMouse)
  1288. {
  1289. m_bMoveFocusedWnd = FALSE;
  1290. if ( m_xMsgBox.IsActive() ) // 侩扁
  1291. {
  1292. HRESULT hResult;
  1293. hResult = m_xMsgBox.OnButtonUp(ptMouse);
  1294. if ( hResult != 0 )
  1295. {
  1296. switch ( m_nIdxMsgBox )
  1297. {
  1298. case 12:
  1299. {
  1300. switch ( hResult ) // 俊叼飘 冠胶啊 绝澜.
  1301. {
  1302. case 2:
  1303. {
  1304.    DWORD dwCurrTick = timeGetTime();
  1305.    if ( (dwCurrTick - g_xGameProc.m_xMyHero.m_dwLastPKStruckTime> 10000) &&
  1306. (dwCurrTick - g_xGameProc.m_xMyHero.m_dwLastMagicTime   > 10000) &&
  1307. (dwCurrTick - g_xGameProc.m_xMyHero.m_dwLastHitTime > 10000) || 
  1308. (g_xGameProc.m_xMyHero.m_bCurrMtn == _MT_DIE ) )
  1309. SendMessage(g_xMainWnd.GetSafehWnd(), WM_DESTROY, NULL, NULL);
  1310.    else
  1311.    {
  1312.    DWORD dwFont, dwBack;
  1313.    dwFont = GetChatColor(3);
  1314.    dwBack = GetChatColor(2);
  1315.    MsgAdd(dwFont, dwBack, "傈捧吝俊绰 立加阑 谗阑 荐 绝嚼聪促.");
  1316.    }
  1317. }
  1318. break;
  1319. case 4:
  1320. m_xMsgBox.HideMessageBox();
  1321. break;
  1322. }
  1323. }
  1324. break;
  1325. }
  1326. }
  1327. }
  1328. else
  1329. {
  1330. if ( m_xScrlBar.OnLButtonUp(ptMouse) )
  1331. {
  1332. return TRUE;
  1333. }
  1334. for( INT nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++ )
  1335. {
  1336. if ( m_xInterBtn[nCnt].OnLButtonUp(ptMouse) )
  1337. {
  1338. switch ( nCnt )
  1339. {
  1340. case _BTN_ID_QUEST: WindowActivate(_WND_ID_QUEST); break;
  1341. case _BTN_ID_OPTION: WindowActivate(_WND_ID_OPTION); break;
  1342. case _BTN_ID_HORSE: WindowActivate(_WND_ID_HORSE); break;
  1343. case _BTN_ID_CHANGE: WindowActivate(_WND_ID_EXCHANGE); break;
  1344. case _BTN_ID_GUILD:
  1345. g_xClientSocket.SendGuildHome();
  1346. break;
  1347. case _BTN_ID_GROUP: WindowActivate(_WND_ID_GROUP); break;
  1348. case _BTN_ID_POPUP: WindowActivate(_WND_ID_CHATPOP); break;
  1349. case _BTN_ID_BAG: WindowActivate(_WND_ID_INVENTORY); break;
  1350. case _BTN_ID_MUGONG: m_bShowKey = !m_bShowKey; break;
  1351. case _BTN_ID_BELT:
  1352. {
  1353. if ( m_shBeltHeight >= 46 )
  1354. {
  1355. m_shBeltHeight = 46;
  1356. }
  1357. else if ( m_shBeltHeight <= 0 )
  1358. {
  1359. m_shBeltHeight = 0;
  1360. }
  1361. if ( m_shBeltHeight == 46 )
  1362. {
  1363. m_bBeltState = _BELT_STATE_DOWN;
  1364. }
  1365. else if ( m_shBeltHeight == 0 )
  1366. {
  1367. m_bBeltState = _BELT_STATE_UP;
  1368. }
  1369. }
  1370. break;
  1371. case _BTN_ID_EXIT:
  1372. {
  1373. CHAR   szMsg[MAX_PATH];
  1374. HINSTANCE hLib;
  1375. m_nIdxMsgBox = 12;
  1376. hLib = LoadLibrary("Ats.dll"); // Load Dll
  1377. LoadString(hLib,m_nIdxMsgBox,szMsg, MAX_PATH);
  1378. FreeLibrary(hLib);
  1379. m_xMsgBox.ShowMessageBox(szMsg, 2); // YES/No ?
  1380. }
  1381. break;
  1382. case _BTN_ID_MAGIC:
  1383. if ( m_xStatusWnd.GetStatusWndType() != _TYPE_SETMAGIC )
  1384. {
  1385. if ( !WindowActivate(_WND_ID_STATUS) ) WindowActivate(_WND_ID_STATUS);
  1386. }
  1387. else
  1388. WindowActivate(_WND_ID_STATUS);
  1389. m_xStatusWnd.SetStatusWndType(_TYPE_SETMAGIC);
  1390. break;
  1391. case _BTN_ID_CHAR:
  1392. if ( m_xStatusWnd.GetStatusWndType() != _TYPE_EQUIP )
  1393. {
  1394. if ( !WindowActivate(_WND_ID_STATUS) ) WindowActivate(_WND_ID_STATUS);
  1395. }
  1396. else
  1397. WindowActivate(_WND_ID_STATUS);
  1398. m_xStatusWnd.SetStatusWndType(_TYPE_EQUIP);
  1399. break;
  1400. }
  1401. }
  1402. }
  1403. INT nInterfaceWndInRect;
  1404. nInterfaceWndInRect = GetWindowInMousePos(ptMouse);
  1405. // 阿 扩档快狼 OnLButtonUp狼 府畔蔼捞 TRUE捞搁 扩档快令绰 Close等促.
  1406. if ( nInterfaceWndInRect != -1 )
  1407. {
  1408. switch ( nInterfaceWndInRect )
  1409. {
  1410. case _WND_ID_INVENTORY: if ( m_xInventoryWnd.OnLButtonUp(&m_stCommonItem, ptMouse) ) WindowActivate(_WND_ID_INVENTORY); break;
  1411. case _WND_ID_STATUS: if ( m_xStatusWnd.OnLButtonUp(&m_stCommonItem, ptMouse) ) WindowActivate(_WND_ID_STATUS); break;
  1412. case _WND_ID_STORE: if ( m_xStoreWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_STORE); break;
  1413. case _WND_ID_EXCHANGE: if ( m_xExchangeWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_EXCHANGE); break;
  1414. case _WND_ID_GUILDMASTER:
  1415. {
  1416. if ( m_xGuildMasterWnd.OnLButtonUp(ptMouse) )
  1417. WindowActivate(_WND_ID_EXCHANGE);
  1418. break;
  1419. }
  1420. case _WND_ID_GUILD: if ( m_xGuildWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_GUILD); break;
  1421. case _WND_ID_GROUP: if ( m_xGroupWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_GROUP); break;
  1422. case _WND_ID_GROUPPOP: if ( m_xGroupPopWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_GROUPPOP); break;
  1423. case _WND_ID_CHATPOP: if ( m_xChatPopWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_CHATPOP); break;
  1424. case _WND_ID_QUEST: if ( m_xQuestWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_QUEST); break;
  1425. case _WND_ID_OPTION: if ( m_xOptionWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_OPTION); break;
  1426. case _WND_ID_HORSE: if ( m_xHorseWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_HORSE); break;
  1427. case _WND_ID_NPCCHAT: if ( m_xNPCWnd.OnLButtonUp(ptMouse) ) WindowActivate(_WND_ID_NPCCHAT); break; // 侩扁
  1428. }
  1429. return TRUE;
  1430. }
  1431. }
  1432. return FALSE;
  1433. }
  1434. /******************************************************************************************************************
  1435. 窃荐疙 : CInterface::OnMouseMove()
  1436. 累己磊 : 
  1437. 累己老 : 
  1438. 格利   : Mouse Move啊 老绢车阑锭 牢磐其捞胶俊辑 且老阑 沥狼茄促.
  1439. 涝仿   : POINT ptMouse
  1440. 免仿   : BOOL 
  1441. [老磊][荐沥磊] : 荐沥郴侩
  1442. *******************************************************************************************************************/
  1443. BOOL CInterface::OnMouseMove(POINT ptMouse)
  1444. {
  1445. MoveTopWindow(ptMouse);
  1446. if ( m_xScrlBar.OnMouseMove(ptMouse) )
  1447. {
  1448. FLOAT fScrlRate;
  1449. fScrlRate = m_xScrlBar.GetScrlRate();
  1450. m_nFstLine  = (m_xChat.GetCounter()-1)*fScrlRate;
  1451. return TRUE;
  1452. }
  1453. for( INT nCnt = 0; nCnt < _MAX_INTER_BTN; nCnt++ )
  1454. m_xInterBtn[nCnt].OnMouseMove(ptMouse);
  1455. INT nInterfaceWndInRect;
  1456. nInterfaceWndInRect = GetWindowInMousePos(ptMouse);
  1457. if ( nInterfaceWndInRect != -1 )
  1458. {
  1459. switch ( nInterfaceWndInRect )
  1460. {
  1461. case _WND_ID_INVENTORY:
  1462. m_xInventoryWnd.OnMouseMove(ptMouse);
  1463. break;
  1464. case _WND_ID_STATUS:
  1465. m_xStatusWnd.OnMouseMove(ptMouse);
  1466. break;
  1467. case _WND_ID_STORE:
  1468. m_xStoreWnd.OnMouseMove(ptMouse);
  1469. break;
  1470. case _WND_ID_EXCHANGE:
  1471. m_xExchangeWnd.OnMouseMove(ptMouse);
  1472. break;
  1473. case _WND_ID_GUILDMASTER:
  1474. m_xGuildMasterWnd.OnMouseMove(ptMouse);
  1475. break;
  1476. case _WND_ID_GUILD:
  1477. m_xGuildWnd.OnMouseMove(ptMouse);
  1478. break;
  1479. case _WND_ID_GROUP:
  1480. m_xGroupWnd.OnMouseMove(ptMouse);
  1481. break;
  1482. case _WND_ID_GROUPPOP:
  1483. m_xGroupPopWnd.OnMouseMove(ptMouse);
  1484. break;
  1485. case _WND_ID_CHATPOP:
  1486. m_xChatPopWnd.OnMouseMove(ptMouse);
  1487. break;
  1488. case _WND_ID_QUEST:
  1489. m_xQuestWnd.OnMouseMove(ptMouse);
  1490. break;
  1491. case _WND_ID_OPTION:
  1492. m_xOptionWnd.OnMouseMove(ptMouse);
  1493. break;
  1494. case _WND_ID_HORSE:
  1495. m_xHorseWnd.OnMouseMove(ptMouse);
  1496. break;
  1497. case _WND_ID_NPCCHAT: // 侩扁
  1498. m_xNPCWnd.OnMouseMove(ptMouse);
  1499. break;
  1500. }
  1501. return TRUE;
  1502. }
  1503. else
  1504. {
  1505. m_xStatusWnd.SetStatusBtnInit();
  1506. m_xInventoryWnd.SetInvenBtnInit();
  1507. m_xChatPopWnd.SetStatusBtnInit();
  1508. m_xGuildMasterWnd.SetStatusBtnInit();
  1509. m_xOptionWnd.SetStatusBtnInit();
  1510. m_xQuestWnd.SetStatusBtnInit();
  1511. m_xHorseWnd.SetStatusBtnInit();
  1512. m_xExchangeWnd.SetStatusBtnInit();
  1513. }
  1514. return FALSE;
  1515. }
  1516. BOOL CInterface::OnScrollDown()
  1517. {
  1518. if ( IsTopWindow(m_xInventoryWnd.m_nID) )
  1519. {
  1520. m_xInventoryWnd.OnScrollDown();
  1521. }
  1522. else if ( IsTopWindow(m_xStatusWnd.m_nID) )
  1523. {
  1524. m_xStatusWnd.OnScrollDown();
  1525. }
  1526. else if (IsTopWindow(m_xNPCWnd.m_nID)) // 侩扁
  1527. {
  1528. m_xNPCWnd.OnScrollDown();
  1529. }
  1530. else
  1531. {
  1532. if ( !m_xChatPopWnd.m_bActive )
  1533. {
  1534. if ( m_nFstLine > 0 )
  1535. {
  1536. m_nFstLine--;
  1537. }
  1538. }
  1539. else
  1540. {
  1541. m_xChatPopWnd.OnScrollDown();
  1542. }
  1543. }
  1544. return TRUE;
  1545. }
  1546. BOOL CInterface::OnScrollUp()
  1547. {
  1548. if ( IsTopWindow(m_xInventoryWnd.m_nID) )
  1549. {
  1550. m_xInventoryWnd.OnScrollUp();
  1551. }
  1552. else if ( IsTopWindow(m_xStatusWnd.m_nID) )
  1553. {
  1554. m_xStatusWnd.OnScrollUp();
  1555. }
  1556. else if (IsTopWindow(m_xNPCWnd.m_nID)) // 侩扁
  1557. {
  1558. m_xNPCWnd.OnScrollUp();
  1559. }
  1560. else
  1561. {
  1562. if ( !m_xChatPopWnd.m_bActive )
  1563. {
  1564. if ( m_nFstLine < (m_xChat.GetCounter()-1) )
  1565. {
  1566. m_nFstLine++;
  1567. }
  1568. }
  1569. else
  1570. {
  1571. m_xChatPopWnd.OnScrollUp();
  1572. }
  1573. }
  1574. return TRUE;
  1575. }
  1576. BOOL CInterface::OnLButtonDoubleClick(POINT ptMouse)
  1577. {
  1578. if ( IsTopWindow(m_xInventoryWnd.m_nID) )
  1579. m_xInventoryWnd.OnLButtonDoubleClick(&m_stCommonItem, ptMouse);
  1580. return TRUE;
  1581. }
  1582. BOOL CInterface::OnKeyUp(WPARAM wParam, LPARAM lParam)
  1583. {
  1584. if ( m_xInventoryWnd.OnKeyUp(&m_stCommonItem, wParam, lParam) )
  1585. {
  1586. return TRUE;
  1587. }
  1588. return FALSE;
  1589. }
  1590. BOOL CInterface::OnKeyDown(WPARAM wParam, LPARAM lParam)
  1591. {
  1592. switch ( wParam )
  1593. {
  1594. case VK_RETURN:
  1595. break;
  1596. case VK_F9:
  1597. WindowActivate(_WND_ID_INVENTORY);
  1598. break;
  1599. case VK_F11:
  1600. if ( m_xStatusWnd.GetStatusWndType() != _TYPE_SETMAGIC )
  1601. {
  1602. if ( !WindowActivate(_WND_ID_STATUS) )
  1603. WindowActivate(_WND_ID_STATUS);
  1604. }
  1605. else
  1606. WindowActivate(_WND_ID_STATUS);
  1607. m_xStatusWnd.SetStatusWndType(_TYPE_SETMAGIC);
  1608. break;
  1609. }
  1610. INT nInterfaceWndInRect;
  1611. nInterfaceWndInRect = GetWindowInMousePos(g_xGameProc.m_ptMousePos);
  1612. if ( nInterfaceWndInRect != -1 )
  1613. {
  1614. if ( nInterfaceWndInRect == _WND_ID_STATUS )
  1615. {
  1616. if ( m_xStatusWnd.OnKeyDown(wParam, lParam, g_xGameProc.m_ptMousePos) )
  1617. return TRUE;
  1618. }
  1619. }
  1620. return FALSE;
  1621. }
  1622. VOID CInterface::OnSysKeyDown()
  1623. {
  1624. // F10 Key 喘啡阑锭.
  1625. if ( m_xStatusWnd.GetStatusWndType() != _TYPE_EQUIP )
  1626. {
  1627. if ( !WindowActivate(_WND_ID_STATUS) )
  1628. WindowActivate(_WND_ID_STATUS);
  1629. }
  1630. else
  1631. WindowActivate(_WND_ID_STATUS);
  1632. m_xStatusWnd.SetStatusWndType(_TYPE_EQUIP);
  1633. }
  1634. LRESULT CInterface::OnMsgInputted(WPARAM wParam, LPARAM lParam)
  1635. {
  1636. if ( m_xNPCWnd.OnMsgInputted() )
  1637. return TRUE;
  1638. return 0L;
  1639. }