Esempio n. 1
0
 private static void ClearAllPlayData()
 {
     LanguageDatabase.Clear();
     LoadedModManager.ClearDestroy();
     foreach (Type genericParam in GenTypes.AllSubclasses(typeof(Def)))
     {
         GenGeneric.InvokeStaticMethodOnGenericType(typeof(DefDatabase <>), genericParam, "Clear");
     }
     ThingCategoryNodeDatabase.Clear();
     BackstoryDatabase.Clear();
     SolidBioDatabase.Clear();
     PlayDataLoader.loaded = false;
 }
Esempio n. 2
0
        private static void ClearAllPlayData()
        {
            LanguageDatabase.Clear();
            // A14 - ModContentPackManager was removed?
            LoadedModManager.ClearDestroy();
            foreach (Type genericParam in GenTypes.AllSubclasses(typeof(Def)))
            {
                GenGeneric.InvokeStaticMethodOnGenericType(typeof(DefDatabase <>), genericParam, "Clear");
            }
            ThingCategoryNodeDatabase.Clear();
            BackstoryDatabase.Clear();
            SolidBioDatabase.Clear();

            PlayDataLoader_loaded.SetValue(null, false);
        }
Esempio n. 3
0
        static IEnumerable <Gizmo> Postfix(IEnumerable <Gizmo> __result, ThingComp __instance)
        {
            foreach (var g in __result)
            {
                yield return(g);
            }
            if (!(__instance is CompArt compArt))
            {
                yield break;
            }
            if (!(compArt.parent is Building_Art))
            {
                yield break;
            }
            yield return(new Command_Action()
            {
                defaultLabel = "Make Special Sculpture (SLOW)",
                defaultDesc = "Make this Sculpture the first Special Sculpture available.  Reloads everything.\n\nTHIS IS VERY SLOW!\n(Project RimFactory)",
                action = delegate() {
                    // reload graphic assets: (not fast)
                    LoadedModManager.GetMod <ProjectRimFactory.Common.ProjectRimFactory_ModComponent>().Content.ReloadContent();
                    // reload language data: (....slow)
                    LanguageDatabase.Clear();
                    LanguageDatabase.InitAllMetadata(); // have to reload all? :p
                    //LoadedModManager.GetMod<ProjectRimFactory.Common.ProjectRimFactory_ModComponent>().Content.
                    ProjectRimFactory.Common.ProjectRimFactory_ModComponent.availableSpecialSculptures
                        = SpecialSculpture.LoadAvailableSpecialSculptures(LoadedModManager.GetMod <ProjectRimFactory.Common.ProjectRimFactory_ModComponent>().Content
                                                                          );
                    foreach (var s in ProjectRimFactory.Common.ProjectRimFactory_ModComponent.availableSpecialSculptures)
                    {
                        s.Init();
                    }
                    var target = ProjectRimFactory.Common.ProjectRimFactory_ModComponent.availableSpecialSculptures[0];

                    var comp = Current.Game.GetComponent <ProjectRimFactory.PRFGameComponent>();
                    if (comp.specialScupltures != null)
                    {
                        //                    if (comp.specialScupltures == null) comp.specialScupltures = new List<SpecialSculpture>();

                        comp.specialScupltures.RemoveAll(s => s.id == target.id);
                    }
                    comp.TryAddSpecialSculpture(compArt.parent, target);
                    compArt.parent.DirtyMapMesh(compArt.parent.Map); // redraw graphic
                }
            });
        }