Compare commits
24 Commits
3.2.2
...
6dc1f4f703
| Author | SHA1 | Date | |
|---|---|---|---|
| 6dc1f4f703 | |||
| 21710d0e02 | |||
| b478e7ba95 | |||
| bd368adfe5 | |||
| 85ea4167ab | |||
| adf7e487b9 | |||
|
22d97a0068
|
|||
| 992127ecb6 | |||
| 0f53057897 | |||
| 03b326e142 | |||
| 2ec8b08983 | |||
| 344f15b8da | |||
| 554f07412b | |||
| f8f53c4236 | |||
| 64f76d95a6 | |||
| 02fecd237c | |||
| eaffc35288 | |||
| 78c7fdb756 | |||
| ec7ce53016 | |||
| 0610d4beef | |||
|
416067f2ea
|
|||
|
e58be09bdb
|
|||
| ccb0c467f2 | |||
|
67bc968497
|
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ezpplauncher",
|
"name": "ezpplauncher",
|
||||||
"version": "3.2.2",
|
"version": "3.2.5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -34,4 +34,7 @@ function run(cmd: string, args: string[]): Promise<void> {
|
|||||||
|
|
||||||
await run('bun', ['./scripts/sync-version.ts']);
|
await run('bun', ['./scripts/sync-version.ts']);
|
||||||
await runVite();
|
await runVite();
|
||||||
|
|
||||||
|
//set NO_STRIP=1 in env for linux to prevent stripping of debug symbols in tauri builds, which causes issues with source maps
|
||||||
|
if (process.platform === 'linux') process.env.NO_STRIP = '1';
|
||||||
await run('bunx', ['tauri', 'build']);
|
await run('bunx', ['tauri', 'build']);
|
||||||
|
|||||||
Generated
+1
-1
@@ -1239,7 +1239,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ezpplauncher"
|
name = "ezpplauncher"
|
||||||
version = "3.2.2"
|
version = "3.2.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ezpplauncher"
|
name = "ezpplauncher"
|
||||||
version = "3.2.2"
|
version = "3.2.5"
|
||||||
description = "EZPPLauncher redefined."
|
description = "EZPPLauncher redefined."
|
||||||
authors = ["HorizonCode"]
|
authors = ["HorizonCode"]
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|||||||
+14
-11
@@ -36,14 +36,15 @@ pub fn opened_urls(app: tauri::AppHandle) -> Vec<PathBuf> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn get_launcher_version() -> String {
|
pub fn get_launcher_version(app: tauri::AppHandle) -> String {
|
||||||
env!("CARGO_PKG_VERSION").to_string()
|
app.package_info().version.to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn get_hwid() -> String {
|
pub fn get_hwid() -> String {
|
||||||
let hwid = get_id().unwrap();
|
get_id()
|
||||||
hwid.into()
|
.unwrap_or("recorderinsandybridge".to_string())
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command(rename_all = "snake_case")]
|
#[tauri::command(rename_all = "snake_case")]
|
||||||
@@ -79,7 +80,6 @@ pub fn valid_osu_folder(folder: String) -> bool {
|
|||||||
check_folder_completeness(path, &osu_folder_files) >= 70.0
|
check_folder_completeness(path, &osu_folder_files) >= 70.0
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn find_osu_installation() -> Option<String> {
|
pub fn find_osu_installation() -> Option<String> {
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
@@ -450,8 +450,6 @@ pub async fn run_osu(folder: String, patch: bool) -> Result<(), String> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(windows)]
|
|
||||||
{
|
|
||||||
if patch {
|
if patch {
|
||||||
let patcher_exe_path = PathBuf::from(&folder)
|
let patcher_exe_path = PathBuf::from(&folder)
|
||||||
.join("EZPPLauncher")
|
.join("EZPPLauncher")
|
||||||
@@ -459,8 +457,6 @@ pub async fn run_osu(folder: String, patch: bool) -> Result<(), String> {
|
|||||||
.join("osu!.patcher.exe");
|
.join("osu!.patcher.exe");
|
||||||
|
|
||||||
if patcher_exe_path.exists() {
|
if patcher_exe_path.exists() {
|
||||||
#[cfg(windows)]
|
|
||||||
{
|
|
||||||
let mut sys = System::new_all();
|
let mut sys = System::new_all();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
@@ -486,12 +482,20 @@ pub async fn run_osu(folder: String, patch: bool) -> Result<(), String> {
|
|||||||
|
|
||||||
sleep(Duration::from_millis(500)).await;
|
sleep(Duration::from_millis(500)).await;
|
||||||
}
|
}
|
||||||
|
#[cfg(windows)]
|
||||||
|
{
|
||||||
let _ = Command::new(&patcher_exe_path)
|
let _ = Command::new(&patcher_exe_path)
|
||||||
.creation_flags(DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP)
|
.creation_flags(DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP)
|
||||||
.spawn()
|
.spawn()
|
||||||
.map_err(|e| format!("Failed to run patcher: {e}"))?;
|
.map_err(|e| format!("Failed to run patcher: {e}"))?;
|
||||||
}
|
}
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
{
|
||||||
|
let _ = Command::new("osu-wine")
|
||||||
|
.arg("--wine")
|
||||||
|
.arg(&patcher_exe_path)
|
||||||
|
.spawn()
|
||||||
|
.map_err(|e| format!("Failed to run patcher: {}", e))?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -958,7 +962,6 @@ pub async fn download_ezpp_launcher_update(app: AppHandle, url: String) -> Resul
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn install_ezpp_launcher_update(app: AppHandle) -> Result<(), String> {
|
pub async fn install_ezpp_launcher_update(app: AppHandle) -> Result<(), String> {
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
|||||||
+10
-3
@@ -24,10 +24,13 @@ pub fn get_osu_user_config<P: AsRef<Path>>(
|
|||||||
return None;
|
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
|
let osu_config_path = osu_folder_path
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.join(format!("osu!.{}.cfg", current_user));
|
.join(format!("osu!.{}.cfg", current_user));
|
||||||
|
println!("Looking for user config at: {:?}", osu_config_path);
|
||||||
if !osu_config_path.exists() {
|
if !osu_config_path.exists() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@@ -48,7 +51,9 @@ pub fn set_osu_user_config_vals(
|
|||||||
osu_folder_path: &str,
|
osu_folder_path: &str,
|
||||||
key_values: &[(&str, Option<&str>)],
|
key_values: &[(&str, Option<&str>)],
|
||||||
) -> Result<bool, String> {
|
) -> 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));
|
let osu_config_path = Path::new(osu_folder_path).join(format!("osu!.{}.cfg", current_user));
|
||||||
|
|
||||||
if !osu_config_path.exists() {
|
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);
|
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,
|
Err(_) => false,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "EZPPLauncher",
|
"productName": "EZPPLauncher",
|
||||||
"version": "3.2.2",
|
"version": "3.2.5",
|
||||||
"identifier": "farm.EZPPFarm.Launcher",
|
"identifier": "farm.EZPPFarm.Launcher",
|
||||||
"mainBinaryName": "ezpplauncher",
|
"mainBinaryName": "ezpplauncher",
|
||||||
"build": {
|
"build": {
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ import type {
|
|||||||
EZPPUserInfoResponse,
|
EZPPUserInfoResponse,
|
||||||
EZPPUserResponse,
|
EZPPUserResponse,
|
||||||
EZPPUSerStatusResponse,
|
EZPPUSerStatusResponse,
|
||||||
|
StreamsResult,
|
||||||
} from '$lib/types';
|
} from '$lib/types';
|
||||||
import { betterFetch } from '@better-fetch/fetch';
|
import { betterFetch } from '@better-fetch/fetch';
|
||||||
|
|
||||||
|
const VERSION_ENDPOINT = 'https://version.ez-pp.farm/';
|
||||||
const BANCHO_ENDPOINT = 'https://c.ez-pp.farm/';
|
const BANCHO_ENDPOINT = 'https://c.ez-pp.farm/';
|
||||||
const API_ENDPOINT = 'https://api.ez-pp.farm/';
|
const API_ENDPOINT = 'https://api.ez-pp.farm/';
|
||||||
const ENDPOINT = 'https://ez-pp.farm/';
|
const ENDPOINT = 'https://ez-pp.farm/';
|
||||||
@@ -89,4 +91,31 @@ export const ezppfarm = {
|
|||||||
);
|
);
|
||||||
return request.error ? undefined : request.data;
|
return request.error ? undefined : request.data;
|
||||||
},
|
},
|
||||||
|
latestBuildVersion: async (releaseStream: string): Promise<string | undefined> => {
|
||||||
|
const request = await betterFetch<StreamsResult>(`${VERSION_ENDPOINT}api/changelog`, {
|
||||||
|
timeout,
|
||||||
|
query: {
|
||||||
|
stream: 'none',
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'User-Agent': 'EZPPLauncher',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (request.error) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const releaseData = request.data;
|
||||||
|
if (!releaseData || !releaseData.streams) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (releaseData.streams.length === 0) return undefined;
|
||||||
|
const selectedRelease = releaseData.streams.find(
|
||||||
|
(releaseBuild) =>
|
||||||
|
releaseBuild.name.toLowerCase() === releaseStream.replaceAll(' ', '').toLowerCase()
|
||||||
|
);
|
||||||
|
if (!selectedRelease) return undefined;
|
||||||
|
return selectedRelease.latest_build.display_version;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
import type { StreamsResult } from '$lib/types';
|
|
||||||
import { betterFetch } from '@better-fetch/fetch';
|
|
||||||
|
|
||||||
const API_ENDPOINT = 'https://osu.ppy.sh/api/';
|
|
||||||
|
|
||||||
const timeout = 5000; // 5 seconds;
|
|
||||||
|
|
||||||
export const osuapi = {
|
|
||||||
latestBuildVersion: async (releaseStream: string): Promise<string | undefined> => {
|
|
||||||
const request = await betterFetch<StreamsResult>(`${API_ENDPOINT}v2/changelog`, {
|
|
||||||
timeout,
|
|
||||||
query: {
|
|
||||||
stream: 'none',
|
|
||||||
},
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'User-Agent': 'EZPPLauncher',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
if (request.error) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
const releaseData = request.data;
|
|
||||||
if (!releaseData || !releaseData.streams) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
if (releaseData.streams.length === 0) return undefined;
|
|
||||||
const selectedRelease = releaseData.streams.find(
|
|
||||||
(releaseBuild) =>
|
|
||||||
releaseBuild.name.toLowerCase() === releaseStream.replaceAll(' ', '').toLowerCase()
|
|
||||||
);
|
|
||||||
if (!selectedRelease) return undefined;
|
|
||||||
return selectedRelease.latest_build.display_version;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
+51
-6
@@ -9,6 +9,11 @@ export enum Gamemodes {
|
|||||||
RELAX_CATCH = 6,
|
RELAX_CATCH = 6,
|
||||||
|
|
||||||
AUTOPILOT_OSU = 8,
|
AUTOPILOT_OSU = 8,
|
||||||
|
|
||||||
|
SCOREV2_OSU = 12,
|
||||||
|
SCOREV2_TAIKO = 13,
|
||||||
|
SCOREV2_CATCH = 14,
|
||||||
|
SCOREV2_MANIA = 15,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum Mode {
|
export enum Mode {
|
||||||
@@ -22,12 +27,39 @@ export enum Type {
|
|||||||
VANILLA = 0,
|
VANILLA = 0,
|
||||||
RELAX = 4,
|
RELAX = 4,
|
||||||
AUTOPILOT = 8,
|
AUTOPILOT = 8,
|
||||||
|
SCOREV2 = 12,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const validModes = [Mode.OSU, Mode.TAIKO, Mode.CATCH, Mode.MANIA];
|
export const validModes = [Mode.OSU, Mode.TAIKO, Mode.CATCH, Mode.MANIA];
|
||||||
export const validTypes = [Type.VANILLA, Type.RELAX, Type.AUTOPILOT];
|
export const validTypes = [Type.VANILLA, Type.RELAX, Type.AUTOPILOT, Type.SCOREV2];
|
||||||
export const validModeTypeCombinations = [0, 1, 2, 3, 4, 5, 6, 8];
|
export const validModeTypeCombinations = [
|
||||||
export const validModeTypeCombinationsSorted = [0, 4, 8, 1, 5, 2, 6, 3];
|
Gamemodes.VANILLA_OSU,
|
||||||
|
Gamemodes.VANILLA_TAIKO,
|
||||||
|
Gamemodes.VANILLA_CATCH,
|
||||||
|
Gamemodes.VANILLA_MANIA,
|
||||||
|
Gamemodes.RELAX_OSU,
|
||||||
|
Gamemodes.RELAX_TAIKO,
|
||||||
|
Gamemodes.RELAX_CATCH,
|
||||||
|
Gamemodes.AUTOPILOT_OSU,
|
||||||
|
Gamemodes.SCOREV2_OSU,
|
||||||
|
Gamemodes.SCOREV2_TAIKO,
|
||||||
|
Gamemodes.SCOREV2_CATCH,
|
||||||
|
Gamemodes.SCOREV2_MANIA,
|
||||||
|
];
|
||||||
|
export const validModeTypeCombinationsSorted = [
|
||||||
|
Gamemodes.VANILLA_OSU,
|
||||||
|
Gamemodes.RELAX_OSU,
|
||||||
|
Gamemodes.AUTOPILOT_OSU,
|
||||||
|
Gamemodes.SCOREV2_OSU,
|
||||||
|
Gamemodes.VANILLA_TAIKO,
|
||||||
|
Gamemodes.RELAX_TAIKO,
|
||||||
|
Gamemodes.SCOREV2_TAIKO,
|
||||||
|
Gamemodes.VANILLA_CATCH,
|
||||||
|
Gamemodes.RELAX_CATCH,
|
||||||
|
Gamemodes.SCOREV2_CATCH,
|
||||||
|
Gamemodes.VANILLA_MANIA,
|
||||||
|
Gamemodes.SCOREV2_MANIA,
|
||||||
|
];
|
||||||
|
|
||||||
export const validMode = (modeStr: string) => modeStrToInt(modeStr) !== undefined;
|
export const validMode = (modeStr: string) => modeStrToInt(modeStr) !== undefined;
|
||||||
export const validType = (typeStr: string) => typeStrToInt(typeStr) !== undefined;
|
export const validType = (typeStr: string) => typeStrToInt(typeStr) !== undefined;
|
||||||
@@ -60,7 +92,7 @@ export const modeIntToStr = (modeInt: number) => {
|
|||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const typeStrToInt = (typeStr: 'vanilla' | 'relax' | 'autopilot' | string) => {
|
export const typeStrToInt = (typeStr: 'vanilla' | 'relax' | 'autopilot' | 'v2' | string) => {
|
||||||
switch (typeStr) {
|
switch (typeStr) {
|
||||||
case 'relax':
|
case 'relax':
|
||||||
return Type.RELAX;
|
return Type.RELAX;
|
||||||
@@ -68,6 +100,8 @@ export const typeStrToInt = (typeStr: 'vanilla' | 'relax' | 'autopilot' | string
|
|||||||
return Type.AUTOPILOT;
|
return Type.AUTOPILOT;
|
||||||
case 'vanilla':
|
case 'vanilla':
|
||||||
return Type.VANILLA;
|
return Type.VANILLA;
|
||||||
|
case 'scorev2':
|
||||||
|
return Type.SCOREV2;
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
@@ -80,13 +114,15 @@ export const typeIntToStr = (typeInt: number) => {
|
|||||||
return 'autopilot';
|
return 'autopilot';
|
||||||
case Type.VANILLA:
|
case Type.VANILLA:
|
||||||
return 'vanilla';
|
return 'vanilla';
|
||||||
|
case Type.SCOREV2:
|
||||||
|
return 'scorev2';
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getGamemodeInt = (
|
export const getGamemodeInt = (
|
||||||
mode: 'osu' | 'taiko' | 'catch' | 'mania' | string | undefined,
|
mode: 'osu' | 'taiko' | 'catch' | 'mania' | string | undefined,
|
||||||
type: 'vanilla' | 'relax' | 'autopilot' | string | undefined
|
type: 'vanilla' | 'relax' | 'autopilot' | 'scorev2' | string | undefined
|
||||||
) => {
|
) => {
|
||||||
let modee = 0;
|
let modee = 0;
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
@@ -108,6 +144,9 @@ export const getGamemodeInt = (
|
|||||||
case 'autopilot':
|
case 'autopilot':
|
||||||
modee += Type.AUTOPILOT;
|
modee += Type.AUTOPILOT;
|
||||||
break;
|
break;
|
||||||
|
case 'scorev2':
|
||||||
|
modee += Type.SCOREV2;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return modee;
|
return modee;
|
||||||
@@ -115,7 +154,7 @@ export const getGamemodeInt = (
|
|||||||
|
|
||||||
export const getGamemodeName = (
|
export const getGamemodeName = (
|
||||||
mode: 'osu' | 'taiko' | 'catch' | 'mania' | string | undefined,
|
mode: 'osu' | 'taiko' | 'catch' | 'mania' | string | undefined,
|
||||||
type: 'vanilla' | 'relax' | 'autopilot' | string | undefined
|
type: 'vanilla' | 'relax' | 'autopilot' | 'scorev2' | string | undefined
|
||||||
) => {
|
) => {
|
||||||
let modeStr = '';
|
let modeStr = '';
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
@@ -140,6 +179,9 @@ export const getGamemodeName = (
|
|||||||
case 'autopilot':
|
case 'autopilot':
|
||||||
modeStr += 'ap';
|
modeStr += 'ap';
|
||||||
break;
|
break;
|
||||||
|
case 'scorev2':
|
||||||
|
modeStr += 'v2';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
modeStr += 'vn';
|
modeStr += 'vn';
|
||||||
break;
|
break;
|
||||||
@@ -173,6 +215,9 @@ export const getModeAndTypeFromGamemode = (gamemode: number) => {
|
|||||||
case Type.AUTOPILOT:
|
case Type.AUTOPILOT:
|
||||||
type = Type.AUTOPILOT;
|
type = Type.AUTOPILOT;
|
||||||
break;
|
break;
|
||||||
|
case Type.SCOREV2:
|
||||||
|
type = Type.SCOREV2;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,5 @@
|
|||||||
import { active_custom_theme, custom_themes } from './global';
|
import { active_custom_theme, custom_themes } from './global';
|
||||||
import { setGlobalVolume } from './utils';
|
import { disableMediaControls, setGlobalVolume } from './utils';
|
||||||
import { betterFetch } from '@better-fetch/fetch';
|
import { betterFetch } from '@better-fetch/fetch';
|
||||||
import { convertFileSrc } from '@tauri-apps/api/core';
|
import { convertFileSrc } from '@tauri-apps/api/core';
|
||||||
import { invoke } from '@tauri-apps/api/core';
|
import { invoke } from '@tauri-apps/api/core';
|
||||||
@@ -268,6 +268,7 @@ export const loadTheme = async (theme: Theme, themeContainer: HTMLElement, volum
|
|||||||
themeScript.mountTheme(themeContainer, { assets: theme.assets });
|
themeScript.mountTheme(themeContainer, { assets: theme.assets });
|
||||||
}
|
}
|
||||||
setGlobalVolume(volume);
|
setGlobalVolume(volume);
|
||||||
|
disableMediaControls();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deleteTheme = async (themeToUninstall: Theme) => {
|
export const deleteTheme = async (themeToUninstall: Theme) => {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
export type LaunchView = 'HOME' | 'LOGIN' | 'SETTINGS' | 'THEMES';
|
||||||
|
|
||||||
export type EZPPUserResponse = {
|
export type EZPPUserResponse = {
|
||||||
code: number;
|
code: number;
|
||||||
message: string;
|
message: string;
|
||||||
|
|||||||
@@ -203,6 +203,43 @@ export function trackMediaContainer(node: HTMLElement) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MEDIA_ACTIONS: MediaSessionAction[] = [
|
||||||
|
'play',
|
||||||
|
'pause',
|
||||||
|
'stop',
|
||||||
|
'previoustrack',
|
||||||
|
'nexttrack',
|
||||||
|
'seekbackward',
|
||||||
|
'seekforward',
|
||||||
|
];
|
||||||
|
|
||||||
|
export function disableMediaControls() {
|
||||||
|
const mediaElements: NodeListOf<HTMLMediaElement> = document.querySelectorAll('audio, video');
|
||||||
|
|
||||||
|
if ('mediaSession' in navigator) {
|
||||||
|
MEDIA_ACTIONS.forEach((action) => {
|
||||||
|
try {
|
||||||
|
navigator.mediaSession.setActionHandler(action, () => {});
|
||||||
|
} catch {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener(
|
||||||
|
'keydown',
|
||||||
|
(e: KeyboardEvent) => {
|
||||||
|
if (e.key.startsWith('Media')) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
mediaElements.forEach((el) => {
|
||||||
|
el.disableRemotePlayback = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function calculateGitBlobSha(fileBuffer: Buffer): string {
|
export function calculateGitBlobSha(fileBuffer: Buffer): string {
|
||||||
const header = Buffer.from(`blob ${fileBuffer.length}\0`);
|
const header = Buffer.from(`blob ${fileBuffer.length}\0`);
|
||||||
const store = Buffer.concat([header, fileBuffer]);
|
const store = Buffer.concat([header, fileBuffer]);
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
const localThemes = await getThemes();
|
const localThemes = await getThemes();
|
||||||
const lastThemeName = await config_theme.get('Default');
|
const lastThemeName = await config_theme.get('Default');
|
||||||
const last_theme = localThemes.find((t) => t.name === lastThemeName);
|
const last_theme = localThemes.find((t) => t.name === lastThemeName);
|
||||||
if (!last_theme) {
|
if (!last_theme || $platform === 'linux') {
|
||||||
await config.value<string>('theme').set('Default');
|
await config.value<string>('theme').set('Default');
|
||||||
loadTheme(localThemes[0], $custom_theme_container!, await config_theme_volume.get(0.15));
|
loadTheme(localThemes[0], $custom_theme_container!, await config_theme_volume.get(0.15));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+103
-28
@@ -2,7 +2,6 @@
|
|||||||
import DefaultThemePreview from '$assets/default_preview.png';
|
import DefaultThemePreview from '$assets/default_preview.png';
|
||||||
import Logo from '$assets/logo.png';
|
import Logo from '$assets/logo.png';
|
||||||
import { ezppfarm } from '$lib/api/ezpp';
|
import { ezppfarm } from '$lib/api/ezpp';
|
||||||
import { osuapi } from '$lib/api/osuapi';
|
|
||||||
import * as AlertDialog from '$lib/components/ui/alert-dialog';
|
import * as AlertDialog from '$lib/components/ui/alert-dialog';
|
||||||
import * as Avatar from '$lib/components/ui/avatar';
|
import * as Avatar from '$lib/components/ui/avatar';
|
||||||
import Badge from '$lib/components/ui/badge/badge.svelte';
|
import Badge from '$lib/components/ui/badge/badge.svelte';
|
||||||
@@ -88,7 +87,7 @@
|
|||||||
loadTheme,
|
loadTheme,
|
||||||
type ThemeInfo,
|
type ThemeInfo,
|
||||||
} from '$lib/themes';
|
} from '$lib/themes';
|
||||||
import { EZPPActionStatus } from '$lib/types';
|
import { EZPPActionStatus, type LaunchView } from '$lib/types';
|
||||||
import { currentUser } from '$lib/userAuthentication';
|
import { currentUser } from '$lib/userAuthentication';
|
||||||
import {
|
import {
|
||||||
cursorSmoothening,
|
cursorSmoothening,
|
||||||
@@ -141,7 +140,7 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { fade, fly, scale } from 'svelte/transition';
|
import { fade, fly, scale } from 'svelte/transition';
|
||||||
|
|
||||||
let selectedView = $state('home');
|
let selectedView = $state<LaunchView>('HOME');
|
||||||
let progress = $state(-1);
|
let progress = $state(-1);
|
||||||
let launchInfo = $state('');
|
let launchInfo = $state('');
|
||||||
let launchError = $state<Error | undefined>(undefined);
|
let launchError = $state<Error | undefined>(undefined);
|
||||||
@@ -151,6 +150,8 @@
|
|||||||
|
|
||||||
let downloadingUpdate = $state(false);
|
let downloadingUpdate = $state(false);
|
||||||
|
|
||||||
|
let updateCheckFailed = $state(false);
|
||||||
|
|
||||||
let dragAndDrop = useDropZone({
|
let dragAndDrop = useDropZone({
|
||||||
onDrop: async (file) => {
|
onDrop: async (file) => {
|
||||||
const firstFile = file[0];
|
const firstFile = file[0];
|
||||||
@@ -245,7 +246,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const launch = async () => {
|
const launch = async (skipUpdateCheck = false) => {
|
||||||
if ($launching) return;
|
if ($launching) return;
|
||||||
launchInfo = 'Checking if osu! is already running...';
|
launchInfo = 'Checking if osu! is already running...';
|
||||||
launching.set(true);
|
launching.set(true);
|
||||||
@@ -302,9 +303,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!skipUpdateCheck) {
|
||||||
try {
|
try {
|
||||||
launchInfo = 'Looking for file updates...';
|
launchInfo = 'Looking for file updates...';
|
||||||
const updateResult = await getEZPPLauncherUpdateFiles(osuPath, $launcherStream);
|
let launchStream = $launcherStream;
|
||||||
|
if ($platform !== 'windows') launchStream = 'stable'; //fallback to stable for non windows systems
|
||||||
|
const updateResult = await getEZPPLauncherUpdateFiles(osuPath, launchStream);
|
||||||
|
|
||||||
if (updateResult) {
|
if (updateResult) {
|
||||||
if (updateResult.filesToDownload.length > 0) {
|
if (updateResult.filesToDownload.length > 0) {
|
||||||
@@ -334,15 +338,18 @@
|
|||||||
launching.set(false);
|
launching.set(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const streamInfo = await osuapi.latestBuildVersion('stable40');
|
if (!skipUpdateCheck) {
|
||||||
|
const streamInfo = await ezppfarm.latestBuildVersion('stable40');
|
||||||
if (!streamInfo) {
|
if (!streamInfo) {
|
||||||
sileo.error({
|
sileo.error({
|
||||||
title: 'Hmmm...',
|
title: 'Hmmm...',
|
||||||
description: 'Failed to check for updates, maybe osu! is down?',
|
description: 'Failed to check for updates, maybe osu! is down?',
|
||||||
});
|
});
|
||||||
launching.set(false);
|
launching.set(false);
|
||||||
|
updateCheckFailed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,6 +409,7 @@
|
|||||||
} else {
|
} else {
|
||||||
launchInfo = 'You are up to date!';
|
launchInfo = 'You are up to date!';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($currentUser) {
|
if ($currentUser) {
|
||||||
const [username, password] = await Promise.all([
|
const [username, password] = await Promise.all([
|
||||||
config.value<string>('username').get(''),
|
config.value<string>('username').get(''),
|
||||||
@@ -573,6 +581,7 @@
|
|||||||
const beatmapCoverImage = `https://assets.ppy.sh/beatmaps/${userStatus.player_status.status.beatmap.set_id}/covers/list@2x.jpg`;
|
const beatmapCoverImage = `https://assets.ppy.sh/beatmaps/${userStatus.player_status.status.beatmap.set_id}/covers/list@2x.jpg`;
|
||||||
const isValidImage = await urlIsValidImage(beatmapCoverImage);
|
const isValidImage = await urlIsValidImage(beatmapCoverImage);
|
||||||
if (isValidImage) largeImageKey = beatmapCoverImage;
|
if (isValidImage) largeImageKey = beatmapCoverImage;
|
||||||
|
if (userStatus.player_status.status.action !== EZPPActionStatus.DIRECT)
|
||||||
customButton = {
|
customButton = {
|
||||||
text: 'View Beatmap',
|
text: 'View Beatmap',
|
||||||
url: `https://ez-pp.farm/beatmapsets/${userStatus.player_status.status.beatmap.set_id}/${userStatus.player_status.status.beatmap.id}`,
|
url: `https://ez-pp.farm/beatmapsets/${userStatus.player_status.status.beatmap.set_id}/${userStatus.player_status.status.beatmap.id}`,
|
||||||
@@ -710,7 +719,7 @@
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
currentUser.set(loginResult.user);
|
currentUser.set(loginResult.user);
|
||||||
selectedView = 'home';
|
selectedView = 'HOME';
|
||||||
} else {
|
} else {
|
||||||
sileo.error({
|
sileo.error({
|
||||||
title: 'Login failed!',
|
title: 'Login failed!',
|
||||||
@@ -1025,6 +1034,47 @@
|
|||||||
</AlertDialog.Content>
|
</AlertDialog.Content>
|
||||||
</AlertDialog.Root>
|
</AlertDialog.Root>
|
||||||
|
|
||||||
|
<AlertDialog.Root open={updateCheckFailed}>
|
||||||
|
<AlertDialog.Content
|
||||||
|
class="bg-theme-950 border-theme-800 p-0 max-w-2xl"
|
||||||
|
escapeKeydownBehavior="ignore"
|
||||||
|
interactOutsideBehavior="ignore"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="flex flex-col items-center justify-center border-b border-theme-800 bg-black/40 rounded-t-lg p-3"
|
||||||
|
>
|
||||||
|
<Import size={40} />
|
||||||
|
<span class="font-semibold text-xl">Update check failed</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="flex flex-col items-center text-sm text-center bg-theme-900 border border-theme-800 rounded-lg mx-3 p-3"
|
||||||
|
>
|
||||||
|
<p class="mb-4">Failed to check for updates.</p>
|
||||||
|
<p>Do you want to launch anyway?</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-center mb-3 gap-4 mt-4">
|
||||||
|
<Button
|
||||||
|
class="min-w-28"
|
||||||
|
onclick={async () => {
|
||||||
|
await launch(true);
|
||||||
|
updateCheckFailed = false;
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Launch anyways
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
onclick={async () => {
|
||||||
|
updateCheckFailed = false;
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Abort
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</AlertDialog.Content>
|
||||||
|
</AlertDialog.Root>
|
||||||
|
|
||||||
<AlertDialog.Root open={$newVersion === undefined && !!droppedTheme && !themeInstalling}>
|
<AlertDialog.Root open={$newVersion === undefined && !!droppedTheme && !themeInstalling}>
|
||||||
<AlertDialog.Content
|
<AlertDialog.Content
|
||||||
class="bg-theme-950 border-theme-800 p-0 max-w-2xl"
|
class="bg-theme-950 border-theme-800 p-0 max-w-2xl"
|
||||||
@@ -1149,36 +1199,36 @@
|
|||||||
<Badge class="text-[0.5rem] py-0 px-2">{$launcherVersion || 'dev'}</Badge>
|
<Badge class="text-[0.5rem] py-0 px-2">{$launcherVersion || 'dev'}</Badge>
|
||||||
<Button
|
<Button
|
||||||
class="flex size-12 items-center gap-2 ring-1 ring-inset ring-white/15 {selectedView ===
|
class="flex size-12 items-center gap-2 ring-1 ring-inset ring-white/15 {selectedView ===
|
||||||
'home'
|
'HOME'
|
||||||
? 'bg-primary/50'
|
? 'bg-primary/50'
|
||||||
: 'bg-black/20 border-black/20'} hover:bg-primary/50 rounded-[0.85rem] p-3 mt-3"
|
: 'bg-black/20 border-black/20'} hover:bg-primary/50 rounded-[0.85rem] p-3 mt-3"
|
||||||
disabled={$launching}
|
disabled={$launching}
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
if (!$launching) selectedView = 'home';
|
if (!$launching) selectedView = 'HOME';
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<House class="text-theme-200 size-5!" />
|
<House class="text-theme-200 size-5!" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
class="flex size-12 items-center gap-2 ring-1 ring-inset ring-white/15 {selectedView ===
|
class="flex size-12 items-center gap-2 ring-1 ring-inset ring-white/15 {selectedView ===
|
||||||
'themes'
|
'THEMES'
|
||||||
? 'bg-primary/50'
|
? 'bg-primary/50'
|
||||||
: 'bg-black/20 border-black/20'} hover:bg-primary/50 rounded-[0.85rem] p-3 mt-3"
|
: 'bg-black/20 border-black/20'} hover:bg-primary/50 rounded-[0.85rem] p-3 mt-3"
|
||||||
disabled={$launching}
|
disabled={$launching}
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
if (!$launching) selectedView = 'themes';
|
if (!$launching) selectedView = 'THEMES';
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Paintbrush class="text-theme-200 size-5!" />
|
<Paintbrush class="text-theme-200 size-5!" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
class="flex size-12 items-center gap-2 ring-1 ring-inset ring-white/15 {selectedView ===
|
class="flex size-12 items-center gap-2 ring-1 ring-inset ring-white/15 {selectedView ===
|
||||||
'settings'
|
'SETTINGS'
|
||||||
? 'bg-primary/50'
|
? 'bg-primary/50'
|
||||||
: 'bg-black/20 border-black/20'} hover:bg-primary/50 rounded-[0.85rem] p-3 mt-3"
|
: 'bg-black/20 border-black/20'} hover:bg-primary/50 rounded-[0.85rem] p-3 mt-3"
|
||||||
disabled={$launching}
|
disabled={$launching}
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
if (!$launching) selectedView = 'settings';
|
if (!$launching) selectedView = 'SETTINGS';
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Settings class="text-theme-200 size-5!" />
|
<Settings class="text-theme-200 size-5!" />
|
||||||
@@ -1209,14 +1259,14 @@
|
|||||||
});
|
});
|
||||||
currentUser.set(undefined);
|
currentUser.set(undefined);
|
||||||
currentUserInfo.set(undefined);
|
currentUserInfo.set(undefined);
|
||||||
selectedView = 'home';
|
selectedView = 'HOME';
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LogOut class="size-3.5 mr-2" />
|
<LogOut class="size-3.5 mr-2" />
|
||||||
Logout
|
Logout
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
{:else}
|
{:else}
|
||||||
<DropdownMenu.Item class="text-xs" onclick={() => (selectedView = 'login')}>
|
<DropdownMenu.Item class="text-xs" onclick={() => (selectedView = 'LOGIN')}>
|
||||||
<LogIn class="size-3.5 mr-2" />
|
<LogIn class="size-3.5 mr-2" />
|
||||||
Login
|
Login
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
@@ -1226,7 +1276,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="z-10 h-full overflow-hidden">
|
<div class="z-10 h-full overflow-hidden">
|
||||||
{#if selectedView === 'home'}
|
{#if selectedView === 'HOME'}
|
||||||
<div
|
<div
|
||||||
class="flex flex-col-reverse h-full"
|
class="flex flex-col-reverse h-full"
|
||||||
in:fly={{
|
in:fly={{
|
||||||
@@ -1351,7 +1401,7 @@
|
|||||||
? 'No connection...'
|
? 'No connection...'
|
||||||
: undefined}
|
: undefined}
|
||||||
disabled={$osuInstallationPath === '' || $serverConnectionFails > 1}
|
disabled={$osuInstallationPath === '' || $serverConnectionFails > 1}
|
||||||
onClick={launch}
|
onClick={async () => await launch()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative h-50">
|
<div class="relative h-50">
|
||||||
@@ -1382,7 +1432,7 @@
|
|||||||
{getGamemodeName(modeIntToStr(selectedMode), typeIntToStr(selectedType))}
|
{getGamemodeName(modeIntToStr(selectedMode), typeIntToStr(selectedType))}
|
||||||
</div>
|
</div>
|
||||||
</Select.Trigger>
|
</Select.Trigger>
|
||||||
<Select.Content class="bg-theme-950 border border-theme-900 rounded-lg">
|
<Select.Content class="bg-theme-950 border border-theme-900 rounded-lg max-h-72">
|
||||||
{#each validModeTypeCombinationsSorted as gamemode (gamemode)}
|
{#each validModeTypeCombinationsSorted as gamemode (gamemode)}
|
||||||
{@const gamemod = getModeAndTypeFromGamemode(gamemode)}
|
{@const gamemod = getModeAndTypeFromGamemode(gamemode)}
|
||||||
<Select.Item value={gamemode.toFixed()}>
|
<Select.Item value={gamemode.toFixed()}>
|
||||||
@@ -1522,7 +1572,7 @@
|
|||||||
<Button
|
<Button
|
||||||
class="flex-1 h-7 text-xs"
|
class="flex-1 h-7 text-xs"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
selectedView = 'login';
|
selectedView = 'LOGIN';
|
||||||
}}>Log In</Button
|
}}>Log In</Button
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
@@ -1543,7 +1593,7 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{:else if selectedView === 'settings'}
|
{:else if selectedView === 'SETTINGS'}
|
||||||
<div
|
<div
|
||||||
class="h-screen w-full flex flex-col items-center justify-center bg-black/20 backdrop-blur-sm"
|
class="h-screen w-full flex flex-col items-center justify-center bg-black/20 backdrop-blur-sm"
|
||||||
in:fly={{
|
in:fly={{
|
||||||
@@ -1558,17 +1608,16 @@
|
|||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<Label class="text-sm" for="setting-patch">Patching</Label>
|
<Label class="text-sm" for="setting-patch">Patching</Label>
|
||||||
<div class="text-muted-foreground text-xs">
|
<div class="text-muted-foreground text-xs">
|
||||||
Shows misses in Relax and Autopilot {#if $platform !== 'windows'}<span
|
Shows misses in Relax and Autopilot {#if $platform !== 'windows'}<!-- <span
|
||||||
class="text-red-500 bg-red-800/20 border border-red-600/20 p-0.5 mx-1 px-2 rounded-lg text-[0.55rem]!"
|
class="text-red-500 bg-red-800/20 border border-red-600/20 p-0.5 mx-1 px-2 rounded-lg text-[0.55rem]!"
|
||||||
>currently only on windows!</span
|
>currently only on windows!</span
|
||||||
>
|
> -->
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id="setting-patch"
|
id="setting-patch"
|
||||||
checked={$platform === 'windows' ? $patch : false}
|
checked={$patch}
|
||||||
disabled={$platform !== 'windows'}
|
|
||||||
onCheckedChange={async (e) => {
|
onCheckedChange={async (e) => {
|
||||||
patch.set(e);
|
patch.set(e);
|
||||||
}}
|
}}
|
||||||
@@ -1717,6 +1766,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row w-full">
|
<div class="flex flex-row w-full">
|
||||||
|
<!-- only stable release stream for linux -->
|
||||||
<Select.Root
|
<Select.Root
|
||||||
type="single"
|
type="single"
|
||||||
bind:value={$launcherStream}
|
bind:value={$launcherStream}
|
||||||
@@ -1762,7 +1812,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{:else if selectedView === 'login'}
|
{:else if selectedView === 'LOGIN'}
|
||||||
<div
|
<div
|
||||||
class="h-screen w-full flex flex-col items-center justify-center bg-black/20 backdrop-blur-sm"
|
class="h-screen w-full flex flex-col items-center justify-center bg-black/20 backdrop-blur-sm"
|
||||||
in:fly={{
|
in:fly={{
|
||||||
@@ -1813,7 +1863,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{:else if selectedView === 'themes'}
|
{:else if selectedView === 'THEMES'}
|
||||||
<div
|
<div
|
||||||
class="h-screen w-full flex flex-col items-center bg-black/20 backdrop-blur-sm"
|
class="h-screen w-full flex flex-col items-center bg-black/20 backdrop-blur-sm"
|
||||||
in:fly={{
|
in:fly={{
|
||||||
@@ -1824,6 +1874,23 @@
|
|||||||
}}
|
}}
|
||||||
out:fly={{ duration: $reduceAnimations ? 0 : 400, y: -5, opacity: 0 }}
|
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}>
|
<ScrollContainer class="pt-8" topOffset={45}>
|
||||||
<div class="grid w-full gap-1 grid-cols-3 p-3 pr-5">
|
<div class="grid w-full gap-1 grid-cols-3 p-3 pr-5">
|
||||||
{#each $custom_themes as theme (theme.folder_name)}
|
{#each $custom_themes as theme (theme.folder_name)}
|
||||||
@@ -1868,7 +1935,10 @@
|
|||||||
} else {
|
} else {
|
||||||
const downloadThemeResult = await downloadTheme(theme);
|
const downloadThemeResult = await downloadTheme(theme);
|
||||||
if (!downloadThemeResult.success) {
|
if (!downloadThemeResult.success) {
|
||||||
if (downloadThemeResult.error && downloadThemeResult.error.length > 0) {
|
if (
|
||||||
|
downloadThemeResult.error &&
|
||||||
|
downloadThemeResult.error.length > 0
|
||||||
|
) {
|
||||||
sileo.error({
|
sileo.error({
|
||||||
title: 'Uhhm..',
|
title: 'Uhhm..',
|
||||||
description: downloadThemeResult.error,
|
description: downloadThemeResult.error,
|
||||||
@@ -1909,7 +1979,11 @@
|
|||||||
onclick={async () => {
|
onclick={async () => {
|
||||||
const defaultTheme = $custom_themes.find((t) => t.name === 'Default');
|
const defaultTheme = $custom_themes.find((t) => t.name === 'Default');
|
||||||
if (defaultTheme) {
|
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);
|
await config.value<string>('theme').set(defaultTheme.name);
|
||||||
|
|
||||||
if (!(await downloadTheme(theme, true))) {
|
if (!(await downloadTheme(theme, true))) {
|
||||||
@@ -1966,6 +2040,7 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
</ScrollContainer>
|
</ScrollContainer>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
discordPresence,
|
discordPresence,
|
||||||
osuBuild,
|
osuBuild,
|
||||||
osuStream,
|
osuStream,
|
||||||
platform,
|
|
||||||
presenceLoading,
|
presenceLoading,
|
||||||
skins,
|
skins,
|
||||||
skinsCount,
|
skinsCount,
|
||||||
@@ -266,17 +265,16 @@
|
|||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<Label class="text-sm" for="setting-patch">Patching</Label>
|
<Label class="text-sm" for="setting-patch">Patching</Label>
|
||||||
<div class="text-muted-foreground text-xs">
|
<div class="text-muted-foreground text-xs">
|
||||||
Shows misses in Relax and Autopilot {#if $platform !== 'windows'}<span
|
Shows misses in Relax and Autopilot <!-- {#if $platform !== 'windows'}<span
|
||||||
class="text-red-500 bg-red-800/20 border border-red-600/20 p-0.5 mx-1 px-2 rounded-lg text-[0.55rem]!"
|
class="text-red-500 bg-red-800/20 border border-red-600/20 p-0.5 mx-1 px-2 rounded-lg text-[0.55rem]!"
|
||||||
>currently only on windows!</span
|
>currently only on windows!</span
|
||||||
>
|
>
|
||||||
{/if}
|
{/if} -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id="setting-patch"
|
id="setting-patch"
|
||||||
checked={$platform === 'windows' ? $patch : false}
|
checked={$patch}
|
||||||
disabled={$platform !== 'windows'}
|
|
||||||
onCheckedChange={async (e) => {
|
onCheckedChange={async (e) => {
|
||||||
patch.set(e);
|
patch.set(e);
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user