Example #1
0
 public void SaveLegacy()
 {
     SaveGame.Save(
         legacyIdentifier,
         LegacySystem.GetAchievements(),
         encode,
         encodePassword,
         serializer,
         encoder,
         encoding,
         savePath);
 }
Example #2
0
    private void SetupView()
    {
        foreach (var i in InstantiatedObjects)
        {
            Destroy(i);
        }
        InstantiatedObjects.Clear();

        var achs = LegacySystem.GetAchievements();

        foreach (var a in achs)
        {
            var entry = Instantiate(Entry, Entry.transform.parent);
            entry.gameObject.SetActive(true);
            entry.SetupAchievement(a);
            InstantiatedObjects.Add(entry.gameObject);
        }
        Entry.gameObject.SetActive(false);

        ViewHolder.SetActive(true);
    }
Example #3
0
    private void SetupLegacyMenu()
    {
        var legs = LegacySystem.GetAchievements();

        // CLASS SELECT SET-UP
        if (legs.Any(a => a.Unlocked && a.UnlocksClass != ""))
        {
            ClassSelectHolder.SetActive(true);

            var unlocked = legs.Where(e => e.Unlocked && e.UnlocksClass != "").Select(a => a.UnlocksClass).Distinct().OrderBy(a => a);

            ChiefClassSelect.ClearOptions();

            ChiefClassSelect.AddOptions(new List <TMP_Dropdown.OptionData>()
            {
                new TMP_Dropdown.OptionData("No class")
            });

            ChiefClassSelect.AddOptions(unlocked.Select(u => new TMP_Dropdown.OptionData(u.ToString())).ToList());
        }
        else
        {
            ClassSelectHolder.SetActive(false);
        }

        // World SELECT SET-UP
        if (legs.Any(a => a.Unlocked && a.UnlocksMapSize != MapGenerator.WorldSize.Small))
        {
            WorldSizeTextHolder.SetActive(true);

            var unlocked = legs.Where(e => e.Unlocked && e.UnlocksMapSize != MapGenerator.WorldSize.Small).Select(a => a.UnlocksMapSize).Distinct().OrderBy(a => a);

            WorldSizeSelect.ClearOptions();

            WorldSizeSelect.AddOptions(new List <TMP_Dropdown.OptionData>()
            {
                new TMP_Dropdown.OptionData("Small")
            });

            WorldSizeSelect.AddOptions(unlocked.Select(u => new TMP_Dropdown.OptionData(u.ToString())).ToList());
        }
        else
        {
            WorldSizeTextHolder.SetActive(false);
        }

        // Blessing SELECT SET-UP
        if (legs.Any(a => a.Unlocked && a.UnlocksBlessing != LegacySystem.Blessing.NoBlessing))
        {
            TribeSelectHolder.SetActive(true);

            var unlocked = legs.Where(e => e.Unlocked && e.UnlocksBlessing != LegacySystem.Blessing.NoBlessing).Select(a => a.UnlocksBlessing).Distinct().OrderBy(a => a);

            TribeBlessingSelect.ClearOptions();

            TribeBlessingSelect.AddOptions(new List <TMP_Dropdown.OptionData>()
            {
                new TMP_Dropdown.OptionData("No blessing")
            });

            TribeBlessingSelect.AddOptions(unlocked.Select(u => new TMP_Dropdown.OptionData(u.ToString())).ToList());
        }
        else
        {
            TribeSelectHolder.SetActive(false);
        }

        LegacyButton.gameObject.SetActive(TribeSelectHolder.activeInHierarchy || ClassSelectHolder.activeInHierarchy ||
                                          WorldSizeTextHolder.activeInHierarchy);
    }