From a0211a8425c49d51a7988d87a368830bf88401d0 Mon Sep 17 00:00:00 2001 From: LemonNexus Date: Mon, 9 Feb 2026 19:30:48 +0000 Subject: [PATCH] fix: handle both NexusArmorSet and ArmorSet types in _on_equip_full_set - Check if pieces is a list (NexusArmorSet) or dict (ArmorSet) - Route to API method for NexusArmorSet - Keep hardcoded logic for ArmorSet from combo box --- ui/loadout_manager.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ui/loadout_manager.py b/ui/loadout_manager.py index 4cd3fa9..ba5ea56 100644 --- a/ui/loadout_manager.py +++ b/ui/loadout_manager.py @@ -2016,8 +2016,14 @@ class LoadoutManagerDialog(QDialog): self._update_calculations() def _on_equip_full_set(self): - """Equip a full armor set.""" + """Equip a full armor set from the combo box or API.""" if self.armor_set_combo.currentIndex() <= 0: + # Check if we have a current_armor_set from API selection + if self.current_armor_set: + # Already equipped via API selector + self._update_armor_summary() + self._update_calculations() + return QMessageBox.information(self, "No Selection", "Please select an armor set first.") return @@ -2025,6 +2031,13 @@ class LoadoutManagerDialog(QDialog): if not armor_set: return + # Check if this is an API-based set (NexusArmorSet) or hardcoded (ArmorSet) + if hasattr(armor_set, 'pieces') and isinstance(armor_set.pieces, list): + # NexusArmorSet - pieces is List[str], need to use API to get pieces + self._on_api_armor_set_selected(armor_set) + return + + # Hardcoded ArmorSet - pieces is Dict[ArmorSlot, ArmorPiece] # Clear any individual pieces for widget in self.slot_widgets.values(): widget.set_piece(None)