Görsel,
gyazo.com
[CODE lang="python" title="localeinterface.txt"]# Ekle
HADES_ASK_DESTROY You're sure you want to destroy this object?[/CODE]
[CODE lang="python" title="root/uicommon.py"]# Sona ekle
class Hades_QuestionDialogDestroy(QuestionDialog2):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.__CreateDialog()
def __del__(self):
QuestionDialog2.__del__(self)
def __CreateDialog(self):
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "uiscript/hades_question_dialog_destroy.py")
self.board = self.GetChild("board")
self.textLine = self.GetChild("destroy")
self.acceptButton = self.GetChild("accept")
self.cancelButton = self.GetChild("cancel")
def Open(self, timeout):
self.SetCenterPosition()
self.SetTop()
self.Show()
self.endTime = app.GetTime() + timeout
def Close(self):
self.Hide()[/CODE]
[CODE lang="python" title="root/game.py"]# Arat
def RequestDropItem(self, answer):
# Kod bloğundan sonra ekle
def RequestDestroyItem(self):
self.itemDropQuestionDialog.Close()
self.Hades_QuestionDialog = uiCommon.Hades_QuestionDialogDestroy()
self.Hades_QuestionDialog.Open(1)
self.Hades_QuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
self.Hades_QuestionDialog.SetCancelText(localeInfo.UI_DENY)
self.Hades_QuestionDialog.SetAcceptEvent(lambda arg = True: self.__RequestDestroyItem(arg))
self.Hades_QuestionDialog.SetCancelEvent(lambda arg = False: self.__RequestDestroyItem(arg))
def __RequestDestroyItem(self, answer):
if not self.Hades_QuestionDialog:
return
if answer:
dropType = self.itemDropQuestionDialog.dropType
dropNumber = self.itemDropQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
return
else:
self.__SendDestroyItemPacket(dropNumber)
self.Hades_QuestionDialog.Close()
self.Hades_QuestionDialog = None
# Arat
def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
# Ekle
itemDropQuestionDialog.SetDestroyEvent(lambda arg=True: self.RequestDestroyItem())
[/CODE]
uiscript ' e atılacak dosya için,
İNDİR: TIKLA
VT: TIKLA
Gyazo Screen Video
[CODE lang="python" title="localeinterface.txt"]# Ekle
HADES_ASK_DESTROY You're sure you want to destroy this object?[/CODE]
[CODE lang="python" title="root/uicommon.py"]# Sona ekle
class Hades_QuestionDialogDestroy(QuestionDialog2):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.__CreateDialog()
def __del__(self):
QuestionDialog2.__del__(self)
def __CreateDialog(self):
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "uiscript/hades_question_dialog_destroy.py")
self.board = self.GetChild("board")
self.textLine = self.GetChild("destroy")
self.acceptButton = self.GetChild("accept")
self.cancelButton = self.GetChild("cancel")
def Open(self, timeout):
self.SetCenterPosition()
self.SetTop()
self.Show()
self.endTime = app.GetTime() + timeout
def Close(self):
self.Hide()[/CODE]
[CODE lang="python" title="root/game.py"]# Arat
def RequestDropItem(self, answer):
# Kod bloğundan sonra ekle
def RequestDestroyItem(self):
self.itemDropQuestionDialog.Close()
self.Hades_QuestionDialog = uiCommon.Hades_QuestionDialogDestroy()
self.Hades_QuestionDialog.Open(1)
self.Hades_QuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
self.Hades_QuestionDialog.SetCancelText(localeInfo.UI_DENY)
self.Hades_QuestionDialog.SetAcceptEvent(lambda arg = True: self.__RequestDestroyItem(arg))
self.Hades_QuestionDialog.SetCancelEvent(lambda arg = False: self.__RequestDestroyItem(arg))
def __RequestDestroyItem(self, answer):
if not self.Hades_QuestionDialog:
return
if answer:
dropType = self.itemDropQuestionDialog.dropType
dropNumber = self.itemDropQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
return
else:
self.__SendDestroyItemPacket(dropNumber)
self.Hades_QuestionDialog.Close()
self.Hades_QuestionDialog = None
# Arat
def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
# Ekle
itemDropQuestionDialog.SetDestroyEvent(lambda arg=True: self.RequestDestroyItem())
[/CODE]
uiscript ' e atılacak dosya için,
İNDİR: TIKLA
VT: TIKLA
