Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Quintessential.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@

<ItemGroup>
<PackageReference Include="YamlDotNet" Version="11.2.1" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />
</ItemGroup>

<ItemGroup>
<Reference Include="Ionic.Zip.Reduced">
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Opus Magnum\Ionic.Zip.Reduced.dll</HintPath>
<CopyLocal>False</CopyLocal>
</Reference>
<Reference Include="Lightning">
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Opus Magnum\IntermediaryLightning.exe</HintPath>
<Private>false</Private>
Expand Down
9 changes: 6 additions & 3 deletions Quintessential/QuintessentialLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Reflection;
using System.Resources;

using Ionic.Zip;
using ICSharpCode.SharpZipLib.Zip;

using MonoMod.Utils;

Expand Down Expand Up @@ -46,6 +46,8 @@ public class QuintessentialLoader {
private static readonly string zipExtractSuffix = "__quintessential_from_zip";
private static readonly string quintAssetFolder = "__quintessential_assets";

private static FastZip zipExtractor = new FastZip();

public static void PreInit() {
try {
PathLightning = Path.GetDirectoryName(typeof(GameLogic).Assembly.Location);
Expand Down Expand Up @@ -93,6 +95,8 @@ public static void PreInit() {
var set = manager.GetResourceSet(CultureInfo.InvariantCulture, true, true);
foreach(object item in set){
if(item is DictionaryEntry de){
foreach(object item in set) {
if(item is DictionaryEntry de) {
string name = (string)de.Key;
using var toStream = File.OpenWrite(Path.Combine(outDir, name));
byte[] content = (byte[])de.Value;
Expand Down Expand Up @@ -323,8 +327,7 @@ protected static void FindZipMod(string zip) {
return;

var dest = zip.Substring(0, zip.Length - ".zip".Length) + zipExtractSuffix;
using(ZipFile file = new(zip))
file.ExtractAll(dest);
zipExtractor.ExtractZip(zip, dest, "");
FindFolderMod(dest, zip);
}

Expand Down