Example #1
0
        internal static void Load()
        {
            SaveData = new Preferences(Main.SavePath + Path.DirectorySeparatorChar + "JourneysBeginning" + Path.DirectorySeparatorChar + "savedata");
            SaveData.Load();

            if (SaveData.Contains("LastKnownVersion"))
            {
                JourneysBeginning.Instance.showChangelogTextVersionDifference = new Version(SaveData.Get("LastKnownVersion", JourneysBeginning.Instance.Version.ToString())) < JourneysBeginning.Instance.Version;
            }
            else
            {
                JourneysBeginning.Instance.showChangelogTextVersionDifference = true;
            }

            if (SaveData.Contains("SeenAnglerWarnMessage"))
            {
                AnglerShopGlobalNPC.HasSeenWarnMessage = SaveData.Get("SeenAnglerWarnMessage", false);
            }
        }
Example #2
0
        public Dictionary <int, bool> LoadConfig()
        {
            if (Configuration.Load())
            {
                Configuration.Get("StandardSpawnable", ref standardKillable);

                for (int i = 0; i < NPCLoader.NPCCount; i++)
                {
                    NPC npc = new NPC();

                    npc.SetDefaults(i);


                    if (npc.boss)
                    {
                        string a = npc.TypeName + "_is_Spawnable";
                        a = a.Replace(" ", "_");
                        bool temp = false;
                        try
                        {
                            if (!Configuration.Contains(a))
                            {
                                string temp2 = "_is_Spawnable";
                                string temp3 = npc.TypeName + temp2;
                                Configuration.Put(temp3, standardKillable);
                                Configuration.Save();
                            }

                            Configuration.Get(a, ref temp);
                            npcInvincible[npc.netID] = temp;
                        }
                        catch
                        {
                            //CreateConfig();

                            string temp2 = "_is_Spawnable";
                            string temp3 = npc.TypeName + temp2;
                            Configuration.Put(temp3, standardKillable);
                            Configuration.Save();

                            Configuration.Get(a, ref temp);
                            npcInvincible[npc.netID] = temp;
                        }
                    }
                }
            }
            else
            {
                CreateConfig();
                npcInvincible = LoadConfig();
            }


            return(npcInvincible);
        }