Skip to content
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
6 changes: 5 additions & 1 deletion Knossos.NET/Models/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,9 @@ public void SaveJson()
/// Uses the new API call introduced along with repo_minimal.json to load the missing data from Nebula using the api
/// Can be called multiple times, the data is only loaded once unless ClearUnusedData() is called on this mod object
/// Does nothing for installed mods
/// Returns true if the operation was successfull, false otherwise.
/// </summary>
public async Task LoadFulLNebulaData()
public async Task<bool> LoadFulLNebulaData()
{
if(!installed && !fullDataLoaded)
{
Expand All @@ -788,12 +789,15 @@ public async Task LoadFulLNebulaData()
modFlag = newData.modFlag;
customBuild = newData.customBuild;
owners = newData.owners;
return true;
}
}catch(Exception ex)
{
Log.Add(Log.LogSeverity.Error, "Mod.LoadFulLNebulaData", ex);
}
return false;
}
return true;
}

/// <summary>
Expand Down
12 changes: 9 additions & 3 deletions Knossos.NET/ViewModels/Windows/ModInstallViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ private async void UpdateSelectedVersion()
List <Mod> allMods;
if(SelectedMod != null)
{
await SelectedMod.LoadFulLNebulaData();
var successfull = await SelectedMod.LoadFulLNebulaData();
if (!successfull)
_ = MessageBox.Show(MainWindow.instance, "An error has ocurred while fetching data from nebula for mod " + SelectedMod, "Error fetching data", MessageBox.MessageBoxButtons.OK);
}
//load all dependencies mods in singletc mode so they can be modified too at any time
if(SelectedMod != null && !SelectedMod.GetMissingDependenciesList().Any() && !Knossos.inSingleTCMode)
Expand Down Expand Up @@ -353,7 +355,9 @@ private async Task ProcessMod(Mod mod, List<Mod> allMods, List<Mod>? processed =
else
{
//Load Nebula data first to check the packages and add to cache
await modDep.LoadFulLNebulaData();
var successfull = await modDep.LoadFulLNebulaData();
if (!successfull)
_ = MessageBox.Show(MainWindow.instance, "An error has ocurred while fetching data from nebula for mod " + modDep, "Error fetching data", MessageBox.MessageBoxButtons.OK);
modCache.Add(modDep);
}

Expand Down Expand Up @@ -384,7 +388,9 @@ private async Task ProcessMod(Mod mod, List<Mod> allMods, List<Mod>? processed =
else
{
//Load Nebula data first to check the packages and add to cache
await alternativeVersion.LoadFulLNebulaData();
var successfull = await alternativeVersion.LoadFulLNebulaData();
if (!successfull)
_ = MessageBox.Show(MainWindow.instance, "An error has ocurred while fetching data from nebula for mod " + alternativeVersion, "Error fetching data", MessageBox.MessageBoxButtons.OK);
modCache.Add(alternativeVersion);
}
}
Expand Down