From 8d2ecccfcf092fb8ab3b5056defdb874ab01640f Mon Sep 17 00:00:00 2001 From: Slushie Date: Wed, 30 Aug 2023 06:30:52 +0100 Subject: [PATCH] Splatfest Open/Pro/Tricolor split also fix breaking change to anarchy battles --- src/components/ScheduleBox.vue | 18 ----- src/components/TricolorBox.vue | 74 +++++++++++++++++++ src/components/concerns/scheduleTypes.mjs | 22 +++++- .../screenshots/ScreenshotScheduleBox.vue | 19 ----- .../screenshots/ScreenshotTricolorBox.vue | 69 +++++++++++++++++ src/stores/schedules.mjs | 19 +++-- src/stores/splatfests.mjs | 2 + src/views/HomeView.vue | 9 ++- src/views/screenshots/SchedulesView.vue | 9 ++- 9 files changed, 190 insertions(+), 51 deletions(-) create mode 100644 src/components/TricolorBox.vue create mode 100644 src/components/screenshots/ScreenshotTricolorBox.vue diff --git a/src/components/ScheduleBox.vue b/src/components/ScheduleBox.vue index 20bae40..c552724 100644 --- a/src/components/ScheduleBox.vue +++ b/src/components/ScheduleBox.vue @@ -48,21 +48,6 @@ img-class="rounded-r-xl" :stage="store.activeSchedule?.settings?.vsStages[1]" /> -
- - -
- -
-
@@ -90,7 +75,6 @@ diff --git a/src/components/TricolorBox.vue b/src/components/TricolorBox.vue new file mode 100644 index 0000000..6182288 --- /dev/null +++ b/src/components/TricolorBox.vue @@ -0,0 +1,74 @@ + + + + + diff --git a/src/components/concerns/scheduleTypes.mjs b/src/components/concerns/scheduleTypes.mjs index 8cc2f2b..38bc9c6 100644 --- a/src/components/concerns/scheduleTypes.mjs +++ b/src/components/concerns/scheduleTypes.mjs @@ -1,4 +1,4 @@ -import { useAnarchyOpenSchedulesStore, useAnarchySeriesSchedulesStore, useRegularSchedulesStore, useSplatfestSchedulesStore, useXSchedulesStore, useEventSchedulesStore } from '@/stores/schedules'; +import { useAnarchyOpenSchedulesStore, useAnarchySeriesSchedulesStore, useRegularSchedulesStore, useSplatfestOpenSchedulesStore, useSplatfestProSchedulesStore, useXSchedulesStore, useEventSchedulesStore } from '@/stores/schedules'; import battleRegularSvg from '@/assets/img/modes/regular.svg'; import battleBankaraSvg from '@/assets/img/modes/bankara.svg'; import battleXSvg from '@/assets/img/modes/x.svg'; @@ -35,10 +35,24 @@ export function useScheduleTypes() { img: battleXSvg, bg: 'bg-splatoon-battle-xmatch bg-tapes', }, - splatfest: { + splatfestOpen: { name: 'schedule.types.splatfest', - badge: null, - store: useSplatfestSchedulesStore(), + badge: 'schedule.types.open', + store: useSplatfestOpenSchedulesStore(), + img: battleRegularSvg, + bg: 'bg-splatoon-battle-regular bg-tapes', + }, + splatfestPro: { + name: 'schedule.types.splatfest', + badge: 'schedule.types.pro', + store: useSplatfestProSchedulesStore(), + img: battleRegularSvg, + bg: 'bg-splatoon-battle-regular bg-tapes', + }, + splatfestTricolor: { + name: 'schedule.types.splatfest', + badge: 'schedule.types.tricolor', + store: useSplatfestProSchedulesStore(), img: battleRegularSvg, bg: 'bg-splatoon-battle-regular bg-tapes', }, diff --git a/src/components/screenshots/ScreenshotScheduleBox.vue b/src/components/screenshots/ScreenshotScheduleBox.vue index babac1a..3c76cd5 100644 --- a/src/components/screenshots/ScreenshotScheduleBox.vue +++ b/src/components/screenshots/ScreenshotScheduleBox.vue @@ -41,23 +41,6 @@ :stage="store.activeSchedule.settings.vsStages[1]" text-size="text-xl" /> - -
- - -
- -
-
@@ -70,7 +53,6 @@ import { useUSSplatfestsStore } from '@/stores/splatfests'; import ProductContainer from '../ProductContainer.vue'; import StageImage from '../StageImage.vue'; import RuleIcon from '../RuleIcon.vue'; -import TricolorIcon from '../TricolorIcon.vue'; import { useScheduleTypes } from '@/components/concerns/scheduleTypes.mjs'; const props = defineProps({ @@ -84,7 +66,6 @@ const { types } = useScheduleTypes(); const type = computed(() => types[props.type]); const store = computed(() => type.value.store); -const tricolor = computed(() => useUSSplatfestsStore().tricolor); diff --git a/src/stores/schedules.mjs b/src/stores/schedules.mjs index e609505..57a353b 100644 --- a/src/stores/schedules.mjs +++ b/src/stores/schedules.mjs @@ -50,13 +50,13 @@ export const useRegularSchedulesStore = defineScheduleStore('regular', { // Anarchy Battle (Series) export const useAnarchySeriesSchedulesStore = defineScheduleStore('anarchy/series', { nodes: () => useSchedulesDataStore().data?.bankaraSchedules.nodes, - settings: node => node.bankaraMatchSettings?.find(s => s.mode === 'CHALLENGE'), + settings: node => node.bankaraMatchSettings?.find(s => s.bankaraMode === 'CHALLENGE'), }); // Anarchy Battle (Open) export const useAnarchyOpenSchedulesStore = defineScheduleStore('anarchy/open', { nodes: () => useSchedulesDataStore().data?.bankaraSchedules.nodes, - settings: node => node.bankaraMatchSettings?.find(s => s.mode === 'OPEN'), + settings: node => node.bankaraMatchSettings?.find(s => s.bankaraMode === 'OPEN'), }); // X Battle @@ -65,10 +65,16 @@ export const useXSchedulesStore = defineScheduleStore('xmatch', { settings: node => node.xMatchSetting, }); -// Splatfest Battle -export const useSplatfestSchedulesStore = defineScheduleStore('splatfest', { +// Splatfest Battle (Open) +export const useSplatfestOpenSchedulesStore = defineScheduleStore('splatfest/open', { nodes: () => useSchedulesDataStore().data?.festSchedules.nodes, - settings: node => node.festMatchSetting, + settings: node => node.festMatchSettings?.find(s => s.festMode === 'OPEN'), +}); + +// Splatfest Battle (Pro) +export const useSplatfestProSchedulesStore = defineScheduleStore('splatfest/pro', { + nodes: () => useSchedulesDataStore().data?.festSchedules.nodes, + settings: node => node.festMatchSettings?.find(s => s.festMode === 'CHALLENGE'), }); // Challenge Events @@ -124,7 +130,8 @@ if (import.meta.hot) { import.meta.hot.accept(acceptHMRUpdate(useAnarchySeriesSchedulesStore, import.meta.hot)); import.meta.hot.accept(acceptHMRUpdate(useAnarchyOpenSchedulesStore, import.meta.hot)); import.meta.hot.accept(acceptHMRUpdate(useXSchedulesStore, import.meta.hot)); - import.meta.hot.accept(acceptHMRUpdate(useSplatfestSchedulesStore, import.meta.hot)); + import.meta.hot.accept(acceptHMRUpdate(useSplatfestOpenSchedulesStore, import.meta.hot)); + import.meta.hot.accept(acceptHMRUpdate(useSplatfestProSchedulesStore, import.meta.hot)); import.meta.hot.accept(acceptHMRUpdate(useEventSchedulesStore, import.meta.hot)); import.meta.hot.accept(acceptHMRUpdate(useSalmonRunSchedulesStore, import.meta.hot)); import.meta.hot.accept(acceptHMRUpdate(useEggstraWorkSchedulesStore, import.meta.hot)); diff --git a/src/stores/splatfests.mjs b/src/stores/splatfests.mjs index 77f2586..4fc84f1 100644 --- a/src/stores/splatfests.mjs +++ b/src/stores/splatfests.mjs @@ -60,6 +60,8 @@ function defineSplatfestRegionStore(region) { return { ...fest, isTricolorActive: time.isActive(fest.midtermTime, fest.endTime), + startTime: fest.midtermTime, + endTime: fest.endTime, }; }); diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 83d1e06..fb42c89 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -4,8 +4,10 @@
diff --git a/src/views/screenshots/SchedulesView.vue b/src/views/screenshots/SchedulesView.vue index 90be6d2..154ec5d 100644 --- a/src/views/screenshots/SchedulesView.vue +++ b/src/views/screenshots/SchedulesView.vue @@ -1,14 +1,16 @@