Skip to content

Commit 3fce718

Browse files
committed
just give the idiots a gif to literally show them what to do
1 parent 0059827 commit 3fce718

File tree

2 files changed

+41
-35
lines changed

2 files changed

+41
-35
lines changed

src-tauri/src/background_thread.rs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
use std::sync::Mutex;
2-
use sysinfo::System;
1+
// use std::sync::Mutex;
2+
// use sysinfo::System;
33

4-
static CHECK_NEW_INSTANCE_AND_CLOSE: Mutex<bool> = Mutex::new(false);
4+
// static CHECK_NEW_INSTANCE_AND_CLOSE: Mutex<bool> = Mutex::new(false);
55

66
pub fn check_for_new_instance_and_close() {
7-
let mut var = CHECK_NEW_INSTANCE_AND_CLOSE.lock().unwrap();
8-
*var = true;
7+
// let mut var = CHECK_NEW_INSTANCE_AND_CLOSE.lock().unwrap();
8+
// *var = true;
99
}
1010

1111
pub fn initialize_background_thread() {
12-
std::thread::spawn(move || loop {
13-
let mut new_instance_check = CHECK_NEW_INSTANCE_AND_CLOSE.lock().unwrap();
14-
if *new_instance_check {
15-
let timeout_since_start = std::time::Duration::from_secs(10);
16-
let now: std::time::Instant = std::time::Instant::now();
17-
let elapsed = now.elapsed();
18-
if elapsed > timeout_since_start {
19-
*new_instance_check = false;
20-
}
12+
// std::thread::spawn(move || loop {
13+
// let mut new_instance_check = CHECK_NEW_INSTANCE_AND_CLOSE.lock().unwrap();
14+
// if *new_instance_check {
15+
// let timeout_since_start = std::time::Duration::from_secs(10);
16+
// let now: std::time::Instant = std::time::Instant::now();
17+
// let elapsed = now.elapsed();
18+
// if elapsed > timeout_since_start {
19+
// *new_instance_check = false;
20+
// }
2121

22-
let s = System::new_all();
22+
// let s = System::new_all();
2323

24-
let current_process = s.process(sysinfo::get_current_pid().unwrap()).unwrap();
25-
for process in s.processes_by_exact_name("omp-launcher.exe") {
26-
if process.pid() != current_process.pid() {
27-
let new_uptime = process.run_time();
28-
let current_uptime = current_process.run_time();
29-
if new_uptime < current_uptime {
30-
current_process.kill();
31-
*new_instance_check = false;
32-
}
33-
}
34-
}
35-
}
24+
// let current_process = s.process(sysinfo::get_current_pid().unwrap()).unwrap();
25+
// for process in s.processes_by_exact_name("omp-launcher.exe") {
26+
// if process.pid() != current_process.pid() {
27+
// let new_uptime = process.run_time();
28+
// let current_uptime = current_process.run_time();
29+
// if new_uptime < current_uptime {
30+
// current_process.kill();
31+
// *new_instance_check = false;
32+
// }
33+
// }
34+
// }
35+
// }
3636

37-
std::thread::sleep(std::time::Duration::from_millis(500));
38-
});
37+
// std::thread::sleep(std::time::Duration::from_millis(500));
38+
// });
3939
}

src/utils/game.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,12 @@ export const startGame = async (
147147
{
148148
title: t("run_as_admin"),
149149
onPress: async () => {
150-
await invoke("rerun_as_admin").then(() => {
151-
process.exit();
152-
});
150+
shell
151+
.open("https://assets.open.mp/run_as_admin.gif")
152+
.then(() => process.exit());
153+
// await invoke("rerun_as_admin").then(() => {
154+
// process.exit();
155+
// });
153156
},
154157
},
155158
{
@@ -245,9 +248,12 @@ export const startGame = async (
245248
{
246249
title: t("run_as_admin"),
247250
onPress: async () => {
248-
await invoke("rerun_as_admin").then(() => {
249-
process.exit();
250-
});
251+
shell
252+
.open("https://assets.open.mp/run_as_admin.gif")
253+
.then(() => process.exit());
254+
// await invoke("rerun_as_admin").then(() => {
255+
// process.exit();
256+
// });
251257
},
252258
},
253259
{

0 commit comments

Comments
 (0)