Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/routes/calc/path.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,39 @@ function CopyFormattedButton(props: { path: PathStep[] }) {
navigator.clipboard.writeText(text).catch(() => alert("Failed to copy :("));
}

function copyFormattedCompact() {
function connTypeToSymbol(connType: ConnType) {
switch (connType) {
case "npc_gate":
return "G";
case "smart_gate":
return "S";
case "jump":
return "J";
}
}
const text = props.path
.map(
(p) =>
`${connTypeToSymbol(p.conn_type)}→ <a href="showinfo:5//${p.to.id}">${p.to.name.substring(0, 4)}</a>`,
)
.join(" -");

navigator.clipboard.writeText(text).catch(() => alert("Failed to copy :("));
}

return (
<>
<input
type="button"
value="Copy with EVE-Links"
onClick={copyFormatted}
/>
<input
type="button"
value="Compact Copy"
onClick={copyFormattedCompact}
/>
(If you paste with EVE-Links into an in-game notepad, you get clickable
links)
</>
Expand Down