mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 17:29:30 +02:00
Add log buttons
Export for Sheets (ExSheet): Exports a file replacing \n with CHAR(10) Delete: Deletes the file
This commit is contained in:
parent
7084155186
commit
c80c291805
@ -413,6 +413,11 @@ export function generateEditOption(scene: BattleScene, i: integer, saves: any, p
|
||||
downloadLogByID(i)
|
||||
phase.callEnd()
|
||||
},
|
||||
() => {
|
||||
scene.ui.playSelect();
|
||||
downloadLogByIDToSheet(i)
|
||||
phase.callEnd()
|
||||
},,
|
||||
() => {
|
||||
scene.ui.playSelect();
|
||||
localStorage.removeItem(logs[i][1])
|
||||
@ -535,6 +540,18 @@ export function downloadLogByID(i: integer) {
|
||||
link.click();
|
||||
link.remove();
|
||||
}
|
||||
export function downloadLogByIDToSheet(i: integer) {
|
||||
console.log(i)
|
||||
var d = JSON.parse(localStorage.getItem(logs[i][1]))
|
||||
const blob = new Blob([ printDRPD("", "", d as DRPD).split("\n").join("CHAR(10)") ], {type: "text/json"});
|
||||
const link = document.createElement("a");
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
var date: string = (d as DRPD).date
|
||||
var filename: string = date[0] + date[1] + "_" + date[3] + date[4] + "_" + date[6] + date[7] + date[8] + date[9] + "_route.json"
|
||||
link.download = `${filename}`;
|
||||
link.click();
|
||||
link.remove();
|
||||
}
|
||||
/**
|
||||
* Calls `logPokemon` once for each opponent or, if it's a trainer battle, logs the trainer's data.
|
||||
* @param scene The BattleScene. Used to get the enemy team and whether it's a trainer battle or not.
|
||||
|
@ -24,7 +24,7 @@ export default class LogNameFormUiHandler extends FormModalUiHandler {
|
||||
}
|
||||
|
||||
getButtonLabels(config?: ModalConfig): string[] {
|
||||
return [ "Rename", "Export" ];
|
||||
return [ "Rename", "Export", "ExSheet", "Delete" ];
|
||||
}
|
||||
|
||||
getReadableErrorMessage(error: string): string {
|
||||
|
Loading…
Reference in New Issue
Block a user