Skip to content

Commit

Permalink
cayo perico update
Browse files Browse the repository at this point in the history
  • Loading branch information
FallBackITA27 committed May 20, 2024
1 parent ef0579f commit 8667771
Show file tree
Hide file tree
Showing 11 changed files with 253 additions and 3 deletions.
22 changes: 22 additions & 0 deletions gtav-interactive-map/assets/cayoPericoScopeOutPlane.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"display_name": "Lago Zancudo",
"coords": [52.268157, -152.226563]
},
{
"display_name": "Grapeseed N. 1",
"coords": [71.350041, -57.23877]
},
{
"display_name": "Grapeseed N. 2",
"coords": [72.919635, -41.572266]
},
{
"display_name": "Paleto Cove",
"coords": [75.890899, -120.157618]
},
{
"display_name": "Procopio Beach",
"coords": [80.823901, -81.738281]
}
]
50 changes: 50 additions & 0 deletions gtav-interactive-map/assets/kosatkaFastTravels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[
{
"display_name": "Chumash",
"coords": [27.994401, -174.023438]
},
{
"display_name": "Pacific Bluffs",
"coords": [-3.776559, -157.060547]
},
{
"display_name": "Vespucci Beach",
"coords": [-25.720735, -134.34082]
},
{
"display_name": "Elysian Island",
"coords": [-51.013755, -107.358398]
},
{
"display_name": "South Palomino Highlands",
"coords": [-46.042736, -47.329102]
},
{
"display_name": "North Palomino Highlands",
"coords": [-2.899154, -30.058594]
},
{
"display_name": "Davis Quartz",
"coords": [47.694974, -20.083008]
},
{
"display_name": "San Chianski",
"coords": [73.873717, -14.545898]
},
{
"display_name": "Mount Gordo",
"coords": [81.321593, -32.475586]
},
{
"display_name": "Procopio Beach",
"coords": [83.287985, -76.376953]
},
{
"display_name": "Paleto Forest",
"coords": [81.268385, -124.189453]
},
{
"display_name": "North Chumash",
"coords": [71.842539, -154.599609]
}
]
1 change: 1 addition & 0 deletions gtav-interactive-map/gtavIcons/kosatka.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions gtav-interactive-map/gtavIcons/plane.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 29 additions & 2 deletions gtav-interactive-map/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
<script defer src="./loadScripts/playingCards.js"></script>
<script defer src="./loadScripts/signalJammers.js"></script>
<script defer src="./loadScripts/ldOrganics.js"></script>
<script defer src="./loadScripts/kosatkaFastTravels.js"></script>
<script defer src="./loadScripts/cayoPericoScopeOutPlane.js"></script>
<script defer src="./script.js"></script>
</head>
<body>
Expand Down Expand Up @@ -72,6 +74,13 @@ <h2>Contents</h2>
<li><a href="#markers-collectibles-ldorganics">LD Organics Products</a></li>
</ul>
</li>
<li type="i">
<a href="#markers-cayopericoheist">Cayo Perico Heist</a>
<ul>
<li><a href="#markers-cayopericoheist-kosatkafasttravels">Kosatka Fast Travel Locations</a></li>
<li><a href="#markers-cayopericoheist-scopeoutplane">Scope Out Plane Locations</a></li>
</ul>
</li>
</ol>
</li>
<li><a href="#tools">Tools</a></li>
Expand Down Expand Up @@ -156,10 +165,24 @@ <h2>LD Organics Products</h2>
<p id="markers-collectibles-ldorganics-completion-number">Completed: 0/100</p>
<div id="ldOrganicsDiv" class="collectibleDiv">
</div>
<hr class="fifty">
<div id="markers-cayopericoheist"></div>
<h2>Cayo Perico Heist</h2>
<p>This will be a list of markers useful for the Cayo Perico Heist</p>
<div id="markers-cayopericoheist-kosatkafasttravels"></div>
<hr class="fifty">
<h2>Kosatka Fast Travels</h2>
<button id="markers-cayopericoheist-kosatkafasttravels-show-all-btn">Show All</button>
<button id="markers-cayopericoheist-kosatkafasttravels-hide-all-btn">Hide All</button>
<div id="kosatkaFastTravelsDiv"></div>
<hr class="fifty">
<div id="markers-cayopericoheist-scopeoutplane"></div>
<h2>Scoping Out Planes</h2>
<button id="markers-cayopericoheist-scopeoutplane-show-all-btn">Show All</button>
<button id="markers-cayopericoheist-scopeoutplane-hide-all-btn">Hide All</button>
<div id="scopeOutPlaneDiv"></div>
<hr>
<div id="settings"></div>
<h2>Settings</h2>
<hr class="fifty">
<h3>Use different map style</h3>
<div id="mapStyleRadioButtons">
<div>
Expand Down Expand Up @@ -207,6 +230,10 @@ <h3>Timers</h3>
<div id="changelog"></div>
<h2>Changelog</h2>
<p>All the dates are in <a target="_blank" href="https://en.wikipedia.org/wiki/Central_European_Time">CET</a>.</p>
<h3>2024 - 05 - 20 | 18:43 | Version 0.8.0</h3>
<p>Added some Cayo Perico related locations. Will add more at a later date.</p>
<p class="sig">Signed: FalB</p>
<p>All the dates are in <a target="_blank" href="https://en.wikipedia.org/wiki/Central_European_Time">CET</a>.</p>
<h3>2024 - 05 - 20 | 15:58 | Version 0.7.0</h3>
<p>Added a few images. Nothing interesting. Also added <a href="//ogp.me">opengraph</a> tags.</p>
<p class="sig">Signed: FalB</p>
Expand Down
38 changes: 38 additions & 0 deletions gtav-interactive-map/lib/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,41 @@ function completionButtonsDivUpdates(
hideCompleted();
}
}

function displayButtons(showAllButtonId, hideAllButtonId, onMapMarkers, lastPickName) {
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);
}
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();
}
}

document.getElementById(showAllButtonId).addEventListener("click", showAll);
document.getElementById(hideAllButtonId).addEventListener("click", hideAll);

if (saveData[lastPickName] === "showAll") {
showAll();
} else if (saveData[lastPickName] === "hideAll") {
hideAll();
}
}
48 changes: 48 additions & 0 deletions gtav-interactive-map/lib/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,54 @@ function iconFromIconData(iconData, i) {
return iconData;
}

function genericMarkers(
parentDivId,
array,
iconData,
lastPickName,
onMapMarkers = [],
startIndex = 0
) {
let parentDiv = document.getElementById(parentDivId);
for (let i = startIndex; i - startIndex < array.length; i++) {
let icon = iconFromIconData(iconData, i);

let actualMarker = L.marker(array[i - startIndex].coords, {
icon: icon,
title: array[i - startIndex].display_name,
});
onMapMarkers.push(actualMarker);

let hr = document.createElement("hr");
hr.classList.add("twentyfive");
parentDiv.append(hr);

let linkDiv = document.createElement("div");
linkDiv.id =
"#" + array[i - startIndex].display_name.replaceAll(" ", "-");
parentDiv.append(linkDiv);

let title = document.createElement("h2");
title.innerHTML = array[i - startIndex].display_name;
parentDiv.append(title);

let zoom = document.createElement("button");
zoom.innerHTML = "Zoom to Marker";
zoom.addEventListener("click", function () {
document.getElementById("gui_toggle_button_div").click();
map.setView(array[i - startIndex].coords, 7);
if (!map.hasLayer(actualMarker)) actualMarker.addTo(map);
});
parentDiv.append(zoom);

actualMarker.on("click", () =>
markerClickEvent(linkDiv, array[i - startIndex].coords, title)
);
}

return onMapMarkers;
}

function multiMarkerCollectibleInsert(
parentDivId,
array,
Expand Down
15 changes: 15 additions & 0 deletions gtav-interactive-map/loadScripts/cayoPericoScopeOutPlane.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function loadCayoPericoScopeOutPlane(r) {
let onMapMarkers = genericMarkers(
"scopeOutPlaneDiv",
r,
constantData.icons.plane,
"lastPickCayoPericoScopeOutPlane"
);

displayButtons(
"markers-cayopericoheist-scopeoutplane-show-all-btn",
"markers-cayopericoheist-scopeoutplane-hide-all-btn",
onMapMarkers,
"lastPickCayoPericoScopeOutPlane"
);
}
15 changes: 15 additions & 0 deletions gtav-interactive-map/loadScripts/kosatkaFastTravels.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function loadKosatkaFastTravels(r) {
let onMapMarkers = genericMarkers(
"kosatkaFastTravelsDiv",
r,
constantData.icons.kosatka,
"lastPickKosatkaFastTravels"
);

displayButtons(
"markers-cayopericoheist-kosatkafasttravels-show-all-btn",
"markers-cayopericoheist-kosatkafasttravels-hide-all-btn",
onMapMarkers,
"lastPickKosatkaFastTravels"
);
}
27 changes: 26 additions & 1 deletion gtav-interactive-map/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const weekday = [
const insertMarkersMode = false;

let saveData = {
version: "0.7.0",
version: "0.8.0",
selectedTileLayer: "game",
lastZoom: 2,
lastCoords: [38.959409, -75.410156],
Expand Down Expand Up @@ -43,6 +43,8 @@ let saveData = {
lastPickSignalJammers: "hideAll",
completionDataLDOrganics: new Set(),
lastPickLDOrganics: "hideAll",
lastPickKosatkaFastTravels: "hideAll",
lastPickCayoPericoScopeOutPlane: "hideAll",
};

function loadInSaveData(dataStr) {
Expand Down Expand Up @@ -113,6 +115,11 @@ function loadInSaveData(dataStr) {
temporarySaveData.version = "0.7.0";
}
if (temporarySaveData.version === "0.7.0") {
temporarySaveData.version = "0.8.0";
temporarySaveData.lastPickKosatkaFastTravels = "hideAll";
temporarySaveData.lastPickCayoPericoScopeOutPlane = "hideAll";
}
if (temporarySaveData.version === "0.8.0") {
// Current version
}
// Here you check the version tag in the savedata and modify it to match the data right after - this way old save data will not be lost.
Expand Down Expand Up @@ -305,6 +312,14 @@ const constantData = {
className: "collectible figurine",
iconSize: [22, 22],
}),
kosatka: L.divIcon({
className: "kosatka",
iconSize: [22, 22],
}),
plane: L.divIcon({
className: "plane",
iconSize: [22, 22],
}),
movieProp: L.divIcon({
className: "collectible movieprop",
iconSize: [22, 22],
Expand Down Expand Up @@ -418,6 +433,16 @@ async function loadDynamicData() {
.then((r) => r.json())
.then(loadLDOrganics)
);
x.push(
fetch("./assets/kosatkaFastTravels.json")
.then((r) => r.json())
.then(loadKosatkaFastTravels)
);
x.push(
fetch("./assets/cayoPericoScopeOutPlane.json")
.then((r) => r.json())
.then(loadCayoPericoScopeOutPlane)
);
// x.push(
// fetch("./assets/buildings.json").then(r=>r.json()).then(r=>{
// for (marker of r) {
Expand Down
8 changes: 8 additions & 0 deletions gtav-interactive-map/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ ul {
flex-direction: column;
}

.kosatka {
background-image: url("gtavIcons/kosatka.svg");
}

.plane {
background-image: url("gtavIcons/plane.svg");
}

.figurine {
background-image: url("gtavIcons/figurine.svg");
}
Expand Down

0 comments on commit 8667771

Please sign in to comment.