1. Game.py aratılır def __DropItem(self, attachedType, attachedItemIndex satır içinde tekrar aratılır (aynı işlem 2 kere yapılır)
  2. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount) ve alttaki ile değiştirilir
  3. if app.WJ_NEW_DROP_DIALOG:
  4. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP_NEW(dropItemName, attachedItemCount, localeInfo.NumberToMoneyString(player.GetISellItemPrice(attachedItemSlotPos)))
  5. else:
  6. questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  7. Tekrar aratılır: itemDropQuestionDialog = uiCommon.QuestionDialog() alttaki ile değiştirilir
  8. if app.WJ_NEW_DROP_DIALOG:
  9. itemDropQuestionDialog = uiCommon.QuestionDialogItem()
  10. else:
  11. itemDropQuestionDialog = uiCommon.QuestionDialog()
  12. Aratılır: itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg)) altına eklenir
  13. if app.WJ_NEW_DROP_DIALOG:
  14. itemDropQuestionDialog.SetDestroyEvent(lambda arg=True: self.RequestDestroyItem(arg))
  15. itemDropQuestionDialog.SetSellEvent(lambda arg=True: self.RequestSellItem(arg))
  16. Game.py içinde uygun bir yere eklenir;
  17. if app.WJ_NEW_DROP_DIALOG:
  18. def __SendDestroyItemPacket(self, itemVNum, itemInvenType = player.INVENTORY):
  19. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  20. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  21. return
  22. net.SendItemDestroyPacket(itemVNum)
  23. def __SendSellItemPacket(self, itemVNum, itemInvenTyoe = player.INVENTORY):
  24. if uiPrivateShopBuilder.IsBuildingPrivateShop():
  25. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  26. return
  27. net.SendItemSellPacket(itemVNum)
  28. def RequestDestroyItem(self, answer):
  29. if not self.itemDropQuestionDialog:
  30. return
  31. if answer:
  32. dropType = self.itemDropQuestionDialog.dropType
  33. dropNumber = self.itemDropQuestionDialog.dropNumber
  34. if player.SLOT_TYPE_INVENTORY == dropType:
  35. if dropNumber == player.ITEM_MONEY:
  36. return
  37. else:
  38. self.__SendDestroyItemPacket(dropNumber)
  39. self.itemDropQuestionDialog.Close()
  40. self.itemDropQuestionDialog = None
  41. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  42. def RequestSellItem(self, answer):
  43. if not self.itemDropQuestionDialog:
  44. return
  45. if answer:
  46. dropType = self.itemDropQuestionDialog.dropType
  47. dropNumber = self.itemDropQuestionDialog.dropNumber
  48. if player.SLOT_TYPE_INVENTORY == dropType:
  49. if dropNumber == player.ITEM_MONEY:
  50. return
  51. else:
  52. self.__SendSellItemPacket(dropNumber)
  53. self.itemDropQuestionDialog.Close()
  54. self.itemDropQuestionDialog = None
  55. constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  56. localeinfo.py içinde aratılır: def NumberToMoneyString(n) : satır sonuna eklenir
  57. if app.WJ_NEW_DROP_DIALOG:
  58. def HOW_MANY_ITEM_DO_YOU_DROP_NEW(dropItemName, dropItemCount, sellItemPrice) :
  59. if dropItemCount > 1 :
  60. return HOW_MANY_ITEM_DO_YOU_DROP_NEW2 % (dropItemName, dropItemCount, sellItemPrice)
  61. else :
  62. return HOW_MANY_ITEM_DO_YOU_DROP_NEW1 % (dropItemName, sellItemPrice)
  63. uicommon.py aratılır : class MoneyInputDialog(ui.ScriptWindow): satır sonuna eklenir
  64. if app.WJ_NEW_DROP_DIALOG:
  65. class QuestionDialogItem(ui.ScriptWindow):
  66. def __init__(self):
  67. ui.ScriptWindow.__init__(self)
  68. self.__CreateDialog()
  69. def __del__(self):
  70. ui.ScriptWindow.__del__(self)
  71. def __CreateDialog(self):
  72. pyScrLoader = ui.PythonScriptLoader()
  73. pyScrLoader.LoadScriptFile(self, "uiscript/questiondialog_item.py")
  74. self.board = self.GetChild("board")
  75. self.textLine = self.GetChild("message")
  76. self.acceptButton = self.GetChild("drop")
  77. self.destroyButton = self.GetChild("destroy")
  78. self.sellButton = self.GetChild("sell")
  79. self.cancelButton = self.GetChild("cancel")
  80. self.itemPic = self.GetChild("image")
  81. try:
  82. self.itemPic.LoadImage(item.GetIconImageFileName())
  83. except:
  84. dbg.TraceError("AttachMetinDialog.Open.LoadImage - Failed to find item data")
  85. def Open(self):
  86. self.SetCenterPosition()
  87. self.SetTop()
  88. self.Show()
  89. def Close(self):
  90. self.Hide()
  91. def SetWidth(self, width):
  92. height = self.GetHeight()
  93. self.SetSize(width, height)
  94. self.board.SetSize(width, height)
  95. self.SetCenterPosition()
  96. self.UpdateRect()
  97. def SAFE_SetAcceptEvent(self, event):
  98. self.acceptButton.SAFE_SetEvent(event)
  99. def SAFE_SetCancelEvent(self, event):
  100. self.cancelButton.SAFE_SetEvent(event)
  101. def SetAcceptEvent(self, event):
  102. self.acceptButton.SetEvent(event)
  103. def SetDestroyEvent(self, event):
  104. self.destroyButton.SetEvent(event)
  105. def SetSellEvent(self, event):
  106. self.sellButton.SetEvent(event)
  107. def SetCancelEvent(self, event):
  108. self.cancelButton.SetEvent(event)
  109. def SetText(self, text):
  110. self.textLine.SetText(text)
  111. def SetAcceptText(self, text):
  112. self.acceptButton.SetText(text)
  113. def SetCancelText(self, text):
  114. self.cancelButton.SetText(text)
  115. def OnPressEscapeKey(self):
  116. self.Close()
  117. return True
  118. locale_tr packında locale_game.txt eklenir
  119. HOW_MANY_ITEM_DO_YOU_DROP_NEW1 [ |cff8BBDFF|H|h%s|h|r ] Nesnesi ne yapılsın? (%s)
  120. HOW_MANY_ITEM_DO_YOU_DROP_NEW2 [ |cff8BBDFF|H|h%s|h|r |cffBCE55C|H|hx%d|h|r ] Nesneleri ne yapılsın? (%s)