mirror of
https://github.com/ALEZ-DEV/Babylonia-terminal.git
synced 2026-03-21 21:58:52 +00:00
change progress display for font installation
This commit is contained in:
parent
8bbbeb59c0
commit
2d642f412e
@ -70,10 +70,7 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
GameState::FontNotInstalled => {
|
GameState::FontNotInstalled => {
|
||||||
info!("Fonts not installed, installing it...");
|
info!("Fonts not installed, installing it...");
|
||||||
GameManager::install_font(
|
GameManager::install_font(&proton.clone().unwrap())
|
||||||
&proton.clone().unwrap(),
|
|
||||||
DownloadReporter::create(false),
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.expect("Failed to install fonts");
|
.expect("Failed to install fonts");
|
||||||
info!("Fonts installed");
|
info!("Fonts installed");
|
||||||
|
|||||||
@ -67,47 +67,43 @@ impl GameManager {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn install_font<P>(proton: &Proton, progress: Arc<P>) -> anyhow::Result<()>
|
pub async fn install_font(proton: &Proton) -> anyhow::Result<()> {
|
||||||
where
|
|
||||||
P: Reporter + 'static,
|
|
||||||
{
|
|
||||||
let wine_with_proton_prefix = proton // wine take the data/wine/pfx prefix, but we want the data/wine prefix
|
let wine_with_proton_prefix = proton // wine take the data/wine/pfx prefix, but we want the data/wine prefix
|
||||||
.wine()
|
.wine()
|
||||||
.clone()
|
.clone()
|
||||||
.with_prefix(proton.wine().prefix.parent().unwrap());
|
.with_prefix(proton.wine().prefix.parent().unwrap());
|
||||||
|
|
||||||
progress.setup(Some(10), "");
|
info!("0/10 font installed");
|
||||||
progress.progress(0);
|
|
||||||
|
|
||||||
wine_with_proton_prefix.install_font(Font::Arial)?;
|
wine_with_proton_prefix.install_font(Font::Arial)?;
|
||||||
progress.progress(1);
|
info!("1/10 font installed");
|
||||||
|
|
||||||
wine_with_proton_prefix.install_font(Font::Andale)?;
|
wine_with_proton_prefix.install_font(Font::Andale)?;
|
||||||
progress.progress(2);
|
info!("2/10 font installed");
|
||||||
|
|
||||||
wine_with_proton_prefix.install_font(Font::Courier)?;
|
wine_with_proton_prefix.install_font(Font::Courier)?;
|
||||||
progress.progress(3);
|
info!("3/10 font installed");
|
||||||
|
|
||||||
wine_with_proton_prefix.install_font(Font::ComicSans)?;
|
wine_with_proton_prefix.install_font(Font::ComicSans)?;
|
||||||
progress.progress(4);
|
info!("4/10 font installed");
|
||||||
|
|
||||||
wine_with_proton_prefix.install_font(Font::Georgia)?;
|
wine_with_proton_prefix.install_font(Font::Georgia)?;
|
||||||
progress.progress(5);
|
info!("5/10 font installed");
|
||||||
|
|
||||||
wine_with_proton_prefix.install_font(Font::Impact)?;
|
wine_with_proton_prefix.install_font(Font::Impact)?;
|
||||||
progress.progress(6);
|
info!("6/10 font installed");
|
||||||
|
|
||||||
wine_with_proton_prefix.install_font(Font::Times)?;
|
wine_with_proton_prefix.install_font(Font::Times)?;
|
||||||
progress.progress(7);
|
info!("7/10 font installed");
|
||||||
|
|
||||||
wine_with_proton_prefix.install_font(Font::Trebuchet)?;
|
wine_with_proton_prefix.install_font(Font::Trebuchet)?;
|
||||||
progress.progress(8);
|
info!("8/10 font installed");
|
||||||
|
|
||||||
wine_with_proton_prefix.install_font(Font::Verdana)?;
|
wine_with_proton_prefix.install_font(Font::Verdana)?;
|
||||||
progress.progress(9);
|
info!("9/10 font installed");
|
||||||
|
|
||||||
wine_with_proton_prefix.install_font(Font::Webdings)?;
|
wine_with_proton_prefix.install_font(Font::Webdings)?;
|
||||||
progress.progress(10);
|
info!("10/10 font installed");
|
||||||
|
|
||||||
let mut config = GameState::get_config().await;
|
let mut config = GameState::get_config().await;
|
||||||
config.is_font_installed = true;
|
config.is_font_installed = true;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user