FCLauncher/FCLauncher/src-tauri/src/main.rs

38 lines
989 B
Rust
Raw Normal View History

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")]
use std::collections::{HashMap, HashSet};
2024-06-22 17:52:25 -06:00
use std::{io::Cursor, path::PathBuf};
use std::io::Seek;
use serde_json::{Map, Result, Value};
use serde::Serialize;
use serde::Deserialize;
2024-06-22 17:52:25 -06:00
mod ftp;
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() {
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");
}