mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-23 06:46:11 +00:00
Remove threading from file write (#226)
This commit is contained in:
parent
ae791b42b6
commit
6ffec53204
1 changed files with 17 additions and 19 deletions
|
@ -359,26 +359,24 @@ pub unsafe fn write_menu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn spawn_menu() {
|
pub unsafe fn spawn_menu() {
|
||||||
std::thread::spawn(||{
|
let fname = "index.html";
|
||||||
let fname = "index.html";
|
let params = MENU.to_url_params();
|
||||||
let params = MENU.to_url_params();
|
let page_response = Webpage::new()
|
||||||
let page_response = Webpage::new()
|
.background(Background::BlurredScreenshot)
|
||||||
.background(Background::BlurredScreenshot)
|
.htdocs_dir("contents")
|
||||||
.htdocs_dir("contents")
|
.boot_display(BootDisplay::BlurredScreenshot)
|
||||||
.boot_display(BootDisplay::BlurredScreenshot)
|
.boot_icon(true)
|
||||||
.boot_icon(true)
|
.start_page(&format!("{}{}", fname, params))
|
||||||
.start_page(&format!("{}{}", fname, params))
|
.open()
|
||||||
.open()
|
.unwrap();
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let last_url = page_response
|
let last_url = page_response
|
||||||
.get_last_url()
|
.get_last_url()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
set_menu_from_url(last_url);
|
set_menu_from_url(last_url);
|
||||||
|
|
||||||
let menu_conf_path = "sd:/TrainingModpack/training_modpack_menu.conf";
|
let menu_conf_path = "sd:/TrainingModpack/training_modpack_menu.conf";
|
||||||
std::fs::write(menu_conf_path, last_url)
|
std::fs::write(menu_conf_path, last_url)
|
||||||
.expect("Failed to write menu conf file");
|
.expect("Failed to write menu conf file");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue