[VisualShader] Add reroute node and improve port drawing
This commit is contained in:
@ -604,6 +604,14 @@ void GraphNode::set_slot_draw_stylebox(int p_slot_index, bool p_enable) {
|
||||
emit_signal(SNAME("slot_updated"), p_slot_index);
|
||||
}
|
||||
|
||||
void GraphNode::set_ignore_invalid_connection_type(bool p_ignore) {
|
||||
ignore_invalid_connection_type = p_ignore;
|
||||
}
|
||||
|
||||
bool GraphNode::is_ignoring_valid_connection_type() const {
|
||||
return ignore_invalid_connection_type;
|
||||
}
|
||||
|
||||
Size2 GraphNode::get_minimum_size() const {
|
||||
Ref<StyleBox> sb_panel = theme_cache.panel;
|
||||
Ref<StyleBox> sb_titlebar = theme_cache.titlebar;
|
||||
@ -859,6 +867,9 @@ void GraphNode::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("is_slot_draw_stylebox", "slot_index"), &GraphNode::is_slot_draw_stylebox);
|
||||
ClassDB::bind_method(D_METHOD("set_slot_draw_stylebox", "slot_index", "enable"), &GraphNode::set_slot_draw_stylebox);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_ignore_invalid_connection_type", "ignore"), &GraphNode::set_ignore_invalid_connection_type);
|
||||
ClassDB::bind_method(D_METHOD("is_ignoring_valid_connection_type"), &GraphNode::is_ignoring_valid_connection_type);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_input_port_count"), &GraphNode::get_input_port_count);
|
||||
ClassDB::bind_method(D_METHOD("get_input_port_position", "port_idx"), &GraphNode::get_input_port_position);
|
||||
ClassDB::bind_method(D_METHOD("get_input_port_type", "port_idx"), &GraphNode::get_input_port_type);
|
||||
@ -874,6 +885,8 @@ void GraphNode::_bind_methods() {
|
||||
GDVIRTUAL_BIND(_draw_port, "slot_index", "position", "left", "color")
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "title"), "set_title", "get_title");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ignore_invalid_connection_type"), "set_ignore_invalid_connection_type", "is_ignoring_valid_connection_type");
|
||||
|
||||
ADD_SIGNAL(MethodInfo("slot_updated", PropertyInfo(Variant::INT, "slot_index")));
|
||||
|
||||
BIND_THEME_ITEM(Theme::DATA_TYPE_STYLEBOX, GraphNode, panel);
|
||||
|
||||
Reference in New Issue
Block a user