You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Disallow Callable, Signal and RID in export arrays
This commit is contained in:
@@ -478,6 +478,11 @@ void EditorPropertyArray::_notification(int p_what) {
|
|||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
change_type->clear();
|
change_type->clear();
|
||||||
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
||||||
|
if (i == Variant::CALLABLE || i == Variant::SIGNAL || i == Variant::RID) {
|
||||||
|
// These types can't be constructed or serialized properly, so skip them.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
String type = Variant::get_type_name(Variant::Type(i));
|
String type = Variant::get_type_name(Variant::Type(i));
|
||||||
change_type->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
|
change_type->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
|
||||||
}
|
}
|
||||||
@@ -1127,6 +1132,11 @@ void EditorPropertyDictionary::_notification(int p_what) {
|
|||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
change_type->clear();
|
change_type->clear();
|
||||||
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
||||||
|
if (i == Variant::CALLABLE || i == Variant::SIGNAL || i == Variant::RID) {
|
||||||
|
// These types can't be constructed or serialized properly, so skip them.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
String type = Variant::get_type_name(Variant::Type(i));
|
String type = Variant::get_type_name(Variant::Type(i));
|
||||||
change_type->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
|
change_type->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -515,14 +515,14 @@ void ProjectSettingsEditor::_update_theme() {
|
|||||||
|
|
||||||
type_box->clear();
|
type_box->clear();
|
||||||
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
||||||
// There's no point in adding Nil types, and Object types
|
if (i == Variant::NIL || i == Variant::OBJECT || i == Variant::CALLABLE || i == Variant::SIGNAL || i == Variant::RID) {
|
||||||
// can't be serialized correctly in the project settings.
|
// These types can't be serialized properly, so skip them.
|
||||||
if (i != Variant::NIL && i != Variant::OBJECT) {
|
continue;
|
||||||
|
}
|
||||||
String type = Variant::get_type_name(Variant::Type(i));
|
String type = Variant::get_type_name(Variant::Type(i));
|
||||||
type_box->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
|
type_box->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ProjectSettingsEditor::_notification(int p_what) {
|
void ProjectSettingsEditor::_notification(int p_what) {
|
||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
|
|||||||
Reference in New Issue
Block a user