1
0
mirror of https://dev.s-ul.net/Galexion/MaiMaiDXNet.git synced 2024-11-24 04:40:11 +01:00

fixed issues with user.js

god i hate my life
This commit is contained in:
Galexion 2023-06-04 04:49:45 -04:00
parent 26f36a8330
commit a75ae3350f
2 changed files with 16 additions and 10 deletions

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "maimaidxnet",
"name": "aquaimagegrabber",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "maimaidxnet",
"name": "aquaimagegrabber",
"version": "1.0.0",
"license": "ISC",
"dependencies": {

View File

@ -91,6 +91,16 @@ async function getReleventInformation(musicData, id) {
return songMatch;
}
async function getReleventInformationMap(mapData, mapid) {
let mapMatch = undefined;
for(map of mapData) {
if (map.mapInfomation.colorId.id == mapid) {
mapMatch = map
} else continue
}
return mapMatch
}
// Ban Check lmao
@ -299,14 +309,15 @@ async function userAreaStatusFormatter(div) {
let areaWrapper = document.createElement('div'); // create the Wrapper Div
for (let i = UserAreaData.length - 1; i >= 0; i--) {
const area = UserAreaData[i]; // get the area
const mapInfo = await getReleventInformation(mapMetadata, area.map_id); // get the relevent Map Information
const mapInfo = await getReleventInformationMap(mapMetadata, area.map_id); // get the relevent Map Information
console.log(mapInfo)
if(!mapInfo) continue // continue if mapInfo cant be found for a map
const areaGrid = document.createElement('div'); // create the Grid for the area inforrmation to go
areaGrid.classList.add('areaGrid'); // add the appropriate class
/* Area Title */
let areaTitle = document.createElement('div');
areaTitle.classList.add('areaTitle');
areaTitle.innerHTML = `<h4>${mapInfo.name.str}</h4>`
areaTitle.innerHTML = `<h4>${mapInfo.name}</h4>`
areaGrid.append(areaTitle)
/* Kilometers */
let areaKilometers = document.createElement('div');
@ -516,12 +527,7 @@ async function mapsMetadata() {
const data = await response.json();
const mapping = {};
data.forEach((song) => {
mapping[song.name.id] = song;
});
return mapping;
return data;
} catch (error) {
console.error(error);
}