Пример #1
0
        /// <summary>Registers the item into it's registry</summary>
        public override PlotItem Register()
        {
            Build();

            LookupRegistry.RegisterLandPlot(Prefab);
            if (RegisterAsPurchasable)
            {
                LandPlotRegistry.RegisterPurchasableLandPlot(new LandPlotRegistry.LandPlotShopEntry()
                {
                    cost       = PlotCost,
                    icon       = PlotIcon ?? SRObjects.MissingIcon,
                    mainImg    = PlotImg ?? PlotIcon ?? SRObjects.MissingImg,
                    pediaId    = PediaID,
                    plot       = ID,
                    isUnlocked = IsUnlocked
                });
            }
            else
            {
                PediaRegistry.RegisterIdEntry(PediaID, PlotIcon ?? SRObjects.MissingIcon);
                PediaRegistry.SetPediaCategory(PediaID, PediaRegistry.PediaCategory.RANCH);
            }

            // TODO: Fix pedia behaviour

            return(this);
        }
Пример #2
0
        /// <summary>
        /// Adds Pedia mappings
        /// </summary>
        /// <param name="id">The pedia ID to register</param>
        /// <param name="cat">The pedia category to add this in</param>
        public IdentifiableItem AddPediaMapping(PediaDirector.Id id, PediaRegistry.PediaCategory cat = PediaRegistry.PediaCategory.RESOURCES)
        {
            PediaRegistry.RegisterIdentifiableMapping(id, ID);
            PediaRegistry.RegisterIdEntry(id, Icon);
            PediaRegistry.SetPediaCategory(id, cat);

            return(this);
        }
Пример #3
0
 // Called before GameContext.Awake
 // You want to register new things and enum values here, as well as do all your harmony patching
 public override void PreLoad()
 {
     HarmonyInstance.PatchAll();
     TranslationPatcher.AddActorTranslation("l." + ModdedIds.MAPLE_SLIME.ToString().ToLower(), "Maple Slime");
     TranslationPatcher.AddActorTranslation("l." + ModdedIds.MAPLE_PLORT.ToString().ToLower(), "Maple Plort");
     TranslationPatcher.AddActorTranslation("l." + ModdedIds.TEST_CRATE_01.ToString().ToLower(), "Test Crate");
     new SlimePediaEntryTranslation(ModdedIds.MAPLE_SLIMES).SetTitleTranslation("Maple Slimes").SetIntroTranslation("Pancakes, anyone?").SetSlimeologyTranslation("A syrupy relative of the Honey Slime, the Maple Slimes are a fall favorite which can be found in the Moss Blanket. It is rumored that they were created in a collaboration between Ogden Ortiz and Viktor Humphries and then got loose. Maybe someday they'll make Butter Slimes too...").SetDietTranslation("Fruit").SetFavoriteTranslation("Pogofruit").SetRisksTranslation("These slimes produce very sticky plorts. If they get loose, you'll have a very sticky situation on your very sticky hands. Best not let that happen.").SetPlortonomicsTranslation("These delicious morsels are just about the best thing since sliced... anything! They're highly prized by top chefs and breakfast enthusiasts alike. There's nothing like the smell of warm syrup to wake up a hungry rancher.");
     new SlimePediaEntryTranslation(ModdedIds.CARAMEL_APPLES).SetTitleTranslation("Caramel Apples").SetIntroTranslation("Intro TK").SetDescriptionTranslation("Description TK");
     PlortRegistry.AddPlortEntry(ModdedIds.MAPLE_PLORT, new ProgressDirector.ProgressType[] {
         ProgressDirector.ProgressType.UNLOCK_MOSS
     });
     DataModelRegistry.RegisterCustomActorModel(ModdedIds.MAPLE_SLIME, (long x, Identifiable.Id y, RegionRegistry.RegionSetId z, GameObject w) => new SlimeModel(x, y, z, w.transform));
     PediaRegistry.RegisterIdentifiableMapping(PediaDirector.Id.PLORTS, ModdedIds.MAPLE_PLORT);
     PediaRegistry.RegisterIdentifiableMapping(ModdedIds.MAPLE_SLIMES, ModdedIds.MAPLE_SLIME);
     PediaRegistry.RegisterIdentifiableMapping(ModdedIds.CARAMEL_APPLES, ModdedIds.CARAMEL_APPLE_FRUIT);
     PediaRegistry.SetPediaCategory(ModdedIds.MAPLE_SLIMES, PediaRegistry.PediaCategory.SLIMES);
     PediaRegistry.SetPediaCategory(ModdedIds.CARAMEL_APPLES, PediaRegistry.PediaCategory.RESOURCES);
 }