Reklam vermek için [email protected]
Kaynak ikonu

[Python] Eşyaları Silmeden Önce Sor 1

indirmek için izniniz yok
Görsel,

localeinterface.txt:
# Ekle

HADES_ASK_DESTROY    You're sure you want to destroy this object?

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()

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())

uiscript ' e atılacak dosya için,

İNDİR: TIKLA
VT: TIKLA
Yazar
XxZeMaHSeRxX
Kaynak İndirilme
1
Görüntüleme
198
İlk yayınlama
Son Güncelleme
Değerlendirme
0.00 yıldız(lar) 0 rating
Üst