mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-11-22 04:46:08 +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]]
|
[[package]]
|
||||||
name = "anime-game-core"
|
name = "anime-game-core"
|
||||||
version = "1.10.0"
|
version = "1.10.1"
|
||||||
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.10.0#d30663c31e505f304f392d0058d659ffa9cb36f0"
|
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.10.1#3300f3edcfcdd4477818b25e1ac85af21476211e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bzip2",
|
"bzip2",
|
||||||
|
@ -96,8 +96,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anime-launcher-sdk"
|
name = "anime-launcher-sdk"
|
||||||
version = "1.4.0"
|
version = "1.4.1"
|
||||||
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.4.0#1ecc5ec822cd163042b9b50459067c924fcb5828"
|
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.4.1#7a63cb4d07048fc7c3126c44148472778b371915"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anime-game-core",
|
"anime-game-core",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -331,9 +331,9 @@ checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base64"
|
name = "base64"
|
||||||
version = "0.21.0"
|
version = "0.21.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
|
checksum = "3f1e31e207a6b8fb791a38ea3105e6cb541f55e4d029902d3039a4ad07cc4105"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base64ct"
|
name = "base64ct"
|
||||||
|
@ -379,9 +379,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bstr"
|
name = "bstr"
|
||||||
version = "1.4.0"
|
version = "1.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09"
|
checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -2335,7 +2335,7 @@ version = "1.0.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b"
|
checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.0",
|
"base64 0.21.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -17,7 +17,7 @@ glib-build-tools = "0.17"
|
||||||
|
|
||||||
[dependencies.anime-launcher-sdk]
|
[dependencies.anime-launcher-sdk]
|
||||||
git = "https://github.com/an-anime-team/anime-launcher-sdk"
|
git = "https://github.com/an-anime-team/anime-launcher-sdk"
|
||||||
tag = "1.4.0"
|
tag = "1.4.1"
|
||||||
features = ["all", "genshin"]
|
features = ["all", "genshin"]
|
||||||
|
|
||||||
# path = "../anime-launcher-sdk" # ! for dev purposes only
|
# path = "../anime-launcher-sdk" # ! for dev purposes only
|
||||||
|
|
|
@ -75,45 +75,45 @@ impl SimpleAsyncComponent for ComponentsPage {
|
||||||
adw::PreferencesPage {
|
adw::PreferencesPage {
|
||||||
add = &adw::PreferencesGroup {
|
add = &adw::PreferencesGroup {
|
||||||
set_title: &tr("wine-version"),
|
set_title: &tr("wine-version"),
|
||||||
|
|
||||||
adw::ComboRow {
|
adw::ComboRow {
|
||||||
set_title: &tr("selected-version"),
|
set_title: &tr("selected-version"),
|
||||||
|
|
||||||
#[watch]
|
#[watch]
|
||||||
#[block_signal(wine_selected_notify)]
|
#[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>>())),
|
set_model: Some(>k::StringList::new(&model.downloaded_wine_versions.iter().map(|(version, _)| version.title.as_str()).collect::<Vec<&str>>())),
|
||||||
|
|
||||||
#[watch]
|
#[watch]
|
||||||
#[block_signal(wine_selected_notify)]
|
#[block_signal(wine_selected_notify)]
|
||||||
set_selected: model.selected_wine_version,
|
set_selected: model.selected_wine_version,
|
||||||
|
|
||||||
#[watch]
|
#[watch]
|
||||||
set_activatable: !model.selecting_wine_version,
|
set_activatable: !model.selecting_wine_version,
|
||||||
|
|
||||||
connect_selected_notify[sender] => move |row| {
|
connect_selected_notify[sender] => move |row| {
|
||||||
if is_ready() {
|
if is_ready() {
|
||||||
sender.input(ComponentsPageMsg::SelectWine(row.selected() as usize));
|
sender.input(ComponentsPageMsg::SelectWine(row.selected() as usize));
|
||||||
}
|
}
|
||||||
} @wine_selected_notify,
|
} @wine_selected_notify,
|
||||||
|
|
||||||
add_suffix = >k::Spinner {
|
add_suffix = >k::Spinner {
|
||||||
set_spinning: true,
|
set_spinning: true,
|
||||||
|
|
||||||
#[watch]
|
#[watch]
|
||||||
set_visible: model.selecting_wine_version
|
set_visible: model.selecting_wine_version
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
adw::ActionRow {
|
adw::ActionRow {
|
||||||
set_title: &tr("recommended-only"),
|
set_title: &tr("recommended-only"),
|
||||||
set_subtitle: &tr("wine-recommended-description"),
|
set_subtitle: &tr("wine-recommended-description"),
|
||||||
|
|
||||||
add_suffix = >k::Switch {
|
add_suffix = >k::Switch {
|
||||||
set_valign: gtk::Align::Center,
|
set_valign: gtk::Align::Center,
|
||||||
|
|
||||||
#[block_signal(wine_recommended_notify)]
|
#[block_signal(wine_recommended_notify)]
|
||||||
set_state: true,
|
set_state: true,
|
||||||
|
|
||||||
connect_state_notify[sender] => move |switch| {
|
connect_state_notify[sender] => move |switch| {
|
||||||
if is_ready() {
|
if is_ready() {
|
||||||
sender.input(ComponentsPageMsg::WineRecommendedOnly(switch.state()));
|
sender.input(ComponentsPageMsg::WineRecommendedOnly(switch.state()));
|
||||||
|
@ -122,62 +122,110 @@ impl SimpleAsyncComponent for ComponentsPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
add = &adw::PreferencesGroup {
|
add = &adw::PreferencesGroup {
|
||||||
add = model.wine_components.widget(),
|
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 {
|
add = &adw::PreferencesGroup {
|
||||||
set_title: &tr("dxvk-version"),
|
set_title: &tr("dxvk-version"),
|
||||||
|
|
||||||
#[watch]
|
#[watch]
|
||||||
set_description: Some(&if !model.allow_dxvk_selection {
|
set_description: Some(&if !model.allow_dxvk_selection {
|
||||||
tr("dxvk-selection-disabled")
|
tr("dxvk-selection-disabled")
|
||||||
} else {
|
} else {
|
||||||
String::new()
|
String::new()
|
||||||
}),
|
}),
|
||||||
|
|
||||||
#[watch]
|
#[watch]
|
||||||
set_sensitive: model.allow_dxvk_selection,
|
set_sensitive: model.allow_dxvk_selection,
|
||||||
|
|
||||||
adw::ComboRow {
|
adw::ComboRow {
|
||||||
set_title: &tr("selected-version"),
|
set_title: &tr("selected-version"),
|
||||||
|
|
||||||
#[watch]
|
#[watch]
|
||||||
#[block_signal(dxvk_selected_notify)]
|
#[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>>())),
|
set_model: Some(>k::StringList::new(&model.downloaded_dxvk_versions.iter().map(|version| version.name.as_str()).collect::<Vec<&str>>())),
|
||||||
|
|
||||||
#[watch]
|
#[watch]
|
||||||
#[block_signal(dxvk_selected_notify)]
|
#[block_signal(dxvk_selected_notify)]
|
||||||
set_selected: model.selected_dxvk_version,
|
set_selected: model.selected_dxvk_version,
|
||||||
|
|
||||||
#[watch]
|
#[watch]
|
||||||
set_activatable: !model.selecting_dxvk_version,
|
set_activatable: !model.selecting_dxvk_version,
|
||||||
|
|
||||||
connect_selected_notify[sender] => move |row| {
|
connect_selected_notify[sender] => move |row| {
|
||||||
if is_ready() {
|
if is_ready() {
|
||||||
sender.input(ComponentsPageMsg::SelectDxvk(row.selected() as usize));
|
sender.input(ComponentsPageMsg::SelectDxvk(row.selected() as usize));
|
||||||
}
|
}
|
||||||
} @dxvk_selected_notify,
|
} @dxvk_selected_notify,
|
||||||
|
|
||||||
add_suffix = >k::Spinner {
|
add_suffix = >k::Spinner {
|
||||||
set_spinning: true,
|
set_spinning: true,
|
||||||
|
|
||||||
#[watch]
|
#[watch]
|
||||||
set_visible: model.selecting_dxvk_version
|
set_visible: model.selecting_dxvk_version
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
adw::ActionRow {
|
adw::ActionRow {
|
||||||
set_title: &tr("recommended-only"),
|
set_title: &tr("recommended-only"),
|
||||||
set_subtitle: &tr("dxvk-recommended-description"),
|
set_subtitle: &tr("dxvk-recommended-description"),
|
||||||
|
|
||||||
add_suffix = >k::Switch {
|
add_suffix = >k::Switch {
|
||||||
set_valign: gtk::Align::Center,
|
set_valign: gtk::Align::Center,
|
||||||
|
|
||||||
#[block_signal(dxvk_recommended_notify)]
|
#[block_signal(dxvk_recommended_notify)]
|
||||||
set_state: true,
|
set_state: true,
|
||||||
|
|
||||||
connect_state_notify[sender] => move |switch| {
|
connect_state_notify[sender] => move |switch| {
|
||||||
if is_ready() {
|
if is_ready() {
|
||||||
sender.input(ComponentsPageMsg::DxvkRecommendedOnly(switch.state()));
|
sender.input(ComponentsPageMsg::DxvkRecommendedOnly(switch.state()));
|
||||||
|
@ -186,11 +234,11 @@ impl SimpleAsyncComponent for ComponentsPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
add = &adw::PreferencesGroup {
|
add = &adw::PreferencesGroup {
|
||||||
#[watch]
|
#[watch]
|
||||||
set_sensitive: model.allow_dxvk_selection,
|
set_sensitive: model.allow_dxvk_selection,
|
||||||
|
|
||||||
add = model.dxvk_components.widget(),
|
add = model.dxvk_components.widget(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue