def isNeedToCheckCRCs(): """ Returns True if the CRCs need to be checked during the starting save process. For now we always check the CRCs so the warning can show on DoM screen and Settings tab. """ return Buffy.isActive()
def getWarningMessage(): """ Returns either a HOF-only or HOF-and-GOTM warning message based on CyGame.getWarningStatus(). """ if not Buffy.isActive(): return BugUtil.getText("TXT_KEY_BUFFY_INVALID_HOF") if CyGame().getWarningStatus() == 1: return BugUtil.getText("TXT_KEY_BUFFY_INVALID_HOF_GOTM") else: return BugUtil.getText("TXT_KEY_BUFFY_INVALID_HOF")
def create(self, screen): tab = self.createTab(screen) panel = self.createMainPanel(screen) column = self.addOneColumnLayout(screen, panel) left, center, right = self.addThreeColumnLayout(screen, column, "Top", True) self.createGreatPersonGeneralPanel(screen, left) self.addSpacer(screen, left, "General1") self.createTechSplashPanel(screen, left) self.addSpacer(screen, left, "General2") self.createLeaderheadPanel(screen, left) self.createAutoSavePanel(screen, center) self.addSpacer(screen, center, "General3") self.createActionsPanel(screen, center) if Buffy.isEnabled(): self.createBuffyPanel(screen, right) self.addSpacer(screen, right, "General4") self.createMiscellaneousPanel(screen, right)
def create(self, screen): tab = self.createTab(screen) panel = self.createMainPanel(screen) column = self.addOneColumnLayout(screen, panel) left, center, right = self.addThreeColumnLayout( screen, column, "Top", True) self.createGreatPersonGeneralPanel(screen, left) self.addSpacer(screen, left, "General1") self.createTechSplashPanel(screen, left) self.addSpacer(screen, left, "General2") self.createLeaderheadPanel(screen, left) self.createAutoSavePanel(screen, center) self.addSpacer(screen, center, "General3") self.createActionsPanel(screen, center) if Buffy.isEnabled(): self.createBuffyPanel(screen, right) self.addSpacer(screen, right, "General4") self.createMiscellaneousPanel(screen, right)
def settingsOK(): """ Returns True if BUFFY is active and all game/map settings and CRCs are acceptable, on Mac, or it's an XOTM game. """ game = gc.getGame() map = gc.getMap() # xOTM games are always okay # EF: Mac only? if isXOTMScenario(): return True if not Buffy.isActive(): return False if not Buffy.isDllInCorrectPath(): return False if game.getWarningStatus() == 1: return False # Check that the map script used is a valid one if not isMapScriptOK(): return False # Don't allow the balanced option if getBalanced(): return False # Check that the world wrap setting is OK if not getWorldWrapSettingOK(): return False # Check that all victory conditions are enabled for iVCLoop in range(gc.getNumVictoryInfos()): if not game.isVictoryValid(iVCLoop): return False # Ensure the game is single player if game.isGameMultiPlayer(): return False # Check the options if len(getInvalidGameOptions()) > 0: return False opponentCount = -1 seenLeaders = set() for player in PlayerUtil.players(barbarian=False, minor=False): opponentCount += 1 iLeader = player.getLeaderType() if iLeader >= 0: if iLeader in seenLeaders: return False seenLeaders.add(iLeader) if not isOpponentCountOK(opponentCount): return False if game.isTeamGame(): return False if crcResult != 0: return False return True