diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/canvas_item.cpp | 17 | ||||
-rw-r--r-- | scene/2d/canvas_item.h | 1 | ||||
-rw-r--r-- | scene/animation/animation_player.cpp | 2 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 15 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 1 | ||||
-rw-r--r-- | scene/resources/animation.cpp | 26 | ||||
-rw-r--r-- | scene/resources/animation.h | 6 |
7 files changed, 47 insertions, 21 deletions
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 8864459dfb..fa9b040d92 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -112,21 +112,9 @@ void CanvasItemMaterial::_get_property_list( List<PropertyInfo> *p_list) const { void CanvasItemMaterial::set_shader(const Ref<Shader>& p_shader) { ERR_FAIL_COND(p_shader.is_valid() && p_shader->get_mode()!=Shader::MODE_CANVAS_ITEM); -#ifdef TOOLS_ENABLED - if (shader.is_valid()) { - shader->disconnect("changed",this,"_shader_changed"); - } -#endif shader=p_shader; -#ifdef TOOLS_ENABLED - - if (shader.is_valid()) { - shader->connect("changed",this,"_shader_changed"); - } -#endif - RID rid; if (shader.is_valid()) rid=shader->get_rid(); @@ -151,11 +139,6 @@ Variant CanvasItemMaterial::get_shader_param(const StringName& p_param) const{ return VS::get_singleton()->canvas_item_material_get_shader_param(material,p_param); } -void CanvasItemMaterial::_shader_changed() { - - -} - RID CanvasItemMaterial::get_rid() const { return material; diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index d915f742ec..8b44e09857 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -60,7 +60,6 @@ protected: bool _get(const StringName& p_name,Variant &r_ret) const; void _get_property_list( List<PropertyInfo> *p_list) const; - void _shader_changed(); static void _bind_methods(); void get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const; diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 0ff6931dcd..dd4fa992ac 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -572,7 +572,7 @@ void AnimationPlayer::_animation_process_data(PlaybackData &cd,float p_delta,flo } else { - if (next_pos<0 or next_pos>len) { + if (next_pos<0 || next_pos>len) { if (!backwards) next_pos=0; else if (backwards) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index ec0573e396..7fbd412de8 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -417,8 +417,22 @@ void TextEdit::_notification(int p_what) { _update_caches(); } break; + case MainLoop::NOTIFICATION_WM_FOCUS_IN: { + window_has_focus = true; + draw_caret = true; + update(); + } break; + case MainLoop::NOTIFICATION_WM_FOCUS_OUT: { + window_has_focus = false; + draw_caret = false; + update(); + } break; case NOTIFICATION_DRAW: { + if ((!has_focus() && !menu->has_focus()) || !window_has_focus) { + draw_caret = false; + } + if (draw_breakpoint_gutter) { breakpoint_gutter_width = (get_row_height() * 55) / 100; cache.breakpoint_gutter_width = breakpoint_gutter_width; @@ -4513,6 +4527,7 @@ TextEdit::TextEdit() { brace_matching_enabled=false; auto_indent=false; insert_mode = false; + window_has_focus=true; menu = memnew( PopupMenu ); add_child(menu); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 22f024c491..f01e6de1c9 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -217,6 +217,7 @@ class TextEdit : public Control { Timer *caret_blink_timer; bool caret_blink_enabled; bool draw_caret; + bool window_has_focus; bool setting_row; bool wrap; diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index b6fc3eb419..9b657d1b8f 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -74,6 +74,8 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { track_set_path(track,p_value); else if (what=="interp") track_set_interpolation_type(track,InterpolationType(p_value.operator int())); + else if (what=="imported") + track_set_imported(track,p_value); else if (what == "keys" || what=="key_values") { if (track_get_type(track)==TYPE_TRANSFORM) { @@ -171,6 +173,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { } + DVector<float> times=d["times"]; Array values=d["values"]; @@ -290,6 +293,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { r_ret=track_get_path(track); else if (what=="interp") r_ret = track_get_interpolation_type(track); + else if (what=="imported") + r_ret = track_is_imported(track); else if (what=="keys") { if (track_get_type(track)==TYPE_TRANSFORM) { @@ -437,6 +442,7 @@ void Animation::_get_property_list( List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo( Variant::STRING, "tracks/"+itos(i)+"/type", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); p_list->push_back( PropertyInfo( Variant::NODE_PATH, "tracks/"+itos(i)+"/path", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); p_list->push_back( PropertyInfo( Variant::INT, "tracks/"+itos(i)+"/interp", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); + p_list->push_back( PropertyInfo( Variant::BOOL, "tracks/"+itos(i)+"/imported", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); p_list->push_back( PropertyInfo( Variant::ARRAY, "tracks/"+itos(i)+"/keys", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); } } @@ -1235,7 +1241,7 @@ T Animation::_interpolate( const Vector< TKey<T> >& p_keys, float p_time, Inter float c=0; // prepare for all cases of interpolation - if (loop and loop_interpolation) { + if (loop && loop_interpolation) { // loop if (idx>=0) { @@ -1648,6 +1654,20 @@ void Animation::track_move_up(int p_track) { emit_changed(); } +void Animation::track_set_imported(int p_track,bool p_imported) { + + ERR_FAIL_INDEX(p_track,tracks.size()); + tracks[p_track]->imported=p_imported; +} + +bool Animation::track_is_imported(int p_track) const{ + + ERR_FAIL_INDEX_V(p_track,tracks.size(),false); + return tracks[p_track]->imported; + +} + + void Animation::track_move_down(int p_track) { if (p_track>0 && p_track<tracks.size()) { @@ -1682,6 +1702,10 @@ void Animation::_bind_methods() { ObjectTypeDB::bind_method(_MD("track_move_up","idx"),&Animation::track_move_up); ObjectTypeDB::bind_method(_MD("track_move_down","idx"),&Animation::track_move_down); + ObjectTypeDB::bind_method(_MD("track_set_imported","idx","imported"),&Animation::track_set_imported); + ObjectTypeDB::bind_method(_MD("track_is_imported","idx"),&Animation::track_is_imported); + + ObjectTypeDB::bind_method(_MD("transform_track_insert_key","idx","time","loc","rot","scale"),&Animation::transform_track_insert_key); ObjectTypeDB::bind_method(_MD("track_insert_key","idx","time","key","transition"),&Animation::track_insert_key,DEFVAL(1)); ObjectTypeDB::bind_method(_MD("track_remove_key","idx","key_idx"),&Animation::track_remove_key); diff --git a/scene/resources/animation.h b/scene/resources/animation.h index 8b677fe0da..ee643c9678 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -72,7 +72,8 @@ private: TrackType type; InterpolationType interpolation; NodePath path; // path to something - Track() { interpolation=INTERPOLATION_LINEAR; } + bool imported; + Track() { interpolation=INTERPOLATION_LINEAR; imported=false;} virtual ~Track() {} }; @@ -241,6 +242,9 @@ public: void track_move_up(int p_track); void track_move_down(int p_track); + void track_set_imported(int p_track,bool p_imported); + bool track_is_imported(int p_track) const; + int transform_track_insert_key(int p_track, float p_time, const Vector3 p_loc, const Quat& p_rot=Quat(), const Vector3& p_scale=Vector3()); void track_insert_key(int p_track, float p_time, const Variant& p_key, float p_transition=1); void track_set_key_transition(int p_track, int p_key_idx,float p_transition); |