Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to use custom script templates. #9158

Merged
merged 1 commit into from Jun 14, 2017

Conversation

27thLiz
Copy link
Member

@27thLiz 27thLiz commented Jun 13, 2017

Templates will be loaded from .godot/script_templates
For now they're disabled for GDNative.

templates

Ideas for further improvements:

  • Supply a bunch of default templates.
  • Add a "Save as Template" option to the script editor, as it can normally only save to res://
  • Support more placeholders / custom placeholders

Fixes #4132

Templates will be loaded from .godot/script_templates
For now they're disabled for GDNative.

Ideas for further improvements:

- Add a "Save as Template" option to the script editor, as it can normally only save to res://
- Support more placeholders / custom placeholders
@bojidar-bg
Copy link
Contributor

@Hinsbart (looking at the screenshot) Shouldn't template names be capitalized? E.g. "no_comments" -> "No Comments".

@27thLiz
Copy link
Member Author

27thLiz commented Jun 14, 2017

@bojidar-bg ah yeah, sounds good

@akien-mga akien-mga merged commit 19017a7 into godotengine:master Jun 14, 2017
@27thLiz 27thLiz deleted the script_templates branch June 15, 2017 12:56
@voOID12
Copy link

voOID12 commented Mar 21, 2020

This would be nice for C# also! 😄

@bojidar-bg
Copy link
Contributor

@voOID12 It is already possible with the followup #12536. Probably you missed it when searching as it mentions "mono" and not "C#" 😃

@voOID12
Copy link

voOID12 commented Mar 21, 2020

@bojidar-bg Yes! just got it to work! Thanks! 😄

Created a minimalistic template with it, found the %CLASS% tag in the source code. God I love open source 😋

using Godot;

public class %CLASS% : %BASE%
{
%TS%
}

@voOID12
Copy link

voOID12 commented Mar 21, 2020

Also just to point out, under Windows, the path to the custom templates are there:

%appdata%/Godot/script_templates

@JRiggles
Copy link

JRiggles commented Sep 8, 2021

For anyone else coming here from a search engine

  • Windows: %APPDATA%\Godot\script_templates\
  • Linux: $HOME/.config/godot/script_templates/
  • macOS: $HOME/Library/Application Support/Godot/script_templates/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Templates for the most basic GDscripts.
5 participants