Skip to content

Commit

Permalink
Merge pull request #157 from SubnauticaModding/nugetDependencies
Browse files Browse the repository at this point in the history
Switch to NuGet package for latest AssetsTools.NET
  • Loading branch information
toebeann authored Jul 24, 2020
2 parents bfe5bcd + 391e569 commit 7c7c958
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 8 deletions.
Binary file modified Build/InstallerExtensions.dll
Binary file not shown.
Binary file modified Build/QModInstaller.dll
Binary file not shown.
Binary file modified Build/QModManager.exe
Binary file not shown.
Binary file modified Build/QModManager_Setup.exe
Binary file not shown.
Binary file removed Dependencies/AssetsTools.NET.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions Executable/AudioFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal static void ChangeDisableUnityAudio(string path, bool newValue, QModGam
AssetsManager am = new AssetsManager();
AssetsFileInstance afi = am.LoadAssetsFile(path, false);
am.LoadClassDatabase("cldb.dat");
AssetFileInfoEx audioInfo = afi.table.getAssetInfo(4);
AssetFileInfoEx audioInfo = afi.table.GetAssetInfo(4);
AssetTypeInstance audioAti = am.GetATI(afi.file, audioInfo);
AssetTypeValueField audioBaseField = audioAti.GetBaseField();
audioBaseField.Get("m_DisableAudio").GetValue().Set(newValue);
Expand All @@ -32,7 +32,7 @@ internal static void ChangeDisableUnityAudio(string path, bool newValue, QModGam
using (MemoryStream memStream = new MemoryStream())
using (AssetsFileWriter writer = new AssetsFileWriter(memStream))
{
afi.file.Write(writer, 0, rep.ToArray(), 0);
afi.file.Write(writer, 0, rep, 0);
afi.stream.Close();
File.WriteAllBytes(path, memStream.ToArray());
}
Expand Down
5 changes: 3 additions & 2 deletions Executable/Executable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="AssetsTools.NET">
<HintPath>..\Dependencies\AssetsTools.NET.dll</HintPath>
<Reference Include="AssetsTools.NET, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AssetsTools.NET.2.0.3\lib\net35\AssetsTools.NET.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
Expand Down Expand Up @@ -119,6 +119,7 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
Expand Down
3 changes: 1 addition & 2 deletions Executable/Injector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal class Injector
internal Injector(string dir, string managedDir)
{
gameDirectory = dir;
managedDirectory = managedDir;
managedDirectory = managedDir;
mainFilename = Path.Combine(managedDirectory, mainFilename);
globalgamemanagers = Path.Combine(managedDirectory, "../globalgamemanagers");
}
Expand Down Expand Up @@ -45,7 +45,6 @@ internal void Inject()
File.Delete(backupFilePath);

AssemblyDefinition game = AssemblyDefinition.ReadAssembly(mainFilename);

AssemblyDefinition installer = AssemblyDefinition.ReadAssembly(installerFilename);
MethodDefinition patchMethod = installer.MainModule.GetType("QModInstaller.QModPatcher").Methods.First(x => x.Name == "Patch");

Expand Down
5 changes: 5 additions & 0 deletions Executable/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AssetsTools.NET" version="2.0.3" targetFramework="net40" />
<package id="Mono.Cecil" version="0.10.4" targetFramework="net40" />
</packages>
4 changes: 2 additions & 2 deletions Installer/QModsInstallerScript.iss
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Source: "..\Build\InstallerExtensions.dll"; Flags: DontCopy
; Subnautica
Source: "..\Dependencies\0Harmony.dll"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
Source: "..\Dependencies\0Harmony-1.2.0.1.dll"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
Source: "..\Dependencies\AssetsTools.NET.dll"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
Source: "..\packages\AssetsTools.NET.2.0.3\lib\net35\AssetsTools.NET.dll"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
Source: "..\Dependencies\cldb.dat"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
Source: "..\Dependencies\Mono.Cecil.dll"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
Source: "..\Build\QModInstaller.dll"; DestDir: "{app}\Subnautica_Data\Managed"; Flags: IgnoreVersion; Check: IsSubnauticaApp
Expand All @@ -69,7 +69,7 @@ Source: "..\Build\QModManager.exe"; DestDir: "{app}\Subnautica_Data\Managed"; Fl
; Below Zero
Source: "..\Dependencies\0Harmony.dll"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
Source: "..\Dependencies\0Harmony-1.2.0.1.dll"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
Source: "..\Dependencies\AssetsTools.NET.dll"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
Source: "..\packages\AssetsTools.NET.2.0.3\lib\net35\AssetsTools.NET.dll"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
Source: "..\Dependencies\cldb.dat"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
Source: "..\Dependencies\Mono.Cecil.dll"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
Source: "..\Build\QModInstaller.dll"; DestDir: "{app}\SubnauticaZero_Data\Managed"; Flags: IgnoreVersion; Check: IsBelowZeroApp
Expand Down

0 comments on commit 7c7c958

Please sign in to comment.