yql0105
(yql0105)
1
For example, I create an enum as:
UENUM(BlueprintType)
enum ETest
{
Test_1,
Test_2,
Test_3,
Test_MAX
};
And I add a variable as:
UPROPERTY(EditAnywhere)
int32 Test[Test_MAX];
After compiling, I open the editor, Find the blueprint, I see
Before 4.26:
Test 3 Array elements
Test_1 0
Test_2 0
Test_3 0
In 4.26:
Test 3 Array elements
0 0
1 0
2 0
Fraps2020
(Fraps2020)
2
Hi Yql0105,
the behavior you display is expected, you’re just defining an Array with TEST_MAX number of elements.
Re: enum, first of all, use metatags!:
UENUM()
enum ETest
{
Test_1 UMETA(DisplayName = "Test_1"),
Test_2 UMETA(DisplayName = "Test_2"),
Test_3 UMETA(DisplayName = "Test_3")
};
Secondly, if you want to define a variable as a Enum, this is the correct way of doing it:
UPROPERTY()
TEnumAsByte<ETest> myEnumVariable;
From here this should achieve what I understand you want to achieve:
UPROPERTY()
TEnumAsByte<ETest> myEnumArray[MAX_ITEMs];
or even better, define that as a TArray!
Hope that helps,
f
There was a change in FItemPropertyNode that caused this behavior to change.
Thankfully it’s straight forward to restore. In FItemPropertyNode::GetDisplayName() around line 572 simply change this
if (FinalDisplayName.IsEmpty())
{
FinalDisplayName = FText::AsNumber(GetArrayIndex());
}
to this
if (FinalDisplayName.IsEmpty())
{
FinalDisplayName = FText::AsNumber(GetArrayIndex());
if (ArraySizeEnum != nullptr)
{
FinalDisplayName = ArraySizeEnum->GetDisplayNameTextByIndex(GetArrayIndex());
}
}
Oliver.
Tefel
(Tefel)
4
Oh thanks! Hope this is going to be fixed in 4.26.1!