diff options
Diffstat (limited to 'scene/gui/graph_node.cpp')
-rw-r--r-- | scene/gui/graph_node.cpp | 87 |
1 files changed, 39 insertions, 48 deletions
diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index da298a795a..aa8c875f40 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -217,8 +217,8 @@ void GraphNode::_notification(int p_what) { sb = get_stylebox( selected ? "selectedframe" : "frame"); } - sb=sb->duplicate(); - sb->call("set_modulate",modulate); + //sb=sb->duplicate(); + //sb->call("set_modulate",modulate); Ref<Texture> port =get_icon("port"); Ref<Texture> close =get_icon("close"); Ref<Texture> resizer =get_icon("resizer"); @@ -621,7 +621,7 @@ Color GraphNode::get_connection_output_color(int p_idx) { return conn_output_cache[p_idx].color; } -void GraphNode::_input_event(const InputEvent& p_ev) { +void GraphNode::_gui_input(const InputEvent& p_ev) { if (p_ev.type==InputEvent::MOUSE_BUTTON) { @@ -675,16 +675,6 @@ void GraphNode::_input_event(const InputEvent& p_ev) { } -void GraphNode::set_modulate(const Color &p_color) { - - modulate=p_color; - update(); -} - -Color GraphNode::get_modulate() const{ - - return modulate; -} void GraphNode::set_overlay(Overlay p_overlay) { overlay=p_overlay; @@ -722,50 +712,51 @@ bool GraphNode::is_resizeable() const{ void GraphNode::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_title","title"),&GraphNode::set_title); - ObjectTypeDB::bind_method(_MD("get_title"),&GraphNode::get_title); - ObjectTypeDB::bind_method(_MD("_input_event"),&GraphNode::_input_event); + ClassDB::bind_method(_MD("set_title","title"),&GraphNode::set_title); + ClassDB::bind_method(_MD("get_title"),&GraphNode::get_title); + ClassDB::bind_method(_MD("_gui_input"),&GraphNode::_gui_input); - ObjectTypeDB::bind_method(_MD("set_slot","idx","enable_left","type_left","color_left","enable_right","type_right","color_right","custom_left","custom_right"),&GraphNode::set_slot,DEFVAL(Ref<Texture>()),DEFVAL(Ref<Texture>())); - ObjectTypeDB::bind_method(_MD("clear_slot","idx"),&GraphNode::clear_slot); - ObjectTypeDB::bind_method(_MD("clear_all_slots","idx"),&GraphNode::clear_all_slots); - ObjectTypeDB::bind_method(_MD("is_slot_enabled_left","idx"),&GraphNode::is_slot_enabled_left); - ObjectTypeDB::bind_method(_MD("get_slot_type_left","idx"),&GraphNode::get_slot_type_left); - ObjectTypeDB::bind_method(_MD("get_slot_color_left","idx"),&GraphNode::get_slot_color_left); - ObjectTypeDB::bind_method(_MD("is_slot_enabled_right","idx"),&GraphNode::is_slot_enabled_right); - ObjectTypeDB::bind_method(_MD("get_slot_type_right","idx"),&GraphNode::get_slot_type_right); - ObjectTypeDB::bind_method(_MD("get_slot_color_right","idx"),&GraphNode::get_slot_color_right); + ClassDB::bind_method(_MD("set_slot","idx","enable_left","type_left","color_left","enable_right","type_right","color_right","custom_left","custom_right"),&GraphNode::set_slot,DEFVAL(Ref<Texture>()),DEFVAL(Ref<Texture>())); + ClassDB::bind_method(_MD("clear_slot","idx"),&GraphNode::clear_slot); + ClassDB::bind_method(_MD("clear_all_slots","idx"),&GraphNode::clear_all_slots); + ClassDB::bind_method(_MD("is_slot_enabled_left","idx"),&GraphNode::is_slot_enabled_left); + ClassDB::bind_method(_MD("get_slot_type_left","idx"),&GraphNode::get_slot_type_left); + ClassDB::bind_method(_MD("get_slot_color_left","idx"),&GraphNode::get_slot_color_left); + ClassDB::bind_method(_MD("is_slot_enabled_right","idx"),&GraphNode::is_slot_enabled_right); + ClassDB::bind_method(_MD("get_slot_type_right","idx"),&GraphNode::get_slot_type_right); + ClassDB::bind_method(_MD("get_slot_color_right","idx"),&GraphNode::get_slot_color_right); - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&GraphNode::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&GraphNode::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&GraphNode::set_offset); + ClassDB::bind_method(_MD("get_offset"),&GraphNode::get_offset); - ObjectTypeDB::bind_method(_MD("set_comment","comment"),&GraphNode::set_comment); - ObjectTypeDB::bind_method(_MD("is_comment"),&GraphNode::is_comment); + ClassDB::bind_method(_MD("set_comment","comment"),&GraphNode::set_comment); + ClassDB::bind_method(_MD("is_comment"),&GraphNode::is_comment); - ObjectTypeDB::bind_method(_MD("set_resizeable","resizeable"),&GraphNode::set_resizeable); - ObjectTypeDB::bind_method(_MD("is_resizeable"),&GraphNode::is_resizeable); + ClassDB::bind_method(_MD("set_resizeable","resizeable"),&GraphNode::set_resizeable); + ClassDB::bind_method(_MD("is_resizeable"),&GraphNode::is_resizeable); - ObjectTypeDB::bind_method(_MD("get_connection_output_count"),&GraphNode::get_connection_output_count); - ObjectTypeDB::bind_method(_MD("get_connection_input_count"),&GraphNode::get_connection_input_count); + ClassDB::bind_method(_MD("set_selected","selected"),&GraphNode::set_selected); + ClassDB::bind_method(_MD("is_selected"),&GraphNode::is_selected); - ObjectTypeDB::bind_method(_MD("get_connection_output_pos","idx"),&GraphNode::get_connection_output_pos); - ObjectTypeDB::bind_method(_MD("get_connection_output_type","idx"),&GraphNode::get_connection_output_type); - ObjectTypeDB::bind_method(_MD("get_connection_output_color","idx"),&GraphNode::get_connection_output_color); - ObjectTypeDB::bind_method(_MD("get_connection_input_pos","idx"),&GraphNode::get_connection_input_pos); - ObjectTypeDB::bind_method(_MD("get_connection_input_type","idx"),&GraphNode::get_connection_input_type); - ObjectTypeDB::bind_method(_MD("get_connection_input_color","idx"),&GraphNode::get_connection_input_color); + ClassDB::bind_method(_MD("get_connection_output_count"),&GraphNode::get_connection_output_count); + ClassDB::bind_method(_MD("get_connection_input_count"),&GraphNode::get_connection_input_count); - ObjectTypeDB::bind_method(_MD("set_modulate","color"),&GraphNode::set_modulate); - ObjectTypeDB::bind_method(_MD("get_modulate"),&GraphNode::get_modulate); + ClassDB::bind_method(_MD("get_connection_output_pos","idx"),&GraphNode::get_connection_output_pos); + ClassDB::bind_method(_MD("get_connection_output_type","idx"),&GraphNode::get_connection_output_type); + ClassDB::bind_method(_MD("get_connection_output_color","idx"),&GraphNode::get_connection_output_color); + ClassDB::bind_method(_MD("get_connection_input_pos","idx"),&GraphNode::get_connection_input_pos); + ClassDB::bind_method(_MD("get_connection_input_type","idx"),&GraphNode::get_connection_input_type); + ClassDB::bind_method(_MD("get_connection_input_color","idx"),&GraphNode::get_connection_input_color); - ObjectTypeDB::bind_method(_MD("set_show_close_button","show"),&GraphNode::set_show_close_button); - ObjectTypeDB::bind_method(_MD("is_close_button_visible"),&GraphNode::is_close_button_visible); + ClassDB::bind_method(_MD("set_show_close_button","show"),&GraphNode::set_show_close_button); + ClassDB::bind_method(_MD("is_close_button_visible"),&GraphNode::is_close_button_visible); - ObjectTypeDB::bind_method(_MD("set_overlay","overlay"),&GraphNode::set_overlay); - ObjectTypeDB::bind_method(_MD("get_overlay"),&GraphNode::get_overlay); + ClassDB::bind_method(_MD("set_overlay","overlay"),&GraphNode::set_overlay); + ClassDB::bind_method(_MD("get_overlay"),&GraphNode::get_overlay); ADD_PROPERTY( PropertyInfo(Variant::STRING,"title"),_SCS("set_title"),_SCS("get_title")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"show_close"),_SCS("set_show_close_button"),_SCS("is_close_button_visible")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"resizeable"),_SCS("set_resizeable"),_SCS("is_resizeable")); ADD_SIGNAL(MethodInfo("offset_changed")); ADD_SIGNAL(MethodInfo("dragged",PropertyInfo(Variant::VECTOR2,"from"),PropertyInfo(Variant::VECTOR2,"to"))); @@ -783,9 +774,9 @@ GraphNode::GraphNode() { overlay=OVERLAY_DISABLED; show_close=false; connpos_dirty=true; - set_stop_mouse(false); - modulate=Color(1,1,1,1); + set_mouse_filter(MOUSE_FILTER_PASS); comment=false; resizeable=false; resizing=false; + selected=false; } |