Unwanted checkbox in conditional hiding of UPROPERTIES in the details panel

I have a class that encapsulates an array. The class itself offers the opportunity to overwrite certain variables of the elements in the array. When the overwrite bool is toggled on, I want to hide those variables in the array elements. I got all of this to work through a combination of EditCondition and PostEditChangeProperty:

On editing the bool (PostEditChangeProperty), I set a hidden bool (I tried both private and hidden through UPROPERTY specifier) on the type of the array elements. On that struct I have an EditCondition that hides the variables that are supposedly being overwritten. I’ve removed some irelevant code from the snippet.

UCLASS(BlueprintType)
class WWAATD_API UShopRecipe : public UPrimaryDataAsset
{
	GENERATED_BODY()

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Slot Recipe Overwrites")
	bool OverwriteSlotTiers = false;

private:
	void PostEditChangeProperty(struct FPropertyChangedEvent& e) override;
};

void UShopRecipe::PostEditChangeProperty(struct FPropertyChangedEvent& e)
{
	FName propertyName = (e.Property != NULL) ? e.Property->GetFName() : NAME_None;
	if (propertyName == GET_MEMBER_NAME_CHECKED(UShopRecipe, OverwriteSlotTiers))
	{
		for (FItemRecipe& itemRecipte : ShopSlotRecipes)
			for (FItemRange& itemRange : itemRecipte.ItemRanges)
				itemRange.HideTierProperties = OverwriteSlotTiers;
	}
	Super::PostEditChangeProperty(e);
}
USTRUCT(BlueprintType)
struct FItemRange
{
	GENERATED_BODY()

	// --- RARITY ---
	UPROPERTY(BlueprintReadWrite, meta = (EditCondition = "HideTierProperties==false", EditConditionHides))
	bool HideTierProperties = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (EditCondition = "HideTierProperties==false", EditConditionHides))
	bool BaseTierOnPlayerLevel = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ClampMin = 0, ClampMax = 4, UIMin = 0, UIMax = 4,
		EditCondition = "HideTierProperties==false&&BaseTierOnPlayerLevel==true", EditConditionHides))
	int TierVariance = 1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ClampMin = 0, ClampMax = 5, UIMin = 0, UIMax = 5,
		EditCondition = "HideTierProperties==false&&BaseTierOnPlayerLevel==false", EditConditionHides))
	int TierMin = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ClampMin = 0, ClampMax = 5, UIMin = 0, UIMax = 5,
		EditCondition = "HideTierProperties==false&&BaseTierOnPlayerLevel==false", EditConditionHides))
	int TierMax = 5;
};

It works exactly as intended, except for one weird anomaly. When OverwriteTierSlots is true, the tier variables on the array elements are hidden. However, when it is set to false, the tier variables are shown with a checked checkbox to the left of BaseTierOnPlayerLevel. When I uncheck it, the tier properties are hidden as well as the checkbox. Retoggling OverwriteTierSlots can make them appear again. How do I get rid of this checkbox/why is it there?

1 Like

Hi! This is a problem for me as well. On top of that, if the Boolean dictating whether it’s displayed is invisible then if you accidentally press that checkbox then that property is invisible forever!

Please fix this Unreal, let us hide that unwanted checkbox

Ah, I am not alone! Seems like a bug to me, would be nice if it got fixed!

UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(EditCondition="1==0",EditConditionHides))
	bool bDisplayMaterialField;

Hi! I find this workaround: where 1==0 won’t return true for obvious reasons. Hope this could help a little.

A bit late, but this thread is still at the top of my google results so leaving an answer for posterity.

You can remove that extra checkbox by adding “HideEditConditionToggle” to the meta specifiers of your property.

2 Likes