update wave, cycle, damage type ...

This commit is contained in:
2025-05-02 16:54:55 +07:00
parent 665bdd497a
commit f9fd97598e
49 changed files with 2072 additions and 702 deletions

View File

@@ -1,15 +1,42 @@
import useBattleDataStore from "@/stores/battleDataStore";
import { BattleDataStateJson } from "@/types/mics";
export const exportBattleData = (
data: BattleDataStateJson,
filename = 'battle_data.json'
) => {
const dataStr = JSON.stringify(data, null, 2);
const blob = new Blob([dataStr], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
a.click();
URL.revokeObjectURL(url);
};
filename = 'battle_data.json'
) => {
const { lineup,
turnHistory,
skillHistory,
totalAV,
totalDamage,
damagePerAV,
cycleIndex,
waveIndex,
dataAvatar,
maxWave,
maxCycle
} = useBattleDataStore.getState();
const data: BattleDataStateJson = {
lineup,
turnHistory,
skillHistory,
dataAvatar,
totalAV,
totalDamage,
damagePerAV,
cycleIndex,
waveIndex,
maxWave,
maxCycle
}
const dataStr = JSON.stringify(data, null, 2);
const blob = new Blob([dataStr], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
a.click();
URL.revokeObjectURL(url);
};

View File

@@ -1,8 +1,8 @@
import { listCurrentLanguage } from "@/lib/constant";
import { AvatarType } from "@/types";
import { AvatarHakushiType } from "@/types";
export function getNameChar(locale: string, data: AvatarType | undefined): string {
export function getNameChar(locale: string, data: AvatarHakushiType | undefined): string {
if (!data) {
return ""
}