/// <summary> /// Loads the user's profile and mods. /// </summary> public static void Load() { Mods.Clear(); NexusMods.User.Load(); if (!File.Exists(NexusMods.RemoteXMLPath)) { return; } XDocument xmlDoc = XDocument.Load(NexusMods.RemoteXMLPath); foreach (XElement xmlMod in xmlDoc.Descendants("Mod")) { try { NMMod mod = NMMod.Deserialize(xmlMod); Mods[mod.ID] = mod; } catch { // TODO: Handle invalid entries. } } }
/// <summary> /// Requests remote information about a mod. /// </summary> /// <param name="url">The url to the mod page. Example: "https://www.nexusmods.com/fallout76/mods/419?tab=files"</param> public static void RequestModInformation(string url) { NMMod mod = new NMMod(url); mod.RequestInformation(); Mods[mod.ID] = mod; }
/// <summary> /// Requests remote information about a mod. /// </summary> public static NMMod RequestModInformation(int modId) { NMMod mod = new NMMod(modId); mod.RequestInformation(); Mods[mod.ID] = mod; return(mod); }
/// <summary> /// Requests remote information about a mod. /// </summary> /// <param name="url">The url to the mod page. Example: "https://www.nexusmods.com/fallout76/mods/419?tab=files"</param> public static NMMod RequestModInformation(string url) { NMMod mod = new NMMod(url); mod.RequestInformation(); Mods[mod.ID] = mod; return(mod); }