Modding/Inventory/Item menu builders

From SDG Wiki
Jump to navigation Jump to search


Several of the inventory item widgets are designed to very easily extendable and customizable:


All custom menu buildables share a function you should override called ShouldIncludeForItem. This determines whether your menu content is eligible for building details/actions/etc for an item instance.

When your menu buildable's Create and CreateWidget functions are called they receive an InBuilder parameter. You should use this to register your built menu contents. For example an action builder has BuildAction and BuildActionWidget functions allowing you to build as many or as few as you need.

At-A-Glance Synopses

At-a-glance overlays are shown on top of item icons to quickly convey critical information. For example the charge in a battery, or the amount of ammunition in a firearm or magazine:

File:UE4Editor 2018-02-26 17-52-49.png

You can create your own by subclassing UInventoryItemAtAGlanceMenu_SynopsisBase, and widget subclasses of UInventoryItemAtAGlanceMenu_SynopsisWidgetBase. For very advanced cases you can specify a custom UInventoryItemAtAGlanceMenu_Builder in your UInventoryItemDataAsset.

Context Actions

Action buttons are available when clicking on most items, and are also used to auto-perform some tasks such as dropping an item when you hold a specific key and click it. Some examples are equipping, dropping or inspecting an item:

File:UE4Editor 2018-02-26 17-53-01.png

You can create your own by subclassing UInventoryItemContextMenu_ActionBase. Most of the vanilla actions use ActionBase's helper function CreateDefaultActionWidget which creates a button with an icon and a label. For very advanced cases you can specify a custom UInventoryItemContextMenu_Builder in your UInventoryItemDataAsset.

  • Override CanPerform for actions which should still be shown as a hint of what can be done with them, but cannot currently be performed.
  • Your action's Perform method will be called when auto-performed or clicked in the menu.
  • Override CanAutoPerform to opt-in, and use a low sort order to get selected.

Sort Order

Sort order is used to rank each action's priority. The highest priority action (lowest number) is auto-performed in some cases. Use custom sort orders to insert your actions between others!

Vanilla Sort Orders
Sort Order Description
1000 Equip
1001 Dequip
5000 Pickup
5001 Drop
10000 Default

Inspector Details

Inspector details are used when inspecting the 3D preview of an item. They are for the extended information about your item like stats and lore, or can be used for extra options like whether a coat should be zipped or unzipped.

File:UE4Editor 2018-02-26 17-50-05.png

You can create your own by subclassing UInventoryItemInspectorMenu_DetailsBase. For simple text details you can use DetailsBase's helper function CreateTextDetailsWidget which adds a line of text like the item's description. For very advanced cases you can specify a custom UInventoryItemInspectorMenu_Builder in your UInventoryItemDataAsset.