You've already forked AstralRinth
forked from didirus/AstralRinth
Modpack support (#60)
* Modpack support * Finish feature * Tauri errors fix (#61) * async impl * working * fmt and redundancy * moved ? to if let Ok block * Finish modpacks support * remove generated file * fix compile err * fix lint * Fix code review comments + forge support --------- Co-authored-by: Wyatt Verchere <wverchere@gmail.com>
This commit is contained in:
16
theseus_gui/src/helpers/pack.js
Normal file
16
theseus_gui/src/helpers/pack.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* 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'
|
||||
|
||||
// Installs pack from a version ID
|
||||
export async function install(version_id) {
|
||||
return await invoke('pack_install_version_id', version_id)
|
||||
}
|
||||
|
||||
// Installs pack from a path
|
||||
export async function install_from_file(path) {
|
||||
return await invoke('pack_install_file', path)
|
||||
}
|
||||
@@ -16,16 +16,6 @@ export async function create() {
|
||||
return await invoke('profile_create')
|
||||
}
|
||||
|
||||
// Add a profile to the in-memory state
|
||||
export async function add(profile) {
|
||||
return await invoke('profile_add', { profile })
|
||||
}
|
||||
|
||||
// Add a path as a profile in-memory
|
||||
export async function add_path(path) {
|
||||
return await invoke('profile_add_path', { path })
|
||||
}
|
||||
|
||||
// Remove a profile
|
||||
export async function remove(path) {
|
||||
return await invoke('profile_remove', { path })
|
||||
@@ -37,18 +27,6 @@ export async function get(path) {
|
||||
return await invoke('profile_get', { path })
|
||||
}
|
||||
|
||||
// Check if a pathed profile is already managed by Theseus
|
||||
// Returns bool
|
||||
export async function is_managed(path) {
|
||||
return await invoke('profile_is_managed', { path })
|
||||
}
|
||||
|
||||
// Check if a pathed profile is loaded
|
||||
// Returns bool
|
||||
export async function is_loaded(path) {
|
||||
return await invoke('profile_is_loaded', { path })
|
||||
}
|
||||
|
||||
// Get a copy of the profile set
|
||||
// Returns hashmap of path -> Profile
|
||||
export async function list() {
|
||||
|
||||
Reference in New Issue
Block a user