Save system: ceremonial PR #42
| @@ -6,6 +6,7 @@ import { addButton } from "./button.ts"; | |||||||
| import { getPlayerProgress } from "./playerprogress.ts"; | import { getPlayerProgress } from "./playerprogress.ts"; | ||||||
| import { getStateManager } from "./statemanager.ts"; | import { getStateManager } from "./statemanager.ts"; | ||||||
| import { getCheckModal } from "./checkmodal.ts"; | import { getCheckModal } from "./checkmodal.ts"; | ||||||
|  | import { saveGame } from "./save.ts"; | ||||||
|  |  | ||||||
| type Button = { | type Button = { | ||||||
|   label: string; |   label: string; | ||||||
| @@ -112,6 +113,7 @@ export class Hotbar { | |||||||
|       }, |       }, | ||||||
|       () => { |       () => { | ||||||
|         getStateManager().advance(); |         getStateManager().advance(); | ||||||
|  |         saveGame(); | ||||||
|       }, |       }, | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -85,7 +85,7 @@ function readBestSave(): SaveFileV1LoadResult { | |||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  |  | ||||||
| export function save() { | export function saveGame() { | ||||||
|   const targetSlot: SaveSlot = |   const targetSlot: SaveSlot = | ||||||
|     readBestSave().slot === "FLEDGLING_SLOT_1" |     readBestSave().slot === "FLEDGLING_SLOT_1" | ||||||
|       ? "FLEDGLING_SLOT_2" |       ? "FLEDGLING_SLOT_2" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user