bump settings file version

This commit is contained in:
Sallai József 2022-03-13 23:54:07 +02:00
parent 921fc922d3
commit 448ce4aa75
1 changed files with 11 additions and 1 deletions

View File

@ -55,7 +55,7 @@ fn default_true() -> bool {
#[inline(always)]
fn current_version() -> u32 {
6
7
}
#[inline(always)]
@ -78,6 +78,11 @@ fn default_vol() -> f32 {
1.0
}
#[inline(always)]
fn default_locale() -> Language {
Language::English
}
impl Settings {
pub fn load(ctx: &Context) -> GameResult<Settings> {
if let Ok(file) = user_open(ctx, "/settings.json") {
@ -115,6 +120,11 @@ impl Settings {
self.player2_key_map.strafe = ScanCode::RShift;
}
if self.version == 6 {
self.version = 7;
self.locale = default_locale();
}
if self.version != initial_version {
log::info!("Upgraded configuration file from version {} to {}.", initial_version, self.version);
}