Skip to content

Commit

Permalink
feat: ability to drag and drop charges
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueBrain committed May 17, 2024
1 parent 00f7538 commit 78c11ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/HardwareListing/HardwareListing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions src/components/ShipFit/Slot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 78c11ec

Please sign in to comment.