예제 #1
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()
예제 #2
0
    def Refresh(self):

        self.RefreshOwnerSlot()
        self.RefreshTargetSlot()

        self.OwnerMoney.SetText(str(exchange.GetElkFromSelf()))
        self.TargetMoney.SetText(str(exchange.GetElkFromTarget()))

        if TRUE == exchange.GetAcceptFromSelf():
            self.OwnerAcceptLight.Down()
        else:
            self.AcceptButton.Enable()
            self.AcceptButton.SetUp()
            self.OwnerAcceptLight.SetUp()

        if TRUE == exchange.GetAcceptFromTarget():
            self.TargetAcceptLight.Down()
        else:
            self.TargetAcceptLight.SetUp()
예제 #3
0
    def Refresh(self):

        self.RefreshOwnerSlot()
        self.RefreshTargetSlot()
        if app.WJ_ENABLE_TRADABLE_ICON:
            self.RefreshLockedSlot()

        self.OwnerMoney.SetText(str(exchange.GetElkFromSelf()))
        self.TargetMoney.SetText(str(exchange.GetElkFromTarget()))

        if True == exchange.GetAcceptFromSelf():
            self.OwnerAcceptLight.Down()
        else:
            self.AcceptButton.Enable()
            self.AcceptButton.SetUp()
            self.OwnerAcceptLight.SetUp()

        if True == exchange.GetAcceptFromTarget():
            self.TargetAcceptLight.Down()
        else:
            self.TargetAcceptLight.SetUp()
예제 #4
0
    def Refresh(self):
        self.RefreshOwnerSlot()
        self.RefreshTargetSlot()

        self.OwnerMoney.SetText(
            localeInfo.NumberToMoneyString(exchange.GetElkFromSelf()))
        self.TargetMoney.SetText(
            localeInfo.NumberToMoneyString(exchange.GetElkFromTarget()))
        if exchange.GetAcceptFromSelf() == True:
            if not app.ENABLE_NEW_EXCHANGE_WINDOW:
                self.OwnerAcceptLight.Down()
            else:
                self.OwnerSlot.SetSlotBaseImage(
                    "d:/ymir work/ui/public/slot_base.sub", 0.3500, 0.8500,
                    0.3500, 1.0)
                self.LogsDropList.AppendItem(
                    self.Item(
                        self, localeInfo.NEW_EXCHANGE_YOU_ACCEPT % (str(
                            (time.strftime("[%H:%M:%S]")))), 0))
        else:
            if self.AcceptButton.IsDown() == True:
                self.LogsDropList.AppendItem(
                    self.Item(
                        self, localeInfo.NEW_EXCHANGE_YOU_ABORT % (str(
                            (time.strftime("[%H:%M:%S]")))), 0))

            self.AcceptButton.Enable()
            self.AcceptButton.SetUp()
            if not app.ENABLE_NEW_EXCHANGE_WINDOW:
                self.OwnerAcceptLight.SetUp()
            else:
                self.OwnerSlot.SetSlotBaseImage(
                    "d:/ymir work/ui/public/slot_base.sub", 1.0, 1.0, 1.0, 1.0)

        if exchange.GetAcceptFromTarget() == True:
            if not app.ENABLE_NEW_EXCHANGE_WINDOW:
                self.TargetAcceptLight.Down()
            else:
                self.TargetAcceptButton.Down()
                self.TargetSlot.SetSlotBaseImage(
                    "d:/ymir work/ui/public/slot_base.sub", 0.3500, 0.8500,
                    0.3500, 1.0)
                self.LogsDropList.AppendItem(
                    self.Item(
                        self, localeInfo.NEW_EXCHANGE_ACCEPT %
                        (str((time.strftime("[%H:%M:%S]"))),
                         exchange.GetNameFromTarget()), 0))
        else:
            if not app.ENABLE_NEW_EXCHANGE_WINDOW:
                self.TargetAcceptLight.SetUp()
            else:
                if self.TargetAcceptButton.IsDown() == True:
                    self.LogsDropList.AppendItem(
                        self.Item(
                            self, localeInfo.NEW_EXCHANGE_ABORT %
                            (str((time.strftime("[%H:%M:%S]"))),
                             exchange.GetNameFromTarget()), 0))

                self.TargetAcceptButton.SetUp()
                self.TargetSlot.SetSlotBaseImage(
                    "d:/ymir work/ui/public/slot_base.sub", 1.0, 1.0, 1.0, 1.0)