1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

Remove GraphNode's comment property and related functionality

(this functionality will be reintroduced in a new and more flexible way)
This commit is contained in:
Hendrik Brucker
2023-07-11 01:15:57 +02:00
parent ef155c1aeb
commit 662d8c76b3
8 changed files with 10 additions and 156 deletions

View File

@@ -286,37 +286,12 @@ void GraphNode::_resort() {
connpos_dirty = true;
}
bool GraphNode::has_point(const Point2 &p_point) const {
if (comment) {
Ref<StyleBox> comment_sb = get_theme_stylebox(SNAME("comment"));
Ref<Texture2D> resizer = get_theme_icon(SNAME("resizer"));
if (Rect2(get_size() - resizer->get_size(), resizer->get_size()).has_point(p_point)) {
return true;
}
if (Rect2(0, 0, get_size().width, comment_sb->get_margin(SIDE_TOP)).has_point(p_point)) {
return true;
}
return false;
} else {
return Control::has_point(p_point);
}
}
void GraphNode::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_DRAW: {
Ref<StyleBox> sb;
if (comment) {
sb = get_theme_stylebox(selected ? SNAME("comment_focus") : SNAME("comment"));
} else {
sb = get_theme_stylebox(selected ? SNAME("selected_frame") : SNAME("frame"));
}
sb = get_theme_stylebox(selected ? SNAME("selected_frame") : SNAME("frame"));
Ref<StyleBox> sb_slot = get_theme_stylebox(SNAME("slot"));
@@ -1003,19 +978,6 @@ GraphNode::Overlay GraphNode::get_overlay() const {
return overlay;
}
void GraphNode::set_comment(bool p_enable) {
if (comment == p_enable) {
return;
}
comment = p_enable;
queue_redraw();
}
bool GraphNode::is_comment() const {
return comment;
}
void GraphNode::set_resizable(bool p_enable) {
if (resizable == p_enable) {
return;
@@ -1115,9 +1077,6 @@ void GraphNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_position_offset", "offset"), &GraphNode::set_position_offset);
ClassDB::bind_method(D_METHOD("get_position_offset"), &GraphNode::get_position_offset);
ClassDB::bind_method(D_METHOD("set_comment", "comment"), &GraphNode::set_comment);
ClassDB::bind_method(D_METHOD("is_comment"), &GraphNode::is_comment);
ClassDB::bind_method(D_METHOD("set_resizable", "resizable"), &GraphNode::set_resizable);
ClassDB::bind_method(D_METHOD("is_resizable"), &GraphNode::is_resizable);
@@ -1157,7 +1116,6 @@ void GraphNode::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draggable"), "set_draggable", "is_draggable");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selectable"), "set_selectable", "is_selectable");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selected"), "set_selected", "is_selected");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "comment"), "set_comment", "is_comment");
ADD_PROPERTY(PropertyInfo(Variant::INT, "overlay", PROPERTY_HINT_ENUM, "Disabled,Breakpoint,Position"), "set_overlay", "get_overlay");
ADD_GROUP("BiDi", "");