diff --git a/src/configs/config.example.json b/src/configs/config.example.json index da18bbfa..c9e4e836 100644 --- a/src/configs/config.example.json +++ b/src/configs/config.example.json @@ -155,16 +155,19 @@ }, "icons": { "Default": { - "path": "https://mygod.github.io/pokicons/v2" - }, - "Local Example": { - "path": "/img/pokemon" + "path": "https://raw.githubusercontent.com/WatWowMap/wwm-uicons/main/pokemon/" }, "Home": { - "path": "https://raw.githubusercontent.com/Mygod/PkmnHomeIcons/icons/icons" + "path": "https://raw.githubusercontent.com/nileplumb/PkmnHomeIcons/master/UICONS/pokemon/" }, "Shuffle": { - "path": "https://raw.githubusercontent.com/Mygod/pokedave_shuffle_icons_-ICONS-/master" + "path": "https://raw.githubusercontent.com/nileplumb/PkmnShuffleMap/master/UICONS/pokemon/" + }, + "Half Shiny": { + "path": "https://raw.githubusercontent.com/jms412/PkmnShuffleMap/master/UICONS_Half_Shiny_Sparkles_256/pokemon/" + }, + "Local Example": { + "path": "/img/pokemon/" } } } diff --git a/src/configs/default.json b/src/configs/default.json index 45350939..711827ed 100644 --- a/src/configs/default.json +++ b/src/configs/default.json @@ -218,7 +218,7 @@ }, "icons": { "Default": { - "path": "https://mygod.github.io/pokicons/v2" + "path": "https://raw.githubusercontent.com/WatWowMap/wwm-uicons/main/pokemon/" } }, "popupDetails": { diff --git a/src/generateMasterfile.js b/src/generateMasterfile.js index 8613b1da..f48b4d32 100644 --- a/src/generateMasterfile.js +++ b/src/generateMasterfile.js @@ -1,7 +1,8 @@ const fs = require('fs'); const axios = require('axios'); -module.exports.generate = async function generate() { +//module.exports.generate = async function generate() { +(async () => { try { const { data } = await axios.get('https://raw.githubusercontent.com/WatWowMap/Masterfile-Generator/master/master-latest.json'); @@ -15,4 +16,5 @@ module.exports.generate = async function generate() { } catch (e) { console.warn('Unable to generate new masterfile, using existing.'); } -}; +//}; +})(); \ No newline at end of file diff --git a/static/js/index.js b/static/js/index.js index 59474308..f124c134 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -982,10 +982,9 @@ function loadStorage () { const invasionFilterValue = retrieve('invasion_filter'); if (invasionFilterValue === null) { const defaultInvasionFilter = {}; - let i; - for (i = 1; i <= 50; i++) { - if (defaultInvasionFilter['i' + i] === undefined) { - defaultInvasionFilter['i' + i] = { show: true, size: 'normal' }; + for (const i of Object.entries(masterfile.invasions)) { + if (defaultInvasionFilter['i' + i[0]] === undefined) { + defaultInvasionFilter['i' + i[0]] = { show: true, size: 'normal' }; } } @@ -993,10 +992,9 @@ function loadStorage () { invasionFilter = defaultInvasionFilter; } else { invasionFilter = JSON.parse(invasionFilterValue); - let i; - for (i = 1; i <= 50; i++) { - if (invasionFilter['i' + i] === undefined) { - invasionFilter['i' + i] = { show: true, size: 'normal' }; + for (const i of Object.entries(masterfile.invasions)) { + if (invasionFilter['i' + i[0]] === undefined) { + invasionFilter['i' + i[0]] = { show: true, size: 'normal' }; } } } @@ -3044,7 +3042,7 @@ const getPvpRanks = (league, pokemon) => { if (showPokemonName) { content += `${pokemonName}` } else { - const img = `${pokemonName}` + const img = `${pokemonName}` if (ranking.evolution) { if (showExperimentalStats && masterfile.pokemon[ranking.pokemon].temp_evolutions[ranking.evolution].unreleased) { content += `*${img}` @@ -3282,7 +3280,7 @@ const getPokemonPopupContent = (pokemon) => {
${getName(pokemon)} ${getGenderIcon(pokemon.gender)} ${getWeatherIcon(pokemon)}
- +
${popupDetails.pokemon.types ? getTypes(pokemon) : ''} @@ -3548,7 +3546,7 @@ const getPossibleInvasionRewards = pokestop => { const makeShadowPokemon = pokemonId => { return `
- +
`; } @@ -3625,7 +3623,7 @@ function getGymPopupContent (gym) { '
' + // START 1ST COL '
'; if (hasRaidBoss) { - content += ``; + content += ``; } else { content += ``; } @@ -4274,7 +4272,7 @@ function getNestMarker (nest, geojson, ts) { iconAnchor: [40 / 2, anchorY], popupAnchor: [0, -8 - anchorY], className: 'nest-marker', - html: `
${typesIcon}
`, + html: `
${typesIcon}
`, //shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png', //shadowSize: [48, 48] }); @@ -4328,7 +4326,7 @@ function getPokemonMarkerIcon (pokemon, ts) { iconAnchor: [size / 2, size / 2], popupAnchor: [0, size * -.6], className: 'pokemon-marker', - html: `
`; + iconHtml = ``; } if (info && info.amount > 1) { iconHtml += `
${info.amount}
`; @@ -4438,7 +4436,7 @@ function getPokestopMarkerIcon (pokestop, ts) { rewardString += '-' + info.form_id; } // TODO: evolution https://github.com/versx/DataParser/issues/10 - iconUrl = `${availableIconStyles[selectedIconStyle].path}/${getPokemonIcon(info.pokemon_id, info.form_id, 0, info.gender_id, info.costume_id, info.shiny)}.png`; + iconUrl = `${availableIconStyles[selectedIconStyle].path}/${getPokemonIcon(info.pokemon_id, info.form_id, 0, info.gender_id, info.costume_id, info.shiny)}`; } else if (id === 8) { // Pokecoin rewardString = 'i-6'; @@ -4455,7 +4453,7 @@ function getPokestopMarkerIcon (pokestop, ts) { rewardString = 'i-8'; iconUrl = '/img/item/-8.png'; if (info && info.pokemon_id) { - iconHtml = ``; + iconHtml = ``; } if (info && info.amount > 1) { iconHtml += `
${info.amount}
`; @@ -4606,7 +4604,7 @@ function getGymMarkerIcon (gym, ts) { if (gym.raid_pokemon_id !== 0 && gym.raid_pokemon_id !== null) { // Raid Boss raidSize = getIconSize('raid', gym.raid_pokemon_id, gym.raid_pokemon_form) - raidIcon = `${availableIconStyles[selectedIconStyle].path}/${getPokemonIcon(gym.raid_pokemon_id, gym.raid_pokemon_form, gym.raid_pokemon_evolution, gym.raid_pokemon_gender, gym.raid_pokemon_costume)}.png`; + raidIcon = `${availableIconStyles[selectedIconStyle].path}/${getPokemonIcon(gym.raid_pokemon_id, gym.raid_pokemon_form, gym.raid_pokemon_evolution, gym.raid_pokemon_gender, gym.raid_pokemon_costume)}`; } else { // Egg raidSize = getIconSize('raid', raidLevel) @@ -6146,17 +6144,17 @@ function getSize (size) { } function getPokemonIcon(pokemonId, form = 0, evolution = 0, gender = 0, costume = 0, shiny = false) { - const evolutionSuffixes = evolution ? ['-e' + evolution, ''] : ['']; - const formSuffixes = form ? ['-f' + form, ''] : ['']; - const costumeSuffixes = costume ? ['-c' + costume, ''] : ['']; - const genderSuffixes = gender ? ['-g' + gender, ''] : ['']; - const shinySuffixes = shiny ? ['-shiny', ''] : ['']; + const evolutionSuffixes = evolution ? ['_e' + evolution, ''] : ['']; + const formSuffixes = form ? ['_f' + form, ''] : ['']; + const costumeSuffixes = costume ? ['_c' + costume, ''] : ['']; + const genderSuffixes = gender ? ['_g' + gender, ''] : ['']; + const shinySuffixes = shiny ? ['_s', ''] : ['']; for (const evolutionSuffix of evolutionSuffixes) { for (const formSuffix of formSuffixes) { for (const costumeSuffix of costumeSuffixes) { for (const genderSuffix of genderSuffixes) { for (const shinySuffix of shinySuffixes) { - const result = `${pokemonId}${evolutionSuffix}${formSuffix}${costumeSuffix}${genderSuffix}${shinySuffix}`; + const result = `${pokemonId}${evolutionSuffix}${formSuffix}${costumeSuffix}${genderSuffix}${shinySuffix}.png`; if (availableForms.has(result)) return result; } } @@ -6342,7 +6340,7 @@ function populateImage (row, type, set, meta) { case 'img': return `
`; case 'pokemon': - return `
`; + return `
`; default: return input; }