bump settings file version
This commit is contained in:
parent
921fc922d3
commit
448ce4aa75
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue