From babfa22ff8cbcc862f8cdbce78702a53c96295f6 Mon Sep 17 00:00:00 2001 From: Liam <67254223+RealFascinated@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:25:48 +0100 Subject: [PATCH] Fixed post swing values, requires HttpSiraStatus update --- pages/overlay.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pages/overlay.js b/pages/overlay.js index 90117f7..d9cfb5c 100644 --- a/pages/overlay.js +++ b/pages/overlay.js @@ -24,7 +24,7 @@ export default class Overlay extends Component { showPlayerStats: true, showScore: false, showSongInfo: false, - textColor: undefined, + textColor: undefined, socket: undefined, isVisible: false, @@ -248,6 +248,8 @@ export default class Overlay extends Component { "noteFullyCut": (data) => { const { noteCut } = data; + console.log(noteCut) + // Left Saber if (noteCut.saberType === 'SaberA') { const data = this.state.leftHand; @@ -260,8 +262,8 @@ export default class Overlay extends Component { if (data.averagePostSwing.includes(30) && data.averagePostSwing.length === 1) { data.averagePostSwing = []; } - data.averagePreSwing.push(noteCut.initialScore > 70 ? 70 : noteCut.initialScore); - data.averagePostSwing.push(noteCut.finalScore - noteCut.initialScore); + data.averagePreSwing.push(noteCut.beforeSwingRating * 70); + data.averagePostSwing.push(noteCut.afterSwingRating * 30); data.averageCut.push(noteCut.cutDistanceScore); this.setState({ leftHand: data }); } @@ -278,8 +280,8 @@ export default class Overlay extends Component { if (data.averagePostSwing.includes(30) && data.averagePostSwing.length === 1) { data.averagePostSwing = []; } - data.averagePreSwing.push(noteCut.initialScore > 70 ? 70 : noteCut.initialScore); - data.averagePostSwing.push(noteCut.finalScore - noteCut.initialScore); + data.averagePreSwing.push(noteCut.beforeSwingRating * 70); + data.averagePostSwing.push(noteCut.afterSwingRating * 30); data.averageCut.push(noteCut.cutDistanceScore); this.setState({ rightHand: data }); }