/// <summary> /// Initialize a GUIMod based on an InstalledModule /// </summary> /// <param name="instMod">The installed module to represent</param> /// <param name="registry">CKAN registry object for current game instance</param> /// <param name="current_ksp_version">Current game version</param> /// <param name="incompatible">If true, mark this module as incompatible</param> public GUIMod(InstalledModule instMod, IRegistryQuerier registry, KspVersionCriteria current_ksp_version, bool incompatible = false) : this(instMod.Module, registry, current_ksp_version, incompatible) { IsInstalled = true; IsInstallChecked = true; InstallDate = instMod.InstallTime; InstalledVersion = instMod.Module.version.ToString(); if (LatestVersion == null || LatestVersion.Equals("-")) { LatestVersion = InstalledVersion; } }
/// <summary> /// Initialize a GUIMod based on an InstalledModule /// </summary> /// <param name="instMod">The installed module to represent</param> /// <param name="registry">CKAN registry object for current game instance</param> /// <param name="current_game_version">Current game version</param> /// <param name="incompatible">If true, mark this module as incompatible</param> public GUIMod(InstalledModule instMod, IRegistryQuerier registry, GameVersionCriteria current_game_version, bool?incompatible = null) : this(instMod.Module, registry, current_game_version, incompatible) { IsInstalled = true; IsInstallChecked = true; InstalledMod = instMod; selectedMod = instMod.Module; IsAutoInstalled = instMod.AutoInstalled; InstallDate = instMod.InstallTime; InstalledVersion = instMod.Module.version.ToString(); if (LatestVersion == null || LatestVersion.Equals("-")) { LatestVersion = InstalledVersion; } }
/// <summary> /// Initialize a GUIMod based on an InstalledModule /// </summary> /// <param name="instMod">The installed module to represent</param> /// <param name="registry">CKAN registry object for current game instance</param> /// <param name="current_game_version">Current game version</param> /// <param name="incompatible">If true, mark this module as incompatible</param> public GUIMod(InstalledModule instMod, IRegistryQuerier registry, GameVersionCriteria current_game_version, bool?incompatible = null) : this(instMod.Module, registry, current_game_version, incompatible) { IsInstalled = true; IsInstallChecked = true; InstalledMod = instMod; selectedMod = instMod.Module; IsAutoInstalled = instMod.AutoInstalled; InstallDate = instMod.InstallTime; InstalledVersion = instMod.Module.version.ToString(); if (LatestVersion == null || LatestVersion.Equals("-")) { LatestVersion = InstalledVersion; } // For mods not known to the registry LatestCompatibleMod is null, however the installed module might be compatible IsIncompatible = incompatible ?? LatestCompatibleMod == null && !instMod.Module.IsCompatibleKSP(current_game_version); }
/// <summary> /// 是否需要更新 /// </summary> /// <returns></returns> public bool IsNeedUpdate() { // 最新版本不等于streaming,并且大于,需要更新 return(!LatestVersion.Equals(StreamVersion) && LatestVersion.IsMax(LocalVersion)); }