-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Add application/config/enable_uids project setting #81122
base: master
Are you sure you want to change the base?
Conversation
core/io/resource_uid.h
Outdated
|
||
static ResourceUID *get_singleton() { return singleton; } | ||
|
||
ResourceUID(); | ||
~ResourceUID(); | ||
}; | ||
|
||
class ResourceUIDDummy : public ResourceUID { | ||
GDCLASS(ResourceUIDDummy, ResourceUID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You haven't registered this class, without doing so it won't work, you need to use GDREGISTER_ABSTRACT_CLASS
like is done with ResourceUID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
Interesting that I ran into no issues while testing this, though I didn't try using ResourceUID
in GDScript.
Wonder if this case should be static_assert at compile time, similar to #81020.
Anyway, I've pushed an update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The opposite is impossible unfortunately, and there are many valid cases of not registering a class for when they aren't enabled
Edit: To clarify why I say it isn't possible:
With my changes to check at registration there's a well defined point of failure, when the class is registered, but doing the opposite isn't trivial, how do you define the point when a class hasn't been registered? Arguably you could create a solution having some large list of all classes that have been declared, but it'd be very complicated and would probably be hard or impossible to do without making every header file dependent on every other header file
bc1bc98
to
53a33ba
Compare
You need to document the method |
I was thinking, would it be preferable to modify |
It shouldn't check the setting every time, that would be too bad performance wise, but it could load the value on creation (as it is only changed on restart) and then use that value |
8b9cc63
to
b173008
Compare
Okay, I removed |
Closes: godotengine/godot-proposals#7195