Changed percentage data type
This commit is contained in:
parent
044a70fd6c
commit
260323b7d0
@ -38,7 +38,7 @@ export default function ScoreStats() {
|
|||||||
<div>
|
<div>
|
||||||
<p>Combo: {combo}</p>
|
<p>Combo: {combo}</p>
|
||||||
<p>
|
<p>
|
||||||
{getFormattedScorePercent(percentage)} {percentage}%
|
{getFormattedScorePercent(percentage)} {percentage.toFixed(2)}%
|
||||||
</p>
|
</p>
|
||||||
{currentPP !== undefined ? <p>{currentPP.toFixed(0)}pp</p> : null}
|
{currentPP !== undefined ? <p>{currentPP.toFixed(0)}pp</p> : null}
|
||||||
</div>
|
</div>
|
||||||
|
@ -83,7 +83,7 @@ const handlers: any = {
|
|||||||
const percent = relativeScore * 100;
|
const percent = relativeScore * 100;
|
||||||
|
|
||||||
state.setCurrentScore(finalScore);
|
state.setCurrentScore(finalScore);
|
||||||
state.setPercent(percent.toFixed(2));
|
state.setPercent(percent);
|
||||||
state.setPp(percent);
|
state.setPp(percent);
|
||||||
|
|
||||||
state.updateMapData(
|
state.updateMapData(
|
||||||
@ -133,7 +133,7 @@ const handlers: any = {
|
|||||||
const percent = relativeScore * 100;
|
const percent = relativeScore * 100;
|
||||||
|
|
||||||
state.setCurrentScore(finalScore);
|
state.setCurrentScore(finalScore);
|
||||||
state.setPercent(percent.toFixed(2));
|
state.setPercent(percent);
|
||||||
state.setCombo(data.status.performance.combo);
|
state.setCombo(data.status.performance.combo);
|
||||||
state.setPp(percent);
|
state.setPp(percent);
|
||||||
},
|
},
|
||||||
|
@ -20,7 +20,7 @@ interface SongDataState {
|
|||||||
failed: boolean;
|
failed: boolean;
|
||||||
currentSongTime: number;
|
currentSongTime: number;
|
||||||
currentScore: number;
|
currentScore: number;
|
||||||
percentage: string;
|
percentage: number;
|
||||||
combo: number;
|
combo: number;
|
||||||
currentPP: number | undefined;
|
currentPP: number | undefined;
|
||||||
saberA: {
|
saberA: {
|
||||||
@ -45,7 +45,7 @@ interface SongDataState {
|
|||||||
setFailed: (failed: boolean) => void;
|
setFailed: (failed: boolean) => void;
|
||||||
setPaused: (paused: boolean) => void;
|
setPaused: (paused: boolean) => void;
|
||||||
setCurrentScore: (score: number) => void;
|
setCurrentScore: (score: number) => void;
|
||||||
setPercent: (percent: string) => void;
|
setPercent: (percent: number) => void;
|
||||||
setCombo: (combo: number) => void;
|
setCombo: (combo: number) => void;
|
||||||
setPp: (percent: number) => void;
|
setPp: (percent: number) => void;
|
||||||
setInSong: (isInSong: boolean) => void;
|
setInSong: (isInSong: boolean) => void;
|
||||||
@ -68,7 +68,7 @@ export const useSongDataStore = create<SongDataState>()((set) => ({
|
|||||||
failed: false,
|
failed: false,
|
||||||
currentSongTime: 0,
|
currentSongTime: 0,
|
||||||
currentScore: 0,
|
currentScore: 0,
|
||||||
percentage: "100",
|
percentage: 100,
|
||||||
combo: 0,
|
combo: 0,
|
||||||
currentPP: undefined,
|
currentPP: undefined,
|
||||||
saberA: {
|
saberA: {
|
||||||
@ -132,7 +132,7 @@ export const useSongDataStore = create<SongDataState>()((set) => ({
|
|||||||
set({ currentScore: score });
|
set({ currentScore: score });
|
||||||
},
|
},
|
||||||
|
|
||||||
setPercent: (percent: string) => {
|
setPercent: (percent: number) => {
|
||||||
set({ percentage: percent });
|
set({ percentage: percent });
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ export const useSongDataStore = create<SongDataState>()((set) => ({
|
|||||||
failed: false,
|
failed: false,
|
||||||
currentSongTime: 0,
|
currentSongTime: 0,
|
||||||
currentScore: 0,
|
currentScore: 0,
|
||||||
percentage: "100",
|
percentage: 100,
|
||||||
combo: 0,
|
combo: 0,
|
||||||
currentPP: undefined,
|
currentPP: undefined,
|
||||||
saberA: {
|
saberA: {
|
||||||
|
Reference in New Issue
Block a user