-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
968b047
commit 5c24c03
Showing
9 changed files
with
323 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
function completionButtonsDivUpdates( | ||
showAllButtonId, | ||
hideAllButtonId, | ||
showCompletedButtonId, | ||
hideCompletedButtonId, | ||
onMapMarkers, | ||
lastPickName, | ||
completionSetName | ||
) { | ||
function showAll() { | ||
saveData[lastPickName] = "showAll"; | ||
saveDataSave(); | ||
let i = 0; | ||
for (let markers of onMapMarkers) { | ||
if (!(markers instanceof Array)) { | ||
markers = [markers]; | ||
} | ||
for (let marker of markers) { | ||
if (!map.hasLayer(marker)) marker.addTo(map); | ||
if (saveData[completionSetName].has(i)) | ||
marker._icon.classList.add("completed"); | ||
} | ||
i++; | ||
} | ||
} | ||
|
||
function hideAll() { | ||
saveData[lastPickName] = "hideAll"; | ||
saveDataSave(); | ||
for (let markers of onMapMarkers) { | ||
if (!(markers instanceof Array)) { | ||
markers = [markers]; | ||
} | ||
for (let marker of markers) | ||
if (map.hasLayer(marker)) marker.remove(); | ||
} | ||
} | ||
|
||
function showCompleted() { | ||
saveData[lastPickName] = "showCompleted"; | ||
saveDataSave(); | ||
let i = 0; | ||
for (let markers of onMapMarkers) { | ||
if (!(markers instanceof Array)) { | ||
markers = [markers]; | ||
} | ||
for (let marker of markers) { | ||
if (saveData[completionSetName].has(i)) { | ||
if (!map.hasLayer(marker)) marker.addTo(map); | ||
marker._icon.classList.add("completed"); | ||
} else { | ||
marker.remove(); | ||
} | ||
} | ||
i++; | ||
} | ||
} | ||
|
||
function hideCompleted() { | ||
saveData[lastPickName] = "hideCompleted"; | ||
saveDataSave(); | ||
let i = 0; | ||
for (let markers of onMapMarkers) { | ||
if (!(markers instanceof Array)) { | ||
markers = [markers]; | ||
} | ||
for (let marker of markers) { | ||
if (!saveData[completionSetName].has(i)) { | ||
if (!map.hasLayer(marker)) marker.addTo(map); | ||
} else { | ||
marker.remove(); | ||
} | ||
} | ||
i++; | ||
} | ||
} | ||
|
||
document.getElementById(showAllButtonId).addEventListener("click", showAll); | ||
document.getElementById(hideAllButtonId).addEventListener("click", hideAll); | ||
document | ||
.getElementById(showCompletedButtonId) | ||
.addEventListener("click", showCompleted); | ||
document | ||
.getElementById(hideCompletedButtonId) | ||
.addEventListener("click", hideCompleted); | ||
|
||
if (saveData[lastPickName] === "showAll") { | ||
showAll(); | ||
} else if (saveData[lastPickName] === "hideAll") { | ||
hideAll(); | ||
} else if (saveData[lastPickName] === "showCompleted") { | ||
showCompleted(); | ||
} else if (saveData[lastPickName] === "hideCompleted") { | ||
hideCompleted(); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
function loadCounties(r) { | ||
let lsCountyPolygon = L.polygon(r.ls.points, { | ||
color: r.ls.color, | ||
}).bindTooltip(r.ls.name, { | ||
permanent: true, | ||
direction: "center", | ||
}); | ||
let blCountyPolygon = L.polygon(r.bl.points, { | ||
color: r.bl.color, | ||
}).bindTooltip(r.bl.name, { | ||
permanent: true, | ||
direction: "center", | ||
}); | ||
|
||
if (saveData.blCountyShow) blCountyPolygon.addTo(map); | ||
if (saveData.lsCountyShow) lsCountyPolygon.addTo(map); | ||
|
||
document | ||
.getElementById("markers-locations-counties-blaine-show-btn") | ||
.addEventListener("click", function () { | ||
blCountyPolygon.addTo(map); | ||
saveData.blCountyShow = true; | ||
saveDataSave(); | ||
}); | ||
|
||
document | ||
.getElementById("markers-locations-counties-ls-show-btn") | ||
.addEventListener("click", function () { | ||
lsCountyPolygon.addTo(map); | ||
saveData.lsCountyShow = true; | ||
saveDataSave(); | ||
}); | ||
|
||
document | ||
.getElementById("markers-locations-counties-blaine-hide-btn") | ||
.addEventListener("click", function () { | ||
blCountyPolygon.remove(); | ||
saveData.blCountyShow = false; | ||
saveDataSave(); | ||
}); | ||
|
||
document | ||
.getElementById("markers-locations-counties-ls-hide-btn") | ||
.addEventListener("click", function () { | ||
lsCountyPolygon.remove(); | ||
saveData.lsCountyShow = false; | ||
saveDataSave(); | ||
}); | ||
|
||
document | ||
.getElementById("markers-locations-counties-show-btn") | ||
.addEventListener("click", function () { | ||
document | ||
.getElementById("markers-locations-counties-ls-show-btn") | ||
.click(); | ||
document | ||
.getElementById("markers-locations-counties-blaine-show-btn") | ||
.click(); | ||
}); | ||
|
||
document | ||
.getElementById("markers-locations-counties-hide-btn") | ||
.addEventListener("click", function () { | ||
document | ||
.getElementById("markers-locations-counties-ls-hide-btn") | ||
.click(); | ||
document | ||
.getElementById("markers-locations-counties-blaine-hide-btn") | ||
.click(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function loadFigurines(r) { | ||
let onMapMarkers = genericCollectibleInsert( | ||
"actionFiguresDiv", | ||
r, | ||
constantData.icons.figurine, | ||
"completionDataFigurines", | ||
"lastPickFigurines", | ||
"markers-collectibles-actionfigures-completion-number", | ||
100 | ||
); | ||
|
||
document.getElementById( | ||
"markers-collectibles-actionfigures-completion-number" | ||
).innerHTML = `Completed ${saveData.completionDataFigurines.size}/100`; | ||
|
||
completionButtonsDivUpdates( | ||
"markers-collectibles-actionfigures-show-all-btn", | ||
"markers-collectibles-actionfigures-hide-all-btn", | ||
"markers-collectibles-actionfigures-show-completed-btn", | ||
"markers-collectibles-actionfigures-hide-completed-btn", | ||
onMapMarkers, | ||
"lastPickFigurines", | ||
"completionDataFigurines" | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
function loadMapStyle(r) { | ||
let tileLayers = { | ||
render: L.tileLayer(r.mainMap.render.url, { | ||
maxNativeZoom: r.mainMap.render.maxNativeZoom, | ||
maxZoom: r.mainMap.render.maxNativeZoom, | ||
minNativeZoom: r.mainMap.render.minNativeZoom, | ||
minZoom: r.mainMap.render.minNativeZoom, | ||
keepBuffer: 4, | ||
noWrap: true, | ||
updateWhenIdle: true, | ||
}), | ||
game: L.tileLayer(r.mainMap.game.url, { | ||
maxNativeZoom: r.mainMap.game.maxNativeZoom, | ||
maxZoom: r.mainMap.game.maxNativeZoom, | ||
minNativeZoom: r.mainMap.game.minNativeZoom, | ||
minZoom: r.mainMap.game.minNativeZoom, | ||
keepBuffer: 4, | ||
noWrap: true, | ||
updateWhenIdle: true, | ||
}), | ||
print: L.tileLayer(r.mainMap.print.url, { | ||
maxNativeZoom: r.mainMap.print.maxNativeZoom, | ||
maxZoom: r.mainMap.print.maxNativeZoom, | ||
minNativeZoom: r.mainMap.print.minNativeZoom, | ||
minZoom: r.mainMap.print.minNativeZoom, | ||
keepBuffer: 4, | ||
noWrap: true, | ||
updateWhenIdle: true, | ||
}), | ||
}; | ||
|
||
let mapStyleClassElements = Array.from( | ||
document.getElementsByClassName("mapStyle") | ||
); | ||
|
||
mapStyleClassElements.forEach(function (btn) { | ||
btn.addEventListener("click", function (e) { | ||
let sl = saveData.selectedTileLayer; | ||
if (sl === e.target.value) return; | ||
tileLayers[sl].remove(); | ||
saveData.selectedTileLayer = e.target.value; | ||
saveDataSave(); | ||
tileLayers[e.target.value].addTo(map); | ||
document.getElementById("map").style.background = | ||
r.mainMap[e.target.value].oceanColor; | ||
}); | ||
if (saveData.selectedTileLayer == btn.value) btn.click(); | ||
}); | ||
|
||
document.getElementById("map").style.background = | ||
r.mainMap[saveData.selectedTileLayer].oceanColor; | ||
tileLayers[saveData.selectedTileLayer].addTo(map); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
function loadMovieProps(r) { | ||
let onMapMarkers = genericCollectibleInsert( | ||
"moviePropsDiv", | ||
r.singleMarker, | ||
constantData.icons.movieProp, | ||
"completionDataMovieProps", | ||
"lastPickMovieProps", | ||
"markers-collectibles-movieprops-completion-number", | ||
10 | ||
); | ||
|
||
document.getElementById( | ||
"markers-collectibles-movieprops-completion-number" | ||
).innerHTML = `Completed ${saveData.completionDataMovieProps.size}/10`; | ||
|
||
onMapMarkers = multiMarkerCollectibleInsert( | ||
"moviePropsDiv", | ||
r.multiMarker, | ||
[ | ||
[constantData.icons.moviePropTruckRebel, 9], | ||
[constantData.icons.moviePropTruckRumpo, 8], | ||
[constantData.icons.moviePropTruckPony, 7], | ||
], | ||
"completionDataMovieProps", | ||
"lastPickMovieProps", | ||
"markers-collectibles-movieprops-completion-number", | ||
10, | ||
onMapMarkers, | ||
7 | ||
); | ||
|
||
completionButtonsDivUpdates( | ||
"markers-collectibles-movieprops-show-all-btn", | ||
"markers-collectibles-movieprops-hide-all-btn", | ||
"markers-collectibles-movieprops-show-completed-btn", | ||
"markers-collectibles-movieprops-hide-completed-btn", | ||
onMapMarkers, | ||
"lastPickMovieProps", | ||
"completionDataMovieProps" | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function loadPlayingCards(r) { | ||
let onMapMarkers = genericCollectibleInsert( | ||
"playingCardsDiv", | ||
r, | ||
constantData.icons.playingCard, | ||
"completionDataPlayingCards", | ||
"lastPickPlayingCards", | ||
"markers-collectibles-playingcards-completion-number", | ||
54 | ||
); | ||
|
||
document.getElementById( | ||
"markers-collectibles-playingcards-completion-number" | ||
).innerHTML = `Completed ${saveData.completionDataPlayingCards.size}/54`; | ||
|
||
completionButtonsDivUpdates( | ||
"markers-collectibles-playingcards-show-all-btn", | ||
"markers-collectibles-playingcards-hide-all-btn", | ||
"markers-collectibles-playingcards-show-completed-btn", | ||
"markers-collectibles-playingcards-hide-completed-btn", | ||
onMapMarkers, | ||
"lastPickPlayingCards", | ||
"completionDataPlayingCards" | ||
); | ||
} |
Oops, something went wrong.