mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-13 23:26:25 +00:00
Add rlwinm decoder window (#83)
* Add rlwinm decoder window * Remove extra files * Create Cargo.lock * Make fmt happy * Update Cargo.lock * Update Cargo.lock * Update Cargo.lock
This commit is contained in:
@@ -10,6 +10,7 @@ pub(crate) mod frame_history;
|
||||
pub(crate) mod function_diff;
|
||||
pub(crate) mod graphics;
|
||||
pub(crate) mod jobs;
|
||||
pub(crate) mod rlwinm;
|
||||
pub(crate) mod symbol_diff;
|
||||
|
||||
#[inline]
|
||||
|
||||
34
objdiff-gui/src/views/rlwinm.rs
Normal file
34
objdiff-gui/src/views/rlwinm.rs
Normal file
@@ -0,0 +1,34 @@
|
||||
use egui::TextStyle;
|
||||
|
||||
use crate::views::appearance::Appearance;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct RlwinmDecodeViewState {
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
pub fn rlwinm_decode_window(
|
||||
ctx: &egui::Context,
|
||||
show: &mut bool,
|
||||
state: &mut RlwinmDecodeViewState,
|
||||
appearance: &Appearance,
|
||||
) {
|
||||
egui::Window::new("Rlwinm Decoder").open(show).show(ctx, |ui| {
|
||||
ui.text_edit_singleline(&mut state.text);
|
||||
ui.add_space(10.0);
|
||||
if let Some(demangled) = rlwinmdec::decode(&state.text) {
|
||||
ui.scope(|ui| {
|
||||
ui.style_mut().override_text_style = Some(TextStyle::Monospace);
|
||||
ui.colored_label(appearance.replace_color, &demangled);
|
||||
});
|
||||
if ui.button("Copy").clicked() {
|
||||
ui.output_mut(|output| output.copied_text = demangled);
|
||||
}
|
||||
} else {
|
||||
ui.scope(|ui| {
|
||||
ui.style_mut().override_text_style = Some(TextStyle::Monospace);
|
||||
ui.colored_label(appearance.replace_color, "[invalid]");
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user