Hi @NoMoonGames ! I'll take a look now and get back to you
Edit:
This should be it. Pasting it here for future reference!
using UnityEngine; using System.Collections; using AC; public class DocumentPageTextures : MonoBehaviour { public int documentID; public Texture2D[] pageTextures; private void OnEnable() { EventManager.OnMenuTurnOn += OnMenuTurnOn; EventManager.OnMenuElementShift += OnMenuElementShift; } private void OnDisable() { EventManager.OnMenuTurnOn -= OnMenuTurnOn; EventManager.OnMenuElementShift -= OnMenuElementShift; } private void OnMenuTurnOn(Menu menu, bool isInstant) { if (menu.title == "Document") { UpdatePageTexture(); } } private void OnMenuElementShift(MenuElement _element, AC_ShiftInventory shiftType) { if (PlayerMenus.GetMenuWithName("Document").elements.Contains(_element)) { UpdatePageTexture(); } } private void UpdatePageTexture() { if (KickStarter.runtimeDocuments.ActiveDocument != null && KickStarter.runtimeDocuments.ActiveDocument.ID == documentID) { MenuJournal journal = PlayerMenus.GetElementWithName("Document", "Journal") as MenuJournal; int pageIndex = journal.showPage - 1; MenuGraphic graphic = PlayerMenus.GetElementWithName("Document", "Texture") as MenuGraphic; graphic.graphic.texture = pageTextures[pageIndex]; graphic.graphic.ClearCache(); } } }
that's great, many thanks!
You're welcome
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Hi @NoMoonGames ! I'll take a look now and get back to you
Edit:
This should be it. Pasting it here for future reference!
that's great, many thanks!
You're welcome