Skip to content

Commit

Permalink
Merge pull request #109 from atenfyr/main
Browse files Browse the repository at this point in the history
unreal_mod_manager: allow loading mods with unknown DownloadMode
  • Loading branch information
atenfyr authored Dec 26, 2024
2 parents a2a39b8 + 8bd7972 commit c636ad4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion unreal_mod_manager/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ impl ModLoaderApp {
.show_ui(ui, |ui| {
// for when there is an Index file show force latest version, this to diecrtly indicate that there
// is the possibility of an auto update vie an index file.
if game_mod.download.is_some() {
if game_mod.download.is_some() && game_mod.download.as_ref().unwrap().download_mode == unreal_mod_metadata::DownloadMode::IndexFile {
let latest_version = game_mod.latest_version.clone().unwrap();
ui.selectable_value(
&mut game_mod.selected_version,
Expand Down
2 changes: 1 addition & 1 deletion unreal_mod_manager/src/mod_processing/index_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub(crate) fn gather_index_files(

data.game_mods
.iter()
.filter(|(mod_id, _)| filter.contains(mod_id))
.filter(|(mod_id, game_mod)| filter.contains(mod_id) && game_mod.download.is_some() && game_mod.download.as_ref().unwrap().download_mode == unreal_mod_metadata::DownloadMode::IndexFile)
.filter_map(|(mod_id, game_mod)| {
game_mod
.download
Expand Down
3 changes: 3 additions & 0 deletions unreal_mod_metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ impl std::fmt::Display for SyncMode {
pub enum DownloadMode {
#[serde(rename = "index_file")]
IndexFile,
#[serde(other)]
Unknown,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
pub struct DownloadInfo {
#[serde(rename = "type")]
pub download_mode: DownloadMode,
#[serde(default)]
pub url: String,
}

Expand Down

0 comments on commit c636ad4

Please sign in to comment.