mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-16 19:51:50 +00:00
removed unused code - Sense_101
This commit is contained in:
parent
25dc74f809
commit
9f47684d66
@ -1,9 +1,8 @@
|
|||||||
import { createLogger } from "../core/logging";
|
import { createLogger } from "../core/logging";
|
||||||
import { DialogWithForm } from "../core/modal_dialog_elements";
|
import { DialogWithForm } from "../core/modal_dialog_elements";
|
||||||
import { FormElementInput } from "../core/modal_dialog_forms";
|
import { FormElementInput } from "../core/modal_dialog_forms";
|
||||||
import { ReadWriteProxy } from "../core/read_write_proxy";
|
|
||||||
import { TextualGameState } from "../core/textual_game_state";
|
import { TextualGameState } from "../core/textual_game_state";
|
||||||
import { formatBigNumberFull, startFileChoose, waitNextFrame } from "../core/utils";
|
import { formatBigNumberFull } from "../core/utils";
|
||||||
import { enumGameModeIds } from "../game/game_mode";
|
import { enumGameModeIds } from "../game/game_mode";
|
||||||
import { ShapeDefinition } from "../game/shape_definition";
|
import { ShapeDefinition } from "../game/shape_definition";
|
||||||
import { MUSIC } from "../platform/sound";
|
import { MUSIC } from "../platform/sound";
|
||||||
@ -614,40 +613,4 @@ export class PuzzleMenuState extends TextualGameState {
|
|||||||
savegame,
|
savegame,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
importPuzzle() {
|
|
||||||
startFileChoose(".bin").then(file => {
|
|
||||||
if (file) {
|
|
||||||
const closeLoader = this.dialogs.showLoadingDialog("Importing Puzzle");
|
|
||||||
waitNextFrame().then(() => {
|
|
||||||
const reader = new FileReader();
|
|
||||||
reader.addEventListener("load", event => {
|
|
||||||
const fileContents = event.target.result.toString();
|
|
||||||
|
|
||||||
/** @type {import("../savegame/savegame_typedefs").PuzzleGameData} */
|
|
||||||
let gameData;
|
|
||||||
|
|
||||||
try {
|
|
||||||
gameData = ReadWriteProxy.deserializeObject(fileContents);
|
|
||||||
} catch (err) {
|
|
||||||
closeLoader();
|
|
||||||
this.dialogs.showWarning(T.global.error, String(err));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const savegame = Savegame.createPuzzleSavegame(this.app);
|
|
||||||
this.moveToState("InGameState", {
|
|
||||||
gameModeId: enumGameModeIds.puzzleEdit,
|
|
||||||
gameModeParameters: {
|
|
||||||
gameData,
|
|
||||||
startInTestMode: true,
|
|
||||||
},
|
|
||||||
savegame,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
reader.readAsText(file);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user