def show(self): techs = [tech for tech in g.techs.values() if tech.available() and not tech.done] techs.sort() self.list = [_("CPU Pool"), g.jobs[g.get_job_level()][3]] + \ [_("Research %s") % tech.name for tech in techs] self.key_list = ["cpu_pool", "jobs"] + [tech.id for tech in techs] self.listbox.key_list = self.key_list self.dirty_count = True return super(ResearchScreen, self).show()
def on_select(self, description_pane, key): if key in g.techs: description = g.techs[key].get_info() elif key == "cpu_pool": description = g.strings["cpu_pool"] + "\n---\n" + g.strings["research_cpu_pool"] elif key == "jobs": template = "%s\n" + _("%s money per CPU per day.") + "\n---\n%s" job = g.jobs[g.get_job_level()] profit = job[0] if g.techs["Advanced Simulacra"].done: profit = int(profit * 1.1) description = template % (job[3], profit, job[2]) else: description = "" text.Text(self.description_pane, (0,0), (-1,-1), text=description, background_color=gg.colors["dark_blue"], text_size=18, align=constants.LEFT, valign=constants.TOP, borders=constants.ALL)