Skip to content

Commit

Permalink
Update deps, update to 2024 edition, rustfmt shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
crumblingstatue committed Nov 27, 2024
1 parent e922a19 commit fa8b0cd
Show file tree
Hide file tree
Showing 41 changed files with 191 additions and 211 deletions.
142 changes: 71 additions & 71 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cargo-features = ["trim-paths"]
[package]
name = "hexerator"
version = "0.4.0-dev"
edition = "2021"
edition = "2024"
license = "MIT OR Apache-2.0"

[features]
Expand Down
12 changes: 6 additions & 6 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ use {
config::Config,
damage_region::DamageRegion,
gui::{
Gui,
message_dialog::{Icon, MessageDialog},
windows::FileDiffResultWindow,
Gui,
},
hex_ui::HexUi,
input::Input,
layout::{default_margin, do_auto_layout, Layout},
layout::{Layout, default_margin, do_auto_layout},
meta::{
perspective::Perspective, region::Region, LayoutKey, Meta, NamedRegion, NamedView,
PerspectiveKey, PerspectiveMap, RegionKey, RegionMap, ViewKey,
LayoutKey, Meta, NamedRegion, NamedView, PerspectiveKey, PerspectiveMap, RegionKey,
RegionMap, ViewKey, perspective::Perspective, region::Region,
},
meta_state::MetaState,
plugin::PluginContainer,
Expand All @@ -27,7 +27,7 @@ use {
source::{Source, SourceAttributes, SourcePermissions, SourceProvider, SourceState},
view::{HexData, TextData, View, ViewKind, ViewportScalar},
},
anyhow::{bail, Context as _},
anyhow::{Context as _, bail},
egui_sfml::sfml::graphics::RenderWindow,
gamedebug_core::{per, per_dbg},
hexerator_plugin_api::MethodResult,
Expand Down Expand Up @@ -680,7 +680,7 @@ impl App {
};
anyhow::ensure!(lo <= hi);
match &src.provider {
SourceProvider::File(ref file) => {
SourceProvider::File(file) => {
let mut file = file;
let offset = match self.src_args.hard_seek {
Some(hs) => hs + lo,
Expand Down
2 changes: 1 addition & 1 deletion src/app/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! we have exclusive access, and then perform it.
use {
super::{backend_command::BackendCmd, App},
super::{App, backend_command::BackendCmd},
crate::{
damage_region::DamageRegion,
gui::Gui,
Expand Down
2 changes: 1 addition & 1 deletion src/app/presentation.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use {
crate::{
color::{rgba, RgbaColor},
color::{RgbaColor, rgba},
value_color::ColorMethod,
},
serde::{Deserialize, Serialize},
Expand Down
2 changes: 1 addition & 1 deletion src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use {
TopBottomPanel, Window,
},
egui_colors::Colorix,
egui_sfml::{sfml::graphics::RenderWindow, SfEgui},
egui_sfml::{SfEgui, sfml::graphics::RenderWindow},
gamedebug_core::{IMMEDIATE, PERSISTENT},
mlua::Lua,
root_ctx_menu::ContextMenu,
Expand Down
30 changes: 13 additions & 17 deletions src/gui/bottom_panel.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use {
super::{dialogs::JumpDialog, egui_ui_ext::EguiResponseExt as _, Gui},
super::{Gui, dialogs::JumpDialog, egui_ui_ext::EguiResponseExt as _},
crate::{
app::{interact_mode::InteractMode, App},
app::{App, interact_mode::InteractMode},
meta::find_most_specific_region_for_offset,
shell::msg_if_fail,
util::human_size,
view::ViewportVec,
},
egui::{text::LayoutJob, Align, Color32, DragValue, Stroke, TextFormat, TextStyle, Ui},
egui::{Align, Color32, DragValue, Stroke, TextFormat, TextStyle, Ui, text::LayoutJob},
slotmap::Key as _,
};

Expand Down Expand Up @@ -180,20 +180,16 @@ fn key_label(ui: &Ui, key_text: &str, label_text: &str) -> LayoutJob {
let mut job = LayoutJob::default();
let style = ui.style();
let body_font = TextStyle::Body.resolve(style);
job.append(
key_text,
0.0,
TextFormat {
font_id: body_font.clone(),
color: style.visuals.widgets.active.fg_stroke.color,
background: style.visuals.code_bg_color,
italics: false,
underline: Stroke::NONE,
strikethrough: Stroke::NONE,
valign: Align::Center,
..Default::default()
},
);
job.append(key_text, 0.0, TextFormat {
font_id: body_font.clone(),
color: style.visuals.widgets.active.fg_stroke.color,
background: style.visuals.code_bg_color,
italics: false,
underline: Stroke::NONE,
strikethrough: Stroke::NONE,
valign: Align::Center,
..Default::default()
});
job.append(
label_text,
10.0,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/jump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use {
crate::{
app::App,
gui::Dialog,
parse_radix::{parse_offset_maybe_relative, Relativity},
parse_radix::{Relativity, parse_offset_maybe_relative},
shell::msg_fail,
},
mlua::Lua,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/pattern_fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use {
crate::{
app::App,
damage_region::DamageRegion,
gui::{message_dialog::Icon, Dialog},
gui::{Dialog, message_dialog::Icon},
slice_ext::SliceExt as _,
},
mlua::Lua,
Expand Down
20 changes: 10 additions & 10 deletions src/gui/file_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use {
message_dialog::MessageDialog,
windows::{AdvancedOpenWindow, FileDiffResultWindow},
},
meta::{region::Region, ViewKey},
meta::{ViewKey, region::Region},
shell::{msg_fail, msg_if_fail},
source::Source,
util::human_size_u64,
Expand Down Expand Up @@ -147,7 +147,7 @@ impl FileOps {
ui.separator();
crate::gui::src_args_ui(ui, &mut self.file_dialog_source_args);
});
if let Some(path) = self.dialog.take_selected()
if let Some(path) = self.dialog.take_picked()
&& let Some(op) = self.op.take()
{
match op {
Expand Down Expand Up @@ -283,31 +283,31 @@ impl FileOps {
let cfg = self.dialog.config_mut();
parent.clone_into(&mut cfg.initial_directory);
}
self.dialog.select_file();
self.dialog.pick_file();
self.op = Some(FileOp::LoadFile);
}
pub fn load_meta_file(&mut self) {
self.dialog.select_file();
self.dialog.pick_file();
self.op = Some(FileOp::LoadMetaFile);
}

pub fn advanced_open_pick_file(&mut self) {
self.dialog.select_file();
self.dialog.pick_file();
self.op = Some(FileOp::AdvancedOpenPickFile);
}

pub fn advanced_open_pick_metafile(&mut self) {
self.dialog.select_file();
self.dialog.pick_file();
self.op = Some(FileOp::AdvancedOpenPickMetafile);
}

pub fn load_palette_for_view(&mut self, key: ViewKey) {
self.dialog.select_file();
self.dialog.pick_file();
self.op = Some(FileOp::LoadPaletteForView(key));
}

pub fn load_palette_from_image_for_view(&mut self, view_key: ViewKey) {
self.dialog.select_file();
self.dialog.pick_file();
self.op = Some(FileOp::LoadPaletteFromImageForView(view_key));
}

Expand All @@ -317,12 +317,12 @@ impl FileOps {
{
self.dialog.config_mut().initial_directory = parent.to_owned();
}
self.dialog.select_file();
self.dialog.pick_file();
self.op = Some(FileOp::DiffWithFile);
}

pub fn load_lua_script(&mut self) {
self.dialog.select_file();
self.dialog.pick_file();
self.op = Some(FileOp::LoadLuaScript);
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/inspect_panel.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
super::message_dialog::{Icon, MessageDialog},
crate::{
app::{interact_mode::InteractMode, App},
app::{App, interact_mode::InteractMode},
damage_region::DamageRegion,
shell::msg_if_fail,
view::ViewportVec,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/root_ctx_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use {
crate::{
app::App,
meta::{
value_type::{self, ValueType},
Bookmark, ViewKey,
value_type::{self, ValueType},
},
view::ViewportScalar,
},
Expand Down
2 changes: 1 addition & 1 deletion src/gui/selection_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use {
app::App,
damage_region::DamageRegion,
gui::{
Gui,
dialogs::{LuaFillDialog, PatternFillDialog, X86AsmDialog},
file_ops::FileOps,
message_dialog::MessageDialog,
windows::RegionsWindow,
Gui,
},
},
egui::Button,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/top_menu/analysis.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
app::App,
gui::{message_dialog::Icon, Gui},
gui::{Gui, message_dialog::Icon},
shell::msg_if_fail,
};

Expand Down
2 changes: 1 addition & 1 deletion src/gui/top_menu/cursor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
crate::{
app::App,
gui::{dialogs::JumpDialog, Gui},
gui::{Gui, dialogs::JumpDialog},
},
egui::Button,
};
Expand Down
4 changes: 2 additions & 2 deletions src/gui/top_menu/edit.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use {
crate::{
app::{
command::{perform_command, Cmd},
App,
command::{Cmd, perform_command},
},
gui::{dialogs::TruncateDialog, message_dialog::Icon, Gui},
gui::{Gui, dialogs::TruncateDialog, message_dialog::Icon},
shell::msg_if_fail,
},
egui::Button,
Expand Down
4 changes: 2 additions & 2 deletions src/gui/top_menu/file.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
crate::{
app::{set_clipboard_string, App},
gui::{dialogs::AutoSaveReloadDialog, Gui},
app::{App, set_clipboard_string},
gui::{Gui, dialogs::AutoSaveReloadDialog},
shell::msg_if_fail,
},
egui::Button,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/top_menu/meta.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
crate::{
app::App,
gui::{egui_ui_ext::EguiResponseExt as _, Gui},
gui::{Gui, egui_ui_ext::EguiResponseExt as _},
shell::msg_if_fail,
},
egui::Button,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/top_menu/perspective.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use {
crate::{
app::{col_change_impl_view_perspective, App},
app::{App, col_change_impl_view_perspective},
gui::Gui,
},
egui::Button,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/top_menu/plugins.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
app::App,
gui::{message_dialog::Icon, Gui},
gui::{Gui, message_dialog::Icon},
plugin::PluginContainer,
shell::msg_fail,
};
Expand Down
4 changes: 2 additions & 2 deletions src/gui/top_panel.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
super::{
dialogs::LuaColorDialog, egui_ui_ext::EguiResponseExt as _, message_dialog::Icon,
top_menu::top_menu, Gui,
Gui, dialogs::LuaColorDialog, egui_ui_ext::EguiResponseExt as _, message_dialog::Icon,
top_menu::top_menu,
},
crate::{
app::App,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub use self::{
advanced_open::AdvancedOpenWindow,
file_diff_result_window::FileDiffResultWindow,
lua_console::{ConMsg, LuaConsoleWindow},
regions_window::{region_context_menu, RegionsWindow},
regions_window::{RegionsWindow, region_context_menu},
};
use {
self::{
Expand Down
9 changes: 4 additions & 5 deletions src/gui/windows/bookmarks_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ use {
damage_region::DamageRegion,
gui::{message_dialog::MessageDialog, windows::regions_window::region_context_menu},
meta::{
find_most_specific_region_for_offset,
Bookmark, find_most_specific_region_for_offset,
value_type::{
EndianedPrimitive, F32Be, F32Le, F64Be, F64Le, I16Be, I16Le, I32Be, I32Le, I64Be,
I64Le, StringMap, U16Be, U16Le, U32Be, U32Le, U64Be, U64Le, ValueType, I8, U8,
EndianedPrimitive, F32Be, F32Le, F64Be, F64Le, I8, I16Be, I16Le, I32Be, I32Le,
I64Be, I64Le, StringMap, U8, U16Be, U16Le, U32Be, U32Le, U64Be, U64Le, ValueType,
},
Bookmark,
},
shell::{msg_fail, msg_if_fail},
},
anyhow::Context as _,
egui::{text::CursorRange, ScrollArea, Ui},
egui::{ScrollArea, Ui, text::CursorRange},
egui_extras::{Column, TableBuilder},
gamedebug_core::per,
num_traits::AsPrimitive,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/windows/file_diff_result_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use {
app::read_source_to_buf,
gui::windows::regions_window::region_context_menu,
meta::{
find_most_specific_region_for_offset, value_type::ValueType, Bookmark, Meta, RegionKey,
Bookmark, Meta, RegionKey, find_most_specific_region_for_offset, value_type::ValueType,
},
shell::msg_if_fail,
},
Expand Down
Loading

0 comments on commit fa8b0cd

Please sign in to comment.