Merge pull request #68420 from RedMser/config-warning-prop
Allow configuration warnings to refer to a property
This commit is contained in:
commit
86ffe92467
|
@ -72,6 +72,9 @@
|
|||
<member name="checked" type="bool" setter="set_checked" getter="is_checked" default="false">
|
||||
Used by the inspector, set to [code]true[/code] when the property is checked.
|
||||
</member>
|
||||
<member name="configuration_warning" type="String" setter="set_configuration_warning" getter="get_configuration_warning" default="""">
|
||||
Used by the inspector, set to show a configuration warning on the property.
|
||||
</member>
|
||||
<member name="deletable" type="bool" setter="set_deletable" getter="is_deletable" default="false">
|
||||
Used by the inspector, set to [code]true[/code] when the property can be deleted by the user.
|
||||
</member>
|
||||
|
|
|
@ -37,9 +37,13 @@
|
|||
</description>
|
||||
</method>
|
||||
<method name="_get_configuration_warnings" qualifiers="virtual const">
|
||||
<return type="PackedStringArray" />
|
||||
<return type="Array" />
|
||||
<description>
|
||||
The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a [code]tool[/code] script.
|
||||
Each array element must either be a [String] or a [Dictionary].
|
||||
A dictionary element must contain a key [code]message[/code] of type [String] which is shown in the user interface.
|
||||
The dictionary may optionally contain a key [code]property[/code] of type [NodePath], which also shows this warning in the inspector on the corresponding property.
|
||||
If a string is found in the returned array, it is converted to an equivalent dictionary with the [code]message[/code] field set.
|
||||
Returning an empty array produces no warnings.
|
||||
Call [method update_configuration_warnings] when the warnings need to be updated for this node.
|
||||
[codeblock]
|
||||
|
|
|
@ -214,6 +214,22 @@ void EditorProperty::_notification(int p_what) {
|
|||
text_size -= close->get_width() + 4 * EDSCALE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!configuration_warning.is_empty() && !read_only) {
|
||||
Ref<Texture2D> warning;
|
||||
|
||||
warning = get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons"));
|
||||
|
||||
rect.size.x -= warning->get_width() + get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
|
||||
if (is_layout_rtl()) {
|
||||
rect.position.x += warning->get_width() + get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
}
|
||||
|
||||
if (no_children) {
|
||||
text_size -= warning->get_width() + 4 * EDSCALE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//set children
|
||||
|
@ -399,6 +415,38 @@ void EditorProperty::_notification(int p_what) {
|
|||
} else {
|
||||
delete_rect = Rect2();
|
||||
}
|
||||
|
||||
if (!configuration_warning.is_empty() && !read_only) {
|
||||
Ref<Texture2D> warning;
|
||||
|
||||
StringName warning_icon;
|
||||
Node *node = Object::cast_to<Node>(object);
|
||||
if (node) {
|
||||
const int warning_num = node->get_configuration_warnings_of_property(property_path).size();
|
||||
warning_icon = Node::get_configuration_warning_icon(warning_num);
|
||||
} else {
|
||||
// This shouldn't happen, but let's not crash over an icon.
|
||||
warning_icon = "NodeWarning";
|
||||
}
|
||||
warning = get_theme_icon(warning_icon, SNAME("EditorIcons"));
|
||||
|
||||
ofs -= warning->get_width() + get_theme_constant(SNAME("hseparator"), SNAME("Tree"));
|
||||
|
||||
Color color2(1, 1, 1);
|
||||
if (configuration_warning_hover) {
|
||||
color2.r *= 1.2;
|
||||
color2.g *= 1.2;
|
||||
color2.b *= 1.2;
|
||||
}
|
||||
configuration_warning_rect = Rect2(ofs, ((size.height - warning->get_height()) / 2), warning->get_width(), warning->get_height());
|
||||
if (rtl) {
|
||||
draw_texture(warning, Vector2(size.width - configuration_warning_rect.position.x - warning->get_width(), configuration_warning_rect.position.y), color2);
|
||||
} else {
|
||||
draw_texture(warning, configuration_warning_rect.position, color2);
|
||||
}
|
||||
} else {
|
||||
configuration_warning_rect = Rect2();
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
@ -674,6 +722,12 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
|
|||
check_hover = new_check_hover;
|
||||
queue_redraw();
|
||||
}
|
||||
|
||||
bool new_configuration_warning_hover = configuration_warning_rect.has_point(mpos) && !button_left;
|
||||
if (new_configuration_warning_hover != configuration_warning_hover) {
|
||||
configuration_warning_hover = new_configuration_warning_hover;
|
||||
queue_redraw();
|
||||
}
|
||||
}
|
||||
|
||||
Ref<InputEventMouseButton> mb = p_event;
|
||||
|
@ -730,6 +784,16 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
|
|||
queue_redraw();
|
||||
emit_signal(SNAME("property_checked"), property, checked);
|
||||
}
|
||||
|
||||
if (configuration_warning_rect.has_point(mpos)) {
|
||||
if (warning_dialog == nullptr) {
|
||||
warning_dialog = memnew(AcceptDialog);
|
||||
add_child(warning_dialog);
|
||||
warning_dialog->set_title(TTR("Node Configuration Warning!"));
|
||||
}
|
||||
warning_dialog->set_text(configuration_warning);
|
||||
warning_dialog->popup_centered();
|
||||
}
|
||||
} else if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MouseButton::RIGHT) {
|
||||
accept_event();
|
||||
_update_popup();
|
||||
|
@ -855,6 +919,16 @@ float EditorProperty::get_name_split_ratio() const {
|
|||
return split_ratio;
|
||||
}
|
||||
|
||||
void EditorProperty::set_configuration_warning(const String &p_configuration_warning) {
|
||||
configuration_warning = p_configuration_warning;
|
||||
queue_redraw();
|
||||
queue_sort();
|
||||
}
|
||||
|
||||
String EditorProperty::get_configuration_warning() const {
|
||||
return configuration_warning;
|
||||
}
|
||||
|
||||
void EditorProperty::set_object_and_property(Object *p_object, const StringName &p_property) {
|
||||
object = p_object;
|
||||
property = p_property;
|
||||
|
@ -911,6 +985,15 @@ void EditorProperty::_update_pin_flags() {
|
|||
}
|
||||
}
|
||||
|
||||
void EditorProperty::_update_configuration_warnings() {
|
||||
Node *node = Object::cast_to<Node>(object);
|
||||
if (node) {
|
||||
const PackedStringArray warnings = node->get_configuration_warnings_as_strings(true, property_path);
|
||||
const String warning_lines = String("\n").join(warnings);
|
||||
set_configuration_warning(warning_lines);
|
||||
}
|
||||
}
|
||||
|
||||
Control *EditorProperty::make_custom_tooltip(const String &p_text) const {
|
||||
EditorHelpBit *tooltip = nullptr;
|
||||
|
||||
|
@ -980,6 +1063,9 @@ void EditorProperty::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_deletable", "deletable"), &EditorProperty::set_deletable);
|
||||
ClassDB::bind_method(D_METHOD("is_deletable"), &EditorProperty::is_deletable);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_configuration_warning", "configuration_warning"), &EditorProperty::set_configuration_warning);
|
||||
ClassDB::bind_method(D_METHOD("get_configuration_warning"), &EditorProperty::get_configuration_warning);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_edited_property"), &EditorProperty::get_edited_property);
|
||||
ClassDB::bind_method(D_METHOD("get_edited_object"), &EditorProperty::get_edited_object);
|
||||
|
||||
|
@ -997,6 +1083,7 @@ void EditorProperty::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_warning"), "set_draw_warning", "is_draw_warning");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keying"), "set_keying", "is_keying");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "deletable"), "set_deletable", "is_deletable");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "configuration_warning"), "set_configuration_warning", "get_configuration_warning");
|
||||
|
||||
ADD_SIGNAL(MethodInfo("property_changed", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), PropertyInfo(Variant::STRING_NAME, "field"), PropertyInfo(Variant::BOOL, "changing")));
|
||||
ADD_SIGNAL(MethodInfo("multiple_properties_changed", PropertyInfo(Variant::PACKED_STRING_ARRAY, "properties"), PropertyInfo(Variant::ARRAY, "value")));
|
||||
|
@ -3314,6 +3401,7 @@ void EditorInspector::update_tree() {
|
|||
ep->set_keying(keying);
|
||||
ep->set_read_only(property_read_only || all_read_only);
|
||||
ep->set_deletable(deletable_properties || p.name.begins_with("metadata/"));
|
||||
ep->_update_configuration_warnings();
|
||||
}
|
||||
|
||||
current_vbox->add_child(editors[i].property_editor);
|
||||
|
@ -3960,6 +4048,12 @@ void EditorInspector::_node_removed(Node *p_node) {
|
|||
}
|
||||
}
|
||||
|
||||
void EditorInspector::_warning_changed(Node *p_node) {
|
||||
if (p_node == object) {
|
||||
update_tree_pending = true;
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInspector::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_READY: {
|
||||
|
@ -3971,6 +4065,7 @@ void EditorInspector::_notification(int p_what) {
|
|||
case NOTIFICATION_ENTER_TREE: {
|
||||
if (!sub_inspector) {
|
||||
get_tree()->connect("node_removed", callable_mp(this, &EditorInspector::_node_removed));
|
||||
get_tree()->connect("node_configuration_warning_changed", callable_mp(this, &EditorInspector::_warning_changed));
|
||||
}
|
||||
} break;
|
||||
|
||||
|
@ -3981,6 +4076,7 @@ void EditorInspector::_notification(int p_what) {
|
|||
case NOTIFICATION_EXIT_TREE: {
|
||||
if (!sub_inspector) {
|
||||
get_tree()->disconnect("node_removed", callable_mp(this, &EditorInspector::_node_removed));
|
||||
get_tree()->disconnect("node_configuration_warning_changed", callable_mp(this, &EditorInspector::_warning_changed));
|
||||
}
|
||||
edit(nullptr);
|
||||
} break;
|
||||
|
|
|
@ -76,6 +76,7 @@ private:
|
|||
String doc_path;
|
||||
bool internal = false;
|
||||
bool has_doc_tooltip = false;
|
||||
AcceptDialog *warning_dialog = nullptr;
|
||||
|
||||
int property_usage;
|
||||
|
||||
|
@ -98,6 +99,8 @@ private:
|
|||
bool check_hover = false;
|
||||
Rect2 delete_rect;
|
||||
bool delete_hover = false;
|
||||
Rect2 configuration_warning_rect;
|
||||
bool configuration_warning_hover = false;
|
||||
|
||||
bool can_revert = false;
|
||||
bool can_pin = false;
|
||||
|
@ -121,12 +124,15 @@ private:
|
|||
Control *bottom_editor = nullptr;
|
||||
PopupMenu *menu = nullptr;
|
||||
|
||||
String configuration_warning;
|
||||
|
||||
HashMap<StringName, Variant> cache;
|
||||
|
||||
GDVIRTUAL0(_update_property)
|
||||
GDVIRTUAL1(_set_read_only, bool)
|
||||
|
||||
void _update_pin_flags();
|
||||
void _update_configuration_warnings();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
|
@ -203,6 +209,9 @@ public:
|
|||
void set_name_split_ratio(float p_ratio);
|
||||
float get_name_split_ratio() const;
|
||||
|
||||
void set_configuration_warning(const String &p_configuration_warning);
|
||||
String get_configuration_warning() const;
|
||||
|
||||
void set_object_and_property(Object *p_object, const StringName &p_property);
|
||||
virtual Control *make_custom_tooltip(const String &p_text) const override;
|
||||
|
||||
|
@ -532,6 +541,7 @@ class EditorInspector : public ScrollContainer {
|
|||
void _object_id_selected(const String &p_path, ObjectID p_id);
|
||||
|
||||
void _node_removed(Node *p_node);
|
||||
void _warning_changed(Node *p_node);
|
||||
|
||||
HashMap<StringName, int> per_array_page;
|
||||
void _page_change_request(int p_new_page, const StringName &p_array_prefix);
|
||||
|
|
|
@ -132,32 +132,13 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i
|
|||
}
|
||||
undo_redo->commit_action();
|
||||
} else if (p_id == BUTTON_WARNING) {
|
||||
const PackedStringArray warnings = n->get_configuration_warnings();
|
||||
|
||||
const PackedStringArray warnings = n->get_configuration_warnings_as_strings(true);
|
||||
if (warnings.is_empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Improve looks on tooltip, extra spacing on non-bullet point newlines.
|
||||
const String bullet_point = U"• ";
|
||||
String all_warnings;
|
||||
for (const String &w : warnings) {
|
||||
all_warnings += "\n" + bullet_point + w;
|
||||
}
|
||||
|
||||
// Limit the line width while keeping some padding.
|
||||
// It is not efficient, but it does not have to be.
|
||||
const PackedInt32Array boundaries = TS->string_get_word_breaks(all_warnings, "", 80);
|
||||
PackedStringArray lines;
|
||||
for (int i = 0; i < boundaries.size(); i += 2) {
|
||||
const int start = boundaries[i];
|
||||
const int end = boundaries[i + 1];
|
||||
const String line = all_warnings.substr(start, end - start);
|
||||
lines.append(line);
|
||||
}
|
||||
all_warnings = String("\n").join(lines).indent(" ").replace(U" •", U"\n•").substr(2); // We don't want the first two newlines.
|
||||
|
||||
warning->set_text(all_warnings);
|
||||
const String warning_lines = String("\n").join(warnings);
|
||||
warning->set_text(warning_lines);
|
||||
warning->popup_centered();
|
||||
|
||||
} else if (p_id == BUTTON_SIGNALS) {
|
||||
|
@ -294,29 +275,12 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
|||
|
||||
if (can_rename) { //should be can edit..
|
||||
|
||||
const PackedStringArray warnings = p_node->get_configuration_warnings();
|
||||
const PackedStringArray warnings = p_node->get_configuration_warnings_as_strings(false);
|
||||
const int num_warnings = warnings.size();
|
||||
if (num_warnings > 0) {
|
||||
String warning_icon;
|
||||
if (num_warnings == 1) {
|
||||
warning_icon = SNAME("NodeWarning");
|
||||
} else if (num_warnings <= 3) {
|
||||
warning_icon = vformat("NodeWarnings%d", num_warnings);
|
||||
} else {
|
||||
warning_icon = SNAME("NodeWarnings4Plus");
|
||||
}
|
||||
|
||||
// Improve looks on tooltip, extra spacing on non-bullet point newlines.
|
||||
const String bullet_point = U"• ";
|
||||
String all_warnings;
|
||||
for (const String &w : warnings) {
|
||||
all_warnings += "\n\n" + bullet_point + w.replace("\n", "\n ");
|
||||
}
|
||||
if (num_warnings == 1) {
|
||||
all_warnings.remove_at(0); // With only one warning, two newlines do not look great.
|
||||
}
|
||||
|
||||
item->add_button(0, get_editor_theme_icon(warning_icon), BUTTON_WARNING, false, TTR("Node configuration warning:") + all_warnings);
|
||||
const StringName warning_icon = Node::get_configuration_warning_icon(num_warnings);
|
||||
const String warning_lines = String("\n\n").join(warnings);
|
||||
item->add_button(0, get_editor_theme_icon(warning_icon), BUTTON_WARNING, false, TTR("Node configuration warning:") + "\n\n" + warning_lines);
|
||||
}
|
||||
|
||||
if (p_node->is_unique_name_in_owner()) {
|
||||
|
|
|
@ -82,3 +82,10 @@ Validate extension JSON: Error: Field 'classes/GPUParticles3D/properties/process
|
|||
Validate extension JSON: Error: Field 'classes/Sky/properties/sky_material': type changed value in new API, from "ShaderMaterial,PanoramaSkyMaterial,ProceduralSkyMaterial,PhysicalSkyMaterial" to "PanoramaSkyMaterial,ProceduralSkyMaterial,PhysicalSkyMaterial,ShaderMaterial".
|
||||
|
||||
Property hints reordered to improve editor usability. The types allowed are still the same as before. No adjustments should be necessary.
|
||||
|
||||
|
||||
GH-68420
|
||||
--------
|
||||
Validate extension JSON: Error: Field 'classes/Node/methods/_get_configuration_warnings/return_value': type changed value in new API, from "PackedStringArray" to "Array".
|
||||
|
||||
Allow configuration warnings to refer to a property. Compatibility method registered.
|
||||
|
|
|
@ -87,8 +87,8 @@ void MultiplayerSpawner::_get_property_list(List<PropertyInfo> *p_list) const {
|
|||
}
|
||||
#endif
|
||||
|
||||
PackedStringArray MultiplayerSpawner::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array MultiplayerSpawner::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (spawn_path.is_empty() || !has_node(spawn_path)) {
|
||||
warnings.push_back(RTR("A valid NodePath must be set in the \"Spawn Path\" property in order for MultiplayerSpawner to be able to spawn Nodes."));
|
||||
|
|
|
@ -91,7 +91,7 @@ protected:
|
|||
void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
#endif
|
||||
public:
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
Node *get_spawn_node() const {
|
||||
return spawn_node.is_valid() ? Object::cast_to<Node>(ObjectDB::get_instance(spawn_node)) : nullptr;
|
||||
|
|
|
@ -143,8 +143,8 @@ bool MultiplayerSynchronizer::update_inbound_sync_time(uint16_t p_network_time)
|
|||
return true;
|
||||
}
|
||||
|
||||
PackedStringArray MultiplayerSynchronizer::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array MultiplayerSynchronizer::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (root_path.is_empty() || !has_node(root_path)) {
|
||||
warnings.push_back(RTR("A valid NodePath must be set in the \"Root Path\" property in order for MultiplayerSynchronizer to be able to synchronize properties."));
|
||||
|
|
|
@ -91,7 +91,7 @@ public:
|
|||
bool update_outbound_sync_time(uint64_t p_usec);
|
||||
bool update_inbound_sync_time(uint16_t p_network_time);
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
void set_replication_interval(double p_interval);
|
||||
double get_replication_interval() const;
|
||||
|
|
|
@ -568,8 +568,8 @@ StringName AnimatedSprite2D::get_animation() const {
|
|||
return animation;
|
||||
}
|
||||
|
||||
PackedStringArray AnimatedSprite2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node2D::get_configuration_warnings();
|
||||
Array AnimatedSprite2D::get_configuration_warnings() const {
|
||||
Array warnings = Node2D::get_configuration_warnings();
|
||||
if (frames.is_null()) {
|
||||
warnings.push_back(RTR("A SpriteFrames resource must be created or set in the \"Frames\" property in order for AnimatedSprite2D to display frames."));
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ public:
|
|||
void set_flip_v(bool p_flip);
|
||||
bool is_flipped_v() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
|
||||
|
||||
AnimatedSprite2D();
|
||||
|
|
|
@ -113,8 +113,8 @@ Color CanvasModulate::get_color() const {
|
|||
return color;
|
||||
}
|
||||
|
||||
PackedStringArray CanvasModulate::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array CanvasModulate::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (is_in_canvas && is_visible_in_tree()) {
|
||||
List<Node *> nodes;
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
void set_color(const Color &p_color);
|
||||
Color get_color() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
CanvasModulate();
|
||||
~CanvasModulate();
|
||||
|
|
|
@ -582,8 +582,8 @@ void CollisionObject2D::_update_pickable() {
|
|||
}
|
||||
}
|
||||
|
||||
PackedStringArray CollisionObject2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array CollisionObject2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (shapes.is_empty()) {
|
||||
warnings.push_back(RTR("This node has no shape, so it can't collide or interact with other objects.\nConsider adding a CollisionShape2D or CollisionPolygon2D as a child to define its shape."));
|
||||
|
|
|
@ -166,7 +166,7 @@ public:
|
|||
void set_pickable(bool p_enabled);
|
||||
bool is_pickable() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
_FORCE_INLINE_ RID get_rid() const { return rid; }
|
||||
|
||||
|
|
|
@ -232,8 +232,8 @@ bool CollisionPolygon2D::_edit_is_selected_on_click(const Point2 &p_point, doubl
|
|||
}
|
||||
#endif
|
||||
|
||||
PackedStringArray CollisionPolygon2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array CollisionPolygon2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!Object::cast_to<CollisionObject2D>(get_parent())) {
|
||||
warnings.push_back(RTR("CollisionPolygon2D only serves to provide a collision shape to a CollisionObject2D derived node. Please only use it as a child of Area2D, StaticBody2D, RigidBody2D, CharacterBody2D, etc. to give them a shape."));
|
||||
|
|
|
@ -77,7 +77,7 @@ public:
|
|||
void set_polygon(const Vector<Point2> &p_polygon);
|
||||
Vector<Point2> get_polygon() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
void set_disabled(bool p_disabled);
|
||||
bool is_disabled() const;
|
||||
|
|
|
@ -173,8 +173,8 @@ bool CollisionShape2D::_edit_is_selected_on_click(const Point2 &p_point, double
|
|||
return shape->_edit_is_selected_on_click(p_point, p_tolerance);
|
||||
}
|
||||
|
||||
PackedStringArray CollisionShape2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array CollisionShape2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
CollisionObject2D *col_object = Object::cast_to<CollisionObject2D>(get_parent());
|
||||
if (col_object == nullptr) {
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
void set_debug_color(const Color &p_color);
|
||||
Color get_debug_color() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
CollisionShape2D();
|
||||
};
|
||||
|
|
|
@ -246,8 +246,8 @@ bool CPUParticles2D::get_fractional_delta() const {
|
|||
return fractional_delta;
|
||||
}
|
||||
|
||||
PackedStringArray CPUParticles2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node2D::get_configuration_warnings();
|
||||
Array CPUParticles2D::get_configuration_warnings() const {
|
||||
Array warnings = Node2D::get_configuration_warnings();
|
||||
|
||||
CanvasItemMaterial *mat = Object::cast_to<CanvasItemMaterial>(get_material().ptr());
|
||||
|
||||
|
|
|
@ -282,7 +282,7 @@ public:
|
|||
void set_gravity(const Vector2 &p_gravity);
|
||||
Vector2 get_gravity() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
void restart();
|
||||
|
||||
|
|
|
@ -327,8 +327,8 @@ float GPUParticles2D::get_interp_to_end() const {
|
|||
return interp_to_end_factor;
|
||||
}
|
||||
|
||||
PackedStringArray GPUParticles2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node2D::get_configuration_warnings();
|
||||
Array GPUParticles2D::get_configuration_warnings() const {
|
||||
Array warnings = Node2D::get_configuration_warnings();
|
||||
|
||||
if (process_material.is_null()) {
|
||||
warnings.push_back(RTR("A material to process the particles is not assigned, so no behavior is imprinted."));
|
||||
|
|
|
@ -161,7 +161,7 @@ public:
|
|||
void set_amount_ratio(float p_ratio);
|
||||
float get_amount_ratio() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
void set_sub_emitter(const NodePath &p_path);
|
||||
NodePath get_sub_emitter() const;
|
||||
|
|
|
@ -212,8 +212,8 @@ bool Joint2D::get_exclude_nodes_from_collision() const {
|
|||
return exclude_from_collision;
|
||||
}
|
||||
|
||||
PackedStringArray Joint2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node2D::get_configuration_warnings();
|
||||
Array Joint2D::get_configuration_warnings() const {
|
||||
Array warnings = Node2D::get_configuration_warnings();
|
||||
|
||||
if (!warning.is_empty()) {
|
||||
warnings.push_back(warning);
|
||||
|
|
|
@ -62,7 +62,7 @@ protected:
|
|||
_FORCE_INLINE_ bool is_configured() const { return configured; }
|
||||
|
||||
public:
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
void set_node_a(const NodePath &p_node_a);
|
||||
NodePath get_node_a() const;
|
||||
|
|
|
@ -401,11 +401,14 @@ Vector2 PointLight2D::get_texture_offset() const {
|
|||
return texture_offset;
|
||||
}
|
||||
|
||||
PackedStringArray PointLight2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array PointLight2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!texture.is_valid()) {
|
||||
warnings.push_back(RTR("A texture with the shape of the light must be supplied to the \"Texture\" property."));
|
||||
Dictionary texture_warning;
|
||||
texture_warning["message"] = RTR("A texture with the shape of the light must be supplied.");
|
||||
texture_warning["property"] = "texture";
|
||||
warnings.push_back(texture_warning);
|
||||
}
|
||||
|
||||
return warnings;
|
||||
|
|
|
@ -174,7 +174,7 @@ public:
|
|||
void set_texture_scale(real_t p_scale);
|
||||
real_t get_texture_scale() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
PointLight2D();
|
||||
};
|
||||
|
|
|
@ -247,8 +247,8 @@ int LightOccluder2D::get_occluder_light_mask() const {
|
|||
return mask;
|
||||
}
|
||||
|
||||
PackedStringArray LightOccluder2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array LightOccluder2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!occluder_polygon.is_valid()) {
|
||||
warnings.push_back(RTR("An occluder polygon must be set (or drawn) for this occluder to take effect."));
|
||||
|
|
|
@ -105,7 +105,7 @@ public:
|
|||
void set_as_sdf_collision(bool p_enable);
|
||||
bool is_set_as_sdf_collision() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
LightOccluder2D();
|
||||
~LightOccluder2D();
|
||||
|
|
|
@ -624,8 +624,8 @@ void NavigationAgent2D::_avoidance_done(Vector3 p_new_velocity) {
|
|||
emit_signal(SNAME("velocity_computed"), safe_velocity);
|
||||
}
|
||||
|
||||
PackedStringArray NavigationAgent2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array NavigationAgent2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!Object::cast_to<Node2D>(get_parent())) {
|
||||
warnings.push_back(RTR("The NavigationAgent2D can be used only under a Node2D inheriting parent node."));
|
||||
|
|
|
@ -200,7 +200,7 @@ public:
|
|||
|
||||
void _avoidance_done(Vector3 p_new_velocity);
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
void set_avoidance_layers(uint32_t p_layers);
|
||||
uint32_t get_avoidance_layers() const;
|
||||
|
|
|
@ -337,8 +337,8 @@ void NavigationLink2D::set_travel_cost(real_t p_travel_cost) {
|
|||
NavigationServer2D::get_singleton()->link_set_travel_cost(link, travel_cost);
|
||||
}
|
||||
|
||||
PackedStringArray NavigationLink2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array NavigationLink2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (start_position.is_equal_approx(end_position)) {
|
||||
warnings.push_back(RTR("NavigationLink2D start position should be different than the end position to be useful."));
|
||||
|
|
|
@ -93,7 +93,7 @@ public:
|
|||
void set_travel_cost(real_t p_travel_cost);
|
||||
real_t get_travel_cost() const { return travel_cost; }
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
NavigationLink2D();
|
||||
~NavigationLink2D();
|
||||
|
|
|
@ -275,8 +275,8 @@ void NavigationRegion2D::_navigation_map_changed(RID p_map) {
|
|||
}
|
||||
#endif // DEBUG_ENABLED
|
||||
|
||||
PackedStringArray NavigationRegion2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node2D::get_configuration_warnings();
|
||||
Array NavigationRegion2D::get_configuration_warnings() const {
|
||||
Array warnings = Node2D::get_configuration_warnings();
|
||||
|
||||
if (is_visible_in_tree() && is_inside_tree()) {
|
||||
if (!navigation_polygon.is_valid()) {
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
void set_avoidance_layer_value(int p_layer_number, bool p_value);
|
||||
bool get_avoidance_layer_value(int p_layer_number) const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
void bake_navigation_polygon(bool p_on_thread);
|
||||
void _bake_finished(Ref<NavigationPolygon> p_navigation_polygon);
|
||||
|
|
|
@ -137,8 +137,8 @@ void ParallaxLayer::set_base_offset_and_scale(const Point2 &p_offset, real_t p_s
|
|||
_update_mirroring();
|
||||
}
|
||||
|
||||
PackedStringArray ParallaxLayer::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array ParallaxLayer::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!Object::cast_to<ParallaxBackground>(get_parent())) {
|
||||
warnings.push_back(RTR("ParallaxLayer node only works when set as child of a ParallaxBackground node."));
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
|
||||
void set_base_offset_and_scale(const Point2 &p_offset, real_t p_scale);
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
ParallaxLayer();
|
||||
};
|
||||
|
||||
|
|
|
@ -287,8 +287,8 @@ void PathFollow2D::_validate_property(PropertyInfo &p_property) const {
|
|||
}
|
||||
}
|
||||
|
||||
PackedStringArray PathFollow2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array PathFollow2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (is_visible_in_tree() && is_inside_tree()) {
|
||||
if (!Object::cast_to<Path2D>(get_parent())) {
|
||||
|
|
|
@ -106,7 +106,7 @@ public:
|
|||
void set_cubic_interpolation_enabled(bool p_enabled);
|
||||
bool is_cubic_interpolation_enabled() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
PathFollow2D() {}
|
||||
};
|
||||
|
|
|
@ -106,8 +106,8 @@ void PhysicalBone2D::_find_joint_child() {
|
|||
}
|
||||
}
|
||||
|
||||
PackedStringArray PhysicalBone2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array PhysicalBone2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!parent_skeleton) {
|
||||
warnings.push_back(RTR("A PhysicalBone2D only works with a Skeleton2D or another PhysicalBone2D as a parent node!"));
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
void set_follow_bone_when_simulating(bool p_follow);
|
||||
bool get_follow_bone_when_simulating() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
PhysicalBone2D();
|
||||
~PhysicalBone2D();
|
||||
|
|
|
@ -928,10 +928,10 @@ void RigidBody2D::_notification(int p_what) {
|
|||
#endif
|
||||
}
|
||||
|
||||
PackedStringArray RigidBody2D::get_configuration_warnings() const {
|
||||
Array RigidBody2D::get_configuration_warnings() const {
|
||||
Transform2D t = get_transform();
|
||||
|
||||
PackedStringArray warnings = CollisionObject2D::get_configuration_warnings();
|
||||
Array warnings = CollisionObject2D::get_configuration_warnings();
|
||||
|
||||
if (ABS(t.columns[0].length() - 1.0) > 0.05 || ABS(t.columns[1].length() - 1.0) > 0.05) {
|
||||
warnings.push_back(RTR("Size changes to RigidBody2D will be overridden by the physics engine when running.\nChange the size in children collision shapes instead."));
|
||||
|
|
|
@ -312,7 +312,7 @@ public:
|
|||
|
||||
TypedArray<Node2D> get_colliding_bodies() const; //function for script
|
||||
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
RigidBody2D();
|
||||
~RigidBody2D();
|
||||
|
|
|
@ -200,8 +200,8 @@ void RemoteTransform2D::force_update_cache() {
|
|||
_update_cache();
|
||||
}
|
||||
|
||||
PackedStringArray RemoteTransform2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array RemoteTransform2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!has_node(remote_node) || !Object::cast_to<Node2D>(get_node(remote_node))) {
|
||||
warnings.push_back(RTR("Path property must point to a valid Node2D node to work."));
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
|
||||
void force_update_cache();
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
RemoteTransform2D();
|
||||
};
|
||||
|
|
|
@ -402,8 +402,8 @@ Array ShapeCast2D::_get_collision_result() const {
|
|||
return ret;
|
||||
}
|
||||
|
||||
PackedStringArray ShapeCast2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node2D::get_configuration_warnings();
|
||||
Array ShapeCast2D::get_configuration_warnings() const {
|
||||
Array warnings = Node2D::get_configuration_warnings();
|
||||
|
||||
if (shape.is_null()) {
|
||||
warnings.push_back(RTR("This node cannot interact with other objects unless a Shape2D is assigned."));
|
||||
|
|
|
@ -118,7 +118,7 @@ public:
|
|||
void remove_exception(const CollisionObject2D *p_node);
|
||||
void clear_exceptions();
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
ShapeCast2D();
|
||||
};
|
||||
|
|
|
@ -415,8 +415,8 @@ int Bone2D::get_index_in_skeleton() const {
|
|||
return skeleton_index;
|
||||
}
|
||||
|
||||
PackedStringArray Bone2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array Bone2D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
if (!skeleton) {
|
||||
if (parent_bone) {
|
||||
warnings.push_back(RTR("This Bone2D chain should end at a Skeleton2D node."));
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
void apply_rest();
|
||||
Transform2D get_skeleton_rest() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
void set_autocalculate_length_and_angle(bool p_autocalculate);
|
||||
bool get_autocalculate_length_and_angle() const;
|
||||
|
|
|
@ -1103,8 +1103,8 @@ void TileMap::draw_cells_outline(Control *p_control, const RBSet<Vector2i> &p_ce
|
|||
#undef DRAW_SIDE_IF_NEEDED
|
||||
}
|
||||
|
||||
PackedStringArray TileMap::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array TileMap::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
// Retrieve the set of Z index values with a Y-sorted layer.
|
||||
RBSet<int> y_sorted_z_index;
|
||||
|
|
|
@ -232,7 +232,7 @@ public:
|
|||
GDVIRTUAL3(_tile_data_runtime_update, int, Vector2i, TileData *);
|
||||
|
||||
// Configuration warnings.
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
TileMap();
|
||||
~TileMap();
|
||||
|
|
|
@ -87,8 +87,8 @@ void BoneAttachment3D::_get_property_list(List<PropertyInfo> *p_list) const {
|
|||
}
|
||||
}
|
||||
|
||||
PackedStringArray BoneAttachment3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node3D::get_configuration_warnings();
|
||||
Array BoneAttachment3D::get_configuration_warnings() const {
|
||||
Array warnings = Node3D::get_configuration_warnings();
|
||||
|
||||
if (use_external_skeleton) {
|
||||
if (external_skeleton_node_cache.is_null()) {
|
||||
|
|
|
@ -71,7 +71,8 @@ public:
|
|||
virtual void notify_skeleton_bones_renamed(Node *p_base_scene, Skeleton3D *p_skeleton, Dictionary p_rename_map);
|
||||
#endif // TOOLS_ENABLED
|
||||
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
public:
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
void set_bone_name(const String &p_name);
|
||||
String get_bone_name() const;
|
||||
|
|
|
@ -728,8 +728,8 @@ bool CollisionObject3D::get_capture_input_on_drag() const {
|
|||
return capture_input_on_drag;
|
||||
}
|
||||
|
||||
PackedStringArray CollisionObject3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array CollisionObject3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (shapes.is_empty()) {
|
||||
warnings.push_back(RTR("This node has no shape, so it can't collide or interact with other objects.\nConsider adding a CollisionShape3D or CollisionPolygon3D as a child to define its shape."));
|
||||
|
|
|
@ -173,7 +173,7 @@ public:
|
|||
|
||||
_FORCE_INLINE_ RID get_rid() const { return rid; }
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
CollisionObject3D();
|
||||
~CollisionObject3D();
|
||||
|
|
|
@ -168,8 +168,8 @@ void CollisionPolygon3D::set_margin(real_t p_margin) {
|
|||
}
|
||||
}
|
||||
|
||||
PackedStringArray CollisionPolygon3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array CollisionPolygon3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!Object::cast_to<CollisionObject3D>(get_parent())) {
|
||||
warnings.push_back(RTR("CollisionPolygon3D only serves to provide a collision shape to a CollisionObject3D derived node.\nPlease only use it as a child of Area3D, StaticBody3D, RigidBody3D, CharacterBody3D, etc. to give them a shape."));
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
real_t get_margin() const;
|
||||
void set_margin(real_t p_margin);
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
CollisionPolygon3D();
|
||||
};
|
||||
|
|
|
@ -118,8 +118,8 @@ void CollisionShape3D::resource_changed(Ref<Resource> res) {
|
|||
}
|
||||
#endif
|
||||
|
||||
PackedStringArray CollisionShape3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array CollisionShape3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
CollisionObject3D *col_object = Object::cast_to<CollisionObject3D>(get_parent());
|
||||
if (col_object == nullptr) {
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
void set_disabled(bool p_disabled);
|
||||
bool is_disabled() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
CollisionShape3D();
|
||||
~CollisionShape3D();
|
||||
|
|
|
@ -193,8 +193,8 @@ bool CPUParticles3D::get_fractional_delta() const {
|
|||
return fractional_delta;
|
||||
}
|
||||
|
||||
PackedStringArray CPUParticles3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = GeometryInstance3D::get_configuration_warnings();
|
||||
Array CPUParticles3D::get_configuration_warnings() const {
|
||||
Array warnings = GeometryInstance3D::get_configuration_warnings();
|
||||
|
||||
bool mesh_found = false;
|
||||
bool anim_material_found = false;
|
||||
|
|
|
@ -302,7 +302,7 @@ public:
|
|||
void set_gravity(const Vector3 &p_gravity);
|
||||
Vector3 get_gravity() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
void restart();
|
||||
|
||||
|
|
|
@ -162,8 +162,8 @@ void Decal::_validate_property(PropertyInfo &p_property) const {
|
|||
}
|
||||
}
|
||||
|
||||
PackedStringArray Decal::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array Decal::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
|
||||
warnings.push_back(RTR("Decals are only available when using the Forward+ or Mobile rendering backends."));
|
||||
|
|
|
@ -69,7 +69,7 @@ protected:
|
|||
#endif // DISABLE_DEPRECATED
|
||||
|
||||
public:
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
void set_size(const Vector3 &p_size);
|
||||
Vector3 get_size() const;
|
||||
|
|
|
@ -117,8 +117,8 @@ AABB FogVolume::get_aabb() const {
|
|||
return AABB();
|
||||
}
|
||||
|
||||
PackedStringArray FogVolume::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array FogVolume::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
Ref<Environment> environment = get_viewport()->find_world_3d()->get_environment();
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
Ref<Material> get_material() const;
|
||||
|
||||
virtual AABB get_aabb() const override;
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
FogVolume();
|
||||
~FogVolume();
|
||||
|
|
|
@ -296,8 +296,8 @@ bool GPUParticles3D::get_interpolate() const {
|
|||
return interpolate;
|
||||
}
|
||||
|
||||
PackedStringArray GPUParticles3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = GeometryInstance3D::get_configuration_warnings();
|
||||
Array GPUParticles3D::get_configuration_warnings() const {
|
||||
Array warnings = GeometryInstance3D::get_configuration_warnings();
|
||||
|
||||
bool meshes_found = false;
|
||||
bool anim_material_found = false;
|
||||
|
|
|
@ -164,7 +164,7 @@ public:
|
|||
void set_draw_pass_mesh(int p_pass, const Ref<Mesh> &p_mesh);
|
||||
Ref<Mesh> get_draw_pass_mesh(int p_pass) const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
void set_sub_emitter(const NodePath &p_path);
|
||||
NodePath get_sub_emitter() const;
|
||||
|
|
|
@ -527,8 +527,8 @@ Ref<Image> GPUParticlesCollisionSDF3D::bake() {
|
|||
return ret;
|
||||
}
|
||||
|
||||
PackedStringArray GPUParticlesCollisionSDF3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array GPUParticlesCollisionSDF3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (bake_mask == 0) {
|
||||
warnings.push_back(RTR("The Bake Mask has no bits enabled, which means baking will not produce any collision for this GPUParticlesCollisionSDF3D.\nTo resolve this, enable at least one bit in the Bake Mask property."));
|
||||
|
|
|
@ -170,7 +170,7 @@ protected:
|
|||
#endif // DISABLE_DEPRECATED
|
||||
|
||||
public:
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
void set_thickness(float p_thickness);
|
||||
float get_thickness() const;
|
||||
|
|
|
@ -198,8 +198,8 @@ bool Joint3D::get_exclude_nodes_from_collision() const {
|
|||
return exclude_from_collision;
|
||||
}
|
||||
|
||||
PackedStringArray Joint3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node3D::get_configuration_warnings();
|
||||
Array Joint3D::get_configuration_warnings() const {
|
||||
Array warnings = Node3D::get_configuration_warnings();
|
||||
|
||||
if (!warning.is_empty()) {
|
||||
warnings.push_back(warning);
|
||||
|
|
|
@ -63,7 +63,7 @@ protected:
|
|||
_FORCE_INLINE_ bool is_configured() const { return configured; }
|
||||
|
||||
public:
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
void set_node_a(const NodePath &p_node_a);
|
||||
NodePath get_node_a() const;
|
||||
|
|
|
@ -169,8 +169,8 @@ AABB Light3D::get_aabb() const {
|
|||
return AABB();
|
||||
}
|
||||
|
||||
PackedStringArray Light3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = VisualInstance3D::get_configuration_warnings();
|
||||
Array Light3D::get_configuration_warnings() const {
|
||||
Array warnings = VisualInstance3D::get_configuration_warnings();
|
||||
|
||||
if (!get_scale().is_equal_approx(Vector3(1, 1, 1))) {
|
||||
warnings.push_back(RTR("A light's scale does not affect the visual size of the light."));
|
||||
|
@ -596,8 +596,8 @@ OmniLight3D::ShadowMode OmniLight3D::get_shadow_mode() const {
|
|||
return shadow_mode;
|
||||
}
|
||||
|
||||
PackedStringArray OmniLight3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Light3D::get_configuration_warnings();
|
||||
Array OmniLight3D::get_configuration_warnings() const {
|
||||
Array warnings = Light3D::get_configuration_warnings();
|
||||
|
||||
if (!has_shadow() && get_projector().is_valid()) {
|
||||
warnings.push_back(RTR("Projector texture only works with shadows active."));
|
||||
|
@ -628,8 +628,8 @@ OmniLight3D::OmniLight3D() :
|
|||
set_shadow_mode(SHADOW_CUBE);
|
||||
}
|
||||
|
||||
PackedStringArray SpotLight3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Light3D::get_configuration_warnings();
|
||||
Array SpotLight3D::get_configuration_warnings() const {
|
||||
Array warnings = Light3D::get_configuration_warnings();
|
||||
|
||||
if (has_shadow() && get_param(PARAM_SPOT_ANGLE) >= 90.0) {
|
||||
warnings.push_back(RTR("A SpotLight3D with an angle wider than 90 degrees cannot cast shadows."));
|
||||
|
|
|
@ -147,7 +147,7 @@ public:
|
|||
Color get_correlated_color() const;
|
||||
|
||||
virtual AABB get_aabb() const override;
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
Light3D();
|
||||
~Light3D();
|
||||
|
@ -217,7 +217,7 @@ public:
|
|||
void set_shadow_mode(ShadowMode p_mode);
|
||||
ShadowMode get_shadow_mode() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
OmniLight3D();
|
||||
};
|
||||
|
@ -231,7 +231,7 @@ protected:
|
|||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
SpotLight3D();
|
||||
};
|
||||
|
|
|
@ -1528,8 +1528,8 @@ Ref<CameraAttributes> LightmapGI::get_camera_attributes() const {
|
|||
return camera_attributes;
|
||||
}
|
||||
|
||||
PackedStringArray LightmapGI::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array LightmapGI::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
|
||||
warnings.push_back(RTR("Lightmap can only be baked from a device that supports the RD backends. Lightmap baking may fail."));
|
||||
|
|
|
@ -302,7 +302,7 @@ public:
|
|||
|
||||
BakeError bake(Node *p_from_node, String p_image_data_path = "", Lightmapper::BakeStepFunc p_bake_step = nullptr, void *p_bake_userdata = nullptr);
|
||||
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
LightmapGI();
|
||||
};
|
||||
|
|
|
@ -690,8 +690,8 @@ void NavigationAgent3D::_avoidance_done(Vector3 p_new_velocity) {
|
|||
emit_signal(SNAME("velocity_computed"), safe_velocity);
|
||||
}
|
||||
|
||||
PackedStringArray NavigationAgent3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array NavigationAgent3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!Object::cast_to<Node3D>(get_parent())) {
|
||||
warnings.push_back(RTR("The NavigationAgent3D can be used only under a Node3D inheriting parent node."));
|
||||
|
|
|
@ -221,7 +221,7 @@ public:
|
|||
|
||||
void _avoidance_done(Vector3 p_new_velocity);
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
void set_avoidance_layers(uint32_t p_layers);
|
||||
uint32_t get_avoidance_layers() const;
|
||||
|
|
|
@ -458,8 +458,8 @@ void NavigationLink3D::set_travel_cost(real_t p_travel_cost) {
|
|||
NavigationServer3D::get_singleton()->link_set_travel_cost(link, travel_cost);
|
||||
}
|
||||
|
||||
PackedStringArray NavigationLink3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array NavigationLink3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (start_position.is_equal_approx(end_position)) {
|
||||
warnings.push_back(RTR("NavigationLink3D start position should be different than the end position to be useful."));
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
void set_travel_cost(real_t p_travel_cost);
|
||||
real_t get_travel_cost() const { return travel_cost; }
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
};
|
||||
|
||||
#endif // NAVIGATION_LINK_3D_H
|
||||
|
|
|
@ -270,8 +270,8 @@ bool NavigationRegion3D::is_baking() const {
|
|||
return NavigationServer3D::get_singleton()->is_baking_navigation_mesh(navigation_mesh);
|
||||
}
|
||||
|
||||
PackedStringArray NavigationRegion3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array NavigationRegion3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (is_visible_in_tree() && is_inside_tree()) {
|
||||
if (!navigation_mesh.is_valid()) {
|
||||
|
|
|
@ -107,7 +107,7 @@ public:
|
|||
void _bake_finished(Ref<NavigationMesh> p_navigation_mesh);
|
||||
bool is_baking() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
NavigationRegion3D();
|
||||
~NavigationRegion3D();
|
||||
|
|
|
@ -693,8 +693,8 @@ OccluderInstance3D::BakeError OccluderInstance3D::bake_scene(Node *p_from_node,
|
|||
return BAKE_ERROR_OK;
|
||||
}
|
||||
|
||||
PackedStringArray OccluderInstance3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array OccluderInstance3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!bool(GLOBAL_GET("rendering/occlusion_culling/use_occlusion_culling"))) {
|
||||
warnings.push_back(RTR("Occlusion culling is disabled in the Project Settings, which means occlusion culling won't be performed in the root viewport.\nTo resolve this, open the Project Settings and enable Rendering > Occlusion Culling > Use Occlusion Culling."));
|
||||
|
|
|
@ -181,7 +181,7 @@ protected:
|
|||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
enum BakeError {
|
||||
BAKE_ERROR_OK,
|
||||
|
|
|
@ -291,8 +291,8 @@ void PathFollow3D::_validate_property(PropertyInfo &p_property) const {
|
|||
}
|
||||
}
|
||||
|
||||
PackedStringArray PathFollow3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array PathFollow3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (is_visible_in_tree() && is_inside_tree()) {
|
||||
if (!Object::cast_to<Path3D>(get_parent())) {
|
||||
|
|
|
@ -122,7 +122,7 @@ public:
|
|||
void set_cubic_interpolation_enabled(bool p_enabled);
|
||||
bool is_cubic_interpolation_enabled() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
PathFollow3D() {}
|
||||
};
|
||||
|
|
|
@ -995,8 +995,8 @@ TypedArray<Node3D> RigidBody3D::get_colliding_bodies() const {
|
|||
return ret;
|
||||
}
|
||||
|
||||
PackedStringArray RigidBody3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = CollisionObject3D::get_configuration_warnings();
|
||||
Array RigidBody3D::get_configuration_warnings() const {
|
||||
Array warnings = CollisionObject3D::get_configuration_warnings();
|
||||
|
||||
Vector3 scale = get_transform().get_basis().get_scale();
|
||||
if (ABS(scale.x - 1.0) > 0.05 || ABS(scale.y - 1.0) > 0.05 || ABS(scale.z - 1.0) > 0.05) {
|
||||
|
|
|
@ -328,7 +328,7 @@ public:
|
|||
void set_constant_torque(const Vector3 &p_torque);
|
||||
Vector3 get_constant_torque() const;
|
||||
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
RigidBody3D();
|
||||
~RigidBody3D();
|
||||
|
|
|
@ -190,8 +190,8 @@ AABB ReflectionProbe::get_aabb() const {
|
|||
return aabb;
|
||||
}
|
||||
|
||||
PackedStringArray ReflectionProbe::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array ReflectionProbe::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
|
||||
warnings.push_back(RTR("ReflectionProbes are not supported when using the GL Compatibility backend yet. Support will be added in a future release."));
|
||||
|
|
|
@ -122,7 +122,7 @@ public:
|
|||
|
||||
virtual AABB get_aabb() const override;
|
||||
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
|
||||
ReflectionProbe();
|
||||
~ReflectionProbe();
|
||||
|
|
|
@ -200,8 +200,8 @@ void RemoteTransform3D::force_update_cache() {
|
|||
_update_cache();
|
||||
}
|
||||
|
||||
PackedStringArray RemoteTransform3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array RemoteTransform3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!has_node(remote_node) || !Object::cast_to<Node3D>(get_node(remote_node))) {
|
||||
warnings.push_back(RTR("The \"Remote Path\" property must point to a valid Node3D or Node3D-derived node to work."));
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
|
||||
void force_update_cache();
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
RemoteTransform3D();
|
||||
};
|
||||
|
|
|
@ -170,8 +170,8 @@ void ShapeCast3D::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "debug_shape_custom_color"), "set_debug_shape_custom_color", "get_debug_shape_custom_color");
|
||||
}
|
||||
|
||||
PackedStringArray ShapeCast3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node3D::get_configuration_warnings();
|
||||
Array ShapeCast3D::get_configuration_warnings() const {
|
||||
Array warnings = Node3D::get_configuration_warnings();
|
||||
|
||||
if (shape.is_null()) {
|
||||
warnings.push_back(RTR("This node cannot interact with other objects unless a Shape3D is assigned."));
|
||||
|
|
|
@ -140,7 +140,7 @@ public:
|
|||
void remove_exception(const CollisionObject3D *p_node);
|
||||
void clear_exceptions();
|
||||
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
};
|
||||
|
||||
#endif // SHAPE_CAST_3D_H
|
||||
|
|
|
@ -373,8 +373,8 @@ void SoftBody3D::_bind_methods() {
|
|||
BIND_ENUM_CONSTANT(DISABLE_MODE_KEEP_ACTIVE);
|
||||
}
|
||||
|
||||
PackedStringArray SoftBody3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array SoftBody3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (mesh.is_null()) {
|
||||
warnings.push_back(RTR("This body will be ignored until you set a mesh."));
|
||||
|
|
|
@ -126,7 +126,7 @@ protected:
|
|||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
public:
|
||||
RID get_physics_rid() const { return physics_rid; }
|
||||
|
|
|
@ -1430,8 +1430,8 @@ StringName AnimatedSprite3D::get_animation() const {
|
|||
return animation;
|
||||
}
|
||||
|
||||
PackedStringArray AnimatedSprite3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = SpriteBase3D::get_configuration_warnings();
|
||||
Array AnimatedSprite3D::get_configuration_warnings() const {
|
||||
Array warnings = SpriteBase3D::get_configuration_warnings();
|
||||
if (frames.is_null()) {
|
||||
warnings.push_back(RTR("A SpriteFrames resource must be created or set in the \"Frames\" property in order for AnimatedSprite3D to display frames."));
|
||||
}
|
||||
|
|
|
@ -285,7 +285,7 @@ public:
|
|||
|
||||
virtual Rect2 get_item_rect() const override;
|
||||
|
||||
virtual PackedStringArray get_configuration_warnings() const override;
|
||||
virtual Array get_configuration_warnings() const override;
|
||||
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
|
||||
|
||||
AnimatedSprite3D();
|
||||
|
|
|
@ -105,8 +105,8 @@ void VehicleWheel3D::_notification(int p_what) {
|
|||
}
|
||||
}
|
||||
|
||||
PackedStringArray VehicleWheel3D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
Array VehicleWheel3D::get_configuration_warnings() const {
|
||||
Array warnings = Node::get_configuration_warnings();
|
||||
|
||||
if (!Object::cast_to<VehicleBody3D>(get_parent())) {
|
||||
warnings.push_back(RTR("VehicleWheel3D serves to provide a wheel system to a VehicleBody3D. Please use it as a child of a VehicleBody3D."));
|
||||
|
|
|
@ -147,7 +147,7 @@ public:
|
|||
void set_steering(real_t p_steering);
|
||||
real_t get_steering() const;
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
Array get_configuration_warnings() const override;
|
||||
|
||||
VehicleWheel3D();
|
||||
};
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue