Пример #1
0
    def Close(self):
        for index, key in self.SkillBookList.items():
            i = key[1]  # attached inven pos
            self.SetCanMouseEventSlot(i)

        net.SendSkillBookCombinationPacket(self.SkillBookList,
                                           SKILLBOOK_COMBI_UI_CLOSE)

        del self.SkillBookList
        del self.AcceptButton
        del self.CancelButton
        del self.Slot
        self.Hide()
Пример #2
0
    def Open(self):
        try:
            pyScrLoader = ui.PythonScriptLoader()
            pyScrLoader.LoadScriptFile(
                self, "UIScript/SkillBookCombinationDialog.py")
        except:
            import exception
            exception.Abort(
                "SkillBookCombinationWindow.Open.SkillBookCombinationDialog.py"
            )

        try:
            ## Title Bar Close Event
            self.GetChild("SkillBook_TitleBar").SetCloseEvent(
                ui.__mem_func__(self.Close))

            ## Button Event
            self.AcceptButton = self.GetChild("accept_button")
            self.CancelButton = self.GetChild("cancel_button")
            self.AcceptButton.SetEvent(ui.__mem_func__(self.ClickAcceptButton))
            self.CancelButton.SetEvent(ui.__mem_func__(self.Close))

            ## SkillBook Slot
            Slot = self.GetChild("SkillBookSlot")
            Slot.SetSelectEmptySlotEvent(ui.__mem_func__(
                self.SelectEmptySlot))  ## [Event] 빈 슬롯 Click 할 때
            Slot.SetSelectItemSlotEvent(ui.__mem_func__(
                self.SelectItemSlot))  ## [Event] 슬롯 안에 있는 Item Click 할 때
            Slot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
            Slot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
            self.Slot = Slot

            self.SkillBookList = {}

            if app.ENABLE_SLOT_MARKING_SYSTEM:
                self.interface.SetOnTopWindow(player.ON_TOP_WND_SKILLBOOK_COMB)
                self.interface.RefreshMarkInventoryBag()

            (self.StartPosX, self.StartPosY,
             z) = player.GetMainCharacterPosition()

            net.SendSkillBookCombinationPacket(self.SkillBookList,
                                               SKILLBOOK_COMBI_UI_OPEN)

            self.SetCenterPosition()
            self.SetTop()
        except:
            import exception
            exception.Abort("SkillBookCombinationWindow.Open.Child")
Пример #3
0
    def Close(self):
        if app.ENABLE_SLOT_MARKING_SYSTEM:
            for index, key in self.SkillBookList.items():
                i = key[1]  # attached inven pos
                self.SetCanMouseEventSlot(i)

            self.interface.SetOnTopWindow(player.ON_TOP_WND_NONE)
            self.interface.RefreshMarkInventoryBag()

        net.SendSkillBookCombinationPacket(self.SkillBookList,
                                           SKILLBOOK_COMBI_UI_CLOSE)

        del self.SkillBookList
        del self.AcceptButton
        del self.CancelButton
        del self.Slot
        self.Hide()
Пример #4
0
    def ClickAcceptButton(self):
        cnt = 0
        for i in self.SkillBookList:
            if not isinstance(i, types.NoneType):
                cnt += 1

        if cnt != SKILLBOOK_SLOT_MAX:
            chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.COMB_NOT_FULL_BOOK)
            return

        net.SendSkillBookCombinationPacket(self.SkillBookList,
                                           SKILLBOOK_COMBI_START)

        for index, key in self.SkillBookList.items():
            i = key[1]  # attached inven pos
            self.SetCanMouseEventSlot(i)

        for i in xrange(SKILLBOOK_SLOT_MAX):
            self.ClearSlot(i)

        self.Slot.RefreshSlot()