Godot template repository for my programs
godot4 edition
bendn 2023-05-18
parent 9c9e2b0 · commit ee2c1b9
-rw-r--r--.github/workflows/export.yml4
-rw-r--r--.gitignore2
-rw-r--r--Main.tscn2
-rw-r--r--README.md2
-rw-r--r--autoloads/CLI.gd16
-rw-r--r--export_presets.cfg233
-rw-r--r--godot.lock13
-rw-r--r--godot.package4
-rwxr-xr-xinstall_addons.sh8
-rw-r--r--project.godot11
10 files changed, 124 insertions, 171 deletions
diff --git a/.github/workflows/export.yml b/.github/workflows/export.yml
index 064575f..512781f 100644
--- a/.github/workflows/export.yml
+++ b/.github/workflows/export.yml
@@ -17,11 +17,11 @@ jobs: # the things to do
export: # a thing to do
uses: bend-n/godot-actions/.github/workflows/callable-export.yml@main
with: # variables
- image: ghcr.io/bend-n/godot-2d:3.5 # the container to use
+ image: ghcr.io/bend-n/godot-2d:4.0.2 # the container to use (remove the `-2d` if 3d)
export-name: ${{ github.event.repository.name }} # the name of the exec. ($export-name.exe)
platforms: "windows linux web android mac" # space seperated list of platforms to build
project-root-path: "." # the directory that project.godot is in
- github-pages: "true" # to deploy to github pages or not (anything besides 'true' == false)
+ github-pages: "true" # to deploy html build to github pages or not (anything besides 'true' == false)
itch-path: "${{ github.repository_owner }}/${{ github.event.repository.name }}" # required for itch.io deployment.
secrets: # secrets
butler-api-key: ${{ secrets.BUTLER_CREDENTIALS }} # required for itch.io deployment
diff --git a/.gitignore b/.gitignore
index d18ee6c..7136bed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-.import/
+.godot/
logs/
*.sh
*.py
diff --git a/Main.tscn b/Main.tscn
index 70a653e..8deb8d9 100644
--- a/Main.tscn
+++ b/Main.tscn
@@ -1,3 +1,3 @@
-[gd_scene format=2]
+[gd_scene format=3 uid="uid://dcttfm6g668of"]
[node name="Main" type="Node2D"]
diff --git a/README.md b/README.md
index 1f8ea92..4544805 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# godot-template
-[![version](https://img.shields.io/badge/3.x-blue?logo=godot-engine&logoColor=white&label=godot&style=for-the-badge)](https://godotengine.org "Made with godot")
+[![version](https://img.shields.io/badge/4.x-blue?logo=godot-engine&logoColor=white&label=godot&style=for-the-badge)](https://godotengine.org "Made with godot")
<a href='https://ko-fi.com/bendn' title='Buy me a coffee' target='_blank'><img height='28' src='https://storage.ko-fi.com/cdn/brandasset/kofi_button_red.png' alt='Buy me a coffee'> </a>
Godot template repository for my programs
diff --git a/autoloads/CLI.gd b/autoloads/CLI.gd
index 095bfd3..0ab5e40 100644
--- a/autoloads/CLI.gd
+++ b/autoloads/CLI.gd
@@ -1,11 +1,11 @@
extends Node
func _ready() -> void:
- var p := Parser.new()
- p.add_argument(Arg.new({triggers=["-h", "--help", "-?"], help="show this help message and exit", action="store_true"}))
- var args = p.parse_arguments()
- if args == null:
- get_tree().quit()
- elif args.get("help", false):
- print(p.help())
- get_tree().quit() \ No newline at end of file
+ var p := Parser.new()
+ p.add_argument(Arg.new({triggers=["-h", "--help", "-?"], help="show this help message and exit", action="store_true"}))
+ var args = p.parse_arguments(OS.get_cmdline_args() + OS.get_cmdline_user_args())
+ if args == null:
+ get_tree().quit()
+ elif args.get("help", false):
+ print(p.help())
+ get_tree().quit()
diff --git a/export_presets.cfg b/export_presets.cfg
index 8a19f81..b1492fa 100644
--- a/export_presets.cfg
+++ b/export_presets.cfg
@@ -3,36 +3,38 @@
name="Windows"
platform="Windows Desktop"
runnable=true
+dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
-script_export_mode=1
-script_encryption_key=""
+encryption_include_filters=""
+encryption_exclude_filters=""
+encrypt_pck=false
+encrypt_directory=false
[preset.0.options]
custom_template/debug=""
custom_template/release=""
-binary_format/64_bits=true
+debug/export_console_script=1
binary_format/embed_pck=true
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
-texture_format/no_bptc_fallbacks=true
+binary_format/architecture="x86_64"
codesign/enable=false
-codesign/identity_type=0
-codesign/identity=""
-codesign/password=""
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
-codesign/custom_options=PoolStringArray( )
+codesign/custom_options=PackedStringArray()
application/modify_resources=true
application/icon=""
+application/console_wrapper_icon=""
+application/icon_interpolation=4
application/file_version=""
application/product_version=""
application/company_name=""
@@ -40,179 +42,98 @@ application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""
+ssh_remote_deploy/enabled=false
+ssh_remote_deploy/host="user@host_ip"
+ssh_remote_deploy/port="22"
+ssh_remote_deploy/extra_args_ssh=""
+ssh_remote_deploy/extra_args_scp=""
+ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
+$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
+$trigger = New-ScheduledTaskTrigger -Once -At 00:00
+$settings = New-ScheduledTaskSettingsSet
+$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
+Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
+Start-ScheduledTask -TaskName godot_remote_debug
+while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
+Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
+ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
+Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
+Remove-Item -Recurse -Force '{temp_dir}'"
[preset.1]
name="Linux"
platform="Linux/X11"
runnable=true
+dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
-script_export_mode=1
-script_encryption_key=""
+encryption_include_filters=""
+encryption_exclude_filters=""
+encrypt_pck=false
+encrypt_directory=false
[preset.1.options]
custom_template/debug=""
custom_template/release=""
-binary_format/64_bits=true
+debug/export_console_script=1
binary_format/embed_pck=true
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
-texture_format/no_bptc_fallbacks=true
+binary_format/architecture="x86_64"
+ssh_remote_deploy/enabled=false
+ssh_remote_deploy/host="user@host_ip"
+ssh_remote_deploy/port="22"
+ssh_remote_deploy/extra_args_ssh=""
+ssh_remote_deploy/extra_args_scp=""
+ssh_remote_deploy/run_script="#!/usr/bin/env bash
+export DISPLAY=:0
+unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
+\"{temp_dir}/{exe_name}\" {cmd_args}"
+ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
+kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
+rm -rf \"{temp_dir}\""
[preset.2]
-name="HTML"
-platform="HTML5"
-runnable=true
-custom_features=""
-export_filter="all_resources"
-include_filter=""
-exclude_filter=""
-export_path=""
-script_export_mode=1
-script_encryption_key=""
-
-[preset.2.options]
-
-custom_template/debug=""
-custom_template/release=""
-variant/export_type=0
-vram_texture_compression/for_desktop=true
-vram_texture_compression/for_mobile=false
-html/export_icon=true
-html/custom_html_shell="res://html/custom.html"
-html/head_include=""
-html/canvas_resize_policy=2
-html/focus_canvas_on_start=true
-html/experimental_virtual_keyboard=true
-progressive_web_app/enabled=false
-progressive_web_app/offline_page=""
-progressive_web_app/display=1
-progressive_web_app/orientation=0
-progressive_web_app/icon_144x144=""
-progressive_web_app/icon_180x180=""
-progressive_web_app/icon_512x512=""
-progressive_web_app/background_color=Color( 0, 0, 0, 1 )
-
-[preset.3]
-
-name="Mac"
-platform="Mac OSX"
-runnable=true
-custom_features=""
-export_filter="all_resources"
-include_filter=""
-exclude_filter=""
-export_path=""
-script_export_mode=1
-script_encryption_key=""
-
-[preset.3.options]
-
-custom_template/debug=""
-custom_template/release=""
-application/name=""
-application/info=""
-application/icon=""
-application/identifier="bendn.game"
-application/signature=""
-application/app_category="Games"
-application/short_version="1.0"
-application/version="1.0"
-application/copyright=""
-display/high_res=false
-privacy/microphone_usage_description=""
-privacy/camera_usage_description=""
-privacy/location_usage_description=""
-privacy/address_book_usage_description=""
-privacy/calendar_usage_description=""
-privacy/photos_library_usage_description=""
-privacy/desktop_folder_usage_description=""
-privacy/documents_folder_usage_description=""
-privacy/downloads_folder_usage_description=""
-privacy/network_volumes_usage_description=""
-privacy/removable_volumes_usage_description=""
-codesign/enable=true
-codesign/identity=""
-codesign/timestamp=true
-codesign/hardened_runtime=true
-codesign/replace_existing_signature=true
-codesign/entitlements/custom_file=""
-codesign/entitlements/allow_jit_code_execution=false
-codesign/entitlements/allow_unsigned_executable_memory=false
-codesign/entitlements/allow_dyld_environment_variables=false
-codesign/entitlements/disable_library_validation=false
-codesign/entitlements/audio_input=false
-codesign/entitlements/camera=false
-codesign/entitlements/location=false
-codesign/entitlements/address_book=false
-codesign/entitlements/calendars=false
-codesign/entitlements/photos_library=false
-codesign/entitlements/apple_events=false
-codesign/entitlements/debugging=false
-codesign/entitlements/app_sandbox/enabled=false
-codesign/entitlements/app_sandbox/network_server=false
-codesign/entitlements/app_sandbox/network_client=false
-codesign/entitlements/app_sandbox/device_usb=false
-codesign/entitlements/app_sandbox/device_bluetooth=false
-codesign/entitlements/app_sandbox/files_downloads=0
-codesign/entitlements/app_sandbox/files_pictures=0
-codesign/entitlements/app_sandbox/files_music=0
-codesign/entitlements/app_sandbox/files_movies=0
-codesign/custom_options=PoolStringArray( )
-notarization/enable=false
-notarization/apple_id_name=""
-notarization/apple_id_password=""
-notarization/apple_team_id=""
-texture_format/s3tc=true
-texture_format/etc=false
-texture_format/etc2=false
-
-[preset.4]
-
name="Android"
platform="Android"
runnable=true
+dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
-script_export_mode=1
-script_encryption_key=""
+encryption_include_filters=""
+encryption_exclude_filters=""
+encrypt_pck=false
+encrypt_directory=false
-[preset.4.options]
+[preset.2.options]
custom_template/debug=""
custom_template/release=""
-custom_build/use_custom_build=false
-custom_build/export_format=0
-custom_build/min_sdk=""
-custom_build/target_sdk=""
+gradle_build/use_gradle_build=false
+gradle_build/export_format=0
+gradle_build/min_sdk=""
+gradle_build/target_sdk=""
architectures/armeabi-v7a=true
architectures/arm64-v8a=false
architectures/x86=false
architectures/x86_64=false
-keystore/debug=""
-keystore/debug_user=""
-keystore/debug_password=""
-keystore/release=""
-keystore/release_user=""
-keystore/release_password=""
-one_click_deploy/clear_previous_install=false
version/code=1
version/name="1.0"
package/unique_name="org.bendn.$genname"
package/name=""
package/signed=true
-package/classify_as_game=true
+package/app_category=2
package/retain_data_on_uninstall=false
package/exclude_from_recents=false
launcher_icons/main_192x192=""
@@ -233,7 +154,7 @@ command_line/extra_args=""
apk_expansion/enable=false
apk_expansion/SALT=""
apk_expansion/public_key=""
-permissions/custom_permissions=PoolStringArray( )
+permissions/custom_permissions=PackedStringArray()
permissions/access_checkin_properties=false
permissions/access_coarse_location=false
permissions/access_fine_location=false
@@ -380,3 +301,41 @@ permissions/write_sms=false
permissions/write_social_stream=false
permissions/write_sync_settings=false
permissions/write_user_dictionary=false
+
+[preset.3]
+
+name="Web"
+platform="Web"
+runnable=true
+dedicated_server=false
+custom_features=""
+export_filter="all_resources"
+include_filter=""
+exclude_filter=""
+export_path=""
+encryption_include_filters=""
+encryption_exclude_filters=""
+encrypt_pck=false
+encrypt_directory=false
+
+[preset.3.options]
+
+custom_template/debug=""
+custom_template/release=""
+variant/extensions_support=false
+vram_texture_compression/for_desktop=true
+vram_texture_compression/for_mobile=false
+html/export_icon=true
+html/custom_html_shell=""
+html/head_include=""
+html/canvas_resize_policy=2
+html/focus_canvas_on_start=true
+html/experimental_virtual_keyboard=false
+progressive_web_app/enabled=false
+progressive_web_app/offline_page=""
+progressive_web_app/display=1
+progressive_web_app/orientation=0
+progressive_web_app/icon_144x144=""
+progressive_web_app/icon_180x180=""
+progressive_web_app/icon_512x512=""
+progressive_web_app/background_color=Color(0, 0, 0, 1)
diff --git a/godot.lock b/godot.lock
index 51fd93a..7a9f8a6 100644
--- a/godot.lock
+++ b/godot.lock
@@ -1,6 +1,7 @@
-{
- "@bendn/gdcli": {
- "version": "1.2.5",
- "integrity": "sha512-/YOAd1+K4JlKvPTmpX8B7VWxGtFrxKq4R0A6u5qOaaVPK6uGsl4dGZaIHpxuqcurEcwPEOabkoShXKZaOXB0lw=="
- }
-} \ No newline at end of file
+[
+ {
+ "name": "@bendn/gdcli",
+ "tarball": "https://registry.npmjs.org/@bendn/gdcli/-/gdcli-2.0.1.tgz",
+ "version": "2.0.1"
+ }
+] \ No newline at end of file
diff --git a/godot.package b/godot.package
index 8c2d29a..b445ace 100644
--- a/godot.package
+++ b/godot.package
@@ -1,5 +1,5 @@
{
"packages": {
- "@bendn/gdcli": "1.2.5"
+ "@bendn/gdcli": "^2"
}
-} \ No newline at end of file
+}
diff --git a/install_addons.sh b/install_addons.sh
index 98a3ef2..2e86be0 100755
--- a/install_addons.sh
+++ b/install_addons.sh
@@ -1,8 +1,2 @@
#!/usr/bin/env bash
-
-rm -rf addons && mkdir addons
-git clone --depth 1 https://github.com/you-win/godot-package-manager
-mv godot-package-manager/addons/godot-package-manager addons/
-rm -rf godot-package-manager
-godot -s --no-window addons/godot-package-manager/cli.gd update
-rm -rf addons/godot-package-manager
+godot-package-manager update || gpm update || echo "please install the gpm at https://github.com/godot-package-manager/cli/releases/latest"
diff --git a/project.godot b/project.godot
index 663e841..5d739ae 100644
--- a/project.godot
+++ b/project.godot
@@ -6,9 +6,9 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
-config_version=4
+config_version=5
-_global_script_classes=[ {
+_global_script_classes=[{
"base": "Reference",
"class": "Arg",
"language": "GDScript",
@@ -18,7 +18,7 @@ _global_script_classes=[ {
"class": "Parser",
"language": "GDScript",
"path": "res://addons/gdcli/Parser.gd"
-} ]
+}]
_global_script_class_icons={
"Arg": "",
"Parser": ""
@@ -30,6 +30,7 @@ config/name="Godot Template"
run/main_scene="res://Main.tscn"
config/use_custom_user_dir=true
config/custom_user_dir_name="GodotTemplate"
+config/features=PackedStringArray("4.1")
[autoload]
@@ -41,13 +42,11 @@ gdscript/warnings/return_value_discarded=false
[display]
+window/stretch/mode="2d"
window/size/width=320
window/size/height=180
window/size/test_width=1280
window/size/test_height=720
-window/dpi/allow_hidpi=true
-window/stretch/mode="2d"
-window/stretch/aspect="keep"
[logging]