mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-03-11 02:29:37 +03:00
feat: added environment emulation support
This experimental feature generates special configuration file which game interprets as different environments. With this, for example, you can access google payment methods
This commit is contained in:
parent
b20df574bf
commit
d7a46b25da
3 changed files with 42 additions and 8 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -40,8 +40,8 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anime-game-core"
|
||||
version = "1.5.0"
|
||||
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.5.0#3d6f5e48168d7daaa5bf4b6388732564947dbe45"
|
||||
version = "1.5.1"
|
||||
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.5.1#4af7a14fc7e86d40cd97a7beb448a6d593a7d43d"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bzip2",
|
||||
|
@ -86,8 +86,8 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anime-launcher-sdk"
|
||||
version = "0.5.8"
|
||||
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=0.5.8#7aa54126c8263efc697feafd3c902d783dcf9bb4"
|
||||
version = "0.5.9"
|
||||
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=0.5.9#c38fc3206a4ffa2aa1c6517a8570ea0cd92daecb"
|
||||
dependencies = [
|
||||
"anime-game-core",
|
||||
"anyhow",
|
||||
|
|
|
@ -17,7 +17,7 @@ glib-build-tools = "0.17"
|
|||
|
||||
[dependencies.anime-launcher-sdk]
|
||||
git = "https://github.com/an-anime-team/anime-launcher-sdk"
|
||||
tag = "0.5.8"
|
||||
tag = "0.5.9"
|
||||
|
||||
# path = "../anime-launcher-sdk" # ! for dev purposes only
|
||||
|
||||
|
|
|
@ -9,12 +9,13 @@ use relm4::factory::{
|
|||
use gtk::prelude::*;
|
||||
use adw::prelude::*;
|
||||
|
||||
use anime_launcher_sdk::anime_game_core::prelude::*;
|
||||
use anime_launcher_sdk::wincompatlib::prelude::*;
|
||||
use anime_launcher_sdk::config;
|
||||
use anime_launcher_sdk::config::launcher::LauncherStyle;
|
||||
use anime_launcher_sdk::anime_game_core::prelude::*;
|
||||
use anime_launcher_sdk::components::*;
|
||||
use anime_launcher_sdk::components::wine::WincompatlibWine;
|
||||
use anime_launcher_sdk::wincompatlib::prelude::*;
|
||||
use anime_launcher_sdk::env_emulation::Environment;
|
||||
|
||||
use super::main::PreferencesAppMsg;
|
||||
use crate::ui::migrate_installation::MigrateInstallationApp;
|
||||
|
@ -302,7 +303,40 @@ impl SimpleAsyncComponent for GeneralApp {
|
|||
|
||||
#[local_ref]
|
||||
voice_packages -> adw::ExpanderRow {
|
||||
set_title: &tr("game-voiceovers")
|
||||
set_title: &tr("game-voiceovers"),
|
||||
set_subtitle: "List of downloaded game voiceovers. You can select them in the game settings"
|
||||
},
|
||||
|
||||
adw::ComboRow {
|
||||
set_title: "Environment emulation",
|
||||
set_subtitle: "Experimental feature. Emulate game environment to get specific features like additional payment methods",
|
||||
|
||||
set_model: Some(>k::StringList::new(&[
|
||||
"PC",
|
||||
"Android"
|
||||
])),
|
||||
|
||||
set_selected: match CONFIG.launcher.environment {
|
||||
Environment::PC => 0,
|
||||
Environment::Android => 1,
|
||||
|
||||
_ => unreachable!()
|
||||
},
|
||||
|
||||
connect_selected_notify => |row| {
|
||||
if is_ready() {
|
||||
if let Ok(mut config) = config::get() {
|
||||
config.launcher.environment = match row.selected() {
|
||||
0 => Environment::PC,
|
||||
1 => Environment::Android,
|
||||
|
||||
_ => unreachable!()
|
||||
};
|
||||
|
||||
config::update(config);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
gtk::Box {
|
||||
|
|
Loading…
Add table
Reference in a new issue