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
This commit is contained in:
parent
32cebbc001
commit
a0211a8425
|
|
@ -2016,8 +2016,14 @@ class LoadoutManagerDialog(QDialog):
|
||||||
self._update_calculations()
|
self._update_calculations()
|
||||||
|
|
||||||
def _on_equip_full_set(self):
|
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:
|
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.")
|
QMessageBox.information(self, "No Selection", "Please select an armor set first.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -2025,6 +2031,13 @@ class LoadoutManagerDialog(QDialog):
|
||||||
if not armor_set:
|
if not armor_set:
|
||||||
return
|
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
|
# Clear any individual pieces
|
||||||
for widget in self.slot_widgets.values():
|
for widget in self.slot_widgets.values():
|
||||||
widget.set_piece(None)
|
widget.set_piece(None)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue