From e835d6116b1623b598a196e9b9501547775d2b07 Mon Sep 17 00:00:00 2001 From: notV4l Date: Wed, 29 May 2024 11:56:40 +0200 Subject: [PATCH] ui fixes --- web/src/components/layout/DrawerMenu.tsx | 2 +- web/src/components/map/Map.tsx | 8 ++++- web/src/components/map/Outline.tsx | 33 ++++++++++++------- .../components/player/ReputationIndicator.tsx | 24 +++++--------- web/src/pages/[gameId]/logs.tsx | 4 +-- web/src/pages/game/new.tsx | 2 +- 6 files changed, 42 insertions(+), 31 deletions(-) diff --git a/web/src/components/layout/DrawerMenu.tsx b/web/src/components/layout/DrawerMenu.tsx index 29532c9f2..8bb90adba 100644 --- a/web/src/components/layout/DrawerMenu.tsx +++ b/web/src/components/layout/DrawerMenu.tsx @@ -56,7 +56,7 @@ const DrawerMenu = () => { - Roll Your Own + diff --git a/web/src/components/map/Map.tsx b/web/src/components/map/Map.tsx index 111a4c181..ad4e22b92 100644 --- a/web/src/components/map/Map.tsx +++ b/web/src/components/map/Map.tsx @@ -2,7 +2,7 @@ import { useConfigStore, useGameStore } from "@/dojo/hooks"; import { Locations } from "@/dojo/types"; import { Flex, Image, useBreakpointValue } from "@chakra-ui/react"; import { motion, useAnimate } from "framer-motion"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { HitBox } from "./HitBox"; import { Outline } from "./Outline"; import { WantedMarkers } from "./WantedMarkers"; @@ -44,10 +44,15 @@ export const Map = ({ }) => { const [scope, animate] = useAnimate(); const isMobile = useBreakpointValue([true, false]); + const [isFirstTurn, setIsFirstTurn] = useState(false); const { game } = useGameStore(); const configStore = useConfigStore(); + useEffect(() => { + setIsFirstTurn(game?.player.turn === 0); + }, []); + useEffect(() => { if (targetId !== undefined) { const point = coordinate[targetId] ? coordinate[targetId] : { x: 0, y: 0 }; @@ -95,6 +100,7 @@ export const Map = ({ wantedCurrent={ current ? game.wanted.wantedByLocation.get(configStore.getLocationById(current)?.location) || 0 : 0 } + isFirstTurn={isFirstTurn} /> )} diff --git a/web/src/components/map/Outline.tsx b/web/src/components/map/Outline.tsx index a102da792..ed6c3b199 100644 --- a/web/src/components/map/Outline.tsx +++ b/web/src/components/map/Outline.tsx @@ -24,11 +24,13 @@ export const Outline = ({ current, wantedTarget, wantedCurrent, + isFirstTurn, }: { targetId?: Locations; current?: Locations; wantedTarget: number; wantedCurrent: number; + isFirstTurn: boolean; }) => { if (targetId === undefined) { return <>; @@ -44,7 +46,7 @@ export const Outline = ({ const fillColorTarget = wantedTarget > 68 ? colors.red : colors.neon[400]; const fillColorPath = wantedTarget > 68 ? colors.red : colors.yellow[400]; - + return ( <> - - - + {!isFirstTurn && ( + + + + )} { export const ReputationIndicator = ({ reputation, ...props }: { reputation: number } & StyleProps) => { return ( - - - - - - - - - - - + + + + + + + + + ); }; diff --git a/web/src/pages/[gameId]/logs.tsx b/web/src/pages/[gameId]/logs.tsx index 5912db6d0..3e69fb8ad 100644 --- a/web/src/pages/[gameId]/logs.tsx +++ b/web/src/pages/[gameId]/logs.tsx @@ -204,9 +204,9 @@ const CustomLeftPanel = () => { marginBottom={["30px", "50px"]} gap={0} > - + {/* {game ? reputationRanks[game.player.drugLevel as reputationRanksKeys] : ""} - + */} {shortString.decodeShortString(gameInfos?.player_name || "")} diff --git a/web/src/pages/game/new.tsx b/web/src/pages/game/new.tsx index 28147e1bb..9e692e22b 100644 --- a/web/src/pages/game/new.tsx +++ b/web/src/pages/game/new.tsx @@ -231,7 +231,7 @@ const New = observer(() => { /> - {/*!isRyoDotGame &&*/ !isMobile && season.paper_fee > 0 && ( + {/*!isRyoDotGame && !isMobile && */ season.paper_fee > 0 && (