File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
packages/kitten-scientists/source Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,10 @@ export class KittenScientists {
120
120
| undefined ;
121
121
122
122
if ( ! state ) {
123
- cinfo ( "The Kittens Game save data did not contain a script state." ) ;
123
+ cinfo (
124
+ "The Kittens Game save data did not contain a script state. Trying to load Auto-Save settings..." ,
125
+ ) ;
126
+ this . _userInterface . stateManagementUi . loadAutoSave ( ) ;
124
127
return ;
125
128
}
126
129
Original file line number Diff line number Diff line change @@ -569,6 +569,17 @@ export class StateManagementUi extends SettingsPanel<StateSettings> {
569
569
this . _host . refreshUi ( ) ;
570
570
}
571
571
572
+ loadAutoSave ( ) {
573
+ const existing = this . states . find ( state => state . unwrap ( ) . label === "Auto-Save" ) ;
574
+ if ( isNil ( existing ) ) {
575
+ cinfo ( "No Auto-Save settings found." ) ;
576
+ return ;
577
+ }
578
+
579
+ cinfo ( "Loading Auto-Save..." ) ;
580
+ this . loadState ( existing . unwrap ( ) . state ) ;
581
+ }
582
+
572
583
updateGame ( game : Unique < StoredGame > , newGame : KGSaveData ) {
573
584
if ( this . _destructiveActionPrevented ( ) ) {
574
585
return ;
You can’t perform that action at this time.
0 commit comments