Files
STARTLINER/src/components/PatchList.vue
2025-04-12 10:53:06 +00:00

54 lines
1.3 KiB
Vue

<script setup lang="ts">
import { Ref, ref } from 'vue';
import * as path from '@tauri-apps/api/path';
import OptionCategory from './OptionCategory.vue';
import PatchEntry from './PatchEntry.vue';
import { invoke } from '../invoke';
import { usePrfStore } from '../stores';
import { Patch } from '../types';
const prf = usePrfStore();
prf.reload();
const gamePatches: Ref<Patch[]> = ref([]);
const amdPatches: Ref<Patch[]> = ref([]);
invoke('list_patches', { target: prf.current!.data.sgt.target }).then(
(patches) => {
gamePatches.value = patches as Patch[];
}
);
(async () => {
const amd = await path.join(
prf.current!.data.sgt.target,
'../amdaemon.exe'
);
amdPatches.value = (await invoke('list_patches', {
target: amd,
})) as Patch[];
})();
</script>
<template>
<OptionCategory title="chusanApp.exe" always-found>
<PatchEntry
v-for="p in gamePatches"
:id="p.id"
:title="p.name"
:tooltip="p.tooltip"
:type="p.type"
/>
</OptionCategory>
<OptionCategory title="amdaemon.exe" always-found>
<PatchEntry
v-for="p in amdPatches"
:id="p.id"
:title="p.name"
:tooltip="p.tooltip"
:type="p.type"
/>
</OptionCategory>
</template>