Skip to content

Commit

Permalink
Updated egui.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed May 28, 2024
1 parent 977747e commit 856d589
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ Allows to alter values in computer games or freeze them to certain values.
"""

[dependencies]
egui = "0.22.0"
egui_extras = "0.22.0"
eframe = { version = "0.22.0", features = ["persistence"] }
egui = "0.27.2"
egui_extras = "0.27.2"
eframe = { version = "0.27.2", features = ["persistence"] }
process-memory = "0.5.0"
sysinfo = "0.29.2"
sysinfo = "0.30.12"
threadpool = "1.0"
sudo = "0.6.0"
gabi = "0.2.6"
i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"]}
i18n-embed-fl = "0.6.4"
i18n-embed = { version = "0.14.1", features = ["fluent-system", "desktop-requester"]}
i18n-embed-fl = "0.8.0"
once_cell = "1.16.0"
rust-embed = "6.4.2"
rust-embed = "8.4.0"
boyer-moore-magiclen = "0.2.16"
proc-maps = "0.3.1"

Expand Down
18 changes: 7 additions & 11 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl GameCheetahEngine {
ui.spacing_mut().item_spacing = egui::Vec2::splat(5.0);

let i = ui.add(egui::TextEdit::singleline(&mut self.process_filter).hint_text(fl!(crate::LANGUAGE_LOADER, "filter-processes-hint")));
if ui.memory(|m| m.focus().is_none()) {
if !ui.memory(|m| m.has_focus(i.id)) {
ui.memory_mut(|m| m.request_focus(i.id));
}

Expand Down Expand Up @@ -88,8 +88,8 @@ impl GameCheetahEngine {

let num_rows: usize = results.len();

body.rows(row_height, num_rows, |row_index, mut row| {
let process = &results[row_index];
body.rows(row_height, num_rows, |mut row| {
let process = &results[row.index()];

row.col(|ui| {
let r = ui.selectable_label(false, process.pid.to_string());
Expand Down Expand Up @@ -294,11 +294,7 @@ impl GameCheetahEngine {
SearchType::Guess,
SearchType::Guess.get_short_description_text(),
);
ui.selectable_value(
&mut search_context.search_type,
SearchType::Byte,
SearchType::Byte.get_short_description_text(),
);
ui.selectable_value(&mut search_context.search_type, SearchType::Byte, SearchType::Byte.get_short_description_text());
ui.selectable_value(
&mut search_context.search_type,
SearchType::Short,
Expand Down Expand Up @@ -347,7 +343,7 @@ impl GameCheetahEngine {
} else {
self.filter_searches(search_index);
}
} else if ui.memory(|m| m.focus().is_none()) {
} else if !ui.memory(|m| m.has_focus(re.id)) {
ui.memory_mut(|m| m.request_focus(re.id));
}

Expand Down Expand Up @@ -456,8 +452,8 @@ impl GameCheetahEngine {
let results = search_context.results.lock().unwrap();
let num_rows: usize = results.len();

body.rows(row_height, num_rows, |row_index, mut row| {
let result = &results[row_index];
body.rows(row_height, num_rows, |mut row| {
let result = &results[row.index()];
row.col(|ui| {
ui.label(format!("0x{:X}", result.addr));
});
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ fn main() {

let options = eframe::NativeOptions {
multisampling: 0,
renderer: eframe::Renderer::Wgpu,
// renderer: eframe::Renderer::,
hardware_acceleration: eframe::HardwareAcceleration::Preferred,
icon_data: Some(eframe::IconData::try_from_png_bytes(&include_bytes!("../build/linux/256x256.png")[..]).unwrap()),
// icon_data: Some(eframe::IconData::try_from_png_bytes(&include_bytes!("../build/linux/256x256.png")[..]).unwrap()),
..Default::default()
};
eframe::run_native(
Expand Down
2 changes: 1 addition & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl GameCheetahEngine {
}
let pid = pid2.as_u32();
let user = match process.user_id() {
Some(user) => sys.get_user_by_id(user).unwrap().name().to_string(),
Some(user) => user.to_string(),
None => "".to_string(),
};
self.processes.push(ProcessInfo {
Expand Down

0 comments on commit 856d589

Please sign in to comment.