Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
feat: removed game sessions manager
Browse files Browse the repository at this point in the history
Game doesn't have sessions at all
  • Loading branch information
krypt0nn committed Jun 28, 2024
1 parent 040661f commit 11b8bd0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 323 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ glib-build-tools = "0.19"

[dependencies.anime-launcher-sdk]
git = "https://github.com/an-anime-team/anime-launcher-sdk"
tag = "1.15.1"
tag = "1.15.2"
features = ["all", "wuwa", "wuwa-patch"]

# path = "../anime-launcher-sdk" # ! for dev purposes only
Expand Down
10 changes: 0 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ use anime_launcher_sdk::wuwa::consts::*;
use anime_launcher_sdk::anime_game_core::prelude::*;
use anime_launcher_sdk::anime_game_core::wuwa::prelude::*;

use anime_launcher_sdk::sessions::SessionsExt;
use anime_launcher_sdk::wuwa::sessions::Sessions;

use tracing_subscriber::prelude::*;
use tracing_subscriber::filter::*;

Expand Down Expand Up @@ -148,13 +145,6 @@ fn main() -> anyhow::Result<()> {
"--just-run-game" => just_run_game = true,
"--no-verbose-tracing" => no_verbose_tracing = true,

"--session" => {
// Switch active session prior running the app
if let Some(session) = args.get(i + 1) {
Sessions::set_current(session.to_owned())?;
}
},

arg => gtk_args.push(arg.to_string())
}
}
Expand Down
17 changes: 17 additions & 0 deletions src/ui/main/launch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use relm4::prelude::*;
use gtk::prelude::*;

use anime_launcher_sdk::wincompatlib::prelude::*;

use anime_launcher_sdk::config::ConfigExt;
use anime_launcher_sdk::wuwa::config::Config;
use anime_launcher_sdk::wuwa::config::schema::prelude::LauncherBehavior;
Expand All @@ -24,6 +26,21 @@ pub fn launch(sender: ComponentSender<App>) {
}

std::thread::spawn(move || {
// I honestly don't care anymore
let wine = config.get_selected_wine().unwrap().unwrap();

let wine = wine
.to_wine(config.components.path, Some(config.game.wine.builds.join(&wine.name)))
.with_loader(WineLoader::Current)
.with_arch(WineArch::Win64)
.with_prefix(&config.game.wine.prefix);

// Fix for the in-game browser being a black window
wine.run_args(["winecfg", "-v", "win7"])
.expect("Failed to run wine server")
.wait()
.expect("Failed to run winecfg -v win7");

if let Err(err) = anime_launcher_sdk::wuwa::game::run() {
tracing::error!("Failed to launch game: {err}");

Expand Down
278 changes: 0 additions & 278 deletions src/ui/preferences/enhancements/game.rs

This file was deleted.

Loading

0 comments on commit 11b8bd0

Please sign in to comment.