Inventory UI

The module PulseInventoryUI adds a hotbar and item tooltips to the HUD. It reads the equipment of the player (UPulseEquipmentComponent, see Equipment) and, if present, cooldowns of consumables from PulseInventoryEffects (Item effects). The inventory modules themselves have no UI code.

At a glance

  1. Give the player a UPulseEquipmentComponent with hotbar slots (Pulse.Equipment.Hotbar.*).
  2. The default HUD layout W_DefaultHUDWidget already contains W_DefaultHotbar (bottom center). It hides itself while the player has no equipment.
  3. Equip items into hotbar slots. The hotbar shows icon, count, slot number, the active slot, cooldowns and wear; clicking a slot selects it (RequestSelectHotbarSlot), hovering or focusing it shows the item tooltip.

Hotbar

Class What it does
UMVVMPulseHotbar View model of the owning player’s hotbar: one slot view model per hotbar slot of the equipment (in the order of Slots), plus empty slots up to MinSlotCount. Follows pawn changes, equipment changes and cooldowns. BindToPlayer, Unbind, Refresh, SelectSlot, GetSlots, field ActiveSlotIndex.
UMVVMPulseItemSlot One slot: SlotTag, SlotIndex, Definition, DisplayName, Icon, StackCount, bHasItem, bIsActive, CooldownFraction, CooldownRemaining, DurabilityPercent, bHasDurability (all FieldNotify).
UPulseHotbarWidget Creates one SlotClass widget per slot in the bound panel SlotPanel. MinSlotCount (default 8), bHideWithoutEquipment, designer preview PreviewSlotCount.
UPulseHotbarSlotWidget A CommonUI button. Optional bound widgets: IconImage, CountText, KeyCap (Pulse Key Cap with the key of SlotKeys), KeyText (slot number), CooldownImage (image with a material that takes CooldownParameter, e.g. M_PulseUI_RadialWipe), CooldownText, ActiveFrame, DurabilityBar. bShowTooltip, bHideSingleCount.

Cooldowns are read from the cooldown effects (Pulse.Item.Cooldown.* tags of FPulseItemTrait_Consumable) on the ability system of the player’s pawn or player state, so they also show on clients. The view model only ticks while the equipment is still missing or a slot has a cooldown group (CooldownUpdateInterval).

Default widgets in /PulseCore/Inventory/UI/: W_DefaultHotbar (panel role Pulse.UI.Panel.HUD), W_DefaultHotbarSlot (76 x 76 inset slot, number top left, count bottom right, dark radial wipe with the seconds left, glowing accent frame on the active slot), button style BS_PulseHotbarSlot.

Item tooltip

UPulseItemTooltipWidget is a HUD tooltip (UPulseHUDTooltipWidget) for items. Make Item Tooltip Data (Definition, instance traits, stack count) builds the tooltip data with the payload FPulseItemTooltipPayload and the widget class of the settings; show it with UPulseHUDSubsystem::ShowTooltip. Hotbar slots do this by themselves.

It shows the rarity in its color (RarityText), the name (TitleText), a stat grid (StatsPanel, one StatRowClass widget per row, StatsDivider hidden without rows) and the description (MessageText). Rows come from tooltip sections in the settings, in order:

Section Rows
FPulseItemTooltipSection_Consumable Healing, use time, cooldown
FPulseItemTooltipSection_EquippedStats Stats while equipped (FPulseItemTrait_EquippedStats)
FPulseItemTooltipSection_RolledStats Rolled stats of the instance (FPulseItemTrait_RolledStats), value color role configurable
FPulseItemTooltipSection_Durability “80 / 100”, warning color below LowFraction, negative when broken

Own rows: derive a struct from FPulseItemTooltipSection, override AddRows(Context, Rows) (read traits with Context.FindTrait<T>(), the instance’s trait first) and add it to TooltipSections. A row is FPulseItemTooltipRow (Label, Value, ValueColorRole). Pure helpers in Pulse::InventoryUI: BuildTooltipRows, FormatStatValue, GetStatName, GetItemRarity, GetCooldownFraction, GetHotbarSlots (specs: PulseInventoryUI).

Default widgets: W_DefaultItemTooltip, W_DefaultItemStatRow.

Rarity names and colors

The tooltip shows the rarity (Pulse.Rarity.*) with a name and color from the UI theme. The theme extension /PulseCore/Inventory/UI/DA_PulseInventory_RarityTheme of PulseInventoryUI adds them to every theme: a text per rarity (Common, Uncommon, Rare, Epic, Legendary) and an alias to a color role (common = muted, uncommon = positive, rare = accent, epic = highlight, legendary = warning). Change them in your theme (its values win over extensions) or add rarities with an extension of your own (see the UI themes page of the Pulse Foundation docs). A rarity without a name in the theme shows no rarity line. Pulse::InventoryUI::GetRarityName and GetRarityColor read them in C++.

Settings (UPulseInventoryUISettings, Project Settings > Pulse > Core > Inventory UI)

Setting Meaning
ItemTooltipClass Tooltip widget of items (default W_DefaultItemTooltip).
TooltipSections Sections of the stat grid (default: consumable, equipped stats, rolled stats, durability).
StatDisplays Name, percent sign, decimals and sign per stat tag (Pulse.Stat.*); stats without entry show the last part of their tag.
CooldownUpdateInterval Seconds between two cooldown updates while one runs.

Cheats

Cheat Does
PulseInventoryUITooltip <item> [seed] Shows the tooltip of an item definition at the mouse (seed: rolls its random stats), again hides it.

To try the hotbar: PulseCombatInventorySetup, PulseInventoryGive DA_PulseExample_Potion 4, PulseInventoryEquip DA_PulseExample_Potion Pulse.Equipment.Hotbar.2, PulseInventoryUse DA_PulseExample_Potion (the example items in /PulseCore/Combat/Examples have icons).


PulseCore plugin documentation.

This site uses Just the Docs, a documentation theme for Jekyll.