Skip to content

Validate and display range in EditorInspectorArray resize dialog - #125823

Open
Chubercik wants to merge 1 commit into
godotengine:masterfrom
Chubercik:improve_array_resize_dialog
Open

Chubercik wants to merge 1 commit into
godotengine:masterfrom
Chubercik:improve_array_resize_dialog

Conversation

@Chubercik

Copy link
Copy Markdown
Contributor

This PR improves the Resize Array... dialog in EditorInspectorArray.

When a count-backed array property defines a PROPERTY_HINT_RANGE, the dialog applies its [min, max] bounds and displays the valid range (for example 1 - 8) next to the input. Invalid (non-integer, empty, or out-of-range) values disable the OK button instead of clamping or failing with an error. Not changing the value doesn't disable the OK button now - I find that more user-friendly, but I can go back on that change if you find it unnecessary.

I've also made it so that SpinBox's LineEdit text is updated before calling select_all(), fixing an issue where only the first digit was highlighted when resizing arrays of 10+ elements.


The main reason for this PR was to make some QoL changes when working with tilesets - Godot now computes and exposes the available atlas frame range (1..max) on AtlasTileProxyObject's animation_frames_count, so that the resize dialog knows how many frames fit in the atlas and displays that info to the user.

Godot 4.7 This PR
Godot 4.7 resize dialog This PR resize dialog

AI was used for navigating around Godot's codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants