Skip to content

Commit

Permalink
Cargo update
Browse files Browse the repository at this point in the history
some small tweaks to formatting and found a display message that was
not ment to be where it was
  • Loading branch information
WardLordRuby committed May 31, 2024
1 parent 4bdc5d9 commit ed17d98
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ fn main() -> Result<(), slint::PlatformError> {
order_data = Some(mod_loader_cfg.parse_into_map());
ini.update().unwrap_or_else(|err| {
error!(err_code = 6, "{err}");
ui.display_msg(&err.to_string());
});
collection =
ini.collect_mods(&path, order_data.as_ref(), false);
Expand Down Expand Up @@ -498,7 +497,7 @@ fn main() -> Result<(), slint::PlatformError> {
}
let _ = get_or_update_game_dir(Some(try_path));
} else {
error!("Required game files not found in: \"{}\", files missing: {}", try_path.display(), DisplayStrs(&not_found));
error!("Required game files not found in: '{}', files missing: {}", try_path.display(), DisplayStrs(&not_found));
ui.display_msg(&format!("Could not find Elden Ring in:\n\"{}\"", try_path.display()));
}
Err(err) => {
Expand Down
8 changes: 4 additions & 4 deletions src/utils/ini/mod_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,19 @@ impl ModLoaderCfg {
pub fn parse_section(&mut self) -> std::io::Result<OrderMap> {
let map = self.parse_into_map();
if self.section().len() != map.len() {
trace!("fixing usize parse error in \"{}\"", LOADER_FILES[2]);
trace!("fixing usize parse error in: {}", LOADER_FILES[2]);
self.update_order_entries(None)?;
return Ok(self.parse_into_map());
}
let mut values = self.iter().filter_map(|(k, _)| map.get(k)).collect::<Vec<_>>();
values.sort();
for (i, value) in values.iter().enumerate() {
if i != **value {
trace!(
"values in \"{}\" are not in order, sorting entries",
self.update_order_entries(None)?;
info!(
"Found entries out of order, sorted load order entries in: {}",
LOADER_FILES[2]
);
self.update_order_entries(None)?;
return Ok(self.parse_into_map());
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/utils/installer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,7 @@ pub fn scan_for_mods(game_dir: &Path, ini_dir: &Path) -> std::io::Result<usize>
if !matches!(scan_dir.try_exists(), Ok(true)) {
return new_io_error!(
ErrorKind::BrokenPipe,
format!(
"\"mods\" folder does not exist in \"{}\"",
game_dir.display()
)
format!("\"mods\" folder does not exist in '{}'", game_dir.display())
);
};
let num_files = items_in_directory(&scan_dir, FileType::File)?;
Expand Down

0 comments on commit ed17d98

Please sign in to comment.