Advertisement
Guest User

Untitled

a guest
Jun 1st, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 75.90 KB | None | 0 0
  1. import ui
  2. import player
  3. import mouseModule
  4. import net
  5. import app
  6. import snd
  7. import item
  8. if app.ENABLE_BIOLOG_SYSTEM:
  9. import uiprofessionalbiolog, uiToolTip
  10. import player
  11. import chat
  12. import grp
  13. import uiScriptLocale
  14. import uiRefine
  15. import uiAttachMetin
  16. import uiPickMoney
  17. import uiPickEtc
  18. import uiCommon
  19. import uiPrivateShopBuilder # °³ÀλóÁ¡ ¿­µ¿¾È ItemMove ¹æÁö
  20. import localeInfo
  21. import constInfo
  22. import ime
  23. import wndMgr
  24.  
  25. ITEM_MALL_BUTTON_ENABLE = True
  26.  
  27. if app.ENABLE_ACCE_COSTUME_SYSTEM:
  28. import acce
  29.  
  30. ITEM_FLAG_APPLICABLE = 1 << 14
  31.  
  32. class CostumeWindow(ui.ScriptWindow):
  33.  
  34. def __init__(self, wndInventory):
  35. import exception
  36.  
  37. if not app.ENABLE_COSTUME_SYSTEM:
  38. exception.Abort("What do you do?")
  39. return
  40.  
  41. if not wndInventory:
  42. exception.Abort("wndInventory parameter must be set to InventoryWindow")
  43. return
  44.  
  45. ui.ScriptWindow.__init__(self)
  46.  
  47. self.isLoaded = 0
  48. self.wndInventory = wndInventory;
  49.  
  50. self.__LoadWindow()
  51.  
  52. def __del__(self):
  53. ui.ScriptWindow.__del__(self)
  54.  
  55. def Show(self):
  56. self.__LoadWindow()
  57. self.RefreshCostumeSlot()
  58.  
  59. ui.ScriptWindow.Show(self)
  60.  
  61. def Close(self):
  62. self.Hide()
  63.  
  64. def __LoadWindow(self):
  65. if self.isLoaded == 1:
  66. return
  67.  
  68. self.isLoaded = 1
  69.  
  70. try:
  71. pyScrLoader = ui.PythonScriptLoader()
  72. pyScrLoader.LoadScriptFile(self, "UIScript/CostumeWindow.py")
  73. except:
  74. import exception
  75. exception.Abort("CostumeWindow.LoadWindow.LoadObject")
  76.  
  77. try:
  78. wndEquip = self.GetChild("CostumeSlot")
  79. self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
  80.  
  81. except:
  82. import exception
  83. exception.Abort("CostumeWindow.LoadWindow.BindObject")
  84.  
  85. ## Equipment
  86. wndEquip.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
  87. wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
  88. wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  89. wndEquip.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  90. wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
  91. wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
  92.  
  93. self.wndEquip = wndEquip
  94.  
  95. def RefreshCostumeSlot(self):
  96. getItemVNum=player.GetItemIndex
  97.  
  98. for i in xrange(item.COSTUME_SLOT_COUNT):
  99. slotNumber = item.COSTUME_SLOT_START + i
  100. self.wndEquip.SetItemSlot(slotNumber, getItemVNum(slotNumber), 0)
  101.  
  102. if app.ENABLE_WEAPON_COSTUME_SYSTEM:
  103. self.wndEquip.SetItemSlot(item.COSTUME_SLOT_WEAPON, getItemVNum(item.COSTUME_SLOT_WEAPON), 0)
  104.  
  105. self.wndEquip.RefreshSlot()
  106.  
  107. class BeltInventoryWindow(ui.ScriptWindow):
  108.  
  109. def __init__(self, wndInventory):
  110. import exception
  111.  
  112. if not app.ENABLE_NEW_EQUIPMENT_SYSTEM:
  113. exception.Abort("What do you do?")
  114. return
  115.  
  116. if not wndInventory:
  117. exception.Abort("wndInventory parameter must be set to InventoryWindow")
  118. return
  119.  
  120. ui.ScriptWindow.__init__(self)
  121.  
  122. self.isLoaded = 0
  123. self.wndInventory = wndInventory;
  124.  
  125. self.wndBeltInventoryLayer = None
  126. self.wndBeltInventorySlot = None
  127. self.expandBtn = None
  128. self.minBtn = None
  129.  
  130. self.__LoadWindow()
  131.  
  132. def __del__(self):
  133. ui.ScriptWindow.__del__(self)
  134.  
  135. def Show(self, openBeltSlot = False):
  136. self.__LoadWindow()
  137. self.RefreshSlot()
  138.  
  139. ui.ScriptWindow.Show(self)
  140.  
  141. if openBeltSlot:
  142. self.OpenInventory()
  143. else:
  144. self.CloseInventory()
  145.  
  146. def Close(self):
  147. self.Hide()
  148.  
  149. def IsOpeningInventory(self):
  150. return self.wndBeltInventoryLayer.IsShow()
  151.  
  152. def OpenInventory(self):
  153. self.wndBeltInventoryLayer.Show()
  154. self.expandBtn.Hide()
  155.  
  156. if localeInfo.IsARABIC() == 0:
  157. self.AdjustPositionAndSize()
  158.  
  159. def CloseInventory(self):
  160. self.wndBeltInventoryLayer.Hide()
  161. self.expandBtn.Show()
  162.  
  163. if localeInfo.IsARABIC() == 0:
  164. self.AdjustPositionAndSize()
  165.  
  166. ## ÇöRç RÎsAL丮 R§Ä?¸¦ ±âÁRR¸·Î BASE R§Ä?¸¦ °c»e, ¸®LD.. LýRÚ ÇDµlÄÚµuÇD±â Á¤¸» ?CÁö¸¸ acaýRE lr´U..
  167. # if app.ENABLE_BIOLOG_SYSTEM:
  168. # def GetBasePosition(self):
  169. # x, y = self.wndInventory.GetGlobalPosition()
  170. # return x - 148, y + 385
  171. # else:
  172. def GetBasePosition(self):
  173. x, y = self.wndInventory.GetGlobalPosition()
  174. return x - 148, y + 241
  175.  
  176. def AdjustPositionAndSize(self):
  177. bx, by = self.GetBasePosition()
  178.  
  179. if self.IsOpeningInventory():
  180. self.SetPosition(bx, by)
  181. self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight())
  182.  
  183. else:
  184. self.SetPosition(bx + 138, by);
  185. self.SetSize(10, self.GetHeight())
  186.  
  187. def __LoadWindow(self):
  188. if self.isLoaded == 1:
  189. return
  190.  
  191. self.isLoaded = 1
  192.  
  193. try:
  194. pyScrLoader = ui.PythonScriptLoader()
  195. pyScrLoader.LoadScriptFile(self, "UIScript/BeltInventoryWindow.py")
  196. except:
  197. import exception
  198. exception.Abort("CostumeWindow.LoadWindow.LoadObject")
  199.  
  200. try:
  201. self.ORIGINAL_WIDTH = self.GetWidth()
  202. wndBeltInventorySlot = self.GetChild("BeltInventorySlot")
  203. self.wndBeltInventoryLayer = self.GetChild("BeltInventoryLayer")
  204. self.expandBtn = self.GetChild("ExpandBtn")
  205. self.minBtn = self.GetChild("MinimizeBtn")
  206.  
  207. self.expandBtn.SetEvent(ui.__mem_func__(self.OpenInventory))
  208. self.minBtn.SetEvent(ui.__mem_func__(self.CloseInventory))
  209.  
  210. if localeInfo.IsARABIC() :
  211. self.expandBtn.SetPosition(self.expandBtn.GetWidth() - 2, 15)
  212. self.wndBeltInventoryLayer.SetPosition(self.wndBeltInventoryLayer.GetWidth() - 5, 0)
  213. self.minBtn.SetPosition(self.minBtn.GetWidth() + 3, 15)
  214.  
  215. for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
  216. slotNumber = item.BELT_INVENTORY_SLOT_START + i
  217. wndBeltInventorySlot.SetCoverButton(slotNumber, "d:/ymir work/ui/game/quest/slot_button_01.sub",\
  218. "d:/ymir work/ui/game/quest/slot_button_01.sub",\
  219. "d:/ymir work/ui/game/quest/slot_button_01.sub",\
  220. "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", False, False)
  221.  
  222. except:
  223. import exception
  224. exception.Abort("CostumeWindow.LoadWindow.BindObject")
  225.  
  226. ## Equipment
  227. wndBeltInventorySlot.SetOverInItemEvent(ui.__mem_func__(self.wndInventory.OverInItem))
  228. wndBeltInventorySlot.SetOverOutItemEvent(ui.__mem_func__(self.wndInventory.OverOutItem))
  229. wndBeltInventorySlot.SetUnselectItemSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  230. wndBeltInventorySlot.SetUseSlotEvent(ui.__mem_func__(self.wndInventory.UseItemSlot))
  231. wndBeltInventorySlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.wndInventory.SelectEmptySlot))
  232. wndBeltInventorySlot.SetSelectItemSlotEvent(ui.__mem_func__(self.wndInventory.SelectItemSlot))
  233.  
  234. self.wndBeltInventorySlot = wndBeltInventorySlot
  235.  
  236. def RefreshSlot(self):
  237. getItemVNum=player.GetItemIndex
  238.  
  239. for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
  240. slotNumber = item.BELT_INVENTORY_SLOT_START + i
  241. self.wndBeltInventorySlot.SetItemSlot(slotNumber, getItemVNum(slotNumber), player.GetItemCount(slotNumber))
  242. self.wndBeltInventorySlot.SetAlwaysRenderCoverButton(slotNumber, True)
  243.  
  244. avail = "0"
  245.  
  246. if player.IsAvailableBeltInventoryCell(slotNumber):
  247. self.wndBeltInventorySlot.EnableCoverButton(slotNumber)
  248. else:
  249. self.wndBeltInventorySlot.DisableCoverButton(slotNumber)
  250.  
  251. self.wndBeltInventorySlot.RefreshSlot()
  252.  
  253. if app.ENABLE_BIOLOG_SYSTEM:
  254. ###################################################################
  255. # title_name : Professional Biolog System
  256. # date_created : 2016.08.07
  257. # filename : uiInventory.py
  258. # author : VegaS
  259. # version_actual : Version 0.0.8
  260. #
  261. class CollectInventoryWindow(ui.ScriptWindow):
  262. def __init__(self, wndInventory):
  263. import exception
  264. if not wndInventory:
  265. exception.Abort("wndInventory parameter must be set to CollectInventoryWindow")
  266. return
  267. ui.ScriptWindow.__init__(self)
  268. self.isLoaded = 0
  269. self.updated = 0
  270. self.wndInventory = wndInventory;
  271. self.tooltipItem = uiToolTip.ItemToolTip()
  272. self.tooltipItem.Hide()
  273. self.wndBeltInventoryLayer = None
  274. self.wndBeltInventorySlot = None
  275. self.expandBtn = None
  276. self.minBtn = None
  277. self.gameWindow = None
  278. self.__LoadWindow()
  279.  
  280. def __del__(self):
  281. ui.ScriptWindow.__del__(self)
  282.  
  283. def Show(self, openBeltSlot = False):
  284. self.__LoadWindow()
  285. ui.ScriptWindow.Show(self)
  286.  
  287. if openBeltSlot:
  288. self.OpenInventory()
  289. else:
  290. self.CloseInventory()
  291.  
  292. def Close(self):
  293. self.Hide()
  294.  
  295. def IsOpeningInventory(self):
  296. return self.wndBeltInventoryLayer.IsShow()
  297.  
  298. def OpenInventory(self):
  299. self.wndBeltInventoryLayer.Show()
  300. self.expandBtn.Hide()
  301.  
  302. self.AdjustPositionAndSize()
  303.  
  304. def CloseInventory(self):
  305. self.wndBeltInventoryLayer.Hide()
  306. self.expandBtn.Show()
  307.  
  308. self.AdjustPositionAndSize()
  309.  
  310. def GetBasePosition(self):
  311. x, y = self.wndInventory.GetGlobalPosition()
  312. return x - 148, y + 400
  313.  
  314. def AdjustPositionAndSize(self):
  315. bx, by = self.GetBasePosition()
  316.  
  317. if self.IsOpeningInventory():
  318. self.SetPosition(bx, by)
  319. self.SetSize(self.ORIGINAL_WIDTH, self.GetHeight())
  320. else:
  321. self.SetPosition(bx + 138, by);
  322. self.SetSize(10, self.GetHeight())
  323.  
  324. def __LoadWindow(self):
  325. if self.isLoaded == 1:
  326. return
  327.  
  328. self.isLoaded = 1
  329.  
  330. try:
  331. pyScrLoader = ui.PythonScriptLoader()
  332. pyScrLoader.LoadScriptFile(self, "UIScript/biolog_collectinventorywindow.py")
  333. except:
  334. import exception
  335. exception.Abort("CollectInventoryWindow.LoadWindow.LoadObject")
  336.  
  337. try:
  338. self.ORIGINAL_WIDTH = self.GetWidth()
  339. self.wndBeltInventoryLayer = self.GetChild("BeltInventoryLayer")
  340. self.wndItem = self.GetChild("BeltInventorySlot")
  341. self.time_value = self.GetChild("time_value")
  342. self.biolog_count = self.GetChild("count_value")
  343. self.expandBtn = self.GetChild("ExpandBtn")
  344. self.minBtn = self.GetChild("MinimizeBtn")
  345. self.sendBtn = self.GetChild("send_biolog")
  346. self.expandBtn.SetEvent(ui.__mem_func__(self.OpenInventory))
  347. self.minBtn.SetEvent(ui.__mem_func__(self.CloseInventory))
  348. self.wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  349. self.wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  350. except:
  351. import exception
  352. exception.Abort("CollectInventoryWindow.LoadWindow.BindObject")
  353.  
  354. if self.sendBtn:
  355. self.sendBtn.SetEvent(ui.__mem_func__(self.AcceptBiolog))
  356.  
  357. def SetItem(self, arg1, arg2, arg3):
  358. self.wndItem.SetItemSlot(0, int(uiprofessionalbiolog.BIOLOG_BINARY_LOADED["vnum"][0]), 0)
  359.  
  360. def AcceptBiolog(self):
  361. net.SendChatPacket("/biolog")
  362.  
  363. def SetTime(self, time):
  364. time_collect = time - app.GetGlobalTimeStamp()
  365.  
  366. if time_collect < 0:
  367. time_collect = 0
  368.  
  369. if time_collect == 1:
  370. self.wndLeftTime = uiprofessionalbiolog.Biolog_TimeExpired()
  371. self.wndLeftTime.OpenWindow()
  372. self.wndLeftTime.Show()
  373.  
  374. self.time_value.SetText(localeInfo.FormatTime(time_collect))
  375.  
  376. def OnUpdate(self):
  377. self.SetTime(int(uiprofessionalbiolog.BIOLOG_BINARY_LOADED["time"][0]))
  378. self.SetItem(0, uiprofessionalbiolog.BIOLOG_BINARY_LOADED["vnum"][0], 0)
  379. self.biolog_count.SetText(uiprofessionalbiolog.BIOLOG_BINARY_LOADED['countActual'][0] + "/" + uiprofessionalbiolog.BIOLOG_BINARY_LOADED['countNeed'][0])
  380.  
  381. def OverInItem(self):
  382. if uiprofessionalbiolog.BIOLOG_BINARY_LOADED["vnum"][0]:
  383. self.tooltipItem.SetItemToolTip(uiprofessionalbiolog.BIOLOG_BINARY_LOADED["vnum"][0])
  384.  
  385. def OverOutItem(self):
  386. if self.tooltipItem:
  387. self.tooltipItem.HideToolTip()
  388.  
  389. class InventoryWindow(ui.ScriptWindow):
  390.  
  391. 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_BIND", "USE_UNBIND", "USE_CHANGE_COSTUME_ATTR", "USE_RESET_COSTUME_ATTR")
  392.  
  393. questionDialog = None
  394. tooltipItem = None
  395. wndCostume = None
  396. wndBelt = None
  397. if app.ENABLE_BIOLOG_SYSTEM:
  398. wndCollect = None
  399. dlgPickMoney = None
  400. dlgPickItem = None
  401.  
  402. sellingSlotNumber = -1
  403. isLoaded = 0
  404. isOpenedCostumeWindowWhenClosingInventory = 0 # Àκ¥Å丮 ´ÝÀ» ¶§ ÄÚ½ºÃõÀÌ ¿­·ÁÀÖ¾ú´ÂÁö ¿©ºÎ-_-; ³×ÀÌ¹Ö ¤¸¤µ
  405. if app.ENABLE_BIOLOG_SYSTEM:
  406. isOpenedCollectWindowWhenClosingInventory = 0
  407. isOpenedBeltWindowWhenClosingInventory = 0 # Àκ¥Å丮 ´ÝÀ» ¶§ º§Æ® Àκ¥Å丮°¡ ¿­·ÁÀÖ¾ú´ÂÁö ¿©ºÎ-_-; ³×ÀÌ¹Ö ¤¸¤µ
  408.  
  409. def __init__(self):
  410. ui.ScriptWindow.__init__(self)
  411.  
  412. self.isOpenedBeltWindowWhenClosingInventory = 0 # Àκ¥Å丮 ´ÝÀ» ¶§ º§Æ® Àκ¥Å丮°¡ ¿­·ÁÀÖ¾ú´ÂÁö ¿©ºÎ-_-; ³×ÀÌ¹Ö ¤¸¤µ
  413.  
  414. self.inventoryPageIndex = 0
  415.  
  416. self.__LoadWindow()
  417.  
  418. def __del__(self):
  419. ui.ScriptWindow.__del__(self)
  420.  
  421. def Show(self):
  422. self.__LoadWindow()
  423.  
  424. ui.ScriptWindow.Show(self)
  425.  
  426. # Àκ¥Å丮¸¦ ´ÝÀ» ¶§ ÄÚ½ºÃõÀÌ ¿­·ÁÀÖ¾ú´Ù¸é Àκ¥Å丮¸¦ ¿­ ¶§ ÄÚ½ºÃõµµ °°ÀÌ ¿­µµ·Ï ÇÔ.
  427. if self.isOpenedCostumeWindowWhenClosingInventory and self.wndCostume:
  428. self.wndCostume.Show()
  429.  
  430. if app.ENABLE_BIOLOG_SYSTEM:
  431. if self.wndCollect:
  432. self.wndCollect.Show(self.isOpenedCollectWindowWhenClosingInventory)
  433.  
  434. # RÎsAL丮¸¦ ´ÝR» ¶§ s§C® RÎsAL丮°? z­·ÁRÖlú´U¸é °°RE z­µµ·D ÇÔ.
  435. if self.wndBelt:
  436. self.wndBelt.Show(self.isOpenedBeltWindowWhenClosingInventory)
  437.  
  438. if app.ENABLE_BIOLOG_SYSTEM:
  439. if self.wndCollect:
  440. self.wndCollect.AdjustPositionAndSize()
  441.  
  442. def BindInterfaceClass(self, interface):
  443. self.interface = interface
  444.  
  445. def __LoadWindow(self):
  446. if self.isLoaded == 1:
  447. return
  448.  
  449. self.isLoaded = 1
  450.  
  451. try:
  452. pyScrLoader = ui.PythonScriptLoader()
  453.  
  454. if app.ENABLE_EXTEND_INVEN_SYSTEM:
  455. pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindowEx.py")
  456. else:
  457. if ITEM_MALL_BUTTON_ENABLE:
  458. pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "InventoryWindow.py")
  459. else:
  460. pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindow.py")
  461. except:
  462. import exception
  463. exception.Abort("InventoryWindow.LoadWindow.LoadObject")
  464.  
  465. try:
  466. wndItem = self.GetChild("ItemSlot")
  467. wndEquip = self.GetChild("EquipmentSlot")
  468. self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
  469. self.wndMoney = self.GetChild("Money")
  470. self.wndMoneySlot = self.GetChild("Money_Slot")
  471. if app.ADD_INVENTORY:
  472. self.engelblack = self.GetChild("engel_01_open")
  473. self.engelblackcl = self.GetChild("engel_01_close")
  474. self.engelblack2 = self.GetChild("engel_02_open")
  475. self.engelblack2cl = self.GetChild("engel_02_close")
  476. self.engelblack3 = self.GetChild("engel_03_open")
  477. self.engelblack3cl = self.GetChild("engel_03_close")
  478. self.engelblack4 = self.GetChild("engel_04_open")
  479. self.engelblack4cl = self.GetChild("engel_04_close")
  480. self.engelblack5 = self.GetChild("engel_05_open")
  481. self.engelblack5cl = self.GetChild("engel_05_close")
  482. self.engelblack6 = self.GetChild("engel_06_open")
  483. self.engelblack6cl = self.GetChild("engel_06_close")
  484. self.engelblack7 = self.GetChild("engel_07_open")
  485. self.engelblack7cl = self.GetChild("engel_07_close")
  486. self.engelblack8 = self.GetChild("engel_08_open")
  487. self.engelblack8cl = self.GetChild("engel_08_close")
  488. self.engelblack9 = self.GetChild("engel_09_open")
  489. self.engelblack9cl = self.GetChild("engel_09_close")
  490. self.mallButton = self.GetChild2("MallButton")
  491. self.DSSButton = self.GetChild2("DSSButton")
  492. self.OpenShop = self.GetChild2("OpenShop")
  493. self.costumeButton = self.GetChild2("CostumeButton")
  494.  
  495. if app.ENABLE_LSM2_NEW_STORAGE:
  496. self.SpecialStorageButton = self.GetChild2("SpecialStorageButton")
  497.  
  498. self.inventoryTab = []
  499. for i in xrange(player.INVENTORY_PAGE_COUNT):
  500. self.inventoryTab.append(self.GetChild("Inventory_Tab_%02d" % (i+1)))
  501.  
  502. self.equipmentTab = []
  503. self.equipmentTab.append(self.GetChild("Equipment_Tab_01"))
  504. self.equipmentTab.append(self.GetChild("Equipment_Tab_02"))
  505.  
  506. if self.costumeButton and not app.ENABLE_COSTUME_SYSTEM:
  507. self.costumeButton.Hide()
  508. self.costumeButton.Destroy()
  509. self.costumeButton = 0
  510. if app.ADD_INVENTORY:
  511. self.engelblack.Hide()
  512. self.engelblackcl.Hide()
  513. self.engelblack2.Hide()
  514. self.engelblack2cl.Hide()
  515. self.engelblack3.Hide()
  516. self.engelblack3cl.Hide()
  517. self.engelblack4.Hide()
  518. self.engelblack4cl.Hide()
  519. self.engelblack5.Hide()
  520. self.engelblack5cl.Hide()
  521. self.engelblack6.Hide()
  522. self.engelblack6cl.Hide()
  523. self.engelblack7.Hide()
  524. self.engelblack7cl.Hide()
  525. self.engelblack8.Hide()
  526. self.engelblack8cl.Hide()
  527. self.engelblack9.Hide()
  528. self.engelblack9cl.Hide()
  529.  
  530. # Belt Inventory Window
  531. self.wndBelt = None
  532.  
  533. if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
  534. self.wndBelt = BeltInventoryWindow(self)
  535.  
  536. if app.ENABLE_BIOLOG_SYSTEM:
  537. self.wndCollect = None
  538. self.wndCollect = CollectInventoryWindow(self)
  539.  
  540. except:
  541. import exception
  542. exception.Abort("InventoryWindow.LoadWindow.BindObject")
  543.  
  544. ## Item
  545. wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
  546. wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
  547. wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
  548. wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
  549. wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  550. wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  551.  
  552. ## Equipment
  553. wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
  554. wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
  555. wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
  556. wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
  557. wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  558. wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  559.  
  560. ## PickMoneyDialog
  561. dlgPickMoney = uiPickMoney.PickMoneyDialog()
  562. dlgPickMoney.LoadDialog()
  563. dlgPickMoney.Hide()
  564.  
  565. dlgPickItem = uiPickEtc.PickEtcDialog()
  566. dlgPickItem.LoadDialog()
  567. dlgPickItem.Hide()
  568. ## RefineDialog
  569. self.refineDialog = uiRefine.RefineDialog()
  570. self.refineDialog.Hide()
  571.  
  572. ## AttachMetinDialog
  573. self.attachMetinDialog = uiAttachMetin.AttachMetinDialog()
  574. self.attachMetinDialog.Hide()
  575.  
  576. ## MoneySlot
  577. ##self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))
  578.  
  579. for i in xrange(player.INVENTORY_PAGE_COUNT):
  580. self.inventoryTab[i].SetEvent(lambda arg=i: self.SetInventoryPage(arg))
  581. self.inventoryTab[0].Down()
  582.  
  583. self.equipmentTab[0].SetEvent(lambda arg=0: self.SetEquipmentPage(arg))
  584. self.equipmentTab[1].SetEvent(lambda arg=1: self.SetEquipmentPage(arg))
  585. self.equipmentTab[0].Down()
  586. self.equipmentTab[0].Hide()
  587. self.equipmentTab[1].Hide()
  588.  
  589. self.wndItem = wndItem
  590. self.wndEquip = wndEquip
  591. self.dlgPickMoney = dlgPickMoney
  592. if app.ADD_INVENTORY:
  593. if self.engelblack:
  594. self.engelblack.SetEvent(ui.__mem_func__(self.en_ac))
  595. if self.engelblack2:
  596. self.engelblack2.SetEvent(ui.__mem_func__(self.en_ac))
  597. if self.engelblack3:
  598. self.engelblack3.SetEvent(ui.__mem_func__(self.en_ac))
  599. if self.engelblack4:
  600. self.engelblack4.SetEvent(ui.__mem_func__(self.en_ac))
  601. if self.engelblack5:
  602. self.engelblack5.SetEvent(ui.__mem_func__(self.en_ac))
  603. if self.engelblack6:
  604. self.engelblack6.SetEvent(ui.__mem_func__(self.en_ac))
  605. if self.engelblack7:
  606. self.engelblack7.SetEvent(ui.__mem_func__(self.en_ac))
  607. if self.engelblack8:
  608. self.engelblack8.SetEvent(ui.__mem_func__(self.en_ac))
  609. if self.engelblack9:
  610. self.engelblack9.SetEvent(ui.__mem_func__(self.en_ac))
  611. self.dlgPickItem = dlgPickItem
  612.  
  613. # MallButton
  614. if self.mallButton:
  615. self.mallButton.SetEvent(ui.__mem_func__(self.ClickMallButton))
  616.  
  617. if app.ENABLE_LSM2_NEW_STORAGE:
  618. if self.SpecialStorageButton:
  619. self.SpecialStorageButton.SetEvent(ui.__mem_func__(self.ClickSpecialStorage))
  620.  
  621. if self.DSSButton:
  622. self.DSSButton.SetEvent(ui.__mem_func__(self.ClickDSSButton))
  623.  
  624. if self.OpenShop:
  625. self.OpenShop.SetEvent(ui.__mem_func__(self.ClickOpenShop))
  626.  
  627. # Costume Button
  628. if self.costumeButton:
  629. self.costumeButton.SetEvent(ui.__mem_func__(self.ClickCostumeButton))
  630.  
  631. self.wndCostume = None
  632.  
  633. #####
  634.  
  635. if app.ENABLE_ACCE_COSTUME_SYSTEM:
  636. self.listAttachedAcces = []
  637.  
  638. ## Refresh
  639. self.SetInventoryPage(0)
  640. self.SetEquipmentPage(0)
  641. self.RefreshItemSlot()
  642. self.RefreshStatus()
  643.  
  644. def Destroy(self):
  645. self.ClearDictionary()
  646.  
  647. self.dlgPickMoney.Destroy()
  648. self.dlgPickMoney = 0
  649.  
  650. self.dlgPickItem.Destroy()
  651. self.dlgPickItem = 0
  652. self.refineDialog.Destroy()
  653. self.refineDialog = 0
  654.  
  655. self.attachMetinDialog.Destroy()
  656. self.attachMetinDialog = 0
  657.  
  658. self.tooltipItem = None
  659. self.wndItem = 0
  660. self.wndEquip = 0
  661. self.dlgPickMoney = 0
  662. self.dlgPickItem = 0
  663. self.wndMoney = 0
  664. self.wndMoneySlot = 0
  665. self.questionDialog = None
  666. self.mallButton = None
  667. if app.ADD_INVENTORY:
  668. self.engelblack = None
  669. self.engelblackcl = None
  670. self.engelblack2 = None
  671. self.engelblack2cl = None
  672. self.engelblack3 = None
  673. self.engelblack3cl = None
  674. self.engelblack4 = None
  675. self.engelblack4cl = None
  676. self.engelblack5 = None
  677. self.engelblack5cl = None
  678. self.engelblack6 = None
  679. self.engelblack6cl = None
  680. self.engelblack7 = None
  681. self.engelblack7cl = None
  682. self.engelblack8 = None
  683. self.engelblack8cl = None
  684. self.engelblack9 = None
  685. self.engelblack9cl = None
  686. self.DSSButton = None
  687. self.interface = None
  688.  
  689. if app.ENABLE_LSM2_NEW_STORAGE:
  690. self.SpecialStorageButton = None
  691.  
  692. if self.wndCostume:
  693. self.wndCostume.Destroy()
  694. self.wndCostume = 0
  695.  
  696. if self.wndBelt:
  697. self.wndBelt.Destroy()
  698. self.wndBelt = None
  699.  
  700. if app.ENABLE_BIOLOG_SYSTEM:
  701. if self.wndCollect:
  702. self.wndCollect.Destroy()
  703. self.wndCollect = None
  704.  
  705. self.inventoryTab = []
  706. self.equipmentTab = []
  707.  
  708. def Hide(self):
  709. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
  710. self.OnCloseQuestionDialog()
  711. return
  712. if None != self.tooltipItem:
  713. self.tooltipItem.HideToolTip()
  714.  
  715. if self.wndCostume:
  716. self.isOpenedCostumeWindowWhenClosingInventory = self.wndCostume.IsShow() # Àκ¥Å丮 âÀÌ ´ÝÈú ¶§ ÄÚ½ºÃõÀÌ ¿­·Á ÀÖ¾ú´Â°¡?
  717. self.wndCostume.Close()
  718.  
  719. if self.wndBelt:
  720. self.isOpenedBeltWindowWhenClosingInventory = self.wndBelt.IsOpeningInventory() # Àκ¥Å丮 âÀÌ ´ÝÈú ¶§ º§Æ® Àκ¥Å丮µµ ¿­·Á ÀÖ¾ú´Â°¡?
  721. print "Is Opening Belt Inven?? ", self.isOpenedBeltWindowWhenClosingInventory
  722. self.wndBelt.Close()
  723.  
  724. if app.ENABLE_BIOLOG_SYSTEM:
  725. if self.wndCollect:
  726. self.isOpenedCollectWindowWhenClosingInventory = self.wndCollect.IsOpeningInventory()
  727. print "Is opening Biolog Inventory", self.isOpenedCollectWindowWhenClosingInventory
  728. self.wndCollect.Close()
  729.  
  730. if self.dlgPickMoney:
  731. self.dlgPickMoney.Close()
  732. if self.dlgPickItem:
  733. self.dlgPickItem.Close()
  734.  
  735. wndMgr.Hide(self.hWnd)
  736.  
  737.  
  738. def Close(self):
  739. self.Hide()
  740.  
  741. def SetInventoryPage(self, page):
  742. if app.ADD_INVENTORY:
  743. constInfo.envanter = page
  744. if page == 2:#3 envanter
  745. if player.GetEnvanter() == 0:#Hepsi kapali
  746. self.engelblack.Show()#open
  747. self.engelblackcl.Hide()
  748. self.engelblack2.Hide()
  749. self.engelblack2cl.Show()#close
  750. self.engelblack3.Hide()
  751. self.engelblack3cl.Show()
  752. self.engelblack4.Hide()
  753. self.engelblack4cl.Show()
  754. self.engelblack5.Hide()
  755. self.engelblack5cl.Show()
  756. self.engelblack6.Hide()
  757. self.engelblack6cl.Show()
  758. self.engelblack7.Hide()
  759. self.engelblack7cl.Show()
  760. self.engelblack8.Hide()
  761. self.engelblack8cl.Show()
  762. self.engelblack9.Hide()
  763. self.engelblack9cl.Show()
  764. elif player.GetEnvanter() == 1:# 1 tane acyk
  765. self.engelblack.Hide()#open
  766. self.engelblackcl.Hide()
  767. self.engelblack2.Show()
  768. self.engelblack2cl.Hide()#close
  769. self.engelblack3.Hide()
  770. self.engelblack3cl.Show()
  771. self.engelblack4.Hide()
  772. self.engelblack4cl.Show()
  773. self.engelblack5.Hide()
  774. self.engelblack5cl.Show()
  775. self.engelblack6.Hide()
  776. self.engelblack6cl.Show()
  777. self.engelblack7.Hide()
  778. self.engelblack7cl.Show()
  779. self.engelblack8.Hide()
  780. self.engelblack8cl.Show()
  781. self.engelblack9.Hide()
  782. self.engelblack9cl.Show()
  783. elif player.GetEnvanter() == 2:# 2 tane acyk
  784. self.engelblack.Hide()#open
  785. self.engelblackcl.Hide()#open
  786. self.engelblack2.Hide()
  787. self.engelblack2cl.Hide()#close
  788. self.engelblack3.Show()
  789. self.engelblack3cl.Hide()
  790. self.engelblack4.Hide()
  791. self.engelblack4cl.Show()
  792. self.engelblack5.Hide()
  793. self.engelblack5cl.Show()
  794. self.engelblack6.Hide()
  795. self.engelblack6cl.Show()
  796. self.engelblack7.Hide()
  797. self.engelblack7cl.Show()
  798. self.engelblack8.Hide()
  799. self.engelblack8cl.Show()
  800. self.engelblack9.Hide()
  801. self.engelblack9cl.Show()
  802. elif player.GetEnvanter() == 3:
  803. self.engelblack.Hide()#open
  804. self.engelblackcl.Hide()#open
  805. self.engelblack2.Hide()
  806. self.engelblack2cl.Hide()#close
  807. self.engelblack3.Hide()
  808. self.engelblack3cl.Hide()
  809. self.engelblack4.Show()###
  810. self.engelblack4cl.Hide()
  811. self.engelblack5.Hide()
  812. self.engelblack5cl.Show()
  813. self.engelblack6.Hide()
  814. self.engelblack6cl.Show()
  815. self.engelblack7.Hide()
  816. self.engelblack7cl.Show()
  817. self.engelblack8.Hide()
  818. self.engelblack8cl.Show()
  819. self.engelblack9.Hide()
  820. self.engelblack9cl.Show()
  821. elif player.GetEnvanter() == 4:
  822. self.engelblack.Hide()#open
  823. self.engelblackcl.Hide()#open
  824. self.engelblack2.Hide()
  825. self.engelblack2cl.Hide()#close
  826. self.engelblack3.Hide()
  827. self.engelblack3cl.Hide()
  828. self.engelblack4.Hide()###
  829. self.engelblack4cl.Hide()
  830. self.engelblack5.Show()
  831. self.engelblack5cl.Hide()
  832. self.engelblack6.Hide()
  833. self.engelblack6cl.Show()
  834. self.engelblack7.Hide()
  835. self.engelblack7cl.Show()
  836. self.engelblack8.Hide()
  837. self.engelblack8cl.Show()
  838. self.engelblack9.Hide()
  839. self.engelblack9cl.Show()
  840. elif player.GetEnvanter() == 5:
  841. self.engelblack.Hide()#open
  842. self.engelblackcl.Hide()#open
  843. self.engelblack2.Hide()
  844. self.engelblack2cl.Hide()#close
  845. self.engelblack3.Hide()
  846. self.engelblack3cl.Hide()
  847. self.engelblack4.Hide()###
  848. self.engelblack4cl.Hide()
  849. self.engelblack5.Hide()
  850. self.engelblack5cl.Hide()
  851. self.engelblack6.Show()#open
  852. self.engelblack6cl.Hide()
  853. self.engelblack7.Hide()
  854. self.engelblack7cl.Show()
  855. self.engelblack8.Hide()
  856. self.engelblack8cl.Show()
  857. self.engelblack9.Hide()
  858. self.engelblack9cl.Show()
  859. elif player.GetEnvanter() == 6:
  860. self.engelblack.Hide()#open
  861. self.engelblackcl.Hide()#open
  862. self.engelblack2.Hide()
  863. self.engelblack2cl.Hide()#close
  864. self.engelblack3.Hide()
  865. self.engelblack3cl.Hide()
  866. self.engelblack4.Hide()###
  867. self.engelblack4cl.Hide()
  868. self.engelblack5.Hide()
  869. self.engelblack5cl.Hide()
  870. self.engelblack6.Hide()#open
  871. self.engelblack6cl.Hide()
  872. self.engelblack7.Show()
  873. self.engelblack7cl.Hide()
  874. self.engelblack8.Hide()
  875. self.engelblack8cl.Show()
  876. self.engelblack9.Hide()
  877. self.engelblack9cl.Show()
  878. elif player.GetEnvanter() == 7:
  879. self.engelblack.Hide()#open
  880. self.engelblackcl.Hide()#open
  881. self.engelblack2.Hide()
  882. self.engelblack2cl.Hide()#close
  883. self.engelblack3.Hide()
  884. self.engelblack3cl.Hide()
  885. self.engelblack4.Hide()###
  886. self.engelblack4cl.Hide()
  887. self.engelblack5.Hide()
  888. self.engelblack5cl.Hide()
  889. self.engelblack6.Hide()#open
  890. self.engelblack6cl.Hide()
  891. self.engelblack7.Hide()
  892. self.engelblack7cl.Hide()
  893. self.engelblack8.Show()
  894. self.engelblack8cl.Hide()
  895. self.engelblack9.Hide()
  896. self.engelblack9cl.Show()
  897. elif player.GetEnvanter() == 8:
  898. self.engelblack.Hide()#open
  899. self.engelblackcl.Hide()#open
  900. self.engelblack2.Hide()
  901. self.engelblack2cl.Hide()#close
  902. self.engelblack3.Hide()
  903. self.engelblack3cl.Hide()
  904. self.engelblack4.Hide()###
  905. self.engelblack4cl.Hide()
  906. self.engelblack5.Hide()
  907. self.engelblack5cl.Hide()
  908. self.engelblack6.Hide()#open
  909. self.engelblack6cl.Hide()
  910. self.engelblack7.Hide()
  911. self.engelblack7cl.Hide()
  912. self.engelblack8.Hide()
  913. self.engelblack8cl.Hide()
  914. self.engelblack9.Show()
  915. self.engelblack9cl.Hide()
  916. elif player.GetEnvanter() == 9:
  917. self.engelblack.Hide()#open
  918. self.engelblackcl.Hide()#open
  919. self.engelblack2.Hide()
  920. self.engelblack2cl.Hide()#close
  921. self.engelblack3.Hide()
  922. self.engelblack3cl.Hide()
  923. self.engelblack4.Hide()###
  924. self.engelblack4cl.Hide()
  925. self.engelblack5.Hide()
  926. self.engelblack5cl.Hide()
  927. self.engelblack6.Hide()#open
  928. self.engelblack6cl.Hide()
  929. self.engelblack7.Hide()
  930. self.engelblack7cl.Hide()
  931. self.engelblack8.Hide()
  932. self.engelblack8cl.Hide()
  933. self.engelblack9.Hide()
  934. self.engelblack9cl.Hide()
  935. elif player.GetEnvanter() >= 10:
  936. self.engelblack.Hide()#open
  937. self.engelblackcl.Hide()#open
  938. self.engelblack2.Hide()
  939. self.engelblack2cl.Hide()#close
  940. self.engelblack3.Hide()
  941. self.engelblack3cl.Hide()
  942. self.engelblack4.Hide()###
  943. self.engelblack4cl.Hide()
  944. self.engelblack5.Hide()
  945. self.engelblack5cl.Hide()
  946. self.engelblack6.Hide()#open
  947. self.engelblack6cl.Hide()
  948. self.engelblack7.Hide()
  949. self.engelblack7cl.Hide()
  950. self.engelblack8.Hide()
  951. self.engelblack8cl.Hide()
  952. self.engelblack9.Hide()
  953. self.engelblack9cl.Hide()
  954. elif page == 3:
  955. if player.GetEnvanter() >= 0 and player.GetEnvanter() <= 8:
  956. self.engelblack.Hide()#open
  957. self.engelblackcl.Show()
  958. self.engelblack2.Hide()
  959. self.engelblack2cl.Show()#close
  960. self.engelblack3.Hide()
  961. self.engelblack3cl.Show()
  962. self.engelblack4.Hide()
  963. self.engelblack4cl.Show()
  964. self.engelblack5.Hide()
  965. self.engelblack5cl.Show()
  966. self.engelblack6.Hide()
  967. self.engelblack6cl.Show()
  968. self.engelblack7.Hide()
  969. self.engelblack7cl.Show()
  970. self.engelblack8.Hide()
  971. self.engelblack8cl.Show()
  972. self.engelblack9.Hide()
  973. self.engelblack9cl.Show()
  974. elif player.GetEnvanter() == 9:#Hepsi kapali
  975. self.engelblack.Show()#open
  976. self.engelblackcl.Hide()
  977. self.engelblack2.Hide()
  978. self.engelblack2cl.Show()#close
  979. self.engelblack3.Hide()
  980. self.engelblack3cl.Show()
  981. self.engelblack4.Hide()
  982. self.engelblack4cl.Show()
  983. self.engelblack5.Hide()
  984. self.engelblack5cl.Show()
  985. self.engelblack6.Hide()
  986. self.engelblack6cl.Show()
  987. self.engelblack7.Hide()
  988. self.engelblack7cl.Show()
  989. self.engelblack8.Hide()
  990. self.engelblack8cl.Show()
  991. self.engelblack9.Hide()
  992. self.engelblack9cl.Show()
  993. elif player.GetEnvanter() == 10:# 1 tane acyk
  994. self.engelblack.Hide()#open
  995. self.engelblackcl.Hide()
  996. self.engelblack2.Show()
  997. self.engelblack2cl.Hide()#close
  998. self.engelblack3.Hide()
  999. self.engelblack3cl.Show()
  1000. self.engelblack4.Hide()
  1001. self.engelblack4cl.Show()
  1002. self.engelblack5.Hide()
  1003. self.engelblack5cl.Show()
  1004. self.engelblack6.Hide()
  1005. self.engelblack6cl.Show()
  1006. self.engelblack7.Hide()
  1007. self.engelblack7cl.Show()
  1008. self.engelblack8.Hide()
  1009. self.engelblack8cl.Show()
  1010. self.engelblack9.Hide()
  1011. self.engelblack9cl.Show()
  1012. elif player.GetEnvanter() == 11:# 2 tane acyk
  1013. self.engelblack.Hide()#open
  1014. self.engelblackcl.Hide()#open
  1015. self.engelblack2.Hide()
  1016. self.engelblack2cl.Hide()#close
  1017. self.engelblack3.Show()
  1018. self.engelblack3cl.Hide()
  1019. self.engelblack4.Hide()
  1020. self.engelblack4cl.Show()
  1021. self.engelblack5.Hide()
  1022. self.engelblack5cl.Show()
  1023. self.engelblack6.Hide()
  1024. self.engelblack6cl.Show()
  1025. self.engelblack7.Hide()
  1026. self.engelblack7cl.Show()
  1027. self.engelblack8.Hide()
  1028. self.engelblack8cl.Show()
  1029. self.engelblack9.Hide()
  1030. self.engelblack9cl.Show()
  1031. elif player.GetEnvanter() == 12:
  1032. self.engelblack.Hide()#open
  1033. self.engelblackcl.Hide()#open
  1034. self.engelblack2.Hide()
  1035. self.engelblack2cl.Hide()#close
  1036. self.engelblack3.Hide()
  1037. self.engelblack3cl.Hide()
  1038. self.engelblack4.Show()###
  1039. self.engelblack4cl.Hide()
  1040. self.engelblack5.Hide()
  1041. self.engelblack5cl.Show()
  1042. self.engelblack6.Hide()
  1043. self.engelblack6cl.Show()
  1044. self.engelblack7.Hide()
  1045. self.engelblack7cl.Show()
  1046. self.engelblack8.Hide()
  1047. self.engelblack8cl.Show()
  1048. self.engelblack9.Hide()
  1049. self.engelblack9cl.Show()
  1050. elif player.GetEnvanter() == 13:
  1051. self.engelblack.Hide()#open
  1052. self.engelblackcl.Hide()#open
  1053. self.engelblack2.Hide()
  1054. self.engelblack2cl.Hide()#close
  1055. self.engelblack3.Hide()
  1056. self.engelblack3cl.Hide()
  1057. self.engelblack4.Hide()###
  1058. self.engelblack4cl.Hide()
  1059. self.engelblack5.Show()
  1060. self.engelblack5cl.Hide()
  1061. self.engelblack6.Hide()
  1062. self.engelblack6cl.Show()
  1063. self.engelblack7.Hide()
  1064. self.engelblack7cl.Show()
  1065. self.engelblack8.Hide()
  1066. self.engelblack8cl.Show()
  1067. self.engelblack9.Hide()
  1068. self.engelblack9cl.Show()
  1069. elif player.GetEnvanter() == 14:
  1070. self.engelblack.Hide()#open
  1071. self.engelblackcl.Hide()#open
  1072. self.engelblack2.Hide()
  1073. self.engelblack2cl.Hide()#close
  1074. self.engelblack3.Hide()
  1075. self.engelblack3cl.Hide()
  1076. self.engelblack4.Hide()###
  1077. self.engelblack4cl.Hide()
  1078. self.engelblack5.Hide()
  1079. self.engelblack5cl.Hide()
  1080. self.engelblack6.Show()#open
  1081. self.engelblack6cl.Hide()
  1082. self.engelblack7.Hide()
  1083. self.engelblack7cl.Show()
  1084. self.engelblack8.Hide()
  1085. self.engelblack8cl.Show()
  1086. self.engelblack9.Hide()
  1087. self.engelblack9cl.Show()
  1088. elif player.GetEnvanter() == 15:
  1089. self.engelblack.Hide()#open
  1090. self.engelblackcl.Hide()#open
  1091. self.engelblack2.Hide()
  1092. self.engelblack2cl.Hide()#close
  1093. self.engelblack3.Hide()
  1094. self.engelblack3cl.Hide()
  1095. self.engelblack4.Hide()###
  1096. self.engelblack4cl.Hide()
  1097. self.engelblack5.Hide()
  1098. self.engelblack5cl.Hide()
  1099. self.engelblack6.Hide()#open
  1100. self.engelblack6cl.Hide()
  1101. self.engelblack7.Show()
  1102. self.engelblack7cl.Hide()
  1103. self.engelblack8.Hide()
  1104. self.engelblack8cl.Show()
  1105. self.engelblack9.Hide()
  1106. self.engelblack9cl.Show()
  1107. elif player.GetEnvanter() == 16:
  1108. self.engelblack.Hide()#open
  1109. self.engelblackcl.Hide()#open
  1110. self.engelblack2.Hide()
  1111. self.engelblack2cl.Hide()#close
  1112. self.engelblack3.Hide()
  1113. self.engelblack3cl.Hide()
  1114. self.engelblack4.Hide()###
  1115. self.engelblack4cl.Hide()
  1116. self.engelblack5.Hide()
  1117. self.engelblack5cl.Hide()
  1118. self.engelblack6.Hide()#open
  1119. self.engelblack6cl.Hide()
  1120. self.engelblack7.Hide()
  1121. self.engelblack7cl.Hide()
  1122. self.engelblack8.Show()
  1123. self.engelblack8cl.Hide()
  1124. self.engelblack9.Hide()
  1125. self.engelblack9cl.Show()
  1126. elif player.GetEnvanter() == 17:
  1127. self.engelblack.Hide()#open
  1128. self.engelblackcl.Hide()#open
  1129. self.engelblack2.Hide()
  1130. self.engelblack2cl.Hide()#close
  1131. self.engelblack3.Hide()
  1132. self.engelblack3cl.Hide()
  1133. self.engelblack4.Hide()###
  1134. self.engelblack4cl.Hide()
  1135. self.engelblack5.Hide()
  1136. self.engelblack5cl.Hide()
  1137. self.engelblack6.Hide()#open
  1138. self.engelblack6cl.Hide()
  1139. self.engelblack7.Hide()
  1140. self.engelblack7cl.Hide()
  1141. self.engelblack8.Hide()
  1142. self.engelblack8cl.Hide()
  1143. self.engelblack9.Show()
  1144. self.engelblack9cl.Hide()
  1145. elif player.GetEnvanter() == 18:
  1146. self.engelblack.Hide()#open
  1147. self.engelblackcl.Hide()#open
  1148. self.engelblack2.Hide()
  1149. self.engelblack2cl.Hide()#close
  1150. self.engelblack3.Hide()
  1151. self.engelblack3cl.Hide()
  1152. self.engelblack4.Hide()###
  1153. self.engelblack4cl.Hide()
  1154. self.engelblack5.Hide()
  1155. self.engelblack5cl.Hide()
  1156. self.engelblack6.Hide()#open
  1157. self.engelblack6cl.Hide()
  1158. self.engelblack7.Hide()
  1159. self.engelblack7cl.Hide()
  1160. self.engelblack8.Hide()
  1161. self.engelblack8cl.Hide()
  1162. self.engelblack9.Hide()
  1163. self.engelblack9cl.Hide()
  1164. else:
  1165. self.engelblack.Hide()
  1166. self.engelblackcl.Hide()
  1167. self.engelblack2.Hide()
  1168. self.engelblack2cl.Hide()
  1169. self.engelblack3.Hide()
  1170. self.engelblack3cl.Hide()
  1171. self.engelblack4.Hide()
  1172. self.engelblack4cl.Hide()
  1173. self.engelblack5.Hide()
  1174. self.engelblack5cl.Hide()
  1175. self.engelblack6.Hide()
  1176. self.engelblack6cl.Hide()
  1177. self.engelblack7.Hide()
  1178. self.engelblack7cl.Hide()
  1179. self.engelblack8.Hide()
  1180. self.engelblack8cl.Hide()
  1181. self.engelblack9.Hide()
  1182. self.engelblack9cl.Hide()
  1183. self.inventoryPageIndex = page
  1184. for i in xrange(player.INVENTORY_PAGE_COUNT):
  1185. if i!=page:
  1186. self.inventoryTab[i].SetUp()
  1187. self.RefreshBagSlotWindow()
  1188.  
  1189. def SetEquipmentPage(self, page):
  1190. self.equipmentPageIndex = page
  1191. self.equipmentTab[1-page].SetUp()
  1192. self.RefreshEquipSlotWindow()
  1193.  
  1194. if app.ADD_INVENTORY:
  1195. def en_ac(self):
  1196. if player.GetEnvanter() < 4:
  1197. envanter = 2
  1198. self.questionDialog = uiCommon.QuestionDialog()
  1199. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  1200. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  1201. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1202. self.questionDialog.Open()
  1203. # self.questionDialog.slotIndex = slotIndex
  1204. elif player.GetEnvanter() == 4 or player.GetEnvanter() == 5:
  1205. envanter = 3
  1206. self.questionDialog = uiCommon.QuestionDialog()
  1207. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  1208. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  1209. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1210. self.questionDialog.Open()
  1211. # self.questionDialog.slotIndex = slotIndex
  1212. elif player.GetEnvanter() == 6 or player.GetEnvanter() == 7 or player.GetEnvanter() == 8:
  1213. envanter = 4
  1214. self.questionDialog = uiCommon.QuestionDialog()
  1215. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  1216. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  1217. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1218. self.questionDialog.Open()
  1219. # self.questionDialog.slotIndex = slotIndex
  1220. elif player.GetEnvanter() == 9 or player.GetEnvanter() == 10 or player.GetEnvanter() == 11:
  1221. envanter = 5
  1222. self.questionDialog = uiCommon.QuestionDialog()
  1223. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  1224. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  1225. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1226. self.questionDialog.Open()
  1227. # self.questionDialog.slotIndex = slotIndex
  1228. elif player.GetEnvanter() == 12 or player.GetEnvanter() == 13 or player.GetEnvanter() == 14:
  1229. envanter = 6
  1230. self.questionDialog = uiCommon.QuestionDialog()
  1231. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  1232. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  1233. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1234. self.questionDialog.Open()
  1235. # self.questionDialog.slotIndex = slotIndex
  1236. elif player.GetEnvanter() == 15 or player.GetEnvanter() == 16 or player.GetEnvanter() == 17:
  1237. envanter = 7
  1238. self.questionDialog = uiCommon.QuestionDialog()
  1239. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  1240. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  1241. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1242. self.questionDialog.Open()
  1243. # self.questionDialog.slotIndex = slotIndex
  1244. else:
  1245. self.wndpopupdialog = uiCommon.PopupDialog()
  1246. self.wndpopupdialog.SetText(localeInfo.ENVANTER_ZATEN_GENIS_3)
  1247. self.wndpopupdialog.Open()
  1248.  
  1249. def ClickMallButton(self):
  1250. print "click_mall_button"
  1251. net.SendChatPacket("/click_mall")
  1252.  
  1253. # DSSButton
  1254. def ClickDSSButton(self):
  1255. print "click_dss_button"
  1256. self.interface.ToggleDragonSoulWindow()
  1257.  
  1258. def ClickOpenShop(self):
  1259. net.SendChatPacket("/open_shop")
  1260.  
  1261. if app.ENABLE_LSM2_NEW_STORAGE:
  1262. def ClickSpecialStorage(self):
  1263. self.interface.ToggleSpecialStorageWindow()
  1264.  
  1265. def ClickCostumeButton(self):
  1266. print "Click Costume Button"
  1267. if self.wndCostume:
  1268. if self.wndCostume.IsShow():
  1269. self.wndCostume.Hide()
  1270. else:
  1271. self.wndCostume.Show()
  1272. else:
  1273. self.wndCostume = CostumeWindow(self)
  1274. self.wndCostume.Show()
  1275.  
  1276. def OpenPickMoneyDialog(self):
  1277.  
  1278. if mouseModule.mouseController.isAttached():
  1279.  
  1280. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1281. if player.SLOT_TYPE_SAFEBOX == mouseModule.mouseController.GetAttachedType():
  1282.  
  1283. if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
  1284. net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
  1285. snd.PlaySound("sound/ui/money.wav")
  1286.  
  1287. mouseModule.mouseController.DeattachObject()
  1288.  
  1289. else:
  1290. curMoney = player.GetElk()
  1291.  
  1292. if curMoney <= 0:
  1293. return
  1294.  
  1295. self.dlgPickMoney.SetTitleName(localeInfo.PICK_MONEY_TITLE)
  1296. self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
  1297. self.dlgPickMoney.Open(curMoney)
  1298. self.dlgPickMoney.SetMax(9) # Àκ¥Å丮 990000 Á¦ÇÑ ¹ö±× ¼öÁ¤
  1299.  
  1300. def OnPickMoney(self, money):
  1301. mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_INVENTORY, money)
  1302.  
  1303. def OnPickItem(self, count):
  1304. itemSlotIndex = self.dlgPickItem.itemGlobalSlotIndex
  1305. selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  1306. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, count)
  1307.  
  1308. def __InventoryLocalSlotPosToGlobalSlotPos(self, local):
  1309. if player.IsEquipmentSlot(local) or player.IsCostumeSlot(local) or (app.ENABLE_NEW_EQUIPMENT_SYSTEM and player.IsBeltInventorySlot(local)):
  1310. return local
  1311.  
  1312. return self.inventoryPageIndex*player.INVENTORY_PAGE_SIZE + local
  1313.  
  1314. def RefreshBagSlotWindow(self):
  1315. getItemVNum=player.GetItemIndex
  1316. getItemCount=player.GetItemCount
  1317. setItemVNum=self.wndItem.SetItemSlot
  1318.  
  1319. for i in xrange(player.INVENTORY_PAGE_SIZE):
  1320. slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
  1321.  
  1322. itemCount = getItemCount(slotNumber)
  1323. # itemCount == 0ÀÌ¸é ¼ÒÄÏÀ» ºñ¿î´Ù.
  1324. if 0 == itemCount:
  1325. self.wndItem.ClearSlot(i)
  1326. continue
  1327. elif 1 == itemCount:
  1328. itemCount = 0
  1329.  
  1330. itemVnum = getItemVNum(slotNumber)
  1331. setItemVNum(i, itemVnum, itemCount)
  1332.  
  1333. ## ÀÚµ¿¹°¾à (HP: #72723 ~ #72726, SP: #72727 ~ #72730) Ư¼öó¸® - ¾ÆÀÌÅÛÀε¥µµ ½½·Ô¿¡ È°¼ºÈ­/ºñÈ°¼ºÈ­ Ç¥½Ã¸¦ À§ÇÑ ÀÛ¾÷ÀÓ - [hyo]
  1334. if constInfo.IS_AUTO_POTION(itemVnum):
  1335. # metinSocket - [0] : È°¼ºÈ­ ¿©ºÎ, [1] : »ç¿ëÇÑ ¾ç, [2] : ÃÖ´ë ¿ë·®
  1336. metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
  1337.  
  1338. isActivated = 0 != metinSocket[0]
  1339.  
  1340. if isActivated:
  1341. self.wndItem.ActivateSlot(i)
  1342. potionType = 0;
  1343. if constInfo.IS_AUTO_POTION_HP(itemVnum):
  1344. potionType = player.AUTO_POTION_TYPE_HP
  1345. elif constInfo.IS_AUTO_POTION_SP(itemVnum):
  1346. potionType = player.AUTO_POTION_TYPE_SP
  1347.  
  1348. usedAmount = int(metinSocket[1])
  1349. totalAmount = int(metinSocket[2])
  1350. player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i))
  1351.  
  1352. else:
  1353. self.wndItem.DeactivateSlot(i)
  1354.  
  1355. if app.ENABLE_ACCE_COSTUME_SYSTEM:
  1356. slotNumberChecked = 0
  1357. if not constInfo.IS_AUTO_POTION(itemVnum):
  1358. self.wndItem.DeactivateSlot(i)
  1359.  
  1360. for j in xrange(acce.WINDOW_MAX_MATERIALS):
  1361. (isHere, iCell) = acce.GetAttachedItem(j)
  1362. if isHere:
  1363. if iCell == slotNumber:
  1364. self.wndItem.ActivateSlot(i, (36.00 / 255.0), (222.00 / 255.0), (3.00 / 255.0), 1.0)
  1365. if not slotNumber in self.listAttachedAcces:
  1366. self.listAttachedAcces.append(slotNumber)
  1367.  
  1368. slotNumberChecked = 1
  1369. else:
  1370. if slotNumber in self.listAttachedAcces and not slotNumberChecked:
  1371. self.wndItem.DeactivateSlot(i)
  1372. self.listAttachedAcces.remove(slotNumber)
  1373.  
  1374. self.wndItem.RefreshSlot()
  1375.  
  1376. if self.wndBelt:
  1377. self.wndBelt.RefreshSlot()
  1378.  
  1379. def RefreshEquipSlotWindow(self):
  1380. getItemVNum=player.GetItemIndex
  1381. getItemCount=player.GetItemCount
  1382. setItemVNum=self.wndEquip.SetItemSlot
  1383. for i in xrange(player.EQUIPMENT_PAGE_COUNT):
  1384. slotNumber = player.EQUIPMENT_SLOT_START + i
  1385. itemCount = getItemCount(slotNumber)
  1386. if itemCount <= 1:
  1387. itemCount = 0
  1388. setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount)
  1389.  
  1390. if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
  1391. for i in xrange(player.NEW_EQUIPMENT_SLOT_COUNT):
  1392. slotNumber = player.NEW_EQUIPMENT_SLOT_START + i
  1393. itemCount = getItemCount(slotNumber)
  1394. if itemCount <= 1:
  1395. itemCount = 0
  1396. setItemVNum(slotNumber, getItemVNum(slotNumber), itemCount)
  1397. print "ENABLE_NEW_EQUIPMENT_SYSTEM", slotNumber, itemCount, getItemVNum(slotNumber)
  1398.  
  1399. self.wndEquip.RefreshSlot()
  1400.  
  1401. if self.wndCostume:
  1402. self.wndCostume.RefreshCostumeSlot()
  1403.  
  1404. def RefreshItemSlot(self):
  1405. self.RefreshBagSlotWindow()
  1406. self.RefreshEquipSlotWindow()
  1407.  
  1408. def RefreshStatus(self):
  1409. money = player.GetElk()
  1410. self.wndMoney.SetText(localeInfo.NumberToMoneyString(money))
  1411.  
  1412. def SetItemToolTip(self, tooltipItem):
  1413. self.tooltipItem = tooltipItem
  1414.  
  1415. def SellItem(self):
  1416. if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
  1417. if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
  1418. ## ¿ëÈ¥¼®µµ Æȸ®°Ô ÇÏ´Â ±â´É Ãß°¡Çϸ鼭 ÀÎÀÚ type Ãß°¡
  1419. net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY)
  1420. snd.PlaySound("sound/ui/money.wav")
  1421. self.OnCloseQuestionDialog()
  1422.  
  1423. def OnDetachMetinFromItem(self):
  1424. if None == self.questionDialog:
  1425. return
  1426.  
  1427. #net.SendItemUseToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos)
  1428. self.__SendUseItemToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos)
  1429. self.OnCloseQuestionDialog()
  1430.  
  1431. def OnCloseQuestionDialog(self):
  1432. if not self.questionDialog:
  1433. return
  1434.  
  1435. self.questionDialog.Close()
  1436. self.questionDialog = None
  1437. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1438.  
  1439. ## Slot Event
  1440. def SelectEmptySlot(self, selectedSlotPos):
  1441. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
  1442. return
  1443.  
  1444. selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos)
  1445.  
  1446. if mouseModule.mouseController.isAttached():
  1447.  
  1448. attachedSlotType = mouseModule.mouseController.GetAttachedType()
  1449. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1450. attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  1451. attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  1452.  
  1453. if player.SLOT_TYPE_INVENTORY == attachedSlotType:
  1454. #@fixme011 BEGIN (block ds equip)
  1455. attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
  1456. if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos):
  1457. mouseModule.mouseController.DeattachObject()
  1458. return
  1459. #@fixme011 END
  1460.  
  1461. itemCount = player.GetItemCount(attachedSlotPos)
  1462. attachedCount = mouseModule.mouseController.GetAttachedItemCount()
  1463. self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)
  1464.  
  1465. if item.IsRefineScroll(attachedItemIndex):
  1466. self.wndItem.SetUseMode(False)
  1467.  
  1468. elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType:
  1469. mouseModule.mouseController.RunCallBack("INVENTORY")
  1470.  
  1471. elif player.SLOT_TYPE_SHOP == attachedSlotType:
  1472. net.SendShopBuyPacket(attachedSlotPos)
  1473.  
  1474. elif player.SLOT_TYPE_SAFEBOX == attachedSlotType:
  1475.  
  1476. if player.ITEM_MONEY == attachedItemIndex:
  1477. net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
  1478. snd.PlaySound("sound/ui/money.wav")
  1479.  
  1480. else:
  1481. net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos)
  1482.  
  1483. elif player.SLOT_TYPE_MALL == attachedSlotType:
  1484. net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos)
  1485.  
  1486. mouseModule.mouseController.DeattachObject()
  1487.  
  1488. def SelectItemSlot(self, itemSlotIndex):
  1489. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
  1490. return
  1491.  
  1492. itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex)
  1493.  
  1494. if mouseModule.mouseController.isAttached():
  1495. attachedSlotType = mouseModule.mouseController.GetAttachedType()
  1496. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1497. attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
  1498.  
  1499.  
  1500. if app.ENABLE_LSM2_NEW_STORAGE:
  1501. if player.SLOT_TYPE_INVENTORY == attachedSlotType or player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType:
  1502. self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex)
  1503. else:
  1504. if player.SLOT_TYPE_INVENTORY == attachedSlotType:
  1505. #@fixme011 BEGIN (block ds equip)
  1506. attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
  1507. if player.IsDSEquipmentSlot(attachedInvenType, attachedSlotPos):
  1508. mouseModule.mouseController.DeattachObject()
  1509. return
  1510. #@fixme011 END
  1511. self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex)
  1512.  
  1513. mouseModule.mouseController.DeattachObject()
  1514.  
  1515. else:
  1516.  
  1517. curCursorNum = app.GetCursor()
  1518. if app.SELL == curCursorNum:
  1519. self.__SellItem(itemSlotIndex)
  1520.  
  1521. elif app.BUY == curCursorNum:
  1522. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)
  1523.  
  1524. elif app.IsPressed(app.DIK_LALT):
  1525. link = player.GetItemLink(itemSlotIndex)
  1526. ime.PasteString(link)
  1527.  
  1528. elif app.IsPressed(app.DIK_LSHIFT):
  1529. itemCount = player.GetItemCount(itemSlotIndex)
  1530.  
  1531. if itemCount > 1:
  1532. self.dlgPickItem.SetTitleName(localeInfo.PICK_ITEM_TITLE)
  1533. self.dlgPickItem.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
  1534. self.dlgPickItem.Open(itemCount)
  1535. self.dlgPickItem.itemGlobalSlotIndex = itemSlotIndex
  1536. #else:
  1537. #selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  1538. #mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum)
  1539.  
  1540. elif app.IsPressed(app.DIK_LCONTROL):
  1541. itemIndex = player.GetItemIndex(itemSlotIndex)
  1542.  
  1543. if True == item.CanAddToQuickSlotItem(itemIndex):
  1544. player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
  1545. else:
  1546. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM)
  1547.  
  1548. else:
  1549. selectedItemVNum = player.GetItemIndex(itemSlotIndex)
  1550. itemCount = player.GetItemCount(itemSlotIndex)
  1551. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
  1552.  
  1553. if self.__IsUsableItemToItem(selectedItemVNum, itemSlotIndex):
  1554. self.wndItem.SetUseMode(True)
  1555. else:
  1556. self.wndItem.SetUseMode(False)
  1557.  
  1558. snd.PlaySound("sound/ui/pick.wav")
  1559.  
  1560. def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos):
  1561. if app.ENABLE_LSM2_NEW_STORAGE:
  1562. if srcItemSlotPos == dstItemSlotPos and not item.IsMetin(srcItemVID):
  1563. return
  1564. else:
  1565. if srcItemSlotPos == dstItemSlotPos:
  1566. return
  1567.  
  1568. if app.ENABLE_SOULBIND_SYSTEM:
  1569. SrcItemVNum = player.GetItemIndex(srcItemSlotPos)
  1570. DstItemVNum = player.GetItemIndex(dstItemSlotPos)
  1571. item.SelectItem(SrcItemVNum)
  1572. SrcSubType = item.GetItemSubType()
  1573. if SrcSubType == item.USE_BIND or SrcSubType == item.USE_UNBIND:
  1574. item.SelectItem(DstItemVNum)
  1575. if item.IsAntiFlag(item.ANTIFLAG_BIND):
  1576. return
  1577. else:
  1578. if SrcSubType == item.USE_BIND and player.GetItemBind(dstItemSlotPos) > 1:
  1579. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SOULBIND_ALERT3)
  1580. elif SrcSubType == item.USE_BIND and player.GetItemBind(dstItemSlotPos) == 1:
  1581. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SOULBIND_ALERT2)
  1582. elif SrcSubType == item.USE_UNBIND and player.GetItemBind(dstItemSlotPos) > 1:
  1583. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SOULBIND_ALERT3)
  1584. elif SrcSubType == item.USE_UNBIND and player.GetItemBind(dstItemSlotPos) != 1:
  1585. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SOULBIND_ALERT1)
  1586. else:
  1587. action = "bind"
  1588. if SrcSubType == item.USE_UNBIND:
  1589. action = "unbind"
  1590.  
  1591. self.__SoulBindItem(srcItemSlotPos, dstItemSlotPos, action)
  1592.  
  1593. return
  1594. else:
  1595. if item.IsRefineScroll(srcItemVID):
  1596. self.RefineItem(srcItemSlotPos, dstItemSlotPos)
  1597. self.wndItem.SetUseMode(FALSE)
  1598. elif item.IsMetin(srcItemVID):
  1599. self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)
  1600. elif item.IsDetachScroll(srcItemVID):
  1601. self.DetachMetinFromItem(srcItemSlotPos, dstItemSlotPos)
  1602. elif item.IsKey(srcItemVID):
  1603. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1604. elif (player.GetItemFlags(srcItemSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
  1605. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1606. elif item.GetUseType(srcItemVID) in self.USE_TYPE_TUPLE:
  1607. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1608. else:
  1609. if player.IsEquipmentSlot(dstItemSlotPos):
  1610. if item.IsEquipmentVID(srcItemVID):
  1611. self.__UseItem(srcItemSlotPos)
  1612. else:
  1613. self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0)
  1614. else:
  1615. if item.IsRefineScroll(srcItemVID):
  1616. self.RefineItem(srcItemSlotPos, dstItemSlotPos)
  1617. self.wndItem.SetUseMode(FALSE)
  1618. elif item.IsMetin(srcItemVID):
  1619. self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)
  1620. elif item.IsDetachScroll(srcItemVID):
  1621. self.DetachMetinFromItem(srcItemSlotPos, dstItemSlotPos)
  1622. elif item.IsKey(srcItemVID):
  1623. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1624. elif (player.GetItemFlags(srcItemSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
  1625. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1626. elif item.GetUseType(srcItemVID) in self.USE_TYPE_TUPLE:
  1627. self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos)
  1628. else:
  1629. if player.IsEquipmentSlot(dstItemSlotPos):
  1630. if item.IsEquipmentVID(srcItemVID):
  1631. self.__UseItem(srcItemSlotPos)
  1632. else:
  1633. self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0)
  1634.  
  1635. def __SellItem(self, itemSlotPos):
  1636. if not player.IsEquipmentSlot(itemSlotPos):
  1637. self.sellingSlotNumber = itemSlotPos
  1638. itemIndex = player.GetItemIndex(itemSlotPos)
  1639. itemCount = player.GetItemCount(itemSlotPos)
  1640.  
  1641.  
  1642. self.sellingSlotitemIndex = itemIndex
  1643. self.sellingSlotitemCount = itemCount
  1644.  
  1645. item.SelectItem(itemIndex)
  1646. ## ¾ÈƼ Ç÷¹±× °Ë»ç ºüÁ®¼­ Ãß°¡
  1647. ## 20140220
  1648. if item.IsAntiFlag(item.ANTIFLAG_SELL):
  1649. popup = uiCommon.PopupDialog()
  1650. popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
  1651. popup.SetAcceptEvent(self.__OnClosePopupDialog)
  1652. popup.Open()
  1653. self.popup = popup
  1654. return
  1655.  
  1656. itemPrice = item.GetISellItemPrice()
  1657.  
  1658. if item.Is1GoldItem():
  1659. itemPrice = itemCount / itemPrice / 5
  1660. else:
  1661. itemPrice = itemPrice * itemCount / 5
  1662.  
  1663. item.GetItemName(itemIndex)
  1664. itemName = item.GetItemName()
  1665.  
  1666. self.questionDialog = uiCommon.QuestionDialog()
  1667. self.questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, itemCount, itemPrice))
  1668. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.SellItem))
  1669. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1670. self.questionDialog.Open()
  1671. self.questionDialog.count = itemCount
  1672.  
  1673. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1674.  
  1675. def __OnClosePopupDialog(self):
  1676. self.pop = None
  1677.  
  1678. def RefineItem(self, scrollSlotPos, targetSlotPos):
  1679.  
  1680. scrollIndex = player.GetItemIndex(scrollSlotPos)
  1681. targetIndex = player.GetItemIndex(targetSlotPos)
  1682.  
  1683. if player.REFINE_OK != player.CanRefine(scrollIndex, targetSlotPos):
  1684. return
  1685.  
  1686. ###########################################################
  1687. self.__SendUseItemToItemPacket(scrollSlotPos, targetSlotPos)
  1688. #net.SendItemUseToItemPacket(scrollSlotPos, targetSlotPos)
  1689. return
  1690. ###########################################################
  1691.  
  1692. ###########################################################
  1693. #net.SendRequestRefineInfoPacket(targetSlotPos)
  1694. #return
  1695. ###########################################################
  1696.  
  1697. result = player.CanRefine(scrollIndex, targetSlotPos)
  1698.  
  1699. if player.REFINE_ALREADY_MAX_SOCKET_COUNT == result:
  1700. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  1701. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_MORE_SOCKET)
  1702.  
  1703. elif player.REFINE_NEED_MORE_GOOD_SCROLL == result:
  1704. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  1705. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NEED_BETTER_SCROLL)
  1706.  
  1707. elif player.REFINE_CANT_MAKE_SOCKET_ITEM == result:
  1708. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  1709. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_SOCKET_DISABLE_ITEM)
  1710.  
  1711. elif player.REFINE_NOT_NEXT_GRADE_ITEM == result:
  1712. #snd.PlaySound("sound/ui/jaeryun_fail.wav")
  1713. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_UPGRADE_DISABLE_ITEM)
  1714.  
  1715. elif player.REFINE_CANT_REFINE_METIN_TO_EQUIPMENT == result:
  1716. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)
  1717.  
  1718. if player.REFINE_OK != result:
  1719. return
  1720.  
  1721. self.refineDialog.Open(scrollSlotPos, targetSlotPos)
  1722.  
  1723. def DetachMetinFromItem(self, scrollSlotPos, targetSlotPos):
  1724. scrollIndex = player.GetItemIndex(scrollSlotPos)
  1725. targetIndex = player.GetItemIndex(targetSlotPos)
  1726. if app.ENABLE_ACCE_COSTUME_SYSTEM:
  1727. if not player.CanDetach(scrollIndex, targetSlotPos):
  1728. item.SelectItem(scrollIndex)
  1729. if item.GetValue(0) == acce.CLEAN_ATTR_VALUE0:
  1730. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ACCE_FAILURE_CLEAN)
  1731. else:
  1732. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
  1733.  
  1734. return
  1735. else:
  1736. if not player.CanDetach(scrollIndex, targetSlotPos):
  1737. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_METIN_INSEPARABLE_ITEM)
  1738. return
  1739.  
  1740. self.questionDialog = uiCommon.QuestionDialog()
  1741. self.questionDialog.SetText(localeInfo.REFINE_DO_YOU_SEPARATE_METIN)
  1742. if app.ENABLE_ACCE_COSTUME_SYSTEM:
  1743. item.SelectItem(targetIndex)
  1744. if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_ACCE:
  1745. item.SelectItem(scrollIndex)
  1746. if item.GetValue(0) == acce.CLEAN_ATTR_VALUE0:
  1747. self.questionDialog.SetText(localeInfo.ACCE_DO_YOU_CLEAN)
  1748.  
  1749. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDetachMetinFromItem))
  1750. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1751. self.questionDialog.Open()
  1752. self.questionDialog.sourcePos = scrollSlotPos
  1753. self.questionDialog.targetPos = targetSlotPos
  1754.  
  1755. def AttachMetinToItem(self, metinSlotPos, targetSlotPos):
  1756. if app.ENABLE_LSM2_NEW_STORAGE:
  1757. metinIndex = player.GetItemIndex(player.STONE_INVENTORY, metinSlotPos)
  1758. else:
  1759. metinIndex = player.GetItemIndex(metinSlotPos)
  1760. targetIndex = player.GetItemIndex(targetSlotPos)
  1761.  
  1762. item.SelectItem(metinIndex)
  1763. itemName = item.GetItemName()
  1764.  
  1765. result = player.CanAttachMetin(metinIndex, targetSlotPos)
  1766.  
  1767. if player.ATTACH_METIN_NOT_MATCHABLE_ITEM == result:
  1768. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_CAN_NOT_ATTACH(itemName))
  1769.  
  1770. if player.ATTACH_METIN_NO_MATCHABLE_SOCKET == result:
  1771. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_SOCKET(itemName))
  1772.  
  1773. elif player.ATTACH_METIN_NOT_EXIST_GOLD_SOCKET == result:
  1774. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_NO_GOLD_SOCKET(itemName))
  1775.  
  1776. elif player.ATTACH_METIN_CANT_ATTACH_TO_EQUIPMENT == result:
  1777. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.REFINE_FAILURE_EQUIP_ITEM)
  1778.  
  1779. if player.ATTACH_METIN_OK != result:
  1780. return
  1781.  
  1782. self.attachMetinDialog.Open(metinSlotPos, targetSlotPos)
  1783.  
  1784.  
  1785.  
  1786. def OverOutItem(self):
  1787. self.wndItem.SetUsableItem(False)
  1788. if None != self.tooltipItem:
  1789. self.tooltipItem.HideToolTip()
  1790.  
  1791. def OverInItem(self, overSlotPos):
  1792. overSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(overSlotPos)
  1793. #self.wndItem.SetUsableItem(False)
  1794.  
  1795. if mouseModule.mouseController.isAttached():
  1796. attachedItemType = mouseModule.mouseController.GetAttachedType()
  1797. if app.ENABLE_LSM2_NEW_STORAGE:
  1798. if player.SLOT_TYPE_INVENTORY == attachedItemType or player.SLOT_TYPE_STONE_INVENTORY == attachedItemType:
  1799. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1800. attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()
  1801.  
  1802. if attachedItemVNum==player.ITEM_MONEY: # @fixme005
  1803. pass
  1804. elif self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos):
  1805. self.wndItem.SetUsableItem(True)
  1806. self.wndItem.SetUseMode(True)
  1807. self.ShowToolTip(overSlotPos)
  1808. return
  1809. else:
  1810. if player.SLOT_TYPE_INVENTORY == attachedItemType:
  1811. attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1812. attachedItemVNum = mouseModule.mouseController.GetAttachedItemIndex()
  1813.  
  1814. if attachedItemVNum==player.ITEM_MONEY: # @fixme005
  1815. pass
  1816. elif self.__CanUseSrcItemToDstItem(attachedItemVNum, attachedSlotPos, overSlotPos):
  1817. self.wndItem.SetUsableItem(True)
  1818. self.ShowToolTip(overSlotPos)
  1819. return
  1820.  
  1821. self.ShowToolTip(overSlotPos)
  1822.  
  1823.  
  1824. def __IsUsableItemToItem(self, srcItemVNum, srcSlotPos):
  1825. "´Ù¸¥ ¾ÆÀÌÅÛ¿¡ »ç¿ëÇÒ ¼ö ÀÖ´Â ¾ÆÀÌÅÛÀΰ¡?"
  1826.  
  1827. if item.IsRefineScroll(srcItemVNum):
  1828. return True
  1829. elif item.IsMetin(srcItemVNum):
  1830. return True
  1831. elif item.IsDetachScroll(srcItemVNum):
  1832. return True
  1833. elif item.IsKey(srcItemVNum):
  1834. return True
  1835. elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
  1836. return True
  1837. else:
  1838. if item.GetUseType(srcItemVNum) in self.USE_TYPE_TUPLE:
  1839. return True
  1840.  
  1841. return False
  1842.  
  1843. def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos):
  1844. "´ë»ó ¾ÆÀÌÅÛ¿¡ »ç¿ëÇÒ ¼ö Àִ°¡?"
  1845.  
  1846. if app.ENABLE_LSM2_NEW_STORAGE:
  1847. if srcSlotPos == dstSlotPos and not item.IsMetin(srcItemVNum):
  1848. return False
  1849. else:
  1850. if srcSlotPos == dstSlotPos:
  1851. return False
  1852.  
  1853. if item.IsRefineScroll(srcItemVNum):
  1854. if player.REFINE_OK == player.CanRefine(srcItemVNum, dstSlotPos):
  1855. return True
  1856. elif item.IsMetin(srcItemVNum):
  1857. if player.ATTACH_METIN_OK == player.CanAttachMetin(srcItemVNum, dstSlotPos):
  1858. return True
  1859. elif item.IsDetachScroll(srcItemVNum):
  1860. if player.DETACH_METIN_OK == player.CanDetach(srcItemVNum, dstSlotPos):
  1861. return True
  1862. elif item.IsKey(srcItemVNum):
  1863. if player.CanUnlock(srcItemVNum, dstSlotPos):
  1864. return True
  1865.  
  1866. elif (player.GetItemFlags(srcSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE:
  1867. return True
  1868.  
  1869. else:
  1870. useType=item.GetUseType(srcItemVNum)
  1871.  
  1872. if "USE_CLEAN_SOCKET" == useType:
  1873. if self.__CanCleanBrokenMetinStone(dstSlotPos):
  1874. return True
  1875. elif "USE_CHANGE_ATTRIBUTE" == useType:
  1876. if self.__CanChangeItemAttrList(dstSlotPos):
  1877. return True
  1878. elif "USE_ADD_ATTRIBUTE" == useType:
  1879. if self.__CanAddItemAttr(dstSlotPos):
  1880. return True
  1881. elif "USE_ADD_ATTRIBUTE2" == useType:
  1882. if self.__CanAddItemAttr(dstSlotPos):
  1883. return True
  1884. elif "USE_ADD_ACCESSORY_SOCKET" == useType:
  1885. if self.__CanAddAccessorySocket(dstSlotPos):
  1886. return True
  1887. elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType:
  1888. if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum):
  1889. return True;
  1890. elif "USE_PUT_INTO_BELT_SOCKET" == useType:
  1891. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1892. print "USE_PUT_INTO_BELT_SOCKET", srcItemVNum, dstItemVNum
  1893.  
  1894. item.SelectItem(dstItemVNum)
  1895.  
  1896. if item.ITEM_TYPE_BELT == item.GetItemType():
  1897. return True
  1898. elif useType == "USE_BIND" or useType == "USE_UNBIND":
  1899. if not app.ENABLE_SOULBIND_SYSTEM:
  1900. return False
  1901.  
  1902. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1903. item.SelectItem(dstItemVNum)
  1904. if item.IsAntiFlag(item.ANTIFLAG_BIND):
  1905. return False
  1906. elif useType == "USE_BIND" and player.GetItemBind(dstSlotPos) == 1:
  1907. return False
  1908. elif useType == "USE_BIND" and player.GetItemBind(dstSlotPos) > 1:
  1909. return False
  1910. elif useType == "USE_UNBIND" and player.GetItemBind(dstSlotPos) != 1:
  1911. return False
  1912. else:
  1913. return True
  1914. elif "USE_CHANGE_COSTUME_ATTR" == useType:
  1915. if self.__CanChangeCostumeAttrList(dstSlotPos):
  1916. return True
  1917. elif "USE_RESET_COSTUME_ATTR" == useType:
  1918. if self.__CanResetCostumeAttr(dstSlotPos):
  1919. return True
  1920.  
  1921. return False
  1922.  
  1923. def __CanCleanBrokenMetinStone(self, dstSlotPos):
  1924. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1925. if dstItemVNum == 0:
  1926. return False
  1927.  
  1928. item.SelectItem(dstItemVNum)
  1929.  
  1930. if item.ITEM_TYPE_WEAPON != item.GetItemType():
  1931. return False
  1932.  
  1933. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1934. if player.GetItemMetinSocket(dstSlotPos, i) == constInfo.ERROR_METIN_STONE:
  1935. return True
  1936.  
  1937. return False
  1938.  
  1939. if app.ENABLE_SOULBIND_SYSTEM:
  1940. def __SoulBindItem(self, scrollSlotPos, targetSlotPos, action = "bind"):
  1941. DstItemVNum = player.GetItemIndex(targetSlotPos)
  1942. item.SelectItem(DstItemVNum)
  1943. item_name = item.GetItemName()
  1944. self.questionDialog = uiCommon.QuestionDialog2()
  1945. if action == "bind":
  1946. self.questionDialog.SetText1(item_name)
  1947. self.questionDialog.SetText2(localeInfo.INVENTORY_REALLY_USE_ITEM)
  1948. else:
  1949. self.questionDialog.SetText1(item_name)
  1950. self.questionDialog.SetText2(localeInfo.INVENTORY_REALLY_USE_ITEM)
  1951. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnAcceptSoulBindItem))
  1952. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  1953. self.questionDialog.Open()
  1954. self.questionDialog.sourcePos = scrollSlotPos
  1955. self.questionDialog.targetPos = targetSlotPos
  1956.  
  1957. def OnAcceptSoulBindItem(self):
  1958. if self.questionDialog == None:
  1959. return
  1960.  
  1961. self.__SendUseItemToItemPacket(self.questionDialog.sourcePos, self.questionDialog.targetPos)
  1962. self.OnCloseQuestionDialog()
  1963.  
  1964. def __CanChangeItemAttrList(self, dstSlotPos):
  1965. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1966. if dstItemVNum == 0:
  1967. return False
  1968.  
  1969. item.SelectItem(dstItemVNum)
  1970.  
  1971. if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
  1972. return False
  1973.  
  1974. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1975. if player.GetItemAttribute(dstSlotPos, i) != 0:
  1976. return True
  1977.  
  1978. return False
  1979.  
  1980. def __CanChangeCostumeAttrList(self, dstSlotPos):
  1981. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1982. if dstItemVNum == 0:
  1983. return False
  1984.  
  1985. item.SelectItem(dstItemVNum)
  1986.  
  1987. if item.GetItemType() != item.ITEM_TYPE_COSTUME:
  1988. return False
  1989.  
  1990. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1991. if player.GetItemAttribute(dstSlotPos, i) != 0:
  1992. return True
  1993.  
  1994. return False
  1995.  
  1996. def __CanResetCostumeAttr(self, dstSlotPos):
  1997. dstItemVNum = player.GetItemIndex(dstSlotPos)
  1998. if dstItemVNum == 0:
  1999. return False
  2000.  
  2001. item.SelectItem(dstItemVNum)
  2002.  
  2003. if item.GetItemType() != item.ITEM_TYPE_COSTUME:
  2004. return False
  2005.  
  2006. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2007. if player.GetItemAttribute(dstSlotPos, i) != 0:
  2008. return True
  2009.  
  2010. return False
  2011.  
  2012. def __CanPutAccessorySocket(self, dstSlotPos, mtrlVnum):
  2013. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2014. if dstItemVNum == 0:
  2015. return False
  2016.  
  2017. item.SelectItem(dstItemVNum)
  2018.  
  2019. if item.GetItemType() != item.ITEM_TYPE_ARMOR:
  2020. return False
  2021.  
  2022. if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
  2023. return False
  2024.  
  2025. curCount = player.GetItemMetinSocket(dstSlotPos, 0)
  2026. maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
  2027.  
  2028. if mtrlVnum != constInfo.GET_ACCESSORY_MATERIAL_VNUM(dstItemVNum, item.GetItemSubType()):
  2029. return False
  2030.  
  2031. if curCount>=maxCount:
  2032. return False
  2033.  
  2034. return True
  2035.  
  2036. def __CanAddAccessorySocket(self, dstSlotPos):
  2037. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2038. if dstItemVNum == 0:
  2039. return False
  2040.  
  2041. item.SelectItem(dstItemVNum)
  2042.  
  2043. if item.GetItemType() != item.ITEM_TYPE_ARMOR:
  2044. return False
  2045.  
  2046. if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
  2047. return False
  2048.  
  2049. curCount = player.GetItemMetinSocket(dstSlotPos, 0)
  2050. maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
  2051.  
  2052. ACCESSORY_SOCKET_MAX_SIZE = 3
  2053. if maxCount >= ACCESSORY_SOCKET_MAX_SIZE:
  2054. return False
  2055.  
  2056. return True
  2057.  
  2058. def __CanAddItemAttr(self, dstSlotPos):
  2059. dstItemVNum = player.GetItemIndex(dstSlotPos)
  2060. if dstItemVNum == 0:
  2061. return False
  2062.  
  2063. item.SelectItem(dstItemVNum)
  2064.  
  2065. if not item.GetItemType() in (item.ITEM_TYPE_WEAPON, item.ITEM_TYPE_ARMOR):
  2066. return False
  2067.  
  2068. attrCount = 0
  2069. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  2070. if player.GetItemAttribute(dstSlotPos, i) != 0:
  2071. attrCount += 1
  2072.  
  2073. if attrCount<4:
  2074. return True
  2075.  
  2076. return False
  2077.  
  2078. def ShowToolTip(self, slotIndex):
  2079. if None != self.tooltipItem:
  2080. self.tooltipItem.SetInventoryItem(slotIndex)
  2081.  
  2082. def OnTop(self):
  2083. if None != self.tooltipItem:
  2084. self.tooltipItem.SetTop()
  2085.  
  2086. def OnPressEscapeKey(self):
  2087. self.Close()
  2088. return True
  2089.  
  2090. if app.ADD_INVENTORY:
  2091. def genislet(self):
  2092. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2093. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.ENVANTER_UYARI)
  2094. return
  2095. net.Envanter_genislet()
  2096. self.OnCloseQuestionDialog()
  2097.  
  2098. def UseItemSlot(self, slotIndex):
  2099. curCursorNum = app.GetCursor()
  2100. if app.SELL == curCursorNum:
  2101. return
  2102.  
  2103. if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
  2104. return
  2105.  
  2106. slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex)
  2107.  
  2108. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  2109. if self.wndDragonSoulRefine.IsShow():
  2110. self.wndDragonSoulRefine.AutoSetItem((player.INVENTORY, slotIndex), 1)
  2111. return
  2112.  
  2113. if app.ENABLE_ACCE_COSTUME_SYSTEM:
  2114. if self.isShowAcceWindow():
  2115. acce.Add(player.INVENTORY, slotIndex, 255)
  2116. return
  2117.  
  2118. self.__UseItem(slotIndex)
  2119. mouseModule.mouseController.DeattachObject()
  2120. self.OverOutItem()
  2121.  
  2122. def __UseItem(self, slotIndex):
  2123. ItemVNum = player.GetItemIndex(slotIndex)
  2124. item.SelectItem(ItemVNum)
  2125.  
  2126. if app.ADD_INVENTORY:
  2127. if ItemVNum == 72320:
  2128. if player.GetEnvanter() < 4:
  2129. envanter = 2
  2130. self.questionDialog = uiCommon.QuestionDialog()
  2131. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  2132. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  2133. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  2134. self.questionDialog.Open()
  2135. self.questionDialog.slotIndex = slotIndex
  2136. elif player.GetEnvanter() == 4 or player.GetEnvanter() == 5:
  2137. envanter = 3
  2138. self.questionDialog = uiCommon.QuestionDialog()
  2139. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  2140. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  2141. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  2142. self.questionDialog.Open()
  2143. self.questionDialog.slotIndex = slotIndex
  2144. elif player.GetEnvanter() == 6 or player.GetEnvanter() == 7 or player.GetEnvanter() == 8:
  2145. envanter = 4
  2146. self.questionDialog = uiCommon.QuestionDialog()
  2147. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  2148. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  2149. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  2150. self.questionDialog.Open()
  2151. self.questionDialog.slotIndex = slotIndex
  2152. elif player.GetEnvanter() == 9 or player.GetEnvanter() == 10 or player.GetEnvanter() == 11:
  2153. envanter = 5
  2154. self.questionDialog = uiCommon.QuestionDialog()
  2155. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  2156. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  2157. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  2158. self.questionDialog.Open()
  2159. self.questionDialog.slotIndex = slotIndex
  2160. elif player.GetEnvanter() == 12 or player.GetEnvanter() == 13 or player.GetEnvanter() == 14:
  2161. envanter = 6
  2162. self.questionDialog = uiCommon.QuestionDialog()
  2163. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  2164. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  2165. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  2166. self.questionDialog.Open()
  2167. self.questionDialog.slotIndex = slotIndex
  2168. elif player.GetEnvanter() == 15 or player.GetEnvanter() == 16 or player.GetEnvanter() == 17:
  2169. envanter = 7
  2170. self.questionDialog = uiCommon.QuestionDialog()
  2171. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  2172. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  2173. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  2174. self.questionDialog.Open()
  2175. self.questionDialog.slotIndex = slotIndex
  2176. else:
  2177. self.wndpopupdialog = uiCommon.PopupDialog()
  2178. self.wndpopupdialog.SetText(localeInfo.ENVANTER_ZATEN_GENIS_3)
  2179. self.wndpopupdialog.Open()
  2180. if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE):
  2181. self.questionDialog = uiCommon.QuestionDialog()
  2182. self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM)
  2183. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnAccept))
  2184. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel))
  2185. self.questionDialog.Open()
  2186. self.questionDialog.slotIndex = slotIndex
  2187.  
  2188. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  2189.  
  2190. else:
  2191. self.__SendUseItemPacket(slotIndex)
  2192. #net.SendItemUsePacket(slotIndex)
  2193.  
  2194. def __UseItemQuestionDialog_OnCancel(self):
  2195. self.OnCloseQuestionDialog()
  2196.  
  2197. def __UseItemQuestionDialog_OnAccept(self):
  2198. self.__SendUseItemPacket(self.questionDialog.slotIndex)
  2199. self.OnCloseQuestionDialog()
  2200.  
  2201. def __SendUseItemToItemPacket(self, srcSlotPos, dstSlotPos):
  2202. # °³ÀλóÁ¡ ¿­°í ÀÖ´Â µ¿¾È ¾ÆÀÌÅÛ »ç¿ë ¹æÁö
  2203. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2204. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
  2205. return
  2206.  
  2207. net.SendItemUseToItemPacket(srcSlotPos, dstSlotPos)
  2208.  
  2209. def __SendUseItemPacket(self, slotPos):
  2210. # °³ÀλóÁ¡ ¿­°í ÀÖ´Â µ¿¾È ¾ÆÀÌÅÛ »ç¿ë ¹æÁö
  2211. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2212. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
  2213. return
  2214.  
  2215. net.SendItemUsePacket(slotPos)
  2216.  
  2217. def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):
  2218. # °³ÀλóÁ¡ ¿­°í ÀÖ´Â µ¿¾È ¾ÆÀÌÅÛ »ç¿ë ¹æÁö
  2219. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  2220. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP)
  2221. return
  2222.  
  2223. net.SendItemMovePacket(srcSlotPos, dstSlotPos, srcItemCount)
  2224.  
  2225. def SetDragonSoulRefineWindow(self, wndDragonSoulRefine):
  2226. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  2227. self.wndDragonSoulRefine = wndDragonSoulRefine
  2228.  
  2229. if app.ENABLE_ACCE_COSTUME_SYSTEM:
  2230. def SetAcceWindow(self, wndAcceCombine, wndAcceAbsorption):
  2231. self.wndAcceCombine = wndAcceCombine
  2232. self.wndAcceAbsorption = wndAcceAbsorption
  2233.  
  2234. def isShowAcceWindow(self):
  2235. if self.wndAcceCombine:
  2236. if self.wndAcceCombine.IsShow():
  2237. return 1
  2238.  
  2239. if self.wndAcceAbsorption:
  2240. if self.wndAcceAbsorption.IsShow():
  2241. return 1
  2242.  
  2243. return 0
  2244.  
  2245. def OnMoveWindow(self, x, y):
  2246. # print "Inventory Global Pos : ", self.GetGlobalPosition()
  2247. if self.wndBelt:
  2248. # print "Belt Global Pos : ", self.wndBelt.GetGlobalPosition()
  2249. self.wndBelt.AdjustPositionAndSize()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement