Add download menu translations

Update download menu formatting
Better error logging
This commit is contained in:
Thoronium
2023-02-26 00:15:42 -07:00
committed by GitHub
parent 08d9db05a5
commit 7f71549831
18 changed files with 80 additions and 26 deletions

View File

@@ -131,8 +131,8 @@ pub fn read_file(path: String) -> String {
let mut file = match fs::File::open(path_buf) {
Ok(file) => file,
Err(e) => {
println!("Failed to open file: {}", e);
return String::new();
// Send back error for handling by the caller
return e;
}
};

View File

@@ -96,6 +96,13 @@ pub fn unzip(
.unwrap();
}
// If downloading full build, emit that the jar was extracted with it
if zipfile = "GrasscutterCulti3.4.zip" {
window
.emit("jar_extracted", destpath.to_string() + (destpath.to_string() + "grasscutter.jar"))
.unwrap();
}
// Delete zip file
match std::fs::remove_file(&zipfile) {
Ok(_) => {