Skip to content

Commit

Permalink
Go back to single save-to-background file name per scene.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcglincy committed Dec 27, 2021
1 parent a83ac65 commit ed2dab5
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/dungeon.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ export class Dungeon extends PlaceableObject {
// uncomment for jpg+compression
//const filename = `${canvas.scene.name}-dungeon.jpg`;
//const base64 = await canvas.app.renderer.extract.base64(this, "image/jpeg", 0.5);
// const randString =
// Math.random().toString(36).substring(2, 6) +
// Math.random().toString(36).substring(2, 6);
// const filename = `${canvas.scene.name}-dungeon-${randString}.png`;
const filename = `${canvas.scene.name}-dungeon.png`;
const base64 = await canvas.app.renderer.extract.base64(tempContainer);
const res = await fetch(base64);
Expand All @@ -107,7 +103,6 @@ export class Dungeon extends PlaceableObject {
await FilePicker.upload("data", folder, file, {});
const path = folder ? folder + "/" + filename : filename;
// make sure we don't keep using a cached copy
// TODO: we only need to do this is we're keeping a fixed filename
TextureLoader.loader.cache.delete(path);
if (canvas.scene.data.img === path) {
// cheat to force a scene update when we're re-saving to the same filename
Expand Down

0 comments on commit ed2dab5

Please sign in to comment.