From f878efe456e8f5c557f2cde9d71f120f3e0b38cd Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Tue, 13 Jan 2026 14:31:37 +0800 Subject: feat: add Minecraft DropOut launcher with version fetching and basic UI - Implemented version manifest fetching from Mojang API. - Created launcher configuration and main launcher logic. - Added SVG and PNG icons for the application. - Developed a simple HTML/CSS interface for the launcher. - Integrated Tauri commands for backend communication. - Added utility functions for file operations and config parsing. --- src-tauri/src/main.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src-tauri/src/main.rs (limited to 'src-tauri/src/main.rs') diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs new file mode 100644 index 0000000..fdd0794 --- /dev/null +++ b/src-tauri/src/main.rs @@ -0,0 +1,32 @@ +// Prevents additional console window on Windows in release, DO NOT REMOVE!! +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +mod core; +mod launcher; + +#[tauri::command] +async fn start_game() -> Result { + println!("Backend received StartGame"); + match core::manifest::fetch_version_manifest().await { + Ok(manifest) => { + let msg = format!( + "Fetched manifest.\nLatest release: {}\nLatest snapshot: {}", + manifest.latest.release, manifest.latest.snapshot + ); + println!("{}", msg); + Ok(msg) + } + Err(e) => { + eprintln!("Error fetching manifest: {}", e); + Err(e.to_string()) + } + } +} + +fn main() { + tauri::Builder::default() + .plugin(tauri_plugin_shell::init()) + .invoke_handler(tauri::generate_handler![start_game]) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} -- cgit v1.2.3-70-g09d2