fix(settings): a profile is not moved to physicslog.trains, and a closed tape window keeps nothing

- the one-time move runs on the player's own settings only; a profile from before it keeps
  physicslog as it was, and the player's mark of the move stays when it is applied
- a read of the tapes under way when the window closes is let go
This commit is contained in:
maj00r
2026-11-16 00:01:46 +01:00
parent f1d77addae
commit 5ab9bce321
3 changed files with 36 additions and 2 deletions

View File

@@ -1257,6 +1257,23 @@ public class SettingsStoreTests
Assert.False(store.LoadFailed);
}
[Fact]
public void A_profile_from_before_the_move_is_not_moved_and_keeps_the_players_mark()
{
var files = new InMemoryFileSystem()
.WithFile(UserIni, "starter.physicslog.moved yes\nphysicslog yes\n")
.WithFile(Profile, "physicslog yes\n");
var store = WithHome(files).SettingsStore;
store.Load();
Assert.True(store.TryLoadProfile(Profile));
store.Save();
Assert.True(store.Settings.PhysicsLog);
Assert.False(store.Settings.PhysicsLogTrains);
Assert.Contains("starter.physicslog.moved yes", files.ReadAllText(UserIni, System.Text.Encoding.UTF8));
}
[Fact]
public void A_missing_profile_leaves_the_settings_as_they_are()
{