 + ')
'
+ var arIcon = item['ar_scan_eligible'] ? '

' : ''
+ html = '
 + ')
' + arIcon + '
'
stopMarker = L.divIcon({
iconSize: [31, 31],
iconAnchor: [25, 45],
@@ -2527,26 +2578,30 @@ function getPokestopMarkerIcon(item) {
html: html
})
} else {
+ var arIcon = item['ar_scan_eligible'] ? '

' : ''
+ html = '
 + ')
' + arIcon + '
'
stopMarker = L.divIcon({
iconSize: [31, 31],
iconAnchor: [25, 45],
popupAnchor: [0, -35],
className: 'stop-marker',
- html: '
'
+ html: html
})
}
} else if (Store.get(['showRocket']) && !noTeamRocket && item['incident_expiration'] > Date.now()) {
+ var arIcon = item['ar_scan_eligible'] ? '

' : ''
if (!noLures && item['lure_expiration'] > Date.now()) {
markerStr = 'Lured_' + item['lure_id']
}
html = '
 + ')
'
+ html += arIcon
if (item['grunt_type'] > 0) {
html += '
 + ')
'
} else {
html += '
'
}
if (noRocketTimer === false && Store.get(['showRocketTimer'])) {
- html += '
'
+ html += '
'
}
stopMarker = L.divIcon({
iconSize: [31, 31],
@@ -2556,6 +2611,7 @@ function getPokestopMarkerIcon(item) {
html: html
})
} else if (Store.get(['showQuests']) && !noQuests && item['quest_reward_type'] !== null && lastMidnight < Number(item['quest_timestamp'])) {
+ var arIcon = item['ar_scan_eligible'] ? '

' : ''
if (!noLures && item['lure_expiration'] > Date.now()) {
markerStr = item['lure_id']
}
@@ -2579,6 +2635,7 @@ function getPokestopMarkerIcon(item) {
shiny = item['reward_pokemon_shiny']
html = '
' +
'
 + ')
' +
+ arIcon +
'
 + ')
' +
'
'
stopMarker = L.divIcon({
@@ -2591,6 +2648,7 @@ function getPokestopMarkerIcon(item) {
} else if (item['quest_reward_type'] === 4) {
html = '
' +
'
 + ')
' +
+ arIcon +
'
 + ')
' +
'
 + ')
' +
'
'
@@ -2604,6 +2662,7 @@ function getPokestopMarkerIcon(item) {
} else if (item['quest_reward_type'] === 3) {
html = '
' +
'
 + ')
' +
+ arIcon +
'
 + ')
' +
'
'
stopMarker = L.divIcon({
@@ -2616,6 +2675,7 @@ function getPokestopMarkerIcon(item) {
} else if (item['quest_reward_type'] === 2) {
html = '
' +
'
 + ')
' +
+ arIcon +
'
 + ')
' +
'
'
stopMarker = L.divIcon({
@@ -2627,7 +2687,8 @@ function getPokestopMarkerIcon(item) {
})
}
} else if (Store.get(['showLures']) && !noLures && item['lure_expiration'] > Date.now()) {
- html = '
 + ')
'
+ var arIcon = item['ar_scan_eligible'] ? '

' : ''
+ html = '
 + ')
' + arIcon + '
'
stopMarker = L.divIcon({
iconSize: [31, 31],
iconAnchor: [25, 45],
@@ -2636,12 +2697,14 @@ function getPokestopMarkerIcon(item) {
html: html
})
} else {
+ var arIcon = item['ar_scan_eligible'] ? '

' : ''
+ html = '
 + ')
' + arIcon + '
'
stopMarker = L.divIcon({
iconSize: [31, 31],
iconAnchor: [25, 45],
popupAnchor: [0, -35],
className: 'stop-marker',
- html: '
 + ')
'
+ html: html
})
}
return stopMarker
@@ -3165,13 +3228,31 @@ function addListeners(marker) {
function clearStaleMarkers() {
$.each(mapData.pokemons, function (key, value) {
var pvpFiltered = false
+ var ivFiltered = false
if (minGLRank > 0 || minULRank > 0) {
pvpFiltered = true
if (minGLRank > 0 && pvpFiltered) {
var greatLeague = JSON.parse(mapData.pokemons[key]['pvp_rankings_great_league'])
$.each(greatLeague, function (index, ranking) {
- if (ranking.rank !== null && ranking.rank <= minGLRank) {
+ let rank
+ switch (Store.get('pvpRankingMethod')) {
+ case 'competition':
+ rank = ranking.competition_rank
+ break
+ case 'dense':
+ rank = ranking.dense_rank
+ break
+ case 'ordinal':
+ rank = ranking.ordinal_rank
+ break
+ }
+
+ if (rank === undefined) {
+ rank = ranking.rank
+ }
+
+ if (rank !== null && rank <= minGLRank) {
pvpFiltered = false
return false
}
@@ -3180,12 +3261,50 @@ function clearStaleMarkers() {
if (minULRank > 0 && pvpFiltered) {
var ultraLeague = JSON.parse(mapData.pokemons[key]['pvp_rankings_ultra_league'])
$.each(ultraLeague, function (index, ranking) {
- if (ranking.rank !== null && ranking.rank <= minULRank) {
+ let rank
+ switch (Store.get('pvpRankingMethod')) {
+ case 'competition':
+ rank = ranking.competition_rank
+ break
+ case 'dense':
+ rank = ranking.dense_rank
+ break
+ case 'ordinal':
+ rank = ranking.ordinal_rank
+ break
+ }
+
+ if (rank === undefined) {
+ rank = ranking.rank
+ }
+
+ if (rank !== null && rank <= minULRank) {
pvpFiltered = false
return false
}
})
}
+ if (pvpFiltered) {
+ if (excludedMinIV.includes(mapData.pokemons[key]['pokemon_id'])) {
+ pvpFiltered = false
+ } else if (Store.get('showMissingIVOnly') === true) {
+ pvpFiltered = false
+ } else if (minIV > 0 || minLevel > 0) {
+ let iv = getIv(mapData.pokemons[key]['individual_attack'], mapData.pokemons[key]['individual_defense'], mapData.pokemons[key]['individual_stamina'])
+ let level = ((mapData.pokemons[key]['level'] != null) ? mapData.pokemons[key]['level'] : getPokemonLevel(mapData.pokemons[key]['cp_multiplier']))
+ pvpFiltered = (iv < minIV || level < minLevel)
+ }
+ }
+ } else {
+ if (excludedMinIV.includes(mapData.pokemons[key]['pokemon_id'])) {
+ ivFiltered = false
+ } else if (Store.get('showMissingIVOnly') === true) {
+ ivFiltered = false
+ } else if (minIV > 0 || minLevel > 0) {
+ let iv = getIv(mapData.pokemons[key]['individual_attack'], mapData.pokemons[key]['individual_defense'], mapData.pokemons[key]['individual_stamina'])
+ let level = ((mapData.pokemons[key]['level'] != null) ? mapData.pokemons[key]['level'] : getPokemonLevel(mapData.pokemons[key]['cp_multiplier']))
+ ivFiltered = (iv < minIV || level < minLevel)
+ }
}
if (
mapData.pokemons[key]['disappear_time'] < new Date().getTime() ||
@@ -3193,7 +3312,7 @@ function clearStaleMarkers() {
(excludedPokemon.indexOf(mapData.pokemons[key]['pokemon_id']) >= 0 ||
isTemporaryHidden(mapData.pokemons[key]['pokemon_id']) ||
(pvpFiltered) ||
- ((((mapData.pokemons[key]['individual_attack'] + mapData.pokemons[key]['individual_defense'] + mapData.pokemons[key]['individual_stamina']) / 45 * 100 < minIV) || ((mapType === 'rdm' && mapData.pokemons[key]['level'] < minLevel) || (mapType === 'rocketmap' && !isNaN(minLevel) && (mapData.pokemons[key]['cp_multiplier'] < cpMultiplier[minLevel - 1])))) && !excludedMinIV.includes(mapData.pokemons[key]['pokemon_id']) && Store.get('showMissingIVOnly') === false) ||
+ (ivFiltered) ||
(Store.get('showMissingIVOnly') === true && mapData.pokemons[key]['individual_attack'] !== null) ||
(Store.get('showBigKarp') === true && mapData.pokemons[key]['pokemon_id'] === 129 && (mapData.pokemons[key]['weight'] < 13.14 || mapData.pokemons[key]['weight'] === null)) ||
(Store.get('showTinyRat') === true && mapData.pokemons[key]['pokemon_id'] === 19 && (mapData.pokemons[key]['weight'] > 2.40 || mapData.pokemons[key]['weight'] === null)) ||
@@ -3361,6 +3480,14 @@ function loadRawData() {
prevMinLevel = null
}
+ if (minGLRank > 0 || minULRank > 0) {
+ // In order to be able to show pokemon meeting IV/Level filters *OR* GL/UL Rank filters, we need to do all the filtering in JS and not in the SQL query.
+ loadMinIV = 0
+ loadMinLevel = 0
+ prevMinIV = null
+ prevMinLevel = null
+ }
+
return $.ajax({
url: 'raw_data',
type: 'POST',
@@ -4766,21 +4893,67 @@ function processPokemons(i, item) {
if (minGLRank > 0 && pvpFiltered) {
var greatLeague = JSON.parse(item['pvp_rankings_great_league'])
$.each(greatLeague, function (index, ranking) {
- if (ranking.rank !== null && ranking.rank <= minGLRank) {
+ let rank
+ switch (Store.get('pvpRankingMethod')) {
+ case 'competition':
+ rank = ranking.competition_rank
+ break
+ case 'dense':
+ rank = ranking.dense_rank
+ break
+ case 'ordinal':
+ rank = ranking.ordinal_rank
+ break
+ }
+
+ if (rank === undefined) {
+ rank = ranking.rank
+ }
+
+ if (rank !== null && rank <= minGLRank) {
pvpFiltered = false
- return false // same as 'break'
+ return false
}
})
}
if (minULRank > 0 && pvpFiltered) {
var ultraLeague = JSON.parse(item['pvp_rankings_ultra_league'])
$.each(ultraLeague, function (index, ranking) {
- if (ranking.rank !== null && ranking.rank <= minULRank) {
+ let rank
+ switch (Store.get('pvpRankingMethod')) {
+ case 'competition':
+ rank = ranking.competition_rank
+ break
+ case 'dense':
+ rank = ranking.dense_rank
+ break
+ case 'ordinal':
+ rank = ranking.ordinal_rank
+ break
+ }
+
+ if (rank === undefined) {
+ rank = ranking.rank
+ }
+
+ if (rank !== null && rank <= minULRank) {
pvpFiltered = false
- return false // same as 'break'
+ return false
}
})
}
+ if (pvpFiltered) {
+ if (excludedMinIV.includes(item['pokemon_id'])) {
+ pvpFiltered = false
+ } else if (Store.get('showMissingIVOnly') === true) {
+ pvpFiltered = false
+ } else if (minIV > 0 || minLevel > 0) {
+ let iv = getIv(item['individual_attack'], item['individual_defense'], item['individual_stamina'])
+ let level = ((item['level'] != null) ? item['level'] : getPokemonLevel(item['cp_multiplier']))
+ pvpFiltered = (iv < minIV || level < minLevel)
+ }
+
+ }
if (pvpFiltered) {
return true
}
@@ -5665,11 +5838,9 @@ var updateLabelDiffTime = function updateLabelDiffTime() {
timestring = i8ln('expired')
}
} else {
- if (hours > 0) {
- timestring += hours + 'h '
- }
- timestring += lpad(minutes, 2, 0) + 'm '
- timestring += lpad(seconds, 2, 0) + 's'
+ timestring += hours + ':'
+ timestring += lpad(minutes, 2, 0) + ':'
+ timestring += lpad(seconds, 2, 0)
}
$(element).text(timestring)
})
@@ -5690,11 +5861,9 @@ function generateRemainingTimer(timestamp, type) {
timestring = i8ln('expired')
}
} else {
- if (hours > 0) {
- timestring += hours + 'h '
- }
- timestring += lpad(minutes, 2, 0) + 'm '
- timestring += lpad(seconds, 2, 0) + 's'
+ timestring += hours + ':'
+ timestring += lpad(minutes, 2, 0) + ':'
+ timestring += lpad(seconds, 2, 0)
}
return timestring
}
@@ -6732,6 +6901,11 @@ $(function () {
lastpokemon = false
updateMap()
})
+ $('#pvp-ranking-method-select').on('change', function (e) {
+ Store.set('pvpRankingMethod', this.value)
+ lastpokemon = false
+ updateMap()
+ })
$selectPokemonNotify.on('change', function (e) {
notifiedPokemon = $selectPokemonNotify.val().split(',').map(Number).sort(function (a, b) {
return parseInt(a) - parseInt(b)
@@ -7582,7 +7756,7 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
var firstTry = true
switch (folder) {
case 'gym':
- if (iconpath['gymIndex'] === undefined) {
+ if (iconpath['gymIndex'] === undefined || iconpath['gymIndex'] === null) {
if (enableJSDebug) {
console.log('No gymIndex? Houston, we have a problem.')
}
@@ -7616,7 +7790,7 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'invasion':
- if (iconpath['invasionIndex'] === undefined) {
+ if (iconpath['invasionIndex'] === undefined || iconpath['invasionIndex'] === null) {
if (enableJSDebug) {
console.log('No invasionIndex? Houston, we have a problem.')
}
@@ -7652,7 +7826,7 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
case 'misc':
break
case 'pokemon':
- if (iconpath['pokemonIndex'] === undefined) {
+ if (iconpath['pokemonIndex'] === undefined || iconpath['pokemonIndex'] === null) {
if (enableJSDebug) {
console.log('No pokemonIndex? Houston, we have a problem.')
}
@@ -7692,7 +7866,7 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'pokestop':
- if (iconpath['pokestopIndex'] === undefined) {
+ if (iconpath['pokestopIndex'] === undefined || iconpath['pokestopIndex'] === null) {
if (enableJSDebug) {
console.log('No pokestopIndex? Houston, we have a problem.')
}
@@ -7723,11 +7897,11 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'raid/egg':
- if (iconpath['raidIndex'] === undefined) {
+ if (iconpath['raidIndex'] === undefined || iconpath['raidIndex'] === null) {
if (enableJSDebug) {
console.log('No raidIndex? Houston, we have a problem.')
}
- } else if (iconpath['raidIndex']['egg'] === undefined) {
+ } else if (iconpath['raidIndex']['egg'] === undefined || iconpath['raidIndex']['egg'] === null) {
if (enableJSDebug) {
console.log('No raidIndex->egg? Houston, we have a problem.')
}
@@ -7758,11 +7932,11 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'reward/item':
- if (iconpath['rewardIndex'] === undefined) {
+ if (iconpath['rewardIndex'] === undefined || iconpath['rewardIndex'] === null) {
if (enableJSDebug) {
console.log('No rewardIndex? Houston, we have a problem.')
}
- } else if (iconpath['rewardIndex']['item'] === undefined) {
+ } else if (iconpath['rewardIndex']['item'] === undefined || iconpath['rewardIndex']['item'] === null) {
if (enableJSDebug) {
console.log('No rewardIndex->item? Houston, we have a problem.')
}
@@ -7790,11 +7964,11 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'reward/mega_resource':
- if (iconpath['rewardIndex'] === undefined) {
+ if (iconpath['rewardIndex'] === undefined || iconpath['rewardIndex'] === null) {
if (enableJSDebug) {
console.log('No rewardIndex? Houston, we have a problem.')
}
- } else if (iconpath['rewardIndex']['mega_resource'] === undefined) {
+ } else if (iconpath['rewardIndex']['mega_resource'] === undefined || iconpath['rewardIndex']['mega_resource'] === null) {
if (enableJSDebug) {
console.log('No rewardIndex->mega_resource? Houston, we have a problem.')
}
@@ -7823,11 +7997,11 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'reward/stardust':
- if (iconpath['rewardIndex'] === undefined) {
+ if (iconpath['rewardIndex'] === undefined || iconpath['rewardIndex'] === null) {
if (enableJSDebug) {
console.log('No rewardIndex? Houston, we have a problem.')
}
- } else if (iconpath['rewardIndex']['stardust'] === undefined) {
+ } else if (iconpath['rewardIndex']['stardust'] === undefined || iconpath['rewardIndex']['stardust'] === null) {
if (enableJSDebug) {
console.log('No rewardIndex->stardust? Houston, we have a problem.')
}
@@ -7844,11 +8018,11 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'reward/candy':
- if (iconpath['rewardIndex'] === undefined) {
+ if (iconpath['rewardIndex'] === undefined || iconpath['rewardIndex'] === null) {
if (enableJSDebug) {
console.log('No rewardIndex? Houston, we have a problem.')
}
- } else if (iconpath['rewardIndex']['candy'] === undefined) {
+ } else if (iconpath['rewardIndex']['candy'] === undefined || iconpath['rewardIndex']['candy'] === null) {
if (enableJSDebug) {
console.log('No rewardIndex->candy? Houston, we have a problem.')
}
@@ -7876,7 +8050,7 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'team':
- if (iconpath['teamIndex'] === undefined) {
+ if (iconpath['teamIndex'] === undefined || iconpath['teamIndex'] === null) {
if (enableJSDebug) {
console.log('No teamIndex? Houston, we have a problem.')
}
@@ -7893,7 +8067,7 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'type':
- if (iconpath['typeIndex'] === undefined) {
+ if (iconpath['typeIndex'] === undefined || iconpath['typeIndex'] === null) {
if (enableJSDebug) {
console.log('No typeIndex? Houston, we have a problem.')
}
@@ -7910,7 +8084,7 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'weather':
- if (iconpath['weatherIndex'] === undefined) {
+ if (iconpath['weatherIndex'] === undefined || iconpath['weatherIndex'] === null) {
if (enableJSDebug) {
console.log('No weatherIndex? Houston, we have a problem.')
}
diff --git a/static/sass/layout/_gyms.scss b/static/sass/layout/_gyms.scss
index ea60bc67b..5991be5d0 100644
--- a/static/sass/layout/_gyms.scss
+++ b/static/sass/layout/_gyms.scss
@@ -36,20 +36,22 @@
margin: 6px;
}
.gym-icon-egg-timer {
- background-color: pink;
+ background-color: #F98795;
color: white;
+ left: -3px;
top: 50px;
position: absolute;
font-size: 11px;
- font-weight: 500;
+ border: 1px solid white;
border-radius: .25rem!important;
}
.gym-icon-raid-timer {
- background-color: #ff8c00;
+ background-color: #FF7836;
color: white;
+ left: -3px;
top: 50px;
position: absolute;
font-size: 11px;
- font-weight: 500;
+ border: 1px solid white;
border-radius: .25rem!important;
}
diff --git a/static/sass/layout/_pokestop.scss b/static/sass/layout/_pokestop.scss
index 648787bcf..5cd6e9500 100644
--- a/static/sass/layout/_pokestop.scss
+++ b/static/sass/layout/_pokestop.scss
@@ -63,9 +63,10 @@
.pokestop-icon-rocket-timer {
background-color: #c7c7c7;
color: black;
+ left: -3px;
top: 50px;
position: absolute;
font-size: 11px;
- font-weight: 500;
+ border: 1px solid black;
border-radius: .25rem!important;
}
From 3a3b563fbf3cba55d9d534740aef26e80225069e Mon Sep 17 00:00:00 2001
From: bradders <>
Date: Mon, 15 Nov 2021 21:21:15 +0000
Subject: [PATCH 10/19] Update default.php
---
config/default.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/config/default.php b/config/default.php
index d8ed8cfec..1627277d8 100644
--- a/config/default.php
+++ b/config/default.php
@@ -229,6 +229,7 @@
$noRarityDisplay = false; // true/false
$noWeatherIcons = true; // true/false
$no100IvShadow = false; // true/false
+$noRank1Shadow = false; // true/false
$noHideSingleMarker = false; // true/false
/* Notification Settings */
@@ -256,6 +257,8 @@
$pokemonGenSearchString = 'generation'; // When custom string is used translations do not work.
$noPvp = false; // true/false
+$noPvpRankingMethod = false; // true/false
+$pvpRankingMethod = 'competition'; // 'competition', 'dense', 'ordinal'
$excludeMinIV = '[]'; // [] for empty
From 751148a0cce8efbddc90698c616c200a1fa3a744 Mon Sep 17 00:00:00 2001
From: bradders <>
Date: Mon, 15 Nov 2021 21:47:25 +0000
Subject: [PATCH 11/19] Forgot some bits
---
.eslintrc.json | 4 +++-
README.md | 5 ++---
pre-index.php | 2 ++
static/data/questtype.json | 1 -
static/js/map.js | 3 +--
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index 8a19911f9..6ad1dbfcf 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -179,6 +179,7 @@
"noRarityDisplay": true,
"noWeatherIcons": true,
"noIvShadow": true,
+ "noRankShadow": true,
"hideQuestsPokemon": true,
"hideQuestsItem": true,
"hideQuestsEnergy": true,
@@ -246,6 +247,7 @@
"processShinyStats": true,
"noPvp": true,
"noHideSingleMarker": true,
- "enableJSDebug": true
+ "enableJSDebug": true,
+ "pvpRankingMethod": true
}
}
diff --git a/README.md b/README.md
index 44b9d8744..03eca3788 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ This fork is different is so many ways that its impossible to name them all. Mai
> Current Version 2.0 - Second release! with OpenStreetMap engine
PokeMap Standalone Frontend or PMSF for short is a PHP Map Interface for RDM, MAD designed to be completely standalone and able to run on any traditional web server. Manual submissions are supported but no longer maintained.
-
+
## Login Support:
### oAuth:
* Discord
@@ -24,8 +24,7 @@ It supports all the common database engines, including MySQL, MariaDB.
* [Wiki](https://github.com/pmsf/PMSF/wiki).
* Join our [Discord](https://discord.gg/JAWztHdqeB) channel for more info about installation.
-
-
+
## Feature Requests
[](https://feathub.com/pmsf/PMSF)
diff --git a/pre-index.php b/pre-index.php
index d17cea40f..b79b0f216 100644
--- a/pre-index.php
+++ b/pre-index.php
@@ -1647,6 +1647,7 @@
var noRarityDisplay = ;
var noWeatherIcons = ;
var noIvShadow = ;
+ var noRankShadow = ;
var noRaidTimer = ;
var enableRaidTimer = ;
var noRocketTimer = ;
@@ -1670,6 +1671,7 @@
var noDarkMode = ;
var noCatchRates = ;
var noPvp = ;
+ var pvpRankingMethod = '';
var noHideSingleMarker = ;
var enableJSDebug = ;
diff --git a/static/data/questtype.json b/static/data/questtype.json
index bc0d6de44..5cf3d31e1 100644
--- a/static/data/questtype.json
+++ b/static/data/questtype.json
@@ -144,7 +144,6 @@
"text": "QUEST_GBL_RANK"
},
"53": {
- "prototext": "QUEST_CHARGE_ATTACK",
"text": "Use {0} Charged Attack(s)"
},
"54": {
diff --git a/static/js/map.js b/static/js/map.js
index bafe0c953..ce6a87a7f 100644
--- a/static/js/map.js
+++ b/static/js/map.js
@@ -4952,7 +4952,6 @@ function processPokemons(i, item) {
let level = ((item['level'] != null) ? item['level'] : getPokemonLevel(item['cp_multiplier']))
pvpFiltered = (iv < minIV || level < minLevel)
}
-
}
if (pvpFiltered) {
return true
@@ -7807,7 +7806,7 @@ function getIcon(iconRepo, folder, fileType, iconKeyId, ...varArgs) {
}
break
case 'nest':
- if (iconpath['nestIndex'] === undefined) {
+ if (iconpath['nestIndex'] === undefined || iconpath['nestIndex'] === null) {
if (enableJSDebug) {
console.log('No nestIndex? Houston, we have a problem.')
}
From 1200022318a5e431b9596199c64a272d1ade7dec Mon Sep 17 00:00:00 2001
From: bradders <>
Date: Mon, 15 Nov 2021 22:56:56 +0000
Subject: [PATCH 12/19] Update map.common.js
---
static/js/map.common.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/static/js/map.common.js b/static/js/map.common.js
index 35f54fd38..65fdef692 100755
--- a/static/js/map.common.js
+++ b/static/js/map.common.js
@@ -612,7 +612,7 @@ function getPokemonMarkerIcon(item) {
})
}
}
- var html = '
 + ')
' +
'
 + ')
' +
+ arIcon +
'
 + ')
' +
'
'
stopMarker = L.divIcon({
@@ -2618,6 +2619,7 @@ function getPokestopMarkerIcon(item) {
if (item['quest_reward_type'] === 12) {
html = '
' +
'
 + ')
' +
+ arIcon +
'
 + ')
' +
'
'
stopMarker = L.divIcon({
From 20c9fda5cc1cb3cd0748706d8ba24a95a500694c Mon Sep 17 00:00:00 2001
From: bradders <>
Date: Fri, 25 Feb 2022 08:46:30 +0000
Subject: [PATCH 14/19] Spawn type selection
Adds the ability to filter map display by spawn/seen type - set 'noSpawnType=false' in access config for groups you wish to have access to this, it's hidden by default.
---
.eslintrc.json | 1 +
config/default.php | 2 ++
config/example.config.php | 2 ++
lib/RDM.php | 32 ++++++++++++++++++++++++++++++--
lib/RocketMap.php | 4 ++--
lib/RocketMap_MAD.php | 30 ++++++++++++++++++++++++++++--
pre-index.php | 16 ++++++++++++++++
raw_data.php | 9 +++++----
static/js/map.common.js | 5 +++++
static/js/map.js | 32 ++++++++++++++++++++++++++++++++
10 files changed, 123 insertions(+), 10 deletions(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index 6ad1dbfcf..41da0f7d8 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -90,6 +90,7 @@
"minLevel": true,
"showBigKarp": true,
"showTinyRat": true,
+ "showSpawnType": true,
"showDespawnTimeType": true,
"showPokemonGender": true,
"hidePokemonCoords": true,
diff --git a/config/default.php b/config/default.php
index 1627277d8..a6f9751af 100644
--- a/config/default.php
+++ b/config/default.php
@@ -271,6 +271,8 @@
$noMissingIVOnly = true; // true/false
$noBigKarp = false; // true/false
$noTinyRat = false; // true/false
+$noSpawnType = true; // true/false
+$showSpawnType = 0; // 0 = All, 1 = Wild + Nearby (Pokestop), 2 = Wild, 3 = Nearby (Pokestop + Other), 4 = Nearby (Pokestop), 5 = Nearby (Other)
$noDespawnTimeType = true; // true/false
$showDespawnTimeType = 0; // 0 = All, 1 = Verified, 2 = Unverified, 3 = Unverified + Nearby (Nearby = no spawn point)
$noPokemonGender = false; // true/false
diff --git a/config/example.config.php b/config/example.config.php
index d2840fa1b..940a21587 100644
--- a/config/example.config.php
+++ b/config/example.config.php
@@ -271,6 +271,8 @@
$noMissingIVOnly = true; // true/false
$noBigKarp = false; // true/false
$noTinyRat = false; // true/false
+$noSpawnType = true; // true/false
+$showSpawnType = 0; // 0 = All, 1 = Wild + Nearby (Pokestop), 2 = Wild, 3 = Nearby (Pokestop + Other), 4 = Nearby (Pokestop), 5 = Nearby (Other)
$noDespawnTimeType = true; // true/false
$showDespawnTimeType = 0; // 0 = All, 1 = Verified, 2 = Unverified, 3 = Unverified + Nearby (Nearby = no spawn point)
$noPokemonGender = false; // true/false
diff --git a/lib/RDM.php b/lib/RDM.php
index 6fa59e2ad..a6b5cf64b 100644
--- a/lib/RDM.php
+++ b/lib/RDM.php
@@ -4,7 +4,7 @@
class RDM extends Scanner
{
- public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
+ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
{
global $db;
$conds = array();
@@ -14,6 +14,7 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
expire_timestamp AS disappear_time,
id AS encounter_id,
spawn_id,
+ pokestop_id,
lat AS latitude,
lon AS longitude,
gender,
@@ -98,6 +99,19 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
$conds[] = '(level >= ' . $minLevel . ' OR pokemon_id IN(' . $exMinIv . ') )';
}
}
+ if (!empty($spawnType)) {
+ if ($spawnType == 1) { // Wild + Nearby (Pokestop)
+ $conds[] = '(spawn_id IS NOT NULL OR pokestop_id IS NOT NULL)';
+ } elseif ($spawnType == 2) { // Wild
+ $conds[] = 'spawn_id IS NOT NULL';
+ } elseif ($spawnType == 3) { // Nearby (Pokestop + Other)
+ $conds[] = 'spawn_id IS NULL';
+ } elseif ($spawnType == 4) { // Nearby (Pokestop)
+ $conds[] = '(spawn_id IS NULL AND pokestop_id IS NOT NULL)';
+ } elseif ($spawnType == 5) { // Nearby (Other)
+ $conds[] = '(spawn_id IS NULL AND pokestop_id IS NULL)';
+ }
+ }
if (!empty($despawnTimeType)) {
if ($despawnTimeType == 1) {
$conds[] = 'expire_timestamp_verified = 1';
@@ -117,7 +131,7 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
return $this->query_active($select, $conds, $params, $encSql);
}
- public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
+ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
{
global $db;
$conds = array();
@@ -127,6 +141,7 @@ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $t
expire_timestamp AS disappear_time,
id AS encounter_id,
spawn_id,
+ pokestop_id,
lat AS latitude,
lon AS longitude,
gender,
@@ -204,6 +219,19 @@ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $t
$conds[] = '(level >= ' . $minLevel . ' OR pokemon_id IN(' . $exMinIv . ') )';
}
}
+ if (!empty($spawnType)) {
+ if ($spawnType == 1) { // Wild + Nearby (Pokestop)
+ $conds[] = '(spawn_id IS NOT NULL OR pokestop_id IS NOT NULL)';
+ } elseif ($spawnType == 2) { // Wild
+ $conds[] = 'spawn_id IS NOT NULL';
+ } elseif ($spawnType == 3) { // Nearby (Pokestop + Other)
+ $conds[] = 'spawn_id IS NULL';
+ } elseif ($spawnType == 4) { // Nearby (Pokestop)
+ $conds[] = '(spawn_id IS NULL AND pokestop_id IS NOT NULL)';
+ } elseif ($spawnType == 5) { // Nearby (Other)
+ $conds[] = '(spawn_id IS NULL AND pokestop_id IS NULL)';
+ }
+ }
if (!empty($despawnTimeType)) {
if ($despawnTimeType == 1) {
$conds[] = 'expire_timestamp_verified = 1';
diff --git a/lib/RocketMap.php b/lib/RocketMap.php
index 91427dc9d..6f6b549d0 100644
--- a/lib/RocketMap.php
+++ b/lib/RocketMap.php
@@ -12,7 +12,7 @@ public function __construct()
$this->setCpMultiplier();
}
- public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
+ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
{
global $db;
$conds = array();
@@ -93,7 +93,7 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
return $this->query_active($select, $conds, $params, $encSql);
}
- public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
+ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
{
global $db;
$conds = array();
diff --git a/lib/RocketMap_MAD.php b/lib/RocketMap_MAD.php
index b06e82d21..d112c5a3d 100644
--- a/lib/RocketMap_MAD.php
+++ b/lib/RocketMap_MAD.php
@@ -4,7 +4,7 @@
class RocketMap_MAD extends RocketMap
{
- public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
+ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
{
global $db;
$conds = array();
@@ -100,6 +100,19 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
$conds[] = '(cp_multiplier >= ' . $this->cpMultiplier[$minLevel] . ' OR pokemon_id IN(' . $exMinIv . ') )';
}
}
+ if (!empty($spawnType)) {
+ if ($spawnType == 1) { // Wild + Nearby (Pokestop)
+ $conds[] = '(spawnpoint_id IS NOT NULL OR pokestop_id IS NOT NULL)';
+ } elseif ($spawnType == 2) { // Wild
+ $conds[] = 'spawnpoint_id IS NOT NULL';
+ } elseif ($spawnType == 3) { // Nearby (Pokestop + Other)
+ $conds[] = 'spawnpoint_id IS NULL';
+ } elseif ($spawnType == 4) { // Nearby (Pokestop)
+ $conds[] = '(spawnpoint_id IS NULL AND pokestop_id IS NOT NULL)';
+ } elseif ($spawnType == 5) { // Nearby (Other)
+ $conds[] = '(spawnpoint_id IS NULL AND pokestop_id IS NULL)';
+ }
+ }
if (!empty($despawnTimeType)) {
if ($despawnTimeType == 1) {
$conds[] = 'ts.calc_endminsec IS NOT NULL';
@@ -120,7 +133,7 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
return $this->query_active($select, $conds, $params, $encSql);
}
- public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
+ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
{
global $db;
$conds = array();
@@ -210,6 +223,19 @@ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $t
$conds[] = '(cp_multiplier >= ' . $this->cpMultiplier[$minLevel] . ' OR pokemon_id IN(' . $exMinIv . ') )';
}
}
+ if (!empty($spawnType)) {
+ if ($spawnType == 1) { // Wild + Nearby (Pokestop)
+ $conds[] = '(spawnpoint_id IS NOT NULL OR pokestop_id IS NOT NULL)';
+ } elseif ($spawnType == 2) { // Wild
+ $conds[] = 'spawnpoint_id IS NOT NULL';
+ } elseif ($spawnType == 3) { // Nearby (Pokestop + Other)
+ $conds[] = 'spawnpoint_id IS NULL';
+ } elseif ($spawnType == 4) { // Nearby (Pokestop)
+ $conds[] = '(spawnpoint_id IS NULL AND pokestop_id IS NOT NULL)';
+ } elseif ($spawnType == 5) { // Nearby (Other)
+ $conds[] = '(spawnpoint_id IS NULL AND pokestop_id IS NULL)';
+ }
+ }
if (!empty($despawnTimeType)) {
if ($despawnTimeType == 1) {
$conds[] = 'ts.calc_endminsec IS NOT NULL';
diff --git a/pre-index.php b/pre-index.php
index b79b0f216..be132622f 100644
--- a/pre-index.php
+++ b/pre-index.php
@@ -288,6 +288,21 @@
+
+
+
+
+
+
@@ -1600,6 +1615,7 @@
var onlyTriggerGyms = ;
var showBigKarp = ;
var showTinyRat = ;
+ var showSpawnType = ;
var showDespawnTimeType = ;
var showPokemonGender = ;
var hidePokemonCoords = ;
diff --git a/raw_data.php b/raw_data.php
index c3948c9ab..3236c5523 100644
--- a/raw_data.php
+++ b/raw_data.php
@@ -36,6 +36,7 @@
$exMinIv = !empty($_POST['exMinIV']) ? $_POST['exMinIV'] : '';
$bigKarp = !empty($_POST['bigKarp']) ? $_POST['bigKarp'] : false;
$tinyRat = !empty($_POST['tinyRat']) ? $_POST['tinyRat'] : false;
+$spawnType = !empty($_POST['spawnType']) ? $_POST['spawnType'] : 0;
$despawnTimeType = !empty($_POST['despawnTimeType']) ? $_POST['despawnTimeType'] : 0;
$pokemonGender = !empty($_POST['pokemonGender']) ? $_POST['pokemonGender'] : 0;
$lastpokemon = !empty($_POST['lastpokemon']) ? $_POST['lastpokemon'] : false;
@@ -148,12 +149,12 @@
if ($d["lastpokemon"] == "true") {
$eids = !empty($_POST['eids']) ? explode(",", $_POST['eids']) : array();
if ($lastpokemon != 'true') {
- $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, 0, 0, 0, 0, 0, $enc_id);
+ $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, 0, 0, 0, 0, 0, $enc_id);
} else {
if ($newarea) {
- $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $enc_id);
+ $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $enc_id);
} else {
- $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, $timestamp, 0, 0, 0, 0, $enc_id);
+ $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, $timestamp, 0, 0, 0, 0, $enc_id);
}
}
$d["preMinIV"] = $minIv;
@@ -163,7 +164,7 @@
$reidsDiff = array_diff($reids, $eids);
if (count($reidsDiff)) {
- $d["pokemons"] = array_merge($d["pokemons"], $scanner->get_active_by_id($reidsDiff, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng));
+ $d["pokemons"] = array_merge($d["pokemons"], $scanner->get_active_by_id($reidsDiff, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng));
}
$d["reids"] = $reids;
diff --git a/static/js/map.common.js b/static/js/map.common.js
index 65fdef692..375f26938 100644
--- a/static/js/map.common.js
+++ b/static/js/map.common.js
@@ -286,6 +286,11 @@ var StoreOptions = {
default: showTinyRat,
type: StoreTypes.Boolean
},
+ 'showSpawnType':
+ {
+ default: showSpawnType,
+ type: StoreTypes.Number
+ },
'showDespawnTimeType':
{
default: showDespawnTimeType,
diff --git a/static/js/map.js b/static/js/map.js
index 5df78e018..bdd394f17 100644
--- a/static/js/map.js
+++ b/static/js/map.js
@@ -1060,6 +1060,7 @@ function initSidebar() {
$('#missing-iv-only-switch').prop('checked', Store.get('showMissingIVOnly'))
$('#big-karp-switch').prop('checked', Store.get('showBigKarp'))
$('#tiny-rat-switch').prop('checked', Store.get('showTinyRat'))
+ $('#spawn-type-select').val(Store.get('showSpawnType'))
$('#despawn-time-type-select').val(Store.get('showDespawnTimeType'))
$('#pokemon-gender-select').val(Store.get('showPokemonGender'))
$('#pokestops-switch').prop('checked', Store.get('showPokestops'))
@@ -3231,6 +3232,7 @@ function clearStaleMarkers() {
$.each(mapData.pokemons, function (key, value) {
var pvpFiltered = false
var ivFiltered = false
+ var spawnTypeFiltered = false
if (minGLRank > 0 || minULRank > 0) {
pvpFiltered = true
@@ -3308,6 +3310,28 @@ function clearStaleMarkers() {
ivFiltered = (iv < minIV || level < minLevel)
}
}
+
+ switch(Store.get('showSpawnType')) {
+ case 0: // All
+ spawnTypeFiltered = false
+ break
+ case 1: // Wild + Nearby (Pokestop)
+ spawnTypeFiltered = (mapData.pokemons[key]['spawn_id'] === null && mapData.pokemons[key]['pokestop_id'] === null)
+ break
+ case 2: // Wild
+ spawnTypeFiltered = (mapData.pokemons[key]['spawn_id'] === null)
+ break
+ case 3: // Nearby (Pokestop + Other)
+ spawnTypeFiltered = (mapData.pokemons[key]['spawn_id'] !== null)
+ break
+ case 4: // Nearby (Pokestop)
+ spawnTypeFiltered = (mapData.pokemons[key]['spawn_id'] !== null || mapData.pokemons[key]['pokestop_id'] === null)
+ break
+ case 5: // Nearby (Other)
+ spawnTypeFiltered = (mapData.pokemons[key]['spawn_id'] !== null || mapData.pokemons[key]['pokestop_id'] !== null)
+ break
+ }
+
if (
mapData.pokemons[key]['disappear_time'] < new Date().getTime() ||
(
@@ -3315,6 +3339,7 @@ function clearStaleMarkers() {
isTemporaryHidden(mapData.pokemons[key]['pokemon_id']) ||
(pvpFiltered) ||
(ivFiltered) ||
+ (spawnTypeFiltered) ||
(Store.get('showMissingIVOnly') === true && mapData.pokemons[key]['individual_attack'] !== null) ||
(Store.get('showBigKarp') === true && mapData.pokemons[key]['pokemon_id'] === 129 && (mapData.pokemons[key]['weight'] < 13.14 || mapData.pokemons[key]['weight'] === null)) ||
(Store.get('showTinyRat') === true && mapData.pokemons[key]['pokemon_id'] === 19 && (mapData.pokemons[key]['weight'] > 2.40 || mapData.pokemons[key]['weight'] === null)) ||
@@ -3457,6 +3482,7 @@ function loadRawData() {
var loadMinLevel = Store.get('remember_text_min_level')
var bigKarp = Boolean(Store.get('showBigKarp'))
var tinyRat = Boolean(Store.get('showTinyRat'))
+ var spawnType = Store.get('showSpawnType')
var despawnTimeType = Store.get('showDespawnTimeType')
var pokemonGender = Store.get('showPokemonGender')
var exEligible = Boolean(Store.get('exEligible'))
@@ -3533,6 +3559,7 @@ function loadRawData() {
'prevMinLevel': prevMinLevel,
'bigKarp': bigKarp,
'tinyRat': tinyRat,
+ 'spawnType': spawnType,
'despawnTimeType': despawnTimeType,
'pokemonGender': pokemonGender,
'swLat': swLat,
@@ -6892,6 +6919,11 @@ $(function () {
lastpokemon = false
updateMap()
})
+ $('#spawn-type-select').on('change', function (e) {
+ Store.set('showSpawnType', this.value)
+ lastpokemon = false
+ updateMap()
+ })
$('#despawn-time-type-select').on('change', function (e) {
Store.set('showDespawnTimeType', this.value)
lastpokemon = false
From 8b4d5f7e21f6deb4ce0135dd766a7dbe67069206 Mon Sep 17 00:00:00 2001
From: bradders <>
Date: Fri, 25 Feb 2022 09:34:00 +0000
Subject: [PATCH 15/19] Rename spawntype to seentype
---
.eslintrc.json | 2 +-
config/default.php | 4 ++--
config/example.config.php | 4 ++--
lib/RDM.php | 28 ++++++++++++++--------------
lib/RocketMap.php | 4 ++--
lib/RocketMap_MAD.php | 28 ++++++++++++++--------------
pre-index.php | 8 ++++----
raw_data.php | 10 +++++-----
static/js/map.common.js | 4 ++--
static/js/map.js | 28 ++++++++++++++--------------
10 files changed, 60 insertions(+), 60 deletions(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index 41da0f7d8..7c18daf44 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -90,7 +90,7 @@
"minLevel": true,
"showBigKarp": true,
"showTinyRat": true,
- "showSpawnType": true,
+ "showSeenType": true,
"showDespawnTimeType": true,
"showPokemonGender": true,
"hidePokemonCoords": true,
diff --git a/config/default.php b/config/default.php
index a6f9751af..463bbb65b 100644
--- a/config/default.php
+++ b/config/default.php
@@ -271,8 +271,8 @@
$noMissingIVOnly = true; // true/false
$noBigKarp = false; // true/false
$noTinyRat = false; // true/false
-$noSpawnType = true; // true/false
-$showSpawnType = 0; // 0 = All, 1 = Wild + Nearby (Pokestop), 2 = Wild, 3 = Nearby (Pokestop + Other), 4 = Nearby (Pokestop), 5 = Nearby (Other)
+$noSeenType = true; // true/false
+$showSeenType = 0; // 0 = All, 1 = Wild + Nearby (Pokestop), 2 = Wild, 3 = Nearby (Pokestop + Other), 4 = Nearby (Pokestop), 5 = Nearby (Other)
$noDespawnTimeType = true; // true/false
$showDespawnTimeType = 0; // 0 = All, 1 = Verified, 2 = Unverified, 3 = Unverified + Nearby (Nearby = no spawn point)
$noPokemonGender = false; // true/false
diff --git a/config/example.config.php b/config/example.config.php
index 940a21587..3b79d6fd3 100644
--- a/config/example.config.php
+++ b/config/example.config.php
@@ -271,8 +271,8 @@
$noMissingIVOnly = true; // true/false
$noBigKarp = false; // true/false
$noTinyRat = false; // true/false
-$noSpawnType = true; // true/false
-$showSpawnType = 0; // 0 = All, 1 = Wild + Nearby (Pokestop), 2 = Wild, 3 = Nearby (Pokestop + Other), 4 = Nearby (Pokestop), 5 = Nearby (Other)
+$noSeenType = true; // true/false
+$showSeenType = 0; // 0 = All, 1 = Wild + Nearby (Pokestop), 2 = Wild, 3 = Nearby (Pokestop + Other), 4 = Nearby (Pokestop), 5 = Nearby (Other)
$noDespawnTimeType = true; // true/false
$showDespawnTimeType = 0; // 0 = All, 1 = Verified, 2 = Unverified, 3 = Unverified + Nearby (Nearby = no spawn point)
$noPokemonGender = false; // true/false
diff --git a/lib/RDM.php b/lib/RDM.php
index a6b5cf64b..fd5f6c1e7 100644
--- a/lib/RDM.php
+++ b/lib/RDM.php
@@ -4,7 +4,7 @@
class RDM extends Scanner
{
- public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
+ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
{
global $db;
$conds = array();
@@ -99,16 +99,16 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
$conds[] = '(level >= ' . $minLevel . ' OR pokemon_id IN(' . $exMinIv . ') )';
}
}
- if (!empty($spawnType)) {
- if ($spawnType == 1) { // Wild + Nearby (Pokestop)
+ if (!empty($seenType)) {
+ if ($seenType == 1) { // Wild + Nearby (Pokestop)
$conds[] = '(spawn_id IS NOT NULL OR pokestop_id IS NOT NULL)';
- } elseif ($spawnType == 2) { // Wild
+ } elseif ($seenType == 2) { // Wild
$conds[] = 'spawn_id IS NOT NULL';
- } elseif ($spawnType == 3) { // Nearby (Pokestop + Other)
+ } elseif ($seenType == 3) { // Nearby (Pokestop + Other)
$conds[] = 'spawn_id IS NULL';
- } elseif ($spawnType == 4) { // Nearby (Pokestop)
+ } elseif ($seenType == 4) { // Nearby (Pokestop)
$conds[] = '(spawn_id IS NULL AND pokestop_id IS NOT NULL)';
- } elseif ($spawnType == 5) { // Nearby (Other)
+ } elseif ($seenType == 5) { // Nearby (Other)
$conds[] = '(spawn_id IS NULL AND pokestop_id IS NULL)';
}
}
@@ -131,7 +131,7 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
return $this->query_active($select, $conds, $params, $encSql);
}
- public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
+ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
{
global $db;
$conds = array();
@@ -219,16 +219,16 @@ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $t
$conds[] = '(level >= ' . $minLevel . ' OR pokemon_id IN(' . $exMinIv . ') )';
}
}
- if (!empty($spawnType)) {
- if ($spawnType == 1) { // Wild + Nearby (Pokestop)
+ if (!empty($seenType)) {
+ if ($seenType == 1) { // Wild + Nearby (Pokestop)
$conds[] = '(spawn_id IS NOT NULL OR pokestop_id IS NOT NULL)';
- } elseif ($spawnType == 2) { // Wild
+ } elseif ($seenType == 2) { // Wild
$conds[] = 'spawn_id IS NOT NULL';
- } elseif ($spawnType == 3) { // Nearby (Pokestop + Other)
+ } elseif ($seenType == 3) { // Nearby (Pokestop + Other)
$conds[] = 'spawn_id IS NULL';
- } elseif ($spawnType == 4) { // Nearby (Pokestop)
+ } elseif ($seenType == 4) { // Nearby (Pokestop)
$conds[] = '(spawn_id IS NULL AND pokestop_id IS NOT NULL)';
- } elseif ($spawnType == 5) { // Nearby (Other)
+ } elseif ($seenType == 5) { // Nearby (Other)
$conds[] = '(spawn_id IS NULL AND pokestop_id IS NULL)';
}
}
diff --git a/lib/RocketMap.php b/lib/RocketMap.php
index 6f6b549d0..bafda7e42 100644
--- a/lib/RocketMap.php
+++ b/lib/RocketMap.php
@@ -12,7 +12,7 @@ public function __construct()
$this->setCpMultiplier();
}
- public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
+ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
{
global $db;
$conds = array();
@@ -93,7 +93,7 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
return $this->query_active($select, $conds, $params, $encSql);
}
- public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
+ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
{
global $db;
$conds = array();
diff --git a/lib/RocketMap_MAD.php b/lib/RocketMap_MAD.php
index d112c5a3d..4d4368c7a 100644
--- a/lib/RocketMap_MAD.php
+++ b/lib/RocketMap_MAD.php
@@ -4,7 +4,7 @@
class RocketMap_MAD extends RocketMap
{
- public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
+ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
{
global $db;
$conds = array();
@@ -100,16 +100,16 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
$conds[] = '(cp_multiplier >= ' . $this->cpMultiplier[$minLevel] . ' OR pokemon_id IN(' . $exMinIv . ') )';
}
}
- if (!empty($spawnType)) {
- if ($spawnType == 1) { // Wild + Nearby (Pokestop)
+ if (!empty($seenType)) {
+ if ($seenType == 1) { // Wild + Nearby (Pokestop)
$conds[] = '(spawnpoint_id IS NOT NULL OR pokestop_id IS NOT NULL)';
- } elseif ($spawnType == 2) { // Wild
+ } elseif ($seenType == 2) { // Wild
$conds[] = 'spawnpoint_id IS NOT NULL';
- } elseif ($spawnType == 3) { // Nearby (Pokestop + Other)
+ } elseif ($seenType == 3) { // Nearby (Pokestop + Other)
$conds[] = 'spawnpoint_id IS NULL';
- } elseif ($spawnType == 4) { // Nearby (Pokestop)
+ } elseif ($seenType == 4) { // Nearby (Pokestop)
$conds[] = '(spawnpoint_id IS NULL AND pokestop_id IS NOT NULL)';
- } elseif ($spawnType == 5) { // Nearby (Other)
+ } elseif ($seenType == 5) { // Nearby (Other)
$conds[] = '(spawnpoint_id IS NULL AND pokestop_id IS NULL)';
}
}
@@ -133,7 +133,7 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
return $this->query_active($select, $conds, $params, $encSql);
}
- public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
+ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
{
global $db;
$conds = array();
@@ -223,16 +223,16 @@ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $t
$conds[] = '(cp_multiplier >= ' . $this->cpMultiplier[$minLevel] . ' OR pokemon_id IN(' . $exMinIv . ') )';
}
}
- if (!empty($spawnType)) {
- if ($spawnType == 1) { // Wild + Nearby (Pokestop)
+ if (!empty($seenType)) {
+ if ($seenType == 1) { // Wild + Nearby (Pokestop)
$conds[] = '(spawnpoint_id IS NOT NULL OR pokestop_id IS NOT NULL)';
- } elseif ($spawnType == 2) { // Wild
+ } elseif ($seenType == 2) { // Wild
$conds[] = 'spawnpoint_id IS NOT NULL';
- } elseif ($spawnType == 3) { // Nearby (Pokestop + Other)
+ } elseif ($seenType == 3) { // Nearby (Pokestop + Other)
$conds[] = 'spawnpoint_id IS NULL';
- } elseif ($spawnType == 4) { // Nearby (Pokestop)
+ } elseif ($seenType == 4) { // Nearby (Pokestop)
$conds[] = '(spawnpoint_id IS NULL AND pokestop_id IS NOT NULL)';
- } elseif ($spawnType == 5) { // Nearby (Other)
+ } elseif ($seenType == 5) { // Nearby (Other)
$conds[] = '(spawnpoint_id IS NULL AND pokestop_id IS NULL)';
}
}
diff --git a/pre-index.php b/pre-index.php
index be132622f..32fa6b332 100644
--- a/pre-index.php
+++ b/pre-index.php
@@ -288,10 +288,10 @@
+ if (! $noSeenType) { ?>
-
;
var showBigKarp = ;
var showTinyRat = ;
- var showSpawnType = ;
+ var showSeenType = ;
var showDespawnTimeType = ;
var showPokemonGender = ;
var hidePokemonCoords = ;
diff --git a/raw_data.php b/raw_data.php
index 3236c5523..0c72cecff 100644
--- a/raw_data.php
+++ b/raw_data.php
@@ -36,7 +36,7 @@
$exMinIv = !empty($_POST['exMinIV']) ? $_POST['exMinIV'] : '';
$bigKarp = !empty($_POST['bigKarp']) ? $_POST['bigKarp'] : false;
$tinyRat = !empty($_POST['tinyRat']) ? $_POST['tinyRat'] : false;
-$spawnType = !empty($_POST['spawnType']) ? $_POST['spawnType'] : 0;
+$seenType = !empty($_POST['seenType']) ? $_POST['seenType'] : 0;
$despawnTimeType = !empty($_POST['despawnTimeType']) ? $_POST['despawnTimeType'] : 0;
$pokemonGender = !empty($_POST['pokemonGender']) ? $_POST['pokemonGender'] : 0;
$lastpokemon = !empty($_POST['lastpokemon']) ? $_POST['lastpokemon'] : false;
@@ -149,12 +149,12 @@
if ($d["lastpokemon"] == "true") {
$eids = !empty($_POST['eids']) ? explode(",", $_POST['eids']) : array();
if ($lastpokemon != 'true') {
- $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, 0, 0, 0, 0, 0, $enc_id);
+ $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, 0, 0, 0, 0, 0, $enc_id);
} else {
if ($newarea) {
- $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $enc_id);
+ $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $enc_id);
} else {
- $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, $timestamp, 0, 0, 0, 0, $enc_id);
+ $d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng, $timestamp, 0, 0, 0, 0, $enc_id);
}
}
$d["preMinIV"] = $minIv;
@@ -164,7 +164,7 @@
$reidsDiff = array_diff($reids, $eids);
if (count($reidsDiff)) {
- $d["pokemons"] = array_merge($d["pokemons"], $scanner->get_active_by_id($reidsDiff, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $spawnType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng));
+ $d["pokemons"] = array_merge($d["pokemons"], $scanner->get_active_by_id($reidsDiff, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $pokemonGender, $swLat, $swLng, $neLat, $neLng));
}
$d["reids"] = $reids;
diff --git a/static/js/map.common.js b/static/js/map.common.js
index 375f26938..aa8b7abc6 100644
--- a/static/js/map.common.js
+++ b/static/js/map.common.js
@@ -286,9 +286,9 @@ var StoreOptions = {
default: showTinyRat,
type: StoreTypes.Boolean
},
- 'showSpawnType':
+ 'showSeenType':
{
- default: showSpawnType,
+ default: showSeenType,
type: StoreTypes.Number
},
'showDespawnTimeType':
diff --git a/static/js/map.js b/static/js/map.js
index bdd394f17..5c3339577 100644
--- a/static/js/map.js
+++ b/static/js/map.js
@@ -1060,7 +1060,7 @@ function initSidebar() {
$('#missing-iv-only-switch').prop('checked', Store.get('showMissingIVOnly'))
$('#big-karp-switch').prop('checked', Store.get('showBigKarp'))
$('#tiny-rat-switch').prop('checked', Store.get('showTinyRat'))
- $('#spawn-type-select').val(Store.get('showSpawnType'))
+ $('#seen-type-select').val(Store.get('showSeenType'))
$('#despawn-time-type-select').val(Store.get('showDespawnTimeType'))
$('#pokemon-gender-select').val(Store.get('showPokemonGender'))
$('#pokestops-switch').prop('checked', Store.get('showPokestops'))
@@ -3232,7 +3232,7 @@ function clearStaleMarkers() {
$.each(mapData.pokemons, function (key, value) {
var pvpFiltered = false
var ivFiltered = false
- var spawnTypeFiltered = false
+ var seenTypeFiltered = false
if (minGLRank > 0 || minULRank > 0) {
pvpFiltered = true
@@ -3311,24 +3311,24 @@ function clearStaleMarkers() {
}
}
- switch(Store.get('showSpawnType')) {
+ switch(Store.get('showSeenType')) {
case 0: // All
- spawnTypeFiltered = false
+ seenTypeFiltered = false
break
case 1: // Wild + Nearby (Pokestop)
- spawnTypeFiltered = (mapData.pokemons[key]['spawn_id'] === null && mapData.pokemons[key]['pokestop_id'] === null)
+ seenTypeFiltered = (mapData.pokemons[key]['spawn_id'] === null && mapData.pokemons[key]['pokestop_id'] === null)
break
case 2: // Wild
- spawnTypeFiltered = (mapData.pokemons[key]['spawn_id'] === null)
+ seenTypeFiltered = (mapData.pokemons[key]['spawn_id'] === null)
break
case 3: // Nearby (Pokestop + Other)
- spawnTypeFiltered = (mapData.pokemons[key]['spawn_id'] !== null)
+ seenTypeFiltered = (mapData.pokemons[key]['spawn_id'] !== null)
break
case 4: // Nearby (Pokestop)
- spawnTypeFiltered = (mapData.pokemons[key]['spawn_id'] !== null || mapData.pokemons[key]['pokestop_id'] === null)
+ seenTypeFiltered = (mapData.pokemons[key]['spawn_id'] !== null || mapData.pokemons[key]['pokestop_id'] === null)
break
case 5: // Nearby (Other)
- spawnTypeFiltered = (mapData.pokemons[key]['spawn_id'] !== null || mapData.pokemons[key]['pokestop_id'] !== null)
+ seenTypeFiltered = (mapData.pokemons[key]['spawn_id'] !== null || mapData.pokemons[key]['pokestop_id'] !== null)
break
}
@@ -3339,7 +3339,7 @@ function clearStaleMarkers() {
isTemporaryHidden(mapData.pokemons[key]['pokemon_id']) ||
(pvpFiltered) ||
(ivFiltered) ||
- (spawnTypeFiltered) ||
+ (seenTypeFiltered) ||
(Store.get('showMissingIVOnly') === true && mapData.pokemons[key]['individual_attack'] !== null) ||
(Store.get('showBigKarp') === true && mapData.pokemons[key]['pokemon_id'] === 129 && (mapData.pokemons[key]['weight'] < 13.14 || mapData.pokemons[key]['weight'] === null)) ||
(Store.get('showTinyRat') === true && mapData.pokemons[key]['pokemon_id'] === 19 && (mapData.pokemons[key]['weight'] > 2.40 || mapData.pokemons[key]['weight'] === null)) ||
@@ -3482,7 +3482,7 @@ function loadRawData() {
var loadMinLevel = Store.get('remember_text_min_level')
var bigKarp = Boolean(Store.get('showBigKarp'))
var tinyRat = Boolean(Store.get('showTinyRat'))
- var spawnType = Store.get('showSpawnType')
+ var seenType = Store.get('showSeenType')
var despawnTimeType = Store.get('showDespawnTimeType')
var pokemonGender = Store.get('showPokemonGender')
var exEligible = Boolean(Store.get('exEligible'))
@@ -3559,7 +3559,7 @@ function loadRawData() {
'prevMinLevel': prevMinLevel,
'bigKarp': bigKarp,
'tinyRat': tinyRat,
- 'spawnType': spawnType,
+ 'seenType': seenType,
'despawnTimeType': despawnTimeType,
'pokemonGender': pokemonGender,
'swLat': swLat,
@@ -6919,8 +6919,8 @@ $(function () {
lastpokemon = false
updateMap()
})
- $('#spawn-type-select').on('change', function (e) {
- Store.set('showSpawnType', this.value)
+ $('#seen-type-select').on('change', function (e) {
+ Store.set('showSeenType', this.value)
lastpokemon = false
updateMap()
})
From 310642ebadb6ab97865ec8114f57645ad8eb1068 Mon Sep 17 00:00:00 2001
From: bradders <>
Date: Fri, 25 Feb 2022 10:34:41 +0000
Subject: [PATCH 16/19] Some QOL tweaks
Added: Ability to temporarily hide specific pokemon forms
Added: Ability to only show gyms that haven't been scanned in the past X hours
Added: Display multiple quest rewards on pokestop label
---
pre-index.php | 5 +++
static/js/map.js | 103 ++++++++++++++++++++++++++++++-----------------
2 files changed, 70 insertions(+), 38 deletions(-)
diff --git a/pre-index.php b/pre-index.php
index 32fa6b332..48a692a50 100644
--- a/pre-index.php
+++ b/pre-index.php
@@ -783,6 +783,11 @@
+
+
+
+
+
diff --git a/static/js/map.js b/static/js/map.js
index 5c3339577..5d25f4532 100644
--- a/static/js/map.js
+++ b/static/js/map.js
@@ -64,6 +64,7 @@ var prevMinIV = null
var prevMinLevel = null
var onlyPokemon = 0
var directionProvider
+var hidePokemonForms = []
var buffer = []
var reincludedPokemon = []
@@ -344,6 +345,11 @@ function notifyAboutPokemon(id) { // eslint-disable-line no-unused-vars
$('#notify-pokemon .pokemon-list .pokemon-icon-sprite[data-value="' + id + '"]').addClass('active')
}
+function hidePokemonForm(form) { // eslint-disable-line no-unused-vars
+ hidePokemonForms.push(form)
+ clearStaleMarkers()
+}
+
function removePokemonMarker(encounterId) { // eslint-disable-line no-unused-vars
if (mapData.pokemons[encounterId].marker.rangeCircle) {
markers.removeLayer(mapData.pokemons[encounterId].marker.rangeCircle)
@@ -1321,6 +1327,9 @@ function pokemonLabel(item) {
} else {
contentstring += '