feat(ui): added components index path selection to initial setup

This commit is contained in:
Observer KRypt0n_ 2023-03-06 22:34:06 +02:00
parent 578f475ab8
commit 2427faa089
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
8 changed files with 36 additions and 14 deletions

2
Cargo.lock generated
View file

@ -76,7 +76,7 @@ dependencies = [
[[package]] [[package]]
name = "anime-launcher-sdk" name = "anime-launcher-sdk"
version = "0.3.2" version = "0.3.3"
dependencies = [ dependencies = [
"anime-game-core", "anime-game-core",
"anyhow", "anyhow",

@ -1 +1 @@
Subproject commit 6565e300309a89f859fd62d2b626ca84675d9ae8 Subproject commit 219d0f7704e18d74a9205163ffbb7d1718291ea4

View file

@ -37,6 +37,7 @@ runners-folder = Runners-Ordner
dxvks-folder = DXVKs-Ordner dxvks-folder = DXVKs-Ordner
wine-prefix-folder = Wine prefix-Ordner wine-prefix-folder = Wine prefix-Ordner
game-installation-folder = Spiel-Installationsordner game-installation-folder = Spiel-Installationsordner
components-index = Komponentenverzeichnis
patch-folder = Patch-Ordner patch-folder = Patch-Ordner
temp-folder = Temp-Ordner temp-folder = Temp-Ordner

View file

@ -37,6 +37,7 @@ runners-folder = Runners folder
dxvks-folder = DXVKs folder dxvks-folder = DXVKs folder
wine-prefix-folder = Wine prefix folder wine-prefix-folder = Wine prefix folder
game-installation-folder = Game installation folder game-installation-folder = Game installation folder
components-index = Components index
patch-folder = Patch folder patch-folder = Patch folder
temp-folder = Temp folder temp-folder = Temp folder

View file

@ -37,6 +37,7 @@ runners-folder = Emplacement des runners
dxvks-folder = Emplacement des versions de DXVK dxvks-folder = Emplacement des versions de DXVK
wine-prefix-folder = Emplacement du préfix wine wine-prefix-folder = Emplacement du préfix wine
game-installation-folder = Emplacement d'installation du jeu game-installation-folder = Emplacement d'installation du jeu
components-index = Indice des composants
patch-folder = Emplacement du patch patch-folder = Emplacement du patch
temp-folder = Dossier temporaire temp-folder = Dossier temporaire

View file

@ -39,6 +39,7 @@ runners-folder = Папка версий Wine
dxvks-folder = Папка версий DXVK dxvks-folder = Папка версий DXVK
wine-prefix-folder = Папка префикса Wine wine-prefix-folder = Папка префикса Wine
game-installation-folder = Путь установки игры game-installation-folder = Путь установки игры
components-index = Индекс компонентов
patch-folder = Папка скачивания патча patch-folder = Папка скачивания патча
temp-folder = Временная папка temp-folder = Временная папка

View file

@ -37,6 +37,7 @@ runners-folder = 运行程序文件夹
dxvks-folder = DXVK 文件夹 dxvks-folder = DXVK 文件夹
wine-prefix-folder = Wine prefix 文件夹 wine-prefix-folder = Wine prefix 文件夹
game-installation-folder = 游戏安装文件夹 game-installation-folder = 游戏安装文件夹
components-index = 成分指数
patch-folder = 补丁文件夹 patch-folder = 补丁文件夹
temp-folder = 临时文件夹 temp-folder = 临时文件夹

View file

@ -19,6 +19,7 @@ pub struct DefaultPathsApp {
dxvks: PathBuf, dxvks: PathBuf,
prefix: PathBuf, prefix: PathBuf,
game: PathBuf, game: PathBuf,
components: PathBuf,
patch: PathBuf, patch: PathBuf,
temp: PathBuf temp: PathBuf
} }
@ -30,6 +31,7 @@ pub enum Folders {
DXVK, DXVK,
Prefix, Prefix,
Game, Game,
Components,
Patch, Patch,
Temp Temp
} }
@ -145,6 +147,17 @@ impl SimpleAsyncComponent for DefaultPathsApp {
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Game) connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Game)
}, },
adw::ActionRow {
set_title: &tr("components-index"),
set_icon_name: Some("folder-symbolic"),
set_activatable: true,
#[watch]
set_subtitle: model.components.to_str().unwrap(),
connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Components)
},
adw::ActionRow { adw::ActionRow {
set_title: &tr("patch-folder"), set_title: &tr("patch-folder"),
set_icon_name: Some("folder-symbolic"), set_icon_name: Some("folder-symbolic"),
@ -208,6 +221,7 @@ impl SimpleAsyncComponent for DefaultPathsApp {
dxvks: CONFIG.game.dxvk.builds.clone(), dxvks: CONFIG.game.dxvk.builds.clone(),
prefix: CONFIG.game.wine.prefix.clone(), prefix: CONFIG.game.wine.prefix.clone(),
game: CONFIG.game.path.clone(), game: CONFIG.game.path.clone(),
components: CONFIG.components.path.clone(),
patch: CONFIG.patch.path.clone(), patch: CONFIG.patch.path.clone(),
#[allow(clippy::or_fun_call)] #[allow(clippy::or_fun_call)]
@ -233,22 +247,24 @@ impl SimpleAsyncComponent for DefaultPathsApp {
match folder { match folder {
Folders::Launcher => { Folders::Launcher => {
self.runners = result.join("runners"); self.runners = result.join("runners");
self.dxvks = result.join("dxvks"); self.dxvks = result.join("dxvks");
self.prefix = result.join("game"); self.prefix = result.join("game");
self.game = result.join("game/drive_c/Program Files/Genshin Impact"); self.game = result.join("game/drive_c/Program Files/Genshin Impact");
self.patch = result.join("patch"); self.components = result.join("components");
self.temp = result.join("temp"); self.patch = result.join("patch");
self.temp = result.join("temp");
self.launcher = result; self.launcher = result;
} }
Folders::Runners => self.runners = result, Folders::Runners => self.runners = result,
Folders::DXVK => self.dxvks = result, Folders::DXVK => self.dxvks = result,
Folders::Prefix => self.prefix = result, Folders::Prefix => self.prefix = result,
Folders::Game => self.game = result, Folders::Game => self.game = result,
Folders::Patch => self.patch = result, Folders::Components => self.components = result,
Folders::Temp => self.temp = result Folders::Patch => self.patch = result,
Folders::Temp => self.temp = result
} }
} }
} }
@ -278,6 +294,7 @@ impl DefaultPathsApp {
config.game.dxvk.builds = self.dxvks.clone(); config.game.dxvk.builds = self.dxvks.clone();
config.game.wine.prefix = self.prefix.clone(); config.game.wine.prefix = self.prefix.clone();
config.game.path = self.game.clone(); config.game.path = self.game.clone();
config.components.path = self.components.clone();
config.patch.path = self.patch.clone(); config.patch.path = self.patch.clone();
config.launcher.temp = Some(self.temp.clone()); config.launcher.temp = Some(self.temp.clone());