Advertisement
viperkit

Untitled

Jul 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 13.16 KB | None | 0 0
  1. I. Client Binary:
  2.  
  3. 1.0 EterPythonLib/PythonSlotWindow.cpp
  4.  
  5. //Pesquisar por:
  6.  
  7.  
  8. if (!m_pSlotActiveEffect)
  9.  
  10. //Substitua por:
  11.  
  12.  
  13. #ifdef ENABLE_HIGHLIGHT_SYSTEM
  14.     if (!m_apSlotActiveEffect[0] || !m_apSlotActiveEffect[1] || !m_apSlotActiveEffect[2])
  15. #else
  16.     if (!m_pSlotActiveEffect)
  17. #endif
  18.  
  19. //Pesquisar por:
  20.  
  21.  
  22.     if (m_pSlotActiveEffect)
  23.         m_pSlotActiveEffect->Update();
  24.  
  25. //Substitua por:
  26.  
  27.  
  28. #ifdef ENABLE_HIGHLIGHT_SYSTEM
  29.     for (int i = 0; i < 3; ++i)
  30.     {
  31.         if (m_apSlotActiveEffect[i])
  32.             m_apSlotActiveEffect[i]->Update();
  33.     }
  34. #else
  35.     if (m_pSlotActiveEffect)
  36.         m_pSlotActiveEffect->Update();
  37. #endif
  38.  
  39. //Pesquisar por:
  40.  
  41.  
  42.         if (rSlot.bActive)
  43.         {
  44.             int ix = m_rect.left + rSlot.ixPosition;
  45.             int iy = m_rect.top + rSlot.iyPosition;
  46.             if (m_pSlotActiveEffect)
  47.             {
  48.                 m_pSlotActiveEffect->SetPosition(ix, iy);
  49.                 m_pSlotActiveEffect->Render();
  50.             }
  51.         }
  52.  
  53. //Substitua por:
  54.  
  55.  
  56.         if (rSlot.bActive)
  57.         {
  58.             int ix = m_rect.left + rSlot.ixPosition;
  59.             int iy = m_rect.top + rSlot.iyPosition;
  60. #ifdef ENABLE_HIGHLIGHT_SYSTEM
  61.             int highlight = rSlot.byyPlacedItemSize;
  62.             if (highlight == 1)
  63.             {
  64.                 m_apSlotActiveEffect[0]->Show();
  65.                 m_apSlotActiveEffect[0]->SetPosition(ix, iy);
  66.                 m_apSlotActiveEffect[0]->Render();
  67.             }
  68.  
  69.             if (highlight == 2)
  70.             {
  71.                 m_apSlotActiveEffect[1]->Show();
  72.                 m_apSlotActiveEffect[1]->SetPosition(ix, iy);
  73.                 m_apSlotActiveEffect[1]->Render();
  74.             }
  75.  
  76.             if (highlight == 3)
  77.             {
  78.                 m_apSlotActiveEffect[2]->Show();
  79.                 m_apSlotActiveEffect[2]->SetPosition(ix, iy);
  80.                 m_apSlotActiveEffect[2]->Render();
  81.             }
  82. #else
  83.             if (m_pSlotActiveEffect)
  84.             {
  85.                 m_pSlotActiveEffect->SetPosition(ix, iy);
  86.                 m_pSlotActiveEffect->Render();
  87.             }
  88. #endif
  89.         }
  90.  
  91. //Pesquisar por:
  92.  
  93.  
  94. void CSlotWindow::__CreateSlotEnableEffect()
  95.  
  96. //Substitui a função por isso:
  97.  
  98.  
  99. void CSlotWindow::__CreateSlotEnableEffect()
  100. {
  101.     __DestroySlotEnableEffect();
  102. #ifdef ENABLE_HIGHLIGHT_SYSTEM
  103.     for (int i = 0; i < 3; ++i)
  104.     {
  105.         CAniImageBox* pEff = new CAniImageBox(NULL);
  106.         for (int j = 0; j <= 12; ++j)
  107.         {
  108.             char buf[64+1];
  109.             sprintf_s(buf, "d:/ymir work/ui/public/slotactiveeffect/slot%d/%02d.sub", (i+1), j);
  110.             pEff->AppendImage(buf);
  111.         }
  112.  
  113.         pEff->SetRenderingMode(CGraphicExpandedImageInstance::RENDERING_MODE_SCREEN);
  114.         m_apSlotActiveEffect[i] = pEff;
  115.     }
  116. #else
  117.     m_pSlotActiveEffect = new CAniImageBox(NULL);
  118.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/00.sub");
  119.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/01.sub");
  120.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/02.sub");
  121.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/03.sub");
  122.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/04.sub");
  123.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/05.sub");
  124.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/06.sub");
  125.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/07.sub");
  126.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/08.sub");
  127.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/09.sub");
  128.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/10.sub");
  129.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/11.sub");
  130.     m_pSlotActiveEffect->AppendImage("d:/ymir work/ui/public/slotactiveeffect/12.sub");
  131.     m_pSlotActiveEffect->SetRenderingMode(CGraphicExpandedImageInstance::RENDERING_MODE_SCREEN);
  132.     m_pSlotActiveEffect->Show();
  133. #endif
  134. }
  135.  
  136. //Pesquisar por:
  137.  
  138.  
  139. void CSlotWindow::__DestroySlotEnableEffect()
  140.  
  141. //Substitui a função por isso:
  142.  
  143.  
  144. void CSlotWindow::__DestroySlotEnableEffect()
  145. {
  146. #ifdef ENABLE_HIGHLIGHT_SYSTEM
  147.     for (int i = 0; i < 3; ++i)
  148.     {
  149.         if (m_apSlotActiveEffect[i])
  150.         {
  151.             delete m_apSlotActiveEffect[i];
  152.             m_apSlotActiveEffect[i] = NULL;
  153.         }
  154.     }
  155. #else
  156.     if (m_pSlotActiveEffect)
  157.     {
  158.         delete m_pSlotActiveEffect;
  159.         m_pSlotActiveEffect = NULL;
  160.     }
  161. #endif
  162. }
  163.  
  164. //Pesquisar por:
  165.  
  166.  
  167. m_pSlotActiveEffect = NULL;
  168.  
  169. //Substitua por:
  170.  
  171.  
  172. #ifdef ENABLE_HIGHLIGHT_SYSTEM
  173.     for (int i = 0; i < 3; ++i)
  174.     {
  175.         m_apSlotActiveEffect[i] = NULL;
  176.     }
  177. #else
  178.     m_pSlotActiveEffect = NULL;
  179. #endif
  180.  
  181.  
  182. 1.1 EterPythonLib/PythonSlotWindow.h
  183.  
  184. //Pesquisar por:
  185.  
  186.  
  187.  #include "PythonWindow.h"
  188.  
  189. //Adiciona antes:
  190.  
  191.  
  192. #include "../UserInterface/Locale_inc.h"
  193.  
  194. //Pesquisar por:
  195.  
  196.  
  197. CAniImageBox * m_pSlotActiveEffect;
  198.  
  199. //Substitua por:
  200.  
  201.  
  202. #ifdef ENABLE_HIGHLIGHT_SYSTEM
  203.             CAniImageBox * m_apSlotActiveEffect[3];
  204. #else
  205.             CAniImageBox * m_pSlotActiveEffect;
  206. #endif
  207.  
  208. 2.o UserInterface/PythonNetworkStreamPhaseGameItem.cpp
  209.  
  210. //Pesquisar por:
  211.  
  212.  
  213. bool CPythonNetworkStream::RecvItemSetPacket2()
  214.  
  215. //Substitui a função por isso:
  216.  
  217.  
  218. bool CPythonNetworkStream::RecvItemSetPacket2()
  219. {
  220.     TPacketGCItemSet2 packet_item_set;
  221.  
  222.     if (!Recv(sizeof(TPacketGCItemSet2), &packet_item_set))
  223.         return false;
  224.  
  225.     TItemData kItemData;
  226.     kItemData.vnum    = packet_item_set.vnum;
  227.     kItemData.count    = packet_item_set.count;
  228. #ifdef ENABLE_SOULBIND_SYSTEM
  229.     kItemData.bind = packet_item_set.bind;
  230. #endif
  231.     kItemData.flags = packet_item_set.flags;
  232.     kItemData.anti_flags = packet_item_set.anti_flags;
  233.  
  234.     for (int i=0; i<ITEM_SOCKET_SLOT_MAX_NUM; ++i)
  235.         kItemData.alSockets[i]=packet_item_set.alSockets[i];
  236.     for (int j=0; j<ITEM_ATTRIBUTE_SLOT_MAX_NUM; ++j)
  237.         kItemData.aAttr[j]=packet_item_set.aAttr[j];
  238.  
  239.     IAbstractPlayer& rkPlayer=IAbstractPlayer::GetSingleton();
  240.     rkPlayer.SetItemData(packet_item_set.Cell, kItemData);
  241.  
  242.     if (packet_item_set.highlight)
  243.         PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_Highlight_Item", Py_BuildValue("(ii)", packet_item_set.Cell.window_type, packet_item_set.Cell.cell));
  244.  
  245.     __RefreshInventoryWindow();
  246.     return true;
  247. }
  248.  
  249. 2.1 UserInterface/PythonApplicationModule.cpp
  250.  
  251. //Pesquisar por:
  252.  
  253.  
  254. #ifdef ENABLE_COSTUME_SYSTEM
  255.  
  256. //adicione abaixo:
  257.  
  258.  
  259. #ifdef ENABLE_HIGHLIGHT_SYSTEM
  260.     PyModule_AddIntConstant(poModule, "ENABLE_HIGHLIGHT_SYSTEM", 1);
  261. #else
  262.     PyModule_AddIntConstant(poModule, "ENABLE_HIGHLIGHT_SYSTEM", 0);
  263. #endif
  264.  
  265. 2.2 UserInterface/Locale_inc.h
  266.  
  267. //Adicionar:
  268.  
  269.  
  270. #define ENABLE_HIGHLIGHT_SYSTEM
  271.  
  272.  
  273. II. Src game
  274.  
  275. 1.0 Common/service.h
  276.  
  277. //Adicionar:
  278.  
  279.  
  280. #define __HIGHLIGHT_SYSTEM__
  281.  
  282. 2.0 Game/Src/item.h
  283.  
  284. //Pesquisar por:
  285.  
  286.  
  287. bool    AddToCharacter(LPCHARACTER ch, TItemPos Cell);
  288.  
  289. //Substitua por:
  290.  
  291.  
  292. #ifdef __HIGHLIGHT_SYSTEM__
  293.         bool    AddToCharacter(LPCHARACTER ch, TItemPos Cell, bool isHighLight = true);
  294. #else
  295.         bool    AddToCharacter(LPCHARACTER ch, TItemPos Cell);
  296. #endif
  297.  
  298. 2.1 Game/Src/item.cpp
  299.  
  300. //Pesquisar por:
  301.  
  302.  
  303. bool CItem::AddToCharacter(LPCHARACTER ch, TItemPos Cell)
  304.  
  305. //Substitua por:
  306.  
  307.  
  308. #ifdef __HIGHLIGHT_SYSTEM__
  309. bool CItem::AddToCharacter(LPCHARACTER ch, TItemPos Cell, bool isHighLight)
  310. #else
  311. bool CItem::AddToCharacter(LPCHARACTER ch, TItemPos Cell)
  312. #endif
  313.  
  314. //Pesquisar por:
  315.  
  316.  
  317. ch->SetItem(TItemPos(window_type, pos), this);
  318.  
  319. //Substitua por:
  320.  
  321.  
  322. #ifdef __HIGHLIGHT_SYSTEM__
  323.     ch->SetItem(TItemPos(window_type, pos), this, isHighLight);
  324. #else
  325.     ch->SetItem(TItemPos(window_type, pos), this);
  326. #endif
  327.  
  328. 2.2 Game/Src/char_item.cpp
  329.  
  330. //Pesquisar por:
  331.  
  332.  
  333. void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem)
  334.  
  335. //Substitua por:
  336.  
  337.  
  338. #ifdef __HIGHLIGHT_SYSTEM__
  339. void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem, bool isHighLight)
  340. #else
  341. void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem)
  342. #endif
  343.  
  344. //Pesquisar por:
  345.  
  346.  
  347. pack.highlight = (Cell.window_type == DRAGON_SOUL_INVENTORY);
  348.  
  349. //Substitua por:
  350.  
  351.  
  352.             if (isHighLight)
  353.                 pack.highlight = true;
  354.             else
  355.                 pack.highlight = (Cell.window_type == DRAGON_SOUL_INVENTORY);
  356. #else
  357.             pack.highlight = (Cell.window_type == DRAGON_SOUL_INVENTORY);
  358. #endif
  359.  
  360. //Pesquisar por:
  361.  
  362.  
  363. SetItem(TItemPos (INVENTORY, INVENTORY_MAX_NUM + bCell), item);
  364.  
  365. //Substitua por:
  366.  
  367.  
  368. #ifdef __HIGHLIGHT_SYSTEM__
  369.     SetItem(TItemPos (INVENTORY, INVENTORY_MAX_NUM + bCell), item, false);
  370. #else
  371.     SetItem(TItemPos (INVENTORY, INVENTORY_MAX_NUM + bCell), item);
  372. #endif
  373.  
  374. //Pesquisar por:
  375.  
  376.  
  377. item2->AddToCharacter(this, TItemPos(INVENTORY, bInvenCell));
  378.  
  379. //Substitua por:
  380.  
  381.  
  382. #ifdef __HIGHLIGHT_SYSTEM__
  383.             item2->AddToCharacter(this, TItemPos(INVENTORY, bInvenCell), false);
  384. #else
  385.             item2->AddToCharacter(this, TItemPos(INVENTORY, bInvenCell));
  386. #endif
  387.  
  388. //Pesquisar por:
  389.  
  390.  
  391.         item1->AddToCharacter(this, TItemPos(INVENTORY, bCell2));
  392.         item2->AddToCharacter(this, TItemPos(INVENTORY, bCell1));
  393.  
  394. //Substitua por:
  395.  
  396.  
  397. #ifdef __HIGHLIGHT_SYSTEM__
  398.         item1->AddToCharacter(this, TItemPos(INVENTORY, bCell2), false);
  399.         item2->AddToCharacter(this, TItemPos(INVENTORY, bCell1), false);
  400. #else
  401.         item1->AddToCharacter(this, TItemPos(INVENTORY, bCell2));
  402.         item2->AddToCharacter(this, TItemPos(INVENTORY, bCell1));
  403. #endif
  404.  
  405. //Pesquisar por:
  406.  
  407.  
  408.         item->AddToCharacter(this, TItemPos(DRAGON_SOUL_INVENTORY, pos));
  409.  
  410. //Substitua por:
  411.  
  412.  
  413. #ifdef __HIGHLIGHT_SYSTEM__
  414.         item->AddToCharacter(this, TItemPos(DRAGON_SOUL_INVENTORY, pos), false);
  415. #else
  416.         item->AddToCharacter(this, TItemPos(DRAGON_SOUL_INVENTORY, pos));
  417. #endif
  418.  
  419. //Pesquisar por:
  420.  
  421.  
  422.         item->AddToCharacter(this, TItemPos(INVENTORY, pos));
  423.  
  424. //Substitua por:
  425.  
  426.  
  427. #ifdef __HIGHLIGHT_SYSTEM__
  428.         item->AddToCharacter(this, TItemPos(INVENTORY, pos), false);
  429. #else
  430.         item->AddToCharacter(this, TItemPos(INVENTORY, pos));
  431. #endif
  432.  
  433.  
  434. 2.3 Game/Src/char.h
  435.  
  436. //Pesquisar por:
  437.  
  438.  
  439. void    SetItem(TItemPos Cell, LPITEM item);
  440.  
  441. //Substitua por:
  442.  
  443.  
  444. #ifdef __HIGHLIGHT_SYSTEM__
  445.         void    SetItem(TItemPos Cell, LPITEM item, bool isHighLight = false);
  446. #else
  447.         void    SetItem(TItemPos Cell, LPITEM item);
  448. #endif
  449.  
  450. III. Client Root
  451.  
  452. 1.0 Root/uiinventory.py
  453.  
  454. //Pesquisar por:
  455.  
  456.  
  457. self.wndCostume = None
  458.  
  459. //Mai jos Adicionar:
  460.  
  461.  
  462.         if app.ENABLE_HIGHLIGHT_SYSTEM:
  463.             self.listHighlightedSlot = []
  464.  
  465. //Pesquisar por:
  466.  
  467.  
  468. def Close(self):
  469.  
  470. //Mai jos Adicionar:
  471.  
  472.  
  473.     if app.ENABLE_HIGHLIGHT_SYSTEM:
  474.         def HighlightSlot(self, slot):
  475.             if not slot in self.listHighlightedSlot:
  476.                 self.listHighlightedSlot.append(slot)
  477.  
  478. //Pesquisar por:
  479.  
  480.  
  481. self.wndItem.DeactivateSlot(i)
  482.  
  483. //Mai jos Adicionar:
  484.  
  485.  
  486.             elif app.ENABLE_HIGHLIGHT_SYSTEM:
  487.                 if slotNumber in self.listHighlightedSlot:
  488.                     self.wndItem.ActivateSlot(i)
  489.  
  490. //Pesquisar por:
  491.  
  492.  
  493. def OverInItem(self, overSlotPos):
  494.  
  495. //După:
  496.  
  497.  
  498. overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos)
  499.  
  500. //adicione abaixo:
  501.  
  502.  
  503.         if app.ENABLE_HIGHLIGHT_SYSTEM:
  504.             stat = 0
  505.             slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos)
  506.             itemVnum = player.GetItemIndex(slotNumber)
  507.             if constInfo.IS_AUTO_POTION(itemVnum):
  508.                 metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
  509.                 if slotNumber >= player.INVENTORY_PAGE_SIZE:
  510.                     slotNumber -= player.INVENTORY_PAGE_SIZE
  511.  
  512.                 isActivated = 0 != metinSocket[0]
  513.                 if isActivated:
  514.                     stat = 1
  515.             elif constInfo.IS_ACCE_ITEM(itemVnum, 1) == TRUE:
  516.                 metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
  517.                 isActivated = metinSocket[0]
  518.                 if isActivated == 1:
  519.                     stat = 1
  520.  
  521.             if not stat:
  522.                 self.wndItem.DeactivateSlot(overSlotPos)
  523.                 try:
  524.                     self.listHighlightedSlot.remove(slotNumber)
  525.                 except:
  526.                     pass
  527.  
  528.  
  529.  
  530. 1.1 Root/interfacemodule.py
  531.  
  532. //Pesquisar por:
  533.  
  534.  
  535. def Highligt_Item(self, inven_type, inven_pos):
  536.  
  537. //Substitui a função por isso:
  538.  
  539.  
  540.     def Highligt_Item(self, inven_type, inven_pos):
  541.         if not app.ENABLE_HIGHLIGHT_SYSTEM:
  542.             if player.DRAGON_SOUL_INVENTORY == inven_type:
  543.                 if app.ENABLE_DRAGON_SOUL_SYSTEM:
  544.                     self.wndDragonSoul.HighlightSlot(inven_pos)
  545.         else:
  546.             if inven_type == player.INVENTORY:
  547.                 self.wndInventory.HighlightSlot(inven_pos)
  548.             elif inven_type == player.DRAGON_SOUL_INVENTORY:
  549.                 if app.ENABLE_DRAGON_SOUL_SYSTEM:
  550.                     self.wndDragonSoul.HighlightSlot(inven_pos)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement