From 87c7c247f13cbcea1f5401abaa0ceda60dc8106b Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 19 Jan 2025 13:48:19 +0100 Subject: [PATCH 1/5] feat: added template module --- engine/modules/PROJECT/SCsub | 3 +++ engine/modules/PROJECT/register_types.cpp | 15 +++++++++++++++ engine/modules/PROJECT/register_types.h | 9 +++++++++ 3 files changed, 27 insertions(+) create mode 100644 engine/modules/PROJECT/SCsub create mode 100644 engine/modules/PROJECT/register_types.cpp create mode 100644 engine/modules/PROJECT/register_types.h diff --git a/engine/modules/PROJECT/SCsub b/engine/modules/PROJECT/SCsub new file mode 100644 index 0000000..2760ab7 --- /dev/null +++ b/engine/modules/PROJECT/SCsub @@ -0,0 +1,3 @@ +Import('env') + +env.add_source_files(env.modules_sources, "*.cpp") diff --git a/engine/modules/PROJECT/register_types.cpp b/engine/modules/PROJECT/register_types.cpp new file mode 100644 index 0000000..a367b16 --- /dev/null +++ b/engine/modules/PROJECT/register_types.cpp @@ -0,0 +1,15 @@ +#include "register_types.h" + +#include "core/object/class_db.h" + +void initialize_PROJECT_module(ModuleInitializationLevel p_level) { + if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { + return; + } +} + +void uninitialize_PROJECT_module(ModuleInitializationLevel p_level) { + if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { + return; + } +} diff --git a/engine/modules/PROJECT/register_types.h b/engine/modules/PROJECT/register_types.h new file mode 100644 index 0000000..2a1d025 --- /dev/null +++ b/engine/modules/PROJECT/register_types.h @@ -0,0 +1,9 @@ +#ifndef PROJECT_REGISTER_TYPES_H +#define PROJECT_REGISTER_TYPES_H + +#include "modules/register_module_types.h" + +void initialize_PROJECT_module(ModuleInitializationLevel p_level); +void uninitialize_PROJECT_module(ModuleInitializationLevel p_level); + +#endif // !PROJECT_REGISTER_TYPES_H From a6f4d83112ae9216fb88c7a5d703d2d37d166dec Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 19 Jan 2025 13:48:24 +0100 Subject: [PATCH 2/5] feat: added template project --- project/.gitattributes | 2 ++ project/.gitignore | 3 +++ project/icon.svg | 1 + project/icon.svg.import | 37 +++++++++++++++++++++++++++++++++++++ project/project.godot | 15 +++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 project/.gitattributes create mode 100644 project/.gitignore create mode 100644 project/icon.svg create mode 100644 project/icon.svg.import create mode 100644 project/project.godot diff --git a/project/.gitattributes b/project/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/project/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/project/.gitignore b/project/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/project/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/project/icon.svg b/project/icon.svg new file mode 100644 index 0000000..9d8b7fa --- /dev/null +++ b/project/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/project/icon.svg.import b/project/icon.svg.import new file mode 100644 index 0000000..869157e --- /dev/null +++ b/project/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bwfkmwx6bd5u4" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project/project.godot b/project/project.godot new file mode 100644 index 0000000..a7538ba --- /dev/null +++ b/project/project.godot @@ -0,0 +1,15 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="EXAMPLE" +config/features=PackedStringArray("4.3", "Forward Plus") +config/icon="res://icon.svg" From e000dd0e62ca9c2cd971d6b89b5c53117b1c5bc2 Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 19 Jan 2025 13:48:29 +0100 Subject: [PATCH 3/5] feat: added init.sh --- init.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 init.sh diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..b19cfab --- /dev/null +++ b/init.sh @@ -0,0 +1,4 @@ +#! /bin/sh + +sed -i -e "s/PROJECT/$1/g" ./engine/modules/PROJECT/register_types.h ./engine/modules/PROJECT/register_types.cpp ./project/project.godot +mv -r ./engine/modules/EXAMPLE/ ./engine/modules/$1/ From 25f9a4c4fdc33f0c647f14ae61aaef64a5908f19 Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 19 Jan 2025 14:08:23 +0100 Subject: [PATCH 4/5] fix: template name in project.godot is now correct --- project/project.godot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/project.godot b/project/project.godot index a7538ba..433d88f 100644 --- a/project/project.godot +++ b/project/project.godot @@ -10,6 +10,6 @@ config_version=5 [application] -config/name="EXAMPLE" +config/name="PROJECT" config/features=PackedStringArray("4.3", "Forward Plus") config/icon="res://icon.svg" From 5251e6737e2aa9b1d2ce7b7982b99368381834b6 Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 19 Jan 2025 14:08:41 +0100 Subject: [PATCH 5/5] feat: replace init.sh with justfile --- init.sh | 4 ---- justfile | 10 ++++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) delete mode 100755 init.sh create mode 100644 justfile diff --git a/init.sh b/init.sh deleted file mode 100755 index b19cfab..0000000 --- a/init.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/sh - -sed -i -e "s/PROJECT/$1/g" ./engine/modules/PROJECT/register_types.h ./engine/modules/PROJECT/register_types.cpp ./project/project.godot -mv -r ./engine/modules/EXAMPLE/ ./engine/modules/$1/ diff --git a/justfile b/justfile new file mode 100644 index 0000000..1745394 --- /dev/null +++ b/justfile @@ -0,0 +1,10 @@ +run: build + cd project/ && ../engine/bin/godot.*.editor.x86_64 -e + +build: + cd engine/ && scons + +initialize-template projectname: + sed -i -e "s/PROJECT/{{projectname}}/g" ./engine/modules/PROJECT/register_types.h ./engine/modules/PROJECT/register_types.cpp ./project/project.godot + mv ./engine/modules/PROJECT ./engine/modules/{{projectname}} +