1
0
mirror of https://dev.s-ul.net/Galexion/MaiMaiDXNet.git synced 2024-11-27 21:50:48 +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", "version": "1.0.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "maimaidxnet", "name": "aquaimagegrabber",
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {

View File

@ -91,6 +91,16 @@ async function getReleventInformation(musicData, id) {
return songMatch; 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 // Ban Check lmao
@ -299,14 +309,15 @@ async function userAreaStatusFormatter(div) {
let areaWrapper = document.createElement('div'); // create the Wrapper Div let areaWrapper = document.createElement('div'); // create the Wrapper Div
for (let i = UserAreaData.length - 1; i >= 0; i--) { for (let i = UserAreaData.length - 1; i >= 0; i--) {
const area = UserAreaData[i]; // get the area 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) 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 const areaGrid = document.createElement('div'); // create the Grid for the area inforrmation to go
areaGrid.classList.add('areaGrid'); // add the appropriate class areaGrid.classList.add('areaGrid'); // add the appropriate class
/* Area Title */ /* Area Title */
let areaTitle = document.createElement('div'); let areaTitle = document.createElement('div');
areaTitle.classList.add('areaTitle'); areaTitle.classList.add('areaTitle');
areaTitle.innerHTML = `<h4>${mapInfo.name.str}</h4>` areaTitle.innerHTML = `<h4>${mapInfo.name}</h4>`
areaGrid.append(areaTitle) areaGrid.append(areaTitle)
/* Kilometers */ /* Kilometers */
let areaKilometers = document.createElement('div'); let areaKilometers = document.createElement('div');
@ -516,12 +527,7 @@ async function mapsMetadata() {
const data = await response.json(); const data = await response.json();
const mapping = {}; return data;
data.forEach((song) => {
mapping[song.name.id] = song;
});
return mapping;
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }