mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-11-21 20:36:01 +03:00
feat: added options to use wine/dxvk shared libraries
This commit is contained in:
parent
c4a9acb4ca
commit
cf02bcab8c
3 changed files with 85 additions and 37 deletions
18
Cargo.lock
generated
18
Cargo.lock
generated
|
@ -48,8 +48,8 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anime-game-core"
|
||||
version = "1.10.0"
|
||||
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.10.0#d30663c31e505f304f392d0058d659ffa9cb36f0"
|
||||
version = "1.10.1"
|
||||
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.10.1#3300f3edcfcdd4477818b25e1ac85af21476211e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bzip2",
|
||||
|
@ -96,8 +96,8 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anime-launcher-sdk"
|
||||
version = "1.4.0"
|
||||
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.4.0#1ecc5ec822cd163042b9b50459067c924fcb5828"
|
||||
version = "1.4.1"
|
||||
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.4.1#7a63cb4d07048fc7c3126c44148472778b371915"
|
||||
dependencies = [
|
||||
"anime-game-core",
|
||||
"anyhow",
|
||||
|
@ -331,9 +331,9 @@ checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
|
|||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.21.0"
|
||||
version = "0.21.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
|
||||
checksum = "3f1e31e207a6b8fb791a38ea3105e6cb541f55e4d029902d3039a4ad07cc4105"
|
||||
|
||||
[[package]]
|
||||
name = "base64ct"
|
||||
|
@ -379,9 +379,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "bstr"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09"
|
||||
checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"serde",
|
||||
|
@ -2335,7 +2335,7 @@ version = "1.0.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b"
|
||||
dependencies = [
|
||||
"base64 0.21.0",
|
||||
"base64 0.21.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -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.0"
|
||||
tag = "1.4.1"
|
||||
features = ["all", "genshin"]
|
||||
|
||||
# path = "../anime-launcher-sdk" # ! for dev purposes only
|
||||
|
|
|
@ -75,45 +75,45 @@ impl SimpleAsyncComponent for ComponentsPage {
|
|||
adw::PreferencesPage {
|
||||
add = &adw::PreferencesGroup {
|
||||
set_title: &tr("wine-version"),
|
||||
|
||||
|
||||
adw::ComboRow {
|
||||
set_title: &tr("selected-version"),
|
||||
|
||||
|
||||
#[watch]
|
||||
#[block_signal(wine_selected_notify)]
|
||||
set_model: Some(>k::StringList::new(&model.downloaded_wine_versions.iter().map(|(version, _)| version.title.as_str()).collect::<Vec<&str>>())),
|
||||
|
||||
|
||||
#[watch]
|
||||
#[block_signal(wine_selected_notify)]
|
||||
set_selected: model.selected_wine_version,
|
||||
|
||||
|
||||
#[watch]
|
||||
set_activatable: !model.selecting_wine_version,
|
||||
|
||||
|
||||
connect_selected_notify[sender] => move |row| {
|
||||
if is_ready() {
|
||||
sender.input(ComponentsPageMsg::SelectWine(row.selected() as usize));
|
||||
}
|
||||
} @wine_selected_notify,
|
||||
|
||||
|
||||
add_suffix = >k::Spinner {
|
||||
set_spinning: true,
|
||||
|
||||
|
||||
#[watch]
|
||||
set_visible: model.selecting_wine_version
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
adw::ActionRow {
|
||||
set_title: &tr("recommended-only"),
|
||||
set_subtitle: &tr("wine-recommended-description"),
|
||||
|
||||
|
||||
add_suffix = >k::Switch {
|
||||
set_valign: gtk::Align::Center,
|
||||
|
||||
|
||||
#[block_signal(wine_recommended_notify)]
|
||||
set_state: true,
|
||||
|
||||
|
||||
connect_state_notify[sender] => move |switch| {
|
||||
if is_ready() {
|
||||
sender.input(ComponentsPageMsg::WineRecommendedOnly(switch.state()));
|
||||
|
@ -122,62 +122,110 @@ impl SimpleAsyncComponent for ComponentsPage {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
add = &adw::PreferencesGroup {
|
||||
add = model.wine_components.widget(),
|
||||
},
|
||||
|
||||
|
||||
add = &adw::PreferencesGroup {
|
||||
set_title: "Wine options",
|
||||
|
||||
adw::ActionRow {
|
||||
set_title: "Use wine shared libraries",
|
||||
set_subtitle: "Set LD_LIBRARY_PATH variable to load system libraries from selected wine build",
|
||||
|
||||
add_suffix = >k::Switch {
|
||||
set_valign: gtk::Align::Center,
|
||||
|
||||
#[block_signal(wine_shared_libraries_notify)]
|
||||
set_state: CONFIG.game.wine.shared_libraries.wine,
|
||||
|
||||
connect_state_notify => |switch| {
|
||||
if is_ready() {
|
||||
if let Ok(mut config) = Config::get() {
|
||||
config.game.wine.shared_libraries.wine = switch.state();
|
||||
|
||||
Config::update(config);
|
||||
}
|
||||
}
|
||||
} @wine_shared_libraries_notify
|
||||
}
|
||||
},
|
||||
|
||||
adw::ActionRow {
|
||||
set_title: "Use gstreamer shared libraries",
|
||||
set_subtitle: "Set GST_PLUGIN_PATH variable to load gstreamer libraries from selected wine build",
|
||||
|
||||
add_suffix = >k::Switch {
|
||||
set_valign: gtk::Align::Center,
|
||||
|
||||
#[block_signal(gstreamer_shared_libraries_notify)]
|
||||
set_state: CONFIG.game.wine.shared_libraries.gstreamer,
|
||||
|
||||
connect_state_notify => |switch| {
|
||||
if is_ready() {
|
||||
if let Ok(mut config) = Config::get() {
|
||||
config.game.wine.shared_libraries.gstreamer = switch.state();
|
||||
|
||||
Config::update(config);
|
||||
}
|
||||
}
|
||||
} @gstreamer_shared_libraries_notify
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
add = &adw::PreferencesGroup {
|
||||
set_title: &tr("dxvk-version"),
|
||||
|
||||
|
||||
#[watch]
|
||||
set_description: Some(&if !model.allow_dxvk_selection {
|
||||
tr("dxvk-selection-disabled")
|
||||
} else {
|
||||
String::new()
|
||||
}),
|
||||
|
||||
|
||||
#[watch]
|
||||
set_sensitive: model.allow_dxvk_selection,
|
||||
|
||||
|
||||
adw::ComboRow {
|
||||
set_title: &tr("selected-version"),
|
||||
|
||||
#[watch]
|
||||
#[block_signal(dxvk_selected_notify)]
|
||||
set_model: Some(>k::StringList::new(&model.downloaded_dxvk_versions.iter().map(|version| version.name.as_str()).collect::<Vec<&str>>())),
|
||||
|
||||
|
||||
#[watch]
|
||||
#[block_signal(dxvk_selected_notify)]
|
||||
set_selected: model.selected_dxvk_version,
|
||||
|
||||
|
||||
#[watch]
|
||||
set_activatable: !model.selecting_dxvk_version,
|
||||
|
||||
|
||||
connect_selected_notify[sender] => move |row| {
|
||||
if is_ready() {
|
||||
sender.input(ComponentsPageMsg::SelectDxvk(row.selected() as usize));
|
||||
}
|
||||
} @dxvk_selected_notify,
|
||||
|
||||
|
||||
add_suffix = >k::Spinner {
|
||||
set_spinning: true,
|
||||
|
||||
|
||||
#[watch]
|
||||
set_visible: model.selecting_dxvk_version
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
adw::ActionRow {
|
||||
set_title: &tr("recommended-only"),
|
||||
set_subtitle: &tr("dxvk-recommended-description"),
|
||||
|
||||
|
||||
add_suffix = >k::Switch {
|
||||
set_valign: gtk::Align::Center,
|
||||
|
||||
|
||||
#[block_signal(dxvk_recommended_notify)]
|
||||
set_state: true,
|
||||
|
||||
|
||||
connect_state_notify[sender] => move |switch| {
|
||||
if is_ready() {
|
||||
sender.input(ComponentsPageMsg::DxvkRecommendedOnly(switch.state()));
|
||||
|
@ -186,11 +234,11 @@ impl SimpleAsyncComponent for ComponentsPage {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
add = &adw::PreferencesGroup {
|
||||
#[watch]
|
||||
set_sensitive: model.allow_dxvk_selection,
|
||||
|
||||
|
||||
add = model.dxvk_components.widget(),
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue