Skip to content

Commit

Permalink
Update Node::get_configuration_warnings signature
Browse files Browse the repository at this point in the history
  • Loading branch information
RedMser committed Feb 8, 2024
1 parent bf37a9b commit d3852de
Show file tree
Hide file tree
Showing 132 changed files with 217 additions and 213 deletions.
4 changes: 2 additions & 2 deletions modules/multiplayer/multiplayer_spawner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
2 changes: 1 addition & 1 deletion modules/multiplayer/multiplayer_spawner.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class MultiplayerSpawner : public Node {
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;
Expand Down
4 changes: 2 additions & 2 deletions modules/multiplayer/multiplayer_synchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
2 changes: 1 addition & 1 deletion modules/multiplayer/multiplayer_synchronizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class MultiplayerSynchronizer : public Node {
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;
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/animated_sprite_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
}
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/animated_sprite_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class AnimatedSprite2D : public Node2D {
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();
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/canvas_modulate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/canvas_modulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CanvasModulate : public Node2D {
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();
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/collision_object_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/collision_object_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class CollisionObject2D : public Node2D {
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; }

Expand Down
4 changes: 2 additions & 2 deletions scene/2d/collision_polygon_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/collision_polygon_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class CollisionPolygon2D : public Node2D {
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;
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/collision_shape_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/collision_shape_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class CollisionShape2D : public Node2D {
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();
};
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/cpu_particles_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
2 changes: 1 addition & 1 deletion scene/2d/cpu_particles_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class CPUParticles2D : public Node2D {
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();

Expand Down
4 changes: 2 additions & 2 deletions scene/2d/gpu_particles_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/gpu_particles_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class GPUParticles2D : public Node2D {
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;
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/joint_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/joint_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Joint2D : public Node2D {
_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;
Expand Down
9 changes: 6 additions & 3 deletions scene/2d/light_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/light_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class PointLight2D : public Light2D {
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();
};
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/light_occluder_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/light_occluder_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class LightOccluder2D : public Node2D {
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();
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/navigation_agent_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/navigation_agent_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class NavigationAgent2D : public Node {

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;
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/navigation_link_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/navigation_link_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class NavigationLink2D : public Node2D {
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();
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/navigation_region_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/navigation_region_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class NavigationRegion2D : public Node2D {
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);
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/parallax_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/parallax_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ParallaxLayer : public Node2D {

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();
};

Expand Down
4 changes: 2 additions & 2 deletions scene/2d/path_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/path_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class PathFollow2D : public Node2D {
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() {}
};
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/physical_bone_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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!"));
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/physical_bone_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class PhysicalBone2D : public RigidBody2D {
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();
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/physics_body_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/physics_body_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class RigidBody2D : public PhysicsBody2D {

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();
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/remote_transform_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down
Loading

0 comments on commit d3852de

Please sign in to comment.