fixed skip clue implimentation

This commit is contained in:
bobbert committed 2025-03-18 22:25:07 +00:00
1 parent fccc2a4edc
commit 2f9a6c732c
18 files changed
+524 -151

No files matched your search

+20 -7
View File
@@ -409,8 +409,10 @@ export function updateCluePointStatus(svgElement, clues) {
`Found ${cluePoints.length} clue points and ${clickAreas.length} click areas to update`
);
// Find the first unfound clue (the current clue)
const currentIndex = clues.findIndex((clue) => !clue.found);
// Find the first unfound and unskipped clue
const currentIndex = clues.findIndex(
(clue) => !clue.found && !clue.skipped
);
const currentClueId = currentIndex !== -1 ? clues[currentIndex].id : null;
console.log(`Current clue ID: ${currentClueId}`);
@@ -439,15 +441,22 @@ export function updateCluePointStatus(svgElement, clues) {
if (clue.found) {
point.classList.add("clue-point-found");
tooltip.textContent = `Clue ${clueId}: ${clue.title || "Completed"}`;
} else if (clue.skipped) {
// Explicitly mark skipped clues with blue color
point.classList.add("clue-point-skipped");
tooltip.textContent = `Skipped Clue ${clueId}: ${
clue.title || "Skipped"
}`;
} else if (clueId === currentClueId) {
point.classList.add("clue-point-current");
tooltip.textContent = `Current Clue: ${
clue.title || "Go to this location"
}`;
} else if (clueId < currentClueId) {
point.classList.add("clue-point-skipped");
tooltip.textContent = `Skipped Clue ${clueId}: ${
clue.title || "Skipped"
} else if (clue.available) {
// Available but not current - could be previous clue or next after skipped
point.classList.add("clue-point-current");
tooltip.textContent = `Available Clue ${clueId}: ${
clue.title || "Available"
}`;
} else {
point.classList.add("clue-point-locked");
@@ -455,7 +464,11 @@ export function updateCluePointStatus(svgElement, clues) {
}
// Store availability data
const isAvailable = clue.found || clueId === currentClueId;
const isAvailable =
clue.found ||
clue.skipped ||
clueId === currentClueId ||
clue.available;
point.setAttribute("data-available", isAvailable.toString());
// Make sure tooltip is attached