Add cut stats toggle

This commit is contained in:
Liam 2022-10-30 14:51:42 +00:00
parent a9a15a9bae
commit 4af129ea20
3 changed files with 14 additions and 2 deletions

@ -3,7 +3,7 @@ import { useSongDataStore } from "../store/songDataStore";
import styles from "../styles/cutStats.module.css"; import styles from "../styles/cutStats.module.css";
export default function CutStats() { export default function CutStats() {
const [showScoreInfo] = useSettingsStore((store) => [store.showScoreInfo]); const [showCutStats] = useSettingsStore((store) => [store.showCutStats]);
const [saberA, saberB, isLoading] = useSongDataStore((store) => [ const [saberA, saberB, isLoading] = useSongDataStore((store) => [
store.saberA, store.saberA,
store.saberB, store.saberB,
@ -14,7 +14,7 @@ export default function CutStats() {
return null; return null;
} }
if (!showScoreInfo) { if (!showCutStats) {
return null; return null;
} }

@ -41,6 +41,7 @@ export default class Home extends Component {
showPlayerStats: true, showPlayerStats: true,
showScoreInfo: false, showScoreInfo: false,
showSongInfo: false, showSongInfo: false,
showCutStats: false,
shouldReplacePlayerInfoWithScore: false, shouldReplacePlayerInfoWithScore: false,
}, },
}; };
@ -286,6 +287,15 @@ export default class Home extends Component {
size="md" size="md"
/> />
<Spacer y={1.2} /> <Spacer y={1.2} />
<Text>Show cut stats (Average cut)</Text>
<Switch
onChange={(event) =>
this.updateValue("showCutStats", event.target.checked)
}
checked={this.state.values.showCutStats}
size="md"
/>
<Spacer y={1.2} />
<Text> <Text>
Replace Player info with Song info when a song starts (Show Replace Player info with Song info when a song starts (Show
song info Required) song info Required)

@ -9,6 +9,7 @@ interface SettingsState {
showPlayerStats: boolean; showPlayerStats: boolean;
showScoreInfo: boolean; showScoreInfo: boolean;
showSongInfo: boolean; showSongInfo: boolean;
showCutStats: boolean;
shouldReplacePlayerInfoWithScore: boolean; shouldReplacePlayerInfoWithScore: boolean;
setMounted: (isMounted: boolean) => void; setMounted: (isMounted: boolean) => void;
setOverlaySettings: (params: string) => void; setOverlaySettings: (params: string) => void;
@ -22,6 +23,7 @@ export const useSettingsStore = create<SettingsState>()((set) => ({
showPlayerStats: true, showPlayerStats: true,
showScoreInfo: false, showScoreInfo: false,
showSongInfo: false, showSongInfo: false,
showCutStats: false,
shouldReplacePlayerInfoWithScore: false, shouldReplacePlayerInfoWithScore: false,
setMounted: (isMounted: boolean) => set(() => ({ mounted: isMounted })), setMounted: (isMounted: boolean) => set(() => ({ mounted: isMounted })),