mirror of
https://github.com/ow-mods/ow-mod-man.git
synced 2025-12-11 20:15:50 +01:00
Fix Windows Build
This commit is contained in:
parent
f0994af59e
commit
c9e10a5af9
@ -1,8 +1,9 @@
|
||||
use crate::{config::Config, mods::OWMLConfig};
|
||||
use crate::config::Config;
|
||||
use anyhow::Result;
|
||||
use std::path::PathBuf;
|
||||
use tokio::process::Command;
|
||||
|
||||
#[cfg(not(windows))]
|
||||
const LINUX_GAME_PATH: &str = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Outer Wilds";
|
||||
|
||||
#[cfg(windows)]
|
||||
@ -18,7 +19,7 @@ pub async fn launch_game(config: &Config, port: &u16) -> Result<()> {
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn setup_wine_prefix(config: &Config) -> Result<Config> {
|
||||
pub async fn setup_wine_prefix(config: &Config) -> Result<Config> {
|
||||
use log::error;
|
||||
error!("How in the ever-loving FUCK did you get here");
|
||||
error!("...report this please");
|
||||
@ -74,6 +75,7 @@ pub async fn setup_wine_prefix(config: &Config) -> Result<Config> {
|
||||
|
||||
use crate::{
|
||||
file::{create_all_parents, get_app_path},
|
||||
mods::OWMLConfig,
|
||||
progress::{ProgressAction, ProgressBar, ProgressType},
|
||||
};
|
||||
|
||||
|
||||
@ -67,13 +67,14 @@ pub enum ProgressPayload {
|
||||
|
||||
impl ProgressPayload {
|
||||
pub fn parse(input: &str) -> Self {
|
||||
let (action, rest) = input.split_once(':').unwrap();
|
||||
let (id, args) = rest.split_once(':').unwrap();
|
||||
let (action, rest) = input.split_once('|').unwrap();
|
||||
let (id, args) = rest.split_once('|').unwrap();
|
||||
match action {
|
||||
"Start" => {
|
||||
let (len, r) = args.split_once(':').unwrap();
|
||||
let (progress_type, r) = r.split_once(':').unwrap();
|
||||
let (progress_action, msg) = r.split_once(':').unwrap();
|
||||
let (len, r) = args.split_once('|').unwrap();
|
||||
let (progress_type, r) = r.split_once('|').unwrap();
|
||||
let (progress_action, msg) = r.split_once('|').unwrap();
|
||||
println!("{}", input);
|
||||
ProgressPayload::Start(ProgressStartPayload {
|
||||
id: id.to_string(),
|
||||
msg: msg.to_string(),
|
||||
@ -118,7 +119,7 @@ impl ProgressBar {
|
||||
len,
|
||||
progress: 0,
|
||||
};
|
||||
info!(target: "progress", "Start:{}:{}:{:?}:{:?}:{}", id, len, progress_type, progress_action, msg);
|
||||
info!(target: "progress", "Start|{}|{}|{:?}|{:?}|{}", id, len, progress_type, progress_action, msg);
|
||||
new
|
||||
}
|
||||
|
||||
@ -128,14 +129,14 @@ impl ProgressBar {
|
||||
} else {
|
||||
self.progress + amount
|
||||
};
|
||||
info!(target: "progress", "Increment:{}:{}", self.id, self.progress);
|
||||
info!(target: "progress", "Increment|{}|{}", self.id, self.progress);
|
||||
}
|
||||
|
||||
pub fn set_msg(&self, msg: &str) {
|
||||
info!(target: "progress", "Msg:{}:{}", self.id, msg);
|
||||
info!(target: "progress", "Msg|{}|{}", self.id, msg);
|
||||
}
|
||||
|
||||
pub fn finish(&self, msg: &str) {
|
||||
info!(target: "progress", "Finish:{}:{}", self.id, msg);
|
||||
info!(target: "progress", "Finish|{}|{}", self.id, msg);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user