fix: fixed game edition changing on switcher change

This commit is contained in:
Observer KRypt0n_ 2023-04-08 22:45:38 +02:00
parent 49ebbc35a2
commit 285195954e
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
3 changed files with 6 additions and 0 deletions

View file

@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added installation migration feature - Added installation migration feature
- Added game environment switcher - Added game environment switcher
- Added game edition switcher - Added game edition switcher
- Added changelog to updated components toast
### Changed ### Changed

View file

@ -87,6 +87,7 @@ impl SimpleComponent for AboutDialog {
"<li>Added installation migration feature</li>", "<li>Added installation migration feature</li>",
"<li>Added game environment switcher</li>", "<li>Added game environment switcher</li>",
"<li>Added game edition switcher</li>", "<li>Added game edition switcher</li>",
"<li>Added changelog to updated components toast</li>",
"</ul>", "</ul>",
"<p>Changed</p>", "<p>Changed</p>",

View file

@ -17,6 +17,7 @@ use anime_launcher_sdk::components::*;
use anime_launcher_sdk::components::wine::WincompatlibWine; use anime_launcher_sdk::components::wine::WincompatlibWine;
use anime_launcher_sdk::env_emulation::Environment; use anime_launcher_sdk::env_emulation::Environment;
use anime_launcher_sdk::config::launcher::GameEdition; use anime_launcher_sdk::config::launcher::GameEdition;
use anime_launcher_sdk::anime_game_core::genshin::consts::GameEdition as CoreGameEdition;
use super::main::PreferencesAppMsg; use super::main::PreferencesAppMsg;
use crate::ui::migrate_installation::MigrateInstallationApp; use crate::ui::migrate_installation::MigrateInstallationApp;
@ -326,6 +327,9 @@ impl SimpleAsyncComponent for GeneralApp {
_ => unreachable!() _ => unreachable!()
}; };
// Select new game edition
CoreGameEdition::from(config.launcher.edition).select();
config::update(config); config::update(config);
sender.output(PreferencesAppMsg::UpdateLauncherState); sender.output(PreferencesAppMsg::UpdateLauncherState);