Example #1
0
        public static void Load()
        {
            Config = OptionsPanelHandler.RegisterModOptions <Config>();
            IngameMenuHandler.RegisterOnSaveEvent(Config.Save);
            Values.Load();
            InventorySetup();
            CreateAndPatchPacks();
            var aFabricator = new AbyssFabricator();

            #region TabNodes
            aFabricator.AddTabNode(AbyssBatteryTab, "AbyssBatteries", SpriteManager.Get(TechType.Battery));
            aFabricator.AddTabNode(AbyssPowCellTab, "AbyssPowerCells", SpriteManager.Get(TechType.PowerCell));
            aFabricator.AddTabNode(AbyssResourcesTab, "Resources", SpriteManager.Get(TechType.Aerogel));
            #endregion
            #region CraftNodes
            aFabricator.AddCraftNode(GhostDNA.TechTypeID, AbyssResourcesTab);
            aFabricator.AddCraftNode(JellyBattery.TechType, AbyssBatteryTab);
            aFabricator.AddCraftNode(JellyCell.TechType, AbyssPowCellTab);
            aFabricator.AddCraftNode(PoopBattery.TechType, AbyssBatteryTab);
            aFabricator.AddCraftNode(PoopCell.TechType, AbyssPowCellTab);
            aFabricator.AddCraftNode(AmpSquidBattery.TechType, AbyssBatteryTab);
            aFabricator.AddCraftNode(AmpSquidCell.TechType, AbyssPowCellTab);
            aFabricator.AddCraftNode(FossilBattery.TechType, AbyssBatteryTab);
            aFabricator.AddCraftNode(FossilCell.TechType, AbyssPowCellTab);
            aFabricator.AddCraftNode(GhostBattery.TechType, AbyssBatteryTab);
            aFabricator.AddCraftNode(GhostCell.TechType, AbyssPowCellTab);
            aFabricator.AddCraftNode(ThermalBattery.TechType, AbyssBatteryTab);
            aFabricator.AddCraftNode(ThermalCell.TechType, AbyssPowCellTab);
            #endregion
            aFabricator.Patch();
            Harmony.CreateAndPatchAll(myAssembly, $"Metious_{myAssembly.GetName().Name}");
        }
Example #2
0
        public static void Patch()
        {
            Config = OptionsPanelHandler.RegisterModOptions <Config>();
            IngameMenuHandler.RegisterOnSaveEvent(Config.Save);

            Harmony.CreateAndPatchAll(myAssembly, $"RandyKnapp_{myAssembly.GetName().Name}");

            QModManager.Utility.Logger.Log(QModManager.Utility.Logger.Level.Info, "LongLockerNames Patched");
        }
Example #3
0
        public static void Patch()
        {
            Config = OptionsPanelHandler.RegisterModOptions <Config>();
            IngameMenuHandler.RegisterOnSaveEvent(Config.Save);

            Harmony.CreateAndPatchAll(myAssembly, "com.QuitToDesktop.mod");

            Console.WriteLine("[QuitToDesktop] Patched");
        }
        public static void Load()
        {
            config = OptionsPanelHandler.RegisterModOptions <Config>();
            IngameMenuHandler.RegisterOnSaveEvent(config.Save);

            var assembly = Assembly.GetExecutingAssembly();

            new Harmony($"MrPurple6411_{assembly.GetName().Name}").PatchAll(assembly);
        }
Example #5
0
        public static void Load()
        {
            WaterParkSize = PlayerPrefs.GetInt("WaterParkSize", 10);
#if BELOWZERO
            LargeWaterParkSize = PlayerPrefs.GetInt("LargeWaterParkSize", 20);
#endif
            OverFlowIntoOcean = PlayerPrefs.GetInt("OverFlowIntoOcean", 0) < 1;

            OptionsPanelHandler.RegisterModOptions(new Options());
            IngameMenuHandler.RegisterOnSaveEvent(() => PowerValues.ForEach((KeyValuePair <string, float> keyValuePair) => PlayerPrefs.SetFloat(keyValuePair.Key, keyValuePair.Value)));
        }
        public static void Prefix(Creature __instance)
        {
            if (Main.CreatureConfig is null)
            {
                Main.CreatureConfig = new CreatureConfig();
                Main.CreatureConfig.Load();
                IngameMenuHandler.RegisterOnSaveEvent(Main.CreatureConfig.Save);
            }

            if (__instance.gameObject != null && __instance.gameObject.GetComponent <WaterParkCreature>() != null &&
                __instance.gameObject.GetComponent <WaterParkCreature>().IsInsideWaterPark())
            {
                return;
            }
            try
            {
                var   id = __instance.GetComponent <PrefabIdentifier>().Id;
                float scale;
                if (!Main.CreatureConfig.CreatureSizes.ContainsKey(id))
                {
                    UnityEngine.Random.InitState(DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Millisecond);
                    scale = UnityEngine.Random.Range(Main.Config.minsize, Main.Config.maxsize);
                    __instance.SetScale(scale);
                    Main.CreatureConfig.CreatureSizes.Add(__instance.GetComponent <PrefabIdentifier>().Id, scale);
                }
                else
                {
                    scale = Main.CreatureConfig.CreatureSizes[id];
                    __instance.SetScale(scale);
                }

                var creatureActions = __instance.gameObject.GetComponentsInChildren <CreatureAction>().Where((x) => x.GetType().GetField("swimVelocity") != null).ToList();

                scale = scale <1f ? 1f : scale> 5f ? 5f : scale;

                foreach (var creatureAction in creatureActions)
                {
                    var swimVelocity = Traverse.Create(creatureAction).Field("swimVelocity");
                    if (!swimVelocity.FieldExists())
                    {
                        continue;
                    }
                    var currentSpeed = swimVelocity.GetValue <float>();
                    swimVelocity.SetValue(currentSpeed * scale);
                }
            }
            catch
            {
                // ignored
            }
        }
        // We keep an initial copy of the spawn infos so Coordinated Spawns also works if you quit to main menu.
        private static void InitializeSpawnInfos()
        {
            if (initialized)
            {
                // we already have an initialSpawnInfos initialized, refresh our spawnInfos List.
                savedSpawnInfos.Clear();
                foreach (var spawnInfo in initialSpawnInfos.Where(spawnInfo => !spawnInfos.Contains(spawnInfo)))
                {
                    spawnInfos.Add(spawnInfo);
                }
                return;
            }

            initialSpawnInfos.AddRange(spawnInfos);
            IngameMenuHandler.RegisterOnSaveEvent(SaveData);
            initialized = true;
        }