Skip to content

Commit

Permalink
restore original font file on localization delete
Browse files Browse the repository at this point in the history
  • Loading branch information
shevernitskiy committed Feb 29, 2024
1 parent 56f7cfe commit cef36a2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 1 deletion.
Binary file added assets/original_font.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl eframe::App for App {
ui.horizontal(|ui| {
ui.heading(t!("Hook"));
// cheksums without lozalization files
if self.hook_checksum != 4282505490 || self.dict_checksum != 3201258627 {
if self.hook_checksum != 4282505490 || self.dict_checksum != 1591420153 {
ui.with_layout(egui::Layout::right_to_left(egui::Align::TOP), |ui| {
let button =
ui.add_sized([20., 20.], egui::Button::new("🗑")).on_hover_text(t!("Delete localization files"));
Expand Down
1 change: 1 addition & 0 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub const VERSION: &'static str = env!("CARGO_PKG_VERSION");
pub const GITHUB_ICON: eframe::egui::widgets::ImageSource<'static> =
eframe::egui::include_image!("../assets/github.png");
pub const APP_ICON: &'static [u8; 1980] = include_bytes!("../assets/df.png");
pub const ORIGINAL_FONT: &'static [u8; 1568] = include_bytes!("../assets/original_font.png");

pub const PATH_CACHE_FILE: &'static str = "./dfint-installer.cache";

Expand Down
1 change: 1 addition & 0 deletions src/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ impl App {

pub fn remove_hook_data(&self) {
if let Some(pathbuf) = &self.df_dir {
let _ = std::fs::write(pathbuf.join(PATH_FONT), &ORIGINAL_FONT);
let _ = std::fs::remove_file(pathbuf.join("dfhooks.dll"));
let _ = std::fs::remove_dir_all(pathbuf.join("dfint-data"));
}
Expand Down

0 comments on commit cef36a2

Please sign in to comment.