Skip to content

Commit 58e27cc

Browse files
authored
Merge pull request #564 from WatWowMap/develop
Sync Develop with Main
2 parents 0fb44fc + 576f331 commit 58e27cc

File tree

18 files changed

+241
-107
lines changed

18 files changed

+241
-107
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactmap",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"description": "React based frontend map.",
55
"main": "ReactMap.mjs",
66
"author": "TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com>",

server/src/configs/custom-environment-variables.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -917,14 +917,6 @@
917917
"gymBadgeTableName": "DATABASE_SETTINGS_GYM_BADGE_TABLE_NAME",
918918
"sessionTableName": "DATABASE_SETTINGS_SESSION_TABLE_NAME",
919919
"migrationTableName": "DATABASE_SETTINGS_MIGRATION_TABLE_NAME",
920-
"joinGymBadgeTable": {
921-
"__name": "DATABASE_SETTINGS_JOIN_GYM_BADGE_TABLE",
922-
"__format": "boolean"
923-
},
924-
"hideOldQuests": {
925-
"__name": "DATABASE_SETTINGS_HIDE_OLD_QUESTS",
926-
"__format": "boolean"
927-
},
928920
"maxConnections": {
929921
"__name": "DATABASE_SETTINGS_MAX_CONNECTIONS",
930922
"__format": "number"

server/src/configs/default.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,6 @@
449449
"gymBadgeTableName": "gymBadges",
450450
"sessionTableName": "session",
451451
"migrationTableName": "knex_migrations",
452-
"joinGymBadgeTable": false,
453-
"hideOldQuests": false,
454452
"maxConnections": 10
455453
},
456454
"schemas": []

server/src/models/Pokestop.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const {
1111
stopValidDataLimit,
1212
hideOldPokestops,
1313
},
14-
database: { settings },
1514
map,
1615
} = require('../services/config')
1716

@@ -59,6 +58,7 @@ module.exports = class Pokestop extends Model {
5958
hasMultiInvasions,
6059
multiInvasionMs,
6160
hasRewardAmount,
61+
hasLayerColumn,
6262
},
6363
) {
6464
const {
@@ -74,7 +74,7 @@ module.exports = class Pokestop extends Model {
7474
ts,
7575
midnight: clientMidnight,
7676
} = args
77-
const midnight = settings.hideOldQuests ? clientMidnight || 0 : 0
77+
const midnight = clientMidnight || 0
7878
const safeTs = ts || Math.floor(new Date().getTime() / 1000)
7979

8080
const {
@@ -110,6 +110,9 @@ module.exports = class Pokestop extends Model {
110110
'incident_expire_timestamp',
111111
),
112112
])
113+
if (hasLayerColumn) {
114+
query.select('layer AS with_ar')
115+
}
113116
if (hideOldPokestops) {
114117
query.whereRaw(
115118
`UNIX_TIMESTAMP(last_updated) > ${
@@ -1109,7 +1112,7 @@ module.exports = class Pokestop extends Model {
11091112

11101113
static async searchQuests(perms, args, { isMad, hasAltQuests }, distance) {
11111114
const { search, onlyAreas = [], locale, midnight: clientMidnight } = args
1112-
const midnight = settings.hideOldQuests ? clientMidnight : 0
1115+
const midnight = clientMidnight || 0
11131116

11141117
const pokemonIds = Object.keys(Event.masterfile.pokemon).filter((pkmn) =>
11151118
i18next

server/src/services/DbCheck.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ module.exports = class DbCheck {
8585
'quest_reward_amount' in columns || isMad,
8686
'alternative_quest_type' in columns,
8787
])
88+
const [hasLayerColumn] = isMad
89+
? await schema('trs_quest')
90+
.columnInfo()
91+
.then((columns) => ['layer' in columns])
92+
: [false]
8893
const [hasMultiInvasions, multiInvasionMs] = await schema('incident')
8994
.columnInfo()
9095
.then((columns) => [
@@ -108,6 +113,7 @@ module.exports = class DbCheck {
108113
this.models[category][j].hasMultiInvasions = hasMultiInvasions
109114
this.models[category][j].multiInvasionMs = multiInvasionMs
110115
this.models[category][j].availableSlotsCol = availableSlotsCol
116+
this.models[category][j].hasLayerColumn = hasLayerColumn
111117
}
112118
})
113119
})

src/components/WebhookQuery.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function WebhookQuery({
3030
return data ? (
3131
<Container
3232
location={
33-
data[`${lowercase}Single`]
33+
data[`${lowercase}Single`]?.lat && data[`${lowercase}Single`]?.lon
3434
? [data[`${lowercase}Single`].lat, data[`${lowercase}Single`].lon]
3535
: location
3636
}

src/components/layout/dialogs/Search.jsx

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import {
1010
import { useTranslation } from 'react-i18next'
1111
import { useQuery } from '@apollo/client'
1212

13-
import Utility from '@services/Utility'
13+
import NameTT from '@components/popups/common/NameTT'
1414
import { useStore, useStatic } from '@hooks/useStore'
15+
import Utility from '@services/Utility'
1516
import Query from '@services/Query'
17+
1618
import Header from '../general/Header'
1719
import QuestTitle from '../general/QuestTitle'
1820

@@ -77,20 +79,28 @@ export default function Search({ safeSearch, toggleDialog, isMobile, Icons }) {
7779
} = option
7880
let main
7981
let amount = 0
82+
let tt = ''
8083
switch (quest_reward_type) {
8184
case 2:
8285
main = Icons.getRewards(quest_reward_type, quest_item_id, item_amount)
8386
amount = main.includes('_a') || item_amount <= 1 ? 0 : item_amount
87+
tt = `item_${quest_item_id}`
8488
break
8589
case 3:
90+
tt = `stardust`
8691
main = Icons.getRewards(quest_reward_type, stardust_amount)
8792
amount = main.includes('_a') ? 0 : stardust_amount
8893
break
8994
case 4:
95+
tt = `poke_${candy_pokemon_id}`
9096
main = Icons.getRewards(quest_reward_type, candy_pokemon_id)
9197
amount = main.includes('_a') ? 0 : candy_amount
9298
break
9399
case 7:
100+
tt = [
101+
quest_form_id ? `form_${quest_form_id}` : '',
102+
`poke_${quest_pokemon_id}`,
103+
]
94104
main = Icons.getPokemon(
95105
quest_pokemon_id,
96106
quest_form_id,
@@ -101,10 +111,12 @@ export default function Search({ safeSearch, toggleDialog, isMobile, Icons }) {
101111
)
102112
break
103113
case 9:
114+
tt = `poke_${xl_candy_pokemon_id}`
104115
main = Icons.getRewards(quest_reward_type, xl_candy_pokemon_id)
105116
amount = main.includes('_a') ? 0 : xl_candy_amount
106117
break
107118
case 12:
119+
tt = `poke_${mega_pokemon_id}`
108120
main = Icons.getRewards(
109121
quest_reward_type,
110122
mega_pokemon_id,
@@ -124,7 +136,13 @@ export default function Search({ safeSearch, toggleDialog, isMobile, Icons }) {
124136
position: 'relative',
125137
}}
126138
>
127-
<img src={main} style={{ maxWidth: 45, maxHeight: 45 }} alt={main} />
139+
<NameTT id={tt}>
140+
<img
141+
src={main}
142+
style={{ maxWidth: 45, maxHeight: 45 }}
143+
alt={main}
144+
/>
145+
</NameTT>
128146
{Boolean(
129147
main.includes('stardust')
130148
? !main.endsWith('0.png')
@@ -141,25 +159,40 @@ export default function Search({ safeSearch, toggleDialog, isMobile, Icons }) {
141159
raid_pokemon_evolution,
142160
} = option
143161
return (
144-
<img
145-
src={Icons.getPokemon(
146-
raid_pokemon_id,
147-
raid_pokemon_form,
148-
raid_pokemon_evolution,
149-
raid_pokemon_gender,
150-
raid_pokemon_costume,
151-
)}
152-
alt={raid_pokemon_id}
153-
style={{ maxWidth: 45, maxHeight: 45 }}
154-
/>
162+
<NameTT
163+
id={[
164+
raid_pokemon_form ? `form_${raid_pokemon_form}` : '',
165+
raid_pokemon_evolution ? `evo_${raid_pokemon_evolution}` : '',
166+
`poke_${raid_pokemon_id}`,
167+
]}
168+
>
169+
<img
170+
src={Icons.getPokemon(
171+
raid_pokemon_id,
172+
raid_pokemon_form,
173+
raid_pokemon_evolution,
174+
raid_pokemon_gender,
175+
raid_pokemon_costume,
176+
)}
177+
alt={raid_pokemon_id}
178+
style={{ maxWidth: 45, maxHeight: 45 }}
179+
/>
180+
</NameTT>
155181
)
156182
}
157183
return (
158-
<img
159-
src={Icons.getPokemon(nest_pokemon_id, nest_pokemon_form)}
160-
alt={nest_pokemon_form}
161-
style={{ maxWidth: 45, maxHeight: 45 }}
162-
/>
184+
<NameTT
185+
id={[
186+
nest_pokemon_form ? `form_${nest_pokemon_form}` : '',
187+
`poke_${nest_pokemon_id}`,
188+
]}
189+
>
190+
<img
191+
src={Icons.getPokemon(nest_pokemon_id, nest_pokemon_form)}
192+
alt={nest_pokemon_form}
193+
style={{ maxWidth: 45, maxHeight: 45 }}
194+
/>
195+
</NameTT>
163196
)
164197
}
165198

src/components/markers/pokemon.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ export const fancyMarker = (
5050
width: size,
5151
}}
5252
/>
53+
{pkmn.seen_type === 'nearby_cell' && (
54+
<img
55+
src={Icons.getMisc('grass')}
56+
alt="nearby_cell"
57+
style={{
58+
width: size / 1.5,
59+
height: 'auto',
60+
bottom: (-size / 5) * pokemonMod.offsetY,
61+
left: `10%`,
62+
}}
63+
/>
64+
)}
5365
{badge && (
5466
<img
5567
src={Icons.getMisc(badge)}

src/components/markers/s2cell.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/components/markers/scanCell.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default function scanCellMarker(ago) {
2+
const value = ago <= 1050 ? 0 : Math.min((ago - 1050) / 750, 1)
3+
const hue = ((1 - value) * 120).toString(10)
4+
5+
return {
6+
fillColor: ['hsl(', hue, ',100%, 50%)'].join(''),
7+
color: 'black',
8+
opacity: 0.75,
9+
fillOpacity: 0.5,
10+
weight: 0.5,
11+
}
12+
}

0 commit comments

Comments
 (0)