Appearance
Input and UI integration
Use one inventory model
For the owning player's UI, read containers and items through URicClientPredictedInventoryComponent. Render its copies and submit operations through the same component.
Keep item and container GUIDs in UI state. After synchronization, resolve current objects rather than continuing to use a stale item reference.
For a server-side debug view, direct manager/container queries are appropriate.
Subscription lifecycle
A widget should:
- Resolve its inventory model.
- Read initial state.
- Subscribe to container changes or synchronization.
- Re-resolve objects when notified.
- Unsubscribe when it closes or changes inventory.
Use OnSync, OnSyncContainer, or SubscribeToContainer(). For a direct view, use manager OnContainersChanged, OnSlotsChanged, and OnItemGameplayTagChanged.
Dynamic delegates need UFUNCTION() handlers with matching signatures. Remove only the widget's own bindings. Avoid clearing shared delegates used by other UI.
Updates can be deferred or debounced. Read current state in the callback and keep handlers safe if the selected item was removed.
Drag payload
The RicInput module supplies abstract URicDragPayload. Create a game-specific subclass:
cpp
#pragma once
#include "CoreMinimal.h"
#include "DragAndDrop/RicDragPayload.h"
#include "Statics/RicStatics.h"
#include "InventoryDragPayload.generated.h"
UCLASS()
class YOURGAME_API UInventoryDragPayload : public URicDragPayload
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite)
FGuid ItemID;
UPROPERTY(BlueprintReadWrite)
ERicRotation Rotation = ERicRotation::D0;
};Include DragAndDrop/RicDragAndDropHelperSubsystem.h and get the subsystem from the game instance:
cpp
URicDragAndDropHelperSubsystem* Drag =
GetGameInstance()->GetSubsystem<URicDragAndDropHelperSubsystem>();
UInventoryDragPayload* Payload =
NewObject<UInventoryDragPayload>(this);
Payload->ItemID = ItemCopy->GetID();
Drag->StartDrag(Payload);These statements belong in a UI object with a game instance; check subsystem and item validity in your integration.
Hover and drop
Resolve the payload's GUID to a current item copy. Find the destination copy and target slot from your widget geometry.
Use prediction GetDropAction() to show feedback. On release, call ProcessDrop(), then Drag->EndDrag(SlotIndex, Result) with the operation result. Ending a drag only broadcasts the drag outcome; it does not perform placement itself.
OnDragStarted and OnDragEnd drive your drag visual. Handle cancellation, removed items, invalid slots, and closing the inventory while dragging.
Context menus
ShowContextMenu() and CloseContextMenu() emit payload events. Your game creates and closes the actual menu widget.
Read URicItemFragmentActions::GetActionsCDO() to obtain configured action handlers. Use action visibility and availability hooks when building the menu, then execute through inventory prediction.
GetWidgetOfClassAtScreenPosition() supports class-based widget hit testing with blocking widget classes. Configure blockers for overlapping panels so a drop does not reach an inventory behind another UI.
Track input devices
URicInputSubsystem is a local-player subsystem:
cpp
#include "RicInputSubsystem.h"
#include "Engine/LocalPlayer.h"
URicInputSubsystem* Input = URicInputSubsystem::Get(LocalPlayer);
if (Input)
{
const ERicInputType Type = Input->GetCurrentInputType();
}Input types are MouseAndKeyboard, Gamepad, and Touch. Bind OnInputMethodChanged to update prompts. This subsystem tracks UI input; your game still supplies input actions and bindings.
Gamepad cursor
The cursor starts disabled. Enable it when inventory UI opens and disable it when returning to gameplay:
cpp
if (Input)
{
Input->SetGamepadCursorEnabled(true);
// On UI close: Input->SetGamepadCursorEnabled(false);
}Default behavior uses the left stick for cursor movement, the right stick for scrolling, and the configured digital click button for left mouse press/release.
Set per-player preferences:
cpp
FRicGamepadCursorSettings Settings = Input->GetGamepadCursorSettings();
Settings.CursorSpeed = 1000.f;
Settings.DeadZone = 0.25f;
Input->SetGamepadCursorSettings(Settings);Project defaults live under Project Settings → Plugins → Ric Gamepad Cursor. Defaults are speed 1200, dead zone 0.2, scroll speed 8, no inverted scroll, and the bottom face button for click. Settings are sanitized when applied.
Your game manages cursor visibility, focus, input mode, gameplay input suppression, and persistence of per-player preferences. GetSimulatedMouse() identifies gamepad-generated pointer routing so custom device detectors can ignore those events.