Closed jhelwig closed 4 years ago
The firebase version does this as part of the highlight/unhighlight for locations & dungeons.
// Highlights a chest location and shows the name as caption
function highlight(x){
document.getElementById(x).style.backgroundImage = "url(/images/highlighted.png)";
document.getElementById("caption").innerHTML = chests[x].name;
}
function unhighlight(x){
document.getElementById(x).style.backgroundImage = "url(/images/poi.png)";
document.getElementById("caption").innerHTML = " ";
}
// Highlights a chest location and shows the name as caption (but for dungeons)
function highlightDungeon(x){
document.getElementById("dungeon"+x).style.backgroundImage = "url(/images/highlighted.png)";
document.getElementById("caption").innerHTML = dungeons[x].name;
}
function unhighlightDungeon(x){
document.getElementById("dungeon"+x).style.backgroundImage = "url(/images/poi.png)";
document.getElementById("caption").innerHTML = " ";
}
This doesn't really seem like a Vue-like way of doing it, though. The highlighting/unhighlighting feels like it should be applying/removing a class, instead of editing properties directly. Also, setting the caption seems like it should be modifying some data that a caption component could be looking at.
We'll want to pull in the names from lttp-tracker's script/chests.js into logic/poi_locations.yaml as the hoverText
.
Eg:
name: "King's Tomb <img src='/images/boots.png' class='mini'> + <img src='/images/glove2.png' class='mini'>/<img src='/images/mirror.png' class='mini'>",
is this "done" now? should we close the issue?
Yup! It's done.
https://lttp-tracker.firebaseapp.com/ shows the location name, and a handy reminder about what item is required to access the location when you hover the mouse over it. We should do that, too.