Example #1
0
    def CanRemove(self):
        for i in xrange(guild.ENEMY_GUILD_SLOT_MAX_COUNT):
            if guild.GetEnemyGuildName(i) != "":
                return False

        if guild.MainPlayerHasAuthority(guild.AUTH_REMOVE_MEMBER):
            if guild.IsMemberByName(self.name):
                return True

        return False
Example #2
0
    def RefreshButton(self):

        self.HideAllButton()

        if chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
            #self.__ShowButton(locale.TARGET_BUTTON_BUILDING_DESTROY)
            #self.__ArrangeButtonPosition()
            return

        if player.IsPVPInstance(self.vid) or player.IsObserverMode():
            # PVP_INFO_SIZE_BUG_FIX
            self.SetSize(200 + 7 * self.nameLength, 40)
            self.UpdatePosition()
            # END_OF_PVP_INFO_SIZE_BUG_FIX
            return

        self.ShowDefaultButton()

        if guild.MainPlayerHasAuthority(guild.AUTH_ADD_MEMBER):
            if not guild.IsMemberByName(self.nameString):
                if 0 == chr.GetGuildID(self.vid):
                    self.__ShowButton(locale.TARGET_BUTTON_INVITE_GUILD)

        if not messenger.IsFriendByName(self.nameString):
            self.__ShowButton(locale.TARGET_BUTTON_FRIEND)

        if player.IsPartyMember(self.vid):

            self.__HideButton(locale.TARGET_BUTTON_FIGHT)

            if player.IsPartyLeader(self.vid):
                self.__ShowButton(locale.TARGET_BUTTON_LEAVE_PARTY)
            elif player.IsPartyLeader(player.GetMainCharacterIndex()):
                self.__ShowButton(locale.TARGET_BUTTON_EXCLUDE)

        else:
            if player.IsPartyMember(player.GetMainCharacterIndex()):
                if player.IsPartyLeader(player.GetMainCharacterIndex()):
                    self.__ShowButton(locale.TARGET_BUTTON_INVITE_PARTY)
            else:
                if chr.IsPartyMember(self.vid):
                    self.__ShowButton(locale.TARGET_BUTTON_REQUEST_ENTER_PARTY)
                else:
                    self.__ShowButton(locale.TARGET_BUTTON_INVITE_PARTY)

            if player.IsRevengeInstance(self.vid):
                self.__HideButton(locale.TARGET_BUTTON_FIGHT)
                self.__ShowButton(locale.TARGET_BUTTON_AVENGE)
            elif player.IsChallengeInstance(self.vid):
                self.__HideButton(locale.TARGET_BUTTON_FIGHT)
                self.__ShowButton(locale.TARGET_BUTTON_ACCEPT_FIGHT)
            elif player.IsCantFightInstance(self.vid):
                self.__HideButton(locale.TARGET_BUTTON_FIGHT)

            if not player.IsSameEmpire(self.vid):
                self.__HideButton(locale.TARGET_BUTTON_INVITE_PARTY)
                self.__HideButton(locale.TARGET_BUTTON_FRIEND)
                self.__HideButton(locale.TARGET_BUTTON_FIGHT)

        distance = player.GetCharacterDistance(self.vid)
        if distance > self.EXCHANGE_LIMIT_RANGE:
            self.__HideButton(locale.TARGET_BUTTON_EXCHANGE)
            self.__ArrangeButtonPosition()

        self.__ArrangeButtonPosition()