feat: amnet integration
This commit is contained in:
@ -13,9 +13,10 @@ import OptionCategory from './OptionCategory.vue';
|
||||
import OptionRow from './OptionRow.vue';
|
||||
import { invoke } from '../invoke';
|
||||
import { usePkgStore, usePrfStore } from '../stores';
|
||||
import { pkgKey } from '../util';
|
||||
import { Feature } from '../types';
|
||||
import { hasFeature, pkgKey } from '../util';
|
||||
|
||||
const pkg = usePkgStore();
|
||||
const pkgs = usePkgStore();
|
||||
const prf = usePrfStore();
|
||||
|
||||
const aimeCode = ref('');
|
||||
@ -53,7 +54,7 @@ const aimeCodeModel = computed({
|
||||
},
|
||||
async set(value: string) {
|
||||
aimeCode.value = value;
|
||||
if (value.match(/^[0-9]{20}$/)) {
|
||||
if (value.match(/^[0-9]{20}$/) || value.length === 0) {
|
||||
const aime_path = await path.join(await prf.configDir, 'aime.txt');
|
||||
await writeTextFile(aime_path, aimeCode.value);
|
||||
}
|
||||
@ -111,7 +112,7 @@ const extraDisplayOptionsDisabled = computed(() => {
|
||||
<Select
|
||||
v-model="prf.current!.sgt.hook"
|
||||
:options="
|
||||
pkg.hooks.map((p) => {
|
||||
pkgs.hooks.map((p) => {
|
||||
return { title: pkgKey(p), value: pkgKey(p) };
|
||||
})
|
||||
"
|
||||
@ -125,7 +126,7 @@ const extraDisplayOptionsDisabled = computed(() => {
|
||||
placeholder="segatools built-in"
|
||||
:options="[
|
||||
{ title: 'segatools built-in', value: null },
|
||||
...pkg.ios.map((p) => {
|
||||
...pkgs.gameIOs.map((p) => {
|
||||
return { title: pkgKey(p), value: pkgKey(p) };
|
||||
}),
|
||||
]"
|
||||
@ -299,23 +300,65 @@ const extraDisplayOptionsDisabled = computed(() => {
|
||||
/>
|
||||
</OptionRow>
|
||||
</OptionCategory>
|
||||
<OptionCategory title="Misc">
|
||||
<OptionRow title="OpenSSL bug workaround for Intel ≥10th gen">
|
||||
<ToggleSwitch v-model="prf.current!.sgt.intel" />
|
||||
</OptionRow>
|
||||
<OptionCategory title="Aime">
|
||||
<OptionRow title="Aime emulation">
|
||||
<ToggleSwitch v-model="prf.current!.sgt.enable_aime" />
|
||||
<Select
|
||||
v-model="prf.current!.sgt.aime"
|
||||
:options="[
|
||||
{ title: 'disabled', value: null },
|
||||
{ title: 'segatools built-in', value: 'BuiltIn' },
|
||||
...pkgs.aimes.map((p) => {
|
||||
return {
|
||||
title: pkgKey(p),
|
||||
value: hasFeature(p, Feature.AMNet)
|
||||
? { AMNet: pkgKey(p) }
|
||||
: { Other: pkgKey(p) },
|
||||
};
|
||||
}),
|
||||
]"
|
||||
placeholder="none"
|
||||
option-label="title"
|
||||
option-value="value"
|
||||
></Select>
|
||||
</OptionRow>
|
||||
<OptionRow title="Aime code">
|
||||
<InputText
|
||||
class="shrink"
|
||||
size="small"
|
||||
:disabled="prf.current?.sgt.enable_aime !== true"
|
||||
:disabled="prf.current!.sgt.aime === null"
|
||||
:maxlength="20"
|
||||
placeholder="00000000000000000000"
|
||||
v-model="aimeCodeModel"
|
||||
/>
|
||||
</OptionRow>
|
||||
<div v-if="prf.current!.sgt.aime?.hasOwnProperty('AMNet')">
|
||||
<OptionRow title="Server name">
|
||||
<InputText
|
||||
class="shrink"
|
||||
size="small"
|
||||
placeholder="CHUNI-PENGUIN"
|
||||
:maxlength="50"
|
||||
v-model="prf.current!.sgt.amnet.name"
|
||||
/>
|
||||
</OptionRow>
|
||||
<OptionRow title="Server address">
|
||||
<InputText
|
||||
class="shrink"
|
||||
size="small"
|
||||
placeholder="http://+:6070"
|
||||
:maxlength="50"
|
||||
v-model="prf.current!.sgt.amnet.addr"
|
||||
/>
|
||||
</OptionRow>
|
||||
<OptionRow title="Use AiMeDB for physical cards">
|
||||
<ToggleSwitch v-model="prf.current!.sgt.amnet.physical" />
|
||||
</OptionRow>
|
||||
</div>
|
||||
</OptionCategory>
|
||||
<OptionCategory title="Misc">
|
||||
<OptionRow title="OpenSSL bug workaround for Intel ≥10th gen">
|
||||
<ToggleSwitch v-model="prf.current!.sgt.intel" />
|
||||
</OptionRow>
|
||||
<OptionRow title="More segatools options">
|
||||
<FileEditor filename="segatools-base.ini" />
|
||||
</OptionRow>
|
||||
|
Reference in New Issue
Block a user