Modding/Inventory/Item menu builders

From SDG Wiki
< Modding‎ | Inventory
Revision as of 23:27, 26 February 2018 by User (talk | contribs) (Sort Order)
Jump to: navigation, search

Template:Ambox/Documentation

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

Common

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 a 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.

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're 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.