Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 5e1cc65

Browse files
committed
2.2
Small cleanup
1 parent 4cd4d67 commit 5e1cc65

File tree

9 files changed

+17
-46
lines changed

9 files changed

+17
-46
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ A <b>BepInEx-Partiality Mod Wrapper</b> for Unity Games. This allows Partiality
77

88
This version is essentially Partiality packaged <b>as</b> a BepInEx mod. It serves as a dummy reference to Partliality.dll for Partiality Mods, but otherwise behaves as a BepInEx mod.
99

10-
The HOOKS file included with the release is the current latest one for Outward. If you're using this for a different game you will need to delete that and run the mod once to generate the hooks for your game.
11-
1210
## Install
1311

1412
Installation instructions and the download link can be found here:
File renamed without changes.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
</PropertyGroup>
2727
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2828
<Optimize>true</Optimize>
29-
<OutputPath>..\package\BepInEx\plugins\PartialityWrapper\</OutputPath>
29+
<OutputPath>..\Release\BepInEx\plugins\PartialityWrapper\</OutputPath>
3030
<DefineConstants>TRACE</DefineConstants>
3131
<ErrorReport>prompt</ErrorReport>
3232
<WarningLevel>4</WarningLevel>
3333
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
3434
</PropertyGroup>
3535
<ItemGroup>
3636
<Reference Include="BepInEx">
37-
<HintPath>..\references\BepInEx.dll</HintPath>
37+
<HintPath>..\lib\BepInEx.dll</HintPath>
3838
<Private>False</Private>
3939
</Reference>
4040
<Reference Include="Mono.Cecil, Version=0.10.4.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e">
@@ -71,13 +71,13 @@
7171
</Reference>
7272
<Reference Include="System" />
7373
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
74-
<HintPath>..\references\UnityEngine.dll</HintPath>
74+
<HintPath>..\lib\UnityEngine.dll</HintPath>
7575
<Private>False</Private>
7676
</Reference>
7777
</ItemGroup>
7878
<ItemGroup>
7979
<Compile Include="PartialityMod.cs" />
80-
<Compile Include="Wrapper.cs" />
80+
<Compile Include="PartialityWrapper.cs" />
8181
<Compile Include="Properties\AssemblyInfo.cs" />
8282
</ItemGroup>
8383
<ItemGroup>
Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
namespace Partiality
1515
{
1616
[BepInPlugin(ID, NAME, VERSION)]
17-
public class Wrapper : BaseUnityPlugin
17+
public class PartialityWrapper : BaseUnityPlugin
1818
{
1919
private const string ID = "com.sinai.PartialityWrapper";
2020
private const string NAME = "Partiality Wrapper";
21-
private const string VERSION = "2.1";
21+
private const string VERSION = "2.2";
2222

2323
public string PluginFolder => Path.GetDirectoryName(Info.Location);
2424
public string ModsFolder => Path.Combine(Paths.GameRootPath, "Mods");
@@ -37,19 +37,19 @@ internal void Awake()
3737

3838
private void LoadDependencies()
3939
{
40-
IEnumerable<string> dependencies = (
40+
var dependencies = (
4141
from filepath in Directory.GetFiles(PluginFolder)
4242
where (filepath.EndsWith(".dll") || filepath.EndsWith(".exe")) && !filepath.Contains("Partiality.dll")
4343
select filepath
4444
).AsEnumerable();
4545

4646
foreach (string filepath in dependencies)
4747
{
48-
Logger.Log(LogLevel.Message, "Loading dependency " + Path.GetFileName(filepath));
48+
//Logger.Log(LogLevel.Message, "Loading dependency " + Path.GetFileName(filepath));
4949
Assembly.Load(File.ReadAllBytes(filepath));
5050
}
5151

52-
Logger.Log(LogLevel.Message, "Done loading dependencies");
52+
//Logger.Log(LogLevel.Message, "Done loading dependencies");
5353
}
5454

5555
private void CheckHooks()
@@ -120,7 +120,7 @@ private void LoadMods()
120120
catch (ReflectionTypeLoadException ex)
121121
{
122122
Logger.Log(LogLevel.Error, $"Could not load \"{Path.GetFileName(filepath)}\" as a plugin!");
123-
Logger.Log(LogLevel.Debug, TypeLoadExceptionToString(ex));
123+
Logger.Log(LogLevel.Debug, ex);
124124
}
125125
catch (BadImageFormatException) { } // unmanaged DLL
126126
catch (Exception ex)
@@ -178,32 +178,5 @@ public static IEnumerable<Type> GetTypesSafe(Assembly asm)
178178
catch (ReflectionTypeLoadException e) { return e.Types.Where(x => x != null); }
179179
catch { return Enumerable.Empty<Type>(); }
180180
}
181-
182-
private static string TypeLoadExceptionToString(ReflectionTypeLoadException ex)
183-
{
184-
StringBuilder sb = new StringBuilder();
185-
foreach (Exception exSub in ex.LoaderExceptions)
186-
{
187-
sb.AppendLine(exSub.Message);
188-
if (exSub is FileNotFoundException exFileNotFound)
189-
{
190-
if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
191-
{
192-
sb.AppendLine("Fusion Log:");
193-
sb.AppendLine(exFileNotFound.FusionLog);
194-
}
195-
}
196-
else if (exSub is FileLoadException exLoad)
197-
{
198-
if (!string.IsNullOrEmpty(exLoad.FusionLog))
199-
{
200-
sb.AppendLine("Fusion Log:");
201-
sb.AppendLine(exLoad.FusionLog);
202-
}
203-
}
204-
sb.AppendLine();
205-
}
206-
return sb.ToString();
207-
}
208181
}
209182
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="Mono.Cecil" version="0.10.4" targetFramework="net35" />
4-
<package id="MonoMod" version="20.4.3.1" targetFramework="net35" />
5-
<package id="MonoMod.RuntimeDetour" version="20.4.3.1" targetFramework="net35" />
6-
<package id="MonoMod.RuntimeDetour.HookGen" version="20.4.3.1" targetFramework="net35" />
7-
<package id="MonoMod.Utils" version="20.4.3.1" targetFramework="net35" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Mono.Cecil" version="0.10.4" targetFramework="net35" />
4+
<package id="MonoMod" version="20.4.3.1" targetFramework="net35" />
5+
<package id="MonoMod.RuntimeDetour" version="20.4.3.1" targetFramework="net35" />
6+
<package id="MonoMod.RuntimeDetour.HookGen" version="20.4.3.1" targetFramework="net35" />
7+
<package id="MonoMod.Utils" version="20.4.3.1" targetFramework="net35" />
88
</packages>

0 commit comments

Comments
 (0)