aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/main.js
blob: 33099cdfb1284b9c5ab520c0208952f1eb0011b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);
    }
});