Merge branch 'master' of https://git.ez-pp.farm/EZPPFarm/EZPPLauncher
This commit is contained in:
+10
-3
@@ -24,10 +24,13 @@ pub fn get_osu_user_config<P: AsRef<Path>>(
|
||||
return None;
|
||||
}
|
||||
|
||||
let current_user = std::env::var("USERNAME").unwrap_or_else(|_| "Admin".to_string());
|
||||
let current_user = std::env::var("USERNAME")
|
||||
.or_else(|_| std::env::var("USER"))
|
||||
.unwrap_or_else(|_| "Admin".to_string());
|
||||
let osu_config_path = osu_folder_path
|
||||
.as_ref()
|
||||
.join(format!("osu!.{}.cfg", current_user));
|
||||
println!("Looking for user config at: {:?}", osu_config_path);
|
||||
if !osu_config_path.exists() {
|
||||
return None;
|
||||
}
|
||||
@@ -48,7 +51,9 @@ pub fn set_osu_user_config_vals(
|
||||
osu_folder_path: &str,
|
||||
key_values: &[(&str, Option<&str>)],
|
||||
) -> Result<bool, String> {
|
||||
let current_user = std::env::var("USERNAME").unwrap_or_else(|_| "Admin".to_string());
|
||||
let current_user = std::env::var("USERNAME")
|
||||
.or_else(|_| std::env::var("USER"))
|
||||
.unwrap_or_else(|_| "Admin".to_string());
|
||||
let osu_config_path = Path::new(osu_folder_path).join(format!("osu!.{}.cfg", current_user));
|
||||
|
||||
if !osu_config_path.exists() {
|
||||
@@ -310,7 +315,9 @@ pub async fn is_net8_installed() -> bool {
|
||||
}
|
||||
|
||||
let stdout_str = String::from_utf8_lossy(&output.stdout);
|
||||
stdout_str.lines().any(|line| line.starts_with("Microsoft.WindowsDesktop.App 8."))
|
||||
stdout_str
|
||||
.lines()
|
||||
.any(|line| line.starts_with("Microsoft.WindowsDesktop.App 8."))
|
||||
}
|
||||
Err(_) => false,
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
const localThemes = await getThemes();
|
||||
const lastThemeName = await config_theme.get('Default');
|
||||
const last_theme = localThemes.find((t) => t.name === lastThemeName);
|
||||
if (!last_theme) {
|
||||
if (!last_theme || $platform === 'linux') {
|
||||
await config.value<string>('theme').set('Default');
|
||||
loadTheme(localThemes[0], $custom_theme_container!, await config_theme_volume.get(0.15));
|
||||
} else {
|
||||
|
||||
@@ -1827,6 +1827,23 @@
|
||||
}}
|
||||
out:fly={{ duration: $reduceAnimations ? 0 : 400, y: -5, opacity: 0 }}
|
||||
>
|
||||
{#if $platform === 'linux'}
|
||||
<div
|
||||
class="flex flex-col items-center gap-4 mt-12 px-6 text-center h-full justify-center"
|
||||
>
|
||||
<!-- currently there is a bug when applying themes on Linux, the Launcher freezes, also when trying to load assets via the assetProtocol it fails because it says the asset was loaded insecurely -->
|
||||
<span class="text-2xl font-bold drop-shadow-lg"
|
||||
>Custom themes are not supported on Linux yet(we are working on it!)</span
|
||||
>
|
||||
<span class="text-muted-foreground font-semibold drop-shadow-lg"
|
||||
>Due to technical limitations on Linux, custom themes are currently not supported.
|
||||
</span>
|
||||
<span class="text-muted-foreground font-semibold drop-shadow-lg"
|
||||
>We are working on a solution to bring custom themes to Linux in a future update, but
|
||||
we don't have an ETA yet. Stay tuned!</span
|
||||
>
|
||||
</div>
|
||||
{:else}
|
||||
<ScrollContainer class="pt-8" topOffset={45}>
|
||||
<div class="grid w-full gap-1 grid-cols-3 p-3 pr-5">
|
||||
{#each $custom_themes as theme (theme.folder_name)}
|
||||
@@ -1871,7 +1888,10 @@
|
||||
} else {
|
||||
const downloadThemeResult = await downloadTheme(theme);
|
||||
if (!downloadThemeResult.success) {
|
||||
if (downloadThemeResult.error && downloadThemeResult.error.length > 0) {
|
||||
if (
|
||||
downloadThemeResult.error &&
|
||||
downloadThemeResult.error.length > 0
|
||||
) {
|
||||
sileo.error({
|
||||
title: 'Uhhm..',
|
||||
description: downloadThemeResult.error,
|
||||
@@ -1912,7 +1932,11 @@
|
||||
onclick={async () => {
|
||||
const defaultTheme = $custom_themes.find((t) => t.name === 'Default');
|
||||
if (defaultTheme) {
|
||||
loadTheme(defaultTheme, $custom_theme_container!, $custom_theme_volume);
|
||||
loadTheme(
|
||||
defaultTheme,
|
||||
$custom_theme_container!,
|
||||
$custom_theme_volume
|
||||
);
|
||||
await config.value<string>('theme').set(defaultTheme.name);
|
||||
|
||||
if (!(await downloadTheme(theme, true))) {
|
||||
@@ -1969,6 +1993,7 @@
|
||||
{/each}
|
||||
</div>
|
||||
</ScrollContainer>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user