feat: more breaking changes
This commit is contained in:
@ -5,7 +5,8 @@ import InputText from 'primevue/inputtext';
|
||||
import Select from 'primevue/select';
|
||||
import SelectButton from 'primevue/selectbutton';
|
||||
import ToggleSwitch from 'primevue/toggleswitch';
|
||||
import { invoke as unproxied_invoke } from '@tauri-apps/api/core';
|
||||
import * as path from '@tauri-apps/api/path';
|
||||
import { readTextFile, writeTextFile } from '@tauri-apps/plugin-fs';
|
||||
import FileEditor from './FileEditor.vue';
|
||||
import FilePicker from './FilePicker.vue';
|
||||
import OptionCategory from './OptionCategory.vue';
|
||||
@ -32,20 +33,6 @@ const hookList: Ref<{ title: string; value: string }[]> = ref([
|
||||
},
|
||||
]);
|
||||
|
||||
unproxied_invoke('read_profile_data', {
|
||||
path: 'aime.txt',
|
||||
})
|
||||
.then((v: unknown) => {
|
||||
if (typeof v === 'string') {
|
||||
aimeCode.value = v;
|
||||
} else {
|
||||
aimeCode.value = '';
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
aimeCode.value = '';
|
||||
});
|
||||
|
||||
invoke('list_platform_capabilities')
|
||||
.then(async (v: unknown) => {
|
||||
if (Array.isArray(v)) {
|
||||
@ -72,26 +59,33 @@ const aimeCodeModel = computed({
|
||||
async set(value: string) {
|
||||
aimeCode.value = value;
|
||||
if (value.match(/^[0-9]{20}$/)) {
|
||||
await invoke('write_profile_data', {
|
||||
path: 'aime.txt',
|
||||
content: aimeCode.value,
|
||||
});
|
||||
const aime_path = await path.join(await prf.configDir, 'aime.txt');
|
||||
await writeTextFile(aime_path, aimeCode.value);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const extraDisplayOptionsDisabled = computed(() => {
|
||||
return prf.cfg('display', 'default').value === 'default';
|
||||
});
|
||||
|
||||
(async () => {
|
||||
const aime_path = await path.join(await prf.configDir, 'aime.txt');
|
||||
aimeCode.value = await readTextFile(aime_path);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<OptionCategory title="General">
|
||||
<!-- <OptionRow title="mu3.exe">
|
||||
<OptionRow title="mu3.exe">
|
||||
<FilePicker
|
||||
field="game-dir"
|
||||
field="target-path"
|
||||
default=""
|
||||
:directory="false"
|
||||
promptname="mu3.exe"
|
||||
extension="exe"
|
||||
></FilePicker>
|
||||
</OptionRow> -->
|
||||
</OptionRow>
|
||||
<OptionRow title="mu3hook">
|
||||
<Select
|
||||
:model-value="prf.cfg('hook', 'segatools-mu3hook')"
|
||||
@ -135,17 +129,14 @@ const aimeCodeModel = computed({
|
||||
option-value="value"
|
||||
></Select>
|
||||
</OptionRow>
|
||||
<OptionRow id="resolution" title="Game resolution">
|
||||
<OptionRow class="number-input" title="Game resolution">
|
||||
<InputNumber
|
||||
class="shrink"
|
||||
size="small"
|
||||
:min="480"
|
||||
:max="9999"
|
||||
:use-grouping="false"
|
||||
:model-value="
|
||||
// prettier-ignore Because primevue fucked up
|
||||
prf.cfg('rez-w', 1080) as any
|
||||
"
|
||||
:model-value="prf.cfgAny('rez-w', 1080)"
|
||||
/>
|
||||
x
|
||||
<InputNumber
|
||||
@ -154,10 +145,7 @@ const aimeCodeModel = computed({
|
||||
:min="640"
|
||||
:max="9999"
|
||||
:use-grouping="false"
|
||||
:model-value="
|
||||
// prettier-ignore
|
||||
prf.cfg('rez-h', 1920) as any
|
||||
"
|
||||
:model-value="prf.cfgAny('rez-h', 1920)"
|
||||
/>
|
||||
</OptionRow>
|
||||
<OptionRow title="Display mode">
|
||||
@ -185,7 +173,18 @@ const aimeCodeModel = computed({
|
||||
]"
|
||||
option-label="title"
|
||||
option-value="value"
|
||||
:disabled="prf.cfg('display', 'default').value === 'default'"
|
||||
:disabled="extraDisplayOptionsDisabled"
|
||||
/>
|
||||
</OptionRow>
|
||||
<OptionRow class="number-input" title="Refresh Rate">
|
||||
<InputNumber
|
||||
class="shrink"
|
||||
size="small"
|
||||
:min="60"
|
||||
:max="999"
|
||||
:use-grouping="false"
|
||||
:model-value="prf.cfgAny('frequency', 60)"
|
||||
:disabled="extraDisplayOptionsDisabled"
|
||||
/>
|
||||
</OptionRow>
|
||||
<OptionRow
|
||||
@ -195,7 +194,7 @@ const aimeCodeModel = computed({
|
||||
<!-- @vue-expect-error -->
|
||||
<ToggleSwitch
|
||||
:disabled="
|
||||
prf.cfg('display', 'default').value === 'default' ||
|
||||
extraDisplayOptionsDisabled ||
|
||||
prf.cfg('display-mode', 'borderless').value != 'borderless'
|
||||
"
|
||||
:model-value="prf.cfg('borderless-fullscreen', false)"
|
||||
@ -209,10 +208,7 @@ const aimeCodeModel = computed({
|
||||
size="small"
|
||||
:maxlength="40"
|
||||
placeholder="192.168.1.234"
|
||||
:model-value="
|
||||
// prettier-ignore
|
||||
prf.cfg<string>('dns-default', '') as any
|
||||
"
|
||||
:model-value="prf.cfgAny<string>('dns-default', '')"
|
||||
/> </OptionRow
|
||||
><OptionRow title="Keychip">
|
||||
<InputText
|
||||
@ -220,10 +216,7 @@ const aimeCodeModel = computed({
|
||||
size="small"
|
||||
:maxlength="16"
|
||||
placeholder="A123-01234567890"
|
||||
:model-value="
|
||||
// prettier-ignore
|
||||
prf.cfg('keychip', '') as any
|
||||
"
|
||||
:model-value="prf.cfgAny('keychip', '')"
|
||||
/> </OptionRow
|
||||
><OptionRow title="Subnet">
|
||||
<InputText
|
||||
@ -231,10 +224,7 @@ const aimeCodeModel = computed({
|
||||
size="small"
|
||||
:maxlength="15"
|
||||
placeholder="192.168.1.0"
|
||||
:model-value="
|
||||
// prettier-ignore
|
||||
prf.cfg('subnet', '') as any
|
||||
"
|
||||
:model-value="prf.cfgAny('subnet', '')"
|
||||
/>
|
||||
</OptionRow>
|
||||
</OptionCategory>
|
||||
@ -271,7 +261,7 @@ const aimeCodeModel = computed({
|
||||
</template>
|
||||
|
||||
<style>
|
||||
#resolution .p-inputnumber-input {
|
||||
.number-input .p-inputnumber-input {
|
||||
width: 4rem;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user