def BUGConstants(self): if self.bBUGConstants: return self.bBUGConstants = True # BUG additions self.hammerIcon = u"%c" % (gc.getYieldInfo( YieldTypes.YIELD_PRODUCTION).getChar()) # Special symbols for building, wonder and project views self.objectIsPresent = "x" self.objectIsNotPresent = "-" self.objectCanBeBuild = "o" self.objectUnderConstruction = self.hammerIcon # add the colors dependant on the statuses self.objectHave = localText.changeTextColor( self.objectIsPresent, gc.getInfoTypeForString("COLOR_GREEN")) #"x" self.objectNotPossible = localText.changeTextColor( self.objectIsNotPresent, gc.getInfoTypeForString("COLOR_RED")) #"-" self.objectPossible = localText.changeTextColor( self.objectCanBeBuild, gc.getInfoTypeForString("COLOR_BLUE")) #"o" self.objectHaveObsolete = localText.changeTextColor( self.objectIsPresent, gc.getInfoTypeForString("COLOR_WHITE")) #"x" self.objectNotPossibleConcurrent = localText.changeTextColor( self.objectIsNotPresent, gc.getInfoTypeForString("COLOR_YELLOW")) #"-" self.objectPossibleConcurrent = localText.changeTextColor( self.objectCanBeBuild, gc.getInfoTypeForString("COLOR_YELLOW")) #"o" self.szCities = localText.getText("TXT_KEY_BUG_RELIGIOUS_CITY", ()) self.szTemples = localText.getText("TXT_KEY_BUG_RELIGIOUS_TEMPLE", ()) self.szMonastaries = localText.getText( "TXT_KEY_BUG_RELIGIOUS_MONASTARY", ()) self.szMissionaries = localText.getText( "TXT_KEY_BUG_RELIGIOUS_MISSIONARY", ()) self.zoomArt = ArtFileMgr.getInterfaceArtInfo( "INTERFACE_BUTTONS_CITYSELECTION").getPath() self.sCity = localText.getText("TXT_KEY_WONDER_CITY", ()) # scroll offset if ReligionUtil.getNumReligions() > 7: self.H_SCROLL_OFFSET = 20 else: self.H_SCROLL_OFFSET = 0
def BUGConstants(self): if self.bBUGConstants: return self.bBUGConstants = True # BUG additions self.hammerIcon = u"%c" % (gc.getYieldInfo(YieldTypes.YIELD_PRODUCTION).getChar()) # Special symbols for building, wonder and project views self.objectIsPresent = "x" self.objectIsNotPresent = "-" self.objectCanBeBuild = "o" self.objectUnderConstruction = self.hammerIcon # add the colors dependant on the statuses self.objectHave = localText.changeTextColor(self.objectIsPresent, gc.getInfoTypeForString("COLOR_GREEN")) # "x" self.objectNotPossible = localText.changeTextColor( self.objectIsNotPresent, gc.getInfoTypeForString("COLOR_RED") ) # "-" self.objectPossible = localText.changeTextColor( self.objectCanBeBuild, gc.getInfoTypeForString("COLOR_BLUE") ) # "o" self.objectHaveObsolete = localText.changeTextColor( self.objectIsPresent, gc.getInfoTypeForString("COLOR_WHITE") ) # "x" self.objectNotPossibleConcurrent = localText.changeTextColor( self.objectIsNotPresent, gc.getInfoTypeForString("COLOR_YELLOW") ) # "-" self.objectPossibleConcurrent = localText.changeTextColor( self.objectCanBeBuild, gc.getInfoTypeForString("COLOR_YELLOW") ) # "o" self.szCities = localText.getText("TXT_KEY_BUG_RELIGIOUS_CITY", ()) self.szTemples = localText.getText("TXT_KEY_BUG_RELIGIOUS_TEMPLE", ()) self.szMonastaries = localText.getText("TXT_KEY_BUG_RELIGIOUS_MONASTARY", ()) self.szMissionaries = localText.getText("TXT_KEY_BUG_RELIGIOUS_MISSIONARY", ()) self.zoomArt = ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_CITYSELECTION").getPath() self.sCity = localText.getText("TXT_KEY_WONDER_CITY", ()) # scroll offset if ReligionUtil.getNumReligions() > 7: self.H_SCROLL_OFFSET = 20 else: self.H_SCROLL_OFFSET = 0
def interfaceScreen (self): self.SCREEN_ART = ArtFileMgr.getInterfaceArtInfo("TECH_BG").getPath() self.NO_STATE_BUTTON_ART = ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_CANCEL").getPath() self.EXIT_TEXT = u"<font=4>" + localText.getText("TXT_KEY_PEDIA_SCREEN_EXIT", ()).upper() + "</font>" self.CONVERT_TEXT = u"<font=4>" + localText.getText("TXT_KEY_RELIGION_CONVERT", ()).upper() + "</font>" self.CANCEL_TEXT = u"<font=4>" + localText.getText("TXT_KEY_SCREEN_CANCEL", ()).upper() + "</font>" self.iActivePlayer = gc.getGame().getActivePlayer() # BUG - start if self.NUM_RELIGIONS == -1: self.NUM_RELIGIONS = ReligionUtil.getNumReligions() self.COL_FIRST_UNIT = self.COL_FIRST_RELIGION + self.NUM_RELIGIONS self.COL_FIRST_BUILDING = self.COL_FIRST_UNIT + ReligionUtil.getNumUnitTypes() self.COL_EFFECTS = self.COL_FIRST_BUILDING + ReligionUtil.getNumBuildingTypes() self.TABLE_COLUMNS = self.COL_EFFECTS + 1 # BUG - end self.bScreenUp = True screen = self.getScreen() if screen.isActive(): return screen.setRenderInterfaceOnly(True); screen.showScreen( PopupStates.POPUPSTATE_IMMEDIATE, False) # Set the background and exit button, and show the screen screen.setDimensions(screen.centerX(0), screen.centerY(0), self.W_SCREEN, self.H_SCREEN) screen.addDDSGFC(self.BACKGROUND_ID, ArtFileMgr.getInterfaceArtInfo("MAINMENU_SLIDESHOW_LOAD").getPath(), 0, 0, self.W_SCREEN, self.H_SCREEN, WidgetTypes.WIDGET_GENERAL, -1, -1 ) screen.addPanel( "TechTopPanel", u"", u"", True, False, 0, 0, self.W_SCREEN, 55, PanelStyles.PANEL_STYLE_TOPBAR ) screen.addPanel( "TechBottomPanel", u"", u"", True, False, 0, 713, self.W_SCREEN, 55, PanelStyles.PANEL_STYLE_BOTTOMBAR ) screen.setText(self.CANCEL_NAME, "Background", self.CANCEL_TEXT, CvUtil.FONT_CENTER_JUSTIFY, self.X_CANCEL, self.Y_CANCEL, self.Z_TEXT, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, 1, 0) screen.showWindowBackground(False) # Header... screen.setLabel(self.HEADER_NAME, "Background", u"<font=4b>" + localText.getText("TXT_KEY_RELIGION_SCREEN_TITLE", ()).upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, self.X_SCREEN, self.Y_TITLE, self.Z_TEXT, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1) # Make the scrollable areas for the city list... if (CyGame().isDebugMode()): self.szDropdownName = self.DEBUG_DROPDOWN_ID screen.addDropDownBoxGFC(self.szDropdownName, 22, 12, 300, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT) for j in range(gc.getMAX_PLAYERS()): if (gc.getPlayer(j).isAlive()): screen.addPullDownString(self.szDropdownName, gc.getPlayer(j).getName(), j, j, False ) if AdvisorOpt.isReligious(): self.X_RELIGION_AREA = 45 self.Y_RELIGION_AREA = 84 - 40 self.W_RELIGION_AREA = 934 self.H_RELIGION_AREA = 175 + 75 # screen.addPanel(szArea, "", "", False, True, self.X_RELIGION_AREA, self.Y_RELIGION_AREA - 40, self.W_RELIGION_AREA, self.H_RELIGION_AREA + 80, PanelStyles.PANEL_STYLE_MAIN) if AdvisorOpt.isShowAllReligions(): self.RELIGIONS = ReligionUtil.getAllReligions() elif AdvisorOpt.isShowFoundedReligions(): self.RELIGIONS = ReligionUtil.getFoundedReligions() else: self.RELIGIONS = ReligionUtil.getPlayerReligions(gc.getPlayer(self.iActivePlayer)) else: self.X_RELIGION_AREA = 45 self.Y_RELIGION_AREA = 84 self.W_RELIGION_AREA = 934 self.H_RELIGION_AREA = 175 # self.RELIGIONS = ReligionUtil.getAllReligions() + (ReligionUtil.getNumReligions(),) # K-Mod. the original BUG code simply doesn't run. (advc, note: Also fixed in BUG 4.5.) self.RELIGIONS = range(gc.getNumReligionInfos()) # Make the scrollable area for the religions list... screen.addPanel(self.RELIGION_PANEL_ID, "", "", False, True, self.X_RELIGION_AREA, self.Y_RELIGION_AREA, self.W_RELIGION_AREA, self.H_RELIGION_AREA+5, PanelStyles.PANEL_STYLE_MAIN) screen.addScrollPanel( "ReligionList", u"", self.X_RELIGION_AREA, self.Y_RELIGION_AREA, self.W_RELIGION_AREA, self.H_RELIGION_AREA, PanelStyles.PANEL_STYLE_EXTERNAL ) screen.setActivation( "ReligionList", ActivationTypes.ACTIVATE_NORMAL ) # Draw Religion info self.drawReligionInfo() self.drawHelpInfo() self.drawCityInfo(self.iReligionSelected)
def interfaceScreen(self): self.SCREEN_ART = ArtFileMgr.getInterfaceArtInfo("TECH_BG").getPath() self.NO_STATE_BUTTON_ART = ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_CANCEL").getPath() self.EXIT_TEXT = u"<font=4>" + localText.getText("TXT_KEY_PEDIA_SCREEN_EXIT", ()).upper() + "</font>" self.CONVERT_TEXT = u"<font=4>" + localText.getText("TXT_KEY_RELIGION_CONVERT", ()).upper() + "</font>" self.CANCEL_TEXT = u"<font=4>" + localText.getText("TXT_KEY_SCREEN_CANCEL", ()).upper() + "</font>" self.iActivePlayer = gc.getGame().getActivePlayer() # BUG - start if self.NUM_RELIGIONS == -1: self.NUM_RELIGIONS = ReligionUtil.getNumReligions() self.COL_FIRST_UNIT = self.COL_FIRST_RELIGION + self.NUM_RELIGIONS self.COL_FIRST_BUILDING = self.COL_FIRST_UNIT + ReligionUtil.getNumUnitTypes() self.COL_EFFECTS = self.COL_FIRST_BUILDING + ReligionUtil.getNumBuildingTypes() self.TABLE_COLUMNS = self.COL_EFFECTS + 1 # BUG - end self.bScreenUp = True screen = self.getScreen() if screen.isActive(): return screen.setRenderInterfaceOnly(True) screen.showScreen(PopupStates.POPUPSTATE_IMMEDIATE, False) # Set the background and exit button, and show the screen screen.setDimensions(screen.centerX(0), screen.centerY(0), self.W_SCREEN, self.H_SCREEN) screen.addDDSGFC( self.BACKGROUND_ID, ArtFileMgr.getInterfaceArtInfo("MAINMENU_SLIDESHOW_LOAD").getPath(), 0, 0, self.W_SCREEN, self.H_SCREEN, WidgetTypes.WIDGET_GENERAL, -1, -1, ) screen.addPanel("TechTopPanel", u"", u"", True, False, 0, 0, self.W_SCREEN, 55, PanelStyles.PANEL_STYLE_TOPBAR) screen.addPanel( "TechBottomPanel", u"", u"", True, False, 0, 713, self.W_SCREEN, 55, PanelStyles.PANEL_STYLE_BOTTOMBAR ) screen.setText( self.CANCEL_NAME, "Background", self.CANCEL_TEXT, CvUtil.FONT_CENTER_JUSTIFY, self.X_CANCEL, self.Y_CANCEL, self.Z_TEXT, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, 1, 0, ) screen.showWindowBackground(False) # Header... screen.setLabel( self.HEADER_NAME, "Background", u"<font=4b>" + localText.getText("TXT_KEY_RELIGION_SCREEN_TITLE", ()).upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, self.X_SCREEN, self.Y_TITLE, self.Z_TEXT, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1, ) # Make the scrollable areas for the city list... if CyGame().isDebugMode(): self.szDropdownName = self.DEBUG_DROPDOWN_ID screen.addDropDownBoxGFC( self.szDropdownName, 22, 12, 300, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT ) for j in range(gc.getMAX_PLAYERS()): if gc.getPlayer(j).isAlive(): screen.addPullDownString(self.szDropdownName, gc.getPlayer(j).getName(), j, j, False) if AdvisorOpt.isReligious(): self.X_RELIGION_AREA = 45 self.Y_RELIGION_AREA = 84 - 40 self.W_RELIGION_AREA = 934 self.H_RELIGION_AREA = 175 + 75 # screen.addPanel(szArea, "", "", False, True, self.X_RELIGION_AREA, self.Y_RELIGION_AREA - 40, self.W_RELIGION_AREA, self.H_RELIGION_AREA + 80, PanelStyles.PANEL_STYLE_MAIN) if AdvisorOpt.isShowAllReligions(): self.RELIGIONS = ReligionUtil.getAllReligions() elif AdvisorOpt.isShowFoundedReligions(): self.RELIGIONS = ReligionUtil.getFoundedReligions() else: self.RELIGIONS = ReligionUtil.getPlayerReligions(gc.getPlayer(self.iActivePlayer)) else: self.X_RELIGION_AREA = 45 self.Y_RELIGION_AREA = 84 self.W_RELIGION_AREA = 934 self.H_RELIGION_AREA = 175 self.RELIGIONS = ReligionUtil.getAllReligions() + (ReligionUtil.getNumReligions(),) # Make the scrollable area for the religions list... screen.addPanel( self.RELIGION_PANEL_ID, "", "", False, True, self.X_RELIGION_AREA, self.Y_RELIGION_AREA, self.W_RELIGION_AREA, self.H_RELIGION_AREA + 5, PanelStyles.PANEL_STYLE_MAIN, ) screen.addScrollPanel( "ReligionList", u"", self.X_RELIGION_AREA, self.Y_RELIGION_AREA, self.W_RELIGION_AREA, self.H_RELIGION_AREA, PanelStyles.PANEL_STYLE_EXTERNAL, ) screen.setActivation("ReligionList", ActivationTypes.ACTIVATE_NORMAL) # Draw Religion info self.drawReligionInfo() self.drawHelpInfo() self.drawCityInfo(self.iReligionSelected)