diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/script_language.cpp | 12 | ||||
-rw-r--r-- | core/script_language.h | 4 | ||||
-rw-r--r-- | core/variant_parser.cpp | 3 |
3 files changed, 17 insertions, 2 deletions
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/variant_parser.cpp b/core/variant_parser.cpp index 2e7a9c0bbc..875a144fef 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -1791,8 +1791,9 @@ 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 being written, which may annoy git, svn, etc. for changes when they don't exist. + 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); } |