sokoban
Initial commit
bendn 2022-08-12
commit d5efe19
-rw-r--r--.gitattributes4
-rw-r--r--.github/workflows/export.yml80
-rw-r--r--.gitignore8
-rw-r--r--.gitmodules3
-rw-r--r--Main.tscn3
-rw-r--r--README.md37
l---------addons/gdcli1
-rw-r--r--autoloads/CLI.gd11
-rw-r--r--export_presets.cfg382
-rw-r--r--html/.gdignore0
-rw-r--r--html/custom.html280
-rw-r--r--project.godot63
-rw-r--r--submodules/.gdignore0
m---------submodules/gdcli0
14 files changed, 872 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..a05dc57
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,4 @@
+*.png filter=lfs diff=lfs merge=lfs -text
+*.ogg filter=lfs diff=lfs merge=lfs -text
+*.ttf filter=lfs diff=lfs merge=lfs -text
+*.svg filter=lfs diff=lfs merge=lfs -text
diff --git a/.github/workflows/export.yml b/.github/workflows/export.yml
new file mode 100644
index 0000000..80bc4ec
--- /dev/null
+++ b/.github/workflows/export.yml
@@ -0,0 +1,80 @@
+name: "export"
+on:
+ workflow_dispatch:
+ push:
+ paths:
+ - "**.gd"
+ - "**.tscn"
+ - "**.import"
+ - "**.tres"
+ - "**.ttf"
+ - "**.yml"
+ branches:
+ - main
+
+env:
+ GODOT_VERSION: 3.5
+ NAME: ${{ github.event.repository.name }}
+
+jobs:
+ export:
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/bend-n/godot-2d:3.5
+ name: ${{ matrix.name }}
+ strategy:
+ matrix:
+ include:
+ - name: Windows export
+ platform: windows
+
+ - name: Linux export
+ platform: linux
+
+ - name: Mac export
+ platform: mac
+
+ - name: Web export
+ platform: web
+
+ - name: Android export
+ platform: android
+
+ steps:
+ - name: Build (Windows)
+ if: matrix.platform == 'windows'
+ uses: bend-n/godot-actions/.github/actions/export-windows@main
+
+ - name: Build (Linux)
+ if: matrix.platform == 'linux'
+ uses: bend-n/godot-actions/.github/actions/export-linux@main
+
+ - name: Build (Mac)
+ if: matrix.platform == 'mac'
+ uses: bend-n/godot-actions/.github/actions/export-mac@main
+
+ - name: Build (Web)
+ if: matrix.platform == 'web'
+ uses: bend-n/godot-actions/.github/actions/export-web@main
+
+ - name: Build (Android)
+ if: matrix.platform == 'android'
+ uses: bend-n/godot-actions/.github/actions/export-android@main
+ with:
+ android-keystore-base64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
+ android-password: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
+
+ push-itch:
+ needs: [export]
+ name: Push to itch.io
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Check for api key
+ id: secret
+ run: echo '::set-output name=secret::${{ secrets.BUTLER_CREDENTIALS }}'
+
+ - name: Push
+ if: steps.secret.outputs.secret
+ uses: bend-n/godot-actions/.github/actions/itch-push@main
+ with:
+ api-key: ${{ secrets.BUTLER_CREDENTIALS }}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5bbe921
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+.import/
+logs/
+*.sh
+*.py
+*.pgn
+.vscode/
+exports/
+*.x86_64
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..68b663d
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "gdcli"]
+ path = submodules/gdcli
+ url = https://github.com/bend-n/gdcli
diff --git a/Main.tscn b/Main.tscn
new file mode 100644
index 0000000..70a653e
--- /dev/null
+++ b/Main.tscn
@@ -0,0 +1,3 @@
+[gd_scene format=2]
+
+[node name="Main" type="Node2D"]
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..7575a7e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,37 @@
+# godot-template
+
+Godot template repository for my programs
+
+---
+
+# How to use
+
+- To use: click use this template button.
+- Clone your repository
+- Add your files
+- Commit
+- Push
+
+<details>
+<summary>For itch.io depoloyment</summary>
+<br>
+Add a secret called BUTLER_CREDENTIALS with your butler api key.
+</details>
+
+<details>
+<summary>For android builds</summary>
+<br>
+Add two secrets:
+ ANDROID_KEYSTORE_BASE64
+ ANDROID_KEYSTORE_PASSWORD
+</details>
+
+---
+
+### Availability:
+
+| windows | ios | linux | android | mac | html | |
+|:------------------:|:---:|:------------------:|:------------------:|:------------------:|:------------------:|:-------------:|
+| :x: | :x: | :x: | :x: | :x: | :heavy_check_mark: | github pages |
+| :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | itch.io |
+| :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | godot exports |
diff --git a/addons/gdcli b/addons/gdcli
new file mode 120000
index 0000000..ac119d8
--- /dev/null
+++ b/addons/gdcli
@@ -0,0 +1 @@
+../submodules/gdcli/addons/gdcli/ \ No newline at end of file
diff --git a/autoloads/CLI.gd b/autoloads/CLI.gd
new file mode 100644
index 0000000..095bfd3
--- /dev/null
+++ b/autoloads/CLI.gd
@@ -0,0 +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
diff --git a/export_presets.cfg b/export_presets.cfg
new file mode 100644
index 0000000..9270cf2
--- /dev/null
+++ b/export_presets.cfg
@@ -0,0 +1,382 @@
+[preset.0]
+
+name="Windows"
+platform="Windows Desktop"
+runnable=true
+custom_features=""
+export_filter="all_resources"
+include_filter=""
+exclude_filter=""
+export_path=""
+script_export_mode=1
+script_encryption_key=""
+
+[preset.0.options]
+
+custom_template/debug=""
+custom_template/release=""
+binary_format/64_bits=true
+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
+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( )
+application/modify_resources=false
+application/icon=""
+application/file_version=""
+application/product_version=""
+application/company_name=""
+application/product_name=""
+application/file_description=""
+application/copyright=""
+application/trademarks=""
+
+[preset.1]
+
+name="Linux"
+platform="Linux/X11"
+runnable=true
+custom_features=""
+export_filter="all_resources"
+include_filter=""
+exclude_filter=""
+export_path=""
+script_export_mode=1
+script_encryption_key=""
+
+[preset.1.options]
+
+custom_template/debug=""
+custom_template/release=""
+binary_format/64_bits=true
+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
+
+[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="Godot Template"
+application/info="Godot Template"
+application/icon=""
+application/identifier="com.godot-template"
+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
+custom_features=""
+export_filter="all_resources"
+include_filter=""
+exclude_filter=""
+export_path=""
+script_export_mode=1
+script_encryption_key=""
+
+[preset.4.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=""
+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.godotengine.$genname"
+package/name=""
+package/signed=true
+package/classify_as_game=true
+package/retain_data_on_uninstall=false
+package/exclude_from_recents=false
+launcher_icons/main_192x192=""
+launcher_icons/adaptive_foreground_432x432=""
+launcher_icons/adaptive_background_432x432=""
+graphics/opengl_debug=false
+xr_features/xr_mode=0
+xr_features/hand_tracking=0
+xr_features/hand_tracking_frequency=0
+xr_features/passthrough=0
+screen/immersive_mode=true
+screen/support_small=true
+screen/support_normal=true
+screen/support_large=true
+screen/support_xlarge=true
+user_data_backup/allow=false
+command_line/extra_args=""
+apk_expansion/enable=false
+apk_expansion/SALT=""
+apk_expansion/public_key=""
+permissions/custom_permissions=PoolStringArray( )
+permissions/access_checkin_properties=false
+permissions/access_coarse_location=false
+permissions/access_fine_location=false
+permissions/access_location_extra_commands=false
+permissions/access_mock_location=false
+permissions/access_network_state=false
+permissions/access_surface_flinger=false
+permissions/access_wifi_state=false
+permissions/account_manager=false
+permissions/add_voicemail=false
+permissions/authenticate_accounts=false
+permissions/battery_stats=false
+permissions/bind_accessibility_service=false
+permissions/bind_appwidget=false
+permissions/bind_device_admin=false
+permissions/bind_input_method=false
+permissions/bind_nfc_service=false
+permissions/bind_notification_listener_service=false
+permissions/bind_print_service=false
+permissions/bind_remoteviews=false
+permissions/bind_text_service=false
+permissions/bind_vpn_service=false
+permissions/bind_wallpaper=false
+permissions/bluetooth=false
+permissions/bluetooth_admin=false
+permissions/bluetooth_privileged=false
+permissions/brick=false
+permissions/broadcast_package_removed=false
+permissions/broadcast_sms=false
+permissions/broadcast_sticky=false
+permissions/broadcast_wap_push=false
+permissions/call_phone=false
+permissions/call_privileged=false
+permissions/camera=false
+permissions/capture_audio_output=false
+permissions/capture_secure_video_output=false
+permissions/capture_video_output=false
+permissions/change_component_enabled_state=false
+permissions/change_configuration=false
+permissions/change_network_state=false
+permissions/change_wifi_multicast_state=false
+permissions/change_wifi_state=false
+permissions/clear_app_cache=false
+permissions/clear_app_user_data=false
+permissions/control_location_updates=false
+permissions/delete_cache_files=false
+permissions/delete_packages=false
+permissions/device_power=false
+permissions/diagnostic=false
+permissions/disable_keyguard=false
+permissions/dump=false
+permissions/expand_status_bar=false
+permissions/factory_test=false
+permissions/flashlight=false
+permissions/force_back=false
+permissions/get_accounts=false
+permissions/get_package_size=false
+permissions/get_tasks=false
+permissions/get_top_activity_info=false
+permissions/global_search=false
+permissions/hardware_test=false
+permissions/inject_events=false
+permissions/install_location_provider=false
+permissions/install_packages=false
+permissions/install_shortcut=false
+permissions/internal_system_window=false
+permissions/internet=false
+permissions/kill_background_processes=false
+permissions/location_hardware=false
+permissions/manage_accounts=false
+permissions/manage_app_tokens=false
+permissions/manage_documents=false
+permissions/manage_external_storage=false
+permissions/master_clear=false
+permissions/media_content_control=false
+permissions/modify_audio_settings=false
+permissions/modify_phone_state=false
+permissions/mount_format_filesystems=false
+permissions/mount_unmount_filesystems=false
+permissions/nfc=false
+permissions/persistent_activity=false
+permissions/process_outgoing_calls=false
+permissions/read_calendar=false
+permissions/read_call_log=false
+permissions/read_contacts=false
+permissions/read_external_storage=false
+permissions/read_frame_buffer=false
+permissions/read_history_bookmarks=false
+permissions/read_input_state=false
+permissions/read_logs=false
+permissions/read_phone_state=false
+permissions/read_profile=false
+permissions/read_sms=false
+permissions/read_social_stream=false
+permissions/read_sync_settings=false
+permissions/read_sync_stats=false
+permissions/read_user_dictionary=false
+permissions/reboot=false
+permissions/receive_boot_completed=false
+permissions/receive_mms=false
+permissions/receive_sms=false
+permissions/receive_wap_push=false
+permissions/record_audio=false
+permissions/reorder_tasks=false
+permissions/restart_packages=false
+permissions/send_respond_via_message=false
+permissions/send_sms=false
+permissions/set_activity_watcher=false
+permissions/set_alarm=false
+permissions/set_always_finish=false
+permissions/set_animation_scale=false
+permissions/set_debug_app=false
+permissions/set_orientation=false
+permissions/set_pointer_speed=false
+permissions/set_preferred_applications=false
+permissions/set_process_limit=false
+permissions/set_time=false
+permissions/set_time_zone=false
+permissions/set_wallpaper=false
+permissions/set_wallpaper_hints=false
+permissions/signal_persistent_processes=false
+permissions/status_bar=false
+permissions/subscribed_feeds_read=false
+permissions/subscribed_feeds_write=false
+permissions/system_alert_window=false
+permissions/transmit_ir=false
+permissions/uninstall_shortcut=false
+permissions/update_device_stats=false
+permissions/use_credentials=false
+permissions/use_sip=false
+permissions/vibrate=false
+permissions/wake_lock=false
+permissions/write_apn_settings=false
+permissions/write_calendar=false
+permissions/write_call_log=false
+permissions/write_contacts=false
+permissions/write_external_storage=false
+permissions/write_gservices=false
+permissions/write_history_bookmarks=false
+permissions/write_profile=false
+permissions/write_secure_settings=false
+permissions/write_settings=false
+permissions/write_sms=false
+permissions/write_social_stream=false
+permissions/write_sync_settings=false
+permissions/write_user_dictionary=false
diff --git a/html/.gdignore b/html/.gdignore
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/html/.gdignore
diff --git a/html/custom.html b/html/custom.html
new file mode 100644
index 0000000..832478b
--- /dev/null
+++ b/html/custom.html
@@ -0,0 +1,280 @@
+<!DOCTYPE html>
+<html xmlns="https://www.w3.org/1999/xhtml" lang="" xml:lang="">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, user-scalable=no" />
+ <title>$GODOT_PROJECT_NAME</title>
+ <style type="text/css">
+ body {
+ touch-action: none;
+ margin: 0;
+ border: 0 none;
+ padding: 0;
+ min-width: 100%;
+ min-height: 100%;
+ text-align: center;
+ background-size: cover;
+ background-repeat: no-repeat;
+ background: linear-gradient(to right, yellow, orange 60%, cyan);
+ }
+
+ #canvas {
+ display: block;
+ margin: 0;
+ color: white;
+ }
+
+ #canvas:focus {
+ outline: none;
+ }
+
+ .godot {
+ font-family: ubuntu;
+ font-weight: bold;
+ color: #e0e0e0;
+ background-color: black;
+ }
+
+ /* Status display
+ * ============== */
+
+ #status {
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ /* don't consume click events - make children visible explicitly */
+ visibility: hidden;
+ }
+
+ #status-progress {
+ width: 600px;
+ height: 50px;
+ background-color: #dcc621;
+ background-image: linear-gradient(to left, cyan, orange 60%, yellow);
+ border: 5px solid black;
+ padding: 3px;
+ border-radius: 30px;
+ visibility: visible;
+ }
+
+ @media only screen and (orientation: portrait) {
+ #status-progress {
+ width: 61.8%;
+ }
+ }
+
+ #status-progress-inner {
+ height: 100%;
+ width: 0;
+ box-sizing: border-box;
+ transition: width 0.5s linear;
+ background-image: linear-gradient(45deg, blue 30%, red);
+ border: 3px solid black;
+ border-radius: 30px;
+ }
+
+ #status-indeterminate {
+ height: 42px;
+ visibility: visible;
+ position: relative;
+ }
+
+ #status-indeterminate > div {
+ width: 4.5px;
+ height: 0;
+ border-style: solid;
+ border-width: 9px 3px 0 3px;
+ border-color: black transparent transparent transparent;
+ transform-origin: center 21px;
+ position: absolute;
+ }
+
+ #status-indeterminate > div:nth-child(1) {
+ transform: rotate(22.5deg);
+ }
+ #status-indeterminate > div:nth-child(2) {
+ transform: rotate(67.5deg);
+ }
+ #status-indeterminate > div:nth-child(3) {
+ transform: rotate(112.5deg);
+ }
+ #status-indeterminate > div:nth-child(4) {
+ transform: rotate(157.5deg);
+ }
+ #status-indeterminate > div:nth-child(5) {
+ transform: rotate(202.5deg);
+ }
+ #status-indeterminate > div:nth-child(6) {
+ transform: rotate(247.5deg);
+ }
+ #status-indeterminate > div:nth-child(7) {
+ transform: rotate(292.5deg);
+ }
+ #status-indeterminate > div:nth-child(8) {
+ transform: rotate(337.5deg);
+ }
+
+ #status-notice {
+ margin: 0 100px;
+ line-height: 1.3;
+ visibility: visible;
+ padding: 4px 6px;
+ visibility: visible;
+ }
+ </style>
+ $GODOT_HEAD_INCLUDE
+ </head>
+ <body>
+ <canvas id="canvas">
+ HTML5 canvas appears to be unsupported in the current browser.<br />
+ Please try updating or use a different browser.
+ </canvas>
+ <div id="status">
+ <div
+ id="status-progress"
+ style="display: none"
+ oncontextmenu="event.preventDefault();"
+ >
+ <div id="status-progress-inner"></div>
+ </div>
+ <div
+ id="status-indeterminate"
+ style="display: none"
+ oncontextmenu="event.preventDefault();"
+ >
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+ <div id="status-notice" class="godot" style="display: none"></div>
+ </div>
+
+ <script type="text/javascript" src="$GODOT_URL"></script>
+ <script type="text/javascript">
+ //<![CDATA[
+
+ const GODOT_CONFIG = $GODOT_CONFIG;
+ var engine = new Engine(GODOT_CONFIG);
+
+ (function () {
+ const INDETERMINATE_STATUS_STEP_MS = 100;
+ var statusProgress = document.getElementById("status-progress");
+ var statusProgressInner = document.getElementById(
+ "status-progress-inner"
+ );
+ var statusIndeterminate = document.getElementById(
+ "status-indeterminate"
+ );
+ var statusNotice = document.getElementById("status-notice");
+
+ var initializing = true;
+ var statusMode = "hidden";
+
+ var animationCallbacks = [];
+ function animate(time) {
+ animationCallbacks.forEach((callback) => callback(time));
+ requestAnimationFrame(animate);
+ }
+ requestAnimationFrame(animate);
+
+ function setStatusMode(mode) {
+ if (statusMode === mode || !initializing) return;
+ [statusProgress, statusIndeterminate, statusNotice].forEach(
+ (elem) => {
+ elem.style.display = "none";
+ }
+ );
+ animationCallbacks = animationCallbacks.filter(function (value) {
+ return value != animateStatusIndeterminate;
+ });
+ switch (mode) {
+ case "progress":
+ statusProgress.style.display = "block";
+ break;
+ case "indeterminate":
+ statusIndeterminate.style.display = "block";
+ animationCallbacks.push(animateStatusIndeterminate);
+ break;
+ case "notice":
+ statusNotice.style.display = "block";
+ break;
+ case "hidden":
+ break;
+ default:
+ throw new Error("Invalid status mode");
+ }
+ statusMode = mode;
+ }
+
+ function animateStatusIndeterminate(ms) {
+ var i = Math.floor((ms / INDETERMINATE_STATUS_STEP_MS) % 8);
+ if (statusIndeterminate.children[i].style.borderTopColor == "") {
+ Array.prototype.slice
+ .call(statusIndeterminate.children)
+ .forEach((child) => {
+ child.style.borderTopColor = "";
+ });
+ statusIndeterminate.children[i].style.borderTopColor = "#dfdfdf";
+ }
+ }
+
+ function setStatusNotice(text) {
+ while (statusNotice.lastChild) {
+ statusNotice.removeChild(statusNotice.lastChild);
+ }
+ var lines = text.split("\n");
+ lines.forEach((line) => {
+ statusNotice.appendChild(document.createTextNode(line));
+ statusNotice.appendChild(document.createElement("br"));
+ });
+ }
+
+ function displayFailureNotice(err) {
+ var msg = err.message || err;
+ console.error(msg);
+ setStatusNotice(msg);
+ setStatusMode("notice");
+ initializing = false;
+ }
+
+ if (!Engine.isWebGLAvailable()) {
+ displayFailureNotice("WebGL not available");
+ } else {
+ setStatusMode("indeterminate");
+ engine
+ .startGame({
+ onProgress: function (current, total) {
+ if (total > 0) {
+ statusProgressInner.style.width =
+ (current / total) * 100 + "%";
+ setStatusMode("progress");
+ if (current === total) {
+ // wait for progress bar animation
+ setTimeout(() => {
+ setStatusMode("indeterminate");
+ }, 500);
+ }
+ } else {
+ setStatusMode("indeterminate");
+ }
+ },
+ })
+ .then(() => {
+ setStatusMode("hidden");
+ initializing = false;
+ }, displayFailureNotice);
+ }
+ })();
+ </script>
+ </body>
+</html>
diff --git a/project.godot b/project.godot
new file mode 100644
index 0000000..663e841
--- /dev/null
+++ b/project.godot
@@ -0,0 +1,63 @@
+; 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=4
+
+_global_script_classes=[ {
+"base": "Reference",
+"class": "Arg",
+"language": "GDScript",
+"path": "res://addons/gdcli/Arg.gd"
+}, {
+"base": "Reference",
+"class": "Parser",
+"language": "GDScript",
+"path": "res://addons/gdcli/Parser.gd"
+} ]
+_global_script_class_icons={
+"Arg": "",
+"Parser": ""
+}
+
+[application]
+
+config/name="Godot Template"
+run/main_scene="res://Main.tscn"
+config/use_custom_user_dir=true
+config/custom_user_dir_name="GodotTemplate"
+
+[autoload]
+
+CLI="*res://autoloads/CLI.gd"
+
+[debug]
+
+gdscript/warnings/return_value_discarded=false
+
+[display]
+
+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]
+
+file_logging/enable_file_logging=true
+
+[rendering]
+
+quality/driver/driver_name="GLES2"
+2d/options/use_nvidia_rect_flicker_workaround=true
+quality/intended_usage/framebuffer_allocation=0
+quality/intended_usage/framebuffer_allocation.mobile=0
+2d/snapping/use_gpu_pixel_snap=true
+vram_compression/import_etc=true
diff --git a/submodules/.gdignore b/submodules/.gdignore
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/submodules/.gdignore
diff --git a/submodules/gdcli b/submodules/gdcli
new file mode 160000
+Subproject 6040364dae05d331f8d6c9d3d52186df1d0399c