def updateGalaxyDashboard(self, player, civilization, universe_key, x, y): try: universe = db.get(universe_key) galaxy = universe.getGalaxyWithXY(x, y) navmap = helpers.drawNavMap(galaxy = galaxy, player = player, civilization = civilization) zoombar = '%s » ' % galaxy.name return navmap + zoombar except Exception, e: import traceback traceback.print_exc()
def updateSectorDashboard(self, player, civilization, galaxy_key, x, y): try: galaxy = db.get(galaxy_key) sector = galaxy.getSectorWithXY(x, y) navmap = helpers.drawNavMap(sector = sector, player = player, civilization = civilization) zoombar = '%s » <a onclick="processGalaxyDashboard(\'%s\', \'%s\', \'%s\')">[ zoom out ]</a>' % (sector.name, galaxy.universe.key(), galaxy.x, galaxy.y) return navmap + zoombar except Exception, e: import traceback traceback.print_exc()
def updateSystemDashboard(self, player, civilization, sector_key, x, y): try: sector = db.get(sector_key) system = sector.getSystemWithXY(x, y) navmap = helpers.drawNavMap(system = system, player = player, civilization = civilization) zoombar = '%s » <a onclick="processSectorDashboard(\'%s\', \'%s\', \'%s\')">[ zoom out ]</a>' % (system.name, sector.galaxy.key(), sector.x, sector.y) return navmap + zoombar except Exception, e: import traceback traceback.print_exc()
def updatePlanetDashboard(self, player, civilization, system_key, x, y): try: system = db.get(system_key) planet = system.getPlanetWithXY(x, y) navmap = helpers.drawNavMap(planet = planet, player = player, civilization = civilization) zoombar = '%s » <a onclick="processSystemDashboard(\'%s\', \'%s\', \'%s\')">[ zoom out ]</a>' % (planet.name, planet.system.sector.key(), planet.system.x, planet.system.y) return navmap + zoombar except Exception, e: import traceback traceback.print_exc()
def draw(player, civilization, planet): navmap = helpers.drawNavMap(planet = planet, player = player, civilization = civilization) zoombar = '%s » <a onclick="processSystemDashboard(\'%s\', \'%s\', \'%s\')">[ zoom out ]</a>' % (planet.name, planet.system.sector.key(), planet.system.x, planet.system.y) sidebar = buildDashboardSidebar(player, civilization) bottombar = buildBottombar(player, civilization) dialogs = '' #dialogs += """ #<div id="welcome_dialog" class="dialog" title="Welcome to Oktober5"><p>I, %s, solomnly swear that I will have fun.</p></div> #""" % (player.name, planet.system.key(), planet.x, planet.y) return navmap, zoombar, sidebar, bottombar, dialogs
def updateDashboard(self, player, civilization): planet = (db.get(civilization.hives[0])).planet navmap = helpers.drawNavMap(planet = planet, player = player, civilization = civilization) zoombar = '%s » <a onclick="processSystemDashboard(\'%s\', \'%s\', \'%s\')">[ zoom out ]</a>' % (planet.name, planet.system.sector.key(), planet.system.x, planet.system.y) return navmap + zoombar