1873 lines
48 KiB
C#
1873 lines
48 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
// Token: 0x020000D4 RID: 212
|
|
public class SaveLoad : MonoBehaviour
|
|
{
|
|
// Token: 0x060013BA RID: 5050 RVA: 0x0017E3B8 File Offset: 0x0017C5B8
|
|
private void Start()
|
|
{
|
|
this.startingOrder = this.canvas.sortingOrder;
|
|
this.anim.enabled = false;
|
|
Links.x.saveLoad = this;
|
|
this.canvas.enabled = false;
|
|
this.contentStartMenu.SetActive(false);
|
|
this.contentSaveLoad.SetActive(false);
|
|
this.confirmMainMenu.SetActive(false);
|
|
this.confirmQuit.SetActive(false);
|
|
base.StartCoroutine(this.GetSaves());
|
|
}
|
|
|
|
// Token: 0x060013BB RID: 5051 RVA: 0x0017E436 File Offset: 0x0017C636
|
|
private IEnumerator GetSaves()
|
|
{
|
|
this.UpdateSave("QuickSave");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("CheckpointSave");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("Save1");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("Save2");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("Save3");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("Save4");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("Save5");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("Save6");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("Save7");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("Save8");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("Save9");
|
|
yield return new WaitForSeconds(0.01f);
|
|
this.UpdateSave("Save10");
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x060013BC RID: 5052 RVA: 0x0017E448 File Offset: 0x0017C648
|
|
public void UpdateSave(string savename)
|
|
{
|
|
ES3File es3File = new ES3File("Version.es3");
|
|
if (!es3File.KeyExists("QuickSave"))
|
|
{
|
|
return;
|
|
}
|
|
if (savename == "QuickSave")
|
|
{
|
|
if (this.quickSaveSprite != null)
|
|
{
|
|
Object.Destroy(this.quickSaveSprite);
|
|
}
|
|
this.quickSaveSprite = this.LoadSprite(Application.persistentDataPath + "/QuickSave.png");
|
|
this.quickSaveInfo = es3File.Load<string>("QuickSave") + "\n<size=.9em>" + es3File.Load<string>("QuickSaveTime") + "</size>";
|
|
}
|
|
if (savename == "CheckpointSave")
|
|
{
|
|
if (this.checkpointSaveSprite != null)
|
|
{
|
|
Object.Destroy(this.checkpointSaveSprite);
|
|
}
|
|
this.checkpointSaveSprite = this.LoadSprite(Application.persistentDataPath + "/CheckpointSave.png");
|
|
this.checkpointSaveInfo = es3File.Load<string>("CheckpointSave") + "\n" + es3File.Load<string>("CheckpointSaveTime");
|
|
}
|
|
if (savename == "Save1")
|
|
{
|
|
if (this.save1Sprite != null)
|
|
{
|
|
Object.Destroy(this.save1Sprite);
|
|
}
|
|
this.save1Sprite = this.LoadSprite(Application.persistentDataPath + "/Save1.png");
|
|
this.save1Info = es3File.Load<string>("Save1") + "\n" + es3File.Load<string>("Save1Time");
|
|
}
|
|
if (savename == "Save2")
|
|
{
|
|
if (this.save2Sprite != null)
|
|
{
|
|
Object.Destroy(this.save2Sprite);
|
|
}
|
|
this.save2Sprite = this.LoadSprite(Application.persistentDataPath + "/Save2.png");
|
|
this.save2Info = es3File.Load<string>("Save2") + "\n" + es3File.Load<string>("Save2Time");
|
|
}
|
|
if (savename == "Save3")
|
|
{
|
|
if (this.save3Sprite != null)
|
|
{
|
|
Object.Destroy(this.save3Sprite);
|
|
}
|
|
this.save3Sprite = this.LoadSprite(Application.persistentDataPath + "/Save3.png");
|
|
this.save3Info = es3File.Load<string>("Save3") + "\n" + es3File.Load<string>("Save3Time");
|
|
}
|
|
if (savename == "Save4")
|
|
{
|
|
if (this.save4Sprite != null)
|
|
{
|
|
Object.Destroy(this.save4Sprite);
|
|
}
|
|
this.save4Sprite = this.LoadSprite(Application.persistentDataPath + "/Save4.png");
|
|
this.save4Info = es3File.Load<string>("Save4") + "\n" + es3File.Load<string>("Save4Time");
|
|
}
|
|
if (savename == "Save5")
|
|
{
|
|
if (this.save5Sprite != null)
|
|
{
|
|
Object.Destroy(this.save5Sprite);
|
|
}
|
|
this.save5Sprite = this.LoadSprite(Application.persistentDataPath + "/Save5.png");
|
|
this.save5Info = es3File.Load<string>("Save5") + "\n" + es3File.Load<string>("Save5Time");
|
|
}
|
|
if (savename == "Save6")
|
|
{
|
|
if (this.save6Sprite != null)
|
|
{
|
|
Object.Destroy(this.save6Sprite);
|
|
}
|
|
this.save6Sprite = this.LoadSprite(Application.persistentDataPath + "/Save6.png");
|
|
this.save6Info = es3File.Load<string>("Save6") + "\n" + es3File.Load<string>("Save6Time");
|
|
}
|
|
if (savename == "Save7")
|
|
{
|
|
if (this.save7Sprite != null)
|
|
{
|
|
Object.Destroy(this.save7Sprite);
|
|
}
|
|
this.save7Sprite = this.LoadSprite(Application.persistentDataPath + "/Save7.png");
|
|
this.save7Info = es3File.Load<string>("Save7") + "\n" + es3File.Load<string>("Save7Time");
|
|
}
|
|
if (savename == "Save8")
|
|
{
|
|
if (this.save8Sprite != null)
|
|
{
|
|
Object.Destroy(this.save8Sprite);
|
|
}
|
|
this.save8Sprite = this.LoadSprite(Application.persistentDataPath + "/Save8.png");
|
|
this.save8Info = es3File.Load<string>("Save8") + "\n" + es3File.Load<string>("Save8Time");
|
|
}
|
|
if (savename == "Save9")
|
|
{
|
|
if (this.save9Sprite != null)
|
|
{
|
|
Object.Destroy(this.save9Sprite);
|
|
}
|
|
this.save9Sprite = this.LoadSprite(Application.persistentDataPath + "/Save9.png");
|
|
this.save9Info = es3File.Load<string>("Save9") + "\n" + es3File.Load<string>("Save9Time");
|
|
}
|
|
if (savename == "Save10")
|
|
{
|
|
if (this.save10Sprite != null)
|
|
{
|
|
Object.Destroy(this.save10Sprite);
|
|
}
|
|
this.save10Sprite = this.LoadSprite(Application.persistentDataPath + "/Save10.png");
|
|
this.save10Info = es3File.Load<string>("Save10") + "\n" + es3File.Load<string>("Save10Time");
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013BD RID: 5053 RVA: 0x0017E948 File Offset: 0x0017CB48
|
|
public void OpenMenu()
|
|
{
|
|
if (this.open)
|
|
{
|
|
return;
|
|
}
|
|
this.canvasGroup.interactable = true;
|
|
if (Links.x.creation)
|
|
{
|
|
Links.x.creation.ToggleInteractable(false);
|
|
}
|
|
Links.x.gameplay.CloseAllMenus();
|
|
if (!Records.x.inMenus && Links.x.gaia.sceneLoaded)
|
|
{
|
|
Links.x.gameplay.OpenDock();
|
|
}
|
|
this.anim.enabled = true;
|
|
this.canvas.enabled = true;
|
|
this.contentStartMenu.SetActive(true);
|
|
this.contentSaveLoad.SetActive(false);
|
|
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");
|
|
}
|
|
if (!Records.x.CanSave())
|
|
{
|
|
this.saveBtn.raycastTarget = false;
|
|
this.saveBtn.gameObject.GetComponent<Button>().interactable = false;
|
|
}
|
|
else
|
|
{
|
|
this.saveBtn.raycastTarget = true;
|
|
this.saveBtn.gameObject.GetComponent<Button>().interactable = true;
|
|
}
|
|
this.closeBtn.SetActive(true);
|
|
if (Links.x.joy && !this.characterDead)
|
|
{
|
|
this.controllerExitStartMenu.SetActive(true);
|
|
this.controllerExitMainMenu.SetActive(true);
|
|
}
|
|
this.bookAuto.SetAtBeginning();
|
|
this.bookQuick.SetAtBeginning();
|
|
this.book1.SetAtBeginning();
|
|
this.book2.SetAtBeginning();
|
|
this.book3.SetAtBeginning();
|
|
this.book4.SetAtBeginning();
|
|
this.book5.SetAtBeginning();
|
|
this.book6.SetAtBeginning();
|
|
this.book7.SetAtBeginning();
|
|
this.book8.SetAtBeginning();
|
|
this.book9.SetAtBeginning();
|
|
this.book10.SetAtBeginning();
|
|
Records.x.AddMenu(base.gameObject);
|
|
this.open = true;
|
|
if (Links.x.joy)
|
|
{
|
|
Links.x.hudControl.UpdateMenuSwitcher("Options");
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013BE RID: 5054 RVA: 0x0017EB98 File Offset: 0x0017CD98
|
|
public void OpenMenuLoad(bool fromDead)
|
|
{
|
|
if (Links.x.deathScreen.activeSelf)
|
|
{
|
|
Links.x.deathScreen.GetComponent<DeathScreen>().DeathScreenOut();
|
|
}
|
|
Links.x.gameplay.lastMenu = "Load";
|
|
this.canvas.enabled = true;
|
|
this.anim.enabled = true;
|
|
this.characterDead = fromDead;
|
|
this.contentStartMenu.SetActive(false);
|
|
this.contentSaveLoad.SetActive(true);
|
|
if (!this.anim.GetCurrentAnimatorStateInfo(0).IsName("OpenMain"))
|
|
{
|
|
this.anim.Play("OpenMain");
|
|
}
|
|
Records.x.AddMenu(base.gameObject);
|
|
this.open = true;
|
|
this.ToggleLoadMenu();
|
|
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.checkpointSaveBtn.gameObject);
|
|
this.closeBtn.SetActive(true);
|
|
}
|
|
|
|
// Token: 0x060013BF RID: 5055 RVA: 0x0017EC88 File Offset: 0x0017CE88
|
|
public void OpenMenuSave()
|
|
{
|
|
Links.x.gameplay.lastMenu = "Save";
|
|
this.canvas.enabled = true;
|
|
this.anim.enabled = true;
|
|
this.contentStartMenu.SetActive(false);
|
|
this.contentSaveLoad.SetActive(true);
|
|
if (!this.anim.GetCurrentAnimatorStateInfo(0).IsName("OpenMain"))
|
|
{
|
|
this.anim.Play("OpenMain");
|
|
}
|
|
Records.x.AddMenu(base.gameObject);
|
|
this.open = true;
|
|
this.ToggleSaveMenu();
|
|
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.quickSaveBtn.gameObject);
|
|
this.closeBtn.SetActive(true);
|
|
}
|
|
|
|
// Token: 0x060013C0 RID: 5056 RVA: 0x0017ED4C File Offset: 0x0017CF4C
|
|
public void EndSwitchMenu()
|
|
{
|
|
this.contentStartMenu.SetActive(false);
|
|
}
|
|
|
|
// Token: 0x060013C1 RID: 5057 RVA: 0x0017ED5C File Offset: 0x0017CF5C
|
|
public void StartMenu(bool startWithSave)
|
|
{
|
|
this.canvas.enabled = true;
|
|
if (this.open)
|
|
{
|
|
this.StartEndMenu(true);
|
|
return;
|
|
}
|
|
if (!this.anim.GetCurrentAnimatorStateInfo(0).IsName("OpenMain"))
|
|
{
|
|
this.anim.Play("OpenMain");
|
|
}
|
|
this.saveCoroutine = null;
|
|
if (startWithSave)
|
|
{
|
|
this.contentSaveLoad.SetActive(true);
|
|
this.currentMenu = "Save";
|
|
this.headerText.text = "Save Game";
|
|
}
|
|
else
|
|
{
|
|
this.contentSaveLoad.SetActive(true);
|
|
this.currentMenu = "Load";
|
|
this.headerText.text = "Load Game";
|
|
}
|
|
ES3File es3File = new ES3File("Version.es3");
|
|
if (this.currentMenu == "Save")
|
|
{
|
|
for (int i = 0; i < this.editBtns.Count; i++)
|
|
{
|
|
this.editBtns[i].SetActive(true);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for (int j = 0; j < this.editBtns.Count; j++)
|
|
{
|
|
this.editBtns[j].SetActive(false);
|
|
}
|
|
}
|
|
this.ChangeButtons(false);
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("QuickSave"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("QuickSaveTime"));
|
|
this.str.Append("</size>");
|
|
this.quickSaveInfo = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("CheckpointSave"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("CheckpointSaveTime"));
|
|
this.str.Append("</size>");
|
|
this.checkpointSaveInfo = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("Save1"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("Save1Time"));
|
|
this.str.Append("</size>");
|
|
this.save1Info = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("Save2"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("Save2Time"));
|
|
this.str.Append("</size>");
|
|
this.save2Info = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("Save3"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("Save3Time"));
|
|
this.str.Append("</size>");
|
|
this.save3Info = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("Save4"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("Save4Time"));
|
|
this.str.Append("</size>");
|
|
this.save4Info = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("Save5"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("Save5Time"));
|
|
this.str.Append("</size>");
|
|
this.save5Info = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("Save6"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("Save6Time"));
|
|
this.str.Append("</size>");
|
|
this.save6Info = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("Save7"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("Save7Time"));
|
|
this.str.Append("</size>");
|
|
this.save7Info = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("Save8"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("Save8Time"));
|
|
this.str.Append("</size>");
|
|
this.save8Info = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("Save9"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("Save9Time"));
|
|
this.str.Append("</size>");
|
|
this.save9Info = this.str.ToString();
|
|
this.str.Clear();
|
|
this.str.Append(es3File.Load<string>("Save10"));
|
|
this.str.Append("\n<size=.8em>");
|
|
this.str.Append(es3File.Load<string>("Save10Time"));
|
|
this.str.Append("</size>");
|
|
this.save10Info = this.str.ToString();
|
|
if (Records.x.removeControls)
|
|
{
|
|
startWithSave = false;
|
|
}
|
|
if (Records.x.InCombat(false) || Records.x.removeControls)
|
|
{
|
|
startWithSave = false;
|
|
}
|
|
this.confirmSave.SetActive(false);
|
|
this.confirmLoad.SetActive(false);
|
|
this.checkpointSaveText.text = "\n<size=.7em>Checkpoint Save</size>";
|
|
this.quickSaveText.text = "\n<size=.7em>Quick Save</size>";
|
|
this.save1Text.text = "\n<size=.7em>Empty</size>";
|
|
this.save2Text.text = "\n<size=.7em>Empty</size>";
|
|
this.save3Text.text = "\n<size=.7em>Empty</size>";
|
|
this.save4Text.text = "\n<size=.7em>Empty</size>";
|
|
this.save5Text.text = "\n<size=.7em>Empty</size>";
|
|
this.save6Text.text = "\n<size=.7em>Empty</size>";
|
|
this.save7Text.text = "\n<size=.7em>Empty</size>";
|
|
this.save8Text.text = "\n<size=.7em>Empty</size>";
|
|
this.save9Text.text = "\n<size=.7em>Empty</size>";
|
|
this.save10Text.text = "\n<size=.7em>Empty</size>";
|
|
this.quickSave = false;
|
|
this.checkpointSave = false;
|
|
this.save1 = false;
|
|
this.save2 = false;
|
|
this.save3 = false;
|
|
this.save4 = false;
|
|
this.save5 = false;
|
|
this.save6 = false;
|
|
this.save7 = false;
|
|
this.save8 = false;
|
|
if (this.currentMenu != "Save")
|
|
{
|
|
this.ChangeButtons(false);
|
|
}
|
|
Color color = new Color(0f, 0f, 0f, 0f);
|
|
Color color2 = new Color(0.5f, 0.5f, 0.5f, 1f);
|
|
this.quickSaveBtn.colors.normalColor = color;
|
|
this.checkpointSaveBtn.colors.normalColor = color;
|
|
this.save1Btn.colors.normalColor = color;
|
|
this.save2Btn.colors.normalColor = color;
|
|
this.save3Btn.colors.normalColor = color;
|
|
this.save4Btn.colors.normalColor = color;
|
|
this.save5Btn.colors.normalColor = color;
|
|
this.save6Btn.colors.normalColor = color;
|
|
this.save7Btn.colors.normalColor = color;
|
|
this.save8Btn.colors.normalColor = color;
|
|
this.save9Btn.colors.normalColor = color;
|
|
this.save10Btn.colors.normalColor = color;
|
|
Color color3 = new Color(0.5647059f, 0.5294118f, 0.46666667f, 1f);
|
|
Color color4 = color;
|
|
this.checkpointSaveText.color = color4;
|
|
this.quickSaveText.color = color4;
|
|
this.save1Text.color = color4;
|
|
this.save2Text.color = color4;
|
|
this.save3Text.color = color4;
|
|
this.save4Text.color = color4;
|
|
this.save5Text.color = color4;
|
|
this.save6Text.color = color4;
|
|
this.save7Text.color = color4;
|
|
this.save8Text.color = color4;
|
|
this.save9Text.color = color4;
|
|
this.save10Text.color = color4;
|
|
if (ES3.FileExists("QuickSave/Quests.es3"))
|
|
{
|
|
this.quickSaveImg.sprite = this.quickSaveSprite;
|
|
this.quickSave = true;
|
|
this.quickSaveBtn.interactable = true;
|
|
this.quickSaveText.text = this.quickSaveInfo;
|
|
this.quickSaveBtn.colors.normalColor = color2;
|
|
this.quickSaveText.color = color3;
|
|
}
|
|
else
|
|
{
|
|
this.quickSaveText.text = "\n<size=.7em>Quick Save (Empty)</size>";
|
|
if (this.currentMenu == "Save")
|
|
{
|
|
this.quickSaveText.color = color3;
|
|
this.quickSaveBtn.colors.normalColor = color2;
|
|
this.quickSaveBtn.interactable = true;
|
|
}
|
|
}
|
|
if (ES3.FileExists("CheckpointSave/Quests.es3") && this.saveCoroutine == null && !startWithSave)
|
|
{
|
|
this.checkpointSaveImg.sprite = this.checkpointSaveSprite;
|
|
this.checkpointSave = true;
|
|
this.checkpointSaveBtn.interactable = true;
|
|
this.checkpointSaveText.text = this.checkpointSaveInfo;
|
|
this.checkpointSaveBtn.colors.normalColor = color2;
|
|
ColorBlock colorBlock = this.checkpointSaveBtn.colors;
|
|
colorBlock.disabledColor = color2 * 0f;
|
|
this.checkpointSaveBtn.colors = colorBlock;
|
|
this.checkpointSaveText.color = color3;
|
|
}
|
|
else if (!ES3.FileExists("CheckpointSave/Quests.es3"))
|
|
{
|
|
this.checkpointSaveText.text = "";
|
|
}
|
|
else
|
|
{
|
|
this.checkpointSaveImg.sprite = this.checkpointSaveSprite;
|
|
this.checkpointSave = true;
|
|
this.checkpointSaveBtn.interactable = false;
|
|
this.checkpointSaveText.text = this.checkpointSaveInfo;
|
|
ColorBlock colorBlock = this.checkpointSaveBtn.colors;
|
|
colorBlock.disabledColor = new Color(0.9f, 0.9f, 0.9f, 0.25f);
|
|
this.checkpointSaveBtn.colors = colorBlock;
|
|
this.checkpointSaveText.color = color3;
|
|
}
|
|
if (ES3.FileExists("Save1/Quests.es3"))
|
|
{
|
|
this.save1Img.sprite = this.save1Sprite;
|
|
this.save1 = true;
|
|
this.save1Btn.interactable = true;
|
|
this.save1Text.text = this.save1Info;
|
|
this.save1Btn.colors.normalColor = color2;
|
|
this.save1Text.color = color3;
|
|
}
|
|
else if (this.currentMenu == "Save")
|
|
{
|
|
this.save1Text.color = color3;
|
|
this.save1Btn.colors.normalColor = color2;
|
|
this.save1Btn.interactable = true;
|
|
}
|
|
if (ES3.FileExists("Save2/Quests.es3"))
|
|
{
|
|
this.save2Img.sprite = this.save2Sprite;
|
|
this.save2 = true;
|
|
this.save2Btn.interactable = true;
|
|
this.save2Text.text = this.save2Info;
|
|
this.save2Btn.colors.normalColor = color2;
|
|
this.save2Text.color = color3;
|
|
}
|
|
else if (this.currentMenu == "Save")
|
|
{
|
|
this.save2Text.color = color3;
|
|
this.save2Btn.colors.normalColor = color2;
|
|
this.save2Btn.interactable = true;
|
|
}
|
|
if (ES3.FileExists("Save3/Quests.es3"))
|
|
{
|
|
this.save3Img.sprite = this.save3Sprite;
|
|
this.save3 = true;
|
|
this.save3Btn.interactable = true;
|
|
this.save3Text.text = this.save3Info;
|
|
this.save3Btn.colors.normalColor = color2;
|
|
this.save3Text.color = color3;
|
|
}
|
|
else if (this.currentMenu == "Save")
|
|
{
|
|
this.save3Text.color = color3;
|
|
this.save3Btn.colors.normalColor = color2;
|
|
this.save3Btn.interactable = true;
|
|
}
|
|
if (ES3.FileExists("Save4/Quests.es3"))
|
|
{
|
|
this.save4Img.sprite = this.save4Sprite;
|
|
this.save4 = true;
|
|
this.save4Btn.interactable = true;
|
|
this.save4Text.text = this.save4Info;
|
|
this.save4Btn.colors.normalColor = color2;
|
|
this.save4Text.color = color3;
|
|
}
|
|
else if (this.currentMenu == "Save")
|
|
{
|
|
this.save4Text.color = color3;
|
|
this.save4Btn.colors.normalColor = color2;
|
|
this.save4Btn.interactable = true;
|
|
}
|
|
if (ES3.FileExists("Save5/Quests.es3"))
|
|
{
|
|
this.save5Img.sprite = this.save5Sprite;
|
|
this.save5 = true;
|
|
this.save5Btn.interactable = true;
|
|
this.save5Text.text = this.save5Info;
|
|
this.save5Btn.colors.normalColor = color2;
|
|
this.save5Text.color = color3;
|
|
}
|
|
else if (this.currentMenu == "Save")
|
|
{
|
|
this.save5Text.color = color3;
|
|
this.save5Btn.colors.normalColor = color2;
|
|
this.save5Btn.interactable = true;
|
|
}
|
|
if (ES3.FileExists("Save6/Quests.es3"))
|
|
{
|
|
this.save6Img.sprite = this.save6Sprite;
|
|
this.save6 = true;
|
|
this.save6Btn.interactable = true;
|
|
this.save6Text.text = this.save6Info;
|
|
this.save6Btn.colors.normalColor = color2;
|
|
this.save6Text.color = color3;
|
|
}
|
|
else if (this.currentMenu == "Save")
|
|
{
|
|
this.save6Text.color = color3;
|
|
this.save6Btn.colors.normalColor = color2;
|
|
this.save6Btn.interactable = true;
|
|
}
|
|
if (ES3.FileExists("Save7/Quests.es3"))
|
|
{
|
|
this.save7Img.sprite = this.save7Sprite;
|
|
this.save7 = true;
|
|
this.save7Btn.interactable = true;
|
|
this.save7Text.text = this.save7Info;
|
|
this.save7Btn.colors.normalColor = color2;
|
|
this.save7Text.color = color3;
|
|
}
|
|
else if (this.currentMenu == "Save")
|
|
{
|
|
this.save7Text.color = color3;
|
|
this.save7Btn.colors.normalColor = color2;
|
|
this.save7Btn.interactable = true;
|
|
}
|
|
if (ES3.FileExists("Save8/Quests.es3"))
|
|
{
|
|
this.save8Img.sprite = this.save8Sprite;
|
|
this.save8 = true;
|
|
this.save8Btn.interactable = true;
|
|
this.save8Text.text = this.save8Info;
|
|
this.save8Btn.colors.normalColor = color2;
|
|
this.save8Text.color = color3;
|
|
}
|
|
else if (this.currentMenu == "Save")
|
|
{
|
|
this.save8Text.color = color3;
|
|
this.save8Btn.colors.normalColor = color2;
|
|
this.save8Btn.interactable = true;
|
|
}
|
|
if (ES3.FileExists("Save9/Quests.es3"))
|
|
{
|
|
this.save9Img.sprite = this.save9Sprite;
|
|
this.save9 = true;
|
|
this.save9Btn.interactable = true;
|
|
this.save9Text.text = this.save9Info;
|
|
this.save9Btn.colors.normalColor = color2;
|
|
this.save9Text.color = color3;
|
|
}
|
|
else if (this.currentMenu == "Save")
|
|
{
|
|
this.save9Text.color = color3;
|
|
this.save9Btn.colors.normalColor = color2;
|
|
this.save9Btn.interactable = true;
|
|
}
|
|
if (ES3.FileExists("Save10/Quests.es3"))
|
|
{
|
|
this.save10Img.sprite = this.save10Sprite;
|
|
this.save10 = true;
|
|
this.save10Btn.interactable = true;
|
|
this.save10Text.text = this.save10Info;
|
|
this.save10Btn.colors.normalColor = color2;
|
|
this.save10Text.color = color3;
|
|
}
|
|
else if (this.currentMenu == "Save")
|
|
{
|
|
this.save10Text.color = color3;
|
|
this.save10Btn.colors.normalColor = color2;
|
|
this.save10Btn.interactable = true;
|
|
}
|
|
if (this.quickSaveBtn && (this.quickSave || startWithSave))
|
|
{
|
|
this.quickSaveBtn.enabled = true;
|
|
this.quickSaveImg.enabled = true;
|
|
}
|
|
if (this.checkpointSave && !startWithSave)
|
|
{
|
|
this.checkpointSaveBtn.enabled = true;
|
|
this.checkpointSaveBtn.interactable = true;
|
|
this.checkpointSaveImg.enabled = true;
|
|
}
|
|
if (this.save1 || startWithSave)
|
|
{
|
|
this.save1Btn.enabled = true;
|
|
this.save1Img.enabled = true;
|
|
}
|
|
if (this.save2 || startWithSave)
|
|
{
|
|
this.save2Btn.enabled = true;
|
|
this.save2Img.enabled = true;
|
|
}
|
|
if (this.save3 || startWithSave)
|
|
{
|
|
this.save3Btn.enabled = true;
|
|
this.save3Img.enabled = true;
|
|
}
|
|
if (this.save4 || startWithSave)
|
|
{
|
|
this.save4Btn.enabled = true;
|
|
this.save4Img.enabled = true;
|
|
}
|
|
if (this.save5 || startWithSave)
|
|
{
|
|
this.save5Btn.enabled = true;
|
|
this.save5Img.enabled = true;
|
|
}
|
|
if (this.save6 || startWithSave)
|
|
{
|
|
this.save6Btn.enabled = true;
|
|
this.save6Img.enabled = true;
|
|
}
|
|
if (this.save7 || startWithSave)
|
|
{
|
|
this.save7Btn.enabled = true;
|
|
this.save7Img.enabled = true;
|
|
}
|
|
if (this.save8 || startWithSave)
|
|
{
|
|
this.save8Btn.enabled = true;
|
|
this.save8Img.enabled = true;
|
|
}
|
|
if (this.save9 || startWithSave)
|
|
{
|
|
this.save9Btn.enabled = true;
|
|
this.save9Img.enabled = true;
|
|
}
|
|
if (this.save10 || startWithSave)
|
|
{
|
|
this.save10Btn.enabled = true;
|
|
this.save10Img.enabled = true;
|
|
}
|
|
if (startWithSave || this.saveCoroutine != null)
|
|
{
|
|
this.checkpointSaveBtn.interactable = false;
|
|
this.checkpointSaveBtn.colors.normalColor = new Color(0f, 0f, 0f, 0f);
|
|
}
|
|
if (this.checkpointSaveBtn.interactable)
|
|
{
|
|
Navigation navigation = this.quickSaveBtn.navigation;
|
|
navigation.selectOnLeft = this.checkpointSaveBtn;
|
|
this.quickSaveBtn.navigation = navigation;
|
|
navigation = this.save2Btn.navigation;
|
|
navigation.selectOnUp = this.checkpointSaveBtn;
|
|
this.save2Btn.navigation = navigation;
|
|
}
|
|
else
|
|
{
|
|
Navigation navigation2 = this.quickSaveBtn.navigation;
|
|
navigation2.selectOnLeft = null;
|
|
this.quickSaveBtn.navigation = navigation2;
|
|
navigation2 = this.save2Btn.navigation;
|
|
navigation2.selectOnUp = this.checkpointSaveBtn;
|
|
this.save2Btn.navigation = navigation2;
|
|
}
|
|
this.open = true;
|
|
}
|
|
|
|
// Token: 0x060013C2 RID: 5058 RVA: 0x001801DC File Offset: 0x0017E3DC
|
|
private Sprite LoadSprite(string path)
|
|
{
|
|
if (File.Exists(path))
|
|
{
|
|
byte[] array = File.ReadAllBytes(path);
|
|
Texture2D texture2D = new Texture2D(1, 1);
|
|
texture2D.LoadImage(array);
|
|
return Sprite.Create(texture2D, new Rect(0f, 0f, (float)texture2D.width, (float)texture2D.height), new Vector2(0.5f, 0.5f));
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x060013C3 RID: 5059 RVA: 0x0018023C File Offset: 0x0017E43C
|
|
public void ToggleSaveMenu()
|
|
{
|
|
if (Links.x.joy)
|
|
{
|
|
Links.x.hudControl.JoyBox(false);
|
|
}
|
|
if (Links.x.mk)
|
|
{
|
|
EventSystem.current.SetSelectedGameObject(null);
|
|
}
|
|
Links.x.gameplay.lastMenu = "Options";
|
|
this.open = false;
|
|
this.currentMenu = "Save";
|
|
this.StartMenu(true);
|
|
}
|
|
|
|
// Token: 0x060013C4 RID: 5060 RVA: 0x001802AC File Offset: 0x0017E4AC
|
|
public void ToggleOptiosn()
|
|
{
|
|
if (Links.x.joy)
|
|
{
|
|
Links.x.hudControl.JoyBox(false);
|
|
}
|
|
if (Links.x.mk)
|
|
{
|
|
EventSystem.current.SetSelectedGameObject(null);
|
|
}
|
|
Links.x.gameplay.lastMenu = "Options";
|
|
this.open = false;
|
|
this.currentMenu = "Save";
|
|
Links.x.options.OpenMenu();
|
|
this.StartEndMenu(false);
|
|
}
|
|
|
|
// Token: 0x060013C5 RID: 5061 RVA: 0x00180328 File Offset: 0x0017E528
|
|
public void ToggleLoadMenu()
|
|
{
|
|
if (Links.x.joy)
|
|
{
|
|
Links.x.hudControl.JoyBox(false);
|
|
}
|
|
if (Links.x.mk)
|
|
{
|
|
EventSystem.current.SetSelectedGameObject(null);
|
|
}
|
|
Links.x.gameplay.lastMenu = "Options";
|
|
this.open = false;
|
|
this.currentMenu = "Load";
|
|
this.StartMenu(false);
|
|
}
|
|
|
|
// Token: 0x060013C6 RID: 5062 RVA: 0x00180398 File Offset: 0x0017E598
|
|
public void GetNewFirstObject()
|
|
{
|
|
if (!this.lastBtn)
|
|
{
|
|
if (this.currentMenu == "Save")
|
|
{
|
|
this.lastBtn = this.quickSaveBtn;
|
|
}
|
|
else
|
|
{
|
|
this.lastBtn = this.checkpointSaveBtn;
|
|
}
|
|
}
|
|
Links.x.gameplay.SetInteractableSelected(EventSystem.current, this.lastBtn.gameObject);
|
|
if (!this.characterDead)
|
|
{
|
|
this.controllerExitStartMenu.SetActive(true);
|
|
}
|
|
if (!this.characterDead)
|
|
{
|
|
this.controllerExitMainMenu.SetActive(true);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013C7 RID: 5063 RVA: 0x00180428 File Offset: 0x0017E628
|
|
public void SetPicked(string picked)
|
|
{
|
|
this.pickedSave = picked;
|
|
this.lastBtn = this.quickSaveBtn;
|
|
if (picked == "QuickSave")
|
|
{
|
|
this.currentBook = this.bookQuick;
|
|
}
|
|
if (picked == "Save1")
|
|
{
|
|
this.lastBtn = this.save1Btn;
|
|
this.currentBook = this.book1;
|
|
}
|
|
if (picked == "Save2")
|
|
{
|
|
this.lastBtn = this.save2Btn;
|
|
this.currentBook = this.book2;
|
|
}
|
|
if (picked == "Save3")
|
|
{
|
|
this.lastBtn = this.save3Btn;
|
|
this.currentBook = this.book3;
|
|
}
|
|
if (picked == "Save4")
|
|
{
|
|
this.lastBtn = this.save4Btn;
|
|
this.currentBook = this.book4;
|
|
}
|
|
if (picked == "Save5")
|
|
{
|
|
this.lastBtn = this.save5Btn;
|
|
this.currentBook = this.book5;
|
|
}
|
|
if (picked == "Save6")
|
|
{
|
|
this.lastBtn = this.save6Btn;
|
|
this.currentBook = this.book6;
|
|
}
|
|
if (picked == "Save7")
|
|
{
|
|
this.lastBtn = this.save7Btn;
|
|
this.currentBook = this.book7;
|
|
}
|
|
if (picked == "Save8")
|
|
{
|
|
this.lastBtn = this.save8Btn;
|
|
this.currentBook = this.book8;
|
|
}
|
|
if (picked == "Save9")
|
|
{
|
|
this.lastBtn = this.save9Btn;
|
|
this.currentBook = this.book9;
|
|
}
|
|
if (picked == "Save10")
|
|
{
|
|
this.lastBtn = this.save10Btn;
|
|
this.currentBook = this.book10;
|
|
}
|
|
if (picked == "CheckpointSave")
|
|
{
|
|
this.lastBtn = this.checkpointSaveBtn;
|
|
this.currentBook = this.bookAuto;
|
|
}
|
|
if (this.currentMenu == "Save")
|
|
{
|
|
if (picked == "QuickSave")
|
|
{
|
|
this.input.interactable = false;
|
|
}
|
|
else
|
|
{
|
|
this.input.interactable = true;
|
|
}
|
|
this.confirmSave.SetActive(true);
|
|
Links.x.hudControl.JoyBox(false);
|
|
this.controllerExitMainMenu.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
if (Records.x.mainMenuOpen)
|
|
{
|
|
this.StartLoad();
|
|
return;
|
|
}
|
|
this.confirmLoad.SetActive(true);
|
|
this.controllerExitMainMenu.SetActive(false);
|
|
}
|
|
Links.x.hudControl.JoyBox(false);
|
|
base.StartCoroutine(this.AnimWait(picked, true));
|
|
}
|
|
|
|
// Token: 0x060013C8 RID: 5064 RVA: 0x001806A5 File Offset: 0x0017E8A5
|
|
private IEnumerator AnimWait(string picked, bool opening)
|
|
{
|
|
if (!opening)
|
|
{
|
|
}
|
|
float num = 0.001f;
|
|
yield return new WaitForSecondsRealtime(num);
|
|
this.AnimComplete(picked, opening);
|
|
if (!opening && Links.x.joy)
|
|
{
|
|
yield return new WaitForSecondsRealtime(0.1f);
|
|
this.GetNewFirstObject();
|
|
}
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x060013C9 RID: 5065 RVA: 0x001806C4 File Offset: 0x0017E8C4
|
|
public void AnimComplete(string picked, bool opening)
|
|
{
|
|
if (this.mainMenu)
|
|
{
|
|
this.StartLoad();
|
|
return;
|
|
}
|
|
if (opening)
|
|
{
|
|
if (this.currentMenu == "Save")
|
|
{
|
|
string text = "";
|
|
ES3File es3File = new ES3File("Version.es3");
|
|
if (picked == "Save1")
|
|
{
|
|
text = es3File.Load<string>("Save1");
|
|
}
|
|
if (picked == "Save2")
|
|
{
|
|
text = es3File.Load<string>("Save2");
|
|
}
|
|
if (picked == "Save3")
|
|
{
|
|
text = es3File.Load<string>("Save3");
|
|
}
|
|
if (picked == "Save4")
|
|
{
|
|
text = es3File.Load<string>("Save4");
|
|
}
|
|
if (picked == "Save5")
|
|
{
|
|
text = es3File.Load<string>("Save5");
|
|
}
|
|
if (picked == "Save6")
|
|
{
|
|
text = es3File.Load<string>("Save6");
|
|
}
|
|
if (picked == "Save7")
|
|
{
|
|
text = es3File.Load<string>("Save7");
|
|
}
|
|
if (picked == "Save8")
|
|
{
|
|
text = es3File.Load<string>("Save8");
|
|
}
|
|
if (picked == "Save9")
|
|
{
|
|
text = es3File.Load<string>("Save9");
|
|
}
|
|
if (picked == "Save10")
|
|
{
|
|
text = es3File.Load<string>("Save10");
|
|
}
|
|
this.input.textComponent.text = text;
|
|
this.input.text = text;
|
|
this.pickedSave = picked;
|
|
this.saveConfirmText.text = "Enter a Save Game Name";
|
|
this.confirmSaveInput.SetActive(true);
|
|
if (picked == "QuickSave")
|
|
{
|
|
this.saveConfirmText.text = "Save over Quick Save?";
|
|
this.confirmSaveInput.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
Records.x.SetTypingState(true);
|
|
}
|
|
this.confirmSave.SetActive(true);
|
|
Links.x.hudControl.JoyBox(false);
|
|
if (picked != "QuickSave" && Links.x.joy)
|
|
{
|
|
Links.x.keyboardScript.StartMenu(null, this.input, base.gameObject, "Save");
|
|
}
|
|
this.input.ActivateInputField();
|
|
this.input.ForceLabelUpdate();
|
|
return;
|
|
}
|
|
string text2 = "";
|
|
ES3File es3File2 = new ES3File("Version.es3");
|
|
if (picked == "Save1")
|
|
{
|
|
text2 = es3File2.Load<string>("Save1");
|
|
}
|
|
if (picked == "Save2")
|
|
{
|
|
text2 = es3File2.Load<string>("Save2");
|
|
}
|
|
if (picked == "Save3")
|
|
{
|
|
text2 = es3File2.Load<string>("Save3");
|
|
}
|
|
if (picked == "Save4")
|
|
{
|
|
text2 = es3File2.Load<string>("Save4");
|
|
}
|
|
if (picked == "Save5")
|
|
{
|
|
text2 = es3File2.Load<string>("Save5");
|
|
}
|
|
if (picked == "Save6")
|
|
{
|
|
text2 = es3File2.Load<string>("Save6");
|
|
}
|
|
if (picked == "Save7")
|
|
{
|
|
text2 = es3File2.Load<string>("Save7");
|
|
}
|
|
if (picked == "Save8")
|
|
{
|
|
text2 = es3File2.Load<string>("Save8");
|
|
}
|
|
if (picked == "Save9")
|
|
{
|
|
text2 = es3File2.Load<string>("Save9");
|
|
}
|
|
if (picked == "Save10")
|
|
{
|
|
text2 = es3File2.Load<string>("Save10");
|
|
}
|
|
if (picked == "CheckpointSave")
|
|
{
|
|
text2 = es3File2.Load<string>("CheckpointSave");
|
|
}
|
|
if (picked == "QuickSave")
|
|
{
|
|
text2 = es3File2.Load<string>("QuickSave");
|
|
}
|
|
this.pickedSave = picked;
|
|
this.confirmLoad.SetActive(true);
|
|
this.loadConfirmText.text = "Leave game and load " + text2 + "? Any unsaved data will be lost.";
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
Records.x.SetTypingState(false);
|
|
this.confirmSave.SetActive(false);
|
|
this.confirmLoad.SetActive(false);
|
|
this.canvasGroup.interactable = true;
|
|
if (this.currentMenu == "Save")
|
|
{
|
|
this.ToggleSaveMenu();
|
|
return;
|
|
}
|
|
this.ToggleLoadMenu();
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013CA RID: 5066 RVA: 0x00180AA6 File Offset: 0x0017ECA6
|
|
public void CloseConfirm()
|
|
{
|
|
Links.x.hudControl.JoyBox(false);
|
|
base.StartCoroutine(this.AnimWait("", false));
|
|
if (!this.characterDead)
|
|
{
|
|
this.controllerExitMainMenu.SetActive(true);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013CB RID: 5067 RVA: 0x00180ADF File Offset: 0x0017ECDF
|
|
public void ReturnFromKeyboard()
|
|
{
|
|
Links.x.hudControl.JoyBox(false);
|
|
EventSystem.current.SetSelectedGameObject(this.confirmSaveButton);
|
|
}
|
|
|
|
// Token: 0x060013CC RID: 5068 RVA: 0x00180B04 File Offset: 0x0017ED04
|
|
public void OverwriteSave()
|
|
{
|
|
if (this.saveCoroutine == null)
|
|
{
|
|
Links.x.hudControl.JoyBox(false);
|
|
string text = this.input.text;
|
|
ES3File es3File = new ES3File("Version.es3");
|
|
if (this.pickedSave == "Save1")
|
|
{
|
|
es3File.Save<string>("Save1", text);
|
|
}
|
|
if (this.pickedSave == "Save2")
|
|
{
|
|
es3File.Save<string>("Save2", text);
|
|
}
|
|
if (this.pickedSave == "Save3")
|
|
{
|
|
es3File.Save<string>("Save3", text);
|
|
}
|
|
if (this.pickedSave == "Save4")
|
|
{
|
|
es3File.Save<string>("Save4", text);
|
|
}
|
|
if (this.pickedSave == "Save5")
|
|
{
|
|
es3File.Save<string>("Save5", text);
|
|
}
|
|
if (this.pickedSave == "Save6")
|
|
{
|
|
es3File.Save<string>("Save6", text);
|
|
}
|
|
if (this.pickedSave == "Save7")
|
|
{
|
|
es3File.Save<string>("Save7", text);
|
|
}
|
|
if (this.pickedSave == "Save8")
|
|
{
|
|
es3File.Save<string>("Save8", text);
|
|
}
|
|
if (this.pickedSave == "Save9")
|
|
{
|
|
es3File.Save<string>("Save9", text);
|
|
}
|
|
if (this.pickedSave == "Save10")
|
|
{
|
|
es3File.Save<string>("Save10", text);
|
|
}
|
|
es3File.Sync();
|
|
this.saveCoroutine = this.Saving();
|
|
base.StartCoroutine(this.saveCoroutine);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013CD RID: 5069 RVA: 0x00180C90 File Offset: 0x0017EE90
|
|
public void ChangeButtons(bool state)
|
|
{
|
|
this.quickSaveBtn.interactable = state;
|
|
this.checkpointSaveBtn.interactable = state;
|
|
this.save1Btn.interactable = state;
|
|
this.save2Btn.interactable = state;
|
|
this.save3Btn.interactable = state;
|
|
this.save4Btn.interactable = state;
|
|
this.save5Btn.interactable = state;
|
|
this.save6Btn.interactable = state;
|
|
this.save7Btn.interactable = state;
|
|
this.save8Btn.interactable = state;
|
|
this.save9Btn.interactable = state;
|
|
this.save10Btn.interactable = state;
|
|
}
|
|
|
|
// Token: 0x060013CE RID: 5070 RVA: 0x00180D30 File Offset: 0x0017EF30
|
|
private void ChangeImageRaycastState(bool state)
|
|
{
|
|
if (this.quickSaveBtn.interactable)
|
|
{
|
|
this.quickSaveImg.raycastTarget = state;
|
|
}
|
|
if (this.checkpointSaveBtn.interactable)
|
|
{
|
|
this.checkpointSaveImg.raycastTarget = state;
|
|
}
|
|
if (this.save1Btn.interactable)
|
|
{
|
|
this.save1Img.raycastTarget = state;
|
|
}
|
|
if (this.save2Btn.interactable)
|
|
{
|
|
this.save2Img.raycastTarget = state;
|
|
}
|
|
if (this.save3Btn.interactable)
|
|
{
|
|
this.save3Img.raycastTarget = state;
|
|
}
|
|
if (this.save4Btn.interactable)
|
|
{
|
|
this.save4Img.raycastTarget = state;
|
|
}
|
|
if (this.save5Btn.interactable)
|
|
{
|
|
this.save5Img.raycastTarget = state;
|
|
}
|
|
if (this.save6Btn.interactable)
|
|
{
|
|
this.save6Img.raycastTarget = state;
|
|
}
|
|
if (this.save7Btn.interactable)
|
|
{
|
|
this.save7Img.raycastTarget = state;
|
|
}
|
|
if (this.save8Btn.interactable)
|
|
{
|
|
this.save8Img.raycastTarget = state;
|
|
}
|
|
if (this.save9Btn.interactable)
|
|
{
|
|
this.save9Img.raycastTarget = state;
|
|
}
|
|
if (this.save10Btn.interactable)
|
|
{
|
|
this.save10Img.raycastTarget = state;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013CF RID: 5071 RVA: 0x00180E69 File Offset: 0x0017F069
|
|
private IEnumerator Loading()
|
|
{
|
|
Links.x.hudControl.JoyBox(false);
|
|
this.ChangeImageRaycastState(false);
|
|
this.confirmLoad.SetActive(false);
|
|
if (this.currentBook)
|
|
{
|
|
this.currentBook.Play("LogBook_Open");
|
|
}
|
|
yield return new WaitForSecondsRealtime(1f);
|
|
if (this.currentBook)
|
|
{
|
|
this.currentBook.End();
|
|
}
|
|
this.waitingForSplash = false;
|
|
if (Records.x.mainMenuOpen)
|
|
{
|
|
this.waitingForSplash = true;
|
|
GameObject.Find("Main Menu").GetComponent<MainMenu>().StartSplash("Load");
|
|
Links.x.saveKeeper.openBook = this.pickedSave;
|
|
Links.x.saveKeeper.loadInGame = true;
|
|
Links.x.saveKeeper.saveFromEditor = this.pickedSave;
|
|
Records.x.openBook = this.pickedSave;
|
|
this.saveCoroutine = null;
|
|
this.loadCoroutine = null;
|
|
yield return new WaitForSecondsRealtime(0.3f);
|
|
this.StartEndMenu(true);
|
|
}
|
|
else
|
|
{
|
|
Links.x.saveKeeper.openBook = this.pickedSave;
|
|
Links.x.saveKeeper.loadInGame = true;
|
|
Links.x.saveKeeper.saveFromEditor = this.pickedSave;
|
|
Records.x.openBook = this.pickedSave;
|
|
Links.x.gaia.LoadFromGameFiles();
|
|
this.saveCoroutine = null;
|
|
this.loadCoroutine = null;
|
|
Links.x.gaia.FadeOutPlaylist(true, 0.25f);
|
|
Links.x.gaia.FadeOutPlaylist(false, 0.25f);
|
|
yield return new WaitForSecondsRealtime(0.3f);
|
|
this.StartEndMenu(true);
|
|
}
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x060013D0 RID: 5072 RVA: 0x00180E78 File Offset: 0x0017F078
|
|
private IEnumerator Saving()
|
|
{
|
|
this.ChangeImageRaycastState(false);
|
|
this.confirmSave.SetActive(false);
|
|
if (this.currentBook)
|
|
{
|
|
this.currentBook.Play("LogBook_Open");
|
|
}
|
|
yield return new WaitForSecondsRealtime(1f);
|
|
Records.x.TriggerGlobalSave(this.pickedSave, false);
|
|
yield return new WaitForSecondsRealtime(0.01f);
|
|
if (this.currentBook)
|
|
{
|
|
this.currentBook.Play("LogBook_Close");
|
|
}
|
|
this.ToggleSaveMenu();
|
|
yield return new WaitForSecondsRealtime(1f);
|
|
this.saveCoroutine = null;
|
|
this.loadCoroutine = null;
|
|
this.StartEndMenu(true);
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x060013D1 RID: 5073 RVA: 0x00180E87 File Offset: 0x0017F087
|
|
public void MainMenu()
|
|
{
|
|
if (Links.x.mk)
|
|
{
|
|
EventSystem.current.SetSelectedGameObject(null);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013D2 RID: 5074 RVA: 0x00180EA0 File Offset: 0x0017F0A0
|
|
public void OpenManual(GameObject go)
|
|
{
|
|
this.lastBtn = go.GetComponent<ButtonMultiTargets>();
|
|
Links.x.gameFeed.ShowNotice("Not available yet");
|
|
if (Links.x.mk)
|
|
{
|
|
EventSystem.current.SetSelectedGameObject(null);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013D3 RID: 5075 RVA: 0x00180EDC File Offset: 0x0017F0DC
|
|
public void GoToMainMenu()
|
|
{
|
|
bool flag = false;
|
|
if (Links.x.deathScreen.activeSelf)
|
|
{
|
|
Links.x.deathScreen.GetComponent<DeathScreen>().DeathScreenOut2();
|
|
flag = true;
|
|
}
|
|
Links.x.saveKeeper.openBook = "";
|
|
Links.x.saveKeeper.loadInGame = false;
|
|
EventSystem.current.SetSelectedGameObject(null);
|
|
if (flag)
|
|
{
|
|
base.StartCoroutine(this.MainMenuOpen());
|
|
return;
|
|
}
|
|
Links.x.gaia.ReturnToMainMenu();
|
|
}
|
|
|
|
// Token: 0x060013D4 RID: 5076 RVA: 0x00180F61 File Offset: 0x0017F161
|
|
private IEnumerator MainMenuOpen()
|
|
{
|
|
yield return new WaitForSecondsRealtime(0.25f);
|
|
Links.x.gaia.ReturnToMainMenu();
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x060013D5 RID: 5077 RVA: 0x00180F6C File Offset: 0x0017F16C
|
|
public void StartLoad()
|
|
{
|
|
if (this.loadCoroutine == null)
|
|
{
|
|
Links.x.combat.slowingTimeForLastDeath = false;
|
|
Records.x.mainCharacterDead = false;
|
|
Links.x.cameraEffects.PlayAnimation("CameraGameplayIdle");
|
|
Links.x.saveKeeper.openBook = this.pickedSave;
|
|
Links.x.saveKeeper.loadInGame = true;
|
|
Links.x.saveKeeper.saveFromEditor = this.pickedSave;
|
|
this.loadCoroutine = this.Loading();
|
|
base.StartCoroutine(this.loadCoroutine);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013D6 RID: 5078 RVA: 0x00181008 File Offset: 0x0017F208
|
|
public void StartEndMenu(bool fromCloseButton)
|
|
{
|
|
Records.x.RemoveMenu(base.gameObject);
|
|
if (Links.x.joy)
|
|
{
|
|
Links.x.hudControl.JoyBox(false);
|
|
if (Records.x.mainMenuOpen)
|
|
{
|
|
Links.x.hudControl.CloseMenuSwitcher();
|
|
}
|
|
}
|
|
if (this.saveCoroutine != null || this.loadCoroutine != null)
|
|
{
|
|
return;
|
|
}
|
|
if (fromCloseButton)
|
|
{
|
|
Links.x.gameplay.openingAnotherMenu = false;
|
|
Links.x.gameplay.CloseDock();
|
|
}
|
|
bool flag = false;
|
|
if (Links.x.joy && (Links.x.gameplay.dockStart || Links.x.gameplay.itemsStart))
|
|
{
|
|
flag = true;
|
|
}
|
|
Links.x.hudControl.JoyBox(false);
|
|
if (flag)
|
|
{
|
|
if (this.contentSaveLoad.activeSelf)
|
|
{
|
|
this.anim.Play("Close", 0, 1f);
|
|
}
|
|
else
|
|
{
|
|
this.anim.Play("CloseSmall", 0, 1f);
|
|
}
|
|
}
|
|
else if (this.contentSaveLoad.activeSelf)
|
|
{
|
|
this.anim.Play("Close");
|
|
}
|
|
else
|
|
{
|
|
this.anim.Play("CloseSmall");
|
|
}
|
|
if (Links.x.creation)
|
|
{
|
|
Links.x.creation.ToggleInteractable(true);
|
|
Links.x.creation.CloseKeyboard();
|
|
}
|
|
}
|
|
|
|
// Token: 0x060013D7 RID: 5079 RVA: 0x00181170 File Offset: 0x0017F370
|
|
public void EndMenu()
|
|
{
|
|
this.canvas.sortingOrder = this.startingOrder;
|
|
Records.x.SetTypingState(false);
|
|
if (!this.characterDead)
|
|
{
|
|
this.contentStartMenu.SetActive(false);
|
|
this.contentSaveLoad.SetActive(false);
|
|
}
|
|
this.open = false;
|
|
this.anim.enabled = false;
|
|
this.canvas.enabled = false;
|
|
if (this.currentBook)
|
|
{
|
|
this.currentBook.imageRenderer.sprite = this.currentBook.sprites3[0];
|
|
}
|
|
this.ChangeImageRaycastState(true);
|
|
if (Records.x.mainMenuOpen && Links.x.mainMenu)
|
|
{
|
|
Links.x.hudControl.JoyBox(false);
|
|
if (Links.x.joy)
|
|
{
|
|
Links.x.gameplay.SetInteractableSelected(EventSystem.current, Links.x.mainMenu.newGameButton.gameObject);
|
|
}
|
|
}
|
|
if (this.characterDead)
|
|
{
|
|
Links.x.deathScreen.GetComponent<DeathScreen>().SetFirstObject();
|
|
}
|
|
this.characterDead = false;
|
|
}
|
|
|
|
// Token: 0x060013D8 RID: 5080 RVA: 0x00181291 File Offset: 0x0017F491
|
|
public void OpenQuitConfirm(GameObject go)
|
|
{
|
|
this.lastBtn = go.GetComponent<ButtonMultiTargets>();
|
|
if (Links.x.mk)
|
|
{
|
|
EventSystem.current.SetSelectedGameObject(null);
|
|
}
|
|
this.confirmQuit.SetActive(true);
|
|
this.controllerExitStartMenu.SetActive(false);
|
|
}
|
|
|
|
// Token: 0x060013D9 RID: 5081 RVA: 0x001812D0 File Offset: 0x0017F4D0
|
|
public void Quit()
|
|
{
|
|
if (Links.x.deathScreen.activeSelf)
|
|
{
|
|
Links.x.deathScreen.GetComponent<DeathScreen>().DeathScreenOut2();
|
|
}
|
|
if (Links.x.mk)
|
|
{
|
|
EventSystem.current.SetSelectedGameObject(null);
|
|
}
|
|
base.StartCoroutine(this.Quitting());
|
|
}
|
|
|
|
// Token: 0x060013DA RID: 5082 RVA: 0x00181326 File Offset: 0x0017F526
|
|
private IEnumerator Quitting()
|
|
{
|
|
yield return new WaitForSecondsRealtime(0.25f);
|
|
Application.Quit();
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x060013DB RID: 5083 RVA: 0x0018132E File Offset: 0x0017F52E
|
|
public void OpenMainMenuConfirm(GameObject go)
|
|
{
|
|
this.lastBtn = go.GetComponent<ButtonMultiTargets>();
|
|
if (Links.x.mk)
|
|
{
|
|
EventSystem.current.SetSelectedGameObject(null);
|
|
}
|
|
this.confirmMainMenu.SetActive(true);
|
|
this.controllerExitStartMenu.SetActive(false);
|
|
}
|
|
|
|
// Token: 0x0400219D RID: 8605
|
|
public Image saveBtn;
|
|
|
|
// Token: 0x0400219E RID: 8606
|
|
public Image loadBtn;
|
|
|
|
// Token: 0x0400219F RID: 8607
|
|
public Sprite onSprite;
|
|
|
|
// Token: 0x040021A0 RID: 8608
|
|
public Sprite offSprite;
|
|
|
|
// Token: 0x040021A1 RID: 8609
|
|
public TextMeshProUGUI headerText;
|
|
|
|
// Token: 0x040021A2 RID: 8610
|
|
public TextMeshProUGUI saveText;
|
|
|
|
// Token: 0x040021A3 RID: 8611
|
|
public TextMeshProUGUI loadText;
|
|
|
|
// Token: 0x040021A4 RID: 8612
|
|
public TextMeshProUGUI quickSaveText;
|
|
|
|
// Token: 0x040021A5 RID: 8613
|
|
public TextMeshProUGUI checkpointSaveText;
|
|
|
|
// Token: 0x040021A6 RID: 8614
|
|
public TextMeshProUGUI save1Text;
|
|
|
|
// Token: 0x040021A7 RID: 8615
|
|
public TextMeshProUGUI save2Text;
|
|
|
|
// Token: 0x040021A8 RID: 8616
|
|
public TextMeshProUGUI save3Text;
|
|
|
|
// Token: 0x040021A9 RID: 8617
|
|
public TextMeshProUGUI save4Text;
|
|
|
|
// Token: 0x040021AA RID: 8618
|
|
public TextMeshProUGUI save5Text;
|
|
|
|
// Token: 0x040021AB RID: 8619
|
|
public TextMeshProUGUI save6Text;
|
|
|
|
// Token: 0x040021AC RID: 8620
|
|
public TextMeshProUGUI save7Text;
|
|
|
|
// Token: 0x040021AD RID: 8621
|
|
public TextMeshProUGUI save8Text;
|
|
|
|
// Token: 0x040021AE RID: 8622
|
|
public TextMeshProUGUI save9Text;
|
|
|
|
// Token: 0x040021AF RID: 8623
|
|
public TextMeshProUGUI save10Text;
|
|
|
|
// Token: 0x040021B0 RID: 8624
|
|
public TextMeshProUGUI saveConfirmText;
|
|
|
|
// Token: 0x040021B1 RID: 8625
|
|
public TextMeshProUGUI loadConfirmText;
|
|
|
|
// Token: 0x040021B2 RID: 8626
|
|
public Image quickSaveImg;
|
|
|
|
// Token: 0x040021B3 RID: 8627
|
|
public Image checkpointSaveImg;
|
|
|
|
// Token: 0x040021B4 RID: 8628
|
|
public Image save1Img;
|
|
|
|
// Token: 0x040021B5 RID: 8629
|
|
public Image save2Img;
|
|
|
|
// Token: 0x040021B6 RID: 8630
|
|
public Image save3Img;
|
|
|
|
// Token: 0x040021B7 RID: 8631
|
|
public Image save4Img;
|
|
|
|
// Token: 0x040021B8 RID: 8632
|
|
public Image save5Img;
|
|
|
|
// Token: 0x040021B9 RID: 8633
|
|
public Image save6Img;
|
|
|
|
// Token: 0x040021BA RID: 8634
|
|
public Image save7Img;
|
|
|
|
// Token: 0x040021BB RID: 8635
|
|
public Image save8Img;
|
|
|
|
// Token: 0x040021BC RID: 8636
|
|
public Image save9Img;
|
|
|
|
// Token: 0x040021BD RID: 8637
|
|
public Image save10Img;
|
|
|
|
// Token: 0x040021BE RID: 8638
|
|
public HannahAnimator bookAuto;
|
|
|
|
// Token: 0x040021BF RID: 8639
|
|
public HannahAnimator bookQuick;
|
|
|
|
// Token: 0x040021C0 RID: 8640
|
|
public HannahAnimator book1;
|
|
|
|
// Token: 0x040021C1 RID: 8641
|
|
public HannahAnimator book2;
|
|
|
|
// Token: 0x040021C2 RID: 8642
|
|
public HannahAnimator book3;
|
|
|
|
// Token: 0x040021C3 RID: 8643
|
|
public HannahAnimator book4;
|
|
|
|
// Token: 0x040021C4 RID: 8644
|
|
public HannahAnimator book5;
|
|
|
|
// Token: 0x040021C5 RID: 8645
|
|
public HannahAnimator book6;
|
|
|
|
// Token: 0x040021C6 RID: 8646
|
|
public HannahAnimator book7;
|
|
|
|
// Token: 0x040021C7 RID: 8647
|
|
public HannahAnimator book8;
|
|
|
|
// Token: 0x040021C8 RID: 8648
|
|
public HannahAnimator book9;
|
|
|
|
// Token: 0x040021C9 RID: 8649
|
|
public HannahAnimator book10;
|
|
|
|
// Token: 0x040021CA RID: 8650
|
|
public Animator anim;
|
|
|
|
// Token: 0x040021CB RID: 8651
|
|
public CanvasGroup canvasGroup;
|
|
|
|
// Token: 0x040021CC RID: 8652
|
|
public ButtonMultiTargets quickSaveBtn;
|
|
|
|
// Token: 0x040021CD RID: 8653
|
|
public ButtonMultiTargets checkpointSaveBtn;
|
|
|
|
// Token: 0x040021CE RID: 8654
|
|
public ButtonMultiTargets save1Btn;
|
|
|
|
// Token: 0x040021CF RID: 8655
|
|
public ButtonMultiTargets save2Btn;
|
|
|
|
// Token: 0x040021D0 RID: 8656
|
|
public ButtonMultiTargets save3Btn;
|
|
|
|
// Token: 0x040021D1 RID: 8657
|
|
public ButtonMultiTargets save4Btn;
|
|
|
|
// Token: 0x040021D2 RID: 8658
|
|
public ButtonMultiTargets save5Btn;
|
|
|
|
// Token: 0x040021D3 RID: 8659
|
|
public ButtonMultiTargets save6Btn;
|
|
|
|
// Token: 0x040021D4 RID: 8660
|
|
public ButtonMultiTargets save7Btn;
|
|
|
|
// Token: 0x040021D5 RID: 8661
|
|
public ButtonMultiTargets save8Btn;
|
|
|
|
// Token: 0x040021D6 RID: 8662
|
|
public ButtonMultiTargets save9Btn;
|
|
|
|
// Token: 0x040021D7 RID: 8663
|
|
public ButtonMultiTargets save10Btn;
|
|
|
|
// Token: 0x040021D8 RID: 8664
|
|
public ButtonMultiTargets lastBtn;
|
|
|
|
// Token: 0x040021D9 RID: 8665
|
|
public bool quickSave;
|
|
|
|
// Token: 0x040021DA RID: 8666
|
|
public bool checkpointSave;
|
|
|
|
// Token: 0x040021DB RID: 8667
|
|
public bool save1;
|
|
|
|
// Token: 0x040021DC RID: 8668
|
|
public bool save2;
|
|
|
|
// Token: 0x040021DD RID: 8669
|
|
public bool save3;
|
|
|
|
// Token: 0x040021DE RID: 8670
|
|
public bool save4;
|
|
|
|
// Token: 0x040021DF RID: 8671
|
|
public bool save5;
|
|
|
|
// Token: 0x040021E0 RID: 8672
|
|
public bool save6;
|
|
|
|
// Token: 0x040021E1 RID: 8673
|
|
public bool save7;
|
|
|
|
// Token: 0x040021E2 RID: 8674
|
|
public bool save8;
|
|
|
|
// Token: 0x040021E3 RID: 8675
|
|
public bool save9;
|
|
|
|
// Token: 0x040021E4 RID: 8676
|
|
public bool save10;
|
|
|
|
// Token: 0x040021E5 RID: 8677
|
|
public GameObject confirmSave;
|
|
|
|
// Token: 0x040021E6 RID: 8678
|
|
public GameObject confirmLoad;
|
|
|
|
// Token: 0x040021E7 RID: 8679
|
|
public GameObject confirmSaveInput;
|
|
|
|
// Token: 0x040021E8 RID: 8680
|
|
public GameObject confirmMainMenu;
|
|
|
|
// Token: 0x040021E9 RID: 8681
|
|
public GameObject confirmQuit;
|
|
|
|
// Token: 0x040021EA RID: 8682
|
|
public string pickedSave;
|
|
|
|
// Token: 0x040021EB RID: 8683
|
|
public bool mainMenu;
|
|
|
|
// Token: 0x040021EC RID: 8684
|
|
public Sprite quickSaveSprite;
|
|
|
|
// Token: 0x040021ED RID: 8685
|
|
public Sprite checkpointSaveSprite;
|
|
|
|
// Token: 0x040021EE RID: 8686
|
|
public Sprite save1Sprite;
|
|
|
|
// Token: 0x040021EF RID: 8687
|
|
public Sprite save2Sprite;
|
|
|
|
// Token: 0x040021F0 RID: 8688
|
|
public Sprite save3Sprite;
|
|
|
|
// Token: 0x040021F1 RID: 8689
|
|
public Sprite save4Sprite;
|
|
|
|
// Token: 0x040021F2 RID: 8690
|
|
public Sprite save5Sprite;
|
|
|
|
// Token: 0x040021F3 RID: 8691
|
|
public Sprite save6Sprite;
|
|
|
|
// Token: 0x040021F4 RID: 8692
|
|
public Sprite save7Sprite;
|
|
|
|
// Token: 0x040021F5 RID: 8693
|
|
public Sprite save8Sprite;
|
|
|
|
// Token: 0x040021F6 RID: 8694
|
|
public Sprite save9Sprite;
|
|
|
|
// Token: 0x040021F7 RID: 8695
|
|
public Sprite save10Sprite;
|
|
|
|
// Token: 0x040021F8 RID: 8696
|
|
public string quickSaveInfo;
|
|
|
|
// Token: 0x040021F9 RID: 8697
|
|
public string checkpointSaveInfo;
|
|
|
|
// Token: 0x040021FA RID: 8698
|
|
public string save1Info;
|
|
|
|
// Token: 0x040021FB RID: 8699
|
|
public string save2Info;
|
|
|
|
// Token: 0x040021FC RID: 8700
|
|
public string save3Info;
|
|
|
|
// Token: 0x040021FD RID: 8701
|
|
public string save4Info;
|
|
|
|
// Token: 0x040021FE RID: 8702
|
|
public string save5Info;
|
|
|
|
// Token: 0x040021FF RID: 8703
|
|
public string save6Info;
|
|
|
|
// Token: 0x04002200 RID: 8704
|
|
public string save7Info;
|
|
|
|
// Token: 0x04002201 RID: 8705
|
|
public string save8Info;
|
|
|
|
// Token: 0x04002202 RID: 8706
|
|
public string save9Info;
|
|
|
|
// Token: 0x04002203 RID: 8707
|
|
public string save10Info;
|
|
|
|
// Token: 0x04002204 RID: 8708
|
|
public bool characterDead;
|
|
|
|
// Token: 0x04002205 RID: 8709
|
|
public GameObject contentStartMenu;
|
|
|
|
// Token: 0x04002206 RID: 8710
|
|
public GameObject contentSaveLoad;
|
|
|
|
// Token: 0x04002207 RID: 8711
|
|
public bool open;
|
|
|
|
// Token: 0x04002208 RID: 8712
|
|
public string currentMenu = "Load";
|
|
|
|
// Token: 0x04002209 RID: 8713
|
|
private HannahAnimator currentBook;
|
|
|
|
// Token: 0x0400220A RID: 8714
|
|
public List<GameObject> editBtns = new List<GameObject>();
|
|
|
|
// Token: 0x0400220B RID: 8715
|
|
public GameObject closeBtn;
|
|
|
|
// Token: 0x0400220C RID: 8716
|
|
public GameObject confirmSaveButton;
|
|
|
|
// Token: 0x0400220D RID: 8717
|
|
public Canvas canvas;
|
|
|
|
// Token: 0x0400220E RID: 8718
|
|
public InputField input;
|
|
|
|
// Token: 0x0400220F RID: 8719
|
|
private IEnumerator loadCoroutine;
|
|
|
|
// Token: 0x04002210 RID: 8720
|
|
private IEnumerator saveCoroutine;
|
|
|
|
// Token: 0x04002211 RID: 8721
|
|
private StringFast str = new StringFast(64);
|
|
|
|
// Token: 0x04002212 RID: 8722
|
|
public GameObject controllerExitStartMenu;
|
|
|
|
// Token: 0x04002213 RID: 8723
|
|
public GameObject controllerExitMainMenu;
|
|
|
|
// Token: 0x04002214 RID: 8724
|
|
public bool waitingForSplash;
|
|
|
|
// Token: 0x04002215 RID: 8725
|
|
private int startingOrder;
|
|
}
|