Show / Hide Table of Contents

Class ItemManager

Manager for handling all custom data added to the game related to items.
Inheritance
object
ItemManager
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Jotunn.Managers
Assembly: Jotunn.dll
Syntax
public class ItemManager

Properties

Name Description
Instance The singleton instance of this manager.

Methods

Name Description
AddItem(CustomItem) Add a CustomItem to the game.
Checks if the custom item is valid and unique and adds it to the list of custom items.
Also adds the prefab of the custom item to the PrefabManager.
Custom items are added to the current ObjectDB on every ObjectDB.Awake.
AddItemConversion(CustomItemConversion) Add a new item conversion
AddRecipe(CustomRecipe) Add a CustomRecipe to the game.
Checks if the custom recipe is unique and adds it to the list of custom recipes.
Custom recipes are added to the current ObjectDB on every ObjectDB.Awake.
AddRecipesFromJson(string) Adds recipes defined in a JSON file at given path, relative to BepInEx/plugins
AddStatusEffect(CustomStatusEffect) Add a CustomStatusEffect to the game.
Checks if the custom status effect is unique and adds it to the list of custom status effects.
Custom status effects are added to the current ObjectDB on every ObjectDB.Awake.
GetItem(string) Get a custom item by its name.
GetRecipe(string) Get a custom recipe by its name.
RegisterItemInObjectDB(GameObject) Register a single item in the current ObjectDB. Also adds the prefab to the PrefabManager and ZNetScene if necessary.
No mock references are fixed.
RemoveItem(CustomItem) Remove a custom item by its ref. Removes the custom recipe, too.
RemoveItem(string) Remove a custom item by its name. Removes the custom recipe, too.
RemoveItemConversion(CustomItemConversion) Remove an item conversion
RemoveRecipe(CustomRecipe) Remove a custom recipe by its ref. Removes it from the manager and the ObjectDB, if instantiated.
RemoveRecipe(string) Remove a custom recipe by its name. Removes it from the manager and the ObjectDB, if instantiated.

Events

Name Description
OnItemsRegistered Event that gets fired after all items were added to the ObjectDB. Your code will execute every time a new ObjectDB is created (on every game start). If you want to execute just once you will need to unregister from the event after execution.
OnItemsRegisteredFejd Event that gets fired after all items were added to the ObjectDB on the FejdStartup screen. Your code will execute every time a new ObjectDB is copied (on every menu start). If you want to execute just once you will need to unregister from the event after execution.

Extension Methods

PrefabExtension.FixReferences(object)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾