home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 January / Gamestar_80_2006-01_dvd.iso / Dema / Civilization4 / data1.cab / Civ4DemoComponent / Assets / Python / Screens / CvHallOfFameScreen.py < prev    next >
Encoding:
Python Source  |  2005-11-09  |  19.6 KB  |  364 lines

  1. ## Sid Meier's Civilization 4
  2. ## Copyright Firaxis Games 2005
  3. from CvPythonExtensions import *
  4. import CvUtil
  5. import ScreenInput
  6. from CvScreenEnums import *
  7. import CvReplayScreen
  8. import CvScreensInterface
  9.  
  10. # globals
  11. gc = CyGlobalContext()
  12. ArtFileMgr = CyArtFileMgr()
  13. localText = CyTranslator()
  14.  
  15. SORT_BY_NORMALIZED_SCORE = 0
  16. SORT_BY_FINISH_DATE = 1
  17. SORT_BY_GAME_SCORE = 2
  18.  
  19. class CvHallOfFameScreen:
  20.     "Top scores and more"
  21.  
  22.     def __init__(self, screenId):
  23.         self.screenId = screenId
  24.         self.SCREEN_NAME = "HallOfFameScreen"
  25.  
  26.         self.WIDGET_ID = "HallOfFameWidget"
  27.         self.HEADER_ID = "HallOfFameHeaderWidget"
  28.         self.EXIT_ID = "HallOfFameScreenExitWidget"
  29.         self.REPLAY_ID = "HallOfFameScreenReplayWidget"
  30.         self.BACKGROUND_ID = "HallOfFameScreenBackground"
  31.         self.TABLE_ID = "HallOfFameScreenTable"
  32.         self.LEADER_DROPDOWN_ID = "HallOfFameScreenLeaderDropdown"
  33.         self.DIFFICULTY_DROPDOWN_ID = "HallOfFameScreenDifficultyDropdown"
  34.         self.MAPSIZE_DROPDOWN_ID = "HallOfFameScreenMapsizeDropdown"
  35.         self.CLIMATE_DROPDOWN_ID = "HallOfFameScreenClimateDropdown"
  36.         self.SEALEVEL_DROPDOWN_ID = "HallOfFameScreenSealevelDropdown"
  37.         self.ERA_DROPDOWN_ID = "HallOfFameScreenEraDropdown"
  38.         self.SPEED_DROPDOWN_ID = "HallOfFameScreenSpeedDropdown"
  39.         self.VICTORY_DROPDOWN_ID = "HallOfFameScreenVictoryDropdown"
  40.         self.MULTIPLAYER_DROPDOWN_ID = "HallOfFameScreenMultiplayerDropdown"
  41.         self.SORT_DROPDOWN_ID = "HallOfFameScreenSortDropdown"
  42.         self.REPLAY_BUTTON_ID = "HallOfFameReplayButton"
  43.  
  44.         self.X_SCREEN = 500
  45.         self.Y_SCREEN = 396
  46.         self.W_SCREEN = 1024
  47.         self.H_SCREEN = 768
  48.         self.Y_TITLE = 12
  49.         
  50.         self.X_EXIT = 994
  51.         self.Y_EXIT = 726
  52.         
  53.         self.DROPDOWN_WIDTH = 200
  54.         self.DROPDOWN_Y = 70
  55.         self.DROPDOWN_SPACING_X = 45
  56.         self.DROPDOWN_SPACING_Y = 50
  57.                                 
  58.         self.nWidgetCount = 0
  59.                 
  60.         self.bAllowReplay = False
  61.         
  62.         
  63.     def getScreen(self):
  64.         return CyGInterfaceScreen(self.SCREEN_NAME, self.screenId)
  65.  
  66.     def hideScreen(self):
  67.         screen = self.getScreen()
  68.         screen.hideScreen()                                    
  69.         
  70.     # Screen construction function
  71.     def interfaceScreen(self, bAllowReplay):
  72.         return
  73.                         
  74.         # Create a new screen
  75.         screen = self.getScreen()
  76.         if screen.isActive():
  77.             return
  78.         screen.setRenderInterfaceOnly(True);
  79.         screen.showScreen(PopupStates.POPUPSTATE_IMMEDIATE, False)
  80.         screen.setPersistent(True)
  81.     
  82.         self.bAllowReplay = bAllowReplay
  83.         self.iLeaderFilter = -1
  84.         self.iHandicapFilter = -1
  85.         self.iWorldFilter = -1
  86.         self.iClimateFilter = -1
  87.         self.iSeaLevelFilter = -1
  88.         self.iEraFilter = -1
  89.         self.iSpeedFilter = -1
  90.         self.iVictoryFilter = -1
  91.         self.iMultiplayerFilter = 0
  92.         self.iSortBy = SORT_BY_NORMALIZED_SCORE
  93.  
  94.         self.EXIT_TEXT = u"<font=4>" + localText.getText("TXT_KEY_PEDIA_SCREEN_EXIT", ()).upper() + u"</font>"
  95.  
  96.         self.hallOfFame = CyHallOfFameInfo()
  97.         self.hallOfFame.loadReplays()
  98.  
  99.         # Set the background widget and exit button
  100.         screen.setDimensions(screen.centerX(0), screen.centerY(0), self.W_SCREEN, self.H_SCREEN)
  101.         screen.addDDSGFC(self.BACKGROUND_ID, ArtFileMgr.getInterfaceArtInfo("SCREEN_BG_OPAQUE").getPath(), 0, 0, self.W_SCREEN, self.H_SCREEN, WidgetTypes.WIDGET_GENERAL, -1, -1 )
  102.         screen.addPanel( "TechTopPanel", u"", u"", True, False, 0, 0, self.W_SCREEN, 55, PanelStyles.PANEL_STYLE_TOPBAR )
  103.         screen.addPanel( "TechBottomPanel", u"", u"", True, False, 0, 713, self.W_SCREEN, 55, PanelStyles.PANEL_STYLE_BOTTOMBAR )
  104.         screen.showWindowBackground(False)
  105.         screen.setText(self.EXIT_ID, "", self.EXIT_TEXT, CvUtil.FONT_RIGHT_JUSTIFY, self.X_EXIT, self.Y_EXIT, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
  106.  
  107.         # Header...
  108.         screen.setLabel(self.HEADER_ID, "Background", u"<font=4b>" + localText.getText("TXT_KEY_HALL_OF_FAME_SCREEN_TITLE", ()).upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, self.X_SCREEN, self.Y_TITLE, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
  109.  
  110.  
  111.  
  112.         xDropDown = self.DROPDOWN_SPACING_X
  113.         yDropDown = self.DROPDOWN_Y
  114.         iNumDropDowns = 0
  115.  
  116.         # Leader dropdown initialization
  117.         screen.addDropDownBoxGFC(self.LEADER_DROPDOWN_ID, xDropDown, yDropDown, self.DROPDOWN_WIDTH, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
  118.         screen.addPullDownString(self.LEADER_DROPDOWN_ID, localText.getText("TXT_KEY_ALL_LEADERS", ()), -1, -1, True)
  119.         for iCiv in range(gc.getNumCivilizationInfos()):
  120.             civ = gc.getCivilizationInfo(iCiv)
  121.             if civ.isPlayable():
  122.                 for iLeader in range(gc.getNumLeaderHeadInfos()):
  123.                     if civ.isLeaders(iLeader):
  124.                         screen.addPullDownString(self.LEADER_DROPDOWN_ID, gc.getLeaderHeadInfo(iLeader).getDescription(), iCiv, iLeader, False)
  125.         iNumDropDowns += 1
  126.         
  127.         yDropDown = self.DROPDOWN_SPACING_Y * (iNumDropDowns % 2) + self.DROPDOWN_Y
  128.         xDropDown = (self.DROPDOWN_WIDTH  + self.DROPDOWN_SPACING_X) * (iNumDropDowns / 2) + self.DROPDOWN_SPACING_X
  129.  
  130.         # Victory dropdown initialization
  131.         screen.addDropDownBoxGFC(self.VICTORY_DROPDOWN_ID, xDropDown, yDropDown, self.DROPDOWN_WIDTH, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
  132.         screen.addPullDownString(self.VICTORY_DROPDOWN_ID, localText.getText("TXT_KEY_ALL_VICTORIES", ()), -1, -1, True)
  133.         for i in range(gc.getNumVictoryInfos()):
  134.             screen.addPullDownString(self.VICTORY_DROPDOWN_ID, gc.getVictoryInfo(i).getDescription(), i, i, False)
  135.         iNumDropDowns += 1
  136.  
  137.         yDropDown = self.DROPDOWN_SPACING_Y * (iNumDropDowns % 2) + self.DROPDOWN_Y
  138.         xDropDown = (self.DROPDOWN_WIDTH  + self.DROPDOWN_SPACING_X) * (iNumDropDowns / 2) + self.DROPDOWN_SPACING_X
  139.  
  140.         # Difficulty level dropdown initialization
  141.         screen.addDropDownBoxGFC(self.DIFFICULTY_DROPDOWN_ID, xDropDown, yDropDown, self.DROPDOWN_WIDTH, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
  142.         screen.addPullDownString(self.DIFFICULTY_DROPDOWN_ID, localText.getText("TXT_KEY_ALL_DIFFICULTIES", ()), -1, -1, True)
  143.         for iHandicap in range(gc.getNumHandicapInfos()):
  144.             screen.addPullDownString(self.DIFFICULTY_DROPDOWN_ID, gc.getHandicapInfo(iHandicap).getDescription(), iHandicap, iHandicap, False)
  145.         iNumDropDowns += 1
  146.             
  147.         yDropDown = self.DROPDOWN_SPACING_Y * (iNumDropDowns % 2) + self.DROPDOWN_Y
  148.         xDropDown = (self.DROPDOWN_WIDTH  + self.DROPDOWN_SPACING_X) * (iNumDropDowns / 2) + self.DROPDOWN_SPACING_X
  149.  
  150.         # World Size dropdown initialization
  151.         screen.addDropDownBoxGFC(self.MAPSIZE_DROPDOWN_ID, xDropDown, yDropDown, self.DROPDOWN_WIDTH, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
  152.         screen.addPullDownString(self.MAPSIZE_DROPDOWN_ID, localText.getText("TXT_KEY_ALL_WORLD_SIZES", ()), -1, -1, True)
  153.         for i in range(gc.getNumWorldInfos()):
  154.             screen.addPullDownString(self.MAPSIZE_DROPDOWN_ID, gc.getWorldInfo(i).getDescription(), i, i, False)
  155.         iNumDropDowns += 1
  156.             
  157.         yDropDown = self.DROPDOWN_SPACING_Y * (iNumDropDowns % 2) + self.DROPDOWN_Y
  158.         xDropDown = (self.DROPDOWN_WIDTH  + self.DROPDOWN_SPACING_X) * (iNumDropDowns / 2) + self.DROPDOWN_SPACING_X
  159.  
  160.         # Era dropdown initialization
  161.         screen.addDropDownBoxGFC(self.ERA_DROPDOWN_ID, xDropDown, yDropDown, self.DROPDOWN_WIDTH, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
  162.         screen.addPullDownString(self.ERA_DROPDOWN_ID, localText.getText("TXT_KEY_ALL_ERAS", ()), -1, -1, True)
  163.         for i in range(gc.getNumEraInfos()):
  164.             screen.addPullDownString(self.ERA_DROPDOWN_ID, gc.getEraInfo(i).getDescription(), i, i, False)
  165.         iNumDropDowns += 1
  166.             
  167.         yDropDown = self.DROPDOWN_SPACING_Y * (iNumDropDowns % 2) + self.DROPDOWN_Y
  168.         xDropDown = (self.DROPDOWN_WIDTH  + self.DROPDOWN_SPACING_X) * (iNumDropDowns / 2) + self.DROPDOWN_SPACING_X
  169.  
  170.         # Game Speed dropdown initialization
  171.         screen.addDropDownBoxGFC(self.SPEED_DROPDOWN_ID, xDropDown, yDropDown, self.DROPDOWN_WIDTH, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
  172.         screen.addPullDownString(self.SPEED_DROPDOWN_ID, localText.getText("TXT_KEY_ALL_GAME_SPEEDS", ()), -1, -1, True)
  173.         for i in range(gc.getNumGameSpeedInfos()):
  174.             screen.addPullDownString(self.SPEED_DROPDOWN_ID, gc.getGameSpeedInfo(i).getDescription(), i, i, False)
  175.         iNumDropDowns += 1
  176.         
  177.         yDropDown = self.DROPDOWN_SPACING_Y * (iNumDropDowns % 2) + self.DROPDOWN_Y
  178.         xDropDown = (self.DROPDOWN_WIDTH  + self.DROPDOWN_SPACING_X) * (iNumDropDowns / 2) + self.DROPDOWN_SPACING_X
  179.  
  180.         # Climate dropdown initialization
  181.         #screen.addDropDownBoxGFC(self.CLIMATE_DROPDOWN_ID, xDropDown, yDropDown, self.DROPDOWN_WIDTH, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
  182.         #screen.addPullDownString(self.CLIMATE_DROPDOWN_ID, localText.getText("TXT_KEY_ALL_CLIMATES", ()), -1, -1, True)
  183.         #for i in range(gc.getNumClimateInfos()):
  184.         #    screen.addPullDownString(self.CLIMATE_DROPDOWN_ID, gc.getClimateInfo(i).getDescription(), i, i, False)
  185.         #iNumDropDowns += 1
  186.             
  187.         #yDropDown = self.DROPDOWN_SPACING_Y * (iNumDropDowns % 2) + self.DROPDOWN_Y
  188.         #xDropDown = (self.DROPDOWN_WIDTH  + self.DROPDOWN_SPACING_X) * (iNumDropDowns / 2) + self.DROPDOWN_SPACING_X
  189.  
  190.         # Sea Level dropdown initialization
  191.         #screen.addDropDownBoxGFC(self.SEALEVEL_DROPDOWN_ID, xDropDown, yDropDown, self.DROPDOWN_WIDTH, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
  192.         #screen.addPullDownString(self.SEALEVEL_DROPDOWN_ID, localText.getText("TXT_KEY_ALL_SEA_LEVELS", ()), -1, -1, True)
  193.         #for i in range(gc.getNumSeaLevelInfos()):
  194.         #    screen.addPullDownString(self.SEALEVEL_DROPDOWN_ID, gc.getSeaLevelInfo(i).getDescription(), i, i, False)
  195.         #iNumDropDowns += 1
  196.             
  197.         yDropDown = self.DROPDOWN_SPACING_Y * (iNumDropDowns % 2) + self.DROPDOWN_Y
  198.         xDropDown = (self.DROPDOWN_WIDTH  + self.DROPDOWN_SPACING_X) * (iNumDropDowns / 2) + self.DROPDOWN_SPACING_X
  199.  
  200.         # Multiplayer dropdown initialization
  201.         screen.addDropDownBoxGFC(self.MULTIPLAYER_DROPDOWN_ID, xDropDown, yDropDown, self.DROPDOWN_WIDTH, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
  202.         screen.addPullDownString(self.MULTIPLAYER_DROPDOWN_ID, localText.getText("TXT_KEY_MAIN_MENU_SINGLE_PLAYER", ()), 0, 0, True)
  203.         screen.addPullDownString(self.MULTIPLAYER_DROPDOWN_ID, localText.getText("TXT_KEY_MAIN_MENU_MULTIPLAYER", ()), 1, 1, False)
  204.         iNumDropDowns += 1
  205.             
  206.         yDropDown = self.DROPDOWN_SPACING_Y * (iNumDropDowns % 2) + self.DROPDOWN_Y
  207.         xDropDown = (self.DROPDOWN_WIDTH  + self.DROPDOWN_SPACING_X) * (iNumDropDowns / 2) + self.DROPDOWN_SPACING_X
  208.  
  209.         # Multiplayer dropdown initialization
  210.         screen.addDropDownBoxGFC(self.SORT_DROPDOWN_ID, xDropDown, yDropDown, self.DROPDOWN_WIDTH, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
  211.         screen.addPullDownString(self.SORT_DROPDOWN_ID, localText.getText("TXT_KEY_HALL_OF_FAME_SORT_BY_NORMALIZED_SCORE", ()), SORT_BY_NORMALIZED_SCORE, SORT_BY_NORMALIZED_SCORE, True)
  212.         screen.addPullDownString(self.SORT_DROPDOWN_ID, localText.getText("TXT_KEY_HALL_OF_FAME_SORT_BY_DATE", ()), SORT_BY_FINISH_DATE, SORT_BY_FINISH_DATE, False)
  213.         screen.addPullDownString(self.SORT_DROPDOWN_ID, localText.getText("TXT_KEY_HALL_OF_FAME_SORT_BY_GAME_SCORE", ()), SORT_BY_GAME_SCORE, SORT_BY_GAME_SCORE, False)
  214.         iNumDropDowns += 1
  215.  
  216.         self.drawContents()
  217.         
  218.     def drawContents(self):
  219.                 
  220.         screen = self.getScreen()
  221.         
  222.         screen.addTableControlGFC(self.TABLE_ID, 10, 2, 2 * self.DROPDOWN_SPACING_Y + self.DROPDOWN_Y, 1018, 545, True, True, 16, 16, TableStyles.TABLE_STYLE_STANDARD);
  223.         screen.enableSelect(self.TABLE_ID, False)
  224.         screen.enableSort(self.TABLE_ID)
  225.         screen.setTableColumnHeader(self.TABLE_ID, 0, "", 20)
  226.         screen.setTableColumnHeader(self.TABLE_ID, 1, localText.getText("TXT_KEY_PITBOSS_LEADER", ()), 200)
  227.         screen.setTableColumnHeader(self.TABLE_ID, 2, localText.getText("TXT_KEY_NORMALIZED_SCORE", ()), 85)
  228.         screen.setTableColumnHeader(self.TABLE_ID, 3, localText.getText("TXT_KEY_HALL_OF_FAME_SORT_BY_DATE", ()), 100)
  229.         screen.setTableColumnHeader(self.TABLE_ID, 4, localText.getText("TXT_KEY_GAME_SCORE", ()), 100)
  230.         screen.setTableColumnHeader(self.TABLE_ID, 5, localText.getText("TXT_KEY_CONCEPT_VICTORY", ()), 102)
  231.         screen.setTableColumnHeader(self.TABLE_ID, 6, localText.getText("TXT_KEY_PITBOSS_DIFFICULTY", ()), 102)
  232.         screen.setTableColumnHeader(self.TABLE_ID, 7, localText.getText("TXT_KEY_SETTINGS_MAP_SIZE", (u"", )), 102)
  233. #        screen.setTableColumnHeader(self.TABLE_ID, , localText.getText("TXT_KEY_SETTINGS_CLIMATE", (u"", )), 102)
  234. #        screen.setTableColumnHeader(self.TABLE_ID, , localText.getText("TXT_KEY_SETTINGS_SEA_LEVEL", (u"", )), 102)
  235.         screen.setTableColumnHeader(self.TABLE_ID, 8, localText.getText("TXT_KEY_SETTINGS_STARTING_ERA", (u"", )), 102)
  236.         screen.setTableColumnHeader(self.TABLE_ID, 9, localText.getText("TXT_KEY_SETTINGS_GAME_SPEED", (u"", )), 102)
  237. #        screen.setTableColumnHeader(self.TABLE_ID, , "", 73)
  238.         
  239.         self.infoList = [(-1,"",-1,"",-1,"","","","","",0)] * self.hallOfFame.getNumGames()
  240.         for i in range(self.hallOfFame.getNumGames()):
  241.             replayInfo = self.hallOfFame.getReplayInfo(i)
  242.             if ((self.iLeaderFilter == -1 or self.iLeaderFilter == replayInfo.getLeader(replayInfo.getActivePlayer())) and (self.iHandicapFilter == -1 or self.iHandicapFilter == replayInfo.getDifficulty()) and (self.iWorldFilter == -1 or self.iWorldFilter == replayInfo.getWorldSize()) and (self.iClimateFilter == -1 or self.iClimateFilter == replayInfo.getClimate()) and (self.iSeaLevelFilter == -1 or self.iSeaLevelFilter == replayInfo.getSeaLevel()) and (self.iEraFilter == -1 or self.iEraFilter == replayInfo.getEra()) and (self.iSpeedFilter == -1 or self.iSpeedFilter == replayInfo.getGameSpeed()) and (self.iVictoryFilter == -1 or self.iVictoryFilter == replayInfo.getVictoryType()) and ((self.iMultiplayerFilter == 1) == replayInfo.isMultiplayer())):
  243.                 szVictory = u""
  244.                 if replayInfo.getVictoryType() <= 0:
  245.                     szVictory = localText.getText("TXT_KEY_NONE", ())
  246.                 else:
  247.                     szVictory = gc.getVictoryInfo(replayInfo.getVictoryType()).getDescription()
  248.                     
  249.                 if self.iSortBy == SORT_BY_NORMALIZED_SCORE:
  250.                     iValue = -replayInfo.getNormalizedScore()
  251.                 elif self.iSortBy == SORT_BY_FINISH_DATE:
  252.                     iValue = replayInfo.getFinalTurn()
  253.                 elif self.iSortBy == SORT_BY_GAME_SCORE:
  254.                     iValue = -replayInfo.getFinalScore()
  255.  
  256.                 self.infoList[i] = (iValue,
  257.                         localText.getText("TXT_KEY_LEADER_CIV_DESCRIPTION", (replayInfo.getLeaderName(), replayInfo.getShortCivDescription())),
  258.                         replayInfo.getNormalizedScore(),
  259.                         replayInfo.getFinalDate(),
  260.                         replayInfo.getFinalScore(), 
  261.                         szVictory,
  262.                         gc.getHandicapInfo(replayInfo.getDifficulty()).getDescription(),
  263.                         gc.getWorldInfo(replayInfo.getWorldSize()).getDescription(),
  264. #                        gc.getClimateInfo(replayInfo.getClimate()).getDescription(),
  265. #                        gc.getSeaLevelInfo(replayInfo.getSeaLevel()).getDescription(),
  266.                         gc.getEraInfo(replayInfo.getEra()).getDescription(),
  267.                         gc.getGameSpeedInfo(replayInfo.getGameSpeed()).getDescription(),
  268.                         i)
  269.         self.infoList.sort()
  270.                         
  271.         for i in range(len(self.infoList)):
  272.         
  273.             szButtonName = self.REPLAY_BUTTON_ID + str(i)
  274.             screen.setButtonGFC(szButtonName, self.infoList[i][1], "",
  275.                 0, 0, 10, 10, WidgetTypes.WIDGET_GENERAL, -1, -1, ButtonStyles.BUTTON_STYLE_STANDARD)
  276.         
  277.             screen.appendTableRow(self.TABLE_ID)
  278.             screen.setTableText(self.TABLE_ID, 1, i, self.infoList[i][1], "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)
  279.             if self.infoList[i][2] >= 0:
  280.                 screen.setTableInt(self.TABLE_ID, 2, i, u"%d" % self.infoList[i][2], "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_RIGHT_JUSTIFY)
  281.             screen.setTableText(self.TABLE_ID, 3, i, self.infoList[i][3], "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)
  282.             if self.infoList[i][4] >= 0:
  283.                 screen.setTableInt(self.TABLE_ID, 4, i, u"%d" % self.infoList[i][4], "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_RIGHT_JUSTIFY)
  284.             screen.setTableText(self.TABLE_ID, 5, i, self.infoList[i][5], "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)
  285.             screen.setTableText(self.TABLE_ID, 6, i, self.infoList[i][6], "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)
  286.             screen.setTableText(self.TABLE_ID, 7, i, self.infoList[i][7], "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)
  287.             screen.setTableText(self.TABLE_ID, 8, i, self.infoList[i][8], "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)
  288.             screen.setTableText(self.TABLE_ID, 9, i, self.infoList[i][9], "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)
  289.             screen.attachControlToTableCell(szButtonName, self.TABLE_ID, i, 0)        
  290.                                 
  291.         return
  292.         
  293.                                                                                 
  294.     # handle the input for this screen...
  295.     def handleInput (self, inputClass):
  296.         if (inputClass.getNotifyCode() == NotifyCode.NOTIFY_LISTBOX_ITEM_SELECTED):
  297.             if (inputClass.getFunctionName() == self.LEADER_DROPDOWN_ID):            
  298.                 screen = self.getScreen()
  299.                 iIndex = screen.getSelectedPullDownID(self.LEADER_DROPDOWN_ID)
  300.                 self.iLeaderFilter = screen.getPullDownData(self.LEADER_DROPDOWN_ID, iIndex)
  301.                 self.drawContents()
  302.             elif (inputClass.getFunctionName() == self.DIFFICULTY_DROPDOWN_ID):            
  303.                 screen = self.getScreen()
  304.                 iIndex = screen.getSelectedPullDownID(self.DIFFICULTY_DROPDOWN_ID)
  305.                 self.iHandicapFilter = screen.getPullDownData(self.DIFFICULTY_DROPDOWN_ID, iIndex)
  306.                 self.drawContents()
  307.             elif (inputClass.getFunctionName() == self.MAPSIZE_DROPDOWN_ID):            
  308.                 screen = self.getScreen()
  309.                 iIndex = screen.getSelectedPullDownID(self.MAPSIZE_DROPDOWN_ID)
  310.                 self.iWorldFilter = screen.getPullDownData(self.MAPSIZE_DROPDOWN_ID, iIndex)
  311.                 self.drawContents()
  312.             elif (inputClass.getFunctionName() == self.CLIMATE_DROPDOWN_ID):            
  313.                 screen = self.getScreen()
  314.                 iIndex = screen.getSelectedPullDownID(self.CLIMATE_DROPDOWN_ID)
  315.                 self.iClimateFilter = screen.getPullDownData(self.CLIMATE_DROPDOWN_ID, iIndex)
  316.                 self.drawContents()
  317.             elif (inputClass.getFunctionName() == self.SEALEVEL_DROPDOWN_ID):            
  318.                 screen = self.getScreen()
  319.                 iIndex = screen.getSelectedPullDownID(self.SEALEVEL_DROPDOWN_ID)
  320.                 self.iSeaLevelFilter = screen.getPullDownData(self.SEALEVEL_DROPDOWN_ID, iIndex)
  321.                 self.drawContents()
  322.             elif (inputClass.getFunctionName() == self.ERA_DROPDOWN_ID):            
  323.                 screen = self.getScreen()
  324.                 iIndex = screen.getSelectedPullDownID(self.ERA_DROPDOWN_ID)
  325.                 self.iEraFilter = screen.getPullDownData(self.ERA_DROPDOWN_ID, iIndex)
  326.                 self.drawContents()
  327.             elif (inputClass.getFunctionName() == self.SPEED_DROPDOWN_ID):            
  328.                 screen = self.getScreen()
  329.                 iIndex = screen.getSelectedPullDownID(self.SPEED_DROPDOWN_ID)
  330.                 self.iSpeedFilter = screen.getPullDownData(self.SPEED_DROPDOWN_ID, iIndex)
  331.                 self.drawContents()
  332.             elif (inputClass.getFunctionName() == self.VICTORY_DROPDOWN_ID):            
  333.                 screen = self.getScreen()
  334.                 iIndex = screen.getSelectedPullDownID(self.VICTORY_DROPDOWN_ID)
  335.                 self.iVictoryFilter = screen.getPullDownData(self.VICTORY_DROPDOWN_ID, iIndex)
  336.                 self.drawContents()
  337.             elif (inputClass.getFunctionName() == self.MULTIPLAYER_DROPDOWN_ID):            
  338.                 screen = self.getScreen()
  339.                 iIndex = screen.getSelectedPullDownID(self.MULTIPLAYER_DROPDOWN_ID)
  340.                 self.iMultiplayerFilter = screen.getPullDownData(self.MULTIPLAYER_DROPDOWN_ID, iIndex)
  341.                 self.drawContents()
  342.             elif (inputClass.getFunctionName() == self.SORT_DROPDOWN_ID):            
  343.                 screen = self.getScreen()
  344.                 iIndex = screen.getSelectedPullDownID(self.SORT_DROPDOWN_ID)
  345.                 self.iSortBy = screen.getPullDownData(self.SORT_DROPDOWN_ID, iIndex)
  346.                 self.drawContents()
  347.         elif (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED):
  348.             if (inputClass.getFunctionName() == self.EXIT_ID):
  349.                 screen = self.getScreen()
  350.                 screen.hideScreen()
  351.             elif (inputClass.getFunctionName() == self.REPLAY_BUTTON_ID and self.bAllowReplay):
  352.                 iRow = inputClass.getID()
  353.                 if iRow < len(self.infoList):
  354.                     CvScreensInterface.replayScreen.replayInfo = self.hallOfFame.getReplayInfo(self.infoList[iRow][10])
  355.                     CvScreensInterface.replayScreen.showScreen(True)
  356.                                         
  357.         return 0
  358.  
  359.     def update(self, fDelta):
  360.         return                    
  361.  
  362.  
  363.  
  364.