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

Enum Export Variable breaks Resource in inspector after restart #52140

Open
NathanaelMangold opened this issue Aug 26, 2021 · 3 comments
Open

Comments

@NathanaelMangold
Copy link

Godot version

3.3.2.stable.mono

System information

Windows 10

Issue description

I am trying to create a "public" enum that is accessible in multiple scripts.
Therefore I created a script "Enums.gd"

This contains my Enum I want to use in different other scripts

enum StoryTriggerCondition {
	default,
	pickup_coin,
	kill_chilli,
	talk_to_B_urrito,
	talk_to_Patua_Pechos,
}

I e.g. use it in my "StoryBlock.gd" Script and preload it like this:

extends Resource
class_name StoryBlock

const ENUMS = preload("res://Scripts/Enums.gd")

export(Array, ENUMS.StoryTriggerCondition) var conditions

If I then create a instance of my Resource it works as I expect it to do:
image
image

However,after restarting the Editor it looks like this:
image

The fix is to force reload the depending "StoryBlock.gd" Script like this:
k1MOAeFmun

Steps to reproduce

As described above. I have stripped down my project as far as I could before it stops working. I really can't tell what the issue is with it.
IssueProject.zip

Minimal reproduction project

I created a minimal "reproduction" project. However in that it is working without any issues. I can't tell where the issue is coming from.
ResourceIssue.zip

@Calinou

This comment has been minimized.

@neikeq
Copy link
Contributor

neikeq commented Nov 9, 2021

Is the topic:mono label correct? This seems unrelated to C#.

@NathanaelMangold
Copy link
Author

It's a problem with GDScript. Nothing to do with mono or the mono version of the editor.

@akien-mga akien-mga modified the milestones: 3.4, 3.x Jul 3, 2022
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

4 participants