Compiler improvements (#145)

* Initial bug fixes

* fix compile error on non-mac

* Fix even more bugs

* Fix more

* fix more

* fix build

* fix build

* working basic

* removed zip

* working functions

* merge fixes

* fixed loadintg bar bug

* changed to one layer deep

* forge version numbers

* improvements + refactoring

* renamed things to fit plugin

* fixed bugs

* removed println

* overrides dont include mrpack

* merge

* fixes

* fixes

* fixed deletion

* merge errors

* force sync before export

* removed testing

* missed line

* removed console log

* mac error reverted

* incoreclty named helper

* added to new register method

* review changes

* minor changes

* moved create pack

* renamed function

---------

Co-authored-by: Jai A <jaiagr+gpg@pm.me>
This commit is contained in:
Wyatt Verchere
2023-06-28 09:58:58 -07:00
committed by GitHub
parent 47970d932b
commit f52e777379
38 changed files with 1047 additions and 896 deletions

View File

@@ -5,11 +5,6 @@
*/
import { invoke } from '@tauri-apps/api/tauri'
// Add empty default instance
export async function create_empty() {
return await invoke('profile_create_empty')
}
/// Add instance
/*
name: String, // the name of the profile, and relative path to create
@@ -22,71 +17,81 @@ export async function create_empty() {
*/
export async function create(name, gameVersion, modloader, loaderVersion, icon) {
return await invoke('profile_create', { name, gameVersion, modloader, loaderVersion, icon })
return await invoke('plugin:profile_create|profile_create', {
name,
gameVersion,
modloader,
loaderVersion,
icon,
})
}
// Remove a profile
export async function remove(path) {
return await invoke('profile_remove', { path })
return await invoke('plugin:profile|profile_remove', { path })
}
// Get a profile by path
// Returns a Profile
export async function get(path, clearProjects) {
return await invoke('profile_get', { path, clearProjects })
return await invoke('plugin:profile|profile_get', { path, clearProjects })
}
// Get optimal java version from profile
// Returns a java version
export async function get_optimal_jre_key(path) {
return await invoke('profile_get_optimal_jre_key', { path })
return await invoke('plugin:profile|profile_get_optimal_jre_key', { path })
}
// Get a copy of the profile set
// Returns hashmap of path -> Profile
export async function list(clearProjects) {
return await invoke('profile_list', { clearProjects })
return await invoke('plugin:profile|profile_list', { clearProjects })
}
export async function check_installed(path, projectId) {
return await invoke('profile_check_installed', { path, projectId })
return await invoke('plugin:profile|profile_check_installed', { path, projectId })
}
// Installs/Repairs a profile
export async function install(path) {
return await invoke('profile_install', { path })
return await invoke('plugin:profile|profile_install', { path })
}
// Updates all of a profile's projects
export async function update_all(path) {
return await invoke('profile_update_all', { path })
return await invoke('plugin:profile|profile_update_all', { path })
}
// Updates a specified project
export async function update_project(path, projectPath) {
return await invoke('profile_update_project', { path, projectPath })
return await invoke('plugin:profile|profile_update_project', { path, projectPath })
}
// Add a project to a profile from a version
// Returns a path to the new project file
export async function add_project_from_version(path, versionId) {
return await invoke('profile_add_project_from_version', { path, versionId })
return await invoke('plugin:profile|profile_add_project_from_version', { path, versionId })
}
// Add a project to a profile from a path + project_type
// Returns a path to the new project file
export async function add_project_from_path(path, projectPath, projectType) {
return await invoke('profile_add_project_from_path', { path, projectPath, projectType })
return await invoke('plugin:profile|profile_add_project_from_path', {
path,
projectPath,
projectType,
})
}
// Toggle disabling a project
export async function toggle_disable_project(path, projectPath) {
return await invoke('profile_toggle_disable_project', { path, projectPath })
return await invoke('plugin:profile|profile_toggle_disable_project', { path, projectPath })
}
// Remove a project
export async function remove_project(path, projectPath) {
return await invoke('profile_remove_project', { path, projectPath })
return await invoke('plugin:profile|profile_remove_project', { path, projectPath })
}
// Export a profile to .mrpack
@@ -116,21 +121,21 @@ export async function get_potential_override_folders(profilePath) {
// Run Minecraft using a pathed profile
// Returns PID of child
export async function run(path) {
return await invoke('profile_run', { path })
return await invoke('plugin:profile|profile_run', { path })
}
// Run Minecraft using a pathed profile
// Waits for end
export async function run_wait(path) {
return await invoke('profile_run_wait', { path })
return await invoke('plugin:profile|profile_run_wait', { path })
}
// Edits a profile
export async function edit(path, editProfile) {
return await invoke('profile_edit', { path, editProfile })
return await invoke('plugin:profile|profile_edit', { path, editProfile })
}
// Edits a profile's icon
export async function edit_icon(path, iconPath) {
return await invoke('profile_edit_icon', { path, iconPath })
return await invoke('plugin:profile|profile_edit_icon', { path, iconPath })
}