forked from FoundKeyGang/FoundKey
fix: volume sliders
Fixed a typo that made a required property be undefined. Also reduced code duplication. Fixes FoundKeyGang/FoundKey#18
This commit is contained in:
parent
a12acf53ef
commit
9c411d181a
1 changed files with 5 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="_formRoot">
|
<div class="_formRoot">
|
||||||
<FormRange v-model="masterVolume" :min="0" :max="1" :step="0.05" :text-converter="(v) => `${Math.floor(v * 100)}%`" class="_formBlock">
|
<FormRange v-model="masterVolume" :min="0" :max="1" :step="0.05" :text-converter="textConverter" class="_formBlock">
|
||||||
<template #label>{{ i18n.ts.masterVolume }}</template>
|
<template #label>{{ i18n.ts.masterVolume }}</template>
|
||||||
</FormRange>
|
</FormRange>
|
||||||
|
|
||||||
|
@ -77,6 +77,8 @@ const soundsTypes = [
|
||||||
'noizenecio/kick_gaba2',
|
'noizenecio/kick_gaba2',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const textConverter = (v) => `${Math.floor(v * 100)}%`;
|
||||||
|
|
||||||
async function edit(type) {
|
async function edit(type) {
|
||||||
const { canceled, result } = await os.form(i18n.t('_sfx.' + type), {
|
const { canceled, result } = await os.form(i18n.t('_sfx.' + type), {
|
||||||
type: {
|
type: {
|
||||||
|
@ -90,10 +92,10 @@ async function edit(type) {
|
||||||
},
|
},
|
||||||
volume: {
|
volume: {
|
||||||
type: 'range',
|
type: 'range',
|
||||||
mim: 0,
|
min: 0,
|
||||||
max: 1,
|
max: 1,
|
||||||
step: 0.05,
|
step: 0.05,
|
||||||
textConverter: (v) => `${Math.floor(v * 100)}%`,
|
textConverter,
|
||||||
label: i18n.ts.volume,
|
label: i18n.ts.volume,
|
||||||
default: sounds.value[type].volume,
|
default: sounds.value[type].volume,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue