If used inside a UMG Blueprint, a struct that has only one element will remove the element from the struct after compiling the blueprint. If the element is edited or a second element is added then this does not occur.
This behavior is inconsistent with a struct inside an Actor blueprint where the element won't be removed on compile.
1. Open UE4Editor (code project)
2. In the Project.Build.cs file add UMG, Slate, and SlateCore modules
3. In Project.h add the following includes:
#include "Runtime/UMG/Public/UMG.h" #include "Runtime/UMG/Public/UMGStyle.h" #include "Runtime/UMG/Public/Slate/SObjectWidget.h" #include "Runtime/UMG/Public/IUMGModule.h" #include "Runtime/UMG/Public/Blueprint/UserWidget.h"
4. In the editor, use the new class wizard to create a class based on UserWidget (MyWidget)
5. In MyWidget.h add the following above the class declaration
UENUM(BlueprintType) enum class ELuaParameterType : uint8 { LFPT_Float UMETA(DisplayName = "Float"), LFPT_String UMETA(DisplayName = "String"), LFPT_Int32 UMETA(DisplayName = "Int32"), LFPT_Bool UMETA(DisplayName = "Bool"), }; USTRUCT() struct FLuaFunctionParameter { GENERATED_USTRUCT_BODY() UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function") ELuaParameterType type; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function") float floatValue; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function") int32 intValue; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function") FString stringValue; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function") bool boolValue; }; USTRUCT() struct FLuaFunctionStruct { GENERATED_USTRUCT_BODY() UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function") FString functionName; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function") FString memberObjectInstance; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function") TArray<FLuaFunctionParameter> parameters; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function") TArray<FLuaFunctionParameter> returnParameters; }; USTRUCT() struct FToolTipElementStruct { GENERATED_USTRUCT_BODY() UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Tool Tips") FLuaFunctionStruct Data; UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Tool Tips") FText TitleText; };
6. In the MyWidget.h class declaration, add the following:
public: UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Tool Tips") TArray<FToolTipElementStruct> ToolTipValues;
7. Compile the code
8. In the editor create 2 UserWidget Blueprints (DummyBP and TestBP)
9. In DummyBP, File->Reparent Blueprint->MyWidget and compile
10. in TestBP, find DummyBP in the Palette and add it to the Designer
11. With DummyBP selected find the Tool Tips section in the details panel and press the + to add an element to Tool Tip Values array
12. Compile the blueprint
Result:
The element added to the array will be removed after the compile.
Expected:
Array elements are not cleared after compile.
i have this problem UE4CC-Windows-58DC12AF4B97F057BD108FBFF569B2E9_0000
UE-81742 DXGI_ERROR_INVALID_CALL
Delay nodes occasionally don't fire the "Completed" output in a nativized build
I am not able to find world outliner how to enable it?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.9.2 |
Target Fix | 4.11 |
Created | Oct 7, 2015 |
---|---|
Resolved | Oct 29, 2015 |
Updated | Apr 27, 2018 |