You've already forked AstralRinth
* fix tauri config * fix package patch * regen pnpm lock * use new workflow * New GH actions * Update lockfile * update scripts * Fix build script * Fix missing deps * Fix assets eslint * Update libraries lint * Fix all lint configs * update lockfile * add fmt + clippy fails * Separate App Tauri portion * fix app features * Fix lints * install tauri cli * update lockfile * corepack, fix lints * add store path * fix unused import * Fix tests * Issue templates + port over tauri release * fix actions * fix before build command * Add X86 target * Update build matrix * finalize actions * make debug build smaller * Use debug build to make cache smaller * dummy commit * change proj name * update file name * Use release builds for less space use * Remove rust cache * Readd for app build * add merge queue trigger
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
/**
|
|
* All theseus API calls return serialized values (both return values and errors);
|
|
* So, for example, addDefaultInstance creates a blank Profile object, where the Rust struct is serialized,
|
|
* and deserialized into a usable JS object.
|
|
*/
|
|
import { invoke } from '@tauri-apps/api/tauri'
|
|
|
|
// Settings object
|
|
/*
|
|
|
|
Settings {
|
|
"memory": MemorySettings,
|
|
"game_resolution": [int int],
|
|
"custom_java_args": [String ...],
|
|
"custom_env_args" : [(string, string) ... ]>,
|
|
"java_globals": Hash of (string, Path),
|
|
"default_user": Uuid string (can be null),
|
|
"hooks": Hooks,
|
|
"max_concurrent_downloads": uint,
|
|
"version": u32,
|
|
"collapsed_navigation": bool,
|
|
}
|
|
|
|
Memorysettings {
|
|
"min": u32, can be null,
|
|
"max": u32,
|
|
}
|
|
|
|
*/
|
|
|
|
// Get full settings object
|
|
export async function get() {
|
|
return await invoke('plugin:settings|settings_get')
|
|
}
|
|
|
|
// Set full settings object
|
|
export async function set(settings) {
|
|
return await invoke('plugin:settings|settings_set', { settings })
|
|
}
|
|
|
|
// Changes the config dir
|
|
// Seizes the entire application state until its done
|
|
export async function change_config_dir(newConfigDir) {
|
|
return await invoke('plugin:settings|settings_change_config_dir', { newConfigDir })
|
|
}
|
|
|
|
export async function is_dir_writeable(newConfigDir) {
|
|
return await invoke('plugin:settings|settings_is_dir_writeable', { newConfigDir })
|
|
}
|