Yardım Syserr Hata Alıyorum

Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

J3yShuFLe

HayaletMetin2 & ExpertCraft [ Founding Owner]
Üye
Mesaj
173
Çözümler
3
Beğeni
24
Puan
479
Ticaret Puanı
0
Konu başlığına yardım veya help yazmak yasak ! Gerekli cezai işlem yapılacaktır, lütfen kurallara uymaya özen gösteriniz.
0121 20:35:04536 ::
networkModule.py(line:209) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:27) <module>
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - <type 'exceptions.IndentationError'>:expected an indented block (uiTarget.py, line 331)

0121 20:35:04536 :: ============================================================================================================
0121 20:35:04536 :: Abort!!!!
 
En son bir moderatör tarafından düzenlenmiş:

Dosya Eklentileri

  • 1.png
    1.png
    137,2 KB · Gösterim: 37
if appli kısımda komple tab hatası var hepsine birer tab atman lazım
 
hata aldığın dosyayı bizimle paylaşabilirmisin
 
hata aldığın dosyayı bizimle paylaşabilirmisin
uitarget.py dosyasının icindekiler
Kod:
import app
import ui
import player
import net
import wndMgr
import messenger
import guild
import chr
import nonplayer
import localeInfo
import constInfo

class TargetBoard(ui.ThinBoard):

    BUTTON_NAME_LIST = (
        localeInfo.TARGET_BUTTON_WHISPER,
        localeInfo.TARGET_BUTTON_EXCHANGE,
        localeInfo.TARGET_BUTTON_FIGHT,
        localeInfo.TARGET_BUTTON_ACCEPT_FIGHT,
        localeInfo.TARGET_BUTTON_AVENGE,
        localeInfo.TARGET_BUTTON_FRIEND,
        localeInfo.TARGET_BUTTON_INVITE_PARTY,
        localeInfo.TARGET_BUTTON_LEAVE_PARTY,
        localeInfo.TARGET_BUTTON_EXCLUDE,
        localeInfo.TARGET_BUTTON_INVITE_GUILD,
        localeInfo.TARGET_BUTTON_DISMOUNT,
        localeInfo.TARGET_BUTTON_EXIT_OBSERVER,
        localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT,
        localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY,
        localeInfo.TARGET_BUTTON_BUILDING_DESTROY,
        localeInfo.TARGET_BUTTON_EMOTION_ALLOW,
        "VOTE_BLOCK_CHAT",
    )

    GRADE_NAME =    {
                        nonplayer.PAWN : localeInfo.TARGET_LEVEL_PAWN,
                        nonplayer.S_PAWN : localeInfo.TARGET_LEVEL_S_PAWN,
                        nonplayer.KNIGHT : localeInfo.TARGET_LEVEL_KNIGHT,
                        nonplayer.S_KNIGHT : localeInfo.TARGET_LEVEL_S_KNIGHT,
                        nonplayer.BOSS : localeInfo.TARGET_LEVEL_BOSS,
                        nonplayer.KING : localeInfo.TARGET_LEVEL_KING,
                    }
    EXCHANGE_LIMIT_RANGE = 3000

    def __init__(self):
        ui.ThinBoard.__init__(self)

        name = ui.TextLine()
        name.SetParent(self)
        name.SetDefaultFontName()
        name.SetOutline()
        name.Show()

        hpGauge = ui.Gauge()
        hpGauge.SetParent(self)
        hpGauge.MakeGauge(130, "red")
        hpGauge.Hide()

        closeButton = ui.Button()
        closeButton.SetParent(self)
        closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
        closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
        closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
        closeButton.SetPosition(30, 13)

        if localeInfo.IsARABIC():
            hpGauge.SetPosition(55, 17)
            hpGauge.SetWindowHorizontalAlignLeft()
            closeButton.SetWindowHorizontalAlignLeft()
        else:
            hpGauge.SetPosition(175, 17)
            hpGauge.SetWindowHorizontalAlignRight()
            closeButton.SetWindowHorizontalAlignRight()

        closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton))
        closeButton.Show()

        self.buttonDict = {}
        self.showingButtonList = []
        for buttonName in self.BUTTON_NAME_LIST:
            button = ui.Button()
            button.SetParent(self)
       
            if localeInfo.IsARABIC():
                button.SetUpVisual("d:/ymir work/ui/public/Small_Button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/Small_Button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/Small_Button_03.sub")
            else:
                button.SetUpVisual("d:/ymir work/ui/public/small_thin_button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/small_thin_button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/small_thin_button_03.sub")
           
            button.SetWindowHorizontalAlignCenter()
            button.SetText(buttonName)
            button.Hide()
            self.buttonDict[buttonName] = button
            self.showingButtonList.append(button)

        self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER].SetEvent(ui.__mem_func__(self.OnWhisper))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE].SetEvent(ui.__mem_func__(self.OnExchange))
        self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyInvite))
        self.buttonDict[localeInfo.TARGET_BUTTON_LEAVE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyExit))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCLUDE].SetEvent(ui.__mem_func__(self.OnPartyRemove))

        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent(self.__OnGuildAddMember)
        self.buttonDict[localeInfo.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent(self.__OnDismount)
        self.buttonDict[localeInfo.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(self.__OnExitObserver)
        self.buttonDict[localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(self.__OnViewEquipment)
        self.buttonDict[localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent(self.__OnRequestParty)
        self.buttonDict[localeInfo.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent(self.__OnDestroyBuilding)
        self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent(self.__OnEmotionAllow)
       
        self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent(ui.__mem_func__(self.__OnVoteBlockChat))

        self.name = name
        self.hpGauge = hpGauge
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = hpDecimal
        self.closeButton = closeButton
        self.nameString = 0
        self.nameLength = 0
        self.vid = 0
        self.eventWhisper = None
        self.isShowButton = False

        self.__Initialize()
        self.ResetTargetBoard()

    def __del__(self):
        ui.ThinBoard.__del__(self)

        print "===================================================== DESTROYED TARGET BOARD"

    def __Initialize(self):
        self.nameString = ""
        self.nameLength = 0
        self.vid = 0
        self.isShowButton = False

    def Destroy(self):
        self.eventWhisper = None
        self.closeButton = None
        self.showingButtonList = None
        self.buttonDict = None
        self.name = None
        self.hpGauge = None
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = None
        self.__Initialize()

    def OnPressedCloseButton(self):
        player.ClearTarget()
        self.Close()

    def Close(self):
        self.__Initialize()
        self.Hide()

    def Open(self, vid, name):
        if vid:
            if not constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
                if not player.IsSameEmpire(vid):
                    self.Hide()
                    return

            if vid != self.GetTargetVID():
                self.ResetTargetBoard()
                self.SetTargetVID(vid)
                self.SetTargetName(name)

            if player.IsMainCharacterIndex(vid):
                self.__ShowMainCharacterMenu()      
            elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
                self.Hide()
            else:
                self.RefreshButton()
                self.Show()
        else:
            self.HideAllButton()
            self.__ShowButton(localeInfo.TARGET_BUTTON_WHISPER)
            self.__ShowButton("VOTE_BLOCK_CHAT")
            self.__ArrangeButtonPosition()
            self.SetTargetName(name)
            self.Show()
           
    def Refresh(self):
        if self.IsShow():
            if self.IsShowButton():          
                self.RefreshButton()      

    def RefreshByVID(self, vid):
        if vid == self.GetTargetVID():          
            self.Refresh()
           
    def RefreshByName(self, name):
        if name == self.GetTargetName():
            self.Refresh()

    def __ShowMainCharacterMenu(self):
        canShow=0

        self.HideAllButton()

        if player.IsMountingHorse():
            self.__ShowButton(localeInfo.TARGET_BUTTON_DISMOUNT)
            canShow=1

        if player.IsObserverMode():
            self.__ShowButton(localeInfo.TARGET_BUTTON_EXIT_OBSERVER)
            canShow=1

        if canShow:
            self.__ArrangeButtonPosition()
            self.Show()
        else:
            self.Hide()
           
    def __ShowNameOnlyMenu(self):
        self.HideAllButton()

    def SetWhisperEvent(self, event):
        self.eventWhisper = event

    def UpdatePosition(self):
        self.SetPosition(wndMgr.GetScreenWidth()/2 - self.GetWidth()/2, 10)

    def ResetTargetBoard(self):

        for btn in self.buttonDict.values():
            btn.Hide()

        self.__Initialize()

        self.name.SetPosition(0, 13)
        self.name.SetHorizontalAlignCenter()
        self.name.SetWindowHorizontalAlignCenter()
        self.hpGauge.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            hpDecimal = ui.TextLine()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()
        self.SetSize(250, 40)

    def SetTargetVID(self, vid):
        self.vid = vid

    def SetEnemyVID(self, vid):
        self.SetTargetVID(vid)
        name = chr.GetNameByVID(vid)
        level = nonplayer.GetLevelByVID(vid)
        grade = nonplayer.GetGradeByVID(vid)

        nameFront = ""
        if -1 != level:
            nameFront += "Lv." + str(level) + " "
        if self.GRADE_NAME.has_key(grade):
            nameFront += "(" + self.GRADE_NAME[grade] + ") "

        self.SetTargetName(nameFront + name)

    def GetTargetVID(self):
        return self.vid

    def GetTargetName(self):
        return self.nameString

    def SetTargetName(self, name):
        self.nameString = name
        self.nameLength = len(name)
        self.name.SetText(name)

    if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
        def SetHP(self, hpPercentage, iMinHP, iMaxHP):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                   
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                            self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
               
                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
               
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
           
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
               
                self.hpDecimal.Show()
    else:
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            def SetHP(self, hpPercentage, iMinHP, iMaxHP):
                if not self.hpGauge.IsShow():
                    if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                        if self.showingButtonList:
                            showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                   
                        if showingButtonCount > 0:
                            if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                                self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
               
                    if localeInfo.IsAraBIC():
                        self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
               
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
           
            self.hpGauge.SetPercentage(hpPercentage, 100)
                if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                    iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                    iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                    self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                    (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
               
                self.hpDecimal.Show()
    else:
    if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
        def SetHP(self, hpPercentage, iMinHP, iMaxHP):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                   
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                            self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
               
                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
               
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
           
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
               
                self.hpDecimal.Show()
    else:
        def SetHP(self, hpPercentage):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                   
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.GetTargetVID) != chr.INSTANCE_TYPE_PLAYER:
                            if showingButtonCount != 1:
                                self.SetSize(max(150, 7 * 75), self.GetHeight())
                            else:
                                self.SetSize(max(150, 2 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())

                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)

                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()

            def ShowDefaultButton(self):
        self.isShowButton = True
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW])
        for button in self.showingButtonList:
            button.Show()

    def HideAllButton(self):
        self.isShowButton = False
        for button in self.showingButtonList:
            button.Hide()
        self.showingButtonList = []

    def __ShowButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        self.buttonDict[name].Show()
        self.showingButtonList.append(self.buttonDict[name])

    def __HideButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        button = self.buttonDict[name]
        button.Hide()

        for btnInList in self.showingButtonList:
            if btnInList == button:
                self.showingButtonList.remove(button)
                break

    def OnWhisper(self):
        if None != self.eventWhisper:
            self.eventWhisper(self.nameString)

    def OnExchange(self):
        net.SendExchangeStartPacket(self.vid)

    def OnPVP(self):
        net.SendChatPacket("/pvp %d" % (self.vid))

    def OnAppendToMessenger(self):
        net.SendMessengerAddByVIDPacket(self.vid)

    def OnPartyInvite(self):
        net.SendPartyInvitePacket(self.vid)

    def OnPartyExit(self):
        net.SendPartyExitPacket()

    def OnPartyRemove(self):
        net.SendPartyRemovePacket(self.vid)

    def __OnGuildAddMember(self):
        net.SendGuildAddMemberPacket(self.vid)

    def __OnDismount(self):
        net.SendChatPacket("/unmount")

    def __OnExitObserver(self):
        net.SendChatPacket("/observer_exit")

    def __OnViewEquipment(self):
        net.SendChatPacket("/view_equip " + str(self.vid))

    def __OnRequestParty(self):
        net.SendChatPacket("/party_request " + str(self.vid))

    def __OnDestroyBuilding(self):
        net.SendChatPacket("/build d %d" % (self.vid))

    def __OnEmotionAllow(self):
        net.SendChatPacket("/emotion_allow %d" % (self.vid))
       
    def __OnVoteBlockChat(self):
        cmd = "/vote_block_chat %s" % (self.nameString)
        net.SendChatPacket(cmd)

    def OnPressEscapeKey(self):
        self.OnPressedCloseButton()
        return True

    def IsShowButton(self):
        return self.isShowButton

    def RefreshButton(self):

        self.HideAllButton()

        if chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
            #self.__ShowButton(localeInfo.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(localeInfo.TARGET_BUTTON_INVITE_GUILD)

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

        if player.IsPartyMember(self.vid):

            self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)

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

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

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

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

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

        self.__ArrangeButtonPosition()

    def __ArrangeButtonPosition(self):
        showingButtonCount = len(self.showingButtonList)
        pos = -(showingButtonCount / 2) * 68
        if 0 == showingButtonCount % 2:
            pos += 34

        for button in self.showingButtonList:
            button.SetPosition(pos, 33)
            pos += 68
       
        if app.ENABLE_VIEW_TARGET_PLAYER_HP:
            if showingButtonCount <= 2:
                self.SetSize(max(150 + 125, showingButtonCount * 75), 65)
            else:
                self.SetSize(max(150, showingButtonCount * 75), 65)
        else:
            self.SetSize(max(150, showingButtonCount * 75), 65)
       
        self.UpdatePosition()
 
uitarget.py:
import app
import ui
import player
import net
import wndMgr
import messenger
import guild
import chr
import nonplayer
import localeInfo
import constInfo

class TargetBoard(ui.ThinBoard):

    BUTTON_NAME_LIST = (
        localeInfo.TARGET_BUTTON_WHISPER,
        localeInfo.TARGET_BUTTON_EXCHANGE,
        localeInfo.TARGET_BUTTON_FIGHT,
        localeInfo.TARGET_BUTTON_ACCEPT_FIGHT,
        localeInfo.TARGET_BUTTON_AVENGE,
        localeInfo.TARGET_BUTTON_FRIEND,
        localeInfo.TARGET_BUTTON_INVITE_PARTY,
        localeInfo.TARGET_BUTTON_LEAVE_PARTY,
        localeInfo.TARGET_BUTTON_EXCLUDE,
        localeInfo.TARGET_BUTTON_INVITE_GUILD,
        localeInfo.TARGET_BUTTON_DISMOUNT,
        localeInfo.TARGET_BUTTON_EXIT_OBSERVER,
        localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT,
        localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY,
        localeInfo.TARGET_BUTTON_BUILDING_DESTROY,
        localeInfo.TARGET_BUTTON_EMOTION_ALLOW,
        "VOTE_BLOCK_CHAT",
    )

    GRADE_NAME =    {
                        nonplayer.PAWN : localeInfo.TARGET_LEVEL_PAWN,
                        nonplayer.S_PAWN : localeInfo.TARGET_LEVEL_S_PAWN,
                        nonplayer.KNIGHT : localeInfo.TARGET_LEVEL_KNIGHT,
                        nonplayer.S_KNIGHT : localeInfo.TARGET_LEVEL_S_KNIGHT,
                        nonplayer.BOSS : localeInfo.TARGET_LEVEL_BOSS,
                        nonplayer.KING : localeInfo.TARGET_LEVEL_KING,
                    }
    EXCHANGE_LIMIT_RANGE = 3000

    def __init__(self):
        ui.ThinBoard.__init__(self)

        name = ui.TextLine()
        name.SetParent(self)
        name.SetDefaultFontName()
        name.SetOutline()
        name.Show()

        hpGauge = ui.Gauge()
        hpGauge.SetParent(self)
        hpGauge.MakeGauge(130, "red")
        hpGauge.Hide()

        closeButton = ui.Button()
        closeButton.SetParent(self)
        closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
        closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
        closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
        closeButton.SetPosition(30, 13)

        if localeInfo.IsARABIC():
            hpGauge.SetPosition(55, 17)
            hpGauge.SetWindowHorizontalAlignLeft()
            closeButton.SetWindowHorizontalAlignLeft()
        else:
            hpGauge.SetPosition(175, 17)
            hpGauge.SetWindowHorizontalAlignRight()
            closeButton.SetWindowHorizontalAlignRight()

        closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton))
        closeButton.Show()

        self.buttonDict = {}
        self.showingButtonList = []
        for buttonName in self.BUTTON_NAME_LIST:
            button = ui.Button()
            button.SetParent(self)
      
            if localeInfo.IsARABIC():
                button.SetUpVisual("d:/ymir work/ui/public/Small_Button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/Small_Button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/Small_Button_03.sub")
            else:
                button.SetUpVisual("d:/ymir work/ui/public/small_thin_button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/small_thin_button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/small_thin_button_03.sub")
          
            button.SetWindowHorizontalAlignCenter()
            button.SetText(buttonName)
            button.Hide()
            self.buttonDict[buttonName] = button
            self.showingButtonList.append(button)

        self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER].SetEvent(ui.__mem_func__(self.OnWhisper))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE].SetEvent(ui.__mem_func__(self.OnExchange))
        self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyInvite))
        self.buttonDict[localeInfo.TARGET_BUTTON_LEAVE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyExit))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCLUDE].SetEvent(ui.__mem_func__(self.OnPartyRemove))

        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent(self.__OnGuildAddMember)
        self.buttonDict[localeInfo.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent(self.__OnDismount)
        self.buttonDict[localeInfo.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(self.__OnExitObserver)
        self.buttonDict[localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(self.__OnViewEquipment)
        self.buttonDict[localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent(self.__OnRequestParty)
        self.buttonDict[localeInfo.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent(self.__OnDestroyBuilding)
        self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent(self.__OnEmotionAllow)
      
        self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent(ui.__mem_func__(self.__OnVoteBlockChat))

        self.name = name
        self.hpGauge = hpGauge
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = hpDecimal
        self.closeButton = closeButton
        self.nameString = 0
        self.nameLength = 0
        self.vid = 0
        self.eventWhisper = None
        self.isShowButton = False

        self.__Initialize()
        self.ResetTargetBoard()

    def __del__(self):
        ui.ThinBoard.__del__(self)

        print "===================================================== DESTROYED TARGET BOARD"

    def __Initialize(self):
        self.nameString = ""
        self.nameLength = 0
        self.vid = 0
        self.isShowButton = False

    def Destroy(self):
        self.eventWhisper = None
        self.closeButton = None
        self.showingButtonList = None
        self.buttonDict = None
        self.name = None
        self.hpGauge = None
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = None
        self.__Initialize()

    def OnPressedCloseButton(self):
        player.ClearTarget()
        self.Close()

    def Close(self):
        self.__Initialize()
        self.Hide()

    def Open(self, vid, name):
        if vid:
            if not constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
                if not player.IsSameEmpire(vid):
                    self.Hide()
                    return

            if vid != self.GetTargetVID():
                self.ResetTargetBoard()
                self.SetTargetVID(vid)
                self.SetTargetName(name)

            if player.IsMainCharacterIndex(vid):
                self.__ShowMainCharacterMenu()     
            elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
                self.Hide()
            else:
                self.RefreshButton()
                self.Show()
        else:
            self.HideAllButton()
            self.__ShowButton(localeInfo.TARGET_BUTTON_WHISPER)
            self.__ShowButton("VOTE_BLOCK_CHAT")
            self.__ArrangeButtonPosition()
            self.SetTargetName(name)
            self.Show()
          
    def Refresh(self):
        if self.IsShow():
            if self.IsShowButton():         
                self.RefreshButton()     

    def RefreshByVID(self, vid):
        if vid == self.GetTargetVID():         
            self.Refresh()
          
    def RefreshByName(self, name):
        if name == self.GetTargetName():
            self.Refresh()

    def __ShowMainCharacterMenu(self):
        canShow=0

        self.HideAllButton()

        if player.IsMountingHorse():
            self.__ShowButton(localeInfo.TARGET_BUTTON_DISMOUNT)
            canShow=1

        if player.IsObserverMode():
            self.__ShowButton(localeInfo.TARGET_BUTTON_EXIT_OBSERVER)
            canShow=1

        if canShow:
            self.__ArrangeButtonPosition()
            self.Show()
        else:
            self.Hide()
          
    def __ShowNameOnlyMenu(self):
        self.HideAllButton()

    def SetWhisperEvent(self, event):
        self.eventWhisper = event

    def UpdatePosition(self):
        self.SetPosition(wndMgr.GetScreenWidth()/2 - self.GetWidth()/2, 10)

    def ResetTargetBoard(self):

        for btn in self.buttonDict.values():
            btn.Hide()

        self.__Initialize()

        self.name.SetPosition(0, 13)
        self.name.SetHorizontalAlignCenter()
        self.name.SetWindowHorizontalAlignCenter()
        self.hpGauge.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            hpDecimal = ui.TextLine()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()
        self.SetSize(250, 40)

    def SetTargetVID(self, vid):
        self.vid = vid

    def SetEnemyVID(self, vid):
        self.SetTargetVID(vid)
        name = chr.GetNameByVID(vid)
        level = nonplayer.GetLevelByVID(vid)
        grade = nonplayer.GetGradeByVID(vid)

        nameFront = ""
        if -1 != level:
            nameFront += "Lv." + str(level) + " "
        if self.GRADE_NAME.has_key(grade):
            nameFront += "(" + self.GRADE_NAME[grade] + ") "

        self.SetTargetName(nameFront + name)

    def GetTargetVID(self):
        return self.vid

    def GetTargetName(self):
        return self.nameString

    def SetTargetName(self, name):
        self.nameString = name
        self.nameLength = len(name)
        self.name.SetText(name)

    if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
        def SetHP(self, hpPercentage, iMinHP, iMaxHP):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                  
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                            self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
              
                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
              
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
          
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
              
                self.hpDecimal.Show()
    else:
        def SetHP(self, hpPercentage):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                  
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.GetTargetVID) != chr.INSTANCE_TYPE_PLAYER:
                            if showingButtonCount != 1:
                                self.SetSize(max(150, 7 * 75), self.GetHeight())
                            else:
                                self.SetSize(max(150, 2 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())

                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)

                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()

    def ShowDefaultButton(self):
        self.isShowButton = True
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW])
        for button in self.showingButtonList:
            button.Show()

    def HideAllButton(self):
        self.isShowButton = False
        for button in self.showingButtonList:
            button.Hide()
        self.showingButtonList = []

    def __ShowButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        self.buttonDict[name].Show()
        self.showingButtonList.append(self.buttonDict[name])

    def __HideButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        button = self.buttonDict[name]
        button.Hide()

        for btnInList in self.showingButtonList:
            if btnInList == button:
                self.showingButtonList.remove(button)
                break

    def OnWhisper(self):
        if None != self.eventWhisper:
            self.eventWhisper(self.nameString)

    def OnExchange(self):
        net.SendExchangeStartPacket(self.vid)

    def OnPVP(self):
        net.SendChatPacket("/pvp %d" % (self.vid))

    def OnAppendToMessenger(self):
        net.SendMessengerAddByVIDPacket(self.vid)

    def OnPartyInvite(self):
        net.SendPartyInvitePacket(self.vid)

    def OnPartyExit(self):
        net.SendPartyExitPacket()

    def OnPartyRemove(self):
        net.SendPartyRemovePacket(self.vid)

    def __OnGuildAddMember(self):
        net.SendGuildAddMemberPacket(self.vid)

    def __OnDismount(self):
        net.SendChatPacket("/unmount")

    def __OnExitObserver(self):
        net.SendChatPacket("/observer_exit")

    def __OnViewEquipment(self):
        net.SendChatPacket("/view_equip " + str(self.vid))

    def __OnRequestParty(self):
        net.SendChatPacket("/party_request " + str(self.vid))

    def __OnDestroyBuilding(self):
        net.SendChatPacket("/build d %d" % (self.vid))

    def __OnEmotionAllow(self):
        net.SendChatPacket("/emotion_allow %d" % (self.vid))
      
    def __OnVoteBlockChat(self):
        cmd = "/vote_block_chat %s" % (self.nameString)
        net.SendChatPacket(cmd)

    def OnPressEscapeKey(self):
        self.OnPressedCloseButton()
        return True

    def IsShowButton(self):
        return self.isShowButton

    def RefreshButton(self):

        self.HideAllButton()

        if chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
            #self.__ShowButton(localeInfo.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(localeInfo.TARGET_BUTTON_INVITE_GUILD)

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

        if player.IsPartyMember(self.vid):

            self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)

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

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

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

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

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

        self.__ArrangeButtonPosition()

    def __ArrangeButtonPosition(self):
        showingButtonCount = len(self.showingButtonList)
        pos = -(showingButtonCount / 2) * 68
        if 0 == showingButtonCount % 2:
            pos += 34

        for button in self.showingButtonList:
            button.SetPosition(pos, 33)
            pos += 68
      
        if app.ENABLE_VIEW_TARGET_PLAYER_HP:
            if showingButtonCount <= 2:
                self.SetSize(max(150 + 125, showingButtonCount * 75), 65)
            else:
                self.SetSize(max(150, showingButtonCount * 75), 65)
        else:
            self.SetSize(max(150, showingButtonCount * 75), 65)
      
        self.UpdatePosition()

şunu bir dene
 
evet şuan o sorun çözüldü fakat tam oyuna gireceği zaman ekran kalıyor syseer şu hataları veriyor
0121 21:25:11980 :: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR
0121 21:25:17334 :: icon/item/12700.tga ƄÀπ̠¾ø½À´ϴٮCItemData::__SetIconImage
0121 21:25:17345 :: icon/item/12700.tga ƄÀπ̠¾ø½À´ϴٮCItemData::__SetIconImage
0121 21:25:17471 :: Traceback (most recent call last):

0121 21:25:17471 :: File "networkModule.py", line 248, in SetGamePhase

0121 21:25:17471 :: File "game.py", line 111, in __init__

0121 21:25:17472 :: File "uiTarget.py", line 123, in __init__

0121 21:25:17472 :: NameError
0121 21:25:17472 :: :
0121 21:25:17472 :: global name 'hpDecimal' is not defined
0121 21:25:17472 ::
 
eklemeye çalıştığın sistemin uitarget.py dosyasını atarmısın. bazı yerleri 2 defa falan eklemişsin
 
Kod:
import app
import ui
import player
import net
import wndMgr
import messenger
import guild
import chr
import nonplayer
import localeInfo
import constInfo

class TargetBoard(ui.ThinBoard):

    BUTTON_NAME_LIST = (
        localeInfo.TARGET_BUTTON_WHISPER,
        localeInfo.TARGET_BUTTON_EXCHANGE,
        localeInfo.TARGET_BUTTON_FIGHT,
        localeInfo.TARGET_BUTTON_ACCEPT_FIGHT,
        localeInfo.TARGET_BUTTON_AVENGE,
        localeInfo.TARGET_BUTTON_FRIEND,
        localeInfo.TARGET_BUTTON_INVITE_PARTY,
        localeInfo.TARGET_BUTTON_LEAVE_PARTY,
        localeInfo.TARGET_BUTTON_EXCLUDE,
        localeInfo.TARGET_BUTTON_INVITE_GUILD,
        localeInfo.TARGET_BUTTON_DISMOUNT,
        localeInfo.TARGET_BUTTON_EXIT_OBSERVER,
        localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT,
        localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY,
        localeInfo.TARGET_BUTTON_BUILDING_DESTROY,
        localeInfo.TARGET_BUTTON_EMOTION_ALLOW,
        "VOTE_BLOCK_CHAT",
    )

    GRADE_NAME =    {
                        nonplayer.PAWN : localeInfo.TARGET_LEVEL_PAWN,
                        nonplayer.S_PAWN : localeInfo.TARGET_LEVEL_S_PAWN,
                        nonplayer.KNIGHT : localeInfo.TARGET_LEVEL_KNIGHT,
                        nonplayer.S_KNIGHT : localeInfo.TARGET_LEVEL_S_KNIGHT,
                        nonplayer.BOSS : localeInfo.TARGET_LEVEL_BOSS,
                        nonplayer.KING : localeInfo.TARGET_LEVEL_KING,
                    }
    EXCHANGE_LIMIT_RANGE = 3000

    def __init__(self):
        ui.ThinBoard.__init__(self)

        name = ui.TextLine()
        name.SetParent(self)
        name.SetDefaultFontName()
        name.SetOutline()
        name.Show()

        hpGauge = ui.Gauge()
        hpGauge.SetParent(self)
        hpGauge.MakeGauge(130, "red")
        hpGauge.Hide()

        closeButton = ui.Button()
        closeButton.SetParent(self)
        closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
        closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
        closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
        closeButton.SetPosition(30, 13)

        if localeInfo.IsARABIC():
            hpGauge.SetPosition(55, 17)
            hpGauge.SetWindowHorizontalAlignLeft()
            closeButton.SetWindowHorizontalAlignLeft()
        else:
            hpGauge.SetPosition(175, 17)
            hpGauge.SetWindowHorizontalAlignRight()
            closeButton.SetWindowHorizontalAlignRight()

        closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton))
        closeButton.Show()

        self.buttonDict = {}
        self.showingButtonList = []
        for buttonName in self.BUTTON_NAME_LIST:
            button = ui.Button()
            button.SetParent(self)
      
            if localeInfo.IsARABIC():
                button.SetUpVisual("d:/ymir work/ui/public/Small_Button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/Small_Button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/Small_Button_03.sub")
            else:
                button.SetUpVisual("d:/ymir work/ui/public/small_thin_button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/small_thin_button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/small_thin_button_03.sub")
          
            button.SetWindowHorizontalAlignCenter()
            button.SetText(buttonName)
            button.Hide()
            self.buttonDict[buttonName] = button
            self.showingButtonList.append(button)

        self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER].SetEvent(ui.__mem_func__(self.OnWhisper))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE].SetEvent(ui.__mem_func__(self.OnExchange))
        self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyInvite))
        self.buttonDict[localeInfo.TARGET_BUTTON_LEAVE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyExit))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCLUDE].SetEvent(ui.__mem_func__(self.OnPartyRemove))

        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent(self.__OnGuildAddMember)
        self.buttonDict[localeInfo.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent(self.__OnDismount)
        self.buttonDict[localeInfo.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(self.__OnExitObserver)
        self.buttonDict[localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(self.__OnViewEquipment)
        self.buttonDict[localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent(self.__OnRequestParty)
        self.buttonDict[localeInfo.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent(self.__OnDestroyBuilding)
        self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent(self.__OnEmotionAllow)
      
        self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent(ui.__mem_func__(self.__OnVoteBlockChat))

        self.name = name
        self.hpGauge = hpGauge
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = hpDecimal
        self.closeButton = closeButton
        self.nameString = 0
        self.nameLength = 0
        self.vid = 0
        self.eventWhisper = None
        self.isShowButton = False

        self.__Initialize()
        self.ResetTargetBoard()

    def __del__(self):
        ui.ThinBoard.__del__(self)

        print "===================================================== DESTROYED TARGET BOARD"

    def __Initialize(self):
        self.nameString = ""
        self.nameLength = 0
        self.vid = 0
        self.isShowButton = False

    def Destroy(self):
        self.eventWhisper = None
        self.closeButton = None
        self.showingButtonList = None
        self.buttonDict = None
        self.name = None
        self.hpGauge = None
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = None
        self.__Initialize()

    def OnPressedCloseButton(self):
        player.ClearTarget()
        self.Close()

    def Close(self):
        self.__Initialize()
        self.Hide()

    def Open(self, vid, name):
        if vid:
            if not constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
                if not player.IsSameEmpire(vid):
                    self.Hide()
                    return

            if vid != self.GetTargetVID():
                self.ResetTargetBoard()
                self.SetTargetVID(vid)
                self.SetTargetName(name)

            if player.IsMainCharacterIndex(vid):
                self.__ShowMainCharacterMenu()     
            elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
                self.Hide()
            else:
                self.RefreshButton()
                self.Show()
        else:
            self.HideAllButton()
            self.__ShowButton(localeInfo.TARGET_BUTTON_WHISPER)
            self.__ShowButton("VOTE_BLOCK_CHAT")
            self.__ArrangeButtonPosition()
            self.SetTargetName(name)
            self.Show()
          
    def Refresh(self):
        if self.IsShow():
            if self.IsShowButton():         
                self.RefreshButton()     

    def RefreshByVID(self, vid):
        if vid == self.GetTargetVID():         
            self.Refresh()
          
    def RefreshByName(self, name):
        if name == self.GetTargetName():
            self.Refresh()

    def __ShowMainCharacterMenu(self):
        canShow=0

        self.HideAllButton()

        if player.IsMountingHorse():
            self.__ShowButton(localeInfo.TARGET_BUTTON_DISMOUNT)
            canShow=1

        if player.IsObserverMode():
            self.__ShowButton(localeInfo.TARGET_BUTTON_EXIT_OBSERVER)
            canShow=1

        if canShow:
            self.__ArrangeButtonPosition()
            self.Show()
        else:
            self.Hide()
          
    def __ShowNameOnlyMenu(self):
        self.HideAllButton()

    def SetWhisperEvent(self, event):
        self.eventWhisper = event

    def UpdatePosition(self):
        self.SetPosition(wndMgr.GetScreenWidth()/2 - self.GetWidth()/2, 10)

    def ResetTargetBoard(self):

        for btn in self.buttonDict.values():
            btn.Hide()

        self.__Initialize()

        self.name.SetPosition(0, 13)
        self.name.SetHorizontalAlignCenter()
        self.name.SetWindowHorizontalAlignCenter()
        self.hpGauge.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            hpDecimal = ui.TextLine()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()
        self.SetSize(250, 40)

    def SetTargetVID(self, vid):
        self.vid = vid

    def SetEnemyVID(self, vid):
        self.SetTargetVID(vid)
        name = chr.GetNameByVID(vid)
        level = nonplayer.GetLevelByVID(vid)
        grade = nonplayer.GetGradeByVID(vid)

        nameFront = ""
        if -1 != level:
            nameFront += "Lv." + str(level) + " "
        if self.GRADE_NAME.has_key(grade):
            nameFront += "(" + self.GRADE_NAME[grade] + ") "

        self.SetTargetName(nameFront + name)

    def GetTargetVID(self):
        return self.vid

    def GetTargetName(self):
        return self.nameString

    def SetTargetName(self, name):
        self.nameString = name
        self.nameLength = len(name)
        self.name.SetText(name)

            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
        def SetHP(self, hpPercentage, iMinHP, iMaxHP):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                  
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                            self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
              
                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
              
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
          
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
              
                self.hpDecimal.Show()
    else:
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            def SetHP(self, hpPercentage, iMinHP, iMaxHP):
                if not self.hpGauge.IsShow():
                    if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                        if self.showingButtonList:
                            showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                  
                        if showingButtonCount > 0:
                            if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                                self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
              
                    if localeInfo.IsAraBIC():
                        self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
              
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
          
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                    iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                    iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                    self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                    (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
              
                self.hpDecimal.Show()
    else:
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
        def SetHP(self, hpPercentage, iMinHP, iMaxHP):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                  
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                            self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
              
                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
              
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
          
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
              
                self.hpDecimal.Show()
    else:
        def SetHP(self, hpPercentage):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                  
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.GetTargetVID) != chr.INSTANCE_TYPE_PLAYER:
                            if showingButtonCount != 1:
                                self.SetSize(max(150, 7 * 75), self.GetHeight())
                            else:
                                self.SetSize(max(150, 2 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())

                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)

                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()

            def ShowDefaultButton(self):
        self.isShowButton = True
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW])
        for button in self.showingButtonList:
            button.Show()

    def HideAllButton(self):
        self.isShowButton = False
        for button in self.showingButtonList:
            button.Hide()
        self.showingButtonList = []

    def __ShowButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        self.buttonDict[name].Show()
        self.showingButtonList.append(self.buttonDict[name])

    def __HideButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        button = self.buttonDict[name]
        button.Hide()

        for btnInList in self.showingButtonList:
            if btnInList == button:
                self.showingButtonList.remove(button)
                break

    def OnWhisper(self):
        if None != self.eventWhisper:
            self.eventWhisper(self.nameString)

    def OnExchange(self):
        net.SendExchangeStartPacket(self.vid)

    def OnPVP(self):
        net.SendChatPacket("/pvp %d" % (self.vid))

    def OnAppendToMessenger(self):
        net.SendMessengerAddByVIDPacket(self.vid)

    def OnPartyInvite(self):
        net.SendPartyInvitePacket(self.vid)

    def OnPartyExit(self):
        net.SendPartyExitPacket()

    def OnPartyRemove(self):
        net.SendPartyRemovePacket(self.vid)

    def __OnGuildAddMember(self):
        net.SendGuildAddMemberPacket(self.vid)

    def __OnDismount(self):
        net.SendChatPacket("/unmount")

    def __OnExitObserver(self):
        net.SendChatPacket("/observer_exit")

    def __OnViewEquipment(self):
        net.SendChatPacket("/view_equip " + str(self.vid))

    def __OnRequestParty(self):
        net.SendChatPacket("/party_request " + str(self.vid))

    def __OnDestroyBuilding(self):
        net.SendChatPacket("/build d %d" % (self.vid))

    def __OnEmotionAllow(self):
        net.SendChatPacket("/emotion_allow %d" % (self.vid))
      
    def __OnVoteBlockChat(self):
        cmd = "/vote_block_chat %s" % (self.nameString)
        net.SendChatPacket(cmd)

    def OnPressEscapeKey(self):
        self.OnPressedCloseButton()
        return True

    def IsShowButton(self):
        return self.isShowButton

    def RefreshButton(self):

        self.HideAllButton()

        if chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
            #self.__ShowButton(localeInfo.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(localeInfo.TARGET_BUTTON_INVITE_GUILD)

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

        if player.IsPartyMember(self.vid):

            self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)

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

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

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

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

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

        self.__ArrangeButtonPosition()

    def __ArrangeButtonPosition(self):
        showingButtonCount = len(self.showingButtonList)
        pos = -(showingButtonCount / 2) * 68
        if 0 == showingButtonCount % 2:
            pos += 34

        for button in self.showingButtonList:
            button.SetPosition(pos, 33)
            pos += 68
      
        if app.ENABLE_VIEW_TARGET_PLAYER_HP:
            if showingButtonCount <= 2:
                self.SetSize(max(150 + 125, showingButtonCount * 75), 65)
            else:
                self.SetSize(max(150, showingButtonCount * 75), 65)
        else:
            self.SetSize(max(150, showingButtonCount * 75), 65)
      
        self.UpdatePosition()


Komple değiştir dene
 
Kod:
""""""
#1) Ara: def __ArrangeButtonPosition(self):
#2) kod bloðunu deðiþtir:
    def __ArrangeButtonPosition(self):
        showingButtonCount = len(self.showingButtonList)
        pos = -(showingButtonCount / 2) * 68
        if 0 == showingButtonCount % 2:
            pos += 34

        for button in self.showingButtonList:
            button.SetPosition(pos, 33)
            pos += 68
        
        if app.ENABLE_VIEW_TARGET_PLAYER_HP:
            if showingButtonCount <= 2:
                self.SetSize(max(150 + 125, showingButtonCount * 75), 65)
            else:
                self.SetSize(max(150, showingButtonCount * 75), 65)
        else:
            self.SetSize(max(150, showingButtonCount * 75), 65)
        
        self.UpdatePosition()
""""""


""""""
#1) Ara: def SetHP(self, hpPercentage):
#2) kod bloðunu deðiþtir:
    if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
        def SetHP(self, hpPercentage, iMinHP, iMaxHP):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                    
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                            self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                
                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
                
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
            
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
                
                self.hpDecimal.Show()
    else:
        def SetHP(self, hpPercentage):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                    
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.GetTargetVID) != chr.INSTANCE_TYPE_PLAYER:
                            if showingButtonCount != 1:
                                self.SetSize(max(150, 7 * 75), self.GetHeight())
                            else:
                                self.SetSize(max(150, 2 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())

                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)

                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
""""""


""""""
#1) Ara: hpGauge.Hide()
#2) Altýna yeni bir satýr açýp ekle:
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            hpDecimal = ui.TextLine()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()
""""""


""""""
#1) Ara: self.hpGauge = hpGauge
#2) Altýna yeni bir satýr açýp ekle:
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = hpDecimal
""""""


""""""
#1) Ara: self.hpGauge = None
#2) Altýna yeni bir satýr açýp ekle:
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = None
""""""


""""""
#1) Ara: self.hpGauge.Hide()
#2) Altýna yeni bir satýr açýp ekle:
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
""""""
 
Kod:
import app
import ui
import player
import net
import wndMgr
import messenger
import guild
import chr
import nonplayer
import localeInfo
import constInfo

class TargetBoard(ui.ThinBoard):

    BUTTON_NAME_LIST = (
        localeInfo.TARGET_BUTTON_WHISPER,
        localeInfo.TARGET_BUTTON_EXCHANGE,
        localeInfo.TARGET_BUTTON_FIGHT,
        localeInfo.TARGET_BUTTON_ACCEPT_FIGHT,
        localeInfo.TARGET_BUTTON_AVENGE,
        localeInfo.TARGET_BUTTON_FRIEND,
        localeInfo.TARGET_BUTTON_INVITE_PARTY,
        localeInfo.TARGET_BUTTON_LEAVE_PARTY,
        localeInfo.TARGET_BUTTON_EXCLUDE,
        localeInfo.TARGET_BUTTON_INVITE_GUILD,
        localeInfo.TARGET_BUTTON_DISMOUNT,
        localeInfo.TARGET_BUTTON_EXIT_OBSERVER,
        localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT,
        localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY,
        localeInfo.TARGET_BUTTON_BUILDING_DESTROY,
        localeInfo.TARGET_BUTTON_EMOTION_ALLOW,
        "VOTE_BLOCK_CHAT",
    )

    GRADE_NAME =    {
                        nonplayer.PAWN : localeInfo.TARGET_LEVEL_PAWN,
                        nonplayer.S_PAWN : localeInfo.TARGET_LEVEL_S_PAWN,
                        nonplayer.KNIGHT : localeInfo.TARGET_LEVEL_KNIGHT,
                        nonplayer.S_KNIGHT : localeInfo.TARGET_LEVEL_S_KNIGHT,
                        nonplayer.BOSS : localeInfo.TARGET_LEVEL_BOSS,
                        nonplayer.KING : localeInfo.TARGET_LEVEL_KING,
                    }
    EXCHANGE_LIMIT_RANGE = 3000

    def __init__(self):
        ui.ThinBoard.__init__(self)

        name = ui.TextLine()
        name.SetParent(self)
        name.SetDefaultFontName()
        name.SetOutline()
        name.Show()

        hpGauge = ui.Gauge()
        hpGauge.SetParent(self)
        hpGauge.MakeGauge(130, "red")
        hpGauge.Hide()

        closeButton = ui.Button()
        closeButton.SetParent(self)
        closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
        closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
        closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
        closeButton.SetPosition(30, 13)

        if localeInfo.IsARABIC():
            hpGauge.SetPosition(55, 17)
            hpGauge.SetWindowHorizontalAlignLeft()
            closeButton.SetWindowHorizontalAlignLeft()
        else:
            hpGauge.SetPosition(175, 17)
            hpGauge.SetWindowHorizontalAlignRight()
            closeButton.SetWindowHorizontalAlignRight()

        closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton))
        closeButton.Show()

        self.buttonDict = {}
        self.showingButtonList = []
        for buttonName in self.BUTTON_NAME_LIST:
            button = ui.Button()
            button.SetParent(self)
     
            if localeInfo.IsARABIC():
                button.SetUpVisual("d:/ymir work/ui/public/Small_Button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/Small_Button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/Small_Button_03.sub")
            else:
                button.SetUpVisual("d:/ymir work/ui/public/small_thin_button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/small_thin_button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/small_thin_button_03.sub")
         
            button.SetWindowHorizontalAlignCenter()
            button.SetText(buttonName)
            button.Hide()
            self.buttonDict[buttonName] = button
            self.showingButtonList.append(button)

        self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER].SetEvent(ui.__mem_func__(self.OnWhisper))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE].SetEvent(ui.__mem_func__(self.OnExchange))
        self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyInvite))
        self.buttonDict[localeInfo.TARGET_BUTTON_LEAVE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyExit))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCLUDE].SetEvent(ui.__mem_func__(self.OnPartyRemove))

        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent(self.__OnGuildAddMember)
        self.buttonDict[localeInfo.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent(self.__OnDismount)
        self.buttonDict[localeInfo.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(self.__OnExitObserver)
        self.buttonDict[localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(self.__OnViewEquipment)
        self.buttonDict[localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent(self.__OnRequestParty)
        self.buttonDict[localeInfo.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent(self.__OnDestroyBuilding)
        self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent(self.__OnEmotionAllow)
     
        self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent(ui.__mem_func__(self.__OnVoteBlockChat))

        self.name = name
        self.hpGauge = hpGauge
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = hpDecimal
        self.closeButton = closeButton
        self.nameString = 0
        self.nameLength = 0
        self.vid = 0
        self.eventWhisper = None
        self.isShowButton = False

        self.__Initialize()
        self.ResetTargetBoard()

    def __del__(self):
        ui.ThinBoard.__del__(self)

        print "===================================================== DESTROYED TARGET BOARD"

    def __Initialize(self):
        self.nameString = ""
        self.nameLength = 0
        self.vid = 0
        self.isShowButton = False

    def Destroy(self):
        self.eventWhisper = None
        self.closeButton = None
        self.showingButtonList = None
        self.buttonDict = None
        self.name = None
        self.hpGauge = None
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = None
        self.__Initialize()

    def OnPressedCloseButton(self):
        player.ClearTarget()
        self.Close()

    def Close(self):
        self.__Initialize()
        self.Hide()

    def Open(self, vid, name):
        if vid:
            if not constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
                if not player.IsSameEmpire(vid):
                    self.Hide()
                    return

            if vid != self.GetTargetVID():
                self.ResetTargetBoard()
                self.SetTargetVID(vid)
                self.SetTargetName(name)

            if player.IsMainCharacterIndex(vid):
                self.__ShowMainCharacterMenu()    
            elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
                self.Hide()
            else:
                self.RefreshButton()
                self.Show()
        else:
            self.HideAllButton()
            self.__ShowButton(localeInfo.TARGET_BUTTON_WHISPER)
            self.__ShowButton("VOTE_BLOCK_CHAT")
            self.__ArrangeButtonPosition()
            self.SetTargetName(name)
            self.Show()
         
    def Refresh(self):
        if self.IsShow():
            if self.IsShowButton():        
                self.RefreshButton()    

    def RefreshByVID(self, vid):
        if vid == self.GetTargetVID():        
            self.Refresh()
         
    def RefreshByName(self, name):
        if name == self.GetTargetName():
            self.Refresh()

    def __ShowMainCharacterMenu(self):
        canShow=0

        self.HideAllButton()

        if player.IsMountingHorse():
            self.__ShowButton(localeInfo.TARGET_BUTTON_DISMOUNT)
            canShow=1

        if player.IsObserverMode():
            self.__ShowButton(localeInfo.TARGET_BUTTON_EXIT_OBSERVER)
            canShow=1

        if canShow:
            self.__ArrangeButtonPosition()
            self.Show()
        else:
            self.Hide()
         
    def __ShowNameOnlyMenu(self):
        self.HideAllButton()

    def SetWhisperEvent(self, event):
        self.eventWhisper = event

    def UpdatePosition(self):
        self.SetPosition(wndMgr.GetScreenWidth()/2 - self.GetWidth()/2, 10)

    def ResetTargetBoard(self):

        for btn in self.buttonDict.values():
            btn.Hide()

        self.__Initialize()

        self.name.SetPosition(0, 13)
        self.name.SetHorizontalAlignCenter()
        self.name.SetWindowHorizontalAlignCenter()
        self.hpGauge.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            hpDecimal = ui.TextLine()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()
        self.SetSize(250, 40)

    def SetTargetVID(self, vid):
        self.vid = vid

    def SetEnemyVID(self, vid):
        self.SetTargetVID(vid)
        name = chr.GetNameByVID(vid)
        level = nonplayer.GetLevelByVID(vid)
        grade = nonplayer.GetGradeByVID(vid)

        nameFront = ""
        if -1 != level:
            nameFront += "Lv." + str(level) + " "
        if self.GRADE_NAME.has_key(grade):
            nameFront += "(" + self.GRADE_NAME[grade] + ") "

        self.SetTargetName(nameFront + name)

    def GetTargetVID(self):
        return self.vid

    def GetTargetName(self):
        return self.nameString

    def SetTargetName(self, name):
        self.nameString = name
        self.nameLength = len(name)
        self.name.SetText(name)

            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
        def SetHP(self, hpPercentage, iMinHP, iMaxHP):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                 
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                            self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
             
                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
             
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
         
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
             
                self.hpDecimal.Show()
    else:
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            def SetHP(self, hpPercentage, iMinHP, iMaxHP):
                if not self.hpGauge.IsShow():
                    if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                        if self.showingButtonList:
                            showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                 
                        if showingButtonCount > 0:
                            if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                                self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
             
                    if localeInfo.IsAraBIC():
                        self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
             
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
         
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                    iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                    iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                    self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                    (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
             
                self.hpDecimal.Show()
    else:
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
        def SetHP(self, hpPercentage, iMinHP, iMaxHP):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                 
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                            self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
             
                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
             
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
         
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
             
                self.hpDecimal.Show()
    else:
        def SetHP(self, hpPercentage):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                 
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.GetTargetVID) != chr.INSTANCE_TYPE_PLAYER:
                            if showingButtonCount != 1:
                                self.SetSize(max(150, 7 * 75), self.GetHeight())
                            else:
                                self.SetSize(max(150, 2 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())

                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)

                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()

            def ShowDefaultButton(self):
        self.isShowButton = True
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW])
        for button in self.showingButtonList:
            button.Show()

    def HideAllButton(self):
        self.isShowButton = False
        for button in self.showingButtonList:
            button.Hide()
        self.showingButtonList = []

    def __ShowButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        self.buttonDict[name].Show()
        self.showingButtonList.append(self.buttonDict[name])

    def __HideButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        button = self.buttonDict[name]
        button.Hide()

        for btnInList in self.showingButtonList:
            if btnInList == button:
                self.showingButtonList.remove(button)
                break

    def OnWhisper(self):
        if None != self.eventWhisper:
            self.eventWhisper(self.nameString)

    def OnExchange(self):
        net.SendExchangeStartPacket(self.vid)

    def OnPVP(self):
        net.SendChatPacket("/pvp %d" % (self.vid))

    def OnAppendToMessenger(self):
        net.SendMessengerAddByVIDPacket(self.vid)

    def OnPartyInvite(self):
        net.SendPartyInvitePacket(self.vid)

    def OnPartyExit(self):
        net.SendPartyExitPacket()

    def OnPartyRemove(self):
        net.SendPartyRemovePacket(self.vid)

    def __OnGuildAddMember(self):
        net.SendGuildAddMemberPacket(self.vid)

    def __OnDismount(self):
        net.SendChatPacket("/unmount")

    def __OnExitObserver(self):
        net.SendChatPacket("/observer_exit")

    def __OnViewEquipment(self):
        net.SendChatPacket("/view_equip " + str(self.vid))

    def __OnRequestParty(self):
        net.SendChatPacket("/party_request " + str(self.vid))

    def __OnDestroyBuilding(self):
        net.SendChatPacket("/build d %d" % (self.vid))

    def __OnEmotionAllow(self):
        net.SendChatPacket("/emotion_allow %d" % (self.vid))
     
    def __OnVoteBlockChat(self):
        cmd = "/vote_block_chat %s" % (self.nameString)
        net.SendChatPacket(cmd)

    def OnPressEscapeKey(self):
        self.OnPressedCloseButton()
        return True

    def IsShowButton(self):
        return self.isShowButton

    def RefreshButton(self):

        self.HideAllButton()

        if chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
            #self.__ShowButton(localeInfo.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(localeInfo.TARGET_BUTTON_INVITE_GUILD)

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

        if player.IsPartyMember(self.vid):

            self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)

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

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

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

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

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

        self.__ArrangeButtonPosition()

    def __ArrangeButtonPosition(self):
        showingButtonCount = len(self.showingButtonList)
        pos = -(showingButtonCount / 2) * 68
        if 0 == showingButtonCount % 2:
            pos += 34

        for button in self.showingButtonList:
            button.SetPosition(pos, 33)
            pos += 68
     
        if app.ENABLE_VIEW_TARGET_PLAYER_HP:
            if showingButtonCount <= 2:
                self.SetSize(max(150 + 125, showingButtonCount * 75), 65)
            else:
                self.SetSize(max(150, showingButtonCount * 75), 65)
        else:
            self.SetSize(max(150, showingButtonCount * 75), 65)
     
        self.UpdatePosition()


Komple değiştir dene
denedim fakat farklı hatalar verdi
0121 21:32:04298 ::
networkModule.py(line:209) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:27) <module>
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - <type 'exceptions.IndentationError'>:unexpected indent (uiTarget.py, line 289)

0121 21:32:04298 :: ============================================================================================================
0121 21:32:04298 :: Abort!!!!
 
uitarget.py:
import app
import ui
import player
import net
import wndMgr
import messenger
import guild
import chr
import nonplayer
import localeInfo
import constInfo

class TargetBoard(ui.ThinBoard):

    BUTTON_NAME_LIST = (
        localeInfo.TARGET_BUTTON_WHISPER,
        localeInfo.TARGET_BUTTON_EXCHANGE,
        localeInfo.TARGET_BUTTON_FIGHT,
        localeInfo.TARGET_BUTTON_ACCEPT_FIGHT,
        localeInfo.TARGET_BUTTON_AVENGE,
        localeInfo.TARGET_BUTTON_FRIEND,
        localeInfo.TARGET_BUTTON_INVITE_PARTY,
        localeInfo.TARGET_BUTTON_LEAVE_PARTY,
        localeInfo.TARGET_BUTTON_EXCLUDE,
        localeInfo.TARGET_BUTTON_INVITE_GUILD,
        localeInfo.TARGET_BUTTON_DISMOUNT,
        localeInfo.TARGET_BUTTON_EXIT_OBSERVER,
        localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT,
        localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY,
        localeInfo.TARGET_BUTTON_BUILDING_DESTROY,
        localeInfo.TARGET_BUTTON_EMOTION_ALLOW,
        "VOTE_BLOCK_CHAT",
    )

    GRADE_NAME =    {
                        nonplayer.PAWN : localeInfo.TARGET_LEVEL_PAWN,
                        nonplayer.S_PAWN : localeInfo.TARGET_LEVEL_S_PAWN,
                        nonplayer.KNIGHT : localeInfo.TARGET_LEVEL_KNIGHT,
                        nonplayer.S_KNIGHT : localeInfo.TARGET_LEVEL_S_KNIGHT,
                        nonplayer.BOSS : localeInfo.TARGET_LEVEL_BOSS,
                        nonplayer.KING : localeInfo.TARGET_LEVEL_KING,
                    }
    EXCHANGE_LIMIT_RANGE = 3000

    def __init__(self):
        ui.ThinBoard.__init__(self)

        name = ui.TextLine()
        name.SetParent(self)
        name.SetDefaultFontName()
        name.SetOutline()
        name.Show()

        hpGauge = ui.Gauge()
        hpGauge.SetParent(self)
        hpGauge.MakeGauge(130, "red")
        hpGauge.Hide()

        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            hpDecimal = ui.TextLine()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()

        closeButton = ui.Button()
        closeButton.SetParent(self)
        closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
        closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
        closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
        closeButton.SetPosition(30, 13)

        if localeInfo.IsARABIC():
            hpGauge.SetPosition(55, 17)
            hpGauge.SetWindowHorizontalAlignLeft()
            closeButton.SetWindowHorizontalAlignLeft()
        else:
            hpGauge.SetPosition(175, 17)
            hpGauge.SetWindowHorizontalAlignRight()
            closeButton.SetWindowHorizontalAlignRight()

        closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton))
        closeButton.Show()

        self.buttonDict = {}
        self.showingButtonList = []
        for buttonName in self.BUTTON_NAME_LIST:
            button = ui.Button()
            button.SetParent(self)
      
            if localeInfo.IsARABIC():
                button.SetUpVisual("d:/ymir work/ui/public/Small_Button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/Small_Button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/Small_Button_03.sub")
            else:
                button.SetUpVisual("d:/ymir work/ui/public/small_thin_button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/small_thin_button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/small_thin_button_03.sub")
          
            button.SetWindowHorizontalAlignCenter()
            button.SetText(buttonName)
            button.Hide()
            self.buttonDict[buttonName] = button
            self.showingButtonList.append(button)

        self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER].SetEvent(ui.__mem_func__(self.OnWhisper))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE].SetEvent(ui.__mem_func__(self.OnExchange))
        self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyInvite))
        self.buttonDict[localeInfo.TARGET_BUTTON_LEAVE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyExit))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCLUDE].SetEvent(ui.__mem_func__(self.OnPartyRemove))

        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent(self.__OnGuildAddMember)
        self.buttonDict[localeInfo.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent(self.__OnDismount)
        self.buttonDict[localeInfo.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(self.__OnExitObserver)
        self.buttonDict[localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(self.__OnViewEquipment)
        self.buttonDict[localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent(self.__OnRequestParty)
        self.buttonDict[localeInfo.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent(self.__OnDestroyBuilding)
        self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent(self.__OnEmotionAllow)
      
        self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent(ui.__mem_func__(self.__OnVoteBlockChat))

        self.name = name
        self.hpGauge = hpGauge
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = hpDecimal
        self.closeButton = closeButton
        self.nameString = 0
        self.nameLength = 0
        self.vid = 0
        self.eventWhisper = None
        self.isShowButton = False

        self.__Initialize()
        self.ResetTargetBoard()

    def __del__(self):
        ui.ThinBoard.__del__(self)

        print "===================================================== DESTROYED TARGET BOARD"

    def __Initialize(self):
        self.nameString = ""
        self.nameLength = 0
        self.vid = 0
        self.isShowButton = False

    def Destroy(self):
        self.eventWhisper = None
        self.closeButton = None
        self.showingButtonList = None
        self.buttonDict = None
        self.name = None
        self.hpGauge = None
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
        self.__Initialize()

    def OnPressedCloseButton(self):
        player.ClearTarget()
        self.Close()

    def Close(self):
        self.__Initialize()
        self.Hide()

    def Open(self, vid, name):
        if vid:
            if not constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
                if not player.IsSameEmpire(vid):
                    self.Hide()
                    return

            if vid != self.GetTargetVID():
                self.ResetTargetBoard()
                self.SetTargetVID(vid)
                self.SetTargetName(name)

            if player.IsMainCharacterIndex(vid):
                self.__ShowMainCharacterMenu()     
            elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
                self.Hide()
            else:
                self.RefreshButton()
                self.Show()
        else:
            self.HideAllButton()
            self.__ShowButton(localeInfo.TARGET_BUTTON_WHISPER)
            self.__ShowButton("VOTE_BLOCK_CHAT")
            self.__ArrangeButtonPosition()
            self.SetTargetName(name)
            self.Show()
          
    def Refresh(self):
        if self.IsShow():
            if self.IsShowButton():         
                self.RefreshButton()     

    def RefreshByVID(self, vid):
        if vid == self.GetTargetVID():         
            self.Refresh()
          
    def RefreshByName(self, name):
        if name == self.GetTargetName():
            self.Refresh()

    def __ShowMainCharacterMenu(self):
        canShow=0

        self.HideAllButton()

        if player.IsMountingHorse():
            self.__ShowButton(localeInfo.TARGET_BUTTON_DISMOUNT)
            canShow=1

        if player.IsObserverMode():
            self.__ShowButton(localeInfo.TARGET_BUTTON_EXIT_OBSERVER)
            canShow=1

        if canShow:
            self.__ArrangeButtonPosition()
            self.Show()
        else:
            self.Hide()
          
    def __ShowNameOnlyMenu(self):
        self.HideAllButton()

    def SetWhisperEvent(self, event):
        self.eventWhisper = event

    def UpdatePosition(self):
        self.SetPosition(wndMgr.GetScreenWidth()/2 - self.GetWidth()/2, 10)

    def ResetTargetBoard(self):

        for btn in self.buttonDict.values():
            btn.Hide()

        self.__Initialize()

        self.name.SetPosition(0, 13)
        self.name.SetHorizontalAlignCenter()
        self.name.SetWindowHorizontalAlignCenter()
        self.hpGauge.Hide()
        self.SetSize(250, 40)

    def SetTargetVID(self, vid):
        self.vid = vid

    def SetEnemyVID(self, vid):
        self.SetTargetVID(vid)
        name = chr.GetNameByVID(vid)
        level = nonplayer.GetLevelByVID(vid)
        grade = nonplayer.GetGradeByVID(vid)

        nameFront = ""
        if -1 != level:
            nameFront += "Lv." + str(level) + " "
        if self.GRADE_NAME.has_key(grade):
            nameFront += "(" + self.GRADE_NAME[grade] + ") "

        self.SetTargetName(nameFront + name)

    def GetTargetVID(self):
        return self.vid

    def GetTargetName(self):
        return self.nameString

    def SetTargetName(self, name):
        self.nameString = name
        self.nameLength = len(name)
        self.name.SetText(name)

    if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
        def SetHP(self, hpPercentage, iMinHP, iMaxHP):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                    
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                            self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                
                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
                
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
            
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
                
                self.hpDecimal.Show()
    else:
        def SetHP(self, hpPercentage):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                    
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.GetTargetVID) != chr.INSTANCE_TYPE_PLAYER:
                            if showingButtonCount != 1:
                                self.SetSize(max(150, 7 * 75), self.GetHeight())
                            else:
                                self.SetSize(max(150, 2 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())

                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)

                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()

    def ShowDefaultButton(self):
        self.isShowButton = True
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW])
        for button in self.showingButtonList:
            button.Show()

    def HideAllButton(self):
        self.isShowButton = False
        for button in self.showingButtonList:
            button.Hide()
        self.showingButtonList = []

    def __ShowButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        self.buttonDict[name].Show()
        self.showingButtonList.append(self.buttonDict[name])

    def __HideButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        button = self.buttonDict[name]
        button.Hide()

        for btnInList in self.showingButtonList:
            if btnInList == button:
                self.showingButtonList.remove(button)
                break

    def OnWhisper(self):
        if None != self.eventWhisper:
            self.eventWhisper(self.nameString)

    def OnExchange(self):
        net.SendExchangeStartPacket(self.vid)

    def OnPVP(self):
        net.SendChatPacket("/pvp %d" % (self.vid))

    def OnAppendToMessenger(self):
        net.SendMessengerAddByVIDPacket(self.vid)

    def OnPartyInvite(self):
        net.SendPartyInvitePacket(self.vid)

    def OnPartyExit(self):
        net.SendPartyExitPacket()

    def OnPartyRemove(self):
        net.SendPartyRemovePacket(self.vid)

    def __OnGuildAddMember(self):
        net.SendGuildAddMemberPacket(self.vid)

    def __OnDismount(self):
        net.SendChatPacket("/unmount")

    def __OnExitObserver(self):
        net.SendChatPacket("/observer_exit")

    def __OnViewEquipment(self):
        net.SendChatPacket("/view_equip " + str(self.vid))

    def __OnRequestParty(self):
        net.SendChatPacket("/party_request " + str(self.vid))

    def __OnDestroyBuilding(self):
        net.SendChatPacket("/build d %d" % (self.vid))

    def __OnEmotionAllow(self):
        net.SendChatPacket("/emotion_allow %d" % (self.vid))
      
    def __OnVoteBlockChat(self):
        cmd = "/vote_block_chat %s" % (self.nameString)
        net.SendChatPacket(cmd)

    def OnPressEscapeKey(self):
        self.OnPressedCloseButton()
        return True

    def IsShowButton(self):
        return self.isShowButton

    def RefreshButton(self):

        self.HideAllButton()

        if chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
            #self.__ShowButton(localeInfo.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(localeInfo.TARGET_BUTTON_INVITE_GUILD)

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

        if player.IsPartyMember(self.vid):

            self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)

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

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

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

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

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

        self.__ArrangeButtonPosition()

    def __ArrangeButtonPosition(self):
        showingButtonCount = len(self.showingButtonList)
        pos = -(showingButtonCount / 2) * 68
        if 0 == showingButtonCount % 2:
            pos += 34

        for button in self.showingButtonList:
            button.SetPosition(pos, 33)
            pos += 68
        
        if app.ENABLE_VIEW_TARGET_PLAYER_HP:
            if showingButtonCount <= 2:
                self.SetSize(max(150 + 125, showingButtonCount * 75), 65)
            else:
                self.SetSize(max(150, showingButtonCount * 75), 65)
        else:
            self.SetSize(max(150, showingButtonCount * 75), 65)
        
        self.UpdatePosition()
 
uitarget.py:
import app
import ui
import player
import net
import wndMgr
import messenger
import guild
import chr
import nonplayer
import localeInfo
import constInfo

class TargetBoard(ui.ThinBoard):

    BUTTON_NAME_LIST = (
        localeInfo.TARGET_BUTTON_WHISPER,
        localeInfo.TARGET_BUTTON_EXCHANGE,
        localeInfo.TARGET_BUTTON_FIGHT,
        localeInfo.TARGET_BUTTON_ACCEPT_FIGHT,
        localeInfo.TARGET_BUTTON_AVENGE,
        localeInfo.TARGET_BUTTON_FRIEND,
        localeInfo.TARGET_BUTTON_INVITE_PARTY,
        localeInfo.TARGET_BUTTON_LEAVE_PARTY,
        localeInfo.TARGET_BUTTON_EXCLUDE,
        localeInfo.TARGET_BUTTON_INVITE_GUILD,
        localeInfo.TARGET_BUTTON_DISMOUNT,
        localeInfo.TARGET_BUTTON_EXIT_OBSERVER,
        localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT,
        localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY,
        localeInfo.TARGET_BUTTON_BUILDING_DESTROY,
        localeInfo.TARGET_BUTTON_EMOTION_ALLOW,
        "VOTE_BLOCK_CHAT",
    )

    GRADE_NAME =    {
                        nonplayer.PAWN : localeInfo.TARGET_LEVEL_PAWN,
                        nonplayer.S_PAWN : localeInfo.TARGET_LEVEL_S_PAWN,
                        nonplayer.KNIGHT : localeInfo.TARGET_LEVEL_KNIGHT,
                        nonplayer.S_KNIGHT : localeInfo.TARGET_LEVEL_S_KNIGHT,
                        nonplayer.BOSS : localeInfo.TARGET_LEVEL_BOSS,
                        nonplayer.KING : localeInfo.TARGET_LEVEL_KING,
                    }
    EXCHANGE_LIMIT_RANGE = 3000

    def __init__(self):
        ui.ThinBoard.__init__(self)

        name = ui.TextLine()
        name.SetParent(self)
        name.SetDefaultFontName()
        name.SetOutline()
        name.Show()

        hpGauge = ui.Gauge()
        hpGauge.SetParent(self)
        hpGauge.MakeGauge(130, "red")
        hpGauge.Hide()

        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            hpDecimal = ui.TextLine()
            hpDecimal.SetParent(hpGauge)
            hpDecimal.SetDefaultFontName()
            hpDecimal.SetPosition(5, 5)
            hpDecimal.SetOutline()
            hpDecimal.Hide()

        closeButton = ui.Button()
        closeButton.SetParent(self)
        closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
        closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
        closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
        closeButton.SetPosition(30, 13)

        if localeInfo.IsARABIC():
            hpGauge.SetPosition(55, 17)
            hpGauge.SetWindowHorizontalAlignLeft()
            closeButton.SetWindowHorizontalAlignLeft()
        else:
            hpGauge.SetPosition(175, 17)
            hpGauge.SetWindowHorizontalAlignRight()
            closeButton.SetWindowHorizontalAlignRight()

        closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton))
        closeButton.Show()

        self.buttonDict = {}
        self.showingButtonList = []
        for buttonName in self.BUTTON_NAME_LIST:
            button = ui.Button()
            button.SetParent(self)
     
            if localeInfo.IsARABIC():
                button.SetUpVisual("d:/ymir work/ui/public/Small_Button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/Small_Button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/Small_Button_03.sub")
            else:
                button.SetUpVisual("d:/ymir work/ui/public/small_thin_button_01.sub")
                button.SetOverVisual("d:/ymir work/ui/public/small_thin_button_02.sub")
                button.SetDownVisual("d:/ymir work/ui/public/small_thin_button_03.sub")
         
            button.SetWindowHorizontalAlignCenter()
            button.SetText(buttonName)
            button.Hide()
            self.buttonDict[buttonName] = button
            self.showingButtonList.append(button)

        self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER].SetEvent(ui.__mem_func__(self.OnWhisper))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE].SetEvent(ui.__mem_func__(self.OnExchange))
        self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.OnPVP))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyInvite))
        self.buttonDict[localeInfo.TARGET_BUTTON_LEAVE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyExit))
        self.buttonDict[localeInfo.TARGET_BUTTON_EXCLUDE].SetEvent(ui.__mem_func__(self.OnPartyRemove))

        self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent(self.__OnGuildAddMember)
        self.buttonDict[localeInfo.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent(self.__OnDismount)
        self.buttonDict[localeInfo.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(self.__OnExitObserver)
        self.buttonDict[localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(self.__OnViewEquipment)
        self.buttonDict[localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent(self.__OnRequestParty)
        self.buttonDict[localeInfo.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent(self.__OnDestroyBuilding)
        self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent(self.__OnEmotionAllow)
     
        self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent(ui.__mem_func__(self.__OnVoteBlockChat))

        self.name = name
        self.hpGauge = hpGauge
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal = hpDecimal
        self.closeButton = closeButton
        self.nameString = 0
        self.nameLength = 0
        self.vid = 0
        self.eventWhisper = None
        self.isShowButton = False

        self.__Initialize()
        self.ResetTargetBoard()

    def __del__(self):
        ui.ThinBoard.__del__(self)

        print "===================================================== DESTROYED TARGET BOARD"

    def __Initialize(self):
        self.nameString = ""
        self.nameLength = 0
        self.vid = 0
        self.isShowButton = False

    def Destroy(self):
        self.eventWhisper = None
        self.closeButton = None
        self.showingButtonList = None
        self.buttonDict = None
        self.name = None
        self.hpGauge = None
        if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
            self.hpDecimal.Hide()
        self.__Initialize()

    def OnPressedCloseButton(self):
        player.ClearTarget()
        self.Close()

    def Close(self):
        self.__Initialize()
        self.Hide()

    def Open(self, vid, name):
        if vid:
            if not constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD():
                if not player.IsSameEmpire(vid):
                    self.Hide()
                    return

            if vid != self.GetTargetVID():
                self.ResetTargetBoard()
                self.SetTargetVID(vid)
                self.SetTargetName(name)

            if player.IsMainCharacterIndex(vid):
                self.__ShowMainCharacterMenu()    
            elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
                self.Hide()
            else:
                self.RefreshButton()
                self.Show()
        else:
            self.HideAllButton()
            self.__ShowButton(localeInfo.TARGET_BUTTON_WHISPER)
            self.__ShowButton("VOTE_BLOCK_CHAT")
            self.__ArrangeButtonPosition()
            self.SetTargetName(name)
            self.Show()
         
    def Refresh(self):
        if self.IsShow():
            if self.IsShowButton():        
                self.RefreshButton()    

    def RefreshByVID(self, vid):
        if vid == self.GetTargetVID():        
            self.Refresh()
         
    def RefreshByName(self, name):
        if name == self.GetTargetName():
            self.Refresh()

    def __ShowMainCharacterMenu(self):
        canShow=0

        self.HideAllButton()

        if player.IsMountingHorse():
            self.__ShowButton(localeInfo.TARGET_BUTTON_DISMOUNT)
            canShow=1

        if player.IsObserverMode():
            self.__ShowButton(localeInfo.TARGET_BUTTON_EXIT_OBSERVER)
            canShow=1

        if canShow:
            self.__ArrangeButtonPosition()
            self.Show()
        else:
            self.Hide()
         
    def __ShowNameOnlyMenu(self):
        self.HideAllButton()

    def SetWhisperEvent(self, event):
        self.eventWhisper = event

    def UpdatePosition(self):
        self.SetPosition(wndMgr.GetScreenWidth()/2 - self.GetWidth()/2, 10)

    def ResetTargetBoard(self):

        for btn in self.buttonDict.values():
            btn.Hide()

        self.__Initialize()

        self.name.SetPosition(0, 13)
        self.name.SetHorizontalAlignCenter()
        self.name.SetWindowHorizontalAlignCenter()
        self.hpGauge.Hide()
        self.SetSize(250, 40)

    def SetTargetVID(self, vid):
        self.vid = vid

    def SetEnemyVID(self, vid):
        self.SetTargetVID(vid)
        name = chr.GetNameByVID(vid)
        level = nonplayer.GetLevelByVID(vid)
        grade = nonplayer.GetGradeByVID(vid)

        nameFront = ""
        if -1 != level:
            nameFront += "Lv." + str(level) + " "
        if self.GRADE_NAME.has_key(grade):
            nameFront += "(" + self.GRADE_NAME[grade] + ") "

        self.SetTargetName(nameFront + name)

    def GetTargetVID(self):
        return self.vid

    def GetTargetName(self):
        return self.nameString

    def SetTargetName(self, name):
        self.nameString = name
        self.nameLength = len(name)
        self.name.SetText(name)

    if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
        def SetHP(self, hpPercentage, iMinHP, iMaxHP):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                   
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.vid) == chr.INSTANCE_TYPE_PLAYER:
                            self.SetSize(max(150 + 75 * 3, 7 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())
               
                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)
               
                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()
           
            self.hpGauge.SetPercentage(hpPercentage, 100)
            if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
                iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
                iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
                self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
                (textWidth, textHeight)=self.hpDecimal.GetTextSize()
                if localeInfo.IsAraBIC():
                    self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
                else:
                    self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
               
                self.hpDecimal.Show()
    else:
        def SetHP(self, hpPercentage):
            if not self.hpGauge.IsShow():
                if app.ENABLE_VIEW_TARGET_PLAYER_HP:
                    if self.showingButtonList:
                        showingButtonCount = len(self.showingButtonList)
                    else:
                        showingButtonCount = 0
                   
                    if showingButtonCount > 0:
                        if chr.GetInstanceType(self.GetTargetVID) != chr.INSTANCE_TYPE_PLAYER:
                            if showingButtonCount != 1:
                                self.SetSize(max(150, 7 * 75), self.GetHeight())
                            else:
                                self.SetSize(max(150, 2 * 75), self.GetHeight())
                        else:
                            self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                    else:
                        self.SetSize(200 + 7*self.nameLength, self.GetHeight())
                else:
                    self.SetSize(200 + 7*self.nameLength, self.GetHeight())

                if localeInfo.IsAraBIC():
                    self.name.SetPosition( self.GetWidth()-23, 13)
                else:
                    self.name.SetPosition(23, 13)

                self.name.SetWindowHorizontalAlignLeft()
                self.name.SetHorizontalAlignLeft()
                self.hpGauge.Show()
                self.UpdatePosition()

    def ShowDefaultButton(self):
        self.isShowButton = True
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT])
        self.showingButtonList.append(self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW])
        for button in self.showingButtonList:
            button.Show()

    def HideAllButton(self):
        self.isShowButton = False
        for button in self.showingButtonList:
            button.Hide()
        self.showingButtonList = []

    def __ShowButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        self.buttonDict[name].Show()
        self.showingButtonList.append(self.buttonDict[name])

    def __HideButton(self, name):

        if not self.buttonDict.has_key(name):
            return

        button = self.buttonDict[name]
        button.Hide()

        for btnInList in self.showingButtonList:
            if btnInList == button:
                self.showingButtonList.remove(button)
                break

    def OnWhisper(self):
        if None != self.eventWhisper:
            self.eventWhisper(self.nameString)

    def OnExchange(self):
        net.SendExchangeStartPacket(self.vid)

    def OnPVP(self):
        net.SendChatPacket("/pvp %d" % (self.vid))

    def OnAppendToMessenger(self):
        net.SendMessengerAddByVIDPacket(self.vid)

    def OnPartyInvite(self):
        net.SendPartyInvitePacket(self.vid)

    def OnPartyExit(self):
        net.SendPartyExitPacket()

    def OnPartyRemove(self):
        net.SendPartyRemovePacket(self.vid)

    def __OnGuildAddMember(self):
        net.SendGuildAddMemberPacket(self.vid)

    def __OnDismount(self):
        net.SendChatPacket("/unmount")

    def __OnExitObserver(self):
        net.SendChatPacket("/observer_exit")

    def __OnViewEquipment(self):
        net.SendChatPacket("/view_equip " + str(self.vid))

    def __OnRequestParty(self):
        net.SendChatPacket("/party_request " + str(self.vid))

    def __OnDestroyBuilding(self):
        net.SendChatPacket("/build d %d" % (self.vid))

    def __OnEmotionAllow(self):
        net.SendChatPacket("/emotion_allow %d" % (self.vid))
     
    def __OnVoteBlockChat(self):
        cmd = "/vote_block_chat %s" % (self.nameString)
        net.SendChatPacket(cmd)

    def OnPressEscapeKey(self):
        self.OnPressedCloseButton()
        return True

    def IsShowButton(self):
        return self.isShowButton

    def RefreshButton(self):

        self.HideAllButton()

        if chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid):
            #self.__ShowButton(localeInfo.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(localeInfo.TARGET_BUTTON_INVITE_GUILD)

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

        if player.IsPartyMember(self.vid):

            self.__HideButton(localeInfo.TARGET_BUTTON_FIGHT)

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

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

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

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

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

        self.__ArrangeButtonPosition()

    def __ArrangeButtonPosition(self):
        showingButtonCount = len(self.showingButtonList)
        pos = -(showingButtonCount / 2) * 68
        if 0 == showingButtonCount % 2:
            pos += 34

        for button in self.showingButtonList:
            button.SetPosition(pos, 33)
            pos += 68
       
        if app.ENABLE_VIEW_TARGET_PLAYER_HP:
            if showingButtonCount <= 2:
                self.SetSize(max(150 + 125, showingButtonCount * 75), 65)
            else:
                self.SetSize(max(150, showingButtonCount * 75), 65)
        else:
            self.SetSize(max(150, showingButtonCount * 75), 65)
       
        self.UpdatePosition()
evet düzeldi fakat bu seferde oyun icinde itemlerin üstüne gelince hicbir yazı vs görünmüyor
gm item kodu görebilme ekledim konu bu
Linkleri görebilmek için giriş yap veya kayıt ol.
o yüzden göstermiyor olabilir mi
 
en başta gönderdiğin dosyada bile bayağı bir hata vardı diğer dosyalarda da olma ihtimali yüksek. Dosyaları tekrar gözden geçir.
 
Geri
Üst