forked from akanyan/STARTLINER
feat: partial support for patches
This commit is contained in:
54
src/components/PatchList.vue
Normal file
54
src/components/PatchList.vue
Normal file
@ -0,0 +1,54 @@
|
||||
<script setup lang="ts">
|
||||
import { Ref, ref } from 'vue';
|
||||
import * as path from '@tauri-apps/api/path';
|
||||
import OptionCategory from './OptionCategory.vue';
|
||||
import OptionRow from './OptionRow.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>
|
Reference in New Issue
Block a user