Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing EditorSpinSlider values with arrow keys does not respect tool script setters #54287

Closed
Razoric480 opened this issue Oct 26, 2021 · 0 comments · Fixed by #54288
Closed

Comments

@Razoric480
Copy link
Contributor

Razoric480 commented Oct 26, 2021

Godot version

3.3.stable, 4.0dev 8c162f4

System information

Windows 10

Issue description

When changing the value of the editor spin slider using the arrow keys UP and DOWN on a value that gets modified by a tool script setter (I.E. clamped), the text value of the spin slider is left in its pre-script value and not properly updated.

This is because setters are called in the next idle frame, not immediately after setting the value, so we need to wait until NOTIFICATION_PROCESS before updating the text. As mentioned in #53090 (comment)

Steps to reproduce

@tool
extends Node

@export
var some_num := 1:
	get:
		return some_num
	set(value):
		some_num = clamp(value, 0, 1)

or 3.x

extends Node
tool

export var some_num := 1 setget _set_some_num

func _set_some_num(value):
	some_num = clamp(value, 0, 1)

138942439-b0488799-5668-4e3a-a8ef-b81b18c55110

Minimal reproduction project

No response

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

Successfully merging a pull request may close this issue.

2 participants