Skip to content

Commit 68b2c1d

Browse files
committed
a few minor qol changes
1 parent 697233b commit 68b2c1d

File tree

4 files changed

+40
-9
lines changed

4 files changed

+40
-9
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
# other
27+
/target/

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "MCSniperRust"
3-
version = "0.1.0"
3+
version = "0.1.2"
44
description = "A name sniper"
55
authors = ["sushi"]
66
edition = "2021"

src-tauri/src/sniper.rs

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,27 @@ use crate::{
1818

1919
#[tauri::command]
2020
pub fn stop() {
21+
match app_handle().get_webview_window("main") {
22+
Some(window) => {
23+
match window.set_title("MCSniperRust - Stopping...") {
24+
Ok(_) => {}
25+
_ => {
26+
log(
27+
"ERROR",
28+
Color::from((255, 0, 0)),
29+
"Failed to change window title!",
30+
);
31+
alert("Failed to change window title!");
32+
}
33+
};
34+
}
35+
_ => {
36+
log("ERROR", Color::from((255, 0, 0)), "Failed to get window!");
37+
alert("Failed to get window!");
38+
}
39+
};
2140
set_thread_status(false);
22-
log("STOPPED", Color::from((255, 0, 0)), "Sniper stopped!");
23-
alert("Sniper stopped!");
41+
log("STOPPING", Color::from((255, 255, 0)), "Sniper stopping...");
2442
app_handle().emit("stop", true).unwrap();
2543
}
2644

@@ -225,18 +243,28 @@ fn snipe(name: String, accounts: Vec<String>, claim: String, proxies: Vec<String
225243
);
226244
alert("Sniper started successfully!");
227245

228-
log(
229-
name.to_uppercase().as_str(),
230-
Color::from((0, 255, 0)),
231-
format!("Sniping {}!", name).as_str(),
232-
);
233246
let (tx_death, rx_death) = channel::<()>();
234247
let (tx_acc, rx_acc) = channel::<Account>();
235248

236249
let mut rl = calculate_ratelimit(accounts_num, proxy_list.len() as u32);
237250

238251
loop {
239252
if !get_thread_status() {
253+
match window.set_title("MCSniperRust - Idle") {
254+
Ok(_) => {}
255+
_ => {
256+
log(
257+
"ERROR",
258+
Color::from((255, 0, 0)),
259+
"Failed to change window title!",
260+
);
261+
alert("Failed to change window title!");
262+
app_handle().emit("stop", true).unwrap();
263+
return;
264+
}
265+
};
266+
log("STOPPED", Color::from((255, 0, 0)), "Sniper stopped!");
267+
alert("Sniper stopped!");
240268
return;
241269
}
242270
if get_ratelimit() {

0 commit comments

Comments
 (0)