fix : set play engine elo
This commit is contained in:
@@ -11,7 +11,7 @@ import { useMemo } from "react";
|
||||
import { useScreenSize } from "@/hooks/useScreenSize";
|
||||
import { Color } from "@/types/enums";
|
||||
import Board from "@/components/board";
|
||||
import { usePlayersData } from "@/hooks/usePlayerNames";
|
||||
import { usePlayersData } from "@/hooks/usePlayersData";
|
||||
|
||||
export default function BoardContainer() {
|
||||
const screenSize = useScreenSize();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { usePlayersData } from "@/hooks/usePlayerNames";
|
||||
import { usePlayersData } from "@/hooks/usePlayersData";
|
||||
import { Grid2 as Grid, Typography } from "@mui/material";
|
||||
import { gameAtom, gameEvalAtom } from "../../../states";
|
||||
import { MoveClassification } from "@/types/enums";
|
||||
|
||||
@@ -43,7 +43,11 @@ export default function LoadGame() {
|
||||
|
||||
resetAndSetGamePgn(gameFromUrl.pgn);
|
||||
setEval(gameFromUrl.eval);
|
||||
setBoardOrientation(true);
|
||||
setBoardOrientation(
|
||||
gameFromUrl.black.name === "You" && gameFromUrl.site === "Chesskit.org"
|
||||
? false
|
||||
: true
|
||||
);
|
||||
};
|
||||
|
||||
loadGame();
|
||||
|
||||
@@ -114,6 +114,7 @@ export default function EngineSettingsDialog({ open, onClose }: Props) {
|
||||
setValue={setMultiPv}
|
||||
min={2}
|
||||
max={6}
|
||||
marksFilter={1}
|
||||
size={6}
|
||||
/>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { useEngine } from "@/hooks/useEngine";
|
||||
import { uciMoveParams } from "@/lib/chess";
|
||||
import Board from "@/components/board";
|
||||
import { useGameData } from "@/hooks/useGameData";
|
||||
import { usePlayersData } from "@/hooks/usePlayerNames";
|
||||
import { usePlayersData } from "@/hooks/usePlayersData";
|
||||
|
||||
export default function BoardContainer() {
|
||||
const screenSize = useScreenSize();
|
||||
|
||||
@@ -55,10 +55,16 @@ export default function GameSettingsDialog({ open, onClose }: Props) {
|
||||
const handleGameStart = () => {
|
||||
onClose();
|
||||
resetGame({
|
||||
whiteName:
|
||||
playerColor === Color.White ? "You" : engineLabel[engineName].small,
|
||||
blackName:
|
||||
playerColor === Color.Black ? "You" : engineLabel[engineName].small,
|
||||
white: {
|
||||
name:
|
||||
playerColor === Color.White ? "You" : engineLabel[engineName].small,
|
||||
rating: playerColor === Color.White ? undefined : engineElo,
|
||||
},
|
||||
black: {
|
||||
name:
|
||||
playerColor === Color.Black ? "You" : engineLabel[engineName].small,
|
||||
rating: playerColor === Color.Black ? undefined : engineElo,
|
||||
},
|
||||
});
|
||||
playGameStartSound();
|
||||
setIsGameInProgress(true);
|
||||
@@ -129,9 +135,10 @@ export default function GameSettingsDialog({ open, onClose }: Props) {
|
||||
label="Bot Elo rating"
|
||||
value={engineElo}
|
||||
setValue={setEngineElo}
|
||||
min={100}
|
||||
max={3200}
|
||||
step={100}
|
||||
min={1320}
|
||||
max={3190}
|
||||
step={10}
|
||||
marksFilter={374}
|
||||
/>
|
||||
|
||||
<FormGroup>
|
||||
|
||||
@@ -7,6 +7,5 @@ export const gameAtom = atom(new Chess());
|
||||
export const gameDataAtom = atom<CurrentPosition>({});
|
||||
export const playerColorAtom = atom<Color>(Color.White);
|
||||
export const enginePlayNameAtom = atom<EngineName>(EngineName.Stockfish17Lite);
|
||||
export const engineSkillLevelAtom = atom<number>(1);
|
||||
export const engineEloAtom = atom<number>(1200);
|
||||
export const engineEloAtom = atom(1320);
|
||||
export const isGameInProgressAtom = atom(false);
|
||||
|
||||
Reference in New Issue
Block a user