Guest User

Untitled

a guest
Nov 14th, 2023
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 67.32 KB | None | 0 0
  1. import ui
  2. import player
  3. import mouseModule
  4. import net
  5. import app
  6. import snd
  7. import item
  8. import player
  9. import chat
  10. import grp
  11. import uiScriptLocale
  12. import uiRefine
  13. import uiAttachMetin
  14. import uiPickMoney
  15. import uiCommon
  16. import uiPrivateShopBuilder # 개인상점 열동안 ItemMove 방지
  17. import localeInfo
  18. import constInfo
  19. import ime
  20. import wndMgr
  21. import uiPickEtc
  22. import uiToolTip
  23.  
  24. ITEM_MALL_BUTTON_ENABLE = True
  25.  
  26.  
  27.  
  28. ITEM_FLAG_APPLICABLE = 1 << 14
  29.  
  30. class CostumeWindow(ui.ScriptWindow):
  31.  
  32. def __init__(self, wndInventory):
  33. import exception
  34.  
  35. if not app.ENABLE_COSTUME_SYSTEM:
  36. exception.Abort("What do you do?")
  37. return
  38.  
  39. if not wndInventory:
  40. exception.Abort("wndInventory parameter must be set to InventoryWindow")
  41. return
  42.  
  43. ui.ScriptWindow.__init__(self)
  44.  
  45. self.isLoaded = 0
  46. self.wndInventory = wndInventory;
  47.  
  48. self.__LoadWindow()
  49.  
  50. def __del__(self):
  51. ui.ScriptWindow.__del__(self)
  52.  
  53. def Show(self):
  54. self.__LoadWindow()
  55. self.RefreshCostumeSlot()
  56.  
  57. ui.ScriptWindow.Show(self)
  58.  
  59. def Close(self):
  60. self.Hide()
  61.  
  62. def __LoadWindow(self):
  63. if self.isLoaded == 1:
  64. return
  65.  
  66. self.isLoaded = 1
  67.  
  68. try:
  69. pyScrLoader = ui.PythonScriptLoader()
  70. pyScrLoader.LoadScriptFile(self, "UIScript/CostumeWindow.py")
  71. except:
  72. import exception
  73. exception.Abort("CostumeWindow.LoadWindow.LoadObject")
  74.  
  75. try:
  76. wndEquip = self.GetChild("CostumeSlot")
  77. self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
  78.  
  79. except:
  80. import exception
  81. exception.Abort("CostumeWindow.LoadWindow.BindObject")
  82.  
  83. ## Equipment
  84. wndEquip.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
  85. wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
  86. wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  87. wndEquip.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  88. wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
  89. wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
  90.  
  91. self.wndEquip = wndEquip
  92.  
  93. def RefreshCostumeSlot(self):
  94. getItemVNum=player.GetItemIndex
  95.  
  96. for i in xrange(item.COSTUME_SLOT_COUNT):
  97. slotNumber = item.COSTUME_SLOT_START + i
  98. self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0)
  99.  
  100. self.wndEquip.RefreshSlot()
  101.  
  102. if app.WJ_SPLIT_INVENTORY_SYSTEM:
  103. class ExtendedInventoryWindow(ui.ScriptWindow):
  104. tooltipItem = None
  105. interface = None
  106. dlgPickMoney = None
  107. dlgPickItem = None
  108. sellingSlotNumber = -1
  109. isLoaded = 0
  110.  
  111. def __init__(self):
  112. ui.ScriptWindow.__init__(self)
  113. self.inventoryPageIndex = 0
  114. self.__LoadWindow()
  115.  
  116. def __del__(self):
  117. ui.ScriptWindow.__del__(self)
  118.  
  119.  
  120. def Show(self):
  121. self.__LoadWindow()
  122. ui.ScriptWindow.Show(self)
  123.  
  124. def BindInterfaceClass(self, interface):
  125. self.interface = interface
  126.  
  127. def __LoadWindow(self):
  128. if self.isLoaded == 1:
  129. return
  130.  
  131. self.isLoaded = 1
  132.  
  133. try:
  134. pyScrLoader = ui.PythonScriptLoader()
  135. pyScrLoader.LoadScriptFile(self, "UIScript/ExtendedInventoryWindow.py")
  136. except:
  137. import exception
  138. exception.Abort("ExtendedInventoryWindow.LoadWindow.LoadObject")
  139.  
  140. try:
  141. wndItem = self.GetChild("ItemSlot")
  142. self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
  143. self.titleName = self.GetChild("TitleName")
  144. self.SkillBookButton = self.GetChild("SkillBookButton")
  145. self.UpgradeItemsButton = self.GetChild("UpgradeItemsButton")
  146. self.stoneButton = self.GetChild("StoneButton")
  147. self.boxButton = self.GetChild("BoxButton")
  148. self.efsunButton = self.GetChild("EfsunButton")
  149. self.cicekButton = self.GetChild("CicekButton")
  150. self.inventoryTab = []
  151. self.inventoryTab.append(self.GetChild("Inventory_Tab_01"))
  152. self.inventoryTab.append(self.GetChild("Inventory_Tab_02"))
  153. self.inventoryTab.append(self.GetChild("Inventory_Tab_03"))
  154. self.MalzemeDeposuInfo = self.GetChild("MalzemeDeposuInfo")
  155. except:
  156. import exception
  157. exception.Abort("ExtendedInventoryWindow.LoadWindow.BindObject")
  158.  
  159. ## Info
  160. self.tlInfo = uiToolTip.ItemToolTip()
  161. self.tlInfo.Hide()
  162. self.tooltipInfo = [self.tlInfo]*7
  163. self.InformationText = [localeInfo.MALZEME_DEPOSU,
  164. localeInfo.BK_ENVANTER_TEXT1,
  165. localeInfo.BK_ENVANTER_TEXT2,
  166. localeInfo.BK_ENVANTER_TEXT3,
  167. localeInfo.BK_ENVANTER_TEXT4,
  168. localeInfo.BK_ENVANTER_TEXT5,
  169. localeInfo.BK_ENVANTER_TEXT6
  170. ]
  171.  
  172. for i in xrange(7):
  173. self.tooltipInfo[i].SetFollow(True)
  174. self.tooltipInfo[i].AlignHorizonalCenter()
  175. if i == 0:
  176. TITLE_COLOR = grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)
  177. self.tooltipInfo[i].AutoAppendTextLine(self.InformationText[i], TITLE_COLOR)
  178. else:
  179. self.tooltipInfo[i].AutoAppendTextLine(self.InformationText[i])
  180. self.tooltipInfo[i].Hide()
  181. self.tooltipInfo[i].toolTipWidth += 10
  182.  
  183. ## Item
  184. wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
  185. wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
  186. wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
  187. wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
  188. wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  189. wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  190.  
  191. self.envanterileacilsin = ui.CheckBox()
  192. self.envanterileacilsin.SetParent(self)
  193. self.envanterileacilsin.SetPosition(17, 385)
  194. self.envanterileacilsin.SetEvent(ui.__mem_func__(self.__OnClickEnableEnvanterOn), "ON_CHECK", True)
  195. self.envanterileacilsin.SetEvent(ui.__mem_func__(self.__OnClickDisableEnvanterOf), "ON_UNCKECK", False)
  196. self.envanterileacilsin.SetTextInfo(localeInfo.ENVANTER_ILE_AC)
  197. self.envanterileacilsin.SetCheckStatus(constInfo.EnvanterAcilsinmi)
  198. self.envanterileacilsin.Show()
  199.  
  200. self.SkillBookButton.SetEvent(lambda arg=0: self.SetInventoryType(arg))
  201. self.UpgradeItemsButton.SetEvent(lambda arg=1: self.SetInventoryType(arg))
  202. self.stoneButton.SetEvent(lambda arg=2: self.SetInventoryType(arg))
  203. self.boxButton.SetEvent(lambda arg=3: self.SetInventoryType(arg))
  204. self.efsunButton.SetEvent(lambda arg=4: self.SetInventoryType(arg))
  205. self.cicekButton.SetEvent(lambda arg=5: self.SetInventoryType(arg))
  206. self.SkillBookButton.Down()
  207.  
  208. self.inventoryTab[0].SetEvent(lambda arg=0: self.SetInventoryPage(arg))
  209. self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg))
  210. self.inventoryTab[2].SetEvent(lambda arg=2: self.SetInventoryPage(arg))
  211. self.inventoryTab[0].Down()
  212.  
  213. ## PickMoneyDialog
  214. dlgPickMoney = uiPickMoney.PickMoneyDialog()
  215. dlgPickMoney.LoadDialog()
  216. dlgPickMoney.Hide()
  217.  
  218. ## PickItemDialog
  219. dlgPickItem = uiPickEtc.PickEtcDialog()
  220. dlgPickItem.LoadDialog()
  221. dlgPickItem.Hide()
  222.  
  223. self.dlgPickMoney = dlgPickMoney
  224.  
  225. self.wndItem = wndItem
  226. self.SetInventoryType(0)
  227. self.SetInventoryPage(0)
  228.  
  229. self.dlgPickItem = dlgPickItem
  230.  
  231. self.wndCostume = None
  232.  
  233. def Destroy(self):
  234. self.ClearDictionary()
  235. self.dlgPickMoney.Destroy()
  236. self.dlgPickItem.Destroy()
  237. self.dlgPickItem = 0
  238. self.dlgPickMoney = 0
  239. self.tooltipItem = None
  240. self.wndItem = 0
  241. self.interface = None
  242. self.inventoryTab = []
  243. self.envanterileacilsin = []
  244.  
  245. def __OnClickEnableEnvanterOn(self):
  246. constInfo.EnvanterAcilsinmi = 1
  247. chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Envanter ile açýlma aktif.")
  248.  
  249. def __OnClickDisableEnvanterOf(self):
  250. constInfo.EnvanterAcilsinmi = 0
  251. chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Envanter ile açýlma pasif.")
  252.  
  253. def Hide(self):
  254. if None != self.tooltipItem:
  255. self.tooltipItem.HideToolTip()
  256. self.tlInfo.Hide()
  257. if self.dlgPickItem:
  258. self.dlgPickItem.Close()
  259. wndMgr.Hide(self.hWnd)
  260.  
  261. def Close(self):
  262. if self.tooltipItem:
  263. self.tooltipItem.HideToolTip()
  264. self.tlInfo.Hide()
  265. self.Hide()
  266.  
  267. def OnUpdate(self):
  268. for i in xrange(7):
  269. if self.MalzemeDeposuInfo.IsIn():
  270. self.tooltipInfo[i].Show()
  271. else:
  272. self.tooltipInfo[i].Hide()
  273.  
  274. def SetInventoryType(self, type):
  275. self.inventoryType = type
  276. if type == 0:
  277. self.SkillBookButton.Down()
  278. self.efsunButton.SetUp()
  279. self.cicekButton.SetUp()
  280. self.UpgradeItemsButton.SetUp()
  281. self.stoneButton.SetUp()
  282. self.boxButton.SetUp()
  283. self.titleName.SetText(localeInfo.INVENTORY_SKILL_BOOK_TOOLTIP)
  284. elif type == 2:
  285. self.stoneButton.Down()
  286. self.efsunButton.SetUp()
  287. self.cicekButton.SetUp()
  288. self.UpgradeItemsButton.SetUp()
  289. self.SkillBookButton.SetUp()
  290. self.boxButton.SetUp()
  291. self.titleName.SetText(localeInfo.INVENTORY_STONE_TOOLTIP)
  292. elif type == 3:
  293. self.boxButton.Down()
  294. self.efsunButton.SetUp()
  295. self.UpgradeItemsButton.SetUp()
  296. self.cicekButton.SetUp()
  297. self.stoneButton.SetUp()
  298. self.SkillBookButton.SetUp()
  299. self.titleName.SetText(localeInfo.INVENTORY_BOX_TOOLTIP)
  300. elif type == 4:
  301. self.efsunButton.Down()
  302. self.boxButton.SetUp()
  303. self.cicekButton.SetUp()
  304. self.UpgradeItemsButton.SetUp()
  305. self.stoneButton.SetUp()
  306. self.SkillBookButton.SetUp()
  307. self.titleName.SetText(localeInfo.INVENTORY_EFSUN_TOOLTIP)
  308. elif type == 5:
  309. self.cicekButton.Down()
  310. self.efsunButton.SetUp()
  311. self.boxButton.SetUp()
  312. self.UpgradeItemsButton.SetUp()
  313. self.stoneButton.SetUp()
  314. self.SkillBookButton.SetUp()
  315. self.titleName.SetText(localeInfo.INVENTORY_CICEK_TOOLTIP)
  316. else:
  317. self.UpgradeItemsButton.Down()
  318. self.SkillBookButton.SetUp()
  319. self.efsunButton.SetUp()
  320. self.cicekButton.SetUp()
  321. self.stoneButton.SetUp()
  322. self.boxButton.SetUp()
  323. self.titleName.SetText(localeInfo.INVENTORY_UPGRADE_ITEM_TOOLTIP)
  324. self.RefreshBagSlotWindow()
  325.  
  326. def SetInventoryPage(self, page):
  327. self.inventoryPageIndex = page
  328. for i in range(0,len(self.inventoryTab)):
  329. self.inventoryTab[i].SetUp()
  330. self.inventoryTab[page].Down()
  331. self.RefreshBagSlotWindow()
  332.  
  333. def OnPickItem(self, count):
  334. itemSlotIndex = self.dlgPickItem.itemGlobalSlotIndex
  335. selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  336. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_SKILL_BOOK_INVENTORY, itemSlotIndex, selectedItemVNum, count)
  337.  
  338. def __InventoryLocalSlotPosToGlobalSlotPos(self, local):
  339. if self.inventoryType == 0:
  340. return self.inventoryPageIndex*player.SKILL_BOOK_INVENTORY_SLOT_COUNT + local + item.SKILL_BOOK_INVENTORY_SLOT_START
  341. elif self.inventoryType == 2:
  342. return self.inventoryPageIndex*player.STONE_INVENTORY_SLOT_COUNT + local + item.STONE_INVENTORY_SLOT_START
  343. elif self.inventoryType == 3:
  344. return self.inventoryPageIndex*player.BOX_INVENTORY_SLOT_COUNT + local + item.BOX_INVENTORY_SLOT_START
  345. elif self.inventoryType == 4:
  346. return self.inventoryPageIndex*player.EFSUN_INVENTORY_SLOT_COUNT + local + item.EFSUN_INVENTORY_SLOT_START
  347. elif self.inventoryType == 5:
  348. return self.inventoryPageIndex*player.CICEK_INVENTORY_SLOT_COUNT + local + item.CICEK_INVENTORY_SLOT_START
  349. else:
  350. return self.inventoryPageIndex*player.UPGRADE_ITEMS_INVENTORY_SLOT_COUNT + local + item.UPGRADE_ITEMS_INVENTORY_SLOT_START
  351.  
  352. def GetInventoryPageIndex(self):
  353. return self.inventoryPageIndex
  354.  
  355. def RefreshBagSlotWindow(self):
  356. getItemVNum=player.GetItemIndex
  357. getItemCount=player.GetItemCount
  358. setItemVNum=self.wndItem.SetItemSlot
  359.  
  360. if self.inventoryType == 0:
  361. for i in xrange(player.SKILL_BOOK_INVENTORY_SLOT_COUNT):
  362. slotNumber = item.SKILL_BOOK_INVENTORY_SLOT_START + i
  363. if self.GetInventoryPageIndex() == 1:
  364. slotNumber += 45
  365. elif self.GetInventoryPageIndex() == 2:
  366. slotNumber += 90
  367. itemCount = getItemCount(slotNumber)
  368. if 0 == itemCount:
  369. self.wndItem.ClearSlot(i)
  370. continue
  371. elif 1 == itemCount:
  372. itemCount = 0
  373. itemVnum = getItemVNum(slotNumber)
  374. setItemVNum(i, itemVnum, itemCount)
  375. elif self.inventoryType == 2:
  376. for i in xrange(player.STONE_INVENTORY_SLOT_COUNT):
  377. slotNumber = item.STONE_INVENTORY_SLOT_START + i
  378. if self.GetInventoryPageIndex() == 1:
  379. slotNumber += 45
  380. elif self.GetInventoryPageIndex() == 2:
  381. slotNumber += 90
  382. itemCount = getItemCount(slotNumber)
  383. if 0 == itemCount:
  384. self.wndItem.ClearSlot(i)
  385. continue
  386. elif 1 == itemCount:
  387. itemCount = 0
  388. itemVnum = getItemVNum(slotNumber)
  389. setItemVNum(i, itemVnum, itemCount)
  390. elif self.inventoryType == 3:
  391. for i in xrange(player.BOX_INVENTORY_SLOT_COUNT):
  392. slotNumber = item.BOX_INVENTORY_SLOT_START + i
  393. if self.GetInventoryPageIndex() == 1:
  394. slotNumber += 45
  395. elif self.GetInventoryPageIndex() == 2:
  396. slotNumber += 90
  397. itemCount = getItemCount(slotNumber)
  398. if 0 == itemCount:
  399. self.wndItem.ClearSlot(i)
  400. continue
  401. elif 1 == itemCount:
  402. itemCount = 0
  403. itemVnum = getItemVNum(slotNumber)
  404. setItemVNum(i, itemVnum, itemCount)
  405. elif self.inventoryType == 4:
  406. for i in xrange(player.EFSUN_INVENTORY_SLOT_COUNT):
  407. slotNumber = item.EFSUN_INVENTORY_SLOT_START + i
  408. if self.GetInventoryPageIndex() == 1:
  409. slotNumber += 45
  410. elif self.GetInventoryPageIndex() == 2:
  411. slotNumber += 90
  412. itemCount = getItemCount(slotNumber)
  413. if 0 == itemCount:
  414. self.wndItem.ClearSlot(i)
  415. continue
  416. elif 1 == itemCount:
  417. itemCount = 0
  418. itemVnum = getItemVNum(slotNumber)
  419. setItemVNum(i, itemVnum, itemCount)
  420. elif self.inventoryType == 5:
  421. for i in xrange(player.CICEK_INVENTORY_SLOT_COUNT):
  422. slotNumber = item.CICEK_INVENTORY_SLOT_START + i
  423. if self.GetInventoryPageIndex() == 1:
  424. slotNumber += 45
  425. elif self.GetInventoryPageIndex() == 2:
  426. slotNumber += 90
  427. itemCount = getItemCount(slotNumber)
  428. if 0 == itemCount:
  429. self.wndItem.ClearSlot(i)
  430. continue
  431. elif 1 == itemCount:
  432. itemCount = 0
  433. itemVnum = getItemVNum(slotNumber)
  434. setItemVNum(i, itemVnum, itemCount)
  435. else:
  436. for i in xrange(player.UPGRADE_ITEMS_INVENTORY_SLOT_COUNT):
  437. slotNumber = item.UPGRADE_ITEMS_INVENTORY_SLOT_START + i
  438. if self.GetInventoryPageIndex() == 1:
  439. slotNumber += 45
  440. elif self.GetInventoryPageIndex() == 2:
  441. slotNumber += 90
  442. itemCount = getItemCount(slotNumber)
  443. if 0 == itemCount:
  444. self.wndItem.ClearSlot(i)
  445. continue
  446. elif 1 == itemCount:
  447. itemCount = 0
  448. itemVnum = getItemVNum(slotNumber)
  449. setItemVNum(i, itemVnum, itemCount)
  450. self.wndItem.RefreshSlot()
  451.  
  452. def RefreshItemSlot(self):
  453. self.RefreshBagSlotWindow()
  454.  
  455. def RefreshStatus(self):
  456. pass
  457.  
  458. def SetItemToolTip(self, tooltipItem):
  459. self.tooltipItem = tooltipItem
  460.  
  461. def SelectEmptySlot(self, selectedSlotPos):
  462. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
  463. return
  464.  
  465. if self.inventoryType == 0:
  466. selectedSlotPos += item.SKILL_BOOK_INVENTORY_SLOT_START
  467. if self.GetInventoryPageIndex() == 1:
  468. selectedSlotPos += 45
  469. elif self.GetInventoryPageIndex() == 2:
  470. selectedSlotPos += 90
  471. elif self.inventoryType == 2:
  472. selectedSlotPos += item.STONE_INVENTORY_SLOT_START
  473. if self.GetInventoryPageIndex() == 1:
  474. selectedSlotPos += 45
  475. elif self.GetInventoryPageIndex() == 2:
  476. selectedSlotPos += 90
  477. elif self.inventoryType == 3:
  478. selectedSlotPos += item.BOX_INVENTORY_SLOT_START
  479. if self.GetInventoryPageIndex() == 1:
  480. selectedSlotPos += 45
  481. elif self.GetInventoryPageIndex() == 2:
  482. selectedSlotPos += 90
  483. elif self.inventoryType == 4:
  484. selectedSlotPos += item.EFSUN_INVENTORY_SLOT_START
  485. if self.GetInventoryPageIndex() == 1:
  486. selectedSlotPos += 45
  487. elif self.GetInventoryPageIndex() == 2:
  488. selectedSlotPos += 90
  489. elif self.inventoryType == 5:
  490. selectedSlotPos += item.CICEK_INVENTORY_SLOT_START
  491. if self.GetInventoryPageIndex() == 1:
  492. selectedSlotPos += 45
  493. elif self.GetInventoryPageIndex() == 2:
  494. selectedSlotPos += 90
  495. else:
  496. selectedSlotPos += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
  497. if self.GetInventoryPageIndex() == 1:
  498. selectedSlotPos += 45
  499. elif self.GetInventoryPageIndex() == 2:
  500. selectedSlotPos += 90
  501.  
  502. if mouseModule.mouseController.isAttached():
  503.  
  504. attachedSlotType = mouseModule.mouseController.GetAttachedType()
  505. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  506. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  507. attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  508.  
  509. if player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType or\
  510. player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType or\
  511. player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType or\
  512. player.SLOT_TYPE_BOX_INVENTORY == attachedSlotType or\
  513. player.SLOT_TYPE_EFSUN_INVENTORY == attachedSlotType or\
  514. player.SLOT_TYPE_CICEK_INVENTORY == attachedSlotType:
  515. itemCount = player.GetItemCount(attachedSlotPos)
  516. attachedCount = mouseModule.mouseController.GetAttachedItemCount()
  517. self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
  518.  
  519. if item.IsRefineScroll(attachedItemIndex):
  520. self.wndItem.SetUseMode(False)
  521.  
  522. elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType:
  523. mouseModule.mouseController.RunCallBack("INVENTORY")
  524.  
  525. elif player.SLOT_TYPE_SHOP == attachedSlotType:
  526. net.SendShopBuyPacket(attachedSlotPos)
  527.  
  528. elif player.SLOT_TYPE_SAFEBOX == attachedSlotType:
  529.  
  530. if player.ITEM_MONEY == attachedItemIndex:
  531. net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
  532. snd.PlaySound("sound/ui/money.wav")
  533.  
  534. else:
  535. net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos)
  536.  
  537. elif player.SLOT_TYPE_MALL == attachedSlotType:
  538. net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos)
  539.  
  540. mouseModule.mouseController.DeattachObject()
  541.  
  542. def SelectItemSlot(self, itemSlotIndex):
  543. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
  544. return
  545.  
  546. if self.inventoryType == 0:
  547. itemSlotIndex += item.SKILL_BOOK_INVENTORY_SLOT_START
  548. if self.GetInventoryPageIndex() == 1:
  549. itemSlotIndex += 45
  550. elif self.GetInventoryPageIndex() == 2:
  551. itemSlotIndex += 90
  552. elif self.inventoryType == 2:
  553. itemSlotIndex += item.STONE_INVENTORY_SLOT_START
  554. if self.GetInventoryPageIndex() == 1:
  555. itemSlotIndex += 45
  556. elif self.GetInventoryPageIndex() == 2:
  557. itemSlotIndex += 90
  558. elif self.inventoryType == 3:
  559. itemSlotIndex += item.BOX_INVENTORY_SLOT_START
  560. if self.GetInventoryPageIndex() == 1:
  561. itemSlotIndex += 45
  562. elif self.GetInventoryPageIndex() == 2:
  563. itemSlotIndex += 90
  564. elif self.inventoryType == 4:
  565. itemSlotIndex += item.EFSUN_INVENTORY_SLOT_START
  566. if self.GetInventoryPageIndex() == 1:
  567. itemSlotIndex += 45
  568. elif self.GetInventoryPageIndex() == 2:
  569. itemSlotIndex += 90
  570. elif self.inventoryType == 5:
  571. itemSlotIndex += item.CICEK_INVENTORY_SLOT_START
  572. if self.GetInventoryPageIndex() == 1:
  573. itemSlotIndex += 45
  574. elif self.GetInventoryPageIndex() == 2:
  575. itemSlotIndex += 90
  576. else:
  577. itemSlotIndex += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
  578. if self.GetInventoryPageIndex() == 1:
  579. itemSlotIndex += 45
  580. elif self.GetInventoryPageIndex() == 2:
  581. itemSlotIndex += 90
  582.  
  583. if mouseModule.mouseController.isAttached():
  584. attachedSlotType = mouseModule.mouseController.GetAttachedType()
  585. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  586. attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
  587. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  588.  
  589. if player.GetItemCount(itemSlotIndex) > attachedItemCount:
  590. return
  591.  
  592. if player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType or\
  593. player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType or\
  594. player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType or\
  595. player.SLOT_TYPE_BOX_INVENTORY == attachedSlotType or\
  596. player.SLOT_TYPE_EFSUN_INVENTORY == attachedSlotType or\
  597. player.SLOT_TYPE_CICEK_INVENTORY == attachedSlotType:
  598. self.__SendMoveItemPacket(attachedSlotPos, itemSlotIndex, attachedItemCount)
  599.  
  600. mouseModule.mouseController.DeattachObject()
  601. else:
  602.  
  603. curCursorNum = app.GetCursor()
  604. #if app.SELL == curCursorNum:
  605. #self.__SellItem(itemSlotIndex)
  606.  
  607. if app.BUY == curCursorNum:
  608. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)
  609.  
  610. elif app.IsPressed(app.DIK_LALT):
  611. link = player.GetItemLink(itemSlotIndex)
  612. ime.PasteString(link)
  613.  
  614. elif app.IsPressed(app.DIK_LALT):
  615. link = player.GetItemLink(itemSlotIndex)
  616. ime.PasteString(link)
  617.  
  618. elif app.IsPressed(app.DIK_LSHIFT):
  619. itemCount = player.GetItemCount(itemSlotIndex)
  620.  
  621. if itemCount > 1:
  622. self.dlgPickItem.SetTitleName(localeInfo.PICK_ITEM_TITLE)
  623. self.dlgPickItem.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
  624. self.dlgPickItem.Open(itemCount)
  625. self.dlgPickItem.itemGlobalSlotIndex = itemSlotIndex
  626.  
  627. elif app.IsPressed(app.DIK_LCONTROL):
  628. itemIndex = player.GetItemIndex(itemSlotIndex)
  629.  
  630. if TRUE == item.CanAddToQuickSlotItem(itemIndex):
  631. player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
  632. else:
  633. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM)
  634. else:
  635. selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  636. itemCount = player.GetItemCount(itemSlotIndex)
  637. if self.inventoryType == 0:
  638. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_SKILL_BOOK_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  639. elif self.inventoryType == 2:
  640. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_STONE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  641. elif self.inventoryType == 3:
  642. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_BOX_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  643. elif self.inventoryType == 4:
  644. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_EFSUN_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  645. elif self.inventoryType == 5:
  646. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_CICEK_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  647. else:
  648. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  649. self.wndItem.SetUseMode(True)
  650.  
  651. snd.PlaySound("sound/ui/pick.wav")
  652.  
  653. def OnCloseQuestionDialog(self):
  654. if not self.questionDialog:
  655. return
  656.  
  657. self.questionDialog.Close()
  658. self.questionDialog = None
  659. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  660.  
  661. def Sat(self):
  662. if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
  663. if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
  664. net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY)
  665. snd.PlaySound("sound/ui/money.wav")
  666. self.OnCloseQuestionDialog()
  667.  
  668. def __OnClosePopupDialog(self):
  669. self.pop = None
  670.  
  671. def OverOutItem(self):
  672. self.wndItem.SetUsableItem(False)
  673. if None != self.tooltipItem:
  674. self.tooltipItem.HideToolTip()
  675.  
  676. def OverInItem(self, overSlotPos):
  677. if self.inventoryType == 0:
  678. overSlotPos += item.SKILL_BOOK_INVENTORY_SLOT_START
  679. if self.GetInventoryPageIndex() == 1:
  680. overSlotPos += 45
  681. elif self.GetInventoryPageIndex() == 2:
  682. overSlotPos += 90
  683. elif self.inventoryType == 2:
  684. overSlotPos += item.STONE_INVENTORY_SLOT_START
  685. if self.GetInventoryPageIndex() == 1:
  686. overSlotPos += 45
  687. elif self.GetInventoryPageIndex() == 2:
  688. overSlotPos += 90
  689. elif self.inventoryType == 3:
  690. overSlotPos += item.BOX_INVENTORY_SLOT_START
  691. if self.GetInventoryPageIndex() == 1:
  692. overSlotPos += 45
  693. elif self.GetInventoryPageIndex() == 2:
  694. overSlotPos += 90
  695. elif self.inventoryType == 4:
  696. overSlotPos += item.EFSUN_INVENTORY_SLOT_START
  697. if self.GetInventoryPageIndex() == 1:
  698. overSlotPos += 45
  699. elif self.GetInventoryPageIndex() == 2:
  700. overSlotPos += 90
  701. elif self.inventoryType == 5:
  702. overSlotPos += item.CICEK_INVENTORY_SLOT_START
  703. if self.GetInventoryPageIndex() == 1:
  704. overSlotPos += 45
  705. elif self.GetInventoryPageIndex() == 2:
  706. overSlotPos += 90
  707. else:
  708. overSlotPos += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
  709. if self.GetInventoryPageIndex() == 1:
  710. overSlotPos += 45
  711. elif self.GetInventoryPageIndex() == 2:
  712. overSlotPos += 90
  713. self.wndItem.SetUsableItem(False)
  714. self.ShowToolTip(overSlotPos)
  715.  
  716. def ShowToolTip(self, slotIndex):
  717. if None != self.tooltipItem:
  718. self.tooltipItem.SetInventoryItem(slotIndex)
  719.  
  720. def OnPressEscapeKey(self):
  721. self.Close()
  722. return True
  723.  
  724. def UseItemSlot(self, slotIndex):
  725. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
  726. return
  727.  
  728. if self.inventoryType == 0:
  729. slotIndex += item.SKILL_BOOK_INVENTORY_SLOT_START
  730. if self.GetInventoryPageIndex() == 1:
  731. slotIndex += 45
  732. elif self.GetInventoryPageIndex() == 2:
  733. slotIndex += 90
  734. elif self.inventoryType == 2:
  735. slotIndex += item.STONE_INVENTORY_SLOT_START
  736. if self.GetInventoryPageIndex() == 1:
  737. slotIndex += 45
  738. elif self.GetInventoryPageIndex() == 2:
  739. slotIndex += 90
  740. elif self.inventoryType == 3:
  741. slotIndex += item.BOX_INVENTORY_SLOT_START
  742. if self.GetInventoryPageIndex() == 1:
  743. slotIndex += 45
  744. elif self.GetInventoryPageIndex() == 2:
  745. slotIndex += 90
  746. elif self.inventoryType == 4:
  747. slotIndex += item.EFSUN_INVENTORY_SLOT_START
  748. if self.GetInventoryPageIndex() == 1:
  749. slotIndex += 45
  750. elif self.GetInventoryPageIndex() == 2:
  751. slotIndex += 90
  752. elif self.inventoryType == 5:
  753. slotIndex += item.CICEK_INVENTORY_SLOT_START
  754. if self.GetInventoryPageIndex() == 1:
  755. slotIndex += 45
  756. elif self.GetInventoryPageIndex() == 2:
  757. slotIndex += 90
  758. else:
  759. slotIndex += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
  760. if self.GetInventoryPageIndex() == 1:
  761. slotIndex += 45
  762. elif self.GetInventoryPageIndex() == 2:
  763. slotIndex += 90
  764. self.__UseItem(slotIndex)
  765. mouseModule.mouseController.DeattachObject()
  766. self.OverOutItem()
  767.  
  768. def __UseItem(self, slotIndex):
  769. ItemVNum = player.GetItemIndex(slotIndex)
  770. item.SelectItem(ItemVNum)
  771.  
  772. if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE):
  773. self.questionDialog = uiCommon.QuestionDialog()
  774. self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM)
  775. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnAccept))
  776. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel))
  777. self.questionDialog.Open()
  778. self.questionDialog.slotIndex = slotIndex
  779.  
  780. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  781.  
  782. elif app.IsPressed(app.DIK_LSHIFT):
  783. if player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GIFTBOX and\
  784. ItemVNum != 31374 and ItemVNum != 50255 and\
  785. ItemVNum != 50187 and ItemVNum != 50197 and\
  786. ItemVNum != 50188 and ItemVNum != 50189 and\
  787. ItemVNum != 50190 and ItemVNum != 50191 and\
  788. ItemVNum != 50192 and ItemVNum != 50193 and\
  789. ItemVNum != 50194 and ItemVNum != 50195:
  790. if app.ENABLE_SHOW_CHEST_DROP:
  791. if self.interface:
  792. if self.interface.dlgChestDrop:
  793. if not self.interface.dlgChestDrop.IsShow():
  794. self.interface.dlgChestDrop.Open(slotIndex)
  795. net.SendChestDropInfo(slotIndex)
  796. else:
  797. self.__SendUseItemPacket(slotIndex)
  798.  
  799. def __UseItemQuestionDialog_OnCancel(self):
  800. self.OnCloseQuestionDialog()
  801.  
  802. def __UseItemQuestionDialog_OnAccept(self):
  803. self.__SendUseItemPacket(self.questionDialog.slotIndex)
  804. self.OnCloseQuestionDialog()
  805.  
  806. def __SendUseItemPacket(self, slotPos):
  807. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  808. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
  809. return
  810.  
  811. net.SendItemUsePacket(slotPos)
  812.  
  813. def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):
  814. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  815. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP)
  816. return
  817.  
  818. net.SendItemMovePacket(srcSlotPos, dstSlotPos, srcItemCount)
  819.  
  820. class BeltInventoryWindow(ui.ScriptWindow):
  821.  
  822. def __init__(self, wndInventory):
  823. import exception
  824.  
  825. if not app.ENABLE_NEW_EQUIPMENT_SYSTEM:
  826. exception.Abort("What do you do?")
  827. return
  828.  
  829. if not wndInventory:
  830. exception.Abort("wndInventory parameter must be set to InventoryWindow")
  831. return
  832.  
  833. ui.ScriptWindow.__init__(self)
  834.  
  835. self.isLoaded = 0
  836. self.wndInventory = wndInventory;
  837.  
  838. self.wndBeltInventoryLayer = None
  839. self.wndBeltInventorySlot = None
  840. self.expandBtn = None
  841. self.minBtn = None
  842.  
  843. self.__LoadWindow()
  844.  
  845. def __del__(self):
  846. ui.ScriptWindow.__del__(self)
  847.  
  848. def Show(self, openBeltSlot = FALSE):
  849. self.__LoadWindow()
  850. self.RefreshSlot()
  851.  
  852. ui.ScriptWindow.Show(self)
  853.  
  854. if openBeltSlot:
  855. self.OpenInventory()
  856. else:
  857. self.CloseInventory()
  858.  
  859. def Close(self):
  860. self.Hide()
  861.  
  862. def IsOpeningInventory(self):
  863. return self.wndBeltInventoryLayer.IsShow()
  864.  
  865. def OpenInventory(self):
  866. self.wndBeltInventoryLayer.Show()
  867. self.expandBtn.Hide()
  868.  
  869. if localeInfo.IsARABIC() == 0:
  870. self.AdjustPositionAndSize()
  871.  
  872. def CloseInventory(self):
  873. self.wndBeltInventoryLayer.Hide()
  874. self.expandBtn.Show()
  875.  
  876. if localeInfo.IsARABIC() == 0:
  877. self.AdjustPositionAndSize()
  878.  
  879. ## 현재 인벤토리 위치를 기준으로 BASE 위치를 계산, 리턴.. 숫자 하드코딩하기 정말 싫지만 방법이 없다..
  880. def GetBasePosition(self):
  881. x, y = self.wndInventory.GetGlobalPosition()
  882. return x - 148, y + 241
  883.  
  884. def AdjustPositionAndSize(self):
  885. bx, by = self.GetBasePosition()
  886.  
  887. if self.IsOpeningInventory():
  888. self.SetPosition(bx, by)
  889. self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight())
  890.  
  891. else:
  892. self.SetPosition(bx + 138, by);
  893. self.SetSize(10, self.GetHeight())
  894.  
  895. def __LoadWindow(self):
  896. if self.isLoaded == 1:
  897. return
  898.  
  899. self.isLoaded = 1
  900.  
  901. try:
  902. pyScrLoader = ui.PythonScriptLoader()
  903. pyScrLoader.LoadScriptFile(self, "UIScript/BeltInventoryWindow.py")
  904. except:
  905. import exception
  906. exception.Abort("CostumeWindow.LoadWindow.LoadObject")
  907.  
  908. try:
  909. self.ORIGINAL_WIDTH = self.GetWidth()
  910. wndBeltInventorySlot = self.GetChild("BeltInventorySlot")
  911. self.wndBeltInventoryLayer = self.GetChild("BeltInventoryLayer")
  912. self.expandBtn = self.GetChild("ExpandBtn")
  913. self.minBtn = self.GetChild("MinimizeBtn")
  914.  
  915. self.expandBtn.SetEvent(ui.__mem_func__(self.OpenInventory))
  916. self.minBtn.SetEvent(ui.__mem_func__(self.CloseInventory))
  917.  
  918. if localeInfo.IsARABIC() :
  919. self.expandBtn.SetPosition(self.expandBtn.GetWidth() - 2, 15)
  920. self.wndBeltInventoryLayer.SetPosition(self.wndBeltInventoryLayer.GetWidth() - 5, 0)
  921. self.minBtn.SetPosition(self.minBtn.GetWidth() + 3, 15)
  922.  
  923. for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
  924. slotNumber = item.BELT_INVENTORY_SLOT_START + i
  925. wndBeltInventorySlot.SetCoverButton(slotNumber, "d:/ymir work/ui/game/quest/slot_button_01.sub",\
  926. "d:/ymir work/ui/game/quest/slot_button_01.sub",\
  927. "d:/ymir work/ui/game/quest/slot_button_01.sub",\
  928. "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", FALSE, FALSE)
  929.  
  930. except:
  931. import exception
  932. exception.Abort("CostumeWindow.LoadWindow.BindObject")
  933.  
  934. ## Equipment
  935. wndBeltInventorySlot.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
  936. wndBeltInventorySlot.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
  937. wndBeltInventorySlot.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  938. wndBeltInventorySlot.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  939. wndBeltInventorySlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
  940. wndBeltInventorySlot.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
  941.  
  942. self.wndBeltInventorySlot = wndBeltInventorySlot
  943.  
  944. def RefreshSlot(self):
  945. getItemVNum=player.GetItemIndex
  946.  
  947. for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
  948. slotNumber = item.BELT_INVENTORY_SLOT_START + i
  949. self.wndBeltInventorySlot.SetItemSlot(slotNumber, getItemVNum(slotNumber), player.GetItemCount(slotNumber))
  950. self.wndBeltInventorySlot.SetAlwaysRenderCoverButton(slotNumber, TRUE)
  951.  
  952. avail = "0"
  953.  
  954. if player.IsAvailableBeltInventoryCell(slotNumber):
  955. self.wndBeltInventorySlot.EnableCoverButton(slotNumber)
  956. else:
  957. self.wndBeltInventorySlot.DisableCoverButton(slotNumber)
  958.  
  959. self.wndBeltInventorySlot.RefreshSlot()
  960.  
  961.  
  962. class InventoryWindow(ui.ScriptWindow):
  963.  
  964. USE_TYPE_TUPLE = ("USE_CLEAN_SOCKET", "USE_CHANGE_ATTRIBUTE", "USE_ADD_ATTRIBUTE", "USE_ADD_ATTRIBUTE2", "USE_ADD_ACCESSORY_SOCKET", "USE_PUT_INTO_ACCESSORY_SOCKET", "USE_PUT_INTO_BELT_SOCKET", "USE_PUT_INTO_RING_SOCKET")
  965.  
  966. questionDialog = None
  967. tooltipItem = None
  968. wndCostume = None
  969. wndBelt = None
  970. dlgPickMoney = None
  971.  
  972. sellingSlotNumber = -1
  973. isLoaded = 0
  974. isOpenedCostumeWindowWhenClosingInventory = 0 # 인벤토리 닫을 때 코스츔이 열려있었는지 여부-_-; 네이밍 ㅈㅅ
  975. isOpenedBeltWindowWhenClosingInventory = 0 # 인벤토리 닫을 때 벨트 인벤토리가 열려있었는지 여부-_-; 네이밍 ㅈㅅ
  976.  
  977. def __init__(self):
  978. ui.ScriptWindow.__init__(self)
  979.  
  980. self.isOpenedBeltWindowWhenClosingInventory = 0 # 인벤토리 닫을 때 벨트 인벤토리가 열려있었는지 여부-_-; 네이밍 ㅈㅅ
  981.  
  982. self.__LoadWindow()
  983.  
  984. def __del__(self):
  985. ui.ScriptWindow.__del__(self)
  986.  
  987. def Show(self):
  988. self.__LoadWindow()
  989.  
  990. ui.ScriptWindow.Show(self)
  991.  
  992. # 인벤토리를 닫을 때 코스츔이 열려있었다면 인벤토리를 열 때 코스츔도 같이 열도록 함.
  993. if self.isOpenedCostumeWindowWhenClosingInventory and self.wndCostume:
  994. self.wndCostume.Show()
  995.  
  996. # 인벤토리를 닫을 때 벨트 인벤토리가 열려있었다면 같이 열도록 함.
  997. if self.wndBelt:
  998. self.wndBelt.Show(self.isOpenedBeltWindowWhenClosingInventory)
  999.  
  1000. def BindInterfaceClass(self, interface):
  1001. self.interface = interface
  1002.  
  1003. def __LoadWindow(self):
  1004. if self.isLoaded == 1:
  1005. return
  1006.  
  1007. self.isLoaded = 1
  1008.  
  1009. try:
  1010. pyScrLoader = ui.PythonScriptLoader()
  1011.  
  1012. if ITEM_MALL_BUTTON_ENABLE:
  1013. pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "InventoryWindow.py")
  1014. else:
  1015. pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindow.py")
  1016. except:
  1017. import exception
  1018. exception.Abort("InventoryWindow.LoadWindow.LoadObject")
  1019.  
  1020. try:
  1021. wndItem = self.GetChild("ItemSlot")
  1022. wndEquip = self.GetChild("EquipmentSlot")
  1023. self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
  1024. self.wndMoney = self.GetChild("Money")
  1025. self.wndMoneySlot = self.GetChild("Money_Slot")
  1026. self.mallButton = self.GetChild2("MallButton")
  1027. self.DSSButton = self.GetChild2("DSSButton")
  1028. self.costumeButton = self.GetChild2("CostumeButton")
  1029.  
  1030. self.inventoryTab = []
  1031. self.inventoryTab.append(self.GetChild("Inventory_Tab_01"))
  1032. self.inventoryTab.append(self.GetChild("Inventory_Tab_02"))
  1033.  
  1034. self.equipmentTab = []
  1035. self.equipmentTab.append(self.GetChild("Equipment_Tab_01"))
  1036. self.equipmentTab.append(self.GetChild("Equipment_Tab_02"))
  1037.  
  1038. if app.BL_ENABLE_PICKUP_ITEM_EFFECT:
  1039. self.listHighlightedSlot = []
  1040.  
  1041. if self.costumeButton and not app.ENABLE_COSTUME_SYSTEM:
  1042. self.costumeButton.Hide()
  1043. self.costumeButton.Destroy()
  1044. self.costumeButton = 0
  1045.  
  1046. # Belt Inventory Window
  1047. self.wndBelt = None
  1048.  
  1049. if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
  1050. self.wndBelt = BeltInventoryWindow(self)
  1051.  
  1052. except:
  1053. import exception
  1054. exception.Abort("InventoryWindow.LoadWindow.BindObject")
  1055.  
  1056. ## Item
  1057. wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
  1058. wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
  1059. wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
  1060. wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
  1061. wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  1062. wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  1063.  
  1064. ## Equipment
  1065. wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
  1066. wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
  1067. wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
  1068. wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
  1069. wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  1070. wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  1071.  
  1072. ## PickMoneyDialog
  1073. dlgPickMoney = uiPickMoney.PickMoneyDialog()
  1074. dlgPickMoney.LoadDialog()
  1075. dlgPickMoney.Hide()
  1076.  
  1077. ## RefineDialog
  1078. self.refineDialog = uiRefine.RefineDialog()
  1079. self.refineDialog.Hide()
  1080.  
  1081. ## AttachMetinDialog
  1082. self.attachMetinDialog = uiAttachMetin.AttachMetinDialog()
  1083. self.attachMetinDialog.Hide()
  1084.  
  1085. ## MoneySlot
  1086. self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))
  1087.  
  1088. self.inventoryTab[0].SetEvent(lambda arg=0: self.SetInventoryPage(arg))
  1089. self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg))
  1090. self.inventoryTab[0].Down()
  1091.  
  1092. self.equipmentTab[0].SetEvent(lambda arg=0: self.SetEquipmentPage(arg))
  1093. self.equipmentTab[1].SetEvent(lambda arg=1: self.SetEquipmentPage(arg))
  1094. self.equipmentTab[0].Down()
  1095. self.equipmentTab[0].Hide()
  1096. self.equipmentTab[1].Hide()
  1097.  
  1098. self.wndItem = wndItem
  1099. self.wndEquip = wndEquip
  1100. self.dlgPickMoney = dlgPickMoney
  1101.  
  1102. # MallButton
  1103. if self.mallButton:
  1104. self.mallButton.SetEvent(ui.__mem_func__(self.ClickMallButton))
  1105.  
  1106. if self.DSSButton:
  1107. self.DSSButton.SetEvent(ui.__mem_func__(self.ClickDSSButton))
  1108.  
  1109. # Costume Button
  1110. if self.costumeButton:
  1111. self.costumeButton.SetEvent(ui.__mem_func__(self.ClickCostumeButton))
  1112.  
  1113. self.wndCostume = None
  1114.  
  1115. #####
  1116.  
  1117. ## Refresh
  1118. self.SetInventoryPage(0)
  1119. self.SetEquipmentPage(0)
  1120. self.RefreshItemSlot()
  1121. self.RefreshStatus()
  1122.  
  1123. def Destroy(self):
  1124. self.ClearDictionary()
  1125.  
  1126. self.dlgPickMoney.Destroy()
  1127. self.dlgPickMoney = 0
  1128.  
  1129. self.refineDialog.Destroy()
  1130. self.refineDialog = 0
  1131.  
  1132. self.attachMetinDialog.Destroy()
  1133. self.attachMetinDialog = 0
  1134.  
  1135. self.tooltipItem = None
  1136. self.wndItem = 0
  1137. self.wndEquip = 0
  1138. self.dlgPickMoney = 0
  1139. self.wndMoney = 0
  1140. self.wndMoneySlot = 0
  1141. self.questionDialog = None
  1142. self.mallButton = None
  1143. self.DSSButton = None
  1144. self.interface = None
  1145.  
  1146. if self.wndCostume:
  1147. self.wndCostume.Destroy()
  1148. self.wndCostume = 0
  1149.  
  1150. if self.wndBelt:
  1151. self.wndBelt.Destroy()
  1152. self.wndBelt = None
  1153.  
  1154. self.inventoryTab = []
  1155. self.equipmentTab = []
  1156.  
  1157. def Hide(self):
  1158. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
  1159. self.OnCloseQuestionDialog()
  1160. return
  1161. if None != self.tooltipItem:
  1162. self.tooltipItem.HideToolTip()
  1163.  
  1164. if self.wndCostume:
  1165. self.isOpenedCostumeWindowWhenClosingInventory = self.wndCostume.IsShow() # 인벤토리 창이 닫힐 때 코스츔이 열려 있었는가?
  1166. self.wndCostume.Close()
  1167.  
  1168. if self.wndBelt:
  1169. self.isOpenedBeltWindowWhenClosingInventory = self.wndBelt.IsOpeningInventory() # 인벤토리 창이 닫힐 때 벨트 인벤토리도 열려 있었는가?
  1170. print "Is Opening Belt Inven?? ", self.isOpenedBeltWindowWhenClosingInventory
  1171. self.wndBelt.Close()
  1172.  
  1173. if self.dlgPickMoney:
  1174. self.dlgPickMoney.Close()
  1175.  
  1176. wndMgr.Hide(self.hWnd)
  1177.  
  1178.  
  1179. def Close(self):
  1180. self.Hide()
  1181.  
  1182. def SetInventoryPage(self, page):
  1183. self.inventoryPageIndex = page
  1184. self.inventoryTab[1-page].SetUp()
  1185. self.RefreshBagSlotWindow()
  1186.  
  1187. def SetEquipmentPage(self, page):
  1188. self.equipmentPageIndex = page
  1189. self.equipmentTab[1-page].SetUp()
  1190. self.RefreshEquipSlotWindow()
  1191.  
  1192. def ClickMallButton(self):
  1193. print "click_mall_button"
  1194. net.SendChatPacket("/click_mall")
  1195.  
  1196. # DSSButton
  1197. def ClickDSSButton(self):
  1198. print "click_dss_button"
  1199. self.interface.ToggleDragonSoulWindow()
  1200.  
  1201. def ClickCostumeButton(self):
  1202. print "Click Costume Button"
  1203. if self.wndCostume:
  1204. if self.wndCostume.IsShow():
  1205. self.wndCostume.Hide()
  1206. else:
  1207. self.wndCostume.Show()
  1208. else:
  1209. self.wndCostume = CostumeWindow(self)
  1210. self.wndCostume.Show()
  1211.  
  1212. def OpenPickMoneyDialog(self):
  1213.  
  1214. if mouseModule.mouseController.isAttached():
  1215.  
  1216. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1217. if player.SLOT_TYPE_SAFEBOX == mouseModule.mouseController.GetAttachedType():
  1218.  
  1219. if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
  1220. net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
  1221. snd.PlaySound("sound/ui/money.wav")
  1222.  
  1223. mouseModule.mouseController.DeattachObject()
  1224.  
  1225. else:
  1226. curMoney = player.GetElk()
  1227.  
  1228. if curMoney <= 0:
  1229. return
  1230.  
  1231. self.dlgPickMoney.SetTitleName(localeInfo.PICK_MONEY_TITLE)
  1232. self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
  1233. self.dlgPickMoney.Open(curMoney)
  1234. self.dlgPickMoney.SetMax(7) # 인벤토리 990000 제한 버그 수정
  1235.  
  1236. def OnPickMoney(self, money):
  1237. mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_INVENTORY, money)
  1238.  
  1239. def OnPickItem(self, count):
  1240. itemSlotIndex = self.dlgPickMoney.itemGlobalSlotIndex
  1241. selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  1242. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, count)
  1243.  
  1244. def __InventoryLocalSlotPosToGlobalSlotPos(self, local):
  1245. if player.IsEquipmentSlot(local) or player.IsCostumeSlot(local) or (app.ENABLE_NEW_EQUIPMENT_SYSTEM and player.IsBeltInventorySlot(local)):
  1246. return local
  1247.  
  1248. return self.inventoryPageIndex*player.INVENTORY_PAGE_SIZE + local
  1249.  
  1250. def RefreshBagSlotWindow(self):
  1251. getItemVNum=player.GetItemIndex
  1252. getItemCount=player.GetItemCount
  1253. setItemVNum=self.wndItem.SetItemSlot
  1254. if app.BL_ENABLE_PICKUP_ITEM_EFFECT:
  1255. for i in xrange(self.wndItem.GetSlotCount()):
  1256. self.wndItem.DeactivateSlot(i)
  1257.  
  1258. for i in xrange(player.INVENTORY_PAGE_SIZE):
  1259. slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
  1260.  
  1261. itemCount = getItemCount(slotNumber)
  1262. # itemCount == 0이면 소켓을 비운다.
  1263. if 0 == itemCount:
  1264. self.wndItem.ClearSlot(i)
  1265. continue
  1266. elif 1 == itemCount:
  1267. itemCount = 0
  1268.  
  1269. itemVnum = getItemVNum(slotNumber)
  1270. setItemVNum(i, itemVnum, itemCount)
  1271.  
  1272. ## 자동물약 (HP: #72723 ~ #72726, SP: #72727 ~ #72730) 특수처리 - 아이템인데도 슬롯에 활성화/비활성화 표시를 위한 작업임 - [hyo]
  1273. if constInfo.IS_AUTO_POTION(itemVnum):
  1274. # metinSocket - [0] : 활성화 여부, [1] : 사용한 양, [2] : 최대 용량
  1275. metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
  1276.  
  1277. if slotNumber >= player.INVENTORY_PAGE_SIZE:
  1278. slotNumber -= player.INVENTORY_PAGE_SIZE
  1279.  
  1280. isActivated = 0 != metinSocket[0]
  1281.  
  1282. if isActivated:
  1283. self.wndItem.ActivateSlot(slotNumber)
  1284. potionType = 0;
  1285. if constInfo.IS_AUTO_POTION_HP(itemVnum):
  1286. potionType = player.AUTO_POTION_TYPE_HP
  1287. elif constInfo.IS_AUTO_POTION_SP(itemVnum):
  1288. potionType = player.AUTO_POTION_TYPE_SP
  1289.  
  1290. usedAmount = int(metinSocket[1])
  1291. totalAmount = int(metinSocket[2])
  1292. player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))
  1293.  
  1294. else:
  1295. self.wndItem.DeactivateSlot(slotNumber)
  1296.  
  1297. if app.BL_ENABLE_PICKUP_ITEM_EFFECT:
  1298. self.__HighlightSlot_Refresh()
  1299.  
  1300. self.wndItem.RefreshSlot()
  1301.  
  1302. if self.wndBelt:
  1303. self.wndBelt.RefreshSlot()
  1304.  
  1305. def RefreshEquipSlotWindow(self):
  1306. getItemVNum=player.GetItemIndex
  1307. getItemCount=player.GetItemCount
  1308. setItemVNum=self.wndEquip.SetItemSlot
  1309. for i in xrange(player.EQUIPMENT_PAGE_COUNT):
  1310. slotNumber = player.EQUIPMENT_SLOT_START + i
  1311. itemCount = getItemCount(slotNumber)
  1312. if itemCount <= 1:
  1313. itemCount = 0
  1314. setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount)
  1315.  
  1316. if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
  1317. for i in xrange(player.NEW_EQUIPMENT_SLOT_COUNT):
  1318. slotNumber = player.NEW_EQUIPMENT_SLOT_START + i
  1319. itemCount = getItemCount(slotNumber)
  1320. if itemCount <= 1:
  1321. itemCount = 0
  1322. setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount)
  1323. print "ENABLE_NEW_EQUIPMENT_SYSTEM", slotNumber, itemCount, getItemVNum(slotNumber)
  1324.  
  1325.  
  1326.  
  1327. self.wndEquip.RefreshSlot()
  1328.  
  1329. if self.wndCostume:
  1330. self.wndCostume.RefreshCostumeSlot()
  1331.  
  1332. def RefreshItemSlot(self):
  1333. self.RefreshBagSlotWindow()
  1334. self.RefreshEquipSlotWindow()
  1335.  
  1336. def RefreshStatus(self):
  1337. money = player.GetElk()
  1338. self.wndMoney.SetText(localeInfo.NumberToMoneyString(money))
  1339.  
  1340. def SetItemToolTip(self, tooltipItem):
  1341. self.tooltipItem = tooltipItem
  1342.  
  1343. def SellItem(self):
  1344. if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
  1345. if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
  1346. ## 용혼석도 팔리게 하는 기능 추가하면서 인자 type 추가
  1347. net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY)
  1348. snd.PlaySound("sound/ui/money.wav")
  1349. self.OnCloseQuestionDialog()
  1350.  
  1351. def OnDetachMetinFromItem(self):
  1352. if None == self.questionDialog:
  1353. return
  1354.  
  1355. #net.SendItemUseToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos)
  1356. self.__SendUseItemToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos)
  1357. self.OnCloseQuestionDialog()
  1358.  
  1359. def OnCloseQuestionDialog(self):
  1360. if not self.questionDialog:
  1361. return
  1362.  
  1363. self.questionDialog.Close()
  1364. self.questionDialog = None
  1365. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1366.  
  1367. ## Slot Event
  1368. def SelectEmptySlot(self, selectedSlotPos):
  1369. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
  1370. return
  1371.  
  1372. selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos)
  1373.  
  1374. if mouseModule.mouseController.isAttached():
  1375.  
  1376. attachedSlotType = mouseModule.mouseController.GetAttachedType()
  1377. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1378. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  1379. attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  1380.  
  1381. if player.SLOT_TYPE_INVENTORY == attachedSlotType or\
  1382. player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType or\
  1383. player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType or\
  1384. player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType or\
  1385. player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType or\
  1386. player.SLOT_TYPE_BOX_INVENTORY == attachedSlotType or\
  1387. player.SLOT_TYPE_EFSUN_INVENTORY == attachedSlotType or\
  1388. player.SLOT_TYPE_CICEK_INVENTORY == attachedSlotType:
  1389. itemCount = player.GetItemCount(attachedSlotPos)
  1390. attachedCount = mouseModule.mouseController.GetAttachedItemCount()
  1391. self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
  1392. itemCount = player.GetItemCount(attachedSlotPos)
  1393. attachedCount = mouseModule.mouseController.GetAttachedItemCount()
  1394. self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
  1395.  
  1396. if item.IsRefineScroll(attachedItemIndex):
  1397. self.wndItem.SetUseMode(False)
  1398.  
  1399. elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType:
  1400. mouseModule.mouseController.RunCallBack("INVENTORY")
  1401.  
  1402. elif player.SLOT_TYPE_SHOP == attachedSlotType:
  1403. net.SendShopBuyPacket(attachedSlotPos)
  1404.  
  1405. elif player.SLOT_TYPE_SAFEBOX == attachedSlotType:
  1406.  
  1407. if player.ITEM_MONEY == attachedItemIndex:
  1408. net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
  1409. snd.PlaySound("sound/ui/money.wav")
  1410.  
  1411. else:
  1412. net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos)
  1413.  
  1414. elif player.SLOT_TYPE_MALL == attachedSlotType:
  1415. net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos)
  1416.  
  1417. mouseModule.mouseController.DeattachObject()
  1418.  
  1419. def SelectItemSlot(self, itemSlotIndex):
  1420. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
  1421. return
  1422.  
  1423. itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex)
  1424.  
  1425. if mouseModule.mouseController.isAttached():
  1426. attachedSlotType = mouseModule.mouseController.GetAttachedType()
  1427. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1428. attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
  1429.  
  1430. if player.SLOT_TYPE_INVENTORY == attachedSlotType or\
  1431. player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType or\
  1432. player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType or\
  1433. player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType or\
  1434. player.SLOT_TYPE_BOX_INVENTORY == attachedSlotType or\
  1435. player.SLOT_TYPE_EFSUN_INVENTORY == attachedSlotType or\
  1436. player.SLOT_TYPE_CICEK_INVENTORY == attachedSlotType:
  1437. self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex)
  1438.  
  1439. mouseModule.mouseController.DeattachObject()
  1440.  
  1441. else:
  1442.  
  1443. curCursorNum = app.GetCursor()
  1444. if app.SELL == curCursorNum:
  1445. self.__SellItem(itemSlotIndex)
  1446.  
  1447. elif app.BUY == curCursorNum:
  1448. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)
  1449.  
  1450. elif app.IsPressed(app.DIK_LALT):
  1451. link = player.GetItemLink(itemSlotIndex)
  1452. ime.PasteString(link)
  1453.  
  1454. elif app.IsPressed(app.DIK_LSHIFT):
  1455. itemCount = player.GetItemCount(itemSlotIndex)
  1456.  
  1457. if itemCount > 1:
  1458. self.dlgPickMoney.SetTitleName(localeInfo.PICK_ITEM_TITLE)
  1459. self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
  1460. self.dlgPickMoney.Open(itemCount)
  1461. self.dlgPickMoney.itemGlobalSlotIndex = itemSlotIndex
  1462. #else:
  1463. #selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  1464. #mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum)
  1465.  
  1466. elif app.IsPressed(app.DIK_LCONTROL):
  1467. itemIndex = player.GetItemIndex(itemSlotIndex)
  1468.  
  1469. if True == item.CanAddToQuickSlotItem(itemIndex):
  1470. player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
  1471. else:
  1472. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM)
  1473.  
  1474. else:
  1475. selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  1476. itemCount = player.GetItemCount(itemSlotIndex)
  1477. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  1478.  
  1479. if self.__IsUsableItemToItem(selectedItemVNum, itemSlotIndex):
  1480. self.wndItem.SetUseMode(True)
  1481. else:
  1482. self.wndItem.SetUseMode(False)
  1483.  
  1484. snd.PlaySound("sound/ui/pick.wav")
  1485.  
  1486. def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos):
  1487. if srcItemSlotPos == dstItemSlotPos:
  1488. return
  1489.  
  1490. elif item.IsRefineScroll(srcItemVID):
  1491. self.RefineItem(srcItemSlotPos, dstItemSlotPos)
  1492. self.wndItem.SetUseMode(False)
  1493.  
  1494. elif item.IsMetin(srcItemVID):
  1495. self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)
  1496.  
  1497. elif item.IsDetachScroll(srcItemVID):
  1498. self.DetachMetinFromItem(srcItemSlotPos, dstItemSlotPos)
  1499.  
  1500. elif item.IsKey(srcItemVID):
  1501. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1502.  
  1503. elif (player.GetItemFlags(srcItemSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
  1504. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1505.  
  1506. elif item.GetUseType(srcItemVID) in self.USE_TYPE_TUPLE:
  1507. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1508.  
  1509. else:
  1510. #snd.PlaySound("sound/ui/drop.wav")
  1511.  
  1512. ## 이동시킨 곳이 장착 슬롯일 경우 아이템을 사용해서 장착 시킨다 - [levites]
  1513. if player.IsEquipmentSlot(dstItemSlotPos):
  1514.  
  1515. ## 들고 있는 아이템이 장비일때만
  1516. if item.IsEquipmentVID(srcItemVID):
  1517. self.__UseItem(srcItemSlotPos)
  1518.  
  1519. else:
  1520. self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0)
  1521. #net.SendItemMovePacket(srcItemSlotPos, dstItemSlotPos, 0)
  1522.  
  1523. def __SellItem(self, itemSlotPos):
  1524. if not player.IsEquipmentSlot(itemSlotPos):
  1525. self.sellingSlotNumber = itemSlotPos
  1526. itemIndex = player.GetItemIndex(itemSlotPos)
  1527. itemCount = player.GetItemCount(itemSlotPos)
  1528.  
  1529.  
  1530. self.sellingSlotitemIndex = itemIndex
  1531. self.sellingSlotitemCount = itemCount
  1532.  
  1533. item.SelectItem(itemIndex)
  1534. ## 안티 플레그 검사 빠져서 추가
  1535. ## 20140220
  1536. if item.IsAntiFlag(item.ANTIFLAG_SELL):
  1537. popup = uiCommon.PopupDialog()
  1538. popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
  1539. popup.SetAcceptEvent(self.__OnClosePopupDialog)
  1540. popup.Open()
  1541. self.popup = popup
  1542. return
  1543.  
  1544. itemPrice = item.GetISellItemPrice()
  1545.  
  1546. if item.Is1GoldItem():
  1547. itemPrice = itemCount / itemPrice / 5
  1548. else:
  1549. itemPrice = itemPrice * itemCount / 5
  1550.  
  1551. item.GetItemName(itemIndex)
  1552. itemName = item.GetItemName()
  1553.  
  1554. self.questionDialog = uiCommon.QuestionDialog()
  1555. self.questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, itemCount, itemPrice))
  1556. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.SellItem))
  1557. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1558. self.questionDialog.Open()
  1559. self.questionDialog.count = itemCount
  1560.  
  1561. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1562.  
  1563. def __OnClosePopupDialog(self):
  1564. self.pop = None
  1565.  
  1566. def RefineItem(self, scrollSlotPos, targetSlotPos):
  1567.  
  1568. scrollIndex = player.GetItemIndex(scrollSlotPos)
  1569. targetIndex = player.GetItemIndex(targetSlotPos)
  1570.  
  1571. if player.REFINE_OK != player.CanRefine(scrollIndex, targetSlotPos):
  1572. return
  1573.  
  1574. ###########################################################
  1575. self.__SendUseItemToItemPacket(scrollSlotPos, targetSlotPos)
  1576. #net.SendItemUseToItemPacket(scrollSlotPos, targetSlotPos)
  1577. return
  1578. ###########################################################
  1579.  
  1580. ###########################################################
  1581. #net.SendRequestRefineInfoPacket(targetSlotPos)
  1582. #return
  1583. ###########################################################
  1584.  
  1585. result = player.CanRefine(scrollIndex, targetSlotPos)
  1586.  
  1587. if player.REFINE_ALREADY_MAX_SOCKET_COUNT == result:
  1588. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  1589. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_MORE_SOCKET)
  1590.  
  1591. elif player.REFINE_NEED_MORE_GOOD_SCROLL == result:
  1592. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  1593. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NEED_BETTER_SCROLL)
  1594.  
  1595. elif player.REFINE_CANT_MAKE_SOCKET_ITEM == result:
  1596. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  1597. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_SOCKET_DISABLE_ITEM)
  1598.  
  1599. elif player.REFINE_NOT_NEXT_GRADE_ITEM == result:
  1600. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  1601. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_UPGRADE_DISABLE_ITEM)
  1602.  
  1603. elif player.REFINE_CANT_REFINE_METIN_TO_EQUIPMENT == result:
  1604. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)
  1605.  
  1606. if player.REFINE_OK != result:
  1607. return
  1608.  
  1609. self.refineDialog.Open(scrollSlotPos, targetSlotPos)
  1610.  
  1611. def DetachMetinFromItem(self, scrollSlotPos, targetSlotPos):
  1612. scrollIndex = player.GetItemIndex(scrollSlotPos)
  1613. targetIndex = player.GetItemIndex(targetSlotPos)
  1614.  
  1615. if not player.CanDetach(scrollIndex, targetSlotPos):
  1616. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
  1617. return
  1618.  
  1619. self.questionDialog = uiCommon.QuestionDialog()
  1620. self.questionDialog.SetText(localeInfo.REFINE_DO_YOU_SEPARATE_METIN)
  1621. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDetachMetinFromItem))
  1622. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1623. self.questionDialog.Open()
  1624. self.questionDialog.sourcePos = scrollSlotPos
  1625. self.questionDialog.targetPos = targetSlotPos
  1626.  
  1627. def AttachMetinToItem(self, metinSlotPos, targetSlotPos):
  1628. metinIndex = player.GetItemIndex(metinSlotPos)
  1629. targetIndex = player.GetItemIndex(targetSlotPos)
  1630.  
  1631. item.SelectItem(metinIndex)
  1632. itemName = item.GetItemName()
  1633.  
  1634. result = player.CanAttachMetin(metinIndex, targetSlotPos)
  1635.  
  1636. if player.ATTACH_METIN_NOT_MATCHABLE_ITEM == result:
  1637. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_CAN_NOT_ATTACH(itemName))
  1638.  
  1639. if player.ATTACH_METIN_NO_MATCHABLE_SOCKET == result:
  1640. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_SOCKET(itemName))
  1641.  
  1642. elif player.ATTACH_METIN_NOT_EXIST_GOLD_SOCKET == result:
  1643. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_GOLD_SOCKET(itemName))
  1644.  
  1645. elif player.ATTACH_METIN_CANT_ATTACH_TO_EQUIPMENT == result:
  1646. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)
  1647.  
  1648. if player.ATTACH_METIN_OK != result:
  1649. return
  1650.  
  1651. self.attachMetinDialog.Open(metinSlotPos, targetSlotPos)
  1652.  
  1653.  
  1654.  
  1655. def OverOutItem(self):
  1656. self.wndItem.SetUsableItem(False)
  1657. if None != self.tooltipItem:
  1658. self.tooltipItem.HideToolTip()
  1659.  
  1660. def OverInItem(self, overSlotPos):
  1661. overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos)
  1662. self.wndItem.SetUsableItem(False)
  1663.  
  1664. if app.BL_ENABLE_PICKUP_ITEM_EFFECT:
  1665. self.DelHighlightSlot(overSlotPos)
  1666.  
  1667. if mouseModule.mouseController.isAttached():
  1668. attachedItemType = mouseModule.mouseController.GetAttachedType()
  1669. if player.SLOT_TYPE_INVENTORY == attachedItemType or player.SLOT_TYPE_STONE_INVENTORY == attachedItemType or player.SLOT_TYPE_EFSUN_INVENTORY == attachedItemType:
  1670.  
  1671. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1672. attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()
  1673.  
  1674. if self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos):
  1675. self.wndItem.SetUsableItem(True)
  1676. self.wndItem.SetUseMode(True)
  1677. self.ShowToolTip(overSlotPos)
  1678. return
  1679.  
  1680. self.ShowToolTip(overSlotPos)
  1681.  
  1682.  
  1683. def __IsUsableItemToItem(self, srcItemVNum, srcSlotPos):
  1684. "다른 아이템에 사용할 수 있는 아이템인가?"
  1685.  
  1686. if item.IsRefineScroll(srcItemVNum):
  1687. return True
  1688. elif item.IsMetin(srcItemVNum):
  1689. return True
  1690. elif item.IsDetachScroll(srcItemVNum):
  1691. return True
  1692. elif item.IsKey(srcItemVNum):
  1693. return True
  1694. elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
  1695. return True
  1696. else:
  1697. if item.GetUseType(srcItemVNum) in self.USE_TYPE_TUPLE:
  1698. return True
  1699.  
  1700. return False
  1701.  
  1702. def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos):
  1703. "대상 아이템에 사용할 수 있는가?"
  1704.  
  1705. if srcSlotPos == dstSlotPos and not item.IsMetin(srcItemVNum):
  1706. return False
  1707.  
  1708. if item.IsRefineScroll(srcItemVNum):
  1709. if player.REFINE_OK == player.CanRefine(srcItemVNum, dstSlotPos):
  1710. return True
  1711. elif item.IsMetin(srcItemVNum):
  1712. if player.ATTACH_METIN_OK == player.CanAttachMetin(srcItemVNum, dstSlotPos):
  1713. return True
  1714. elif item.IsDetachScroll(srcItemVNum):
  1715. if player.DETACH_METIN_OK == player.CanDetach(srcItemVNum, dstSlotPos):
  1716. return True
  1717. elif item.IsKey(srcItemVNum):
  1718. if player.CanUnlock(srcItemVNum, dstSlotPos):
  1719. return True
  1720.  
  1721. elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
  1722. return True
  1723.  
  1724. else:
  1725. useType=item.GetUseType(srcItemVNum)
  1726.  
  1727. if "USE_CLEAN_SOCKET" == useType:
  1728. if self.__CanCleanBrokenMetinStone(dstSlotPos):
  1729. return True
  1730. elif "USE_CHANGE_ATTRIBUTE" == useType:
  1731. if self.__CanChangeItemAttrList(dstSlotPos):
  1732. return True
  1733. elif "USE_ADD_ATTRIBUTE" == useType:
  1734. if self.__CanAddItemAttr(dstSlotPos):
  1735. return True
  1736. elif "USE_ADD_ATTRIBUTE2" == useType:
  1737. if self.__CanAddItemAttr(dstSlotPos):
  1738. return True
  1739. elif "USE_ADD_ACCESSORY_SOCKET" == useType:
  1740. if self.__CanAddAccessorySocket(dstSlotPos):
  1741. return True
  1742. elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType:
  1743. if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum):
  1744. return TRUE;
  1745. elif "USE_PUT_INTO_BELT_SOCKET" == useType:
  1746. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1747. print "USE_PUT_INTO_BELT_SOCKET", srcItemVNum, dstItemVNum
  1748.  
  1749. item.SelectItem(dstItemVNum)
  1750.  
  1751. if item.ITEM_TYPE_BELT == item.GetItemType():
  1752. return True
  1753.  
  1754. return False
  1755.  
  1756. def __CanCleanBrokenMetinStone(self, dstSlotPos):
  1757. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1758. if dstItemVNum == 0:
  1759. return False
  1760.  
  1761. item.SelectItem(dstItemVNum)
  1762.  
  1763. if item.ITEM_TYPE_WEAPON != item.GetItemType():
  1764. return False
  1765.  
  1766. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1767. if player.GetItemMetinSocket(dstSlotPos, i) == constInfo.ERROR_METIN_STONE:
  1768. return True
  1769.  
  1770. return False
  1771.  
  1772. def __CanChangeItemAttrList(self, dstSlotPos):
  1773. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1774. if dstItemVNum == 0:
  1775. return False
  1776.  
  1777. item.SelectItem(dstItemVNum)
  1778.  
  1779. if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
  1780. return False
  1781.  
  1782. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1783. if player.GetItemAttribute(dstSlotPos, i) != 0:
  1784. return True
  1785.  
  1786. return False
  1787.  
  1788. def __CanPutAccessorySocket(self, dstSlotPos, mtrlVnum):
  1789. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1790. if dstItemVNum == 0:
  1791. return False
  1792.  
  1793. item.SelectItem(dstItemVNum)
  1794.  
  1795. if item.GetItemType() != item.ITEM_TYPE_ARMOR:
  1796. return False
  1797.  
  1798. if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
  1799. return False
  1800.  
  1801. curCount = player.GetItemMetinSocket(dstSlotPos, 0)
  1802. maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
  1803.  
  1804. if mtrlVnum != constInfo.GET_ACCESSORY_MATERIAL_VNUM(dstItemVNum, item.GetItemSubType()):
  1805. return False
  1806.  
  1807. if curCount>=maxCount:
  1808. return False
  1809.  
  1810. return True
  1811.  
  1812. def __CanAddAccessorySocket(self, dstSlotPos):
  1813. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1814. if dstItemVNum == 0:
  1815. return False
  1816.  
  1817. item.SelectItem(dstItemVNum)
  1818.  
  1819. if item.GetItemType() != item.ITEM_TYPE_ARMOR:
  1820. return False
  1821.  
  1822. if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
  1823. return False
  1824.  
  1825. curCount = player.GetItemMetinSocket(dstSlotPos, 0)
  1826. maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
  1827.  
  1828. ACCESSORY_SOCKET_MAX_SIZE = 3
  1829. if maxCount >= ACCESSORY_SOCKET_MAX_SIZE:
  1830. return False
  1831.  
  1832. return True
  1833.  
  1834. def __CanAddItemAttr(self, dstSlotPos):
  1835. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1836. if dstItemVNum == 0:
  1837. return False
  1838.  
  1839. item.SelectItem(dstItemVNum)
  1840.  
  1841. if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
  1842. return False
  1843.  
  1844. attrCount = 0
  1845. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1846. if player.GetItemAttribute(dstSlotPos, i) != 0:
  1847. attrCount += 1
  1848.  
  1849. if attrCount<4:
  1850. return True
  1851.  
  1852. return False
  1853.  
  1854. def ShowToolTip(self, slotIndex):
  1855. if None != self.tooltipItem:
  1856. self.tooltipItem.SetInventoryItem(slotIndex)
  1857.  
  1858. def OnTop(self):
  1859. if None != self.tooltipItem:
  1860. self.tooltipItem.SetTop()
  1861.  
  1862. def OnPressEscapeKey(self):
  1863. self.Close()
  1864. return True
  1865.  
  1866. def UseItemSlot(self, slotIndex):
  1867. curCursorNum = app.GetCursor()
  1868. if app.SELL == curCursorNum:
  1869. return
  1870.  
  1871. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
  1872. return
  1873.  
  1874. slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex)
  1875.  
  1876. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1877. if self.wndDragonSoulRefine.IsShow():
  1878. self.wndDragonSoulRefine.AutoSetItem((player.INVENTORY, slotIndex), 1)
  1879. return
  1880.  
  1881. self.__UseItem(slotIndex)
  1882. mouseModule.mouseController.DeattachObject()
  1883. self.OverOutItem()
  1884.  
  1885. def __UseItem(self, slotIndex):
  1886. ItemVNum = player.GetItemIndex(slotIndex)
  1887. item.SelectItem(ItemVNum)
  1888. if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE):
  1889. self.questionDialog = uiCommon.QuestionDialog()
  1890. self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM)
  1891. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnAccept))
  1892. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel))
  1893. self.questionDialog.Open()
  1894. self.questionDialog.slotIndex = slotIndex
  1895.  
  1896. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1897.  
  1898. else:
  1899. self.__SendUseItemPacket(slotIndex)
  1900. #net.SendItemUsePacket(slotIndex)
  1901.  
  1902. def __UseItemQuestionDialog_OnCancel(self):
  1903. self.OnCloseQuestionDialog()
  1904.  
  1905. def __UseItemQuestionDialog_OnAccept(self):
  1906. self.__SendUseItemPacket(self.questionDialog.slotIndex)
  1907. self.OnCloseQuestionDialog()
  1908.  
  1909. def __SendUseItemToItemPacket(self, srcSlotPos, dstSlotPos):
  1910. # 개인상점 열고 있는 동안 아이템 사용 방지
  1911. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1912. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
  1913. return
  1914.  
  1915. net.SendItemUseToItemPacket(srcSlotPos, dstSlotPos)
  1916.  
  1917. def __SendUseItemPacket(self, slotPos):
  1918. # 개인상점 열고 있는 동안 아이템 사용 방지
  1919. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1920. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
  1921. return
  1922.  
  1923. net.SendItemUsePacket(slotPos)
  1924.  
  1925. def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):
  1926. # 개인상점 열고 있는 동안 아이템 사용 방지
  1927. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1928. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP)
  1929. return
  1930.  
  1931. net.SendItemMovePacket(srcSlotPos, dstSlotPos, srcItemCount)
  1932.  
  1933. def SetDragonSoulRefineWindow(self, wndDragonSoulRefine):
  1934. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1935. self.wndDragonSoulRefine = wndDragonSoulRefine
  1936.  
  1937. def OnMoveWindow(self, x, y):
  1938. # print "Inventory Global Pos : ", self.GetGlobalPosition()
  1939. if self.wndBelt:
  1940. # print "Belt Global Pos : ", self.wndBelt.GetGlobalPosition()
  1941. self.wndBelt.AdjustPositionAndSize()
  1942.  
  1943. if app.BL_ENABLE_PICKUP_ITEM_EFFECT:
  1944. def ActivateSlot(self, slotindex, type):
  1945. if type == wndMgr.HILIGHTSLOT_MAX:
  1946. return
  1947.  
  1948. def DeactivateSlot(self, slotindex, type):
  1949. if type == wndMgr.HILIGHTSLOT_MAX:
  1950. return
  1951.  
  1952. def __HighlightSlot_Refresh(self):
  1953. for i in xrange(self.wndItem.GetSlotCount()):
  1954. slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
  1955. if slotNumber in self.listHighlightedSlot:
  1956. self.wndItem.ActivateSlot(i)
  1957.  
  1958. def __HighlightSlot_Clear(self):
  1959. for i in xrange(self.wndItem.GetSlotCount()):
  1960. slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
  1961. if slotNumber in self.listHighlightedSlot:
  1962. self.wndItem.DeactivateSlot(i)
  1963. self.listHighlightedSlot.remove(slotNumber)
  1964.  
  1965. def HighlightSlot(self, slot):
  1966. if slot>player.INVENTORY_PAGE_SIZE*player.INVENTORY_PAGE_COUNT:
  1967. return
  1968.  
  1969. if not slot in self.listHighlightedSlot:
  1970. self.listHighlightedSlot.append (slot)
  1971.  
  1972. def DelHighlightSlot(self, inventorylocalslot):
  1973. if inventorylocalslot in self.listHighlightedSlot:
  1974. if inventorylocalslot >= player.INVENTORY_PAGE_SIZE:
  1975. self.wndItem.DeactivateSlot(inventorylocalslot - (self.inventoryPageIndex * player.INVENTORY_PAGE_SIZE) )
  1976. else:
  1977. self.wndItem.DeactivateSlot(inventorylocalslot)
  1978.  
  1979. self.listHighlightedSlot.remove(inventorylocalslot)
  1980.  
Add Comment
Please, Sign In to add comment