Beispiel #1
0
        //Here we add both every item in this mod to a single custom sorting group, as well as add an existing item, the copper shortsword, to a vanilla sorting group.
        //These can be interchanged, modded items can go in vanilla sorting groups and vice versa.
        public override void ModifyResearchSorting(Item item, ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
        {
            if (item.ModItem?.Mod == Mod)
            {
                itemGroup = (ContentSamples.CreativeHelper.ItemGroup) 1337;                //This number is where the item sort is in relation to any other sorts added by vanilla or mods; 1337 set here is in between the Critters and Keys sorts. To know where your custom group relates to the vanilla sorting numbers, refer to the vanilla ItemGroup class, which you can easily get to by pressing f12 if using Visual Studio.
            }

            if (item.type == ItemID.CopperShortsword)
            {
                itemGroup = ContentSamples.CreativeHelper.ItemGroup.EventItem;                 //Changed the copper shortsword's default sorting to be with the event items instead of melee weapons.
                //Vanilla already has many default research sorting groups that you can add your item into. It is usually done automatically with a few exceptions. For an example of an exception, refer to the ExampleTorch file.
            }
        }
Beispiel #2
0
 /// <summary>
 /// Allows you to set an item's sorting group in Journey Mode's duplication menu. This is useful for setting custom item types that group well together, or whenever the default vanilla sorting doesn't sort the way you want it.
 /// </summary>
 /// <param name="item">The item being used</param>
 /// <param name="itemGroup">The item group this item is being assigned to</param>
 public virtual void ModifyResearchSorting(Item item, ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
 {
 }
Beispiel #3
0
 public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) //Overrides the default sorting method of this Item.
 {
     itemGroup = ContentSamples.CreativeHelper.ItemGroup.Torches;                                  //Vanilla usually matches sorting methods with the right type of item, but sometimes, like with torches, it doesn't. Make sure to set whichever items manually if need be.
 }