1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Problem with Interface after Merging

Discussion in 'Civ4 - SDK/Python' started by cybrxkhan, Mar 7, 2010.

  1. cybrxkhan

    cybrxkhan Asian Xwedodah

    Joined:
    Aug 10, 2006
    Messages:
    9,687
    Location:
    The Universe
    Hello all!

    I was merging Orion's Inquisition Mod into my mod, World of Legends. Everything worked out fine, except for one thing - the leader/civilization scoreboard (the one to the right of one's screen that shows all the leaders/civilizations and their scores, religions, and so forth) will not show up.

    I attempted the obvious solution of clicking on the red check mark button, but it does seem that somehow the leader/civilization scoreboard will not show up.

    Does anyone know what could be causing this, and perhaps where in the CvMainInterface.py I can find out how to fix this?

    Thanks in advance.
     
  2. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,765
    Location:
    DE/NL/FR
    Might be a bit difficult to compare (long), but this is the code, which is used for that:
    Spoiler :

    PHP:
        def updateScoreStringsself ):
        
            
    screen CyGInterfaceScreen"MainInterface"CvScreenEnums.MAIN_INTERFACE )

            
    xResolution screen.getXResolution()
            
    yResolution screen.getYResolution()
            
            
    screen.hide"ScoreBackground" )
            
            for 
    i in rangegc.getMAX_PLAYERS() ):
                
    szName "ScoreText" str(i)
                
    screen.hideszName )

            
    iWidth 0
            iCount 
    0
            iBtnHeight 
    22
            
            
    if ((CyInterface().getShowInterface() != InterfaceVisibility.INTERFACE_HIDE_ALL and CyInterface().getShowInterface() != InterfaceVisibility.INTERFACE_MINIMAP_ONLY)):
                if (
    CyInterface().isScoresVisible() and not CyInterface().isCityScreenUp() and CyEngine().isGlobeviewUp() == false):

                    
    gc.getMAX_CIV_TEAMS() - 1
                    
    while (> -1):
                        
    eTeam gc.getGame().getRankTeam(i)

                        if (
    gc.getTeam(gc.getGame().getActiveTeam()).isHasMet(eTeam) or gc.getTeam(eTeam).isHuman() or gc.getGame().isDebugMode()):
                            
    gc.getMAX_CIV_PLAYERS() - 1
                            
    while (> -1):
                                
    ePlayer gc.getGame().getRankPlayer(j)

                                if (
    not CyInterface().isScoresMinimized() or gc.getGame().getActivePlayer() == ePlayer):
                                    if (
    gc.getPlayer(ePlayer).isAlive() and not gc.getPlayer(ePlayer).isMinorCiv()):

                                        if (
    gc.getPlayer(ePlayer).getTeam() == eTeam):
                                            
    szBuffer u"<font=2>"

                                            
    if (gc.getGame().isGameMultiPlayer()):
                                                if (
    not (gc.getPlayer(ePlayer).isTurnActive())):
                                                    
    szBuffer szBuffer "*"

                                            
    if (not CyInterface().isFlashingPlayer(ePlayer) or CyInterface().shouldFlash(ePlayer)):
                                                if (
    ePlayer == gc.getGame().getActivePlayer()):
                                                    
    szTempBuffer u"%d: [<color=%d,%d,%d,%d>%s</color>]" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getPlayerTextColorR(), gc.getPlayer(ePlayer).getPlayerTextColorG(), gc.getPlayer(ePlayer).getPlayerTextColorB(), gc.getPlayer(ePlayer).getPlayerTextColorA(), gc.getPlayer(ePlayer).getName())
                                                else:
                                                    
    szTempBuffer u"%d: <color=%d,%d,%d,%d>%s</color>" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getPlayerTextColorR(), gc.getPlayer(ePlayer).getPlayerTextColorG(), gc.getPlayer(ePlayer).getPlayerTextColorB(), gc.getPlayer(ePlayer).getPlayerTextColorA(), gc.getPlayer(ePlayer).getName())
                                            else:
                                                
    szTempBuffer u"%d: %s" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getName())
                                            
    szBuffer szBuffer szTempBuffer

                                            
    if (gc.getTeam(eTeam).isAlive()):
                                                if ( 
    not (gc.getTeam(gc.getGame().getActiveTeam()).isHasMet(eTeam)) ):
                                                    
    szBuffer szBuffer + (" ?")
                                                if (
    gc.getTeam(eTeam).isAtWar(gc.getGame().getActiveTeam())):
                                                    
    szBuffer szBuffer "("  localText.getColorText("TXT_KEY_CONCEPT_WAR", (), gc.getInfoTypeForString("COLOR_RED")).upper() + ")"
                                                
    if (gc.getPlayer(ePlayer).canTradeNetworkWith(gc.getGame().getActivePlayer()) and (ePlayer != gc.getGame().getActivePlayer())):
                                                    
    szTempBuffer u"%c" %(CyGame().getSymbolID(FontSymbols.TRADE_CHAR))
                                                    
    szBuffer szBuffer szTempBuffer
                                                
    if (gc.getTeam(eTeam).isOpenBorders(gc.getGame().getActiveTeam())):
                                                    
    szTempBuffer u"%c" %(CyGame().getSymbolID(FontSymbols.OPEN_BORDERS_CHAR))
                                                    
    szBuffer szBuffer szTempBuffer
                                                
    if (gc.getTeam(eTeam).isDefensivePact(gc.getGame().getActiveTeam())):
                                                    
    szTempBuffer u"%c" %(CyGame().getSymbolID(FontSymbols.DEFENSIVE_PACT_CHAR))
                                                    
    szBuffer szBuffer szTempBuffer
                                                
    if (gc.getPlayer(ePlayer).getStateReligion() != -1):
                                                    if (
    gc.getPlayer(ePlayer).hasHolyCity(gc.getPlayer(ePlayer).getStateReligion())):
                                                        
    szTempBuffer u"%c" %(gc.getReligionInfo(gc.getPlayer(ePlayer).getStateReligion()).getHolyCityChar())
                                                        
    szBuffer szBuffer szTempBuffer
                                                    
    else:
                                                        
    szTempBuffer u"%c" %(gc.getReligionInfo(gc.getPlayer(ePlayer).getStateReligion()).getChar())
                                                        
    szBuffer szBuffer szTempBuffer
                                                
    if (gc.getTeam(eTeam).getEspionagePointsAgainstTeam(gc.getGame().getActiveTeam()) < gc.getTeam(gc.getGame().getActiveTeam()).getEspionagePointsAgainstTeam(eTeam)):
                                                    
    szTempBuffer u"%c" %(gc.getCommerceInfo(CommerceTypes.COMMERCE_ESPIONAGE).getChar())
                                                    
    szBuffer szBuffer szTempBuffer
                                            
                                            bEspionageCanSeeResearch 
    false
                                            
    for iMissionLoop in range(gc.getNumEspionageMissionInfos()):
                                                if (
    gc.getEspionageMissionInfo(iMissionLoop).isSeeResearch()):
                                                    
    bEspionageCanSeeResearch gc.getPlayer(gc.getGame().getActivePlayer()).canDoEspionageMission(iMissionLoopePlayerNone, -1)
                                                    break
                                            
                                            if (((
    gc.getPlayer(ePlayer).getTeam() == gc.getGame().getActiveTeam()) and (gc.getTeam(gc.getGame().getActiveTeam()).getNumMembers() > 1)) or (gc.getTeam(gc.getPlayer(ePlayer).getTeam()).isVassal(gc.getGame().getActiveTeam())) or gc.getGame().isDebugMode() or bEspionageCanSeeResearch):
                                                if (
    gc.getPlayer(ePlayer).getCurrentResearch() != -1):
                                                    
    szTempBuffer u"-%s (%d)" %(gc.getTechInfo(gc.getPlayer(ePlayer).getCurrentResearch()).getDescription(), gc.getPlayer(ePlayer).getResearchTurnsLeft(gc.getPlayer(ePlayer).getCurrentResearch(), True))
                                                    
    szBuffer szBuffer szTempBuffer
                                            
    if (CyGame().isNetworkMultiPlayer()):
                                                
    szBuffer szBuffer CyGameTextMgr().getNetStats(ePlayer)
                                                
                                            if (
    gc.getPlayer(ePlayer).isHuman() and CyInterface().isOOSVisible()):
                                                
    szTempBuffer u" <color=255,0,0>* %s *</color>" %(CyGameTextMgr().getOOSSeeds(ePlayer))
                                                
    szBuffer szBuffer szTempBuffer
                                                
                                            szBuffer 
    szBuffer "</font>"

                                            
    if ( CyInterface().determineWidthszBuffer ) > iWidth ):
                                                
    iWidth CyInterface().determineWidthszBuffer )

                                            
    szName "ScoreText" str(ePlayer)
                                            if ( 
    CyInterface().getShowInterface() == InterfaceVisibility.INTERFACE_SHOW or CyInterface().isInAdvancedStart()):
                                                
    yCoord yResolution 206
                                            
    else:
                                                
    yCoord yResolution 88
                                            screen
    .setTextszName"Background"szBufferCvUtil.FONT_RIGHT_JUSTIFYxResolution 12yCoord - (iCount iBtnHeight), -0.3FontTypes.SMALL_FONTWidgetTypes.WIDGET_CONTACT_CIVePlayer, -)
                                            
    screen.showszName )
                                            
                                            
    CyInterface().checkFlashReset(ePlayer)

                                            
    iCount iCount 1
                                j 
    1
                        i 
    1

                    
    if ( CyInterface().getShowInterface() == InterfaceVisibility.INTERFACE_SHOW or CyInterface().isInAdvancedStart()):
                        
    yCoord yResolution 186
                    
    else:
                        
    yCoord yResolution 68
                    screen
    .setPanelSize"ScoreBackground"xResolution 21 iWidthyCoord - (iBtnHeight iCount) - 4iWidth 12, (iBtnHeight iCount) + )
                    
    screen.show"ScoreBackground" )
     
  3. lemmy101

    lemmy101 Emperor

    Joined:
    Apr 10, 2006
    Messages:
    1,064
    One thing to check is that, because of Python's (RIDICULOUS) tab indent based scope system for for loops and if statements,, if you used a merge tool, make sure you set it not to ignore whitespace so you can see the differences.

    You probably know this already but it gave me the opportunity to say that Python's indent system is RIDICULOUS. ;D
     

Share This Page