feat: added feature to map wine drives

This commit is contained in:
Observer KRypt0n_ 2023-08-17 16:02:29 +02:00
parent 76d7aaa792
commit 018b3c3d77
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
16 changed files with 155 additions and 4 deletions

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Added feature to map wine drives
### Changed
- Updated Turkish

4
Cargo.lock generated
View file

@ -88,8 +88,8 @@ dependencies = [
[[package]]
name = "anime-launcher-sdk"
version = "1.10.0"
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.10.0#916d4b56e0de0b3ed7720603da2090cbd9a11210"
version = "1.11.0"
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.11.0#b858205ca74d3ce930d0d6cd36eb0b9dc749a7a7"
dependencies = [
"anime-game-core",
"anyhow",

View file

@ -19,7 +19,7 @@ glib-build-tools = "0.18"
[dependencies.anime-launcher-sdk]
git = "https://github.com/an-anime-team/anime-launcher-sdk"
tag = "1.10.0"
tag = "1.11.0"
features = ["all", "genshin"]
# path = "../anime-launcher-sdk" # ! for dev purposes only

View file

@ -14,6 +14,12 @@ system = System
borderless-window = Randloses Fenster
virtual-desktop = Virtueller Desktop
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = Spiel
hud = HUD

View file

@ -14,6 +14,12 @@ system = System
borderless-window = Borderless window
virtual-desktop = Virtual desktop
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = Game
hud = HUD

View file

@ -14,6 +14,12 @@ system = Sistema
borderless-window = Ventana sin bordes
virtual-desktop = Escritorio virtual
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = Juego
hud = HUD

View file

@ -14,6 +14,12 @@ system = Système
borderless-window = Utiliser une fenêtre sans bordure
virtual-desktop = Bureau virtuel
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = Jeu
hud = HUD

View file

@ -14,6 +14,12 @@ system = Rendszer
borderless-window = Kerettelen ablak(borderless)
virtual-desktop = Virtuális asztal
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = Játék
hud = HUD

View file

@ -14,6 +14,12 @@ system = Sistem
borderless-window = window tanpa border
virtual-desktop = Desktop virtual
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = Game
hud = HUD

View file

@ -14,6 +14,12 @@ system = Sistema
borderless-window = Finestra senza bordi
virtual-desktop = Desktop virtuale
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = Gioco
hud = HUD

View file

@ -14,6 +14,12 @@ system = システム
borderless-window = ボーダーレスウィンドウ
virtual-desktop = 仮想デスクトップ
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = ゲーム
hud = HUD

View file

@ -14,6 +14,12 @@ system = Системный
borderless-window = Окно без рамок
virtual-desktop = Виртуальный рабочий стол
map-drive-c = Создавать диск C:
map-drive-c-description = Автоматически создавать ссылку на папку drive_c из префикса Wine в dosdevices
map-game-folder = Создавать диск с папкой игры
map-game-folder-description = Автоматически создавать ссылку на папку с игрой в dosdevices
game = Игра
hud = HUD

View file

@ -14,6 +14,12 @@ system = System
borderless-window = Kantlöst fönster
virtual-desktop = Virtuellt skrivbord
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = Spel
hud = HUD

View file

@ -14,6 +14,12 @@ system = Sistem
borderless-window = Köşesiz Pencere
virtual-desktop = Sanal Masaüstü
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = Oyun
hud = HUD

View file

@ -14,6 +14,12 @@ system = 系统
borderless-window = 无边框窗口
virtual-desktop = 虚拟桌面
map-drive-c = Map drive C:
map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices
map-game-folder = Map game folder
map-game-folder-description = Automatically symlink game folder to the dosdevices
game = 游戏
hud = HUD

View file

@ -1,6 +1,11 @@
use relm4::prelude::*;
use relm4::component::*;
use relm4::factory::*;
use relm4::factory::{
AsyncFactoryComponent,
AsyncFactorySender,
AsyncFactoryVecDeque
};
use adw::prelude::*;
@ -285,6 +290,76 @@ impl SimpleAsyncComponent for EnhancementsApp {
if let Ok(mut config) = Config::get() {
config.game.wine.virtual_desktop.enabled = switch.state();
Config::update(config);
}
}
}
}
},
adw::ActionRow {
set_title: &tr!("map-drive-c"),
set_subtitle: &tr!("map-drive-c-description"),
add_suffix = &gtk::Switch {
set_valign: gtk::Align::Center,
set_state: CONFIG.game.wine.drives.drive_c,
connect_state_notify => |switch| {
if is_ready() {
if let Ok(mut config) = Config::get() {
config.game.wine.drives.drive_c = switch.state();
Config::update(config);
}
}
}
}
},
#[name = "map_game_folder_row"]
adw::ComboRow {
set_title: &tr!("map-game-folder"),
set_subtitle: &tr!("map-game-folder-description"),
#[wrap(Some)]
set_model = &gtk::StringList::new(&AllowedDrives::list().iter()
.map(|drive| drive.to_drive())
.collect::<Vec<_>>()),
set_selected: match CONFIG.game.wine.drives.game_folder {
Some(drive) => AllowedDrives::list().iter()
.position(|allowed| *allowed == drive)
.unwrap_or(8) as u32,
None => 8 // G:
},
connect_selected_notify => |row| {
if is_ready() {
if let Ok(mut config) = Config::get() {
config.game.wine.drives.game_folder = Some(AllowedDrives::list()[row.selected() as usize]);
Config::update(config);
}
}
},
add_suffix = &gtk::Switch {
set_valign: gtk::Align::Center,
set_state: CONFIG.game.wine.drives.game_folder.is_some(),
connect_state_notify[map_game_folder_row] => move |switch| {
if is_ready() {
if let Ok(mut config) = Config::get() {
if switch.state() {
config.game.wine.drives.game_folder = Some(AllowedDrives::list()[map_game_folder_row.selected() as usize]);
} else {
config.game.wine.drives.game_folder = None;
}
Config::update(config);
}
}