fixed pp not showing frfr
This commit is contained in:
parent
21bc9287ee
commit
a827fcbbd8
@ -59,7 +59,7 @@ interface SongDataState {
|
|||||||
setCurrentScore: (score: number) => void;
|
setCurrentScore: (score: number) => void;
|
||||||
setPercent: (percent: number) => void;
|
setPercent: (percent: number) => void;
|
||||||
setCombo: (combo: number) => void;
|
setCombo: (combo: number) => void;
|
||||||
setPp: (percent: number) => void;
|
setPp: (percent: number, attempt?: number) => void;
|
||||||
setInSong: (isInSong: boolean) => void;
|
setInSong: (isInSong: boolean) => void;
|
||||||
setSaberData: (saberType: string, cutData: any) => void;
|
setSaberData: (saberType: string, cutData: any) => void;
|
||||||
setModifiers: (modifiers: Map<string, object>) => void;
|
setModifiers: (modifiers: Map<string, object>) => void;
|
||||||
@ -185,6 +185,16 @@ export const useSongDataStore = create<SongDataState>()((set) => ({
|
|||||||
},
|
},
|
||||||
|
|
||||||
setPp: (percent: number) => {
|
setPp: (percent: number) => {
|
||||||
|
const leaderboardData = useSongDataStore.getState().mapLeaderboardData;
|
||||||
|
if (
|
||||||
|
leaderboardData.beatleader.stars == undefined ||
|
||||||
|
leaderboardData.scoresaber.stars == undefined
|
||||||
|
) {
|
||||||
|
setTimeout(() => {
|
||||||
|
useSongDataStore.getState().setPp(percent);
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
|
||||||
const scoreSaberMapStarCount =
|
const scoreSaberMapStarCount =
|
||||||
useSongDataStore.getState().mapLeaderboardData.scoresaber.stars;
|
useSongDataStore.getState().mapLeaderboardData.scoresaber.stars;
|
||||||
let scoreSaberPP = Utils.calculatePP(
|
let scoreSaberPP = Utils.calculatePP(
|
||||||
@ -204,7 +214,6 @@ export const useSongDataStore = create<SongDataState>()((set) => ({
|
|||||||
const lastSSPP = useSongDataStore.getState().currentPP?.scoreSaber;
|
const lastSSPP = useSongDataStore.getState().currentPP?.scoreSaber;
|
||||||
const lastBLPP = useSongDataStore.getState().currentPP?.beatLeader;
|
const lastBLPP = useSongDataStore.getState().currentPP?.beatLeader;
|
||||||
|
|
||||||
// undefined is returned if the curve ate shit (BL one does that if the current % is too high).
|
|
||||||
set({
|
set({
|
||||||
currentPP: {
|
currentPP: {
|
||||||
beatLeader: beatLeaderPP == undefined ? lastBLPP : beatLeaderPP,
|
beatLeader: beatLeaderPP == undefined ? lastBLPP : beatLeaderPP,
|
||||||
|
Reference in New Issue
Block a user