update wave, cycle, damage type ...
This commit is contained in:
@@ -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);
|
||||
};
|
||||
@@ -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 ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user