public override void WorldLoaded() { _extendedDataStorage = UtilityWorldObjectManager.GetUtilityWorldObject <ExtendedDataStorage>(); _extendedDataStorage.Cleanup(); base.WorldLoaded(); LessonAutoActivator.TeachOpportunity(GUC_ConceptDefOf.GUC_Animal_Handling, OpportunityType.GoodToKnow); }
public override void WorldLoaded() { var obj = UtilityWorldObjectManager.GetUtilityWorldObject<WorldDataStore>(); //после загрузки мира GameData = obj; GrassFix.SetMapTickOnPlaced(GameData.GrassFixData ?? ""); }
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); }
public override void WorldLoaded() { base.WorldLoaded(); _extendedBillDataStorage = UtilityWorldObjectManager.GetUtilityWorldObject <ExtendedBillDataStorage>(); BillCopyPasteHandler.Clear(); }
public override void WorldLoaded() { var obj = UtilityWorldObjectManager.GetUtilityWorldObject <WorldDataStore>(); //после загрузки мира GameData = obj; }
public DaysMatterTab() { layer = WindowLayer.GameUI; // closeOnClickedOutside = true; // closeOnEscapeKey = true; // forcePause = true; _store = UtilityWorldObjectManager.GetUtilityWorldObject <MatteredDayStore>(); }
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; } } }
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(); }
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(); }
public override void WorldLoaded() { worldData = UtilityWorldObjectManager.GetUtilityWorldObject <WorldDataStore>(); foreach (var item in worldData.defaultPonicsPlant.ToList()) { item.Key.building.defaultPlantToGrow = item.Value; } }
public override void WorldLoaded() { WorldSettings = UtilityWorldObjectManager.GetUtilityWorldObject <WorldSettings>(); // Fix compatibilities with older saves UpdateLegacy.Update(); VisibilityDesignator.PlanningVisibility = WorldSettings.PlanningVisibility; OpacityDesignator.Opacity = ModSettings.PlanOpacity; }
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(); }
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(); }
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); } }
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); * } * } */ }
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); }
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(); }
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); } }
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); } }
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) { } }
public override void WorldLoaded() { saveData = UtilityWorldObjectManager.GetUtilityWorldObject <DefensivePositionsData>(); }
public override void WorldLoaded() { WorldObject = UtilityWorldObjectManager.GetUtilityWorldObject <WorldObject> (); base.WorldLoaded(); }
public override void WorldLoaded() { _store = UtilityWorldObjectManager.GetUtilityWorldObject <MatteredDayStore>(); }
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(); }
public override void WorldLoaded() { _WFcontrolstorage = UtilityWorldObjectManager.GetUtilityWorldObject <WarframeControlStorage>(); base.WorldLoaded(); }
// 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>(); }
public override void WorldLoaded() { var obj = UtilityWorldObjectManager.GetUtilityWorldObject <WorldDataStore>(); }
public override void WorldLoaded() { _extendedDataStorage = UtilityWorldObjectManager.GetUtilityWorldObject <ExtendedDataStorage>(); base.WorldLoaded(); }
public override void WorldLoaded() { savedData = UtilityWorldObjectManager.GetUtilityWorldObject <SavedData>(); }