Savegames hold only the game state: no settings, no camera (settings stay in local storage)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-06 07:54:36 +01:00
1 parent 68e878265c
commit 7709226a58
4 files changed
+30 -30

No files matched your search

+10 -10
View File
@@ -609,20 +609,20 @@ impl App {
self.status = Some((text, now));
}
// Load a savegame (settings in the savegame are always applied)
// Load a savegame (only the game state; the settings stay as they are). The camera looks at
// the heart (screenshot scenes bring their own camera).
fn load_bytes(&mut self, bytes: &[u8], ui: &mut Ui, menu: &mut Menu, r3d: &mut R3d, now: f64) {
match save::from_bytes(bytes) {
Ok(l) => {
self.game = l.game;
if let Some(c) = l.camera {
self.cam = c;
self.cam.snap();
}
if let Some(s) = l.settings {
self.settings = s;
apply_settings(&self.settings, r3d);
store_settings(&self.settings);
match l.camera {
Some(c) => self.cam = c,
None => {
let (cx, cy) = self.game.map.core;
self.cam = Cam::new(cx as f32 + 1.5, cy as f32 + 1.5);
}
}
self.cam.snap();
apply_game_settings(&mut self.game, &self.settings);
self.game.coop = false;
self.coop = false;
@@ -638,7 +638,7 @@ impl App {
}
fn autosave_json(&self) -> String {
save::to_json(&self.game, &self.cam, &self.settings)
save::to_json(&self.game)
}
fn connect_match(&mut self, cloud: &Cloud) -> bool {