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

Preloaded enums do not automatically update to latest version #23103

Open
ghost opened this issue Oct 18, 2018 · 6 comments
Open

Preloaded enums do not automatically update to latest version #23103

ghost opened this issue Oct 18, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Oct 18, 2018

Godot version:

b550f93

OS/device including version:

Linux

Issue description:

Consider the following situation:

#scriptA.gd
enum MyEnum{
    ValueA,
    ValueB
}
...
#scriptB.gd
const ScriptA := preload("res://scriptA.gd")
export(ScriptA.MyEnum) var myEnum := 0

Everything is fine so far; your enum will appear in the inspector, and you can assign it to ValueA and ValueB.

However, you modify your enum later:

enum MyEnum{
    ValueA,
    ValueB,
    ValueC
}

myEnum can still only be assigned to ValueA or ValueB, ValueC does not appear. To trigger it to update, you must do any of the following:

  1. Comment out the line that preloads, save, then uncomment, and save
  2. Comment out the export, save, then uncomment, and save
  3. Restart the editor

Ideally, saving the enum would trigger a reload for anything referencing it.

I assumed this was the case for anything that has been preloaded, but I tried it with a custom resource, and it seemed to show the updated version.

@ghost
Copy link

ghost commented Dec 5, 2018

Confirmed in 99640ac.

For me at least, I only need to comment out the preloading line, save, and then remove the comment and it seems to trigger the refresh.

@KoBeWi
Copy link
Member

KoBeWi commented Jun 29, 2020

Still valid in 3.2.2

For me the enum didn't appear in the inspector until I added another export variable, which refreshed the inspector. Same with updating the enum values. What's weird, reloading scene doesn't help.

@yhwhey
Copy link

yhwhey commented Oct 11, 2022

Still an issue in Godot 4.0b2

@Dante3085
Copy link

Still an issue in v4.0.beta13.official [caacade].

@elvisish
Copy link

Still valid in 3.2.2

For me the enum didn't appear in the inspector until I added another export variable, which refreshed the inspector. Same with updating the enum values. What's weird, reloading scene doesn't help.

This is still useful in 3.5, just adding a new export var (then deleting if you want to) refreshes the preloaded enum.

@Invertex
Copy link
Contributor

Invertex commented Nov 11, 2023

Still seems to be an issue in 4.2 beta 5.
Not personally experienced enough with the Engine code to even know where to begin looking at solving this issue though.

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

No branches or pull requests

6 participants