summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gdscript/gd_function.cpp25
-rw-r--r--modules/gdscript/gd_function.h3
-rw-r--r--modules/gdscript/gd_parser.cpp9
-rw-r--r--modules/gdscript/gd_script.h2
-rw-r--r--platform/haiku/context_gl_haiku.cpp12
-rw-r--r--platform/haiku/context_gl_haiku.h5
-rw-r--r--platform/haiku/detect.py6
-rw-r--r--platform/x11/detect.py4
-rw-r--r--scene/3d/skeleton.cpp16
-rw-r--r--scene/audio/stream_player.cpp10
-rw-r--r--scene/audio/stream_player.h2
-rw-r--r--scene/gui/line_edit.cpp45
-rw-r--r--scene/gui/line_edit.h6
-rw-r--r--scene/gui/text_edit.cpp7
-rw-r--r--scene/main/viewport.cpp8
-rw-r--r--tools/doc/doc_data.cpp6
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.cpp1
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp22
-rw-r--r--tools/editor/plugins/script_editor_plugin.h2
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.cpp63
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.cpp2
-rw-r--r--tools/editor/project_manager.cpp3
-rw-r--r--tools/editor/scenes_dock.cpp3
23 files changed, 231 insertions, 31 deletions
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index 6e52686de4..de86eb2ab9 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -846,6 +846,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
gdfs->state._class=_class;
gdfs->state.ip=ip+ipofs;
gdfs->state.line=line;
+ gdfs->state.instance_id=(p_instance && p_instance->get_owner())?p_instance->get_owner()->get_instance_ID():0;
+ gdfs->state.script_id=_class->get_instance_ID();
//gdfs->state.result_pos=ip+ipofs-1;
gdfs->state.defarg=defarg;
gdfs->state.instance=p_instance;
@@ -1352,6 +1354,18 @@ GDFunction::~GDFunction() {
Variant GDFunctionState::_signal_callback(const Variant** p_args, int p_argcount, Variant::CallError& r_error) {
+#ifdef DEBUG_ENABLED
+ if (state.instance_id && !ObjectDB::get_instance(state.instance_id)) {
+ ERR_EXPLAIN("Resumed after yield, but class instance is gone");
+ ERR_FAIL_V(Variant());
+ }
+
+ if (state.script_id && !ObjectDB::get_instance(state.script_id)) {
+ ERR_EXPLAIN("Resumed after yield, but script is gone");
+ ERR_FAIL_V(Variant());
+ }
+#endif
+
Variant arg;
r_error.error=Variant::CallError::CALL_OK;
@@ -1398,6 +1412,17 @@ bool GDFunctionState::is_valid() const {
Variant GDFunctionState::resume(const Variant& p_arg) {
ERR_FAIL_COND_V(!function,Variant());
+#ifdef DEBUG_ENABLED
+ if (state.instance_id && !ObjectDB::get_instance(state.instance_id)) {
+ ERR_EXPLAIN("Resumed after yield, but class instance is gone");
+ ERR_FAIL_V(Variant());
+ }
+
+ if (state.script_id && !ObjectDB::get_instance(state.script_id)) {
+ ERR_EXPLAIN("Resumed after yield, but script is gone");
+ ERR_FAIL_V(Variant());
+ }
+#endif
state.result=p_arg;
Variant::CallError err;
diff --git a/modules/gdscript/gd_function.h b/modules/gdscript/gd_function.h
index 942db170c8..e09c6509dd 100644
--- a/modules/gdscript/gd_function.h
+++ b/modules/gdscript/gd_function.h
@@ -136,6 +136,9 @@ public:
struct CallState {
+ ObjectID instance_id; //by debug only
+ ObjectID script_id;
+
GDInstance *instance;
Vector<uint8_t> stack;
int stack_size;
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index e83bd3d21e..6c6560efa6 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -31,6 +31,7 @@
#include "io/resource_loader.h"
#include "os/file_access.h"
#include "script_language.h"
+#include "gd_script.h"
template<class T>
T* GDParser::alloc_node() {
@@ -494,6 +495,14 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
}
}
+ if (GDScriptLanguage::get_singleton()->get_global_map().has(identifier)) {
+ //check from constants
+ ConstantNode *constant = alloc_node<ConstantNode>();
+ constant->value = GDScriptLanguage::get_singleton()->get_global_array()[ GDScriptLanguage::get_singleton()->get_global_map()[identifier] ];
+ expr=constant;
+ bfn = true;
+ }
+
if ( !bfn ) {
IdentifierNode *id = alloc_node<IdentifierNode>();
id->name = identifier;
diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h
index 166e29ad70..723761c3a9 100644
--- a/modules/gdscript/gd_script.h
+++ b/modules/gdscript/gd_script.h
@@ -202,6 +202,8 @@ friend class GDCompiler;
public:
+ _FORCE_INLINE_ Object* get_owner() { return owner; }
+
virtual bool set(const StringName& p_name, const Variant& p_value);
virtual bool get(const StringName& p_name, Variant &r_ret) const;
virtual void get_property_list(List<PropertyInfo> *p_properties) const;
diff --git a/platform/haiku/context_gl_haiku.cpp b/platform/haiku/context_gl_haiku.cpp
index 2fedd1532a..bf890d14bf 100644
--- a/platform/haiku/context_gl_haiku.cpp
+++ b/platform/haiku/context_gl_haiku.cpp
@@ -35,6 +35,8 @@ ContextGL_Haiku::ContextGL_Haiku(HaikuDirectWindow* p_window) {
uint32 type = BGL_RGB | BGL_DOUBLE | BGL_DEPTH;
view = new HaikuGLView(window->Bounds(), type);
+
+ use_vsync = false;
}
ContextGL_Haiku::~ContextGL_Haiku() {
@@ -57,7 +59,7 @@ void ContextGL_Haiku::make_current() {
}
void ContextGL_Haiku::swap_buffers() {
- view->SwapBuffers();
+ view->SwapBuffers(use_vsync);
}
int ContextGL_Haiku::get_window_width() {
@@ -68,4 +70,12 @@ int ContextGL_Haiku::get_window_height() {
return window->Bounds().IntegerHeight();
}
+void ContextGL_Haiku::set_use_vsync(bool p_use) {
+ use_vsync = p_use;
+}
+
+bool ContextGL_Haiku::is_using_vsync() const {
+ return use_vsync;
+}
+
#endif
diff --git a/platform/haiku/context_gl_haiku.h b/platform/haiku/context_gl_haiku.h
index 91aae6b382..c7f80543aa 100644
--- a/platform/haiku/context_gl_haiku.h
+++ b/platform/haiku/context_gl_haiku.h
@@ -40,6 +40,8 @@ class ContextGL_Haiku : public ContextGL {
private:
HaikuGLView* view;
HaikuDirectWindow* window;
+
+ bool use_vsync;
public:
ContextGL_Haiku(HaikuDirectWindow* p_window);
@@ -51,6 +53,9 @@ public:
virtual void swap_buffers();
virtual int get_window_width();
virtual int get_window_height();
+
+ virtual void set_use_vsync(bool p_use);
+ virtual bool is_using_vsync() const;
};
#endif
diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py
index 6d1a96a8da..f36b0c567e 100644
--- a/platform/haiku/detect.py
+++ b/platform/haiku/detect.py
@@ -24,7 +24,7 @@ def get_opts():
def get_flags():
return [
('builtin_zlib', 'no'),
- #('glew', 'yes'), # TODO: investigate the GLEW situation on Haiku
+ ('glew', 'yes'),
]
def configure(env):
@@ -38,8 +38,8 @@ def configure(env):
env.Append(CPPPATH = ['#platform/haiku'])
- env["CC"] = "gcc"
- env["CXX"] = "g++"
+ env["CC"] = "gcc-x86"
+ env["CXX"] = "g++-x86"
if (env["target"]=="release"):
if (env["debug_release"]=="yes"):
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 5f272536ba..54940866b2 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -209,5 +209,7 @@ def configure(env):
if (env["use_static_cpp"]=="yes"):
env.Append(LINKFLAGS=['-static-libstdc++'])
- env["x86_opt_gcc"]=True
+ list_of_x86 = ['x86_64', 'x86', 'i386', 'i586']
+ if any(platform.machine() in s for s in list_of_x86):
+ env["x86_opt_gcc"]=True
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/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/line_edit.cpp b/scene/gui/line_edit.cpp
index 579a6e2f0a..16000bb55f 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -108,7 +108,7 @@ void LineEdit::_input_event(InputEvent p_event) {
selection.doubleclick=false;
if (OS::get_singleton()->has_virtual_keyboard())
- OS::get_singleton()->show_virtual_keyboard(get_text(),get_global_rect());
+ OS::get_singleton()->show_virtual_keyboard(text,get_global_rect());
}
update();
@@ -634,14 +634,19 @@ void LineEdit::_notification(int p_what) {
Color font_color_selected=get_color("font_color_selected");
Color cursor_color=get_color("cursor_color");
+ const String& t = text.empty() ? placeholder : text;
+ // draw placeholder color
+ if(text.empty())
+ font_color.a *= placeholder_alpha;
+
while(true) {
//end of string, break!
- if (char_ofs>=text.length())
+ if (char_ofs>=t.length())
break;
- CharType cchar=pass?'*':text[char_ofs];
- CharType next=pass?'*':text[char_ofs+1];
+ CharType cchar=pass?'*':t[char_ofs];
+ CharType next=pass?'*':t[char_ofs+1];
int char_width=font->get_char_size( cchar,next ).width;
// end of widget, break!
@@ -678,7 +683,7 @@ void LineEdit::_notification(int p_what) {
}
if (OS::get_singleton()->has_virtual_keyboard())
- OS::get_singleton()->show_virtual_keyboard(get_text(),get_global_rect());
+ OS::get_singleton()->show_virtual_keyboard(text,get_global_rect());
} break;
case NOTIFICATION_FOCUS_EXIT: {
@@ -938,6 +943,29 @@ String LineEdit::get_text() const {
return text;
}
+void LineEdit::set_placeholder(String p_text) {
+
+ placeholder = p_text;
+ update();
+}
+
+String LineEdit::get_placeholder() const {
+
+ return placeholder;
+}
+
+
+void LineEdit::set_placeholder_alpha(float p_alpha) {
+
+ placeholder_alpha = p_alpha;
+ update();
+}
+
+float LineEdit::get_placeholder_alpha() const {
+
+ return placeholder_alpha;
+}
+
void LineEdit::set_cursor_pos(int p_pos) {
if (p_pos>(int)text.length())
@@ -1223,6 +1251,10 @@ void LineEdit::_bind_methods() {
ObjectTypeDB::bind_method(_MD("select_all"),&LineEdit::select_all);
ObjectTypeDB::bind_method(_MD("set_text","text"),&LineEdit::set_text);
ObjectTypeDB::bind_method(_MD("get_text"),&LineEdit::get_text);
+ ObjectTypeDB::bind_method(_MD("set_placeholder","text"),&LineEdit::set_placeholder);
+ ObjectTypeDB::bind_method(_MD("get_placeholder"),&LineEdit::get_placeholder);
+ ObjectTypeDB::bind_method(_MD("set_placeholder_alpha","alpha"),&LineEdit::set_placeholder_alpha);
+ ObjectTypeDB::bind_method(_MD("get_placeholder_alpha"),&LineEdit::get_placeholder_alpha);
ObjectTypeDB::bind_method(_MD("set_cursor_pos","pos"),&LineEdit::set_cursor_pos);
ObjectTypeDB::bind_method(_MD("get_cursor_pos"),&LineEdit::get_cursor_pos);
ObjectTypeDB::bind_method(_MD("cursor_set_blink_enabled", "enable"),&LineEdit::cursor_set_blink_enabled);
@@ -1257,6 +1289,8 @@ void LineEdit::_bind_methods() {
BIND_CONSTANT( MENU_MAX );
ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "text" ), _SCS("set_text"),_SCS("get_text") );
+ ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "placeholder/text" ), _SCS("set_placeholder"),_SCS("get_placeholder") );
+ ADD_PROPERTYNZ( PropertyInfo( Variant::REAL, "placeholder/alpha",PROPERTY_HINT_RANGE,"0,1,0.001" ), _SCS("set_placeholder_alpha"),_SCS("get_placeholder_alpha") );
ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "align", PROPERTY_HINT_ENUM, "Left,Center,Right,Fill"), _SCS("set_align"), _SCS("get_align"));
ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "max_length" ), _SCS("set_max_length"),_SCS("get_max_length") );
ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "editable" ), _SCS("set_editable"),_SCS("is_editable") );
@@ -1275,6 +1309,7 @@ LineEdit::LineEdit() {
window_has_focus=true;
max_length = 0;
pass=false;
+ placeholder_alpha=0.6;
selection_clear();
set_focus_mode( FOCUS_ALL );
diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h
index e4da0f0b87..112e4ad55e 100644
--- a/scene/gui/line_edit.h
+++ b/scene/gui/line_edit.h
@@ -67,6 +67,8 @@ private:
String undo_text;
String text;
+ String placeholder;
+ float placeholder_alpha;
PopupMenu *menu;
@@ -135,6 +137,10 @@ public:
void delete_text(int p_from_column, int p_to_column);
void set_text(String p_text);
String get_text() const;
+ void set_placeholder(String p_text);
+ String get_placeholder() const;
+ void set_placeholder_alpha(float p_alpha);
+ float get_placeholder_alpha() const;
void set_cursor_pos(int p_pos);
int get_cursor_pos() const;
void set_max_length(int p_max_length);
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 6fd6137ac8..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;
}
@@ -1973,6 +1978,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
}
} break;
case KEY_TAB: {
+ if (k.mod.command) break; // avoid tab when command
if (readonly)
break;
@@ -4541,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/viewport.cpp b/scene/main/viewport.cpp
index ff8f0d05f1..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;
diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp
index e3689cf13d..470dd078ae 100644
--- a/tools/doc/doc_data.cpp
+++ b/tools/doc/doc_data.cpp
@@ -455,6 +455,12 @@ void DocData::generate(bool p_basic_types) {
}
+ {
+ //so it can be documented that it does not exist
+ class_list["Variant"]=ClassDoc();
+ class_list["Variant"].name="Variant";
+ }
+
if (!p_basic_types)
return;
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp
index 10c7bf79a3..203564e612 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_player_editor_plugin.cpp
@@ -1404,6 +1404,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) {
hb->add_child(animation);
animation->set_h_size_flags(SIZE_EXPAND_FILL);
animation->set_tooltip(TTR("Display list of animations in player."));
+ animation->set_clip_text(true);
autoplay = memnew( ToolButton );
hb->add_child(autoplay);
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 10e4fc8475..ee83b6b032 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -585,7 +585,6 @@ void ScriptTextEditor::_code_complete_script(const String& p_code, List<String>*
Error err = script->get_language()->complete_code(p_code,script->get_path().get_base_dir(),base,r_options,hint);
if (hint!="") {
get_text_edit()->set_code_hint(hint);
- print_line("hint: "+hint.replace(String::chr(0xFFFF),"|"));
}
}
@@ -2316,6 +2315,22 @@ void ScriptEditor::_script_split_dragged(float) {
EditorNode::get_singleton()->save_layout();
}
+void ScriptEditor::_unhandled_input(const InputEvent& p_event) {
+ if (p_event.key.pressed || !is_visible()) return;
+ if (ED_IS_SHORTCUT("script_editor/next_script", p_event)) {
+ int next_tab = script_list->get_current() + 1;
+ next_tab %= script_list->get_item_count();
+ _go_to_tab(script_list->get_item_metadata(next_tab));
+ _update_script_names();
+ }
+ if (ED_IS_SHORTCUT("script_editor/prev_script", p_event)) {
+ int next_tab = script_list->get_current() - 1;
+ next_tab = next_tab >= 0 ? next_tab : script_list->get_item_count() - 1;
+ _go_to_tab(script_list->get_item_metadata(next_tab));
+ _update_script_names();
+ }
+}
+
void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {
if (!bool(EDITOR_DEF("text_editor/restore_scripts_on_load",true))) {
@@ -2598,6 +2613,7 @@ void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_history_forward",&ScriptEditor::_history_forward);
ObjectTypeDB::bind_method("_history_back",&ScriptEditor::_history_back);
ObjectTypeDB::bind_method("_live_auto_reload_running_scripts",&ScriptEditor::_live_auto_reload_running_scripts);
+ ObjectTypeDB::bind_method("_unhandled_input",&ScriptEditor::_unhandled_input);
}
@@ -2631,6 +2647,10 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
tab_container->set_h_size_flags(SIZE_EXPAND_FILL);
+ ED_SHORTCUT("script_editor/next_script", TTR("Next script"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_GREATER);
+ ED_SHORTCUT("script_editor/prev_script", TTR("Previous script"), KEY_MASK_CMD | KEY_LESS);
+ set_process_unhandled_input(true);
+
file_menu = memnew( MenuButton );
menu_hb->add_child(file_menu);
file_menu->set_text(TTR("File"));
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index 0636190a41..85412087b4 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -279,6 +279,8 @@ class ScriptEditor : public VBoxContainer {
void _script_split_dragged(float);
+ void _unhandled_input(const InputEvent& p_event);
+
void _history_forward();
void _history_back();
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
index 4f59287994..e29a0c8d52 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -31,7 +31,7 @@
#include "io/resource_loader.h"
#include "globals.h"
#include "tools/editor/editor_settings.h"
-
+#include "scene/3d/sprite_3d.h"
@@ -355,6 +355,35 @@ void SpriteFramesEditor::_animation_select() {
}
+
+static void _find_anim_sprites(Node* p_node,List<Node*> *r_nodes,Ref<SpriteFrames> p_sfames) {
+
+ Node *edited = EditorNode::get_singleton()->get_edited_scene();
+ if (!edited)
+ return;
+ if (p_node!=edited && p_node->get_owner()!=edited)
+ return;
+
+ {
+ AnimatedSprite *as = p_node->cast_to<AnimatedSprite>();
+ if (as && as->get_sprite_frames()==p_sfames) {
+ r_nodes->push_back(p_node);
+ }
+ }
+
+ {
+ AnimatedSprite3D *as = p_node->cast_to<AnimatedSprite3D>();
+ if (as && as->get_sprite_frames()==p_sfames) {
+ r_nodes->push_back(p_node);
+ }
+ }
+
+ for(int i=0;i<p_node->get_child_count();i++) {
+ _find_anim_sprites(p_node->get_child(i),r_nodes,p_sfames);
+ }
+
+}
+
void SpriteFramesEditor::_animation_name_edited(){
if (updating)
@@ -381,9 +410,24 @@ void SpriteFramesEditor::_animation_name_edited(){
name=new_name+" "+itos(counter);
}
+ List<Node*> nodes;
+ _find_anim_sprites(EditorNode::get_singleton()->get_edited_scene(),&nodes,Ref<SpriteFrames>(frames));
+
undo_redo->create_action(TTR("Rename Animation"));
undo_redo->add_do_method(frames,"rename_animation",edited_anim,name);
undo_redo->add_undo_method(frames,"rename_animation",name,edited_anim);
+
+ for(List<Node*>::Element *E=nodes.front();E;E=E->next()) {
+
+ String current = E->get()->call("get_animation");
+ if (current!=edited_anim)
+ continue;
+
+ undo_redo->add_do_method(E->get(),"set_animation",name);
+ undo_redo->add_undo_method(E->get(),"set_animation",edited_anim);
+
+ }
+
undo_redo->add_do_method(this,"_update_library");
undo_redo->add_undo_method(this,"_update_library");
@@ -406,12 +450,28 @@ void SpriteFramesEditor::_animation_add(){
name=new_name+" "+itos(counter);
}
+ List<Node*> nodes;
+ _find_anim_sprites(EditorNode::get_singleton()->get_edited_scene(),&nodes,Ref<SpriteFrames>(frames));
+
+
undo_redo->create_action(TTR("Add Animation"));
undo_redo->add_do_method(frames,"add_animation",name);
undo_redo->add_undo_method(frames,"remove_animation",name);
undo_redo->add_do_method(this,"_update_library");
undo_redo->add_undo_method(this,"_update_library");
+
+ for(List<Node*>::Element *E=nodes.front();E;E=E->next()) {
+
+ String current = E->get()->call("get_animation");
+ if (frames->has_animation(current))
+ continue;
+
+ undo_redo->add_do_method(E->get(),"set_animation",name);
+ undo_redo->add_undo_method(E->get(),"set_animation",current);
+
+ }
+
edited_anim=new_name;
undo_redo->commit_action();
@@ -426,6 +486,7 @@ void SpriteFramesEditor::_animation_remove(){
if (!frames->has_animation(edited_anim))
return;
+
undo_redo->create_action(TTR("Remove Animation"));
undo_redo->add_do_method(frames,"remove_animation",edited_anim);
undo_redo->add_undo_method(frames,"add_animation",edited_anim);
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp
index d5f85d3333..9d27ac8aa3 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.cpp
+++ b/tools/editor/plugins/tile_map_editor_plugin.cpp
@@ -223,7 +223,7 @@ void TileMapEditor::_update_palette() {
String name;
if (tileset->tile_get_name(E->get())!="") {
- name = tileset->tile_get_name(E->get());
+ name = itos(E->get())+" - "+tileset->tile_get_name(E->get());
} else {
name = "#"+itos(E->get());
}
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp
index d8814fd50e..dafec397c5 100644
--- a/tools/editor/project_manager.cpp
+++ b/tools/editor/project_manager.cpp
@@ -871,9 +871,6 @@ ProjectManager::ProjectManager() {
HBoxContainer *top_hb = memnew( HBoxContainer);
vb->add_child(top_hb);
- TextureFrame *logo = memnew( TextureFrame );
- logo->set_texture(theme->get_icon("LogoSmall","EditorIcons"));
- //top_hb->add_child( logo );
CenterContainer *ccl = memnew( CenterContainer );
Label *l = memnew( Label );
l->set_text(_MKSTR(VERSION_NAME)+String(" - ")+TTR("Project Manager"));
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index cbd7df9d18..0df4dfacc1 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -164,12 +164,14 @@ void ScenesDock::_notification(int p_what) {
if (split_mode) {
file_list_vb->hide();
+ tree->set_custom_minimum_size(Size2(0,0));
tree->set_v_size_flags(SIZE_EXPAND_FILL);
button_back->show();
} else {
tree->show();
file_list_vb->show();
+ tree->set_custom_minimum_size(Size2(0,200)*EDSCALE);
tree->set_v_size_flags(SIZE_FILL);
button_back->hide();
if (!EditorFileSystem::get_singleton()->is_scanning()) {
@@ -1702,7 +1704,6 @@ ScenesDock::ScenesDock(EditorNode *p_editor) {
tree->set_hide_root(true);
split_box->add_child(tree);
- tree->set_custom_minimum_size(Size2(0,200)*EDSCALE);
tree->set_drag_forwarding(this);