Skip to content

Commit

Permalink
Add saving game language settings to legacy directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Drombeys committed May 8, 2024
1 parent b18ab95 commit 0a773bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static IServiceCollection AddManagers(this IServiceCollection services)
.ConfigurePrimaryHttpMessageHandler(() => {
return new HttpClientHandler {
SslProtocols = System.Security.Authentication.SslProtocols.Tls12
}; ;
};
}).ConfigureHttpClient(ConfigureClient);
services.AddSingleton<UserManager>();
services.AddSingleton<InitializerManager>();
Expand All @@ -40,7 +40,7 @@ public static IServiceCollection AddServices(this IServiceCollection services)
{
return new HttpClientHandler {
SslProtocols = System.Security.Authentication.SslProtocols.Tls12
}; ;
};
})
.ConfigureHttpClient(ConfigureClient);
services.AddTransient<IReleaseComparerService<GitHubRelease>, ReleaseComparerService>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ public void ShowLauncherImpl(MainWindowViewModel mainWindowViewModel)
using var writer = new StreamWriter(PathStorage.GameUser, true);
writer.WriteLine($"language {SelectedLanguage.Key}");
}

// TODO: Удалить в следующем релизе
if (!File.Exists(PathStorage.LegacyGameUser)) {
if (!Directory.Exists(DirectoryStorage.LegacyUserData)) {
Directory.CreateDirectory(DirectoryStorage.LegacyUserData);
}

using var writer = new StreamWriter(PathStorage.LegacyGameUser, true);
writer.WriteLine($"language {SelectedLanguage.Key}");
}
_launcherViewModel.SelectMenu();
mainWindowViewModel.ShowLauncherImpl();
}
Expand Down

0 comments on commit 0a773bd

Please sign in to comment.