Merge pull request #77779 from KoBeWi/emit_changed()

Use `emit_changed()` consistently
This commit is contained in:
Rémi Verschelde 2023-06-10 12:11:25 +02:00
commit fe0ee24533
No known key found for this signature in database
GPG Key ID: C3336907360768E1
3 changed files with 14 additions and 18 deletions

View File

@ -30,7 +30,6 @@
#include "curve.h" #include "curve.h"
#include "core/core_string_names.h"
#include "core/math/math_funcs.h" #include "core/math/math_funcs.h"
const char *Curve::SIGNAL_RANGE_CHANGED = "range_changed"; const char *Curve::SIGNAL_RANGE_CHANGED = "range_changed";
@ -388,7 +387,7 @@ real_t Curve::sample_local_nocheck(int p_index, real_t p_local_offset) const {
void Curve::mark_dirty() { void Curve::mark_dirty() {
_baked_cache_dirty = true; _baked_cache_dirty = true;
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
Array Curve::get_data() const { Array Curve::get_data() const {
@ -775,7 +774,7 @@ Vector2 Curve2D::samplef(real_t p_findex) const {
void Curve2D::mark_dirty() { void Curve2D::mark_dirty() {
baked_cache_dirty = true; baked_cache_dirty = true;
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
void Curve2D::_bake_segment2d(RBMap<real_t, Vector2> &r_bake, real_t p_begin, real_t p_end, const Vector2 &p_a, const Vector2 &p_out, const Vector2 &p_b, const Vector2 &p_in, int p_depth, int p_max_depth, real_t p_tol) const { void Curve2D::_bake_segment2d(RBMap<real_t, Vector2> &r_bake, real_t p_begin, real_t p_end, const Vector2 &p_a, const Vector2 &p_out, const Vector2 &p_b, const Vector2 &p_in, int p_depth, int p_max_depth, real_t p_tol) const {
@ -1492,7 +1491,7 @@ Vector3 Curve3D::samplef(real_t p_findex) const {
void Curve3D::mark_dirty() { void Curve3D::mark_dirty() {
baked_cache_dirty = true; baked_cache_dirty = true;
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
void Curve3D::_bake_segment3d(RBMap<real_t, Vector3> &r_bake, real_t p_begin, real_t p_end, const Vector3 &p_a, const Vector3 &p_out, const Vector3 &p_b, const Vector3 &p_in, int p_depth, int p_max_depth, real_t p_tol) const { void Curve3D::_bake_segment3d(RBMap<real_t, Vector3> &r_bake, real_t p_begin, real_t p_end, const Vector3 &p_a, const Vector3 &p_out, const Vector3 &p_b, const Vector3 &p_in, int p_depth, int p_max_depth, real_t p_tol) const {

View File

@ -30,8 +30,6 @@
#include "gradient.h" #include "gradient.h"
#include "core/core_string_names.h"
Gradient::Gradient() { Gradient::Gradient() {
//Set initial gradient transition from black to white //Set initial gradient transition from black to white
points.resize(2); points.resize(2);
@ -119,7 +117,7 @@ void Gradient::set_interpolation_mode(Gradient::InterpolationMode p_interp_mode)
} }
interpolation_mode = p_interp_mode; interpolation_mode = p_interp_mode;
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
notify_property_list_changed(); notify_property_list_changed();
} }
@ -133,7 +131,7 @@ void Gradient::set_interpolation_color_space(Gradient::ColorSpace p_color_space)
} }
interpolation_color_space = p_color_space; interpolation_color_space = p_color_space;
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
Gradient::ColorSpace Gradient::get_interpolation_color_space() { Gradient::ColorSpace Gradient::get_interpolation_color_space() {
@ -146,7 +144,7 @@ void Gradient::set_offsets(const Vector<float> &p_offsets) {
points.write[i].offset = p_offsets[i]; points.write[i].offset = p_offsets[i];
} }
is_sorted = false; is_sorted = false;
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
void Gradient::set_colors(const Vector<Color> &p_colors) { void Gradient::set_colors(const Vector<Color> &p_colors) {
@ -157,7 +155,7 @@ void Gradient::set_colors(const Vector<Color> &p_colors) {
for (int i = 0; i < points.size(); i++) { for (int i = 0; i < points.size(); i++) {
points.write[i].color = p_colors[i]; points.write[i].color = p_colors[i];
} }
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
Vector<Gradient::Point> &Gradient::get_points() { Vector<Gradient::Point> &Gradient::get_points() {
@ -171,14 +169,14 @@ void Gradient::add_point(float p_offset, const Color &p_color) {
is_sorted = false; is_sorted = false;
points.push_back(p); points.push_back(p);
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
void Gradient::remove_point(int p_index) { void Gradient::remove_point(int p_index) {
ERR_FAIL_INDEX(p_index, points.size()); ERR_FAIL_INDEX(p_index, points.size());
ERR_FAIL_COND(points.size() <= 1); ERR_FAIL_COND(points.size() <= 1);
points.remove_at(p_index); points.remove_at(p_index);
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
void Gradient::reverse() { void Gradient::reverse() {
@ -188,13 +186,13 @@ void Gradient::reverse() {
is_sorted = false; is_sorted = false;
_update_sorting(); _update_sorting();
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
void Gradient::set_points(const Vector<Gradient::Point> &p_points) { void Gradient::set_points(const Vector<Gradient::Point> &p_points) {
points = p_points; points = p_points;
is_sorted = false; is_sorted = false;
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
void Gradient::set_offset(int pos, const float offset) { void Gradient::set_offset(int pos, const float offset) {
@ -202,7 +200,7 @@ void Gradient::set_offset(int pos, const float offset) {
_update_sorting(); _update_sorting();
points.write[pos].offset = offset; points.write[pos].offset = offset;
is_sorted = false; is_sorted = false;
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
float Gradient::get_offset(int pos) { float Gradient::get_offset(int pos) {
@ -215,7 +213,7 @@ void Gradient::set_color(int pos, const Color &color) {
ERR_FAIL_INDEX(pos, points.size()); ERR_FAIL_INDEX(pos, points.size());
_update_sorting(); _update_sorting();
points.write[pos].color = color; points.write[pos].color = color;
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
Color Gradient::get_color(int pos) { Color Gradient::get_color(int pos) {

View File

@ -30,7 +30,6 @@
#include "navigation_polygon.h" #include "navigation_polygon.h"
#include "core/core_string_names.h"
#include "core/math/geometry_2d.h" #include "core/math/geometry_2d.h"
#include "core/os/mutex.h" #include "core/os/mutex.h"
@ -320,7 +319,7 @@ void NavigationPolygon::make_polygons_from_outlines() {
polygons.push_back(p); polygons.push_back(p);
} }
emit_signal(CoreStringNames::get_singleton()->changed); emit_changed();
} }
void NavigationPolygon::_bind_methods() { void NavigationPolygon::_bind_methods() {