Skip to content

Commit

Permalink
Merge pull request #973 from WatWowMap/spacial-rend-range
Browse files Browse the repository at this point in the history
feat: spacial rend range
  • Loading branch information
TurtIeSocks authored Mar 2, 2024
2 parents 2b5690a + 374c5eb commit 7da0eff
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/locales/lib/human/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,9 @@
"reset_options": "Optionen zurücksetzen",
"reset_menus": "Menüs zurücksetzen",
"reset_settings": "Einstellungen zurücksetzen",
"reset_general": "Allgemein",
"reset_general_title": "Allgemein",
"reset_assets": "Styles",
"reset_filters": "Filter",
"reset_filters_title": "Filter",
"reset_pokemon": "Pokémon zurücksetzen",
"reset_pokestops": "PokéStops zurücksetzen",
"reset_gyms": "Arenen zurücksetzen",
Expand Down
7 changes: 4 additions & 3 deletions packages/locales/lib/human/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,9 @@
"reset_options": "Reset Options",
"reset_menus": "Reset Menus",
"reset_settings": "Reset Settings",
"reset_general": "General",
"reset_general_title": "General",
"reset_filters_title": "Filters",
"reset_assets": "Assets",
"reset_filters": "Filters",
"reset_pokemon": "Reset Pokémon",
"reset_pokestops": "Reset PokéStops",
"reset_gyms": "Reset Gyms",
Expand All @@ -764,5 +764,6 @@
"reset_s2cells": "Reset S2 Cells",
"reset_spawnpoints": "Reset Spawnpoints",
"reset_submission_cells": "Reset Submission Cells",
"hisuian": "Hisuian"
"hisuian": "Hisuian",
"spacial_rend_range": "Spacial Rend Range"
}
1 change: 1 addition & 0 deletions server/src/configs/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
"linkGlobalAndAdvanced": false,
"showSizeIndicator": false,
"enablePokemonPopupCoords": false,
"spacialRendRange": false,
"glow": [
{
"name": "Hundo",
Expand Down
1 change: 1 addition & 0 deletions server/src/services/ui/clientOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function clientOptions(perms) {
levelCircles: { type: 'bool', perm: ['iv'] },
minLevelCircle: { type: 'number', perm: ['iv'] },
interactionRanges: { type: 'bool', perm: ['pokemon'] },
spacialRendRange: { type: 'bool', perm: ['pokemon'] },
showDexNumInPopup: { type: 'bool', perm: ['pokemon'] },
weatherIndicator: { type: 'bool', perm: ['pokemon'] },
pvpMega: { type: 'bool', perm: ['pvp'] },
Expand Down
12 changes: 10 additions & 2 deletions src/components/tiles/Pokemon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const PokemonTile = (pkmn) => {
showWeather,
showSize,
showInteractionRange,
showSpacialRendRange,
filterSize,
] = useStorage((s) => {
const {
Expand All @@ -65,6 +66,7 @@ const PokemonTile = (pkmn) => {
weatherIndicator,
showSizeIndicator,
interactionRanges,
spacialRendRange,
} = s.userSettings.pokemon
return [
pokemonTimers,
Expand All @@ -74,6 +76,7 @@ const PokemonTile = (pkmn) => {
!!(pkmn.weather && weatherIndicator),
showSizeIndicator && Number.isInteger(pkmn.size) && pkmn.size !== 3,
interactionRanges,
spacialRendRange,
s.filters.pokemon.filter[internalId]?.size || 'md',
]
}, basicEqualFn)
Expand Down Expand Up @@ -210,10 +213,15 @@ const PokemonTile = (pkmn) => {
</ToolTipWrapper>
)}
{showInteractionRange && configZoom && (
<Circle center={finalLocation} radius={40} color="#BA42F6" weight={1} />
)}
{showSpacialRendRange && configZoom && (
<Circle
center={finalLocation}
radius={40}
pathOptions={{ color: '#BA42F6', weight: 1 }}
radius={80}
color="#E3B3FB"
dashArray="5, 5"
weight={1}
/>
)}
</Marker>
Expand Down
2 changes: 1 addition & 1 deletion src/features/data/components/ResetFilters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function ResetFilters() {

return (
<ChildContainer>
<StyledSubHeader>{t('reset_filters')}</StyledSubHeader>
<StyledSubHeader>{t('reset_filters_title')}</StyledSubHeader>
{Object.keys(filters)
.filter((perm) => perms[perm])
.map((/** @type {import('@rm/types').Categories} */ key) => (
Expand Down
2 changes: 1 addition & 1 deletion src/features/data/components/ResetGeneral.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function ResetGeneral() {

return (
<ChildContainer>
<StyledSubHeader>{t('reset_general')}</StyledSubHeader>
<StyledSubHeader>{t('reset_general_title')}</StyledSubHeader>
<ButtonWithNotification
onClick={resetSettings}
label={t('reset_settings')}
Expand Down

0 comments on commit 7da0eff

Please sign in to comment.