Merge pull request #185 from dgarroDC/fix-black-frame

Fix slide not showing after blackFrameDuration
This commit is contained in:
Ben C 2022-06-11 10:28:35 -04:00 committed by GitHub
commit 6153062cc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 7 deletions

View File

@ -96,7 +96,7 @@ namespace NewHorizons.Builder.Props
imageLoader.imageLoadedEvent.AddListener(
(Texture2D tex, int index) =>
{
slideCollection.slides[index].textureOverride = ImageUtilities.Invert(tex);
slideCollection.slides[index]._image = ImageUtilities.Invert(tex);
// Track the first 15 to put on the slide reel object
if (index < 15)
@ -176,7 +176,7 @@ namespace NewHorizons.Builder.Props
slideCollection.slides[i] = slide;
}
imageLoader.imageLoadedEvent.AddListener((Texture2D tex, int index) => { slideCollection.slides[index].textureOverride = ImageUtilities.Invert(tex); });
imageLoader.imageLoadedEvent.AddListener((Texture2D tex, int index) => { slideCollection.slides[index]._image = ImageUtilities.Invert(tex); });
slideCollectionContainer.slideCollection = slideCollection;
@ -185,8 +185,8 @@ namespace NewHorizons.Builder.Props
// Change the picture on the lens
var lens = projectorObj.transform.Find("Spotlight/Prop_IP_SingleSlideProjector/Projector_Lens").GetComponent<MeshRenderer>();
lens.materials[1].mainTexture = slideCollection.slides[0]._textureOverride;
lens.materials[1].SetTexture(EmissionMap, slideCollection.slides[0]._textureOverride);
lens.materials[1].mainTexture = slideCollection.slides[0]._image;
lens.materials[1].SetTexture(EmissionMap, slideCollection.slides[0]._image);
projectorObj.SetActive(true);
}
@ -224,7 +224,7 @@ namespace NewHorizons.Builder.Props
slideCollection.slides[i] = slide;
}
imageLoader.imageLoadedEvent.AddListener((Texture2D tex, int index) => { slideCollection.slides[index].textureOverride = tex; });
imageLoader.imageLoadedEvent.AddListener((Texture2D tex, int index) => { slideCollection.slides[index]._image = tex; });
// attatch a component to store all the data for the slides that play when a vision torch scans this target
@ -298,7 +298,7 @@ namespace NewHorizons.Builder.Props
imageLoader.imageLoadedEvent.AddListener(
(Texture2D tex, int index) =>
{
slideCollection.slides[index].textureOverride = tex;
slideCollection.slides[index]._image = tex;
displaySlidesLoaded++; // threading moment
if (displaySlidesLoaded >= slides.Length)
@ -380,7 +380,7 @@ namespace NewHorizons.Builder.Props
public class VisionTorchTarget : MonoBehaviour
{
public MindSlideCollection slideCollection;
public SlideCollectionContainer slideCollectionContainer;
public SlideCollectionContainer slideCollectionContainer;
public OWEvent.OWCallback onSlidesComplete;
}
}

View File

@ -0,0 +1,14 @@
using HarmonyLib;
namespace NewHorizons.Patches;
[HarmonyPatch]
public class AutoSlideProjectorPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(AutoSlideProjector), nameof(AutoSlideProjector.Play))]
public static void AutoSlideProjector_Play(ref SlideCollectionContainer ____slideCollectionItem)
{
____slideCollectionItem.enabled = true;
}
}