2022-04-08 16:29:24 +09:00
|
|
|
<template>
|
|
|
|
<div id="config">
|
2022-12-17 08:54:58 +09:00
|
|
|
<section class="appearance">
|
|
|
|
<h3>{{ l.h3 }}</h3>
|
2023-01-29 04:39:18 +09:00
|
|
|
<TextConfig v-model="textConfig" />
|
2022-04-08 16:29:24 +09:00
|
|
|
</section>
|
|
|
|
<section class="freeze">
|
2022-12-17 08:54:58 +09:00
|
|
|
<h3>{{ l.freeze.h3 }}</h3>
|
2022-04-22 19:23:15 +09:00
|
|
|
<div>
|
2022-12-17 08:54:58 +09:00
|
|
|
{{ l.freeze.duration }}<input type="number" min="0" max="32767" v-model="freezeDuration" />
|
|
|
|
{{ l.freeze.frame }} = {{ ((freezeDuration * 1001) / 30000).toFixed(2) }} {{ l.freeze.sec }}
|
2022-04-22 19:23:15 +09:00
|
|
|
</div>
|
2022-04-08 16:29:24 +09:00
|
|
|
<table>
|
|
|
|
<tbody>
|
|
|
|
<tr v-for="key in freezeKeys" :key="key">
|
2022-12-17 08:54:58 +09:00
|
|
|
<td>{{ l.freeze.rows[key] }}</td>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" :checked="freeze[key]" @change="onChangeFreeze($event, key)" />
|
|
|
|
</td>
|
2022-04-08 16:29:24 +09:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-01-29 04:39:18 +09:00
|
|
|
import { defaultConfig, lskey, getConfig, getPreviewText, codes, statusKeys } from './codegen.js';
|
2023-02-01 02:49:55 +09:00
|
|
|
import { makeUpdateConfig } from '../utils';
|
2022-04-08 16:29:24 +09:00
|
|
|
import labels from './labels.json';
|
2022-10-15 19:31:18 +09:00
|
|
|
import TextConfig from '../TextConfig.vue';
|
2022-04-08 16:29:24 +09:00
|
|
|
|
2023-01-29 04:39:18 +09:00
|
|
|
const updateConfig = makeUpdateConfig(lskey, defaultConfig, getPreviewText);
|
2022-04-08 16:29:24 +09:00
|
|
|
export default {
|
2022-10-15 19:31:18 +09:00
|
|
|
components: {
|
|
|
|
TextConfig,
|
|
|
|
},
|
2022-04-08 16:29:24 +09:00
|
|
|
props: {
|
2022-12-17 08:54:58 +09:00
|
|
|
version: { type: String },
|
2022-04-08 16:29:24 +09:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onChangeFreeze($event, key) {
|
2022-04-22 19:23:15 +09:00
|
|
|
this.freeze[key] = $event.target.checked;
|
2022-04-08 16:29:24 +09:00
|
|
|
this.updateConfig();
|
|
|
|
},
|
2022-10-15 19:31:18 +09:00
|
|
|
updateConfig,
|
2022-04-08 16:29:24 +09:00
|
|
|
},
|
|
|
|
data() {
|
2023-01-29 04:39:18 +09:00
|
|
|
const config = getConfig();
|
2022-04-08 16:29:24 +09:00
|
|
|
return {
|
2023-01-29 04:39:18 +09:00
|
|
|
...config,
|
2022-04-08 16:29:24 +09:00
|
|
|
// const
|
2023-01-10 16:55:28 +09:00
|
|
|
freezeKeys: [
|
|
|
|
...Object.keys(codes[this.version]?.freezeCodeHooks ?? {}),
|
|
|
|
...statusKeys,
|
|
|
|
],
|
2022-04-08 16:29:24 +09:00
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
l() {
|
|
|
|
return labels[this.$lang] ?? labels['en-US'];
|
|
|
|
},
|
2022-10-15 19:31:18 +09:00
|
|
|
textConfig: {
|
|
|
|
get() {
|
2023-01-29 04:39:18 +09:00
|
|
|
return this;
|
2022-10-15 19:31:18 +09:00
|
|
|
},
|
|
|
|
set(value) {
|
|
|
|
Object.assign(this, value);
|
|
|
|
this.updateConfig();
|
|
|
|
},
|
|
|
|
},
|
2022-04-08 16:29:24 +09:00
|
|
|
},
|
|
|
|
watch: {
|
2022-04-22 19:23:15 +09:00
|
|
|
freezeDuration: updateConfig,
|
2022-04-08 16:29:24 +09:00
|
|
|
},
|
2022-12-17 08:54:58 +09:00
|
|
|
};
|
2022-04-08 16:29:24 +09:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2022-12-17 08:54:58 +09:00
|
|
|
input[type='number'],
|
|
|
|
td.right {
|
2022-04-08 16:29:24 +09:00
|
|
|
text-align: right;
|
|
|
|
}
|
2022-12-17 08:54:58 +09:00
|
|
|
input[type='number'] {
|
2022-04-08 16:29:24 +09:00
|
|
|
width: 3em;
|
|
|
|
margin: 0 2px;
|
|
|
|
}
|
|
|
|
.appearance > div {
|
|
|
|
padding: 0 0 4px;
|
|
|
|
}
|
|
|
|
|
2022-12-17 08:54:58 +09:00
|
|
|
input[type='number'] {
|
2022-04-08 16:29:24 +09:00
|
|
|
-moz-appearance: textfield;
|
|
|
|
}
|
2022-12-17 08:54:58 +09:00
|
|
|
input[type='number']::-webkit-inner-spin-button,
|
|
|
|
input[type='number']::-webkit-outer-spin-button {
|
2022-04-08 16:29:24 +09:00
|
|
|
-webkit-appearance: none;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
</style>
|