/// <summary>Notifies the page handler that it's corresponding menu has been opened.</summary> /// <param name="menu">The native menu owning all the pages.</param> /// <param name="page">The specific page this handler is for.</param> /// <param name="inventory">The inventory handler.</param> public virtual void Open(IClickableMenu menu, IClickableMenu page, InventoryHandler inventory) { this.NativeMenu = menu; this.MenuPage = page as TPageType; this.Inventory = inventory; if (this.HasInventory) { InitInventory(); } }
/// <summary>Constructs and instance.</summary> /// <param name="helper">Mod helper instance.</param> /// <param name="monitor">Monitor instance.</param> public BaseMenuHandler(IModHelper helper, IMonitor monitor) { this.Helper = helper; this.Monitor = monitor; this.Inventory = new InventoryHandler(helper.Reflection, monitor); }
/// <summary>Tell the handler to close.</summary> public virtual void Close() { this.NativeMenu = null; this.MenuPage = null; this.Inventory = null; }