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