Add character card v3 import/export

This commit is contained in:
kwaroran
2024-05-25 09:23:59 +09:00
parent e5e7533e1a
commit 65fd56c0e4
7 changed files with 319 additions and 109 deletions

View File

@@ -1,5 +1,5 @@
import { get } from "svelte/store";
import { exportSpecV2 } from "./characterCards";
import { exportCharacterCard } from "./characterCards";
import { VirtualWriter, isTauri, openURL } from "./storage/globalApi";
import { sleep } from "./util";
import { CurrentCharacter } from "./stores";
@@ -21,7 +21,7 @@ export async function shareRealmCardData():Promise<{ name: ArrayBuffer; data: Ar
const trimedName = char.name.replace(/[^a-zA-Z0-9]/g, '') || 'character';
const writer = new VirtualWriter()
const namebuf = new TextEncoder().encode(trimedName + '.png')
await exportSpecV2(char, 'png', {writer: writer})
await exportCharacterCard(char, 'png', {writer: writer})
alertStore.set({
type: 'none',
msg: ''