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 2, 2024
2 parents e79aab2 + ef7f416 commit 6bbbb31
Show file tree
Hide file tree
Showing 23 changed files with 33 additions and 30 deletions.
Binary file removed src/assets/map/Figure_Blue.png
Binary file not shown.
Binary file removed src/assets/map/Figure_Copper.png
Binary file not shown.
Binary file removed src/assets/map/Figure_Green.png
Binary file not shown.
Binary file removed src/assets/map/Figure_LightGreen.png
Binary file not shown.
Binary file removed src/assets/map/Figure_LightSalad.png
Binary file not shown.
Binary file removed src/assets/map/Figure_Pink.png
Binary file not shown.
Binary file removed src/assets/map/Figure_Purple.png
Binary file not shown.
Binary file removed src/assets/map/Figure_Red.png
Binary file not shown.
Binary file removed src/assets/map/Figure_Salad.png
Binary file not shown.
Binary file removed src/assets/map/Figure_Yellow.png
Binary file not shown.
Binary file added src/assets/map/PlayerBlue.webp
Binary file not shown.
Binary file added src/assets/map/PlayerBlueDark.webp
Binary file not shown.
Binary file added src/assets/map/PlayerBlueLight.webp
Binary file not shown.
Binary file added src/assets/map/PlayerBrown.webp
Binary file not shown.
Binary file added src/assets/map/PlayerGreen.webp
Binary file not shown.
Binary file added src/assets/map/PlayerGreenLight.webp
Binary file not shown.
Binary file added src/assets/map/PlayerOrange.webp
Binary file not shown.
Binary file added src/assets/map/PlayerPink.webp
Binary file not shown.
Binary file added src/assets/map/PlayerPinkLight.webp
Binary file not shown.
Binary file added src/assets/map/PlayerPurple.webp
Binary file not shown.
Binary file added src/assets/map/PlayerRed.webp
Binary file not shown.
41 changes: 22 additions & 19 deletions src/pages/map/components/PlayerIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,33 @@ import { Box } from '@mui/material'
import { animated, useSpring } from '@react-spring/web'
import { useEffect, useRef, useState } from 'react'
import { getPlayerColor, Player } from 'utils/types'
import FigureCopper from 'assets/map/Figure_Copper.png'
import FigureBlue from 'assets/map/Figure_Blue.png'
import FigureGreen from 'assets/map/Figure_Green.png'
import FigureRed from 'assets/map/Figure_Red.png'
import FigurePink from 'assets/map/Figure_Pink.png'
import FigurePurple from 'assets/map/Figure_Purple.png'
import FigureLightGreen from 'assets/map/Figure_LightGreen.png'
import FigureSalad from 'assets/map/Figure_Salad.png'
import FigureLightSalad from 'assets/map/Figure_LightSalad.png'
import PlayerGreen from 'assets/map/PlayerGreen.webp'
import PlayerGreenLight from 'assets/map/PlayerGreenLight.webp'
import PlayerRed from 'assets/map/PlayerRed.webp'
import PlayerBlue from 'assets/map/PlayerBlue.webp'
import PlayerBlueLight from 'assets/map/PlayerBlueLight.webp'
import PlayerBlueDark from 'assets/map/PlayerBlueDark.webp'
import PlayerBrown from 'assets/map/PlayerBrown.webp'
import PlayerPink from 'assets/map/PlayerPink.webp'
import PlayerPinkLight from 'assets/map/PlayerPinkLight.webp'
import PlayerOrange from 'assets/map/PlayerOrange.webp'
import PlayerPurple from 'assets/map/PlayerPurple.webp'

import { cellSize } from '../types'
import PlayerPopup from './PlayerPopup'
import { getMapCellById, laddersByCell, snakesByCell } from './utils'

const playerIcons: { [key: string]: string } = {
lasqa: FigurePurple,
roadhouse: FigureCopper,
segall: FigureBlue,
artur: FigureRed,
uselessmouth: FigurePink,
unclobjorn: FigureSalad,
melharucos: FigureLightSalad,
browjey: FigureLightGreen,
f1ashko: FigureGreen,
lasqa: PlayerBlue,
praden: PlayerBrown,
roadhouse: PlayerPurple,
segall: PlayerOrange,
artur: PlayerRed,
uselessmouth: PlayerPink,
unclobjorn: PlayerBlueDark,
melharucos: PlayerBlueLight,
browjey: PlayerGreen,
f1ashko: PlayerPinkLight,
}

type Props = {
Expand Down Expand Up @@ -209,7 +212,7 @@ export default function PlayerIcon({

const onlineColor = player.is_online ? 'green' : 'red'
const playerColor = getPlayerColor(player)
const playerIcon = playerIcons[player.url_handle] || FigureCopper
const playerIcon = playerIcons[player.url_handle] || PlayerBlueLight

const hideAvatar =
playersOnSamePosition.length > 1 &&
Expand Down
22 changes: 11 additions & 11 deletions src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,31 +103,31 @@ export type CustomColorOverrides = {
}

export const ColorByUrlHandle: { [key: string]: string } = {
lasqa: Color.purple,
segall: Color.blue,
lasqa: Color.blue,
segall: Color.orange,
praden: Color.brown,
artur: Color.red,
uselessmouth: Color.pink,
roadhouse: Color.orange,
roadhouse: Color.purple,
unclobjorn: Color.blueDark,
melharucos: Color.blueLight,
browjey: Color.greenLight,
f1ashko: Color.green,
browjey: Color.green,
f1ashko: Color.pinkLight,
}

export const ColorNameByUrlHandle: {
[key: string]: CustomColorNames
} = {
lasqa: 'customPurple',
segall: 'customBlue',
lasqa: 'customBlue',
praden: 'customBrown',
roadhouse: 'customPurple',
segall: 'customOrange',
artur: 'customRed',
uselessmouth: 'customBlueDark',
roadhouse: 'customOrange',
uselessmouth: 'customPink',
unclobjorn: 'customBlueDark',
melharucos: 'customBlueLight',
browjey: 'customGreenLight',
f1ashko: 'customGreen',
browjey: 'customGreen',
f1ashko: 'customPinkLight',
}

export function getPlayerColor(player: Player): string {
Expand Down

0 comments on commit 6bbbb31

Please sign in to comment.