feat: ability to drag and drop charges (#124)

This commit is contained in:
Patric Stout
2024-05-17 20:49:23 +02:00
committed by GitHub
parent 00f753843b
commit 1008128bcc
2 changed files with 6 additions and 0 deletions

View File

@@ -72,6 +72,7 @@ const ModuleGroup = (props: { level: number; group: ListingGroup; hideGroup?: bo
level={2}
content={item.name}
onClick={() => shipSnapShot.addCharge(item.typeId)}
onDragStart={onItemDragStart(item.typeId, "charge")}
/>
);
} else {

View File

@@ -181,6 +181,11 @@ export const Slot = (props: { type: string; index: number; fittable: boolean; ma
return;
}
if (draggedSlotType === "charge") {
shipSnapshot.addCharge(draggedTypeId, esiFlag);
return;
}
const isValidSlotGroup = draggedSlotType === esiFlagType;
if (!isValidSlotGroup) {
return;