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. --- ui/main.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ui/main.js (limited to 'ui/main.js') diff --git a/ui/main.js b/ui/main.js new file mode 100644 index 0000000..33099cd --- /dev/null +++ b/ui/main.js @@ -0,0 +1,15 @@ +const { invoke } = window.__TAURI__.core; + +const startBtn = document.getElementById("start-game-btn"); +const statusText = document.getElementById("status-text"); + +startBtn.addEventListener("click", async () => { + statusText.textContent = "正在获取 Manifest..."; + try { + const response = await invoke("start_game"); + statusText.textContent = response; + } catch (error) { + statusText.textContent = "错误: " + error; + console.error(error); + } +}); -- cgit v1.2.3-70-g09d2