mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-11-17 18:52:06 +00:00
feat: add bind for loading fastfiles to ModMan
This commit is contained in:
@@ -3,10 +3,15 @@ import { ref } from "vue";
|
||||
import { webviewBinds } from "./native";
|
||||
|
||||
const lastPath = ref("");
|
||||
const loadingFastFile = ref(false);
|
||||
|
||||
async function onOpenFastfileClick() {
|
||||
lastPath.value =
|
||||
(await webviewBinds.openFileDialog({ filters: [{ name: "Fastfiles", filter: "*.ff" }] })) ?? "";
|
||||
|
||||
loadingFastFile.value = true;
|
||||
await webviewBinds.loadFastFile(lastPath.value);
|
||||
loadingFastFile.value = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -18,6 +23,7 @@ async function onOpenFastfileClick() {
|
||||
<p>
|
||||
<button @click="onOpenFastfileClick">Open fastfile</button>
|
||||
<span>The last path: {{ lastPath }}</span>
|
||||
<span>Loading: {{ loadingFastFile }}</span>
|
||||
</p>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
3
src/ModManUi/src/native/FastFileBinds.ts
Normal file
3
src/ModManUi/src/native/FastFileBinds.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface FastFileBinds {
|
||||
loadFastFile(path: string): Promise<void>;
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { DialogBinds } from "./DialogBinds";
|
||||
import type { FastFileBinds } from "./FastFileBinds";
|
||||
|
||||
|
||||
export type NativeMethods = DialogBinds;
|
||||
export type NativeMethods = DialogBinds & FastFileBinds;
|
||||
|
||||
interface NativeEventMap {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user