feat: etc
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import Fieldset from 'primevue/fieldset';
|
||||
import InputNumber from 'primevue/inputnumber';
|
||||
import InputText from 'primevue/inputtext';
|
||||
import RadioButton from 'primevue/radiobutton';
|
||||
import Toggle from 'primevue/toggleswitch';
|
||||
import * as path from '@tauri-apps/api/path';
|
||||
import { readTextFile, writeTextFile } from '@tauri-apps/plugin-fs';
|
||||
import { usePkgStore } from '../stores';
|
||||
|
||||
const store = usePkgStore();
|
||||
@ -23,7 +25,32 @@ const cfgRezW = _cfg('rez-w', 1080);
|
||||
const cfgRezH = _cfg('rez-h', 1920);
|
||||
const cfgDisplayMode = _cfg('display-mode', 'borderless');
|
||||
const cfgAime = _cfg('aime', false);
|
||||
const cfgAimeCode = _cfg('aime-code', '');
|
||||
|
||||
const aimeCode = ref('');
|
||||
// temp
|
||||
let aimePath = '';
|
||||
|
||||
(async () => {
|
||||
aimePath = await path.join(
|
||||
await path.dataDir(),
|
||||
'startliner/profile-ongeki-default/aime.txt'
|
||||
);
|
||||
aimeCode.value = await readTextFile(aimePath);
|
||||
})();
|
||||
|
||||
path.homeDir().then(console.log);
|
||||
|
||||
const aimeCodeModel = computed({
|
||||
get() {
|
||||
return aimeCode.value;
|
||||
},
|
||||
async set(value: string) {
|
||||
aimeCode.value = value;
|
||||
if (value.match(/^[0-9]{20}$/)) {
|
||||
await writeTextFile(aimePath, aimeCode.value);
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -98,13 +125,9 @@ const cfgAimeCode = _cfg('aime-code', '');
|
||||
class="shrink"
|
||||
size="small"
|
||||
:disabled="store.cfg('aime') !== true"
|
||||
:invalid="
|
||||
store.cfg('aime') === true &&
|
||||
store.cfg('aime-code')?.toString().length !== 20
|
||||
"
|
||||
:maxlength="20"
|
||||
placeholder="00000000000000000000"
|
||||
v-model="cfgAimeCode"
|
||||
v-model="aimeCodeModel"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user