feat(wuwa): removed fonts checking
This commit is contained in:
parent
8a00674501
commit
080ce25b3c
1 changed files with 3 additions and 36 deletions
|
@ -1,7 +1,5 @@
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use wincompatlib::wine::ext::Font;
|
|
||||||
|
|
||||||
use anime_game_core::prelude::*;
|
use anime_game_core::prelude::*;
|
||||||
use anime_game_core::wuwa::prelude::*;
|
use anime_game_core::wuwa::prelude::*;
|
||||||
|
|
||||||
|
@ -16,8 +14,6 @@ pub enum LauncherState {
|
||||||
|
|
||||||
PrefixNotExists,
|
PrefixNotExists,
|
||||||
|
|
||||||
FontsNotInstalled(Vec<Font>),
|
|
||||||
|
|
||||||
TelemetryNotDisabled,
|
TelemetryNotDisabled,
|
||||||
|
|
||||||
// Always contains `VersionDiff::Diff`
|
// Always contains `VersionDiff::Diff`
|
||||||
|
@ -48,41 +44,12 @@ impl LauncherState {
|
||||||
pub fn get<F: Fn(StateUpdating)>(params: LauncherStateParams<F>) -> anyhow::Result<Self> {
|
pub fn get<F: Fn(StateUpdating)>(params: LauncherStateParams<F>) -> anyhow::Result<Self> {
|
||||||
tracing::debug!("Trying to get launcher state");
|
tracing::debug!("Trying to get launcher state");
|
||||||
|
|
||||||
// Check prefix existence
|
|
||||||
if !params.wine_prefix.join("drive_c").exists() {
|
|
||||||
return Ok(Self::PrefixNotExists);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check wine components installation status
|
// Check wine components installation status
|
||||||
(params.status_updater)(StateUpdating::Components);
|
(params.status_updater)(StateUpdating::Components);
|
||||||
|
|
||||||
let mut fonts = Vec::new();
|
// Check prefix existence
|
||||||
|
if !params.wine_prefix.join("drive_c").exists() {
|
||||||
// In future, wincompatlib's Font might contain fonts that won't be actually needed
|
return Ok(Self::PrefixNotExists);
|
||||||
// That's why I listed only needed fonts here
|
|
||||||
const COREFONTS: &[Font] = &[
|
|
||||||
Font::Andale,
|
|
||||||
Font::Arial,
|
|
||||||
Font::Courier,
|
|
||||||
Font::Georgia,
|
|
||||||
Font::Impact,
|
|
||||||
Font::Times,
|
|
||||||
Font::Trebuchet,
|
|
||||||
Font::Verdana,
|
|
||||||
Font::Webdings,
|
|
||||||
|
|
||||||
// Who even needs it?
|
|
||||||
Font::ComicSans
|
|
||||||
];
|
|
||||||
|
|
||||||
for font in COREFONTS.iter().copied() {
|
|
||||||
if !font.is_installed(¶ms.wine_prefix) {
|
|
||||||
fonts.push(font);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !fonts.is_empty() {
|
|
||||||
return Ok(Self::FontsNotInstalled(fonts));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check telemetry servers
|
// Check telemetry servers
|
||||||
|
|
Loading…
Reference in a new issue