/// <summary> /// Get the data needed for the save menu /// </summary> /// <param name="file">Save File</param> /// <returns></returns> public static SaveMenuData GetSaveData(int file) { SaveMenuData saveData = new SaveMenuData(); saveData.Exists = SaveExists(file); if (saveData.Exists) { saveData.PlayTime = saveFiles[file].PlayTime; saveData.Location = saveFiles[file].CurrentScene; saveData.CurrentParty = saveFiles[file].CurrentParty; } return(saveData); }
/// <summary> /// Update the save menu /// </summary> public void UpdateSaveMenu() { for (int i = 0; i < SaveFiles.Length; i++) { SaveMenuData saveData = SaveFileManager.GetSaveData(i); if (!saveData.Exists) { // save doesn't exist Data[i].SetActive(false); // don't show data NoData[i].gameObject.SetActive(true); // show no data text continue; } Data[i].SetActive(true); NoData[i].gameObject.SetActive(false); PlayTime[i].text = parsePlayTime(saveData.PlayTime); Location[i].text = saveData.Location; for (int j = saveData.CurrentParty.Count; j < 3; j++) { // set the images of the party members that aren't in the party inactive if (j == 1) { PartyMember2[i].gameObject.SetActive(false); } if (j == 2) { PartyMember3[i].gameObject.SetActive(false); } } PartyMember1[i].sprite = GameManager.Instance.GetCharSprite(saveData.CurrentParty[0]); // always at least 1 character in party if (1 < saveData.CurrentParty.Count) { // put in second character PartyMember2[i].sprite = GameManager.Instance.GetCharSprite(saveData.CurrentParty[1]); } if (2 < saveData.CurrentParty.Count) { // put in third character PartyMember3[i].sprite = GameManager.Instance.GetCharSprite(saveData.CurrentParty[2]); } } }