def update_selection(self):
        tech = self.assets.techs().get_tech(self.selected_tech)

        # this is only used if player has corrupt/missing modded techs known
        if tech is None:
            self.ui.tech_info.setText("Unknown Tech")
            self.ui.current_icon.setPixmap(QPixmap())
            self.ui.add_button.setEnabled(False)
            self.ui.remove_button.setEnabled(True)
            return

        visible = [x["name"] for x in self.player.get_visible_techs()]

        tech_info = "<strong>%s (%s)</strong><br><br>" % (tech[0]["shortdescription"],
                                                          tech[0]["itemName"])
        tech_info += "<strong>Type:</strong> %s<br>" % tech[3]["type"]
        tech_info += "<strong>Rarity:</strong> %s<br>" % tech[0]["rarity"]
        tech_info += "<strong>Module:</strong> %s<br><br>" % tech[0]["techModule"]
        tech_info += tech[0]["description"]+"<br>"

        self.ui.tech_info.setText(tech_info)
        self.ui.current_icon.setPixmap(QPixmap.fromImage(ImageQt(tech[1])).scaled(32, 32))

        slots = ["head", "body", "legs", "suit"]
        index = 1
        for slot in slots:
            set_button = getattr(self.ui, "icon" + str(index) + "_button")
            clear_button = getattr(self.ui, "icon" + str(index) + "_clear")
            can_set = tech[3]["type"] == slot
            is_set = self.equip[index-1] is not None
            set_button.setEnabled(can_set)
            clear_button.setEnabled(is_set)
            index += 1

        can_add = self.selected_tech not in visible
        self.ui.add_button.setEnabled(can_add)
        self.ui.remove_button.setEnabled(not can_add)
        self.ui.toggle_button.setEnabled(not can_add)
dataset/ETHPy150Open wizzomafizzo/starcheat/starcheat/gui/techs.py/Techs.update_selection/original