using System; using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; // Token: 0x020000BB RID: 187 public class Journal : MonoBehaviour { // Token: 0x060011C1 RID: 4545 RVA: 0x0015CB10 File Offset: 0x0015AD10 private void Start() { Links.x.journal = this; this.noteAnimator.speed = 1.5f; if (!Records.x.windows) { this.scrollRectLeft.scrollSensitivity = 9f; this.scrollRectRight.scrollSensitivity = 9f; } this.anim.enabled = false; this.CloseMenu(); } // Token: 0x060011C2 RID: 4546 RVA: 0x0015CB78 File Offset: 0x0015AD78 public void ClearNotes() { for (int i = 0; i < this.playerNotes.Count; i++) { if (this.playerNotes[i]) { Object.Destroy(this.playerNotes[i].gameObject); } } for (int j = 0; j < this.itemNotes.Count; j++) { if (this.itemNotes[j]) { Object.Destroy(this.itemNotes[j].gameObject); } } this.itemNotes.Clear(); this.playerNotes.Clear(); this.playerScrolls.Clear(); this.playerScrollLabels.Clear(); this.playerScrollIDs.Clear(); this.itemScrollInventory.Clear(); this.itemScrollIDs.Clear(); this.noteCount = 0; } // Token: 0x060011C3 RID: 4547 RVA: 0x0015CC57 File Offset: 0x0015AE57 public void NewGame() { base.StartCoroutine(this.WaitForNewGame()); } // Token: 0x060011C4 RID: 4548 RVA: 0x0015CC66 File Offset: 0x0015AE66 private IEnumerator WaitForNewGame() { yield return new WaitForSecondsRealtime(0.1f); this.AddNote("", "Conversation Notes", Random.Range(0, 6), true, "", "Scroll", -1, -1); yield break; } // Token: 0x060011C5 RID: 4549 RVA: 0x0015CC78 File Offset: 0x0015AE78 public void DoSave() { string text = Records.x.openBook + "/Records.es3"; this.playerScrolls.Clear(); this.playerScrollLabels.Clear(); this.playerScrollIDs.Clear(); this.itemScrollInventory.Clear(); this.itemScrollIDs.Clear(); this.saveFile = new ES3File(text); for (int i = 0; i < this.playerNotes.Count; i++) { this.playerScrolls.Add(this.playerNotes[i].note); this.playerScrollLabels.Add(this.playerNotes[i].label); this.playerScrollIDs.Add(this.playerNotes[i].ID); this.itemScrollIDs.Add(this.playerNotes[i].uniqueID); } this.saveFile.Save>("Player Scrolls", this.playerScrolls); this.saveFile.Save>("Item Scroll Inventory Names", this.itemScrollInventory); this.saveFile.Save>("Player Scroll ID", this.playerScrollIDs); this.saveFile.Save>("Item Scroll ID", this.itemScrollIDs); this.saveFile.Save>("Player Scroll Labels", this.playerScrollLabels); this.saveFile.Save("Pinned Note Text", Links.x.hudControl.savedNoteText); this.saveFile.Save("Pinned Note Image", Links.x.hudControl.savedNoteImage); this.saveFile.Save("Pinned Note Rune", Links.x.hudControl.savedNoteRune); this.saveFile.Save("Note Count", this.noteCount); this.saveFile.Sync(); } // Token: 0x060011C6 RID: 4550 RVA: 0x0015CE54 File Offset: 0x0015B054 public void StartMenu() { if (this.open) { return; } this.pinButton.SetActive(false); if (Links.x.diorama.sceneName == "F4_BanquetIsle") { this.pavuraNote.SetActive(false); } else { this.pavuraNote.SetActive(true); } Links.x.gameplay.lastMenu = "Journal"; this.anim.enabled = true; Links.x.gameplay.openingAnotherMenu = true; Links.x.gameplay.CloseAllMenus(); if (!Records.x.inMenus && Links.x.gaia.sceneLoaded) { Links.x.gameplay.OpenDock(); } this.removeScrollMenu.SetActive(false); this.canvas.enabled = true; this.contents1.SetActive(true); this.contents2.SetActive(true); bool flag = false; if (Links.x.joy && (Links.x.gameplay.dockStart || Links.x.gameplay.itemsStart)) { flag = true; } if (flag) { this.anim.Play("Open", 0, 1f); } else { this.anim.Play("Open"); } Records.x.AddMenu(base.gameObject); this.open = true; this.closeNoteBtn.interactable = false; this.UpdateWithCloseButton(); if (Links.x.joy) { Links.x.hudControl.UpdateMenuSwitcher("Journal"); } Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.playerNotes[0].gameObject); this.UpdateButtonNavs(this.playerNotes[0]); if (Links.x.joy) { this.UpdateScrollNav(true, this.playerNotes[0], true); } this.inputFieldBorderTitle.color = new Color(0f, 0f, 0f, 0f); this.inputFieldBorderNote.color = new Color(0f, 0f, 0f, 0f); } // Token: 0x060011C7 RID: 4551 RVA: 0x0015D08C File Offset: 0x0015B28C public void LoadScrolls() { this.ClearNotes(); this.playerScrolls.Clear(); this.playerScrollLabels.Clear(); this.playerScrollIDs.Clear(); this.itemScrollInventory.Clear(); this.itemScrollIDs.Clear(); string text = Records.x.openBook + "/Records.es3"; this.saveFile = new ES3File(text); if (this.saveFile.KeyExists("Player Scrolls")) { this.playerScrolls = this.saveFile.Load>("Player Scrolls"); this.itemScrollInventory = this.saveFile.Load>("Item Scroll Inventory Names"); this.playerScrollIDs = this.saveFile.Load>("Player Scroll ID"); this.itemScrollIDs = this.saveFile.Load>("Item Scroll ID"); this.playerScrollLabels = this.saveFile.Load>("Player Scroll Labels"); Links.x.hudControl.savedNoteText = this.saveFile.Load("Pinned Note Text"); Links.x.hudControl.savedNoteImage = this.saveFile.Load("Pinned Note Image"); Links.x.hudControl.savedNoteRune = this.saveFile.Load("Pinned Note Rune"); Links.x.hudControl.SetPinnedNoteFromLoad(); } bool flag = false; if (this.saveFile.KeyExists("Note Count")) { this.noteCount = this.saveFile.Load("Note Count"); } else { this.noteCount = 0; flag = true; } for (int i = 0; i < this.playerScrolls.Count; i++) { this.playerNotes.Add(null); if (flag) { this.itemScrollIDs.Add(this.noteCount); this.noteCount++; } this.AddNote(this.playerScrolls[i], this.playerScrollLabels[i], this.playerScrollIDs[i], true, "", "Scroll", i, this.itemScrollIDs[i]); } } // Token: 0x060011C8 RID: 4552 RVA: 0x0015D2A4 File Offset: 0x0015B4A4 public void AddNoteFromButton() { this.AddNote("", "", Random.Range(0, 6), true, "", "Scroll", -1, -1); } // Token: 0x060011C9 RID: 4553 RVA: 0x0015D2D8 File Offset: 0x0015B4D8 public void AddNote(string text, string label, int id, bool userCreated, string inventoryName, string tag, int index, int uniqueID) { JournalScroll journalScroll = null; if (userCreated) { journalScroll = Object.Instantiate(this.scrollsVariationsLeft[id], new Vector3(0f, 0f, 0f), Quaternion.identity, this.leftScrollParent).GetComponent(); if (index == -1) { this.playerNotes.Add(journalScroll); this.playerScrolls.Add(journalScroll.note); this.playerScrollLabels.Add(journalScroll.label); this.playerScrollIDs.Add(journalScroll.ID); uniqueID = this.noteCount; this.itemScrollIDs.Add(this.noteCount); this.noteCount++; } else { this.playerNotes[index] = journalScroll; this.playerScrolls[index] = journalScroll.note; this.playerScrollLabels[index] = journalScroll.label; this.playerScrollIDs[index] = journalScroll.ID; } } journalScroll.gameObject.transform.localPosition = new Vector3(0f, 0f, 0f); journalScroll.userCreated = userCreated; journalScroll.inventoryName = inventoryName; journalScroll.note = text; journalScroll.label = label; journalScroll.textLabel.text = label; journalScroll.uniqueID = uniqueID; this.UpdateScrollNav(userCreated, journalScroll, true); if (this.playerNotes.Count == 0 || userCreated) { this.UpdateButtonNavs(journalScroll); } } // Token: 0x060011CA RID: 4554 RVA: 0x0015D454 File Offset: 0x0015B654 private void UpdateButtonNavs(JournalScroll scroll) { if (Links.x.joy) { if (!scroll.button) { scroll.button = scroll.gameObject.GetComponent