Skip to content

Commit

Permalink
Add tooltips #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Zusier committed Mar 27, 2022
1 parent 5c2046c commit 2e907a6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
18 changes: 18 additions & 0 deletions gameutil-rs/src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pub struct GameUtil {
kill_dwm: nwg::CheckBox,
kill_exp: nwg::CheckBox,
timerresval_label: nwg::Label,
timer_tooltip: nwg::Tooltip,
idle_tooltip: nwg::Tooltip,
clean_tooltip: nwg::Tooltip,
}
mod app_gui {
use nwg::CheckBoxState;
Expand Down Expand Up @@ -93,6 +96,21 @@ mod app_gui {
.parent(&data.window)
.build(&mut data.clean_button)?;

nwg::Tooltip::builder()
.register(
&*&mut data.timerresval,
"Has no effect on Windows 2004+, 0.0 to disable.",
)
.build(&mut data.timer_tooltip)?;

nwg::Tooltip::builder()
.register(&*&mut data.disableidle_button, "Disables the system idle process. Taskmgr will display CPU usage as 100%, is it not actually under 100% load.")
.build(&mut data.idle_tooltip)?;

nwg::Tooltip::builder()
.register(&*&mut data.clean_button, "Hotkey: F4. Cleans the working set of all processes. Can cause a slight stutter after clicking so if in-game run it when you are safe.")
.build(&mut data.clean_tooltip)?;

// Wrap-up
let ui = GameUtilUi {
inner: Rc::new(data),
Expand Down
1 change: 0 additions & 1 deletion gameutil-rs/src/gui/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ pub fn cleanworkingset() {
for process in sys.processes() {
// not very readable, so it goes:
// pid -> handle -> empty working set
//EmptyWorkingSet(gethandle(process.0));
EmptyWorkingSet(OpenProcess(0x1F0FFF, 0, *process.0 as u32));
}
}
Expand Down

0 comments on commit 2e907a6

Please sign in to comment.