Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unreal_mod_manager: allow loading mods with unknown DownloadMode #109

Merged
merged 2 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading