diff options
-rw-r--r-- | core/os/file_access.cpp | 4 | ||||
-rw-r--r-- | core/variant_call.cpp | 2 | ||||
-rw-r--r-- | doc/base/classes.xml | 192 | ||||
-rw-r--r-- | scene/animation/animation_player.cpp | 3 | ||||
-rw-r--r-- | scene/audio/stream_player.cpp | 2 | ||||
-rw-r--r-- | scene/main/node.cpp | 10 | ||||
-rw-r--r-- | scene/main/node.h | 2 | ||||
-rw-r--r-- | scene/scene_string_names.cpp | 1 | ||||
-rw-r--r-- | scene/scene_string_names.h | 1 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 1 | ||||
-rw-r--r-- | tools/editor/scene_tree_dock.cpp | 1 |
11 files changed, 217 insertions, 2 deletions
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index 0846ef3eb0..a3ee9395de 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -284,7 +284,7 @@ Vector<String> FileAccess::get_csv_line(String delim) const { String l; int qc=0; do { - l+=get_line(); + l+=get_line()+"\n"; qc=0; for(int i=0;i<l.length();i++) { @@ -295,6 +295,8 @@ Vector<String> FileAccess::get_csv_line(String delim) const { } while (qc%2); + l=l.substr(0, l.length()-1); + Vector<String> strings; bool in_quote=false; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index a4963f0d1f..f3bf8f9e47 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -246,6 +246,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM1R(String,match); VCALL_LOCALMEM1R(String,matchn); VCALL_LOCALMEM1R(String,begins_with); + VCALL_LOCALMEM1R(String,ends_with); VCALL_LOCALMEM2R(String,replace); VCALL_LOCALMEM2R(String,replacen); VCALL_LOCALMEM2R(String,insert); @@ -1261,6 +1262,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC1(STRING,BOOL,String,match,STRING,"expr",varray()); ADDFUNC1(STRING,BOOL,String,matchn,STRING,"expr",varray()); ADDFUNC1(STRING,BOOL,String,begins_with,STRING,"text",varray()); + ADDFUNC1(STRING,BOOL,String,ends_with,STRING,"text",varray()); ADDFUNC2(STRING,STRING,String,replace,STRING,"what",STRING,"forwhat",varray()); ADDFUNC2(STRING,STRING,String,replacen,STRING,"what",STRING,"forwhat",varray()); diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 23b699ecb0..b77a1c29a8 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -3561,6 +3561,62 @@ <description> </description> </method> + <method name="set_collision_mask"> + <argument index="0" name="collision_mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_collision_mask" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="set_layer_mask"> + <argument index="0" name="layer_mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_layer_mask" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="set_collision_mask_bit"> + <argument index="0" name="bit" type="int"> + </argument> + <argument index="1" name="value" type="bool"> + </argument> + <description> + </description> + </method> + <method name="get_collision_mask_bit" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="bit" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_layer_mask_bit"> + <argument index="0" name="bit" type="int"> + </argument> + <argument index="1" name="value" type="bool"> + </argument> + <description> + </description> + </method> + <method name="get_layer_mask_bit" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="bit" type="int"> + </argument> + <description> + </description> + </method> <method name="set_monitorable"> <argument index="0" name="enable" type="bool"> </argument> @@ -9683,6 +9739,14 @@ This approximation makes straight segments between each point, then subdivides t Return true if the dictionary has a given key. </description> </method> + <method name="has_all"> + <return type="bool"> + </return> + <argument index="0" name="values" type="Array"> + </argument> + <description> + </description> + </method> <method name="hash"> <return type="int"> </return> @@ -25065,6 +25129,50 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> + <method name="set_collision_mask"> + <argument index="0" name="mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_collision_mask" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="set_collision_mask_bit"> + <argument index="0" name="bit" type="int"> + </argument> + <argument index="1" name="value" type="bool"> + </argument> + <description> + </description> + </method> + <method name="get_collision_mask_bit" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="bit" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_layer_mask_bit"> + <argument index="0" name="bit" type="int"> + </argument> + <argument index="1" name="value" type="bool"> + </argument> + <description> + </description> + </method> + <method name="get_layer_mask_bit" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="bit" type="int"> + </argument> + <description> + </description> + </method> <method name="add_collision_exception_with"> <argument index="0" name="body" type="PhysicsBody"> </argument> @@ -25681,6 +25789,22 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> + <method name="area_set_layer_mask"> + <argument index="0" name="area" type="RID"> + </argument> + <argument index="1" name="mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="area_set_collision_mask"> + <argument index="0" name="area" type="RID"> + </argument> + <argument index="1" name="mask" type="int"> + </argument> + <description> + </description> + </method> <method name="area_set_param"> <argument index="0" name="area" type="RID"> </argument> @@ -25799,6 +25923,42 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> + <method name="body_set_layer_mask"> + <argument index="0" name="body" type="RID"> + </argument> + <argument index="1" name="mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="body_get_layer_mask" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="body" type="RID"> + </argument> + <argument index="1" name="arg1" type="int"> + </argument> + <description> + </description> + </method> + <method name="body_set_collision_mask"> + <argument index="0" name="body" type="RID"> + </argument> + <argument index="1" name="mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="body_get_collision_mask" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="body" type="RID"> + </argument> + <argument index="1" name="arg1" type="int"> + </argument> + <description> + </description> + </method> <method name="body_add_shape"> <argument index="0" name="body" type="RID"> </argument> @@ -28265,6 +28425,30 @@ This method controls whether the position between two cached points is interpola <description> </description> </method> + <method name="set_layer_mask"> + <argument index="0" name="mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_layer_mask" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="set_type_mask"> + <argument index="0" name="mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_type_mask" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> @@ -35079,6 +35263,14 @@ This method controls whether the position between two cached points is interpola Return true if the string is empty. </description> </method> + <method name="ends_with"> + <return type="bool"> + </return> + <argument index="0" name="text" type="String"> + </argument> + <description> + </description> + </method> <method name="extension"> <return type="String"> </return> diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 32958112e5..25f49a8a8b 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1012,6 +1012,8 @@ void AnimationPlayer::play(const StringName& p_name, float p_custom_blend, float queued.clear(); _set_process(true); // always process when starting an animation playing = true; + + emit_signal(SceneStringNames::get_singleton()->animation_started, c.assigned); if (is_inside_tree() && get_tree()->is_editor_hint()) return; // no next in this case @@ -1347,6 +1349,7 @@ void AnimationPlayer::_bind_methods() { ADD_SIGNAL( MethodInfo("finished") ); ADD_SIGNAL( MethodInfo("animation_changed", PropertyInfo(Variant::STRING,"old_name"), PropertyInfo(Variant::STRING,"new_name")) ); + ADD_SIGNAL( MethodInfo("animation_started", PropertyInfo(Variant::STRING,"name")) ); BIND_CONSTANT( ANIMATION_PROCESS_FIXED ); BIND_CONSTANT( ANIMATION_PROCESS_IDLE ); diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp index b6b1ee85f3..050e945c8f 100644 --- a/scene/audio/stream_player.cpp +++ b/scene/audio/stream_player.cpp @@ -388,7 +388,7 @@ void StreamPlayer::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") ); ADD_SIGNAL(MethodInfo("finished")); diff --git a/scene/main/node.cpp b/scene/main/node.cpp index b90edb38b2..f4c41256db 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1374,6 +1374,16 @@ bool Node::is_editable_instance(Node *p_node) const { return data.editable_instances.has(p); } +void Node::set_editable_instances(const HashMap<NodePath,int>& p_editable_instances) { + + data.editable_instances=p_editable_instances; +} + +HashMap<NodePath,int> Node::get_editable_instances() const { + + return data.editable_instances; +} + #if 0 diff --git a/scene/main/node.h b/scene/main/node.h index 5c6147d644..560a2e588a 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -239,6 +239,8 @@ public: void set_editable_instance(Node* p_node,bool p_editable); bool is_editable_instance(Node* p_node) const; + void set_editable_instances(const HashMap<NodePath,int>& p_editable_instances); + HashMap<NodePath,int> get_editable_instances() const; /* NOTIFICATIONS */ diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index f47b61001c..28834c732d 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -52,6 +52,7 @@ SceneStringNames::SceneStringNames() { finished=StaticCString::create("finished"); animation_changed=StaticCString::create("animation_changed"); + animation_started=StaticCString::create("animation_started"); mouse_enter=StaticCString::create("mouse_enter"); mouse_exit=StaticCString::create("mouse_exit"); diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index fc45351c33..f85a858423 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -79,6 +79,7 @@ public: StringName finished; StringName animation_changed; + StringName animation_started; StringName body_enter_shape; StringName body_enter; diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index aa47e97622..316485f42a 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2672,6 +2672,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { break; } + _menu_option_confirm(RUN_STOP,true); get_tree()->quit(); String exec = OS::get_singleton()->get_executable_path(); diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 6b2961ea72..c6115ba87a 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -1317,6 +1317,7 @@ void SceneTreeDock::_create() { if (n==edited_scene) { edited_scene=newnode; editor->set_edited_scene(newnode); + newnode->set_editable_instances(n->get_editable_instances()); } //small hack to make collisionshapes and other kind of nodes to work |