Skip to content

Commit 51404a3

Browse files
committed
Repaint the window, fix for custom Steam dirs
1 parent 2256961 commit 51404a3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/app.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ pub struct SlopDev {
2727
impl SlopDev {
2828
fn start_game(&mut self) {
2929
// TODO: bad assumption
30-
let steam_exe = "C:\\Program Files (x86)\\Steam\\Steam.exe";
30+
let custom_steam_exe_path = self.work_dir.join("steam_path.txt");
31+
let steam_exe = if custom_steam_exe_path.exists() {
32+
std::fs::read_to_string(custom_steam_exe_path)
33+
.expect("failed to read custom steam exe path")
34+
.trim()
35+
.to_string()
36+
} else {
37+
"C:\\Program Files (x86)\\Steam\\Steam.exe".to_string()
38+
};
39+
3140
std::process::Command::new(steam_exe)
3241
.arg("-applaunch")
3342
.arg("1353230")
@@ -268,5 +277,8 @@ impl eframe::App for SlopDev {
268277
);
269278
}
270279
});
280+
281+
let _60fps = std::time::Duration::from_millis(1000 / 60);
282+
ctx.request_repaint_after(_60fps);
271283
}
272284
}

0 commit comments

Comments
 (0)