2024-06-22 17:17:07 -06:00
|
|
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
|
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
|
|
|
|
2024-06-22 20:30:23 -06:00
|
|
|
use std::collections::{HashMap, HashSet};
|
2024-06-22 17:52:25 -06:00
|
|
|
use std::{io::Cursor, path::PathBuf};
|
|
|
|
use std::io::Seek;
|
2024-06-22 20:30:23 -06:00
|
|
|
use serde_json::{Map, Result, Value};
|
|
|
|
use serde::Serialize;
|
|
|
|
use serde::Deserialize;
|
2024-06-22 17:52:25 -06:00
|
|
|
|
|
|
|
mod ftp;
|
2024-06-22 20:30:23 -06:00
|
|
|
mod java;
|
|
|
|
mod prism;
|
|
|
|
mod system_dirs;
|
|
|
|
mod util;
|
|
|
|
mod modpack;
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
|
|
struct ModpackEntry{
|
|
|
|
name: String,
|
|
|
|
id: String
|
|
|
|
}
|
2024-06-22 17:52:25 -06:00
|
|
|
|
2024-06-22 17:17:07 -06:00
|
|
|
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
|
|
|
|
#[tauri::command]
|
|
|
|
fn greet(name: &str) -> String {
|
|
|
|
format!("Hello, {}! You've been greeted from Rust!", name)
|
|
|
|
}
|
|
|
|
|
2024-06-22 17:52:25 -06:00
|
|
|
|
2024-06-22 17:17:07 -06:00
|
|
|
fn main() {
|
2024-06-22 20:30:23 -06:00
|
|
|
prism::install_prism();
|
2024-06-22 17:17:07 -06:00
|
|
|
tauri::Builder::default()
|
2024-06-23 00:49:03 -06:00
|
|
|
.invoke_handler(tauri::generate_handler![greet, modpack::get_modpacks, modpack::launch_modpack, prism::launch_prism])
|
2024-06-22 17:17:07 -06:00
|
|
|
.run(tauri::generate_context!())
|
|
|
|
.expect("error while running tauri application");
|
|
|
|
}
|