From 6e847c61f5ee21c89925fab31df0e2c45af1b662 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Mon, 22 May 2023 22:45:53 +0200 Subject: [PATCH] feat(ui): set fsr quality in enhancements settings instead of strength --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/ui/preferences/enhancements/mod.rs | 14 +++----------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa0576b..74148b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,8 +96,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "1.4.1" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.4.1#7a63cb4d07048fc7c3126c44148472778b371915" +version = "1.4.2" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.4.2#62e31155f21525f8653ac08ab7ebd477d06fef32" dependencies = [ "anime-game-core", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index b23b150..56e5d53 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ glib-build-tools = "0.17" [dependencies.anime-launcher-sdk] git = "https://github.com/an-anime-team/anime-launcher-sdk" -tag = "1.4.1" +tag = "1.4.2" features = ["all", "genshin"] # path = "../anime-launcher-sdk" # ! for dev purposes only diff --git a/src/ui/preferences/enhancements/mod.rs b/src/ui/preferences/enhancements/mod.rs index 234949a..1b7ab6f 100644 --- a/src/ui/preferences/enhancements/mod.rs +++ b/src/ui/preferences/enhancements/mod.rs @@ -264,20 +264,12 @@ impl SimpleAsyncComponent for EnhancementsApp { &tr("performance") ]), - // FSR strength selection - // - // Ultra Quality = 5 - // Quality = 4 - // Balanced = 3 - // Performance = 2 - // - // Source: Bottles (https://github.com/bottlesdevs/Bottles/blob/22fa3573a13f4e9b9c429e4cdfe4ca29787a2832/src/ui/details-preferences.ui#L88) - set_selected: 5 - CONFIG.game.enhancements.fsr.strength as u32, + set_selected: CONFIG.game.enhancements.fsr.quality.ordinal() as u32, - connect_selected_notify => |row| { + connect_selected_notify => |row| unsafe { if is_ready() { if let Ok(mut config) = Config::get() { - config.game.enhancements.fsr.strength = 5 - row.selected() as u64; + config.game.enhancements.fsr.quality = FsrQuality::from_ordinal_unsafe(row.selected() as i8); Config::update(config); }