aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/ui/mod.rs
diff options
context:
space:
mode:
authorHsiangNianian <i@jyunko.cn>2026-01-13 14:31:37 +0800
committerHsiangNianian <i@jyunko.cn>2026-01-13 14:31:37 +0800
commitf878efe456e8f5c557f2cde9d71f120f3e0b38cd (patch)
treed6e54b7dc262502f2ef9dc011fcff6ad2aba2d54 /src/ui/mod.rs
parent225f87bf713492daef83a85e9e2a0bfdb0f9d23f (diff)
downloadDropOut-f878efe456e8f5c557f2cde9d71f120f3e0b38cd.tar.gz
DropOut-f878efe456e8f5c557f2cde9d71f120f3e0b38cd.zip
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.
Diffstat (limited to 'src/ui/mod.rs')
-rw-r--r--src/ui/mod.rs39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/ui/mod.rs b/src/ui/mod.rs
deleted file mode 100644
index 3ee1e6a..0000000
--- a/src/ui/mod.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-use gtk::prelude::*;
-use gtk::{Button, Window, WindowType};
-use tokio::sync::mpsc::Sender;
-
-pub enum UiEvent {
- StartGame,
-}
-
-pub fn init(tx: Sender<UiEvent>) {
- if gtk::init().is_err() {
- println!("Failed to initialize GTK.");
- return;
- }
-
- let window = Window::new(WindowType::Toplevel);
- window.set_title("Minecraft 启动器");
- window.set_default_size(350, 70);
-
- let button = Button::with_label("开始游戏");
- let tx_clone = tx.clone();
- button.connect_clicked(move |_| {
- println!("开始游戏按钮被点击");
- // Use blocking_send because we are in a synchronous callback
- if let Err(e) = tx_clone.blocking_send(UiEvent::StartGame) {
- eprintln!("Failed to send event: {}", e);
- }
- });
-
- window.add(&button);
-
- window.connect_delete_event(|_, _| {
- gtk::main_quit();
- Inhibit(false)
- });
-
- window.show_all();
-
- gtk::main();
-}