Server-authoritative, data-driven item/inventory/interaction/carry/equipment/ world-slot/placement/crafting framework. 8 modules, compiles against UE 5.7. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32 lines
1.3 KiB
C++
32 lines
1.3 KiB
C++
// Copyright ExByte Studios. Item Interaction Ecosystem.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "ItemInteractionComponent.h"
|
|
#include "WorldInteractionComponent.generated.h"
|
|
|
|
/**
|
|
* The interaction executor to put on a player pawn in a project that uses the
|
|
* world modules. Extends the base with the modes that need ItemWorld types:
|
|
* carry, drop-held, equip, install/remove from world slots, and drop-from-inventory
|
|
* (stages 6-8). Keeps ItemInteraction free of any ItemWorld dependency.
|
|
*/
|
|
UCLASS(ClassGroup = (Interaction), meta = (BlueprintSpawnableComponent))
|
|
class ITEMWORLD_API UWorldInteractionComponent : public UItemInteractionComponent
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
protected:
|
|
virtual bool ExecuteAuthorized(const FInteractionContext& Context, const FInteractionOption& Option, const FInteractionRequest& Request) override;
|
|
virtual bool HandleDropFromInventory(FGuid InstanceId) override;
|
|
|
|
private:
|
|
bool ExecuteCarry(const FInteractionContext& Context, bool bPhysics);
|
|
bool ExecuteDropHeld(const FInteractionContext& Context);
|
|
bool ExecuteInstall(const FInteractionContext& Context);
|
|
bool ExecuteEquip(const FInteractionContext& Context, const FInteractionRequest& Request);
|
|
bool ExecuteUseHeldOnTarget(const FInteractionContext& Context, const FInteractionOption& Option);
|
|
bool ExecuteRemoveFromSlot(const FInteractionContext& Context);
|
|
};
|