Skip to content

Skip zero values in EditorPropertyFlags#115351

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
kleonc:editor_property_flags_skip_zero_values
Jan 26, 2026
Merged

Skip zero values in EditorPropertyFlags#115351
Repiteo merged 1 commit into
godotengine:masterfrom
kleonc:editor_property_flags_skip_zero_values

Conversation

@kleonc

@kleonc kleonc commented Jan 25, 2026

Copy link
Copy Markdown
Member

This PR makes the EditorPropertyFlags not create a checkbox for enum entries with zero value, like None = 0. Such created checkboxes were broken / not usable before anyway.

Resolves godotengine/godot-proposals#14023.

Note the above proposal is about C#, but the issue is not C# specific. In GDScript, @export_flags indeed prevents adding 0 value arguments:

Godot_v4 6-rc2_win64_KXclF3Nl6F

but it could still be added manually e.g. using _validate_property:

@tool
extends Node

@export_flags("First:1", "Second:2", "Third:4") var flags: int = 0

func _validate_property(property: Dictionary) -> void:
	if property.name == "flags":
		property.hint_string += ",None:0"

Result for the script above:

Before
v4.6.rc2.official [78c6632]
After
this PR
Godot_v4 6-rc2_win64_hgCyet6WoW godot windows editor dev x86_64_P2yELM3gTW
@KoBeWi KoBeWi modified the milestones: 4.x, 4.7 Jan 25, 2026
@Repiteo Repiteo merged commit 1387e0c into godotengine:master Jan 26, 2026
20 checks passed
@Repiteo

Repiteo commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@kleonc kleonc deleted the editor_property_flags_skip_zero_values branch January 27, 2026 04:16
rivie13 pushed a commit to rivie13/Phoenix-Agentic-Engine that referenced this pull request Feb 16, 2026
…gs_skip_zero_values

Skip zero values in `EditorPropertyFlags`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment