def on_description_change(self): super(MultipleBuildDialog, self).on_description_change() if self.item is not None: count = self.count_slider.slider_pos self.description.text += "\n---\n" self.description.text += self.item.get_total_cost_info(self.count_slider.slider_pos) self.description.text += "\n" self.description.text += self.item.get_quality_info(if_installed_in_base=self.parent.base, count=count) self.description.text += "\n" if self.count_slider.slider_pos > 0: g.pl.considered_buyables = [buyable.Buyable(self.item, count=count)] else: g.pl.considered_buyables = []
def on_description_change(self): super(MultipleBuildDialog, self).on_description_change() if self.item is not None: self.description.text += "\n---\n" self.description.text += self.item.get_total_cost_info( self.count_slider.slider_pos) self.description.text += "\n" if self.count_slider.slider_pos > 0: g.pl.considered_buyables = [ buyable.Buyable(self.item, count=self.count_slider.slider_pos) ] else: g.pl.considered_buyables = []
def on_change(self, description_pane, item): self.item = item self.description = text.Text(self.description_pane, (0, 0), (-1, -1), text="", background_color="pane_background", align=constants.LEFT, valign=constants.TOP, borders=constants.ALL) old_item = self.parent.base.items[self.type.id] if item is not None and (old_item is None or old_item.spec != item): g.pl.considered_buyables = [buyable.Buyable(self.item, count=1)] else: g.pl.considered_buyables = [] self.on_description_change()