コード例 #1
0
 public override void WorldLoaded()
 {
     _extendedDataStorage = UtilityWorldObjectManager.GetUtilityWorldObject <ExtendedDataStorage>();
     _extendedDataStorage.Cleanup();
     base.WorldLoaded();
     LessonAutoActivator.TeachOpportunity(GUC_ConceptDefOf.GUC_Animal_Handling, OpportunityType.GoodToKnow);
 }
コード例 #2
0
 public override void WorldLoaded()
 {
     var obj = UtilityWorldObjectManager.GetUtilityWorldObject<WorldDataStore>();
     //после загрузки мира
     GameData = obj;
     GrassFix.SetMapTickOnPlaced(GameData.GrassFixData ?? "");
 }
コード例 #3
0
        public override void WorldLoaded()
        {
            if (!ModIsActive)
            {
                return;
            }
            _currentCache = null;

            var recipes = DefDatabase <RecipeDef> .AllDefsListForReading
                          .Where(r => r.defName.StartsWith("MateriaRecipe"))
                          .ToDictionary(r => r.defName, r => r);

            _database = UtilityWorldObjectManager.GetUtilityWorldObject <MateriaDatabase>();

            if (_database.RecipeSpecs.Count == 0)
            {
                Logger.Message($"Generating {recipes.Count} new recipe.");

                var recipeGen = new RecipesGen(_random);
                recipeGen.Populate(_database, recipes.Values.ToQueue());
                EffectsGen.PopulateEffects(_database.RecipeSpecs);
                CreateOptions();
            }

            Logger.Message($"Applying {_database.RecipeSpecs.Count} recipe specifications.");
            var cookingRecipeUsers = GetCookingRecipeUsers();

            foreach (var spec in _database.RecipeSpecs)
            {
                var recipe = recipes[spec.Name];
                spec.ApplyTo(recipe, cookingRecipeUsers);
            }

            _currentCache = _database.RecipeSpecs.FirstOrDefault(r => r.IsUnlocking);
        }
コード例 #4
0
 public override void WorldLoaded()
 {
     base.WorldLoaded();
     _extendedBillDataStorage =
         UtilityWorldObjectManager.GetUtilityWorldObject <ExtendedBillDataStorage>();
     BillCopyPasteHandler.Clear();
 }
コード例 #5
0
        public override void WorldLoaded()
        {
            var obj = UtilityWorldObjectManager.GetUtilityWorldObject <WorldDataStore>();

            //после загрузки мира
            GameData = obj;
        }
コード例 #6
0
 public DaysMatterTab()
 {
     layer = WindowLayer.GameUI;
     // closeOnClickedOutside = true;
     // closeOnEscapeKey = true;
     // forcePause = true;
     _store = UtilityWorldObjectManager.GetUtilityWorldObject <MatteredDayStore>();
 }
コード例 #7
0
        public static void ResetPPSMedicalCare(Pawn_PlayerSettings pps, Pawn pawn)
        {
            if (pps == null || pawn == null)
            {
                return;
            }

            Config config = UtilityWorldObjectManager.GetUtilityWorldObject <Config>();

            // needed for world creation, loading
            if (config == null || Find.FactionManager == null)
            {
                pps.medCare = MedicalCareCategory.HerbalOrWorse;
                if (pawn.IsColonist && !pawn.IsPrisoner && !pawn.RaceProps.Animal)
                {
                    pps.medCare = MedicalCareCategory.Best;
                }
                return;
            }

            if (pawn.RaceProps.Humanlike)
            {
                if (pawn.Faction != null && pawn.Faction.IsPlayer)
                {
                    if (pawn.IsPrisoner)
                    {
                        pps.medCare = config.care_PrisonerHuman;
                    }
                    else
                    {
                        pps.medCare = config.care_PlayerHuman;
                    }
                }
                else if (pawn.Faction == null || !pawn.Faction.HostileTo(Faction.OfPlayer))
                {
                    pps.medCare = config.care_AllyHuman;
                }
                else
                {
                    pps.medCare = config.care_EnemyHuman;
                }
            }
            else
            {
                if (pawn.Faction != null && pawn.Faction.IsPlayer)
                {
                    pps.medCare = config.care_PlayerAnimal;
                }
                else if (pawn.Faction == null || !pawn.Faction.HostileTo(Faction.OfPlayer))
                {
                    pps.medCare = config.care_AllyAnimal;
                }
                else
                {
                    pps.medCare = config.care_EnemyAnimal;
                }
            }
        }
コード例 #8
0
        public override void WorldLoaded()
        {
            base.WorldLoaded();
            _extendedDataStorage =
                UtilityWorldObjectManager.GetUtilityWorldObject <ExtendedDataStorage>();

            // Ticks appear to be run before MapLoaded, so we need a FireManager available
            _fireManager = new FireManager();
        }
コード例 #9
0
 public override void WorldLoaded()
 {
     //Failsafe if other mods prevent the store from being loaded during MapComponentsInitializing
     if (_extendedDataStorage == null)
     {
         _extendedDataStorage = UtilityWorldObjectManager.GetUtilityWorldObject <ExtendedDataStorage>();
     }
     base.WorldLoaded();
 }
コード例 #10
0
        public override void WorldLoaded()
        {
            worldData = UtilityWorldObjectManager.GetUtilityWorldObject <WorldDataStore>();

            foreach (var item in worldData.defaultPonicsPlant.ToList())
            {
                item.Key.building.defaultPlantToGrow = item.Value;
            }
        }
コード例 #11
0
        public override void WorldLoaded()
        {
            WorldSettings = UtilityWorldObjectManager.GetUtilityWorldObject <WorldSettings>();

            // Fix compatibilities with older saves
            UpdateLegacy.Update();

            VisibilityDesignator.PlanningVisibility = WorldSettings.PlanningVisibility;
            OpacityDesignator.Opacity = ModSettings.PlanOpacity;
        }
コード例 #12
0
        public override void WorldLoaded()
        {
            TaleNewsDatabaseSystem       = UtilityWorldObjectManager.GetUtilityWorldObject <TaleNewsDatabase>();
            ArrivalActionAndSenderLinker = UtilityWorldObjectManager.GetUtilityWorldObject <Linker_ArrivalActionAndSender>();
            DesynchronizedVersionTracker = UtilityWorldObjectManager.GetUtilityWorldObject <DesynchronizedVersionTracker>();
            TheHallOfFigures             = UtilityWorldObjectManager.GetUtilityWorldObject <HallOfFigures>();

            if (DesynchronizedVersionTracker.VersionOfModWithinSave < new Version(1, 4, 5, 0))
            {
                TaleNewsDatabaseSystem.SelfPatching_NullVictims();
            }
            TaleNewsDatabaseSystem.SelfVerify();
        }
コード例 #13
0
        public override void WorldLoaded()
        {
            FoodSearchCache.ClearAll();

            var obj = UtilityWorldObjectManager.GetUtilityWorldObject <WorldDataStore_PawnPolicies>();

#if DEBUG
            Log.Message("World loaded. assigned policies: " + WorldDataStore_PawnPolicies.AssignedPoliciesCount);
#endif

            //if (!SeparatedNutrientPaste)
            //	Utils.ShowRevertAllWorldNonVanillaThingsDialog();
        }
コード例 #14
0
 private void OnDefsLoaded()
 {
     try {
         UtilityWorldObjectManager.OnDefsLoaded();
         for (int i = 0; i < childMods.Count; i++)
         {
             try {
                 childMods[i].DefsLoaded();
             } catch (Exception e) {
                 Logger.ReportException(e, childMods[i].LogIdentifierSafe);
             }
         }
     } catch (Exception e) {
         Logger.ReportException(e);
     }
 }
コード例 #15
0
ファイル: Base.cs プロジェクト: LazyRichard/WhatTheHack
        public override void WorldLoaded()
        {
            _extendedDataStorage = UtilityWorldObjectManager.GetUtilityWorldObject <ExtendedDataStorage>();
            base.WorldLoaded();

            /*
             * foreach (Map map in Find.Maps)
             * {
             *  foreach (Pawn pawn in map.mapPawns.AllPawnsSpawned.Where((Pawn p) => p.health != null && p.RaceProps.IsMechanoid && p.def.comps.Any<CompProperties>()))
             *  {
             *      ThingWithComps twc = (ThingWithComps)pawn;
             *      RemoveComps(ref twc);
             *  }
             * }
             */
        }
コード例 #16
0
ファイル: Main.cs プロジェクト: Dakraid/RW_LabelsOnFloor
        public override void WorldLoaded()
        {
            base.WorldLoaded();

            _customRoomLabelManager =
                UtilityWorldObjectManager.GetUtilityWorldObject <CustomRoomLabelManager>();

            LabelPlacementHandler = new LabelPlacementHandler(
                _labelHolder,
                new MeshHandler(_fontHandler),
                new LabelMaker(_customRoomLabelManager),
                new RoomRoleFinder(_customRoomLabelManager)
                );

            _labelDrawer = new LabelDrawer(_labelHolder, _fontHandler);
        }
コード例 #17
0
        public override void WorldLoaded()
        {
            // InfoKnowStorage = UtilityWorldObjectManager.GetUtilityWorldObject<InformationKnowledgeStorage>();
            // CentralTaleDatabase = UtilityWorldObjectManager.GetUtilityWorldObject<CentralTaleDatabase>();
            TaleNewsDatabaseSystem       = UtilityWorldObjectManager.GetUtilityWorldObject <TaleNewsDatabase>();
            ArrivalActionAndSenderLinker = UtilityWorldObjectManager.GetUtilityWorldObject <Linker_ArrivalActionAndSender>();
            DesynchronizedVersionTracker = UtilityWorldObjectManager.GetUtilityWorldObject <DesynchronizedVersionTracker>();
            TheHallOfFigures             = UtilityWorldObjectManager.GetUtilityWorldObject <HallOfFigures>();
            // ASDF obj = UtilityWorldObjectManager.GetUtilityWorldObject<ASDF>();

            if (DesynchronizedVersionTracker.VersionOfModWithinSave < new Version(1, 4, 5, 0))
            {
                TaleNewsDatabaseSystem.SelfPatching_NullVictims();
            }
            TaleNewsDatabaseSystem.SelfVerify();
        }
コード例 #18
0
 internal void OnPlayingStateEntered()
 {
     try {
         UtilityWorldObjectManager.OnWorldLoaded();
         for (int i = 0; i < childMods.Count; i++)
         {
             try {
                 childMods[i].WorldLoaded();
             } catch (Exception e) {
                 Logger.ReportException(e, childMods[i].ModIdentifier);
             }
         }
     } catch (Exception e) {
         Logger.ReportException(e);
     }
 }
コード例 #19
0
 private void OnDefsLoaded()
 {
     try {
         RegisterOwnSettings();
         UtilityWorldObjectManager.OnDefsLoaded();
         for (int i = 0; i < childMods.Count; i++)
         {
             try {
                 childMods[i].DefsLoaded();
             } catch (Exception e) {
                 Logger.ReportException(e, childMods[i].ModIdentifier);
             }
         }
     } catch (Exception e) {
         Logger.ReportException(e);
     }
 }
コード例 #20
0
 internal void OnPlayingStateEntered()
 {
     try {
         var currentTick = Find.TickManager.TicksGame;
         CallbackScheduler.Initialize(currentTick);
         DistributedTicker.Initialize(currentTick);
         UtilityWorldObjectManager.OnWorldLoaded();
         Current.Game.tickManager.RegisterAllTickabilityFor(new HugsTickProxy {
             CreatedByController = true
         });
         for (int i = 0; i < childMods.Count; i++)
         {
             try {
                 childMods[i].WorldLoaded();
             } catch (Exception e) {
                 Logger.ReportException(e, childMods[i].ModIdentifier);
             }
         }
     } catch (Exception e) {
         Logger.ReportException(e);
     }
 }
 public ModWorldSettingsHandler(World world) : base(world)
 {
     //Transfer over the old settings in the world, if they exist.
     //  In case UtilityWorldObjectManager is completely removed, the try catch block will
     //  prevent displaying a harmless error.
     try
     {
         ModSettingsWorldStorage oldWorldSettings = null;
         if (UtilityWorldObjectManager.UtilityWorldObjectExists <ModSettingsWorldStorage>())
         {
             oldWorldSettings = UtilityWorldObjectManager.GetUtilityWorldObject <ModSettingsWorldStorage>();
         }
         if (oldWorldSettings != null)
         {
             PawnkindRaceDiversification.Logger.Message("The old local settings object holder has been identified in this world. Transfering the local settings over to the new world component.");
             ModSettingsHandler.setLocalFlatWeights.Clear();
             ModSettingsHandler.setLocalFlatWeights.AddRange(oldWorldSettings.oldLocalFlatWeights);
             ResolveMissingWeights();
             ModSettingsHandler.UpdateHandleReferencesInAllReferences(ref ModSettingsHandler.setLocalFlatWeights, HandleContext.LOCAL);
             Find.WorldObjects.Remove(oldWorldSettings);
         }
     }
     catch (Exception e) { }
 }
コード例 #22
0
 public override void WorldLoaded()
 {
     saveData = UtilityWorldObjectManager.GetUtilityWorldObject <DefensivePositionsData>();
 }
コード例 #23
0
 public override void WorldLoaded()
 {
     WorldObject = UtilityWorldObjectManager.GetUtilityWorldObject <WorldObject> ();
     base.WorldLoaded();
 }
コード例 #24
0
 public override void WorldLoaded()
 {
     _store = UtilityWorldObjectManager.GetUtilityWorldObject <MatteredDayStore>();
 }
コード例 #25
0
        public override void DoWindowContents(Rect inRect)
        {
            Text.Font = GameFont.Medium;
            Rect rect = new Rect(0f, 0f, InitialSize.x, 50f);

            Widgets.Label(rect, "Medical Defaults");
            Text.Font = GameFont.Small;

            Rect content = new Rect(0, 50, inRect.width, inRect.height - 70);

            Listing_Standard listing_Standard = new Listing_Standard(content);
            float            stdHeight        = MedicalCareUtility.CareSetterHeight;

            float hgap = 40;

            float hposA = 10;
            float hposB = 160;
            float hposC = hposB + MedicalCareUtility.CareSetterWidth + hgap;

            float hwidthA = 120;
            float hwidthB = MedicalCareUtility.CareSetterWidth;
            float hwidthC = MedicalCareUtility.CareSetterWidth;

            try
            {
                Config config = UtilityWorldObjectManager.GetUtilityWorldObject <Config>();

                MedicalCareUtility_Detour.HorribleHackWithinDefaultDialog = true;

                listing_Standard.Gap(20);

                {
                    Rect title = listing_Standard.GetRect(stdHeight);
                    Widgets.Label(new Rect(hposB + 30, title.y, hwidthB, stdHeight), "Human");
                    Widgets.Label(new Rect(hposC + 30, title.y, hwidthC, stdHeight), "Animal");
                }

                {
                    Rect title = listing_Standard.GetRect(stdHeight);
                    Widgets.Label(new Rect(hposA, title.y, hwidthA, stdHeight), "Colonist");
                    MedicalCareUtility.MedicalCareSetter(new Rect(hposB, title.y, hwidthB, stdHeight), ref config.care_PlayerHuman);
                    MedicalCareUtility.MedicalCareSetter(new Rect(hposC, title.y, hwidthC, stdHeight), ref config.care_PlayerAnimal);
                }

                {
                    Rect title = listing_Standard.GetRect(stdHeight);
                    Widgets.Label(new Rect(hposA, title.y, hwidthA, stdHeight), "Colonist Prisoner");
                    MedicalCareUtility.MedicalCareSetter(new Rect(hposB, title.y, hwidthB, stdHeight), ref config.care_PrisonerHuman);
                }

                {
                    Rect title = listing_Standard.GetRect(stdHeight);
                    Widgets.Label(new Rect(hposA, title.y, hwidthA, stdHeight), "Ally");
                    MedicalCareUtility.MedicalCareSetter(new Rect(hposB, title.y, hwidthB, stdHeight), ref config.care_AllyHuman);
                    MedicalCareUtility.MedicalCareSetter(new Rect(hposC, title.y, hwidthC, stdHeight), ref config.care_AllyAnimal);
                }

                {
                    Rect title = listing_Standard.GetRect(stdHeight);
                    Widgets.Label(new Rect(hposA, title.y, hwidthA, stdHeight), "Enemy");
                    MedicalCareUtility.MedicalCareSetter(new Rect(hposB, title.y, hwidthB, stdHeight), ref config.care_EnemyHuman);
                    MedicalCareUtility.MedicalCareSetter(new Rect(hposC, title.y, hwidthC, stdHeight), ref config.care_EnemyAnimal);
                }

                listing_Standard.Gap(50);

                if (listing_Standard.ButtonText("Reset all pawns to these values"))
                {
                    foreach (Pawn p in PawnsFinder.AllMapsAndWorld_Alive)
                    {
                        Pawn_PlayerSettings_Detour.ResetPPSMedicalCare(p.playerSettings, p);
                    }
                }
            }
            finally
            {
                MedicalCareUtility_Detour.HorribleHackWithinDefaultDialog = false;
            }

            listing_Standard.End();
        }
コード例 #26
0
ファイル: WFModBase.cs プロジェクト: emipa606/Warframe
 public override void WorldLoaded()
 {
     _WFcontrolstorage = UtilityWorldObjectManager.GetUtilityWorldObject <WarframeControlStorage>();
     base.WorldLoaded();
 }
コード例 #27
0
 // we do our injections at world load because some mods overwrite ThingDesignatorDef.resolvedDesignators during init
 public override void WorldLoaded()
 {
     InjectDesignators();
     DesignatorContextMenuController.PrepareDesignatorContextMenus();
     WorldSettings = UtilityWorldObjectManager.GetUtilityWorldObject <WorldSettings>();
 }
コード例 #28
0
 public override void WorldLoaded()
 {
     var obj =
         UtilityWorldObjectManager.GetUtilityWorldObject <WorldDataStore>();
 }
コード例 #29
0
ファイル: Base.cs プロジェクト: lazydog8242/GiddyUpCore
 public override void WorldLoaded()
 {
     _extendedDataStorage = UtilityWorldObjectManager.GetUtilityWorldObject <ExtendedDataStorage>();
     base.WorldLoaded();
 }
コード例 #30
0
 public override void WorldLoaded()
 {
     savedData = UtilityWorldObjectManager.GetUtilityWorldObject <SavedData>();
 }