diff options
47 files changed, 260 insertions, 9 deletions
diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index 95ae31f3dd..75388f514a 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -357,6 +357,7 @@ if (res!=-1 && res < min_pos) {\ } break; case MIN_OPEN: { int level=1; + end++; while(end<close_pos) { if (str[end]=='[') @@ -373,6 +374,7 @@ if (res!=-1 && res < min_pos) {\ } break; case MIN_CURLY_OPEN: { int level=1; + end++; while(end<close_pos) { if (str[end]=='{') diff --git a/core/object.cpp b/core/object.cpp index 07e24655c2..c1904d05d7 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1282,6 +1282,23 @@ void Object::get_signal_list(List<MethodInfo> *p_signals ) const { } } + +void Object::get_all_signal_connections(List<Connection> *p_connections) const { + + const StringName *S=NULL; + + while((S=signal_map.next(S))) { + + const Signal *s=&signal_map[*S]; + + for(int i=0;i<s->slot_map.size();i++) { + + p_connections->push_back(s->slot_map.getv(i).conn); + } + } + +} + void Object::get_signal_connection_list(const StringName& p_signal,List<Connection> *p_connections) const { const Signal *s=signal_map.getptr(p_signal); diff --git a/core/object.h b/core/object.h index 44464ab199..fc64b91412 100644 --- a/core/object.h +++ b/core/object.h @@ -574,6 +574,7 @@ public: void emit_signal(const StringName& p_name,VARIANT_ARG_LIST); void get_signal_list(List<MethodInfo> *p_signals ) const; void get_signal_connection_list(const StringName& p_signal,List<Connection> *p_connections) const; + void get_all_signal_connections(List<Connection> *p_connections) const; Error connect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method,const Vector<Variant>& p_binds=Vector<Variant>(),uint32_t p_flags=0); void disconnect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method); diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index f266595772..5e7df3be7e 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -234,11 +234,17 @@ void UndoRedo::_process_operation_list(List<Operation>::Element *E) { ERR_FAIL_COND(!obj); } + switch(op.type) { case Operation::TYPE_METHOD: { - obj->call(op.name,VARIANT_ARGS_FROM_ARRAY(op.args)); + obj->call(op.name,VARIANT_ARGS_FROM_ARRAY(op.args)); +#ifdef TOOLS_ENABLED + Resource* res = obj->cast_to<Resource>(); + if (res) + res->set_edited(true); +#endif } break; case Operation::TYPE_PROPERTY: { diff --git a/demos/2d/isometric/bastiles.res b/demos/2d/isometric/bastiles.res Binary files differindex 2161c88f1e..50f3c78321 100644 --- a/demos/2d/isometric/bastiles.res +++ b/demos/2d/isometric/bastiles.res diff --git a/demos/2d/isometric/dungeon.scn b/demos/2d/isometric/dungeon.scn Binary files differindex 58c530d5c5..64efc257c0 100644 --- a/demos/2d/isometric/dungeon.scn +++ b/demos/2d/isometric/dungeon.scn diff --git a/demos/2d/isometric/tileset.scn b/demos/2d/isometric/tileset.scn Binary files differindex edb0bc0276..c04ea5382c 100644 --- a/demos/2d/isometric/tileset.scn +++ b/demos/2d/isometric/tileset.scn diff --git a/demos/2d/isometric/troll.scn b/demos/2d/isometric/troll.scn Binary files differindex f5d87c3631..19b566fe05 100644 --- a/demos/2d/isometric/troll.scn +++ b/demos/2d/isometric/troll.scn diff --git a/demos/2d/isometric_light/cubio.scn b/demos/2d/isometric_light/cubio.scn Binary files differindex c52b7dfd4b..fc931b0c8d 100644 --- a/demos/2d/isometric_light/cubio.scn +++ b/demos/2d/isometric_light/cubio.scn diff --git a/demos/2d/isometric_light/map.scn b/demos/2d/isometric_light/map.scn Binary files differindex c1d11f8e4c..89002f991f 100644 --- a/demos/2d/isometric_light/map.scn +++ b/demos/2d/isometric_light/map.scn diff --git a/demos/2d/isometric_light/tileset.res b/demos/2d/isometric_light/tileset.res Binary files differindex dab6f36f57..f64a4e32bd 100644 --- a/demos/2d/isometric_light/tileset.res +++ b/demos/2d/isometric_light/tileset.res diff --git a/demos/2d/lookat/arrow.png b/demos/2d/lookat/arrow.png Binary files differnew file mode 100644 index 0000000000..25db91e8d1 --- /dev/null +++ b/demos/2d/lookat/arrow.png diff --git a/demos/2d/lookat/engine.cfg b/demos/2d/lookat/engine.cfg new file mode 100644 index 0000000000..56917a39ec --- /dev/null +++ b/demos/2d/lookat/engine.cfg @@ -0,0 +1,4 @@ +[application] + +name="Look At Pointer" +main_scene="res://lookat.scn" diff --git a/demos/2d/lookat/lookat.gd b/demos/2d/lookat/lookat.gd new file mode 100644 index 0000000000..742c5b0671 --- /dev/null +++ b/demos/2d/lookat/lookat.gd @@ -0,0 +1,43 @@ + +extends Sprite + +# member variables here, example: +# var a=2 +# var b="textvar" + +const MODE_DIRECT=0 +const MODE_CONSTANT=1 +const MODE_SMOOTH=2 + +const ROTATION_SPEED = 1 +const SMOOTH_SPEED = 2.0 + +export(int,"Direct","Constant","Smooth") var mode=MODE_DIRECT + +func _process(delta): + var mpos = get_viewport().get_mouse_pos() + + if (mode==MODE_DIRECT): + + look_at(mpos) + + elif (mode==MODE_CONSTANT): + + var ang = get_angle_to(mpos) + var s = sign(ang) + ang=abs(ang) + + rotate( min(ang,ROTATION_SPEED*delta)*s ) + + elif (mode==MODE_SMOOTH): + + var ang = get_angle_to(mpos) + + rotate( ang*delta*SMOOTH_SPEED ) + +func _ready(): + # Initialization here + set_process(true) + pass + + diff --git a/demos/2d/lookat/lookat.scn b/demos/2d/lookat/lookat.scn Binary files differnew file mode 100644 index 0000000000..880070b4c7 --- /dev/null +++ b/demos/2d/lookat/lookat.scn diff --git a/demos/3d/platformer/bullet.scn b/demos/3d/platformer/bullet.scn Binary files differindex 4f1623b7d9..da90dba1a5 100644 --- a/demos/3d/platformer/bullet.scn +++ b/demos/3d/platformer/bullet.scn diff --git a/demos/gui/translation/controls.gd b/demos/gui/translation/controls.gd new file mode 100644 index 0000000000..f8403f49a7 --- /dev/null +++ b/demos/gui/translation/controls.gd @@ -0,0 +1,20 @@ + +extends Panel + +# member variables here, example: +# var a=2 +# var b="textvar" + +func _ready(): + # Initialization here + pass + + + + +func _on_back_pressed(): + var s = load("res://main.scn") + var si = s.instance() + get_parent().add_child(si) + queue_free() + pass # replace with function body diff --git a/demos/gui/translation/controls.scn b/demos/gui/translation/controls.scn Binary files differnew file mode 100644 index 0000000000..66e6d47702 --- /dev/null +++ b/demos/gui/translation/controls.scn diff --git a/demos/gui/translation/engine.cfg b/demos/gui/translation/engine.cfg new file mode 100644 index 0000000000..169b65e154 --- /dev/null +++ b/demos/gui/translation/engine.cfg @@ -0,0 +1,9 @@ +[application] + +name="Translation Demo" +main_scene="res://main.scn" + +[locale] + +translations=["res://translations/text.en.xl", "res://translations/text.es.xl", "res://translations/text.ja.xl"] +translation_remaps={"res://flag_uk.png":["res://flag_spain.png:es", "res://flag_japan.png:ja"]} diff --git a/demos/gui/translation/flag_japan.png b/demos/gui/translation/flag_japan.png Binary files differnew file mode 100644 index 0000000000..4cc8267a5c --- /dev/null +++ b/demos/gui/translation/flag_japan.png diff --git a/demos/gui/translation/flag_spain.png b/demos/gui/translation/flag_spain.png Binary files differnew file mode 100644 index 0000000000..4d00f93593 --- /dev/null +++ b/demos/gui/translation/flag_spain.png diff --git a/demos/gui/translation/flag_uk.png b/demos/gui/translation/flag_uk.png Binary files differnew file mode 100644 index 0000000000..53fbef3d67 --- /dev/null +++ b/demos/gui/translation/flag_uk.png diff --git a/demos/gui/translation/main.gd b/demos/gui/translation/main.gd new file mode 100644 index 0000000000..bf3c0c0840 --- /dev/null +++ b/demos/gui/translation/main.gd @@ -0,0 +1,42 @@ + +extends Panel + +# member variables here, example: +# var a=2 +# var b="textvar" + +func _ready(): + # Initialization here + pass + + + +func _goto_scene(): + var s = load("res://controls.scn") + var si = s.instance() + get_parent().add_child(si) + queue_free() + pass + + +func _on_system_pressed(): + #will autodetect based on system, then fall back + #to english if not found + _goto_scene() + +#NOTE: Changling locale will not change the text in the controls, +# The scene must be reloaded for changes to take effect. + +func _on_english_pressed(): + TranslationServer.set_locale("en") + _goto_scene() + + +func _on_spanish_pressed(): + TranslationServer.set_locale("es") + _goto_scene() + + +func _on_japanese_pressed(): + TranslationServer.set_locale("ja") + _goto_scene() diff --git a/demos/gui/translation/main.scn b/demos/gui/translation/main.scn Binary files differnew file mode 100644 index 0000000000..76c9ba7b45 --- /dev/null +++ b/demos/gui/translation/main.scn diff --git a/demos/gui/translation/noto.fnt b/demos/gui/translation/noto.fnt Binary files differnew file mode 100644 index 0000000000..e019615f41 --- /dev/null +++ b/demos/gui/translation/noto.fnt diff --git a/demos/gui/translation/notosans.otf b/demos/gui/translation/notosans.otf Binary files differnew file mode 100644 index 0000000000..6443f9023e --- /dev/null +++ b/demos/gui/translation/notosans.otf diff --git a/demos/gui/translation/text.csv b/demos/gui/translation/text.csv new file mode 100644 index 0000000000..0f4c148b95 --- /dev/null +++ b/demos/gui/translation/text.csv @@ -0,0 +1,3 @@ +,en,es,ja +KEY_HELLO,Hello!,Hola!,こんにちは +KEY_PUSH,Push Me!,Aprétame!,私をプッシュ
\ No newline at end of file diff --git a/demos/gui/translation/translations/text.en.xl b/demos/gui/translation/translations/text.en.xl Binary files differnew file mode 100644 index 0000000000..7bcba63e71 --- /dev/null +++ b/demos/gui/translation/translations/text.en.xl diff --git a/demos/gui/translation/translations/text.es.xl b/demos/gui/translation/translations/text.es.xl Binary files differnew file mode 100644 index 0000000000..4474d955d5 --- /dev/null +++ b/demos/gui/translation/translations/text.es.xl diff --git a/demos/gui/translation/translations/text.ja.xl b/demos/gui/translation/translations/text.ja.xl Binary files differnew file mode 100644 index 0000000000..b3d1f0bf60 --- /dev/null +++ b/demos/gui/translation/translations/text.ja.xl diff --git a/platform/android/java/src/com/android/godot/Godot.java b/platform/android/java/src/com/android/godot/Godot.java index e0ac6b0f12..4f42a1a82b 100644 --- a/platform/android/java/src/com/android/godot/Godot.java +++ b/platform/android/java/src/com/android/godot/Godot.java @@ -747,7 +747,8 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC //} } break; case MotionEvent.ACTION_POINTER_UP: { - int pointer_idx = event.getActionIndex(); + final int indexPointUp = event.getAction() >> MotionEvent.ACTION_POINTER_INDEX_SHIFT; + final int pointer_idx = event.getPointerId(indexPointUp); GodotLib.touch(4,pointer_idx,evcount,arr); //System.out.printf("%d - s.up at: %f,%f\n",pointer_idx, event.getX(pointer_idx),event.getY(pointer_idx)); } break; diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index fc5be255ce..99c33c787d 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -346,6 +346,17 @@ Matrix32 Node2D::get_relative_transform(const Node *p_parent) const { return parent_2d->get_relative_transform(p_parent) * get_transform(); } + +void Node2D::look_at(const Vector2& p_pos) { + + rotate(get_angle_to(p_pos)); +} + +float Node2D::get_angle_to(const Vector2& p_pos) const { + + return (get_global_transform().affine_inverse().xform(p_pos)).atan2(); +} + void Node2D::_bind_methods() { @@ -374,6 +385,9 @@ void Node2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_transform","xform"),&Node2D::set_transform); ObjectTypeDB::bind_method(_MD("set_global_transform","xform"),&Node2D::set_global_transform); + ObjectTypeDB::bind_method(_MD("look_at","point"),&Node2D::look_at); + ObjectTypeDB::bind_method(_MD("get_angle_to","point"),&Node2D::get_angle_to); + ObjectTypeDB::bind_method(_MD("set_z","z"),&Node2D::set_z); ObjectTypeDB::bind_method(_MD("get_z"),&Node2D::get_z); diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index 74612b3c6d..8efce33cda 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -93,6 +93,9 @@ public: void set_z(int p_z); int get_z() const; + void look_at(const Vector2& p_pos); + float get_angle_to(const Vector2& p_pos) const; + void set_z_as_relative(bool p_enabled); bool is_z_relative() const; diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 9fd4a25e7f..3d2917d843 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -68,18 +68,32 @@ float PhysicsBody2D::get_one_way_collision_max_depth() const{ } +void PhysicsBody2D::_set_layers(uint32_t p_mask) { + + set_layer_mask(p_mask); + set_collision_mask(p_mask); +} + +uint32_t PhysicsBody2D::_get_layers() const{ + + return get_layer_mask(); +} + void PhysicsBody2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_layer_mask","mask"),&PhysicsBody2D::set_layer_mask); ObjectTypeDB::bind_method(_MD("get_layer_mask"),&PhysicsBody2D::get_layer_mask); ObjectTypeDB::bind_method(_MD("set_collision_mask","mask"),&PhysicsBody2D::set_collision_mask); ObjectTypeDB::bind_method(_MD("get_collision_mask"),&PhysicsBody2D::get_collision_mask); + ObjectTypeDB::bind_method(_MD("_set_layers","mask"),&PhysicsBody2D::_set_layers); + ObjectTypeDB::bind_method(_MD("_get_layers"),&PhysicsBody2D::_get_layers); ObjectTypeDB::bind_method(_MD("set_one_way_collision_direction","dir"),&PhysicsBody2D::set_one_way_collision_direction); ObjectTypeDB::bind_method(_MD("get_one_way_collision_direction"),&PhysicsBody2D::get_one_way_collision_direction); ObjectTypeDB::bind_method(_MD("set_one_way_collision_max_depth","depth"),&PhysicsBody2D::set_one_way_collision_max_depth); ObjectTypeDB::bind_method(_MD("get_one_way_collision_max_depth"),&PhysicsBody2D::get_one_way_collision_max_depth); ObjectTypeDB::bind_method(_MD("add_collision_exception_with","body:PhysicsBody2D"),&PhysicsBody2D::add_collision_exception_with); ObjectTypeDB::bind_method(_MD("remove_collision_exception_with","body:PhysicsBody2D"),&PhysicsBody2D::remove_collision_exception_with); + ADD_PROPERTY(PropertyInfo(Variant::INT,"layers",PROPERTY_HINT_ALL_FLAGS,"",0),_SCS("_set_layers"),_SCS("_get_layers")); //for backwards compat ADD_PROPERTY(PropertyInfo(Variant::INT,"collision/layers",PROPERTY_HINT_ALL_FLAGS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); ADD_PROPERTY(PropertyInfo(Variant::INT,"collision/mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"one_way_collision/direction"),_SCS("set_one_way_collision_direction"),_SCS("get_one_way_collision_direction")); diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index b6be07500f..03f95959b6 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -42,6 +42,11 @@ class PhysicsBody2D : public CollisionObject2D { uint32_t collision_mask; Vector2 one_way_collision_direction; float one_way_collision_max_depth; + + + void _set_layers(uint32_t p_mask); + uint32_t _get_layers() const; + protected: void _notification(int p_what); diff --git a/scene/main/node.cpp b/scene/main/node.cpp index e0181b9238..5c60b9fbff 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1417,6 +1417,41 @@ void Node::_duplicate_and_reown(Node* p_new_parent, const Map<Node*,Node*>& p_re } + +void Node::_duplicate_signals(const Node* p_original,Node* p_copy) const { + + if (this!=p_original && get_owner()!=p_original) + return; + + List<Connection> conns; + get_all_signal_connections(&conns); + + for (List<Connection>::Element *E=conns.front();E;E=E->next()) { + + if (E->get().flags&CONNECT_PERSIST) { + //user connected + NodePath p = p_original->get_path_to(this); + Node *copy = p_copy->get_node(p); + + Node *target = E->get().target->cast_to<Node>(); + if (!target) + continue; + NodePath ptarget = p_original->get_path_to(target); + Node *copytarget = p_copy->get_node(ptarget); + + if (copy && copytarget) { + copy->connect(E->get().signal,copytarget,E->get().method,E->get().binds,CONNECT_PERSIST); + } + } + } + + for(int i=0;i<get_child_count();i++) { + get_child(i)->_duplicate_signals(p_original,p_copy); + } + +} + + Node *Node::duplicate_and_reown(const Map<Node*,Node*>& p_reown_map) const { @@ -1455,6 +1490,7 @@ Node *Node::duplicate_and_reown(const Map<Node*,Node*>& p_reown_map) const { get_child(i)->_duplicate_and_reown(node,p_reown_map); } + _duplicate_signals(this,node); return node; } diff --git a/scene/main/node.h b/scene/main/node.h index 4d0a84d347..be32c4e726 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -126,6 +126,7 @@ private: void _propagate_pause_owner(Node*p_owner); Array _get_node_and_resource(const NodePath& p_path); + void _duplicate_signals(const Node* p_original,Node* p_copy) const; void _duplicate_and_reown(Node* p_new_parent, const Map<Node*,Node*>& p_reown_map) const; Array _get_children() const; Array _get_groups() const; diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 4d9feb3af1..3bb64e54c6 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1177,6 +1177,11 @@ void Viewport::_vp_unhandled_input(const InputEvent& p_ev) { } +Vector2 Viewport::get_mouse_pos() const { + + return (get_final_transform().affine_inverse() * _get_input_pre_xform()).xform(Input::get_singleton()->get_mouse_pos()); +} + void Viewport::warp_mouse(const Vector2& p_pos) { Vector2 gpos = (get_final_transform().affine_inverse() * _get_input_pre_xform()).affine_inverse().xform(p_pos); @@ -1377,6 +1382,7 @@ void Viewport::_bind_methods() { ObjectTypeDB::bind_method(_MD("is_audio_listener_2d","enable"), &Viewport::is_audio_listener_2d); ObjectTypeDB::bind_method(_MD("set_render_target_to_screen_rect"), &Viewport::set_render_target_to_screen_rect); + ObjectTypeDB::bind_method(_MD("get_mouse_pos"), &Viewport::get_mouse_pos); ObjectTypeDB::bind_method(_MD("warp_mouse","to_pos"), &Viewport::warp_mouse); ADD_PROPERTY( PropertyInfo(Variant::RECT2,"rect"), _SCS("set_rect"), _SCS("get_rect") ); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index fba6725610..c3c339ac5d 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -252,6 +252,7 @@ public: void set_render_target_to_screen_rect(const Rect2& p_rect); Rect2 get_render_target_to_screen_rect() const; + Vector2 get_mouse_pos() const; void warp_mouse(const Vector2& p_pos); void set_physics_object_picking(bool p_enable); diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp index e8d37d346a..6bfed134e6 100644 --- a/servers/physics_2d/body_pair_2d_sw.cpp +++ b/servers/physics_2d/body_pair_2d_sw.cpp @@ -265,7 +265,7 @@ bool BodyPair2DSW::setup(float p_step) { } //faster to set than to check.. - bool prev_collided=collided; + //bool prev_collided=collided; collided = CollisionSolver2DSW::solve(shape_A_ptr,xform_A,motion_A,shape_B_ptr,xform_B,motion_B,_add_contact,this,&sep_axis); if (!collided) { @@ -282,12 +282,18 @@ bool BodyPair2DSW::setup(float p_step) { collided=true; } - if (!collided) + if (!collided) { + oneway_disabled=false; return false; + } } - if (!prev_collided) { + if (oneway_disabled) + return false; + + //if (!prev_collided) { + { if (A->is_using_one_way_collision()) { Vector2 direction = A->get_one_way_collision_direction(); @@ -309,6 +315,7 @@ bool BodyPair2DSW::setup(float p_step) { if (!valid) { collided=false; + oneway_disabled=true; return false; } } @@ -333,6 +340,7 @@ bool BodyPair2DSW::setup(float p_step) { } if (!valid) { collided=false; + oneway_disabled=true; return false; } } @@ -525,6 +533,7 @@ BodyPair2DSW::BodyPair2DSW(Body2DSW *p_A, int p_shape_A,Body2DSW *p_B, int p_sha B->add_constraint(this,1); contact_count=0; collided=false; + oneway_disabled=false; } diff --git a/servers/physics_2d/body_pair_2d_sw.h b/servers/physics_2d/body_pair_2d_sw.h index 2365512036..a7fa287be4 100644 --- a/servers/physics_2d/body_pair_2d_sw.h +++ b/servers/physics_2d/body_pair_2d_sw.h @@ -76,6 +76,7 @@ class BodyPair2DSW : public Constraint2DSW { Contact contacts[MAX_CONTACTS]; int contact_count; bool collided; + bool oneway_disabled; int cc; diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index b38cf0c2df..9b69ab299d 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -655,7 +655,12 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body,const Vector2&p_motion,float p if (col_obj->get_type()==CollisionObject2DSW::TYPE_BODY) { const Body2DSW *body=static_cast<const Body2DSW*>(col_obj); - cbk.valid_dir=body->get_one_way_collision_direction(); + + Vector2 cdir = body->get_one_way_collision_direction(); + if (cdir!=Vector2() && p_motion.dot(cdir)<0) + continue; + + cbk.valid_dir=cdir; cbk.valid_depth=body->get_one_way_collision_max_depth(); } else { cbk.valid_dir=Vector2(); diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index a6625d7204..5e5d2a5409 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2122,7 +2122,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } editor_data.get_undo_redo().clear_history(); - if (editor_plugin_screen) { //reload editor plugin + if (editor_plugin_over) { //reload editor plugin editor_plugin_over->edit(NULL); editor_plugin_over->edit(current); } diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 9a4505efed..f49d3b496d 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -264,6 +264,7 @@ void EditorSettings::create() { singleton = Ref<EditorSettings>( memnew( EditorSettings ) ); singleton->config_file_path=config_file_path; + singleton->settings_path=config_path+"/"+config_dir; singleton->_load_defaults(); singleton->scan_plugins(); diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index ac2ea9799e..0b3f3e0626 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -3372,6 +3372,7 @@ void SpatialEditor::_notification(int p_what) { tool_button[SpatialEditor::TOOL_MODE_ROTATE]->set_icon( get_icon("ToolRotate","EditorIcons") ); tool_button[SpatialEditor::TOOL_MODE_SCALE]->set_icon( get_icon("ToolScale","EditorIcons") ); instance_button->set_icon( get_icon("SpatialAdd","EditorIcons") ); + instance_button->hide(); view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT),get_icon("Panels1","EditorIcons")); diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 63187d2903..374dda852b 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -479,6 +479,11 @@ Error ProjectExportDialog::export_platform(const String& p_platform, const Strin if (err!=OK) { error->set_text("Error exporting project!"); error->popup_centered_minsize(); + ERR_PRINT("Exporting failed!"); + if (p_quit_after) { + OS::get_singleton()->set_exit_code(255); + get_tree()->quit(); + } return ERR_CANT_CREATE; } else { if (p_quit_after) { diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index 85adbd3a3b..08a1191f41 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -916,8 +916,8 @@ void ProjectSettings::_translation_res_option_changed() { ERR_FAIL_COND(!remaps.has(key)); - StringArray r = remaps[key]; - ERR_FAIL_INDEX(idx,remaps.size()); + StringArray r = remaps[key]; + ERR_FAIL_INDEX(idx,r.size()); r.set(idx,path+":"+langs[which]); remaps[key]=r; @@ -1095,6 +1095,7 @@ void ProjectSettings::_update_translations() { t2->set_editable(1,true); t2->set_metadata(1,path); int idx = langs.find(locale); + print_line("find "+locale+" at "+itos(idx)); if (idx<0) idx=0; |