예제 #1
0
 def RefreshOwnerSlot(self):
     for i in xrange(exchange.EXCHANGE_ITEM_MAX_NUM):
         itemIndex = exchange.GetItemVnumFromSelf(i)
         itemCount = exchange.GetItemCountFromSelf(i)
         if 1 == itemCount:
             itemCount = 0
         self.OwnerSlot.SetItemSlot(i, itemIndex, itemCount)
     self.OwnerSlot.RefreshSlot()
 def RefreshOwnerSlot(self):
     for i in xrange(exchange.EXCHANGE_ITEM_MAX_NUM):
         itemIndex = exchange.GetItemVnumFromSelf(i)
         itemCount = exchange.GetItemCountFromSelf(i)
         if 1 == itemCount:
             itemCount = 0
         self.OwnerSlot.SetItemSlot(i, itemIndex, itemCount)
         if app.ENABLE_CHANGELOOK_SYSTEM:
             itemTransmutedVnum = exchange.GetItemTransmutation(i, True)
             if itemTransmutedVnum:
                 self.OwnerSlot.DisableCoverButton(i)
             else:
                 self.OwnerSlot.EnableCoverButton(i)
     self.OwnerSlot.RefreshSlot()
예제 #3
0
    def AcceptExchange(self):
        if app.ENABLE_NEW_EXCHANGE_WINDOW:
            atLeastOneItem = 0
            atLeastOneYang = 0
            for i in xrange(exchange.EXCHANGE_ITEM_MAX_NUM):
                itemCount = exchange.GetItemCountFromTarget(i)
                if itemCount >= 1:
                    atLeastOneYang = 1
                    break

            if exchange.GetElkFromTarget() >= 1:
                atLeastOneYang = 1

            if atLeastOneItem or atLeastOneYang:
                GFHhg54GHGhh45GHGH.SendExchangeAcceptPacket()
                self.AcceptButton.Disable()
            else:
                atLeastOneItem = 0
                atLeastOneYang = 0
                for i in xrange(exchange.EXCHANGE_ITEM_MAX_NUM):
                    itemCount = exchange.GetItemCountFromSelf(i)
                    if itemCount >= 1:
                        atLeastOneYang = 1
                        break

                if exchange.GetElkFromSelf() >= 1:
                    atLeastOneYang = 1

                if atLeastOneItem or atLeastOneYang:
                    self.questionDialog = uiCommon.QuestionDialog2()
                    self.questionDialog.SetText1(
                        localeInfo.NEW_EXCHANGE_ALERT1)
                    self.questionDialog.SetText2(
                        localeInfo.NEW_EXCHANGE_ALERT2)
                    self.questionDialog.SetAcceptEvent(
                        ui.__mem_func__(self.AcceptQuestion))
                    self.questionDialog.SetCancelEvent(
                        ui.__mem_func__(self.OnCloseQuestionDialog))
                    self.questionDialog.Open()
                else:
                    GFHhg54GHGhh45GHGH.SendExchangeAcceptPacket()
                    self.AcceptButton.Disable()
        else:
            GFHhg54GHGhh45GHGH.SendExchangeAcceptPacket()
            self.AcceptButton.Disable()