Fixed for latest NMM API.

This commit is contained in:
Rob Nelson
2016-11-15 13:37:01 -08:00
parent 097cd233aa
commit c8d6ad61a3
7 changed files with 426 additions and 301 deletions
+2
View File
@@ -0,0 +1,2 @@
/nmm
/NexusClientCLI/obj
+84 -77
View File
@@ -23,13 +23,13 @@ namespace Nexus.Client.ModManagement.InstallationLog
{
class DummyInstallLog : IInstallLog
{
private Dictionary<string, Pair<IMod, string> > m_InstalledFiles = null;
private Dictionary<string, Pair<IMod, string>> m_InstalledFiles = null;
private Set<string> m_UsedKeys = null;
public DummyInstallLog()
{
m_InstalledFiles = new Dictionary<string, Pair<IMod, string>>();
m_UsedKeys = new Set<string>();
}
@@ -100,44 +100,44 @@ namespace Nexus.Client.ModManagement.InstallationLog
}
public void AddIniEdit(IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue)
{
// nop
}
{
// nop
}
public void ReplaceIniEdit(IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue)
{
// nop
}
public void ReplaceIniEdit(IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue)
{
// nop
}
public void RemoveIniEdit(IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey)
{
// nop
}
public void RemoveIniEdit(IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey)
{
// nop
}
public IMod GetCurrentIniEditOwner(string p_strSettingsFileName, string p_strSection, string p_strKey)
{
return null;
}
public IMod GetCurrentIniEditOwner(string p_strSettingsFileName, string p_strSection, string p_strKey)
{
return null;
}
public string GetCurrentIniEditOwnerKey(string p_strSettingsFileName, string p_strSection, string p_strKey)
{
return null;
}
public string GetCurrentIniEditOwnerKey(string p_strSettingsFileName, string p_strSection, string p_strKey)
{
return null;
}
public string GetPreviousIniValue(string p_strSettingsFileName, string p_strSection, string p_strKey)
{
return null;
}
public string GetPreviousIniValue(string p_strSettingsFileName, string p_strSection, string p_strKey)
{
return null;
}
public void LogOriginalIniValue(string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue)
{
// nop
}
public void LogOriginalIniValue(string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue)
{
// nop
}
public IList<IniEdit> GetInstalledIniEdits(IMod p_modInstaller)
{
return null;
}
public IList<IniEdit> GetInstalledIniEdits(IMod p_modInstaller)
{
return null;
}
public IList<IMod> GetIniEditInstallers(string p_strSettingsFileName, string p_strSection, string p_strKey)
{
@@ -156,18 +156,18 @@ namespace Nexus.Client.ModManagement.InstallationLog
}
public void AddDataFile(IMod p_modInstallingMod, string p_strDataFilePath)
{
{
string key = GenerateKey();
m_InstalledFiles[p_strDataFilePath.ToLower()] = new Pair<IMod, string>(p_modInstallingMod, key);
}
}
public void RemoveDataFile(IMod p_modInstallingMod, string p_strDataFilePath)
{
public void RemoveDataFile(IMod p_modInstallingMod, string p_strDataFilePath)
{
m_InstalledFiles.Remove(p_strDataFilePath.ToLower());
}
}
public IMod GetCurrentFileOwner(string p_strPath)
{
public IMod GetCurrentFileOwner(string p_strPath)
{
string strPathLower = p_strPath.ToLower();
if (m_InstalledFiles.ContainsKey(strPathLower))
{
@@ -177,15 +177,15 @@ namespace Nexus.Client.ModManagement.InstallationLog
{
return null;
}
}
}
public IMod GetPreviousFileOwner(string p_strPath)
{
return null;
}
public IMod GetPreviousFileOwner(string p_strPath)
{
return null;
}
public string GetCurrentFileOwnerKey(string p_strPath)
{
public string GetCurrentFileOwnerKey(string p_strPath)
{
string strPathLower = p_strPath.ToLower();
if (m_InstalledFiles.ContainsKey(strPathLower))
{
@@ -197,18 +197,18 @@ namespace Nexus.Client.ModManagement.InstallationLog
}
}
public string GetPreviousFileOwnerKey(string p_strPath)
{
return null;
}
public string GetPreviousFileOwnerKey(string p_strPath)
{
return null;
}
public void LogOriginalDataFile(string p_strDataFilePath)
{
// nop
}
public void LogOriginalDataFile(string p_strDataFilePath)
{
// nop
}
public IList<string> GetInstalledModFiles(IMod p_modInstaller)
{
public IList<string> GetInstalledModFiles(IMod p_modInstaller)
{
Set<string> result = new Set<string>();
foreach (KeyValuePair<string, Pair<IMod, string>> file in m_InstalledFiles)
{
@@ -217,8 +217,8 @@ namespace Nexus.Client.ModManagement.InstallationLog
result.Add(file.Key);
}
}
return result;
}
return result;
}
public IList<IMod> GetFileInstallers(string p_strPath)
{
@@ -232,24 +232,26 @@ namespace Nexus.Client.ModManagement.InstallationLog
}
public void AddActiveMod(IMod p_modMod)
{
// nop
}
{
// nop
}
public void ReplaceActiveMod(IMod p_modOldMod, IMod p_modNewMod)
{
// nop
}
public void ReplaceActiveMod(IMod p_modOldMod, IMod p_modNewMod)
{
// nop
}
public string GetModKey(IMod p_modMod)
{
return null;
}
public string GetModKey(IMod p_modMod)
{
return null;
}
/* protected IMod GetMod(string p_strKey)
{
return null;
}*/
/*
protected IMod GetMod(string p_strKey)
{
return null;
}
*/
public IEnumerable<KeyValuePair<IMod, IMod>> GetMismatchedVersionMods()
{
@@ -268,12 +270,17 @@ namespace Nexus.Client.ModManagement.InstallationLog
public byte[] GetXMLModList()
{
throw new NotImplementedException();
return null;
}
public byte[] GetXMLIniList()
{
throw new NotImplementedException();
return null;
}
public IInstallLog ReInitialize(string p_strLogPath)
{
return this; // ???
}
}
}
+29 -22
View File
@@ -33,7 +33,7 @@ namespace Nexus.Client.PluginManagement
public DummyPluginManager(string pluginsFile, IGameMode gameMode, IMod mod)
{
StreamReader reader = new StreamReader(pluginsFile);
string installationPath = Path.Combine(gameMode.GameModeEnvironmentInfo.InstallationPath, gameMode.GetModFormatAdjustedPath(mod.Format, null, false));
string line;
@@ -59,12 +59,12 @@ namespace Nexus.Client.PluginManagement
#region Properties
public ReadOnlyObservableList<Plugin> ManagedPlugins
{
get
{
{
get
{
return m_ROOLPlugins;
}
}
}
}
public ReadOnlyObservableList<Plugin> ActivePlugins
{
@@ -185,26 +185,33 @@ namespace Nexus.Client.PluginManagement
{
return false;
}
public bool CanActivatePlugins()
{
return true;
return true;
}
public int MaxAllowedActivePluginsCount {
get {
return 255;
}
}
public List<Plugin> GetOrphanedPlugins(string p_strMasterName)
{
throw new NotImplementedException();
}
public int MaxAllowedActivePluginsCount
{
get
{
return 255;
}
}
public string GetPluginDescription(string p_strPlugin)
{
throw new NotImplementedException();
}
public List<Plugin> GetOrphanedPlugins(string p_strMasterName)
{
return null;
}
public string GetPluginDescription(string p_strPlugin)
{
return null;
}
public IBackgroundTask ApplyLoadOrder(Dictionary<Plugin, string> p_kvpRegisteredPlugins, bool p_booSortingOnly)
{
return null;
}
}
}
+242 -200
View File
@@ -5,256 +5,298 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nexus.Client.BackgroundTasks;
using Nexus.Client.UI;
namespace Nexus.Client.CLI
{
class DummyVirtualModActivator : IVirtualModActivator
{
public event EventHandler ModActivationChanged;
protected IEnvironmentInfo EnvironmentInfo { get; private set; }
public bool MultiHDMode
class DummyVirtualModActivator : IVirtualModActivator
{
get { return false; }
}
public event EventHandler ModActivationChanged;
public bool Initialized
{
get { return true; }
}
protected IEnvironmentInfo EnvironmentInfo { get; private set; }
public bool DisableLinkCreation
{
get { return false; }
}
public bool MultiHDMode
{
get { return false; }
}
public bool DisableIniLogging
{
get { return true; }
}
public bool Initialized
{
get { return true; }
}
public string VirtualPath
{
get
{
//string[] components = EnvironmentInfo.Settings.InstallationPaths[GameMode.ModeId].Split(Path.DirectorySeparatorChar);
//return components[components.Length - 1];
return "";
}
}
public bool DisableLinkCreation
{
get { return false; }
}
public string HDLinkFolder
{
get { throw new NotImplementedException(); }
}
public bool DisableIniLogging
{
get { return true; }
}
public Util.Collections.ThreadSafeObservableList<IVirtualModLink> VirtualLinks
{
get { throw new NotImplementedException(); }
}
public string VirtualPath
{
get
{
//string[] components = EnvironmentInfo.Settings.InstallationPaths[GameMode.ModeId].Split(Path.DirectorySeparatorChar);
//return components[components.Length - 1];
return "";
}
}
public Util.Collections.ThreadSafeObservableList<IVirtualModInfo> VirtualMods
{
get { throw new NotImplementedException(); }
}
public string HDLinkFolder
{
get { throw new NotImplementedException(); }
}
public IEnumerable<string> ActiveModList
{
get { throw new NotImplementedException(); }
}
public Util.Collections.ThreadSafeObservableList<IVirtualModLink> VirtualLinks
{
get { throw new NotImplementedException(); }
}
public int ModCount
{
get { throw new NotImplementedException(); }
}
public Util.Collections.ThreadSafeObservableList<IVirtualModInfo> VirtualMods
{
get { throw new NotImplementedException(); }
}
public Games.IGameMode GameMode { get; private set; }
public IEnumerable<string> ActiveModList
{
get { throw new NotImplementedException(); }
}
public DummyVirtualModActivator(Games.IGameMode gameMode, IEnvironmentInfo environment)
{
GameMode = gameMode;
EnvironmentInfo = environment;
}
public int ModCount
{
get { throw new NotImplementedException(); }
}
public void Initialize()
{
throw new NotImplementedException();
}
public Games.IGameMode GameMode { get; private set; }
public void Setup()
{
throw new NotImplementedException();
}
public DummyVirtualModActivator(Games.IGameMode gameMode, IEnvironmentInfo environment)
{
GameMode = gameMode;
EnvironmentInfo = environment;
}
public void Reset()
{
throw new NotImplementedException();
}
public void Initialize()
{
throw new NotImplementedException();
}
public void SaveList()
{
throw new NotImplementedException();
}
public void Setup()
{
throw new NotImplementedException();
}
public void SetCurrentList(IList<IVirtualModLink> p_ilvVirtualLinks)
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
public List<IVirtualModLink> LoadList(string p_strXMLFilePath)
{
throw new NotImplementedException();
}
public void SaveList()
{
throw new NotImplementedException();
}
public List<IVirtualModLink> LoadImportedList(string p_strXML)
{
throw new NotImplementedException();
}
public void SetCurrentList(IList<IVirtualModLink> p_ilvVirtualLinks)
{
throw new NotImplementedException();
}
public bool LoadListOnDemand(string p_strProfilePath, out List<IVirtualModLink> p_lstVirtualLinks, out List<IVirtualModInfo> p_lstVirtualMods)
{
throw new NotImplementedException();
}
public List<IVirtualModLink> LoadList(string p_strXMLFilePath)
{
throw new NotImplementedException();
}
public void SaveModList(string p_strPath)
{
throw new NotImplementedException();
}
public List<IVirtualModLink> LoadImportedList(string p_strXML)
{
throw new NotImplementedException();
}
public string CheckVirtualLink(string p_strFilePath)
{
throw new NotImplementedException();
}
public bool LoadListOnDemand(string p_strProfilePath, out List<IVirtualModLink> p_lstVirtualLinks, out List<IVirtualModInfo> p_lstVirtualMods)
{
throw new NotImplementedException();
}
public int CheckFileLink(string p_strFilePath, out Mods.IMod p_modMod, out List<IVirtualModLink> lstFileLinks)
{
throw new NotImplementedException();
}
public void SaveModList(string p_strPath)
{
throw new NotImplementedException();
}
public bool PurgeLinks()
{
throw new NotImplementedException();
}
public string CheckVirtualLink(string p_strFilePath)
{
throw new NotImplementedException();
}
public void AddInactiveLink(Mods.IMod p_modMod, string p_strBaseFilePath, int p_intPriority)
{
throw new NotImplementedException();
}
public int CheckFileLink(string p_strFilePath, out Mods.IMod p_modMod, out List<IVirtualModLink> lstFileLinks)
{
throw new NotImplementedException();
}
public string AddFileLink(Mods.IMod p_modMod, string p_strBaseFilePath, bool p_booIsSwitching, bool p_booIsRestoring, int p_intPriority)
{
throw new NotImplementedException();
}
public bool PurgeLinks()
{
throw new NotImplementedException();
}
public string AddFileLink(Mods.IMod p_modMod, string p_strBaseFilePath, string p_strSourceFile, bool p_booIsSwitching, bool p_booIsRestoring, bool p_booHandlePlugin, int p_intPriority)
{
throw new NotImplementedException();
}
public void AddInactiveLink(Mods.IMod p_modMod, string p_strBaseFilePath, int p_intPriority)
{
throw new NotImplementedException();
}
public void RemoveFileLink(string p_strFilePath, Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public string AddFileLink(Mods.IMod p_modMod, string p_strBaseFilePath, bool p_booIsSwitching, bool p_booIsRestoring, int p_intPriority)
{
throw new NotImplementedException();
}
public void RemoveFileLink(IVirtualModLink p_ivlVirtualLink, Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public string AddFileLink(Mods.IMod p_modMod, string p_strBaseFilePath, string p_strSourceFile, bool p_booIsSwitching, bool p_booIsRestoring, bool p_booHandlePlugin, int p_intPriority)
{
throw new NotImplementedException();
}
public void UpdateLinkPriority(IVirtualModLink p_ivlFileLink)
{
throw new NotImplementedException();
}
public void RemoveFileLink(string p_strFilePath, Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void UpdateLinkListPriority(List<IVirtualModLink> lstFileLinks)
{
throw new NotImplementedException();
}
public void RemoveFileLink(IVirtualModLink p_ivlVirtualLink, Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void DisableMod(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void UpdateLinkPriority(IVirtualModLink p_ivlFileLink)
{
throw new NotImplementedException();
}
public void DisableModFiles(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void UpdateLinkListPriority(List<IVirtualModLink> lstFileLinks)
{
throw new NotImplementedException();
}
public void FinalizeModDeactivation(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void DisableMod(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void EnableMod(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void DisableModFiles(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void FinalizeModActivation(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void FinalizeModDeactivation(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void LogIniEdits(Mods.IMod p_modMod, string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue)
{
throw new NotImplementedException();
}
public void EnableMod(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void RestoreIniEdits()
{
throw new NotImplementedException();
}
public void FinalizeModActivation(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void PurgeIniEdits()
{
throw new NotImplementedException();
}
public void LogIniEdits(Mods.IMod p_modMod, string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue)
{
throw new NotImplementedException();
}
public void ImportIniEdits(string p_strIniXML)
{
throw new NotImplementedException();
}
public void RestoreIniEdits()
{
throw new NotImplementedException();
}
public void SetNewFolders(string p_strVirtual, string p_strLink, bool? p_booMultiHD)
{
throw new NotImplementedException();
}
public void PurgeIniEdits()
{
throw new NotImplementedException();
}
public void CheckLinkListIntegrity(IList<IVirtualModLink> p_ivlVirtualLinks, out Dictionary<string, string> p_dicUninstalled, out Dictionary<string, string> p_dicMissing, IList<string> p_lstForced)
{
throw new NotImplementedException();
}
public void ImportIniEdits(string p_strIniXML)
{
throw new NotImplementedException();
}
public IModLinkInstaller GetModLinkInstaller()
{
return new DummyModLinkInstaller();
}
public void SetNewFolders(string p_strVirtual, string p_strLink, bool? p_booMultiHD)
{
throw new NotImplementedException();
}
public void PurgeMods(List<Mods.IMod> p_lstMods, string p_strPath)
{
throw new NotImplementedException();
}
public void CheckLinkListIntegrity(IList<IVirtualModLink> p_ivlVirtualLinks, out Dictionary<string, string> p_dicUninstalled, out Dictionary<string, string> p_dicMissing, IList<string> p_lstForced)
{
throw new NotImplementedException();
}
public bool CheckHasActiveLinks(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public IModLinkInstaller GetModLinkInstaller()
{
return new DummyModLinkInstaller();
}
public string GetCurrentFileOwner(string p_strPath)
{
throw new NotImplementedException();
}
public void PurgeMods(List<Mods.IMod> p_lstMods, string p_strPath)
{
throw new NotImplementedException();
}
public BackgroundTasks.IBackgroundTask ActivatingMod(Mods.IMod p_modMod, bool p_booDisabling, UI.ConfirmActionMethod p_camConfirm)
{
throw new NotImplementedException();
}
public bool CheckHasActiveLinks(Mods.IMod p_modMod)
{
throw new NotImplementedException();
}
public void SaveModList(string p_strPath, List<IVirtualModInfo> p_lstVirtualModInfo, List<IVirtualModLink> p_lstVirtualModList)
{
throw new NotImplementedException();
public string GetCurrentFileOwner(string p_strPath)
{
throw new NotImplementedException();
}
public BackgroundTasks.IBackgroundTask ActivatingMod(Mods.IMod p_modMod, bool p_booDisabling, UI.ConfirmActionMethod p_camConfirm)
{
throw new NotImplementedException();
}
public void SaveModList(string p_strPath, List<IVirtualModInfo> p_lstVirtualModInfo, List<IVirtualModLink> p_lstVirtualModList)
{
throw new NotImplementedException();
}
public string RequiresFixing()
{
throw new NotImplementedException();
}
public string RequiresFixing(string p_strFilePath)
{
throw new NotImplementedException();
}
bool IVirtualModActivator.SaveList()
{
throw new NotImplementedException();
}
public bool SaveList(bool p_booModActivationChange)
{
throw new NotImplementedException();
}
public List<IVirtualModLink> LoadImportedList(string p_strXML, string p_strSavePath)
{
throw new NotImplementedException();
}
public void UpdateDownloadId(string p_strCurrentProfilePath, Dictionary<string, string> p_dctNewDownloadID)
{
throw new NotImplementedException();
}
public void CheckLinkListIntegrity(IList<IVirtualModLink> p_ivlVirtualLinks, out List<IVirtualModInfo> p_lstMissingModInfo, IList<string> p_lstForced)
{
throw new NotImplementedException();
}
public IBackgroundTask FixConfigFiles(List<string> p_lstFiles, IModProfile p_mprProfile, ConfirmActionMethod p_camConfirm)
{
throw new NotImplementedException();
}
}
}
}
+1 -1
View File
@@ -5,7 +5,7 @@
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{67229E11-4C18-4863-8B1E-45145BC858FB}</ProjectGuid>
<ProjectGuid>{08AA7C55-01D6-4C22-AC2D-E04DBCF35890}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Nexus.Client.CLI</RootNamespace>
+41 -1
View File
@@ -1,4 +1,5 @@
using Nexus.Client.Settings;
using System;
using Nexus.Client.Settings;
namespace Nexus.Client.CLI.Properties
{
@@ -11,6 +12,32 @@ namespace Nexus.Client.CLI.Properties
/// </remarks>
internal sealed partial class Settings : ISettings
{
public DateTime LastCheckedMissingDownloadID
{
get
{
return DateTime.Now; // idfk, doesn't seem used as of 11/15/2016 - N3X
}
set
{
//nop
}
}
public int MaxConcurrentDownloads
{
get
{
return 1; // idfk, value set for toasters - N3X
}
set
{
// nop
}
}
/// <summary>
/// Gets the full name of the mod manager.
/// </summary>
@@ -22,5 +49,18 @@ namespace Nexus.Client.CLI.Properties
return "NMM CLI";
}
}
public bool SkyrimSEFirstInstallWarning
{
get
{
return true; // Avoid any popups. Yeees, we totally showed that popup! - N3X
}
set
{
// nop
}
}
}
}
+27
View File
@@ -0,0 +1,27 @@
import os
script_dir = os.path.dirname(__file__)
from buildtools import log
from buildtools.buildsystem.visualstudio import VisualStudio2015Solution, ProjectType
target=os.path.join(script_dir, '..', 'NMM','NexusClient.sln')
csprojfile = os.path.join('..','NexusClientCli','NexusClientCLI','NexusClientCLI.csproj')
sln = VisualStudio2015Solution()
sln.LoadFromFile(target)
changed=False
if 'NexusClientCli' not in sln.projectsByName:
proj = sln.AddProject('NexusClientCli',ProjectType.CSHARP_PROJECT,csprojfile)
log.info('Added %s (%s) to %s', proj.name, proj.guid, target)
changed=True
else:
proj = sln.projectsByName['NexusClientCli']
log.info('Project %s (%s) already exists in %s', proj.name, proj.guid, target)
if proj.projectfile != csprojfile:
oprojfile = proj.projectfile
proj.projectfile = csprojfile
log.info('Fixed CSPROJ location: %s -> %s',oprojfile,csprojfile)
changed=True
if changed:
sln.SaveToFile(target+'.patched')