Browse Source

Merge pull request #19251 from YeldhamDev/script_templates_changes

Small changes to the comments in the script templates
Max Hilbrunner 7 years ago
parent
commit
0705eb904a

+ 1 - 1
editor/plugins/script_editor_plugin.cpp

@@ -2884,7 +2884,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
 
 	error_dialog = memnew(AcceptDialog);
 	add_child(error_dialog);
-	error_dialog->get_ok()->set_text(TTR("I see.."));
+	error_dialog->get_ok()->set_text(TTR("I see..."));
 
 	debugger = memnew(ScriptEditorDebugger(editor));
 	debugger->connect("goto_script_line", this, "_goto_script_line");

+ 12 - 12
modules/gdscript/gdscript_editor.cpp

@@ -54,18 +54,18 @@ void GDScriptLanguage::get_string_delimiters(List<String> *p_delimiters) const {
 }
 Ref<Script> GDScriptLanguage::get_template(const String &p_class_name, const String &p_base_class_name) const {
 
-	String _template = String() +
-					   "extends %BASE%\n\n" +
-					   "# class member variables go here, for example:\n" +
-					   "# var a = 2\n" +
-					   "# var b = \"textvar\"\n\n" +
-					   "func _ready():\n" +
-					   "%TS%# Called when the node is added to the scene for the first time.\n" +
-					   "%TS%# Initialization here.\n" +
-					   "%TS%pass\n\n" +
-					   "#func _process(delta):\n" +
-					   "#%TS%# Called every frame. Delta is time since last frame.\n" +
-					   "#%TS%# Update game logic here.\n" +
+	String _template = "extends %BASE%\n"
+					   "\n"
+					   "# Declare member variables here. Examples:\n"
+					   "# var a = 2\n"
+					   "# var b = \"text\"\n"
+					   "\n"
+					   "# Called when the node enters the scene tree for the first time.\n"
+					   "func _ready():\n"
+					   "%TS%pass # Replace with function body.\n"
+					   "\n"
+					   "# Called every frame. 'delta' is the elapsed time since the previous frame.\n"
+					   "#func _process(delta):\n"
 					   "#%TS%pass\n";
 
 	_template = _template.replace("%BASE%", p_base_class_name);

+ 6 - 8
modules/mono/csharp_script.cpp

@@ -298,22 +298,20 @@ Ref<Script> CSharpLanguage::get_template(const String &p_class_name, const Strin
 							 "\n"
 							 "public class %CLASS_NAME% : %BASE_CLASS_NAME%\n"
 							 "{\n"
-							 "    // Member variables here, example:\n"
+							 "    // Declare member variables here. Examples:\n"
 							 "    // private int a = 2;\n"
-							 "    // private string b = \"textvar\";\n"
+							 "    // private string b = \"text\";\n"
 							 "\n"
+							 "    // Called when the node enters the scene tree for the first time."
 							 "    public override void _Ready()\n"
 							 "    {\n"
-							 "        // Called every time the node is added to the scene.\n"
-							 "        // Initialization here.\n"
-							 "        \n"
+							 "        "
 							 "    }\n"
 							 "\n"
+							 "//    // Called every frame. 'delta' is the elapsed time since the previous frame."
 							 "//    public override void _Process(float delta)\n"
 							 "//    {\n"
-							 "//        // Called every frame. Delta is time since last frame.\n"
-							 "//        // Update game logic here.\n"
-							 "//        \n"
+							 "//        "
 							 "//    }\n"
 							 "}\n";