1
0

Merge remote-tracking branch 'upstream/main' into beta

This commit is contained in:
2025-08-16 22:38:14 +03:00
844 changed files with 105393 additions and 102744 deletions

View File

@@ -1,13 +1,14 @@
import { get_full_path, get_mod_full_path } from '@/helpers/profile'
import { invoke } from '@tauri-apps/api/core'
import { get_full_path, get_mod_full_path } from '@/helpers/profile'
export async function isDev() {
return await invoke('is_dev')
return await invoke('is_dev')
}
// One of 'Windows', 'Linux', 'MacOS'
export async function getOS() {
return await invoke('plugin:utils|get_os')
return await invoke('plugin:utils|get_os')
}
// [AR] Feature. Updater
@@ -27,52 +28,52 @@ export async function initAuthlibPatching(minecraftVersion, isMojang) {
}
export async function openPath(path) {
return await invoke('plugin:utils|open_path', { path })
return await invoke('plugin:utils|open_path', { path })
}
export async function highlightInFolder(path) {
return await invoke('plugin:utils|highlight_in_folder', { path })
return await invoke('plugin:utils|highlight_in_folder', { path })
}
export async function showLauncherLogsFolder() {
return await invoke('plugin:utils|show_launcher_logs_folder', {})
return await invoke('plugin:utils|show_launcher_logs_folder', {})
}
// Opens a profile's folder in the OS file explorer
export async function showProfileInFolder(path) {
const fullPath = await get_full_path(path)
return await openPath(fullPath)
const fullPath = await get_full_path(path)
return await openPath(fullPath)
}
export async function highlightModInProfile(profilePath, projectPath) {
const fullPath = await get_mod_full_path(profilePath, projectPath)
return await highlightInFolder(fullPath)
const fullPath = await get_mod_full_path(profilePath, projectPath)
return await highlightInFolder(fullPath)
}
export async function restartApp() {
return await invoke('restart_app')
return await invoke('restart_app')
}
/**
* @deprecated This method is no longer needed, and just returns its parameter
*/
export function sanitizePotentialFileUrl(url) {
return url
return url
}
export const releaseColor = (releaseType) => {
switch (releaseType) {
case 'release':
return 'green'
case 'beta':
return 'orange'
case 'alpha':
return 'red'
default:
return ''
}
switch (releaseType) {
case 'release':
return 'green'
case 'beta':
return 'orange'
case 'alpha':
return 'red'
default:
return ''
}
}
export async function copyToClipboard(text) {
await navigator.clipboard.writeText(text)
await navigator.clipboard.writeText(text)
}