Skip to content

Commit

Permalink
WIP small mark adjustments for ruleset version
Browse files Browse the repository at this point in the history
  • Loading branch information
swantzter committed Oct 27, 2024
1 parent 0a97b31 commit 4af86fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
14 changes: 3 additions & 11 deletions src/views/scoring/[email protected]/DDDifficulty.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
single-row
:disabled="!!scoresheet?.completedAt || modDisabled"
class="col-start-3 row-start-4"
@click="addMod('Minus')"
@click="addMark({ schema: 'diffMinus' })"
/>
<score-button
v-if="hasBreaks"
Expand All @@ -72,7 +72,7 @@
single-row
:disabled="!!scoresheet?.completedAt || modDisabled"
class="col-start-2 row-start-4"
@click="addMod('Plus')"
@click="addMark({ schema: 'diffPlus' })"
/>
</main>
</template>
Expand All @@ -86,7 +86,7 @@ import type { Model } from '../../../models'
import type { PropType } from 'vue'
type DiffBaseSchema = `diffL${1 | 2 | 3 | 4 | 5}`
export type Schema = 'break' | `${DiffBaseSchema}${'Plus' | 'Minus' | ''}`
export type Schema = 'break' | 'diffPlus' | 'diffMinus' | DiffBaseSchema
defineProps({
model: {
Expand Down Expand Up @@ -118,14 +118,6 @@ const levels = computed(() => ([5, 4, 3, 2, 1] as const).map<Array<[Schema, numb
[`diffL${l}Minus`, l - 0.25],
]).flat(1))
async function addMod (type: 'Plus' | 'Minus') {
const prevMark = scoresheet.value?.marks.at(-1)
if (isDiffBaseSchema(prevMark?.schema)) {
await addMark({ schema: 'undo', target: prevMark.sequence })
await addMark({ schema: `${prevMark.schema}${type}` })
}
}
const result = computed(() => {
let score = 0
if (judgeType.value === 'Dj') {
Expand Down
18 changes: 9 additions & 9 deletions src/views/scoring/[email protected]/Presentation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
label="Repetitive -"
class="row-start-6"
color="red"
:value="tally('varietyMinus')"
:value="tally('variMinus')"
:disabled="!!scoresheet?.completedAt"
@click="addMark({ schema: 'varietyMinus' })"
@click="addMark({ schema: 'variMinus' })"
/>
<score-button
Expand Down Expand Up @@ -75,9 +75,9 @@
<score-button
label="Variety +"
class="row-start-6 col-start-3"
:value="tally('varietyPlus')"
:value="tally('variPlus')"
:disabled="!!scoresheet?.completedAt"
@click="addMark({ schema: 'varietyPlus' })"
@click="addMark({ schema: 'variPlus' })"
/>
<score-button
Expand Down Expand Up @@ -142,7 +142,7 @@
class="row-start-6"
color="red"
:disabled="!!scoresheet?.completedAt"
@click="addMark({ schema: 'varietyMinusAdj' })"
@click="addMark({ schema: 'variMinusAdj' })"
/>
<div
Expand Down Expand Up @@ -187,7 +187,7 @@
label="Variety +"
class="row-start-6 col-start-4"
:disabled="!!scoresheet?.completedAt"
@click="addMark({ schema: 'varietyPlusAdj' })"
@click="addMark({ schema: 'variPlusAdj' })"
/>
</main>
</template>
Expand All @@ -200,7 +200,7 @@ import { computed, type PropType } from 'vue'
import type { Model } from '../../../models'
import { clamp } from '@vueuse/core'
const components = ['crea', 'music', 'ent', 'form', 'variety'] as const
const components = ['crea', 'music', 'ent', 'form', 'vari'] as const
type Component = typeof components[number]
export type Schema = 'miss' | `${Component}${'Plus' | 'Minus'}${'' | 'Adj'}`
Expand Down Expand Up @@ -242,7 +242,7 @@ const weights = {
form: 0.25,
music: 0.2,
crea: 0.15,
variety: 0.15
vari: 0.15
}
const result = computed(() => {
Expand All @@ -251,7 +251,7 @@ const result = computed(() => {
form: componentScore('form'),
ent: componentScore('ent'),
crea: componentScore('crea'),
variety: componentScore('variety')
vari: componentScore('vari')
}
let sum = 0
Expand Down

0 comments on commit 4af86fb

Please sign in to comment.