Fix Windows Build

This commit is contained in:
Ben C 2023-02-21 14:35:35 -05:00
parent f0994af59e
commit c9e10a5af9
2 changed files with 14 additions and 11 deletions

View File

@ -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},
};

View File

@ -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);
}
}