From 8c1731b67995add31361ae526b0e6af76346181e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 15 Feb 2014 21:16:33 -0300 Subject: -project settings are saved when changed -load() was in the GDScript docs but missing in the scripting-different music for platformer 2D and 3D -fix how documentation is generated, built in doc browser should be always up to date -copypaste, scrolling, etc in builtin doc -built-in scripts get saved now (though debugger may not always work on them) -Theme can be set to controls as a property --- script/gdscript/gd_script.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'script/gdscript/gd_script.cpp') diff --git a/script/gdscript/gd_script.cpp b/script/gdscript/gd_script.cpp index 891cede03..5679e1e06 100644 --- a/script/gdscript/gd_script.cpp +++ b/script/gdscript/gd_script.cpp @@ -1524,21 +1524,21 @@ bool GDScript::_get(const StringName& p_name,Variant &r_ret) const { top=top->_base; } - return false; - } + if (p_name==GDScriptLanguage::get_singleton()->strings._script_source) { + r_ret=get_source_code(); + return true; + } + } - if (p_name=="script/source") { - r_ret=get_source_code(); - } - return true; + return false; } bool GDScript::_set(const StringName& p_name, const Variant& p_value) { - if (p_name=="script/source") { + if (p_name==GDScriptLanguage::get_singleton()->strings._script_source) { set_source_code(p_value); reload(); @@ -2115,6 +2115,7 @@ GDScriptLanguage::GDScriptLanguage() { strings._set= StaticCString::create("_set"); strings._get= StaticCString::create("_get"); strings._get_property_list= StaticCString::create("_get_property_list"); + strings._script_source=StaticCString::create("script/source"); _debug_parse_err_line=-1; _debug_parse_err_file=""; -- cgit v1.2.3-70-g09d2