Skip to content

Commit

Permalink
Merge branch 'main' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
maximvl committed Oct 3, 2024
2 parents b8c1aec + 6a5c476 commit 6df5819
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 2 deletions.
Binary file added src/assets/map/PlayerBlueDarkMoving.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/map/PlayerBlueLightMoving.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/map/PlayerBlueMoving.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/map/PlayerBrownMoving.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/map/PlayerGreenLightMoving.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/map/PlayerGreenMoving.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/map/PlayerOrangeMoving.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/map/PlayerPinkLightMoving.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/map/PlayerPinkMoving.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/map/PlayerRedMoving.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 29 additions & 2 deletions src/pages/map/components/PlayerIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ import PlayerOrange from 'assets/map/PlayerOrange.webp'
import PlayerPurple from 'assets/map/PlayerPurple.webp'
import PlayerPurpleMoving from 'assets/map/PlayerPurpleMoving.gif'

import PlayerPurpleMoving from 'assets/map/PlayerPurpleMoving.gif'
import PlayerOrangeMoving from 'assets/map/PlayerOrangeMoving.gif'
import PlayerPinkMoving from 'assets/map/PlayerPinkMoving.gif'
import PlayerPinkLightMoving from 'assets/map/PlayerPinkLightMoving.gif'
import PlayerRedMoving from 'assets/map/PlayerRedMoving.gif'
import PlayerBlueMoving from 'assets/map/PlayerBlueMoving.gif'
import PlayerBlueLightMoving from 'assets/map/PlayerBlueLightMoving.gif'
import PlayerBlueDarkMoving from 'assets/map/PlayerBlueDarkMoving.gif'
import PlayerGreenMoving from 'assets/map/PlayerGreenMoving.gif'
import PlayerGreenLightMoving from 'assets/map/PlayerGreenLightMoving.gif'
import PlayerBrownMoving from 'assets/map/PlayerBrownMoving.gif'

import { cellSize } from '../types'
import PlayerPopup from './PlayerPopup'
import { getMapCellById, laddersByCell, snakesByCell } from './utils'
Expand All @@ -33,6 +45,19 @@ const playerIcons: { [key: string]: string } = {
f1ashko: PlayerPinkLight,
}

const playerMovingIcons: { [key: string]: string } = {
lasqa: PlayerBlueMoving,
praden: PlayerBrownMoving,
roadhouse: PlayerPurpleMoving,
segall: PlayerOrangeMoving,
artur: PlayerRedMoving,
uselessmouth: PlayerPinkMoving,
unclobjorn: PlayerBlueDarkMoving,
melharucos: PlayerBlueLightMoving,
browjey: PlayerGreenMoving,
f1ashko: PlayerPinkLightMoving,
}

type Props = {
player: Player
players: Player[]
Expand Down Expand Up @@ -223,7 +248,9 @@ export default function PlayerIcon({

const onlineColor = player.is_online ? Color.green : Color.red
const playerColor = getPlayerColor(player)
const playerIcon = playerIcons[player.url_handle] || PlayerBlueLight
const playerIcon = isMoving
? playerMovingIcons[player.url_handle] || PlayerBlueLightMoving
: playerIcons[player.url_handle] || PlayerBlueLight

const hideAvatar =
playersOnSamePosition.length > 1 && player.map_position !== 0 && !isMoving
Expand Down Expand Up @@ -252,7 +279,7 @@ export default function PlayerIcon({
{!hideAvatar && (
<img
ref={iconRef}
src={isMoving ? PlayerPurpleMoving : playerIcon}
src={playerIcon}
width={'40px'}
alt=""
style={{ verticalAlign: 'middle' }}
Expand Down

0 comments on commit 6df5819

Please sign in to comment.