public void equipment_selected(TMP_Dropdown d) { selecting = true; string e = d.captionText.text; EquipmentInventory ei = TurnPhaser.I.active_disc.equipment_inventory; // Undo the selection, the same equipment cannot be worn more than once, // and only one of a type can be worn at once. if (ei.has_equipped(e) || ei.get_equipment_amount(e) > 1) { if (ei.equipment_slots[dropdowns[d]].full) { string name = ei.equipment_slots[dropdowns[d]].equipment.name; d.value = d.options.FindIndex(option => option.text == name); } else { d.value = d.options.FindIndex(option => option.text == "Empty"); } return; } // Unequip existing worn item. if (ei.equipment_slots[dropdowns[d]].full) { ei.unequip(dropdowns[d]); } hide_equipment_descriptionP(); ei.equip(e, dropdowns[d]); }
public void load_equipment_description(EquipmentInventory ei, string e) { if (!ei.has_equipped(e)) { return; } descriptionP.SetActive(true); descriptionT.text = ei.equipment[e][0].description; }