Skip to content

Commit

Permalink
fix: battleOpacity => stationsOpacity
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Sep 10, 2024
1 parent cd32477 commit f720aa3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
"stations": {
"clustering": true,
"stationTimers": false,
"battleOpacity": true,
"stationsOpacity": true,
"enableStationPopupCoords": false,
"opacityTenMinutes": 0.75,
"opacityFiveMinutes": 0.5,
Expand Down
2 changes: 1 addition & 1 deletion packages/locales/lib/human/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@
"ended": "Ended",
"global_search_stations": "Search Power Spots",
"station_timers": "Power Spot Timers",
"station_opacity": "Power Spot Opacity",
"stations_opacity": "Dynamic Power Spot Opacity",
"max_battles": "Max Battles",
"dynamax": "Dynamax",
"stations_subtitle": "Displays Power Spots on the map",
Expand Down
2 changes: 1 addition & 1 deletion server/src/ui/clientOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function clientOptions(perms) {
stations: {
clustering: { type: 'bool', perm: ['stations', 'dynamax'] },
stationTimers: { type: 'bool', perm: ['stations', 'dynamax'] },
stationOpacity: { type: 'bool', perm: ['stations', 'dynamax'] },
stationsOpacity: { type: 'bool', perm: ['stations', 'dynamax'] },
opacityTenMinutes: { type: 'number', perm: ['stations', 'dynamax'] },
opacityFiveMinutes: { type: 'number', perm: ['stations', 'dynamax'] },
opacityOneMinute: { type: 'number', perm: ['stations', 'dynamax'] },
Expand Down
6 changes: 4 additions & 2 deletions src/features/station/useStationMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function useStationMarker({
battle_pokemon_id,
is_battle_available,
start_time,
end_time,
}) {
const [, Icons] = useStorage(
(s) => [s.icons, useMemory.getState().Icons],
Expand All @@ -44,7 +45,7 @@ export function useStationMarker({
]
}, basicEqualFn)
const [stationMod, battleMod] = Icons.getModifiers('station', 'dynamax')
const getOpacity = useOpacity('station')
const opacity = useOpacity('stations')(end_time)

return divIcon({
popupAnchor: [
Expand All @@ -63,6 +64,7 @@ export function useStationMarker({
style="
width: ${baseSize}px;
height: ${baseSize}px;
opacity: ${opacity};
bottom: ${2 + stationMod.offsetY}px;
left: ${stationMod.offsetX * 50}%;
transform: translateX(-50%);
Expand All @@ -75,7 +77,7 @@ export function useStationMarker({
src="${battleIcon}"
alt="${battleIcon}"
style="
opacity: ${getOpacity(0)};
opacity: ${opacity};
width: ${battleSize}px;
height: ${battleSize}px;
bottom: ${baseSize * 0.8 * battleMod.offsetY}px;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useOpacity.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useStorage } from '@store/useStorage'

/**
* Returns dynamic opacity based on timestamp
* @template {'pokemon' | 'gyms' | 'pokestops' | 'station'} T
* @template {'pokemon' | 'gyms' | 'pokestops' | 'stations'} T
* @param {T} category
* @param {T extends 'pokestops' ? 'invasion' : T extends 'gyms' ? 'raid' : never} [subCategory]
* @returns
Expand Down

0 comments on commit f720aa3

Please sign in to comment.