mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-15 07:01:11 +01:00
Fix loading cursors for the gradient editor.
This commit is contained in:
parent
275d0604f8
commit
1ec5e8a756
@ -8,6 +8,11 @@ Color GradientCursor::get_cursor_color() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GradientCursor::set_cursor_color(const Color &val) {
|
void GradientCursor::set_cursor_color(const Color &val) {
|
||||||
|
color = val;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GradientCursor::set_cursor_color_notify(const Color &val) {
|
||||||
color = val;
|
color = val;
|
||||||
MMGradientEditor *ged = Object::cast_to<MMGradientEditor>(get_parent());
|
MMGradientEditor *ged = Object::cast_to<MMGradientEditor>(get_parent());
|
||||||
ERR_FAIL_COND(!ged);
|
ERR_FAIL_COND(!ged);
|
||||||
@ -104,7 +109,7 @@ bool GradientCursor::can_drop_data_fw(const Point2 &p_point, const Variant &p_da
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GradientCursor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
|
void GradientCursor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
|
||||||
set_cursor_color(p_data);
|
set_cursor_color_notify(p_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
GradientCursor::GradientCursor() {
|
GradientCursor::GradientCursor() {
|
||||||
@ -132,6 +137,8 @@ void GradientCursor::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("set_cursor_color", "value"), &GradientCursor::set_cursor_color);
|
ClassDB::bind_method(D_METHOD("set_cursor_color", "value"), &GradientCursor::set_cursor_color);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "cursor_color"), "set_cursor_color", "get_cursor_color");
|
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "cursor_color"), "set_cursor_color", "get_cursor_color");
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("set_cursor_color_notify", "value"), &GradientCursor::set_cursor_color_notify);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_sliding"), &GradientCursor::get_sliding);
|
ClassDB::bind_method(D_METHOD("get_sliding"), &GradientCursor::get_sliding);
|
||||||
ClassDB::bind_method(D_METHOD("set_sliding", "value"), &GradientCursor::set_sliding);
|
ClassDB::bind_method(D_METHOD("set_sliding", "value"), &GradientCursor::set_sliding);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sliding"), "set_sliding", "get_sliding");
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sliding"), "set_sliding", "get_sliding");
|
||||||
|
@ -17,6 +17,8 @@ public:
|
|||||||
Color get_cursor_color();
|
Color get_cursor_color();
|
||||||
void set_cursor_color(const Color &val);
|
void set_cursor_color(const Color &val);
|
||||||
|
|
||||||
|
void set_cursor_color_notify(const Color &val);
|
||||||
|
|
||||||
bool get_sliding() const;
|
bool get_sliding() const;
|
||||||
void set_sliding(const bool val);
|
void set_sliding(const bool val);
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ void MMGradientEditor::select_color(GradientCursor *cursor, const Vector2 &posit
|
|||||||
|
|
||||||
ColorPicker *color_picker = color_picker_popup->color_picker;
|
ColorPicker *color_picker = color_picker_popup->color_picker;
|
||||||
color_picker->set_pick_color(cursor->get_cursor_color());
|
color_picker->set_pick_color(cursor->get_cursor_color());
|
||||||
color_picker->connect("color_changed", cursor, "set_cursor_color");
|
color_picker->connect("color_changed", cursor, "set_cursor_color_notify");
|
||||||
|
|
||||||
color_picker_popup->set_position(position);
|
color_picker_popup->set_position(position);
|
||||||
color_picker_popup->connect("popup_hide", this, "undo_redo_save_color_state");
|
color_picker_popup->connect("popup_hide", this, "undo_redo_save_color_state");
|
||||||
|
Loading…
Reference in New Issue
Block a user