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

Reverting exported values broken on tool scripts #66791

Closed
BanchouBoo opened this issue Oct 2, 2022 · 6 comments
Closed

Reverting exported values broken on tool scripts #66791

BanchouBoo opened this issue Oct 2, 2022 · 6 comments

Comments

@BanchouBoo
Copy link

Godot version

4.0.beta2.official.f8745f2f7

System information

Void Linux

Issue description

On tool scripts for resources, the revert button for exported variables doesn't appear, and on tool scripts for nodes in a scene, it only appears after saving and reloading that inspector (and then it doesn't go away even when you revert the value)

Steps to reproduce

@tool
extends Resource

@export var test: float = 0
@tool
extends Node2D

@export var test: float = 12

Minimal reproduction project

tool_export_test.zip

@adamscott
Copy link
Member

Verified by @KoBeWi and me. We could reproduce.

@idomo1
Copy link

idomo1 commented Oct 8, 2022

Looks like this is happening because the default value is being stored as an int

@export var test: float = 12 // Broken

If you change this to a float it works as expected:

@export var test: float = 12. // Working

Not sure whether it's intended that casting would happen here or a syntax error
Without the tools decorator it does seem to cast, so that's probably what's expected

@BanchouBoo
Copy link
Author

Looks like this is happening because the default value is being stored as an int

@export var test: float = 12 // Broken

If you change this to a float it works as expected:

@export var test: float = 12. // Working

Not sure whether it's intended that casting would happen here or a syntax error Without the tools decorator it does seem to cast, so that's probably what's expected

This fixes the (and then it doesn't go away even when you revert the value) part, but the rest of the problems are still there.

@idomo1
Copy link

idomo1 commented Dec 18, 2022

The (and then it doesn't go away even when you revert the value) part has been fixed by #69416. The rest of the issue is still valid.

@dalexeev
Copy link
Member

dalexeev commented Feb 11, 2023

Related/duplicate of:

@vnen vnen modified the milestones: 4.0, 4.1 Feb 20, 2023
@akien-mga
Copy link
Member

Consolidating in #62363.

@github-project-automation github-project-automation bot moved this from Todo to Done in 4.x Priority Issues Jun 22, 2023
@akien-mga akien-mga modified the milestones: 4.1, 4.x Jun 22, 2023
@YuriSizov YuriSizov removed this from the 4.x milestone Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

8 participants