Guest User

Untitled

a guest
Jun 14th, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 85.52 KB | None | 0 0
  1. import ui
  2. import player
  3. import mouseModule
  4. import net
  5. import app
  6. import snd
  7. if app.ENABLE_BIOLOG_SYSTEM:
  8. import uiprofessionalbiolog, uiToolTip
  9. import item
  10. import player
  11. import chat
  12. import grp
  13. import uiScriptLocale
  14. import uiRefine
  15. import uiAttachMetin
  16. import uiPickMoney
  17. import uiCommon
  18. import uiPrivateShopBuilder
  19. import localeInfo
  20. import constInfo
  21. import ime
  22. import wndMgr
  23. import uiPickEtc
  24. import uipicketc
  25. import exchange
  26. if app.ENABLE_ACCE_SYSTEM:
  27. import acce
  28.  
  29. ITEM_MALL_BUTTON_ENABLE = True
  30.  
  31.  
  32.  
  33. ITEM_FLAG_APPLICABLE = 1 << 14
  34.  
  35. class CostumeWindow(ui.ScriptWindow):
  36.  
  37. def __init__(self, wndInventory):
  38. import exception
  39.  
  40. if not app.ENABLE_COSTUME_SYSTEM:
  41. exception.Abort("What do you do?")
  42. return
  43.  
  44. if not wndInventory:
  45. exception.Abort("wndInventory parameter must be set to InventoryWindow")
  46. return
  47.  
  48. ui.ScriptWindow.__init__(self)
  49.  
  50. self.isLoaded = 0
  51. self.wndInventory = wndInventory;
  52. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  53. self.visibleButtonList = []
  54.  
  55. self.__LoadWindow()
  56.  
  57. def __del__(self):
  58. ui.ScriptWindow.__del__(self)
  59.  
  60. def Show(self):
  61. self.__LoadWindow()
  62. self.RefreshCostumeSlot()
  63.  
  64. ui.ScriptWindow.Show(self)
  65.  
  66. def Close(self):
  67. self.Hide()
  68.  
  69. def __LoadWindow(self):
  70. if self.isLoaded == 1:
  71. return
  72.  
  73. self.isLoaded = 1
  74.  
  75. try:
  76. pyScrLoader = ui.PythonScriptLoader()
  77. pyScrLoader.LoadScriptFile(self, "uiscript/costumewindow.py")
  78. except:
  79. import exception
  80. exception.Abort("CostumeWindow.LoadWindow.LoadObject")
  81.  
  82. try:
  83. wndEquip = self.GetChild("CostumeSlot")
  84. self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
  85. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  86. self.visibleButtonList.append(self.GetChild("BodyToolTipButton"))
  87. self.visibleButtonList.append(self.GetChild("HairToolTipButton"))
  88. if app.ENABLE_ACCE_SYSTEM:
  89. self.visibleButtonList.append(self.GetChild("AcceToolTipButton"))
  90. self.visibleButtonList.append(self.GetChild("WeaponToolTipButton"))
  91.  
  92. except:
  93. import exception
  94. exception.Abort("CostumeWindow.LoadWindow.BindObject")
  95.  
  96. ## Equipment
  97. wndEquip.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
  98. wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
  99. wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  100. wndEquip.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  101. wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
  102. wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
  103.  
  104. self.wndEquip = wndEquip
  105. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  106. self.visibleButtonList[0].SetToggleUpEvent(ui.__mem_func__(self.VisibleCostume), 1, 0)
  107. self.visibleButtonList[1].SetToggleUpEvent(ui.__mem_func__(self.VisibleCostume), 2, 0)
  108. if app.ENABLE_ACCE_SYSTEM:
  109. self.visibleButtonList[2].SetToggleUpEvent(ui.__mem_func__(self.VisibleCostume), 3, 0)
  110. if app.ENABLE_WEAPON_COSTUME_SYSTEM:
  111. self.visibleButtonList[3].SetToggleUpEvent(ui.__mem_func__(self.VisibleCostume), 4, 0)
  112.  
  113. self.visibleButtonList[0].SetToggleDownEvent(ui.__mem_func__(self.VisibleCostume), 1, 1)
  114. self.visibleButtonList[1].SetToggleDownEvent(ui.__mem_func__(self.VisibleCostume), 2, 1)
  115. if app.ENABLE_ACCE_SYSTEM:
  116. self.visibleButtonList[2].SetToggleDownEvent(ui.__mem_func__(self.VisibleCostume), 3, 1)
  117. if app.ENABLE_WEAPON_COSTUME_SYSTEM:
  118. self.visibleButtonList[3].SetToggleDownEvent(ui.__mem_func__(self.VisibleCostume), 4, 1)
  119.  
  120.  
  121. def RefreshCostumeSlot(self):
  122. getItemVNum=player.GetItemIndex
  123.  
  124. for i in xrange(item.COSTUME_SLOT_COUNT):
  125. slotNumber = item.COSTUME_SLOT_START + i
  126. self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0)
  127.  
  128. if app.ENABLE_WEAPON_COSTUME_SYSTEM:
  129. self.wndEquip.SetItemSlot(item.COSTUME_SLOT_WEAPON, getItemVNum(item.COSTUME_SLOT_WEAPON), 0)
  130.  
  131. self.wndEquip.RefreshSlot()
  132.  
  133. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  134. def RefreshVisibleCostume(self):
  135. body = constInfo.HIDDEN_BODY_COSTUME
  136. hair = constInfo.HIDDEN_HAIR_COSTUME
  137. if app.ENABLE_ACCE_SYSTEM:
  138. acce = constInfo.HIDDEN_ACCE_COSTUME
  139. if app.ENABLE_WEAPON_COSTUME_SYSTEM:
  140. weapon = constInfo.HIDDEN_WEAPON_COSTUME
  141.  
  142. if body == 1:
  143. self.visibleButtonList[0].SetToolTipText(localeInfo.SHOW_COSTUME)
  144. self.visibleButtonList[0].Down()
  145. else:
  146. self.visibleButtonList[0].SetToolTipText(localeInfo.HIDE_COSTUME)
  147. self.visibleButtonList[0].SetUp()
  148.  
  149. if hair == 1:
  150. self.visibleButtonList[1].SetToolTipText(localeInfo.SHOW_COSTUME)
  151. self.visibleButtonList[1].Down()
  152. else:
  153. self.visibleButtonList[1].SetToolTipText(localeInfo.HIDE_COSTUME)
  154. self.visibleButtonList[1].SetUp()
  155.  
  156. if app.ENABLE_ACCE_SYSTEM:
  157. if acce == 1:
  158. self.visibleButtonList[2].SetToolTipText(localeInfo.SHOW_COSTUME)
  159. self.visibleButtonList[2].Down()
  160. else:
  161. self.visibleButtonList[2].SetToolTipText(localeInfo.HIDE_COSTUME)
  162. self.visibleButtonList[2].SetUp()
  163.  
  164. if app.ENABLE_WEAPON_COSTUME_SYSTEM:
  165. if weapon == 1:
  166. self.visibleButtonList[3].SetToolTipText(localeInfo.SHOW_COSTUME)
  167. self.visibleButtonList[3].Down()
  168. else:
  169. self.visibleButtonList[3].SetToolTipText(localeInfo.HIDE_COSTUME)
  170. self.visibleButtonList[3].SetUp()
  171.  
  172. def VisibleCostume(self, part, hidden):
  173. net.SendChatPacket("/hide_costume %d %d" % (part, hidden))
  174.  
  175. if app.WJ_SPLIT_INVENTORY_SYSTEM:
  176. class ExtendedInventoryWindow(ui.ScriptWindow):
  177. tooltipItem = None
  178. interface = None
  179. dlgPickMoney = None
  180. dlgPickItem = None
  181. sellingSlotNumber = -1
  182. isLoaded = 0
  183.  
  184. def __init__(self):
  185. ui.ScriptWindow.__init__(self)
  186. self.inventoryPageIndex = 0
  187. self.__LoadWindow()
  188.  
  189. def __del__(self):
  190. ui.ScriptWindow.__del__(self)
  191.  
  192.  
  193. def Show(self):
  194. self.__LoadWindow()
  195. ui.ScriptWindow.Show(self)
  196.  
  197. def BindInterfaceClass(self, interface):
  198. self.interface = interface
  199.  
  200. def __LoadWindow(self):
  201. if self.isLoaded == 1:
  202. return
  203.  
  204. self.isLoaded = 1
  205.  
  206. try:
  207. pyScrLoader = ui.PythonScriptLoader()
  208. pyScrLoader.LoadScriptFile(self, "UIScript/ExtendedInventoryWindow.py")
  209. except:
  210. import exception
  211. exception.Abort("ExtendedInventoryWindow.LoadWindow.LoadObject")
  212.  
  213. try:
  214. wndItem = self.GetChild("ItemSlot")
  215. self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
  216. self.titleName = self.GetChild("TitleName")
  217. self.SkillBookButton = self.GetChild("SkillBookButton")
  218. self.UpgradeItemsButton = self.GetChild("UpgradeItemsButton")
  219. self.stoneButton = self.GetChild("StoneButton")
  220. self.boxButton = self.GetChild("BoxButton")
  221. self.inventoryTab = []
  222. self.inventoryTab.append(self.GetChild("Inventory_Tab_01"))
  223. self.inventoryTab.append(self.GetChild("Inventory_Tab_02"))
  224. self.inventoryTab.append(self.GetChild("Inventory_Tab_03"))
  225. self.MalzemeDeposuInfo = self.GetChild("MalzemeDeposuInfo")
  226. except:
  227. import exception
  228. exception.Abort("ExtendedInventoryWindow.LoadWindow.BindObject")
  229.  
  230. ## Info
  231. self.tlInfo = uiToolTip.ItemToolTip()
  232. self.tlInfo.Hide()
  233. self.tooltipInfo = [self.tlInfo]*7
  234. self.InformationText = [localeInfo.MALZEME_DEPOSU,
  235. localeInfo.BK_ENVANTER_TEXT1,
  236. localeInfo.BK_ENVANTER_TEXT2,
  237. localeInfo.BK_ENVANTER_TEXT3,
  238. localeInfo.BK_ENVANTER_TEXT4,
  239. localeInfo.BK_ENVANTER_TEXT5,
  240. localeInfo.BK_ENVANTER_TEXT6
  241. ]
  242.  
  243. for i in xrange(7):
  244. self.tooltipInfo[i].SetFollow(True)
  245. self.tooltipInfo[i].AlignHorizonalCenter()
  246. if i == 0:
  247. TITLE_COLOR = grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)
  248. self.tooltipInfo[i].AutoAppendTextLine(self.InformationText[i], TITLE_COLOR)
  249. else:
  250. self.tooltipInfo[i].AutoAppendTextLine(self.InformationText[i])
  251. self.tooltipInfo[i].Hide()
  252. self.tooltipInfo[i].toolTipWidth += 10
  253.  
  254. ## Item
  255. wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
  256. wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
  257. wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
  258. wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
  259. wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  260. wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  261.  
  262. self.envanterileacilsin = ui.CheckBox()
  263. self.envanterileacilsin.SetParent(self)
  264. self.envanterileacilsin.SetPosition(17, 385)
  265. self.envanterileacilsin.SetEvent(ui.__mem_func__(self.__OnClickEnableEnvanterOn), "ON_CHECK", True)
  266. self.envanterileacilsin.SetEvent(ui.__mem_func__(self.__OnClickDisableEnvanterOf), "ON_UNCKECK", False)
  267. self.envanterileacilsin.SetTextInfo(localeInfo.ENVANTER_ILE_AC)
  268. self.envanterileacilsin.SetCheckStatus(constInfo.EnvanterAcilsinmi)
  269. self.envanterileacilsin.Show()
  270.  
  271. self.SkillBookButton.SetEvent(lambda arg=0: self.SetInventoryType(arg))
  272. self.UpgradeItemsButton.SetEvent(lambda arg=1: self.SetInventoryType(arg))
  273. self.stoneButton.SetEvent(lambda arg=2: self.SetInventoryType(arg))
  274. self.boxButton.SetEvent(lambda arg=3: self.SetInventoryType(arg))
  275. self.SkillBookButton.Down()
  276.  
  277. self.inventoryTab[0].SetEvent(lambda arg=0: self.SetInventoryPage(arg))
  278. self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg))
  279. self.inventoryTab[2].SetEvent(lambda arg=2: self.SetInventoryPage(arg))
  280. self.inventoryTab[0].Down()
  281.  
  282. ## PickMoneyDialog
  283. dlgPickMoney = uiPickMoney.PickMoneyDialog()
  284. dlgPickMoney.LoadDialog()
  285. dlgPickMoney.Hide()
  286.  
  287. ## PickItemDialog
  288. dlgPickItem = uiPickEtc.PickEtcDialog()
  289. dlgPickItem.LoadDialog()
  290. dlgPickItem.Hide()
  291.  
  292. self.dlgPickMoney = dlgPickMoney
  293.  
  294. self.wndItem = wndItem
  295. self.SetInventoryType(0)
  296. self.SetInventoryPage(0)
  297.  
  298. self.dlgPickItem = dlgPickItem
  299.  
  300. self.wndCostume = None
  301.  
  302.  
  303. def Destroy(self):
  304. self.ClearDictionary()
  305. self.dlgPickMoney.Destroy()
  306. self.dlgPickItem.Destroy()
  307. self.dlgPickItem = 0
  308. self.dlgPickMoney = 0
  309. self.tooltipItem = None
  310. self.wndItem = 0
  311. self.interface = None
  312. self.inventoryTab = []
  313. self.envanterileacilsin = []
  314.  
  315. def __OnClickEnableEnvanterOn(self):
  316. constInfo.EnvanterAcilsinmi = 1
  317. chat.AppendChat(chat.CHAT_TYPE_INFO, "Apertura automatica con inventario normale attiva.")
  318.  
  319. def __OnClickDisableEnvanterOf(self):
  320. constInfo.EnvanterAcilsinmi = 0
  321. chat.AppendChat(chat.CHAT_TYPE_INFO, "Apertura automatica con inventario normale disattivata.")
  322.  
  323. def Hide(self):
  324. if None != self.tooltipItem:
  325. self.tooltipItem.HideToolTip()
  326. self.tlInfo.Hide()
  327. if self.dlgPickItem:
  328. self.dlgPickItem.Close()
  329. wndMgr.Hide(self.hWnd)
  330.  
  331. def Close(self):
  332. if self.tooltipItem:
  333. self.tooltipItem.HideToolTip()
  334. self.tlInfo.Hide()
  335. self.Hide()
  336.  
  337. def OnUpdate(self):
  338. for i in xrange(7):
  339. if self.MalzemeDeposuInfo.IsIn():
  340. self.tooltipInfo[i].Show()
  341. else:
  342. self.tooltipInfo[i].Hide()
  343.  
  344. def SetInventoryType(self, type):
  345. self.inventoryType = type
  346. if type == 0:
  347. self.SkillBookButton.Down()
  348. self.UpgradeItemsButton.SetUp()
  349. self.stoneButton.SetUp()
  350. self.boxButton.SetUp()
  351. self.titleName.SetText(localeInfo.INVENTORY_SKILL_BOOK_TOOLTIP)
  352. elif type == 2:
  353. self.stoneButton.Down()
  354. self.UpgradeItemsButton.SetUp()
  355. self.SkillBookButton.SetUp()
  356. self.boxButton.SetUp()
  357. self.titleName.SetText(localeInfo.INVENTORY_STONE_TOOLTIP)
  358. elif type == 3:
  359. self.boxButton.Down()
  360. self.UpgradeItemsButton.SetUp()
  361. self.stoneButton.SetUp()
  362. self.SkillBookButton.SetUp()
  363. self.titleName.SetText(localeInfo.INVENTORY_BOX_TOOLTIP)
  364. elif type == 4:
  365. self.boxButton.SetUp()
  366. self.UpgradeItemsButton.SetUp()
  367. self.stoneButton.SetUp()
  368. self.SkillBookButton.SetUp()
  369. self.titleName.SetText(localeInfo.INVENTORY_EFSUN_TOOLTIP)
  370. elif type == 5:
  371. self.boxButton.SetUp()
  372. self.UpgradeItemsButton.SetUp()
  373. self.stoneButton.SetUp()
  374. self.SkillBookButton.SetUp()
  375. self.titleName.SetText(localeInfo.INVENTORY_CICEK_TOOLTIP)
  376. else:
  377. self.UpgradeItemsButton.Down()
  378. self.SkillBookButton.SetUp()
  379. self.stoneButton.SetUp()
  380. self.boxButton.SetUp()
  381. self.titleName.SetText(localeInfo.INVENTORY_UPGRADE_ITEM_TOOLTIP)
  382. self.RefreshBagSlotWindow()
  383.  
  384. def SetInventoryPage(self, page):
  385. self.inventoryPageIndex = page
  386. for i in range(0,len(self.inventoryTab)):
  387. self.inventoryTab[i].SetUp()
  388. self.inventoryTab[page].Down()
  389. self.RefreshBagSlotWindow()
  390.  
  391. def OnPickItem(self, count):
  392. itemSlotIndex = self.dlgPickItem.itemGlobalSlotIndex
  393. selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  394. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_SKILL_BOOK_INVENTORY, itemSlotIndex, selectedItemVNum, count)
  395.  
  396. def __InventoryLocalSlotPosToGlobalSlotPos(self, local):
  397. if self.inventoryType == 0:
  398. return self.inventoryPageIndex*player.SKILL_BOOK_INVENTORY_SLOT_COUNT + local + item.SKILL_BOOK_INVENTORY_SLOT_START
  399. elif self.inventoryType == 2:
  400. return self.inventoryPageIndex*player.STONE_INVENTORY_SLOT_COUNT + local + item.STONE_INVENTORY_SLOT_START
  401. elif self.inventoryType == 3:
  402. return self.inventoryPageIndex*player.BOX_INVENTORY_SLOT_COUNT + local + item.BOX_INVENTORY_SLOT_START
  403. elif self.inventoryType == 4:
  404. return self.inventoryPageIndex*player.EFSUN_INVENTORY_SLOT_COUNT + local + item.EFSUN_INVENTORY_SLOT_START
  405. elif self.inventoryType == 5:
  406. return self.inventoryPageIndex*player.CICEK_INVENTORY_SLOT_COUNT + local + item.CICEK_INVENTORY_SLOT_START
  407. else:
  408. return self.inventoryPageIndex*player.UPGRADE_ITEMS_INVENTORY_SLOT_COUNT + local + item.UPGRADE_ITEMS_INVENTORY_SLOT_START
  409.  
  410. def GetInventoryPageIndex(self):
  411. return self.inventoryPageIndex
  412.  
  413. def RefreshBagSlotWindow(self):
  414. getItemVNum=player.GetItemIndex
  415. getItemCount=player.GetItemCount
  416. setItemVNum=self.wndItem.SetItemSlot
  417.  
  418. if self.inventoryType == 0:
  419. for i in xrange(player.SKILL_BOOK_INVENTORY_SLOT_COUNT):
  420. slotNumber = item.SKILL_BOOK_INVENTORY_SLOT_START + i
  421. if self.GetInventoryPageIndex() == 1:
  422. slotNumber += 45
  423. elif self.GetInventoryPageIndex() == 2:
  424. slotNumber += 90
  425. itemCount = getItemCount(slotNumber)
  426. if 0 == itemCount:
  427. self.wndItem.ClearSlot(i)
  428. continue
  429. elif 1 == itemCount:
  430. itemCount = 0
  431. itemVnum = getItemVNum(slotNumber)
  432. setItemVNum(i, itemVnum, itemCount)
  433. elif self.inventoryType == 2:
  434. for i in xrange(player.STONE_INVENTORY_SLOT_COUNT):
  435. slotNumber = item.STONE_INVENTORY_SLOT_START + i
  436. if self.GetInventoryPageIndex() == 1:
  437. slotNumber += 45
  438. elif self.GetInventoryPageIndex() == 2:
  439. slotNumber += 90
  440. itemCount = getItemCount(slotNumber)
  441. if 0 == itemCount:
  442. self.wndItem.ClearSlot(i)
  443. continue
  444. elif 1 == itemCount:
  445. itemCount = 0
  446. itemVnum = getItemVNum(slotNumber)
  447. setItemVNum(i, itemVnum, itemCount)
  448. elif self.inventoryType == 3:
  449. for i in xrange(player.BOX_INVENTORY_SLOT_COUNT):
  450. slotNumber = item.BOX_INVENTORY_SLOT_START + i
  451. if self.GetInventoryPageIndex() == 1:
  452. slotNumber += 45
  453. elif self.GetInventoryPageIndex() == 2:
  454. slotNumber += 90
  455. itemCount = getItemCount(slotNumber)
  456. if 0 == itemCount:
  457. self.wndItem.ClearSlot(i)
  458. continue
  459. elif 1 == itemCount:
  460. itemCount = 0
  461. itemVnum = getItemVNum(slotNumber)
  462. setItemVNum(i, itemVnum, itemCount)
  463. elif self.inventoryType == 4:
  464. for i in xrange(player.EFSUN_INVENTORY_SLOT_COUNT):
  465. slotNumber = item.EFSUN_INVENTORY_SLOT_START + i
  466. if self.GetInventoryPageIndex() == 1:
  467. slotNumber += 45
  468. elif self.GetInventoryPageIndex() == 2:
  469. slotNumber += 90
  470. itemCount = getItemCount(slotNumber)
  471. if 0 == itemCount:
  472. self.wndItem.ClearSlot(i)
  473. continue
  474. elif 1 == itemCount:
  475. itemCount = 0
  476. itemVnum = getItemVNum(slotNumber)
  477. setItemVNum(i, itemVnum, itemCount)
  478. elif self.inventoryType == 5:
  479. for i in xrange(player.CICEK_INVENTORY_SLOT_COUNT):
  480. slotNumber = item.CICEK_INVENTORY_SLOT_START + i
  481. if self.GetInventoryPageIndex() == 1:
  482. slotNumber += 45
  483. elif self.GetInventoryPageIndex() == 2:
  484. slotNumber += 90
  485. itemCount = getItemCount(slotNumber)
  486. if 0 == itemCount:
  487. self.wndItem.ClearSlot(i)
  488. continue
  489. elif 1 == itemCount:
  490. itemCount = 0
  491. itemVnum = getItemVNum(slotNumber)
  492. setItemVNum(i, itemVnum, itemCount)
  493. else:
  494. for i in xrange(player.UPGRADE_ITEMS_INVENTORY_SLOT_COUNT):
  495. slotNumber = item.UPGRADE_ITEMS_INVENTORY_SLOT_START + i
  496. if self.GetInventoryPageIndex() == 1:
  497. slotNumber += 45
  498. elif self.GetInventoryPageIndex() == 2:
  499. slotNumber += 90
  500. itemCount = getItemCount(slotNumber)
  501. if 0 == itemCount:
  502. self.wndItem.ClearSlot(i)
  503. continue
  504. elif 1 == itemCount:
  505. itemCount = 0
  506. itemVnum = getItemVNum(slotNumber)
  507. setItemVNum(i, itemVnum, itemCount)
  508. self.wndItem.RefreshSlot()
  509.  
  510. def RefreshItemSlot(self):
  511. self.RefreshBagSlotWindow()
  512.  
  513. def RefreshStatus(self):
  514. pass
  515.  
  516. def SetItemToolTip(self, tooltipItem):
  517. self.tooltipItem = tooltipItem
  518.  
  519. def SelectEmptySlot(self, selectedSlotPos):
  520. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
  521. return
  522.  
  523. if self.inventoryType == 0:
  524. selectedSlotPos += item.SKILL_BOOK_INVENTORY_SLOT_START
  525. if self.GetInventoryPageIndex() == 1:
  526. selectedSlotPos += 45
  527. elif self.GetInventoryPageIndex() == 2:
  528. selectedSlotPos += 90
  529. elif self.inventoryType == 2:
  530. selectedSlotPos += item.STONE_INVENTORY_SLOT_START
  531. if self.GetInventoryPageIndex() == 1:
  532. selectedSlotPos += 45
  533. elif self.GetInventoryPageIndex() == 2:
  534. selectedSlotPos += 90
  535. elif self.inventoryType == 3:
  536. selectedSlotPos += item.BOX_INVENTORY_SLOT_START
  537. if self.GetInventoryPageIndex() == 1:
  538. selectedSlotPos += 45
  539. elif self.GetInventoryPageIndex() == 2:
  540. selectedSlotPos += 90
  541. elif self.inventoryType == 4:
  542. selectedSlotPos += item.EFSUN_INVENTORY_SLOT_START
  543. if self.GetInventoryPageIndex() == 1:
  544. selectedSlotPos += 45
  545. elif self.GetInventoryPageIndex() == 2:
  546. selectedSlotPos += 90
  547. elif self.inventoryType == 5:
  548. selectedSlotPos += item.CICEK_INVENTORY_SLOT_START
  549. if self.GetInventoryPageIndex() == 1:
  550. selectedSlotPos += 45
  551. elif self.GetInventoryPageIndex() == 2:
  552. selectedSlotPos += 90
  553. else:
  554. selectedSlotPos += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
  555. if self.GetInventoryPageIndex() == 1:
  556. selectedSlotPos += 45
  557. elif self.GetInventoryPageIndex() == 2:
  558. selectedSlotPos += 90
  559.  
  560. if mouseModule.mouseController.isAttached():
  561.  
  562. attachedSlotType = mouseModule.mouseController.GetAttachedType()
  563. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  564. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  565. attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  566.  
  567. if player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType or\
  568. player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType or\
  569. player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType or\
  570. player.SLOT_TYPE_BOX_INVENTORY == attachedSlotType or\
  571. player.SLOT_TYPE_EFSUN_INVENTORY == attachedSlotType or\
  572. player.SLOT_TYPE_CICEK_INVENTORY == attachedSlotType:
  573. itemCount = player.GetItemCount(attachedSlotPos)
  574. attachedCount = mouseModule.mouseController.GetAttachedItemCount()
  575. self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
  576.  
  577. if item.IsRefineScroll(attachedItemIndex):
  578. self.wndItem.SetUseMode(False)
  579.  
  580. elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType:
  581. mouseModule.mouseController.RunCallBack("INVENTORY")
  582.  
  583. elif player.SLOT_TYPE_SHOP == attachedSlotType:
  584. net.SendShopBuyPacket(attachedSlotPos)
  585.  
  586. elif player.SLOT_TYPE_SAFEBOX == attachedSlotType:
  587.  
  588. if player.ITEM_MONEY == attachedItemIndex:
  589. net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
  590. snd.PlaySound("sound/ui/money.wav")
  591.  
  592. else:
  593. net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos)
  594.  
  595. elif player.SLOT_TYPE_MALL == attachedSlotType:
  596. net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos)
  597.  
  598. mouseModule.mouseController.DeattachObject()
  599.  
  600. def SelectItemSlot(self, itemSlotIndex):
  601. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
  602. return
  603.  
  604. if self.inventoryType == 0:
  605. itemSlotIndex += item.SKILL_BOOK_INVENTORY_SLOT_START
  606. if self.GetInventoryPageIndex() == 1:
  607. itemSlotIndex += 45
  608. elif self.GetInventoryPageIndex() == 2:
  609. itemSlotIndex += 90
  610. elif self.inventoryType == 2:
  611. itemSlotIndex += item.STONE_INVENTORY_SLOT_START
  612. if self.GetInventoryPageIndex() == 1:
  613. itemSlotIndex += 45
  614. elif self.GetInventoryPageIndex() == 2:
  615. itemSlotIndex += 90
  616. elif self.inventoryType == 3:
  617. itemSlotIndex += item.BOX_INVENTORY_SLOT_START
  618. if self.GetInventoryPageIndex() == 1:
  619. itemSlotIndex += 45
  620. elif self.GetInventoryPageIndex() == 2:
  621. itemSlotIndex += 90
  622. elif self.inventoryType == 4:
  623. itemSlotIndex += item.EFSUN_INVENTORY_SLOT_START
  624. if self.GetInventoryPageIndex() == 1:
  625. itemSlotIndex += 45
  626. elif self.GetInventoryPageIndex() == 2:
  627. itemSlotIndex += 90
  628. elif self.inventoryType == 5:
  629. itemSlotIndex += item.CICEK_INVENTORY_SLOT_START
  630. if self.GetInventoryPageIndex() == 1:
  631. itemSlotIndex += 45
  632. elif self.GetInventoryPageIndex() == 2:
  633. itemSlotIndex += 90
  634. else:
  635. itemSlotIndex += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
  636. if self.GetInventoryPageIndex() == 1:
  637. itemSlotIndex += 45
  638. elif self.GetInventoryPageIndex() == 2:
  639. itemSlotIndex += 90
  640.  
  641. if mouseModule.mouseController.isAttached():
  642. attachedSlotType = mouseModule.mouseController.GetAttachedType()
  643. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  644. attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
  645. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  646.  
  647. if player.GetItemCount(itemSlotIndex) > attachedItemCount:
  648. return
  649.  
  650. if player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType or\
  651. player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType or\
  652. player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType or\
  653. player.SLOT_TYPE_BOX_INVENTORY == attachedSlotType or\
  654. player.SLOT_TYPE_EFSUN_INVENTORY == attachedSlotType or\
  655. player.SLOT_TYPE_CICEK_INVENTORY == attachedSlotType:
  656. self.__SendMoveItemPacket(attachedSlotPos, itemSlotIndex, attachedItemCount)
  657.  
  658. mouseModule.mouseController.DeattachObject()
  659. else:
  660.  
  661. curCursorNum = app.GetCursor()
  662. #if app.SELL == curCursorNum:
  663. #self.__SellItem(itemSlotIndex)
  664.  
  665. if app.BUY == curCursorNum:
  666. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)
  667.  
  668. elif app.IsPressed(app.DIK_LALT):
  669. link = player.GetItemLink(itemSlotIndex)
  670. ime.PasteString(link)
  671.  
  672. elif app.IsPressed(app.DIK_LALT):
  673. link = player.GetItemLink(itemSlotIndex)
  674. ime.PasteString(link)
  675.  
  676. elif app.IsPressed(app.DIK_LSHIFT):
  677. itemCount = player.GetItemCount(itemSlotIndex)
  678.  
  679. if itemCount > 1:
  680. self.dlgPickItem.SetTitleName(localeInfo.PICK_ITEM_TITLE)
  681. self.dlgPickItem.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
  682. self.dlgPickItem.Open(itemCount)
  683. self.dlgPickItem.itemGlobalSlotIndex = itemSlotIndex
  684.  
  685. elif app.IsPressed(app.DIK_LCONTROL):
  686. itemIndex = player.GetItemIndex(itemSlotIndex)
  687.  
  688. if TRUE == item.CanAddToQuickSlotItem(itemIndex):
  689. player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
  690. else:
  691. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM)
  692. else:
  693. selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  694. itemCount = player.GetItemCount(itemSlotIndex)
  695. if self.inventoryType == 0:
  696. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_SKILL_BOOK_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  697. elif self.inventoryType == 2:
  698. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_STONE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  699. elif self.inventoryType == 3:
  700. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_BOX_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  701. elif self.inventoryType == 4:
  702. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_EFSUN_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  703. elif self.inventoryType == 5:
  704. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_CICEK_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  705. else:
  706. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  707. self.wndItem.SetUseMode(True)
  708.  
  709. snd.PlaySound("sound/ui/pick.wav")
  710.  
  711. def OnCloseQuestionDialog(self):
  712. if not self.questionDialog:
  713. return
  714.  
  715. self.questionDialog.Close()
  716. self.questionDialog = None
  717. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  718.  
  719. def Sat(self):
  720. if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
  721. if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
  722. net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY)
  723. snd.PlaySound("sound/ui/money.wav")
  724. self.OnCloseQuestionDialog()
  725.  
  726. def __OnClosePopupDialog(self):
  727. self.pop = None
  728.  
  729. def OverOutItem(self):
  730. self.wndItem.SetUsableItem(False)
  731. if None != self.tooltipItem:
  732. self.tooltipItem.HideToolTip()
  733.  
  734. def OverInItem(self, overSlotPos):
  735. if self.inventoryType == 0:
  736. overSlotPos += item.SKILL_BOOK_INVENTORY_SLOT_START
  737. if self.GetInventoryPageIndex() == 1:
  738. overSlotPos += 45
  739. elif self.GetInventoryPageIndex() == 2:
  740. overSlotPos += 90
  741. elif self.inventoryType == 2:
  742. overSlotPos += item.STONE_INVENTORY_SLOT_START
  743. if self.GetInventoryPageIndex() == 1:
  744. overSlotPos += 45
  745. elif self.GetInventoryPageIndex() == 2:
  746. overSlotPos += 90
  747. elif self.inventoryType == 3:
  748. overSlotPos += item.BOX_INVENTORY_SLOT_START
  749. if self.GetInventoryPageIndex() == 1:
  750. overSlotPos += 45
  751. elif self.GetInventoryPageIndex() == 2:
  752. overSlotPos += 90
  753. elif self.inventoryType == 4:
  754. overSlotPos += item.EFSUN_INVENTORY_SLOT_START
  755. if self.GetInventoryPageIndex() == 1:
  756. overSlotPos += 45
  757. elif self.GetInventoryPageIndex() == 2:
  758. overSlotPos += 90
  759. elif self.inventoryType == 5:
  760. overSlotPos += item.CICEK_INVENTORY_SLOT_START
  761. if self.GetInventoryPageIndex() == 1:
  762. overSlotPos += 45
  763. elif self.GetInventoryPageIndex() == 2:
  764. overSlotPos += 90
  765. else:
  766. overSlotPos += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
  767. if self.GetInventoryPageIndex() == 1:
  768. overSlotPos += 45
  769. elif self.GetInventoryPageIndex() == 2:
  770. overSlotPos += 90
  771. self.wndItem.SetUsableItem(False)
  772. self.ShowToolTip(overSlotPos)
  773.  
  774. def ShowToolTip(self, slotIndex):
  775. if None != self.tooltipItem:
  776. self.tooltipItem.SetInventoryItem(slotIndex)
  777.  
  778. def OnPressEscapeKey(self):
  779. self.Close()
  780. return True
  781.  
  782. def UseItemSlot(self, slotIndex):
  783. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
  784. return
  785.  
  786. if self.inventoryType == 0:
  787. slotIndex += item.SKILL_BOOK_INVENTORY_SLOT_START
  788. if self.GetInventoryPageIndex() == 1:
  789. slotIndex += 45
  790. elif self.GetInventoryPageIndex() == 2:
  791. slotIndex += 90
  792. elif self.inventoryType == 2:
  793. slotIndex += item.STONE_INVENTORY_SLOT_START
  794. if self.GetInventoryPageIndex() == 1:
  795. slotIndex += 45
  796. elif self.GetInventoryPageIndex() == 2:
  797. slotIndex += 90
  798. elif self.inventoryType == 3:
  799. slotIndex += item.BOX_INVENTORY_SLOT_START
  800. if self.GetInventoryPageIndex() == 1:
  801. slotIndex += 45
  802. elif self.GetInventoryPageIndex() == 2:
  803. slotIndex += 90
  804. elif self.inventoryType == 4:
  805. slotIndex += item.EFSUN_INVENTORY_SLOT_START
  806. if self.GetInventoryPageIndex() == 1:
  807. slotIndex += 45
  808. elif self.GetInventoryPageIndex() == 2:
  809. slotIndex += 90
  810. elif self.inventoryType == 5:
  811. slotIndex += item.CICEK_INVENTORY_SLOT_START
  812. if self.GetInventoryPageIndex() == 1:
  813. slotIndex += 45
  814. elif self.GetInventoryPageIndex() == 2:
  815. slotIndex += 90
  816. else:
  817. slotIndex += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
  818. if self.GetInventoryPageIndex() == 1:
  819. slotIndex += 45
  820. elif self.GetInventoryPageIndex() == 2:
  821. slotIndex += 90
  822. self.__UseItem(slotIndex)
  823. mouseModule.mouseController.DeattachObject()
  824. self.OverOutItem()
  825.  
  826. def __UseItem(self, slotIndex):
  827. ItemVNum = player.GetItemIndex(slotIndex)
  828. item.SelectItem(ItemVNum)
  829.  
  830. if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE):
  831. self.questionDialog = uiCommon.QuestionDialog()
  832. self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM)
  833. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnAccept))
  834. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel))
  835. self.questionDialog.Open()
  836. self.questionDialog.slotIndex = slotIndex
  837.  
  838. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  839.  
  840. elif app.IsPressed(app.DIK_LSHIFT):
  841. if player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GIFTBOX and\
  842. ItemVNum != 31374 and ItemVNum != 50255 and\
  843. ItemVNum != 50187 and ItemVNum != 50197 and\
  844. ItemVNum != 50188 and ItemVNum != 50189 and\
  845. ItemVNum != 50190 and ItemVNum != 50191 and\
  846. ItemVNum != 50192 and ItemVNum != 50193 and\
  847. ItemVNum != 50194 and ItemVNum != 50195:
  848. if app.ENABLE_SHOW_CHEST_DROP:
  849. if self.interface:
  850. if self.interface.dlgChestDrop:
  851. if not self.interface.dlgChestDrop.IsShow():
  852. self.interface.dlgChestDrop.Open(slotIndex)
  853. net.SendChestDropInfo(slotIndex)
  854. #elif player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GACHA or player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GIFTBOX:
  855.  
  856. elif player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GIFTBOX:
  857. if app.ENABLE_SHOW_CHEST_DROP:
  858. if self.interface:
  859. if self.interface.dlgChestDrop:
  860. if not self.interface.dlgChestDrop.IsShow():
  861. self.interface.dlgChestDrop.Open(slotIndex)
  862. net.SendChestDropInfo(slotIndex)
  863. else:
  864. self.__SendUseItemPacket(slotIndex)
  865.  
  866. def __UseItemQuestionDialog_OnCancel(self):
  867. self.OnCloseQuestionDialog()
  868.  
  869. def __UseItemQuestionDialog_OnAccept(self):
  870. self.__SendUseItemPacket(self.questionDialog.slotIndex)
  871. self.OnCloseQuestionDialog()
  872.  
  873. def __SendUseItemPacket(self, slotPos):
  874. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  875. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
  876. return
  877.  
  878. net.SendItemUsePacket(slotPos)
  879.  
  880. def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):
  881. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  882. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP)
  883. return
  884.  
  885. net.SendItemMovePacket(srcSlotPos, dstSlotPos, srcItemCount)
  886.  
  887. class BeltInventoryWindow(ui.ScriptWindow):
  888.  
  889. def __init__(self, wndInventory):
  890. import exception
  891.  
  892. if not app.ENABLE_NEW_EQUIPMENT_SYSTEM:
  893. exception.Abort("What do you do?")
  894. return
  895.  
  896. if not wndInventory:
  897. exception.Abort("wndInventory parameter must be set to InventoryWindow")
  898. return
  899.  
  900. ui.ScriptWindow.__init__(self)
  901.  
  902. self.isLoaded = 0
  903. self.wndInventory = wndInventory;
  904.  
  905. self.wndBeltInventoryLayer = None
  906. self.wndBeltInventorySlot = None
  907. self.expandBtn = None
  908. self.minBtn = None
  909.  
  910. self.__LoadWindow()
  911.  
  912. def __del__(self):
  913. ui.ScriptWindow.__del__(self)
  914.  
  915. def Show(self, openBeltSlot = False):
  916. self.__LoadWindow()
  917. self.RefreshSlot()
  918.  
  919. ui.ScriptWindow.Show(self)
  920.  
  921. if openBeltSlot:
  922. self.OpenInventory()
  923. else:
  924. self.CloseInventory()
  925.  
  926. def Close(self):
  927. self.Hide()
  928.  
  929. def IsOpeningInventory(self):
  930. return self.wndBeltInventoryLayer.IsShow()
  931.  
  932. def OpenInventory(self):
  933. self.wndBeltInventoryLayer.Show()
  934. self.expandBtn.Hide()
  935.  
  936. if localeInfo.IsARABIC() == 0:
  937. self.AdjustPositionAndSize()
  938.  
  939. def CloseInventory(self):
  940. self.wndBeltInventoryLayer.Hide()
  941. self.expandBtn.Show()
  942.  
  943. if localeInfo.IsARABIC() == 0:
  944. self.AdjustPositionAndSize()
  945.  
  946. if app.ENABLE_BIOLOG_SYSTEM:
  947. def GetBasePosition(self):
  948. x, y = self.wndInventory.GetGlobalPosition()
  949. return x - 148, y + 385
  950. else:
  951. def GetBasePosition(self):
  952. x, y = self.wndInventory.GetGlobalPosition()
  953. return x - 148, y + 241
  954.  
  955. def AdjustPositionAndSize(self):
  956. bx, by = self.GetBasePosition()
  957.  
  958. if self.IsOpeningInventory():
  959. self.SetPosition(bx, by)
  960. self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight())
  961.  
  962. else:
  963. self.SetPosition(bx + 138, by);
  964. self.SetSize(10, self.GetHeight())
  965.  
  966. def __LoadWindow(self):
  967. if self.isLoaded == 1:
  968. return
  969.  
  970. self.isLoaded = 1
  971.  
  972. try:
  973. pyScrLoader = ui.PythonScriptLoader()
  974. pyScrLoader.LoadScriptFile(self, "UIScript/BeltInventoryWindow.py")
  975. except:
  976. import exception
  977. exception.Abort("CostumeWindow.LoadWindow.LoadObject")
  978.  
  979. try:
  980. self.ORIGINAL_WIDTH = self.GetWidth()
  981. wndBeltInventorySlot = self.GetChild("BeltInventorySlot")
  982. self.wndBeltInventoryLayer = self.GetChild("BeltInventoryLayer")
  983. self.expandBtn = self.GetChild("ExpandBtn")
  984. self.minBtn = self.GetChild("MinimizeBtn")
  985.  
  986. self.expandBtn.SetEvent(ui.__mem_func__(self.OpenInventory))
  987. self.minBtn.SetEvent(ui.__mem_func__(self.CloseInventory))
  988.  
  989. if localeInfo.IsARABIC() :
  990. self.expandBtn.SetPosition(self.expandBtn.GetWidth() - 2, 15)
  991. self.wndBeltInventoryLayer.SetPosition(self.wndBeltInventoryLayer.GetWidth() - 5, 0)
  992. self.minBtn.SetPosition(self.minBtn.GetWidth() + 3, 15)
  993.  
  994. for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
  995. slotNumber = item.BELT_INVENTORY_SLOT_START + i
  996. wndBeltInventorySlot.SetCoverButton(slotNumber, "d:/ymir work/ui/game/quest/slot_button_01.sub",\
  997. "d:/ymir work/ui/game/quest/slot_button_01.sub",\
  998. "d:/ymir work/ui/game/quest/slot_button_01.sub",\
  999. "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", False, False)
  1000.  
  1001. except:
  1002. import exception
  1003. exception.Abort("CostumeWindow.LoadWindow.BindObject")
  1004.  
  1005. ## Equipment
  1006. wndBeltInventorySlot.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
  1007. wndBeltInventorySlot.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
  1008. wndBeltInventorySlot.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  1009. wndBeltInventorySlot.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  1010. wndBeltInventorySlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
  1011. wndBeltInventorySlot.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
  1012.  
  1013. self.wndBeltInventorySlot = wndBeltInventorySlot
  1014.  
  1015. def RefreshSlot(self):
  1016. getItemVNum=player.GetItemIndex
  1017.  
  1018. for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
  1019. slotNumber = item.BELT_INVENTORY_SLOT_START + i
  1020. self.wndBeltInventorySlot.SetItemSlot(slotNumber, getItemVNum(slotNumber), player.GetItemCount(slotNumber))
  1021. self.wndBeltInventorySlot.SetAlwaysRenderCoverButton(slotNumber, True)
  1022.  
  1023. avail = "0"
  1024.  
  1025. if player.IsAvailableBeltInventoryCell(slotNumber):
  1026. self.wndBeltInventorySlot.EnableCoverButton(slotNumber)
  1027. else:
  1028. self.wndBeltInventorySlot.DisableCoverButton(slotNumber)
  1029.  
  1030. self.wndBeltInventorySlot.RefreshSlot()
  1031.  
  1032. class SideBarInventoryWindow(ui.ScriptWindow):
  1033. def __init__(self, wndInventory):
  1034. import exception
  1035.  
  1036. if not wndInventory:
  1037. exception.Abort("wndInventory parameter must be set to InventoryWindow")
  1038. return
  1039.  
  1040. ui.ScriptWindow.__init__(self)
  1041.  
  1042. self.isLoaded = 0
  1043. self.wndInventory = wndInventory
  1044.  
  1045. self.__LoadWindow()
  1046.  
  1047. def __del__(self):
  1048. ui.ScriptWindow.__del__(self)
  1049.  
  1050. def Show(self):
  1051. self.__LoadWindow()
  1052.  
  1053. ui.ScriptWindow.Show(self)
  1054.  
  1055. def Close(self):
  1056. self.Hide()
  1057.  
  1058. def bind_interface(self, interface):
  1059. self.interface = interface
  1060.  
  1061. def __LoadWindow(self):
  1062. if self.isLoaded == 1:
  1063. return
  1064.  
  1065. self.isLoaded = 1
  1066.  
  1067. try:
  1068. pyScrLoader = ui.PythonScriptLoader()
  1069. pyScrLoader.LoadScriptFile(self, "UIscript/inventory_sidebar.py")
  1070. if app.ENABLE_SWITCHBOT:
  1071. self.wndSwitchbot = self.GetChild2("SwitchBotButton")
  1072. ## ADD YOUR BUTTON
  1073. self.wndSpecialInventory = self.GetChild2("SpecialInventoryButton")
  1074. self.wndSpecialInventory2 = self.GetChild2("SpecialInventoryButton2")
  1075. self.wndSpecialInventory3 = self.GetChild2("SpecialInventoryButton3")
  1076. self.wndSpecialInventory4 = self.GetChild2("SpecialInventoryButton4")
  1077. ## ADD YOUR BUTTON
  1078.  
  1079. except:
  1080. import exception
  1081. exception.Abort("SidebarWindow.LoadWindow.LoadObject")
  1082.  
  1083. self.AdjustPosition()
  1084.  
  1085. if app.ENABLE_SWITCHBOT:
  1086. if self.wndSwitchbot:
  1087. self.wndSwitchbot.SetEvent(ui.__mem_func__(self.ClickSwitchBotButton))
  1088.  
  1089. if self.wndSpecialInventory:
  1090. self.wndSpecialInventory.SetEvent(ui.__mem_func__(self.ClickSpecialInventoryButton))
  1091.  
  1092. if self.wndSpecialInventory2:
  1093. self.wndSpecialInventory2.SetEvent(ui.__mem_func__(self.Clickkaraca425Button))
  1094.  
  1095. if self.wndSpecialInventory3:
  1096. self.wndSpecialInventory3.SetEvent(ui.__mem_func__(self.ClickItemFinder))
  1097.  
  1098. if self.wndSpecialInventory4:
  1099. self.wndSpecialInventory4.SetEvent(ui.__mem_func__(self.ClickInventorySpecial))
  1100.  
  1101. def GetBasePosition(self):
  1102. x, y = self.wndInventory.GetGlobalPosition()
  1103. return x, y
  1104.  
  1105. def AdjustPosition(self):
  1106. bx, by = self.GetBasePosition()
  1107. self.SetPosition(bx - 40, by + 3)
  1108.  
  1109. if app.ENABLE_SWITCHBOT:
  1110. def ClickSwitchBotButton(self):
  1111. self.interface.ToggleSwitchbotWindow()
  1112.  
  1113. ## ADD YOUR BUTTON
  1114. def ClickSpecialInventoryButton(self):
  1115. self.interface.ToggleEkipmanWindowStatusPage()
  1116.  
  1117. def ClickItemFinder(self):
  1118. self.interface.ShowItemFinder()
  1119.  
  1120. def ClickInventorySpecial(self):
  1121. self.interface.ToggleExtendedInventoryWindow()
  1122.  
  1123. # Open shop inventory
  1124. def Clickkaraca425Button(self):
  1125. net.SendChatPacket("/pazar_ac")
  1126.  
  1127. ## ADD YOUR BUTTON
  1128.  
  1129. if app.ENABLE_BIOLOG_SYSTEM:
  1130. class CollectInventoryWindow(ui.ScriptWindow):
  1131. def __init__(self, wndInventory):
  1132. import exception
  1133. if not wndInventory:
  1134. exception.Abort("wndInventory parameter must be set to CollectInventoryWindow")
  1135. return
  1136. ui.ScriptWindow.__init__(self)
  1137. self.isLoaded = 0
  1138. self.updated = 0
  1139. self.wndInventory = wndInventory;
  1140. self.tooltipItem = uiToolTip.ItemToolTip()
  1141. self.tooltipItem.Hide()
  1142. self.wndBeltInventoryLayer = None
  1143. self.wndBeltInventorySlot = None
  1144. self.expandBtn = None
  1145. self.minBtn = None
  1146. self.gameWindow = None
  1147. self.__LoadWindow()
  1148.  
  1149. def __del__(self):
  1150. ui.ScriptWindow.__del__(self)
  1151.  
  1152. def Show(self, openBeltSlot = False):
  1153. self.__LoadWindow()
  1154. ui.ScriptWindow.Show(self)
  1155.  
  1156. if openBeltSlot:
  1157. self.OpenInventory()
  1158. else:
  1159. self.CloseInventory()
  1160.  
  1161. def Close(self):
  1162. self.Hide()
  1163.  
  1164. def IsOpeningInventory(self):
  1165. return self.wndBeltInventoryLayer.IsShow()
  1166.  
  1167. def OpenInventory(self):
  1168. self.wndBeltInventoryLayer.Show()
  1169. self.expandBtn.Hide()
  1170.  
  1171. self.AdjustPositionAndSize()
  1172.  
  1173. def CloseInventory(self):
  1174. self.wndBeltInventoryLayer.Hide()
  1175. self.expandBtn.Show()
  1176.  
  1177. self.AdjustPositionAndSize()
  1178.  
  1179. def GetBasePosition(self):
  1180. x, y = self.wndInventory.GetGlobalPosition()
  1181. return x - 148, y + 260
  1182.  
  1183. def AdjustPositionAndSize(self):
  1184. bx, by = self.GetBasePosition()
  1185.  
  1186. if self.IsOpeningInventory():
  1187. self.SetPosition(bx, by)
  1188. self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight())
  1189. else:
  1190. self.SetPosition(bx + 138, by);
  1191. self.SetSize(10, self.GetHeight())
  1192.  
  1193. def __LoadWindow(self):
  1194. if self.isLoaded == 1:
  1195. return
  1196.  
  1197. self.isLoaded = 1
  1198.  
  1199. try:
  1200. pyScrLoader = ui.PythonScriptLoader()
  1201. pyScrLoader.LoadScriptFile(self, "UIScript/biolog_collectinventorywindow.py")
  1202. except:
  1203. import exception
  1204. exception.Abort("CollectInventoryWindow.LoadWindow.LoadObject")
  1205.  
  1206. try:
  1207. self.ORIGINAL_WIDTH = self.GetWidth()
  1208. self.wndBeltInventoryLayer = self.GetChild("BeltInventoryLayer")
  1209. self.wndItem = self.GetChild("BeltInventorySlot")
  1210. self.time_value = self.GetChild("time_value")
  1211. self.biolog_count = self.GetChild("count_value")
  1212. self.expandBtn = self.GetChild("ExpandBtn")
  1213. self.minBtn = self.GetChild("MinimizeBtn")
  1214. self.sendBtn = self.GetChild("send_biolog")
  1215. self.expandBtn.SetEvent(ui.__mem_func__(self.OpenInventory))
  1216. self.minBtn.SetEvent(ui.__mem_func__(self.CloseInventory))
  1217. self.wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  1218. self.wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  1219. except:
  1220. import exception
  1221. exception.Abort("CollectInventoryWindow.LoadWindow.BindObject")
  1222.  
  1223. if self.sendBtn:
  1224. self.sendBtn.SetEvent(ui.__mem_func__(self.AcceptBiolog))
  1225.  
  1226. def SetItem(self, arg1, arg2, arg3):
  1227. self.wndItem.SetItemSlot(0, int(uiprofessionalbiolog.BIOLOG_BINARY_LOADED["vnum"][0]), 0)
  1228.  
  1229. def AcceptBiolog(self):
  1230. net.SendChatPacket("/biolog")
  1231.  
  1232. def SetTime(self, time):
  1233. time_collect = time - app.GetGlobalTimeStamp()
  1234.  
  1235. if time_collect < 0:
  1236. time_collect = 0
  1237.  
  1238. if time_collect == 1:
  1239. self.wndLeftTime = uiprofessionalbiolog.Biolog_TimeExpired()
  1240. self.wndLeftTime.OpenWindow()
  1241. self.wndLeftTime.Show()
  1242.  
  1243. self.time_value.SetText(localeInfo.FormatTime(time_collect))
  1244.  
  1245. def OnUpdate(self):
  1246. self.SetTime(int(uiprofessionalbiolog.BIOLOG_BINARY_LOADED["time"][0]))
  1247. self.SetItem(0, uiprofessionalbiolog.BIOLOG_BINARY_LOADED["vnum"][0], 0)
  1248. self.biolog_count.SetText(uiprofessionalbiolog.BIOLOG_BINARY_LOADED['countActual'][0] + "/" + uiprofessionalbiolog.BIOLOG_BINARY_LOADED['countNeed'][0])
  1249.  
  1250. def OverInItem(self):
  1251. if uiprofessionalbiolog.BIOLOG_BINARY_LOADED["vnum"][0]:
  1252. self.tooltipItem.SetItemToolTip(uiprofessionalbiolog.BIOLOG_BINARY_LOADED["vnum"][0])
  1253.  
  1254. def OverOutItem(self):
  1255. if self.tooltipItem:
  1256. self.tooltipItem.HideToolTip()
  1257.  
  1258. class InventoryWindow(ui.ScriptWindow):
  1259.  
  1260. 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", "USE_CHANGE_COSTUME_ATTR", "USE_RESET_COSTUME_ATTR")
  1261.  
  1262. questionDialog = None
  1263. tooltipItem = None
  1264. wndCostume = None
  1265. wndSideBar = None
  1266. if app.ENABLE_BIOLOG_SYSTEM:
  1267. wndCollect = None
  1268. wndBelt = None
  1269. dlgPickMoney = None
  1270. dlgPickItem = None
  1271.  
  1272. sellingSlotNumber = -1
  1273. isLoaded = 0
  1274. if app.ENABLE_BIOLOG_SYSTEM:
  1275. isOpenedCollectWindowWhenClosingInventory = 0
  1276. isOpenedCostumeWindowWhenClosingInventory = 0 # 인벤토리 닫을 때 코스츔이 열려있었는지 여부-_-; 네이밍 ㅈㅅ
  1277. isOpenedBeltWindowWhenClosingInventory = 0 # 인벤토리 닫을 때 벨트 인벤토리가 열려있었는지 여부-_-; 네이밍 ㅈㅅ
  1278.  
  1279. if app.ENABLE_HIDE_COSTUME_SYSTEM:
  1280. def RefreshVisibleCostume(self):
  1281. if self.wndCostume:
  1282. self.wndCostume.RefreshVisibleCostume()
  1283. else:
  1284. self.wndCostume = CostumeWindow(self)
  1285. self.wndCostume.RefreshVisibleCostume()
  1286.  
  1287. if app.ENABLE_HIGHLIGHT_NEW_ITEM:
  1288. liHighlightedItems = []
  1289.  
  1290.  
  1291. def __init__(self):
  1292. ui.ScriptWindow.__init__(self)
  1293.  
  1294. self.isOpenedBeltWindowWhenClosingInventory = 0 # 인벤토리 닫을 때 벨트 인벤토리가 열려있었는지 여부-_-; 네이밍 ㅈㅅ
  1295.  
  1296. self.inventoryPageIndex = 0
  1297.  
  1298. self.__LoadWindow()
  1299.  
  1300. def __del__(self):
  1301. ui.ScriptWindow.__del__(self)
  1302.  
  1303. def Show(self):
  1304. self.__LoadWindow()
  1305.  
  1306. ui.ScriptWindow.Show(self)
  1307.  
  1308. if app.ENABLE_BIOLOG_SYSTEM:
  1309. if self.wndCollect:
  1310. self.wndCollect.Show(self.isOpenedCollectWindowWhenClosingInventory)
  1311.  
  1312. # 인벤토리를 닫을 때 코스츔이 열려있었다면 인벤토리를 열 때 코스츔도 같이 열도록 함.
  1313. if self.isOpenedCostumeWindowWhenClosingInventory and self.wndCostume:
  1314. self.wndCostume.Show()
  1315.  
  1316. # 인벤토리를 닫을 때 벨트 인벤토리가 열려있었다면 같이 열도록 함.
  1317. if self.wndBelt:
  1318. self.wndBelt.Show(self.isOpenedBeltWindowWhenClosingInventory)
  1319. if self.wndSideBar:
  1320. self.wndSideBar.Show()
  1321.  
  1322. def BindInterfaceClass(self, interface):
  1323. self.interface = interface
  1324. self.wndSideBar.bind_interface(interface)
  1325.  
  1326. def __LoadWindow(self):
  1327. if self.isLoaded == 1:
  1328. return
  1329.  
  1330. self.isLoaded = 1
  1331.  
  1332. try:
  1333. pyScrLoader = ui.PythonScriptLoader()
  1334.  
  1335. if app.ENABLE_EXTEND_INVEN_SYSTEM:
  1336. pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindowEx.py")
  1337. else:
  1338. if ITEM_MALL_BUTTON_ENABLE:
  1339. pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "InventoryWindow.py")
  1340. else:
  1341. pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindow.py")
  1342. except:
  1343. import exception
  1344. exception.Abort("InventoryWindow.LoadWindow.LoadObject")
  1345.  
  1346. try:
  1347. wndItem = self.GetChild("ItemSlot")
  1348. wndEquip = self.GetChild("EquipmentSlot")
  1349. self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
  1350. self.wndMoney = self.GetChild("Money")
  1351. self.wndMoneySlot = self.GetChild("Money_Slot")
  1352.  
  1353. if app.ENABLE_CHEQUE_SYSTEM:
  1354. self.wndCheque = self.GetChild("Cheque")
  1355. self.wndChequeSlot = self.GetChild("Cheque_Slot")
  1356.  
  1357. self.mallButton = self.GetChild2("MallButton")
  1358. self.DSSButton = self.GetChild2("DSSButton")
  1359. self.costumeButton = self.GetChild2("CostumeButton")
  1360.  
  1361. self.inventoryTab = []
  1362. for i in xrange(player.INVENTORY_PAGE_COUNT):
  1363. self.inventoryTab.append(self.GetChild("Inventory_Tab_%02d" % (i+1)))
  1364.  
  1365. self.equipmentTab = []
  1366. self.equipmentTab.append(self.GetChild("Equipment_Tab_01"))
  1367. self.equipmentTab.append(self.GetChild("Equipment_Tab_02"))
  1368.  
  1369. if self.costumeButton and not app.ENABLE_COSTUME_SYSTEM:
  1370. self.costumeButton.Hide()
  1371. self.costumeButton.Destroy()
  1372. self.costumeButton = 0
  1373.  
  1374. # Belt Inventory Window
  1375. self.wndBelt = None
  1376.  
  1377. if app.ENABLE_BIOLOG_SYSTEM:
  1378. self.wndCollect = None
  1379. self.wndCollect = CollectInventoryWindow(self)
  1380.  
  1381. if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
  1382. self.wndBelt = BeltInventoryWindow(self)
  1383. self.wndSideBar = SideBarInventoryWindow(self)
  1384.  
  1385.  
  1386. except:
  1387. import exception
  1388. exception.Abort("InventoryWindow.LoadWindow.BindObject")
  1389.  
  1390. ## Item
  1391. wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
  1392. wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
  1393. wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
  1394. wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
  1395. wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  1396. wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  1397.  
  1398. ## Equipment
  1399. wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
  1400. wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
  1401. wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
  1402. wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
  1403. wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  1404. wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  1405.  
  1406. ## PickMoneyDialog
  1407. dlgPickMoney = uiPickMoney.PickMoneyDialog()
  1408. dlgPickMoney.LoadDialog()
  1409. dlgPickMoney.Hide()
  1410.  
  1411. #pick item
  1412. self.dlgPickItem = uipicketc.PickEtcDialog()
  1413. self.dlgPickItem.LoadDialog()
  1414. self.dlgPickItem.Hide()
  1415.  
  1416. ## RefineDialog
  1417. self.refineDialog = uiRefine.RefineDialog()
  1418. self.refineDialog.Hide()
  1419.  
  1420. ## AttachMetinDialog
  1421. self.attachMetinDialog = uiAttachMetin.AttachMetinDialog()
  1422. self.attachMetinDialog.Hide()
  1423.  
  1424. ## MoneySlot
  1425. self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))
  1426. if app.ENABLE_CHEQUE_SYSTEM:
  1427. ## WonSlot
  1428. self.wndChequeSlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))
  1429.  
  1430. for i in xrange(player.INVENTORY_PAGE_COUNT):
  1431. self.inventoryTab[i].SetEvent(lambda arg=i: self.SetInventoryPage(arg))
  1432. self.inventoryTab[0].Down()
  1433.  
  1434. self.equipmentTab[0].SetEvent(lambda arg=0: self.SetEquipmentPage(arg))
  1435. self.equipmentTab[1].SetEvent(lambda arg=1: self.SetEquipmentPage(arg))
  1436. self.equipmentTab[0].Down()
  1437. self.equipmentTab[0].Hide()
  1438. self.equipmentTab[1].Hide()
  1439.  
  1440. self.wndItem = wndItem
  1441. self.wndEquip = wndEquip
  1442. self.dlgPickMoney = dlgPickMoney
  1443.  
  1444. # MallButton
  1445. if self.mallButton:
  1446. self.mallButton.SetEvent(ui.__mem_func__(self.ClickMallButton))
  1447.  
  1448. if self.DSSButton:
  1449. self.DSSButton.SetEvent(ui.__mem_func__(self.ClickDSSButton))
  1450.  
  1451. # Costume Button
  1452. if self.costumeButton:
  1453. self.costumeButton.SetEvent(ui.__mem_func__(self.ClickCostumeButton))
  1454.  
  1455. self.wndCostume = None
  1456.  
  1457. #####
  1458.  
  1459. if app.ENABLE_ACCE_SYSTEM:
  1460. self.listAttachedAcces = []
  1461.  
  1462. ## Refresh
  1463. self.SetInventoryPage(0)
  1464. self.SetEquipmentPage(0)
  1465. self.RefreshItemSlot()
  1466. self.RefreshStatus()
  1467.  
  1468. def Destroy(self):
  1469. self.ClearDictionary()
  1470.  
  1471. self.dlgPickMoney.Destroy()
  1472. self.dlgPickMoney = 0
  1473.  
  1474. self.refineDialog.Destroy()
  1475. self.refineDialog = 0
  1476.  
  1477. self.attachMetinDialog.Destroy()
  1478. self.attachMetinDialog = 0
  1479.  
  1480. self.tooltipItem = None
  1481. self.wndItem = 0
  1482. self.wndEquip = 0
  1483. self.dlgPickMoney = 0
  1484. self.wndMoney = 0
  1485. self.wndMoneySlot = 0
  1486. if app.ENABLE_CHEQUE_SYSTEM:
  1487. self.wndCheque = 0
  1488. self.wndChequeSlot = 0
  1489. self.questionDialog = None
  1490. self.mallButton = None
  1491. self.DSSButton = None
  1492. self.interface = None
  1493.  
  1494. if self.wndCostume:
  1495. self.wndCostume.Destroy()
  1496. self.wndCostume = 0
  1497.  
  1498. if app.ENABLE_BIOLOG_SYSTEM:
  1499. if self.wndCollect:
  1500. self.wndCollect.Destroy()
  1501. self.wndCollect = None
  1502.  
  1503. if self.wndBelt:
  1504. self.wndBelt.Destroy()
  1505. self.wndBelt = None
  1506. if self.wndSideBar:
  1507. self.wndSideBar.Destroy()
  1508. self.wndSideBar = None
  1509.  
  1510. self.inventoryTab = []
  1511. self.equipmentTab = []
  1512.  
  1513. def Hide(self):
  1514. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
  1515. self.OnCloseQuestionDialog()
  1516. return
  1517. if None != self.tooltipItem:
  1518. self.tooltipItem.HideToolTip()
  1519.  
  1520. if app.ENABLE_BIOLOG_SYSTEM:
  1521. if self.wndCollect:
  1522. self.isOpenedCollectWindowWhenClosingInventory = self.wndCollect.IsOpeningInventory()
  1523. print "Is opening Biolog Inventory", self.isOpenedCollectWindowWhenClosingInventory
  1524. self.wndCollect.Close()
  1525.  
  1526. if self.wndCostume:
  1527. self.isOpenedCostumeWindowWhenClosingInventory = self.wndCostume.IsShow() # 인벤토리 창이 닫힐 때 코스츔이 열려 있었는가?
  1528. self.wndCostume.Close()
  1529.  
  1530. if self.wndBelt:
  1531. self.isOpenedBeltWindowWhenClosingInventory = self.wndBelt.IsOpeningInventory() # 인벤토리 창이 닫힐 때 벨트 인벤토리도 열려 있었는가?
  1532. print "Is Opening Belt Inven?? ", self.isOpenedBeltWindowWhenClosingInventory
  1533. self.wndBelt.Close()
  1534.  
  1535. if self.wndSideBar:
  1536. self.wndSideBar.Close()
  1537.  
  1538. if self.dlgPickMoney:
  1539. self.dlgPickMoney.Close()
  1540.  
  1541. wndMgr.Hide(self.hWnd)
  1542.  
  1543.  
  1544. def Close(self):
  1545. self.Hide()
  1546.  
  1547. def SetInventoryPage(self, page):
  1548. self.inventoryPageIndex = page
  1549. for i in xrange(player.INVENTORY_PAGE_COUNT):
  1550. if i!=page:
  1551. self.inventoryTab[i].SetUp()
  1552. self.RefreshBagSlotWindow()
  1553.  
  1554. def SetEquipmentPage(self, page):
  1555. self.equipmentPageIndex = page
  1556. self.equipmentTab[1-page].SetUp()
  1557. self.RefreshEquipSlotWindow()
  1558.  
  1559. def ClickMallButton(self):
  1560. print "click_mall_button"
  1561. net.SendChatPacket("/click_mall")
  1562.  
  1563. # DSSButton
  1564. def ClickDSSButton(self):
  1565. print "click_dss_button"
  1566. self.interface.ToggleDragonSoulWindow()
  1567.  
  1568. def ClickCostumeButton(self):
  1569. print "Click Costume Button"
  1570. if self.wndCostume:
  1571. if self.wndCostume.IsShow():
  1572. self.wndCostume.Hide()
  1573. else:
  1574. self.wndCostume.Show()
  1575. else:
  1576. self.wndCostume = CostumeWindow(self)
  1577. self.wndCostume.Show()
  1578.  
  1579. def OpenPickMoneyDialog(self):
  1580. if mouseModule.mouseController.isAttached():
  1581.  
  1582. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1583. if player.SLOT_TYPE_SAFEBOX == mouseModule.mouseController.GetAttachedType():
  1584.  
  1585. if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
  1586. net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
  1587. snd.PlaySound("sound/ui/money.wav")
  1588.  
  1589. elif app.ENABLE_CHEQUE_SYSTEM and player.ITEM_CHEQUE == mouseModule.mouseController.GetAttachedItemIndex():
  1590. snd.PlaySound("sound/ui/money.wav")
  1591.  
  1592. mouseModule.mouseController.DeattachObject()
  1593.  
  1594. else:
  1595. curMoney = player.GetElk()
  1596. if app.ENABLE_CHEQUE_SYSTEM:
  1597. curCheque = player.GetWon()
  1598.  
  1599. if curMoney <= 0:
  1600. return
  1601.  
  1602. self.dlgPickMoney.SetTitleName(localeInfo.PICK_MONEY_TITLE)
  1603. self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
  1604.  
  1605. if app.ENABLE_CHEQUE_SYSTEM:
  1606. self.dlgPickMoney.Open(curMoney, curCheque)
  1607.  
  1608. else:
  1609. self.dlgPickMoney.Open(curMoney)
  1610. self.dlgPickMoney.SetMax(9) # 인벤토리 990000 제한 버그 수정
  1611.  
  1612. if app.ENABLE_CHEQUE_SYSTEM:
  1613. def OnPickMoney(self, money, cheque):
  1614. if money > 0 and cheque <= 0:
  1615. mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_INVENTORY, money)
  1616. elif cheque > 0 and money <= 0:
  1617. mouseModule.mouseController.AttachCheque(self, player.SLOT_TYPE_INVENTORY, cheque)
  1618. else:
  1619. chat.AppendChat(chat.CHAT_TYPE_INFO, "Info: N? ?permitido descartar duas moedas juntas.")
  1620.  
  1621. else:
  1622. def OnPickMoney(self, money):
  1623. mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_INVENTORY, money)
  1624.  
  1625. def OnPickItem(self, count):
  1626. itemSlotIndex = self.dlgPickMoney.itemGlobalSlotIndex
  1627. selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  1628. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, count)
  1629.  
  1630. def __InventoryLocalSlotPosToGlobalSlotPos(self, local):
  1631. if player.IsEquipmentSlot(local) or player.IsCostumeSlot(local) or (app.ENABLE_NEW_EQUIPMENT_SYSTEM and player.IsBeltInventorySlot(local)):
  1632. return local
  1633.  
  1634. return self.inventoryPageIndex*player.INVENTORY_PAGE_SIZE + local
  1635.  
  1636. def RefreshBagSlotWindow(self):
  1637. getItemVNum=player.GetItemIndex
  1638. getItemCount=player.GetItemCount
  1639. setItemVNum=self.wndItem.SetItemSlot
  1640.  
  1641. for i in xrange(player.INVENTORY_PAGE_SIZE):
  1642. slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
  1643.  
  1644. itemCount = getItemCount(slotNumber)
  1645. # itemCount == 0이면 소켓을 비운다.
  1646. if 0 == itemCount:
  1647. self.wndItem.ClearSlot(i)
  1648. continue
  1649. elif 1 == itemCount:
  1650. itemCount = 0
  1651.  
  1652. itemVnum = getItemVNum(slotNumber)
  1653. setItemVNum(i, itemVnum, itemCount)
  1654.  
  1655. ## 자동물약 (HP: #72723 ~ #72726, SP: #72727 ~ #72730) 특수처리 - 아이템인데도 슬롯에 활성화/비활성화 표시를 위한 작업임 - [hyo]
  1656. if constInfo.IS_AUTO_POTION(itemVnum):
  1657. # metinSocket - [0] : 활성화 여부, [1] : 사용한 양, [2] : 최대 용량
  1658. metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
  1659.  
  1660. isActivated = 0 != metinSocket[0]
  1661.  
  1662. if isActivated:
  1663. self.wndItem.ActivateSlot(i)
  1664. potionType = 0;
  1665. if constInfo.IS_AUTO_POTION_HP(itemVnum):
  1666. potionType = player.AUTO_POTION_TYPE_HP
  1667. elif constInfo.IS_AUTO_POTION_SP(itemVnum):
  1668. potionType = player.AUTO_POTION_TYPE_SP
  1669.  
  1670. usedAmount = int(metinSocket[1])
  1671. totalAmount = int(metinSocket[2])
  1672. player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))
  1673.  
  1674. else:
  1675. self.wndItem.DeactivateSlot(i)
  1676.  
  1677. if app.ENABLE_ACCE_SYSTEM:
  1678. slotNumberChecked = 0
  1679. if not constInfo.IS_AUTO_POTION(itemVnum):
  1680. if app.ENABLE_HIGHLIGHT_NEW_ITEM:
  1681. if not slotNumber in self.liHighlightedItems:
  1682. self.wndItem.DeactivateSlot(i)
  1683. else:
  1684. self.wndItem.DeactivateSlot(i)
  1685.  
  1686. for j in xrange(acce.WINDOW_MAX_MATERIALS):
  1687. (isHere, iCell) = acce.GetAttachedItem(j)
  1688. if isHere:
  1689. if iCell == slotNumber:
  1690. self.wndItem.ActivateSlot(i, (36.00 / 255.0), (222.00 / 255.0), (3.00 / 255.0), 1.0)
  1691. if not slotNumber in self.listAttachedAcces:
  1692. self.listAttachedAcces.append(slotNumber)
  1693.  
  1694. slotNumberChecked = 1
  1695. else:
  1696. if slotNumber in self.listAttachedAcces and not slotNumberChecked:
  1697. self.wndItem.DeactivateSlot(i)
  1698. self.listAttachedAcces.remove(slotNumber)
  1699.  
  1700. elif app.ENABLE_HIGHLIGHT_NEW_ITEM and not constInfo.IS_AUTO_POTION(itemVnum):
  1701. if not slotNumber in self.liHighlightedItems:
  1702. self.wndItem.DeactivateSlot(i)
  1703.  
  1704. self.wndItem.RefreshSlot()
  1705. if app.ENABLE_HIGHLIGHT_NEW_ITEM:
  1706. self.__RefreshHighlights()
  1707.  
  1708. if self.wndBelt:
  1709. self.wndBelt.RefreshSlot()
  1710.  
  1711.  
  1712.  
  1713.  
  1714. if app.ENABLE_HIGHLIGHT_NEW_ITEM:
  1715. def HighlightSlot(self, slot):
  1716. if not slot in self.liHighlightedItems:
  1717. self.liHighlightedItems.append(slot)
  1718.  
  1719. def __RefreshHighlights(self):
  1720. for i in xrange(player.INVENTORY_PAGE_SIZE):
  1721. slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
  1722. if slotNumber in self.liHighlightedItems:
  1723. self.wndItem.ActivateSlot(i)
  1724.  
  1725.  
  1726.  
  1727.  
  1728. def RefreshEquipSlotWindow(self):
  1729. getItemVNum=player.GetItemIndex
  1730. getItemCount=player.GetItemCount
  1731. setItemVNum=self.wndEquip.SetItemSlot
  1732. for i in xrange(player.EQUIPMENT_PAGE_COUNT):
  1733. slotNumber = player.EQUIPMENT_SLOT_START + i
  1734. itemCount = getItemCount(slotNumber)
  1735. if itemCount <= 1:
  1736. itemCount = 0
  1737. setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount)
  1738.  
  1739. if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
  1740. for i in xrange(player.NEW_EQUIPMENT_SLOT_COUNT):
  1741. slotNumber = player.NEW_EQUIPMENT_SLOT_START + i
  1742. itemCount = getItemCount(slotNumber)
  1743. if itemCount <= 1:
  1744. itemCount = 0
  1745. setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount)
  1746. print "ENABLE_NEW_EQUIPMENT_SYSTEM", slotNumber, itemCount, getItemVNum(slotNumber)
  1747.  
  1748.  
  1749.  
  1750. self.wndEquip.RefreshSlot()
  1751.  
  1752. if self.wndCostume:
  1753. self.wndCostume.RefreshCostumeSlot()
  1754.  
  1755. def RefreshItemSlot(self):
  1756. self.RefreshBagSlotWindow()
  1757. self.RefreshEquipSlotWindow()
  1758.  
  1759. def RefreshStatus(self):
  1760. money = player.GetElk()
  1761. self.wndMoney.SetText(localeInfo.NumberToMoneyString(money))
  1762.  
  1763. if app.ENABLE_CHEQUE_SYSTEM:
  1764. cheque = player.GetWon()
  1765. self.wndCheque.SetText(str(cheque))
  1766.  
  1767. def SetItemToolTip(self, tooltipItem):
  1768. self.tooltipItem = tooltipItem
  1769.  
  1770. def SellItem(self):
  1771. if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
  1772. if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
  1773. ## 용혼석도 팔리게 하는 기능 추가하면서 인자 type 추가
  1774. net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY)
  1775. snd.PlaySound("sound/ui/money.wav")
  1776. self.OnCloseQuestionDialog()
  1777.  
  1778. if app.ENABLE_QUICK_SELL:
  1779. def QuickSellItem(self, itemSlotIndex):
  1780. itemIndex = player.GetItemIndex(itemSlotIndex)
  1781. itemCount = player.GetItemCount(itemSlotIndex)
  1782. if itemIndex == player.GetItemIndex(itemSlotIndex):
  1783. if itemCount == player.GetItemCount(itemSlotIndex):
  1784. net.SendShopSellPacketNew(itemSlotIndex, itemCount, player.INVENTORY)
  1785. snd.PlaySound("sound/ui/money.wav")
  1786.  
  1787. def OnDetachMetinFromItem(self):
  1788. if None == self.questionDialog:
  1789. return
  1790.  
  1791. #net.SendItemUseToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos)
  1792. self.__SendUseItemToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos)
  1793. self.OnCloseQuestionDialog()
  1794.  
  1795. def OnCloseQuestionDialog(self):
  1796. if not self.questionDialog:
  1797. return
  1798.  
  1799. self.questionDialog.Close()
  1800. self.questionDialog = None
  1801. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1802.  
  1803. ## Slot Event
  1804. def SelectEmptySlot(self, selectedSlotPos):
  1805. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
  1806. return
  1807.  
  1808. #BONUS SWITCHER
  1809. if constInfo.IS_BONUS_CHANGER == TRUE:
  1810. return
  1811. #END OF BONUS SWITCHER
  1812.  
  1813. selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos)
  1814.  
  1815. if mouseModule.mouseController.isAttached():
  1816.  
  1817. attachedSlotType = mouseModule.mouseController.GetAttachedType()
  1818. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1819. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  1820. attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  1821.  
  1822. if player.SLOT_TYPE_INVENTORY == attachedSlotType or\
  1823. player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType or\
  1824. player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType or\
  1825. player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType or\
  1826. player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType or\
  1827. player.SLOT_TYPE_BOX_INVENTORY == attachedSlotType or\
  1828. player.SLOT_TYPE_EFSUN_INVENTORY == attachedSlotType or\
  1829. player.SLOT_TYPE_CICEK_INVENTORY == attachedSlotType:
  1830. itemCount = player.GetItemCount(attachedSlotPos)
  1831. attachedCount = mouseModule.mouseController.GetAttachedItemCount()
  1832. self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
  1833. #@fixme011 BEGIN (block ds equip)
  1834. attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
  1835. if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos):
  1836. mouseModule.mouseController.DeattachObject()
  1837. return
  1838. #@fixme011 END
  1839.  
  1840. itemCount = player.GetItemCount(attachedSlotPos)
  1841. attachedCount = mouseModule.mouseController.GetAttachedItemCount()
  1842. self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
  1843.  
  1844. if item.IsRefineScroll(attachedItemIndex):
  1845. self.wndItem.SetUseMode(False)
  1846.  
  1847. elif app.ENABLE_SWITCHBOT and player.SLOT_TYPE_SWITCHBOT == attachedSlotType:
  1848. attachedCount = mouseModule.mouseController.GetAttachedItemCount()
  1849. net.SendItemMovePacket(player.SWITCHBOT, attachedSlotPos, player.INVENTORY, selectedSlotPos, attachedCount)
  1850.  
  1851. elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType:
  1852. mouseModule.mouseController.RunCallBack("INVENTORY")
  1853.  
  1854. elif player.SLOT_TYPE_SHOP == attachedSlotType:
  1855. net.SendShopBuyPacket(attachedSlotPos)
  1856.  
  1857. elif player.SLOT_TYPE_SAFEBOX == attachedSlotType:
  1858.  
  1859. if player.ITEM_MONEY == attachedItemIndex:
  1860. net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
  1861. snd.PlaySound("sound/ui/money.wav")
  1862.  
  1863. elif app.ENABLE_CHEQUE_SYSTEM and player.ITEM_CHEQUE == attachedItemIndex:
  1864. snd.PlaySound("sound/ui/money.wav")
  1865.  
  1866. else:
  1867. net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos)
  1868.  
  1869. elif player.SLOT_TYPE_MALL == attachedSlotType:
  1870. net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos)
  1871.  
  1872. mouseModule.mouseController.DeattachObject()
  1873.  
  1874. #BONUS SWITCHER
  1875. def IsChanger(self, itemVnum):
  1876. changerList = [71084] #Vnum bonus changer.
  1877. if itemVnum in changerList:
  1878. return TRUE
  1879.  
  1880. return FALSE
  1881. #END OF BONUS SWITCHER
  1882.  
  1883. def SelectItemSlot(self, itemSlotIndex):
  1884. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
  1885. return
  1886.  
  1887. #BONUS SWITCHER
  1888. if constInfo.IS_BONUS_CHANGER == TRUE:
  1889. return
  1890. #END OF BONUS SWITCHER
  1891.  
  1892. itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex)
  1893.  
  1894. if mouseModule.mouseController.isAttached():
  1895. attachedSlotType = mouseModule.mouseController.GetAttachedType()
  1896. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1897. attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
  1898. if player.SLOT_TYPE_INVENTORY == attachedSlotType or\
  1899. player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType or\
  1900. player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType or\
  1901. player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType or\
  1902. player.SLOT_TYPE_BOX_INVENTORY == attachedSlotType or\
  1903. player.SLOT_TYPE_EFSUN_INVENTORY == attachedSlotType or\
  1904. player.SLOT_TYPE_CICEK_INVENTORY == attachedSlotType:
  1905. #@fixme011 BEGIN (block ds equip)
  1906. attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
  1907. if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos):
  1908. mouseModule.mouseController.DeattachObject()
  1909. return
  1910. #@fixme011 END
  1911.  
  1912. #BONUS SWITCHER
  1913. if self.IsChanger(attachedItemVID) and not player.IsEquipmentSlot(itemSlotIndex):
  1914. itemVnum = player.GetItemIndex(itemSlotIndex)
  1915. item.SelectItem(itemVnum)
  1916. if item.GetItemType() == item.ITEM_TYPE_WEAPON or item.GetItemType() == item.ITEM_TYPE_ARMOR:
  1917. self.interface.AddToBonusChange(itemSlotIndex, attachedSlotPos)
  1918. mouseModule.mouseController.DeattachObject()
  1919. return
  1920. #END OF BONUS SWITCHER
  1921.  
  1922. self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex)
  1923.  
  1924. mouseModule.mouseController.DeattachObject()
  1925.  
  1926. else:
  1927.  
  1928. curCursorNum = app.GetCursor()
  1929. if app.SELL == curCursorNum:
  1930. self.__SellItem(itemSlotIndex)
  1931.  
  1932. elif app.BUY == curCursorNum:
  1933. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)
  1934.  
  1935. elif app.IsPressed(app.DIK_LALT):
  1936. link = player.GetItemLink(itemSlotIndex)
  1937. ime.PasteString(link)
  1938.  
  1939. elif app.IsPressed(app.DIK_LSHIFT):
  1940. itemCount = player.GetItemCount(itemSlotIndex)
  1941.  
  1942. if itemCount > 1:
  1943. self.dlgPickMoney.SetTitleName(localeInfo.PICK_ITEM_TITLE)
  1944. self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
  1945. self.dlgPickMoney.Open(itemCount)
  1946. self.dlgPickMoney.itemGlobalSlotIndex = itemSlotIndex
  1947. #else:
  1948. #selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  1949. #mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum)
  1950.  
  1951. elif app.IsPressed(app.DIK_LCONTROL):
  1952. itemIndex = player.GetItemIndex(itemSlotIndex)
  1953.  
  1954. if True == item.CanAddToQuickSlotItem(itemIndex):
  1955. player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
  1956. else:
  1957. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM)
  1958.  
  1959. else:
  1960. selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  1961. itemCount = player.GetItemCount(itemSlotIndex)
  1962. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  1963.  
  1964. if self.__IsUsableItemToItem(selectedItemVNum, itemSlotIndex):
  1965. self.wndItem.SetUseMode(True)
  1966. else:
  1967. self.wndItem.SetUseMode(False)
  1968.  
  1969. snd.PlaySound("sound/ui/pick.wav")
  1970.  
  1971. def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos):
  1972. if srcItemSlotPos == dstItemSlotPos:
  1973. return
  1974.  
  1975. # cyh itemseal 2013 11 08
  1976. if app.ENABLE_SOULBIND_SYSTEM and item.IsSealScroll(srcItemVID):
  1977. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1978.  
  1979. elif item.IsRefineScroll(srcItemVID):
  1980. self.RefineItem(srcItemSlotPos, dstItemSlotPos)
  1981. self.wndItem.SetUseMode(False)
  1982.  
  1983. elif item.IsMetin(srcItemVID):
  1984. self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)
  1985.  
  1986. elif item.IsDetachScroll(srcItemVID):
  1987. self.DetachMetinFromItem(srcItemSlotPos, dstItemSlotPos)
  1988.  
  1989. elif item.IsKey(srcItemVID):
  1990. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1991.  
  1992. elif (player.GetItemFlags(srcItemSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
  1993. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1994.  
  1995. elif item.GetUseType(srcItemVID) in self.USE_TYPE_TUPLE:
  1996. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1997.  
  1998. else:
  1999. #snd.PlaySound("sound/ui/drop.wav")
  2000.  
  2001. ## 이동시킨 곳이 장착 슬롯일 경우 아이템을 사용해서 장착 시킨다 - [levites]
  2002. if player.IsEquipmentSlot(dstItemSlotPos):
  2003.  
  2004. ## 들고 있는 아이템이 장비일때만
  2005. if item.IsEquipmentVID(srcItemVID):
  2006. self.__UseItem(srcItemSlotPos)
  2007.  
  2008. else:
  2009. self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0)
  2010. #net.SendItemMovePacket(srcItemSlotPos, dstItemSlotPos, 0)
  2011.  
  2012. def __SellItem(self, itemSlotPos):
  2013. if not player.IsEquipmentSlot(itemSlotPos):
  2014. self.sellingSlotNumber = itemSlotPos
  2015. itemIndex = player.GetItemIndex(itemSlotPos)
  2016. itemCount = player.GetItemCount(itemSlotPos)
  2017.  
  2018.  
  2019. self.sellingSlotitemIndex = itemIndex
  2020. self.sellingSlotitemCount = itemCount
  2021.  
  2022. item.SelectItem(itemIndex)
  2023. ## 안티 플레그 검사 빠져서 추가
  2024. ## 20140220
  2025. if item.IsAntiFlag(item.ANTIFLAG_SELL):
  2026. popup = uiCommon.PopupDialog()
  2027. popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
  2028. popup.SetAcceptEvent(self.__OnClosePopupDialog)
  2029. popup.Open()
  2030. self.popup = popup
  2031. return
  2032.  
  2033. itemPrice = item.GetISellItemPrice()
  2034.  
  2035. if item.Is1GoldItem():
  2036. itemPrice = itemCount / itemPrice / 5
  2037. else:
  2038. itemPrice = itemPrice * itemCount / 5
  2039.  
  2040. item.GetItemName(itemIndex)
  2041. itemName = item.GetItemName()
  2042.  
  2043. self.questionDialog = uiCommon.QuestionDialog()
  2044. self.questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, itemCount, itemPrice))
  2045. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.SellItem))
  2046. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  2047. self.questionDialog.Open()
  2048. self.questionDialog.count = itemCount
  2049.  
  2050. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  2051.  
  2052. def __OnClosePopupDialog(self):
  2053. self.pop = None
  2054.  
  2055. def RefineItem(self, scrollSlotPos, targetSlotPos):
  2056.  
  2057. scrollIndex = player.GetItemIndex(scrollSlotPos)
  2058. targetIndex = player.GetItemIndex(targetSlotPos)
  2059.  
  2060. if player.REFINE_OK != player.CanRefine(scrollIndex, targetSlotPos):
  2061. return
  2062.  
  2063. if app.ENABLE_REFINE_RENEWAL:
  2064. constInfo.AUTO_REFINE_TYPE = 1
  2065. constInfo.AUTO_REFINE_DATA["ITEM"][0] = scrollSlotPos
  2066. constInfo.AUTO_REFINE_DATA["ITEM"][1] = targetSlotPos
  2067.  
  2068.  
  2069. ###########################################################
  2070. self.__SendUseItemToItemPacket(scrollSlotPos, targetSlotPos)
  2071. #net.SendItemUseToItemPacket(scrollSlotPos, targetSlotPos)
  2072. return
  2073. ###########################################################
  2074.  
  2075. ###########################################################
  2076. #net.SendRequestRefineInfoPacket(targetSlotPos)
  2077. #return
  2078. ###########################################################
  2079.  
  2080. result = player.CanRefine(scrollIndex, targetSlotPos)
  2081.  
  2082. if player.REFINE_ALREADY_MAX_SOCKET_COUNT == result:
  2083. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2084. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_MORE_SOCKET)
  2085.  
  2086. elif player.REFINE_NEED_MORE_GOOD_SCROLL == result:
  2087. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2088. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NEED_BETTER_SCROLL)
  2089.  
  2090. elif player.REFINE_CANT_MAKE_SOCKET_ITEM == result:
  2091. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2092. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_SOCKET_DISABLE_ITEM)
  2093.  
  2094. elif player.REFINE_NOT_NEXT_GRADE_ITEM == result:
  2095. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2096. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_UPGRADE_DISABLE_ITEM)
  2097.  
  2098. elif player.REFINE_CANT_REFINE_METIN_TO_EQUIPMENT == result:
  2099. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)
  2100.  
  2101. if player.REFINE_OK != result:
  2102. return
  2103.  
  2104. self.refineDialog.Open(scrollSlotPos, targetSlotPos)
  2105.  
  2106. def DetachMetinFromItem(self, scrollSlotPos, targetSlotPos):
  2107. scrollIndex = player.GetItemIndex(scrollSlotPos)
  2108. targetIndex = player.GetItemIndex(targetSlotPos)
  2109.  
  2110. if not player.CanDetach(scrollIndex, targetSlotPos):
  2111. if app.ENABLE_ACCE_SYSTEM:
  2112. item.SelectItem(scrollIndex)
  2113. if item.GetValue(0) == acce.CLEAN_ATTR_VALUE0:
  2114. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_FAILURE_CLEAN)
  2115. else:
  2116. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
  2117. else:
  2118. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
  2119. return
  2120.  
  2121. self.questionDialog = uiCommon.QuestionDialog()
  2122. self.questionDialog.SetText(localeInfo.REFINE_DO_YOU_SEPARATE_METIN)
  2123. if app.ENABLE_ACCE_SYSTEM:
  2124. item.SelectItem(targetIndex)
  2125. if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_ACCE:
  2126. item.SelectItem(scrollIndex)
  2127. if item.GetValue(0) == acce.CLEAN_ATTR_VALUE0:
  2128. self.questionDialog.SetText(localeInfo.ACCE_DO_YOU_CLEAN)
  2129.  
  2130. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDetachMetinFromItem))
  2131. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  2132. self.questionDialog.Open()
  2133. self.questionDialog.sourcePos = scrollSlotPos
  2134. self.questionDialog.targetPos = targetSlotPos
  2135.  
  2136. def AttachMetinToItem(self, metinSlotPos, targetSlotPos):
  2137. metinIndex = player.GetItemIndex(metinSlotPos)
  2138. targetIndex = player.GetItemIndex(targetSlotPos)
  2139.  
  2140. item.SelectItem(metinIndex)
  2141. itemName = item.GetItemName()
  2142.  
  2143. result = player.CanAttachMetin(metinIndex, targetSlotPos)
  2144.  
  2145. if player.ATTACH_METIN_NOT_MATCHABLE_ITEM == result:
  2146. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_CAN_NOT_ATTACH(itemName))
  2147.  
  2148. if player.ATTACH_METIN_NO_MATCHABLE_SOCKET == result:
  2149. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_SOCKET(itemName))
  2150.  
  2151. elif player.ATTACH_METIN_NOT_EXIST_GOLD_SOCKET == result:
  2152. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_GOLD_SOCKET(itemName))
  2153.  
  2154. elif player.ATTACH_METIN_CANT_ATTACH_TO_EQUIPMENT == result:
  2155. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)
  2156.  
  2157. if player.ATTACH_METIN_OK != result:
  2158. return
  2159.  
  2160. self.attachMetinDialog.Open(metinSlotPos, targetSlotPos)
  2161.  
  2162.  
  2163.  
  2164. def OverOutItem(self):
  2165. self.wndItem.SetUsableItem(False)
  2166. if None != self.tooltipItem:
  2167. self.tooltipItem.HideToolTip()
  2168.  
  2169.  
  2170. #when apply HIGHLIGHT remember to apply a check about acce (or search it in acce system)
  2171. def OverInItem(self, overSlotPosGlobal):
  2172. overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPosGlobal)
  2173. self.wndItem.SetUsableItem(False)
  2174.  
  2175. if app.ENABLE_HIGHLIGHT_NEW_ITEM and overSlotPosGlobal in self.liHighlightedItems:
  2176. self.liHighlightedItems.remove(overSlotPosGlobal)
  2177. self.wndItem.DeactivateSlot(overSlotPos)
  2178.  
  2179.  
  2180. if mouseModule.mouseController.isAttached():
  2181. attachedItemType = mouseModule.mouseController.GetAttachedType()
  2182. if player.SLOT_TYPE_INVENTORY == attachedItemType or player.SLOT_TYPE_STONE_INVENTORY == attachedItemType or player.SLOT_TYPE_EFSUN_INVENTORY == attachedItemType:
  2183.  
  2184. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  2185. attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()
  2186.  
  2187. if attachedItemVNum==player.ITEM_MONEY: # @fixme005
  2188. pass
  2189. elif self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos):
  2190. self.wndItem.SetUsableItem(True)
  2191. self.wndItem.SetUseMode(True)
  2192. self.ShowToolTip(overSlotPos)
  2193. return
  2194.  
  2195. self.ShowToolTip(overSlotPos)
  2196.  
  2197.  
  2198. def __IsUsableItemToItem(self, srcItemVNum, srcSlotPos):
  2199. "다른 아이템에 사용할 수 있는 아이템인가?"
  2200.  
  2201. if item.IsRefineScroll(srcItemVNum):
  2202. return True
  2203. elif item.IsMetin(srcItemVNum):
  2204. return True
  2205. elif item.IsDetachScroll(srcItemVNum):
  2206. return True
  2207. elif item.IsKey(srcItemVNum):
  2208. return True
  2209. elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
  2210. return True
  2211. else:
  2212. if item.GetUseType(srcItemVNum) in self.USE_TYPE_TUPLE:
  2213. return True
  2214.  
  2215. return False
  2216.  
  2217. def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos):
  2218. "대상 아이템에 사용할 수 있는가?"
  2219.  
  2220. if srcSlotPos == dstSlotPos and not item.IsMetin(srcItemVNum):
  2221. return False
  2222.  
  2223. if item.IsRefineScroll(srcItemVNum):
  2224. if player.REFINE_OK == player.CanRefine(srcItemVNum, dstSlotPos):
  2225. return True
  2226. elif item.IsMetin(srcItemVNum):
  2227. if player.ATTACH_METIN_OK == player.CanAttachMetin(srcItemVNum, dstSlotPos):
  2228. return True
  2229. elif item.IsDetachScroll(srcItemVNum):
  2230. if player.DETACH_METIN_OK == player.CanDetach(srcItemVNum, dstSlotPos):
  2231. return True
  2232. elif item.IsKey(srcItemVNum):
  2233. if player.CanUnlock(srcItemVNum, dstSlotPos):
  2234. return True
  2235.  
  2236. elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
  2237. return True
  2238.  
  2239. else:
  2240. useType=item.GetUseType(srcItemVNum)
  2241.  
  2242. if "USE_CLEAN_SOCKET" == useType:
  2243. if self.__CanCleanBrokenMetinStone(dstSlotPos):
  2244. return True
  2245. elif "USE_CHANGE_ATTRIBUTE" == useType:
  2246. if self.__CanChangeItemAttrList(dstSlotPos):
  2247. return True
  2248. elif "USE_ADD_ATTRIBUTE" == useType:
  2249. if self.__CanAddItemAttr(dstSlotPos):
  2250. return True
  2251. elif "USE_ADD_ATTRIBUTE2" == useType:
  2252. if self.__CanAddItemAttr(dstSlotPos):
  2253. return True
  2254. elif "USE_ADD_ACCESSORY_SOCKET" == useType:
  2255. if self.__CanAddAccessorySocket(dstSlotPos):
  2256. return True
  2257. elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType:
  2258. if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum):
  2259. return True;
  2260. elif "USE_PUT_INTO_BELT_SOCKET" == useType:
  2261. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2262. print "USE_PUT_INTO_BELT_SOCKET", srcItemVNum, dstItemVNum
  2263.  
  2264. item.SelectItem(dstItemVNum)
  2265.  
  2266. if item.ITEM_TYPE_BELT == item.GetItemType():
  2267. return True
  2268. elif "USE_CHANGE_COSTUME_ATTR" == useType:
  2269. if self.__CanChangeCostumeAttrList(dstSlotPos):
  2270. return True
  2271. elif "USE_RESET_COSTUME_ATTR" == useType:
  2272. if self.__CanResetCostumeAttr(dstSlotPos):
  2273. return True
  2274.  
  2275. return False
  2276.  
  2277. def __CanCleanBrokenMetinStone(self, dstSlotPos):
  2278. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2279. if dstItemVNum == 0:
  2280. return False
  2281.  
  2282. item.SelectItem(dstItemVNum)
  2283.  
  2284. if item.ITEM_TYPE_WEAPON != item.GetItemType():
  2285. return False
  2286.  
  2287. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2288. if player.GetItemMetinSocket(dstSlotPos, i) == constInfo.ERROR_METIN_STONE:
  2289. return True
  2290.  
  2291. return False
  2292.  
  2293. def __CanChangeItemAttrList(self, dstSlotPos):
  2294. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2295. if dstItemVNum == 0:
  2296. return False
  2297.  
  2298. item.SelectItem(dstItemVNum)
  2299.  
  2300. if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
  2301. return False
  2302.  
  2303. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2304. if player.GetItemAttribute(dstSlotPos, i) != 0:
  2305. return True
  2306.  
  2307. return False
  2308.  
  2309. def __CanChangeCostumeAttrList(self, dstSlotPos):
  2310. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2311. if dstItemVNum == 0:
  2312. return False
  2313.  
  2314. item.SelectItem(dstItemVNum)
  2315.  
  2316. if item.GetItemType() != item.ITEM_TYPE_COSTUME:
  2317. return False
  2318.  
  2319. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2320. if player.GetItemAttribute(dstSlotPos, i) != 0:
  2321. return True
  2322.  
  2323. return False
  2324.  
  2325. def __CanResetCostumeAttr(self, dstSlotPos):
  2326. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2327. if dstItemVNum == 0:
  2328. return False
  2329.  
  2330. item.SelectItem(dstItemVNum)
  2331.  
  2332. if item.GetItemType() != item.ITEM_TYPE_COSTUME:
  2333. return False
  2334.  
  2335. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2336. if player.GetItemAttribute(dstSlotPos, i) != 0:
  2337. return True
  2338.  
  2339. return False
  2340.  
  2341. def __CanPutAccessorySocket(self, dstSlotPos, mtrlVnum):
  2342. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2343. if dstItemVNum == 0:
  2344. return False
  2345.  
  2346. item.SelectItem(dstItemVNum)
  2347.  
  2348. if item.GetItemType() != item.ITEM_TYPE_ARMOR:
  2349. return False
  2350.  
  2351. if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
  2352. return False
  2353.  
  2354. curCount = player.GetItemMetinSocket(dstSlotPos, 0)
  2355. maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
  2356.  
  2357. if mtrlVnum != constInfo.GET_ACCESSORY_MATERIAL_VNUM(dstItemVNum, item.GetItemSubType()):
  2358. return False
  2359.  
  2360. if curCount>=maxCount:
  2361. return False
  2362.  
  2363. return True
  2364.  
  2365. def __CanAddAccessorySocket(self, dstSlotPos):
  2366. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2367. if dstItemVNum == 0:
  2368. return False
  2369.  
  2370. item.SelectItem(dstItemVNum)
  2371.  
  2372. if item.GetItemType() != item.ITEM_TYPE_ARMOR:
  2373. return False
  2374.  
  2375. if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
  2376. return False
  2377.  
  2378. curCount = player.GetItemMetinSocket(dstSlotPos, 0)
  2379. maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
  2380.  
  2381. ACCESSORY_SOCKET_MAX_SIZE = 3
  2382. if maxCount >= ACCESSORY_SOCKET_MAX_SIZE:
  2383. return False
  2384.  
  2385. return True
  2386.  
  2387. def __CanAddItemAttr(self, dstSlotPos):
  2388. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2389. if dstItemVNum == 0:
  2390. return False
  2391.  
  2392. item.SelectItem(dstItemVNum)
  2393.  
  2394. if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
  2395. return False
  2396.  
  2397. attrCount = 0
  2398. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2399. if player.GetItemAttribute(dstSlotPos, i) != 0:
  2400. attrCount += 1
  2401.  
  2402. if attrCount<4:
  2403. return True
  2404.  
  2405. return False
  2406.  
  2407. def ShowToolTip(self, slotIndex):
  2408. if None != self.tooltipItem:
  2409. self.tooltipItem.SetInventoryItem(slotIndex)
  2410.  
  2411. def OnTop(self):
  2412. if None != self.tooltipItem:
  2413. self.tooltipItem.SetTop()
  2414.  
  2415. def OnPressEscapeKey(self):
  2416. self.Close()
  2417. return True
  2418.  
  2419. def UseItemSlot(self, slotIndex):
  2420. curCursorNum = app.GetCursor()
  2421. if app.SELL == curCursorNum:
  2422. return
  2423.  
  2424. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
  2425. return
  2426.  
  2427. #BONUS SWITCHER
  2428. if constInfo.IS_BONUS_CHANGER:
  2429. return
  2430. #END OF BONUS SWITCHER
  2431.  
  2432. slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex)
  2433.  
  2434. if app.ENABLE_QUICK_SELL:
  2435. import shop
  2436. if app.IsPressed(app.DIK_LSHIFT) or app.IsPressed(app.DIK_RSHIFT):
  2437. if shop.IsOpen():
  2438. if not shop.IsPrivateShop():
  2439. self.QuickSellItem(slotIndex)
  2440. return
  2441.  
  2442. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  2443. if self.wndDragonSoulRefine.IsShow():
  2444. self.wndDragonSoulRefine.AutoSetItem((player.INVENTORY, slotIndex), 1)
  2445. return
  2446. if app.ENABLE_ACCE_SYSTEM:
  2447. if self.isShowAcceWindow():
  2448. acce.Add(player.INVENTORY, slotIndex, 255)
  2449. return
  2450.  
  2451. self.__UseItem(slotIndex)
  2452. mouseModule.mouseController.DeattachObject()
  2453. self.OverOutItem()
  2454.  
  2455. def __UseItem(self, slotIndex):
  2456. ItemVNum = player.GetItemIndex(slotIndex)
  2457. item.SelectItem(ItemVNum)
  2458.  
  2459. if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE):
  2460. self.questionDialog = uiCommon.QuestionDialog()
  2461. self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM)
  2462. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnAccept))
  2463. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel))
  2464. self.questionDialog.Open()
  2465. self.questionDialog.slotIndex = slotIndex
  2466.  
  2467. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  2468.  
  2469. elif app.IsPressed(app.DIK_LSHIFT):
  2470. if player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GIFTBOX and\
  2471. ItemVNum != 31374 and ItemVNum != 50255 and\
  2472. ItemVNum != 50187 and ItemVNum != 50197 and\
  2473. ItemVNum != 50188 and ItemVNum != 50189 and\
  2474. ItemVNum != 50190 and ItemVNum != 50191 and\
  2475. ItemVNum != 50192 and ItemVNum != 50193 and\
  2476. ItemVNum != 50194 and ItemVNum != 50195:
  2477. if app.ENABLE_SHOW_CHEST_DROP:
  2478. if self.interface:
  2479. if self.interface.dlgChestDrop:
  2480. if not self.interface.dlgChestDrop.IsShow():
  2481. self.interface.dlgChestDrop.Open(slotIndex)
  2482. net.SendChestDropInfo(slotIndex)
  2483. #elif player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GACHA or player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GIFTBOX:
  2484.  
  2485. elif player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GIFTBOX:
  2486. if app.ENABLE_SHOW_CHEST_DROP:
  2487. if self.interface:
  2488. if self.interface.dlgChestDrop:
  2489. if not self.interface.dlgChestDrop.IsShow():
  2490. self.interface.dlgChestDrop.Open(slotIndex)
  2491. net.SendChestDropInfo(slotIndex)
  2492. else:
  2493. self.__SendUseItemPacket(slotIndex)
  2494.  
  2495. def __UseItemQuestionDialog_OnCancel(self):
  2496. self.OnCloseQuestionDialog()
  2497.  
  2498. def __UseItemQuestionDialog_OnAccept(self):
  2499. self.__SendUseItemPacket(self.questionDialog.slotIndex)
  2500. self.OnCloseQuestionDialog()
  2501.  
  2502. def __SendUseItemToItemPacket(self, srcSlotPos, dstSlotPos):
  2503. # 개인상점 열고 있는 동안 아이템 사용 방지
  2504. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2505. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
  2506. return
  2507.  
  2508. net.SendItemUseToItemPacket(srcSlotPos, dstSlotPos)
  2509.  
  2510. def __SendUseItemPacket(self, slotPos):
  2511. # 개인상점 열고 있는 동안 아이템 사용 방지
  2512. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2513. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
  2514. return
  2515.  
  2516. net.SendItemUsePacket(slotPos)
  2517.  
  2518. def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):
  2519. # 개인상점 열고 있는 동안 아이템 사용 방지
  2520. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2521. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP)
  2522. return
  2523.  
  2524. net.SendItemMovePacket(srcSlotPos, dstSlotPos, srcItemCount)
  2525.  
  2526. def SetDragonSoulRefineWindow(self, wndDragonSoulRefine):
  2527. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  2528. self.wndDragonSoulRefine = wndDragonSoulRefine
  2529.  
  2530.  
  2531. if app.ENABLE_ACCE_SYSTEM:
  2532. def SetAcceWindow(self, wndAcceCombine, wndAcceAbsorption):
  2533. self.wndAcceCombine = wndAcceCombine
  2534. self.wndAcceAbsorption = wndAcceAbsorption
  2535.  
  2536. def isShowAcceWindow(self):
  2537. if self.wndAcceCombine:
  2538. if self.wndAcceCombine.IsShow():
  2539. return 1
  2540.  
  2541. if self.wndAcceAbsorption:
  2542. if self.wndAcceAbsorption.IsShow():
  2543. return 1
  2544.  
  2545. return 0
  2546.  
  2547. def OnMoveWindow(self, x, y):
  2548. # print "Inventory Global Pos : ", self.GetGlobalPosition()
  2549. if app.ENABLE_BIOLOG_SYSTEM:
  2550. if self.wndCollect:
  2551. self.wndCollect.AdjustPositionAndSize()
  2552. if self.wndBelt:
  2553. # print "Belt Global Pos : ", self.wndBelt.GetGlobalPosition()
  2554. self.wndBelt.AdjustPositionAndSize()
  2555. if self.wndSideBar:
  2556. self.wndSideBar.AdjustPosition()
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
Add Comment
Please, Sign In to add comment