Fixed enum to wrong string cause by misuse GetNameStringByValue and GetNameStringByIndex

This commit is contained in:
julee 2021-10-29 10:51:14 +08:00
parent 6ed174b72d
commit 409ceece3d
3 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ static FString PropSizeTypeToString(EPropSize PropSizeType)
{
return FString("unknown");
}
return ptr->GetNameStringByIndex(static_cast<int32>(PropSizeType));
return ptr->GetNameStringByValue(static_cast<int32>(PropSizeType));
}
static EPropSize StringToPropSizeType(FString PropSize)

View File

@ -26,5 +26,5 @@ FString CityMapMeshTag::ToString(ECityMapMeshTag Tag)
const UEnum* ptr = FindObject<UEnum>(ANY_PACKAGE, TEXT("ECityMapMeshTag"), true);
if(!ptr)
return FString("Invalid");
return ptr->GetNameStringByIndex(static_cast<int32>(Tag));
return ptr->GetNameStringByValue(static_cast<int32>(Tag));
}

View File

@ -57,7 +57,7 @@ FString QualityLevelToString(EQualityLevel QualitySettingsLevel)
{
return FString("Invalid");
}
return ptr->GetNameStringByIndex(static_cast<int32>(QualitySettingsLevel));
return ptr->GetNameStringByValue(static_cast<int32>(QualitySettingsLevel));
}
static void LoadSettingsFromConfig(