summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/canvas_item.cpp68
-rw-r--r--scene/2d/canvas_item.h1
-rw-r--r--scene/2d/parallax_background.cpp15
-rw-r--r--scene/2d/parallax_background.h7
-rw-r--r--scene/2d/parallax_layer.cpp54
-rw-r--r--scene/2d/parallax_layer.h4
-rw-r--r--scene/2d/sprite.cpp2
-rw-r--r--scene/3d/skeleton.cpp16
-rw-r--r--scene/animation/animation_player.cpp14
-rw-r--r--scene/audio/stream_player.cpp10
-rw-r--r--scene/audio/stream_player.h2
-rw-r--r--scene/gui/base_button.cpp5
-rw-r--r--scene/gui/control.cpp19
-rw-r--r--scene/gui/control.h2
-rw-r--r--scene/gui/item_list.cpp16
-rw-r--r--scene/gui/item_list.h1
-rw-r--r--scene/gui/patch_9_frame.cpp5
-rw-r--r--scene/gui/text_edit.cpp6
-rw-r--r--scene/main/node.cpp14
-rw-r--r--scene/main/node.h3
-rw-r--r--scene/main/viewport.cpp33
-rw-r--r--scene/main/viewport.h1
-rw-r--r--scene/resources/animation.cpp22
-rw-r--r--scene/resources/animation.h3
-rw-r--r--scene/resources/packed_scene.cpp4
-rw-r--r--scene/resources/packed_scene.h1
-rw-r--r--scene/resources/sample.cpp2
-rw-r--r--scene/resources/sample.h1
-rw-r--r--scene/resources/scene_format_text.cpp55
-rw-r--r--scene/resources/scene_format_text.h2
-rw-r--r--scene/resources/style_box.cpp5
-rw-r--r--scene/resources/texture.cpp9
-rw-r--r--scene/resources/texture.h1
33 files changed, 247 insertions, 156 deletions
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp
index 976a5c4f1e..bc5bff3b8e 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -756,6 +756,17 @@ void CanvasItem::draw_set_transform(const Point2& p_offset, float p_rot, const S
VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item,xform);
}
+void CanvasItem::draw_set_transform_matrix(const Matrix32& p_matrix) {
+
+ if (!drawing) {
+ ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
+ ERR_FAIL();
+ }
+
+ VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item,p_matrix);
+
+}
+
void CanvasItem::draw_polygon(const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, Ref<Texture> p_texture) {
if (!drawing) {
@@ -942,62 +953,8 @@ InputEvent CanvasItem::make_input_local(const InputEvent& p_event) const {
ERR_FAIL_COND_V(!is_inside_tree(),p_event);
- InputEvent ev = p_event;
-
- Matrix32 local_matrix = (get_canvas_transform() * get_global_transform()).affine_inverse();
-
- switch(ev.type) {
-
- case InputEvent::MOUSE_BUTTON: {
-
- Vector2 g = local_matrix.xform(Vector2(ev.mouse_button.global_x,ev.mouse_button.global_y));
- Vector2 l = local_matrix.xform(Vector2(ev.mouse_button.x,ev.mouse_button.y));
- ev.mouse_button.x=l.x;
- ev.mouse_button.y=l.y;
- ev.mouse_button.global_x=g.x;
- ev.mouse_button.global_y=g.y;
-
- } break;
- case InputEvent::MOUSE_MOTION: {
-
- Vector2 g = local_matrix.xform(Vector2(ev.mouse_motion.global_x,ev.mouse_motion.global_y));
- Vector2 l = local_matrix.xform(Vector2(ev.mouse_motion.x,ev.mouse_motion.y));
- Vector2 r = local_matrix.basis_xform(Vector2(ev.mouse_motion.relative_x,ev.mouse_motion.relative_y));
- Vector2 s = local_matrix.basis_xform(Vector2(ev.mouse_motion.speed_x,ev.mouse_motion.speed_y));
- ev.mouse_motion.x=l.x;
- ev.mouse_motion.y=l.y;
- ev.mouse_motion.global_x=g.x;
- ev.mouse_motion.global_y=g.y;
- ev.mouse_motion.relative_x=r.x;
- ev.mouse_motion.relative_y=r.y;
- ev.mouse_motion.speed_x=s.x;
- ev.mouse_motion.speed_y=s.y;
-
- } break;
- case InputEvent::SCREEN_TOUCH: {
-
-
- Vector2 t = local_matrix.xform(Vector2(ev.screen_touch.x,ev.screen_touch.y));
- ev.screen_touch.x=t.x;
- ev.screen_touch.y=t.y;
-
- } break;
- case InputEvent::SCREEN_DRAG: {
-
-
- Vector2 t = local_matrix.xform(Vector2(ev.screen_drag.x,ev.screen_drag.y));
- Vector2 r = local_matrix.basis_xform(Vector2(ev.screen_drag.relative_x,ev.screen_drag.relative_y));
- Vector2 s = local_matrix.basis_xform(Vector2(ev.screen_drag.speed_x,ev.screen_drag.speed_y));
- ev.screen_drag.x=t.x;
- ev.screen_drag.y=t.y;
- ev.screen_drag.relative_x=r.x;
- ev.screen_drag.relative_y=r.y;
- ev.screen_drag.speed_x=s.x;
- ev.screen_drag.speed_y=s.y;
- } break;
- }
+ return p_event.xform_by( (get_canvas_transform() * get_global_transform()).affine_inverse() );
- return ev;
}
@@ -1076,6 +1033,7 @@ void CanvasItem::_bind_methods() {
ObjectTypeDB::bind_method(_MD("draw_char","font:Font","pos","char","next","modulate"),&CanvasItem::draw_char,DEFVAL(Color(1,1,1)));
ObjectTypeDB::bind_method(_MD("draw_set_transform","pos","rot","scale"),&CanvasItem::draw_set_transform);
+ ObjectTypeDB::bind_method(_MD("draw_set_transform_matrix","xform"),&CanvasItem::draw_set_transform_matrix);
ObjectTypeDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform);
ObjectTypeDB::bind_method(_MD("get_global_transform"),&CanvasItem::get_global_transform);
ObjectTypeDB::bind_method(_MD("get_global_transform_with_canvas"),&CanvasItem::get_global_transform_with_canvas);
diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h
index 8b44e09857..8a61b449fd 100644
--- a/scene/2d/canvas_item.h
+++ b/scene/2d/canvas_item.h
@@ -222,6 +222,7 @@ public:
float draw_char(const Ref<Font>& p_font,const Point2& p_pos, const String& p_char,const String& p_next="",const Color& p_modulate=Color(1,1,1));
void draw_set_transform(const Point2& p_offset, float p_rot, const Size2& p_scale);
+ void draw_set_transform_matrix(const Matrix32& p_matrix);
/* RECT / TRANSFORM */
diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp
index 7f2e9efd96..1b6ab66fcc 100644
--- a/scene/2d/parallax_background.cpp
+++ b/scene/2d/parallax_background.cpp
@@ -104,16 +104,18 @@ void ParallaxBackground::_update_scroll() {
}
ofs = -ofs;
+ final_offset=ofs;
+
for(int i=0;i<get_child_count();i++) {
ParallaxLayer *l=get_child(i)->cast_to<ParallaxLayer>();
if (!l)
continue;
- if (ignore_camera_zoom)
- l->set_base_offset_and_scale(ofs, 1.0);
- else
- l->set_base_offset_and_scale(ofs, scale);
+ if (ignore_camera_zoom)
+ l->set_base_offset_and_scale(ofs, 1.0);
+ else
+ l->set_base_offset_and_scale(ofs, scale);
}
}
@@ -180,6 +182,11 @@ bool ParallaxBackground::is_ignore_camera_zoom(){
}
+Vector2 ParallaxBackground::get_final_offset() const {
+
+ return final_offset;
+}
+
void ParallaxBackground::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_camera_moved"),&ParallaxBackground::_camera_moved);
diff --git a/scene/2d/parallax_background.h b/scene/2d/parallax_background.h
index bdaf7d241f..c00cd52f26 100644
--- a/scene/2d/parallax_background.h
+++ b/scene/2d/parallax_background.h
@@ -44,6 +44,7 @@ class ParallaxBackground : public CanvasLayer {
String group_name;
Point2 limit_begin;
Point2 limit_end;
+ Point2 final_offset;
bool ignore_camera_zoom;
void _update_scroll();
@@ -73,8 +74,10 @@ public:
void set_limit_end(const Point2& p_ofs);
Point2 get_limit_end() const;
- void set_ignore_camera_zoom(bool ignore);
- bool is_ignore_camera_zoom();
+ void set_ignore_camera_zoom(bool ignore);
+ bool is_ignore_camera_zoom();
+
+ Vector2 get_final_offset() const;
ParallaxBackground();
};
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp
index a67ea04959..e9378b1d02 100644
--- a/scene/2d/parallax_layer.cpp
+++ b/scene/2d/parallax_layer.cpp
@@ -32,6 +32,15 @@
void ParallaxLayer::set_motion_scale(const Size2& p_scale) {
motion_scale=p_scale;
+
+
+ ParallaxBackground *pb = get_parent()->cast_to<ParallaxBackground>();
+ if (is_inside_tree() && pb) {
+ Vector2 ofs = pb->get_final_offset();
+ float scale = pb->get_scroll_scale();
+ set_base_offset_and_scale(ofs,scale);
+ }
+
}
Size2 ParallaxLayer::get_motion_scale() const {
@@ -40,6 +49,23 @@ Size2 ParallaxLayer::get_motion_scale() const {
}
+void ParallaxLayer::set_motion_offset(const Size2& p_offset) {
+
+ motion_offset=p_offset;
+
+ ParallaxBackground *pb = get_parent()->cast_to<ParallaxBackground>();
+ if (is_inside_tree() && pb) {
+ Vector2 ofs = pb->get_final_offset();
+ float scale = pb->get_scroll_scale();
+ set_base_offset_and_scale(ofs,scale);
+ }
+}
+
+Size2 ParallaxLayer::get_motion_offset() const {
+
+ return motion_offset;
+
+}
void ParallaxLayer::_update_mirroring() {
@@ -59,6 +85,11 @@ void ParallaxLayer::_update_mirroring() {
void ParallaxLayer::set_mirroring(const Size2& p_mirroring) {
mirroring=p_mirroring;
+ if (mirroring.x<0)
+ mirroring.x=0;
+ if (mirroring.y<0)
+ mirroring.y=0;
+
_update_mirroring();
}
@@ -89,16 +120,26 @@ void ParallaxLayer::set_base_offset_and_scale(const Point2& p_offset,float p_sca
return;
if (get_tree()->is_editor_hint())
return;
- Point2 new_ofs = ((orig_offset+p_offset)*motion_scale)*p_scale;
+ Point2 new_ofs = ((orig_offset+p_offset)*motion_scale)*p_scale+motion_offset;
if (mirroring.x) {
- double den = mirroring.x*p_scale;
- new_ofs.x = fmod(new_ofs.x,den) - (mirroring.x > 0 ? den : 0);
+
+ while( new_ofs.x>=0) {
+ new_ofs.x -= mirroring.x*p_scale;
+ }
+ while(new_ofs.x < -mirroring.x*p_scale) {
+ new_ofs.x += mirroring.x*p_scale;
+ }
}
if (mirroring.y) {
- double den = mirroring.y*p_scale;
- new_ofs.y = fmod(new_ofs.y,den) - (mirroring.y > 0 ? den : 0);
+
+ while( new_ofs.y>=0) {
+ new_ofs.y -= mirroring.y*p_scale;
+ }
+ while(new_ofs.y < -mirroring.y*p_scale) {
+ new_ofs.y += mirroring.y*p_scale;
+ }
}
@@ -122,10 +163,13 @@ void ParallaxLayer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_motion_scale","scale"),&ParallaxLayer::set_motion_scale);
ObjectTypeDB::bind_method(_MD("get_motion_scale"),&ParallaxLayer::get_motion_scale);
+ ObjectTypeDB::bind_method(_MD("set_motion_offset","offset"),&ParallaxLayer::set_motion_offset);
+ ObjectTypeDB::bind_method(_MD("get_motion_offset"),&ParallaxLayer::get_motion_offset);
ObjectTypeDB::bind_method(_MD("set_mirroring","mirror"),&ParallaxLayer::set_mirroring);
ObjectTypeDB::bind_method(_MD("get_mirroring"),&ParallaxLayer::get_mirroring);
ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion/scale"),_SCS("set_motion_scale"),_SCS("get_motion_scale"));
+ ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion/offset"),_SCS("set_motion_offset"),_SCS("get_motion_offset"));
ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion/mirroring"),_SCS("set_mirroring"),_SCS("get_mirroring"));
}
diff --git a/scene/2d/parallax_layer.h b/scene/2d/parallax_layer.h
index c2d345da47..6b1d73ea66 100644
--- a/scene/2d/parallax_layer.h
+++ b/scene/2d/parallax_layer.h
@@ -38,6 +38,7 @@ class ParallaxLayer : public Node2D {
Point2 orig_offset;
Point2 orig_scale;
Size2 motion_scale;
+ Vector2 motion_offset;
Vector2 mirroring;
void _update_mirroring();
@@ -48,6 +49,9 @@ protected:
public:
+ void set_motion_offset(const Size2& p_scale);
+ Size2 get_motion_offset() const;
+
void set_motion_scale(const Size2& p_scale);
Size2 get_motion_scale() const;
diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp
index 3e6384ea2c..27aa08ec5b 100644
--- a/scene/2d/sprite.cpp
+++ b/scene/2d/sprite.cpp
@@ -120,6 +120,7 @@ void Sprite::set_texture(const Ref<Texture>& p_texture) {
}
#endif
update();
+ emit_signal("texture_changed");
item_rect_changed();
}
@@ -323,6 +324,7 @@ void Sprite::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_modulate"),&Sprite::get_modulate);
ADD_SIGNAL(MethodInfo("frame_changed"));
+ ADD_SIGNAL(MethodInfo("texture_changed"));
ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_texture"),_SCS("get_texture"));
ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "centered"), _SCS("set_centered"),_SCS("is_centered"));
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index d0b739e17f..c996a8123c 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -64,15 +64,17 @@ bool Skeleton::_set(const StringName& p_path, const Variant& p_value) {
else if (what=="bound_childs") {
Array children=p_value;
- bones[which].nodes_bound.clear();
+ if (is_inside_tree()) {
+ bones[which].nodes_bound.clear();
- for (int i=0;i<children.size();i++) {
+ for (int i=0;i<children.size();i++) {
- NodePath path=children[i];
- ERR_CONTINUE( path.operator String()=="" );
- Node *node = get_node(path);
- ERR_CONTINUE(!node);
- bind_child_node_to_bone(which,node);
+ NodePath path=children[i];
+ ERR_CONTINUE( path.operator String()=="" );
+ Node *node = get_node(path);
+ ERR_CONTINUE(!node);
+ bind_child_node_to_bone(which,node);
+ }
}
} else {
return false;
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index dd4fa992ac..30af9b0094 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -540,7 +540,6 @@ void AnimationPlayer::_animation_process_data(PlaybackData &cd,float p_delta,flo
float len=cd.from->animation->get_length();
bool loop=cd.from->animation->has_loop();
- bool loop_interpolation=cd.from->animation->has_loop_interpolation();
if (!loop) {
@@ -566,21 +565,10 @@ void AnimationPlayer::_animation_process_data(PlaybackData &cd,float p_delta,flo
}
- } else if (loop_interpolation) {
+ } else {
next_pos=Math::fposmod(next_pos,len);
- } else {
-
- if (next_pos<0 || next_pos>len) {
- if (!backwards)
- next_pos=0;
- else if (backwards)
- next_pos=len;
- }
- // fix delta - not sure if needed here
- delta=next_pos-cd.pos;
-
}
cd.pos=next_pos;
diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp
index 050e945c8f..99ecace1ed 100644
--- a/scene/audio/stream_player.cpp
+++ b/scene/audio/stream_player.cpp
@@ -77,7 +77,7 @@ void StreamPlayer::sp_update() {
if (to_mix==0) {
if (!stop_request) {
stop_request=true;
- call_deferred("stop");
+ call_deferred("_do_stop");
}
return;
}
@@ -91,7 +91,10 @@ void StreamPlayer::sp_update() {
}
}
-
+void StreamPlayer::_do_stop() {
+ stop();
+ emit_signal("finished");
+}
void StreamPlayer::_notification(int p_what) {
@@ -181,7 +184,7 @@ void StreamPlayer::stop() {
stop_request=false;
playback->stop();
resampler.flush();
- emit_signal("finished");
+
//set_idle_process(false);
}
@@ -381,6 +384,7 @@ void StreamPlayer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_set_play","play"),&StreamPlayer::_set_play);
ObjectTypeDB::bind_method(_MD("_get_play"),&StreamPlayer::_get_play);
+ ObjectTypeDB::bind_method(_MD("_do_stop"),&StreamPlayer::_do_stop);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream/stream", PROPERTY_HINT_RESOURCE_TYPE,"AudioStream"), _SCS("set_stream"), _SCS("get_stream") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/play"), _SCS("_set_play"), _SCS("_get_play") );
diff --git a/scene/audio/stream_player.h b/scene/audio/stream_player.h
index 475139c2a4..4facc3c816 100644
--- a/scene/audio/stream_player.h
+++ b/scene/audio/stream_player.h
@@ -71,6 +71,8 @@ class StreamPlayer : public Node {
AudioRBResampler resampler;
+ void _do_stop();
+
bool _play;
void _set_play(bool p_play);
bool _get_play() const;
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index d7632b14b8..a2b7cd2e0a 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -31,6 +31,7 @@
#include "print_string.h"
#include "button_group.h"
#include "scene/scene_string_names.h"
+#include "scene/main/viewport.h"
void BaseButton::_input_event(InputEvent p_event) {
@@ -416,6 +417,10 @@ Ref<ShortCut> BaseButton:: get_shortcut() const {
void BaseButton::_unhandled_input(InputEvent p_event) {
if (!is_disabled() && is_visible() && shortcut.is_valid() && shortcut->is_shortcut(p_event)) {
+
+ if (get_viewport()->get_modal_stack_top() && !get_viewport()->get_modal_stack_top()->is_a_parent_of(this))
+ return; //ignore because of modal window
+
if (is_toggle_mode()) {
set_pressed(!is_pressed());
emit_signal("toggled",is_pressed());
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 2e28baa137..fc27c0d24f 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -49,14 +49,22 @@
Variant Control::edit_get_state() const {
- return get_rect();
+ Dictionary s;
+ s["rect"]=get_rect();
+ s["rot"]=get_rotation();
+ s["scale"]=get_scale();
+ return s;
}
void Control::edit_set_state(const Variant& p_state) {
- Rect2 state=p_state;
+ Dictionary s=p_state;
+
+ Rect2 state=s["rect"];
set_pos(state.pos);
set_size(state.size);
+ set_rotation(s["rot"]);
+ set_scale(s["scale"]);
}
void Control::set_custom_minimum_size(const Size2& p_custom) {
@@ -754,6 +762,11 @@ bool Control::is_window_modal_on_top() const {
return get_viewport()->_gui_is_modal_on_top(this);
}
+uint64_t Control::get_modal_frame() const {
+
+ return data.modal_frame;
+}
+
Size2 Control::get_minimum_size() const {
@@ -1829,6 +1842,7 @@ void Control::show_modal(bool p_exclusive) {
raise();
data.modal_exclusive=p_exclusive;
data.MI=get_viewport()->_gui_show_modal(this);
+ data.modal_frame=OS::get_singleton()->get_frames_drawn();
}
@@ -2539,6 +2553,7 @@ Control::Control() {
data.parent_canvas_item=NULL;
data.scale=Vector2(1,1);
data.drag_owner=0;
+ data.modal_frame=0;
for (int i=0;i<4;i++) {
diff --git a/scene/gui/control.h b/scene/gui/control.h
index 07a28de1ea..830ebd1620 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -132,6 +132,7 @@ private:
ObjectID drag_owner;
bool modal;
bool modal_exclusive;
+ uint64_t modal_frame; //frame used to put something as modal
Ref<Theme> theme;
Control *theme_owner;
String tooltip;
@@ -249,6 +250,7 @@ public:
Size2 get_custom_minimum_size() const;
bool is_window_modal_on_top() const;
+ uint64_t get_modal_frame() const; //frame in which this was made modal
Control *get_parent_control() const;
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 5379836746..d63c483ef9 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -1245,6 +1245,19 @@ real_t ItemList::get_icon_scale() const {
return icon_scale;
}
+Vector<int> ItemList::get_selected_items() {
+ Vector<int> selected;
+ for (int i = 0; i < items.size(); i++) {
+ if (items[i].selected) {
+ selected.push_back(i);
+ if (this->select_mode == SELECT_SINGLE) {
+ break;
+ }
+ }
+ }
+ return selected;
+}
+
void ItemList::_bind_methods(){
ObjectTypeDB::bind_method(_MD("add_item","text","icon:Texture","selectable"),&ItemList::add_item,DEFVAL(Variant()),DEFVAL(true));
@@ -1277,6 +1290,7 @@ void ItemList::_bind_methods(){
ObjectTypeDB::bind_method(_MD("select","idx","single"),&ItemList::select,DEFVAL(true));
ObjectTypeDB::bind_method(_MD("unselect","idx"),&ItemList::unselect);
ObjectTypeDB::bind_method(_MD("is_selected","idx"),&ItemList::is_selected);
+ ObjectTypeDB::bind_method(_MD("get_selected_items"),&ItemList::get_selected_items);
ObjectTypeDB::bind_method(_MD("get_item_count"),&ItemList::get_item_count);
ObjectTypeDB::bind_method(_MD("remove_item","idx"),&ItemList::remove_item);
@@ -1330,8 +1344,6 @@ void ItemList::_bind_methods(){
ADD_SIGNAL( MethodInfo("item_activated",PropertyInfo(Variant::INT,"index")));
}
-
-
ItemList::ItemList() {
current=-1;
diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h
index aa6dd64c50..e1902d1c1f 100644
--- a/scene/gui/item_list.h
+++ b/scene/gui/item_list.h
@@ -144,6 +144,7 @@ public:
void select(int p_idx,bool p_single=true);
void unselect(int p_idx);
bool is_selected(int p_idx) const;
+ Vector<int> get_selected_items();
void set_current(int p_current);
int get_current() const;
diff --git a/scene/gui/patch_9_frame.cpp b/scene/gui/patch_9_frame.cpp
index a6a3490ad2..9ad6398359 100644
--- a/scene/gui/patch_9_frame.cpp
+++ b/scene/gui/patch_9_frame.cpp
@@ -79,6 +79,8 @@ void Patch9Frame::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_draw_center","draw_center"), & Patch9Frame::set_draw_center );
ObjectTypeDB::bind_method(_MD("get_draw_center"), & Patch9Frame::get_draw_center );
+ ADD_SIGNAL(MethodInfo("texture_changed"));
+
ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), _SCS("set_texture"),_SCS("get_texture") );
ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate") );
ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "draw_center"), _SCS("set_draw_center"),_SCS("get_draw_center") );
@@ -93,11 +95,14 @@ void Patch9Frame::_bind_methods() {
void Patch9Frame::set_texture(const Ref<Texture>& p_tex) {
+ if (texture==p_tex)
+ return;
texture=p_tex;
update();
//if (texture.is_valid())
// texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites
minimum_size_changed();
+ emit_signal("texture_changed");
}
Ref<Texture> Patch9Frame::get_texture() const {
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 5a6660819c..e106f0dfc6 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -852,6 +852,11 @@ void TextEdit::_notification(int p_what) {
k++;
}
+ // check for space between name and bracket
+ while (k < str.length() && (str[k] == '\t' || str[k] == ' ')) {
+ k++;
+ }
+
if (str[k] == '(') {
in_function_name = true;
}
@@ -4542,6 +4547,7 @@ TextEdit::TextEdit() {
scroll_past_end_of_file_enabled=false;
auto_brace_completion_enabled=false;
brace_matching_enabled=false;
+ highlight_all_occurrences=false;
auto_indent=false;
insert_mode = false;
window_has_focus=true;
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 11b400d4a9..bea6e75aef 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2085,6 +2085,15 @@ bool Node::is_owned_by_parent() const {
return data.parent_owned;
}
+void Node::set_display_folded(bool p_folded) {
+ data.display_folded=p_folded;
+}
+
+bool Node::is_displayed_folded() const {
+
+ return data.display_folded;
+}
+
void Node::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_add_child_below_node","node:Node","child_node:Node","legible_unique_name"),&Node::add_child_below_node,DEFVAL(false));
@@ -2140,6 +2149,8 @@ void Node::_bind_methods() {
ObjectTypeDB::bind_method(_MD("can_process"),&Node::can_process);
ObjectTypeDB::bind_method(_MD("print_stray_nodes"),&Node::_print_stray_nodes);
ObjectTypeDB::bind_method(_MD("get_position_in_parent"),&Node::get_position_in_parent);
+ ObjectTypeDB::bind_method(_MD("set_display_folded","fold"),&Node::set_display_folded);
+ ObjectTypeDB::bind_method(_MD("is_displayed_folded"),&Node::is_displayed_folded);
ObjectTypeDB::bind_method(_MD("get_tree:SceneTree"),&Node::get_tree);
@@ -2194,6 +2205,7 @@ void Node::_bind_methods() {
//ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/input" ), _SCS("set_process_input"),_SCS("is_processing_input" ) );
//ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/unhandled_input" ), _SCS("set_process_unhandled_input"),_SCS("is_processing_unhandled_input" ) );
ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "process/pause_mode",PROPERTY_HINT_ENUM,"Inherit,Stop,Process" ), _SCS("set_pause_mode"),_SCS("get_pause_mode" ) );
+ ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "editor/display_folded",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR ), _SCS("set_display_folded"),_SCS("is_displayed_folded" ) );
BIND_VMETHOD( MethodInfo("_process",PropertyInfo(Variant::REAL,"delta")) );
BIND_VMETHOD( MethodInfo("_fixed_process",PropertyInfo(Variant::REAL,"delta")) );
@@ -2231,6 +2243,7 @@ Node::Node() {
data.in_constructor=true;
data.viewport=NULL;
data.use_placeholder=false;
+ data.display_folded=false;
}
Node::~Node() {
@@ -2240,6 +2253,7 @@ Node::~Node() {
data.owned.clear();
data.children.clear();
+
ERR_FAIL_COND(data.parent);
ERR_FAIL_COND(data.children.size());
diff --git a/scene/main/node.h b/scene/main/node.h
index 88334f32f0..dcc3829d15 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -111,6 +111,7 @@ private:
bool in_constructor;
bool use_placeholder;
+ bool display_folded;
} data;
@@ -325,6 +326,8 @@ public:
void update_configuration_warning();
+ void set_display_folded(bool p_folded);
+ bool is_displayed_folded() const;
/* CANVAS */
Node();
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 3c52af1c1e..68f5a252e5 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1331,11 +1331,11 @@ Matrix32 Viewport::_get_input_pre_xform() const {
Matrix32 pre_xf;
if (render_target) {
- ERR_FAIL_COND_V(to_screen_rect.size.x==0,pre_xf);
- ERR_FAIL_COND_V(to_screen_rect.size.y==0,pre_xf);
+ if (to_screen_rect!=Rect2()) {
- pre_xf.elements[2]=-to_screen_rect.pos;
- pre_xf.scale(rect.size/to_screen_rect.size);
+ pre_xf.elements[2]=-to_screen_rect.pos;
+ pre_xf.scale(rect.size/to_screen_rect.size);
+ }
} else {
pre_xf.elements[2]=-rect.pos;
@@ -1575,35 +1575,38 @@ void Viewport::_gui_call_input(Control *p_control,const InputEvent& p_input) {
// _block();
+ InputEvent ev = p_input;
+
//mouse wheel events can't be stopped
- bool cant_stop_me_now = (p_input.type==InputEvent::MOUSE_BUTTON &&
- (p_input.mouse_button.button_index==BUTTON_WHEEL_DOWN ||
- p_input.mouse_button.button_index==BUTTON_WHEEL_UP ||
- p_input.mouse_button.button_index==BUTTON_WHEEL_LEFT ||
- p_input.mouse_button.button_index==BUTTON_WHEEL_RIGHT ) );
+ bool cant_stop_me_now = (ev.type==InputEvent::MOUSE_BUTTON &&
+ (ev.mouse_button.button_index==BUTTON_WHEEL_DOWN ||
+ ev.mouse_button.button_index==BUTTON_WHEEL_UP ||
+ ev.mouse_button.button_index==BUTTON_WHEEL_LEFT ||
+ ev.mouse_button.button_index==BUTTON_WHEEL_RIGHT ) );
CanvasItem *ci=p_control;
while(ci) {
Control *control = ci->cast_to<Control>();
if (control) {
- control->call_multilevel(SceneStringNames::get_singleton()->_input_event,p_input);
+ control->call_multilevel(SceneStringNames::get_singleton()->_input_event,ev);
if (gui.key_event_accepted)
break;
if (!control->is_inside_tree())
break;
- control->emit_signal(SceneStringNames::get_singleton()->input_event,p_input);
+ control->emit_signal(SceneStringNames::get_singleton()->input_event,ev);
if (!control->is_inside_tree() || control->is_set_as_toplevel())
break;
if (gui.key_event_accepted)
break;
- if (!cant_stop_me_now && control->data.stop_mouse && (p_input.type==InputEvent::MOUSE_BUTTON || p_input.type==InputEvent::MOUSE_MOTION))
+ if (!cant_stop_me_now && control->data.stop_mouse && (ev.type==InputEvent::MOUSE_BUTTON || ev.type==InputEvent::MOUSE_MOTION))
break;
}
if (ci->is_set_as_toplevel())
break;
+ ev=ev.xform_by(ci->get_transform()); //transform event upwards
ci=ci->get_parent_item();
}
@@ -1749,8 +1752,9 @@ void Viewport::_gui_input_event(InputEvent p_event) {
Vector2 pos = top->get_global_transform_with_canvas().affine_inverse().xform(mpos);
if (!top->has_point(pos)) {
- if (top->data.modal_exclusive) {
+ if (top->data.modal_exclusive || top->data.modal_frame==OS::get_singleton()->get_frames_drawn()) {
//cancel event, sorry, modal exclusive EATS UP ALL
+ //alternative, you can't pop out a window the same frame it was made modal (fixes many issues)
//get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID);
get_tree()->set_input_as_handled();
return; // no one gets the event if exclusive NO ONE
@@ -2498,6 +2502,9 @@ Variant Viewport::gui_get_drag_data() const {
return gui.drag_data;
}
+Control *Viewport::get_modal_stack_top() const {
+ return gui.modal_stack.size()?gui.modal_stack.back()->get():NULL;
+}
String Viewport::get_configuration_warning() const {
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 545020dfc7..aaa640e0e6 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -374,6 +374,7 @@ public:
bool gui_has_modal_stack() const;
Variant gui_get_drag_data() const;
+ Control *get_modal_stack_top() const;
virtual String get_configuration_warning() const;
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index 8be39e3021..098801bcf5 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -38,8 +38,6 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) {
set_length(p_value);
else if (name=="loop")
set_loop(p_value);
- else if (name=="loop_interpolation")
- set_loop_interpolation(p_value);
else if (name=="step")
set_step(p_value);
else if (name.begins_with("tracks/")) {
@@ -270,8 +268,6 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const {
r_ret= length;
else if (name=="loop")
r_ret= loop;
- else if (name=="loop_interpolation")
- r_ret= loop_interpolation;
else if (name=="step")
r_ret= step;
else if (name.begins_with("tracks/")) {
@@ -437,7 +433,6 @@ void Animation::_get_property_list( List<PropertyInfo> *p_list) const {
p_list->push_back( PropertyInfo( Variant::REAL, "length", PROPERTY_HINT_RANGE, "0.001,99999,0.001"));
p_list->push_back( PropertyInfo( Variant::BOOL, "loop" ));
- p_list->push_back( PropertyInfo( Variant::BOOL, "loop_interpolation"));
p_list->push_back( PropertyInfo( Variant::REAL, "step", PROPERTY_HINT_RANGE, "0,4096,0.001" ));
for (int i=0;i<tracks.size();i++) {
@@ -1244,7 +1239,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 && loop_interpolation) {
+ if (loop) {
// loop
if (idx>=0) {
@@ -1632,19 +1627,10 @@ void Animation::set_loop(bool p_enabled) {
loop=p_enabled;
emit_changed();
}
-void Animation::set_loop_interpolation(bool p_enabled) {
-
- loop_interpolation=p_enabled;
- emit_changed();
-}
bool Animation::has_loop() const {
return loop;
}
-bool Animation::has_loop_interpolation() const {
-
- return loop_interpolation;
-}
void Animation::track_move_up(int p_track) {
@@ -1741,9 +1727,7 @@ void Animation::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_length"),&Animation::get_length);
ObjectTypeDB::bind_method(_MD("set_loop","enabled"),&Animation::set_loop);
- ObjectTypeDB::bind_method(_MD("set_loop_interpolation","enabled"),&Animation::set_loop_interpolation);
ObjectTypeDB::bind_method(_MD("has_loop"),&Animation::has_loop);
- ObjectTypeDB::bind_method(_MD("has_loop_interpolation"),&Animation::has_loop_interpolation);
ObjectTypeDB::bind_method(_MD("set_step","size_sec"),&Animation::set_step);
ObjectTypeDB::bind_method(_MD("get_step"),&Animation::get_step);
@@ -1771,7 +1755,6 @@ void Animation::clear() {
memdelete( tracks[i] );
tracks.clear();
loop=false;
- loop_interpolation=true;
length=1;
}
@@ -2031,7 +2014,6 @@ Animation::Animation() {
step=0.1;
loop=false;
- loop_interpolation=true;
length=1;
}
@@ -2042,3 +2024,5 @@ Animation::~Animation() {
memdelete( tracks[i] );
}
+
+
diff --git a/scene/resources/animation.h b/scene/resources/animation.h
index ee643c9678..6c8d7252aa 100644
--- a/scene/resources/animation.h
+++ b/scene/resources/animation.h
@@ -172,7 +172,6 @@ private:
float length;
float step;
bool loop;
- bool loop_interpolation;
// bind helpers
private:
@@ -279,9 +278,7 @@ public:
float get_length() const;
void set_loop(bool p_enabled);
- void set_loop_interpolation(bool p_enabled);
bool has_loop() const;
- bool has_loop_interpolation() const;
void set_step(float p_step);
float get_step() const;
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index ac528e6659..50852dc1f7 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -375,7 +375,7 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S
PackState ps;
ps.node=node;
ps.state=state;
- pack_state_stack.push_front(ps);
+ pack_state_stack.push_back(ps);
instanced_by_owner=false;
}
}
@@ -545,6 +545,7 @@ https://github.com/godotengine/godot/issues/3127
}
#endif
+
if (exists) {
//check if already exists and did not change
@@ -556,6 +557,7 @@ https://github.com/godotengine/godot/issues/3127
if (Math::abs(a-b)<CMP_EPSILON)
continue;
} else if (bool(Variant::evaluate(Variant::OP_EQUAL,value,original))) {
+
continue;
}
}
diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h
index 6bde508d72..3b6c0898e0 100644
--- a/scene/resources/packed_scene.h
+++ b/scene/resources/packed_scene.h
@@ -196,6 +196,7 @@ class PackedScene : public Resource {
protected:
+ virtual bool editor_can_reload_from_file() { return false; } // this is handled by editor better
static void _bind_methods();
public:
diff --git a/scene/resources/sample.cpp b/scene/resources/sample.cpp
index 87fcfc425d..aae4e85a27 100644
--- a/scene/resources/sample.cpp
+++ b/scene/resources/sample.cpp
@@ -187,6 +187,8 @@ RID Sample::get_rid() const {
return sample;
}
+
+
void Sample::_bind_methods(){
diff --git a/scene/resources/sample.h b/scene/resources/sample.h
index 0a88167233..18672e41c0 100644
--- a/scene/resources/sample.h
+++ b/scene/resources/sample.h
@@ -75,6 +75,7 @@ protected:
public:
+
void create(Format p_format, bool p_stereo, int p_length);
Format get_format() const;
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index c7e2fc4e73..95645107d4 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -67,12 +67,17 @@ Error ResourceInteractiveLoaderText::_parse_sub_resource(VariantParser::Stream*
String path = local_path+"::"+itos(index);
- if (!ResourceCache::has(path)) {
- r_err_str="Can't load cached sub-resource: "+path;
- return ERR_PARSE_ERROR;
- }
+ if (!ignore_resource_parsing) {
- r_res=RES(ResourceCache::get(path));
+ if (!ResourceCache::has(path)) {
+ r_err_str="Can't load cached sub-resource: "+path;
+ return ERR_PARSE_ERROR;
+ }
+
+ r_res=RES(ResourceCache::get(path));
+ } else {
+ r_res=RES();
+ }
VariantParser::get_token(p_stream,token,line,r_err_str);
if (token.type!=VariantParser::TK_PARENTHESIS_CLOSE) {
@@ -95,25 +100,29 @@ Error ResourceInteractiveLoaderText::_parse_ext_resource(VariantParser::Stream*
int id = token.value;
+ if (!ignore_resource_parsing) {
- if (!ext_resources.has(id)) {
- r_err_str="Can't load cached ext-resource #"+itos(id);
- return ERR_PARSE_ERROR;
- }
+ if (!ext_resources.has(id)) {
+ r_err_str="Can't load cached ext-resource #"+itos(id);
+ return ERR_PARSE_ERROR;
+ }
- String path = ext_resources[id].path;
- String type = ext_resources[id].type;
+ String path = ext_resources[id].path;
+ String type = ext_resources[id].type;
- if (path.find("://")==-1 && path.is_rel_path()) {
- // path is relative to file being loaded, so convert to a resource path
- path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
+ if (path.find("://")==-1 && path.is_rel_path()) {
+ // path is relative to file being loaded, so convert to a resource path
+ path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
- }
+ }
- r_res=ResourceLoader::load(path,type);
+ r_res=ResourceLoader::load(path,type);
- if (r_res.is_null()) {
- WARN_PRINT(String("Couldn't load external resource: "+path).utf8().get_data());
+ if (r_res.is_null()) {
+ WARN_PRINT(String("Couldn't load external resource: "+path).utf8().get_data());
+ }
+ } else {
+ r_res=RES();
}
VariantParser::get_token(p_stream,token,line,r_err_str);
@@ -625,6 +634,7 @@ void ResourceInteractiveLoaderText::get_dependencies(FileAccess *f,List<String>
open(f);
+ ignore_resource_parsing=true;
ERR_FAIL_COND(error!=OK);
while(next_tag.name=="ext_resource") {
@@ -662,6 +672,7 @@ void ResourceInteractiveLoaderText::get_dependencies(FileAccess *f,List<String>
Error err = VariantParser::parse_tag(&stream,lines,error_text,next_tag,&rp);
if (err) {
+ print_line(error_text+" - "+itos(lines));
error_text="Unexpected end of file";
_printerr();
error=ERR_FILE_CORRUPT;
@@ -676,7 +687,7 @@ Error ResourceInteractiveLoaderText::rename_dependencies(FileAccess *p_f, const
open(p_f,true);
ERR_FAIL_COND_V(error!=OK,error);
-
+ ignore_resource_parsing=true;
//FileAccess
FileAccess *fw = NULL;
@@ -794,7 +805,7 @@ void ResourceInteractiveLoaderText::open(FileAccess *p_f,bool p_skip_first_tag)
stream.f=f;
is_scene=false;
-
+ ignore_resource_parsing=false;
resource_current=0;
@@ -879,6 +890,8 @@ String ResourceInteractiveLoaderText::recognize(FileAccess *p_f) {
stream.f=f;
+ ignore_resource_parsing=true;
+
VariantParser::Tag tag;
Error err = VariantParser::parse_tag(&stream,lines,error_text,tag);
@@ -1296,7 +1309,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re
if ((PE->get().usage&PROPERTY_USAGE_STORE_IF_NONZERO && value.is_zero())||(PE->get().usage&PROPERTY_USAGE_STORE_IF_NONONE && value.is_one()) )
continue;
- if (PE->get().type==Variant::OBJECT && value.is_zero() && (!PE->get().usage&PROPERTY_USAGE_STORE_IF_NULL))
+ if (PE->get().type==Variant::OBJECT && value.is_zero() && !(PE->get().usage&PROPERTY_USAGE_STORE_IF_NULL))
continue;
String vars;
diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h
index 8dbfbfda48..6122a1f9d8 100644
--- a/scene/resources/scene_format_text.h
+++ b/scene/resources/scene_format_text.h
@@ -56,7 +56,7 @@ class ResourceInteractiveLoaderText : public ResourceInteractiveLoader {
bool is_scene;
String res_type;
-
+ bool ignore_resource_parsing;
// Map<String,String> remaps;
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp
index a61ffe8e97..8580ffdc5a 100644
--- a/scene/resources/style_box.cpp
+++ b/scene/resources/style_box.cpp
@@ -104,7 +104,10 @@ StyleBox::StyleBox() {
void StyleBoxTexture::set_texture(RES p_texture) {
+ if (texture==p_texture)
+ return;
texture=p_texture;
+ emit_signal("texture_changed");
emit_changed();
}
@@ -207,6 +210,8 @@ void StyleBoxTexture::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_draw_center","enable"),&StyleBoxTexture::set_draw_center);
ObjectTypeDB::bind_method(_MD("get_draw_center"),&StyleBoxTexture::get_draw_center);
+ ADD_SIGNAL(MethodInfo("texture_changed"));
+
ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture" ), _SCS("set_texture"),_SCS("get_texture") );
ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect"));
ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin/left", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_LEFT );
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 1893bfe524..726b1938c4 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -98,10 +98,6 @@ Texture::Texture() {
-bool ImageTexture::can_reload_from_file() {
-
- return true;
-}
void ImageTexture::reload_from_file() {
@@ -526,8 +522,11 @@ uint32_t AtlasTexture::get_flags() const{
void AtlasTexture::set_atlas(const Ref<Texture>& p_atlas){
+ if (atlas==p_atlas)
+ return;
atlas=p_atlas;
emit_changed();
+ emit_signal("atlas_changed");
}
Ref<Texture> AtlasTexture::get_atlas() const{
@@ -569,6 +568,8 @@ void AtlasTexture::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_margin","margin"),&AtlasTexture::set_margin);
ObjectTypeDB::bind_method(_MD("get_margin"),&AtlasTexture::get_margin);
+ ADD_SIGNAL(MethodInfo("atlas_changed"));
+
ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "atlas", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_atlas"),_SCS("get_atlas") );
ADD_PROPERTY( PropertyInfo( Variant::RECT2, "region"), _SCS("set_region"),_SCS("get_region") );
ADD_PROPERTY( PropertyInfo( Variant::RECT2, "margin"), _SCS("set_margin"),_SCS("get_margin") );
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index 103b425cd8..05ea833978 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -103,7 +103,6 @@ private:
float lossy_storage_quality;
protected:
- virtual bool can_reload_from_file();
virtual void reload_from_file();
bool _set(const StringName& p_name, const Variant& p_value);