diff options
Diffstat (limited to 'misc/dist')
-rw-r--r-- | misc/dist/docker/Dockerfile | 13 | ||||
-rw-r--r-- | misc/dist/docker/README.md | 40 | ||||
-rw-r--r-- | misc/dist/docker/scripts/install-android-tools | 90 | ||||
-rw-r--r-- | misc/dist/html/fixed-size.html | 1 | ||||
-rw-r--r-- | misc/dist/html/full-size.html | 1 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_ios/dummy.cpp | 4 | ||||
-rw-r--r-- | misc/dist/linux/godot.6 | 25 | ||||
-rw-r--r-- | misc/dist/linux/org.godotengine.Godot.appdata.xml | 2 | ||||
-rwxr-xr-x | misc/dist/osx_template.app/Contents/Info.plist | 4 | ||||
-rwxr-xr-x | misc/dist/osx_tools.app/Contents/Info.plist | 12 | ||||
-rw-r--r-- | misc/dist/shell/_godot.zsh-completion | 77 | ||||
-rw-r--r-- | misc/dist/shell/godot.bash-completion | 124 |
12 files changed, 236 insertions, 157 deletions
diff --git a/misc/dist/docker/Dockerfile b/misc/dist/docker/Dockerfile deleted file mode 100644 index 428de9d1a7..0000000000 --- a/misc/dist/docker/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM ubuntu:14.04 -MAINTAINER Mohammad Rezai, https://github.com/mrezai -WORKDIR /godot-dev -COPY scripts/install-android-tools /godot-dev/ -ENV DEBIAN_FRONTEND noninteractive -RUN dpkg --add-architecture i386 && \ - apt-get update && \ - apt-get upgrade -y && \ - apt-get install --no-install-recommends -y -q \ - build-essential gcc-multilib g++-multilib mingw32 mingw-w64 scons pkg-config libx11-dev libxcursor-dev \ - libasound2-dev libfreetype6-dev libgl1-mesa-dev libglu-dev libssl-dev libxinerama-dev libudev-dev \ - git wget openjdk-7-jdk libbcprov-java libc6:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386 lib32z1 - diff --git a/misc/dist/docker/README.md b/misc/dist/docker/README.md deleted file mode 100644 index 71aac8a77c..0000000000 --- a/misc/dist/docker/README.md +++ /dev/null @@ -1,40 +0,0 @@ -## A Docker image to build Linux, Windows and Android godot binaries. - -The main reason to write this, is to provide a simple way in all platforms to integrate external godot modules and build a custom version of godot. - -## usage -1. Install docker on Linux or docker toolbox on Windows or Mac. -2. Open a terminal on linux or "Docker Quickstart Terminal" on Windows or Mac. -3. Run command: - - Linux: `cd` - - Windows: `cd /c/Users/YOUR_USERNAME` - - Mac: `cd /Users/YOUR_USERNAME` -4. Get godot source code: `git clone https://github.com/godotengine/godot.git` -5. Run command: `cd godot/tools/docker` -6. Run command: `docker build -t godot .`(In Linux run Docker commands with `sudo` or add your user to docker group before run the Docker commands). The godot docker image will be build after a while. -7. Run command: - - Linux: `docker run -it --name=godot-dev -v /home/YOUR_USERNAME/godot:/godot-dev/godot godot` - - Windows: `docker run -it --name=godot-dev -v /c/Users/YOUR_USERNAME/godot:/godot-dev/godot godot` - - Mac: `docker run -it --name=godot-dev -v /Users/YOUR_USERNAME/godot:/godot-dev/godot godot` - You are in the godot-dev container and /godot-dev directory now. -8. Run `./install-android-tools` to download and install all android development tools. -9. Run command: `source ~/.bashrc` -10. Run command: `cd godot` -11. Run command: `scons p=android target=release` to test everything is ok. You can set platform to x11, windows, android, haiku and server. - -After use and exit, you can use this environment again by open terminal and type commands: `docker start godot-dev && docker attach godot-dev`. - -### Windows and Mac stuffs: - -- Speed up compilation: - - Exit from container. - - Run command: `docker-machine stop` - - Open "Oracle VM VirtualBox". - - In settings of default VM increase CPU cores and RAM to suitable values. - - Run command: `docker-machine start` - - Run command: `docker start godot-dev && docker attach godot-dev` - -- ssh to VM(can be useful sometimes): - - `docker-machine ssh` - -Check docker and boot2docker projects for more details. diff --git a/misc/dist/docker/scripts/install-android-tools b/misc/dist/docker/scripts/install-android-tools deleted file mode 100644 index 8a617d9942..0000000000 --- a/misc/dist/docker/scripts/install-android-tools +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash - -BASH_RC=~/.bashrc -GODOT_BUILD_TOOLS_PATH=/godot-dev/build-tools -mkdir -p $GODOT_BUILD_TOOLS_PATH -cd $GODOT_BUILD_TOOLS_PATH - -ANDROID_BASE_URL=http://dl.google.com/android - -ANDROID_SDK_RELEASE=android-sdk_r24.4.1 -ANDROID_SDK_DIR=android-sdk-linux -ANDROID_SDK_FILENAME=$ANDROID_SDK_RELEASE-linux.tgz -ANDROID_SDK_URL=$ANDROID_BASE_URL/$ANDROID_SDK_FILENAME -ANDROID_SDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_SDK_DIR -ANDROID_SDK_SHA1=725bb360f0f7d04eaccff5a2d57abdd49061326d - -ANDROID_NDK_RELEASE=android-ndk-r10e -ANDROID_NDK_DIR=$ANDROID_NDK_RELEASE -ANDROID_NDK_FILENAME=$ANDROID_NDK_RELEASE-linux-x86_64.bin -ANDROID_NDK_URL=$ANDROID_BASE_URL/ndk/$ANDROID_NDK_FILENAME -ANDROID_NDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_NDK_DIR -ANDROID_NDK_MD5=19af543b068bdb7f27787c2bc69aba7f - -echo -echo "Download and install Android development tools ..." -echo - -if [ ! -e $ANDROID_SDK_FILENAME ]; then - echo "Downloading: Android SDK ..." - wget $ANDROID_SDK_URL -else - echo $ANDROID_SDK_SHA1 $ANDROID_SDK_FILENAME > $ANDROID_SDK_FILENAME.sha1 - sha1sum --check --strict $ANDROID_SDK_FILENAME.sha1 - if [ ! $? -eq 0 ]; then - echo "Downloading: Android SDK ..." - wget $ANDROID_SDK_URL - fi -fi - -if [ ! -d $ANDROID_SDK_DIR ]; then - tar -xvzf $ANDROID_SDK_FILENAME -fi - -if [ ! -e $ANDROID_NDK_FILENAME ]; then - echo "Downloading: Android NDK ..." - wget $ANDROID_NDK_URL -else - echo $ANDROID_NDK_MD5 $ANDROID_NDK_FILENAME > $ANDROID_NDK_FILENAME.md5 - md5sum --check --strict $ANDROID_NDK_FILENAME.md5 - if [ ! $? -eq 0 ]; then - echo "Downloading: Android NDK ..." - wget $ANDROID_NDK_URL - fi -fi - -if [ ! -d $ANDROID_NDK_DIR ]; then - chmod a+x $ANDROID_NDK_FILENAME - ./$ANDROID_NDK_FILENAME - echo -fi - -cd $ANDROID_SDK_DIR/tools -chmod a+x android - -if ! ./android list target | grep -q 'android-19'; then - echo "Installing: Android Tools ..." - echo y | ./android update sdk --no-ui --all --filter "platform-tools,android-19,build-tools-19.1.0,\ - extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository,\ - extra-google-play_apk_expansion,extra-google-play_billing,extra-google-play_licensing" -fi - -EXPORT_VAL="export ANDROID_HOME=$ANDROID_SDK_PATH" -if ! grep -q "^$EXPORT_VAL" $BASH_RC; then - echo $EXPORT_VAL >> ~/.bashrc -fi - - -EXPORT_VAL="export ANDROID_NDK_ROOT=$ANDROID_NDK_PATH" -if ! grep -q "^$EXPORT_VAL" $BASH_RC; then - echo $EXPORT_VAL >> ~/.bashrc -fi - -EXPORT_VAL="export PATH=$PATH:$ANDROID_SDK_PATH/tools" -if ! grep -q "^export PATH=.*$ANDROID_SDK_PATH/tools.*" $BASH_RC; then - echo $EXPORT_VAL >> ~/.bashrc -fi - -echo -echo "Done!" -echo
\ No newline at end of file diff --git a/misc/dist/html/fixed-size.html b/misc/dist/html/fixed-size.html index 1cc6fd715e..6c6a3a5d2d 100644 --- a/misc/dist/html/fixed-size.html +++ b/misc/dist/html/fixed-size.html @@ -2,6 +2,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> <head> <meta charset="utf-8" /> + <link id='-gd-engine-icon' rel='icon' type='image/png' href='favicon.png' /> <title></title> <style type="text/css"> diff --git a/misc/dist/html/full-size.html b/misc/dist/html/full-size.html index 9269227d02..92b65257d4 100644 --- a/misc/dist/html/full-size.html +++ b/misc/dist/html/full-size.html @@ -3,6 +3,7 @@ <head> <meta charset='utf-8' /> <meta name='viewport' content='width=device-width, user-scalable=no' /> + <link id='-gd-engine-icon' rel='icon' type='image/png' href='favicon.png' /> <title></title> <style type='text/css'> diff --git a/misc/dist/ios_xcode/godot_ios/dummy.cpp b/misc/dist/ios_xcode/godot_ios/dummy.cpp index 7b52e926b0..0fcbf227b5 100644 --- a/misc/dist/ios_xcode/godot_ios/dummy.cpp +++ b/misc/dist/ios_xcode/godot_ios/dummy.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/misc/dist/linux/godot.6 b/misc/dist/linux/godot.6 index 4860c7b5a8..00d19c5178 100644 --- a/misc/dist/linux/godot.6 +++ b/misc/dist/linux/godot.6 @@ -1,4 +1,4 @@ -.TH GODOT "6" "March 2019" "godot 3.2" "Games" +.TH GODOT "6" "January 2020" "godot 4.0" "Games" .SH NAME godot \- multi\-platform 2D and 3D game engine with a feature\-rich editor .SH SYNOPSIS @@ -85,6 +85,12 @@ Force low\-DPI mode (macOS and Windows only). .TP \fB\-\-no\-window\fR Disable window creation (Windows only). Useful together with \fB\-\-script\fR. +.TP +\fB\-\-enable\-vsync\-via\-compositor\fR +When vsync is enabled, vsync via the OS' window compositor (Windows only). +.TP +\fB\-\-disable\-vsync\-via\-compositor\fR +Disable vsync via the OS' window compositor (Windows only). .SS "Debug options:" .TP \fB\-d\fR, \fB\-\-debug\fR @@ -130,11 +136,16 @@ Run a script. \fB\-\-check\-only\fR Only parse for errors and quit (use with --script). .TP -\fB\-\-export\fR <target> -Export the project using the given export target. Export only main pack if path ends with .pck or .zip. +\fB\-\-export\fR <preset> <path> +Export the project using the given preset and matching release template. The preset name should match one defined in export_presets.cfg. +.br +<path> should be absolute or relative to the project directory, and include the filename for the binary (e.g. 'builds/game.exe'). The target directory should exist. +.TP +\fB\-\-export\-debug\fR <preset> <path> +Same as \-\-export, but using the debug template. .TP -\fB\-\-export\-debug\fR <target> -Like \-\-export, but use debug template. +\fB\-\-export\-pack\fR <preset> <path> +Same as \-\-export, but only export the game pack for the given preset. The <path> extension determines whether it will be in PCK or ZIP format. .TP \fB\-\-doctool\fR <path> Dump the engine API reference to the given <path> in XML format, merging if existing files are found. @@ -143,7 +154,7 @@ Dump the engine API reference to the given <path> in XML format, merging if exis Disallow dumping the base types (used with \fB\-\-doctool\fR). .TP \fB\-\-build\-solutions\fR -Build the scripting solutions (e.g. for C# projects). +Build the scripting solutions (e.g. for C# projects). Implies \-\-editor and requires a valid project to edit. .TP \fB\-\-gdnative\-generate\-json\-api\fR Generate JSON dump of the Godot API for GDNative bindings. @@ -179,5 +190,5 @@ Godot Engine is a free and open source project and welcomes any kind of contributions. In particular, you can report issues or make suggestions on Godot's issue tracker at \fIhttps://github.com/godotengine/godot/issues\fR. .SH AUTHOR -Man page written by Rémi Verschelde <akien@godotengine.org> on behalf of the +Man page written by Rémi Verschelde <remi@godotengine.org> on behalf of the Godot Engine development team. diff --git a/misc/dist/linux/org.godotengine.Godot.appdata.xml b/misc/dist/linux/org.godotengine.Godot.appdata.xml index 09d5468d70..2b30036006 100644 --- a/misc/dist/linux/org.godotengine.Godot.appdata.xml +++ b/misc/dist/linux/org.godotengine.Godot.appdata.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright 2017-2019 Rémi Verschelde <akien@godotengine.org> --> +<!-- Copyright 2017-2020 Rémi Verschelde <remi@godotengine.org> --> <component type="desktop"> <id>org.godotengine.Godot</id> <metadata_license>CC0-1.0</metadata_license> diff --git a/misc/dist/osx_template.app/Contents/Info.plist b/misc/dist/osx_template.app/Contents/Info.plist index eee787bdaf..696c825594 100755 --- a/misc/dist/osx_template.app/Contents/Info.plist +++ b/misc/dist/osx_template.app/Contents/Info.plist @@ -24,6 +24,10 @@ <string>$signature</string> <key>CFBundleVersion</key> <string>$version</string> + <key>NSMicrophoneUsageDescription</key> + <string>$microphone_usage_description</string> + <key>NSCameraUsageDescription</key> + <string>$camera_usage_description</string> <key>NSHumanReadableCopyright</key> <string>$copyright</string> <key>LSMinimumSystemVersion</key> diff --git a/misc/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist index bb22f1807c..46550ba6c7 100755 --- a/misc/dist/osx_tools.app/Contents/Info.plist +++ b/misc/dist/osx_tools.app/Contents/Info.plist @@ -9,7 +9,7 @@ <key>CFBundleName</key> <string>Godot</string> <key>CFBundleGetInfoString</key> - <string>(c) 2007-2019 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> + <string>(c) 2007-2020 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> <key>CFBundleIconFile</key> <string>Godot.icns</string> <key>CFBundleIdentifier</key> @@ -19,15 +19,19 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>3.2</string> + <string>4.0</string> <key>CFBundleSignature</key> <string>godot</string> <key>CFBundleVersion</key> - <string>3.2</string> + <string>4.0</string> + <key>NSMicrophoneUsageDescription</key> + <string>Microphone access is required to capture audio.</string> + <key>NSCameraUsageDescription</key> + <string>Camera access is required to capture video.</string> <key>NSRequiresAquaSystemAppearance</key> <false /> <key>NSHumanReadableCopyright</key> - <string>© 2007-2019 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> + <string>© 2007-2020 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> <key>LSMinimumSystemVersion</key> <string>10.9.0</string> <key>LSMinimumSystemVersionByArchitecture</key> diff --git a/misc/dist/shell/_godot.zsh-completion b/misc/dist/shell/_godot.zsh-completion new file mode 100644 index 0000000000..4945ecbabc --- /dev/null +++ b/misc/dist/shell/_godot.zsh-completion @@ -0,0 +1,77 @@ +#compdef godot + +# zsh completion for the Godot editor +# To use it, install this file as `_godot` in a directory specified in your +# `fpath` environment variable then restart your shell. +# +# Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. +# Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +_arguments \ + "1::path to scene or 'project.godot' file:_files" \ + '(-h --help)'{-h,--help}'[display the full help message]' \ + '--version[display the version string]' \ + '(-v --verbose)'{-v,--verbose}'[use verbose stdout mode]' \ + '--quiet[quiet mode, silences stdout messages (errors are still displayed)]' \ + '(-e --editor)'{-e,--editor}'[start the editor instead of running the scene]' \ + '(-p --project-manager)'{-p,--project-manager}'[start the project manager, even if a project is auto-detected]' \ + '(-q --quit)'{-q,--quit}'[quit after the first iteration]' \ + '(-l --language)'{-l,--language}'[use a specific locale (<locale> being a two-letter code)]:two-letter locale code' \ + "--path[path to a project (<directory> must contain a 'project.godot' file)]:path to directory with 'project.godot' file:_dirs" \ + '(-u --upwards)'{-u,--upwards}'[scan folders upwards for project.godot file]' \ + '--main-pack[path to a pack (.pck) file to load]:path to .pck file:_files' \ + '--render-thread[set the render thread mode]:render thread mode:(unsafe safe separate)' \ + '--remote-fs[use a remote filesystem]:remote filesystem address' \ + '--remote-fs-password[password for remote filesystem]:remote filesystem password' \ + '--audio-driver[set the audio driver]:audio driver name' \ + "--video-driver[set the video driver]:video driver name:((GLES3\:'OpenGL ES 3.0 renderer' GLES2\:'OpenGL ES 2.0 renderer'))" \ + '(-f --fullscreen)'{-f,--fullscreen}'[request fullscreen mode]' \ + '(-m --maximized)'{-m,--maximized}'[request a maximized window]' \ + '(-w --windowed)'{-w,--windowed}'[request windowed mode]' \ + '(-t --always-on-top)'{-t,--always-on-top}'[request an always-on-top window]' \ + '--resolution[request window resolution]:resolution in WxH format' \ + '--position[request window position]:position in X,Y format' \ + '--low-dpi[force low-DPI mode (macOS and Windows only)]' \ + '--no-window[disable window creation (Windows only), useful together with --script]' \ + "--enable-vsync-via-compositor[when Vsync is enabled, Vsync via the OS' window compositor (Windows only)]" \ + "--disable-vsync-via-compositor[disable Vsync via the OS' window compositor (Windows only)]" \ + '(-d --debug)'{-d,--debug}'[debug (local stdout debugger)]' \ + '(-b --breakpoints)'{-b,--breakpoints}'[specify the breakpoint list as source::line comma-separated pairs, no spaces (use %20 instead)]:breakpoint list' \ + '--profiling[enable profiling in the script debugger]' \ + '--remote-debug[enable remote debugging]:remote debugger address' \ + '--debug-collisions[show collision shapes when running the scene]' \ + '--debug-navigation[show navigation polygons when running the scene]' \ + '--frame-delay[simulate high CPU load (delay each frame by the given number of milliseconds)]:number of milliseconds' \ + '--time-scale[force time scale (higher values are faster, 1.0 is normal speed)]:time scale' \ + '--disable-render-loop[disable render loop so rendering only occurs when called explicitly from script]' \ + '--disable-crash-handler[disable crash handler when supported by the platform code]' \ + '--fixed-fps[force a fixed number of frames per second (this setting disables real-time synchronization)]:frames per second' \ + '--print-fps[print the frames per second to the stdout]' \ + '(-s, --script)'{-s,--script}'[run a script]:path to script:_files' \ + '--check-only[only parse for errors and quit (use with --script)]' \ + '--export[export the project using the given preset and matching release template]:export preset name' \ + '--export-debug[same as --export, but using the debug template]:export preset name' \ + '--export-pack[same as --export, but only export the game pack for the given preset]:export preset name' \ + '--doctool[dump the engine API reference to the given path in XML format, merging if existing files are found]:path to base Godot build directory:_dirs' \ + '--no-docbase[disallow dumping the base types (used with --doctool)]' \ + '--build-solutions[build the scripting solutions (e.g. for C# projects)]' \ + '--gdnative-generate-json-api[generate JSON dump of the Godot API for GDNative bindings]' \ + '--test[run a unit test]:unit test name' diff --git a/misc/dist/shell/godot.bash-completion b/misc/dist/shell/godot.bash-completion new file mode 100644 index 0000000000..714b6758e3 --- /dev/null +++ b/misc/dist/shell/godot.bash-completion @@ -0,0 +1,124 @@ +#!/usr/bin/env bash + +# Bash completion for the Godot editor +# To use it, install this file in `/etc/bash_completion.d` then restart your shell. +# You can also `source` this file directly in your shell startup file. +# +# Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. +# Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +_complete_godot_options() { + # Since Bash doesn't support option descriptions in autocompletion, + # only display long options to be more descriptive. + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W " \ +--help +--version +--verbose +--quiet +--editor +--project-manager +--quit +--language +--path +--upwards +--main-pack +--render-thread +--remote-fs +--remote-fs-password +--audio-driver +--video-driver +--fullscreen +--maximized +--windowed +--always-on-top +--resolution +--position +--low-dpi +--no-window +--enable-vsync-via-compositor +--disable-vsync-via-compositor +--debug +--breakpoints +--profiling +--remote-debug +--debug-collisions +--debug-navigation +--frame-delay +--time-scale +--disable-render-loop +--disable-crash-handler +--fixed-fps +--print-fps +--script +--check-only +--export +--export-debug +--export-pack +--doctool +--no-docbase +--build-solutions +--gdnative-generate-json-api +--test +" -- "$1")) +} + +_complete_godot_bash() { + local cur="${COMP_WORDS[$COMP_CWORD]}" prev + + # Complete options or the positional argument. + if [[ $cur == -* ]]; then + _complete_godot_options "$cur" + else + local IFS=$'\n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -f -X "!*.@(scn|tscn|escn|godot)" -- "$cur")) + fi + + # If the array is accessed out of bounds (which will happen for the first argument), + # `$prev` will be an empty string and won't match any of the conditions below. + prev="${COMP_WORDS[$((COMP_CWORD-1))]}" + + # Complete option values. + if [[ $prev == "--render-thread" ]]; then + local IFS=$' \n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "unsafe safe separate" -- "$cur")) + elif [[ $prev == "--video-driver" ]]; then + local IFS=$' \n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "GLES3 GLES2" -- "$cur")) + elif [[ $prev == "--path" || $prev == "--doctool" ]]; then + local IFS=$'\n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -d -- "$cur")) + elif [[ $prev == "--main-pack" ]]; then + local IFS=$'\n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -f -X "!*.@(pck|zip)" -- "$cur")) + elif [[ $prev == "-s" || $prev == "--script" ]]; then + local IFS=$'\n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -f -X "!*.gd" -- "$cur")) + fi +} + +complete -o filenames -F _complete_godot_bash godot |