I’m having a minor nuisance. I got my FName property type customization working… mostly.
Essentially, what I wanted to do was just to check if the Name already exists elsewhere when entering my own. This is useful for what we’re doing because we have a table of Names, and want to make sure we’ve correctly typed the name when referencing it elsewhere.
Now I am able to test if the Name I’m typing exists already, but the problem is that when I save the value the value is added to the table of names. Thus, I’m no longer testing if the name exists elsewhere…
To recap:
- I want to define a Name variable someplace in blueprints.
- We want to check whether or not this Name already exists when typing.
- Upon completing my entry, the Name is added to the table, and our test above always returns a match - itself.
Here’s how I’m testing for an already existing entry:
if (FName(*NewText.ToString(), FNAME_Find) == NAME_None)
{
bUniqueName = true;
}
else
{
bUniqueName = false;
}
And this is simply reflected here…
if(bUniqueName)
{
return FText::FromString(TEXT("!="));
}
else
{
return FText::FromString(TEXT("=="));
}
I.e if I write “MachineIsPowered” - a name I know matches - I get a match. So that’s good! If I write “MachineIsPowerede” I no longer get a match… until I hit enter, upon which “MachineIsPowerede” is now an entry that I can match on…