Browse Source

Moved classes to new namespace

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
cace022c38
16 changed files with 49 additions and 25 deletions
  1. +9
    -9
      IPA.Loader/IPA.Loader.csproj
  2. +1
    -1
      IPA.Loader/IllusionInjector/BeatSaber/CompositeBSPlugin.cs
  3. +2
    -0
      IPA.Loader/IllusionInjector/IPA/CompositeIPAPlugin.cs
  4. +1
    -0
      IPA.Loader/IllusionInjector/Logging/StandardLogger.cs
  5. +1
    -0
      IPA.Loader/IllusionInjector/PluginComponent.cs
  6. +24
    -4
      IPA.Loader/IllusionInjector/PluginManager.cs
  7. +1
    -0
      IPA.Loader/IllusionInjector/Updating/ModsaberML/Updater.cs
  8. +1
    -1
      IPA.Loader/IllusionInjector/Updating/SelfPlugin.cs
  9. +1
    -1
      IPA.Loader/IniFile.cs
  10. +1
    -1
      IPA.Loader/ModPrefs.cs
  11. +2
    -3
      IPA.Loader/PluginInterfaces/BeatSaber/IBeatSaberPlugin.cs
  12. +1
    -1
      IPA.Loader/PluginInterfaces/BeatSaber/IEnhancedBeatSaberPlugin.cs
  13. +1
    -1
      IPA.Loader/PluginInterfaces/BeatSaber/ModsaberModInfo.cs
  14. +1
    -1
      IPA.Loader/PluginInterfaces/IGenericEnhancedPlugin.cs
  15. +1
    -1
      IPA.Loader/PluginInterfaces/IPA/IEnhancedPlugin.cs
  16. +1
    -1
      IPA.Loader/PluginInterfaces/IPA/IPlugin.cs

+ 9
- 9
IPA.Loader/IPA.Loader.csproj View File

@ -7,7 +7,7 @@
<ProjectGuid>{5AD344F0-01A0-4CA8-92E5-9D095737744D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IPA.Loader</RootNamespace>
<RootNamespace>IPA</RootNamespace>
<AssemblyName>IPA.Loader</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
@ -52,16 +52,16 @@
</ItemGroup>
<ItemGroup>
<Compile Include="IllusionInjector\BeatSaber\CompositeBSPlugin.cs" />
<Compile Include="IllusionPlugin\BeatSaber\IBeatSaberPlugin.cs" />
<Compile Include="IllusionPlugin\BeatSaber\IEnhancedBeatSaberPlugin.cs" />
<Compile Include="IllusionPlugin\BeatSaber\ModsaberModInfo.cs" />
<Compile Include="IllusionPlugin\IGenericEnhancedPlugin.cs" />
<Compile Include="IllusionPlugin\IniFile.cs" />
<Compile Include="IllusionPlugin\IPA\IEnhancedPlugin.cs" />
<Compile Include="IllusionPlugin\IPA\IPlugin.cs" />
<Compile Include="PluginInterfaces\BeatSaber\IBeatSaberPlugin.cs" />
<Compile Include="PluginInterfaces\BeatSaber\IEnhancedBeatSaberPlugin.cs" />
<Compile Include="PluginInterfaces\BeatSaber\ModsaberModInfo.cs" />
<Compile Include="PluginInterfaces\IGenericEnhancedPlugin.cs" />
<Compile Include="IniFile.cs" />
<Compile Include="PluginInterfaces\IPA\IEnhancedPlugin.cs" />
<Compile Include="PluginInterfaces\IPA\IPlugin.cs" />
<Compile Include="IllusionPlugin\Logging\Logger.cs" />
<Compile Include="IllusionPlugin\Logging\LogPrinter.cs" />
<Compile Include="IllusionPlugin\ModPrefs.cs" />
<Compile Include="ModPrefs.cs" />
<Compile Include="IllusionPlugin\Utils\ReflectionUtil.cs" />
<Compile Include="IllusionInjector\IPA\CompositeIPAPlugin.cs" />
<Compile Include="IllusionInjector\Logging\Printers\ColoredConsolePrinter.cs" />


+ 1
- 1
IPA.Loader/IllusionInjector/BeatSaber/CompositeBSPlugin.cs View File

@ -1,5 +1,5 @@
using IllusionPlugin;
using IllusionPlugin.BeatSaber;
using IPA;
using System;
using System.Collections.Generic;
using System.Linq;


+ 2
- 0
IPA.Loader/IllusionInjector/IPA/CompositeIPAPlugin.cs View File

@ -1,6 +1,8 @@
using IllusionPlugin;
using System;
using System.Collections.Generic;
using IPA;
using IPA.Old;
using System.Linq;
using System.Text;
using UnityEngine;


+ 1
- 0
IPA.Loader/IllusionInjector/Logging/StandardLogger.cs View File

@ -9,6 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using IPA;
using LoggerBase = IllusionPlugin.Logging.Logger;
namespace IllusionInjector.Logging


+ 1
- 0
IPA.Loader/IllusionInjector/PluginComponent.cs View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Text;
using UnityEngine;
using UnityEngine.SceneManagement;
using IPA.Loader;
namespace IllusionInjector
{


+ 24
- 4
IPA.Loader/IllusionInjector/PluginManager.cs View File

@ -2,7 +2,8 @@
using IllusionInjector.Updating;
using IllusionInjector.Utilities;
using IllusionPlugin;
using IllusionPlugin.BeatSaber;
using IPA;
using IPA.Old;
using Mono.Cecil;
using System;
using System.Collections.Generic;
@ -16,7 +17,7 @@ using System.Text;
using System.Threading.Tasks;
using LoggerBase = IllusionPlugin.Logging.Logger;
namespace IllusionInjector
namespace IPA.Loader
{
public static class PluginManager
{
@ -177,17 +178,36 @@ namespace IllusionInjector
try
{
#region Fix assemblies for refactor
var module = ModuleDefinition.ReadModule(file);
bool modifiedModule = false;
foreach (var @ref in module.AssemblyReferences)
{
{ // fix assembly references
if (@ref.Name == "IllusionPlugin" || @ref.Name == "IllusionInjector")
{
@ref.Name = "IPA.Loader";
modifiedModule = true;
}
}
if (modifiedModule) module.Write(file);
if (modifiedModule)
{ // types don't need to be fixed if it's already referencing the new version
foreach (var @ref in module.GetTypeReferences())
{ // fix type references
if (@ref.FullName == "IllusionPlugin.IPlugin") @ref.Namespace = "IPA.Old"; //@ref.Name = "";
if (@ref.FullName == "IllusionPlugin.IEnhancedPlugin") @ref.Namespace = "IPA.Old"; //@ref.Name = ""
if (@ref.FullName == "IllusionPlugin.IBeatSaberPlugin") @ref.Namespace = "IPA"; //@ref.Name = ""
if (@ref.FullName == "IllusionPlugin.IEnhancedBeatSaberPlugin") @ref.Namespace = "IPA"; //@ref.Name = ""
if (@ref.FullName == "IllusionPlugin.BeatSaber.ModsaberModInfo") @ref.Namespace = "IPA"; //@ref.Name = ""
if (@ref.FullName == "IllusionPlugin.IniFile") @ref.Namespace = "IPA"; //@ref.Name = ""
if (@ref.FullName == "IllusionPlugin.IModPrefs") @ref.Namespace = "IPA"; //@ref.Name = ""
if (@ref.FullName == "IllusionPlugin.ModPrefs") @ref.Namespace = "IPA"; //@ref.Name = ""
if (@ref.FullName == "IllusionInjector.PluginManager") @ref.Namespace = "IPA.Loader"; //@ref.Name = ""
}
module.Write(file);
}
#endregion
Assembly assembly = Assembly.LoadFrom(file);


+ 1
- 0
IPA.Loader/IllusionInjector/Updating/ModsaberML/Updater.cs View File

@ -1,5 +1,6 @@
using IllusionInjector.Updating.Backup;
using IllusionInjector.Utilities;
using IPA.Loader;
using Ionic.Zip;
using Newtonsoft.Json;
using System;


+ 1
- 1
IPA.Loader/IllusionInjector/Updating/SelfPlugin.cs View File

@ -1,5 +1,5 @@
using IllusionPlugin;
using IllusionPlugin.BeatSaber;
using IPA;
using System;
using System.Collections.Generic;
using System.Linq;


IPA.Loader/IllusionPlugin/IniFile.cs → IPA.Loader/IniFile.cs View File

@ -4,7 +4,7 @@ using System.IO;
using System.Runtime.InteropServices;
using System.Text;
namespace IllusionPlugin
namespace IPA
{
/// <summary>
/// Create a New INI file to store or load data

IPA.Loader/IllusionPlugin/ModPrefs.cs → IPA.Loader/ModPrefs.cs View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Reflection;
using System.Text;
namespace IllusionPlugin
namespace IPA
{
/// <summary>
/// Allows to get and set preferences for your mod.

IPA.Loader/IllusionPlugin/BeatSaber/IBeatSaberPlugin.cs → IPA.Loader/PluginInterfaces/BeatSaber/IBeatSaberPlugin.cs View File

@ -1,10 +1,9 @@
using IllusionPlugin.BeatSaber;
using System;
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine.SceneManagement;
namespace IllusionPlugin
namespace IPA
{
/// <summary>
/// Interface for Beat Saber plugins. Every class that implements this will be loaded if the DLL is placed at

IPA.Loader/IllusionPlugin/BeatSaber/IEnhancedBeatSaberPlugin.cs → IPA.Loader/PluginInterfaces/BeatSaber/IEnhancedBeatSaberPlugin.cs View File

@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
namespace IllusionPlugin
namespace IPA
{
/// <summary>
/// An enhanced version of a standard BeatSaber plugin.

IPA.Loader/IllusionPlugin/BeatSaber/ModsaberModInfo.cs → IPA.Loader/PluginInterfaces/BeatSaber/ModsaberModInfo.cs View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IllusionPlugin.BeatSaber
namespace IPA
{
/// <summary>
/// A class to provide information about a mod on ModSaber.ML

IPA.Loader/IllusionPlugin/IGenericEnhancedPlugin.cs → IPA.Loader/PluginInterfaces/IGenericEnhancedPlugin.cs View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IllusionPlugin
namespace IPA
{
/// <summary>
/// A generic interface for the modification for enhanced plugins.

IPA.Loader/IllusionPlugin/IPA/IEnhancedPlugin.cs → IPA.Loader/PluginInterfaces/IPA/IEnhancedPlugin.cs View File

@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
namespace IllusionPlugin
namespace IPA.Old
{
/// <summary>
/// An enhanced version of the standard IPA plugin.

IPA.Loader/IllusionPlugin/IPA/IPlugin.cs → IPA.Loader/PluginInterfaces/IPA/IPlugin.cs View File

@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
namespace IllusionPlugin
namespace IPA.Old
{
/// <summary>
/// Interface for generic Illusion unity plugins. Every class that implements this will be loaded if the DLL is placed at

Loading…
Cancel
Save