Guest User

Untitled

a guest
Jul 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include "CoreMinimal.h"
  4. #include "Runtime/CoreUObject/Public/Templates/Casts.h"
  5. #include "Runtime/Engine/Classes/Materials/MaterialLayersFunctions.h"
  6. #include "Runtime/Engine/Classes/Materials/MaterialInterface.h"
  7.  
  8. #include "UmgInventoryUtilitiesTypes.generated.h"
  9.  
  10. USTRUCT(BlueprintType)
  11. struct FInventoryExposedMaterialParameter
  12. {
  13. GENERATED_BODY()
  14.  
  15. public:
  16.  
  17. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  18. FName Name;
  19.  
  20. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  21. FName FriendlyName;
  22. };
  23.  
  24. USTRUCT(BlueprintType)
  25. struct FMaterialVectorParameterInfoValue
  26. {
  27. GENERATED_BODY()
  28.  
  29. public:
  30.  
  31. UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
  32. FMaterialParameterInfo ParameterInfo;
  33.  
  34. UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
  35. FLinearColor Value;
  36. };
  37.  
  38. USTRUCT(BlueprintType)
  39. struct FMaterialScalarParameterInfoValue
  40. {
  41. GENERATED_BODY()
  42.  
  43. public:
  44.  
  45. UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
  46. FMaterialParameterInfo ParameterInfo;
  47.  
  48. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  49. float Value;
  50. };
  51.  
  52. USTRUCT(BlueprintType)
  53. struct FMaterialParameterInfoValueCollection
  54. {
  55. GENERATED_BODY()
  56.  
  57. public:
  58.  
  59. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  60. TArray<FMaterialScalarParameterInfoValue> MaterialScalarParameterInfoValues;
  61.  
  62. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  63. TArray<FMaterialVectorParameterInfoValue> MaterialVectorParameterInfoValues;
  64. };
  65.  
  66. USTRUCT(BlueprintType)
  67. struct FMaterialSettings
  68. {
  69. GENERATED_BODY()
  70.  
  71. public:
  72.  
  73. UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
  74. FName SlotName;
  75.  
  76. UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
  77. class UMaterialInterface* Material;
  78.  
  79. UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
  80. FMaterialParameterInfoValueCollection MaterialParamaterInfoValueCollection;
  81.  
  82. };
  83.  
  84. USTRUCT(BlueprintType)
  85. struct FItemMaterialInformation
  86. {
  87. GENERATED_BODY()
  88.  
  89. public:
  90.  
  91. UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
  92. TMap<FName, FMaterialSettings> SlotToMaterialParameterInfoValueCollection;
  93. };
  94.  
  95. USTRUCT(BlueprintType)
  96. struct FEquippableItemBaseData
  97. {
  98. GENERATED_BODY()
  99.  
  100. public:
  101.  
  102. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  103. FGuid Id;
  104.  
  105. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  106. FString Name;
  107.  
  108. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  109. FName Slot;
  110.  
  111. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  112. FName ParentSocket;
  113.  
  114. UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
  115. bool bIsEquipped;
  116.  
  117. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  118. class UTexture2D* ItemPreviewTexture;
  119.  
  120. FEquippableItemBaseData() :
  121. Id(FGuid::NewGuid()),
  122. Name(FString("")),
  123. Slot(FName::FName()),
  124. ParentSocket(FName::FName()),
  125. bIsEquipped(false),
  126. ItemPreviewTexture(nullptr)
  127. {};
  128.  
  129. };
  130.  
  131. USTRUCT(BlueprintType)
  132. struct FEquippableSkeletalMeshData : public FEquippableItemBaseData
  133. {
  134. GENERATED_BODY()
  135.  
  136. public:
  137.  
  138. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  139. class USkeletalMesh* Mesh;
  140.  
  141. FEquippableSkeletalMeshData() :
  142. Mesh(nullptr)
  143. {};
  144.  
  145. };
  146.  
  147. USTRUCT(BlueprintType)
  148. struct FEquippableActorData : public FEquippableItemBaseData
  149. {
  150. GENERATED_BODY()
  151.  
  152. public:
  153.  
  154. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  155. TSubclassOf<AActor> ActorClass;
  156.  
  157. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  158. class UAnimSequence* EquipAdditiveAnimation;
  159.  
  160. FEquippableActorData() :
  161. ActorClass(nullptr),
  162. EquipAdditiveAnimation(nullptr)
  163. {};
  164.  
  165. };
  166.  
  167. UCLASS(BlueprintType)
  168. class UMGINVENTORYUTILITIES_API UEquippableItemBase : public UObject
  169. {
  170. GENERATED_BODY()
  171.  
  172. public:
  173.  
  174. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  175. FGuid Id;
  176.  
  177. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  178. FString Name;
  179.  
  180. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  181. FName Slot;
  182.  
  183. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  184. FName ParentSocket;
  185.  
  186. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  187. bool bIsEquipped;
  188.  
  189. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  190. class UTexture2D* ItemPreviewTexture;
  191.  
  192. UFUNCTION(BlueprintCallable)
  193. void InitFromData(FEquippableItemBaseData Data)
  194. {
  195. Id = Data.Id;
  196. Name = Data.Name;
  197. Slot = Data.Slot;
  198. ParentSocket = Data.ParentSocket;
  199. bIsEquipped = Data.bIsEquipped;
  200. ItemPreviewTexture = Data.ItemPreviewTexture;
  201. };
  202.  
  203. };
  204.  
  205. UCLASS(BlueprintType)
  206. class UMGINVENTORYUTILITIES_API UEquippableSkeletalMesh : public UEquippableItemBase
  207. {
  208. GENERATED_BODY()
  209.  
  210. public:
  211.  
  212. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  213. class USkeletalMesh* Mesh;
  214.  
  215. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  216. class USkeletalMeshComponent* MeshComponent;
  217.  
  218. UFUNCTION(BlueprintCallable)
  219. void InitFromData(FEquippableSkeletalMeshData Data)
  220. {
  221. Id = Data.Id;
  222. Name = Data.Name;
  223. Slot = Data.Slot;
  224. ParentSocket = Data.ParentSocket;
  225. bIsEquipped = Data.bIsEquipped;
  226. ItemPreviewTexture = Data.ItemPreviewTexture;
  227. Mesh = Data.Mesh;
  228. MeshComponent = nullptr;
  229. };
  230.  
  231. };
  232.  
  233. UCLASS(BlueprintType)
  234. class UMGINVENTORYUTILITIES_API UEquippableActor : public UEquippableItemBase
  235. {
  236. GENERATED_BODY()
  237.  
  238. public:
  239.  
  240. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  241. TSubclassOf<AActor> ActorClass;
  242.  
  243. UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
  244. AActor *Actor;
  245.  
  246. UPROPERTY(EditAnywhere, BlueprintReadWrite)
  247. class UAnimSequence* EquipAdditiveAnimation;
  248.  
  249. UFUNCTION(BlueprintCallable)
  250. void InitFromData(FEquippableActorData Data)
  251. {
  252. Id = Data.Id;
  253. Name = Data.Name;
  254. Slot = Data.Slot;
  255. ParentSocket = Data.ParentSocket;
  256. bIsEquipped = Data.bIsEquipped;
  257. ItemPreviewTexture = Data.ItemPreviewTexture;
  258. ActorClass = Data.ActorClass;
  259. EquipAdditiveAnimation = Data.EquipAdditiveAnimation;
  260. Actor = nullptr;
  261. };
  262.  
  263. };
  264.  
  265. USTRUCT(BlueprintType)
  266. struct FInventoryMaterialItem
  267. {
  268. GENERATED_BODY()
  269.  
  270. public:
  271. FName Name;
  272. FName Type;
  273. class UTexture2D *PreviewImage;
  274. };
Add Comment
Please, Sign In to add comment