summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--SConstruct11
-rw-r--r--core/array.cpp24
-rw-r--r--core/array.h3
-rw-r--r--core/global_constants.cpp1
-rw-r--r--core/io/unzip.c17
-rw-r--r--core/object.h1
-rw-r--r--core/os/file_access.cpp2
-rw-r--r--core/os/file_access.h8
-rw-r--r--core/script_language.cpp12
-rw-r--r--core/script_language.h4
-rw-r--r--core/ustring.cpp44
-rw-r--r--core/ustring.h3
-rw-r--r--core/variant.cpp4
-rw-r--r--core/variant_call.cpp10
-rw-r--r--core/variant_parser.cpp40
-rw-r--r--core/vector.h10
-rw-r--r--doc/base/classes.xml336
-rw-r--r--drivers/unix/file_access_unix.cpp5
-rw-r--r--drivers/windows/file_access_windows.cpp4
-rw-r--r--modules/gdscript/gd_compiler.cpp3
-rw-r--r--modules/gdscript/gd_function.cpp7
-rw-r--r--modules/gdscript/gd_functions.cpp70
-rw-r--r--modules/gdscript/gd_parser.cpp6
-rw-r--r--modules/gdscript/gd_script.cpp5
-rw-r--r--modules/gdscript/gd_tokenizer.cpp5
-rw-r--r--modules/gridmap/grid_map.cpp2
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp2
-rw-r--r--platform/android/export/export.cpp175
-rw-r--r--platform/osx/detect.py7
-rw-r--r--platform/windows/detect.py9
-rw-r--r--platform/windows/os_windows.cpp8
-rw-r--r--platform/x11/detect.py15
-rw-r--r--platform/x11/os_x11.cpp75
-rw-r--r--platform/x11/os_x11.h22
-rw-r--r--scene/3d/spatial.cpp9
-rw-r--r--scene/3d/vehicle_body.cpp2
-rw-r--r--scene/3d/vehicle_body.h2
-rw-r--r--scene/audio/sample_player.cpp4
-rw-r--r--scene/gui/base_button.cpp9
-rw-r--r--scene/gui/control.cpp45
-rw-r--r--scene/gui/item_list.cpp110
-rw-r--r--scene/gui/item_list.h12
-rw-r--r--scene/gui/label.cpp8
-rw-r--r--scene/gui/line_edit.cpp25
-rw-r--r--scene/gui/rich_text_label.cpp2
-rw-r--r--scene/gui/split_container.cpp2
-rw-r--r--scene/gui/split_container.h2
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/gui/text_edit.h2
-rw-r--r--scene/gui/texture_frame.cpp28
-rw-r--r--scene/gui/texture_frame.h3
-rw-r--r--scene/gui/tree.cpp3
-rw-r--r--scene/main/viewport.cpp4
-rw-r--r--scene/resources/packed_scene.cpp16
-rw-r--r--scene/resources/room.cpp2
-rw-r--r--scene/resources/room.h2
-rw-r--r--scene/resources/theme.cpp7
-rw-r--r--servers/physics_2d_server.cpp8
-rw-r--r--tools/editor/code_editor.cpp17
-rw-r--r--tools/editor/connections_dialog.cpp147
-rw-r--r--tools/editor/connections_dialog.h1
-rw-r--r--tools/editor/create_dialog.cpp6
-rw-r--r--tools/editor/dependency_editor.cpp5
-rw-r--r--tools/editor/editor_file_dialog.cpp4
-rw-r--r--tools/editor/editor_help.cpp2
-rw-r--r--tools/editor/editor_node.cpp20
-rw-r--r--tools/editor/editor_node.h1
-rw-r--r--tools/editor/editor_settings.cpp22
-rw-r--r--tools/editor/editor_settings.h6
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp59
-rw-r--r--tools/editor/plugins/script_editor_plugin.h2
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/texture_region_editor_plugin.cpp44
-rw-r--r--tools/editor/plugins/texture_region_editor_plugin.h2
-rw-r--r--tools/editor/plugins/theme_editor_plugin.cpp1
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.cpp6
-rw-r--r--tools/editor/project_manager.cpp12
-rw-r--r--tools/editor/property_editor.cpp10
-rw-r--r--tools/editor/quick_open.cpp4
-rw-r--r--tools/editor/scene_tree_dock.cpp2
-rw-r--r--tools/editor/scene_tree_editor.cpp48
-rw-r--r--tools/editor/scene_tree_editor.h2
-rw-r--r--tools/editor/scenes_dock.cpp6
-rw-r--r--tools/editor/script_editor_debugger.cpp4
-rw-r--r--tools/translations/ko.po137
86 files changed, 1377 insertions, 456 deletions
diff --git a/.travis.yml b/.travis.yml
index c5f9cf48b7..3c7ee5c102 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -54,7 +54,7 @@ addons:
- libglu1-mesa-dev
- libssl-dev
- libxinerama-dev
- - libudev-dev
+ - libxrandr-dev
# For cross-compiling to Windows.
- binutils-mingw-w64-i686
diff --git a/SConstruct b/SConstruct
index 0f9b046e2b..038d42f946 100644
--- a/SConstruct
+++ b/SConstruct
@@ -123,7 +123,7 @@ opts.Add('minizip','Build Minizip Archive Support: (yes/no)','yes')
opts.Add('squish','Squish BC Texture Compression in editor (yes/no)','yes')
opts.Add('theora','Theora Video (yes/no)','yes')
opts.Add('theoralib','Theora Video (yes/no)','no')
-opts.Add('freetype','Freetype support in editor','yes')
+opts.Add('freetype','Freetype support in editor','builtin')
opts.Add('speex','Speex Audio (yes/no)','yes')
opts.Add('xml','XML Save/Load support (yes/no)','yes')
opts.Add('png','PNG Image loader support (yes/no)','yes')
@@ -190,6 +190,7 @@ elif env_base['p'] != "":
env_base["platform"]=selected_platform
+
if selected_platform in platform_list:
sys.path.append("./platform/"+selected_platform)
@@ -246,6 +247,14 @@ if selected_platform in platform_list:
#must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11)
detect.configure(env)
+
+ if (env["freetype"]!="no"):
+ env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
+ if (env["freetype"]=="builtin"):
+ env.Append(CPPPATH=['#drivers/freetype'])
+ env.Append(CPPPATH=['#drivers/freetype/freetype/include'])
+
+
#env['platform_libsuffix'] = env['LIBSUFFIX']
suffix="."+selected_platform
diff --git a/core/array.cpp b/core/array.cpp
index 1d283a14aa..bb8e527304 100644
--- a/core/array.cpp
+++ b/core/array.cpp
@@ -150,17 +150,26 @@ void Array::erase(const Variant& p_value) {
_p->array.erase(p_value);
}
-int Array::find(const Variant& p_value) const {
+int Array::find(const Variant& p_value, int p_from) const {
- return _p->array.find(p_value);
+ return _p->array.find(p_value, p_from);
}
-int Array::find_last(const Variant& p_value) const {
+int Array::rfind(const Variant& p_value, int p_from) const {
- if(_p->array.size() == 0)
+ if (_p->array.size() == 0)
return -1;
- for (int i=_p->array.size()-1; i>=0; i--) {
+ if (p_from < 0) {
+ // Relative offset from the end
+ p_from = _p->array.size() + p_from;
+ }
+ if (p_from < 0 || p_from >= _p->array.size()) {
+ // Limit to array boundaries
+ p_from = _p->array.size() - 1;
+ }
+
+ for (int i=p_from; i>=0; i--) {
if(_p->array[i] == p_value){
return i;
@@ -170,6 +179,11 @@ int Array::find_last(const Variant& p_value) const {
return -1;
}
+int Array::find_last(const Variant& p_value) const {
+
+ return rfind(p_value);
+}
+
int Array::count(const Variant& p_value) const {
if(_p->array.size() == 0)
diff --git a/core/array.h b/core/array.h
index 9472a6dd21..096660653e 100644
--- a/core/array.h
+++ b/core/array.h
@@ -71,7 +71,8 @@ public:
void sort_custom(Object *p_obj,const StringName& p_function);
void invert();
- int find(const Variant& p_value) const;
+ int find(const Variant& p_value, int p_from=0) const;
+ int rfind(const Variant& p_value, int p_from=-1) const;
int find_last(const Variant& p_value) const;
int count(const Variant& p_value) const;
diff --git a/core/global_constants.cpp b/core/global_constants.cpp
index 63764383ff..2594be63ac 100644
--- a/core/global_constants.cpp
+++ b/core/global_constants.cpp
@@ -489,6 +489,7 @@ static _GlobalConstant _global_constants[]={
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORE_IF_NONONE ),
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_NO_INSTANCE_STATE ),
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_RESTART_IF_CHANGED ),
+ BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_SCRIPT_VARIABLE ),
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_DEFAULT ),
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_DEFAULT_INTL ),
diff --git a/core/io/unzip.c b/core/io/unzip.c
index 78672677f9..7aa0a86d13 100644
--- a/core/io/unzip.c
+++ b/core/io/unzip.c
@@ -1031,10 +1031,19 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file,
if (lSeek!=0)
{
- if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
- lSeek=0;
- else
- err=UNZ_ERRNO;
+ if (lSeek<0) {
+ // WORKAROUND for backwards seeking
+ z_off_t pos = ZTELL64(s->z_filefunc, s->filestream);
+ if (ZSEEK64(s->z_filefunc, s->filestream,pos+lSeek,ZLIB_FILEFUNC_SEEK_SET)==0)
+ lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ } else {
+ if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
+ lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ }
}
while(acc < file_info.size_file_extra)
diff --git a/core/object.h b/core/object.h
index 9359f4d4b2..a27e8c7dd8 100644
--- a/core/object.h
+++ b/core/object.h
@@ -86,6 +86,7 @@ enum PropertyUsageFlags {
PROPERTY_USAGE_STORE_IF_NONONE=1024, //only store if false
PROPERTY_USAGE_NO_INSTANCE_STATE=2048,
PROPERTY_USAGE_RESTART_IF_CHANGED=4096,
+ PROPERTY_USAGE_SCRIPT_VARIABLE=8192,
PROPERTY_USAGE_DEFAULT=PROPERTY_USAGE_STORAGE|PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_NETWORK,
PROPERTY_USAGE_DEFAULT_INTL=PROPERTY_USAGE_STORAGE|PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_NETWORK|PROPERTY_USAGE_INTERNATIONALIZED,
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index a3ee9395de..1f23e8f33d 100644
--- a/core/os/file_access.cpp
+++ b/core/os/file_access.cpp
@@ -35,6 +35,8 @@
FileAccess::CreateFunc FileAccess::create_func[ACCESS_MAX]={0,0};
+FileAccess::FileCloseFailNotify FileAccess::close_fail_notify=NULL;
+
bool FileAccess::backup_save=false;
diff --git a/core/os/file_access.h b/core/os/file_access.h
index 2c894c94eb..8d5823663e 100644
--- a/core/os/file_access.h
+++ b/core/os/file_access.h
@@ -47,6 +47,8 @@ public:
ACCESS_MAX
};
+ typedef void (*FileCloseFailNotify)(const String&);
+
typedef FileAccess*(*CreateFunc)();
bool endian_swap;
bool real_is_double;
@@ -56,7 +58,7 @@ protected:
virtual Error _open(const String& p_path, int p_mode_flags)=0; ///< open a file
virtual uint64_t _get_modified_time(const String& p_file)=0;
-
+ static FileCloseFailNotify close_fail_notify;
private:
static bool backup_save;
@@ -69,8 +71,12 @@ private:
return memnew( T );
}
+
+
public:
+ static void set_file_close_fail_notify_callback(FileCloseFailNotify p_cbk) { close_fail_notify=p_cbk; }
+
virtual void _set_access_type(AccessType p_access);
enum ModeFlags {
diff --git a/core/script_language.cpp b/core/script_language.cpp
index b3116a0297..68a694398a 100644
--- a/core/script_language.cpp
+++ b/core/script_language.cpp
@@ -32,7 +32,7 @@ ScriptLanguage *ScriptServer::_languages[MAX_LANGUAGES];
int ScriptServer::_language_count=0;
bool ScriptServer::scripting_enabled=true;
-
+bool ScriptServer::reload_scripts_on_save=false;
void Script::_notification( int p_what) {
@@ -92,6 +92,16 @@ void ScriptServer::init_languages() {
}
}
+void ScriptServer::set_reload_scripts_on_save(bool p_enable) {
+
+ reload_scripts_on_save=p_enable;
+}
+
+bool ScriptServer::is_reload_scripts_on_save_enabled() {
+
+ return reload_scripts_on_save;
+}
+
void ScriptInstance::get_property_state(List<Pair<StringName, Variant> > &state) {
List<PropertyInfo> pinfo;
diff --git a/core/script_language.h b/core/script_language.h
index cbf6d8e116..478ebd88ed 100644
--- a/core/script_language.h
+++ b/core/script_language.h
@@ -47,6 +47,7 @@ class ScriptServer {
static ScriptLanguage *_languages[MAX_LANGUAGES];
static int _language_count;
static bool scripting_enabled;
+ static bool reload_scripts_on_save;
public:
static void set_scripting_enabled(bool p_enabled);
@@ -55,6 +56,9 @@ public:
static ScriptLanguage *get_language(int p_idx);
static void register_language(ScriptLanguage *p_language);
+ static void set_reload_scripts_on_save(bool p_enable);
+ static bool is_reload_scripts_on_save_enabled();
+
static void init_languages();
};
diff --git a/core/ustring.cpp b/core/ustring.cpp
index a039ba11cd..309b9e08fa 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -2752,6 +2752,50 @@ bool String::begins_with(const char* p_string) const {
}
+bool String::is_subsequence_of(const String& p_string) const {
+
+ return _base_is_subsequence_of(p_string, false);
+}
+
+bool String::is_subsequence_ofi(const String& p_string) const {
+
+ return _base_is_subsequence_of(p_string, true);
+}
+
+bool String::_base_is_subsequence_of(const String& p_string, bool case_insensitive) const {
+
+ int len=length();
+ if (len == 0) {
+ // Technically an empty string is subsequence of any string
+ return true;
+ }
+
+ if (len > p_string.length()) {
+ return false;
+ }
+
+ const CharType *src = &operator[](0);
+ const CharType *tgt = &p_string[0];
+
+ for (;*src && *tgt;tgt++) {
+ bool match = false;
+ if (case_insensitive) {
+ CharType srcc = _find_lower(*src);
+ CharType tgtc = _find_lower(*tgt);
+ match = srcc == tgtc;
+ } else {
+ match = *src == *tgt;
+ }
+ if (match) {
+ src++;
+ if(!*src) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
static bool _wildcard_match(const CharType* p_pattern, const CharType* p_string,bool p_case_sensitive) {
switch (*p_pattern) {
diff --git a/core/ustring.h b/core/ustring.h
index e03f74f506..fddb77b040 100644
--- a/core/ustring.h
+++ b/core/ustring.h
@@ -66,6 +66,7 @@ class String : public Vector<CharType> {
void copy_from(const char *p_cstr);
void copy_from(const CharType* p_cstr, int p_clip_to=-1);
void copy_from(const CharType& p_char);
+ bool _base_is_subsequence_of(const String& p_string, bool case_insensitive) const;
public:
@@ -122,6 +123,8 @@ public:
bool begins_with(const String& p_string) const;
bool begins_with(const char* p_string) const;
bool ends_with(const String& p_string) const;
+ bool is_subsequence_of(const String& p_string) const;
+ bool is_subsequence_ofi(const String& p_string) const;
String replace_first(String p_key,String p_with) const;
String replace(String p_key,String p_with) const;
String replacen(String p_key,String p_with) const;
diff --git a/core/variant.cpp b/core/variant.cpp
index 38f5e69cc0..472d6cf568 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -3029,9 +3029,9 @@ String Variant::get_call_error_text(Object* p_base, const StringName& p_method,c
int errorarg=ce.argument;
err_text="Cannot convert argument "+itos(errorarg+1)+" from "+Variant::get_type_name(p_argptrs[errorarg]->get_type())+" to "+Variant::get_type_name(ce.expected)+".";
} else if (ce.error==Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) {
- err_text="Expected "+itos(ce.argument)+" arguments.";
+ err_text="Method expected "+itos(ce.argument)+" arguments, but called with "+itos(p_argcount)+".";
} else if (ce.error==Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) {
- err_text="Expected "+itos(ce.argument)+" arguments.";
+ err_text="Method expected "+itos(ce.argument)+" arguments, but called with "+itos(p_argcount)+".";
} else if (ce.error==Variant::CallError::CALL_ERROR_INVALID_METHOD) {
err_text="Method not found.";
} else if (ce.error==Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL) {
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index d427a80541..94ab93d55c 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -247,6 +247,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
VCALL_LOCALMEM1R(String,matchn);
VCALL_LOCALMEM1R(String,begins_with);
VCALL_LOCALMEM1R(String,ends_with);
+ VCALL_LOCALMEM1R(String,is_subsequence_of);
+ VCALL_LOCALMEM1R(String,is_subsequence_ofi);
VCALL_LOCALMEM2R(String,replace);
VCALL_LOCALMEM2R(String,replacen);
VCALL_LOCALMEM2R(String,insert);
@@ -464,7 +466,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
VCALL_LOCALMEM1(Array,resize);
VCALL_LOCALMEM2(Array,insert);
VCALL_LOCALMEM1(Array,remove);
- VCALL_LOCALMEM1R(Array,find);
+ VCALL_LOCALMEM2R(Array,find);
+ VCALL_LOCALMEM2R(Array,rfind);
VCALL_LOCALMEM1R(Array,find_last);
VCALL_LOCALMEM1R(Array,count);
VCALL_LOCALMEM1(Array,erase);
@@ -1268,6 +1271,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
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());
+ ADDFUNC1(STRING,BOOL,String,is_subsequence_of,STRING,"text",varray());
+ ADDFUNC1(STRING,BOOL,String,is_subsequence_ofi,STRING,"text",varray());
ADDFUNC2(STRING,STRING,String,replace,STRING,"what",STRING,"forwhat",varray());
ADDFUNC2(STRING,STRING,String,replacen,STRING,"what",STRING,"forwhat",varray());
@@ -1453,7 +1458,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC2(ARRAY,NIL,Array,insert,INT,"pos",NIL,"value",varray());
ADDFUNC1(ARRAY,NIL,Array,remove,INT,"pos",varray());
ADDFUNC1(ARRAY,NIL,Array,erase,NIL,"value",varray());
- ADDFUNC1(ARRAY,INT,Array,find,NIL,"value",varray());
+ ADDFUNC2(ARRAY,INT,Array,find,NIL,"what",INT,"from",varray(0));
+ ADDFUNC2(ARRAY,INT,Array,rfind,NIL,"what",INT,"from",varray(-1));
ADDFUNC1(ARRAY,INT,Array,find_last,NIL,"value",varray());
ADDFUNC1(ARRAY,INT,Array,count,NIL,"value",varray());
ADDFUNC0(ARRAY,NIL,Array,pop_back,varray());
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp
index e2786b8099..875a144fef 100644
--- a/core/variant_parser.cpp
+++ b/core/variant_parser.cpp
@@ -1789,6 +1789,14 @@ Error VariantParser::parse(Stream *p_stream, Variant& r_ret, String &r_err_str,
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
+static String rtosfix(double p_value) {
+
+
+ if (p_value==0.0)
+ return "0"; //avoid negative zero (-0) being written, which may annoy git, svn, etc. for changes when they don't exist.
+ else
+ return rtoss(p_value);
+}
Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_string_func, void *p_store_string_ud,EncodeResourceFunc p_encode_res_func,void* p_encode_res_ud) {
@@ -1807,7 +1815,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
} break;
case Variant::REAL: {
- String s = rtoss(p_variant.operator real_t());
+ String s = rtosfix(p_variant.operator real_t());
if (s.find(".")==-1 && s.find("e")==-1)
s+=".0";
p_store_string_func(p_store_string_ud, s );
@@ -1822,35 +1830,35 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
case Variant::VECTOR2: {
Vector2 v = p_variant;
- p_store_string_func(p_store_string_ud,"Vector2( "+rtoss(v.x) +", "+rtoss(v.y)+" )" );
+ p_store_string_func(p_store_string_ud,"Vector2( "+rtosfix(v.x) +", "+rtosfix(v.y)+" )" );
} break;
case Variant::RECT2: {
Rect2 aabb = p_variant;
- p_store_string_func(p_store_string_ud,"Rect2( "+rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y)+" )" );
+ p_store_string_func(p_store_string_ud,"Rect2( "+rtosfix(aabb.pos.x) +", "+rtosfix(aabb.pos.y) +", "+rtosfix(aabb.size.x) +", "+rtosfix(aabb.size.y)+" )" );
} break;
case Variant::VECTOR3: {
Vector3 v = p_variant;
- p_store_string_func(p_store_string_ud,"Vector3( "+rtoss(v.x) +", "+rtoss(v.y)+", "+rtoss(v.z)+" )");
+ p_store_string_func(p_store_string_ud,"Vector3( "+rtosfix(v.x) +", "+rtosfix(v.y)+", "+rtosfix(v.z)+" )");
} break;
case Variant::PLANE: {
Plane p = p_variant;
- p_store_string_func(p_store_string_ud,"Plane( "+rtoss(p.normal.x) +", "+rtoss(p.normal.y)+", "+rtoss(p.normal.z)+", "+rtoss(p.d)+" )" );
+ p_store_string_func(p_store_string_ud,"Plane( "+rtosfix(p.normal.x) +", "+rtosfix(p.normal.y)+", "+rtosfix(p.normal.z)+", "+rtosfix(p.d)+" )" );
} break;
case Variant::_AABB: {
AABB aabb = p_variant;
- p_store_string_func(p_store_string_ud,"AABB( "+rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.pos.z) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y) +", "+rtoss(aabb.size.z)+" )" );
+ p_store_string_func(p_store_string_ud,"AABB( "+rtosfix(aabb.pos.x) +", "+rtosfix(aabb.pos.y) +", "+rtosfix(aabb.pos.z) +", "+rtosfix(aabb.size.x) +", "+rtosfix(aabb.size.y) +", "+rtosfix(aabb.size.z)+" )" );
} break;
case Variant::QUAT: {
Quat quat = p_variant;
- p_store_string_func(p_store_string_ud,"Quat( "+rtoss(quat.x)+", "+rtoss(quat.y)+", "+rtoss(quat.z)+", "+rtoss(quat.w)+" )");
+ p_store_string_func(p_store_string_ud,"Quat( "+rtosfix(quat.x)+", "+rtosfix(quat.y)+", "+rtosfix(quat.z)+", "+rtosfix(quat.w)+" )");
} break;
case Variant::MATRIX32: {
@@ -1862,7 +1870,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i!=0 || j!=0)
s+=", ";
- s+=rtoss( m3.elements[i][j] );
+ s+=rtosfix( m3.elements[i][j] );
}
}
@@ -1878,7 +1886,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i!=0 || j!=0)
s+=", ";
- s+=rtoss( m3.elements[i][j] );
+ s+=rtosfix( m3.elements[i][j] );
}
}
@@ -1895,11 +1903,11 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i!=0 || j!=0)
s+=", ";
- s+=rtoss( m3.elements[i][j] );
+ s+=rtosfix( m3.elements[i][j] );
}
}
- s=s+", "+rtoss(t.origin.x) +", "+rtoss(t.origin.y)+", "+rtoss(t.origin.z);
+ s=s+", "+rtosfix(t.origin.x) +", "+rtosfix(t.origin.y)+", "+rtosfix(t.origin.z);
p_store_string_func(p_store_string_ud,s+" )");
} break;
@@ -1908,7 +1916,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
case Variant::COLOR: {
Color c = p_variant;
- p_store_string_func(p_store_string_ud,"Color( "+rtoss(c.r) +", "+rtoss(c.g)+", "+rtoss(c.b)+", "+rtoss(c.a)+" )");
+ p_store_string_func(p_store_string_ud,"Color( "+rtosfix(c.r) +", "+rtosfix(c.g)+", "+rtosfix(c.b)+", "+rtosfix(c.a)+" )");
} break;
case Variant::IMAGE: {
@@ -2143,7 +2151,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i>0)
p_store_string_func(p_store_string_ud,", ");
- p_store_string_func(p_store_string_ud,rtoss(ptr[i]));
+ p_store_string_func(p_store_string_ud,rtosfix(ptr[i]));
}
p_store_string_func(p_store_string_ud," )");
@@ -2184,7 +2192,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i>0)
p_store_string_func(p_store_string_ud,", ");
- p_store_string_func(p_store_string_ud,rtoss(ptr[i].x)+", "+rtoss(ptr[i].y) );
+ p_store_string_func(p_store_string_ud,rtosfix(ptr[i].x)+", "+rtosfix(ptr[i].y) );
}
p_store_string_func(p_store_string_ud," )");
@@ -2202,7 +2210,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i>0)
p_store_string_func(p_store_string_ud,", ");
- p_store_string_func(p_store_string_ud,rtoss(ptr[i].x)+", "+rtoss(ptr[i].y)+", "+rtoss(ptr[i].z) );
+ p_store_string_func(p_store_string_ud,rtosfix(ptr[i].x)+", "+rtosfix(ptr[i].y)+", "+rtosfix(ptr[i].z) );
}
p_store_string_func(p_store_string_ud," )");
@@ -2222,7 +2230,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i>0)
p_store_string_func(p_store_string_ud,", ");
- p_store_string_func(p_store_string_ud,rtoss(ptr[i].r)+", "+rtoss(ptr[i].g)+", "+rtoss(ptr[i].b)+", "+rtoss(ptr[i].a) );
+ p_store_string_func(p_store_string_ud,rtosfix(ptr[i].r)+", "+rtosfix(ptr[i].g)+", "+rtosfix(ptr[i].b)+", "+rtosfix(ptr[i].a) );
}
p_store_string_func(p_store_string_ud," )");
diff --git a/core/vector.h b/core/vector.h
index 87248ccf68..cafb4a4aa3 100644
--- a/core/vector.h
+++ b/core/vector.h
@@ -120,7 +120,7 @@ public:
template <class T_val>
- int find(const T_val& p_val) const;
+ int find(const T_val& p_val, int p_from=0) const;
void set(int p_index,T p_elem);
T get(int p_index) const;
@@ -238,13 +238,13 @@ void Vector<T>::_copy_on_write() {
}
template<class T> template<class T_val>
-int Vector<T>::find(const T_val &p_val) const {
+int Vector<T>::find(const T_val &p_val, int p_from) const {
int ret = -1;
- if (size() == 0)
+ if (p_from < 0 || size() == 0)
return ret;
- for (int i=0; i<size(); i++) {
+ for (int i=p_from; i<size(); i++) {
if (operator[](i) == p_val) {
ret = i;
@@ -253,7 +253,7 @@ int Vector<T>::find(const T_val &p_val) const {
};
return ret;
-};
+}
template<class T>
Error Vector<T>::resize(int p_size) {
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index b74ac1c144..0d8f7eecdd 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -4390,10 +4390,12 @@
<method name="find">
<return type="int">
</return>
- <argument index="0" name="value" type="var">
+ <argument index="0" name="what" type="var">
+ </argument>
+ <argument index="1" name="from" type="int" default="0">
</argument>
<description>
- Searches the array for a value and returns its index or -1 if not found.
+ Searches the array for a value and returns its index or -1 if not found. Optionally, the initial search index can be passed.
</description>
</method>
<method name="find_last">
@@ -4471,6 +4473,15 @@
Resize the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are Null.
</description>
</method>
+ <method name="rfind">
+ <argument index="0" name="what" type="var">
+ </argument>
+ <argument index="1" name="from" type="int">
+ </argument>
+ <description>
+ Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array.
+ </description>
+ </method>
<method name="size">
<return type="int">
</return>
@@ -8740,7 +8751,7 @@
Concave polygon 2D shape resource for physics.
</brief_description>
<description>
- Concave polygon 2D shape resource for physics. It is made out of segments and is very optimal for complex polygonal concave collisions. It is really not advised to use for RigidBody nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions.
+ Concave polygon 2D shape resource for physics. It is made out of segments and is very optimal for complex polygonal concave collisions. It is really not advised to use for [RigidBody2D] nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions.
The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection.
</description>
<methods>
@@ -24959,12 +24970,14 @@ This method controls whether the position between two cached points is interpola
<return type="float">
</return>
<description>
+ Return the rate at which the body stops moving, if there are not any other forces moving it.
</description>
</method>
<method name="get_total_angular_damp" qualifiers="const">
<return type="float">
</return>
<description>
+ Return the rate at which the body stops rotating, if there are not any other forces moving it.
</description>
</method>
<method name="get_inverse_mass" qualifiers="const">
@@ -25059,6 +25072,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="contact_idx" type="int">
</argument>
<description>
+ Return the local normal (of this body) of the contact point.
</description>
</method>
<method name="get_contact_local_shape" qualifiers="const">
@@ -25076,7 +25090,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="contact_idx" type="int">
</argument>
<description>
- Return the RID of the collider.
+ Return the [RID] of the collider.
</description>
</method>
<method name="get_contact_collider_pos" qualifiers="const">
@@ -25121,6 +25135,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="contact_idx" type="int">
</argument>
<description>
+ Return the metadata of the collided shape. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
</description>
</method>
<method name="get_contact_collider_velocity_at_pos" qualifiers="const">
@@ -25157,8 +25172,10 @@ This method controls whether the position between two cached points is interpola
</class>
<class name="Physics2DDirectBodyStateSW" inherits="Physics2DDirectBodyState" category="Core">
<brief_description>
+ Software implementation of [Physics2DDirectBodyState].
</brief_description>
<description>
+ Software implementation of [Physics2DDirectBodyState]. This object exposes no new methods or properties and should not be used, as [Physics2DDirectBodyState] selects the best implementation available.
</description>
<methods>
</methods>
@@ -25187,6 +25204,13 @@ This method controls whether the position between two cached points is interpola
<argument index="4" name="type_mask" type="int" default="15">
</argument>
<description>
+ Check whether a point is inside any shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields:
+ shape: Shape index within the object the point is in.
+ metadata: Metadata of the shape the point is in. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
+ collider_id: Id of the object the point is in.
+ collider: Object the point is inside of.
+ rid: [RID] of the object the point is in.
+ Additionally, the method can take an array of objects or [RID]s that are to be excluded from collisions, a bitmask representing the physics layers to check in, and another bitmask for the types of objects to check (see TYPE_MASK_* constants).
</description>
</method>
<method name="intersect_ray">
@@ -25203,15 +25227,16 @@ This method controls whether the position between two cached points is interpola
<argument index="4" name="type_mask" type="int" default="15">
</argument>
<description>
- Intersect a ray in a given space, the returned object is a dictionary with the following fields:
- position: place where ray is stopped.
- normal: normal of the object at the point where the ray was stopped.
- shape: shape index of the object against which the ray was stopped.
- collider_: collider against which the ray was stopped.
- collider_id: collider id of the object against which the ray was stopped.
- collider: collider object against which the ray was stopped.
+ Intersect a ray in a given space. The returned object is a dictionary with the following fields:
+ position: Place where ray is stopped.
+ normal: Normal of the object at the point where the ray was stopped.
+ shape: Shape index within the object against which the ray was stopped.
+ metadata: Metadata of the shape against which the ray was stopped. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
+ collider_id: Id of the object against which the ray was stopped.
+ collider: Object against which the ray was stopped.
rid: [RID] of the object against which the ray was stopped.
If the ray did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead.
+ Additionally, the method can take an array of objects or [RID]s that are to be excluded from collisions, a bitmask representing the physics layers to check in, and another bitmask for the types of objects to check (see TYPE_MASK_* constants).
</description>
</method>
<method name="intersect_shape">
@@ -25222,7 +25247,13 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="max_results" type="int" default="32">
</argument>
<description>
- Intersect a given shape (RID or [Shape2D]) against the space, the intersected shapes are returned in a special result object.
+ Check the intersections of a shape, given through a [Physics2DShapeQueryParameters] object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields:
+ shape: Shape index within the object the shape intersected.
+ metadata: Metadata of the shape intersected by the shape given through the [Physics2DShapeQueryParameters]. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
+ collider_id: Id of the object the shape intersected.
+ collider: Object the shape intersected.
+ rid: [RID] of the object the shape intersected.
+ The number of intersections can be limited with the second paramater, to reduce the processing time.
</description>
</method>
<method name="cast_motion">
@@ -25231,6 +25262,8 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="shape" type="Physics2DShapeQueryParameters">
</argument>
<description>
+ Check whether the shape can travel to a point. If it can, the method will return an array with two floats: The first is the distance the shape can move in that direction without colliding, and the second is the distance at which it will collide.
+ If the shape can not move, the array will be empty.
</description>
</method>
<method name="collide_shape">
@@ -25241,6 +25274,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="max_results" type="int" default="32">
</argument>
<description>
+ Check the intersections of a shape, given through a [Physics2DShapeQueryParameters] object, against the space. The resulting array contains a list of points where the shape intersects another. Like with [method intersect_shape], the number of returned results can be limited to save processing time.
</description>
</method>
<method name="get_rest_info">
@@ -25249,21 +25283,37 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="shape" type="Physics2DShapeQueryParameters">
</argument>
<description>
+ Check the intersections of a shape, given through a [Physics2DShapeQueryParameters] object, against the space. If it collides with more than a shape, the nearest one is selected. The returned object is a dictionary containing the following fields:
+ pointo: Place where the shapes intersect.
+ normal: Normal of the object at the point where the shapes intersect.
+ shape: Shape index within the object against which the shape intersected.
+ metadata: Metadata of the shape against which the shape intersected. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
+ collider_id: Id of the object against which the shape intersected.
+ collider: Object against which the shape intersected.
+ rid: [RID] of the object against which the shape intersected.
+ linear_velocity: The movement vector of the object the shape intersected, if it was a body. If it was an area, it is (0,0).
+ If the shape did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead.
</description>
</method>
</methods>
<constants>
<constant name="TYPE_MASK_STATIC_BODY" value="1">
+ Check for collisions with static bodies.
</constant>
<constant name="TYPE_MASK_KINEMATIC_BODY" value="2">
+ Check for collisions with kinematic bodies.
</constant>
<constant name="TYPE_MASK_RIGID_BODY" value="4">
+ Check for collisions with rigid bodies.
</constant>
<constant name="TYPE_MASK_CHARACTER_BODY" value="8">
+ Check for collisions with rigid bodies in character mode.
</constant>
<constant name="TYPE_MASK_AREA" value="16">
+ Check for collisions with areas.
</constant>
<constant name="TYPE_MASK_COLLISION" value="15">
+ Check for collisions with any kind of bodies (but not areas).
</constant>
</constants>
</class>
@@ -25272,7 +25322,7 @@ This method controls whether the position between two cached points is interpola
Physics 2D Server.
</brief_description>
<description>
- Physics 2D Server is the server responsible for all 2D physics.
+ Physics 2D Server is the server responsible for all 2D physics. It can create many kinds of physics objects, but does not insert them on the node tree.
</description>
<methods>
<method name="shape_create">
@@ -25281,6 +25331,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="type" type="int">
</argument>
<description>
+ Create a shape of type SHAPE_*. Does not assign it to a body or an area. To do so, you must use [method area_set_shape] or [method body_set_shape].
</description>
</method>
<method name="shape_set_data">
@@ -25289,6 +25340,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="data" type="Variant">
</argument>
<description>
+ Set the shape data that defines its shape and size. The data to be passed depends on the kind of shape created [method shape_get_type].
</description>
</method>
<method name="shape_get_type" qualifiers="const">
@@ -25297,18 +25349,23 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="shape" type="RID">
</argument>
<description>
+ Return the type of shape (see SHAPE_* constants).
</description>
</method>
<method name="shape_get_data" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="shape" type="RID">
</argument>
<description>
+ Return the shape data.
</description>
</method>
<method name="space_create">
<return type="RID">
</return>
<description>
+ Create a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with [method area_set_space], or to a body with [method body_set_space].
</description>
</method>
<method name="space_set_active">
@@ -25317,6 +25374,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="active" type="bool">
</argument>
<description>
+ Mark a space as active. It will not have an effect, unless it is assigned to an area or body.
</description>
</method>
<method name="space_is_active" qualifiers="const">
@@ -25325,6 +25383,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="space" type="RID">
</argument>
<description>
+ Return whether the space is active.
</description>
</method>
<method name="space_set_param">
@@ -25335,6 +25394,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="float">
</argument>
<description>
+ Set the value for a space parameter. A list of available parameters is on the SPACE_PARAM_* constants.
</description>
</method>
<method name="space_get_param" qualifiers="const">
@@ -25345,6 +25405,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="param" type="int">
</argument>
<description>
+ Return the value of a space parameter.
</description>
</method>
<method name="space_get_direct_state">
@@ -25353,12 +25414,14 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="space" type="RID">
</argument>
<description>
+ Return the state of a space, a [Physics2DDirectSpaceState]. This object can be used to make collision/intersection queries.
</description>
</method>
<method name="area_create">
<return type="RID">
</return>
<description>
+ Create an [Area2D].
</description>
</method>
<method name="area_set_space">
@@ -25367,6 +25430,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="space" type="RID">
</argument>
<description>
+ Assign a space to the area.
</description>
</method>
<method name="area_get_space" qualifiers="const">
@@ -25375,6 +25439,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Return the space assigned to the area.
</description>
</method>
<method name="area_set_space_override_mode">
@@ -25383,6 +25448,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mode" type="int">
</argument>
<description>
+ Set the space override mode for the area. The modes are described in the constants AREA_SPACE_OVERRIDE_*.
</description>
</method>
<method name="area_get_space_override_mode" qualifiers="const">
@@ -25391,6 +25457,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Return the space override mode for the area.
</description>
</method>
<method name="area_add_shape">
@@ -25401,6 +25468,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="transform" type="Matrix32" default="1,0, 0,1, 0,0">
</argument>
<description>
+ Add a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
</description>
</method>
<method name="area_set_shape">
@@ -25411,6 +25479,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="shape" type="RID">
</argument>
<description>
+ Substitute a given area shape by another. The old shape is selected by its index, the new one by its [RID].
</description>
</method>
<method name="area_set_shape_transform">
@@ -25421,6 +25490,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="transform" type="Matrix32">
</argument>
<description>
+ Set the transform matrix for an area shape.
</description>
</method>
<method name="area_get_shape_count" qualifiers="const">
@@ -25429,6 +25499,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Return the number of shapes assigned to an area.
</description>
</method>
<method name="area_get_shape" qualifiers="const">
@@ -25439,6 +25510,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return the [RID] of the nth shape of an area.
</description>
</method>
<method name="area_get_shape_transform" qualifiers="const">
@@ -25449,6 +25521,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return the transform matrix of a shape within an area.
</description>
</method>
<method name="area_remove_shape">
@@ -25457,12 +25530,14 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Remove a shape from an area. It does not delete the shape, so it can be reassigned later.
</description>
</method>
<method name="area_clear_shapes">
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Remove all shapes from an area. It does not delete the shapes, so they can be reassigned later.
</description>
</method>
<method name="area_set_layer_mask">
@@ -25471,6 +25546,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mask" type="int">
</argument>
<description>
+ Assign the area to one or many physics layers.
</description>
</method>
<method name="area_set_collision_mask">
@@ -25479,6 +25555,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mask" type="int">
</argument>
<description>
+ Set which physics layers the area will monitor.
</description>
</method>
<method name="area_set_param">
@@ -25489,6 +25566,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="Variant">
</argument>
<description>
+ Set the value for an area parameter. A list of available parameters is on the AREA_PARAM_* constants.
</description>
</method>
<method name="area_set_transform">
@@ -25497,14 +25575,18 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="transform" type="Matrix32">
</argument>
<description>
+ Set the transform matrix for an area.
</description>
</method>
<method name="area_get_param" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="area" type="RID">
</argument>
<argument index="1" name="param" type="int">
</argument>
<description>
+ Return an area parameter value.
</description>
</method>
<method name="area_get_transform" qualifiers="const">
@@ -25513,6 +25595,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Return the transform matrix for an area.
</description>
</method>
<method name="area_attach_object_instance_ID">
@@ -25521,6 +25604,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="id" type="int">
</argument>
<description>
+ Assign the area to a descendant of [Object], so it can exist in the node tree.
</description>
</method>
<method name="area_get_object_instance_ID" qualifiers="const">
@@ -25529,6 +25613,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Get the instance ID of the object the area is assigned to.
</description>
</method>
<method name="area_set_monitor_callback">
@@ -25539,6 +25624,12 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="method" type="String">
</argument>
<description>
+ Set the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters:
+ 1: AREA_BODY_ADDED or AREA_BODY_REMOVED, depending on whether the object entered or exited the area.
+ 2: [RID] of the object that entered/exited the area.
+ 3: Instance ID of the object that entered/exited the area.
+ 4: The shape index of the object that entered/exited the area.
+ 5: The shape index of the area where the object entered/exited.
</description>
</method>
<method name="body_create">
@@ -25549,6 +25640,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="init_sleeping" type="bool" default="false">
</argument>
<description>
+ Create a physics body. The first parameter can be any value from constants BODY_MODE*, for the type of body created. Additionally, the body can be created in sleeping state to save processing time.
</description>
</method>
<method name="body_set_space">
@@ -25557,6 +25649,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="space" type="RID">
</argument>
<description>
+ Assign a space to the body (see [method create_space]).
</description>
</method>
<method name="body_get_space" qualifiers="const">
@@ -25565,6 +25658,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the [RID] of the space assigned to a body.
</description>
</method>
<method name="body_set_mode">
@@ -25573,6 +25667,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mode" type="int">
</argument>
<description>
+ Set the body mode, from one of the constants BODY_MODE*.
</description>
</method>
<method name="body_get_mode" qualifiers="const">
@@ -25581,6 +25676,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the body mode.
</description>
</method>
<method name="body_add_shape">
@@ -25591,6 +25687,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="transform" type="Matrix32" default="1,0, 0,1, 0,0">
</argument>
<description>
+ Add a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
</description>
</method>
<method name="body_set_shape">
@@ -25601,6 +25698,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="shape" type="RID">
</argument>
<description>
+ Substitute a given body shape by another. The old shape is selected by its index, the new one by its [RID].
</description>
</method>
<method name="body_set_shape_transform">
@@ -25611,6 +25709,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="transform" type="Matrix32">
</argument>
<description>
+ Set the transform matrix for a body shape.
</description>
</method>
<method name="body_set_shape_metadata">
@@ -25621,6 +25720,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="metadata" type="Variant">
</argument>
<description>
+ Set metadata of a shape within a body. This metadata is different from [method Object.set_meta], and can be retrieved on shape queries.
</description>
</method>
<method name="body_get_shape_count" qualifiers="const">
@@ -25629,6 +25729,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the number of shapes assigned to a body.
</description>
</method>
<method name="body_get_shape" qualifiers="const">
@@ -25639,6 +25740,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return the [RID] of the nth shape of a body.
</description>
</method>
<method name="body_get_shape_transform" qualifiers="const">
@@ -25649,14 +25751,18 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return the transform matrix of a body shape.
</description>
</method>
<method name="body_get_shape_metadata" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="body" type="RID">
</argument>
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return the metadata of a shape of a body.
</description>
</method>
<method name="body_remove_shape">
@@ -25665,12 +25771,14 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Remove a shape from a body. The shape is not deleted, so it can be reused afterwards.
</description>
</method>
<method name="body_clear_shapes">
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Remove all shapes from a body.
</description>
</method>
<method name="body_set_shape_as_trigger">
@@ -25681,6 +25789,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="enable" type="bool">
</argument>
<description>
+ Mark a body's shape as a trigger. A trigger shape cannot affect other bodies, but detects other shapes entering and exiting it.
</description>
</method>
<method name="body_is_shape_set_as_trigger" qualifiers="const">
@@ -25691,6 +25800,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return whether a body's shape is marked as a trigger.
</description>
</method>
<method name="body_attach_object_instance_ID">
@@ -25699,6 +25809,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="id" type="int">
</argument>
<description>
+ Assign the area to a descendant of [Object], so it can exist in the node tree.
</description>
</method>
<method name="body_get_object_instance_ID" qualifiers="const">
@@ -25707,6 +25818,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Get the instance ID of the object the area is assigned to.
</description>
</method>
<method name="body_set_continuous_collision_detection_mode">
@@ -25715,6 +25827,8 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mode" type="int">
</argument>
<description>
+ Set the continuous collision detection mode from any of the CCD_MODE_* constants.
+ Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.
</description>
</method>
<method name="body_get_continuous_collision_detection_mode" qualifiers="const">
@@ -25723,6 +25837,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the continuous collision detection mode.
</description>
</method>
<method name="body_set_layer_mask">
@@ -25731,6 +25846,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mask" type="int">
</argument>
<description>
+ Set the physics layer or layers a body belongs to.
</description>
</method>
<method name="body_get_layer_mask" qualifiers="const">
@@ -25739,6 +25855,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the physics layer or layers a body belongs to.
</description>
</method>
<method name="body_set_collision_mask">
@@ -25747,6 +25864,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mask" type="int">
</argument>
<description>
+ Set the physics layer or layers a body can collide with.
</description>
</method>
<method name="body_get_collision_mask" qualifiers="const">
@@ -25755,6 +25873,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the physics layer or layers a body can collide with.
</description>
</method>
<method name="body_set_param">
@@ -25765,6 +25884,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="float">
</argument>
<description>
+ Set a body parameter (see BODY_PARAM* constants).
</description>
</method>
<method name="body_get_param" qualifiers="const">
@@ -25775,6 +25895,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="param" type="int">
</argument>
<description>
+ Return the value of a body parameter.
</description>
</method>
<method name="body_set_state">
@@ -25785,14 +25906,18 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="Variant">
</argument>
<description>
+ Set a body state (see BODY_STATE* constants).
</description>
</method>
<method name="body_get_state" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="body" type="RID">
</argument>
<argument index="1" name="state" type="int">
</argument>
<description>
+ Return a body state.
</description>
</method>
<method name="body_apply_impulse">
@@ -25803,6 +25928,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="impulse" type="Vector2">
</argument>
<description>
+ Add a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates.
</description>
</method>
<method name="body_add_force">
@@ -25813,7 +25939,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="force" type="Vector2">
</argument>
<description>
- Add a positioned force to the applied force and torque. As with [method body_apply_impulse], both the force and the offset from the body origin are in global coordinates.
+ Add a positioned force to the applied force and torque. As with [method body_apply_impulse], both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied.
</description>
</method>
<method name="body_set_axis_velocity">
@@ -25822,6 +25948,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="axis_velocity" type="Vector2">
</argument>
<description>
+ Set an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.
</description>
</method>
<method name="body_add_collision_exception">
@@ -25830,6 +25957,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="excepted_body" type="RID">
</argument>
<description>
+ Add a body to the list of bodies exempt from collisions.
</description>
</method>
<method name="body_remove_collision_exception">
@@ -25838,6 +25966,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="excepted_body" type="RID">
</argument>
<description>
+ Remove a body from the list of bodies exempt from collisions.
</description>
</method>
<method name="body_set_max_contacts_reported">
@@ -25846,6 +25975,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="amount" type="int">
</argument>
<description>
+ Set the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0.
</description>
</method>
<method name="body_get_max_contacts_reported" qualifiers="const">
@@ -25854,6 +25984,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the maximum contacts that can be reported. See [method body_set_max_contacts_reported].
</description>
</method>
<method name="body_set_one_way_collision_direction">
@@ -25862,6 +25993,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="normal" type="Vector2">
</argument>
<description>
+ Set a direction in which bodies can go through the given one. If this value is different from (0,0), any movement within 90 degrees of this vector is considered a valid movement. Set this direction to (0,0) to disable one-way collisions.
</description>
</method>
<method name="body_get_one_way_collision_direction" qualifiers="const">
@@ -25870,6 +26002,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the direction used for one-way collision detection.
</description>
</method>
<method name="body_set_one_way_collision_max_depth">
@@ -25878,6 +26011,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="depth" type="float">
</argument>
<description>
+ Set how far a body can go through the given one, if it allows one-way collisions (see [method body_set_one_way_collision_direction]).
</description>
</method>
<method name="body_get_one_way_collision_max_depth" qualifiers="const">
@@ -25886,6 +26020,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return how far a body can go through the given one, when it allows one-way collisions.
</description>
</method>
<method name="body_set_omit_force_integration">
@@ -25894,6 +26029,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="enable" type="bool">
</argument>
<description>
+ Set whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
</description>
</method>
<method name="body_is_omitting_force_integration" qualifiers="const">
@@ -25902,6 +26038,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
</description>
</method>
<method name="body_set_force_integration_callback">
@@ -25914,6 +26051,7 @@ This method controls whether the position between two cached points is interpola
<argument index="3" name="userdata" type="Variant" default="NULL">
</argument>
<description>
+ Set the function used to calculate physics for an object, if that object allows it (see [method body_set_omit_force integration]).
</description>
</method>
<method name="body_test_motion">
@@ -25928,6 +26066,7 @@ This method controls whether the position between two cached points is interpola
<argument index="3" name="result" type="Physics2DTestMotionResult" default="NULL">
</argument>
<description>
+ Return whether a body can move in a given direction. Apart from the boolean return value, a [Physics2DTestMotionResult] can be passed to return additional information in.
</description>
</method>
<method name="joint_set_param">
@@ -25938,6 +26077,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="float">
</argument>
<description>
+ Set a joint parameter. Parameters are explained in the JOINT_PARAM* constants.
</description>
</method>
<method name="joint_get_param" qualifiers="const">
@@ -25948,6 +26088,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="param" type="int">
</argument>
<description>
+ Return the value of a joint parameter.
</description>
</method>
<method name="pin_joint_create">
@@ -25960,6 +26101,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="body_b" type="RID" default="RID()">
</argument>
<description>
+ Create a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself.
</description>
</method>
<method name="groove_joint_create">
@@ -25976,6 +26118,7 @@ This method controls whether the position between two cached points is interpola
<argument index="4" name="body_b" type="RID" default="RID()">
</argument>
<description>
+ Create a groove joint between two bodies. If not specified, the bodyies are assumed to be the joint itself.
</description>
</method>
<method name="damped_spring_joint_create">
@@ -25990,6 +26133,7 @@ This method controls whether the position between two cached points is interpola
<argument index="3" name="body_b" type="RID" default="RID()">
</argument>
<description>
+ Create a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself.
</description>
</method>
<method name="damped_string_joint_set_param">
@@ -26000,6 +26144,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="float">
</argument>
<description>
+ Set a damped spring joint parameter. Parameters are explained in the DAMPED_STRING* constants.
</description>
</method>
<method name="damped_string_joint_get_param" qualifiers="const">
@@ -26010,6 +26155,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="param" type="int">
</argument>
<description>
+ Return the value of a damped spring joint parameter.
</description>
</method>
<method name="joint_get_type" qualifiers="const">
@@ -26018,18 +26164,21 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="joint" type="RID">
</argument>
<description>
+ Return the type of a joint (see JOINT_* constants).
</description>
</method>
<method name="free_rid">
<argument index="0" name="rid" type="RID">
</argument>
<description>
+ Destroy any of the objects created by Physics2DServer. If the [RID] passed is not one of the objects that can be created by Physics2DServer, an error will be sent to the console.
</description>
</method>
<method name="set_active">
<argument index="0" name="active" type="bool">
</argument>
<description>
+ Activate or deactivate the 2D physics engine.
</description>
</method>
<method name="get_process_info">
@@ -26038,41 +26187,79 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="process_info" type="int">
</argument>
<description>
+ Return information about the current state of the 2D physics engine. The states are listed under the INFO_* constants.
</description>
</method>
</methods>
<constants>
+ <constant name="SPACE_PARAM_CONTACT_RECYCLE_RADIUS" value="0">
+ Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated.
+ </constant>
+ <constant name="SPACE_PARAM_CONTACT_MAX_SEPARATION" value="1">
+ Constant to set/get the maximum distance a shape can be from another before they are considered separated.
+ </constant>
+ <constant name="SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION" value="2">
+ Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision.
+ </constant>
+ <constant name="SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD" value="3">
+ Constant to set/get the linear velocity threshold. Bodies slower than this will be marked as potentially inactive.
+ </constant>
+ <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD" value="4">
+ Constant to set/get the angular velocity threshold. Bodies slower than this will be marked as potentially inactive.
+ </constant>
+ <constant name="SPACE_PARAM_BODY_TIME_TO_SLEEP" value="5">
+ Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time.
+ </constant>
+ <constant name="SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS" value="6">
+ Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision.
+ </constant>
<constant name="SHAPE_LINE" value="0">
+ This is the constant for creating line shapes. A line shape is an infinite line with an origin point, and a normal. Thus, it can be used for front/behind checks.
</constant>
<constant name="SHAPE_SEGMENT" value="2">
+ This is the constant for creating segment shapes. A segment shape is a line from a point A to a point B. It can be checked for intersections.
</constant>
<constant name="SHAPE_CIRCLE" value="3">
+ This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks.
</constant>
<constant name="SHAPE_RECTANGLE" value="4">
+ This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks.
</constant>
<constant name="SHAPE_CAPSULE" value="5">
+ This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks.
</constant>
<constant name="SHAPE_CONVEX_POLYGON" value="6">
+ This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. Unlike the method [method CollisionPolygon2D.set_polygon], polygons modified with [method shape_set_data] do not verify that the points supplied form, in fact, a convex polygon.
</constant>
<constant name="SHAPE_CONCAVE_POLYGON" value="7">
+ This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks.
</constant>
<constant name="SHAPE_CUSTOM" value="8">
+ This constant is used internally by the engine. Any attempt to create this kind of shape results in an error.
</constant>
<constant name="AREA_PARAM_GRAVITY" value="0">
+ Constant to set/get gravity strength in an area.
</constant>
<constant name="AREA_PARAM_GRAVITY_VECTOR" value="1">
+ Constant to set/get gravity vector/center in an area.
</constant>
<constant name="AREA_PARAM_GRAVITY_IS_POINT" value="2">
+ Constant to set/get whether the gravity vector of an area is a direction, or a center point.
</constant>
<constant name="AREA_PARAM_GRAVITY_DISTANCE_SCALE" value="3">
+ Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance.
</constant>
<constant name="AREA_PARAM_GRAVITY_POINT_ATTENUATION" value="4">
+ This constant was used to set/get the falloff factor for point gravity. It has been superseded by AREA_PARAM_GRAVITY_DISTANCE_SCALE.
</constant>
<constant name="AREA_PARAM_LINEAR_DAMP" value="5">
+ Constant to set/get the linear dampening factor of an area.
</constant>
<constant name="AREA_PARAM_ANGULAR_DAMP" value="6">
+ Constant to set/get the angular dampening factor of an area.
</constant>
<constant name="AREA_PARAM_PRIORITY" value="7">
+ Constant to set/get the priority (order of processing) of an area.
</constant>
<constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0">
This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
@@ -26090,73 +26277,115 @@ This method controls whether the position between two cached points is interpola
This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
</constant>
<constant name="BODY_MODE_STATIC" value="0">
+ Constant for static bodies.
</constant>
<constant name="BODY_MODE_KINEMATIC" value="1">
+ Constant for kinematic bodies.
</constant>
<constant name="BODY_MODE_RIGID" value="2">
+ Constant for rigid bodies.
</constant>
<constant name="BODY_MODE_CHARACTER" value="3">
+ Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics.
</constant>
<constant name="BODY_PARAM_BOUNCE" value="0">
+ Constant to set/get a body's bounce factor.
</constant>
<constant name="BODY_PARAM_FRICTION" value="1">
+ Constant to set/get a body's friction.
</constant>
<constant name="BODY_PARAM_MASS" value="2">
+ Constant to set/get a body's mass.
</constant>
<constant name="BODY_PARAM_INERTIA" value="3">
+ Constant to set/get a body's inertia.
</constant>
<constant name="BODY_PARAM_GRAVITY_SCALE" value="4">
+ Constant to set/get a body's gravity multiplier.
</constant>
<constant name="BODY_PARAM_LINEAR_DAMP" value="5">
+ Constant to set/get a body's linear dampening factor.
</constant>
<constant name="BODY_PARAM_ANGULAR_DAMP" value="6">
+ Constant to set/get a body's angular dampening factor.
</constant>
<constant name="BODY_PARAM_MAX" value="7">
+ This is the last ID for body parameters. Any attempt to set this property is ignored. Any attempt to get it returns 0.
</constant>
<constant name="BODY_STATE_TRANSFORM" value="0">
+ Constant to set/get the current transform matrix of the body.
</constant>
<constant name="BODY_STATE_LINEAR_VELOCITY" value="1">
+ Constant to set/get the current linear velocity of the body.
</constant>
<constant name="BODY_STATE_ANGULAR_VELOCITY" value="2">
+ Constant to set/get the current angular velocity of the body.
</constant>
<constant name="BODY_STATE_SLEEPING" value="3">
+ Constant to sleep/wake up a body, or to get whether it is sleeping.
</constant>
<constant name="BODY_STATE_CAN_SLEEP" value="4">
+ Constant to set/get whether the body can sleep.
</constant>
<constant name="JOINT_PIN" value="0">
+ Constant to create pin joints.
</constant>
<constant name="JOINT_GROOVE" value="1">
+ Constant to create groove joints.
</constant>
<constant name="JOINT_DAMPED_SPRING" value="2">
+ Constant to create damped spring joints.
+ </constant>
+ <constant name="JOINT_PARAM_BIAS" value="0">
+ Constant to set/get the solver bias for a joint.
+ </constant>
+ <constant name="JOINT_PARAM_MAX_BIAS" value="1">
+ Constant to set/get the maximum speed at which a joint can correct its bodies.
+ </constant>
+ <constant name="JOINT_PARAM_MAX_FORCE" value="2">
+ Constant to set the maximum force a joint can exert on its bodies.
</constant>
<constant name="DAMPED_STRING_REST_LENGTH" value="0">
+ Set the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
</constant>
<constant name="DAMPED_STRING_STIFFNESS" value="1">
+ Set the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.
</constant>
<constant name="DAMPED_STRING_DAMPING" value="2">
+ Set the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping).
</constant>
<constant name="CCD_MODE_DISABLED" value="0">
+ Disables continuous collision detection. This is the fastest way to detect body collisions, but can miss small, fast-moving objects.
</constant>
<constant name="CCD_MODE_CAST_RAY" value="1">
+ Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise.
</constant>
<constant name="CCD_MODE_CAST_SHAPE" value="2">
+ Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise.
</constant>
<constant name="AREA_BODY_ADDED" value="0">
+ The value of the first parameter and area callback function receives, when an object enters one of its shapes.
</constant>
<constant name="AREA_BODY_REMOVED" value="1">
+ The value of the first parameter and area callback function receives, when an object exits one of its shapes.
</constant>
<constant name="INFO_ACTIVE_OBJECTS" value="0">
+ Constant to get the number of objects that are not sleeping.
</constant>
<constant name="INFO_COLLISION_PAIRS" value="1">
+ Constant to get the number of possible collisions.
</constant>
<constant name="INFO_ISLAND_COUNT" value="2">
+ Constant to get the number of space regions where a collision could occur.
</constant>
</constants>
</class>
<class name="Physics2DServerSW" inherits="Physics2DServer" category="Core">
<brief_description>
+ Software implementation of [Physics2DServer].
</brief_description>
<description>
+ Software implementation of [Physics2DServer]. This class exposes no new methods or properties and should not be used, as [Physics2DServer] automatically selects the best implementation available.
</description>
<methods>
</methods>
@@ -26165,98 +26394,115 @@ This method controls whether the position between two cached points is interpola
</class>
<class name="Physics2DShapeQueryParameters" inherits="Reference" category="Core">
<brief_description>
+ Parameters to be sent to a 2D shape physics query.
</brief_description>
<description>
+ This class contains the shape and other parameters for intersection/collision queries.
</description>
<methods>
<method name="set_shape">
<argument index="0" name="shape" type="Shape2D">
</argument>
<description>
+ Set the [Shape2D] that will be used for collision/intersection queries.
</description>
</method>
<method name="set_shape_rid">
<argument index="0" name="shape" type="RID">
</argument>
<description>
+ Set the [RID] of the shape to be used in queries.
</description>
</method>
<method name="get_shape_rid" qualifiers="const">
<return type="RID">
</return>
<description>
+ Return the [RID] of the shape queried.
</description>
</method>
<method name="set_transform">
<argument index="0" name="transform" type="Matrix32">
</argument>
<description>
+ Set the transormation matrix of the shape. This is necessary to set its position/rotation/scale.
</description>
</method>
<method name="get_transform" qualifiers="const">
<return type="Matrix32">
</return>
<description>
+ Return the transform matrix of the shape queried.
</description>
</method>
<method name="set_motion">
<argument index="0" name="motion" type="Vector2">
</argument>
<description>
+ Set the current movement speed of the shape.
</description>
</method>
<method name="get_motion" qualifiers="const">
<return type="Vector2">
</return>
<description>
+ Return the current movement speed of the shape.
</description>
</method>
<method name="set_margin">
<argument index="0" name="margin" type="float">
</argument>
<description>
+ Set the collision margin for the shape. A collision margin is an amount (in pixels) that the shape will grow when computing collisions, to account for numerical imprecision.
</description>
</method>
<method name="get_margin" qualifiers="const">
<return type="float">
</return>
<description>
+ Return the collision margin for the shape.
</description>
</method>
<method name="set_layer_mask">
<argument index="0" name="layer_mask" type="int">
</argument>
<description>
+ Set the physics layer(s) the shape belongs to.
</description>
</method>
<method name="get_layer_mask" qualifiers="const">
<return type="int">
</return>
<description>
+ Return the physics layer(s) the shape belongs to.
</description>
</method>
<method name="set_object_type_mask">
<argument index="0" name="object_type_mask" type="int">
</argument>
<description>
+ Set the type of object the shape belongs to (see Physics2DDirectSpaceState.TYPE_MASK_*).
</description>
</method>
<method name="get_object_type_mask" qualifiers="const">
<return type="int">
</return>
<description>
+ Return the type of object the shape belongs to.
</description>
</method>
<method name="set_exclude">
<argument index="0" name="exclude" type="Array">
</argument>
<description>
+ Set the list of objects, or object [RID]s, that will be excluded from collisions.
</description>
</method>
<method name="get_exclude" qualifiers="const">
<return type="Array">
</return>
<description>
+ Return the list of objects, or object [RID]s, that will be excluded from collisions.
</description>
</method>
</methods>
@@ -28377,155 +28623,162 @@ This method controls whether the position between two cached points is interpola
2D polygon representation
</brief_description>
<description>
- A Polygon2D is defined by a set of n points connected together by line segments, meaning that the point 1 will be connected with point 2, point 2 with point 3 ..., point n-1 with point n and point n with point 1 in order to close the loop and define a plane.
+ A Polygon2D is defined by a set of n vertices connected together by line segments, meaning that the vertex 1 will be connected with vertex 2, vertex 2 with vertex 3 ..., vertex n-1 with vertex n and vertex n with vertex 1 in order to close the loop and define a polygon.
</description>
<methods>
<method name="set_polygon">
<argument index="0" name="polygon" type="Vector2Array">
</argument>
<description>
- Defines the set of points that will represent the polygon.
+ Define the set of vertices that will represent the polygon.
</description>
</method>
<method name="get_polygon" qualifiers="const">
<return type="Vector2Array">
</return>
<description>
- Returns the set of points that defines this polygon
+ Return the set of vertices that defines this polygon.
</description>
</method>
<method name="set_uv">
<argument index="0" name="uv" type="Vector2Array">
</argument>
<description>
- Sets the uv value for every point of the polygon
+ Set the texture coordinates for every vertex of the polygon. There should be one uv vertex for every vertex in the polygon. If there are less, the undefined ones will be assumed to be (0,0). Extra uv vertices are ignored.
</description>
</method>
<method name="get_uv" qualifiers="const">
<return type="Vector2Array">
</return>
<description>
- Returns the uv value associated with every point of the polygon
+ Return the texture coordinates associated with every vertex of the polygon.
</description>
</method>
<method name="set_color">
<argument index="0" name="color" type="Color">
</argument>
<description>
- Sets the polygon fill color, if the polygon has a texture defined, the defined texture will be tinted to the polygon fill color.
+ Set the polygon fill color. If the polygon has a texture defined, the defined texture will be multiplied by the polygon fill color. This, also, is the default color for those vertices that are not defined by [method get_vertex_colors].
</description>
</method>
<method name="get_color" qualifiers="const">
<return type="Color">
</return>
<description>
- Returns the polygon fill color
+ Return the polygon fill color.
</description>
</method>
<method name="set_vertex_colors">
<argument index="0" name="vertex_colors" type="ColorArray">
</argument>
<description>
+ Set the color for each vertex of the polygon. There should be one color for every vertex in the polygon. If there are less, the undefined ones will be assumed to be [method get_color]. Extra color entries are ignored.
+ Colors are interpolated between vertices, resulting in smooth gradients when they differ.
</description>
</method>
<method name="get_vertex_colors" qualifiers="const">
<return type="ColorArray">
</return>
<description>
+ Return the list of vertex colors.
</description>
</method>
<method name="set_texture">
<argument index="0" name="texture" type="Object">
</argument>
<description>
- Sets the polygon texture.
+ Set the polygon texture.
</description>
</method>
<method name="get_texture" qualifiers="const">
<return type="Object">
</return>
<description>
- Returns the polygon texture
+ Return the polygon texture
</description>
</method>
<method name="set_texture_offset">
<argument index="0" name="texture_offset" type="Vector2">
</argument>
<description>
- Sets the offset of the polygon texture. Initially the texture will appear anchored to the polygon position, the offset is used to move the texture location away from that point (notice that the texture origin is set to its top left corner, so when offset is 0,0 the top left corner of the texture is at the polygon position), for example setting the offset to 10, 10 will move the texture 10 units to the left and 10 units to the top.
+ Set the offset of the polygon texture. Initially the texture will appear anchored to the polygon position, the offset is used to move the texture location away from that point (notice that the texture origin is set to its top left corner, so when offset is 0,0 the top left corner of the texture is at the polygon position), for example setting the offset to 10, 10 will move the texture 10 units to the left and 10 units to the top.
</description>
</method>
<method name="get_texture_offset" qualifiers="const">
<return type="Vector2">
</return>
<description>
- Returns the polygon texture offset.
+ Return the polygon texture offset.
</description>
</method>
<method name="set_texture_rotation">
<argument index="0" name="texture_rotation" type="float">
</argument>
<description>
- Sets the amount of rotation of the polygon texture, [code]texture_rotation[/code] is specified in radians and clockwise rotation.
+ Set the amount of rotation of the polygon texture, [code]texture_rotation[/code] is specified in radians and clockwise rotation.
</description>
</method>
<method name="get_texture_rotation" qualifiers="const">
<return type="float">
</return>
<description>
- Returns the rotation in radians of the texture polygon.
+ Return the rotation in radians of the texture polygon.
</description>
</method>
<method name="set_texture_scale">
<argument index="0" name="texture_scale" type="Vector2">
</argument>
<description>
+ Set the value that will multiply the uv coordinates ([method get_uv]) when applying the texture. Larger values make the texture smaller, and vice versa.
</description>
</method>
<method name="get_texture_scale" qualifiers="const">
<return type="Vector2">
</return>
<description>
+ Return the uv coordinate multiplier.
</description>
</method>
<method name="set_invert">
<argument index="0" name="invert" type="bool">
</argument>
<description>
- Sets the polygon as the defined polygon bounding box minus the defined polygon (the defined polygon will appear as a hole on square that contains the defined polygon).
+ Set the polygon as the defined polygon bounding box minus the defined polygon (the defined polygon will appear as a hole on the square that contains the defined polygon).
</description>
</method>
<method name="get_invert" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns whether this polygon is inverted or not
+ Return whether this polygon is inverted or not.
</description>
</method>
<method name="set_invert_border">
<argument index="0" name="invert_border" type="float">
</argument>
<description>
+ Add extra padding around the bounding box, making it bigger. Too small a value can make the polygon triangulate strangely, due to numerical imprecision.
</description>
</method>
<method name="get_invert_border" qualifiers="const">
<return type="float">
</return>
<description>
+ Return the added padding around the bounding box.
</description>
</method>
<method name="set_offset">
<argument index="0" name="offset" type="Vector2">
</argument>
<description>
- Sets the amount of distance from the polygon points from the polygon position, for example if the offset is set to 10,10 then all the polygon points will move 10 units to the right and 10 units to the bottom.
+ Set the an offset that will be added to the vertices' position. E.g. if the offset is set to (10,10) then all the polygon points will move 10 units to the right and 10 units to the bottom.
</description>
</method>
<method name="get_offset" qualifiers="const">
<return type="Vector2">
</return>
<description>
- Returns the polygon points offset to the polygon position.
+ Return the offset for the polygon vertices.
</description>
</method>
</methods>
@@ -31404,6 +31657,7 @@ This method controls whether the position between two cached points is interpola
Rigid body. This is the "natural" state of a rigid body. It is affected by forces, and can move, rotate, and be affected by user code.
</constant>
<constant name="MODE_CHARACTER" value="2">
+ Character body. This behaves like a rigid body, but can not rotate.
</constant>
</constants>
</class>
@@ -31456,7 +31710,7 @@ This method controls whether the position between two cached points is interpola
<return type="float">
</return>
<description>
- Return the body's moment of inertia. This is usually automatically computed from the mass and the shapes. Note that this doesn't seem to work in a [code]_ready[/code] function: it apparently has not been auto-computed yet.
+ Return the body's moment of inertia. This is usually automatically computed from the mass and the shapes. Note that this doesn't seem to work in a [code]_ready[/code] function: it apparently has not been auto-computed yet.
</description>
</method>
<method name="set_inertia">
@@ -37017,6 +37271,24 @@ This method controls whether the position between two cached points is interpola
If the string is a path to a file or directory, return true if the path is relative.
</description>
</method>
+ <method name="is_subsequence_of">
+ <return type="bool">
+ </return>
+ <argument index="0" name="text" type="String">
+ </argument>
+ <description>
+ Checked whether this string is a subsequence of the given string.
+ </description>
+ </method>
+ <method name="is_subsequence_ofi">
+ <return type="bool">
+ </return>
+ <argument index="0" name="text" type="String">
+ </argument>
+ <description>
+ Checked whether this string is a subsequence of the given string, without considering case.
+ </description>
+ </method>
<method name="is_valid_float">
<return type="bool">
</return>
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index 9f24633bd4..2838e7d913 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -124,6 +124,11 @@ void FileAccessUnix::close() {
//unlink(save_path.utf8().get_data());
//print_line("renaming..");
int rename_error = rename((save_path+".tmp").utf8().get_data(),save_path.utf8().get_data());
+
+ if (rename_error && close_fail_notify) {
+ close_fail_notify(save_path);
+ }
+
save_path="";
ERR_FAIL_COND( rename_error != 0);
}
diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp
index 66181a6f44..3f27068fb2 100644
--- a/drivers/windows/file_access_windows.cpp
+++ b/drivers/windows/file_access_windows.cpp
@@ -131,6 +131,10 @@ void FileAccessWindows::close() {
//atomic replace for existing file
rename_error = !ReplaceFileW(save_path.c_str(), (save_path+".tmp").c_str(), NULL, 2|4, NULL, NULL);
}
+ if (rename_error && close_fail_notify) {
+ close_fail_notify(save_path);
+ }
+
save_path="";
ERR_FAIL_COND( rename_error );
}
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp
index d51f1a4ddc..7481eac620 100644
--- a/modules/gdscript/gd_compiler.cpp
+++ b/modules/gdscript/gd_compiler.cpp
@@ -1611,6 +1611,9 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa
p_script->member_default_values[name]=p_class->variables[i].default_value;
}
#endif
+ } else {
+
+ p_script->member_info[name]=PropertyInfo(Variant::NIL,name,PROPERTY_HINT_NONE,"",PROPERTY_USAGE_SCRIPT_VARIABLE);
}
//int new_idx = p_script->member_indices.size();
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index 04522aadc2..9d438998cb 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -727,7 +727,12 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
String methodstr = GDFunctions::get_func_name(func);
- err_text=_get_call_error(err,"built-in function '"+methodstr+"'",(const Variant**)argptrs);
+ if (dst->get_type()==Variant::STRING) {
+ //call provided error string
+ err_text="Error calling built-in function '"+methodstr+"': "+String(*dst);
+ } else {
+ err_text=_get_call_error(err,"built-in function '"+methodstr+"'",(const Variant**)argptrs);
+ }
break;
}
ip+=argc+1;
diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp
index 5ea5908c5f..077255064d 100644
--- a/modules/gdscript/gd_functions.cpp
+++ b/modules/gdscript/gd_functions.cpp
@@ -120,11 +120,13 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
if (p_arg_count<m_count) {\
r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;\
r_error.argument=m_count;\
+ r_ret=Variant();\
return;\
}\
if (p_arg_count>m_count) {\
r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;\
r_error.argument=m_count;\
+ r_ret=Variant();\
return;\
}
@@ -133,6 +135,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;\
r_error.argument=m_arg;\
r_error.expected=Variant::REAL;\
+ r_ret=Variant();\
return;\
}
@@ -244,6 +247,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::REAL;
+ r_ret=Variant();
}
} break;
case MATH_SIGN: {
@@ -261,6 +265,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::REAL;
+ r_ret=Variant();
}
} break;
case MATH_POW: {
@@ -442,6 +447,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::OBJECT;
+ r_ret=Variant();
return;
}
@@ -479,7 +485,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::OBJECT;
- r_ret=Variant();
+ r_ret=Variant();
return;
}
@@ -508,8 +514,11 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
int type=*p_args[1];
if (type<0 || type>=Variant::VARIANT_MAX) {
- ERR_PRINT("Invalid type argument to convert()");
- r_ret=Variant::NIL;
+ r_ret=RTR("Invalid type argument to convert(), use TYPE_* constants.");
+ r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.argument=0;
+ r_error.expected=Variant::INT;
+ return;
} else {
@@ -638,7 +647,8 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::STRING;
- r_ret=Variant();
+ r_ret="Parse error at line "+itos(line)+": "+errs;
+ return;
}
} break;
@@ -652,7 +662,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::NIL;
- r_ret=Variant();
+ r_ret="Unexpected error encoding variable to bytes, likely unserializable type found (Object or RID).";
return;
}
@@ -680,11 +690,10 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
ByteArray::Read r=varr.read();
Error err = decode_variant(ret,r.ptr(),varr.size(),NULL);
if (err!=OK) {
- ERR_PRINT("Not enough bytes for decoding..");
+ r_ret=RTR("Not enough bytes for decoding bytes, or invalid format.");
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::RAW_ARRAY;
- r_ret=Variant();
return;
}
@@ -701,6 +710,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument=1;
+ r_ret=Variant();
} break;
case 1: {
@@ -759,9 +769,9 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
int incr=*p_args[2];
if (incr==0) {
- ERR_EXPLAIN("step argument is zero!");
+ r_ret=RTR("step argument is zero!");
r_error.error=Variant::CallError::CALL_ERROR_INVALID_METHOD;
- ERR_FAIL();
+ return;
}
Array arr(true);
@@ -812,6 +822,8 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.argument=3;
+ r_ret=Variant();
+
} break;
}
@@ -847,8 +859,8 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::DICTIONARY;
- ERR_PRINT("Not a script with an instance");
-
+ r_ret=RTR("Not a script with an instance");
+ return;
} else {
GDInstance *ins = static_cast<GDInstance*>(obj->get_script_instance());
@@ -858,7 +870,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::DICTIONARY;
- ERR_PRINT("Not based on a script");
+ r_ret=RTR("Not based on a script");
return;
}
@@ -879,8 +891,10 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::DICTIONARY;
- print_line("PATH: "+p->path);
- ERR_PRINT("Not based on a resource file");
+ r_ret=Variant();
+
+
+ r_ret=RTR("Not based on a resource file");
return;
}
@@ -926,6 +940,8 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::DICTIONARY;
+ r_ret=Variant();
+
return;
}
@@ -936,6 +952,8 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::OBJECT;
+ r_ret=RTR("Invalid instance dictionary format (missing @path)");
+
return;
}
@@ -945,6 +963,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::OBJECT;
+ r_ret=RTR("Invalid instance dictionary format (can't load script at @path)");
return;
}
@@ -955,6 +974,8 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::OBJECT;
+ r_ret=Variant();
+ r_ret=RTR("Invalid instance dictionary format (invalid script at @path)");
return;
}
@@ -971,20 +992,22 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
r_error.expected=Variant::OBJECT;
+ r_ret=Variant();
+ r_ret=RTR("Invalid instance dictionary (invalid subclasses)");
return;
}
}
r_ret = gdscr->_new(NULL,0,r_error);
- GDInstance *ins = static_cast<GDInstance*>(static_cast<Object*>(r_ret)->get_script_instance());
- Ref<GDScript> gd_ref = ins->get_script();
+ GDInstance *ins = static_cast<GDInstance*>(static_cast<Object*>(r_ret)->get_script_instance());
+ Ref<GDScript> gd_ref = ins->get_script();
- for(Map<StringName,GDScript::MemberInfo>::Element *E = gd_ref->member_indices.front(); E; E = E->next()) {
- if(d.has(E->key())) {
- ins->members[E->get().index] = d[E->key()];
- }
- }
+ for(Map<StringName,GDScript::MemberInfo>::Element *E = gd_ref->member_indices.front(); E; E = E->next()) {
+ if(d.has(E->key())) {
+ ins->members[E->get().index] = d[E->key()];
+ }
+ }
} break;
case HASH: {
@@ -998,11 +1021,15 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
if (p_arg_count<3) {
r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument=3;
+ r_ret=Variant();
+
return;
}
if (p_arg_count>4) {
r_error.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_error.argument=4;
+ r_ret=Variant();
+
return;
}
@@ -1036,6 +1063,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
if (p_args[0]->get_type()!=Variant::INT && p_args[0]->get_type()!=Variant::REAL) {
r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument=0;
+ r_error.expected=Variant::INT;
r_ret=Variant();
break;
}
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 9e90027a70..ac96a2117c 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -730,7 +730,7 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
//find list [ or find dictionary {
- print_line("found bug?");
+ //print_line("found bug?");
_set_error("Error parsing expression, misplaced: "+String(tokenizer->get_token_name(tokenizer->get_token())));
return NULL; //nothing
@@ -2408,6 +2408,7 @@ void GDParser::_parse_class(ClassNode *p_class) {
return;
}
current_export.type=type;
+ current_export.usage|=PROPERTY_USAGE_SCRIPT_VARIABLE;
tokenizer->advance();
if (tokenizer->get_token()==GDTokenizer::TK_COMMA) {
// hint expected next!
@@ -2782,6 +2783,8 @@ void GDParser::_parse_class(ClassNode *p_class) {
current_export.type=Variant::OBJECT;
current_export.hint=PROPERTY_HINT_RESOURCE_TYPE;
+ current_export.usage|=PROPERTY_USAGE_SCRIPT_VARIABLE;
+
current_export.hint_string=identifier;
tokenizer->advance();
@@ -2901,6 +2904,7 @@ void GDParser::_parse_class(ClassNode *p_class) {
return;
}
member._export.type=cn->value.get_type();
+ member._export.usage|=PROPERTY_USAGE_SCRIPT_VARIABLE;
}
}
#ifdef TOOLS_ENABLED
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index 359a9fe2d5..026fd04869 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -1898,6 +1898,11 @@ Error ResourceFormatSaverGDScript::save(const String &p_path,const RES& p_resour
}
file->close();
memdelete(file);
+
+ if (ScriptServer::is_reload_scripts_on_save_enabled()) {
+ GDScriptLanguage::get_singleton()->reload_tool_script(p_resource,false);
+ }
+
return OK;
}
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp
index 56eacfd20e..8dd68cf95a 100644
--- a/modules/gdscript/gd_tokenizer.cpp
+++ b/modules/gdscript/gd_tokenizer.cpp
@@ -79,8 +79,8 @@ const char* GDTokenizer::token_names[TK_MAX]={
"for",
"do",
"while",
-"switch",
-"case",
+"switch (reserved)",
+"case (reserved)",
"break",
"continue",
"pass",
@@ -874,6 +874,7 @@ void GDTokenizerText::_advance() {
{TK_CF_WHILE,"while"},
{TK_CF_DO,"do"},
{TK_CF_SWITCH,"switch"},
+ {TK_CF_CASE,"case"},
{TK_CF_BREAK,"break"},
{TK_CF_CONTINUE,"continue"},
{TK_CF_RETURN,"return"},
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 503e723de2..5e30416641 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -1830,7 +1830,7 @@ GridMap::GridMap() {
baked_light_instance=NULL;
use_baked_light=false;
-
+ navigation = NULL;
}
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 87afe3d5a4..f3beabceb8 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -741,7 +741,7 @@ void GridMapEditor::update_pallete() {
}
float min_size = EDITOR_DEF("grid_map/preview_size",64);
- theme_pallete->set_min_icon_size(Size2(min_size, min_size));
+ theme_pallete->set_fixed_icon_size(Size2(min_size, min_size));
theme_pallete->set_fixed_column_width(min_size*3/2);
theme_pallete->set_max_text_lines(2);
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 060819b90e..b35e3a8055 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -9,6 +9,7 @@
#include "os/file_access.h"
#include "os/os.h"
#include "platform/android/logo.h"
+#include <string.h>
static const char* android_perms[]={
@@ -231,6 +232,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
void _fix_manifest(Vector<uint8_t>& p_manifest, bool p_give_internet);
void _fix_resources(Vector<uint8_t>& p_manifest);
static Error save_apk_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total);
+ static bool _should_compress_asset(const String& p_path);
protected:
@@ -1001,7 +1003,7 @@ Error EditorExportPlatformAndroid::save_apk_file(void *p_userdata,const String&
NULL,
0,
NULL,
- Z_DEFLATED,
+ _should_compress_asset(p_path) ? Z_DEFLATED : 0,
Z_DEFAULT_COMPRESSION);
@@ -1012,13 +1014,63 @@ Error EditorExportPlatformAndroid::save_apk_file(void *p_userdata,const String&
}
+bool EditorExportPlatformAndroid::_should_compress_asset(const String& p_path) {
+
+ /*
+ * By not compressing files with little or not benefit in doing so,
+ * a performance gain is expected at runtime. Moreover, if the APK is
+ * zip-aligned, assets stored as they are can be efficiently read by
+ * Android by memory-mapping them.
+ */
+
+ // -- Unconditional uncompress to mimic AAPT plus some other
+
+ static const char* unconditional_compress_ext[] = {
+ // From https://github.com/android/platform_frameworks_base/blob/master/tools/aapt/Package.cpp
+ // These formats are already compressed, or don't compress well:
+ ".jpg", ".jpeg", ".png", ".gif",
+ ".wav", ".mp2", ".mp3", ".ogg", ".aac",
+ ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",
+ ".rtttl", ".imy", ".xmf", ".mp4", ".m4a",
+ ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",
+ ".amr", ".awb", ".wma", ".wmv",
+ // Godot-specific:
+ ".webp", // Same reasoning as .png
+ ".cfb", // Don't let small config files slow-down startup
+ // Trailer for easier processing
+ NULL
+ };
+
+ for (const char** ext=unconditional_compress_ext; *ext; ++ext) {
+ if (p_path.to_lower().ends_with(String(*ext))) {
+ return false;
+ }
+ }
+
+ // -- Compressed resource?
+
+ FileAccess *f=FileAccess::open(p_path,FileAccess::READ);
+ ERR_FAIL_COND_V(!f,true);
+
+ uint8_t header[4];
+ f->get_buffer(header,4);
+ if (header[0]=='R' && header[1]=='S' && header[2]=='C' && header[3]=='C') {
+ // Already compressed
+ return false;
+ }
+
+ // --- TODO: Decide on texture resources according to their image compression setting
+
+ return true;
+}
+
Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_debug, int p_flags) {
String src_apk;
- EditorProgress ep("export","Exporting for Android",104);
+ EditorProgress ep("export","Exporting for Android",105);
if (p_debug)
src_apk=custom_debug_package;
@@ -1058,7 +1110,8 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
zlib_filefunc_def io2=io;
FileAccess *dst_f=NULL;
io2.opaque=&dst_f;
- zipFile apk=zipOpen2(p_path.utf8().get_data(),APPEND_STATUS_CREATE,NULL,&io2);
+ String unaligned_path=EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmpexport-unaligned.apk";
+ zipFile unaligned_apk=zipOpen2(unaligned_path.utf8().get_data(),APPEND_STATUS_CREATE,NULL,&io2);
while(ret==UNZ_OK) {
@@ -1137,7 +1190,11 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
print_line("ADDING: "+file);
if (!skip) {
- zipOpenNewFileInZip(apk,
+
+ // Respect decision on compression made by AAPT for the export template
+ const bool uncompressed = info.compression_method == 0;
+
+ zipOpenNewFileInZip(unaligned_apk,
file.utf8().get_data(),
NULL,
NULL,
@@ -1145,11 +1202,11 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
NULL,
0,
NULL,
- Z_DEFLATED,
+ uncompressed ? 0 : Z_DEFLATED,
Z_DEFAULT_COMPRESSION);
- zipWriteInFileInZip(apk,data.ptr(),data.size());
- zipCloseFileInZip(apk);
+ zipWriteInFileInZip(unaligned_apk,data.ptr(),data.size());
+ zipCloseFileInZip(unaligned_apk);
}
ret = unzGoToNextFile(pkg);
@@ -1206,7 +1263,7 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
APKExportData ed;
ed.ep=&ep;
- ed.apk=apk;
+ ed.apk=unaligned_apk;
err = export_project_files(save_apk_file,&ed,false);
}
@@ -1235,7 +1292,7 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
print_line(itos(i)+" param: "+cl[i]);
}
- zipOpenNewFileInZip(apk,
+ zipOpenNewFileInZip(unaligned_apk,
"assets/_cl_",
NULL,
NULL,
@@ -1243,15 +1300,15 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
NULL,
0,
NULL,
- Z_DEFLATED,
+ 0, // No compress (little size gain and potentially slower startup)
Z_DEFAULT_COMPRESSION);
- zipWriteInFileInZip(apk,clf.ptr(),clf.size());
- zipCloseFileInZip(apk);
+ zipWriteInFileInZip(unaligned_apk,clf.ptr(),clf.size());
+ zipCloseFileInZip(unaligned_apk);
}
- zipClose(apk,NULL);
+ zipClose(unaligned_apk,NULL);
unzClose(pkg);
if (err) {
@@ -1308,7 +1365,7 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
args.push_back(keystore);
args.push_back("-storepass");
args.push_back(password);
- args.push_back(p_path);
+ args.push_back(unaligned_path);
args.push_back(user);
int retval;
int err = OS::get_singleton()->execute(jarsigner,args,true,NULL,NULL,&retval);
@@ -1321,16 +1378,102 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
args.clear();
args.push_back("-verify");
- args.push_back(p_path);
+ args.push_back(unaligned_path);
args.push_back("-verbose");
err = OS::get_singleton()->execute(jarsigner,args,true,NULL,NULL,&retval);
if (retval) {
- EditorNode::add_io_error("'jarsigner' verificaiton of APK failed. Make sure to use jarsigner from Java 6.");
+ EditorNode::add_io_error("'jarsigner' verification of APK failed. Make sure to use jarsigner from Java 6.");
return ERR_CANT_CREATE;
}
}
+
+
+
+ // Let's zip-align (must be done after signing)
+
+ static const int ZIP_ALIGNMENT = 4;
+
+ ep.step("Aligning APK..",105);
+
+ unzFile tmp_unaligned = unzOpen2(unaligned_path.utf8().get_data(), &io);
+ if (!tmp_unaligned) {
+
+ EditorNode::add_io_error("Could not find temp unaligned APK.");
+ return ERR_FILE_NOT_FOUND;
+ }
+
+ ERR_FAIL_COND_V(!tmp_unaligned, ERR_CANT_OPEN);
+ ret = unzGoToFirstFile(tmp_unaligned);
+
+ io2=io;
+ dst_f=NULL;
+ io2.opaque=&dst_f;
+ zipFile final_apk=zipOpen2(p_path.utf8().get_data(),APPEND_STATUS_CREATE,NULL,&io2);
+
+ // Take files from the unaligned APK and write them out to the aligned one
+ // in raw mode, i.e. not uncompressing and recompressing, aligning them as needed,
+ // following what is done in https://github.com/android/platform_build/blob/master/tools/zipalign/ZipAlign.cpp
+ int bias = 0;
+ while(ret==UNZ_OK) {
+
+ unz_file_info info;
+ memset(&info, 0, sizeof(info));
+
+ char fname[16384];
+ char extra[16384];
+ ret = unzGetCurrentFileInfo(tmp_unaligned,&info,fname,16384,extra,16384-ZIP_ALIGNMENT,NULL,0);
+
+ String file=fname;
+
+ Vector<uint8_t> data;
+ data.resize(info.compressed_size);
+
+ // read
+ int method, level;
+ unzOpenCurrentFile2(tmp_unaligned, &method, &level, 1); // raw read
+ long file_offset = unzGetCurrentFileZStreamPos64(tmp_unaligned);
+ unzReadCurrentFile(tmp_unaligned,data.ptr(),data.size());
+ unzCloseCurrentFile(tmp_unaligned);
+
+ // align
+ int padding = 0;
+ if (!info.compression_method) {
+ // Uncompressed file => Align
+ long new_offset = file_offset + bias;
+ padding = (ZIP_ALIGNMENT - (new_offset % ZIP_ALIGNMENT)) % ZIP_ALIGNMENT;
+ }
+
+ memset(extra + info.size_file_extra, 0, padding);
+
+ // write
+ zipOpenNewFileInZip2(final_apk,
+ file.utf8().get_data(),
+ NULL,
+ extra,
+ info.size_file_extra + padding,
+ NULL,
+ 0,
+ NULL,
+ method,
+ level,
+ 1); // raw write
+ zipWriteInFileInZip(final_apk,data.ptr(),data.size());
+ zipCloseFileInZipRaw(final_apk,info.uncompressed_size,info.crc);
+
+ bias += padding;
+
+ ret = unzGoToNextFile(tmp_unaligned);
+ }
+
+ zipClose(final_apk,NULL);
+ unzClose(tmp_unaligned);
+
+ if (err) {
+ return err;
+ }
+
return OK;
}
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index d1aa54b71d..1982beb10e 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -30,7 +30,6 @@ def get_flags():
return [
('legacygl', 'yes'),
('builtin_zlib', 'no'),
- ('freetype','builtin'), #use builtin freetype
('glew', 'yes'),
]
@@ -56,12 +55,6 @@ def configure(env):
env.Append(CCFLAGS=['-g3', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED'])
- if (env["freetype"]!="no"):
- env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
- env.Append(CPPPATH=['#drivers/freetype'])
- env.Append(CPPPATH=['#drivers/freetype/freetype/include'])
-
-
if (not os.environ.has_key("OSXCROSS_ROOT")):
#regular native build
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index a6a949a11a..320fb9d269 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -168,7 +168,6 @@ def get_opts():
def get_flags():
return [
- ('freetype','builtin'), #use builtin freetype
('glew','yes'),
('openssl','builtin'), #use builtin openssl
]
@@ -203,10 +202,6 @@ def configure(env):
env.Append(CPPPATH=['#platform/windows/include'])
env.Append(LIBPATH=['#platform/windows/lib'])
- if (env["freetype"]!="no"):
- env.Append(CCFLAGS=['/DFREETYPE_ENABLED'])
- env.Append(CPPPATH=['#drivers/freetype'])
- env.Append(CPPPATH=['#drivers/freetype/freetype/include'])
if (env["target"]=="release"):
@@ -350,10 +345,6 @@ def configure(env):
env.Append(CCFLAGS=['-g', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED'])
- if (env["freetype"]!="no"):
- env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
- env.Append(CPPPATH=['#drivers/freetype'])
- env.Append(CPPPATH=['#drivers/freetype/freetype/include'])
env["CC"]=mingw_prefix+"gcc"
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 9034541f37..630d5715e9 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1834,6 +1834,11 @@ uint64_t OS_Windows::get_unix_time() const {
};
uint64_t OS_Windows::get_system_time_secs() const {
+
+
+ const uint64_t WINDOWS_TICK = 10000000;
+ const uint64_t SEC_TO_UNIX_EPOCH = 11644473600LL;
+
SYSTEMTIME st;
GetSystemTime(&st);
FILETIME ft;
@@ -1842,7 +1847,8 @@ uint64_t OS_Windows::get_system_time_secs() const {
ret=ft.dwHighDateTime;
ret<<=32;
ret|=ft.dwLowDateTime;
- return ret;
+
+ return (uint64_t)(ret / WINDOWS_TICK - SEC_TO_UNIX_EPOCH);
}
void OS_Windows::delay_usec(uint32_t p_usec) const {
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 2561e09b9a..5f272536ba 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -45,6 +45,11 @@ def can_build():
print("xinerama not found.. x11 disabled.")
return False
+ x11_error=os.system("pkg-config xrandr --modversion > /dev/null ")
+ if (x11_error):
+ print("xrandr not found.. x11 disabled.")
+ return False
+
return True # X11 enabled
@@ -67,6 +72,8 @@ def get_flags():
('builtin_zlib', 'no'),
('glew', 'yes'),
("openssl", "yes"),
+ ('freetype','yes'), #use system freetype
+
#("theora","no"),
]
@@ -132,6 +139,7 @@ def configure(env):
env.ParseConfig('pkg-config x11 --cflags --libs')
env.ParseConfig('pkg-config xinerama --cflags --libs')
env.ParseConfig('pkg-config xcursor --cflags --libs')
+ env.ParseConfig('pkg-config xrandr --cflags --libs')
if (env["openssl"]=="yes"):
env.ParseConfig('pkg-config openssl --cflags --libs')
@@ -141,11 +149,6 @@ def configure(env):
env.ParseConfig('pkg-config freetype2 --cflags --libs')
- if (env["freetype"]!="no"):
- env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
- if (env["freetype"]=="builtin"):
- env.Append(CPPPATH=['#drivers/freetype'])
- env.Append(CPPPATH=['#drivers/freetype/freetype/include'])
env.Append(CPPFLAGS=['-DOPENGL_ENABLED'])
@@ -179,7 +182,7 @@ def configure(env):
print("PulseAudio development libraries not found, disabling driver")
env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES_OVER_GL'])
- env.Append(LIBS=['GL', 'GLU', 'pthread', 'z'])
+ env.Append(LIBS=['GL', 'GLU', 'pthread', 'z', 'dl'])
#env.Append(CPPFLAGS=['-DMPC_FIXED_POINT'])
#host compiler is default..
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index b089436a17..1ca779ef7c 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -57,6 +57,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include <dlfcn.h>
//stupid linux.h
#ifdef KEY_TAB
@@ -117,6 +118,37 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
char * modifiers = XSetLocaleModifiers ("@im=none");
ERR_FAIL_COND( modifiers == NULL );
+ const char* err;
+ xrr_get_monitors = NULL;
+ xrr_free_monitors = NULL;
+ int xrandr_major = 0;
+ int xrandr_minor = 0;
+ int event_base, error_base;
+ xrandr_ext_ok = XRRQueryExtension(x11_display,&event_base, &error_base);
+ xrandr_handle = dlopen("libXrandr.so", RTLD_LAZY);
+ err = dlerror();
+ if (!xrandr_handle) {
+ fprintf(stderr, "could not load libXrandr.so, Error: %s\n", err);
+ }
+ else {
+ XRRQueryVersion(x11_display, &xrandr_major, &xrandr_minor);
+ if (((xrandr_major << 8) | xrandr_minor) >= 0x0105) {
+ xrr_get_monitors = (xrr_get_monitors_t) dlsym(xrandr_handle, "XRRGetMonitors");
+ if (!xrr_get_monitors) {
+ err = dlerror();
+ fprintf(stderr, "could not find symbol XRRGetMonitors\nError: %s\n", err);
+ }
+ else {
+ xrr_free_monitors = (xrr_free_monitors_t) dlsym(xrandr_handle, "XRRFreeMonitors");
+ if (!xrr_free_monitors) {
+ err = dlerror();
+ fprintf(stderr, "could not find XRRFreeMonitors\nError: %s\n", err);
+ xrr_get_monitors = NULL;
+ }
+ }
+ }
+ }
+
xim = XOpenIM (x11_display, NULL, NULL, NULL);
@@ -480,6 +512,9 @@ void OS_X11::finalize() {
physics_2d_server->finish();
memdelete(physics_2d_server);
+ if (xrandr_handle)
+ dlclose(xrandr_handle);
+
XUnmapWindow( x11_display, x11_window );
XDestroyWindow( x11_display, x11_window );
@@ -722,6 +757,46 @@ Size2 OS_X11::get_screen_size(int p_screen) const {
return size;
}
+int OS_X11::get_screen_dpi(int p_screen) const {
+
+ //invalid screen?
+ ERR_FAIL_INDEX_V(p_screen, get_screen_count(), 0);
+
+ //Get physical monitor Dimensions through XRandR and calculate dpi
+ Size2 sc = get_screen_size(p_screen);
+ if (xrandr_ext_ok) {
+ int count = 0;
+ if (xrr_get_monitors) {
+ xrr_monitor_info *monitors = xrr_get_monitors(x11_display, x11_window, true, &count);
+ if (p_screen < count) {
+ double xdpi = sc.width / (double) monitors[p_screen].mwidth * 25.4;
+ double ydpi = sc.height / (double) monitors[p_screen].mheight * 25.4;
+ xrr_free_monitors(monitors);
+ return (xdpi + ydpi) / 2;
+ }
+ xrr_free_monitors(monitors);
+ }
+ else if (p_screen == 0) {
+ XRRScreenSize *sizes = XRRSizes(x11_display, 0, &count);
+ if (sizes) {
+ double xdpi = sc.width / (double) sizes[0].mwidth * 25.4;
+ double ydpi = sc.height / (double) sizes[0].mheight * 25.4;
+ return (xdpi + ydpi) / 2;
+ }
+ }
+ }
+
+ int width_mm = DisplayWidthMM(x11_display, p_screen);
+ int height_mm = DisplayHeightMM(x11_display, p_screen);
+ double xdpi = (width_mm ? sc.width / (double) width_mm * 25.4 : 0);
+ double ydpi = (height_mm ? sc.height / (double) height_mm * 25.4 : 0);
+ if (xdpi || xdpi)
+ return (xdpi + ydpi)/(xdpi && ydpi ? 2 : 1);
+
+ //could not get dpi
+ return 96;
+}
+
Point2 OS_X11::get_window_position() const {
int x,y;
Window child;
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 311f26d4d3..71bbe726dd 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -52,6 +52,7 @@
#include <X11/keysym.h>
#include <X11/Xlib.h>
#include <X11/Xcursor/Xcursor.h>
+#include <X11/extensions/Xrandr.h>
// Hints for X11 fullscreen
typedef struct {
@@ -62,6 +63,20 @@ typedef struct {
unsigned long status;
} Hints;
+typedef struct _xrr_monitor_info {
+ Atom name;
+ Bool primary;
+ Bool automatic;
+ int noutput;
+ int x;
+ int y;
+ int width;
+ int height;
+ int mwidth;
+ int mheight;
+ RROutput *outputs;
+} xrr_monitor_info;
+
#undef CursorShape
/**
@author Juan Linietsky <reduzio@gmail.com>
@@ -162,6 +177,12 @@ class OS_X11 : public OS_Unix {
//void set_wm_border(bool p_enabled);
void set_wm_fullscreen(bool p_enabled);
+ typedef xrr_monitor_info* (*xrr_get_monitors_t)(Display *dpy, Window window, Bool get_active, int *nmonitors);
+ typedef void (*xrr_free_monitors_t)(xrr_monitor_info* monitors);
+ xrr_get_monitors_t xrr_get_monitors;
+ xrr_free_monitors_t xrr_free_monitors;
+ void *xrandr_handle;
+ Bool xrandr_ext_ok;
protected:
@@ -219,6 +240,7 @@ public:
virtual void set_current_screen(int p_screen);
virtual Point2 get_screen_position(int p_screen=0) const;
virtual Size2 get_screen_size(int p_screen=0) const;
+ virtual int get_screen_dpi(int p_screen=0) const;
virtual Point2 get_window_position() const;
virtual void set_window_position(const Point2& p_position);
virtual Size2 get_window_size() const;
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp
index 6a9c655141..920e56130c 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -712,6 +712,15 @@ void Spatial::look_at(const Vector3& p_target, const Vector3& p_up_normal) {
Transform lookat;
lookat.origin=get_global_transform().origin;
+ if (lookat.origin==p_target) {
+ ERR_EXPLAIN("Node origin and target are in the same position, look_at() failed");
+ ERR_FAIL();
+ }
+
+ if (p_up_normal.cross(p_target-lookat.origin)==Vector3()) {
+ ERR_EXPLAIN("Up vector and direction between node origin and target are aligned, look_at() failed");
+ ERR_FAIL();
+ }
lookat=lookat.looking_at(p_target,p_up_normal);
set_global_transform(lookat);
}
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index e35ba11e84..7d134a070e 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -990,7 +990,7 @@ float VehicleBody::get_steering() const{
return m_steeringValue;
}
-Vector3 VehicleBody::get_linear_velocity()
+Vector3 VehicleBody::get_linear_velocity() const
{
return linear_velocity;
}
diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h
index b6ad88f15e..31c61ff99d 100644
--- a/scene/3d/vehicle_body.h
+++ b/scene/3d/vehicle_body.h
@@ -178,7 +178,7 @@ public:
void set_steering(float p_steering);
float get_steering() const;
- Vector3 get_linear_velocity();
+ Vector3 get_linear_velocity() const;
VehicleBody();
};
diff --git a/scene/audio/sample_player.cpp b/scene/audio/sample_player.cpp
index b4a237c60f..bcd4354975 100644
--- a/scene/audio/sample_player.cpp
+++ b/scene/audio/sample_player.cpp
@@ -290,7 +290,7 @@ void SamplePlayer::stop_all() {
#define _GET_VOICE\
uint32_t voice=p_voice&0xFFFF;\
- ERR_FAIL_COND(voice > (uint32_t)voices.size());\
+ ERR_FAIL_COND(voice >= (uint32_t)voices.size());\
Voice &v=voices[voice];\
if (v.check!=uint32_t(p_voice>>16))\
return;\
@@ -381,7 +381,7 @@ void SamplePlayer::set_reverb(VoiceID p_voice,ReverbRoomType p_room,float p_send
#define _GET_VOICE_V(m_ret)\
uint32_t voice=p_voice&0xFFFF;\
- ERR_FAIL_COND_V(voice > (uint32_t)voices.size(),m_ret);\
+ ERR_FAIL_COND_V(voice >= (uint32_t)voices.size(),m_ret);\
const Voice &v=voices[voice];\
if (v.check!=(p_voice>>16))\
return m_ret;\
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 2200cac5da..bc498f47bc 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -418,8 +418,13 @@ void BaseButton::_unhandled_input(InputEvent p_event) {
String BaseButton::get_tooltip(const Point2& p_pos) const {
String tooltip=Control::get_tooltip(p_pos);
- if (shortcut.is_valid() && shortcut->is_valid())
- tooltip+=" ("+shortcut->get_as_text()+")";
+ if (shortcut.is_valid() && shortcut->is_valid()) {
+ if (tooltip.find("$sc")!=-1) {
+ tooltip=tooltip.replace_first("$sc","("+shortcut->get_as_text()+")");
+ } else {
+ tooltip+=" ("+shortcut->get_as_text()+")";
+ }
+ }
return tooltip;
}
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index bd56369746..dfad7d1432 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -223,7 +223,7 @@ bool Control::_get(const StringName& p_name,Variant &r_ret) const {
String sname=p_name;
- if (!sname.begins_with("custom"))
+ if (!sname.begins_with("custom")) {
if (sname.begins_with("margin/")) {
String dname = sname.get_slicec('/', 1);
if (dname == "left") {
@@ -248,6 +248,7 @@ bool Control::_get(const StringName& p_name,Variant &r_ret) const {
} else {
return false;
}
+ }
if (sname.begins_with("custom_icons/")) {
String name = sname.get_slicec('/',1);
@@ -489,6 +490,10 @@ void Control::_notification(int p_notification) {
}
+ if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) {
+ data.theme_owner=data.parent->data.theme_owner;
+ notification(NOTIFICATION_THEME_CHANGED);
+ }
} break;
case NOTIFICATION_EXIT_CANVAS: {
@@ -520,26 +525,9 @@ void Control::_notification(int p_notification) {
data.parent=NULL;
data.parent_canvas_item=NULL;
-
- } break;
-
-
- case NOTIFICATION_PARENTED: {
-
- Control * parent = get_parent()->cast_to<Control>();
-
- //make children reference them theme
-
- if (parent && data.theme.is_null() && parent->data.theme_owner) {
- _propagate_theme_changed(parent->data.theme_owner);
- }
-
- } break;
- case NOTIFICATION_UNPARENTED: {
-
- //make children unreference the theme
- if (data.theme.is_null() && data.theme_owner) {
- _propagate_theme_changed(NULL);
+ if (data.theme_owner && data.theme.is_null()) {
+ data.theme_owner=NULL;
+ //notification(NOTIFICATION_THEME_CHANGED);
}
} break;
@@ -785,7 +773,7 @@ Ref<Texture> Control::get_icon(const StringName& p_name,const StringName& p_type
while(theme_owner) {
if (theme_owner->data.theme->has_icon(p_name, type ) )
- return data.theme_owner->data.theme->get_icon(p_name, type );
+ return theme_owner->data.theme->get_icon(p_name, type );
Control *parent = theme_owner->get_parent()?theme_owner->get_parent()->cast_to<Control>():NULL;
if (parent)
@@ -815,7 +803,7 @@ Ref<Shader> Control::get_shader(const StringName& p_name,const StringName& p_typ
while(theme_owner) {
if (theme_owner->data.theme->has_shader(p_name, type))
- return data.theme_owner->data.theme->get_shader(p_name, type );
+ return theme_owner->data.theme->get_shader(p_name, type );
Control *parent = theme_owner->get_parent()?theme_owner->get_parent()->cast_to<Control>():NULL;
if (parent)
@@ -843,8 +831,9 @@ Ref<StyleBox> Control::get_stylebox(const StringName& p_name,const StringName& p
while(theme_owner) {
- if (theme_owner->data.theme->has_stylebox(p_name, type ) )
- return data.theme_owner->data.theme->get_stylebox(p_name, type );
+ if (theme_owner->data.theme->has_stylebox(p_name, type ) ) {
+ return theme_owner->data.theme->get_stylebox(p_name, type );
+ }
Control *parent = theme_owner->get_parent()?theme_owner->get_parent()->cast_to<Control>():NULL;
if (parent)
@@ -872,7 +861,7 @@ Ref<Font> Control::get_font(const StringName& p_name,const StringName& p_type) c
while(theme_owner) {
if (theme_owner->data.theme->has_font(p_name, type ) )
- return data.theme_owner->data.theme->get_font(p_name, type );
+ return theme_owner->data.theme->get_font(p_name, type );
if (theme_owner->data.theme->get_default_theme_font().is_valid())
return theme_owner->data.theme->get_default_theme_font();
Control *parent = theme_owner->get_parent()?theme_owner->get_parent()->cast_to<Control>():NULL;
@@ -902,7 +891,7 @@ Color Control::get_color(const StringName& p_name,const StringName& p_type) cons
while(theme_owner) {
if (theme_owner->data.theme->has_color(p_name, type ) )
- return data.theme_owner->data.theme->get_color(p_name, type );
+ return theme_owner->data.theme->get_color(p_name, type );
Control *parent = theme_owner->get_parent()?theme_owner->get_parent()->cast_to<Control>():NULL;
if (parent)
@@ -931,7 +920,7 @@ int Control::get_constant(const StringName& p_name,const StringName& p_type) con
while(theme_owner) {
if (theme_owner->data.theme->has_constant(p_name, type ) )
- return data.theme_owner->data.theme->get_constant(p_name, type );
+ return theme_owner->data.theme->get_constant(p_name, type );
Control *parent = theme_owner->get_parent()?theme_owner->get_parent()->cast_to<Control>():NULL;
if (parent)
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index fc4ab5f8ca..66e8fe10ff 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -384,27 +384,16 @@ ItemList::IconMode ItemList::get_icon_mode() const{
return icon_mode;
}
-void ItemList::set_min_icon_size(const Size2& p_size) {
- min_icon_size=p_size;
- update();
-}
-
-Size2 ItemList::get_min_icon_size() const {
-
- return min_icon_size;
-}
+void ItemList::set_fixed_icon_size(const Size2& p_size) {
-
-void ItemList::set_max_icon_size(const Size2& p_size) {
-
- max_icon_size=p_size;
+ fixed_icon_size=p_size;
update();
}
-Size2 ItemList::get_max_icon_size() const {
+Size2 ItemList::get_fixed_icon_size() const {
- return max_icon_size;
+ return fixed_icon_size;
}
Size2 ItemList::Item::get_icon_size() const {
@@ -732,51 +721,21 @@ void ItemList::ensure_current_is_visible() {
update();
}
-static Size2 _adjust_to_max_size(Size2 p_size, Size2 p_max_size) {
-
- if (p_max_size.x<=0)
- p_max_size.x=1e20;
- if (p_max_size.y<=0)
- p_max_size.y=1e20;
-
+static Rect2 _adjust_to_max_size(Size2 p_size, Size2 p_max_size) {
- Size2 new_size;
+ Size2 size=p_max_size;
+ int tex_width = p_size.width * size.height / p_size.height;
+ int tex_height = size.height;
- if (p_size.x > p_max_size.x) {
-
- new_size.width=p_max_size.x;
- new_size.height=p_size.height * p_max_size.width / p_size.width;
-
- if (new_size.height > p_max_size.height) {
- new_size=Size2(); //invalid
- }
+ if (tex_width>size.width) {
+ tex_width=size.width;
+ tex_height=p_size.height * tex_width / p_size.width;
}
+ int ofs_x=(size.width - tex_width)/2;
+ int ofs_y=(size.height - tex_height)/2;
- if (p_size.y > p_max_size.y) {
-
- Size2 new_size2;
- new_size2.height=p_max_size.y;
- new_size2.width=p_size.width * p_max_size.height / p_size.height;
-
- if (new_size2.width < p_max_size.width) {
-
- if (new_size!=Size2()) {
-
- if (new_size2.x*new_size2.y > new_size.x*new_size.y) {
- new_size=new_size2;
- }
- } else {
- new_size=new_size2;
- }
- }
-
- }
-
- if (new_size==Size2())
- return p_size;
- else
- return new_size;
+ return Rect2(ofs_x,ofs_y,tex_width,tex_height);
}
@@ -845,7 +804,11 @@ void ItemList::_notification(int p_what) {
Size2 minsize;
if (items[i].icon.is_valid()) {
- minsize=_adjust_to_max_size(items[i].get_icon_size(),max_icon_size) * icon_scale;
+ if (fixed_icon_size.x>0 && fixed_icon_size.y>0) {
+ minsize=fixed_icon_size* icon_scale;
+ } else {
+ minsize=items[i].get_icon_size() *icon_scale;
+ }
if (items[i].text!="") {
if (icon_mode==ICON_MODE_TOP) {
@@ -1001,13 +964,18 @@ void ItemList::_notification(int p_what) {
Vector2 text_ofs;
if (items[i].icon.is_valid()) {
- Size2 icon_size = _adjust_to_max_size(items[i].get_icon_size(),max_icon_size) * icon_scale;
+ Size2 icon_size;
+ //= _adjust_to_max_size(items[i].get_icon_size(),fixed_icon_size) * icon_scale;
+
+ if (fixed_icon_size.x>0 && fixed_icon_size.y>0) {
+ icon_size=fixed_icon_size* icon_scale;
+ } else {
+ icon_size=items[i].get_icon_size() *icon_scale;
- Vector2 icon_ofs;
- if (min_icon_size!=Vector2()) {
- icon_ofs = (min_icon_size - icon_size)/2;
}
+ Vector2 icon_ofs;
+
Point2 pos = items[i].rect_cache.pos + icon_ofs + base_ofs;
if (icon_mode==ICON_MODE_TOP) {
@@ -1017,18 +985,26 @@ void ItemList::_notification(int p_what) {
Math::floor((items[i].rect_cache.size.height - icon_size.height)/2),
items[i].rect_cache.size.height - items[i].min_rect_cache.size.height
);
- text_ofs.y = MAX(icon_size.height, min_icon_size.y) + icon_margin;
+ text_ofs.y = icon_size.height + icon_margin;
text_ofs.y += items[i].rect_cache.size.height - items[i].min_rect_cache.size.height;
} else {
pos.y += Math::floor((items[i].rect_cache.size.height - icon_size.height)/2);
- text_ofs.x = MAX(icon_size.width, min_icon_size.x) + icon_margin;
+ text_ofs.x = icon_size.width + icon_margin;
+ }
+
+ Rect2 draw_rect=Rect2(pos,icon_size);
+
+ if (fixed_icon_size.x>0 && fixed_icon_size.y>0) {
+ Rect2 adj = _adjust_to_max_size(items[i].get_icon_size() * icon_scale,icon_size);
+ draw_rect.pos+=adj.pos;
+ draw_rect.size=adj.size;
}
if (items[i].icon_region.has_no_area())
- draw_texture_rect(items[i].icon, Rect2(pos,icon_size) );
+ draw_texture_rect(items[i].icon, draw_rect );
else
- draw_texture_rect_region(items[i].icon, Rect2(pos, icon_size), items[i].icon_region);
+ draw_texture_rect_region(items[i].icon, draw_rect, items[i].icon_region);
}
@@ -1298,11 +1274,9 @@ void ItemList::_bind_methods(){
ObjectTypeDB::bind_method(_MD("set_icon_mode","mode"),&ItemList::set_icon_mode);
ObjectTypeDB::bind_method(_MD("get_icon_mode"),&ItemList::get_icon_mode);
- ObjectTypeDB::bind_method(_MD("set_min_icon_size","size"),&ItemList::set_min_icon_size);
- ObjectTypeDB::bind_method(_MD("get_min_icon_size"),&ItemList::get_min_icon_size);
- ObjectTypeDB::bind_method(_MD("set_max_icon_size","size"),&ItemList::set_max_icon_size);
- ObjectTypeDB::bind_method(_MD("get_max_icon_size"),&ItemList::get_max_icon_size);
+ ObjectTypeDB::bind_method(_MD("set_fixed_icon_size","size"),&ItemList::set_fixed_icon_size);
+ ObjectTypeDB::bind_method(_MD("get_fixed_icon_size"),&ItemList::get_fixed_icon_size);
ObjectTypeDB::bind_method(_MD("set_icon_scale","scale"),&ItemList::set_icon_scale);
ObjectTypeDB::bind_method(_MD("get_icon_scale"),&ItemList::get_icon_scale);
diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h
index 087c585128..a4909205ef 100644
--- a/scene/gui/item_list.h
+++ b/scene/gui/item_list.h
@@ -62,8 +62,7 @@ private:
int max_text_lines;
int max_columns;
- Size2 min_icon_size;
- Size2 max_icon_size;
+ Size2 fixed_icon_size;
Size2 max_item_size_cache;
@@ -75,6 +74,8 @@ private:
void _scroll_changed(double);
void _input_event(const InputEvent& p_event);
+
+
protected:
void _notification(int p_what);
@@ -144,11 +145,8 @@ public:
void set_icon_mode(IconMode p_mode);
IconMode get_icon_mode() const;
- void set_min_icon_size(const Size2& p_size);
- Size2 get_min_icon_size() const;
-
- void set_max_icon_size(const Size2& p_size);
- Size2 get_max_icon_size() const;
+ void set_fixed_icon_size(const Size2& p_size);
+ Size2 get_fixed_icon_size() const;
void set_allow_rmb_select(bool p_allow);
bool get_allow_rmb_select() const;
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index 09c6a77b42..2d4438c48c 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -92,7 +92,9 @@ void Label::_notification(int p_what) {
VisualServer::get_singleton()->canvas_item_set_distance_field_mode(get_canvas_item(),font.is_valid() && font->is_distance_field_hint());
int font_h = font->get_height()+line_spacing;
- int lines_visible = size.y/font_h;
+
+ int lines_visible = (size.y+line_spacing)/font_h;
+
int space_w=font->get_char_size(' ').width;
int chars_total=0;
@@ -488,9 +490,9 @@ void Label::regenerate_word_cache() {
if (!autowrap) {
minsize.width=width;
if (max_lines_visible > 0 && line_count > max_lines_visible) {
- minsize.height=(font->get_height()+line_spacing)*max_lines_visible;
+ minsize.height=(font->get_height() * max_lines_visible) + (line_spacing * (max_lines_visible - 1));
} else {
- minsize.height=(font->get_height()+line_spacing)*line_count;
+ minsize.height=(font->get_height() * line_count)+(line_spacing * (line_count - 1));
}
}
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 44cc798447..ab556ede0c 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -454,7 +454,7 @@ void LineEdit::_notification(int p_what) {
} break;
}
- int ofs_max=width-style->get_minimum_size().width+x_ofs;
+ int ofs_max=width-style->get_minimum_size().width;
int char_ofs=window_pos;
int y_area=height-style->get_minimum_size().height;
@@ -731,14 +731,21 @@ void LineEdit::set_cursor_pos(int p_pos) {
int width_to_cursor=0;
int wp=window_pos;
- if (font != NULL) {
- for (int i=window_pos;i<cursor_pos;i++)
- width_to_cursor+=font->get_char_size( text[i] ).width;
+ if (font.is_valid()) {
+
+ int accum_width=0;
- while (width_to_cursor >= window_width && wp < text.length()) {
+ for(int i=cursor_pos;i>=window_pos;i--) {
- width_to_cursor -= font->get_char_size(text[wp]).width;
- wp++;
+ if (i>=text.length()) {
+ accum_width=font->get_char_size(' ').width; //anything should do
+ } else {
+ accum_width+=font->get_char_size(text[i],i+1<text.length()?text[i+1]:0).width; //anything should do
+ }
+ if (accum_width>=window_width)
+ break;
+
+ wp=i;
}
}
@@ -799,8 +806,8 @@ Size2 LineEdit::get_minimum_size() const {
Ref<Font> font=get_font("font");
Size2 min=style->get_minimum_size();
- min+=font->get_string_size(this->text);
-
+ min.height+=font->get_height();
+ min.width+=get_constant("minimum_spaces")*font->get_char_size(' ').x;
return min;
}
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 98bc0b9434..80949b4eb4 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -374,6 +374,8 @@ if (m_height > line_height) {\
int cw=0;
bool visible = visible_characters<0 || p_char_count<visible_characters;
+ if (c[i]=='\t')
+ visible=false;
if (selected) {
diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp
index d22f6a0229..6b36a60ea2 100644
--- a/scene/gui/split_container.cpp
+++ b/scene/gui/split_container.cpp
@@ -351,7 +351,7 @@ void SplitContainer::_input_event(const InputEvent& p_event) {
}
-Control::CursorShape SplitContainer::get_cursor_shape(const Point2& p_pos) {
+Control::CursorShape SplitContainer::get_cursor_shape(const Point2& p_pos) const {
if (collapsed)
return Control::get_cursor_shape(p_pos);
diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h
index f721d16310..d2dc42165e 100644
--- a/scene/gui/split_container.h
+++ b/scene/gui/split_container.h
@@ -75,7 +75,7 @@ public:
void set_dragger_visibility(DraggerVisibility p_visibility);
DraggerVisibility get_dragger_visibility() const;
- virtual CursorShape get_cursor_shape(const Point2& p_pos=Point2i());
+ virtual CursorShape get_cursor_shape(const Point2& p_pos=Point2i()) const;
virtual Size2 get_minimum_size() const;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 3e374ef888..3d3ef46465 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2892,7 +2892,7 @@ int TextEdit::get_char_count() {
return totalsize; // omit last \n
}
-Size2 TextEdit::get_minimum_size() {
+Size2 TextEdit::get_minimum_size() const {
return cache.style_normal->get_minimum_size();
}
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 24a72afd48..22f024c491 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -278,7 +278,7 @@ class TextEdit : public Control {
void _scroll_lines_down();
// void mouse_motion(const Point& p_pos, const Point& p_rel, int p_button_mask);
- Size2 get_minimum_size();
+ Size2 get_minimum_size() const;
int get_row_height() const;
diff --git a/scene/gui/texture_frame.cpp b/scene/gui/texture_frame.cpp
index 2fe8735fda..143f0e83b8 100644
--- a/scene/gui/texture_frame.cpp
+++ b/scene/gui/texture_frame.cpp
@@ -60,6 +60,29 @@ void TextureFrame::_notification(int p_what) {
Vector2 ofs = (get_size() - texture->get_size())/2;
draw_texture_rect(texture,Rect2(ofs,texture->get_size()),false,modulate);
} break;
+ case STRETCH_KEEP_ASPECT_CENTERED:
+ case STRETCH_KEEP_ASPECT: {
+
+ Size2 size=get_size();
+ int tex_width = texture->get_width() * size.height / texture ->get_height();
+ int tex_height = size.height;
+
+ if (tex_width>size.width) {
+ tex_width=size.width;
+ tex_height=texture->get_height() * tex_width / texture->get_width();
+ }
+
+ int ofs_x = 0;
+ int ofs_y = 0;
+
+ if (stretch_mode==STRETCH_KEEP_ASPECT_CENTERED) {
+ ofs_x+=(size.width - tex_width)/2;
+ ofs_y+=(size.height - tex_height)/2;
+ }
+
+ draw_texture_rect(texture,Rect2(ofs_x,ofs_y,tex_width,tex_height));
+ } break;
+
}
@@ -104,13 +127,16 @@ void TextureFrame::_bind_methods() {
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_PROPERTYNZ( PropertyInfo( Variant::BOOL, "expand" ), _SCS("set_expand"),_SCS("has_expand") );
- ADD_PROPERTYNO( PropertyInfo( Variant::INT, "stretch_mode",PROPERTY_HINT_ENUM,"Scale On Expand (Compat),Scale,Tile,Keep,Keep Centered"), _SCS("set_stretch_mode"),_SCS("get_stretch_mode") );
+ ADD_PROPERTYNO( PropertyInfo( Variant::INT, "stretch_mode",PROPERTY_HINT_ENUM,"Scale On Expand (Compat),Scale,Tile,Keep,Keep Centered,Keep Aspect,Keep Aspect Centered"), _SCS("set_stretch_mode"),_SCS("get_stretch_mode") );
BIND_CONSTANT( STRETCH_SCALE_ON_EXPAND );
BIND_CONSTANT( STRETCH_SCALE );
BIND_CONSTANT( STRETCH_TILE );
BIND_CONSTANT( STRETCH_KEEP );
BIND_CONSTANT( STRETCH_KEEP_CENTERED );
+ BIND_CONSTANT( STRETCH_KEEP_ASPECT );
+ BIND_CONSTANT( STRETCH_KEEP_ASPECT_CENTERED );
+
}
diff --git a/scene/gui/texture_frame.h b/scene/gui/texture_frame.h
index a4acf588ea..0b47202532 100644
--- a/scene/gui/texture_frame.h
+++ b/scene/gui/texture_frame.h
@@ -43,6 +43,9 @@ public:
STRETCH_TILE,
STRETCH_KEEP,
STRETCH_KEEP_CENTERED,
+ STRETCH_KEEP_ASPECT,
+ STRETCH_KEEP_ASPECT_CENTERED,
+
};
private:
bool expand;
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 2c39aea08c..08fe847a33 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1186,7 +1186,8 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
Ref<Texture> updown = cache.updown;
- String valtext = String::num( p_item->cells[i].val, Math::decimals( p_item->cells[i].step ) );
+ //String valtext = String::num( p_item->cells[i].val, Math::decimals( p_item->cells[i].step ) );
+ String valtext = rtos( p_item->cells[i].val );
font->draw( ci, text_pos, valtext, col, item_rect.size.x-updown->get_width());
if (!p_item->cells[i].editable)
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 4083dc893d..79502c74ce 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -500,7 +500,7 @@ void Viewport::_notification(int p_what) {
- if (physics_object_picking) {
+ if (physics_object_picking && (render_target || Input::get_singleton()->get_mouse_mode()!=Input::MOUSE_MODE_CAPTURED)) {
Vector2 last_pos(1e20,1e20);
CollisionObject *last_object;
@@ -1210,7 +1210,7 @@ void Viewport::set_size_override_stretch(bool p_enable) {
bool Viewport::is_size_override_stretch_enabled() const {
- return size_override;
+ return size_override_stretch;
}
void Viewport::set_as_render_target(bool p_enable){
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 5df22ba8cc..5ac7946391 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -545,9 +545,19 @@ https://github.com/godotengine/godot/issues/3127
}
#endif
- if (exists && bool(Variant::evaluate(Variant::OP_EQUAL,value,original))) {
- //exists and did not change
- continue;
+ if (exists) {
+
+ //check if already exists and did not change
+ if (value.get_type()==Variant::REAL && original.get_type()==Variant::REAL) {
+ //this must be done because, as some scenes save as text, there might be a tiny difference in floats due to numerical error
+ float a = value;
+ float b = original;
+
+ if (Math::abs(a-b)<CMP_EPSILON)
+ continue;
+ } else if (bool(Variant::evaluate(Variant::OP_EQUAL,value,original))) {
+ continue;
+ }
}
if (!exists && isdefault) {
diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp
index 4024e2f45c..d1fc614c90 100644
--- a/scene/resources/room.cpp
+++ b/scene/resources/room.cpp
@@ -31,7 +31,7 @@
#include "servers/visual_server.h"
-RID RoomBounds::get_rid() {
+RID RoomBounds::get_rid() const {
return area;
}
diff --git a/scene/resources/room.h b/scene/resources/room.h
index a9f159cd46..3ed41a3e61 100644
--- a/scene/resources/room.h
+++ b/scene/resources/room.h
@@ -50,7 +50,7 @@ protected:
public:
- virtual RID get_rid();
+ virtual RID get_rid() const;
void set_bounds( const BSP_Tree& p_bounds );
BSP_Tree get_bounds() const;
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index 8d0aedbf93..2f4d37053e 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -240,7 +240,7 @@ Ref<Texture> Theme::get_icon(const StringName& p_name,const StringName& p_type)
bool Theme::has_icon(const StringName& p_name,const StringName& p_type) const {
- return (icon_map.has(p_type) && icon_map[p_type].has(p_name));
+ return (icon_map.has(p_type) && icon_map[p_type].has(p_name) && icon_map[p_type][p_name].is_valid());
}
@@ -337,12 +337,13 @@ Ref<StyleBox> Theme::get_stylebox(const StringName& p_name,const StringName& p_t
return style_map[p_type][p_name];
} else {
return default_style;
+
}
}
bool Theme::has_stylebox(const StringName& p_name,const StringName& p_type) const {
- return (style_map.has(p_type) && style_map[p_type].has(p_name) );
+ return (style_map.has(p_type) && style_map[p_type].has(p_name) && style_map[p_type][p_name].is_valid());
}
void Theme::clear_stylebox(const StringName& p_name,const StringName& p_type) {
@@ -402,7 +403,7 @@ Ref<Font> Theme::get_font(const StringName& p_name,const StringName& p_type) con
bool Theme::has_font(const StringName& p_name,const StringName& p_type) const {
- return (font_map.has(p_type) && font_map[p_type].has(p_name));
+ return (font_map.has(p_type) && font_map[p_type].has(p_name) && font_map[p_type][p_name].is_valid());
}
void Theme::clear_font(const StringName& p_name,const StringName& p_type) {
diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp
index 411b99ebc8..e41461c11f 100644
--- a/servers/physics_2d_server.cpp
+++ b/servers/physics_2d_server.cpp
@@ -646,6 +646,14 @@ void Physics2DServer::_bind_methods() {
// ObjectTypeDB::bind_method(_MD("sync"),&Physics2DServer::sync);
//ObjectTypeDB::bind_method(_MD("flush_queries"),&Physics2DServer::flush_queries);
+ BIND_CONSTANT( SPACE_PARAM_CONTACT_RECYCLE_RADIUS );
+ BIND_CONSTANT( SPACE_PARAM_CONTACT_MAX_SEPARATION );
+ BIND_CONSTANT( SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION );
+ BIND_CONSTANT( SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD );
+ BIND_CONSTANT( SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD );
+ BIND_CONSTANT( SPACE_PARAM_BODY_TIME_TO_SLEEP );
+ BIND_CONSTANT( SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS );
+
BIND_CONSTANT( SHAPE_LINE );
BIND_CONSTANT( SHAPE_SEGMENT );
BIND_CONSTANT( SHAPE_CIRCLE );
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp
index f62209fafa..be5d9c47ff 100644
--- a/tools/editor/code_editor.cpp
+++ b/tools/editor/code_editor.cpp
@@ -247,8 +247,18 @@ void FindReplaceBar::_get_search_from(int& r_line, int& r_col) {
r_col=text_edit->cursor_get_column();
if (text_edit->is_selection_active() && !replace_all_mode) {
- r_line=text_edit->get_selection_from_line();
- r_col=text_edit->get_selection_to_column();
+
+ int selection_line=text_edit->get_selection_from_line();
+
+ if (text_edit->get_selection_text()==get_search_text() && r_line==selection_line) {
+
+ int selection_from_col=text_edit->get_selection_from_column();
+
+ if (r_col>=selection_from_col && r_col<=text_edit->get_selection_to_column()) {
+ r_col=selection_line;
+ r_col=selection_from_col;
+ }
+ }
}
if (r_line==result_line && r_col>=result_col && r_col<=result_col+get_search_text().length()) {
@@ -521,6 +531,9 @@ FindReplaceBar::FindReplaceBar() {
error_label = memnew(Label);
search_options->add_child(error_label);
+ error_label->add_color_override("font_color", Color(1,1,0,1));
+ error_label->add_color_override("font_color_shadow", Color(0,0,0,1));
+ error_label->add_constant_override("shadow_as_outline", 1);
search_options->add_spacer();
diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp
index e2b8f2884f..8847654ad7 100644
--- a/tools/editor/connections_dialog.cpp
+++ b/tools/editor/connections_dialog.cpp
@@ -35,6 +35,7 @@
#include "print_string.h"
#include "editor_settings.h"
#include "editor_node.h"
+#include "plugins/script_editor_plugin.h"
class ConnectDialogBinds : public Object {
@@ -294,47 +295,33 @@ void ConnectDialog::_bind_methods() {
ConnectDialog::ConnectDialog() {
- int margin = get_constant("margin","Dialogs");
- int button_margin = get_constant("button_margin","Dialogs");
+ VBoxContainer *vbc = memnew( VBoxContainer );
+ add_child(vbc);
+ set_child_rect(vbc);
+ HBoxContainer *main_hb = memnew( HBoxContainer );
+ vbc->add_child(main_hb);
+ main_hb->set_v_size_flags(SIZE_EXPAND_FILL);
- Label * label = memnew( Label );
- label->set_pos( Point2( 8,11) );
- label->set_text(TTR("Connect To Node:"));
-
-
- add_child(label);
- label = memnew( Label );
- label->set_anchor( MARGIN_LEFT, ANCHOR_RATIO );
- label->set_pos( Point2( 0.5,11) );
- label->set_text(TTR("Binds (Extra Params):"));
- add_child(label);
+ VBoxContainer *vbc_left = memnew( VBoxContainer );
+ main_hb->add_child(vbc_left);
+ vbc_left->set_h_size_flags(SIZE_EXPAND_FILL);
tree = memnew(SceneTreeEditor(false));
- tree->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO );
- tree->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- tree->set_begin( Point2( 15,32) );
- tree->set_end( Point2( 0.5,127 ) );
+ vbc_left->add_margin_child(TTR("Conect To Node:"),tree,true);
- add_child(tree);
- bind_editor = memnew( PropertyEditor );
- bind_editor->set_anchor( MARGIN_RIGHT, ANCHOR_END );
- bind_editor->set_anchor( MARGIN_LEFT, ANCHOR_RATIO );
- bind_editor->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- bind_editor->set_begin( Point2( 0.51,42) );
- bind_editor->set_end( Point2( 15,127 ) );
- bind_editor->get_top_label()->hide();
- add_child(bind_editor);
+ VBoxContainer *vbc_right = memnew( VBoxContainer );
+ main_hb->add_child(vbc_right);
+ vbc_right->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ HBoxContainer *add_bind_hb = memnew( HBoxContainer );
type_list = memnew( OptionButton );
- type_list->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO );
- type_list->set_anchor( MARGIN_LEFT, ANCHOR_RATIO );
- type_list->set_begin( Point2( 0.51,32) );
- type_list->set_end( Point2( 0.75,33 ) );
- add_child(type_list);
+ type_list->set_h_size_flags(SIZE_EXPAND_FILL);
+ add_bind_hb->add_child(type_list);
type_list->add_item("bool",Variant::BOOL);
@@ -356,65 +343,36 @@ ConnectDialog::ConnectDialog() {
type_list->select(0);
Button *add_bind = memnew( Button );
- add_bind->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO );
- add_bind->set_anchor( MARGIN_LEFT, ANCHOR_RATIO );
- add_bind->set_begin( Point2( 0.76,32) );
- add_bind->set_end( Point2( 0.84,33 ) );
+
add_bind->set_text(TTR("Add"));
- add_child(add_bind);
+ add_bind_hb->add_child(add_bind);
add_bind->connect("pressed",this,"_add_bind");
Button *del_bind = memnew( Button );
- del_bind->set_anchor( MARGIN_RIGHT, ANCHOR_END );
- del_bind->set_anchor( MARGIN_LEFT, ANCHOR_RATIO );
- del_bind->set_begin( Point2( 0.85,32) );
- del_bind->set_end( Point2( 15,33 ) );
del_bind->set_text(TTR("Remove"));
- add_child(del_bind);
+ add_bind_hb->add_child(del_bind);
del_bind->connect("pressed",this,"_remove_bind");
+ vbc_right->add_margin_child(TTR("Add Extra Call Argument:"),add_bind_hb);
- label = memnew( Label );
- label->set_anchor( MARGIN_TOP, ANCHOR_END );
- label->set_begin( Point2( 8,124) );
- label->set_end( Point2( 15,99) );
- label->set_text(TTR("Path To Node:"));
+ bind_editor = memnew( PropertyEditor );
+ bind_editor->hide_top_label();
- add_child(label);
+ vbc_right->add_margin_child(TTR("Extra Call Arguments:"),bind_editor,true);
- dst_path = memnew(LineEdit);
- dst_path->set_anchor( MARGIN_TOP, ANCHOR_END );
- dst_path->set_anchor( MARGIN_RIGHT, ANCHOR_END );
- dst_path->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- dst_path->set_begin( Point2( 15,105) );
- dst_path->set_end( Point2( 15,80 ) );
- add_child(dst_path);
- label = memnew( Label );
- label->set_anchor( MARGIN_TOP, ANCHOR_END );
- label->set_anchor( MARGIN_RIGHT, ANCHOR_END );
- label->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- label->set_begin( Point2( 8,78 ) );
- label->set_end( Point2( 15,52 ) );
- label->set_text(TTR("Method In Node:"));
- add_child(label);
+ dst_path = memnew(LineEdit);
+ vbc->add_margin_child(TTR("Path to Node:"),dst_path);
HBoxContainer *dstm_hb = memnew( HBoxContainer );
- dstm_hb->set_anchor( MARGIN_TOP, ANCHOR_END );
- dstm_hb->set_anchor( MARGIN_RIGHT, ANCHOR_END );
- dstm_hb->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
- dstm_hb->set_begin( Point2( 15,59) );
- dstm_hb->set_end( Point2( 15,39 ) );
- add_child(dstm_hb);
+ vbc->add_margin_child("Method In Node:",dstm_hb);
dst_method = memnew(LineEdit);
dst_method->set_h_size_flags(SIZE_EXPAND_FILL);
dstm_hb->add_child(dst_method);
-
-
/*dst_method_list = memnew( MenuButton );
dst_method_list->set_text("List..");
dst_method_list->set_anchor( MARGIN_RIGHT, ANCHOR_END );
@@ -567,6 +525,7 @@ void ConnectionsDock::_connect_pressed() {
connect_dialog->edit(node);
connect_dialog->popup_centered_ratio();
+ connect_dialog->set_title(TTR("Connecting Signal:")+" "+signalname);
connect_dialog->set_dst_method("_on_"+midname+"_"+signal);
connect_dialog->set_dst_node(node->get_owner()?node->get_owner():node);
@@ -808,11 +767,58 @@ void ConnectionsDock::_something_selected() {
}
+void ConnectionsDock::_something_activated() {
+
+ TreeItem *item = tree->get_selected();
+
+ if (!item)
+ return;
+
+ if (item->get_parent()==tree->get_root() || item->get_parent()->get_parent()==tree->get_root()) {
+ // a signal - connect
+ String signal=item->get_metadata(0).operator Dictionary()["name"];
+ String midname=node->get_name();
+ for(int i=0;i<midname.length();i++) {
+ CharType c = midname[i];
+ if ((c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='_') {
+ //all good
+ } else if (c==' ') {
+ c='_';
+ } else {
+ midname.remove(i);
+ i--;
+ continue;
+ }
+
+ midname[i]=c;
+ }
+
+ connect_dialog->edit(node);
+ connect_dialog->popup_centered_ratio();
+ connect_dialog->set_dst_method("_on_"+midname+"_"+signal);
+ connect_dialog->set_dst_node(node->get_owner()?node->get_owner():node);
+ } else {
+ // a slot - go to target method
+ Connection c=item->get_metadata(0);
+ ERR_FAIL_COND(c.source!=node); //shouldn't happen but...bugcheck
+
+ if (!c.target)
+ return;
+
+ Ref<Script> script = c.target->get_script();
+
+ if (script.is_valid() && ScriptEditor::get_singleton()->script_go_to_method(script,c.method)) {
+ editor->call("_editor_select",EditorNode::EDITOR_SCRIPT);
+ }
+ }
+}
+
void ConnectionsDock::_bind_methods() {
ObjectTypeDB::bind_method("_connect",&ConnectionsDock::_connect);
ObjectTypeDB::bind_method("_something_selected",&ConnectionsDock::_something_selected);
+ ObjectTypeDB::bind_method("_something_activated",&ConnectionsDock::_something_activated);
ObjectTypeDB::bind_method("_close",&ConnectionsDock::_close);
ObjectTypeDB::bind_method("_connect_pressed",&ConnectionsDock::_connect_pressed);
ObjectTypeDB::bind_method("update_tree",&ConnectionsDock::update_tree);
@@ -865,6 +871,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) {
remove_confirm->connect("confirmed", this,"_remove_confirm");
connect_dialog->connect("connected", this,"_connect");
tree->connect("item_selected", this,"_something_selected");
+ tree->connect("item_activated", this,"_something_activated");
add_constant_override("separation",3*EDSCALE);
}
diff --git a/tools/editor/connections_dialog.h b/tools/editor/connections_dialog.h
index 96ebaf85b0..73f52abc9e 100644
--- a/tools/editor/connections_dialog.h
+++ b/tools/editor/connections_dialog.h
@@ -111,6 +111,7 @@ class ConnectionsDock : public VBoxContainer {
void _close();
void _connect();
void _something_selected();
+ void _something_activated();
UndoRedo *undo_redo;
protected:
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp
index b6137ddac0..5275e1beeb 100644
--- a/tools/editor/create_dialog.cpp
+++ b/tools/editor/create_dialog.cpp
@@ -103,7 +103,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
item->set_selectable(0,false);
} else {
- if (!*to_select && (search_box->get_text()=="" || p_type.findn(search_box->get_text())!=-1)) {
+ if (!*to_select && (search_box->get_text().is_subsequence_ofi(p_type))) {
*to_select=item;
}
@@ -172,7 +172,7 @@ void CreateDialog::_update_search() {
bool found=false;
String type=I->get();
while(type!="" && ObjectTypeDB::is_type(type,base_type) && type!=base_type) {
- if (type.findn(search_box->get_text())!=-1) {
+ if (search_box->get_text().is_subsequence_ofi(type)) {
found=true;
break;
@@ -194,7 +194,7 @@ void CreateDialog::_update_search() {
const Vector<EditorData::CustomType> &ct = EditorNode::get_editor_data().get_custom_types()[type];
for(int i=0;i<ct.size();i++) {
- bool show = search_box->get_text()=="" || ct[i].name.findn(search_box->get_text())!=-1;
+ bool show = search_box->get_text().is_subsequence_ofi(ct[i].name);
if (!show)
continue;
diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp
index a702d3c687..6ad7704815 100644
--- a/tools/editor/dependency_editor.cpp
+++ b/tools/editor/dependency_editor.cpp
@@ -399,6 +399,7 @@ void DependencyRemoveDialog::show(const Vector<String> &to_erase) {
_fill_owners(EditorFileSystem::get_singleton()->get_filesystem());
+
if (exist) {
owners->show();
text->set_text(TTR("The files being removed are required by other resources in order for them to work.\nRemove them anyway? (no undo)"));
@@ -417,6 +418,10 @@ void DependencyRemoveDialog::ok_pressed() {
DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
for (Map<String,TreeItem*>::Element *E=files.front();E;E=E->next()) {
+ if (ResourceCache::has(E->key())) {
+ Resource *res = ResourceCache::get(E->key());
+ res->set_path(""); //clear reference to path
+ }
da->remove(E->key());
EditorFileSystem::get_singleton()->update_file(E->key());
}
diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp
index 185ec17459..e631aad7f6 100644
--- a/tools/editor/editor_file_dialog.cpp
+++ b/tools/editor/editor_file_dialog.cpp
@@ -443,7 +443,7 @@ void EditorFileDialog::update_file_list() {
item_list->set_icon_mode(ItemList::ICON_MODE_TOP);
item_list->set_fixed_column_width(thumbnail_size*3/2);
item_list->set_max_text_lines(2);
- item_list->set_min_icon_size(Size2(thumbnail_size,thumbnail_size));
+ item_list->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size));
if (!has_icon("ResizedFolder","EditorIcons")) {
Ref<ImageTexture> folder = get_icon("FolderBig","EditorIcons");
@@ -475,7 +475,7 @@ void EditorFileDialog::update_file_list() {
item_list->set_max_columns(1);
item_list->set_max_text_lines(1);
item_list->set_fixed_column_width(0);
- item_list->set_min_icon_size(Size2());
+ item_list->set_fixed_icon_size(Size2());
if (preview->get_texture().is_valid())
preview_vb->show();
diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp
index ac9feacd46..0b60db5ee3 100644
--- a/tools/editor/editor_help.cpp
+++ b/tools/editor/editor_help.cpp
@@ -453,7 +453,7 @@ void EditorHelpIndex::_update_class_list() {
String type = E->key();
while(type != "") {
- if (type.findn(filter)!=-1) {
+ if (filter.is_subsequence_ofi(type)) {
if (to_select.empty()) {
to_select = type;
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index d63a010272..2e8bf0f311 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -56,7 +56,7 @@
#include "io/zip_io.h"
#include "io/config_file.h"
#include "animation_editor.h"
-
+#include "io/stream_peer_ssl.h"
// plugins
#include "plugins/sprite_frames_editor_plugin.h"
#include "plugins/texture_region_editor_plugin.h"
@@ -217,7 +217,7 @@ void EditorNode::_notification(int p_what) {
if (p_what==NOTIFICATION_EXIT_TREE) {
editor_data.save_editor_external_data();
-
+ FileAccess::set_file_close_fail_notify_callback(NULL);
log->deinit(); // do not get messages anymore
}
if (p_what==NOTIFICATION_PROCESS) {
@@ -3089,6 +3089,7 @@ void EditorNode::set_addon_plugin_enabled(const String& p_addon,bool p_enabled)
if (!p_enabled) {
EditorPlugin *addon = plugin_addons[p_addon];
+ editor_data.remove_editor_plugin( addon );
memdelete(addon); //bye
plugin_addons.erase(p_addon);
_update_addon_config();
@@ -5137,6 +5138,10 @@ void EditorNode::_dropped_files(const Vector<String>& p_files,int p_screen) {
EditorImportExport::get_singleton()->get_import_plugin(i)->import_from_drop(p_files,cur_path);
}
}
+void EditorNode::_file_access_close_error_notify(const String& p_str) {
+
+ add_io_error("Unable to write to file '"+p_str+"', file in use, locked or lacking permissions.");
+}
void EditorNode::_bind_methods() {
@@ -5232,7 +5237,6 @@ EditorNode::EditorNode() {
SceneState::set_disable_placeholders(true);
editor_initialize_certificates(); //for asset sharing
-
InputDefault *id = Input::get_singleton()->cast_to<InputDefault>();
if (id) {
@@ -6274,7 +6278,7 @@ EditorNode::EditorNode() {
logo->set_texture(gui_base->get_icon("Logo","EditorIcons") );
warning = memnew( AcceptDialog );
- add_child(warning);
+ gui_base->add_child(warning);
@@ -6381,8 +6385,12 @@ EditorNode::EditorNode() {
add_editor_plugin( memnew( CanvasItemEditorPlugin(this) ) );
add_editor_plugin( memnew( SpatialEditorPlugin(this) ) );
add_editor_plugin( memnew( ScriptEditorPlugin(this) ) );
- add_editor_plugin( memnew( AssetLibraryEditorPlugin(this) ) );
+ if (StreamPeerSSL::is_available()) {
+ add_editor_plugin( memnew( AssetLibraryEditorPlugin(this) ) );
+ } else {
+ WARN_PRINT("Asset Library not available, as it requires SSL to work.");
+ }
//more visually meaningful to have this later
raise_bottom_panel_item(AnimationPlayerEditor::singleton);
@@ -6570,6 +6578,7 @@ EditorNode::EditorNode() {
_load_docks();
+ FileAccess::set_file_close_fail_notify_callback(_file_access_close_error_notify);
}
@@ -6577,6 +6586,7 @@ EditorNode::EditorNode() {
EditorNode::~EditorNode() {
+
memdelete( EditorHelp::get_doc_data() );
memdelete(editor_selection);
memdelete(editor_plugins_over);
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 65a5687dce..7023c6c174 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -574,6 +574,7 @@ private:
void _update_addon_config();
+ static void _file_access_close_error_notify(const String& p_str);
protected:
void _notification(int p_what);
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index bf01e02330..0d0008fcb8 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -86,6 +86,10 @@ bool EditorSettings::_set(const StringName& p_name, const Variant& p_value) {
props[p_name].variant=p_value;
else
props[p_name]=VariantContainer(p_value,last_order++);
+
+ if (save_changed_setting) {
+ props[p_name].save=true;
+ }
}
emit_signal("settings_changed");
@@ -126,6 +130,7 @@ struct _EVCSort {
String name;
Variant::Type type;
int order;
+ bool save;
bool operator<(const _EVCSort& p_vcs) const{ return order< p_vcs.order; }
};
@@ -148,15 +153,24 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const {
vc.name=*k;
vc.order=v->order;
vc.type=v->variant.get_type();
+ vc.save=v->save;
+
vclist.insert(vc);
}
for(Set<_EVCSort>::Element *E=vclist.front();E;E=E->next()) {
- int pinfo = PROPERTY_USAGE_STORAGE;
- if (!E->get().name.begins_with("_"))
+ int pinfo = 0;
+ if (E->get().save) {
+ pinfo|=PROPERTY_USAGE_STORAGE;
+ }
+
+ if (!E->get().name.begins_with("_") && !E->get().name.begins_with("projects/")) {
pinfo|=PROPERTY_USAGE_EDITOR;
+ } else {
+ pinfo|=PROPERTY_USAGE_STORAGE; //hiddens must always be saved
+ }
PropertyInfo pi(E->get().type, E->get().name);
pi.usage=pinfo;
@@ -330,6 +344,7 @@ void EditorSettings::create() {
goto fail;
}
+ singleton->save_changed_setting=true;
singleton->config_file_path=config_file_path;
singleton->project_config_path=pcp;
singleton->settings_path=config_path+"/"+config_dir;
@@ -363,6 +378,7 @@ void EditorSettings::create() {
};
singleton = Ref<EditorSettings>( memnew( EditorSettings ) );
+ singleton->save_changed_setting=true;
singleton->config_file_path=config_file_path;
singleton->settings_path=config_path+"/"+config_dir;
singleton->_load_defaults(extra_config);
@@ -975,6 +991,7 @@ EditorSettings::EditorSettings() {
//singleton=this;
last_order=0;
+ save_changed_setting=true;
EditorTranslationList *etl=_editor_translations;
@@ -999,6 +1016,7 @@ EditorSettings::EditorSettings() {
}
_load_defaults();
+ save_changed_setting=false;
}
diff --git a/tools/editor/editor_settings.h b/tools/editor/editor_settings.h
index 60333b5811..d975a7ef86 100644
--- a/tools/editor/editor_settings.h
+++ b/tools/editor/editor_settings.h
@@ -64,7 +64,8 @@ private:
int order;
Variant variant;
bool hide_from_editor;
- VariantContainer(){ order=0; hide_from_editor=false; }
+ bool save;
+ VariantContainer(){ order=0; hide_from_editor=false; save=false;}
VariantContainer(const Variant& p_variant, int p_order) { variant=p_variant; order=p_order; hide_from_editor=false; }
};
@@ -85,6 +86,9 @@ private:
Ref<Resource> clipboard;
+ bool save_changed_setting;
+
+
void _load_defaults(Ref<ConfigFile> p_extra_config = NULL);
void _load_default_text_editor_theme();
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 8d00f2cd8a..4ab5dddef6 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -2147,12 +2147,17 @@ void ScriptEditor::save_all_scripts() {
continue;
Ref<Script> script = ste->get_edited_script();
+ if (script.is_valid())
+ ste->apply_code();
+
if (script->get_path()!="" && script->get_path().find("local://")==-1 &&script->get_path().find("::")==-1) {
//external script, save it
- ste->apply_code();
+
editor->save_resource(script);
//ResourceSaver::save(script->get_path(),script);
+
}
+
}
}
@@ -2273,6 +2278,8 @@ void ScriptEditor::_editor_settings_changed() {
ste->get_text_edit()->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter"));
}
+ ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true));
+
}
void ScriptEditor::_autosave_scripts() {
@@ -2496,6 +2503,51 @@ void ScriptEditor::set_scene_root_script( Ref<Script> p_script ) {
}
}
+bool ScriptEditor::script_go_to_method(Ref<Script> p_script, const String& p_method) {
+
+ Vector<String> functions;
+ bool found=false;
+
+ for (int i=0;i<tab_container->get_child_count();i++) {
+ ScriptTextEditor *current = tab_container->get_child(i)->cast_to<ScriptTextEditor>();
+
+ if (current && current->get_edited_script()==p_script) {
+ functions=current->get_functions();
+ found=true;
+ break;
+ }
+ }
+
+ if (!found) {
+ String errortxt;
+ int line=-1,col;
+ String text=p_script->get_source_code();
+ List<String> fnc;
+
+ if (p_script->get_language()->validate(text,line,col,errortxt,p_script->get_path(),&fnc)) {
+
+ for (List<String>::Element *E=fnc.front();E;E=E->next())
+ functions.push_back(E->get());
+ }
+ }
+
+ String method_search = p_method + ":";
+
+ for (int i=0;i<functions.size();i++) {
+ String function=functions[i];
+
+ if (function.begins_with(method_search)) {
+
+ edit(p_script);
+ int line=function.get_slice(":",1).to_int();
+ _goto_script_line2(line-1);
+ return true;
+ }
+ }
+
+ return false;
+}
+
void ScriptEditor::set_live_auto_reload_running_scripts(bool p_enabled) {
auto_reload_running_scripts=p_enabled;
@@ -2614,8 +2666,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
edit_menu->get_popup()->add_item(TTR("Auto Indent"),EDIT_AUTO_INDENT,KEY_MASK_CMD|KEY_I);
edit_menu->get_popup()->connect("item_pressed", this,"_menu_option");
edit_menu->get_popup()->add_separator();
- edit_menu->get_popup()->add_item(TTR("Reload Tool Script"),FILE_TOOL_RELOAD,KEY_MASK_CMD|KEY_R);
- edit_menu->get_popup()->add_item(TTR("Reload Tool Script (Soft)"),FILE_TOOL_RELOAD_SOFT,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_R);
+ edit_menu->get_popup()->add_item(TTR("Soft Reload Script"),FILE_TOOL_RELOAD_SOFT,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_R);
search_menu = memnew( MenuButton );
@@ -2919,6 +2970,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) {
script_editor->hide();
EDITOR_DEF("text_editor/auto_reload_scripts_on_external_change",true);
+ ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true));
EDITOR_DEF("text_editor/open_dominant_script_on_scene_change",true);
EDITOR_DEF("external_editor/use_external_editor",false);
EDITOR_DEF("external_editor/exec_path","");
@@ -2930,6 +2982,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) {
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"external_editor/exec_path",PROPERTY_HINT_GLOBAL_FILE));
EDITOR_DEF("external_editor/exec_flags","");
+
}
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index 5a9dce759e..3d723adfe9 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -325,6 +325,8 @@ public:
void set_scene_root_script( Ref<Script> p_script );
+ bool script_go_to_method(Ref<Script> p_script, const String& p_method);
+
virtual void edited_scene_changed();
ScriptEditorDebugger *get_debugger() { return debugger; }
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
index 4532e91e1f..4f59287994 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -825,7 +825,7 @@ SpriteFramesEditor::SpriteFramesEditor() {
tree->set_icon_mode(ItemList::ICON_MODE_TOP);
tree->set_fixed_column_width(thumbnail_size*3/2);
tree->set_max_text_lines(2);
- tree->set_max_icon_size(Size2(thumbnail_size,thumbnail_size));
+ tree->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size));
//tree->set_min_icon_size(Size2(thumbnail_size,thumbnail_size));
tree->set_drag_forwarding(this);
diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/tools/editor/plugins/texture_region_editor_plugin.cpp
index b69b0d7a9b..57db19b736 100644
--- a/tools/editor/plugins/texture_region_editor_plugin.cpp
+++ b/tools/editor/plugins/texture_region_editor_plugin.cpp
@@ -43,6 +43,8 @@ void TextureRegionEditor::_region_draw()
base_tex = node_patch9->get_texture();
else if(node_type == "StyleBoxTexture" && obj_styleBox)
base_tex = obj_styleBox->get_texture();
+ else if(node_type == "AtlasTexture" && atlas_tex)
+ base_tex = atlas_tex->get_atlas();
if (base_tex.is_null())
return;
@@ -164,6 +166,8 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input)
drag=true;
if(node_type == "Sprite" && node_sprite )
rect_prev=node_sprite->get_region_rect();
+ else if(node_type == "AtlasTexture" && atlas_tex)
+ rect_prev=atlas_tex->get_region();
else if(node_type == "Patch9Frame" && node_patch9)
rect_prev=node_patch9->get_region_rect();
else if(node_type == "StyleBoxTexture" && obj_styleBox)
@@ -191,10 +195,18 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input)
undo_redo->add_do_method(node_sprite ,"set_region_rect",node_sprite->get_region_rect());
undo_redo->add_undo_method(node_sprite,"set_region_rect",rect_prev);
}
+ else if(node_type == "AtlasTexture" && atlas_tex ){
+ undo_redo->add_do_method(atlas_tex ,"set_region",atlas_tex->get_region());
+ undo_redo->add_undo_method(atlas_tex,"set_region",rect_prev);
+ }
else if(node_type == "Patch9Frame" && node_patch9){
undo_redo->add_do_method(node_patch9 ,"set_region_rect",node_patch9->get_region_rect());
undo_redo->add_undo_method(node_patch9,"set_region_rect",rect_prev);
}
+ else if(node_type == "StyleBoxTexture" && obj_styleBox){
+ undo_redo->add_do_method(obj_styleBox ,"set_region_rect",obj_styleBox->get_region_rect());
+ undo_redo->add_undo_method(obj_styleBox,"set_region_rect",rect_prev);
+ }
undo_redo->add_do_method(edit_draw,"update");
undo_redo->add_undo_method(edit_draw,"update");
undo_redo->commit_action();
@@ -355,6 +367,8 @@ void TextureRegionEditor::apply_rect(const Rect2& rect){
node_patch9->set_region_rect(rect);
else if(obj_styleBox)
obj_styleBox->set_region_rect(rect);
+ else if(atlas_tex)
+ atlas_tex->set_region(rect);
}
else if(this->editing_region == REGION_PATCH_MARGIN) {
if(node_patch9) {
@@ -387,10 +401,11 @@ void TextureRegionEditor::_notification(int p_what)
void TextureRegionEditor::_node_removed(Object *p_obj)
{
- if(p_obj == node_sprite || p_obj == node_patch9 || p_obj == obj_styleBox) {
- node_patch9 = NULL;
- node_sprite = NULL;
+ if(p_obj == node_sprite || p_obj == node_patch9 || p_obj == obj_styleBox || p_obj == atlas_tex) {
+ node_patch9 = NULL;
+ node_sprite = NULL;
obj_styleBox = NULL;
+ atlas_tex = NULL;
hide();
}
}
@@ -421,30 +436,42 @@ void TextureRegionEditor::edit(Object *p_obj)
node_sprite = p_obj->cast_to<Sprite>();
node_patch9 = NULL;
obj_styleBox = NULL;
+ atlas_tex = NULL;
+ }
+ else if(node_type == "AtlasTexture") {
+ atlas_tex = p_obj->cast_to<AtlasTexture>();
+ node_sprite = NULL;
+ node_patch9 = NULL;
+ obj_styleBox = NULL;
}
else if(node_type == "Patch9Frame") {
node_patch9 = p_obj->cast_to<Patch9Frame>();
node_sprite = NULL;
obj_styleBox = NULL;
+ atlas_tex = NULL;
margin_button->show();
}
else if(node_type == "StyleBoxTexture") {
obj_styleBox = p_obj->cast_to<StyleBoxTexture>();
node_sprite = NULL;
node_patch9 = NULL;
+ atlas_tex = NULL;
margin_button->show();
}
p_obj->connect("exit_tree",this,"_node_removed",varray(p_obj),CONNECT_ONESHOT);
} else {
if(node_sprite)
node_sprite->disconnect("exit_tree",this,"_node_removed");
+ else if(atlas_tex)
+ atlas_tex->disconnect("exit_tree",this,"_node_removed");
else if(node_patch9)
node_patch9->disconnect("exit_tree",this,"_node_removed");
else if(obj_styleBox)
obj_styleBox->disconnect("exit_tree",this,"_node_removed");
- node_sprite = NULL;
- node_patch9 = NULL;
+ node_sprite = NULL;
+ node_patch9 = NULL;
obj_styleBox = NULL;
+ atlas_tex = NULL;
}
}
@@ -469,6 +496,8 @@ void TextureRegionEditor::_edit_node(int region)
texture = node_patch9->get_texture();
else if(node_type == "StyleBoxTexture" && obj_styleBox)
texture = obj_styleBox->get_texture();
+ else if(node_type == "AtlasTexture" && atlas_tex)
+ texture = atlas_tex->get_atlas();
if (texture.is_null()) {
error->set_text(TTR("No texture in this node.\nSet a texture to be able to edit region."));
@@ -482,6 +511,8 @@ void TextureRegionEditor::_edit_node(int region)
tex_region = node_patch9->get_region_rect();
else if(node_type == "StyleBoxTexture" && obj_styleBox)
tex_region = obj_styleBox->get_region_rect();
+ else if(node_type == "AtlasTexture" && atlas_tex)
+ tex_region = atlas_tex->get_region();
rect = tex_region;
if(region == REGION_PATCH_MARGIN) {
@@ -521,6 +552,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
{
node_sprite = NULL;
node_patch9 = NULL;
+ atlas_tex = NULL;
editor=p_editor;
undo_redo = editor->get_undo_redo();
@@ -661,7 +693,7 @@ void TextureRegionEditorPlugin::edit(Object *p_node)
bool TextureRegionEditorPlugin::handles(Object *p_obj) const
{
- return p_obj->is_type("Sprite") || p_obj->is_type("Patch9Frame") || p_obj->is_type("StyleBoxTexture");
+ return p_obj->is_type("Sprite") || p_obj->is_type("Patch9Frame") || p_obj->is_type("StyleBoxTexture") || p_obj->is_type("AtlasTexture");
}
void TextureRegionEditorPlugin::make_visible(bool p_visible)
diff --git a/tools/editor/plugins/texture_region_editor_plugin.h b/tools/editor/plugins/texture_region_editor_plugin.h
index 951b11e1e6..1e4888b06d 100644
--- a/tools/editor/plugins/texture_region_editor_plugin.h
+++ b/tools/editor/plugins/texture_region_editor_plugin.h
@@ -38,6 +38,7 @@
#include "scene/2d/sprite.h"
#include "scene/gui/patch_9_frame.h"
#include "scene/resources/style_box.h"
+#include "scene/resources/texture.h"
class TextureRegionEditor : public HBoxContainer {
@@ -82,6 +83,7 @@ class TextureRegionEditor : public HBoxContainer {
Patch9Frame *node_patch9;
Sprite *node_sprite;
StyleBoxTexture *obj_styleBox;
+ AtlasTexture *atlas_tex;
int editing_region;
Rect2 rect;
diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp
index 37cb0398e7..2673948365 100644
--- a/tools/editor/plugins/theme_editor_plugin.cpp
+++ b/tools/editor/plugins/theme_editor_plugin.cpp
@@ -583,6 +583,7 @@ ThemeEditor::ThemeEditor() {
add_child(panel);
panel->set_area_as_parent_rect(0);
panel->set_margin(MARGIN_TOP,25);
+ panel->set_theme(Theme::get_default());
main_vb= memnew( VBoxContainer );
panel->add_child(main_vb);
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp
index 6d5f2a519c..5a40777665 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.cpp
+++ b/tools/editor/plugins/tile_map_editor_plugin.cpp
@@ -208,9 +208,14 @@ void TileMapEditor::_update_palette() {
palette->set_max_columns(0);
palette->add_constant_override("hseparation", 6);
+
+ float min_size = EDITOR_DEF("tile_map/preview_size",64);
+ palette->set_fixed_icon_size(Size2(min_size, min_size));
+ palette->set_fixed_column_width(min_size*3/2);
palette->set_icon_mode(ItemList::ICON_MODE_TOP);
palette->set_max_text_lines(2);
+
String filter = search_box->get_text().strip_edges();
for (List<int>::Element *E=tiles.front();E;E=E->next()) {
@@ -1434,6 +1439,7 @@ void TileMapEditorPlugin::make_visible(bool p_visible) {
TileMapEditorPlugin::TileMapEditorPlugin(EditorNode *p_node) {
+ EDITOR_DEF("tile_map/preview_size",64);
tile_map_editor = memnew( TileMapEditor(p_node) );
add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE, tile_map_editor);
tile_map_editor->hide();
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp
index c00bd0ab37..419f05f2cf 100644
--- a/tools/editor/project_manager.cpp
+++ b/tools/editor/project_manager.cpp
@@ -39,7 +39,7 @@
#include "scene/gui/line_edit.h"
#include "scene/gui/panel_container.h"
#include "scene/gui/center_container.h"
-
+#include "io/stream_peer_ssl.h"
#include "scene/gui/texture_frame.h"
#include "scene/gui/margin_container.h"
@@ -986,10 +986,14 @@ ProjectManager::ProjectManager() {
tree_vb->add_spacer();
+ if (StreamPeerSSL::is_available()) {
- asset_library = memnew( EditorAssetLibrary(true) );
- asset_library->set_name("Templates");
- tabs->add_child(asset_library);
+ asset_library = memnew( EditorAssetLibrary(true) );
+ asset_library->set_name("Templates");
+ tabs->add_child(asset_library);
+ } else {
+ WARN_PRINT("Asset Library not available, as it requires SSL to work.");
+ }
CenterContainer *cc = memnew( CenterContainer );
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 2f0ba2da99..763734f035 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -1963,6 +1963,13 @@ bool PropertyEditor::_is_property_different(const Variant& p_current, const Vari
return false;
}
+ if (p_current.get_type()==Variant::REAL && p_orig.get_type()==Variant::REAL) {
+ float a = p_current;
+ float b = p_orig;
+
+ return Math::abs(a-b)>CMP_EPSILON; //this must be done because, as some scenes save as text, there might be a tiny difference in floats due to numerical error
+ }
+
return bool(Variant::evaluate(Variant::OP_NOT_EQUAL,p_current,p_orig));
}
@@ -2232,6 +2239,7 @@ void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) {
if (_get_instanced_node_original_property(p_name,vorig) || usage) {
Variant v = obj->get(p_name);
+
bool changed = _is_property_different(v,vorig,usage);
//if ((found!=-1 && !is_disabled)!=changed) {
@@ -2804,7 +2812,7 @@ void PropertyEditor::update_tree() {
if (capitalize_paths)
cat = cat.capitalize();
- if (cat.findn(filter)==-1 && name.findn(filter)==-1)
+ if (!filter.is_subsequence_ofi(cat) && !filter.is_subsequence_ofi(name))
continue;
}
diff --git a/tools/editor/quick_open.cpp b/tools/editor/quick_open.cpp
index 72059c264f..fc2a2241ab 100644
--- a/tools/editor/quick_open.cpp
+++ b/tools/editor/quick_open.cpp
@@ -126,7 +126,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd) {
path+="/";
if (path!="res://") {
path=path.substr(6,path.length());
- if (path.findn(search_box->get_text())!=-1) {
+ if (search_box->get_text().is_subsequence_ofi(path)) {
TreeItem *ti = search_options->create_item(root);
ti->set_text(0,path);
Ref<Texture> icon = get_icon("folder","FileDialog");
@@ -138,7 +138,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd) {
String file = efsd->get_file_path(i);
file=file.substr(6,file.length());
- if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_box->get_text()=="" || file.findn(search_box->get_text())!=-1)) {
+ if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_box->get_text().is_subsequence_ofi(file))) {
TreeItem *ti = search_options->create_item(root);
ti->set_text(0,file);
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 9612305a0f..5124505b90 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -201,6 +201,7 @@ static String _get_name_num_separator() {
return " ";
}
+
void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
current_option=p_tool;
@@ -519,6 +520,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
EditorNode::get_singleton()->push_item(mne.ptr());
} break;
+
case TOOL_ERASE: {
List<Node*> remove_list = editor_selection->get_selected_node_list();
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index f8ce121690..2de6fc5cf2 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -94,6 +94,29 @@ void SceneTreeEditor::_subscene_option(int p_idx) {
case SCENE_MENU_CLEAR_INHERITANCE: {
clear_inherit_confirm->popup_centered_minsize();
} break;
+ case SCENE_MENU_CLEAR_INSTANCING: {
+
+ Node*root=EditorNode::get_singleton()->get_edited_scene();
+ if (!root)
+ break;
+
+
+ ERR_FAIL_COND(node->get_filename()==String());
+
+ undo_redo->create_action("Discard Instancing");
+
+ undo_redo->add_do_method(node,"set_filename","");
+ undo_redo->add_undo_method(node,"set_filename",node->get_filename());
+
+ _node_replace_owner(node,node,root);
+
+ undo_redo->add_do_method(this,"update_tree");
+ undo_redo->add_undo_method(this,"update_tree");
+
+ undo_redo->commit_action();
+
+
+ } break;
case SCENE_MENU_OPEN_INHERITED: {
if (node && node->get_scene_inherited_state().is_valid()) {
emit_signal("open",node->get_scene_inherited_state()->get_path());
@@ -108,11 +131,30 @@ void SceneTreeEditor::_subscene_option(int p_idx) {
} break;
+
}
}
+void SceneTreeEditor::_node_replace_owner(Node* p_base,Node* p_node,Node* p_root) {
+
+ if (p_base!=p_node) {
+
+ if (p_node->get_owner()==p_base) {
+
+ undo_redo->add_do_method(p_node,"set_owner",p_root);
+ undo_redo->add_undo_method(p_node,"set_owner",p_base);
+ }
+ }
+
+ for(int i=0;i<p_node->get_child_count();i++) {
+
+ _node_replace_owner(p_base,p_node->get_child(i),p_root);
+ }
+}
+
+
void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id) {
TreeItem *item=p_item->cast_to<TreeItem>();
@@ -386,7 +428,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) {
item->set_as_cursor(0);
}
- bool keep= ( filter==String() || String(p_node->get_name()).to_lower().find(filter.to_lower())!=-1 );
+ bool keep= (filter.is_subsequence_ofi(String(p_node->get_name())));
for (int i=0;i<p_node->get_child_count();i++) {
@@ -606,7 +648,7 @@ void SceneTreeEditor::_notification(int p_what) {
get_tree()->connect("node_removed",this,"_node_removed");
get_tree()->connect("node_configuration_warning_changed",this,"_warning_changed");
- instance_menu->set_item_icon(3,get_icon("Load","EditorIcons"));
+ instance_menu->set_item_icon(5,get_icon("Load","EditorIcons"));
tree->connect("item_collapsed",this,"_cell_collapsed");
inheritance_menu->set_item_icon(2,get_icon("Load","EditorIcons"));
clear_inherit_confirm->connect("confirmed",this,"_subscene_option",varray(SCENE_MENU_CLEAR_INHERITANCE_CONFIRM));
@@ -1109,6 +1151,8 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open
instance_menu->add_check_item(TTR("Editable Children"),SCENE_MENU_EDITABLE_CHILDREN);
instance_menu->add_check_item(TTR("Load As Placeholder"),SCENE_MENU_USE_PLACEHOLDER);
instance_menu->add_separator();
+ instance_menu->add_item(TTR("Discard Instancing"),SCENE_MENU_CLEAR_INSTANCING);
+ instance_menu->add_separator();
instance_menu->add_item(TTR("Open in Editor"),SCENE_MENU_OPEN);
instance_menu->connect("item_pressed",this,"_subscene_option");
add_child(instance_menu);
diff --git a/tools/editor/scene_tree_editor.h b/tools/editor/scene_tree_editor.h
index ae0afa32ec..e184891200 100644
--- a/tools/editor/scene_tree_editor.h
+++ b/tools/editor/scene_tree_editor.h
@@ -61,6 +61,7 @@ class SceneTreeEditor : public Control {
SCENE_MENU_CLEAR_INHERITANCE,
SCENE_MENU_OPEN_INHERITED,
SCENE_MENU_CLEAR_INHERITANCE_CONFIRM,
+ SCENE_MENU_CLEAR_INSTANCING,
};
Tree *tree;
@@ -117,6 +118,7 @@ class SceneTreeEditor : public Control {
void _node_visibility_changed(Node *p_node);
void _subscene_option(int p_idx);
+ void _node_replace_owner(Node* p_base,Node* p_node,Node* p_root);
void _selection_changed();
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index 7c61e3d4a1..44832c84eb 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -454,8 +454,7 @@ void ScenesDock::_update_files(bool p_keep_selection) {
files->set_icon_mode(ItemList::ICON_MODE_TOP);
files->set_fixed_column_width(thumbnail_size*3/2);
files->set_max_text_lines(2);
- files->set_min_icon_size(Size2(thumbnail_size,thumbnail_size));
- files->set_max_icon_size(Size2(thumbnail_size,thumbnail_size));
+ files->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size));
if (!has_icon("ResizedFolder","EditorIcons")) {
Ref<ImageTexture> folder = get_icon("FolderBig","EditorIcons");
@@ -485,7 +484,7 @@ void ScenesDock::_update_files(bool p_keep_selection) {
files->set_max_columns(1);
files->set_max_text_lines(1);
files->set_fixed_column_width(0);
- files->set_min_icon_size(Size2());
+ files->set_fixed_icon_size(Size2());
}
@@ -1052,6 +1051,7 @@ void ScenesDock::_file_option(int p_option) {
if (path.ends_with("/") || !files->is_selected(i))
continue;
torem.push_back(path);
+
}
if (torem.empty()) {
diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp
index 37a90ba7be..6d8f54d88f 100644
--- a/tools/editor/script_editor_debugger.cpp
+++ b/tools/editor/script_editor_debugger.cpp
@@ -1731,15 +1731,17 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){
docontinue->set_tooltip(TTR("Continue"));
docontinue->connect("pressed",this,"debug_continue");
- hbc->add_child( memnew( VSeparator) );
+ //hbc->add_child( memnew( VSeparator) );
back = memnew( Button );
hbc->add_child(back);
back->set_tooltip(TTR("Inspect Previous Instance"));
+ back->hide();
forward = memnew( Button );
hbc->add_child(forward);
forward->set_tooltip(TTR("Inspect Next Instance"));
+ forward->hide();
HSplitContainer *sc = memnew( HSplitContainer );
diff --git a/tools/translations/ko.po b/tools/translations/ko.po
index 489e3a6b12..2a6ee8e06f 100644
--- a/tools/translations/ko.po
+++ b/tools/translations/ko.po
@@ -207,13 +207,12 @@ msgstr ""
"SampleLibrary 리소스를 생성하거나, 지정해야합니다."
#: scene/3d/sprite_3d.cpp
-#, fuzzy
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
"order for AnimatedSprite3D to display frames."
msgstr ""
-"AnimatedSprite이 프레임을 보여주기 위해서는 'Frames' 속성에 SpriteFrames 리소"
-"스 만들거나 지정해야 합니다."
+"AnimatedSprite3D가 프레임을 보여주기 위해서는 'Frames' 속성에 SpriteFrames 리"
+"소스 만들거나 지정해야 합니다."
#: scene/gui/dialogs.cpp tools/editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Cancel"
@@ -251,24 +250,20 @@ msgid "Open"
msgstr "열기"
#: scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Open a File"
-msgstr "샘플 파일 열기"
+msgstr "파일 열기"
#: scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Open File(s)"
-msgstr "샘플 파일 열기"
+msgstr "파일 열기"
#: scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Open a Directory"
-msgstr "디렉토리 선택"
+msgstr "디렉토리 열기"
#: scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Open a File or Directory"
-msgstr "디렉토리 선택"
+msgstr "디렉토리 또는 파일 열기"
#: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp
#: tools/editor/editor_node.cpp
@@ -332,7 +327,7 @@ msgstr "알트+"
#: scene/gui/input_action.cpp
msgid "Ctrl+"
-msgstr ""
+msgstr "컨트롤+"
#: scene/gui/input_action.cpp tools/editor/project_settings.cpp
#: tools/editor/settings_config_dialog.cpp
@@ -797,22 +792,20 @@ msgid "Site:"
msgstr "사이트:"
#: tools/editor/asset_library_editor_plugin.cpp
-#, fuzzy
msgid "Support.."
-msgstr "내보내기.."
+msgstr "지원.."
#: tools/editor/asset_library_editor_plugin.cpp
msgid "Official"
-msgstr ""
+msgstr "공식"
#: tools/editor/asset_library_editor_plugin.cpp
msgid "Community"
-msgstr ""
+msgstr "커뮤니티"
#: tools/editor/asset_library_editor_plugin.cpp
-#, fuzzy
msgid "Testing"
-msgstr "설정"
+msgstr "테스팅"
#: tools/editor/asset_library_editor_plugin.cpp
msgid "Assets ZIP File"
@@ -1005,9 +998,8 @@ msgid "Disconnect"
msgstr "연결해제"
#: tools/editor/connections_dialog.cpp tools/editor/node_dock.cpp
-#, fuzzy
msgid "Signals"
-msgstr "시그널:"
+msgstr "시그널"
#: tools/editor/create_dialog.cpp
msgid "Create New"
@@ -1200,7 +1192,7 @@ msgstr "상속한 클래스:"
#: tools/editor/editor_help.cpp
msgid "Brief Description:"
-msgstr "짧은 설명:"
+msgstr "간단한 설명:"
#: tools/editor/editor_help.cpp
msgid "Public Methods:"
@@ -1267,9 +1259,8 @@ msgid "Setting Up.."
msgstr "설정 중.."
#: tools/editor/editor_log.cpp
-#, fuzzy
msgid " Output:"
-msgstr "출력"
+msgstr "출력:"
#: tools/editor/editor_node.cpp tools/editor/editor_reimport_dialog.cpp
msgid "Re-Importing"
@@ -1382,9 +1373,8 @@ msgid "Copy Params"
msgstr "속성 복사"
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Paste Params"
-msgstr "프레임 붙여넣기"
+msgstr "속성 붙여넣기"
#: tools/editor/editor_node.cpp
#: tools/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -1404,9 +1394,8 @@ msgid "Make Sub-Resources Unique"
msgstr "하위 리소스를 유일하게 만들기"
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Open in Help"
-msgstr "씬 열기"
+msgstr "도움말에서 열기"
#: tools/editor/editor_node.cpp
msgid "There is no defined scene to run."
@@ -1417,6 +1406,8 @@ msgid ""
"No main scene has ever been defined.\n"
"Select one from \"Project Settings\" under the 'application' category."
msgstr ""
+"메인 씬이 지정되지 않았습니다.\n"
+"\"프로젝트 설정\"의 'Application' 항목에서 씬을 하나 선택해 주세요."
#: tools/editor/editor_node.cpp
msgid "Current scene was never saved, please save it prior to running."
@@ -1535,9 +1526,8 @@ msgid "Save Layout"
msgstr "레이아웃 저장"
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Load Layout"
-msgstr "레이아웃 저장"
+msgstr "레이아웃 로드"
#: tools/editor/editor_node.cpp tools/editor/project_export.cpp
msgid "Default"
@@ -1601,9 +1591,8 @@ msgid "Open Recent"
msgstr "최근 열었던 항목"
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Quick Filter Files.."
-msgstr "빠른 파일 검색.."
+msgstr "빠른 파일 필터링.."
#: tools/editor/editor_node.cpp
msgid "Convert To.."
@@ -1675,9 +1664,8 @@ msgid "Export"
msgstr "내보내기"
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Play the project."
-msgstr "프로젝트 실행 (F5)."
+msgstr "프로젝트 실행."
#: tools/editor/editor_node.cpp
#: tools/editor/plugins/sample_library_editor_plugin.cpp
@@ -1689,14 +1677,12 @@ msgid "Pause the scene"
msgstr "씬 일시 정지"
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Pause Scene"
msgstr "씬 일시 정지"
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Stop the scene."
-msgstr "씬 정지 (F8)."
+msgstr "씬 정지"
#: tools/editor/editor_node.cpp
#: tools/editor/plugins/sample_library_editor_plugin.cpp
@@ -1704,14 +1690,12 @@ msgid "Stop"
msgstr "정지"
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Play the edited scene."
-msgstr "편집 중인 씬 실행 (F6)."
+msgstr "편집 중인 씬 실행"
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Play Scene"
-msgstr "씬 저장"
+msgstr "씬 실행"
#: tools/editor/editor_node.cpp
msgid "Play custom scene"
@@ -1722,7 +1706,6 @@ msgid "Debug options"
msgstr "디버그 옵션"
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Deploy with Remote Debug"
msgstr "원격 디버그 배포"
@@ -1731,10 +1714,12 @@ msgid ""
"When exporting or deploying, the resulting executable will attempt to connect "
"to the IP of this computer in order to be debugged."
msgstr ""
+"내보내기나 배포를 할 때, 실행 파일이 디버깅을 위해서 이 컴퓨터의 IP로 연결을 "
+"시도합니다."
#: tools/editor/editor_node.cpp
msgid "Small Deploy with Network FS"
-msgstr ""
+msgstr "네트워크 파일 시스템을 갖는 작은 배포"
#: tools/editor/editor_node.cpp
msgid ""
@@ -1745,6 +1730,11 @@ msgid ""
"On Android, deploy will use the USB cable for faster performance. This option "
"speeds up testing for games with a large footprint."
msgstr ""
+"이 옵션이 활성화 되어 있을 경우, 내보내기나 배포는 최소한의 실행파일을 생성합"
+"니다.\n"
+"파일 시스템은 네트워크를 통해서 에디터 상의 프로젝트가 제공합니다.\n"
+"안드로이드의 경우, USB 케이블을 사용하여 배포할 경우 더 빠른 퍼포먼스를 제공합"
+"니다. 이 옵션은 큰 설치 용량을 요구하는 게임의 테스트를 빠르게 할 수 있습니다."
#: tools/editor/editor_node.cpp
msgid "Visible Collision Shapes"
@@ -1755,6 +1745,8 @@ msgid ""
"Collision shapes and raycast nodes (for 2D and 3D) will be visible on the "
"running game if this option is turned on."
msgstr ""
+"이 옵션이 활성화 되어 있을 경우, 게임이 실행되는 동안 (2D와 3D의) 충돌 모양과 "
+"Raycast 노드가 표시됩니다."
#: tools/editor/editor_node.cpp
msgid "Visible Navigation"
@@ -1765,10 +1757,12 @@ msgid ""
"Navigation meshes and polygons will be visible on the running game if this "
"option is turned on."
msgstr ""
+"이 옵션이 활성화 되어 있을 경우, 게임이 실행되는 동안 네비게이션 메쉬가 표시됩"
+"니다."
#: tools/editor/editor_node.cpp
msgid "Sync Scene Changes"
-msgstr ""
+msgstr "씬 변경사항 동기화"
#: tools/editor/editor_node.cpp
msgid ""
@@ -1777,11 +1771,14 @@ msgid ""
"When used remotely on a device, this is more efficient with network "
"filesystem."
msgstr ""
+"이 옵션이 활성화 되어 있을 경우, 에디터상의 씬의 변경사항이 실행중인 게임에 반"
+"영됩니다.\n"
+"기기에 원격으로 사용되는 경우, 네트워크 파일 시스템과 함께하면 더욱 효과적입니"
+"다."
#: tools/editor/editor_node.cpp
-#, fuzzy
msgid "Sync Script Changes"
-msgstr "변경사항만 갱신"
+msgstr "스크립트 변경사항 동기화"
#: tools/editor/editor_node.cpp
msgid ""
@@ -1790,6 +1787,10 @@ msgid ""
"When used remotely on a device, this is more efficient with network "
"filesystem."
msgstr ""
+"이 옵션이 활성화 되어 있을 경우, 스크립트를 수정하고 저장하면 실행중인 게임에"
+"서 다시 읽어 들입니다.\n"
+"기기에 원격으로 사용되는 경우, 네트워크 파일 시스템과 함께하면 더욱 효과적입니"
+"다."
#: tools/editor/editor_node.cpp tools/editor/plugins/spatial_editor_plugin.cpp
msgid "Settings"
@@ -2051,9 +2052,8 @@ msgid "Imported Resources"
msgstr "가져온 리소스"
#: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
-#, fuzzy
msgid "No bit masks to import!"
-msgstr "가져올 항목이 없습니다!"
+msgstr "가져올 비트 마스크가 없습니다!"
#: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
#: tools/editor/io_plugins/editor_sample_import_plugin.cpp
@@ -2083,9 +2083,8 @@ msgid "Save path is empty!"
msgstr "저장 경로가 없습니다!"
#: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
-#, fuzzy
msgid "Import BitMasks"
-msgstr "텍스쳐 가져오기"
+msgstr "비트마스크 가져오기"
#: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
#: tools/editor/io_plugins/editor_texture_import_plugin.cpp
@@ -2112,7 +2111,7 @@ msgstr "수락"
#: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
msgid "Bit Mask"
-msgstr ""
+msgstr "비트 마스크"
#: tools/editor/io_plugins/editor_font_import_plugin.cpp
msgid "No source font file!"
@@ -2623,18 +2622,16 @@ msgid "MultiNode Set"
msgstr "다중 노드 설정"
#: tools/editor/node_dock.cpp
-#, fuzzy
msgid "Node"
-msgstr "믹스 노드"
+msgstr "노드"
#: tools/editor/node_dock.cpp
-#, fuzzy
msgid "Groups"
-msgstr "그룹:"
+msgstr "그룹"
#: tools/editor/node_dock.cpp
msgid "Select a Node to edit Signals and Groups."
-msgstr ""
+msgstr "시그널과 그룹을 편집할 노드를 선택하세요."
#: tools/editor/plugins/animation_player_editor_plugin.cpp
msgid "Toggle Autoplay"
@@ -3944,13 +3941,12 @@ msgid "Auto Indent"
msgstr "자동 들여쓰기"
#: tools/editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Reload Tool Script"
-msgstr "노드 스크립트 생성"
+msgstr "툴 스크립트 다시 로드"
#: tools/editor/plugins/script_editor_plugin.cpp
msgid "Reload Tool Script (Soft)"
-msgstr ""
+msgstr "툴 스크립트 다시 로드 (소프트)"
#: tools/editor/plugins/script_editor_plugin.cpp
#: tools/editor/plugins/shader_editor_plugin.cpp
@@ -4607,20 +4603,20 @@ msgid "StyleBox Preview:"
msgstr "StyleBox 미리보기:"
#: tools/editor/plugins/texture_region_editor_plugin.cpp
-#, fuzzy
msgid "Texture Region Editor"
-msgstr "Sprite 구역 편집기"
+msgstr "텍스쳐 구역 편집기"
#: tools/editor/plugins/texture_region_editor_plugin.cpp
-#, fuzzy
msgid "Scale Region Editor"
-msgstr "Sprite 구역 편집기"
+msgstr "스케일 구역 편집기"
#: tools/editor/plugins/texture_region_editor_plugin.cpp
msgid ""
"No texture in this node.\n"
"Set a texture to be able to edit region."
msgstr ""
+"이 노드에 텍스쳐가 없습니다.\n"
+"구역을 편집하기 위해서는 텍스쳐를 지정해야합니다."
#: tools/editor/plugins/theme_editor_plugin.cpp
msgid "Can't save theme to file:"
@@ -5142,14 +5138,12 @@ msgstr ""
"목록에서 프로젝트를 제거하시겠습니까? (폴더와 파일들은 남아있게 됩니다.)"
#: tools/editor/project_manager.cpp
-#, fuzzy
msgid "Project Manager"
-msgstr "프로젝트 명:"
+msgstr "프로젝트 매니저"
#: tools/editor/project_manager.cpp
-#, fuzzy
msgid "Project List"
-msgstr "종료하고 프로젝트 목록으로 돌아가기"
+msgstr "프로젝트 목록"
#: tools/editor/project_manager.cpp
msgid "Run"
@@ -5302,14 +5296,12 @@ msgid "Invalid name. Must not collide with an existing global constant name."
msgstr "유효하지 않은 이름입니다. 전역 상수 이름과 충돌하지 않아야 합니다."
#: tools/editor/project_settings.cpp
-#, fuzzy
msgid "Autoload '%s' already exists!"
-msgstr "'%s' 액션이 이미 존재합니다!"
+msgstr "자동로드에 '%s'이(가) 이미 존재합니다!"
#: tools/editor/project_settings.cpp
-#, fuzzy
msgid "Rename Autoload"
-msgstr "자동 로드 삭제"
+msgstr "자동 로드 이름 변경"
#: tools/editor/project_settings.cpp
msgid "Toggle AutoLoad Globals"
@@ -5832,9 +5824,8 @@ msgid "View Owners.."
msgstr "소유자 보기.."
#: tools/editor/scenes_dock.cpp
-#, fuzzy
msgid "Copy Path"
-msgstr "속성 복사"
+msgstr "경로 복사"
#: tools/editor/scenes_dock.cpp
msgid "Rename or Move.."
@@ -6074,7 +6065,7 @@ msgstr "트리로부터 설정"
#: tools/editor/settings_config_dialog.cpp
msgid "Shortcuts"
-msgstr ""
+msgstr "단축키"
#: tools/editor/spatial_editor_gizmos.cpp
msgid "Change Light Radius"