Skip to content

Commit

Permalink
Merge pull request #66 from nicoco007/bind-async-installers
Browse files Browse the repository at this point in the history
Allow binding against AsyncInstallers
  • Loading branch information
Auros committed Feb 19, 2024
2 parents 84e677c + 2a4a684 commit 726d6af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions SiraUtil/SiraUtil.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
</Reference>
<Reference Include="BGLib.AppFlow">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.AppFlow.dll</HintPath>
<Publicize>True</Publicize>
<Private>False</Private>
</Reference>
<Reference Include="BGLib.DotnetExtension">
Expand Down
7 changes: 6 additions & 1 deletion SiraUtil/Zenject/Harmony/ContextDecorator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using HarmonyLib;
using BGLib.AppFlow.Initialization;
using HarmonyLib;
using SiraUtil.Zenject.Internal;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -39,6 +40,10 @@ internal static void Prefix(ref Context __instance, ref List<InstallerBase> norm
foreach (var installerPrefab in installerPrefabs)
bindings.Add(new ContextBinding(__instance, installerPrefab.GetType(), accessor));

if (__instance is AsyncSceneContext asyncSceneContext)
foreach (var asyncInstaller in asyncSceneContext._asyncInstallers)
bindings.Add(new ContextBinding(__instance, asyncInstaller.GetType(), accessor));

if (__instance is SceneDecoratorContext decorator)
_recentlyInstalledDecorators.Add(decorator);

Expand Down

0 comments on commit 726d6af

Please sign in to comment.