Initial commit
authorEduardo <[email protected]>
Sun, 5 May 2024 01:17:02 +0000 (03:17 +0200)
committerEduardo <[email protected]>
Sun, 5 May 2024 01:17:02 +0000 (03:17 +0200)
added some plugins, the splash screen and the main menu (wip)

190 files changed:
.gitattributes [new file with mode: 0644]
.gitignore [new file with mode: 0644]
MainTheme.tres [new file with mode: 0644]
addons/ColorPreview/ColorHelper.gd [new file with mode: 0644]
addons/ColorPreview/ColorPreview.gd [new file with mode: 0644]
addons/ColorPreview/LICENSE [new file with mode: 0644]
addons/ColorPreview/Picker.tscn [new file with mode: 0644]
addons/ColorPreview/plugin.cfg [new file with mode: 0644]
addons/debug_menu/LICENSE.md [new file with mode: 0644]
addons/debug_menu/debug_menu.gd [new file with mode: 0644]
addons/debug_menu/debug_menu.tscn [new file with mode: 0644]
addons/debug_menu/plugin.cfg [new file with mode: 0644]
addons/debug_menu/plugin.gd [new file with mode: 0644]
addons/godot-git-plugin/LICENSE [new file with mode: 0644]
addons/godot-git-plugin/THIRDPARTY.md [new file with mode: 0644]
addons/godot-git-plugin/git_plugin.gdextension [new file with mode: 0644]
addons/godot-git-plugin/linux/libgit_plugin.linux.editor.x86_64.so [new file with mode: 0644]
addons/godot-git-plugin/macos/libgit_plugin.macos.editor.universal.dylib [new file with mode: 0644]
addons/godot-git-plugin/plugin.cfg [new file with mode: 0644]
addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.dll [new file with mode: 0644]
addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.exp [new file with mode: 0644]
addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.lib [new file with mode: 0644]
addons/health_bar_2d/LICENSE.md [new file with mode: 0644]
addons/health_bar_2d/README.md [new file with mode: 0644]
addons/health_bar_2d/addon.gd [new file with mode: 0644]
addons/health_bar_2d/examples/bullet.gd [new file with mode: 0644]
addons/health_bar_2d/examples/bullet.tscn [new file with mode: 0644]
addons/health_bar_2d/examples/example.tscn [new file with mode: 0644]
addons/health_bar_2d/examples/heal.gd [new file with mode: 0644]
addons/health_bar_2d/examples/heal.tscn [new file with mode: 0644]
addons/health_bar_2d/examples/player.gd [new file with mode: 0644]
addons/health_bar_2d/examples/player.tscn [new file with mode: 0644]
addons/health_bar_2d/examples/turrent.gd [new file with mode: 0644]
addons/health_bar_2d/examples/turrent.tscn [new file with mode: 0644]
addons/health_bar_2d/health_bar_2d.gd [new file with mode: 0644]
addons/health_bar_2d/health_bar_2d.tscn [new file with mode: 0644]
addons/health_bar_2d/icon.png [new file with mode: 0644]
addons/health_bar_2d/icon.png.import [new file with mode: 0644]
addons/health_bar_2d/plugin.cfg [new file with mode: 0644]
addons/health_bar_2d/resources/health_bar_texture.png [new file with mode: 0644]
addons/health_bar_2d/resources/health_bar_texture.png.import [new file with mode: 0644]
addons/label_font_auto_sizer/LICENSE [new file with mode: 0644]
addons/label_font_auto_sizer/icon.svg [new file with mode: 0644]
addons/label_font_auto_sizer/icon.svg.import [new file with mode: 0644]
addons/label_font_auto_sizer/label_auto_sizer.gd [new file with mode: 0644]
addons/label_font_auto_sizer/label_font_auto_size_manager.gd [new file with mode: 0644]
addons/label_font_auto_sizer/plugin.cfg [new file with mode: 0644]
addons/label_font_auto_sizer/plugin.gd [new file with mode: 0644]
addons/label_font_auto_sizer/rich_label_auto_sizer.gd [new file with mode: 0644]
addons/licenses/LICENSE.md [new file with mode: 0644]
addons/licenses/component.gd [new file with mode: 0644]
addons/licenses/export_plugin.gd [new file with mode: 0644]
addons/licenses/internal/component_detail_tree.gd [new file with mode: 0644]
addons/licenses/internal/components_container.gd [new file with mode: 0644]
addons/licenses/internal/components_tree.gd [new file with mode: 0644]
addons/licenses/internal/file_system_watcher.gd [new file with mode: 0644]
addons/licenses/internal/handler/array.gd [new file with mode: 0644]
addons/licenses/internal/handler/base.gd [new file with mode: 0644]
addons/licenses/internal/handler/object.gd [new file with mode: 0644]
addons/licenses/internal/handler/string.gd [new file with mode: 0644]
addons/licenses/internal/handler/string_file.gd [new file with mode: 0644]
addons/licenses/internal/handler/string_multiline.gd [new file with mode: 0644]
addons/licenses/internal/licenses.gd [new file with mode: 0644]
addons/licenses/internal/licenses.tscn [new file with mode: 0644]
addons/licenses/internal/licenses_dialog.gd [new file with mode: 0644]
addons/licenses/internal/licenses_dialog.tscn [new file with mode: 0644]
addons/licenses/internal/toolbar.gd [new file with mode: 0644]
addons/licenses/internal/utils.gd [new file with mode: 0644]
addons/licenses/licenses.gd [new file with mode: 0644]
addons/licenses/plugin.cfg [new file with mode: 0644]
addons/licenses/plugin.gd [new file with mode: 0644]
addons/rich_text_label_ex/LICENSE [new file with mode: 0644]
addons/rich_text_label_ex/README.md [new file with mode: 0644]
addons/rich_text_label_ex/RichTextLabelEx.svg [new file with mode: 0644]
addons/rich_text_label_ex/RichTextLabelEx.svg.import [new file with mode: 0644]
addons/rich_text_label_ex/plugin.cfg [new file with mode: 0644]
addons/rich_text_label_ex/plugin.gd [new file with mode: 0644]
addons/rich_text_label_ex/rich_text_label_ex.gd [new file with mode: 0644]
addons/scene_manager/Dissolve2d.gdshader [new file with mode: 0644]
addons/scene_manager/NodeFlagsInspectorPlugin.gd [new file with mode: 0644]
addons/scene_manager/SceneManager.gd [new file with mode: 0644]
addons/scene_manager/SceneManager.tscn [new file with mode: 0644]
addons/scene_manager/SceneManagerConstants.gd [new file with mode: 0644]
addons/scene_manager/SceneManagerPlugin.gd [new file with mode: 0644]
addons/scene_manager/ShaderFade.tres [new file with mode: 0644]
addons/scene_manager/SingletonCheckProperty.gd [new file with mode: 0644]
addons/scene_manager/SingletonNameProperty.gd [new file with mode: 0644]
addons/scene_manager/icon.png [new file with mode: 0644]
addons/scene_manager/icon.png.import [new file with mode: 0644]
addons/scene_manager/plugin.cfg [new file with mode: 0644]
addons/scene_manager/shader_patterns/circle.png [new file with mode: 0644]
addons/scene_manager/shader_patterns/circle.png.import [new file with mode: 0644]
addons/scene_manager/shader_patterns/curtains.png [new file with mode: 0644]
addons/scene_manager/shader_patterns/curtains.png.import [new file with mode: 0644]
addons/scene_manager/shader_patterns/diagonal.png [new file with mode: 0644]
addons/scene_manager/shader_patterns/diagonal.png.import [new file with mode: 0644]
addons/scene_manager/shader_patterns/horizontal.png [new file with mode: 0644]
addons/scene_manager/shader_patterns/horizontal.png.import [new file with mode: 0644]
addons/scene_manager/shader_patterns/radial.png [new file with mode: 0644]
addons/scene_manager/shader_patterns/radial.png.import [new file with mode: 0644]
addons/scene_manager/shader_patterns/scribbles.png [new file with mode: 0644]
addons/scene_manager/shader_patterns/scribbles.png.import [new file with mode: 0644]
addons/scene_manager/shader_patterns/squares.png [new file with mode: 0644]
addons/scene_manager/shader_patterns/squares.png.import [new file with mode: 0644]
addons/scene_manager/shader_patterns/vertical.png [new file with mode: 0644]
addons/scene_manager/shader_patterns/vertical.png.import [new file with mode: 0644]
addons/script-ide/LICENSE [new file with mode: 0644]
addons/script-ide/Popup.gd [new file with mode: 0644]
addons/script-ide/README.md [new file with mode: 0644]
addons/script-ide/icon/class.svg [new file with mode: 0644]
addons/script-ide/icon/class.svg.import [new file with mode: 0644]
addons/script-ide/icon/constant.svg [new file with mode: 0644]
addons/script-ide/icon/constant.svg.import [new file with mode: 0644]
addons/script-ide/icon/export.svg [new file with mode: 0644]
addons/script-ide/icon/export.svg.import [new file with mode: 0644]
addons/script-ide/icon/func.svg [new file with mode: 0644]
addons/script-ide/icon/func.svg.import [new file with mode: 0644]
addons/script-ide/icon/func_get.svg [new file with mode: 0644]
addons/script-ide/icon/func_get.svg.import [new file with mode: 0644]
addons/script-ide/icon/func_set.svg [new file with mode: 0644]
addons/script-ide/icon/func_set.svg.import [new file with mode: 0644]
addons/script-ide/icon/keyword.svg [new file with mode: 0644]
addons/script-ide/icon/keyword.svg.import [new file with mode: 0644]
addons/script-ide/icon/property.svg [new file with mode: 0644]
addons/script-ide/icon/property.svg.import [new file with mode: 0644]
addons/script-ide/icon/signal.svg [new file with mode: 0644]
addons/script-ide/icon/signal.svg.import [new file with mode: 0644]
addons/script-ide/plugin.cfg [new file with mode: 0644]
addons/script-ide/plugin.gd [new file with mode: 0644]
addons/script-tabs/LICENSE [new file with mode: 0644]
addons/script-tabs/plugin.cfg [new file with mode: 0644]
addons/script-tabs/plugin.gd [new file with mode: 0644]
addons/tracer/StackHandler.cs [new file with mode: 0644]
addons/tracer/plugin.cfg [new file with mode: 0644]
addons/tracer/subscriber.gd [new file with mode: 0644]
addons/tracer/tracer.gd [new file with mode: 0644]
addons/tracer/tracer_plugin.gd [new file with mode: 0644]
assets/fonts/Agora.otf [new file with mode: 0644]
assets/fonts/Agora.otf.import [new file with mode: 0644]
assets/fonts/Agora.ttf [new file with mode: 0644]
assets/fonts/Agora.ttf.import [new file with mode: 0644]
assets/logo_backpain.png [new file with mode: 0644]
assets/logo_backpain.png.import [new file with mode: 0644]
assets/logo_made_with_godot.png [new file with mode: 0644]
assets/logo_made_with_godot.png.import [new file with mode: 0644]
assets/title_screen_background.png [new file with mode: 0644]
assets/title_screen_background.png.import [new file with mode: 0644]
assets/ui-components/Agora.otf [new file with mode: 0644]
assets/ui-components/Agora.otf.import [new file with mode: 0644]
assets/ui-components/button.png [new file with mode: 0644]
assets/ui-components/button.png.import [new file with mode: 0644]
assets/ui-components/button_hover.png [new file with mode: 0644]
assets/ui-components/button_hover.png.import [new file with mode: 0644]
assets/ui-components/button_pressed.png [new file with mode: 0644]
assets/ui-components/button_pressed.png.import [new file with mode: 0644]
assets/ui-components/logo_routes&roots.png [new file with mode: 0644]
assets/ui-components/logo_routes&roots.png.import [new file with mode: 0644]
assets/vertical_divisor.png [new file with mode: 0644]
assets/vertical_divisor.png.import [new file with mode: 0644]
components/button/MainButton.tres [new file with mode: 0644]
components/button/MainButton.tscn [new file with mode: 0644]
components/button/MainButtonHover.tres [new file with mode: 0644]
components/button/MainButtonPressed.tres [new file with mode: 0644]
examples/label_font_auto_sizer/Anta-Regular.ttf [new file with mode: 0644]
examples/label_font_auto_sizer/Anta-Regular.ttf.import [new file with mode: 0644]
examples/label_font_auto_sizer/OFL.txt [new file with mode: 0644]
examples/label_font_auto_sizer/demo_label_settings.tres [new file with mode: 0644]
examples/label_font_auto_sizer/demo_label_theme.tres [new file with mode: 0644]
examples/label_font_auto_sizer/in_editor_demo.tscn [new file with mode: 0644]
examples/label_font_auto_sizer/play_scene_demo.tscn [new file with mode: 0644]
examples/label_font_auto_sizer/set_numbers_button.gd [new file with mode: 0644]
examples/licenses/README.md [new file with mode: 0644]
examples/licenses/license_container.gd [new file with mode: 0644]
examples/licenses/license_selector.gd [new file with mode: 0644]
examples/licenses/licenses.json [new file with mode: 0644]
examples/licenses/main.tscn [new file with mode: 0644]
examples/scene-manager/test.gd [new file with mode: 0644]
examples/scene-manager/test.tscn [new file with mode: 0644]
examples/scene-manager/test2.gd [new file with mode: 0644]
examples/scene-manager/test2.tscn [new file with mode: 0644]
examples/tracer/logs.txt [new file with mode: 0644]
examples/tracer/test.gd [new file with mode: 0644]
examples/tracer/test.tscn [new file with mode: 0644]
icon.svg [new file with mode: 0644]
icon.svg.import [new file with mode: 0644]
project.godot [new file with mode: 0644]
scenes/MainMenu.tscn [new file with mode: 0644]
scenes/SplashScreen.tscn [new file with mode: 0644]
scenes/main_menu.gd [new file with mode: 0644]
scenes/splash_screen.gd [new file with mode: 0644]

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..8ad74f7
--- /dev/null
@@ -0,0 +1,2 @@
+# Normalize EOL for all files that Git considers text files.
+* text=auto eol=lf
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..7de8ea5
--- /dev/null
@@ -0,0 +1,3 @@
+# Godot 4+ specific ignores
+.godot/
+android/
diff --git a/MainTheme.tres b/MainTheme.tres
new file mode 100644 (file)
index 0000000..d02f789
--- /dev/null
@@ -0,0 +1,21 @@
+[gd_resource type="Theme" load_steps=6 format=3 uid="uid://c2kdv11t73232"]
+
+[ext_resource type="FontFile" uid="uid://b13vwg53k4dkq" path="res://assets/fonts/Agora.otf" id="1_b5ag8"]
+[ext_resource type="StyleBox" uid="uid://m4kfq5fl0mex" path="res://components/button/MainButton.tres" id="2_1ainy"]
+[ext_resource type="StyleBox" uid="uid://bac76g4px5500" path="res://components/button/MainButtonHover.tres" id="2_rhu3r"]
+[ext_resource type="StyleBox" uid="uid://cqjnn1fveqsfw" path="res://components/button/MainButtonPressed.tres" id="4_caeb0"]
+
+[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_kuftc"]
+
+[resource]
+Button/colors/font_color = Color(1, 1, 1, 1)
+Button/colors/font_outline_color = Color(0.376471, 0.427451, 1, 1)
+Button/constants/h_separation = 0
+Button/constants/outline_size = 30
+Button/font_sizes/font_size = 80
+Button/fonts/font = ExtResource("1_b5ag8")
+Button/styles/disabled = ExtResource("4_caeb0")
+Button/styles/focus = SubResource("StyleBoxEmpty_kuftc")
+Button/styles/hover = ExtResource("2_rhu3r")
+Button/styles/normal = ExtResource("2_1ainy")
+Button/styles/pressed = ExtResource("2_1ainy")
diff --git a/addons/ColorPreview/ColorHelper.gd b/addons/ColorPreview/ColorHelper.gd
new file mode 100644 (file)
index 0000000..95982ae
--- /dev/null
@@ -0,0 +1,167 @@
+class_name ColorHelper
+extends RefCounted
+
+## This is a duplicate of core/math/color_names.inc named_colors (without _)
+## Since those colors are only accessible through the Color constants
+const named_colors := {
+       "ALICEBLUE": null,
+       "ANTIQUEWHITE": null,
+       "AQUA": null,
+       "AQUAMARINE": null,
+       "AZURE": null,
+       "BEIGE": null,
+       "BISQUE": null,
+       "BLACK": null,
+       "BLANCHEDALMOND": null,
+       "BLUE": null,
+       "BLUEVIOLET": null,
+       "BROWN": null,
+       "BURLYWOOD": null,
+       "CADETBLUE": null,
+       "CHARTREUSE": null,
+       "CHOCOLATE": null,
+       "CORAL": null,
+       "CORNFLOWERBLUE": null,
+       "CORNSILK": null,
+       "CRIMSON": null,
+       "CYAN": null,
+       "DARKBLUE": null,
+       "DARKCYAN": null,
+       "DARKGOLDENROD": null,
+       "DARKGRAY": null,
+       "DARKGREEN": null,
+       "DARKKHAKI": null,
+       "DARKMAGENTA": null,
+       "DARKOLIVEGREEN": null,
+       "DARKORANGE": null,
+       "DARKORCHID": null,
+       "DARKRED": null,
+       "DARKSALMON": null,
+       "DARKSEAGREEN": null,
+       "DARKSLATEBLUE": null,
+       "DARKSLATEGRAY": null,
+       "DARKTURQUOISE": null,
+       "DARKVIOLET": null,
+       "DEEPPINK": null,
+       "DEEPSKYBLUE": null,
+       "DIMGRAY": null,
+       "DODGERBLUE": null,
+       "FIREBRICK": null,
+       "FLORALWHITE": null,
+       "FORESTGREEN": null,
+       "FUCHSIA": null,
+       "GAINSBORO": null,
+       "GHOSTWHITE": null,
+       "GOLD": null,
+       "GOLDENROD": null,
+       "GRAY": null,
+       "GREEN": null,
+       "GREENYELLOW": null,
+       "HONEYDEW": null,
+       "HOTPINK": null,
+       "INDIANRED": null,
+       "INDIGO": null,
+       "IVORY": null,
+       "KHAKI": null,
+       "LAVENDER": null,
+       "LAVENDERBLUSH": null,
+       "LAWNGREEN": null,
+       "LEMONCHIFFON": null,
+       "LIGHTBLUE": null,
+       "LIGHTCORAL": null,
+       "LIGHTCYAN": null,
+       "LIGHTGOLDENROD": null,
+       "LIGHTGRAY": null,
+       "LIGHTGREEN": null,
+       "LIGHTPINK": null,
+       "LIGHTSALMON": null,
+       "LIGHTSEAGREEN": null,
+       "LIGHTSKYBLUE": null,
+       "LIGHTSLATEGRAY": null,
+       "LIGHTSTEELBLUE": null,
+       "LIGHTYELLOW": null,
+       "LIME": null,
+       "LIMEGREEN": null,
+       "LINEN": null,
+       "MAGENTA": null,
+       "MAROON": null,
+       "MEDIUMAQUAMARINE": null,
+       "MEDIUMBLUE": null,
+       "MEDIUMORCHID": null,
+       "MEDIUMPURPLE": null,
+       "MEDIUMSEAGREEN": null,
+       "MEDIUMSLATEBLUE": null,
+       "MEDIUMSPRINGGREEN": null,
+       "MEDIUMTURQUOISE": null,
+       "MEDIUMVIOLETRED": null,
+       "MIDNIGHTBLUE": null,
+       "MINTCREAM": null,
+       "MISTYROSE": null,
+       "MOCCASIN": null,
+       "NAVAJOWHITE": null,
+       "NAVYBLUE": null,
+       "OLDLACE": null,
+       "OLIVE": null,
+       "OLIVEDRAB": null,
+       "ORANGE": null,
+       "ORANGERED": null,
+       "ORCHID": null,
+       "PALEGOLDENROD": null,
+       "PALEGREEN": null,
+       "PALETURQUOISE": null,
+       "PALEVIOLETRED": null,
+       "PAPAYAWHIP": null,
+       "PEACHPUFF": null,
+       "PERU": null,
+       "PINK": null,
+       "PLUM": null,
+       "POWDERBLUE": null,
+       "PURPLE": null,
+       "REBECCAPURPLE": null,
+       "RED": null,
+       "ROSYBROWN": null,
+       "ROYALBLUE": null,
+       "SADDLEBROWN": null,
+       "SALMON": null,
+       "SANDYBROWN": null,
+       "SEAGREEN": null,
+       "SEASHELL": null,
+       "SIENNA": null,
+       "SILVER": null,
+       "SKYBLUE": null,
+       "SLATEBLUE": null,
+       "SLATEGRAY": null,
+       "SNOW": null,
+       "SPRINGGREEN": null,
+       "STEELBLUE": null,
+       "TAN": null,
+       "TEAL": null,
+       "THISTLE": null,
+       "TOMATO": null,
+       "TRANSPARENT": null,
+       "TURQUOISE": null,
+       "VIOLET": null,
+       "WEBGRAY": null,
+       "WEBGREEN": null,
+       "WEBMAROON": null,
+       "WEBPURPLE": null,
+       "WHEAT": null,
+       "WHITE": null,
+       "WHITESMOKE": null,
+       "YELLOW": null,
+       "YELLOWGREEN": null,
+}
+
+
+## Checks if a color is a named color.
+## Based on Godot /core/math/color.cpp Color::find_named_color
+static func is_named_color(name: String) -> bool:
+       # Normalize name
+       name = name.replace(" ", "")
+       name = name.replace("-", "")
+       name = name.replace("_", "")
+       name = name.replace("'", "")
+       name = name.replace(".", "")
+       name = name.to_upper()
+
+       return name in named_colors
diff --git a/addons/ColorPreview/ColorPreview.gd b/addons/ColorPreview/ColorPreview.gd
new file mode 100644 (file)
index 0000000..54e88fa
--- /dev/null
@@ -0,0 +1,353 @@
+@tool
+extends EditorPlugin
+
+var editor: Node = null
+var editors: Array = []
+var current_textedit: TextEdit
+var hovering_line = null
+var gutter_position: int = 0
+var preview_gutter_name: String = "color_preview"
+var picker_popup: Popup
+var regex: RegEx
+const regex_patterns: Array[String] = [
+       "Color\\((?<color_params>(?R)*.*?)\\)",
+       "Color\\.(?<color_const>[A-Z_]+)\\b",
+       "source_color.*?vec4\\((?<vec4_params>(?R)*.*?)\\)",
+]
+
+
+func _enter_tree() -> void:
+       initialize_gutter()
+       initialize_picker()
+       # the shader editor does not exist until opened for the first time
+       # so, to get it consistently, check if it's there whenever the focus changes
+       get_viewport().gui_focus_changed.connect(get_shader_editor_code_edit)
+
+       regex = RegEx.new()
+       regex.compile("|".join(regex_patterns))
+
+
+func _exit_tree() -> void:
+       exit_picker()
+       exit_gutter()
+
+
+func initialize_picker() -> void:
+       var editor_base := get_editor_interface().get_base_control()
+       if not picker_popup:
+               picker_popup = preload("res://addons/ColorPreview/Picker.tscn").instantiate()
+               picker_popup.get_node("%ColorPreviewPicker").theme = editor_base.theme
+               picker_popup.connect("popup_hide", on_picker_popup_close)
+       picker_popup.hide()
+
+       var picker := (picker_popup.get_node("%ColorPreviewPicker") as ColorPicker)
+       if not picker.is_connected("color_changed", picker_color_changed):
+               picker.connect("color_changed", picker_color_changed)
+
+       if not picker_popup.is_inside_tree() or not editor_base.has_node(picker_popup.get_path()):
+               editor_base.add_child(picker_popup)
+
+
+func exit_picker() -> void:
+       if picker_popup:
+               picker_popup.queue_free()
+
+
+func initialize_gutter() -> void:
+       var script_editor := get_editor_interface().get_script_editor()
+       if not script_editor.is_connected("editor_script_changed", editor_script_changed):
+               script_editor.connect("editor_script_changed", editor_script_changed)
+       get_all_text_editors(script_editor)
+       for child in editors:
+               if child and is_instance_valid(child) and child is TextEdit:
+                       add_color_gutter(child)
+
+
+func exit_gutter() -> void:
+       var script_editor := get_editor_interface().get_script_editor()
+       get_all_text_editors(script_editor)
+       for child in editors:
+               if child is TextEdit:
+                       remove_color_gutter(child)
+
+
+### ### ### GETTING AND KEEPING EDITORS ### ### ###
+
+func get_all_text_editors(parent : Node) -> void:
+       for child in parent.get_children():
+               if child.get_child_count():
+                       get_all_text_editors(child)
+
+               if child is CodeEdit:
+                       add_code_edit_to_editors_array(child)
+
+
+func get_shader_editor_code_edit(node: Node):
+       if not node is CodeEdit or not node.get_parent().get_class() == "ShaderTextEditor":
+               return
+
+       if not editors.has(node):
+               add_code_edit_to_editors_array(node)
+               initialize_gutter()
+               initialize_picker()
+
+
+func add_code_edit_to_editors_array(node: CodeEdit) -> void:
+       editors.append(node)
+
+       if node.is_connected("text_changed", handle_change):
+               node.disconnect("text_changed", handle_change)
+       node.text_changed.connect(handle_change.bind(node))
+
+       if node.is_connected("caret_changed", handle_change):
+               node.disconnect("caret_changed", handle_change)
+       node.caret_changed.connect(handle_change.bind(node))
+
+
+func handle_change(textedit : TextEdit) -> void:
+       current_textedit = textedit
+       if not current_textedit.is_connected("gui_input", textedit_clicked):
+               current_textedit.gui_input.connect(textedit_clicked.bind(textedit))
+
+       var editor := get_editor_interface()
+       if not editors.has(textedit):
+               editors.clear()
+               get_all_text_editors(editor.get_script_editor())
+       get_colors_from_textedit(textedit)
+
+
+func editor_script_changed(script: Script) -> void:
+       initialize_gutter()
+       initialize_picker()
+       if current_textedit:
+               if current_textedit.is_connected("gui_input", textedit_clicked):
+                       current_textedit.disconnect("gui_input", textedit_clicked)
+               current_textedit = null
+       var editor := get_editor_interface()
+       var script_editor = editor.get_script_editor()
+       editors.clear()
+       get_all_text_editors(script_editor)
+
+
+### ### ### HANDLING GUTTERS ### ### ###
+
+func has_color_preview_gutter(textedit: TextEdit) -> bool:
+       for gutter_index in textedit.get_gutter_count() - 1:
+               if gutter_index < 0:
+                       continue
+               if textedit.get_gutter_name(gutter_index) == preview_gutter_name:
+                       return true
+       return false
+
+
+func add_color_gutter(textedit: TextEdit) -> void:
+       if has_color_preview_gutter(textedit):
+               return
+       current_textedit = textedit
+       textedit.add_gutter(gutter_position)
+       textedit.set_gutter_width(gutter_position, 35)
+       textedit.set_gutter_name(gutter_position, preview_gutter_name)
+       textedit.set_gutter_type(gutter_position, TextEdit.GUTTER_TYPE_CUSTOM)
+       textedit.set_gutter_custom_draw(gutter_position, gutter_draw_color_preview)
+
+
+func remove_color_gutter(textedit: TextEdit) -> void:
+       for gutter_index in textedit.get_gutter_count() - 1:
+               if gutter_index < 0:
+                       continue
+               var name = textedit.get_gutter_name(gutter_index)
+               if name == preview_gutter_name:
+                       textedit.remove_gutter(gutter_position)
+
+
+func gutter_draw_color_preview(line: int, gutter: int, area: Rect2) -> void:
+       if not current_textedit or line > current_textedit.get_line_count() - 1:
+               return
+
+       var size: int
+       var offset := Vector2.ZERO
+       # centering the preview square in the line because perfectionism
+       if area.size.x < area.size.y:
+               size = area.size.x
+               offset = Vector2(0, (area.size.y - area.size.x) /2)
+       else:
+               size = area.size.y
+               offset = Vector2((area.size.x - area.size.y) /2, 0)
+       var icon_region := Rect2(area.position + offset, Vector2(size, size))
+
+       # spacing the squares so they don't merge
+       var padding = size / 6
+       icon_region = icon_region.grow(-padding)
+
+       var icon_corner_region := PackedVector2Array([
+               icon_region.end,
+               icon_region.end + Vector2(-icon_region.size.x / 2, 0.0),
+               icon_region.end + Vector2(0.0, -icon_region.size.y / 2)
+       ])
+
+       var mouse_pos := current_textedit.get_local_mouse_pos()
+       var hovering := area.has_point(mouse_pos)
+       var line_color = get_line_color(current_textedit, line)
+
+       # black is falsey, comparing to null allows us to preview it
+       if line_color is Color:
+               line_color = line_color as Color
+
+               if line_color.a < 1:    # transparent -> add checkered bg + no-alpha corner
+                       current_textedit.draw_rect(icon_region, Color.WHITE)
+                       current_textedit.draw_rect( Rect2(
+                               Vector2(icon_region.position.x + icon_region.size.x/2, icon_region.position.y),
+                               icon_region.size/2
+                       ), Color.DIM_GRAY)
+                       current_textedit.draw_rect( Rect2(
+                               Vector2(icon_region.position.x, icon_region.position.y + icon_region.size.y/2),
+                               icon_region.size/2
+                       ), Color.DIM_GRAY)
+
+                       current_textedit.draw_colored_polygon(icon_corner_region, Color(line_color, 1.0))
+
+               current_textedit.draw_rect(icon_region, line_color)
+               current_textedit.set_line_gutter_clickable(line, gutter_position, true)
+
+               if hovering:
+                       hovering_line = line
+       else:
+               if hovering:
+                       hovering_line = null
+
+       # not captured by the hovering check above
+       # if left or right of gutter, forget the line
+       if mouse_pos.x > area.end.x or mouse_pos.x < area.position.x:
+               # in case the picker is open, remember the line even when moving away
+               if not picker_popup or not picker_popup.visible:
+                       hovering_line = null
+
+
+func get_colors_from_textedit(textedit: TextEdit) -> void:
+       var all_lines := textedit.text.split("\n")
+       var has_color := false
+
+       for line_index in len(all_lines):
+               var color = color_from_string(all_lines[line_index])
+               if color != null:
+                       has_color = true
+                       set_line_color(textedit, line_index, color)
+                       textedit.set_gutter_draw(gutter_position, true)
+               else:
+                       set_line_color(textedit, line_index)
+
+       if not has_color:
+               textedit.set_gutter_draw(gutter_position, false)
+
+
+func set_line_color(textedit: TextEdit, line: int, color = null) -> void:
+       textedit.set_line_gutter_metadata(line, gutter_position, color)
+
+
+func get_line_color(textedit: TextEdit, line: int):
+       var meta = textedit.get_line_gutter_metadata(line, gutter_position)
+       return meta if meta is Color else null
+
+
+### ### ### COLOR PICKER ### ### ###
+
+func textedit_clicked(event: InputEvent, textedit: TextEdit) -> void:
+       if hovering_line != null:
+               if event is InputEventMouseButton:
+                       if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
+                               var color: Color = get_line_color(textedit, hovering_line)
+                               if color != null:
+                                       picker_popup.get_node("%ColorPreviewPicker").color = color
+                                       picker_popup.position = event.global_position + Vector2(20, 0)
+                                       picker_popup.popup()
+
+
+func picker_color_changed(new_color: Color) -> void:
+       if hovering_line and current_textedit:
+               set_line_color(current_textedit, hovering_line, new_color)
+
+
+func on_picker_popup_close() -> void:
+       if not hovering_line:
+               return
+       var text := current_textedit.get_line(hovering_line)
+       var color_match := regex.search(text)
+       var new_color = get_line_color(current_textedit, hovering_line)
+
+       if color_from_regex_match(color_match) == new_color:
+               return # don't change if equal -> doesn't mess up constants, strings etc.
+
+       if color_match.get_string("color_const"): # replace the whole color string
+               text = text.replace(color_match.get_string(), "Color" + str(new_color))
+
+       else: # only replace inside parenthesis to cover Color(...) and vec4(...)
+               var color_string := str(new_color).replace("(", "").replace(")", "")
+               var params := color_match.get_string("color_params")
+               if params == "":
+                       params = color_match.get_string("vec4_params")
+               text = text.replace(params, color_string)
+
+       current_textedit.set_line(hovering_line, text)
+
+
+### ### ### COLOR INTERPRETATION ### ### ###
+
+func color_from_string(string: String): # Color or null
+       var color_match := regex.search(string)
+       if !color_match:
+               return null
+       return color_from_regex_match(color_match)
+
+
+func color_from_regex_match(regex_match: RegExMatch): # Color or null
+       var color_const := regex_match.get_string("color_const")
+       if ColorHelper.is_named_color(color_const):
+               return Color(color_const)
+
+       var params := regex_match.get_string("color_params")
+       if params == "":
+               params = regex_match.get_string("vec4_params")
+
+       if not "," in params:
+               var color = color_from_string(params)
+               if color != null:
+                       return color
+               color = named_or_hex_color(params)
+               if color != null:
+                       return color
+
+       var parameters := params.split(",")
+       var parameter_count := parameters.size()
+       if parameter_count == 2:
+                       var color = color_from_string(parameters[0])
+                       if color != null:
+                               return Color(color, parameters[1].to_float())
+                       color = named_or_hex_color(parameters[0])
+                       if color != null:
+                               return Color(color , parameters[1].to_float())
+       elif parameter_count == 3:
+                       return Color(
+                               parameters[0].to_float(),
+                               parameters[1].to_float(),
+                               parameters[2].to_float(),
+                       )
+       elif parameter_count == 4:
+                       return Color(
+                               parameters[0].to_float(),
+                               parameters[1].to_float(),
+                               parameters[2].to_float(),
+                               parameters[3].to_float(),
+                       )
+       return null
+
+
+func named_or_hex_color(string: String): # Color or null
+       string = string.trim_prefix("\"").trim_prefix("\'").trim_suffix("\"").trim_suffix("\'")
+       if string.is_valid_html_color() or ColorHelper.is_named_color(string):
+               return Color(string)
+       return null
+
+
+
+
+
diff --git a/addons/ColorPreview/LICENSE b/addons/ColorPreview/LICENSE
new file mode 100644 (file)
index 0000000..163258e
--- /dev/null
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Steen RH/Qubus0
+
+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
diff --git a/addons/ColorPreview/Picker.tscn b/addons/ColorPreview/Picker.tscn
new file mode 100644 (file)
index 0000000..7881771
--- /dev/null
@@ -0,0 +1,15 @@
+[gd_scene format=3 uid="uid://dlhe1fiimv8if"]
+
+[node name="Popup" type="PopupPanel"]
+size = Vector2i(465, 775)
+
+[node name="ColorPreviewPicker" type="ColorPicker" parent="."]
+unique_name_in_owner = true
+offset_left = 14.0
+offset_top = 14.0
+offset_right = 435.0
+offset_bottom = 761.0
+grow_horizontal = 2
+grow_vertical = 2
+color = Color(0.129412, 0.145098, 0.176471, 1)
+deferred_mode = true
diff --git a/addons/ColorPreview/plugin.cfg b/addons/ColorPreview/plugin.cfg
new file mode 100644 (file)
index 0000000..175431d
--- /dev/null
@@ -0,0 +1,7 @@
+[plugin]
+
+name="ColorPreview"
+description="An Editor Plugin which lets you preview and adjust colors from code directly next to them"
+author="Ste and Contributors"
+version="2.1.0"
+script="ColorPreview.gd"
diff --git a/addons/debug_menu/LICENSE.md b/addons/debug_menu/LICENSE.md
new file mode 100644 (file)
index 0000000..54fc020
--- /dev/null
@@ -0,0 +1,21 @@
+# MIT License
+
+Copyright © 2023-present Hugo Locurcio and contributors
+
+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.
diff --git a/addons/debug_menu/debug_menu.gd b/addons/debug_menu/debug_menu.gd
new file mode 100644 (file)
index 0000000..a1ab064
--- /dev/null
@@ -0,0 +1,479 @@
+extends CanvasLayer
+
+@export var fps: Label
+@export var frame_time: Label
+@export var frame_number: Label
+@export var frame_history_total_avg: Label
+@export var frame_history_total_min: Label
+@export var frame_history_total_max: Label
+@export var frame_history_total_last: Label
+@export var frame_history_cpu_avg: Label
+@export var frame_history_cpu_min: Label
+@export var frame_history_cpu_max: Label
+@export var frame_history_cpu_last: Label
+@export var frame_history_gpu_avg: Label
+@export var frame_history_gpu_min: Label
+@export var frame_history_gpu_max: Label
+@export var frame_history_gpu_last: Label
+@export var fps_graph: Panel
+@export var total_graph: Panel
+@export var cpu_graph: Panel
+@export var gpu_graph: Panel
+@export var information: Label
+@export var settings: Label
+
+## The number of frames to keep in history for graph drawing and best/worst calculations.
+## Currently, this also affects how FPS is measured.
+const HISTORY_NUM_FRAMES = 150
+
+const GRAPH_SIZE = Vector2(150, 25)
+const GRAPH_MIN_FPS = 10
+const GRAPH_MAX_FPS = 160
+const GRAPH_MIN_FRAMETIME = 1.0 / GRAPH_MIN_FPS
+const GRAPH_MAX_FRAMETIME = 1.0 / GRAPH_MAX_FPS
+
+## Debug menu display style.
+enum Style {
+       HIDDEN,  ## Debug menu is hidden.
+       VISIBLE_COMPACT,  ## Debug menu is visible, with only the FPS, FPS cap (if any) and time taken to render the last frame.
+       VISIBLE_DETAILED,  ## Debug menu is visible with full information, including graphs.
+       MAX,  ## Represents the size of the Style enum.
+}
+
+## The style to use when drawing the debug menu.
+var style := Style.HIDDEN:
+       set(value):
+               style = value
+               match style:
+                       Style.HIDDEN:
+                               visible = false
+                       Style.VISIBLE_COMPACT, Style.VISIBLE_DETAILED:
+                               visible = true
+                               frame_number.visible = style == Style.VISIBLE_DETAILED
+                               $DebugMenu/VBoxContainer/FrameTimeHistory.visible = style == Style.VISIBLE_DETAILED
+                               $DebugMenu/VBoxContainer/FPSGraph.visible = style == Style.VISIBLE_DETAILED
+                               $DebugMenu/VBoxContainer/TotalGraph.visible = style == Style.VISIBLE_DETAILED
+                               $DebugMenu/VBoxContainer/CPUGraph.visible = style == Style.VISIBLE_DETAILED
+                               $DebugMenu/VBoxContainer/GPUGraph.visible = style == Style.VISIBLE_DETAILED
+                               information.visible = style == Style.VISIBLE_DETAILED
+                               settings.visible = style == Style.VISIBLE_DETAILED
+
+# Value of `Time.get_ticks_usec()` on the previous frame.
+var last_tick := 0
+
+var thread := Thread.new()
+
+## Returns the sum of all values of an array (use as a parameter to `Array.reduce()`).
+var sum_func := func avg(accum: float, number: float) -> float: return accum + number
+
+# History of the last `HISTORY_NUM_FRAMES` rendered frames.
+var frame_history_total: Array[float] = []
+var frame_history_cpu: Array[float] = []
+var frame_history_gpu: Array[float] = []
+var fps_history: Array[float] = []  # Only used for graphs.
+
+var frametime_avg := GRAPH_MIN_FRAMETIME
+var frametime_cpu_avg := GRAPH_MAX_FRAMETIME
+var frametime_gpu_avg := GRAPH_MIN_FRAMETIME
+var frames_per_second := float(GRAPH_MIN_FPS)
+var frame_time_gradient := Gradient.new()
+
+func _init() -> void:
+       # This must be done here instead of `_ready()` to avoid having `visibility_changed` be emitted immediately.
+       visible = false
+
+       if not InputMap.has_action("cycle_debug_menu"):
+               # Create default input action if no user-defined override exists.
+               # We can't do it in the editor plugin's activation code as it doesn't seem to work there.
+               InputMap.add_action("cycle_debug_menu")
+               var event := InputEventKey.new()
+               event.keycode = KEY_F3
+               InputMap.action_add_event("cycle_debug_menu", event)
+
+
+func _ready() -> void:
+       fps_graph.draw.connect(_fps_graph_draw)
+       total_graph.draw.connect(_total_graph_draw)
+       cpu_graph.draw.connect(_cpu_graph_draw)
+       gpu_graph.draw.connect(_gpu_graph_draw)
+
+       fps_history.resize(HISTORY_NUM_FRAMES)
+       frame_history_total.resize(HISTORY_NUM_FRAMES)
+       frame_history_cpu.resize(HISTORY_NUM_FRAMES)
+       frame_history_gpu.resize(HISTORY_NUM_FRAMES)
+
+       # NOTE: Both FPS and frametimes are colored following FPS logic
+       # (red = 10 FPS, yellow = 60 FPS, green = 110 FPS, cyan = 160 FPS).
+       # This makes the color gradient non-linear.
+       # Colors are taken from <https://tailwindcolor.com/>.
+       frame_time_gradient.set_color(0, Color8(239, 68, 68))   # red-500
+       frame_time_gradient.set_color(1, Color8(56, 189, 248))  # light-blue-400
+       frame_time_gradient.add_point(0.3333, Color8(250, 204, 21))  # yellow-400
+       frame_time_gradient.add_point(0.6667, Color8(128, 226, 95))  # 50-50 mix of lime-400 and green-400
+
+       get_viewport().size_changed.connect(update_settings_label)
+
+       # Display loading text while information is being queried,
+       # in case the user toggles the full debug menu just after starting the project.
+       information.text = "Loading hardware information...\n\n "
+       settings.text = "Loading project information..."
+       thread.start(
+               func():
+                       # Disable thread safety checks as they interfere with this add-on.
+                       # This only affects this particular thread, not other thread instances in the project.
+                       # See <https://github.com/godotengine/godot/pull/78000> for details.
+                       # Use a Callable so that this can be ignored on Godot 4.0 without causing a script error
+                       # (thread safety checks were added in Godot 4.1).
+                       if Engine.get_version_info()["hex"] >= 0x040100:
+                               Callable(Thread, "set_thread_safety_checks_enabled").call(false)
+
+                       # Enable required time measurements to display CPU/GPU frame time information.
+                       # These lines are time-consuming operations, so run them in a separate thread.
+                       RenderingServer.viewport_set_measure_render_time(get_viewport().get_viewport_rid(), true)
+                       update_information_label()
+                       update_settings_label()
+       )
+
+
+func _input(event: InputEvent) -> void:
+       if event.is_action_pressed("cycle_debug_menu"):
+               style = wrapi(style + 1, 0, Style.MAX) as Style
+
+
+func _exit_tree() -> void:
+       thread.wait_to_finish()
+
+
+## Update hardware information label (this can change at runtime based on window
+## size and graphics settings). This is only called when the window is resized.
+## To update when graphics settings are changed, the function must be called manually
+## using `DebugMenu.update_settings_label()`.
+func update_settings_label() -> void:
+       settings.text = ""
+       if ProjectSettings.has_setting("application/config/version"):
+               settings.text += "Project Version: %s\n" % ProjectSettings.get_setting("application/config/version")
+
+       var rendering_method := str(ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method"))
+       var rendering_method_string := rendering_method
+       match rendering_method:
+               "forward_plus":
+                       rendering_method_string = "Forward+"
+               "mobile":
+                       rendering_method_string = "Forward Mobile"
+               "gl_compatibility":
+                       rendering_method_string = "Compatibility"
+       settings.text += "Rendering Method: %s\n" % rendering_method_string
+
+       var viewport := get_viewport()
+
+       # The size of the viewport rendering, which determines which resolution 3D is rendered at.
+       var viewport_render_size := Vector2i()
+
+       if viewport.content_scale_mode == Window.CONTENT_SCALE_MODE_VIEWPORT:
+               viewport_render_size = viewport.get_visible_rect().size
+               settings.text += "Viewport: %d×%d, Window: %d×%d\n" % [viewport.get_visible_rect().size.x, viewport.get_visible_rect().size.y, viewport.size.x, viewport.size.y]
+       else:
+               # Window size matches viewport size.
+               viewport_render_size = viewport.size
+               settings.text += "Viewport: %d×%d\n" % [viewport.size.x, viewport.size.y]
+
+       # Display 3D settings only if relevant.
+       if viewport.get_camera_3d():
+               var scaling_3d_mode_string := "(unknown)"
+               match viewport.scaling_3d_mode:
+                       Viewport.SCALING_3D_MODE_BILINEAR:
+                               scaling_3d_mode_string = "Bilinear"
+                       Viewport.SCALING_3D_MODE_FSR:
+                               scaling_3d_mode_string = "FSR 1.0"
+                       Viewport.SCALING_3D_MODE_FSR2:
+                               scaling_3d_mode_string = "FSR 2.2"
+
+               var antialiasing_3d_string := ""
+               if viewport.scaling_3d_mode == Viewport.SCALING_3D_MODE_FSR2:
+                       # The FSR2 scaling mode includes its own temporal antialiasing implementation.
+                       antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "FSR 2.2"
+               if viewport.scaling_3d_mode != Viewport.SCALING_3D_MODE_FSR2 and viewport.use_taa:
+                       # Godot's own TAA is ignored when using FSR2 scaling mode, as FSR2 provides its own TAA implementation.
+                       antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "TAA"
+               if viewport.msaa_3d >= Viewport.MSAA_2X:
+                       antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "%d× MSAA" % pow(2, viewport.msaa_3d)
+               if viewport.screen_space_aa == Viewport.SCREEN_SPACE_AA_FXAA:
+                       antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "FXAA"
+
+               settings.text += "3D scale (%s): %d%% = %d×%d" % [
+                               scaling_3d_mode_string,
+                               viewport.scaling_3d_scale * 100,
+                               viewport_render_size.x * viewport.scaling_3d_scale,
+                               viewport_render_size.y * viewport.scaling_3d_scale,
+               ]
+
+               if not antialiasing_3d_string.is_empty():
+                       settings.text += "\n3D Antialiasing: %s" % antialiasing_3d_string
+
+               var environment := viewport.get_camera_3d().get_world_3d().environment
+               if environment:
+                       if environment.ssr_enabled:
+                               settings.text += "\nSSR: %d Steps" % environment.ssr_max_steps
+
+                       if environment.ssao_enabled:
+                               settings.text += "\nSSAO: On"
+                       if environment.ssil_enabled:
+                               settings.text += "\nSSIL: On"
+
+                       if environment.sdfgi_enabled:
+                               settings.text += "\nSDFGI: %d Cascades" % environment.sdfgi_cascades
+
+                       if environment.glow_enabled:
+                               settings.text += "\nGlow: On"
+
+                       if environment.volumetric_fog_enabled:
+                               settings.text += "\nVolumetric Fog: On"
+       var antialiasing_2d_string := ""
+       if viewport.msaa_2d >= Viewport.MSAA_2X:
+               antialiasing_2d_string = "%d× MSAA" % pow(2, viewport.msaa_2d)
+
+       if not antialiasing_2d_string.is_empty():
+               settings.text += "\n2D Antialiasing: %s" % antialiasing_2d_string
+
+
+## Update hardware/software information label (this never changes at runtime).
+func update_information_label() -> void:
+       var adapter_string := ""
+       # Make "NVIDIA Corporation" and "NVIDIA" be considered identical (required when using OpenGL to avoid redundancy).
+       if RenderingServer.get_video_adapter_vendor().trim_suffix(" Corporation") in RenderingServer.get_video_adapter_name():
+               # Avoid repeating vendor name before adapter name.
+               # Trim redundant suffix sometimes reported by NVIDIA graphics cards when using OpenGL.
+               adapter_string = RenderingServer.get_video_adapter_name().trim_suffix("/PCIe/SSE2")
+       else:
+               adapter_string = RenderingServer.get_video_adapter_vendor() + " - " + RenderingServer.get_video_adapter_name().trim_suffix("/PCIe/SSE2")
+
+       # Graphics driver version information isn't always availble.
+       var driver_info := OS.get_video_adapter_driver_info()
+       var driver_info_string := ""
+       if driver_info.size() >= 2:
+               driver_info_string = driver_info[1]
+       else:
+               driver_info_string = "(unknown)"
+
+       var release_string := ""
+       if OS.has_feature("editor"):
+               # Editor build (implies `debug`).
+               release_string = "editor"
+       elif OS.has_feature("debug"):
+               # Debug export template build.
+               release_string = "debug"
+       else:
+               # Release export template build.
+               release_string = "release"
+
+       var rendering_method := str(ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method"))
+       var rendering_driver := str(ProjectSettings.get_setting_with_override("rendering/rendering_device/driver"))
+       var graphics_api_string := rendering_driver
+       if rendering_method != "gl_compatibility":
+               if rendering_driver == "d3d12":
+                       graphics_api_string = "Direct3D 12"
+               elif rendering_driver == "metal":
+                       graphics_api_string = "Metal"
+               elif rendering_driver == "vulkan":
+                       if OS.has_feature("macos") or OS.has_feature("ios"):
+                               graphics_api_string = "Vulkan via MoltenVK"
+                       else:
+                               graphics_api_string = "Vulkan"
+       else:
+               if rendering_driver == "opengl3_angle":
+                       graphics_api_string = "OpenGL via ANGLE"
+               elif OS.has_feature("mobile") or rendering_driver == "opengl3_es":
+                       graphics_api_string = "OpenGL ES"
+               elif OS.has_feature("web"):
+                       graphics_api_string = "WebGL"
+               elif rendering_driver == "opengl3":
+                       graphics_api_string = "OpenGL"
+
+       information.text = (
+                       "%s, %d threads\n" % [OS.get_processor_name().replace("(R)", "").replace("(TM)", ""), OS.get_processor_count()]
+                       + "%s %s (%s %s), %s %s\n" % [OS.get_name(), "64-bit" if OS.has_feature("64") else "32-bit", release_string, "double" if OS.has_feature("double") else "single", graphics_api_string, RenderingServer.get_video_adapter_api_version()]
+                       + "%s, %s" % [adapter_string, driver_info_string]
+       )
+
+
+func _fps_graph_draw() -> void:
+       var fps_polyline := PackedVector2Array()
+       fps_polyline.resize(HISTORY_NUM_FRAMES)
+       for fps_index in fps_history.size():
+               fps_polyline[fps_index] = Vector2(
+                               remap(fps_index, 0, fps_history.size(), 0, GRAPH_SIZE.x),
+                               remap(clampf(fps_history[fps_index], GRAPH_MIN_FPS, GRAPH_MAX_FPS), GRAPH_MIN_FPS, GRAPH_MAX_FPS, GRAPH_SIZE.y, 0.0)
+               )
+       # Don't use antialiasing to speed up line drawing, but use a width that scales with
+       # viewport scale to keep the line easily readable on hiDPI displays.
+       fps_graph.draw_polyline(fps_polyline, frame_time_gradient.sample(remap(frames_per_second, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0)), 1.0)
+
+
+func _total_graph_draw() -> void:
+       var total_polyline := PackedVector2Array()
+       total_polyline.resize(HISTORY_NUM_FRAMES)
+       for total_index in frame_history_total.size():
+               total_polyline[total_index] = Vector2(
+                               remap(total_index, 0, frame_history_total.size(), 0, GRAPH_SIZE.x),
+                               remap(clampf(frame_history_total[total_index], GRAPH_MIN_FPS, GRAPH_MAX_FPS), GRAPH_MIN_FPS, GRAPH_MAX_FPS, GRAPH_SIZE.y, 0.0)
+               )
+       # Don't use antialiasing to speed up line drawing, but use a width that scales with
+       # viewport scale to keep the line easily readable on hiDPI displays.
+       total_graph.draw_polyline(total_polyline, frame_time_gradient.sample(remap(1000.0 / frametime_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0)), 1.0)
+
+
+func _cpu_graph_draw() -> void:
+       var cpu_polyline := PackedVector2Array()
+       cpu_polyline.resize(HISTORY_NUM_FRAMES)
+       for cpu_index in frame_history_cpu.size():
+               cpu_polyline[cpu_index] = Vector2(
+                               remap(cpu_index, 0, frame_history_cpu.size(), 0, GRAPH_SIZE.x),
+                               remap(clampf(frame_history_cpu[cpu_index], GRAPH_MIN_FPS, GRAPH_MAX_FPS), GRAPH_MIN_FPS, GRAPH_MAX_FPS, GRAPH_SIZE.y, 0.0)
+               )
+       # Don't use antialiasing to speed up line drawing, but use a width that scales with
+       # viewport scale to keep the line easily readable on hiDPI displays.
+       cpu_graph.draw_polyline(cpu_polyline, frame_time_gradient.sample(remap(1000.0 / frametime_cpu_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0)), 1.0)
+
+
+func _gpu_graph_draw() -> void:
+       var gpu_polyline := PackedVector2Array()
+       gpu_polyline.resize(HISTORY_NUM_FRAMES)
+       for gpu_index in frame_history_gpu.size():
+               gpu_polyline[gpu_index] = Vector2(
+                               remap(gpu_index, 0, frame_history_gpu.size(), 0, GRAPH_SIZE.x),
+                               remap(clampf(frame_history_gpu[gpu_index], GRAPH_MIN_FPS, GRAPH_MAX_FPS), GRAPH_MIN_FPS, GRAPH_MAX_FPS, GRAPH_SIZE.y, 0.0)
+               )
+       # Don't use antialiasing to speed up line drawing, but use a width that scales with
+       # viewport scale to keep the line easily readable on hiDPI displays.
+       gpu_graph.draw_polyline(gpu_polyline, frame_time_gradient.sample(remap(1000.0 / frametime_gpu_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0)), 1.0)
+
+
+func _process(_delta: float) -> void:
+       if visible:
+               fps_graph.queue_redraw()
+               total_graph.queue_redraw()
+               cpu_graph.queue_redraw()
+               gpu_graph.queue_redraw()
+
+               # Difference between the last two rendered frames in milliseconds.
+               var frametime := (Time.get_ticks_usec() - last_tick) * 0.001
+
+               frame_history_total.push_back(frametime)
+               if frame_history_total.size() > HISTORY_NUM_FRAMES:
+                       frame_history_total.pop_front()
+
+               # Frametimes are colored following FPS logic (red = 10 FPS, yellow = 60 FPS, green = 110 FPS, cyan = 160 FPS).
+               # This makes the color gradient non-linear.
+               frametime_avg = frame_history_total.reduce(sum_func) / frame_history_total.size()
+               frame_history_total_avg.text = str(frametime_avg).pad_decimals(2)
+               frame_history_total_avg.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               var frametime_min: float = frame_history_total.min()
+               frame_history_total_min.text = str(frametime_min).pad_decimals(2)
+               frame_history_total_min.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_min, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               var frametime_max: float = frame_history_total.max()
+               frame_history_total_max.text = str(frametime_max).pad_decimals(2)
+               frame_history_total_max.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_max, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               frame_history_total_last.text = str(frametime).pad_decimals(2)
+               frame_history_total_last.modulate = frame_time_gradient.sample(remap(1000.0 / frametime, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               var viewport_rid := get_viewport().get_viewport_rid()
+               var frametime_cpu := RenderingServer.viewport_get_measured_render_time_cpu(viewport_rid) + RenderingServer.get_frame_setup_time_cpu()
+               frame_history_cpu.push_back(frametime_cpu)
+               if frame_history_cpu.size() > HISTORY_NUM_FRAMES:
+                       frame_history_cpu.pop_front()
+
+               frametime_cpu_avg = frame_history_cpu.reduce(sum_func) / frame_history_cpu.size()
+               frame_history_cpu_avg.text = str(frametime_cpu_avg).pad_decimals(2)
+               frame_history_cpu_avg.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_cpu_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               var frametime_cpu_min: float = frame_history_cpu.min()
+               frame_history_cpu_min.text = str(frametime_cpu_min).pad_decimals(2)
+               frame_history_cpu_min.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_cpu_min, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               var frametime_cpu_max: float = frame_history_cpu.max()
+               frame_history_cpu_max.text = str(frametime_cpu_max).pad_decimals(2)
+               frame_history_cpu_max.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_cpu_max, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               frame_history_cpu_last.text = str(frametime_cpu).pad_decimals(2)
+               frame_history_cpu_last.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_cpu, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               var frametime_gpu := RenderingServer.viewport_get_measured_render_time_gpu(viewport_rid)
+               frame_history_gpu.push_back(frametime_gpu)
+               if frame_history_gpu.size() > HISTORY_NUM_FRAMES:
+                       frame_history_gpu.pop_front()
+
+               frametime_gpu_avg = frame_history_gpu.reduce(sum_func) / frame_history_gpu.size()
+               frame_history_gpu_avg.text = str(frametime_gpu_avg).pad_decimals(2)
+               frame_history_gpu_avg.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_gpu_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               var frametime_gpu_min: float = frame_history_gpu.min()
+               frame_history_gpu_min.text = str(frametime_gpu_min).pad_decimals(2)
+               frame_history_gpu_min.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_gpu_min, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               var frametime_gpu_max: float = frame_history_gpu.max()
+               frame_history_gpu_max.text = str(frametime_gpu_max).pad_decimals(2)
+               frame_history_gpu_max.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_gpu_max, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               frame_history_gpu_last.text = str(frametime_gpu).pad_decimals(2)
+               frame_history_gpu_last.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_gpu, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+
+               frames_per_second = 1000.0 / frametime_avg
+               fps_history.push_back(frames_per_second)
+               if fps_history.size() > HISTORY_NUM_FRAMES:
+                       fps_history.pop_front()
+
+               fps.text = str(floor(frames_per_second)) + " FPS"
+               var frame_time_color := frame_time_gradient.sample(remap(frames_per_second, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
+               fps.modulate = frame_time_color
+
+               frame_time.text = str(frametime).pad_decimals(2) + " mspf"
+               frame_time.modulate = frame_time_color
+
+               var vsync_string := ""
+               match DisplayServer.window_get_vsync_mode():
+                       DisplayServer.VSYNC_ENABLED:
+                               vsync_string = "V-Sync"
+                       DisplayServer.VSYNC_ADAPTIVE:
+                               vsync_string = "Adaptive V-Sync"
+                       DisplayServer.VSYNC_MAILBOX:
+                               vsync_string = "Mailbox V-Sync"
+
+               if Engine.max_fps > 0 or OS.low_processor_usage_mode:
+                       # Display FPS cap determined by `Engine.max_fps` or low-processor usage mode sleep duration
+                       # (the lowest FPS cap is used).
+                       var low_processor_max_fps := roundi(1000000.0 / OS.low_processor_usage_mode_sleep_usec)
+                       var fps_cap := low_processor_max_fps
+                       if Engine.max_fps > 0:
+                               fps_cap = mini(Engine.max_fps, low_processor_max_fps)
+                       frame_time.text += " (cap: " + str(fps_cap) + " FPS"
+
+                       if not vsync_string.is_empty():
+                               frame_time.text += " + " + vsync_string
+
+                       frame_time.text += ")"
+               else:
+                       if not vsync_string.is_empty():
+                               frame_time.text += " (" + vsync_string + ")"
+
+               frame_number.text = "Frame: " + str(Engine.get_frames_drawn())
+
+       last_tick = Time.get_ticks_usec()
+
+
+func _on_visibility_changed() -> void:
+       if visible:
+               # Reset graphs to prevent them from looking strange before `HISTORY_NUM_FRAMES` frames
+               # have been drawn.
+               var frametime_last := (Time.get_ticks_usec() - last_tick) * 0.001
+               fps_history.resize(HISTORY_NUM_FRAMES)
+               fps_history.fill(1000.0 / frametime_last)
+               frame_history_total.resize(HISTORY_NUM_FRAMES)
+               frame_history_total.fill(frametime_last)
+               frame_history_cpu.resize(HISTORY_NUM_FRAMES)
+               var viewport_rid := get_viewport().get_viewport_rid()
+               frame_history_cpu.fill(RenderingServer.viewport_get_measured_render_time_cpu(viewport_rid) + RenderingServer.get_frame_setup_time_cpu())
+               frame_history_gpu.resize(HISTORY_NUM_FRAMES)
+               frame_history_gpu.fill(RenderingServer.viewport_get_measured_render_time_gpu(viewport_rid))
diff --git a/addons/debug_menu/debug_menu.tscn b/addons/debug_menu/debug_menu.tscn
new file mode 100644 (file)
index 0000000..9bfc9d6
--- /dev/null
@@ -0,0 +1,401 @@
+[gd_scene load_steps=3 format=3 uid="uid://cggqb75a8w8r"]
+
+[ext_resource type="Script" path="res://addons/debug_menu/debug_menu.gd" id="1_p440y"]
+
+[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ki0n8"]
+bg_color = Color(0, 0, 0, 0.25098)
+
+[node name="CanvasLayer" type="CanvasLayer" node_paths=PackedStringArray("fps", "frame_time", "frame_number", "frame_history_total_avg", "frame_history_total_min", "frame_history_total_max", "frame_history_total_last", "frame_history_cpu_avg", "frame_history_cpu_min", "frame_history_cpu_max", "frame_history_cpu_last", "frame_history_gpu_avg", "frame_history_gpu_min", "frame_history_gpu_max", "frame_history_gpu_last", "fps_graph", "total_graph", "cpu_graph", "gpu_graph", "information", "settings")]
+layer = 128
+script = ExtResource("1_p440y")
+fps = NodePath("DebugMenu/VBoxContainer/FPS")
+frame_time = NodePath("DebugMenu/VBoxContainer/FrameTime")
+frame_number = NodePath("DebugMenu/VBoxContainer/FrameNumber")
+frame_history_total_avg = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/TotalAvg")
+frame_history_total_min = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/TotalMin")
+frame_history_total_max = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/TotalMax")
+frame_history_total_last = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/TotalLast")
+frame_history_cpu_avg = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/CPUAvg")
+frame_history_cpu_min = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/CPUMin")
+frame_history_cpu_max = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/CPUMax")
+frame_history_cpu_last = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/CPULast")
+frame_history_gpu_avg = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/GPUAvg")
+frame_history_gpu_min = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/GPUMin")
+frame_history_gpu_max = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/GPUMax")
+frame_history_gpu_last = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/GPULast")
+fps_graph = NodePath("DebugMenu/VBoxContainer/FPSGraph/Graph")
+total_graph = NodePath("DebugMenu/VBoxContainer/TotalGraph/Graph")
+cpu_graph = NodePath("DebugMenu/VBoxContainer/CPUGraph/Graph")
+gpu_graph = NodePath("DebugMenu/VBoxContainer/GPUGraph/Graph")
+information = NodePath("DebugMenu/VBoxContainer/Information")
+settings = NodePath("DebugMenu/VBoxContainer/Settings")
+
+[node name="DebugMenu" type="Control" parent="."]
+custom_minimum_size = Vector2(400, 400)
+layout_mode = 3
+anchors_preset = 1
+anchor_left = 1.0
+anchor_right = 1.0
+offset_left = -416.0
+offset_top = 8.0
+offset_right = -16.0
+offset_bottom = 408.0
+grow_horizontal = 0
+size_flags_horizontal = 8
+size_flags_vertical = 4
+mouse_filter = 2
+
+[node name="VBoxContainer" type="VBoxContainer" parent="DebugMenu"]
+layout_mode = 1
+anchors_preset = 1
+anchor_left = 1.0
+anchor_right = 1.0
+offset_left = -300.0
+offset_bottom = 374.0
+grow_horizontal = 0
+mouse_filter = 2
+theme_override_constants/separation = 0
+
+[node name="FPS" type="Label" parent="DebugMenu/VBoxContainer"]
+modulate = Color(0, 1, 0, 1)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 5
+theme_override_constants/line_spacing = 0
+theme_override_font_sizes/font_size = 18
+text = "60 FPS"
+horizontal_alignment = 2
+
+[node name="FrameTime" type="Label" parent="DebugMenu/VBoxContainer"]
+modulate = Color(0, 1, 0, 1)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "16.67 mspf (cap: 123 FPS + Adaptive V-Sync)"
+horizontal_alignment = 2
+
+[node name="FrameNumber" type="Label" parent="DebugMenu/VBoxContainer"]
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "Frame: 1234"
+horizontal_alignment = 2
+
+[node name="FrameTimeHistory" type="GridContainer" parent="DebugMenu/VBoxContainer"]
+layout_mode = 2
+size_flags_horizontal = 8
+mouse_filter = 2
+theme_override_constants/h_separation = 0
+theme_override_constants/v_separation = 0
+columns = 5
+
+[node name="Spacer" type="Control" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+custom_minimum_size = Vector2(60, 0)
+layout_mode = 2
+mouse_filter = 2
+
+[node name="AvgHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "Average"
+horizontal_alignment = 2
+
+[node name="MinHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "Best"
+horizontal_alignment = 2
+
+[node name="MaxHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "Worst"
+horizontal_alignment = 2
+
+[node name="LastHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "Last"
+horizontal_alignment = 2
+
+[node name="TotalHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "Total:"
+horizontal_alignment = 2
+
+[node name="TotalAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "123.45"
+horizontal_alignment = 2
+
+[node name="TotalMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "123.45"
+horizontal_alignment = 2
+
+[node name="TotalMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "123.45"
+horizontal_alignment = 2
+
+[node name="TotalLast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "123.45"
+horizontal_alignment = 2
+
+[node name="CPUHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "CPU:"
+horizontal_alignment = 2
+
+[node name="CPUAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "123.45"
+horizontal_alignment = 2
+
+[node name="CPUMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "12.34"
+horizontal_alignment = 2
+
+[node name="CPUMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "123.45"
+horizontal_alignment = 2
+
+[node name="CPULast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "123.45"
+horizontal_alignment = 2
+
+[node name="GPUHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "GPU:"
+horizontal_alignment = 2
+
+[node name="GPUAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "123.45"
+horizontal_alignment = 2
+
+[node name="GPUMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "1.23"
+horizontal_alignment = 2
+
+[node name="GPUMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "123.45"
+horizontal_alignment = 2
+
+[node name="GPULast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
+modulate = Color(0, 1, 0, 1)
+custom_minimum_size = Vector2(50, 0)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "123.45"
+horizontal_alignment = 2
+
+[node name="FPSGraph" type="HBoxContainer" parent="DebugMenu/VBoxContainer"]
+layout_mode = 2
+mouse_filter = 2
+alignment = 2
+
+[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/FPSGraph"]
+custom_minimum_size = Vector2(0, 27)
+layout_mode = 2
+size_flags_horizontal = 8
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "FPS: ↑"
+vertical_alignment = 1
+
+[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/FPSGraph"]
+custom_minimum_size = Vector2(150, 25)
+layout_mode = 2
+size_flags_vertical = 0
+mouse_filter = 2
+theme_override_styles/panel = SubResource("StyleBoxFlat_ki0n8")
+
+[node name="TotalGraph" type="HBoxContainer" parent="DebugMenu/VBoxContainer"]
+layout_mode = 2
+mouse_filter = 2
+alignment = 2
+
+[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/TotalGraph"]
+custom_minimum_size = Vector2(0, 27)
+layout_mode = 2
+size_flags_horizontal = 8
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "Total: ↓"
+vertical_alignment = 1
+
+[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/TotalGraph"]
+custom_minimum_size = Vector2(150, 25)
+layout_mode = 2
+size_flags_vertical = 0
+mouse_filter = 2
+theme_override_styles/panel = SubResource("StyleBoxFlat_ki0n8")
+
+[node name="CPUGraph" type="HBoxContainer" parent="DebugMenu/VBoxContainer"]
+layout_mode = 2
+mouse_filter = 2
+alignment = 2
+
+[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/CPUGraph"]
+custom_minimum_size = Vector2(0, 27)
+layout_mode = 2
+size_flags_horizontal = 8
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "CPU: ↓"
+vertical_alignment = 1
+
+[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/CPUGraph"]
+custom_minimum_size = Vector2(150, 25)
+layout_mode = 2
+size_flags_vertical = 0
+mouse_filter = 2
+theme_override_styles/panel = SubResource("StyleBoxFlat_ki0n8")
+
+[node name="GPUGraph" type="HBoxContainer" parent="DebugMenu/VBoxContainer"]
+layout_mode = 2
+mouse_filter = 2
+alignment = 2
+
+[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/GPUGraph"]
+custom_minimum_size = Vector2(0, 27)
+layout_mode = 2
+size_flags_horizontal = 8
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "GPU: ↓"
+vertical_alignment = 1
+
+[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/GPUGraph"]
+custom_minimum_size = Vector2(150, 25)
+layout_mode = 2
+size_flags_vertical = 0
+mouse_filter = 2
+theme_override_styles/panel = SubResource("StyleBoxFlat_ki0n8")
+
+[node name="Information" type="Label" parent="DebugMenu/VBoxContainer"]
+modulate = Color(1, 1, 1, 0.752941)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "12th Gen Intel(R) Core(TM) i0-1234K
+Windows 12 64-bit (double precision), Vulkan 1.2.34
+NVIDIA GeForce RTX 1234, 123.45.67"
+horizontal_alignment = 2
+
+[node name="Settings" type="Label" parent="DebugMenu/VBoxContainer"]
+modulate = Color(0.8, 0.84, 1, 0.752941)
+layout_mode = 2
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 3
+theme_override_font_sizes/font_size = 12
+text = "Project Version: 1.2.3
+Rendering Method: Forward+
+Window: 1234×567, Viewport: 1234×567
+3D Scale (FSR 1.0): 100% = 1234×567
+3D Antialiasing: TAA + 2× MSAA + FXAA
+SSR: 123 Steps
+SSAO: On
+SSIL: On
+SDFGI: 1 Cascades
+Glow: On
+Volumetric Fog: On
+2D Antialiasing: 2× MSAA"
+horizontal_alignment = 2
+
+[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
diff --git a/addons/debug_menu/plugin.cfg b/addons/debug_menu/plugin.cfg
new file mode 100644 (file)
index 0000000..54100f7
--- /dev/null
@@ -0,0 +1,7 @@
+[plugin]
+
+name="Debug Menu"
+description="In-game debug menu displaying performance metrics and hardware information"
+author="Calinou"
+version="1.2.0"
+script="plugin.gd"
diff --git a/addons/debug_menu/plugin.gd b/addons/debug_menu/plugin.gd
new file mode 100644 (file)
index 0000000..5ec132e
--- /dev/null
@@ -0,0 +1,29 @@
+@tool
+extends EditorPlugin
+
+func _enter_tree() -> void:
+       add_autoload_singleton("DebugMenu", "res://addons/debug_menu/debug_menu.tscn")
+
+       # FIXME: This appears to do nothing.
+#      if not ProjectSettings.has_setting("application/config/version"):
+#              ProjectSettings.set_setting("application/config/version", "1.0.0")
+#
+#      ProjectSettings.set_initial_value("application/config/version", "1.0.0")
+#      ProjectSettings.add_property_info({
+#              name = "application/config/version",
+#              type = TYPE_STRING,
+#      })
+#
+#      if not InputMap.has_action("cycle_debug_menu"):
+#              InputMap.add_action("cycle_debug_menu")
+#              var event := InputEventKey.new()
+#              event.keycode = KEY_F3
+#              InputMap.action_add_event("cycle_debug_menu", event)
+#
+#      ProjectSettings.save()
+
+
+func _exit_tree() -> void:
+       remove_autoload_singleton("DebugMenu")
+       # Don't remove the project setting's value and input map action,
+       # as the plugin may be re-enabled in the future.
diff --git a/addons/godot-git-plugin/LICENSE b/addons/godot-git-plugin/LICENSE
new file mode 100644 (file)
index 0000000..f153fb8
--- /dev/null
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2016-2023 The Godot Engine community
+
+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.
diff --git a/addons/godot-git-plugin/THIRDPARTY.md b/addons/godot-git-plugin/THIRDPARTY.md
new file mode 100644 (file)
index 0000000..837488f
--- /dev/null
@@ -0,0 +1,1349 @@
+# Third-Party Notices
+
+The Godot Git Plugin source code uses the following third-party source code:
+
+1. godotengine/godot-cpp - MIT License - https://github.com/godotengine/godot-cpp/tree/02336831735fd6affbe0a6fa252ec98d3e78120c
+2. libgit2/libgit2 - GPLv2 with a special Linking Exception - https://github.com/libgit2/libgit2/tree/b7bad55e4bb0a285b073ba5e02b01d3f522fc95d
+3. libssh2/libssh2 - BSD-3-Clause License - https://github.com/libssh2/libssh2/tree/635caa90787220ac3773c1d5ba11f1236c22eae8
+
+We also link to these third-party libraries (only in the compiled binary form):
+
+1. OpenSSL - Only on Linux and MacOS - OpenSSL License - http://www.openssl.org/source/openssl-1.1.1s.tar.gz
+
+## License Texts
+
+### godotengine/godot-cpp
+
+```
+# MIT License
+
+Copyright (c) 2017-2022 Godot Engine contributors.
+
+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.
+```
+
+### libgit2/libgit2
+
+```
+ libgit2 is Copyright (C) the libgit2 contributors,
+ unless otherwise stated. See the AUTHORS file for details.
+
+ Note that the only valid version of the GPL as far as this project
+ is concerned is _this_ particular version of the license (ie v2, not
+ v2.2 or v3.x or whatever), unless explicitly otherwise stated.
+
+----------------------------------------------------------------------
+
+                       LINKING EXCEPTION
+
+ In addition to the permissions in the GNU General Public License,
+ the authors give you unlimited permission to link the compiled
+ version of this library into combinations with other programs,
+ and to distribute those combinations without any restriction
+ coming from the use of this file.  (The General Public License
+ restrictions do apply in other respects; for example, they cover
+ modification of the file, and distribution when not linked into
+ a combined executable.)
+
+----------------------------------------------------------------------
+
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+----------------------------------------------------------------------
+
+The bundled ZLib code is licensed under the ZLib license:
+
+Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  [email protected]          [email protected]
+
+----------------------------------------------------------------------
+
+The Clar framework is licensed under the ISC license:
+
+Copyright (c) 2011-2015 Vicent Marti
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+----------------------------------------------------------------------
+
+The regex library (deps/regex/) is licensed under the GNU LGPL
+(available at the end of this file).
+
+Definitions for data structures and routines for the regular
+expression library.
+
+Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006,2008
+Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with the GNU C Library; if not, write to the Free
+Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+----------------------------------------------------------------------
+
+The bundled winhttp definition files (deps/winhttp/) are licensed under
+the GNU LGPL (available at the end of this file).
+
+Copyright (C) 2007 Francois Gouget
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+----------------------------------------------------------------------
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+----------------------------------------------------------------------
+
+The bundled SHA1 collision detection code is licensed under the MIT license:
+
+MIT License
+
+Copyright (c) 2017:
+    Marc Stevens
+    Cryptology Group
+    Centrum Wiskunde & Informatica
+    P.O. Box 94079, 1090 GB Amsterdam, Netherlands
+
+    Dan Shumow
+    Microsoft Research
+
+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.
+
+----------------------------------------------------------------------
+
+The bundled wildmatch code is licensed under the BSD license:
+
+Copyright Rich Salz.
+All rights reserved.
+
+Redistribution and use in any form are permitted provided that the
+following restrictions are are met:
+
+1.  Source distributions must retain this entire copyright notice
+    and comment.
+2.  Binary distributions must include the acknowledgement ``This
+    product includes software developed by Rich Salz'' in the
+    documentation or other materials provided with the
+    distribution.  This must not be represented as an endorsement
+   or promotion without specific prior written permission.
+3.  The origin of this software must not be misrepresented, either
+    by explicit claim or by omission.  Credits must appear in the
+    source and documentation.
+4.  Altered versions must be plainly marked as such in the source
+    and documentation and must not be misrepresented as being the
+    original software.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+----------------------------------------------------------------------
+
+Portions of the OpenSSL headers are included under the OpenSSL license:
+
+Copyright (C) 1995-1998 Eric Young ([email protected])
+All rights reserved.
+
+This package is an SSL implementation written
+by Eric Young ([email protected]).
+The implementation was written so as to conform with Netscapes SSL.
+
+This library is free for commercial and non-commercial use as long as
+the following conditions are aheared to.  The following conditions
+apply to all code found in this distribution, be it the RC4, RSA,
+lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+included with this distribution is covered by the same copyright terms
+except that the holder is Tim Hudson ([email protected]).
+
+Copyright remains Eric Young's, and as such any Copyright notices in
+the code are not to be removed.
+If this package is used in a product, Eric Young should be given attribution
+as the author of the parts of the library used.
+This can be in the form of a textual message at program startup or
+in documentation (online or textual) provided with the package.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. All advertising materials mentioning features or use of this software
+   must display the following acknowledgement:
+   "This product includes cryptographic software written by
+    Eric Young ([email protected])"
+   The word 'cryptographic' can be left out if the rouines from the library
+   being used are not cryptographic related :-).
+4. If you include any Windows specific code (or a derivative thereof) from
+   the apps directory (application code) you must include an acknowledgement:
+   "This product includes software written by Tim Hudson ([email protected])"
+
+THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+The licence and distribution terms for any publically available version or
+derivative of this code cannot be changed.  i.e. this code cannot simply be
+copied and put under another distribution licence
+[including the GNU Public Licence.]
+
+====================================================================
+Copyright (c) 1998-2007 The OpenSSL Project.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in
+   the documentation and/or other materials provided with the
+   distribution.
+
+3. All advertising materials mentioning features or use of this
+   software must display the following acknowledgment:
+   "This product includes software developed by the OpenSSL Project
+   for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+
+4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+   endorse or promote products derived from this software without
+   prior written permission. For written permission, please contact
+
+5. Products derived from this software may not be called "OpenSSL"
+   nor may "OpenSSL" appear in their names without prior written
+   permission of the OpenSSL Project.
+
+6. Redistributions of any form whatsoever must retain the following
+   acknowledgment:
+   "This product includes software developed by the OpenSSL Project
+   for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+
+THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+```
+
+### libssh2/libssh2
+
+```
+/* Copyright (c) 2004-2007 Sara Golemon <[email protected]>
+ * Copyright (c) 2005,2006 Mikhail Gusarov <[email protected]>
+ * Copyright (c) 2006-2007 The Written Word, Inc.
+ * Copyright (c) 2007 Eli Fant <[email protected]>
+ * Copyright (c) 2009-2021 Daniel Stenberg
+ * Copyright (C) 2008, 2009 Simon Josefsson
+ * Copyright (c) 2000 Markus Friedl
+ * Copyright (c) 2015 Microsoft Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ *   Redistributions of source code must retain the above
+ *   copyright notice, this list of conditions and the
+ *   following disclaimer.
+ *
+ *   Redistributions in binary form must reproduce the above
+ *   copyright notice, this list of conditions and the following
+ *   disclaimer in the documentation and/or other materials
+ *   provided with the distribution.
+ *
+ *   Neither the name of the copyright holder nor the names
+ *   of any other contributors may be used to endorse or
+ *   promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ */
+```
+
+### OpenSSL
+
+```
+
+  LICENSE ISSUES
+  ==============
+
+  The OpenSSL toolkit stays under a double license, i.e. both the conditions of
+  the OpenSSL License and the original SSLeay license apply to the toolkit.
+  See below for the actual license texts.
+
+  OpenSSL License
+  ---------------
+
+/* ====================================================================
+ * Copyright (c) 1998-2019 The OpenSSL Project.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ *    software must display the following acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For written permission, please contact
+ *    [email protected].
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ *    nor may "OpenSSL" appear in their names without prior written
+ *    permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * ([email protected]).  This product includes software written by Tim
+ * Hudson ([email protected]).
+ *
+ */
+
+ Original SSLeay License
+ -----------------------
+
+/* Copyright (C) 1995-1998 Eric Young ([email protected])
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young ([email protected]).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson ([email protected]).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young ([email protected])"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson ([email protected])"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+```
diff --git a/addons/godot-git-plugin/git_plugin.gdextension b/addons/godot-git-plugin/git_plugin.gdextension
new file mode 100644 (file)
index 0000000..49fffbf
--- /dev/null
@@ -0,0 +1,12 @@
+[configuration]
+
+entry_symbol = "git_plugin_init"
+compatibility_minimum = "4.1.0"
+
+[libraries]
+
+macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
+windows.editor.x86_64 = "win64/libgit_plugin.windows.editor.x86_64.dll"
+linux.editor.x86_64 = "linux/libgit_plugin.linux.editor.x86_64.so"
+linux.editor.arm64 = "linux/libgit_plugin.linux.editor.arm64.so"
+linux.editor.rv64 = ""
diff --git a/addons/godot-git-plugin/linux/libgit_plugin.linux.editor.x86_64.so b/addons/godot-git-plugin/linux/libgit_plugin.linux.editor.x86_64.so
new file mode 100644 (file)
index 0000000..8dab6db
Binary files /dev/null and b/addons/godot-git-plugin/linux/libgit_plugin.linux.editor.x86_64.so differ
diff --git a/addons/godot-git-plugin/macos/libgit_plugin.macos.editor.universal.dylib b/addons/godot-git-plugin/macos/libgit_plugin.macos.editor.universal.dylib
new file mode 100644 (file)
index 0000000..644aa2a
Binary files /dev/null and b/addons/godot-git-plugin/macos/libgit_plugin.macos.editor.universal.dylib differ
diff --git a/addons/godot-git-plugin/plugin.cfg b/addons/godot-git-plugin/plugin.cfg
new file mode 100644 (file)
index 0000000..9c4e36f
--- /dev/null
@@ -0,0 +1,7 @@
+[plugin]
+
+name="Godot Git Plugin"
+description="This plugin lets you interact with Git without leaving the Godot editor. More information can be found at https://github.com/godotengine/godot-git-plugin/wiki"
+author="twaritwaikar"
+version="v3.1.1"
+script="godot-git-plugin.gd"
diff --git a/addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.dll b/addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.dll
new file mode 100644 (file)
index 0000000..47bbb1d
Binary files /dev/null and b/addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.dll differ
diff --git a/addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.exp b/addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.exp
new file mode 100644 (file)
index 0000000..6c68d89
Binary files /dev/null and b/addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.exp differ
diff --git a/addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.lib b/addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.lib
new file mode 100644 (file)
index 0000000..4537929
Binary files /dev/null and b/addons/godot-git-plugin/win64/libgit_plugin.windows.editor.x86_64.lib differ
diff --git a/addons/health_bar_2d/LICENSE.md b/addons/health_bar_2d/LICENSE.md
new file mode 100644 (file)
index 0000000..5cb1c0c
--- /dev/null
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Ashutosh Vishu Yadav
+
+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.
diff --git a/addons/health_bar_2d/README.md b/addons/health_bar_2d/README.md
new file mode 100644 (file)
index 0000000..2817b87
--- /dev/null
@@ -0,0 +1,48 @@
+# HealthBar2D
+
+<p align="center">
+  <img height="150px" src="https://user-images.githubusercontent.com/66784253/211215415-80537f1b-c3b8-42ea-90ea-bf20cdafd01e.png" alt="addon-icon"/>
+</p>
+
+
+> Note: this addon is under development/testing right now
+
+A 2d Health bar implementation for the Godot Engine, written in GDScript.
+
+This project is a Godot Engine addon that adds a HealthBar2D node to the editor. It extends the TextureProgress node and can be used to make various Progress bars that can represent Health, Stamina, Hunger, etc. It is released under the terms of the MIT License.
+
+## Installation
+- Clone this repository and move the content of the addons directory into the `res://addons` of your project
+- In your project settings, enable the plugin
+
+## Usage
+After enabling, it will add a HealthBar2D node.
+- Add this node as a child of the character you like
+- As it extends from TextureProgress it will require texture. You can use the given `health_bar_texture.png` in the resources directory of the addon.
+- resize the `Rect` control property by clicking the circular arrow in the Inspector
+- Now you need two things in the parent character script. the `health` variable and the `health_changed` signal
+
+```gdscript
+extends KinematicBody2D  # example
+
+signal health_changed
+
+var health := 10
+```
+- Before running the project. you also need to call the `initialize` method from the parent
+
+> One can add multiple bars using `HealthBar2D` and handle value change logic inside character script, just remember to `emit` the related `signal`.
+```gdscript
+func _ready() -> void:
+    $HealthBar2D.initialize("health_changed", health)
+```
+- Now whenever the character takes damage, emit our `health_changed` signal with the current health.
+
+
+```gdscript
+emit_signal("health_changed", health)
+```
+
+Thats it!
+
+You can take a look at `example.tscn` scene in the `example` directory for a working example.
diff --git a/addons/health_bar_2d/addon.gd b/addons/health_bar_2d/addon.gd
new file mode 100644 (file)
index 0000000..6a1a7db
--- /dev/null
@@ -0,0 +1,13 @@
+@tool
+extends EditorPlugin
+
+var icon = preload("res://addons/health_bar_2d/icon.png")
+var health_bar_2d = preload("res://addons/health_bar_2d/health_bar_2d.gd")
+
+
+func _enter_tree():
+       add_custom_type("HealthBar2D", "TextureProgressBar", health_bar_2d, icon)
+
+
+func _exit_tree():
+       remove_custom_type("HealthBar2D")
diff --git a/addons/health_bar_2d/examples/bullet.gd b/addons/health_bar_2d/examples/bullet.gd
new file mode 100644 (file)
index 0000000..25d1699
--- /dev/null
@@ -0,0 +1,22 @@
+extends Area2D
+
+@onready var vn = $VN
+
+var direction := Vector2.ZERO
+var _speed := 200
+
+
+func _ready() -> void:
+       connect("body_entered", _detected)
+       vn.connect("screen_exited", queue_free)
+       rotation = direction.angle()
+
+
+func _process(delta) -> void:
+       position += direction * delta * _speed
+
+
+func _detected(body: Node2D) -> void:
+       if body.name == "Player":
+               body.hurt()
+               queue_free()
diff --git a/addons/health_bar_2d/examples/bullet.tscn b/addons/health_bar_2d/examples/bullet.tscn
new file mode 100644 (file)
index 0000000..ea110db
--- /dev/null
@@ -0,0 +1,18 @@
+[gd_scene load_steps=2 format=2]
+
+[ext_resource path="res://addons/health_bar_2d/examples/bullet.gd" type="Script" id=1]
+
+[node name="Bullet" type="Area2D"]
+collision_layer = 2
+collision_mask = 17
+script = ExtResource( 1 )
+
+[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
+polygon = PackedVector2Array( 0, 0, -2, -2, -2, 2 )
+
+[node name="Polygon2D" type="Polygon2D" parent="."]
+position = Vector2( 0, -0.5 )
+scale = Vector2( 2, 1.5 )
+polygon = PackedVector2Array( -1, -1, -1, 1.66667, 0, 0.333333 )
+
+[node name="VN" type="VisibleOnScreenNotifier2D" parent="."]
diff --git a/addons/health_bar_2d/examples/example.tscn b/addons/health_bar_2d/examples/example.tscn
new file mode 100644 (file)
index 0000000..a17dd25
--- /dev/null
@@ -0,0 +1,57 @@
+[gd_scene load_steps=6 format=3 uid="uid://1lstnl4xitt7"]
+
+[ext_resource type="PackedScene" path="res://addons/health_bar_2d/examples/player.tscn" id="1"]
+[ext_resource type="Script" path="res://addons/health_bar_2d/health_bar_2d.gd" id="2"]
+[ext_resource type="PackedScene" uid="uid://b7w7epnvdwsos" path="res://addons/health_bar_2d/examples/turrent.tscn" id="3"]
+[ext_resource type="PackedScene" path="res://addons/health_bar_2d/examples/heal.tscn" id="4"]
+[ext_resource type="Texture2D" uid="uid://cnjw8wn77f05i" path="res://addons/health_bar_2d/resources/health_bar_texture.png" id="5"]
+
+[node name="World" type="Node2D"]
+
+[node name="Label" type="Label" parent="."]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+text = "Use Arrow keys to move, SHIFT to sprint"
+
+[node name="Player" parent="." instance=ExtResource("1")]
+position = Vector2(237, 152)
+
+[node name="HealthBar2D" type="TextureProgressBar" parent="Player"]
+value = 5.0
+texture_under = ExtResource("5")
+texture_progress = ExtResource("5")
+tint_under = Color(0.105882, 0.105882, 0.105882, 0.858824)
+tint_progress = Color(1, 0, 0, 1)
+script = ExtResource("2")
+_animation_timeout = 0.5
+_offset = Vector2(0, -16)
+
+[node name="HealthBar2D2" type="TextureProgressBar" parent="Player"]
+value = 50.0
+texture_under = ExtResource("5")
+texture_progress = ExtResource("5")
+tint_under = Color(0.117647, 0.117647, 0.117647, 0.698039)
+tint_progress = Color(0.988235, 1, 0.592157, 1)
+script = ExtResource("2")
+_animation_timeout = 0.5
+_offset = Vector2(0, -22)
+
+[node name="Camera2D" type="Camera2D" parent="."]
+position = Vector2(256, 148)
+
+[node name="Turrent" parent="." instance=ExtResource("3")]
+position = Vector2(121, 202)
+
+[node name="Turrent2" parent="." instance=ExtResource("3")]
+position = Vector2(97, 59)
+
+[node name="Turrent3" parent="." instance=ExtResource("3")]
+position = Vector2(405, 77)
+
+[node name="Turrent4" parent="." instance=ExtResource("3")]
+position = Vector2(358, 221)
+
+[node name="Heal" parent="." instance=ExtResource("4")]
+position = Vector2(246, 134)
+collision_mask = 16
diff --git a/addons/health_bar_2d/examples/heal.gd b/addons/health_bar_2d/examples/heal.gd
new file mode 100644 (file)
index 0000000..8903bf1
--- /dev/null
@@ -0,0 +1,13 @@
+extends Area2D
+
+@export var _heal_power := 10
+
+
+func _ready() -> void:
+       connect("body_entered", _heal)
+
+
+func _heal(body: Node) -> void:
+       if body.name == "Player":
+               body.health = _heal_power
+               body.emit_signal("health_changed", body.health)
diff --git a/addons/health_bar_2d/examples/heal.tscn b/addons/health_bar_2d/examples/heal.tscn
new file mode 100644 (file)
index 0000000..4a4b5af
--- /dev/null
@@ -0,0 +1,28 @@
+[gd_scene load_steps=3 format=2]
+
+[ext_resource path="res://addons/health_bar_2d/examples/heal.gd" type="Script" id=1]
+
+[sub_resource type="CircleShape2D" id=1]
+radius = 29.0172
+
+[node name="Heal" type="Area2D"]
+script = ExtResource( 1 )
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
+visible = false
+shape = SubResource( 1 )
+
+[node name="Polygon2D" type="Polygon2D" parent="."]
+z_index = -1
+color = Color( 0.207843, 0.278431, 0.34902, 0.439216 )
+polygon = PackedVector2Array( 0, -29, -7, -28, -16, -24, -22, -19, -25, -13, -29, -6, -28, 4, -24, 16, -15, 25, -6, 29, 6, 29, 15, 25, 21, 21, 25, 15, 29, 7, 29, -4, 26, -12, 20, -21, 15, -25, 7, -28 )
+
+[node name="Label" type="Label" parent="."]
+modulate = Color( 1, 1, 1, 0.345098 )
+offset_left = -20.0
+offset_top = -6.0
+offset_right = 20.0
+offset_bottom = 8.0
+text = "heal"
+align = 1
+valign = 1
diff --git a/addons/health_bar_2d/examples/player.gd b/addons/health_bar_2d/examples/player.gd
new file mode 100644 (file)
index 0000000..194918e
--- /dev/null
@@ -0,0 +1,41 @@
+extends CharacterBody2D
+
+# Need to be added to use the HealthBar2D
+signal health_changed
+signal stamina_changed
+
+var direction = Vector2.ZERO
+var speed := 100
+var sprint_speed := 150
+# Need to be added to use the HealthBar2D
+var health := 10
+var max_stamina := 50.0
+var stamina := max_stamina
+
+
+func _ready() -> void:
+       # Need to be called to use the HealthBar2D
+       $HealthBar2D.initialize("health_changed", health)
+       $HealthBar2D2.initialize("stamina_changed", max_stamina)
+
+
+func _process(delta) -> void:
+       direction.x = int(Input.is_action_pressed("ui_right")) - int(Input.is_action_pressed("ui_left"))
+       direction.y = int(Input.is_action_pressed("ui_down")) - int(Input.is_action_pressed("ui_up"))
+       velocity = direction.normalized() * speed
+               
+       if Input.is_action_pressed("sprint") and stamina > 0:
+               velocity = direction.normalized() * sprint_speed
+               stamina -= 0.5
+               emit_signal("stamina_changed", stamina)
+       elif stamina < max_stamina:
+               stamina += 0.2
+               emit_signal("stamina_changed", stamina)
+       
+       move_and_slide()
+
+
+func hurt() -> void:
+       if health > 0:
+               health -= 1
+               emit_signal("health_changed", health)
diff --git a/addons/health_bar_2d/examples/player.tscn b/addons/health_bar_2d/examples/player.tscn
new file mode 100644 (file)
index 0000000..b8c7799
--- /dev/null
@@ -0,0 +1,27 @@
+[gd_scene load_steps=3 format=2]
+
+[ext_resource path="res://addons/health_bar_2d/examples/player.gd" type="Script" id=1]
+
+[sub_resource type="CircleShape2D" id=1]
+radius = 12.1655
+
+[node name="Player" type="CharacterBody2D"]
+collision_layer = 16
+collision_mask = 3
+script = ExtResource( 1 )
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
+shape = SubResource( 1 )
+
+[node name="Polygon2D" type="Polygon2D" parent="."]
+position = Vector2( 9.53674e-07, 9.53674e-07 )
+scale = Vector2( 3.26804, 2.8943 )
+color = Color( 0.0705882, 0.290196, 0.34902, 1 )
+polygon = PackedVector2Array( 0, -4.83709, -2.14196, -3.62782, -3.21294, -2.41855, -3.21294, 1.20927, -2.14196, 3.62782, 0, 4.83709, 2.14196, 3.62782, 3.21294, 1.20927, 3.21294, -2.41855, 2.14196, -3.62782 )
+
+[node name="Polygon2D2" type="Polygon2D" parent="."]
+position = Vector2( 0, 2 )
+rotation = 3.14159
+scale = Vector2( 0.675475, 0.598226 )
+color = Color( 0.478431, 0.478431, 0.478431, 1 )
+polygon = PackedVector2Array( -2.87234, -0.216216, -1.91489, 0.648649, -0.957447, 0.864865, 0.765957, 0.864865, 2.29787, 0.432432, 3.06383, -0.216216, 3.06383, 0.432432, 2.29787, 1.08108, 0.765957, 1.51351, -0.957447, 1.51351, -1.91489, 1.2973, -3.06383, 0.216216 )
diff --git a/addons/health_bar_2d/examples/turrent.gd b/addons/health_bar_2d/examples/turrent.gd
new file mode 100644 (file)
index 0000000..92cbdc2
--- /dev/null
@@ -0,0 +1,43 @@
+extends Area2D
+
+@onready var nozzle = $Nozzle
+
+@export var bullet: PackedScene
+
+var _target: Node2D
+var _timer: Timer
+
+
+func _ready():
+       _config_timer()
+       connect("body_entered", _detected)
+       connect("body_exited", _lost)
+
+
+func _config_timer() -> void:
+       _timer = Timer.new()
+       _timer.autostart = true
+       _timer.wait_time = 0.5
+       add_child(_timer)
+       _timer.connect("timeout", _shoot)
+
+
+func _shoot() -> void:
+       if _target:
+               var dir = (_target.global_position - global_position).normalized()
+               nozzle.rotation = dir.angle()
+               var b = bullet.instantiate()
+               b.global_position = nozzle.get_child(0).global_position
+               b.direction = dir
+               get_tree().get_root().add_child(b)
+       _timer.start()
+
+
+func _detected(body: Node2D) -> void:
+       if body.name == "Player":
+               _target = body
+
+
+func _lost(body: Node2D) -> void:
+       if body.name == "Player":
+               _target = null
diff --git a/addons/health_bar_2d/examples/turrent.tscn b/addons/health_bar_2d/examples/turrent.tscn
new file mode 100644 (file)
index 0000000..fc1f315
--- /dev/null
@@ -0,0 +1,24 @@
+[gd_scene load_steps=4 format=3 uid="uid://b7w7epnvdwsos"]
+
+[ext_resource type="Script" path="res://addons/health_bar_2d/examples/turrent.gd" id="1"]
+[ext_resource type="PackedScene" path="res://addons/health_bar_2d/examples/bullet.tscn" id="2"]
+
+[sub_resource type="CircleShape2D" id="1"]
+radius = 89.0056
+
+[node name="Turrent" type="Area2D"]
+collision_mask = 16
+script = ExtResource("1")
+bullet = ExtResource("2")
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
+shape = SubResource("1")
+
+[node name="Nozzle" type="Polygon2D" parent="."]
+scale = Vector2(1.11111, 1)
+color = Color(0.47451, 0.333333, 0.333333, 1)
+polygon = PackedVector2Array(9, -3, 0, 0, 9, 3)
+
+[node name="Marker2D" type="Marker2D" parent="Nozzle"]
+position = Vector2(9.9, 0)
+scale = Vector2(0.9, 1)
diff --git a/addons/health_bar_2d/health_bar_2d.gd b/addons/health_bar_2d/health_bar_2d.gd
new file mode 100644 (file)
index 0000000..8c62537
--- /dev/null
@@ -0,0 +1,115 @@
+extends TextureProgressBar
+
+# if false, health bar will only show itself when value is changed
+@export var _static:bool = false
+# if set true, health bar color will change as value decreases
+@export var _gradient:bool = false
+# time out for show/hide health bar animation
+@export var _animation_timeout:float = 1.0
+# offset of health bar from player
+@export var _offset:Vector2 = Vector2(0, -6)
+
+# Colors #
+const _colors = {
+       "neutral": "#00489d",
+       "danger": "#9d0000",
+       "success": "#009d36",
+       "caution": "#d1ce00"
+}
+
+var _parent: Node
+var _center_offset: Vector2 = size/2
+#var _tween: Tween
+var _timer: Timer
+
+
+func _ready() -> void:
+       _setup()
+
+
+func _setup() -> void:
+       """Connects value_changed signal to _tween_fade or _color
+       method according to exported _static and _gradient variables.
+       """
+       if not _static:
+#              _tween = Tween.new()
+#              add_child(_tween)
+               connect("value_changed", _show)
+               modulate.a = 0
+               
+               _timer = Timer.new()
+               add_child(_timer)
+               _timer.connect("timeout", _fade)
+               _timer.wait_time = _animation_timeout
+
+       if _gradient:
+               connect("value_changed", _color)
+
+
+func _process(delta) -> void:
+       """Initialize the health bar for use in game.
+       It must be called for HealthBar2D to work.
+       """
+       if _parent:
+               set_rotation(-_parent.rotation)
+               set_global_position(_parent.position + _offset - _center_offset)
+
+
+func initialize(signal_string: String, conneted_bar_max_value) -> void:
+       """Initialize the health bar for use in game.
+       It must be called for HealthBar2D to work.
+       """
+       print("Info: Initialized %s %s signal" % [name, signal_string])
+       _parent = get_parent()
+       _parent.connect(signal_string, _handle_value)
+       max_value = conneted_bar_max_value
+       value = max_value
+
+
+func _handle_value(val: int) -> void:
+       """Sets the parent health to texture progress value.
+       """
+       if max_value >= val:
+               value = val
+
+
+func _show(val: float) -> void:
+       """Method handles the health bar visibility.
+       """
+       _timer.start()
+       _tween(1)
+
+
+func _fade() -> void:
+       """Method handles the health bar visibility.
+       """
+       _tween(0)
+
+
+func _color(val: float) -> void:
+       """Method handles the color of health bar.
+       """
+       if _prc(val, 30):
+               tint_progress = _colors.danger
+       elif _prc(val, 55):
+               tint_progress = _colors.caution
+       else:
+               tint_progress = _colors.success
+
+
+func _prc(val: float, percentage: int) -> bool:
+       """Method returns true if health bar is in certain percentage."""
+       return val <= max_value*(percentage/100.0)
+
+
+func _tween(value: float) -> void:
+       """Method handles the tween animations.
+       """
+       var tween := create_tween()
+#      _tween.stop(self, "modulate:a")
+       tween.set_ease(Tween.EASE_OUT)
+       tween.set_trans(Tween.TRANS_LINEAR)
+       
+       tween.tween_property(
+               self, "modulate:a", value, _animation_timeout
+       )
diff --git a/addons/health_bar_2d/health_bar_2d.tscn b/addons/health_bar_2d/health_bar_2d.tscn
new file mode 100644 (file)
index 0000000..819fe2e
--- /dev/null
@@ -0,0 +1,12 @@
+[gd_scene load_steps=3 format=3 uid="uid://bpsrn4wc8548e"]
+
+[ext_resource type="Script" path="res://addons/health_bar_2d/health_bar_2d.gd" id="1"]
+[ext_resource type="Texture2D" uid="uid://cnjw8wn77f05i" path="res://addons/health_bar_2d/resources/health_bar_texture.png" id="2"]
+
+[node name="HealthBar2D" type="TextureProgressBar"]
+value = 50.0
+texture_under = ExtResource("2")
+texture_progress = ExtResource("2")
+tint_under = Color(0.356863, 0.356863, 0.356863, 0.603922)
+tint_progress = Color(0.141176, 0.329412, 0.513726, 1)
+script = ExtResource("1")
diff --git a/addons/health_bar_2d/icon.png b/addons/health_bar_2d/icon.png
new file mode 100644 (file)
index 0000000..a6c5963
Binary files /dev/null and b/addons/health_bar_2d/icon.png differ
diff --git a/addons/health_bar_2d/icon.png.import b/addons/health_bar_2d/icon.png.import
new file mode 100644 (file)
index 0000000..c8b1b6a
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://j5smia0mu4jh"
+path="res://.godot/imported/icon.png-1a04300e498d83b21b1db2658a8a7ad1.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/health_bar_2d/icon.png"
+dest_files=["res://.godot/imported/icon.png-1a04300e498d83b21b1db2658a8a7ad1.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
diff --git a/addons/health_bar_2d/plugin.cfg b/addons/health_bar_2d/plugin.cfg
new file mode 100644 (file)
index 0000000..460c3b6
--- /dev/null
@@ -0,0 +1,7 @@
+[plugin]
+
+name="HealthBar2D"
+description="A simple 2d health/stamina bar for attaching with player, enemies etc."
+author="vishu"
+version="0.2.0"
+script="addon.gd"
diff --git a/addons/health_bar_2d/resources/health_bar_texture.png b/addons/health_bar_2d/resources/health_bar_texture.png
new file mode 100644 (file)
index 0000000..bfdb5b1
Binary files /dev/null and b/addons/health_bar_2d/resources/health_bar_texture.png differ
diff --git a/addons/health_bar_2d/resources/health_bar_texture.png.import b/addons/health_bar_2d/resources/health_bar_texture.png.import
new file mode 100644 (file)
index 0000000..f03199e
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cnjw8wn77f05i"
+path="res://.godot/imported/health_bar_texture.png-b2571afb0d9e83bce90afa57c997503e.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/health_bar_2d/resources/health_bar_texture.png"
+dest_files=["res://.godot/imported/health_bar_texture.png-b2571afb0d9e83bce90afa57c997503e.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
diff --git a/addons/label_font_auto_sizer/LICENSE b/addons/label_font_auto_sizer/LICENSE
new file mode 100644 (file)
index 0000000..485105b
--- /dev/null
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 Lescandez
+
+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.
diff --git a/addons/label_font_auto_sizer/icon.svg b/addons/label_font_auto_sizer/icon.svg
new file mode 100644 (file)
index 0000000..5022cea
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   height="16"
+   viewBox="0 0 16 16"
+   width="16"
+   version="1.1"
+   id="svg1"
+   sodipodi:docname="Label.svg"
+   inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <defs
+     id="defs1" />
+  <sodipodi:namedview
+     id="namedview1"
+     pagecolor="#ffffff"
+     bordercolor="#999999"
+     borderopacity="1"
+     inkscape:showpageshadow="2"
+     inkscape:pageopacity="0"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     showguides="true"
+     inkscape:zoom="25.65625"
+     inkscape:cx="8.3020706"
+     inkscape:cy="11.127893"
+     inkscape:window-width="1920"
+     inkscape:window-height="1017"
+     inkscape:window-x="-8"
+     inkscape:window-y="-8"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg1">
+    <sodipodi:guide
+       position="1.0377588,8.0048721"
+       orientation="0,-1"
+       id="guide1"
+       inkscape:locked="false" />
+  </sodipodi:namedview>
+  <path
+     id="path4"
+     style="fill:#8eef97"
+     inkscape:label="path4"
+     d="M 6 3 C 5.7347997 3.0000401 5.4804738 3.1054236 5.2929688 3.2929688 L 1.2929688 7.2929688 C 0.90254633 7.6834747 0.90254633 8.3165253 1.2929688 8.7070312 L 5.2929688 12.707031 C 5.4804738 12.894577 5.7347997 12.99996 6 13 L 14 13 C 14.552282 13 15 12.552282 15 12 L 15 4 C 15 3.447717 14.552282 3 14 3 L 6 3 z M 9.8554688 4.3359375 L 11.177734 4.3359375 L 13.890625 11.667969 L 12.833984 11.667969 L 12.103516 9.625 L 8.8789062 9.625 L 8.1484375 11.667969 L 7.1425781 11.667969 L 9.8554688 4.3359375 z M 10.490234 5.1894531 L 9.1796875 8.7871094 L 11.796875 8.7871094 L 10.490234 5.1894531 z M 5 7 C 6.3333288 7 6.3333288 9 5 9 C 3.6666712 9 3.6666712 7 5 7 z " />
+</svg>
diff --git a/addons/label_font_auto_sizer/icon.svg.import b/addons/label_font_auto_sizer/icon.svg.import
new file mode 100644 (file)
index 0000000..04557e1
--- /dev/null
@@ -0,0 +1,37 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://xcatff4jxyle"
+path="res://.godot/imported/icon.svg-678c72dc12642c8e5f0b56a46fd750a5.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/label_font_auto_sizer/icon.svg"
+dest_files=["res://.godot/imported/icon.svg-678c72dc12642c8e5f0b56a46fd750a5.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/addons/label_font_auto_sizer/label_auto_sizer.gd b/addons/label_font_auto_sizer/label_auto_sizer.gd
new file mode 100644 (file)
index 0000000..a4c3f59
--- /dev/null
@@ -0,0 +1,236 @@
+@tool
+@icon ("res://addons/label_font_auto_sizer/icon.svg")
+extends Label
+class_name LabelAutoSizer
+
+#region External variables
+@export_group("Size values")
+## The number of times the auto sizer will shrink the font to try to fit the text into the control rect.
+@export_range(1,100) var _max_steps: int = 4:
+       set(value):
+               _max_steps = value
+               if is_node_ready(): ## This setter gets called when the label enters the tree in the editor, before it's ready, which might not be desirable when using auto translate.
+                       call_deferred("_check_line_count") 
+## The size value in pixels that the auto sizer will shrink the font during each step.
+@export_range(1,100) var _size_per_step: int = 2:
+       set(value):
+               _size_per_step = value
+               if is_node_ready(): ## This setter gets called when the label enters the tree in the editor, before it's ready, which might not be desirable when using auto translate.
+                       call_deferred("_check_line_count")
+@export_group("")
+@export_group("Debug settings")
+## Set this to true if you want to debug the steps happening in the class. The calls are commented so you need to decomment them.
+@export var _print_debug_enabled: bool = false
+@export_group("")
+#endregion
+
+#region --Internal variables--
+var _base_font_size: int
+var _current_font_size: int
+var _last_size_state: LABEL_SIZE_STATE = LABEL_SIZE_STATE.IDLE
+var _size_just_modified_by_autosizer: bool = false
+var _label_settings_just_duplicated: bool = false
+var _set_defaults: bool = false
+
+enum LABEL_SIZE_STATE {JUST_SHRUNK, IDLE, JUST_ENLARGED} 
+#endregion
+
+
+#region --Signal funcs--
+## Gets called in-editor and in-game. Sets some default values if necessary.
+func _ready() -> void:
+       if !_set_defaults:
+               set_editor_defaults()
+       #else:
+               #_print_debug_message(str(name) + " Base font size: " + str(_base_font_size) + "px.")
+       if Engine.is_editor_hint():
+               call_deferred("_connect_signals")
+       else:
+               _check_line_count()
+       LabelFontAutoSizeManager.register_label(self)
+
+
+## Gets called when there are changes in either the Theme or Label Settings resources.
+## Checks if the change was made by the script of by the user and if not, sets the base font size value.
+func _on_font_resource_changed() -> void:
+       #_print_debug_message(str(name) + "' Font resource changed.")
+       if _size_just_modified_by_autosizer:
+               _size_just_modified_by_autosizer = false ## Early return because the change wasn't made by the user.
+       else:
+               call_deferred("_set_base_font_size")
+
+
+## Gets called whenever the size of the control rect is modified (in editor). Calls the line count check.
+func _on_label_rect_resized() -> void:
+       if !_set_defaults:
+               return
+       call_deferred("_check_line_count")
+
+
+## Called by autosize manager whenever the locale_chaged() method is called, as the tr() object changes don't trigger
+## the set_text() method of the label, thus the size and line_amount doesn't get checked.
+func _on_locale_changed() -> void:
+       call_deferred("_check_line_count")
+
+
+## Gets called on scene changes and when the label is freed and erases itself from the autosize manager.
+func _exit_tree() -> void:
+       LabelFontAutoSizeManager.erase_label(self)
+#endregion
+
+#region --Private funcs--
+##Only in-editor, keeps stuff in check while manually changing font resources and resizing the label.
+func _connect_signals() -> void:
+       if label_settings != null:
+               if !label_settings.changed.is_connected(_on_font_resource_changed):
+                       label_settings.changed.connect(_on_font_resource_changed)
+       if !theme_changed.is_connected(_on_font_resource_changed):
+               theme_changed.connect(_on_font_resource_changed)
+       if !resized.is_connected(_on_label_rect_resized):
+               resized.connect(_on_label_rect_resized)
+
+
+## Text can be changed via either: set_text(value), or _my_label.text = value. Both will trigger a line check.
+## This func also checks whenever a new LabelSettings resource is un/loaded.
+##**If you're doing some testing/developing, if you are changing the text from withit one of the label classes themselves, do it like self.set_text(value) or self.text = value, othersise it doesn't trigger a size check.
+##In a real scenario you wouldn't be changing the text from within the class itself though.**
+func _set(property: StringName, value: Variant) -> bool:
+       match property:
+               "text":
+                       text = value
+                       call_deferred("_check_line_count")
+                       return true
+               "label_settings":
+                       if _label_settings_just_duplicated: ## Need to check because this gets called whenever we duplicate the resource as well.
+                               _label_settings_just_duplicated = false
+                               return true
+                       else: 
+                               if value != null:
+                                       label_settings = value
+                                       _label_settings_just_duplicated = true
+                                       label_settings = label_settings.duplicate() ## Label Settings are not unique by default, so we it gets duplicated to not override every instance.
+                                       if !label_settings.changed.is_connected(_on_font_resource_changed):
+                                               label_settings.changed.connect(_on_font_resource_changed)
+                               else:
+                                       label_settings = null
+                               call_deferred("_set_base_font_size")
+                       return true
+               _:
+                       return false
+
+
+## Goes through the resources in the label and sets the base font size value.
+## Priority: Label Settings > Override Theme Font Size > Theme Font Size.
+func _set_base_font_size() -> void:
+       if label_settings != null:
+               _base_font_size = label_settings.font_size
+       elif get("theme_override_font_sizes/font_size") != null:
+               _base_font_size = get("theme_override_font_sizes/font_size")
+       elif get_theme_font_size("font_size") != null:
+               _base_font_size = get_theme_font_size("font_size")
+       _current_font_size = _base_font_size
+       #_print_debug_message(str(name) + " Base font size: " + str(_base_font_size) + "px.")
+
+
+## Makes variables persistent without exposing them in the editor.
+## Will get removed in Godot 4.3 with the upcoming @export_storage annotation.
+func _get_property_list():
+       var properties: Array = []
+       var bool_properties: Array[String] = ["_size_just_modified_by_autosizer","_set_defaults"]
+       for name in bool_properties:
+               properties.append({
+                       "name": name,
+                       "type": TYPE_BOOL,
+                       "usage": PROPERTY_USAGE_STORAGE,
+               })
+       var int_properties: Array[String] = ["_base_font_size", "_current_font_size", "_last_size_state"]
+       for name in int_properties:
+               properties.append({
+                       "name": name,
+                       "type": TYPE_INT,
+                       "usage": PROPERTY_USAGE_STORAGE,
+               })
+       return properties
+
+
+## Checks the current font size and amount of lines in the text against the visible lines inside the rect.
+## Calls for the shrink or enlarge methods accordingly.
+func _check_line_count() -> void:
+       #_print_debug_message("Checking lines of " + str(name))
+       if get_line_count() > get_visible_line_count() and _current_font_size > max(_base_font_size - (_size_per_step * _max_steps), 1):
+               _shrink_font()
+               return
+       elif get_line_count() == get_visible_line_count() and _current_font_size < _base_font_size:
+               _enlarge_font()
+               return
+       _last_size_state = LABEL_SIZE_STATE.IDLE
+
+
+## Makes the font size smaller. Rechecks or stops the cycle depending on the conditions.
+func _shrink_font():
+       #_print_debug_message(str(name) + "' shrink method called")
+       _override_font_size(_current_font_size - _size_per_step)
+       #_print_debug_message(str(name) + " shrunk " + str(_size_per_step) + "px.")
+       if _last_size_state == LABEL_SIZE_STATE.JUST_ENLARGED: ## To stop infinite cycles.
+               _last_size_state = LABEL_SIZE_STATE.IDLE
+               #_print_debug_message(str(name) + " finished shrinking. Was just enlarged.")
+       else:
+               _last_size_state = LABEL_SIZE_STATE.JUST_SHRUNK
+               _check_line_count()
+
+
+## Makes the font size larger. Rechecks/Shrinks/stops the cycle depending on the conditions.
+func _enlarge_font():
+       #_print_debug_message(str(name) + "' enlarge method called")
+       _override_font_size(_current_font_size + _size_per_step)
+       if _last_size_state == LABEL_SIZE_STATE.JUST_SHRUNK:
+               if  get_line_count() > get_visible_line_count():
+                       _last_size_state = LABEL_SIZE_STATE.JUST_ENLARGED
+                       _shrink_font()
+               else: ## To stop infinite cycles.
+                       #_print_debug_message(str(name) + " finished enlarging. Was just shrunk.")
+                       _last_size_state = LABEL_SIZE_STATE.IDLE
+       else:
+               _last_size_state = LABEL_SIZE_STATE.JUST_ENLARGED
+               _check_line_count()
+
+
+## Applies the new font size.
+func _override_font_size(new_size: int) -> void:
+       _size_just_modified_by_autosizer = true
+       if label_settings != null:
+               label_settings.font_size = new_size
+       else:
+               set("theme_override_font_sizes/font_size", new_size)
+       _current_font_size = new_size
+
+
+## Prints message on console, for debugging was used while developing. You can decomment all the calls to debug.
+func _print_debug_message(message: String) -> void:
+       if _print_debug_enabled:
+               print(message)
+#endregion
+
+
+#region --Public funcs--
+## Gets called in-editor and sets the default values.
+func set_editor_defaults() -> void:
+       _set_defaults =  true
+       clip_text = true
+       autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
+       if label_settings != null:
+               label_settings = label_settings.duplicate() ## These are not unique by default, so we it gets duplicated to not override every instance.
+               label_settings.changed.connect(_on_font_resource_changed)
+       call_deferred("_set_base_font_size")
+       set_deferred("_current_font_size", _base_font_size)
+       call_deferred("_connect_signals")
+
+
+## Text can be changed via either: set_text(value), or _my_label.text = value. Both will trigger a line check.
+##**If you're doing some testing/developing, if you are changing the text from withit one of the label classes themselves, do it like self.set_text(value) or self.text = value, othersise it doesn't trigger a size check.
+##In a real scenario you wouldn't be changing the text from within the class itself though.**
+func set_text(new_text: String) -> void:
+       text = new_text
+       call_deferred("_check_line_count")
+#endregion
+
diff --git a/addons/label_font_auto_sizer/label_font_auto_size_manager.gd b/addons/label_font_auto_sizer/label_font_auto_size_manager.gd
new file mode 100644 (file)
index 0000000..7c905b9
--- /dev/null
@@ -0,0 +1,21 @@
+@tool
+extends Node
+class_name  LabelFontAutoSizeManager
+
+static var _active_labels : Array[Control]
+
+
+static func register_label(label: Control) -> void:
+       _active_labels.append(label)
+
+
+static func erase_label(label: Control) -> void:
+       _active_labels.erase(label)
+
+
+## This function is to be called by the user after manually changing the locale of the game.
+## Will cause to check the size of all the active labels, useful after changing the language of text pieces.
+## Call it with: LabelFotAutoSizeManager.locale_changed()
+static func locale_chaged() -> void:
+       for label: Control in _active_labels:
+               label._on_locale_changed()
diff --git a/addons/label_font_auto_sizer/plugin.cfg b/addons/label_font_auto_sizer/plugin.cfg
new file mode 100644 (file)
index 0000000..cc12e56
--- /dev/null
@@ -0,0 +1,7 @@
+[plugin]
+
+name="LabelFontAutoSizer - Godot4"
+description="Tool that makes labels text fit into the rect."
+author="Lescandez"
+version="1.0.2"
+script="plugin.gd"
diff --git a/addons/label_font_auto_sizer/plugin.gd b/addons/label_font_auto_sizer/plugin.gd
new file mode 100644 (file)
index 0000000..2d65d83
--- /dev/null
@@ -0,0 +1,101 @@
+@tool
+extends EditorPlugin
+
+var _current_root: Node
+
+
+## Class setup.
+func _ready() -> void:
+       await _set_root(EditorInterface.get_edited_scene_root())
+       scene_changed.connect(_on_scene_changed.bind())
+       call_deferred("_check_nodes_in_scene")
+
+
+## Called whenever a new node is added to the scene. Calls for a label check.
+func _on_child_entered_tree(node: Node) -> void:
+       if !node.child_entered_tree.is_connected(_on_child_entered_tree.bind()): ##Keeps checking for nested children, looking for labels.
+                       node.child_entered_tree.connect(_on_child_entered_tree.bind())
+       if !node.child_exiting_tree.is_connected(_on_child_exiting_tree.bind()):
+                       node.child_exiting_tree.connect(_on_child_exiting_tree.bind())
+       _check_label(node)
+
+
+## Called when changing scene. Gets the new root and calls for a node scan in the tree.
+func _on_scene_changed(root: Node) -> void:
+       if _current_root != null and is_instance_valid(_current_root):
+               if _current_root.child_entered_tree.is_connected(_on_child_entered_tree.bind()):
+                       _current_root.child_entered_tree.disconnect(_on_child_entered_tree.bind())
+       _current_root = root
+       await _set_root(root)
+       call_deferred("_check_nodes_in_scene")
+
+
+## Gets called whenever any node is deleted, and when user changes scene.
+func _on_child_exiting_tree(node: Node) -> void:
+       if node.child_exiting_tree.is_connected(_on_child_exiting_tree):
+               node.child_exiting_tree.disconnect(_on_child_exiting_tree)
+       if node.child_entered_tree.is_connected(_on_child_entered_tree):
+               node.child_entered_tree.disconnect(_on_child_entered_tree)
+
+
+## Gets called whenever a label is deleted, and whenever user changes scene.
+func _on_label_exiting_tree(label: Node) -> void:
+       if label.tree_exiting.is_connected(_on_label_exiting_tree.bind(label)):
+               label.tree_exiting.disconnect(_on_label_exiting_tree.bind(label))
+       if label.script_changed.is_connected(_on_label_script_changed.bind(label)):
+               label.script_changed.disconnect(_on_label_script_changed.bind(label))
+
+
+## Gets called whenever any label on the scene gets a (new) script or is removed from it.
+## If it finds an autosizer added to the label, it sets the default values automatically (basically the reason of this class).
+func _on_label_script_changed(label: Node):
+       var script: Script = label.get_script()
+       if script == null:
+               return
+       elif script.resource_path.ends_with("label_auto_sizer.gd"):
+               label.set_editor_defaults()
+
+
+## Sets the current scene root and listens for nodes entering in the tree.
+func _set_root(root: Node) -> void:
+       _current_root = root
+       if _current_root == null:
+               await _check_root()
+       if !_current_root.child_entered_tree.is_connected(_on_child_entered_tree.bind()):
+                       _current_root.child_entered_tree.connect(_on_child_entered_tree.bind())
+
+
+## If no root is found (all scenes are closed) it keeps checking until one is opened.
+func _check_root() -> void:
+       while _current_root == null:
+               await get_tree().process_frame
+               _current_root = EditorInterface.get_edited_scene_root()
+
+
+## Goes through every node in the scene, children included. Calls for a label check.
+## get_children(true) is not returning nested children so it needs to be done manually.
+func _check_nodes_in_scene() -> void:
+       var nodes_to_check: Array[Node] = []
+       nodes_to_check.append(_current_root)
+       while nodes_to_check.size() > 0:
+               var current_node: Node = nodes_to_check.pop_front()
+               if !current_node.child_entered_tree.is_connected(_on_child_entered_tree.bind()):
+                       current_node.child_entered_tree.connect(_on_child_entered_tree.bind())
+               if !current_node.child_exiting_tree.is_connected(_on_child_exiting_tree.bind()):
+                       current_node.child_exiting_tree.connect(_on_child_exiting_tree.bind())
+               _check_label(current_node)
+               if current_node.get_child_count() > 0:
+                       for child_node in current_node.get_children():
+                               nodes_to_check.append(child_node)
+
+
+## Checks if the node is a label, starts listening for its attatched script.
+## If the node has the script already attached, it sets the defaults directly.
+func _check_label(node: Node) -> void:
+       if node is Label or node is RichTextLabel:
+               if !node.tree_exiting.is_connected(_on_label_exiting_tree.bind(node)):
+                       node.tree_exiting.connect(_on_label_exiting_tree.bind(node))
+               if !node.script_changed.is_connected(_on_label_script_changed.bind(node)):
+                       node.script_changed.connect(_on_label_script_changed.bind(node))
+               if node is LabelAutoSizer or node is RichLabelAutoSizer:
+                       node.set_editor_defaults()
diff --git a/addons/label_font_auto_sizer/rich_label_auto_sizer.gd b/addons/label_font_auto_sizer/rich_label_auto_sizer.gd
new file mode 100644 (file)
index 0000000..cb482a6
--- /dev/null
@@ -0,0 +1,218 @@
+@tool
+@icon ("res://addons/label_font_auto_sizer/icon.svg")
+extends RichTextLabel
+class_name RichLabelAutoSizer
+
+#region External variables
+@export_group("Size values")
+## The number of times the auto sizer will shrink the font to try to fit the text into the control rect.
+@export_range(1,100) var _max_steps: int = 4:
+       set(value):
+               _max_steps = value
+               if is_node_ready(): ## This setter gets called when the label enters the tree in the editor, before it's ready, which might not be desirable when using auto translate.
+                       call_deferred("_check_line_count") 
+## The size value in pixels that the auto sizer will shrink the font during each step.
+@export_range(1,100) var _size_per_step: int = 2:
+       set(value):
+               _size_per_step = value
+               if is_node_ready(): ## This setter gets called when the label enters the tree in the editor, before it's ready, which might not be desirable when using auto translate.
+                       call_deferred("_check_line_count")
+@export_group("")
+@export_group("Debug settings")
+## Set this to true if you want to debug the steps happening in the class. The calls are commented so you need to decomment them.
+@export var _print_debug_enabled: bool = false
+@export_group("")
+#endregion
+
+#region --Internal variables--
+var _base_font_size: int
+var _current_font_size: int
+var _last_size_state: LABEL_SIZE_STATE = LABEL_SIZE_STATE.IDLE
+var _size_just_modified_by_autosizer: bool = false
+var _label_settings_just_duplicated: bool = false
+var _set_defaults: bool = false
+
+enum LABEL_SIZE_STATE {JUST_SHRUNK, IDLE, JUST_ENLARGED} 
+#endregion
+
+
+
+#region --Signal funcs--
+## Gets called in-editor and in-game. Sets some default values if necessary.
+func _ready() -> void:
+       if !_set_defaults:
+               set_editor_defaults()
+       #else:
+               #_print_debug_message(str(name) + " Base font size: " + str(_base_font_size) + "px.")
+       if Engine.is_editor_hint():
+               call_deferred("_connect_signals")
+       else:
+               _check_line_count()
+       LabelFontAutoSizeManager.register_label(self)
+
+
+## Gets called when there are changes in either the Theme or Label Settings resources.
+## Checks if the change was made by the script of by the user and if not, sets the base font size value.
+func _on_font_resource_changed() -> void:
+       #_print_debug_message(str(name) + "' Font resource changed.")
+       if _size_just_modified_by_autosizer:
+               _size_just_modified_by_autosizer = false ## Early return because the change wasn't made by the user.
+       else:
+               call_deferred("_set_base_font_size")
+
+
+## Gets called whenever the size of the control rect is modified (in editor). Calls the line count check.
+func _on_label_rect_resized() -> void:
+       if !_set_defaults:
+               return
+       call_deferred("_check_line_count")
+
+
+## Called by autosize manager whenever the locale_chaged() method is called, as the tr() object changes don't trigger
+## the set_text() method of the label, thus the size and line_amount doesn't get checked.
+func _on_locale_changed() -> void:
+       call_deferred("_check_line_count")
+
+
+## Gets called on scene changes and when the label is freed and erases itself from the autosize manager.
+func _exit_tree() -> void:
+       LabelFontAutoSizeManager.erase_label(self)
+#endregion
+
+#region --Private funcs--
+##Only in-editor, keeps stuff in check while manually changing font resources and resizing the label.
+func _connect_signals() -> void:
+       if !theme_changed.is_connected(_on_font_resource_changed):
+               theme_changed.connect(_on_font_resource_changed)
+       if !resized.is_connected(_on_label_rect_resized):
+               resized.connect(_on_label_rect_resized)
+
+
+## Text can be changed via either: set_text(value), or _my_label.text = value. Both will trigger a line check.
+##**If you're doing some testing/developing, if you are changing the text from withit one of the label classes themselves, do it like self.set_text(value) or self.text = value, othersise it doesn't trigger a size check.
+##In a real scenario you wouldn't be changing the text from within the class itself though.**
+func _set(property: StringName, value: Variant) -> bool:
+       match property:
+               "text":
+                       text = value
+                       call_deferred("_check_line_count")
+                       return true
+               _:
+                       return false
+
+
+## Goes through the resources in the label and sets the base font size value.
+## Priority: Override Theme Font Size > Theme Font Size. (RichTextLabels don't allow Label Settings)
+func _set_base_font_size() -> void:
+       if get("theme_override_font_sizes/normal_font_size") != null:
+               _base_font_size = get("theme_override_font_sizes/normal_font_size")
+       elif get_theme_font_size("normal_font_size") != null:
+               _base_font_size = get_theme_font_size("normal_font_size")
+       _current_font_size = _base_font_size
+       #_print_debug_message(str(name) + " Base font size: " + str(_base_font_size) + "px.")
+
+
+## Makes variables persistent without exposing them in the editor.
+## Will get removed in Godot 4.3 with the upcoming @export_storage annotation.
+func _get_property_list():
+       var properties: Array = []
+       var bool_properties: Array[String] = ["_size_just_modified_by_autosizer","_set_defaults"]
+       for name in bool_properties:
+               properties.append({
+                       "name": name,
+                       "type": TYPE_BOOL,
+                       "usage": PROPERTY_USAGE_STORAGE,
+               })
+       var int_properties: Array[String] = ["_base_font_size", "_current_font_size", "_last_size_state"]
+       for name in int_properties:
+               properties.append({
+                       "name": name,
+                       "type": TYPE_INT,
+                       "usage": PROPERTY_USAGE_STORAGE,
+               })
+       return properties
+
+
+## Checks the current font size and amount of lines in the text against the visible lines inside the rect.
+## Calls for the shrink or enlarge methods accordingly.
+func _check_line_count() -> void:
+       #_print_debug_message("Checking lines of " + str(name))
+       if get_content_height() > size.y or get_content_width() > size.x:
+               if _current_font_size > max(_base_font_size - (_size_per_step * _max_steps), 1):
+                       _shrink_font()
+                       return
+       elif get_content_height() <= size.y or get_content_width() <= size.x:
+               if _current_font_size < _base_font_size:
+                       _enlarge_font()
+                       return
+       _last_size_state = LABEL_SIZE_STATE.IDLE
+
+
+## Makes the font size smaller. Rechecks or stops the cycle depending on the conditions.
+func _shrink_font():
+       #_print_debug_message(str(name) + "' shrink method called")
+       _override_font_size(_current_font_size - _size_per_step)
+       #_print_debug_message(str(name) + " shrunk " + str(_size_per_step) + "px.")
+       if _last_size_state == LABEL_SIZE_STATE.JUST_ENLARGED: ## To stop infinite cycles.
+               _last_size_state = LABEL_SIZE_STATE.IDLE
+               #_print_debug_message(str(name) + " finished shrinking. Was just enlarged.")
+       else:
+               _last_size_state = LABEL_SIZE_STATE.JUST_SHRUNK
+               _check_line_count()
+
+
+## Makes the font size larger. Rechecks/Shrinks/stops the cycle depending on the conditions.
+func _enlarge_font():
+       #_print_debug_message(str(name) + "' enlarge method called")
+       _override_font_size(_current_font_size + _size_per_step)
+       if _last_size_state == LABEL_SIZE_STATE.JUST_SHRUNK:
+               if  get_content_height() > size.y:
+                       _last_size_state = LABEL_SIZE_STATE.JUST_ENLARGED
+                       _shrink_font()
+               else: ## To stop infinite cycles.
+                       #_print_debug_message(str(name) + " finished enlarging. Was just shrunk.")
+                       _last_size_state = LABEL_SIZE_STATE.IDLE
+       else:
+               _last_size_state = LABEL_SIZE_STATE.JUST_ENLARGED
+               _check_line_count()
+
+
+## Applies the new font size.
+func _override_font_size(new_size: int) -> void:
+       _size_just_modified_by_autosizer = true
+       set("theme_override_font_sizes/normal_font_size", new_size)
+       _current_font_size = new_size
+
+
+## Prints message on console, for debugging was used while developing. You can decomment all the calls to debug.
+func _print_debug_message(message: String) -> void:
+       if _print_debug_enabled:
+               print(message)
+#endregion
+
+
+#region --Public funcs--
+## Gets called in-editor and sets the default values.
+func set_editor_defaults() -> void:
+       _set_defaults =  true
+       clip_contents = true
+       fit_content = false
+       scroll_active = false
+       autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
+       call_deferred("_set_base_font_size")
+       call_deferred("_set_current_font_size_to_base")
+       call_deferred("_connect_signals")
+
+## For some reason using set_deferred() wasn't doing it after setting the base size, so this gets called deferred.
+func _set_current_font_size_to_base() -> void:
+       _current_font_size = _base_font_size
+
+
+## Text can be changed via either: set_text(value), or _my_label.text = value. Both will trigger a line check.
+##**If you're doing some testing/developing, if you are changing the text from withit one of the label classes themselves, do it like self.set_text(value) or self.text = value, othersise it doesn't trigger a size check.
+##In a real scenario you wouldn't be changing the text from within the class itself though.**
+func set_text(new_text: String) -> void:
+       text = new_text
+       call_deferred("_check_line_count")
+#endregion
+
diff --git a/addons/licenses/LICENSE.md b/addons/licenses/LICENSE.md
new file mode 100644 (file)
index 0000000..4abfd1f
--- /dev/null
@@ -0,0 +1,7 @@
+Copyright 2022-present Iceflower S ([email protected])
+
+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.
diff --git a/addons/licenses/component.gd b/addons/licenses/component.gd
new file mode 100644 (file)
index 0000000..fd1543e
--- /dev/null
@@ -0,0 +1,172 @@
+extends RefCounted
+
+## used to mark readonly components, like auto generated components
+## not serialized
+var readonly: bool = false
+
+class License:
+    extends RefCounted
+
+    var name: String
+    var identifier: String
+    ## Use either license_text or license_file
+    var text: String
+    ## Will be loaded at runtime if license_text is not filled.
+    var file: String
+    ## Web present of the license
+    var web: String
+
+    func _get_property_list() -> Array[Dictionary]:
+        return [
+            {
+                "name": "text",
+                "type": TYPE_STRING,
+                "hint": PROPERTY_HINT_MULTILINE_TEXT,
+            },
+            {
+                "name": "file",
+                "type": TYPE_STRING,
+                "hint": PROPERTY_HINT_FILE,
+            }
+        ]
+
+    ## Either returns the license text or loads the text from file or a message that the text could not be loaded.
+    func get_license_text() -> String:
+        if self.text != "":
+            return self.text
+
+        var file: FileAccess = FileAccess.open(self.file, FileAccess.READ)
+        if file == null:
+            return "License text not available. (Could not load file)"
+        var text: String = file.get_as_text()
+        file = null
+        return text
+
+    func serialize() -> Dictionary:
+        return {
+            "name": self.name,
+            "identifier": self.identifier,
+            "text": self.text,
+            "file": self.file,
+            "web": self.web,
+        }
+
+    func deserialize(data: Dictionary):
+        self.name = data.get("name", "")
+        self.identifier = data.get("identifier", "")
+        self.text = data.get("text", "")
+        self.file = data.get("file", "")
+        self.web = data.get("web", "")
+        return self
+
+    func duplicate():
+        var dup = new()
+        dup.name = self.name
+        dup.identifier = self.identifier
+        dup.text = self.text
+        dup.file = self.file
+        dup.web = self.web
+
+        return dup
+
+## Identifier
+var id: String
+## Use to structure the licenses to top categories. E.g. Textures, Fonts, ...
+var category: String
+
+## Name of the software or component
+var name: String
+## Version of the software or component
+var version: String
+## Name of the copyrights
+var copyright: PackedStringArray = []
+## Contact to developer
+var contact: String
+## Additional description.
+var description: String
+## Web url to project page
+var web: String
+## Array of String, affected files or directories
+var paths: PackedStringArray = []
+var licenses: Array[License] = []
+
+func _get_property_list() -> Array:
+    return [
+        {
+            "name": "paths",
+            "type": TYPE_PACKED_STRING_ARRAY,
+            "hint": PROPERTY_HINT_FILE,
+            "hint_text": "*",
+        },
+        {
+            "name": "description",
+            "type": TYPE_STRING,
+            "hint": PROPERTY_HINT_MULTILINE_TEXT,
+        },
+        {
+            "name": "licenses",
+            "type": TYPE_ARRAY,
+            "constructor": License.new,
+        },
+    ]
+
+func get_warnings() -> PackedStringArray:
+    var res: PackedStringArray = []
+    if self.name == "":
+        res.append("no name")
+    if self.licenses.is_empty():
+        res.append("no license")
+    if self.copyright.is_empty():
+        res.append("no copyright")
+    var path_missing: bool = false
+    for path: String in self.paths:
+        if FileAccess.file_exists(path) || DirAccess.dir_exists_absolute(path):
+            continue
+        res.append("path '" + path + "' does not exst")
+    return res
+
+func serialize() -> Dictionary:
+    var licenses: Array[Dictionary] = []
+    for license: License in self.licenses:
+        licenses.append(license.serialize())
+    return {
+        "id": self.id,
+        "category": self.category,
+        "name": self.name,
+        "version": self.version,
+        "copyright": self.copyright,
+        "contact": self.contact,
+        "description": self.description,
+        "web": self.web,
+        "paths": self.paths,
+        "licenses": licenses,
+    }
+
+func deserialize(data: Dictionary):
+    self.id = data.get("id", "")
+    self.category = data.get("category", "")
+    self.name = data.get("name", "")
+    self.version = data.get("version", "")
+    self.copyright = data.get("copyright", PackedStringArray())
+    self.contact = data.get("contact", "")
+    self.description = data.get("description", "")
+    self.web = data.get("web", "")
+    self.paths = data.get("paths", [])
+    for license: Dictionary in data.get("licenses", []):
+        self.licenses.append(License.new().deserialize(license))
+    return self
+
+func duplicate():
+    var dup = new()
+    dup.id = self.id
+    dup.category = self.category
+    dup.name = self.name
+    dup.version = self.version
+    dup.copyright = self.copyright.duplicate()
+    dup.contact = self.contact
+    dup.web = self.web
+    dup.paths = self.paths.duplicate()
+    for license in self.licenses:
+        dup.licenses.append(license.duplicate())
+
+    return dup
diff --git a/addons/licenses/export_plugin.gd b/addons/licenses/export_plugin.gd
new file mode 100644 (file)
index 0000000..0a96087
--- /dev/null
@@ -0,0 +1,29 @@
+extends EditorExportPlugin
+
+const Licenses := preload("licenses.gd")
+const Component := preload("component.gd")
+
+func _get_name() -> String:
+    return "kenyoni_licenses_exporter"
+
+func _export_begin(features: PackedStringArray, is_debug: bool, path: String, flags: int) -> void:
+    if not FileAccess.file_exists(Licenses.get_license_data_filepath()):
+        return
+    self._add_file(Licenses.get_license_data_filepath())
+    var res = Licenses.load(Licenses.get_license_data_filepath())
+    if res.err_msg != "":
+        push_error("Failed to export license files: " + res.err_msg)
+        return
+    for component: Component in res.components:
+        for license: Component.License in component.licenses:
+            if license.file != "":
+                self._add_file(license.file)
+
+func _add_file(file_path: String) -> void:
+    var file: FileAccess = FileAccess.open(file_path, FileAccess.READ)
+    if file == null:
+        push_error("Could not open file ("+String.num_int64(FileAccess.get_open_error())+"): " + file_path)
+        return
+    var content: PackedByteArray = file.get_buffer(file.get_length())
+    file = null
+    self.add_file(file_path, content, false)
diff --git a/addons/licenses/internal/component_detail_tree.gd b/addons/licenses/internal/component_detail_tree.gd
new file mode 100644 (file)
index 0000000..a684057
--- /dev/null
@@ -0,0 +1,86 @@
+@tool
+extends Tree
+
+const Component := preload("../component.gd")
+
+signal component_edited(component: Component)
+
+enum BUTTON_ID {
+    RESET = 1,
+    MULTI_LINE_STR = 2,
+    FILE_DIALOG = 3
+}
+
+var _component: Component :
+    set = set_component,
+    get = get_component
+var handlers: Array[GDScript] = []
+var _selected_item: TreeItem = null
+
+func set_component(new_component: Component) -> void:
+    if _component == new_component:
+        return
+    _component = new_component
+    self.reload()
+
+func get_component() -> Component:
+    return _component
+
+func _init() -> void:
+    self.set_column_custom_minimum_width(0, 152)
+    self.set_column_expand(0, false)
+    self.set_column_clip_content(1, true)
+
+func reload() -> void:
+    self._selected_item = null
+    self.clear()
+    if self._component == null:
+        return
+    self._add_item(null, self._component, {"name": "component", "type": TYPE_OBJECT})
+    if _component.readonly:
+        self.set_readonly(self.get_root())
+
+func set_readonly(item: TreeItem) -> void:
+    for column: int in range(self.columns):
+        item.set_editable(column, false)
+        for idx: int in range(item.get_button_count(column)):
+            item.erase_button(column, 0)
+    for child: TreeItem in item.get_children():
+        self.set_readonly(child)
+    if item.get_next() != null:
+        self.set_readonly(item.get_next())
+
+func _on_button_clicked(item: TreeItem, column: int, id: int, mouse_button_idx: int) -> void:
+    item.get_meta("handler").button_clicked(column, id, mouse_button_idx)
+
+func _on_cell_selected() -> void:
+    if self._selected_item != null:
+        self._selected_item.clear_custom_bg_color(0)
+    self._selected_item = self.get_selected()
+    self._selected_item.set_custom_bg_color(0, self.get_theme_color("box_selection_fill_color", "Editor"))
+    if self.get_selected_column() == 0:
+        self._selected_item.deselect(0)
+        self._selected_item.select(1)
+
+func _on_item_edited(item: TreeItem = null) -> void:
+    if item == null:
+        item = self.get_edited()
+    var handler = item.get_meta("handler")
+    handler.edited()
+    var parent = item.get_parent()
+    if parent != null:
+        parent.get_meta("handler").child_edited(item)
+
+    self.component_edited.emit(self._component)
+
+func _get_handler(property: Dictionary) -> GDScript:
+    for handler: GDScript in self.handlers:
+        if handler.can_handle(property):
+            return handler
+    return null
+
+func _add_item(parent: TreeItem, value: Variant, property: Dictionary) -> void:
+    var handler_cls: GDScript = self._get_handler(property)
+    if handler_cls == null:
+        return
+    handler_cls.new(self, self.create_item(parent), value, property)
diff --git a/addons/licenses/internal/components_container.gd b/addons/licenses/internal/components_container.gd
new file mode 100644 (file)
index 0000000..6a0af4f
--- /dev/null
@@ -0,0 +1,39 @@
+extends Node
+
+const Component := preload("../component.gd")
+const Licenses := preload("../licenses.gd")
+
+signal components_changed()
+
+var _components: Array[Component] = []
+
+func emit_changed() -> void:
+    self.components_changed.emit()
+
+func add_component(component: Component) -> void:
+    self._components.append(component)
+    self._components.sort_custom(Licenses.compare_components_ascending)
+
+func set_components(components_: Array[Component]) -> void:
+    self._components = components_
+
+func components() -> Array[Component]:
+    return self._components
+
+func get_at(idx: int) -> Component:
+    return self._components[idx]
+
+func remove_at(idx: int) -> void:
+    self._components.remove_at(idx)
+
+func remove_component(component: Component) -> void:
+    var idx: int = self._components.find(component)
+    if idx == -1:
+        return
+    self.remove_at(idx)
+
+func sort_custom(fn: Callable) -> void:
+    self._components.sort_custom(fn)
+
+func count() -> int:
+    return len(self._components)
diff --git a/addons/licenses/internal/components_tree.gd b/addons/licenses/internal/components_tree.gd
new file mode 100644 (file)
index 0000000..5c899ee
--- /dev/null
@@ -0,0 +1,159 @@
+@tool
+extends Tree
+
+const Component := preload("../component.gd")
+const ComponentsContainer := preload("components_container.gd")
+const Licenses := preload("../licenses.gd")
+
+const _BTN_ID_REMOVE: int = 2
+
+signal component_selected(comp: Component)
+signal component_remove(comp: Component)
+signal component_add(comp: Component)
+
+var show_readonly_components: bool = false:
+    set = set_show_readonly_components
+var _components: ComponentsContainer
+## cached value
+var _readonly_components: Array[Component] = []
+
+func set_show_readonly_components(show: bool) -> void:
+    show_readonly_components = show
+    if show:
+        self._readonly_components = Licenses.get_required_engine_components()
+    else:
+        self._readonly_components = []
+    self.reload()
+
+func _ready() -> void:
+    self.allow_rmb_select = true
+
+# only used once
+func set_components(comp: ComponentsContainer) -> void:
+    self._components = comp
+
+func _create_category_item(category_cache: Dictionary, category: String, root: TreeItem) -> TreeItem:
+    if category in category_cache:
+        return category_cache[category]
+    var category_item: TreeItem
+    category_item = self.create_item(root)
+    category_item.set_text(0, category)
+    category_item.set_editable(0, true)
+    category_item.set_meta("category", category)
+    category_cache[category] = category_item
+    return category_item
+
+func _add_tree_item(component: Component, idx: int, parent: TreeItem) -> TreeItem:
+    var item: TreeItem = self.create_item(parent)
+    item.set_text(0, component.name)
+    item.set_meta("idx", idx)
+    item.set_meta("readonly", component.readonly)
+    if not component.readonly:
+        item.add_button(0, self.get_theme_icon("Remove", "EditorIcons"), _BTN_ID_REMOVE)
+    var tooltip = component.name
+    var comp_warnings: PackedStringArray = component.get_warnings()
+    if comp_warnings.size() != 0:
+        tooltip += "\n- " + "\n- ".join(comp_warnings)
+        item.set_icon(0, self.get_theme_icon("NodeWarning", "EditorIcons"))
+    item.set_tooltip_text(0, tooltip)
+    return item
+
+func reload(scroll_to: Component = null) -> void:
+    self.clear()
+    if self.get_root() != null:
+        push_error("could not clear")
+
+    var category_cache: Dictionary = {}
+    var root: TreeItem = self.create_item(null)
+    category_cache[""] = root
+    # count current added engine component
+    var readonly_idx: int = 0
+    # count current added custom components
+    var idx: int = 0
+
+    while idx < self._components.count() or readonly_idx < len(self._readonly_components):
+        var component: Component = null
+        var cur_idx: int = 0
+        var cmp: bool = false
+        # compare readonly items with editable, to determine which one to show first
+        if idx < self._components.count() and readonly_idx < len(self._readonly_components):
+            cmp = Licenses.compare_components_ascending(self._components.get_at(idx), self._readonly_components[readonly_idx])
+        if readonly_idx >= len(self._readonly_components) or cmp:
+            component = self._components.get_at(idx)
+            cur_idx = idx
+            idx = idx + 1
+        elif idx >= self._components.count() or not cmp:
+            component = self._readonly_components[readonly_idx]
+            cur_idx = readonly_idx
+            readonly_idx = readonly_idx + 1
+
+        var parent: TreeItem = self._create_category_item(category_cache, component.category, root)
+        var item: TreeItem = self._add_tree_item(component, cur_idx, parent)
+        if scroll_to != null && component == scroll_to:
+            self.scroll_to_item(item)
+            item.select(0)
+
+func _can_drop_data(at_position: Vector2, data: Variant) -> bool:
+    var item: TreeItem = self.get_item_at_position(at_position)
+    return item != null and data is TreeItem
+
+func _get_drag_data(at_position: Vector2) -> Variant:
+    var item: TreeItem = self.get_item_at_position(at_position)
+    if item == null:
+        return null
+    if not item.has_meta("idx") or (item.get_meta("readonly") as bool):
+        return null
+
+    self.set_drop_mode_flags(Tree.DROP_MODE_INBETWEEN)
+
+    var preview: Label = Label.new()
+    preview.text = item.get_text(0)
+    self.set_drag_preview(preview)
+
+    return item
+
+func _drop_data(at_position: Vector2, data: Variant) -> void:
+    var to_item: TreeItem = self.get_item_at_position(at_position)
+    var shift: int = self.get_drop_section_at_position(at_position)
+    # above category node
+    var category: String = ""
+    # below or above item with category
+    if to_item.has_meta("idx"):
+        category = self._components.get_at(to_item.get_meta("idx") as int).category
+    # below category node
+    elif shift == 1:
+        category = to_item.get_text(0)
+    var cur_component: Component = self._components.get_at(data.get_meta("idx") as int)
+    if cur_component.category == category:
+        return
+    cur_component.category = category
+    self._components.sort_custom(Licenses.compare_components_ascending)
+    self._components.emit_changed()
+
+func _on_item_selected() -> void:
+    var item: TreeItem = self.get_selected()
+    if not item.has_meta("readonly"):
+        return
+    var component: Component
+    if item.get_meta("readonly") as bool:
+        component = self._readonly_components[item.get_meta("idx")]
+    else:
+        component = self._components.get_at(item.get_meta("idx") as int)
+    self.component_selected.emit(component)
+
+func _on_button_clicked(item: TreeItem, column: int, id: int, mouse_button_idx: int) -> void:
+    match id:
+        _BTN_ID_REMOVE:
+            self.component_remove.emit(self._components.get_at(item.get_meta("idx") as int))
+
+func _on_item_edited() -> void:
+    var category_item: TreeItem = self.get_edited()
+    var old_category: String = category_item.get_meta("category")
+    var new_category: String = category_item.get_text(0)
+    category_item.set_meta("category", new_category)
+    for component: Component in self._components.components():
+        if component.category == old_category:
+            component.category = new_category
+
+    self._components.sort_custom(Licenses.compare_components_ascending)
+    self._components.emit_changed()
diff --git a/addons/licenses/internal/file_system_watcher.gd b/addons/licenses/internal/file_system_watcher.gd
new file mode 100644 (file)
index 0000000..2421615
--- /dev/null
@@ -0,0 +1,36 @@
+extends RefCounted
+
+const ComponentsContainer := preload("components_container.gd")
+
+var _components: ComponentsContainer
+
+func _init(components: ComponentsContainer):
+    self._components = components
+    var fs_dock: FileSystemDock = EditorInterface.get_file_system_dock()
+    fs_dock.files_moved.connect(self._on_file_moved)
+    fs_dock.folder_moved.connect(self._on_folder_moved)
+
+func _on_file_moved(old_file: String, new_file: String) -> void:
+    var changed: bool = false
+    for comp in self._components.components():
+        for idx in range(comp.paths.size()):
+            var path: String = comp.paths[idx]
+            if path == old_file:
+                changed = true
+                comp.paths[idx] = new_file
+    if changed:
+        self._components.emit_changed()
+
+func _on_folder_moved(old_folder: String, new_folder: String) -> void:
+    var old_folder_no_slash: String = old_folder.rstrip("/")
+    var changed: bool = false
+    for comp in self._components.components():
+        for idx in range(comp.paths.size()):
+            var path: String = comp.paths[idx]
+            if path == old_folder_no_slash:
+                changed = true
+                comp.paths[idx] = new_folder.rstrip("/")
+            if path.begins_with(old_folder):
+                comp.paths[idx] = new_folder.rstrip("/") + "/" + comp.paths[idx].trim_prefix(old_folder)
+    if changed:
+        self._components.emit_changed()
diff --git a/addons/licenses/internal/handler/array.gd b/addons/licenses/internal/handler/array.gd
new file mode 100644 (file)
index 0000000..10b5234
--- /dev/null
@@ -0,0 +1,85 @@
+extends "base.gd"
+
+var _constructor: Callable
+
+func _init(tree_: ComponentDetailTree, item_: TreeItem, value_: Variant, property_: Dictionary) -> void:
+    super._init(tree_, item_, value_, property_)
+    self.item.set_text(0, self.property["name"].capitalize())
+    self.item.set_text(1, "[ " + str(len(self.value)) + " ]")
+    self.item.set_text_alignment(1, HORIZONTAL_ALIGNMENT_CENTER)
+    self._update_reset_button()
+    self.item.add_button(1, self.tree.get_theme_icon("Add", "EditorIcons"), 1)
+    self.item.add_button(1, self.tree.get_theme_icon("Remove", "EditorIcons"), 2)
+
+    match self._get_child_property("")["type"]:
+        TYPE_STRING:
+            self._constructor = func() -> String: return ""
+        TYPE_OBJECT:
+            self._constructor = self.property["constructor"]
+
+    for idx: int in range(len(self.value)):
+        self.tree._add_item(self.item, self.value[idx], self._get_child_property(str(idx)))
+
+func _get_child_property(name: String) -> Dictionary:
+    var type: int = TYPE_NIL
+    match self.property["type"]:
+        TYPE_PACKED_STRING_ARRAY:
+            type = TYPE_STRING
+    if self.property["type"] == TYPE_ARRAY and self.property.get("constructor") != null:
+        type = TYPE_OBJECT
+    return {"name": name, "type": type, "hint": self.property.get("hint", PROPERTY_HINT_NONE), "hint_text": self.property.get("hint_text", ""), "constructor": self.property.get("constructor", null)}
+
+static func can_handle(property: Dictionary) -> bool:
+    return property["type"] == TYPE_PACKED_STRING_ARRAY or property["type"] == TYPE_ARRAY and property.get("constructor") != null
+
+func _update_reset_button() -> void:
+    var button_id: int = self.item.get_button_by_id(0, 0)
+    if !self.value.is_empty() and button_id == -1:
+        self.item.add_button(0, self.tree.get_theme_icon("Reload", "EditorIcons"), 0)
+    elif self.value.is_empty() and button_id != -1:
+        self.item.erase_button(0, button_id)
+
+func button_clicked(column: int, id: int, mouse_button_idx: int) -> void:
+    match id:
+        # reset array
+        0:
+            self.value = []
+            var next_item: TreeItem = self.item.get_first_child()
+            while next_item != null:
+                self.item.remove_child(next_item)
+                var tmp_item: TreeItem = next_item.get_next()
+                next_item.free()
+                next_item = tmp_item
+            self._update_reset_button()
+            self.tree._on_item_edited(self.item)
+        # add
+        1:
+            var value: Variant = self._constructor.call()
+            self.value.append(value)
+            self.tree._add_item(self.item, value, self._get_child_property(str(len(self.value) - 1)))
+            self._update_reset_button()
+            self.tree._on_item_edited(self.item)
+        # remove
+        2:
+            var selected_item: TreeItem = self.tree._selected_item
+            if selected_item == null or selected_item.get_parent() != self.item:
+                return
+            self.value.remove_at(int(selected_item.get_text(0)))
+
+            var next_item: TreeItem = selected_item.get_next()
+            while next_item != null:
+                var new_name: String = str(int(next_item.get_text(0)) - 1)
+                next_item.set_text(0, new_name)
+                next_item.get_meta("handler").property["name"] = new_name
+                next_item = next_item.get_next()
+
+            self.item.select(0)
+            self.item.remove_child(selected_item)
+            selected_item.free()
+            self._update_reset_button()
+            self.tree._on_item_edited(self.item)
+
+func child_edited(item: TreeItem) -> void:
+    var child = item.get_meta("handler")
+    self.value[int(child.property["name"])] = child.value
+    self.tree._on_item_edited(self.item)
diff --git a/addons/licenses/internal/handler/base.gd b/addons/licenses/internal/handler/base.gd
new file mode 100644 (file)
index 0000000..dc07ac1
--- /dev/null
@@ -0,0 +1,33 @@
+extends RefCounted
+
+const ComponentDetailTree := preload("../component_detail_tree.gd")
+
+var tree: ComponentDetailTree
+var item: TreeItem
+var property: Dictionary
+var value: Variant
+
+func _init(tree_: ComponentDetailTree, item_: TreeItem, value_: Variant, property_: Dictionary) -> void:
+    assert(item_ != null, "item must not null")
+    self.tree = tree_
+    self.item = item_
+    self.property = property_
+    self.value = value_
+    self.item.set_meta("handler", self)
+    self.item.custom_minimum_height = 16
+
+static func can_handle(property: Dictionary) -> bool:
+    return false
+
+# return true if edited
+func button_clicked(column: int, id: int, mouse_button_idx: int) -> void:
+    pass
+
+func child_edited(item: TreeItem) -> void:
+    pass
+
+func edited() -> void:
+    pass
+
+func selected() -> void:
+    pass
diff --git a/addons/licenses/internal/handler/object.gd b/addons/licenses/internal/handler/object.gd
new file mode 100644 (file)
index 0000000..482ba8e
--- /dev/null
@@ -0,0 +1,22 @@
+extends "base.gd"
+
+const Utils := preload("../utils.gd")
+
+func _init(tree_: ComponentDetailTree, item_: TreeItem, value_: Variant, property_: Dictionary) -> void:
+    super._init(tree_, item_, value_, property_)
+    self.item.set_text(0, self.property["name"].capitalize())
+    self.item.set_selectable(1, false)
+
+    for prop: Dictionary in Utils.get_updated_property_list(self.value):
+        # ignore private variables and ignore non supported types and already added items
+        if prop["name"].begins_with("_"):
+            continue
+        self.tree._add_item(self.item, (self.value as Object).get(prop["name"]), prop)
+
+static func can_handle(property: Dictionary) -> bool:
+    return property["type"] == TYPE_OBJECT and property.get("class_name", "") != "Script"
+
+func child_edited(item: TreeItem) -> void:
+    var child = item.get_meta("handler")
+    (self.value as Object).set(child.property["name"], child.value)
+    self.tree._on_item_edited(self.item)
diff --git a/addons/licenses/internal/handler/string.gd b/addons/licenses/internal/handler/string.gd
new file mode 100644 (file)
index 0000000..5b62727
--- /dev/null
@@ -0,0 +1,28 @@
+extends "base.gd"
+
+func _init(tree_: ComponentDetailTree, item_: TreeItem, value_: Variant, property_: Dictionary) -> void:
+    super._init(tree_, item_, value_, property_)
+    self.item.set_text(0, self.property["name"].capitalize())
+    self.item.set_text(1, value_)
+    self.item.set_editable(1, true)
+    self._update_reset_button()
+
+static func can_handle(property: Dictionary) -> bool:
+    return property["type"] == TYPE_STRING
+
+func _update_reset_button() -> void:
+    var button_id: int = self.item.get_button_by_id(0, 0)
+    if self.value != "" and button_id == -1:
+        self.item.add_button(0, self.tree.get_theme_icon("Reload", "EditorIcons"), 0)
+    elif self.value == "" and button_id != -1:
+        self.item.erase_button(0, button_id)
+
+func button_clicked(column: int, id: int, mouse_button_idx: int) -> void:
+    self.value = ""
+    self.item.set_text(1, "")
+    self._update_reset_button()
+    self.tree._on_item_edited(self.item)
+
+func edited() -> void:
+    self.value = self.item.get_text(1)
+    self._update_reset_button()
diff --git a/addons/licenses/internal/handler/string_file.gd b/addons/licenses/internal/handler/string_file.gd
new file mode 100644 (file)
index 0000000..a8a9619
--- /dev/null
@@ -0,0 +1,49 @@
+extends "base.gd"
+
+func _init(tree_: ComponentDetailTree, item_: TreeItem, value_: Variant, property_: Dictionary) -> void:
+    super._init(tree_, item_, value_, property_)
+    self.item.set_text(0, self.property["name"].capitalize())
+    self.item.set_text(1, self.value)
+    self.item.set_editable(1, true)
+    self._update_reset_button()
+    self.item.add_button(1, self.tree.get_theme_icon("Load", "EditorIcons"), 1)
+
+static func can_handle(property: Dictionary) -> bool:
+    return property["type"] == TYPE_STRING and property.get("hint", PROPERTY_HINT_NONE) == PROPERTY_HINT_FILE
+
+func _update_reset_button() -> void:
+    var button_id: int = self.item.get_button_by_id(0, 0)
+    if self.value != "" and button_id == -1:
+        self.item.add_button(0, self.tree.get_theme_icon("Reload", "EditorIcons"), 0)
+    elif self.value == "" and button_id != -1:
+        self.item.erase_button(0, button_id)
+
+func button_clicked(column: int, id: int, mouse_button_idx: int) -> void:
+    match id:
+        0:
+            self.value = ""
+            self.item.set_text(1, self.value)
+            self._update_reset_button()
+            self.tree._on_item_edited(self.item)
+        1:
+            var dialog: FileDialog = FileDialog.new()
+            if property.get("hint_text", "") == "*":
+                dialog.file_mode = FileDialog.FILE_MODE_OPEN_ANY
+            else:
+                dialog.file_mode = FileDialog.FILE_MODE_OPEN_FILE
+            self.tree.add_child(dialog)
+            var view_size: Vector2 = self.tree.get_viewport().size
+            dialog.popup_centered_ratio(0.4)
+            dialog.close_requested.connect(dialog.queue_free)
+            dialog.file_selected.connect(self._on_path_selected)
+            dialog.dir_selected.connect(self._on_path_selected)
+
+func _on_path_selected(path: String) -> void:
+    self.value = path
+    self.item.set_text(1, self.value)
+    self._update_reset_button()
+    self.tree._on_item_edited(self.item)
+
+func edited() -> void:
+    self.value = self.item.get_text(1)
+    self._update_reset_button()
diff --git a/addons/licenses/internal/handler/string_multiline.gd b/addons/licenses/internal/handler/string_multiline.gd
new file mode 100644 (file)
index 0000000..b5505ea
--- /dev/null
@@ -0,0 +1,55 @@
+extends "base.gd"
+
+var _dialog: AcceptDialog
+
+func _init(tree_: ComponentDetailTree, item_: TreeItem, value_: Variant, property_: Dictionary) -> void:
+    super._init(tree_, item_, value_, property_)
+    self.item.set_text(0, self.property["name"].capitalize())
+    self.item.set_text(1, self.value)
+    var tooltip_text: String = self.value.substr(0, mini(self.value.length(), 512))
+    if self.value.length() > 512:
+        tooltip_text += "..."
+    self.item.set_tooltip_text(1, tooltip_text)
+    self._update_reset_button()
+    self.item.add_button(1, self.tree.get_theme_icon("DistractionFree", "EditorIcons"), 1)
+
+static func can_handle(property: Dictionary) -> bool:
+    return property["type"] == TYPE_STRING and property.get("hint", PROPERTY_HINT_NONE) == PROPERTY_HINT_MULTILINE_TEXT
+
+func _update_reset_button() -> void:
+    var button_id: int = self.item.get_button_by_id(0, 0)
+    if self.value != "" and button_id == -1:
+        self.item.add_button(0, self.tree.get_theme_icon("Reload", "EditorIcons"), 0)
+    elif self.value == "" and button_id != -1:
+        self.item.erase_button(0, button_id)
+
+func button_clicked(column: int, id: int, mouse_button_idx: int) -> void:
+    match id:
+        0:
+            self.value = ""
+            self.item.set_text(1, self.value)
+            self._update_reset_button()
+            self.tree._on_item_edited(self.item)
+        1:
+            self._dialog = AcceptDialog.new()
+            self._dialog.title = "Edit Text:"
+            self._dialog.unresizable = false
+            var margin_cont: MarginContainer = MarginContainer.new()
+            margin_cont.anchor_right = 1
+            margin_cont.anchor_bottom = 0.913
+            self._dialog.add_child(margin_cont)
+            var edit_text: TextEdit = TextEdit.new()
+            edit_text.text = self.value
+            margin_cont.add_child(edit_text)
+
+            self.tree.add_child(self._dialog)
+            var view_size: Vector2 = self.tree.get_viewport().size
+            self._dialog.popup_centered_ratio(0.4)
+            self._dialog.confirmed.connect(self._on_text_edited)
+
+func _on_text_edited() -> void:
+    self.value = self._dialog.get_child(0).get_child(0).text
+    self.item.set_text(1, self.value)
+    self._update_reset_button()
+    self._dialog.queue_free()
+    self.tree._on_item_edited(self.item)
diff --git a/addons/licenses/internal/licenses.gd b/addons/licenses/internal/licenses.gd
new file mode 100644 (file)
index 0000000..86e451a
--- /dev/null
@@ -0,0 +1,168 @@
+@tool
+extends MarginContainer
+
+const Licenses := preload("../licenses.gd")
+const Component := preload("../component.gd")
+const ComponentsTree := preload("components_tree.gd")
+const ComponentDetailTree := preload("component_detail_tree.gd")
+const Toolbar := preload("toolbar.gd")
+const ComponentsContainer := preload("components_container.gd")
+const FileSystemWatcher := preload("file_system_watcher.gd")
+# handler
+const BaseHandler := preload("handler/base.gd")
+const ObjectHandler := preload("handler/object.gd")
+const ArrayHandler := preload("handler/array.gd")
+const StringHandler := preload("handler/string.gd")
+const StringFileHandler := preload("handler/string_file.gd")
+const StringMultiLineHandler := preload("handler/string_multiline.gd")
+
+@export_node_path("Tree") var _components_tree_path
+@onready var _components_tree: ComponentsTree = self.get_node(self._components_tree_path)
+@export_node_path("Tree") var _component_detail_tree_path
+@onready var _component_detail_tree: ComponentDetailTree = self.get_node(self._component_detail_tree_path)
+@export_node_path("HBoxContainer") var _toolbar_path
+@onready var _toolbar: Toolbar = self.get_node(self._toolbar_path)
+var _item_menu: PopupMenu
+@export var _license_file_edit: LineEdit = null
+@export var _license_file_load_button: Button = null
+@export var _set_license_filepath_button: Button = null
+
+var _components: ComponentsContainer = ComponentsContainer.new()
+var _file_watcher: FileSystemWatcher
+
+func _ready() -> void:
+    self._license_file_load_button.icon = self.get_theme_icon("Load", "EditorIcons")
+    self._license_file_load_button.pressed.connect(self._on_data_file_load_button_clicked)
+    self._set_license_filepath_button.icon = self.get_theme_icon("ImportCheck", "EditorIcons")
+    self._set_license_filepath_button.pressed.connect(self._on_set_license_filepath_clicked)
+    self._license_file_edit.text_submitted.connect(self._on_data_file_edit_changed)
+    self._license_file_edit.text = Licenses.get_license_data_filepath()
+
+    self._create_item_menu()
+    self._components_tree.gui_input.connect(self._on_gui_input)
+    self.add_child(self._components)
+
+    self._components_tree.set_components(self._components)
+    self._components_tree.component_selected.connect(self._on_component_tree_selected)
+    self._components_tree.component_remove.connect(self._on_component_tree_remove)
+    self._components_tree.component_add.connect(self._on_component_tree_add)
+
+    self._component_detail_tree.component_edited.connect(self._on_component_detail_edited)
+    self._component_detail_tree.handlers = [ObjectHandler, StringFileHandler, StringMultiLineHandler, StringHandler, ArrayHandler]
+
+    self._toolbar.add_component.connect(self._on_toolbar_add_component)
+    self._toolbar.show_engine_components.connect(self._on_toolbar_show_engine_components)
+
+    self.reload()
+    self._components.components_changed.connect(self._on_components_changed)
+    if Engine.is_editor_hint():
+        self._file_watcher = FileSystemWatcher.new(self._components)
+
+func reload() -> void:
+    self._update_set_license_filepath_button()
+    var res: Licenses.LoadResult = Licenses.load(self._license_file_edit.text)
+    if res.err_msg == "":
+        self._license_file_edit.right_icon = null
+        self._license_file_edit.tooltip_text = ""
+    else:
+        self._license_file_edit.right_icon = self.get_theme_icon("NodeWarning", "EditorIcons")
+        self._license_file_edit.tooltip_text = res.err_msg
+    
+    self._components.set_components(res.components)
+    self._components.sort_custom(Licenses.compare_components_ascending)
+    self._components.emit_changed()
+
+func _create_item_menu() -> void:
+    self._item_menu = PopupMenu.new()
+    self._item_menu.name = "item_menu"
+    self._item_menu.id_pressed.connect(self._on_item_menu_pressed)
+    self._item_menu.add_icon_item(self.get_theme_icon("Duplicate", "EditorIcons"), "Duplicate")
+    self._item_menu.add_icon_item(self.get_theme_icon("Remove", "EditorIcons"), "Delete")
+    self._item_menu.size = self._item_menu.get_contents_minimum_size()
+    self.add_child(self._item_menu)
+
+func _update_set_license_filepath_button() -> void:
+    if Licenses.get_license_data_filepath() == self._license_file_edit.text:
+        self._set_license_filepath_button.icon = self.get_theme_icon("ImportCheck", "EditorIcons")
+        self._set_license_filepath_button.tooltip_text = "Selected file is set as the project license file."
+        self._set_license_filepath_button.disabled = true
+    else:
+        self._set_license_filepath_button.icon = self.get_theme_icon("ImportFail", "EditorIcons")
+        self._set_license_filepath_button.tooltip_text = "Set the current file as project license file."
+        self._set_license_filepath_button.disabled = false
+
+func _on_data_file_load_button_clicked() -> void:
+    var dialog: FileDialog = FileDialog.new()
+    dialog.file_mode = FileDialog.FILE_MODE_OPEN_FILE
+    dialog.current_path = self._license_file_edit.text
+    self.add_child(dialog)
+    dialog.popup_centered_ratio(0.4)
+    dialog.close_requested.connect(dialog.queue_free)
+    dialog.file_selected.connect(self._on_data_file_selected)
+
+func _on_data_file_edit_changed(new_text: String) -> void:
+    self._on_data_file_selected(new_text)
+
+func _on_data_file_selected(path: String) -> void:
+    self._license_file_edit.text = path
+    self.reload()
+
+func _on_set_license_filepath_clicked() -> void:
+    Licenses.set_license_data_filepath(self._license_file_edit.text)
+    self._update_set_license_filepath_button()
+
+func _on_component_tree_selected(comp: Component) -> void:
+    self._component_detail_tree.set_component(comp)
+
+func _on_component_tree_add(comp: Component) -> void:
+    self._components.add_component(comp)
+    self._component_detail_tree.set_component(comp)
+    self._components.emit_changed()
+
+func _on_component_tree_remove(comp: Component) -> void:
+    self._components.remove_component(comp)
+    self._components.sort_custom(Licenses.compare_components_ascending)
+    # refresh detail view if the current component was removed
+    if comp == self._component_detail_tree.get_component():
+        self._component_detail_tree.set_component(null)
+    self._components.emit_changed()
+
+func _on_toolbar_add_component(comp: Component) -> void:
+    self._on_component_tree_add(comp)
+
+func _on_toolbar_show_engine_components(show: bool) -> void:
+    self._components_tree.show_readonly_components = show
+
+# callback from component detail tree
+func _on_component_detail_edited(component: Component) -> void:
+    self._components.sort_custom(Licenses.compare_components_ascending)
+    # we cannot reload the tree while it is processing any kind of input/signals
+    # https://github.com/godotengine/godot/issues/50084
+    call_deferred("_emit_changed")
+
+func _on_components_changed() -> void:
+    Licenses.save(self._components.components(), self._license_file_edit.text)
+    self._component_detail_tree.reload()
+    self._components_tree.reload(self._component_detail_tree.get_component())
+
+func _on_gui_input(event: InputEvent) -> void:
+    if !(event is InputEventMouseButton) || !event.pressed || event.button_index != MOUSE_BUTTON_RIGHT:
+        return
+    var item: TreeItem = self._components_tree.get_item_at_position(event.position)
+    if item == null || !item.has_meta("idx") || !item.has_meta("readonly") || (item.get_meta("readonly") as bool):
+        return
+
+    self._item_menu.popup_on_parent(Rect2(self.get_local_mouse_position(), self._item_menu.size))
+
+func _on_item_menu_pressed(btn_idx: int) -> void:
+    var idx: int = self._components_tree.get_selected().get_meta("idx") as int
+    match btn_idx:
+        0:
+            var new_comp: Component = self._components.get_at(idx).duplicate()
+            new_comp.name = new_comp.name + " Copy"
+            self._on_component_tree_add(new_comp)
+        1:
+            self._on_component_tree_remove(self._components.get_at(idx))
+
+func _emit_changed():
+    self._components.emit_changed()
diff --git a/addons/licenses/internal/licenses.tscn b/addons/licenses/internal/licenses.tscn
new file mode 100644 (file)
index 0000000..5f1401d
--- /dev/null
@@ -0,0 +1,106 @@
+[gd_scene load_steps=6 format=3 uid="uid://dfj2mhwrs1oss"]
+
+[ext_resource type="Script" path="res://addons/licenses/internal/component_detail_tree.gd" id="1"]
+[ext_resource type="Script" path="res://addons/licenses/internal/components_tree.gd" id="2"]
+[ext_resource type="Script" path="res://addons/licenses/internal/toolbar.gd" id="2_a8iu8"]
+[ext_resource type="Script" path="res://addons/licenses/internal/licenses.gd" id="3"]
+
+[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5cx7n"]
+
+[node name="licenses" type="MarginContainer" node_paths=PackedStringArray("_license_file_edit", "_license_file_load_button", "_set_license_filepath_button")]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+size_flags_horizontal = 3
+size_flags_vertical = 3
+theme_override_constants/margin_left = 4
+theme_override_constants/margin_top = 4
+theme_override_constants/margin_right = 4
+theme_override_constants/margin_bottom = 4
+script = ExtResource("3")
+_components_tree_path = NodePath("VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/components")
+_component_detail_tree_path = NodePath("VBoxContainer/HSplitContainer/component_detail")
+_toolbar_path = NodePath("VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/toolbar")
+_license_file_edit = NodePath("VBoxContainer/license_file_config/edit")
+_license_file_load_button = NodePath("VBoxContainer/license_file_config/file_button")
+_set_license_filepath_button = NodePath("VBoxContainer/license_file_config/set_license_filepath_button")
+
+[node name="VBoxContainer" type="VBoxContainer" parent="."]
+layout_mode = 2
+
+[node name="license_file_config" type="HBoxContainer" parent="VBoxContainer"]
+layout_mode = 2
+
+[node name="file_button" type="Button" parent="VBoxContainer/license_file_config"]
+layout_mode = 2
+
+[node name="edit" type="LineEdit" parent="VBoxContainer/license_file_config"]
+layout_mode = 2
+size_flags_horizontal = 3
+auto_translate = false
+localize_numeral_system = false
+placeholder_text = "res://licenses.json"
+
+[node name="set_license_filepath_button" type="Button" parent="VBoxContainer/license_file_config"]
+layout_mode = 2
+
+[node name="HSplitContainer" type="HSplitContainer" parent="VBoxContainer"]
+layout_mode = 2
+size_flags_vertical = 3
+
+[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/HSplitContainer"]
+layout_mode = 2
+size_flags_horizontal = 3
+size_flags_stretch_ratio = 0.4
+
+[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HSplitContainer/PanelContainer"]
+layout_mode = 2
+size_flags_horizontal = 3
+theme_override_constants/separation = 0
+
+[node name="toolbar" type="HBoxContainer" parent="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer" node_paths=PackedStringArray("_menu_button", "_add_button")]
+layout_mode = 2
+script = ExtResource("2_a8iu8")
+_menu_button = NodePath("menu")
+_add_button = NodePath("add")
+
+[node name="menu" type="Button" parent="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/toolbar"]
+layout_mode = 2
+flat = true
+
+[node name="Label" type="Label" parent="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/toolbar"]
+layout_mode = 2
+size_flags_horizontal = 3
+text = "Components"
+horizontal_alignment = 1
+vertical_alignment = 1
+
+[node name="add" type="Button" parent="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/toolbar"]
+layout_mode = 2
+flat = true
+
+[node name="components" type="Tree" parent="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer"]
+layout_mode = 2
+size_flags_horizontal = 3
+size_flags_vertical = 3
+theme_override_styles/panel = SubResource("StyleBoxEmpty_5cx7n")
+hide_root = true
+scroll_horizontal_enabled = false
+script = ExtResource("2")
+
+[node name="component_detail" type="Tree" parent="VBoxContainer/HSplitContainer"]
+layout_mode = 2
+size_flags_horizontal = 3
+size_flags_vertical = 3
+columns = 2
+hide_root = true
+script = ExtResource("1")
+
+[connection signal="button_clicked" from="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/components" to="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/components" method="_on_button_clicked"]
+[connection signal="item_edited" from="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/components" to="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/components" method="_on_item_edited"]
+[connection signal="item_selected" from="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/components" to="VBoxContainer/HSplitContainer/PanelContainer/VBoxContainer/components" method="_on_item_selected"]
+[connection signal="button_clicked" from="VBoxContainer/HSplitContainer/component_detail" to="VBoxContainer/HSplitContainer/component_detail" method="_on_button_clicked"]
+[connection signal="cell_selected" from="VBoxContainer/HSplitContainer/component_detail" to="VBoxContainer/HSplitContainer/component_detail" method="_on_cell_selected"]
+[connection signal="item_edited" from="VBoxContainer/HSplitContainer/component_detail" to="VBoxContainer/HSplitContainer/component_detail" method="_on_item_edited"]
diff --git a/addons/licenses/internal/licenses_dialog.gd b/addons/licenses/internal/licenses_dialog.gd
new file mode 100644 (file)
index 0000000..0ec73e2
--- /dev/null
@@ -0,0 +1,13 @@
+@tool
+extends Window
+
+const LicensesContainer := preload("licenses.gd")
+
+@export_node_path("MarginContainer") var _licenses_path; @onready var _licenses: LicensesContainer = self.get_node(self._licenses_path)
+
+func _notification(what: int) -> void:
+    if (what == NOTIFICATION_WM_CLOSE_REQUEST):
+        self.hide()
+
+func _on_about_to_popup() -> void:
+    self._licenses.reload()
diff --git a/addons/licenses/internal/licenses_dialog.tscn b/addons/licenses/internal/licenses_dialog.tscn
new file mode 100644 (file)
index 0000000..366ef45
--- /dev/null
@@ -0,0 +1,25 @@
+[gd_scene load_steps=3 format=3 uid="uid://cjrktrabkeadi"]
+
+[ext_resource type="Script" path="res://addons/licenses/internal/licenses_dialog.gd" id="1_0s46i"]
+[ext_resource type="PackedScene" uid="uid://dfj2mhwrs1oss" path="res://addons/licenses/internal/licenses.tscn" id="1_f3ql8"]
+
+[node name="license_dialog" type="Window"]
+disable_3d = true
+title = "Licenses"
+size = Vector2i(1920, 1080)
+visible = false
+wrap_controls = true
+transient = true
+script = ExtResource("1_0s46i")
+_licenses_path = NodePath("licenses")
+
+[node name="panel" type="Panel" parent="."]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+
+[node name="licenses" parent="." instance=ExtResource("1_f3ql8")]
+
+[connection signal="about_to_popup" from="." to="." method="_on_about_to_popup"]
diff --git a/addons/licenses/internal/toolbar.gd b/addons/licenses/internal/toolbar.gd
new file mode 100644 (file)
index 0000000..955e023
--- /dev/null
@@ -0,0 +1,141 @@
+@tool
+extends HBoxContainer
+
+const Licenses := preload("../licenses.gd")
+const Component := preload("../component.gd")
+const ComponentTree := preload("components_tree.gd")
+
+signal add_component(comp: Component)
+signal show_engine_components(show: bool)
+
+@export var _menu_button: Button = null
+@export var _add_button: Button = null
+
+var _menu: PopupMenu
+var _add_menu: PopupMenu
+var _add_plugin_menu: PopupMenu
+var _add_engine_menu: PopupMenu
+
+func _ready() -> void:
+    self._menu_button.icon = self.get_theme_icon("GuiTabMenuHl", "EditorIcons")
+    self._menu_button.pressed.connect(self._on_menu_pressed)
+    self._add_button.icon = self.get_theme_icon("Add", "EditorIcons")
+    self._add_button.pressed.connect(self._on_add_pressed)
+
+    self._menu = PopupMenu.new()
+    self._menu.add_check_item("Show Engine Components", 0)
+    self._menu.id_pressed.connect(self._on_menu_id_pressed)
+    self.add_child(self._menu)
+
+    self._add_menu = PopupMenu.new()
+    self._add_menu.add_item("New Component", 0)
+    self._add_menu.set_item_icon(0, get_theme_icon("New", "EditorIcons"))
+    self._add_menu.add_submenu_item("Generate from Plugin", "menu_plugin", 1)
+    self._add_menu.set_item_icon(1, get_theme_icon("EditorPlugin", "EditorIcons"))
+    self._add_menu.add_submenu_item("Generate from Engine", "menu_engine", 2)
+    self._add_menu.set_item_icon(2, get_theme_icon("Godot", "EditorIcons"))
+    self._add_menu.id_pressed.connect(self._on_add_id_pressed)
+    self.add_child(self._add_menu)
+
+    self._create_plugin_menu_items()
+    self._create_engine_menu_items()
+
+# get plugin config as dictionary
+func _get_plugin_config(path: String) -> Dictionary:
+    var config: ConfigFile = ConfigFile.new()
+    var err: int = config.load(path)
+    if err != OK:
+        push_warning("Could not load " + path)
+        return {}
+
+    var cfg_data: Dictionary = {}
+    for section: String in config.get_sections():
+        var section_data: Dictionary = {}
+        for key: String in config.get_section_keys(section):
+            section_data[key] = config.get_value(section, key)
+        cfg_data[section] = section_data
+    return cfg_data
+
+func _create_engine_menu_items() -> void:
+    self._add_engine_menu = PopupMenu.new()
+    self._add_engine_menu.id_pressed.connect(self._on_engine_add_id_pressed)
+    self._add_engine_menu.name = "menu_engine"
+    self._add_menu.add_child(self._add_engine_menu)
+
+    var idx: int = 0
+    for info: Dictionary in Engine.get_copyright_info():
+        self._add_engine_menu.add_item(info["name"])
+        self._add_engine_menu.set_item_metadata(idx, info["name"])
+        idx = idx + 1
+
+    # set max size to ~10 items
+    var min_size: Vector2 = self._add_engine_menu.get_contents_minimum_size()
+    min_size.y = 280
+    self._add_engine_menu.max_size = min_size
+
+func _create_plugin_menu_items() -> void:
+    self._add_plugin_menu = PopupMenu.new()
+    self._add_plugin_menu.id_pressed.connect(self._on_plugin_add_id_pressed)
+    self._add_plugin_menu.name = "menu_plugin"
+    self._add_menu.add_child(self._add_plugin_menu)
+
+    var dir: DirAccess = DirAccess.open("res://addons/")
+    if dir == null:
+        return
+
+    dir.list_dir_begin()
+    var elem: String = dir.get_next()
+    var idx: int = 0
+    while (not elem.is_empty()):
+        if dir.current_is_dir():
+            var path: String = "res://addons/".path_join(elem).path_join("/plugin.cfg")
+            var cfg: Dictionary = self._get_plugin_config(path)
+            var name: String = cfg.get("plugin", {}).get("name", "")
+            if name != "":
+                self._add_plugin_menu.add_item(name)
+                self._add_plugin_menu.set_item_metadata(idx, path)
+                idx = idx + 1
+        elem = dir.get_next()
+    dir.list_dir_end()
+    dir = null
+    # set max size to ~10 items
+    var min_size: Vector2 = self._add_plugin_menu.get_contents_minimum_size()
+    min_size.y = 284
+    self._add_plugin_menu.max_size = min_size
+
+func _on_add_pressed() -> void:
+    self._add_menu.popup_on_parent(Rect2(self._add_button.global_position + Vector2(0.0, self._add_button.size.y), self._add_menu.get_contents_minimum_size()))
+
+func _on_menu_pressed() -> void:
+    self._menu.popup_on_parent(Rect2(self._menu_button.global_position + Vector2(0.0, self._menu_button.size.y), self._menu.get_contents_minimum_size()))
+
+# add license entry based on engine entry
+func _on_engine_add_id_pressed(id: int) -> void:
+    var component: Component = Licenses.get_engine_component(self._add_engine_menu.get_item_metadata(id))
+    if component == null:
+        return
+    component.readonly = false
+    self.add_component.emit(component)
+
+# add component entry based on plugin cfg
+func _on_plugin_add_id_pressed(id: int) -> void:
+    var cfg: Dictionary = self._get_plugin_config(self._add_plugin_menu.get_item_metadata(id))
+    var component: Component = Component.new()
+    component.name = cfg["plugin"]["name"]
+    component.description = cfg["plugin"].get("description", "")
+    component.copyright.append(cfg["plugin"].get("author", ""))
+    component.version = cfg["plugin"].get("version", "")
+    component.paths.append(self._add_plugin_menu.get_item_metadata(id).get_base_dir())
+    self.add_component.emit(component)
+
+func _on_menu_id_pressed(id: int) -> void:
+    match id:
+        0:
+            self._menu.toggle_item_checked(0)
+            self.show_engine_components.emit(self._menu.is_item_checked(0))
+
+func _on_add_id_pressed(id: int) -> void:
+    match id:
+        0:
+            var component: Component = Component.new()
+            self.add_component.emit(component)
diff --git a/addons/licenses/internal/utils.gd b/addons/licenses/internal/utils.gd
new file mode 100644 (file)
index 0000000..3f02467
--- /dev/null
@@ -0,0 +1,12 @@
+## will return the property list of object
+## if an entry is duplicated the last one is replacing the previous one
+static func get_updated_property_list(object: Object) -> Array:
+    var properties: Array = object.get_property_list()
+    var patched_properties: Array = object._get_property_list()
+    properties = properties.slice(0, properties.size() - patched_properties.size())
+    for p_prop_idx: int in range(patched_properties.size()):
+        for prop_idx: int in range(properties.size()):
+            if properties[prop_idx]["name"] == patched_properties[p_prop_idx]["name"]:
+                properties[prop_idx] = patched_properties[p_prop_idx]
+                break
+    return properties
diff --git a/addons/licenses/licenses.gd b/addons/licenses/licenses.gd
new file mode 100644 (file)
index 0000000..fe7d9c5
--- /dev/null
@@ -0,0 +1,117 @@
+extends RefCounted
+# DO NOT USE THE CLASS NAME, it will be removed later
+class_name __LicenseManager
+
+const Component := preload("component.gd")
+
+const DATA_FILE: String = "plugins/licenses/data_file"
+
+static func compare_components_ascending(lhs: Component, rhs: Component) -> bool:
+    var lhs_cat_lower: String = lhs.category.to_lower()
+    var rhs_cat_lower: String = rhs.category.to_lower()
+    return lhs_cat_lower < rhs_cat_lower or (lhs_cat_lower == rhs_cat_lower and lhs.name.to_lower() < rhs.name.to_lower())
+
+static func get_engine_component(name: String) -> Component:
+    var license_keys: Array = Engine.get_license_info().keys()
+    for info: Dictionary in Engine.get_copyright_info():
+        if info["name"] != name:
+            continue
+        var component: Component = Component.new()
+        component.readonly = true
+        component.id = info["name"].to_snake_case()
+        component.category = "Engine Components"
+        component.name = info["name"]
+
+        component.copyright = info["parts"][0]["copyright"]
+        var license_str: String = info["parts"][0]["license"]
+        for license_key: String in license_keys:
+            if license_key in license_str:
+                var license: Component.License = Component.License.new()
+                license.name = license_key
+                if license.name == "Expat":
+                    license.name = "MIT License"
+                    license.identifier = "MIT"
+                license.text = Engine.get_license_info()[license_key]
+                component.licenses.append(license)
+
+        if info["name"] == "Godot Engine":
+            component.version = Engine.get_version_info().string
+            component.web = "https://godotengine.org/"
+            component.licenses[0].text = Engine.get_license_text()
+            component.licenses[0].web = "https://godotengine.org/license"
+
+        return component
+    return null
+
+static func get_engine_components() -> Array[Component]:
+    var engine_components: Array[Component] = []
+
+    for info: Dictionary in Engine.get_copyright_info():
+        var eg_comp: Component = get_engine_component(info["name"])
+        if eg_comp != null:
+            engine_components.append(eg_comp)
+
+    engine_components.sort_custom(__LicenseManager.compare_components_ascending)
+    return engine_components
+
+static func get_required_engine_components() -> Array[Component]:
+    var engine_components: Array[Component] = []
+
+    for name: String in ["Godot Engine", "ENet", "The FreeType Project", "Mbed TLS"]:
+        var eg_comp: Component = get_engine_component(name)
+        if eg_comp != null:
+            engine_components.append(eg_comp)
+
+    engine_components.sort_custom(__LicenseManager.compare_components_ascending)
+    return engine_components
+
+static func save(components: Array[Component], file_path: String) -> int:
+    var file: FileAccess = FileAccess.open(file_path, FileAccess.WRITE)
+    if file == null:
+        return FileAccess.get_open_error()
+    var raw: Array = []
+    for component: Component in components:
+        raw.append(component.serialize())
+    file.store_line(JSON.stringify({"components": raw}))
+    file = null
+    return OK
+
+class LoadResult:
+    extends RefCounted
+
+    var components: Array[Component]
+    var err_msg: String = ""
+
+    func _init(components: Array[Component], err_msg: String = "") -> void:
+        self.components = components
+        self.err_msg = err_msg
+
+static func load(file_path: String) -> LoadResult:
+    if not FileAccess.file_exists(file_path):
+        return LoadResult.new([])
+
+    var file: FileAccess = FileAccess.open(file_path, FileAccess.READ)
+    if file == null:
+        return LoadResult.new([], "could not open file (" + String.num_int64(FileAccess.get_open_error()) + "): " % [file_path])
+    var parser: JSON = JSON.new()
+    var res: int = parser.parse(file.get_as_text())
+    file = null
+    if res != OK:
+        return LoadResult.new([], "'%s' could not parse: '%s'" % [file_path, parser.get_error_message()])
+    if not "components" in parser.data:
+        return LoadResult.new([], "'%s' does not have a 'components' field" % [file_path])
+
+    var components: Array[Component] = []
+    for raw: Dictionary in parser.data["components"]:
+        components.append(Component.new().deserialize(raw))
+    components = components
+    return LoadResult.new(components)
+
+static func set_license_data_filepath(path: String) -> void:
+    ProjectSettings.set_setting(DATA_FILE, path)
+
+static func get_license_data_filepath() -> String:
+    # does not work due to https://github.com/godotengine/godot/issues/56598
+    if ProjectSettings.has_setting(DATA_FILE):
+        return ProjectSettings.get_setting(DATA_FILE)
+    return "res://licenses.json"
diff --git a/addons/licenses/plugin.cfg b/addons/licenses/plugin.cfg
new file mode 100644 (file)
index 0000000..0555b12
--- /dev/null
@@ -0,0 +1,19 @@
+[plugin]
+
+name="License Manager"
+description="Manage license and copyright for third party graphics, software or libraries."
+author="Iceflower S"
+version="1.7.0"
+script="plugin.gd"
+license="MIT"
+repository="https://github.com/kenyoni-software/godot-addons"
+keywords=[
+    "tool"
+]
+classifiers=[
+    "Development Status :: 5 - Production/Stable",
+    "License :: OSI Approved :: MIT License"
+]
+
+[plugin.dependencies]
+godot=">=4.2"
\ No newline at end of file
diff --git a/addons/licenses/plugin.gd b/addons/licenses/plugin.gd
new file mode 100644 (file)
index 0000000..02c8fe4
--- /dev/null
@@ -0,0 +1,43 @@
+@tool
+extends EditorPlugin
+
+const LicensesDialogScene: PackedScene = preload("internal/licenses_dialog.tscn")
+const Licenses := preload("licenses.gd")
+const ExportPlugin := preload("export_plugin.gd")
+
+var export_plugin: ExportPlugin
+var licenses_dialog: Window
+
+func _get_plugin_name() -> String:
+    return "Licenses"
+
+func _enter_tree() -> void:
+    set_project_setting(Licenses.DATA_FILE, "res://licenses.json", TYPE_STRING, PROPERTY_HINT_FILE)
+
+    self.export_plugin = ExportPlugin.new()
+    self.add_export_plugin(self.export_plugin)
+
+    self.licenses_dialog = LicensesDialogScene.instantiate()
+    EditorInterface.get_base_control().add_child(self.licenses_dialog)
+    self.add_tool_menu_item(self._get_plugin_name() + "...", self._show_popup)
+
+func _exit_tree() -> void:
+    self.remove_tool_menu_item(self._get_plugin_name() + "...")
+    self.licenses_dialog.queue_free()
+    self.remove_export_plugin(self.export_plugin)
+
+func _show_popup() -> void:
+    if licenses_dialog.visible:
+        self.licenses_dialog.grab_focus()
+    else:
+        self.licenses_dialog.popup_centered_ratio(0.4)
+
+static func set_project_setting(key: String, initial_value, type: int, type_hint: int) -> void:
+    if not ProjectSettings.has_setting(key):
+        ProjectSettings.set_setting(key, initial_value)
+    ProjectSettings.set_initial_value(key, initial_value)
+    ProjectSettings.add_property_info({
+        "name": key,
+        "type": type,
+        "hint": type_hint,
+    })
diff --git a/addons/rich_text_label_ex/LICENSE b/addons/rich_text_label_ex/LICENSE
new file mode 100644 (file)
index 0000000..0e259d4
--- /dev/null
@@ -0,0 +1,121 @@
+Creative Commons Legal Code
+
+CC0 1.0 Universal
+
+    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
+    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
+    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+    HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer
+exclusive Copyright and Related Rights (defined below) upon the creator
+and subsequent owner(s) (each and all, an "owner") of an original work of
+authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for
+the purpose of contributing to a commons of creative, cultural and
+scientific works ("Commons") that the public can reliably and without fear
+of later claims of infringement build upon, modify, incorporate in other
+works, reuse and redistribute as freely as possible in any form whatsoever
+and for any purposes, including without limitation commercial purposes.
+These owners may contribute to the Commons to promote the ideal of a free
+culture and the further production of creative, cultural and scientific
+works, or to gain reputation or greater distribution for their Work in
+part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any
+expectation of additional consideration or compensation, the person
+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
+is an owner of Copyright and Related Rights in the Work, voluntarily
+elects to apply CC0 to the Work and publicly distribute the Work under its
+terms, with knowledge of his or her Copyright and Related Rights in the
+Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be
+protected by copyright and related or neighboring rights ("Copyright and
+Related Rights"). Copyright and Related Rights include, but are not
+limited to, the following:
+
+  i. the right to reproduce, adapt, distribute, perform, display,
+     communicate, and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+iii. publicity and privacy rights pertaining to a person's image or
+     likeness depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work,
+     subject to the limitations in paragraph 4(a), below;
+  v. rights protecting the extraction, dissemination, use and reuse of data
+     in a Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+     European Parliament and of the Council of 11 March 1996 on the legal
+     protection of databases, and under any national implementation
+     thereof, including any amended or successor version of such
+     directive); and
+vii. other similar, equivalent or corresponding rights throughout the
+     world based on applicable law or treaty, and any national
+     implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention
+of, applicable law, Affirmer hereby overtly, fully, permanently,
+irrevocably and unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims and causes
+of action, whether now known or unknown (including existing as well as
+future claims and causes of action), in the Work (i) in all territories
+worldwide, (ii) for the maximum duration provided by applicable law or
+treaty (including future time extensions), (iii) in any current or future
+medium and for any number of copies, and (iv) for any purpose whatsoever,
+including without limitation commercial, advertising or promotional
+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
+member of the public at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be subject to
+revocation, rescission, cancellation, termination, or any other legal or
+equitable action to disrupt the quiet enjoyment of the Work by the public
+as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason
+be judged legally invalid or ineffective under applicable law, then the
+Waiver shall be preserved to the maximum extent permitted taking into
+account Affirmer's express Statement of Purpose. In addition, to the
+extent the Waiver is so judged Affirmer hereby grants to each affected
+person a royalty-free, non transferable, non sublicensable, non exclusive,
+irrevocable and unconditional license to exercise Affirmer's Copyright and
+Related Rights in the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty (including future
+time extensions), (iii) in any current or future medium and for any number
+of copies, and (iv) for any purpose whatsoever, including without
+limitation commercial, advertising or promotional purposes (the
+"License"). The License shall be deemed effective as of the date CC0 was
+applied by Affirmer to the Work. Should any part of the License for any
+reason be judged legally invalid or ineffective under applicable law, such
+partial invalidity or ineffectiveness shall not invalidate the remainder
+of the License, and in such case Affirmer hereby affirms that he or she
+will not (i) exercise any of his or her remaining Copyright and Related
+Rights in the Work or (ii) assert any associated claims and causes of
+action with respect to the Work, in either case contrary to Affirmer's
+express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
+    surrendered, licensed or otherwise affected by this document.
+ b. Affirmer offers the Work as-is and makes no representations or
+    warranties of any kind concerning the Work, express, implied,
+    statutory or otherwise, including without limitation warranties of
+    title, merchantability, fitness for a particular purpose, non
+    infringement, or the absence of latent or other defects, accuracy, or
+    the present or absence of errors, whether or not discoverable, all to
+    the greatest extent permissible under applicable law.
+ c. Affirmer disclaims responsibility for clearing rights of other persons
+    that may apply to the Work or any use thereof, including without
+    limitation any person's Copyright and Related Rights in the Work.
+    Further, Affirmer disclaims responsibility for obtaining any necessary
+    consents, permissions or other rights required for any use of the
+    Work.
+ d. Affirmer understands and acknowledges that Creative Commons is not a
+    party to this document and has no duty or obligation with respect to
+    this CC0 or use of the Work.
diff --git a/addons/rich_text_label_ex/README.md b/addons/rich_text_label_ex/README.md
new file mode 100644 (file)
index 0000000..9a4651c
--- /dev/null
@@ -0,0 +1,52 @@
+# <img src="icon.png" width="32" alt="addon icon"> RichTextLabelEx for Godot Engine 4
+A custom node of RichTextLabel for external images in BBCode tags.
+
+*This addon was made based on
+[godot_richtext_with_dynamic_images](https://github.com/fahrstuhl/godot_richtext_with_dynamic_images).
+Thank you fahrstuhl!*
+
+![screenshot](screenshots/screenshot.png)
+
+## How to install (plugin version)
+
+### (1) Download ZIP file
+\[ Code \](green button) &gt; Download ZIP  
+*(If you want all files, please use git clone)*
+
+### (2) Copy files
+Copy from (unzipped file)/addons/rich_text_label_ex/*  
+to (your project)/addons/rich_text_label_ex/*
+
+### (3) Activate plugin
+Project &gt; Project Settings &gt; Plugins &gt; RichTextLabelEx &gt; Enable
+
+## How to install (not plugin version)
+
+### (1) Download ZIP file
+same as above
+
+### (2) Copy files
+Copy from (unzipped file)/addons/rich_text_label_ex/  
+rich_text_label_ex.gd  
+RichTextLabelEx.svg  
+to (your project)/(anywhere but addons)/
+
+## How to use
+Add/Create a New Node &gt; RichTextLabelEx  
+You can use external images in BBCode tags!
+
+```
+[img]user://user_path.png[/img]
+[img]E:/absolute_path.png[/img]
+[img]relative_path.png[/img]
+```
+
+## Limitations
+If you turn on bbcode_enabled in editor, turn on bbcode_enabled_deferred instead.  
+But you don't need to use bbcode_enabled_deferred in your script.
+
+### Settings for running and exporting
+![settings_for_running](screenshots/settings_for_running.png)
+
+### Settings for real-time editing on the editor
+![settings_for_editing](screenshots/settings_for_editing.png)
diff --git a/addons/rich_text_label_ex/RichTextLabelEx.svg b/addons/rich_text_label_ex/RichTextLabelEx.svg
new file mode 100644 (file)
index 0000000..5421018
--- /dev/null
@@ -0,0 +1 @@
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#8eef97"><path d="m14 1h2l-5 14h-2z"/><path d="m10 1h1l5 14h-2l-5-14"/><path d="m1 13h7v2h-7z"/><path d="m1 1h7v2h-7z"/><path d="m1 7h5v2h-5z"/><path d="m1 4h3v2h-3z"/><path d="m1 10h3v2h-3z"/></g></svg>
\ No newline at end of file
diff --git a/addons/rich_text_label_ex/RichTextLabelEx.svg.import b/addons/rich_text_label_ex/RichTextLabelEx.svg.import
new file mode 100644 (file)
index 0000000..3b096d9
--- /dev/null
@@ -0,0 +1,37 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://wks6o5upfqps"
+path="res://.godot/imported/RichTextLabelEx.svg-787bfde0f54d24f5a2e5bc3d8fbb4e38.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/rich_text_label_ex/RichTextLabelEx.svg"
+dest_files=["res://.godot/imported/RichTextLabelEx.svg-787bfde0f54d24f5a2e5bc3d8fbb4e38.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/addons/rich_text_label_ex/plugin.cfg b/addons/rich_text_label_ex/plugin.cfg
new file mode 100644 (file)
index 0000000..adb112b
--- /dev/null
@@ -0,0 +1,7 @@
+[plugin]
+
+name="RichTextLabelEx"
+description="A custom node of RichTextLabel for external images in BBCode tags."
+author="nekofleet"
+version="1.0.0"
+script="plugin.gd"
diff --git a/addons/rich_text_label_ex/plugin.gd b/addons/rich_text_label_ex/plugin.gd
new file mode 100644 (file)
index 0000000..cd20a4e
--- /dev/null
@@ -0,0 +1,14 @@
+@tool
+extends EditorPlugin
+
+
+func _enter_tree():
+       add_custom_type(
+               "RichTextLabelEx",
+               "RichTextLabel",
+               preload("rich_text_label_ex.gd"),
+               preload("RichTextLabelEx.svg"))
+
+
+func _exit_tree():
+       remove_custom_type("RichTextLabelEx")
diff --git a/addons/rich_text_label_ex/rich_text_label_ex.gd b/addons/rich_text_label_ex/rich_text_label_ex.gd
new file mode 100644 (file)
index 0000000..8971abc
--- /dev/null
@@ -0,0 +1,93 @@
+@tool
+@icon("RichTextLabelEx.svg")
+class_name RichTextLabelEx
+extends RichTextLabel
+## A custom node of [RichTextLabel] for external images in BBCode tags.
+##
+## [codeblock]
+## [img]user://user_path.png[/img]
+## [img]E:/absolute_path.png[/img]
+## [img]relative_path.png[/img]
+## [/codeblock][br]
+## [b]Note:[/b] See also [member bbcode_enabled_deferred].
+##
+## @tutorial: https://github.com/nekofleet/rich-text-label-ex
+
+
+## If you turn on [member RichTextLabel.bbcode_enabled] in editor,
+## turn on [member bbcode_enabled_deferred] instead.[br]
+## [b]Note:[/b] But you don't need to use [member bbcode_enabled_deferred] in your script.
+@export var bbcode_enabled_deferred := false
+
+var _texture_caches := {} # {"path": Texture2D}
+
+
+func _set(property: StringName, value: Variant) -> bool:
+       match property:
+               "text":
+                       _set_texture_caches(value)
+       return false
+
+
+func _ready() -> void:
+       _set_texture_caches(text)
+
+       if not Engine.is_editor_hint():
+               if bbcode_enabled_deferred:
+                       bbcode_enabled = true
+                       bbcode_enabled_deferred = false
+
+
+## Creates a new texture from the path of imported image or external image.
+## [codeblock]
+## # load() - imported image only
+## $Sprite2D.texture = load("res://imported_image.png")
+## $Sprite2D.texture = load("external_image.png") # error
+##
+## # this method
+## $Sprite2D.texture = RichTextLabelEx.load_texture_from_file("res://imported_image.png")
+## $Sprite2D.texture = RichTextLabelEx.load_texture_from_file("external_image.png")
+##
+## # load() after this method
+## var texture = RichTextLabelEx.load_texture_from_file("external_image.png")
+## $Sprite2D.texture = load("external_image.png")
+## [/codeblock]
+static func load_texture_from_file(path: String) -> Texture2D:
+       if path.begins_with("res://"):
+               return load(path)
+
+       var image = Image.load_from_file(path)
+       if image != null:
+               var texture = ImageTexture.create_from_image(image)
+               if texture != null:
+                       if path.is_relative_path():
+                               path = "res://" + path
+                       texture.take_over_path(path)
+                       return texture
+
+       return null
+
+
+func _set_texture_caches(new_text: String) -> void:
+       # Get image paths from new_text.
+       var new_paths = []
+
+       var re = RegEx.new()
+       re.compile("\\[img.*\\](?P<path>.*)\\[\\/img\\]")
+
+       var re_matches = re.search_all(new_text)
+       for re_match in re_matches:
+               var path = re_match.get_string("path")
+               if not path.begins_with("res://"):
+                       new_paths.append(path)
+
+       # Remove unused caches.
+       var old_paths = _texture_caches.keys()
+       for old_path in old_paths:
+               if old_path not in new_paths:
+                       _texture_caches.erase(old_path)
+
+       # Add new caches.
+       for new_path in new_paths:
+               if new_path not in old_paths:
+                       _texture_caches[new_path] = RichTextLabelEx.load_texture_from_file(new_path)
diff --git a/addons/scene_manager/Dissolve2d.gdshader b/addons/scene_manager/Dissolve2d.gdshader
new file mode 100644 (file)
index 0000000..1076041
--- /dev/null
@@ -0,0 +1,19 @@
+shader_type canvas_item;
+
+uniform sampler2D dissolve_texture;
+uniform float dissolve_amount : hint_range(0.0, 1.0) = 0.5;
+uniform vec4 fade_color : source_color = vec4(1.0, 1.0, 1.0, 1.0);
+uniform bool fade = false;
+uniform bool inverted = false;
+
+void fragment() {
+       if (dissolve_amount < 0.0001 || dissolve_amount > 0.9999 || fade) {
+               COLOR = vec4(fade_color.rgb, dissolve_amount);
+       } else {
+               float sample = texture(dissolve_texture, UV).r;
+               if (inverted) {
+                       sample = 1.0 - sample;
+               }
+               COLOR = vec4(fade_color.rgb, step(sample, dissolve_amount));
+       }
+}
diff --git a/addons/scene_manager/NodeFlagsInspectorPlugin.gd b/addons/scene_manager/NodeFlagsInspectorPlugin.gd
new file mode 100644 (file)
index 0000000..b848eb2
--- /dev/null
@@ -0,0 +1,13 @@
+extends EditorInspectorPlugin
+
+var SingletonCheckProperty = load('res://addons/scene_manager/SingletonCheckProperty.gd')
+var SingletonNameProperty = load('res://addons/scene_manager/SingletonNameProperty.gd')
+
+
+func _can_handle(object: Variant):
+       return object is Node
+
+
+func _parse_begin(object: Object):
+       add_property_editor("singleton_check", SingletonCheckProperty.new())
+       add_property_editor("singleton_name", SingletonNameProperty.new())
diff --git a/addons/scene_manager/SceneManager.gd b/addons/scene_manager/SceneManager.gd
new file mode 100644 (file)
index 0000000..df09009
--- /dev/null
@@ -0,0 +1,172 @@
+extends Node2D
+
+signal fade_complete
+signal scene_unloaded
+signal scene_loaded
+signal transition_finished
+
+var is_transitioning := false
+@onready var _tree := get_tree()
+@onready var _root := _tree.get_root()
+@onready var _current_scene := _tree.current_scene
+@onready var _animation_player : AnimationPlayer = $AnimationPlayer
+@onready var _shader_blend_rect : ColorRect = $CanvasLayer/ColorRect
+
+var default_options := {
+       "speed": 2,
+       "color": Color("#000000"),
+       "pattern": "fade",
+       "wait_time": 0.5,
+       "invert": false,
+       "invert_on_leave": true,
+       "ease": 1.0,
+       "skip_scene_change": false,
+       "skip_fade_out": false,
+       "skip_fade_in": false,
+       "on_tree_enter": func(scene): null,
+       "on_ready": func(scene): null,
+       "on_fade_out": func(): null,
+       "on_fade_in": func(): null,
+}
+# extra_options = {
+#   "pattern_enter": DEFAULT_IMAGE,
+#   "pattern_leave": DEFAULT_IMAGE,
+#   "ease_enter": 1.0,
+#   "ease_leave": 1.0,
+# }
+
+var singleton_entities := {}
+var _previous_scene = null
+
+func _ready() -> void:
+       _set_singleton_entities()
+       scene_loaded.emit()
+
+func _set_singleton_entities() -> void:
+       singleton_entities = {}
+       var entities = _current_scene.get_tree().get_nodes_in_group(
+               SceneManagerConstants.SINGLETON_GROUP_NAME
+       )
+       for entity in entities:
+               var has_entity_name : bool = entity.has_meta(SceneManagerConstants.SINGLETON_META_NAME)
+               assert(has_entity_name,"The node was set as a singleton entity, but no entity name was provided.")
+               var entity_name = entity.get_meta(SceneManagerConstants.SINGLETON_META_NAME)
+               assert(not singleton_entities.has(entity_name),"The entity name %s is already being used more than once! Please check that your entity name is unique within the scene.")
+               singleton_entities[entity_name] = entity
+
+func get_entity(entity_name: String) -> Node:
+       assert(singleton_entities.has(entity_name),"Entity is not set as a singleton entity. Please define it in the editor.")
+       return singleton_entities[entity_name]
+
+func _load_pattern(pattern) -> Texture:
+       assert(pattern is Texture or pattern is String, "Pattern is not a valid Texture, absolute path, or built-in texture.")
+       if pattern is String:
+               if pattern.is_absolute_path():
+                       return load(pattern)
+               elif pattern == 'fade':
+                       return null
+               return load("res://addons/scene_manager/shader_patterns/%s.png" % pattern)
+       return pattern
+
+func _get_final_options(initial_options: Dictionary) -> Dictionary:
+       var options = initial_options.duplicate()
+
+       for key in default_options.keys():
+               if not options.has(key):
+                       options[key] = default_options[key]
+
+       for pattern_key in ["pattern_enter", "pattern_leave"]:
+               options[pattern_key] = (
+                       _load_pattern(options[pattern_key])
+                       if pattern_key in options
+                       else _load_pattern(options["pattern"])
+               )
+
+       for ease_key in ["ease_enter", "ease_leave"]:
+               if not ease_key in options:
+                       options[ease_key] = options["ease"]
+
+       return options
+
+func _process(_delta: float) -> void:
+       if not is_instance_valid(_previous_scene) and _tree.current_scene:
+               _previous_scene = _tree.current_scene
+               _current_scene = _tree.current_scene
+               _set_singleton_entities()
+               scene_loaded.emit()
+       if _tree.current_scene != _previous_scene:
+               _previous_scene = _tree.current_scene
+
+func change_scene(path: Variant, setted_options: Dictionary = {}) -> void:
+       assert(path == null or path is String, 'Path must be a string')
+       var options = _get_final_options(setted_options)
+       if not options["skip_fade_out"]:
+               await fade_out(setted_options)
+       if not options["skip_scene_change"]:
+               if path == null:
+                       _reload_scene()
+               else:
+                       _replace_scene(path, options)
+       await _tree.create_timer(options["wait_time"]).timeout
+       if not options["skip_fade_in"]:
+               await fade_in(setted_options)
+
+func reload_scene(setted_options: Dictionary = {}) -> void:
+       await change_scene(null, setted_options)
+
+func _reload_scene() -> void:
+       _tree.reload_current_scene()
+       await _tree.create_timer(0.0).timeout
+       _current_scene = _tree.current_scene
+
+func fade_in_place(setted_options: Dictionary = {}) -> void:
+       setted_options["no_scene_change"] = true
+       await change_scene(null, setted_options)
+
+func _replace_scene(path: String, options: Dictionary) -> void:
+       _current_scene.queue_free()
+       scene_unloaded.emit()
+       var following_scene: PackedScene = ResourceLoader.load(path, "PackedScene", 0)
+       _current_scene = following_scene.instantiate()
+       _current_scene.tree_entered.connect(options["on_tree_enter"].bind(_current_scene))
+       _current_scene.ready.connect(options["on_ready"].bind(_current_scene))
+       await _tree.create_timer(0.0).timeout
+       _root.add_child(_current_scene)
+       _tree.set_current_scene(_current_scene)
+
+func fade_out(setted_options: Dictionary= {}) -> void:
+       var options = _get_final_options(setted_options)
+       is_transitioning = true
+       _animation_player.speed_scale = options["speed"]
+
+       _shader_blend_rect.material.set_shader_parameter(
+               "dissolve_texture", options["pattern_enter"]
+       )
+       _shader_blend_rect.material.set_shader_parameter("fade", !options["pattern_enter"])
+       _shader_blend_rect.material.set_shader_parameter("fade_color", options["color"])
+       _shader_blend_rect.material.set_shader_parameter("inverted", false)
+       var animation = _animation_player.get_animation("ShaderFade")
+       animation.track_set_key_transition(0, 0, options["ease_enter"])
+       _animation_player.play("ShaderFade")
+
+       await _animation_player.animation_finished
+       fade_complete.emit()
+       options["on_fade_out"].call()
+
+func fade_in(setted_options: Dictionary = {}) -> void:
+       var options = _get_final_options(setted_options)
+       _animation_player.speed_scale = options["speed"]
+       _shader_blend_rect.material.set_shader_parameter(
+               "dissolve_texture", options["pattern_leave"]
+       )
+       _shader_blend_rect.material.set_shader_parameter("fade", !options["pattern_leave"])
+       _shader_blend_rect.material.set_shader_parameter("fade_color", options["color"])
+       _shader_blend_rect.material.set_shader_parameter("inverted", options["invert_on_leave"])
+       var animation = _animation_player.get_animation("ShaderFade")
+       animation.track_set_key_transition(0, 0, options["ease_leave"])
+       _animation_player.play_backwards("ShaderFade")
+
+       await _animation_player.animation_finished
+       is_transitioning = false
+       transition_finished.emit()
+       options["on_fade_in"].call()
diff --git a/addons/scene_manager/SceneManager.tscn b/addons/scene_manager/SceneManager.tscn
new file mode 100644 (file)
index 0000000..9a96c7b
--- /dev/null
@@ -0,0 +1,27 @@
+[gd_scene load_steps=5 format=3 uid="uid://j20v4cg7v8m1"]
+
+[ext_resource type="Script" path="res://addons/scene_manager/SceneManager.gd" id="1_22br8"]
+[ext_resource type="Shader" path="res://addons/scene_manager/Dissolve2d.gdshader" id="2_853wq"]
+[ext_resource type="Animation" uid="uid://dxr1r78uxitcq" path="res://addons/scene_manager/ShaderFade.tres" id="5_anecj"]
+
+[sub_resource type="ShaderMaterial" id="ShaderMaterial_0imdi"]
+shader = ExtResource( "2_853wq" )
+shader_parameter/dissolve_amount = 0.0
+shader_parameter/fade_color = Color(0, 0, 0, 1)
+shader_parameter/fade = null
+shader_parameter/inverted = null
+
+[node name="SceneManager" type="Node2D"]
+script = ExtResource( "1_22br8" )
+
+[node name="CanvasLayer" type="CanvasLayer" parent="."]
+layer = 3
+
+[node name="ColorRect" type="ColorRect" parent="CanvasLayer"]
+material = SubResource( "ShaderMaterial_0imdi" )
+anchor_right = 1.0
+anchor_bottom = 1.0
+mouse_filter = 2
+
+[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
+anims/ShaderFade = ExtResource( "5_anecj" )
diff --git a/addons/scene_manager/SceneManagerConstants.gd b/addons/scene_manager/SceneManagerConstants.gd
new file mode 100644 (file)
index 0000000..1e11a57
--- /dev/null
@@ -0,0 +1,4 @@
+class_name SceneManagerConstants extends Object
+
+const SINGLETON_GROUP_NAME = "scene_manager_entity_nodes"
+const SINGLETON_META_NAME = "entity_name"
diff --git a/addons/scene_manager/SceneManagerPlugin.gd b/addons/scene_manager/SceneManagerPlugin.gd
new file mode 100644 (file)
index 0000000..9c616e5
--- /dev/null
@@ -0,0 +1,13 @@
+@tool
+extends EditorPlugin
+var _inspector_plugin
+
+func _enter_tree():
+       add_autoload_singleton("SceneManager", "res://addons/scene_manager/SceneManager.tscn")
+       _inspector_plugin = load("res://addons/scene_manager/NodeFlagsInspectorPlugin.gd").new()
+       add_inspector_plugin(_inspector_plugin)
+
+
+func _exit_tree():
+       remove_autoload_singleton("SceneManager")
+       remove_inspector_plugin(_inspector_plugin)
diff --git a/addons/scene_manager/ShaderFade.tres b/addons/scene_manager/ShaderFade.tres
new file mode 100644 (file)
index 0000000..abe3db4
--- /dev/null
@@ -0,0 +1,16 @@
+[gd_resource type="Animation" format=3 uid="uid://dxr1r78uxitcq"]
+
+[resource]
+resource_name = "ShaderFade"
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath("CanvasLayer/ColorRect:material:shader_parameter/dissolve_amount")
+tracks/0/interp = 2
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0, 1),
+"transitions": PackedFloat32Array(1, 1),
+"update": 0,
+"values": [0.0, 1.0]
+}
diff --git a/addons/scene_manager/SingletonCheckProperty.gd b/addons/scene_manager/SingletonCheckProperty.gd
new file mode 100644 (file)
index 0000000..1960485
--- /dev/null
@@ -0,0 +1,32 @@
+extends EditorProperty
+
+var checkbox := CheckBox.new()
+var edited_control = null
+var group_name = SceneManagerConstants.SINGLETON_GROUP_NAME
+
+func _ready():
+       edited_control = get_edited_object()
+
+       label = "Singleton entity"
+
+       checkbox.connect("toggled", Callable(self, "_on_checkbox_checked"))
+       add_child(checkbox)
+
+
+func _physics_process(_delta):
+       if not edited_control and get_edited_object():
+               edited_control = get_edited_object()
+               checkbox.set_pressed_no_signal(edited_control.is_in_group(group_name))
+       checkbox.text = "Yes" if checkbox.pressed else "No"
+
+
+func _on_checkbox_checked(is_checked):
+       var new_groups = edited_control.get_groups()
+       if is_checked:
+               new_groups.append(group_name)
+               edited_control.add_to_group(group_name, true)
+       else:
+               var index = new_groups.find(group_name)
+               new_groups.remove(index)
+               edited_control.remove_from_group(group_name)
+       emit_changed('groups', new_groups)
diff --git a/addons/scene_manager/SingletonNameProperty.gd b/addons/scene_manager/SingletonNameProperty.gd
new file mode 100644 (file)
index 0000000..63ede31
--- /dev/null
@@ -0,0 +1,34 @@
+extends EditorProperty
+
+var line_edit = LineEdit.new()
+var edited_control = null
+var meta_name = SceneManagerConstants.SINGLETON_META_NAME
+var group_name = SceneManagerConstants.SINGLETON_GROUP_NAME
+
+func _ready():
+       label = "Entity name"
+
+       line_edit.connect("text_changed", Callable(self, "_on_text_changed"))
+       add_child(line_edit)
+
+
+func _physics_process(_delta):
+       if not edited_control and get_edited_object():
+               edited_control = get_edited_object()
+               if edited_control.has_meta(meta_name):
+                       line_edit.text = edited_control.get_meta(meta_name)
+       if edited_control:
+               pass
+#              XXX
+#              draw_red = (
+#                      not edited_control.has_meta(meta_name)
+#                      and edited_control.is_in_group(group_name)
+#              )
+
+
+func _on_text_changed(new_text: String):
+       if new_text == "":
+               edited_control.set_meta(meta_name, null)
+       else:
+               edited_control.set_meta(meta_name, new_text)
+       emit_changed("meta", new_text, meta_name)
diff --git a/addons/scene_manager/icon.png b/addons/scene_manager/icon.png
new file mode 100644 (file)
index 0000000..41fb36c
Binary files /dev/null and b/addons/scene_manager/icon.png differ
diff --git a/addons/scene_manager/icon.png.import b/addons/scene_manager/icon.png.import
new file mode 100644 (file)
index 0000000..b3772de
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://b7x3qxooitt0l"
+path="res://.godot/imported/icon.png-1ae74eb651b355b4baf5d77f5493a2f8.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/scene_manager/icon.png"
+dest_files=["res://.godot/imported/icon.png-1ae74eb651b355b4baf5d77f5493a2f8.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
diff --git a/addons/scene_manager/plugin.cfg b/addons/scene_manager/plugin.cfg
new file mode 100644 (file)
index 0000000..28388cc
--- /dev/null
@@ -0,0 +1,7 @@
+[plugin]
+
+name="Scene Manager"
+description="Scene Manager"
+author="GlassBrick"
+version="1.0.1"
+script="SceneManagerPlugin.gd"
diff --git a/addons/scene_manager/shader_patterns/circle.png b/addons/scene_manager/shader_patterns/circle.png
new file mode 100644 (file)
index 0000000..7e3eb48
Binary files /dev/null and b/addons/scene_manager/shader_patterns/circle.png differ
diff --git a/addons/scene_manager/shader_patterns/circle.png.import b/addons/scene_manager/shader_patterns/circle.png.import
new file mode 100644 (file)
index 0000000..c30fa93
--- /dev/null
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bpskbib6w4gdp"
+path.s3tc="res://.godot/imported/circle.png-49deb66a2171d4476d4de5b40b7c62d8.s3tc.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://addons/scene_manager/shader_patterns/circle.png"
+dest_files=["res://.godot/imported/circle.png-49deb66a2171d4476d4de5b40b7c62d8.s3tc.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+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=0
diff --git a/addons/scene_manager/shader_patterns/curtains.png b/addons/scene_manager/shader_patterns/curtains.png
new file mode 100644 (file)
index 0000000..c9f096e
Binary files /dev/null and b/addons/scene_manager/shader_patterns/curtains.png differ
diff --git a/addons/scene_manager/shader_patterns/curtains.png.import b/addons/scene_manager/shader_patterns/curtains.png.import
new file mode 100644 (file)
index 0000000..ec5e7e4
--- /dev/null
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://nglientb4rxo"
+path.s3tc="res://.godot/imported/curtains.png-f5a25cbc897d336641cfbab203b5832e.s3tc.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://addons/scene_manager/shader_patterns/curtains.png"
+dest_files=["res://.godot/imported/curtains.png-f5a25cbc897d336641cfbab203b5832e.s3tc.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+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=0
diff --git a/addons/scene_manager/shader_patterns/diagonal.png b/addons/scene_manager/shader_patterns/diagonal.png
new file mode 100644 (file)
index 0000000..30ce2f9
Binary files /dev/null and b/addons/scene_manager/shader_patterns/diagonal.png differ
diff --git a/addons/scene_manager/shader_patterns/diagonal.png.import b/addons/scene_manager/shader_patterns/diagonal.png.import
new file mode 100644 (file)
index 0000000..fee571c
--- /dev/null
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cgmfhc32g6va6"
+path.s3tc="res://.godot/imported/diagonal.png-fda70de082e7ad6bc449e3580ab09c7f.s3tc.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://addons/scene_manager/shader_patterns/diagonal.png"
+dest_files=["res://.godot/imported/diagonal.png-fda70de082e7ad6bc449e3580ab09c7f.s3tc.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+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=0
diff --git a/addons/scene_manager/shader_patterns/horizontal.png b/addons/scene_manager/shader_patterns/horizontal.png
new file mode 100644 (file)
index 0000000..6dc32d5
Binary files /dev/null and b/addons/scene_manager/shader_patterns/horizontal.png differ
diff --git a/addons/scene_manager/shader_patterns/horizontal.png.import b/addons/scene_manager/shader_patterns/horizontal.png.import
new file mode 100644 (file)
index 0000000..a688c8d
--- /dev/null
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://7ypismovx1sv"
+path.s3tc="res://.godot/imported/horizontal.png-350a31fe557936e31f870194c26cef69.s3tc.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://addons/scene_manager/shader_patterns/horizontal.png"
+dest_files=["res://.godot/imported/horizontal.png-350a31fe557936e31f870194c26cef69.s3tc.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+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=0
diff --git a/addons/scene_manager/shader_patterns/radial.png b/addons/scene_manager/shader_patterns/radial.png
new file mode 100644 (file)
index 0000000..926330b
Binary files /dev/null and b/addons/scene_manager/shader_patterns/radial.png differ
diff --git a/addons/scene_manager/shader_patterns/radial.png.import b/addons/scene_manager/shader_patterns/radial.png.import
new file mode 100644 (file)
index 0000000..4e240ba
--- /dev/null
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dpipc6av3p107"
+path.s3tc="res://.godot/imported/radial.png-45b81257cf212bc197b861ea33052002.s3tc.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://addons/scene_manager/shader_patterns/radial.png"
+dest_files=["res://.godot/imported/radial.png-45b81257cf212bc197b861ea33052002.s3tc.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+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=0
diff --git a/addons/scene_manager/shader_patterns/scribbles.png b/addons/scene_manager/shader_patterns/scribbles.png
new file mode 100644 (file)
index 0000000..428b956
Binary files /dev/null and b/addons/scene_manager/shader_patterns/scribbles.png differ
diff --git a/addons/scene_manager/shader_patterns/scribbles.png.import b/addons/scene_manager/shader_patterns/scribbles.png.import
new file mode 100644 (file)
index 0000000..4b84f71
--- /dev/null
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bgcid7fyjtd30"
+path.s3tc="res://.godot/imported/scribbles.png-430a0f7331a442eb053961f8e9bb82f0.s3tc.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://addons/scene_manager/shader_patterns/scribbles.png"
+dest_files=["res://.godot/imported/scribbles.png-430a0f7331a442eb053961f8e9bb82f0.s3tc.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+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=0
diff --git a/addons/scene_manager/shader_patterns/squares.png b/addons/scene_manager/shader_patterns/squares.png
new file mode 100644 (file)
index 0000000..d471ef7
Binary files /dev/null and b/addons/scene_manager/shader_patterns/squares.png differ
diff --git a/addons/scene_manager/shader_patterns/squares.png.import b/addons/scene_manager/shader_patterns/squares.png.import
new file mode 100644 (file)
index 0000000..4f97374
--- /dev/null
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://b45fitoojqhxe"
+path.s3tc="res://.godot/imported/squares.png-a8c8144d665aa3e0d712474304ad6e6f.s3tc.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://addons/scene_manager/shader_patterns/squares.png"
+dest_files=["res://.godot/imported/squares.png-a8c8144d665aa3e0d712474304ad6e6f.s3tc.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+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=0
diff --git a/addons/scene_manager/shader_patterns/vertical.png b/addons/scene_manager/shader_patterns/vertical.png
new file mode 100644 (file)
index 0000000..394ca1e
Binary files /dev/null and b/addons/scene_manager/shader_patterns/vertical.png differ
diff --git a/addons/scene_manager/shader_patterns/vertical.png.import b/addons/scene_manager/shader_patterns/vertical.png.import
new file mode 100644 (file)
index 0000000..3ec5293
--- /dev/null
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cwci7g18k0mgh"
+path.s3tc="res://.godot/imported/vertical.png-5d237b9ea3cdd66e653ef032da0bd507.s3tc.ctex"
+metadata={
+"imported_formats": ["s3tc_bptc"],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://addons/scene_manager/shader_patterns/vertical.png"
+dest_files=["res://.godot/imported/vertical.png-5d237b9ea3cdd66e653ef032da0bd507.s3tc.ctex"]
+
+[params]
+
+compress/mode=2
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=true
+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=0
diff --git a/addons/script-ide/LICENSE b/addons/script-ide/LICENSE
new file mode 100644 (file)
index 0000000..ffc9cf2
--- /dev/null
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Marius Hanl
+
+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.
diff --git a/addons/script-ide/Popup.gd b/addons/script-ide/Popup.gd
new file mode 100644 (file)
index 0000000..400a3f3
--- /dev/null
@@ -0,0 +1,6 @@
+extends PopupPanel
+
+var input_listener: Callable
+
+func _input(event: InputEvent) -> void:
+       input_listener.call(event)
diff --git a/addons/script-ide/README.md b/addons/script-ide/README.md
new file mode 100644 (file)
index 0000000..8c434a0
--- /dev/null
@@ -0,0 +1,34 @@
+# Script IDE
+
+Transforms the Script UI into an IDE like UI. Tabs are used for navigating between scripts. The default Outline got an overhaul and now shows all members of the script (not just methods) with unique icons for faster navigation.
+
+Features:
+- Scripts are now shown as Tabs inside a TabContainer (No Script List by default, but can be toggled on again)
+- The Outline is on the right side (can be changed to be on the left side again)
+- The Outline got an overhaul and shows more than just the methods of the script. It includes the following members with a unique icon:
+       - Classes (Red Square)
+       - Constants (Red Circle)
+       - Signals (Yellow)
+       - Export variables (Orange)
+       - (Static) Variables (Red)
+       - Engine callback functions (Blue)
+       - (Static) Functions (Green)
+- All the different members of the script can be hidden or made visible again. This allows fine control what should be visible (e.g. only signals, functions, ...)
+- There is also the possibility to hide private members, this is all members starting with a '_'
+- The Outline can be opened as Popup with a defined shortcut (more below). This allows to quickly search for a specific member and scroll to it
+- You can navigate through the Outline with the arrow keys and scroll to the selected item by pressing `ENTER`
+- The Outline (and Script List) can be toggled via `File -> Toggle Scripts Panel`. This will hide or show it
+- The plugin is written with performance in mind, everything is very fast and works without any lags or stuttering.
+
+All settings can be changed in the `Editor Settings` under `Plugin` -> `Script Ide`:
+- `Open Outline Popup` = Shortcut to control how the Outline Popup should be triggered (default=CTRL+O or META+O)
+- `Outline Position Right` = Flag to control whether the outline should be on the right or on the left side of the script editor (default=true)
+- `Hide Private Members` = Flag to control whether private members (methods/variables/constants starting with '_') should be hidden in the Outline or not (default=false)
+- `Script List Visible` = Flag to control whether the script list should still be visible or not (above the outline)
+- All outline visibility settings
+
+![Example of the outline](https://github.com/godotengine/godot/assets/66004280/30d04924-ba53-415d-b796-92b2fc086ff9)
+
+![Example of the outline popup](https://github.com/godotengine/godot/assets/66004280/cad0e00e-dbb6-4d3d-980b-c36da6af2cb8)
+
+![Example of the editor settings](https://github.com/godotengine/godot/assets/66004280/9cec7454-1a38-428b-97cc-886d0ce415bb)
diff --git a/addons/script-ide/icon/class.svg b/addons/script-ide/icon/class.svg
new file mode 100644 (file)
index 0000000..51cd478
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="1" width="14" height="14" fill="#ff4949" stroke-width="2.6941"/></svg>
diff --git a/addons/script-ide/icon/class.svg.import b/addons/script-ide/icon/class.svg.import
new file mode 100644 (file)
index 0000000..811536d
--- /dev/null
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://csik7oxvt7tq3"
+path="res://.godot/imported/class.svg-e6f2816a1f06041fb421c2af52817a4a.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/script-ide/icon/class.svg"
+dest_files=["res://.godot/imported/class.svg-e6f2816a1f06041fb421c2af52817a4a.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=0.8
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/script-ide/icon/constant.svg b/addons/script-ide/icon/constant.svg
new file mode 100644 (file)
index 0000000..b81f2c0
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7s7-3.134 7-7c0-3.866-3.134-7-7-7zm0 2c2.7614 0 5 2.2386 5 5 0 2.7614-2.2386 5-5 5-2.7614 0-5-2.2386-5-5 0-2.7614 2.2386-5 5-5z" fill="#ff4949"/></svg>
diff --git a/addons/script-ide/icon/constant.svg.import b/addons/script-ide/icon/constant.svg.import
new file mode 100644 (file)
index 0000000..60a64e5
--- /dev/null
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cawc456ja8vf5"
+path="res://.godot/imported/constant.svg-f6e857276565573c7540f3c32801842a.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/script-ide/icon/constant.svg"
+dest_files=["res://.godot/imported/constant.svg-f6e857276565573c7540f3c32801842a.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=0.8
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/script-ide/icon/export.svg b/addons/script-ide/icon/export.svg
new file mode 100644 (file)
index 0000000..866bd5d
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7z" fill="#c67e43"/></svg>
diff --git a/addons/script-ide/icon/export.svg.import b/addons/script-ide/icon/export.svg.import
new file mode 100644 (file)
index 0000000..b0036dc
--- /dev/null
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bvu2gnj8fv2kw"
+path="res://.godot/imported/export.svg-d2d18132258a7a219ec1af1f0316c91c.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/script-ide/icon/export.svg"
+dest_files=["res://.godot/imported/export.svg-d2d18132258a7a219ec1af1f0316c91c.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=0.8
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/script-ide/icon/func.svg b/addons/script-ide/icon/func.svg
new file mode 100644 (file)
index 0000000..85161ba
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7z" fill="#8fcc77"/></svg>
diff --git a/addons/script-ide/icon/func.svg.import b/addons/script-ide/icon/func.svg.import
new file mode 100644 (file)
index 0000000..233870a
--- /dev/null
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://rni04cl446ov"
+path="res://.godot/imported/func.svg-139842caa5b4b7e4839711b6c756d0f7.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/script-ide/icon/func.svg"
+dest_files=["res://.godot/imported/func.svg-139842caa5b4b7e4839711b6c756d0f7.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=0.8
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/script-ide/icon/func_get.svg b/addons/script-ide/icon/func_get.svg
new file mode 100644 (file)
index 0000000..e5ac92a
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m8 15c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm0.5-2a1 1 0 0 1-0.70703-0.29297l-4-4a1 1 0 0 1-0.25977-0.62695 1.0001 1.0001 0 0 1 0-0.16016 1 1 0 0 1 0.25977-0.62695l4-4a1 1 0 0 1 1.4141 0 1 1 0 0 1 0 1.4141l-2.293 2.293h4.5859a1 1 0 0 1 1 1 1 1 0 0 1-1 1h-4.5859l2.293 2.293a1 1 0 0 1 0 1.4141 1 1 0 0 1-0.70703 0.29297z" fill="#8fc77a"/></svg>
diff --git a/addons/script-ide/icon/func_get.svg.import b/addons/script-ide/icon/func_get.svg.import
new file mode 100644 (file)
index 0000000..59de1a0
--- /dev/null
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://c2a3aowyhxj5x"
+path="res://.godot/imported/func_get.svg-093f0ce02889d1f102ff9cc3e7f72654.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/script-ide/icon/func_get.svg"
+dest_files=["res://.godot/imported/func_get.svg-093f0ce02889d1f102ff9cc3e7f72654.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=0.8
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/script-ide/icon/func_set.svg b/addons/script-ide/icon/func_set.svg
new file mode 100644 (file)
index 0000000..9ed3107
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7s7-3.134 7-7c0-3.866-3.134-7-7-7zm-0.5 2a1 1 0 0 1 0.70703 0.29297l4 4a1 1 0 0 1 0.25977 0.62695 1.0001 1.0001 0 0 1 0 0.16016 1 1 0 0 1-0.25977 0.62695l-4 4a1 1 0 0 1-1.4141 0 1 1 0 0 1 0-1.4141l2.293-2.293h-4.5859a1 1 0 0 1-1-1 1 1 0 0 1 1-1h4.5859l-2.293-2.293a1 1 0 0 1 0-1.4141 1 1 0 0 1 0.70703-0.29297z" fill="#8fc77a"/></svg>
diff --git a/addons/script-ide/icon/func_set.svg.import b/addons/script-ide/icon/func_set.svg.import
new file mode 100644 (file)
index 0000000..cedc130
--- /dev/null
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bvjkrti6kj6o2"
+path="res://.godot/imported/func_set.svg-c31168d90866ff1707ad9834754bd2c9.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/script-ide/icon/func_set.svg"
+dest_files=["res://.godot/imported/func_set.svg-c31168d90866ff1707ad9834754bd2c9.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=0.8
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/script-ide/icon/keyword.svg b/addons/script-ide/icon/keyword.svg
new file mode 100644 (file)
index 0000000..2082823
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7z" fill="#0094ff"/></svg>
diff --git a/addons/script-ide/icon/keyword.svg.import b/addons/script-ide/icon/keyword.svg.import
new file mode 100644 (file)
index 0000000..673e34a
--- /dev/null
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cupb0polhqrwj"
+path="res://.godot/imported/keyword.svg-15ea12cc9eda85ed385533fe57e3bba8.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/script-ide/icon/keyword.svg"
+dest_files=["res://.godot/imported/keyword.svg-15ea12cc9eda85ed385533fe57e3bba8.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=0.8
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/script-ide/icon/property.svg b/addons/script-ide/icon/property.svg
new file mode 100644 (file)
index 0000000..dc32112
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7z" fill="#ff4949"/></svg>
diff --git a/addons/script-ide/icon/property.svg.import b/addons/script-ide/icon/property.svg.import
new file mode 100644 (file)
index 0000000..cdf7a95
--- /dev/null
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dbwlgnwv5e8kl"
+path="res://.godot/imported/property.svg-9e228499f30651faad74aa99e4499d7e.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/script-ide/icon/property.svg"
+dest_files=["res://.godot/imported/property.svg-9e228499f30651faad74aa99e4499d7e.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=0.8
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/script-ide/icon/signal.svg b/addons/script-ide/icon/signal.svg
new file mode 100644 (file)
index 0000000..1eb6d9f
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7z" fill="#ffdb3a"/></svg>
diff --git a/addons/script-ide/icon/signal.svg.import b/addons/script-ide/icon/signal.svg.import
new file mode 100644 (file)
index 0000000..16dc07d
--- /dev/null
@@ -0,0 +1,38 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bnccvnaloqnte"
+path="res://.godot/imported/signal.svg-97182e1498b520a1ff5b8b9017c3b480.ctex"
+metadata={
+"has_editor_variant": true,
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/script-ide/icon/signal.svg"
+dest_files=["res://.godot/imported/signal.svg-97182e1498b520a1ff5b8b9017c3b480.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=0.8
+editor/scale_with_editor_scale=true
+editor/convert_colors_with_editor_theme=false
diff --git a/addons/script-ide/plugin.cfg b/addons/script-ide/plugin.cfg
new file mode 100644 (file)
index 0000000..33fcba6
--- /dev/null
@@ -0,0 +1,7 @@
+[plugin]
+
+name="Script-IDE"
+description="Transforms the Script UI into an IDE like UI. Tabs are used for navigating between scripts. The default Outline got an overhaul and now shows all members of the script (not just methods) with unique icons for faster navigation."
+author="Marius Hanl"
+version="1.2.9"
+script="plugin.gd"
diff --git a/addons/script-ide/plugin.gd b/addons/script-ide/plugin.gd
new file mode 100644 (file)
index 0000000..eb8801e
--- /dev/null
@@ -0,0 +1,885 @@
+@tool
+extends EditorPlugin
+
+## Editor setting path
+const SCRIPT_IDE: StringName = &"plugin/script_ide/"
+## Editor setting for the outline position
+const OUTLINE_POSITION_RIGHT: StringName = SCRIPT_IDE + &"outline_position_right"
+## Editor setting to control whether private members (annotated with '_' should be hidden or not)
+const HIDE_PRIVATE_MEMBERS: StringName = SCRIPT_IDE + &"hide_private_members"
+## Editor setting to control whether the script list should be visible or not
+const SCRIPT_LIST_VISIBLE: StringName = SCRIPT_IDE + &"script_list_visible"
+## Editor setting for the 'Open Outline Popup' shortcut
+const OPEN_OUTLINE_POPUP: StringName = SCRIPT_IDE + &"open_outline_popup"
+
+#region Outline icons
+const keyword_icon: Texture2D = preload("res://addons/script-ide/icon/keyword.svg")
+const func_icon: Texture2D = preload("res://addons/script-ide/icon/func.svg")
+const func_get_icon: Texture2D = preload("res://addons/script-ide/icon/func_get.svg")
+const func_set_icon: Texture2D = preload("res://addons/script-ide/icon/func_set.svg")
+const property_icon: Texture2D = preload("res://addons/script-ide/icon/property.svg")
+const export_icon: Texture2D = preload("res://addons/script-ide/icon/export.svg")
+const signal_icon: Texture2D = preload("res://addons/script-ide/icon/signal.svg")
+const constant_icon: Texture2D = preload("res://addons/script-ide/icon/constant.svg")
+const class_icon: Texture2D = preload("res://addons/script-ide/icon/class.svg")
+#endregion
+
+const POPUP_SCRIPT: GDScript = preload("res://addons/script-ide/Popup.gd")
+
+#region Editor settings
+var is_outline_right: bool = true
+var is_script_list_visible: bool = false
+var hide_private_members: bool = false
+var open_outline_popup: Shortcut
+#endregion
+
+var suppress_settings_sync: bool = false
+
+#region Existing controls we modify
+var outline_container: Control
+var outline_parent: Node
+var scripts_tab_container: TabContainer
+var scripts_tab_bar: TabBar
+var scripts_item_list: ItemList
+var split_container: HSplitContainer
+var old_outline: ItemList
+var filter_txt: LineEdit
+var sort_btn: Button
+#endregion
+
+#region Own controls we add
+var outline: ItemList
+var outline_popup: PopupPanel
+var filter_box: HBoxContainer
+
+var class_btn: Button
+var constant_btn: Button
+var signal_btn: Button
+var property_btn: Button
+var export_btn: Button
+var func_btn: Button
+var engine_func_btn: Button
+#endregion
+
+var keywords: Dictionary = {} # Basically used as Set, since Godot has none. [String, int = 0]
+var outline_cache: OutlineCache
+var tab_state: TabStateCache
+
+var old_script_editor_base: ScriptEditorBase
+var old_script_type: StringName
+
+var selected_tab: int = -1
+var last_tab_hovered: int = -1
+var sync_script_list: bool
+
+#region Enter / Exit -> Plugin setup
+## Change the Godot script UI and transform into an IDE like UI
+func _enter_tree() -> void:
+       is_outline_right = get_setting(OUTLINE_POSITION_RIGHT, is_outline_right)
+       hide_private_members = get_setting(HIDE_PRIVATE_MEMBERS, hide_private_members)
+       is_script_list_visible = get_setting(SCRIPT_LIST_VISIBLE, is_script_list_visible)
+
+       var editor_settings: EditorSettings = get_editor_settings()
+       if (!editor_settings.has_setting(OPEN_OUTLINE_POPUP)):
+               var shortcut: Shortcut = Shortcut.new()
+               var event: InputEventKey = InputEventKey.new()
+               event.device = -1
+               event.ctrl_pressed = true
+               event.keycode = KEY_O
+
+               var event2: InputEventKey = InputEventKey.new()
+               event2.device = -1
+               event2.meta_pressed = true
+               event2.keycode = KEY_O
+
+               shortcut.events = [ event, event2 ]
+               editor_settings.set_setting(OPEN_OUTLINE_POPUP, shortcut)
+               editor_settings.set_initial_value(OPEN_OUTLINE_POPUP, shortcut, false)
+
+       open_outline_popup = editor_settings.get_setting(OPEN_OUTLINE_POPUP)
+
+       # Update on filesystem changed (e.g. save operation).
+       var file_system: EditorFileSystem = get_editor_interface().get_resource_filesystem()
+       file_system.filesystem_changed.connect(schedule_update)
+
+       # Make tab container visible
+       var script_editor: ScriptEditor = get_editor_interface().get_script_editor()
+       scripts_tab_container = find_or_null(script_editor.find_children("*", "TabContainer", true, false))
+       if (scripts_tab_container != null):
+               scripts_tab_bar = scripts_tab_container.get_tab_bar()
+
+               tab_state = TabStateCache.new()
+               tab_state.save(scripts_tab_container, scripts_tab_bar)
+
+               scripts_tab_container.tabs_visible = true
+               scripts_tab_container.drag_to_rearrange_enabled = true
+
+               if (scripts_tab_bar != null):
+                       scripts_tab_bar.tab_close_display_policy = TabBar.CLOSE_BUTTON_SHOW_ACTIVE_ONLY
+                       scripts_tab_bar.drag_to_rearrange_enabled = true
+                       scripts_tab_bar.select_with_rmb = true
+                       scripts_tab_bar.tab_close_pressed.connect(on_tab_close)
+                       scripts_tab_bar.tab_rmb_clicked.connect(on_tab_rmb)
+                       scripts_tab_bar.tab_hovered.connect(on_tab_hovered)
+                       scripts_tab_bar.mouse_exited.connect(on_tab_bar_mouse_exited)
+                       scripts_tab_bar.active_tab_rearranged.connect(on_active_tab_rearranged)
+                       scripts_tab_bar.gui_input.connect(on_tab_bar_gui_input)
+
+                       scripts_tab_bar.tab_changed.connect(on_tab_changed)
+
+       # Change script item list visibility
+       scripts_item_list = find_or_null(script_editor.find_children("*", "ItemList", true, false))
+       if (scripts_item_list != null):
+               update_script_list_visibility()
+
+       # Remove existing outline and add own outline
+       split_container = find_or_null(script_editor.find_children("*", "HSplitContainer", true, false))
+       if (split_container != null):
+               outline_container = split_container.get_child(0)
+
+               if (is_outline_right):
+                       update_outline_position()
+
+               old_outline = find_or_null(outline_container.find_children("*", "ItemList", true, false), 1)
+               outline_parent = old_outline.get_parent()
+               outline_parent.remove_child(old_outline)
+
+               outline = ItemList.new()
+               outline.allow_reselect = true
+               outline.size_flags_vertical = Control.SIZE_EXPAND_FILL
+               outline_parent.add_child(outline)
+
+               outline.item_selected.connect(scroll_to_index)
+
+               # Add a filter box for all kind of members
+               filter_box = HBoxContainer.new()
+
+               engine_func_btn = create_filter_btn(keyword_icon, "Engine callbacks")
+               filter_box.add_child(engine_func_btn)
+
+               func_btn = create_filter_btn(func_icon, "Functions")
+               filter_box.add_child(func_btn)
+
+               signal_btn = create_filter_btn(signal_icon, "Signals")
+               filter_box.add_child(signal_btn)
+
+               export_btn = create_filter_btn(export_icon, "Exported properties")
+               filter_box.add_child(export_btn)
+
+               property_btn = create_filter_btn(property_icon, "Properties")
+               filter_box.add_child(property_btn)
+
+               class_btn = create_filter_btn(class_icon, "Classes")
+               filter_box.add_child(class_btn)
+
+               constant_btn = create_filter_btn(constant_icon, "Constants")
+               filter_box.add_child(constant_btn)
+
+               outline.get_parent().add_child(filter_box)
+               outline.get_parent().move_child(filter_box, outline.get_index())
+
+               # Callback when the filter changed
+               filter_txt = find_or_null(outline_container.find_children("*", "LineEdit", true, false), 1)
+               filter_txt.text_changed.connect(update_outline.unbind(1))
+
+               # Callback when the sorting changed
+               sort_btn = find_or_null(outline_container.find_children("*", "Button", true, false))
+               sort_btn.pressed.connect(update_outline)
+
+       get_editor_settings().settings_changed.connect(sync_settings)
+
+       on_tab_changed(scripts_tab_bar.current_tab)
+
+## Restore the old Godot script UI and free everything we created
+func _exit_tree() -> void:
+       var file_system: EditorFileSystem = get_editor_interface().get_resource_filesystem()
+       file_system.filesystem_changed.disconnect(schedule_update)
+
+       if (old_script_editor_base != null):
+               old_script_editor_base.edited_script_changed.disconnect(update_selected_tab)
+
+       if (split_container != null):
+               if (split_container != outline_container.get_parent()):
+                       split_container.add_child(outline_container)
+
+               # Try to restore the previous split offset.
+               if (is_outline_right):
+                       var split_offset: float = split_container.get_child(1).size.x
+                       split_container.split_offset = split_offset
+
+               split_container.move_child(outline_container, 0)
+
+               filter_txt.text_changed.disconnect(update_outline)
+               sort_btn.pressed.disconnect(update_outline)
+
+               outline.item_selected.disconnect(scroll_to_index)
+
+               outline_parent.remove_child(filter_box)
+               outline_parent.remove_child(outline)
+               outline_parent.add_child(old_outline)
+               outline_parent.move_child(old_outline, 1)
+
+               filter_box.free()
+               outline.free()
+
+       if (scripts_tab_container != null):
+               tab_state.restore(scripts_tab_container, scripts_tab_bar)
+
+               if (scripts_tab_bar != null):
+                       scripts_tab_bar.mouse_exited.disconnect(on_tab_bar_mouse_exited)
+                       scripts_tab_bar.gui_input.disconnect(on_tab_bar_gui_input)
+                       scripts_tab_bar.tab_close_pressed.disconnect(on_tab_close)
+                       scripts_tab_bar.tab_rmb_clicked.disconnect(on_tab_rmb)
+                       scripts_tab_bar.tab_hovered.disconnect(on_tab_hovered)
+                       scripts_tab_bar.active_tab_rearranged.disconnect(on_active_tab_rearranged)
+
+                       scripts_tab_bar.tab_changed.disconnect(on_tab_changed)
+
+       if (scripts_item_list != null):
+               scripts_item_list.get_parent().visible = true
+
+       if (outline_popup != null):
+               outline_popup.hide()
+
+       get_editor_settings().settings_changed.disconnect(sync_settings)
+#endregion
+
+## Lazy pattern to update the editor only once per frame
+func _process(delta: float) -> void:
+       update_editor()
+       set_process(false)
+
+#region Input handling -> Popup
+## Add navigation to the Outline
+func _input(event: InputEvent) -> void:
+       if (!filter_txt.has_focus()):
+               return
+
+       if (event.is_action_pressed("ui_text_submit")):
+               var items: PackedInt32Array = outline.get_selected_items()
+
+               if (items.is_empty()):
+                       return
+
+               var index: int = items[0]
+               scroll_to_index(index)
+
+       if (event.is_action_pressed("ui_down", true)):
+               var items: PackedInt32Array = outline.get_selected_items()
+
+               var index: int
+               if (items.is_empty()):
+                       index = -1
+               else:
+                       index = items[0]
+
+               if (index == outline.item_count - 1):
+                       return
+
+               index += 1
+
+               outline.select(index)
+               outline.ensure_current_is_visible()
+               get_viewport().set_input_as_handled()
+       elif (event.is_action_pressed("ui_up", true)):
+               var items: PackedInt32Array = outline.get_selected_items()
+
+               var index: int
+               if (items.is_empty()):
+                       index = outline.item_count
+               else:
+                       index = items[0]
+
+               if (index == 0):
+                       return
+
+               index -= 1
+               outline.select(index)
+               outline.ensure_current_is_visible()
+               get_viewport().set_input_as_handled()
+
+## Triggers the Outline popup
+func _unhandled_key_input(event: InputEvent) -> void:
+       if !(event is InputEventKey):
+               return
+
+       if (open_outline_popup.matches_event(event)):
+               get_viewport().set_input_as_handled()
+
+               var button_flags: Array[bool] = []
+               for child in filter_box.get_children():
+                       var btn: Button = child
+                       button_flags.append(btn.button_pressed)
+
+                       btn.button_pressed = true
+
+               var old_text: String = filter_txt.text
+               filter_txt.text = ""
+
+               outline_popup = POPUP_SCRIPT.new()
+               outline_popup.input_listener = _input
+
+               var outline_initially_closed: bool = !outline_container.visible
+               if (outline_initially_closed):
+                       outline_container.visible = true
+
+               outline_container.reparent(outline_popup)
+
+               var script_editor: ScriptEditor = get_editor_interface().get_script_editor()
+               outline_popup.popup_hide.connect(func():
+                       if outline_initially_closed:
+                               outline_container.visible = false
+
+                       outline_container.reparent(split_container)
+                       if (!is_outline_right):
+                               split_container.move_child(outline_container, 0)
+
+                       filter_txt.text = old_text
+
+                       var index: int = 0
+                       for flag in button_flags:
+                               var btn: Button = filter_box.get_child(index)
+                               btn.button_pressed = flag
+                               index += 1
+
+                       outline_popup.queue_free()
+                       outline_popup = null
+
+                       update_outline()
+               )
+
+               var window_rect: Rect2
+               if (script_editor.get_parent().get_parent() is Window):
+                       # Popup mode
+                       var window: Window = script_editor.get_parent().get_parent()
+                       window_rect = window.get_visible_rect()
+               else:
+                       window_rect = get_editor_interface().get_base_control().get_rect()
+
+               var size: Vector2i = Vector2i(400, 550)
+               var x: int = window_rect.size.x / 2 - size.x / 2
+               var y: int = window_rect.size.y / 2 - size.y / 2
+               var position: Vector2i = Vector2i(x, y)
+
+               outline_popup.popup_exclusive_on_parent(script_editor, Rect2i(position, size))
+
+               filter_txt.grab_focus()
+
+               update_outline()
+#endregion
+
+## Schedules an update on the frame
+func schedule_update():
+       set_process(true)
+
+## Updates all parts of the editor needed to be synchronized with the file system.
+func update_editor():
+       if (sync_script_list):
+               sync_tab_with_script_list()
+               sync_script_list = false
+
+       update_tabs()
+       update_outline_cache()
+       update_outline()
+
+func get_current_script() -> Script:
+       var script_editor: ScriptEditor = get_editor_interface().get_script_editor()
+       return script_editor.get_current_script()
+
+func scroll_to_index(selected_idx: int):
+       if (outline_popup != null):
+               outline_popup.hide.call_deferred()
+
+       var script: Script = get_current_script()
+       if (!script):
+               return
+
+       var text: String = outline.get_item_text(selected_idx)
+       var metadata: Dictionary = outline.get_item_metadata(selected_idx)
+       var modifier: String = metadata["modifier"]
+       var type: String = metadata["type"]
+
+       var type_with_text: String = type + " " + text
+       if (type == "func"):
+               type_with_text = type_with_text + "("
+
+       var source_code: String = script.get_source_code()
+       var lines: PackedStringArray = source_code.split("\n")
+
+       var index: int = 0
+       for line in lines:
+               # Easy case, like 'var abc'
+               if (line.begins_with(type_with_text)):
+                       goto_line(index)
+                       return
+
+               # We have an modifier, e.g. 'static'
+               if (modifier != "" && line.begins_with(modifier)):
+                       if (line.begins_with(modifier + " " + type_with_text)):
+                               goto_line(index)
+                               return
+                       # Special case: An 'enum' is treated different.
+                       elif (modifier == "enum" && line.contains("enum " + text)):
+                               goto_line(index)
+                               return
+
+               # Hard case, probably something like '@onready var abc'
+               if (type == "var" && line.contains(type_with_text)):
+                       goto_line(index)
+                       return
+
+               index += 1
+
+       push_error(type_with_text + " or " + modifier + " not found in source code")
+
+func goto_line(index: int):
+       var script_editor: ScriptEditor = get_editor_interface().get_script_editor()
+       script_editor.goto_line(index)
+
+       var code_edit: CodeEdit = script_editor.get_current_editor().get_base_editor()
+       code_edit.set_caret_line(index)
+       code_edit.set_caret_column(0)
+       code_edit.set_v_scroll(index)
+       code_edit.set_h_scroll(0)
+
+func create_filter_btn(icon: Texture2D, title: String) -> Button:
+       var btn: Button = Button.new()
+       btn.toggle_mode = true
+       btn.icon = icon
+       btn.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
+       btn.tooltip_text = title
+
+       var property: StringName = as_setting(title)
+       btn.set_meta("property", property)
+       btn.button_pressed = get_setting(property, true)
+
+       btn.toggled.connect(on_filter_button_pressed.bind(btn))
+
+       btn.add_theme_color_override("icon_pressed_color", Color.WHITE)
+       btn.add_theme_color_override("icon_hover_color", Color.WHITE)
+       btn.add_theme_color_override("icon_focus_color", Color.WHITE)
+
+       var style_box_empty: StyleBoxEmpty = StyleBoxEmpty.new()
+       style_box_empty.set_content_margin_all(4 * get_editor_scale())
+       btn.add_theme_stylebox_override("normal", style_box_empty)
+
+       var style_box: StyleBoxFlat = StyleBoxFlat.new()
+       style_box.draw_center = false
+       style_box.border_color = get_editor_accent_color()
+       style_box.set_border_width_all(1 * get_editor_scale())
+       style_box.set_corner_radius_all(get_editor_corner_radius() * get_editor_scale())
+       btn.add_theme_stylebox_override("focus", style_box)
+
+       return btn
+
+func on_filter_button_pressed(pressed: bool, btn: Button):
+       set_setting(btn.get_meta("property"), pressed)
+
+       update_outline()
+
+func update_outline_position():
+       if (is_outline_right):
+               # Try to restore the previous split offset.
+               var split_offset: float = split_container.get_child(1).size.x
+               split_container.split_offset = split_offset
+               split_container.move_child(outline_container, 1)
+       else:
+               split_container.move_child(outline_container, 0)
+
+func update_script_list_visibility():
+       scripts_item_list.get_parent().visible = is_script_list_visible
+
+func sync_settings():
+       if (suppress_settings_sync):
+               return
+
+       var changed_settings: PackedStringArray = get_editor_settings().get_changed_settings()
+       for setting in changed_settings:
+               if (!setting.begins_with(SCRIPT_IDE)):
+                       continue
+
+               if (setting == OUTLINE_POSITION_RIGHT):
+                       # Update outline position.
+                       var new_outline_right: bool = get_setting(OUTLINE_POSITION_RIGHT, is_outline_right)
+                       if (new_outline_right != is_outline_right):
+                               is_outline_right = new_outline_right
+
+                               update_outline_position()
+               elif (setting == HIDE_PRIVATE_MEMBERS):
+                       # Update cache and outline to reflect the private members setting.
+                       var new_hide_private_members: bool = get_setting(HIDE_PRIVATE_MEMBERS, hide_private_members)
+                       if (new_hide_private_members != hide_private_members):
+                               hide_private_members = new_hide_private_members
+
+                               update_outline_cache()
+                               update_outline()
+               elif (setting == OPEN_OUTLINE_POPUP):
+                       # Update show outline popup shortcut.
+                       open_outline_popup = get_editor_settings().get_setting(OPEN_OUTLINE_POPUP)
+               elif (setting == SCRIPT_LIST_VISIBLE):
+                       # Update the script list visibility
+                       var new_script_list_visible: bool = get_setting(SCRIPT_LIST_VISIBLE, is_script_list_visible)
+                       if (new_script_list_visible != is_script_list_visible):
+                               is_script_list_visible = new_script_list_visible
+
+                               update_script_list_visibility()
+               else:
+                       # Update filter buttons.
+                       for btn_node in filter_box.get_children():
+                               var btn: Button = btn_node
+                               var property: StringName = btn.get_meta("property")
+
+                               btn.button_pressed = get_setting(property, btn.button_pressed)
+
+func as_setting(property: String) -> StringName:
+       return SCRIPT_IDE + property.to_lower().replace(" ", "_")
+
+func get_setting(property: StringName, alt: bool) -> bool:
+       var editor_settings: EditorSettings = get_editor_settings()
+       if (editor_settings.has_setting(property)):
+               return editor_settings.get_setting(property)
+       else:
+               editor_settings.set_setting(property, alt)
+               editor_settings.set_initial_value(property, alt, false)
+               return alt
+
+func set_setting(property: StringName, value: bool):
+       var editor_settings: EditorSettings = get_editor_settings()
+
+       suppress_settings_sync = true
+       editor_settings.set_setting(property, value)
+       suppress_settings_sync = false
+
+func on_tab_changed(idx: int):
+       selected_tab = idx;
+
+       if (old_script_editor_base != null):
+               old_script_editor_base.edited_script_changed.disconnect(update_selected_tab)
+               old_script_editor_base = null
+
+       var script_editor: ScriptEditor = get_editor_interface().get_script_editor()
+       var script_editor_base: ScriptEditorBase = script_editor.get_current_editor()
+
+       if (script_editor_base != null):
+               script_editor_base.edited_script_changed.connect(update_selected_tab)
+
+               old_script_editor_base = script_editor_base
+
+       sync_script_list = true
+       schedule_update()
+
+func update_selected_tab():
+       if (selected_tab == -1):
+               return
+
+       if (scripts_item_list.item_count == 0):
+               return
+
+       scripts_tab_container.set_tab_title(selected_tab, scripts_item_list.get_item_text(selected_tab))
+       scripts_tab_container.set_tab_icon(selected_tab, scripts_item_list.get_item_icon(selected_tab))
+
+func update_tabs():
+       for index in scripts_tab_container.get_tab_count():
+               scripts_tab_container.set_tab_title(index, scripts_item_list.get_item_text(index))
+               scripts_tab_container.set_tab_icon(index, scripts_item_list.get_item_icon(index))
+
+#region Outline (cache) update
+func update_keywords(script: Script):
+       if (script == null):
+               return
+
+       var new_script_type: StringName = script.get_instance_base_type()
+       if (old_script_type != new_script_type):
+               old_script_type = new_script_type
+
+               keywords.clear()
+               keywords["_static_init"] = 0
+               register_virtual_methods(new_script_type)
+
+func register_virtual_methods(clazz: String):
+       for method in ClassDB.class_get_method_list(clazz):
+               if method.flags & METHOD_FLAG_VIRTUAL > 0:
+                       keywords[method.name] = 0
+
+func update_outline_cache():
+       outline_cache = null
+
+       var script: Script = get_current_script()
+       if (!script):
+               return
+
+       update_keywords(script)
+
+       # Check if built-in script. In this case we need to duplicate it.
+       if (script.get_path().contains(".tscn::GDScript")):
+               script = script.duplicate()
+
+       outline_cache = OutlineCache.new()
+
+       # Collect all script members.
+       for_each_script_member(script, func(array: Array[String], item: String): array.append(item))
+
+       # Remove script members that only exist in the base script (which includes the base of the base etc.).
+       # Note: The method that only collects script members without including the base script(s)
+       # is not exposed to GDScript.
+       var base_script: Script = script.get_base_script()
+       if (base_script != null):
+               for_each_script_member(base_script, func(array: Array[String], item: String): array.erase(item))
+
+func for_each_script_member(script: Script, consumer: Callable):
+       # Functions / Methods
+       for dict in script.get_script_method_list():
+               var func_name: String = dict["name"]
+
+               if (keywords.has(func_name)):
+                       consumer.call(outline_cache.engine_funcs, func_name)
+               else:
+                       if hide_private_members && func_name.begins_with("_"):
+                               continue
+
+                       # Inline getter/setter will normally be shown as '@...getter', '@...setter'.
+                       # Since we already show the variable itself, we will skip those.
+                       if (func_name.begins_with("@")):
+                               continue
+
+                       consumer.call(outline_cache.funcs, func_name)
+
+       # Properties / Exported variables
+       for dict in script.get_script_property_list():
+               var property: String = dict["name"]
+               if hide_private_members && property.begins_with("_"):
+                       continue
+
+               var usage: int = dict["usage"]
+
+               if (usage & PROPERTY_USAGE_SCRIPT_VARIABLE):
+                       if (usage & PROPERTY_USAGE_STORAGE && usage & PROPERTY_USAGE_EDITOR):
+                               consumer.call(outline_cache.exports, property)
+                       else:
+                               consumer.call(outline_cache.properties, property)
+
+       # Static variables (are separated for whatever reason)
+       for dict in script.get_property_list():
+               var property: String = dict["name"]
+               if hide_private_members && property.begins_with("_"):
+                       continue
+
+               var usage: int = dict["usage"]
+
+               if (usage & PROPERTY_USAGE_SCRIPT_VARIABLE):
+                       consumer.call(outline_cache.properties, property)
+
+       # Signals
+       for dict in script.get_script_signal_list():
+               var signal_name: String = dict["name"]
+
+               consumer.call(outline_cache.signals, signal_name)
+
+       # Constants / Classes
+       for name_key in script.get_script_constant_map():
+               if hide_private_members && name_key.begins_with("_"):
+                       continue
+
+               var object: Variant = script.get_script_constant_map().get(name_key)
+               # Inner classes have no source code, while a const of type GDScript has.
+               if (object is GDScript && !object.has_source_code()):
+                       consumer.call(outline_cache.classes, name_key)
+               else:
+                       consumer.call(outline_cache.constants, name_key)
+
+func update_outline():
+       outline.clear()
+
+       if (outline_cache == null):
+               return
+
+       # Classes
+       if (class_btn.button_pressed):
+               add_to_outline(outline_cache.classes, class_icon, "class")
+
+       # Constants
+       if (constant_btn.button_pressed):
+               add_to_outline(outline_cache.constants, constant_icon, "const", "enum")
+
+       # Properties
+       if (property_btn.button_pressed):
+               add_to_outline(outline_cache.properties, property_icon, "var")
+
+       # Exports
+       if (export_btn.button_pressed):
+               add_to_outline(outline_cache.exports, export_icon, "var", "@export")
+
+       # Signals
+       if (signal_btn.button_pressed):
+               add_to_outline(outline_cache.signals, signal_icon, "signal")
+
+       # Functions
+       if (func_btn.button_pressed):
+               add_to_outline_ext(outline_cache.funcs, get_icon, "func", "static")
+
+       # Engine functions
+       if (engine_func_btn.button_pressed):
+               add_to_outline(outline_cache.engine_funcs, keyword_icon, "func")
+
+func add_to_outline(items: Array[String], icon: Texture2D, type: String, modifier: String = ""):
+       add_to_outline_ext(items, func(str: String): return icon, type, modifier)
+
+func add_to_outline_ext(items: Array[String], icon_callable: Callable, type: String, modifier: String = ""):
+       var text: String = filter_txt.get_text()
+       var move_index: int = 0
+
+       if (is_sorted()):
+               items = items.duplicate()
+               items.sort_custom(func(a, b): return a.naturalnocasecmp_to(b) < 0)
+
+       for item in items:
+               if (text.is_empty() || text.is_subsequence_ofn(item)):
+                       var icon: Texture2D = icon_callable.call(item)
+                       outline.add_item(item, icon, true)
+
+                       var dict: Dictionary = {
+                               "type": type,
+                               "modifier": modifier
+                       }
+                       outline.set_item_metadata(outline.item_count - 1, dict)
+                       # Only activate the tooltip when we do not show the outline in the popup.
+                       outline.set_item_tooltip_enabled(outline.item_count - 1, outline_popup == null)
+                       outline.move_item(outline.item_count - 1, move_index)
+
+                       move_index += 1
+
+func get_icon(func_name: String) -> Texture2D:
+       var icon: Texture2D = func_icon
+       if (func_name.begins_with("get")):
+               icon = func_get_icon
+       elif (func_name.begins_with("set")):
+               icon = func_set_icon
+
+       return icon
+#endregion
+
+func sync_tab_with_script_list():
+       # For some reason the selected tab is wrong. Looks like a Godot bug.
+       if (selected_tab >= scripts_item_list.item_count):
+               selected_tab = scripts_tab_bar.current_tab
+
+       # Hide filter and outline for non .gd scripts.
+       var is_script: bool = get_current_script() != null
+       filter_box.visible = is_script
+       outline.visible = is_script
+
+       # Sync with script item list.
+       if (selected_tab != -1 && scripts_item_list.item_count > 0 && !scripts_item_list.is_selected(selected_tab)):
+               scripts_item_list.select(selected_tab)
+               scripts_item_list.item_selected.emit(selected_tab)
+
+               scripts_item_list.ensure_current_is_visible()
+
+func trigger_script_editor_update_script_names():
+       var script_editor: ScriptEditor = get_editor_interface().get_script_editor()
+       # for now it is the only way to trigger script_editor._update_script_names
+       script_editor.notification(Control.NOTIFICATION_THEME_CHANGED)
+
+#region Tab Handling
+func on_tab_bar_mouse_exited():
+       last_tab_hovered = -1
+
+func on_tab_hovered(idx: int):
+       last_tab_hovered = idx
+
+func on_tab_bar_gui_input(event: InputEvent):
+       if last_tab_hovered == -1:
+               return
+
+       if event is InputEventMouseMotion:
+               scripts_tab_bar.tooltip_text = get_res_path(last_tab_hovered)
+
+       if event is InputEventMouseButton:
+               if event.is_pressed() and event.button_index == MOUSE_BUTTON_MIDDLE:
+                       simulate_item_clicked(last_tab_hovered, MOUSE_BUTTON_MIDDLE)
+
+func on_active_tab_rearranged(idx_to: int):
+       var control: Control = scripts_tab_container.get_tab_control(selected_tab)
+       if (!control):
+               return
+
+       scripts_tab_container.move_child(control, idx_to)
+       scripts_tab_container.current_tab = scripts_tab_container.current_tab
+       selected_tab = scripts_tab_container.current_tab
+       trigger_script_editor_update_script_names()
+
+func get_res_path(idx: int) -> String:
+       var tab_control: Control = scripts_tab_container.get_tab_control(idx)
+       if (tab_control == null):
+               return ''
+
+       var path_var: Variant = tab_control.get("metadata/_edit_res_path")
+       if (path_var == null):
+               return ''
+
+       return path_var
+
+func on_tab_rmb(tab_idx: int):
+       simulate_item_clicked(tab_idx, MOUSE_BUTTON_RIGHT)
+
+func on_tab_close(tab_idx: int):
+       simulate_item_clicked(tab_idx, MOUSE_BUTTON_MIDDLE)
+
+func simulate_item_clicked(tab_idx: int, mouse_idx: int):
+       scripts_item_list.item_clicked.emit(tab_idx, scripts_item_list.get_local_mouse_position(), mouse_idx)
+#endregion
+
+func get_editor_scale() -> float:
+       return get_editor_interface().get_editor_scale()
+
+func get_editor_corner_radius() -> int:
+       return get_editor_interface().get_editor_settings().get_setting("interface/theme/corner_radius")
+
+func get_editor_accent_color() -> Color:
+       return get_editor_interface().get_editor_settings().get_setting("interface/theme/accent_color")
+
+func is_sorted() -> bool:
+       return get_editor_settings().get_setting("text_editor/script_list/sort_members_outline_alphabetically")
+
+func get_editor_settings() -> EditorSettings:
+       return get_editor_interface().get_editor_settings()
+
+static func find_or_null(arr: Array[Node], index: int = 0) -> Node:
+       if arr.is_empty():
+               return null
+
+       return arr[index]
+
+class OutlineCache:
+       var classes: Array[String] = []
+       var constants: Array[String] = []
+       var signals: Array[String] = []
+       var exports: Array[String] = []
+       var properties: Array[String] = []
+       var funcs: Array[String] = []
+       var engine_funcs: Array[String] = []
+
+class TabStateCache:
+       var tabs_visible: bool
+       var drag_to_rearrange_enabled: bool
+       var tab_bar_drag_to_rearrange_enabled: bool
+       var tab_close_display_policy: TabBar.CloseButtonDisplayPolicy
+       var select_with_rmb: bool
+
+       func save(tab_container: TabContainer, tab_bar: TabBar):
+               if (tab_container != null):
+                       tabs_visible = tab_container.tabs_visible
+                       drag_to_rearrange_enabled = tab_container.drag_to_rearrange_enabled
+               if (tab_bar != null):
+                       tab_bar_drag_to_rearrange_enabled = tab_bar.drag_to_rearrange_enabled
+                       tab_close_display_policy = tab_bar.tab_close_display_policy
+                       select_with_rmb = tab_bar.select_with_rmb
+
+       func restore(tab_container: TabContainer, tab_bar: TabBar):
+               if (tab_container != null):
+                       tab_container.tabs_visible = tabs_visible
+                       tab_container.drag_to_rearrange_enabled = drag_to_rearrange_enabled
+               if (tab_bar != null):
+                       tab_bar.drag_to_rearrange_enabled = drag_to_rearrange_enabled
+                       tab_bar.tab_close_display_policy = tab_close_display_policy
+                       tab_bar.select_with_rmb = select_with_rmb
diff --git a/addons/script-tabs/LICENSE b/addons/script-tabs/LICENSE
new file mode 100644 (file)
index 0000000..ca61fab
--- /dev/null
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Maxim Kovkel
+
+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.
diff --git a/addons/script-tabs/plugin.cfg b/addons/script-tabs/plugin.cfg
new file mode 100644 (file)
index 0000000..13217ed
--- /dev/null
@@ -0,0 +1,7 @@
+[plugin]
+
+name="script-tabs"
+description="Move scripts list to tabs."
+author="kovkel"
+version="1.0.0"
+script="plugin.gd"
diff --git a/addons/script-tabs/plugin.gd b/addons/script-tabs/plugin.gd
new file mode 100644 (file)
index 0000000..13e472a
--- /dev/null
@@ -0,0 +1,213 @@
+@tool
+extends EditorPlugin
+
+const HIDE_NATIVE_LIST = true
+
+var _scripts_tab_container: TabContainer
+var _scripts_tab_bar: TabBar
+var _scripts_item_list: ItemList
+var _prev_state := TabContainerState.new()
+var _last_tab_selected = -1
+var _last_tab_hovered = -1
+
+
+func _enter_tree() -> void:
+       var script_editor = get_editor_interface().get_script_editor()
+       _scripts_tab_container = first_or_null(script_editor.find_children(
+                       "*", "TabContainer", true, false
+               )
+       )
+       _scripts_item_list = first_or_null(script_editor.find_children(
+               "*", "ItemList", true, false
+       ))
+       if _scripts_tab_container:
+               _scripts_tab_bar = get_tab_bar_of(_scripts_tab_container)
+               _prev_state.save(_scripts_tab_container, _scripts_tab_bar)
+               _scripts_tab_container.tabs_visible = true
+               _scripts_tab_container.drag_to_rearrange_enabled = true
+               _scripts_tab_container.sort_children.connect(_update_tabs)
+       if _scripts_tab_bar:
+               _scripts_tab_bar.tab_close_display_policy = TabBar.CLOSE_BUTTON_SHOW_ACTIVE_ONLY
+               _scripts_tab_bar.select_with_rmb = true
+               _scripts_tab_bar.drag_to_rearrange_enabled = true
+               _scripts_tab_bar.tab_close_pressed.connect(_on_tab_close)
+               _scripts_tab_bar.tab_rmb_clicked.connect(_on_tab_rmb)
+               _scripts_tab_bar.tab_selected.connect(_on_tab_selected)
+               _scripts_tab_bar.tab_hovered.connect(_on_tab_hovered)
+               _scripts_tab_bar.mouse_exited.connect(_on_tab_bar_mouse_exited)
+               _scripts_tab_bar.active_tab_rearranged.connect(_on_active_tab_rearranged)
+               _scripts_tab_bar.gui_input.connect(_on_scripts_tab_bar_gui_input)
+       if _scripts_item_list:
+               if HIDE_NATIVE_LIST:
+                       _scripts_item_list.get_parent().visible = false
+               _scripts_item_list.property_list_changed.connect(_on_item_list_property_list_changed)
+       _update_tabs()
+
+
+func _exit_tree() -> void:
+       if _scripts_tab_container:
+               _scripts_tab_bar = get_tab_bar_of(_scripts_tab_container)
+               _prev_state.restore(_scripts_tab_container, _scripts_tab_bar)
+               _scripts_tab_container.sort_children.disconnect(_update_tabs)
+       if _scripts_item_list:
+               if HIDE_NATIVE_LIST:
+                       _scripts_item_list.get_parent().visible = true
+               _scripts_item_list.property_list_changed.disconnect(_on_item_list_property_list_changed)
+       if _scripts_tab_bar:
+               _scripts_tab_bar.mouse_exited.disconnect(_on_tab_bar_mouse_exited)
+               _scripts_tab_bar.gui_input.disconnect(_on_scripts_tab_bar_gui_input)
+               _scripts_tab_bar.tab_close_pressed.disconnect(_on_tab_close)
+               _scripts_tab_bar.tab_rmb_clicked.disconnect(_on_tab_rmb)
+               _scripts_tab_bar.tab_selected.disconnect(_on_tab_selected)
+               _scripts_tab_bar.tab_hovered.disconnect(_on_tab_hovered)
+               _scripts_tab_bar.active_tab_rearranged.disconnect(_on_active_tab_rearranged)
+
+
+func _on_tab_bar_mouse_exited():
+       _last_tab_hovered = -1
+       
+
+func _on_tab_hovered(idx):
+       _last_tab_hovered = idx
+
+
+func _on_scripts_tab_bar_gui_input(event: InputEvent):
+       if event is InputEventMouseMotion:
+               var tab_control = _scripts_tab_container.get_tab_control(_last_tab_hovered)
+               var path = ''
+               if tab_control:
+                       path = tab_control.get("metadata/_edit_res_path")
+               _scripts_tab_bar.tooltip_text = '' if path == null else path
+       if _last_tab_hovered == -1: return
+       if event is InputEventMouseButton:
+               if event.is_pressed() and event.button_index == MOUSE_BUTTON_MIDDLE:
+                       _simulate_item_clicked(_last_tab_hovered, MOUSE_BUTTON_MIDDLE)
+
+
+func _on_active_tab_rearranged(_idx_to):
+       var control = _scripts_tab_container.get_tab_control(_last_tab_selected)
+       if not control:
+               return
+       _scripts_tab_container.move_child(control, _idx_to)
+       _scripts_tab_container.current_tab = _scripts_tab_container.current_tab
+       _trigger_script_editor_update_script_names()
+
+
+func _on_tab_selected(tab_idx):
+       _last_tab_selected = tab_idx
+       var item_idx = _find_list_item_idx_by_tab_idx(tab_idx)
+       if item_idx != -1:
+               if not _scripts_item_list.is_selected(item_idx):
+                       var select_scripts_item = func():
+                               _scripts_item_list.select(item_idx)
+                               _scripts_item_list.item_selected.emit(item_idx)
+                       select_scripts_item.call_deferred()
+
+
+func _on_tab_rmb(tab_idx):
+       _simulate_item_clicked(tab_idx, MOUSE_BUTTON_RIGHT)
+
+
+func _on_tab_close(tab_idx):
+       _simulate_item_clicked(tab_idx, MOUSE_BUTTON_MIDDLE)
+
+
+func _on_item_list_property_list_changed():
+       _update_tabs.call_deferred()
+
+
+func _simulate_item_clicked(tab_idx, mouse_idx):
+       if _scripts_item_list:
+               var item_idx = _find_list_item_idx_by_tab_idx(tab_idx)
+               if item_idx != -1:
+                       _scripts_item_list.item_clicked.emit(
+                               item_idx,
+                               _scripts_item_list.get_local_mouse_position(),
+                               mouse_idx
+                       )
+
+
+func _update_tabs():
+       _update_tab_names()
+       _update_tab_icons()
+
+
+func _update_tab_names():
+       if not _scripts_tab_container or not _scripts_item_list:
+               return
+
+       for item_idx in _scripts_item_list.item_count:
+               var tab_idx = _get_item_list_tab_idx(item_idx)
+               if tab_idx != -1:
+                       _scripts_tab_container.set_tab_title(
+                               tab_idx, _scripts_item_list.get_item_text(item_idx)
+                       )
+
+
+func _update_tab_icons():
+       if not _scripts_tab_container or not _scripts_item_list:
+               return
+       
+       for item_idx in _scripts_item_list.item_count:
+               var tab_idx = _get_item_list_tab_idx(item_idx)
+               if tab_idx != -1:
+                       _scripts_tab_container.set_tab_icon(
+                               tab_idx, _scripts_item_list.get_item_icon(item_idx)
+                       )
+
+
+func _get_item_list_tab_idx(item_idx) -> int:
+       var metadata = _scripts_item_list.get_item_metadata(item_idx)
+       if not metadata is int:
+               return -1
+       else:
+               return metadata
+
+
+func _find_list_item_idx_by_tab_idx(tab_idx) -> int:
+       for i in _scripts_item_list.item_count:
+               if _scripts_item_list.get_item_metadata(i) == tab_idx:
+                       return i
+       return -1
+
+
+func _trigger_script_editor_update_script_names():
+       var script_editor = get_editor_interface().get_script_editor()
+       # for now it is the only way to trigger script_edtior._update_script_names
+       script_editor.notification(Control.NOTIFICATION_THEME_CHANGED)
+
+
+static func first_or_null(arr):
+       if len(arr) == 0:
+               return null
+       return arr[0]
+
+
+static func get_tab_bar_of(src) -> TabBar:
+       for c in src.get_children(true):
+               if c is TabBar:
+                       return c
+       return null
+
+
+class TabContainerState:
+       var _tabs_visible
+       var _drag_to_rearrange_enabled
+       var _tab_close_display_policy
+       var _select_with_rmb
+       
+       func save(src: TabContainer, tab_bar: TabBar):
+               if src:
+                       _tabs_visible = src.tabs_visible
+               if tab_bar:
+                       _drag_to_rearrange_enabled = tab_bar.drag_to_rearrange_enabled
+                       _tab_close_display_policy = tab_bar.tab_close_display_policy
+                       _select_with_rmb = tab_bar.select_with_rmb
+       
+       func restore(src: TabContainer, tab_bar: TabBar):
+               if src:
+                       src.tabs_visible = _tabs_visible
+               if tab_bar:
+                       tab_bar.drag_to_rearrange_enabled = _drag_to_rearrange_enabled
+                       tab_bar.tab_close_display_policy = _tab_close_display_policy
+                       tab_bar.select_with_rmb = _select_with_rmb
diff --git a/addons/tracer/StackHandler.cs b/addons/tracer/StackHandler.cs
new file mode 100644 (file)
index 0000000..872cb28
--- /dev/null
@@ -0,0 +1,40 @@
+using Godot;
+using System.Diagnostics;
+
+public partial class StackHandler : GodotObject
+{
+       public string GetModulePath()
+       {
+               string modulePath = "unknown";
+               StackTrace st = new StackTrace(true);
+               if (st.FrameCount > 6)
+               {
+                       StackFrame sf = st.GetFrame(6);
+                       modulePath = sf.GetFileName();
+                       string rootDir = ProjectSettings.GlobalizePath("res://");
+                       // This substring is necessary in order to remove the OS path from the module's
+                       // filepath.
+                       // i.e. remove "C:/GodotProjects/Game" from "C:/GodotProjects/Game/Scenes/Main/Main.cs"
+                       // ProjectSettings.LocalizePath(...) doesn't seem to work.
+                       modulePath = modulePath.Substring(rootDir.Length);
+                       // Also convert Windows-style backslashes to Godot standard forward slashes if present.
+                       if (modulePath.Contains("\\"))
+                       {
+                               modulePath = modulePath.Replace("\\", "/");
+                       }
+               }
+               return modulePath;
+       }
+
+       public string GetFunctionName()
+       {
+               string functionName = "unknown";
+               StackTrace st = new StackTrace(true);
+               if (st.FrameCount > 6)
+               {
+                       StackFrame sf = st.GetFrame(6);
+                       functionName = sf.GetMethod().Name;
+               }
+               return functionName;
+       }
+}
diff --git a/addons/tracer/plugin.cfg b/addons/tracer/plugin.cfg
new file mode 100644 (file)
index 0000000..6ecb615
--- /dev/null
@@ -0,0 +1,7 @@
+[plugin]
+
+name="Tracer"
+description="Structured tracing for godot"
+author="wyvernbw"
+version=""
+script="tracer_plugin.gd"
diff --git a/addons/tracer/subscriber.gd b/addons/tracer/subscriber.gd
new file mode 100644 (file)
index 0000000..9eedff1
--- /dev/null
@@ -0,0 +1,123 @@
+class_name TraceSubscriber
+extends Node
+
+var print_level := true
+var use_colored_output := true
+var use_nicer_colors := false
+var print_module := true
+var print_function := true
+var print_timestamp := true
+var print_thread_id := false
+var writer: Callable = print_stump
+var filter: int = ~0
+
+func init() -> void:
+       Tracer.add_child(self)
+       Tracer.entered_span.connect(on_entered_span)
+
+
+func print_stump(text: String) -> void:
+       print_rich(text)
+
+
+func on_entered_span() -> void:
+       var span: Tracer.Trace = Tracer.current_span
+       if span.level & filter == 0:
+               return
+       var text = span.msg
+       var level_str = (
+               Tracer.level_colored
+               if use_colored_output
+               else Tracer.level_string
+       )
+       if use_nicer_colors and use_colored_output:
+               level_str = Tracer.level_colored_nice
+       var gray = (
+               "[color=dimgray]%s[/color]"
+               if use_nicer_colors
+               else "[color=gray]%s[/color]"
+       )
+       if not use_colored_output:
+               gray = "%s"
+       if print_function:
+               var function_name = span.function_name
+               if use_colored_output:
+                       function_name = (gray % function_name)
+               text = function_name + ": " + text
+       if print_module:
+               var module_name = span.module
+               if use_colored_output:
+                       module_name = (gray % module_name)
+               var separator = (gray % "::") if print_function else ": "
+               text = module_name + separator + text
+       if print_level:
+               var separator = ": " if not (print_module or print_function) else " "
+               text = level_str.call(span.level) + separator + text
+       if print_timestamp:
+               text = "[%s] " % span.timestamp + text
+       if print_thread_id:
+               text = "ThreadId(%s) " % span.thread_id + text
+       writer.call(text)
+
+
+func with_level(displayed: bool) -> TraceSubscriber:
+       print_level = displayed
+       return self
+
+
+func with_colored_output(displayed: bool) -> TraceSubscriber:
+       use_colored_output = displayed
+       return self
+
+
+func with_module(displayed: bool) -> TraceSubscriber:
+       print_module = displayed
+       return self
+
+
+func with_function(displayed: bool) -> TraceSubscriber:
+       print_function = displayed
+       return self
+
+
+func with_timestamp(displayed: bool) -> TraceSubscriber:
+       print_timestamp = displayed
+       return self
+
+
+func with_thread_id(displayed: bool) -> TraceSubscriber:
+       print_thread_id = displayed
+       return self
+
+
+func with_nicer_colors(displayed: bool) -> TraceSubscriber:
+       use_nicer_colors = displayed
+       return self
+
+
+func barebones() -> TraceSubscriber:
+       return (
+               self
+               . with_level(true)
+               . with_colored_output(false)
+               . with_module(true)
+               . with_function(true)
+               . with_timestamp(true)
+               . with_thread_id(false)
+       )
+
+
+func with_filter(new_filter: int) -> TraceSubscriber:
+       filter = new_filter
+       return self
+
+
+func with_writer(writer: Callable) -> TraceSubscriber:
+       self.writer = writer
+       return self
+
+
+static func writer_from_file(file: FileAccess) -> Callable:
+       return func(text: String) -> void:
+               file.store_string(text + "\n")
+
diff --git a/addons/tracer/tracer.gd b/addons/tracer/tracer.gd
new file mode 100644 (file)
index 0000000..eb38d8b
--- /dev/null
@@ -0,0 +1,131 @@
+extends Node
+
+signal entered_span
+
+enum Level {
+       Error = 1,
+       Warn = 2,
+       Info = 4,
+       Debug = 8,
+       Trace = 16,
+}
+
+
+class Trace:
+       var level: Level
+       var msg: String
+       var module: String = "unknown"
+       var function_name: String = "unknown"
+       var timestamp: String = (
+               Time.get_datetime_string_from_system()
+       )
+       var thread_id := 1
+       var _has_mono: bool = Engine.has_singleton("GodotSharp")
+
+       func _init(
+               msg: String, level: Level, new_thread_id := 0
+       ) -> void:
+               self.msg = msg
+               self.level = level
+               var st = get_stack()
+               if st.size() > 2:
+                       module = st[2].source.trim_prefix("res://")
+                       function_name = st[2].function
+               elif _has_mono:
+                       # C#-specific stack handling
+                       var mono_sh_script = load("res://addons/tracer/StackHandler.cs")
+                       var mono_stack_handler = mono_sh_script.new()
+                       module = mono_stack_handler.GetModulePath()
+                       function_name = mono_stack_handler.GetFunctionName()
+               else:
+                       function_name = "unknown"
+               thread_id = new_thread_id
+
+
+var current_span: Trace = null:
+       set = set_current_span
+
+
+func set_current_span(span: Trace) -> void:
+       current_span = span
+       entered_span.emit()
+
+
+func info(msg: String) -> void:
+       current_span = Trace.new(
+               msg, Level.Info, OS.get_thread_caller_id()
+       )
+
+
+func debug(msg: String) -> void:
+       current_span = Trace.new(
+               msg, Level.Debug, OS.get_thread_caller_id()
+       )
+
+
+func warn(msg: String) -> void:
+       current_span = Trace.new(
+               msg, Level.Warn, OS.get_thread_caller_id()
+       )
+
+
+func error(msg: String) -> void:
+       current_span = Trace.new(
+               msg, Level.Error, OS.get_thread_caller_id()
+       )
+
+
+func trace(msg: String) -> void:
+       current_span = Trace.new(msg, Level.Trace)
+
+
+static func level_string(level: Level) -> String:
+       match level:
+               Level.Info:
+                       return "INFO"
+               Level.Debug:
+                       return "DEBUG"
+               Level.Warn:
+                       return "WARN"
+               Level.Error:
+                       return "ERROR"
+               Level.Trace:
+                       return "TRACE"
+               _:
+                       return "UNKNOWN"
+
+
+static func level_colored(level: Level) -> String:
+       var color = ""
+       match level:
+               Level.Info:
+                       color = "[color=green]%s[/color]"
+               Level.Debug:
+                       color = "[color=blue]%s[/color]"
+               Level.Warn:
+                       color = "[color=yellow]%s[/color]"
+               Level.Error:
+                       color = "[color=red]%s[/color]"
+               Level.Trace:
+                       color = "[color=magenta]%s[/color]"
+               _:
+                       color = "[color=white]%s[/color]"
+       return color % level_string(level)
+
+
+static func level_colored_nice(level: Level) -> String:
+       var color = ""
+       match level:
+               Level.Info:
+                       color = "[color=greenyellow]%s[/color]"
+               Level.Debug:
+                       color = "[color=dodgerblue]%s[/color]"
+               Level.Warn:
+                       color = "[color=gold]%s[/color]"
+               Level.Error:
+                       color = "[color=orangered]%s[/color]"
+               Level.Trace:
+                       color = "[color=maroon]%s[/color]"
+               _:
+                       color = "[color=white]%s[/color]"
+       return color % level_string(level)
diff --git a/addons/tracer/tracer_plugin.gd b/addons/tracer/tracer_plugin.gd
new file mode 100644 (file)
index 0000000..8574064
--- /dev/null
@@ -0,0 +1,14 @@
+@tool
+extends EditorPlugin
+
+const AUTOLOAD_NAME = "Tracer"
+
+
+func _enter_tree():
+       add_autoload_singleton(AUTOLOAD_NAME, "./tracer.gd")
+       pass
+
+
+func _exit_tree():
+       remove_autoload_singleton(AUTOLOAD_NAME)
+       pass
diff --git a/assets/fonts/Agora.otf b/assets/fonts/Agora.otf
new file mode 100644 (file)
index 0000000..4826ed2
Binary files /dev/null and b/assets/fonts/Agora.otf differ
diff --git a/assets/fonts/Agora.otf.import b/assets/fonts/Agora.otf.import
new file mode 100644 (file)
index 0000000..b4022bc
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="font_data_dynamic"
+type="FontFile"
+uid="uid://b13vwg53k4dkq"
+path="res://.godot/imported/Agora.otf-a38c4aadad6fc12d1969a406b069cc52.fontdata"
+
+[deps]
+
+source_file="res://assets/fonts/Agora.otf"
+dest_files=["res://.godot/imported/Agora.otf-a38c4aadad6fc12d1969a406b069cc52.fontdata"]
+
+[params]
+
+Rendering=null
+antialiasing=1
+generate_mipmaps=false
+disable_embedded_bitmaps=true
+multichannel_signed_distance_field=false
+msdf_pixel_range=8
+msdf_size=48
+allow_system_fallback=true
+force_autohinter=false
+hinting=1
+subpixel_positioning=1
+oversampling=0.0
+Fallbacks=null
+fallbacks=[]
+Compress=null
+compress=true
+preload=[]
+language_support={}
+script_support={}
+opentype_features={}
diff --git a/assets/fonts/Agora.ttf b/assets/fonts/Agora.ttf
new file mode 100644 (file)
index 0000000..ed5724d
Binary files /dev/null and b/assets/fonts/Agora.ttf differ
diff --git a/assets/fonts/Agora.ttf.import b/assets/fonts/Agora.ttf.import
new file mode 100644 (file)
index 0000000..40974e1
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="font_data_dynamic"
+type="FontFile"
+uid="uid://df26qb3be0lr5"
+path="res://.godot/imported/Agora.ttf-597f65f6b5e5eef131ed4256231e269d.fontdata"
+
+[deps]
+
+source_file="res://assets/fonts/Agora.ttf"
+dest_files=["res://.godot/imported/Agora.ttf-597f65f6b5e5eef131ed4256231e269d.fontdata"]
+
+[params]
+
+Rendering=null
+antialiasing=1
+generate_mipmaps=false
+disable_embedded_bitmaps=true
+multichannel_signed_distance_field=false
+msdf_pixel_range=8
+msdf_size=48
+allow_system_fallback=true
+force_autohinter=false
+hinting=1
+subpixel_positioning=1
+oversampling=0.0
+Fallbacks=null
+fallbacks=[]
+Compress=null
+compress=true
+preload=[]
+language_support={}
+script_support={}
+opentype_features={}
diff --git a/assets/logo_backpain.png b/assets/logo_backpain.png
new file mode 100644 (file)
index 0000000..698139b
Binary files /dev/null and b/assets/logo_backpain.png differ
diff --git a/assets/logo_backpain.png.import b/assets/logo_backpain.png.import
new file mode 100644 (file)
index 0000000..6a071df
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bwwrm5h5uvljd"
+path="res://.godot/imported/logo_backpain.png-658659efba431a738a86a54d8b4b63ee.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/logo_backpain.png"
+dest_files=["res://.godot/imported/logo_backpain.png-658659efba431a738a86a54d8b4b63ee.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
diff --git a/assets/logo_made_with_godot.png b/assets/logo_made_with_godot.png
new file mode 100644 (file)
index 0000000..edc0449
Binary files /dev/null and b/assets/logo_made_with_godot.png differ
diff --git a/assets/logo_made_with_godot.png.import b/assets/logo_made_with_godot.png.import
new file mode 100644 (file)
index 0000000..ae13c59
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://c2hclus3idni7"
+path="res://.godot/imported/logo_made_with_godot.png-c37ed0307a68f19e110b2bf16ebbf52e.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/logo_made_with_godot.png"
+dest_files=["res://.godot/imported/logo_made_with_godot.png-c37ed0307a68f19e110b2bf16ebbf52e.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
diff --git a/assets/title_screen_background.png b/assets/title_screen_background.png
new file mode 100644 (file)
index 0000000..b3c320c
Binary files /dev/null and b/assets/title_screen_background.png differ
diff --git a/assets/title_screen_background.png.import b/assets/title_screen_background.png.import
new file mode 100644 (file)
index 0000000..3b165de
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://b1hgu1e1abcgx"
+path="res://.godot/imported/title_screen_background.png-9cc91148dde7f81e40d7ea8d391f71d7.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/title_screen_background.png"
+dest_files=["res://.godot/imported/title_screen_background.png-9cc91148dde7f81e40d7ea8d391f71d7.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
diff --git a/assets/ui-components/Agora.otf b/assets/ui-components/Agora.otf
new file mode 100644 (file)
index 0000000..4826ed2
Binary files /dev/null and b/assets/ui-components/Agora.otf differ
diff --git a/assets/ui-components/Agora.otf.import b/assets/ui-components/Agora.otf.import
new file mode 100644 (file)
index 0000000..eb2bba5
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="font_data_dynamic"
+type="FontFile"
+uid="uid://l0yx46jg8c6g"
+path="res://.godot/imported/Agora.otf-865f3b15cbe3196c45a3628cbc08e205.fontdata"
+
+[deps]
+
+source_file="res://assets/ui-components/Agora.otf"
+dest_files=["res://.godot/imported/Agora.otf-865f3b15cbe3196c45a3628cbc08e205.fontdata"]
+
+[params]
+
+Rendering=null
+antialiasing=1
+generate_mipmaps=false
+disable_embedded_bitmaps=true
+multichannel_signed_distance_field=false
+msdf_pixel_range=8
+msdf_size=48
+allow_system_fallback=true
+force_autohinter=false
+hinting=1
+subpixel_positioning=1
+oversampling=0.0
+Fallbacks=null
+fallbacks=[]
+Compress=null
+compress=true
+preload=[]
+language_support={}
+script_support={}
+opentype_features={}
diff --git a/assets/ui-components/button.png b/assets/ui-components/button.png
new file mode 100644 (file)
index 0000000..cdd5951
Binary files /dev/null and b/assets/ui-components/button.png differ
diff --git a/assets/ui-components/button.png.import b/assets/ui-components/button.png.import
new file mode 100644 (file)
index 0000000..60d4362
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dincbtrehm6ha"
+path="res://.godot/imported/button.png-8d9fe31904317a4acebd895103199004.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/ui-components/button.png"
+dest_files=["res://.godot/imported/button.png-8d9fe31904317a4acebd895103199004.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
diff --git a/assets/ui-components/button_hover.png b/assets/ui-components/button_hover.png
new file mode 100644 (file)
index 0000000..e3b2adb
Binary files /dev/null and b/assets/ui-components/button_hover.png differ
diff --git a/assets/ui-components/button_hover.png.import b/assets/ui-components/button_hover.png.import
new file mode 100644 (file)
index 0000000..0e5e45c
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dwux4h043hvnu"
+path="res://.godot/imported/button_hover.png-996739c2189bc0e639692125baaa34a9.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/ui-components/button_hover.png"
+dest_files=["res://.godot/imported/button_hover.png-996739c2189bc0e639692125baaa34a9.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
diff --git a/assets/ui-components/button_pressed.png b/assets/ui-components/button_pressed.png
new file mode 100644 (file)
index 0000000..2a349a3
Binary files /dev/null and b/assets/ui-components/button_pressed.png differ
diff --git a/assets/ui-components/button_pressed.png.import b/assets/ui-components/button_pressed.png.import
new file mode 100644 (file)
index 0000000..ae3a39c
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://d23kb25ypnr3m"
+path="res://.godot/imported/button_pressed.png-3897d488bb0c8223a4047b37eacc63e1.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/ui-components/button_pressed.png"
+dest_files=["res://.godot/imported/button_pressed.png-3897d488bb0c8223a4047b37eacc63e1.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
diff --git a/assets/ui-components/logo_routes&roots.png b/assets/ui-components/logo_routes&roots.png
new file mode 100644 (file)
index 0000000..bf64854
Binary files /dev/null and b/assets/ui-components/logo_routes&roots.png differ
diff --git a/assets/ui-components/logo_routes&roots.png.import b/assets/ui-components/logo_routes&roots.png.import
new file mode 100644 (file)
index 0000000..4e81647
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cm6jp47f1d4cl"
+path="res://.godot/imported/logo_routes&roots.png-60c5823c21b62f53c57f0b01742572ec.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/ui-components/logo_routes&roots.png"
+dest_files=["res://.godot/imported/logo_routes&roots.png-60c5823c21b62f53c57f0b01742572ec.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
diff --git a/assets/vertical_divisor.png b/assets/vertical_divisor.png
new file mode 100644 (file)
index 0000000..0d6d29d
Binary files /dev/null and b/assets/vertical_divisor.png differ
diff --git a/assets/vertical_divisor.png.import b/assets/vertical_divisor.png.import
new file mode 100644 (file)
index 0000000..8ab463d
--- /dev/null
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://b3u2jhhvyo8ss"
+path="res://.godot/imported/vertical_divisor.png-5d26877459d1d6145b721ec00eea2c92.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/vertical_divisor.png"
+dest_files=["res://.godot/imported/vertical_divisor.png-5d26877459d1d6145b721ec00eea2c92.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
diff --git a/components/button/MainButton.tres b/components/button/MainButton.tres
new file mode 100644 (file)
index 0000000..7342677
--- /dev/null
@@ -0,0 +1,10 @@
+[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://m4kfq5fl0mex"]
+
+[ext_resource type="Texture2D" uid="uid://dincbtrehm6ha" path="res://assets/ui-components/button.png" id="1_5nktv"]
+
+[resource]
+texture = ExtResource("1_5nktv")
+texture_margin_left = 80.0
+texture_margin_top = 80.0
+texture_margin_right = 80.0
+texture_margin_bottom = 80.0
diff --git a/components/button/MainButton.tscn b/components/button/MainButton.tscn
new file mode 100644 (file)
index 0000000..c2ca709
--- /dev/null
@@ -0,0 +1,18 @@
+[gd_scene load_steps=2 format=3 uid="uid://c3uole0l14mxh"]
+
+[ext_resource type="Theme" uid="uid://c2kdv11t73232" path="res://MainTheme.tres" id="1_8jeht"]
+
+[node name="MainButton" type="Button"]
+anchors_preset = -1
+anchor_left = -0.108
+anchor_top = -0.044
+anchor_right = 0.285
+anchor_bottom = 0.179
+offset_left = -0.639999
+offset_top = 0.520004
+offset_right = -355.2
+offset_bottom = -40.32
+grow_horizontal = 2
+grow_vertical = 2
+theme = ExtResource("1_8jeht")
+text = "Button"
diff --git a/components/button/MainButtonHover.tres b/components/button/MainButtonHover.tres
new file mode 100644 (file)
index 0000000..d941cf9
--- /dev/null
@@ -0,0 +1,10 @@
+[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://bac76g4px5500"]
+
+[ext_resource type="Texture2D" uid="uid://dwux4h043hvnu" path="res://assets/ui-components/button_hover.png" id="1_xwqyt"]
+
+[resource]
+texture = ExtResource("1_xwqyt")
+texture_margin_left = 80.0
+texture_margin_top = 80.0
+texture_margin_right = 80.0
+texture_margin_bottom = 80.0
diff --git a/components/button/MainButtonPressed.tres b/components/button/MainButtonPressed.tres
new file mode 100644 (file)
index 0000000..75ebdb0
--- /dev/null
@@ -0,0 +1,10 @@
+[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://cqjnn1fveqsfw"]
+
+[ext_resource type="Texture2D" uid="uid://d23kb25ypnr3m" path="res://assets/ui-components/button_pressed.png" id="1_38wj4"]
+
+[resource]
+texture = ExtResource("1_38wj4")
+texture_margin_left = 80.0
+texture_margin_top = 80.0
+texture_margin_right = 80.0
+texture_margin_bottom = 80.0
diff --git a/examples/label_font_auto_sizer/Anta-Regular.ttf b/examples/label_font_auto_sizer/Anta-Regular.ttf
new file mode 100644 (file)
index 0000000..7efc950
Binary files /dev/null and b/examples/label_font_auto_sizer/Anta-Regular.ttf differ
diff --git a/examples/label_font_auto_sizer/Anta-Regular.ttf.import b/examples/label_font_auto_sizer/Anta-Regular.ttf.import
new file mode 100644 (file)
index 0000000..3c7a86a
--- /dev/null
@@ -0,0 +1,39 @@
+[remap]
+
+importer="font_data_dynamic"
+type="FontFile"
+uid="uid://cxqub0sfewm4v"
+path="res://.godot/imported/Anta-Regular.ttf-38f518770960793af8af4211d3fdb2dc.fontdata"
+
+[deps]
+
+source_file="res://examples/label_font_auto_sizer/Anta-Regular.ttf"
+dest_files=["res://.godot/imported/Anta-Regular.ttf-38f518770960793af8af4211d3fdb2dc.fontdata"]
+
+[params]
+
+Rendering=null
+antialiasing=1
+generate_mipmaps=false
+disable_embedded_bitmaps=true
+multichannel_signed_distance_field=false
+msdf_pixel_range=8
+msdf_size=48
+allow_system_fallback=true
+force_autohinter=false
+hinting=1
+subpixel_positioning=1
+oversampling=0.0
+Fallbacks=null
+fallbacks=[]
+Compress=null
+compress=true
+preload=[{
+"chars": [],
+"glyphs": [],
+"name": "New Configuration",
+"size": Vector2i(16, 0)
+}]
+language_support={}
+script_support={}
+opentype_features={}
diff --git a/examples/label_font_auto_sizer/OFL.txt b/examples/label_font_auto_sizer/OFL.txt
new file mode 100644 (file)
index 0000000..07dd184
--- /dev/null
@@ -0,0 +1,93 @@
+Copyright 2019 The Anta Project Authors (https://github.com/Typedesigners/Anta-Regular)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded, 
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/examples/label_font_auto_sizer/demo_label_settings.tres b/examples/label_font_auto_sizer/demo_label_settings.tres
new file mode 100644 (file)
index 0000000..c46161c
--- /dev/null
@@ -0,0 +1,4 @@
+[gd_resource type="LabelSettings" format=3 uid="uid://cbwybvdywcpgh"]
+
+[resource]
+font_size = 50
diff --git a/examples/label_font_auto_sizer/demo_label_theme.tres b/examples/label_font_auto_sizer/demo_label_theme.tres
new file mode 100644 (file)
index 0000000..b5489c2
--- /dev/null
@@ -0,0 +1,25 @@
+[gd_resource type="Theme" load_steps=3 format=3 uid="uid://cifdhwluyikjx"]
+
+[ext_resource type="FontFile" uid="uid://cxqub0sfewm4v" path="res://examples/label_font_auto_sizer/Anta-Regular.ttf" id="1_6bocj"]
+
+[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mkad4"]
+bg_color = Color(0.027451, 0.0196078, 0.0196078, 1)
+border_width_left = 5
+border_width_top = 5
+border_width_right = 5
+border_width_bottom = 5
+border_color = Color(0.647059, 0.647059, 0.647059, 1)
+corner_radius_top_left = 3
+corner_radius_top_right = 3
+corner_radius_bottom_right = 3
+corner_radius_bottom_left = 3
+shadow_color = Color(0.188235, 0.188235, 0.188235, 0.6)
+shadow_size = 9
+anti_aliasing = false
+
+[resource]
+Label/font_sizes/font_size = 36
+Label/fonts/font = ExtResource("1_6bocj")
+Label/styles/normal = SubResource("StyleBoxFlat_mkad4")
+RichTextLabel/font_sizes/normal_font_size = 36
+RichTextLabel/fonts/normal_font = ExtResource("1_6bocj")
diff --git a/examples/label_font_auto_sizer/in_editor_demo.tscn b/examples/label_font_auto_sizer/in_editor_demo.tscn
new file mode 100644 (file)
index 0000000..45ebe16
--- /dev/null
@@ -0,0 +1,100 @@
+[gd_scene load_steps=4 format=3 uid="uid://dm1ajn5egucid"]
+
+[ext_resource type="Theme" uid="uid://cifdhwluyikjx" path="res://examples/label_font_auto_sizer/demo_label_theme.tres" id="1_5kqak"]
+[ext_resource type="Script" path="res://addons/label_font_auto_sizer/label_auto_sizer.gd" id="2_gbljs"]
+[ext_resource type="Script" path="res://addons/label_font_auto_sizer/rich_label_auto_sizer.gd" id="3_h5141"]
+
+[node name="InEditorDemo" type="Control"]
+layout_mode = 3
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+metadata/_edit_lock_ = true
+
+[node name="BKG" type="ColorRect" parent="."]
+layout_mode = 1
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+color = Color(0.0605303, 0.0605304, 0.0605303, 1)
+metadata/_edit_lock_ = true
+
+[node name="LabelWithScript" type="Label" parent="."]
+layout_mode = 1
+anchors_preset = 8
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+offset_left = -547.0
+offset_top = 80.0
+offset_right = -58.0
+offset_bottom = 284.0
+grow_horizontal = 2
+grow_vertical = 2
+theme = ExtResource("1_5kqak")
+theme_override_font_sizes/font_size = 40
+text = "Label with autosize. Try resizing this!"
+horizontal_alignment = 1
+vertical_alignment = 1
+autowrap_mode = 3
+clip_text = true
+script = ExtResource("2_gbljs")
+_max_steps = 10
+_size_just_modified_by_autosizer = false
+_set_defaults = true
+_base_font_size = 40
+_current_font_size = 40
+_last_size_state = 1
+
+[node name="LabelNoScript" type="Label" parent="."]
+layout_mode = 1
+anchors_preset = 8
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+offset_left = 51.0
+offset_top = 80.0
+offset_right = 540.0
+offset_bottom = 284.0
+grow_horizontal = 2
+grow_vertical = 2
+theme = ExtResource("1_5kqak")
+theme_override_font_sizes/font_size = 40
+text = "Label with no script. You can try and resize this as well :)"
+horizontal_alignment = 1
+vertical_alignment = 1
+autowrap_mode = 3
+clip_text = true
+
+[node name="RichTextLabel" type="RichTextLabel" parent="."]
+layout_mode = 1
+anchors_preset = 8
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+offset_left = -540.0
+offset_top = -267.0
+offset_right = 540.0
+offset_bottom = 24.0
+grow_horizontal = 2
+grow_vertical = 2
+pivot_offset = Vector2(540, 165)
+theme = ExtResource("1_5kqak")
+theme_override_font_sizes/normal_font_size = 46
+text = "This is a RichTextLabel, the line count methods work are wonky, but calculating the height of the text content against the height of the rect helps us achieve the same result! Try resizing and/or editing the text!"
+scroll_active = false
+shortcut_keys_enabled = false
+script = ExtResource("3_h5141")
+_max_steps = 16
+_size_just_modified_by_autosizer = false
+_set_defaults = true
+_base_font_size = 46
+_current_font_size = 46
+_last_size_state = 1
diff --git a/examples/label_font_auto_sizer/play_scene_demo.tscn b/examples/label_font_auto_sizer/play_scene_demo.tscn
new file mode 100644 (file)
index 0000000..aa1ca29
--- /dev/null
@@ -0,0 +1,246 @@
+[gd_scene load_steps=8 format=3 uid="uid://cqk1bel28xqov"]
+
+[ext_resource type="FontFile" uid="uid://cxqub0sfewm4v" path="res://examples/label_font_auto_sizer/Anta-Regular.ttf" id="1_wd48m"]
+[ext_resource type="Theme" uid="uid://cifdhwluyikjx" path="res://examples/label_font_auto_sizer/demo_label_theme.tres" id="2_x0fsq"]
+[ext_resource type="Script" path="res://addons/label_font_auto_sizer/label_auto_sizer.gd" id="3_bwkhl"]
+[ext_resource type="Script" path="res://demo/set_numbers_button.gd" id="4_hu8nr"]
+
+[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mh8qh"]
+bg_color = Color(0.8, 0.8, 0.8, 1)
+border_width_left = 5
+border_width_top = 5
+border_width_right = 5
+border_width_bottom = 5
+border_color = Color(0, 0, 0, 1)
+corner_radius_top_left = 3
+corner_radius_top_right = 3
+corner_radius_bottom_right = 3
+corner_radius_bottom_left = 3
+shadow_size = 6
+shadow_offset = Vector2(5, 5)
+anti_aliasing = false
+
+[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pkevp"]
+bg_color = Color(0.8, 0.8, 0.8, 1)
+border_width_left = 5
+border_width_top = 5
+border_width_right = 5
+border_width_bottom = 5
+border_color = Color(1, 1, 1, 1)
+corner_radius_top_left = 3
+corner_radius_top_right = 3
+corner_radius_bottom_right = 3
+corner_radius_bottom_left = 3
+shadow_size = 6
+shadow_offset = Vector2(5, 5)
+anti_aliasing = false
+
+[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5mxln"]
+bg_color = Color(1, 1, 1, 1)
+border_width_left = 5
+border_width_top = 5
+border_width_right = 5
+border_width_bottom = 5
+border_color = Color(1, 1, 1, 1)
+corner_radius_top_left = 3
+corner_radius_top_right = 3
+corner_radius_bottom_right = 3
+corner_radius_bottom_left = 3
+shadow_size = 6
+shadow_offset = Vector2(5, 5)
+anti_aliasing = false
+
+[node name="PlaySceneDemo" type="Control"]
+layout_mode = 3
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+metadata/_edit_lock_ = true
+
+[node name="BKG2" type="ColorRect" parent="."]
+layout_mode = 1
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+color = Color(0.0588235, 0.0588235, 0.0588235, 1)
+metadata/_edit_lock_ = true
+
+[node name="Enabled" type="Label" parent="."]
+layout_mode = 0
+offset_left = 33.0
+offset_top = 60.0
+offset_right = 609.0
+offset_bottom = 134.0
+theme_override_fonts/font = ExtResource("1_wd48m")
+theme_override_font_sizes/font_size = 56
+text = "Auto Sizer Enabled"
+horizontal_alignment = 1
+vertical_alignment = 1
+
+[node name="Disabled" type="Label" parent="."]
+layout_mode = 0
+offset_left = 674.0
+offset_top = 60.0
+offset_right = 1250.0
+offset_bottom = 134.0
+theme_override_fonts/font = ExtResource("1_wd48m")
+theme_override_font_sizes/font_size = 56
+text = "Auto Sizer Disabled"
+horizontal_alignment = 1
+vertical_alignment = 1
+
+[node name="LabelWithScript" type="Label" parent="."]
+layout_mode = 1
+anchors_preset = 8
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+offset_left = -504.0
+offset_top = -170.0
+offset_right = -132.0
+offset_bottom = -74.0
+grow_horizontal = 2
+grow_vertical = 2
+theme = ExtResource("2_x0fsq")
+theme_override_font_sizes/font_size = 36
+text = "Label with script"
+horizontal_alignment = 1
+vertical_alignment = 1
+autowrap_mode = 3
+clip_text = true
+script = ExtResource("3_bwkhl")
+_size_just_modified_by_autosizer = false
+_set_defaults = true
+_base_font_size = 36
+_current_font_size = 36
+_last_size_state = 1
+
+[node name="LabelWithScript2" type="Label" parent="."]
+layout_mode = 1
+anchors_preset = 8
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+offset_left = -540.0
+offset_top = -7.0
+offset_right = -98.0
+offset_bottom = 157.0
+grow_horizontal = 2
+grow_vertical = 2
+theme = ExtResource("2_x0fsq")
+theme_override_font_sizes/font_size = 36
+text = "Label with script"
+horizontal_alignment = 1
+vertical_alignment = 1
+autowrap_mode = 3
+clip_text = true
+script = ExtResource("3_bwkhl")
+_max_steps = 10
+_size_just_modified_by_autosizer = false
+_set_defaults = true
+_base_font_size = 36
+_current_font_size = 36
+_last_size_state = 1
+
+[node name="LabelNoScript" type="Label" parent="."]
+layout_mode = 1
+anchors_preset = 8
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+offset_left = 135.0
+offset_top = -170.0
+offset_right = 507.0
+offset_bottom = -76.0
+grow_horizontal = 2
+grow_vertical = 2
+theme = ExtResource("2_x0fsq")
+text = "Label with no script"
+horizontal_alignment = 1
+vertical_alignment = 1
+autowrap_mode = 3
+clip_text = true
+
+[node name="LabelNoScript2" type="Label" parent="."]
+layout_mode = 1
+anchors_preset = 8
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+offset_left = 100.0
+offset_top = -7.0
+offset_right = 542.0
+offset_bottom = 157.0
+grow_horizontal = 2
+grow_vertical = 2
+theme = ExtResource("2_x0fsq")
+text = "Label with no script"
+horizontal_alignment = 1
+vertical_alignment = 1
+autowrap_mode = 3
+clip_text = true
+
+[node name="AddButton" type="Button" parent="." node_paths=PackedStringArray("_labels")]
+layout_mode = 0
+offset_left = 310.0
+offset_top = 594.0
+offset_right = 613.0
+offset_bottom = 666.0
+theme_override_colors/font_color = Color(0, 0, 0, 1)
+theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
+theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
+theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
+theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
+theme_override_colors/font_disabled_color = Color(0, 0, 0, 1)
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_normal_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_pressed_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_hover_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_hover_pressed_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_focus_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_disabled_color = Color(0, 0, 0, 1)
+theme_override_font_sizes/font_size = 32
+theme_override_styles/normal = SubResource("StyleBoxFlat_mh8qh")
+theme_override_styles/hover = SubResource("StyleBoxFlat_pkevp")
+theme_override_styles/pressed = SubResource("StyleBoxFlat_5mxln")
+text = "ADD NUMBERS"
+script = ExtResource("4_hu8nr")
+_labels = [NodePath("../LabelNoScript"), NodePath("../LabelWithScript"), NodePath("../LabelWithScript2"), NodePath("../LabelNoScript2")]
+
+[node name="DeleteButton" type="Button" parent="." node_paths=PackedStringArray("_labels")]
+layout_mode = 0
+offset_left = 669.0
+offset_top = 594.0
+offset_right = 972.0
+offset_bottom = 666.0
+theme_override_colors/font_color = Color(0, 0, 0, 1)
+theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
+theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
+theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
+theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
+theme_override_colors/font_disabled_color = Color(0, 0, 0, 1)
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_normal_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_pressed_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_hover_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_hover_pressed_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_focus_color = Color(0, 0, 0, 1)
+theme_override_colors/icon_disabled_color = Color(0, 0, 0, 1)
+theme_override_font_sizes/font_size = 32
+theme_override_styles/normal = SubResource("StyleBoxFlat_mh8qh")
+theme_override_styles/hover = SubResource("StyleBoxFlat_pkevp")
+theme_override_styles/pressed = SubResource("StyleBoxFlat_5mxln")
+text = "DELETE NUMBERS"
+script = ExtResource("4_hu8nr")
+_labels = [NodePath("../LabelNoScript"), NodePath("../LabelWithScript"), NodePath("../LabelWithScript2"), NodePath("../LabelNoScript2")]
+
+[connection signal="pressed" from="AddButton" to="AddButton" method="_on_button_clicked" binds= [true]]
+[connection signal="pressed" from="DeleteButton" to="DeleteButton" method="_on_button_clicked" binds= [false]]
diff --git a/examples/label_font_auto_sizer/set_numbers_button.gd b/examples/label_font_auto_sizer/set_numbers_button.gd
new file mode 100644 (file)
index 0000000..64b4a42
--- /dev/null
@@ -0,0 +1,22 @@
+extends Button
+
+@export var _labels: Array[Label]
+
+static var added_numbers: Array[int]= []
+
+func _on_button_clicked(_adds_number : bool):
+       if _adds_number:
+               var random_num = randi_range(0, 100)
+               added_numbers.append(random_num)  # Add the random number to the list
+       else:
+               if added_numbers.size() > 0:
+                       added_numbers.remove_at(added_numbers.size() - 1)
+       update_labels()
+
+
+func update_labels() -> void:
+       for label in _labels:
+               label.text = ""
+               for num in added_numbers:
+                       label.text += str(num) + " "
+
diff --git a/examples/licenses/README.md b/examples/licenses/README.md
new file mode 100644 (file)
index 0000000..97f8ceb
--- /dev/null
@@ -0,0 +1,526 @@
+# Godot Addons
+
+Download [here](https://github.com/kenyoni-software/godot-addons/releases/tag/latest).
+
+## License
+
+[MIT License](./LICENSE.md)
+
+## Overview
+
+### Nodes
+
+- [AspectRatioResizeContainer](#aspectratioresizecontainer)  
+  Extension of `AspectRatioContainer` to update it's own size.
+- [TextureButtonColored](#texturebuttoncolored)  
+  Extension of `TextureButton` with color options.
+- [Logging](#logging)  
+  Simple logger.
+- [QR Code](#qr-code)  
+  QRCodeRect and QR Code generation.
+
+### Tools
+
+- [Git SHA Project Setting](#git-sha-project-setting)  
+  Add Git SHA as project setting.
+- [Hide Private Properties](#hide-private-properties)  
+  Hide private properties of instantiated child scenes.
+- [Icons Patcher](#icons-patcher)  
+  Patch Pictogrammers icons to white.
+- [License Manager](#license-manager)  
+  Manage license and copyright for third party graphics, software or libraries.
+
+### Utility
+
+- [Custom Theme Overrides](#custom-theme-overrides)  
+  Utility to provide custom theme overrides for any node.
+
+---
+
+## AspectRatioResizeContainer
+
+The `AspectRatioContainer` allows his own size to be smaller than the children, which causes neighboring UI elements to be covered.
+This new node type will extend the existing `AspectRatioContainer` and update it's own minimum size based on the children.
+This works except for `STRETCH_MODE_COVER`.
+
+You are also not able to use the property `custom_minimum_size` anymore as it is used to set the minimum size.
+
+### Compatibility
+
+- Godot 4.2
+
+### Example
+
+[examples/aspect_ratio_resize_container](./examples/aspect_ratio_resize_container)
+
+### Changelog
+
+#### 3.1.0
+
+- Require Godot 4.2
+- Add more values to plugin.cfg
+- Add static typing in for loops
+
+---
+
+## Custom Theme Overrides
+
+Utility to make custom theme overrides for any node possible.
+
+This plugin will auto register (via `class_name`) the class `CustomThemeOverrides`.
+
+You should not use `@export` on your custom theme variables, as they will be exported with the `_get_property_list` method. Also setter and getter will not be called inside the editor.
+
+If everything is set up, your theme override variables can be handled like every other theme override property.
+
+### Compatibility
+
+- Godot 4.2
+
+### Screenshot
+
+![Custom theme overrides screenshot](./doc/custom_theme_overrides.png "Custom Theme Overrides")
+
+### Example
+
+```gdscript
+# declare the members
+# DO NOT
+# - use @export
+# - use setter and getter, they are NOT called in the editor
+# - access these variables directly
+var my_font_color: Color
+var my_border_size: int
+var my_font: Font
+var my_font_size: int
+var my_icon: Texture2D
+var my_style_box: StyleBox
+
+# declare the custom theme overrides, use the member name and the theme data type.
+var _theme_overrides = CustomThemeOverrides.new([
+       ["my_font_color", Theme.DATA_TYPE_COLOR],
+       ["my_border_size", Theme.DATA_TYPE_CONSTANT],
+       ["my_font", Theme.DATA_TYPE_FONT],
+       ["my_font_size", Theme.DATA_TYPE_FONT_SIZE],
+       ["my_icon", Theme.DATA_TYPE_ICON],
+       ["my_style_box", Theme.DATA_TYPE_STYLEBOX]
+])
+
+# required, if you have other properties use append_array
+func _get_property_list() -> Array[Dictionary]:
+       return self._theme_overrides.theme_property_list(self)
+
+# optional: if you want to use the revert function
+func _property_can_revert(property: StringName) -> bool:
+       return self._theme_overrides.can_revert(property)
+
+# optional: if you want to use the revert function, return null
+func _property_get_revert(_property: StringName) -> Variant:
+       return null
+```
+
+[examples/custom_theme_overrides](./examples/custom_theme_overrides)
+
+### Changelog
+
+#### 1.1.0
+
+- Require Godot 4.2
+- Add more values to plugin.cfg
+- Add static typing in for loops
+
+---
+
+## Git SHA Project Setting
+
+Previously named `Metadata`.
+
+Adds the project setting `application/config/git_sha`, which contains the current Git SHA.
+This one is automatically set and updated when you run any scene or on exporting the project. The git_sha will **not** be kept in `project.godot` to not clutter any version control system. It will be removed from the settings on closing the Godot Editor.
+
+### Compatibility
+
+- Godot 4.2
+
+### Example
+
+[examples/metadata](./examples/metadata)
+
+### Changelog
+
+#### 2.1.0
+
+- Require Godot 4.2
+- Add more values to plugin.cfg
+
+#### 2.0.0
+
+- Added an initial Git SHA load on opening the project.
+- Removed `application/config/version`, there was no need that this was part of the addon. The value can still be added manually.
+
+---
+
+## Hide Private Properties
+
+Private members (names starting with an underscore) should not be exposed.
+
+This plugin will hide exported private properties in the inspector for instantiated child scenes.
+
+### Compatibility
+
+- Godot 4.2
+
+### Example
+
+[examples/hide_private_properties](./examples/hide_private_properties)
+
+### Changelog
+
+#### 1.1.0
+
+- Require Godot 4.2
+- Add more values to plugin.cfg
+
+---
+
+## Icons Patcher
+
+If you use Material Design icons from [Pictogrammers](https://pictogrammers.com/library/mdi/), they come without any fill color, automatically rendered black. This is not a convenient color as it makes it impossible to modulate the color. The icon patcher provides a utility to automatically patch the icons to white color.
+
+Set the icon directory in the Project Settings under the menu `Plugins` -> `Icons Patcher`.
+
+Then use `Project` -> `Tools` -> `Icons Patcher` to patch the icons.
+
+### Compatibility
+
+- Godot 4.2
+
+### Changelog
+
+#### 1.3.0
+
+- Require Godot 4.2
+- Add more values to plugin.cfg
+
+#### 1.2.0
+
+- Added automatic file reimporting.
+
+---
+
+## License Manager
+
+Manage license and copyright for third party graphics, software or libraries.
+Group them into categories, add descriptions or web links.
+
+The data is stored inside a json file. This file is automatically added to the export, you do not need to add it yourself. If you provide license files instead of a text, they are also exported.
+
+If you add paths to license data, it will be automatically adjusted if you rename a file or folder inside the editor.
+
+You can change the project license file either with a button at the upper right, in the license menu. Or inside the project settings under the menu `Plugins` -> `Licenses`.
+
+### Compatibility
+
+- Godot 4.2
+
+### Screenshot
+
+![license manager screenshot](./doc/license_manager.png "License Manager")
+
+### Example
+
+[examples/licenses](./examples/licenses)
+
+### Classes & Functions
+
+**Licenses** - [`addons/licenses/licenses.gd`](./addons/licenses/licenses.gd)
+
+General class, providing among other things static functions to save and load licenses.
+
+**Component** - [`addons/licenses/component.gd`](./addons/licenses/component.gd)
+
+Component class, data wrapper for all  information regarding one license item.
+
+**Component.License** - [`addons/licenses/component.gd`](./addons/licenses/component.gd)
+
+License class.
+
+### Changelog
+
+#### 1.7.0
+
+- Add renaming of paths when a file or folder gets renamed inside the editor
+- Add right click menu to duplicate or delete items
+
+#### 1.6.1
+
+- Workaround show engine components, calling static function is bugged
+
+#### 1.6.0
+
+- Require Godot 4.2
+- Add more values to plugin.cfg
+- Add static typing in for loops
+- Use static sorting function as lambda
+
+#### 1.5.0
+
+- Removed overriden engine methods
+- Creating a plugin component will now add the plugin path to paths
+- Fix dragging/ double click crash
+- Fix overriding project license file if another license file is loaded
+- Add warning tooltip if a component paths does not exist
+
+---
+
+## Logging
+
+Simple logger. An autoload `GLogging` will be created at installation.
+Logging methods support formatting, values wont be stringified if they are not logged.
+
+Logging into a file is not supported yet. The output will be always done via print.
+
+
+### Compatibility
+
+- Godot 4.2
+
+### Example
+
+```
+2023-07-04 15:57:16.242 [    INFO] [      root] ready and initialize GUI
+2023-07-04 15:57:16.242 [    INFO] [      root] initialized logger root and other
+2023-07-04 15:57:18.300 [   DEBUG] [      root] Demo Text!
+2023-07-04 15:57:20.452 [    INFO] [      root] Demo Text!
+2023-07-04 15:57:22.071 [ WARNING] [      root] Demo Text!
+2023-07-04 15:57:24.606 [   ERROR] [      root] Demo Text!
+2023-07-04 15:57:28.793 [CRITICAL] [      root] Demo Text!
+2023-07-04 15:57:37.483 [    INFO] [   network] Demo Text!
+2023-07-04 15:57:50.843 [    INFO] [       gui] Demo Text!
+```
+
+[examples/glogging](./examples/glogging)
+
+### Classes & Functions
+
+**GLogging** - [`addons/glogging/glogging.gd`](./addons/glogging/glogging.gd)
+
+Logging base class. Provides helper methods.
+
+- `root_logger: Logger`  
+  root logger object
+- `debug(message: Variant, values: Array[Variant] = []) -> void`  
+  log with root logger at debug level
+- `info(message: Variant, values: Array[Variant] = []) -> void`  
+  log with root logger at info level
+- `warning(message: Variant, values: Array[Variant] = []) -> void`  
+  log with root logger at warning level, will also display a debug warning
+- `error(message: Variant, values: Array[Variant] = []) -> void`  
+  log with root logger at error level, will also display a debug error
+- `critical(message: Variant, values: Array[Variant] = []) -> void`  
+  log with root logger at critical level
+- `log(level: int, message: Variant, values: Array[Variant] = []) -> void`  
+  log at custom level
+
+**GLogging.Logger** - [`addons/glogging/glogging.gd`](./addons/glogging/glogging.gd)
+
+Logger class.
+If not log level is set, the log level of the parent logger will be used.
+
+- `create_child(module_name: String, log_level: int = LEVEL_NOTSET) -> Logger`  
+  create a child logger
+- `set_log_level(level: int) -> void`  
+  set the log level
+- `log_level() -> int`  
+  get log level
+- `debug(message: Variant, values: Array[Variant] = []) -> void`  
+  log at debug level
+- `info(message: Variant, values: Array[Variant] = []) -> void`  
+  log at info level
+- `warning(message: Variant, values: Array[Variant] = []) -> void`  
+  log at warning level, will also display a debug warning
+- `error(message: Variant, values: Array[Variant] = []) -> void`  
+  log at error level, will also display a debug error
+- `critical(message: Variant, values: Array[Variant] = []) -> void`  
+  log at critical level
+- `log(level: int, message: Variant, values: Array[Variant] = []) -> void`  
+  log at custom level
+
+### Changelog
+
+#### 1.5.0
+
+- Require Godot 4.2
+- Add more values to plugin.cfg
+
+---
+
+## QR Code
+
+QR Code generation either with the included `QRCodeRect` node or use the encoding result of the `QRCode` class.
+
+### Compatibility
+
+- Godot 4.2
+
+### Screenshot
+
+![QRCodeRect node inspector screenshot](./doc/qr_code.png "QRCodeRect in inspector")
+
+### Example
+
+[examples/qr_code](./examples/qr_code)
+
+### Classes & Functions
+
+**QRCodeRect** - [`addons/qr_code/qr_code_rect.gd`](./addons/qr_code/qr_code_rect.gd)
+
+`TextureRect` like node. The texture is updated by itself.
+When using byte encoding you can also pass strings for specific ECI values (ISO 8859-1, Shift JIS, UTF-8, UTF-16, US ASCII), the input string will be automatically converted to an byte array.
+
+#### Properties
+
+- `mode: QRCode.Mode`
+- `error_correction: QRCode.ErrorCorrection`
+- `use_eci: bool`  
+  Use Extended Channel Interpretation (ECI)
+- `eci_value: int`  
+  Extended Channel Interpretation (ECI) Value
+- `data: Variant`  
+  Type varies based on the encoding mode.
+- `auto_version: bool`  
+  Use automatically the smallest QR Code version.
+- `version: int`
+- `auto_mask_pattern: bool`  
+  Use automatically the best mask pattern.
+- `mask_pattern: int`
+- `light_module_color: Color`
+- `dark_module_color: Color`
+- `auto_module_px_size: bool`  
+  Automatically set the module pixel size based on the size.  
+  Do not use expand mode KEEP_SIZE when using it.  
+  Turn this off when the QR Code changes or is resized often, as it impacts the performance quite heavily.
+- `module_px_size: int`  
+  Use that many pixel for one module.
+- `quiet_zone_size: int`  
+  Use that many modules for the quiet zone. A value of 4 is recommended.
+
+**QRCode** - [`addons/qr_code/qr_code.gd`](./addons/qr_code/qr_code.gd)
+
+QRCode class to generate QR Codes.
+
+#### Enums
+
+- `Mode`  
+  Encoding mode enum.
+  - `NUMERIC = 1`
+  - `ALPHANUMERIC = 2`
+  - `BYTE = 4`
+  - `KANJI = 8`
+- `ErrorCorrection`  
+  Error correction enum.
+  - `LOW = 1`
+  - `MEDIUM = 0`
+  - `QUARTILE = 3`
+  - `HIGH = 2`
+- `ECI`  
+  Extended Channel Interpretation enum. Provides some values by name.
+
+#### Properties
+
+- `mode: Mode`
+- `error_correction: ErrorCorrection`
+- `use_eci: bool`  
+  Use Extended Channel Interpretation (ECI)
+- `eci_value: int`  
+  Extended Channel Interpretation (ECI) Value
+- `auto_version: bool`  
+  Use automatically the smallest QR Code version.
+- `version: int`
+- `auto_mask_pattern: bool`  
+  Use automatically the best mask pattern.
+- `mask_pattern: int`
+
+#### Methods
+
+- `get_module_count() -> int`  
+  Get the module count per side.
+- `calc_min_version() -> int`  
+  Get the minimal version required to encode the data.
+- `generate_image(module_px_size: int = 1, light_module_color: Color = Color.WHITE, dark_module_color: Color = Color.BLACK) -> Image`  
+  Generate an image. This method can be called repeatedly, as encoding will only happens once and be cached.
+- `put_numeric(number: String) -> void`  
+  Put a numeric text as data. Invalid characters are removed. Will change the encoding mode to `Mode.NUMERIC`.
+- `put_alphanumeric(text: String) -> void`  
+  Put a alphanumeric text as data. Invalid characters are removed. Will change the encoding mode to `Mode.ALPHANUMERIC`.
+- `put_byte(data: PackedByteArray) -> void`  
+  Put a byte data. Will change the encoding mode to `Mode.BYTE`.
+- `put_numeric(number: String) -> void`  
+  Put a numeric text as data. Invalid characters are removed. Will change the encoding mode to `Mode.KANJI`.
+- `encode() -> PackedByteArray`  
+  Get the QR Code row by row in one array. To get the row size use `get_module_count`.
+
+**ShiftJIS** - [`addons/qr_code/shift_jis.gd`](./addons/qr_code/shift_jis.gd)
+
+Shift JIS encoding utility.
+
+### Functions
+
+- `static func to_shift_jis_2004_buffer(text: String) -> PackedByteArray`
+- `static func get_string_from_shift_jis_2004(arr: PackedByteArray) -> String`
+- `static func to_jis_8_buffer(text: String) -> PackedByteArray`
+- `static func get_string_from_jis_8(arr: PackedByteArray) -> String`
+
+### Changelog
+
+#### 1.1.0
+
+- Require Godot 4.2
+- Add more values to plugin.cfg
+- Add static typing in for loops
+
+#### 1.0.0
+
+- Renamed `get_string_from_jis_2004` to `get_string_from_shift_jis_2004`
+
+#### 0.3.1
+
+- Improve inspector properties
+- Improve input handling of byte data based on ECI usage
+
+#### 0.3.0
+
+- Make ECI value optional
+
+#### 0.2.0
+
+- Added quiet zone size property
+
+---
+
+## TextureButtonColored
+
+Let you apply the icon color theme properties for the texture button. Uses `self_modulate`.
+
+### Compatibility
+
+- Godot 4.2
+
+### Dependencies
+
+- [Custom Theme Overrides](#custom-theme-overrides)
+
+### Example
+
+[examples/texture_button_colored](./examples/texture_button_colored)
+
+### Changelog
+
+#### 1.3.0
+
+- Require Godot 4.2
+- Add more values to plugin.cfg
+
+#### 1.2.3
+
+- Rename method `get_theme_color` to `get_theme_coloring`, this function was never called by the engine anyway and should not be overridden
diff --git a/examples/licenses/license_container.gd b/examples/licenses/license_container.gd
new file mode 100644 (file)
index 0000000..f905f1a
--- /dev/null
@@ -0,0 +1,27 @@
+extends MarginContainer
+
+const Component := preload("res://addons/licenses/component.gd")
+
+@export_node_path("Label") var _name_path; @onready var _name: Label = self.get_node(_name_path)
+@export_node_path("Label") var _version_path; @onready var _version: Label = self.get_node(_version_path)
+@export_node_path("RichTextLabel") var _description_path; @onready var _description: RichTextLabel = self.get_node(_description_path)
+@export_node_path("RichTextLabel") var _contact_path; @onready var _contact: RichTextLabel = self.get_node(_contact_path)
+@export_node_path("RichTextLabel") var _web_path; @onready var _web: RichTextLabel = self.get_node(_web_path)
+@export_node_path("RichTextLabel") var _license_path; @onready var _license: RichTextLabel = self.get_node(_license_path)
+@export_node_path("RichTextLabel") var _license_text_path; @onready var _license_text: RichTextLabel = self.get_node(_license_text_path)
+
+func set_component(component: Component) -> void:
+    self._name.text = component.name
+    self._version.text = component.version
+    self._description.text = component.description
+    self._contact.text = component.contact
+    self._web.text = component.web
+    self._license.text = ""
+    self._license_text.text = ""
+    for idx in range(len(component.licenses)):
+        var license: Component.License = component.licenses[idx]
+        if idx > 0:
+            self._license.text = self._license.text + " & "
+            self._license_text.text = self._license_text.text + "\n=========================\n"
+        self._license.text = self._license.text + license.name
+        self._license_text.text = self._license_text.text + license.get_license_text()
diff --git a/examples/licenses/license_selector.gd b/examples/licenses/license_selector.gd
new file mode 100644 (file)
index 0000000..013ba00
--- /dev/null
@@ -0,0 +1,52 @@
+extends Tree
+
+const Component := preload("res://addons/licenses/component.gd")
+const Licenses := preload("res://addons/licenses/licenses.gd")
+const LicenseContainer := preload("license_container.gd")
+
+@export_node_path("Node") var _license_container_path; @onready var _license_container: LicenseContainer = self.get_node(_license_container_path)
+
+var licenses: Array[Component] = []
+
+func _ready() -> void:
+    self.item_selected.connect(self._on_item_selected)
+    var res: Licenses.LoadResult = Licenses.load(Licenses.get_license_data_filepath())
+    if res.err_msg != "":
+        return
+    self.licenses = res.components
+    self.licenses.append_array(Licenses.get_required_engine_components())
+    self.licenses.sort_custom(Licenses.new().compare_components_ascending)
+
+    # create items
+    var category_cache: Dictionary = {}
+    var root: TreeItem = self.create_item(null)
+    category_cache[""] = root
+    var idx: int = 0
+
+    while idx < len(self.licenses):
+        var component: Component = self.licenses[idx]
+        self._add_component(component, category_cache, root, idx)
+        idx = idx + 1
+
+func _create_category_item(category_cache: Dictionary, category: String, root: TreeItem) -> TreeItem:
+    if category in category_cache:
+        return category_cache[category]
+    var category_item: TreeItem
+    category_item = self.create_item(root)
+    category_item.set_text(0, category)
+    category_item.set_selectable(0, false)
+    category_cache[category] = category_item
+    return category_item
+
+func _add_tree_item(component: Component, idx: int, parent: TreeItem) -> TreeItem:
+    var item: TreeItem = self.create_item(parent)
+    item.set_text(0, component.name)
+    item.set_meta("idx", idx)
+    return item
+
+func _add_component(component: Component, category_cache: Dictionary, root: TreeItem, idx: int) -> TreeItem:
+    var parent: TreeItem = self._create_category_item(category_cache, component.category, root)
+    return self._add_tree_item(component, idx, parent)
+
+func _on_item_selected() -> void:
+    self._license_container.set_component(self.licenses[self.get_selected().get_meta("idx")])
diff --git a/examples/licenses/licenses.json b/examples/licenses/licenses.json
new file mode 100644 (file)
index 0000000..034426d
--- /dev/null
@@ -0,0 +1 @@
+{"components":[{"category":"Fonts","contact":"","copyright":["2012, Google Inc."],"description":"","id":"noto_sans_font","licenses":[{"file":"","identifier":"","name":"OFL-1.1","text":"PREAMBLE\nThe goals of the Open Font License (OFL) are to stimulate worldwide\ndevelopment of collaborative font projects, to support the font creation\nefforts of academic and linguistic communities, and to provide a free and\nopen framework in which fonts may be shared and improved in partnership\nwith others.\n\nThe OFL allows the licensed fonts to be used, studied, modified and\nredistributed freely as long as they are not sold by themselves. The\nfonts, including any derivative works, can be bundled, embedded,\nredistributed and/or sold with any software provided that any reserved\nnames are not used by derivative works. The fonts and derivatives,\nhowever, cannot be released under any other type of license. The\nrequirement for fonts to remain under this license does not apply\nto any document created using the fonts or their derivatives.\n\nDEFINITIONS\n\"Font Software\" refers to the set of files released by the Copyright\nHolder(s) under this license and clearly marked as such. This may\ninclude source files, build scripts and documentation.\n\n\"Reserved Font Name\" refers to any names specified as such after the\ncopyright statement(s).\n\n\"Original Version\" refers to the collection of Font Software components as\ndistributed by the Copyright Holder(s).\n\n\"Modified Version\" refers to any derivative made by adding to, deleting,\nor substituting -- in part or in whole -- any of the components of the\nOriginal Version, by changing formats or by porting the Font Software to a\nnew environment.\n\n\"Author\" refers to any designer, engineer, programmer, technical\nwriter or other person who contributed to the Font Software.\n\nPERMISSION & CONDITIONS\nPermission is hereby granted, free of charge, to any person obtaining\na copy of the Font Software, to use, study, copy, merge, embed, modify,\nredistribute, and sell modified and unmodified copies of the Font\nSoftware, subject to the following conditions:\n\n1) Neither the Font Software nor any of its individual components,\nin Original or Modified Versions, may be sold by itself.\n\n2) Original or Modified Versions of the Font Software may be bundled,\nredistributed and/or sold with any software, provided that each copy\ncontains the above copyright notice and this license. These can be\nincluded either as stand-alone text files, human-readable headers or\nin the appropriate machine-readable metadata fields within text or\nbinary files as long as those fields can be easily viewed by the user.\n\n3) No Modified Version of the Font Software may use the Reserved Font\nName(s) unless explicit written permission is granted by the corresponding\nCopyright Holder. This restriction only applies to the primary font name as\npresented to the users.\n\n4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font\nSoftware shall not be used to promote, endorse or advertise any\nModified Version, except to acknowledge the contribution(s) of the\nCopyright Holder(s) and the Author(s) or with their explicit written\npermission.\n\n5) The Font Software, modified or unmodified, in part or in whole,\nmust be distributed entirely under this license, and must not be\ndistributed under any other license. The requirement for fonts to\nremain under this license does not apply to any document created\nusing the Font Software.\n\nTERMINATION\nThis license becomes null and void if any of the above conditions are\nnot met.\n\nDISCLAIMER\nTHE FONT SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT\nOF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE\nCOPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nINCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL\nDAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE.\n","web":""}],"name":"Noto Sans font","paths":["res://assets/fonts/noto_sans"],"version":"","web":""},{"category":"Textures","contact":"","copyright":["2017, Andrea Calabró"],"description":"","id":"godot_engine_logo","licenses":[{"file":"","identifier":"","name":"CC-BY-4.0","text":"Creative Commons Attribution 4.0 International Public License\n\nBy exercising the Licensed Rights (defined below), You accept and agree\nto be bound by the terms and conditions of this Creative Commons\nAttribution 4.0 International Public License (\"Public\nLicense\"). To the extent this Public License may be interpreted as a\ncontract, You are granted the Licensed Rights in consideration of Your\nacceptance of these terms and conditions, and the Licensor grants You\nsuch rights in consideration of benefits the Licensor receives from\nmaking the Licensed Material available under these terms and\nconditions.\n\nSection 1 -- Definitions.\n\na. Adapted Material means material subject to Copyright and Similar\nRights that is derived from or based upon the Licensed Material\nand in which the Licensed Material is translated, altered,\narranged, transformed, or otherwise modified in a manner requiring\npermission under the Copyright and Similar Rights held by the\nLicensor. For purposes of this Public License, where the Licensed\nMaterial is a musical work, performance, or sound recording,\nAdapted Material is always produced where the Licensed Material is\nsynched in timed relation with a moving image.\n\nb. Adapter's License means the license You apply to Your Copyright\nand Similar Rights in Your contributions to Adapted Material in\naccordance with the terms and conditions of this Public License.\n\nc. Copyright and Similar Rights means copyright and/or similar rights\nclosely related to copyright including, without limitation,\nperformance, broadcast, sound recording, and Sui Generis Database\nRights, without regard to how the rights are labeled or\ncategorized. For purposes of this Public License, the rights\nspecified in Section 2(b)(1)-(2) are not Copyright and Similar\nRights.\n\nd. Effective Technological Measures means those measures that, in the\nabsence of proper authority, may not be circumvented under laws\nfulfilling obligations under Article 11 of the WIPO Copyright\nTreaty adopted on December 20, 1996, and/or similar international\nagreements.\n\ne. Exceptions and Limitations means fair use, fair dealing, and/or\nany other exception or limitation to Copyright and Similar Rights\nthat applies to Your use of the Licensed Material.\n\nf. Licensed Material means the artistic or literary work, database,\nor other material to which the Licensor applied this Public\nLicense.\n\ng. Licensed Rights means the rights granted to You subject to the\nterms and conditions of this Public License, which are limited to\nall Copyright and Similar Rights that apply to Your use of the\nLicensed Material and that the Licensor has authority to license.\n\nh. Licensor means the individual(s) or entity(ies) granting rights\nunder this Public License.\n\ni. Share means to provide material to the public by any means or\nprocess that requires permission under the Licensed Rights, such\nas reproduction, public display, public performance, distribution,\ndissemination, communication, or importation, and to make material\navailable to the public including in ways that members of the\npublic may access the material from a place and at a time\nindividually chosen by them.\n\nj. Sui Generis Database Rights means rights other than copyright\nresulting from Directive 96/9/EC of the European Parliament and of\nthe Council of 11 March 1996 on the legal protection of databases,\nas amended and/or succeeded, as well as other essentially\nequivalent rights anywhere in the world.\n\nk. You means the individual or entity exercising the Licensed Rights\nunder this Public License. Your has a corresponding meaning.\n\nSection 2 -- Scope.\n\na. License grant.\n\n1. Subject to the terms and conditions of this Public License,\nthe Licensor hereby grants You a worldwide, royalty-free,\nnon-sublicensable, non-exclusive, irrevocable license to\nexercise the Licensed Rights in the Licensed Material to:\n\na. reproduce and Share the Licensed Material, in whole or\nin part; and\n\nb. produce, reproduce, and Share Adapted Material.\n\n2. Exceptions and Limitations. For the avoidance of doubt, where\nExceptions and Limitations apply to Your use, this Public\nLicense does not apply, and You do not need to comply with\nits terms and conditions.\n\n3. Term. The term of this Public License is specified in Section\n6(a).\n\n4. Media and formats; technical modifications allowed. The\nLicensor authorizes You to exercise the Licensed Rights in\nall media and formats whether now known or hereafter created,\nand to make technical modifications necessary to do so. The\nLicensor waives and/or agrees not to assert any right or\nauthority to forbid You from making technical modifications\nnecessary to exercise the Licensed Rights, including\ntechnical modifications necessary to circumvent Effective\nTechnological Measures. For purposes of this Public License,\nsimply making modifications authorized by this Section 2(a)\n(4) never produces Adapted Material.\n\n5. Downstream recipients.\n\na. Offer from the Licensor -- Licensed Material. Every\nrecipient of the Licensed Material automatically\nreceives an offer from the Licensor to exercise the\nLicensed Rights under the terms and conditions of this\nPublic License.\n\nb. No downstream restrictions. You may not offer or impose\nany additional or different terms or conditions on, or\napply any Effective Technological Measures to, the\nLicensed Material if doing so restricts exercise of the\nLicensed Rights by any recipient of the Licensed\nMaterial.\n\n6. No endorsement. Nothing in this Public License constitutes or\nmay be construed as permission to assert or imply that You\nare, or that Your use of the Licensed Material is, connected\nwith, or sponsored, endorsed, or granted official status by,\nthe Licensor or others designated to receive attribution as\nprovided in Section 3(a)(1)(A)(i).\n\nb. Other rights.\n\n1. Moral rights, such as the right of integrity, are not\nlicensed under this Public License, nor are publicity,\nprivacy, and/or other similar personality rights; however, to\nthe extent possible, the Licensor waives and/or agrees not to\nassert any such rights held by the Licensor to the limited\nextent necessary to allow You to exercise the Licensed\nRights, but not otherwise.\n\n2. Patent and trademark rights are not licensed under this\nPublic License.\n\n3. To the extent possible, the Licensor waives any right to\ncollect royalties from You for the exercise of the Licensed\nRights, whether directly or through a collecting society\nunder any voluntary or waivable statutory or compulsory\nlicensing scheme. In all other cases the Licensor expressly\nreserves any right to collect such royalties.\n\nSection 3 -- License Conditions.\n\nYour exercise of the Licensed Rights is expressly made subject to the\nfollowing conditions.\n\na. Attribution.\n\n1. If You Share the Licensed Material (including in modified\nform), You must:\n\na. retain the following if it is supplied by the Licensor\nwith the Licensed Material:\n\ni. identification of the creator(s) of the Licensed\nMaterial and any others designated to receive\nattribution, in any reasonable manner requested by\nthe Licensor (including by pseudonym if\ndesignated);\n\nii. a copyright notice;\n\niii. a notice that refers to this Public License;\n\niv. a notice that refers to the disclaimer of\nwarranties;\n\nv. a URI or hyperlink to the Licensed Material to the\nextent reasonably practicable;\n\nb. indicate if You modified the Licensed Material and\nretain an indication of any previous modifications; and\n\nc. indicate the Licensed Material is licensed under this\nPublic License, and include the text of, or the URI or\nhyperlink to, this Public License.\n\n2. You may satisfy the conditions in Section 3(a)(1) in any\nreasonable manner based on the medium, means, and context in\nwhich You Share the Licensed Material. For example, it may be\nreasonable to satisfy the conditions by providing a URI or\nhyperlink to a resource that includes the required\ninformation.\n\n3. If requested by the Licensor, You must remove any of the\ninformation required by Section 3(a)(1)(A) to the extent\nreasonably practicable.\n\n4. If You Share Adapted Material You produce, the Adapter's\nLicense You apply must not prevent recipients of the Adapted\nMaterial from complying with this Public License.\n\nSection 4 -- Sui Generis Database Rights.\n\nWhere the Licensed Rights include Sui Generis Database Rights that\napply to Your use of the Licensed Material:\n\na. for the avoidance of doubt, Section 2(a)(1) grants You the right\nto extract, reuse, reproduce, and Share all or a substantial\nportion of the contents of the database;\n\nb. if You include all or a substantial portion of the database\ncontents in a database in which You have Sui Generis Database\nRights, then the database in which You have Sui Generis Database\nRights (but not its individual contents) is Adapted Material; and\n\nc. You must comply with the conditions in Section 3(a) if You Share\nall or a substantial portion of the contents of the database.\n\nFor the avoidance of doubt, this Section 4 supplements and does not\nreplace Your obligations under this Public License where the Licensed\nRights include other Copyright and Similar Rights.\n\nSection 5 -- Disclaimer of Warranties and Limitation of Liability.\n\na. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE\nEXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS\nAND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF\nANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,\nIMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,\nWARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR\nPURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,\nACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT\nKNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT\nALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.\n\nb. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE\nTO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,\nNEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,\nINCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,\nCOSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR\nUSE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN\nADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR\nDAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR\nIN PART, THIS LIMITATION MAY NOT APPLY TO YOU.\n\nc. The disclaimer of warranties and limitation of liability provided\nabove shall be interpreted in a manner that, to the extent\npossible, most closely approximates an absolute disclaimer and\nwaiver of all liability.\n\nSection 6 -- Term and Termination.\n\na. This Public License applies for the term of the Copyright and\nSimilar Rights licensed here. However, if You fail to comply with\nthis Public License, then Your rights under this Public License\nterminate automatically.\n\nb. Where Your right to use the Licensed Material has terminated under\nSection 6(a), it reinstates:\n\n1. automatically as of the date the violation is cured, provided\nit is cured within 30 days of Your discovery of the\nviolation; or\n\n2. upon express reinstatement by the Licensor.\n\nFor the avoidance of doubt, this Section 6(b) does not affect any\nright the Licensor may have to seek remedies for Your violations\nof this Public License.\n\nc. For the avoidance of doubt, the Licensor may also offer the\nLicensed Material under separate terms or conditions or stop\ndistributing the Licensed Material at any time; however, doing so\nwill not terminate this Public License.\n\nd. Sections 1, 5, 6, 7, and 8 survive termination of this Public\nLicense.\n\nSection 7 -- Other Terms and Conditions.\n\na. The Licensor shall not be bound by any additional or different\nterms or conditions communicated by You unless expressly agreed.\n\nb. Any arrangements, understandings, or agreements regarding the\nLicensed Material not stated herein are separate from and\nindependent of the terms and conditions of this Public License.\n\nSection 8 -- Interpretation.\n\na. For the avoidance of doubt, this Public License does not, and\nshall not be interpreted to, reduce, limit, restrict, or impose\nconditions on any use of the Licensed Material that could lawfully\nbe made without permission under this Public License.\n\nb. To the extent possible, if any provision of this Public License is\ndeemed unenforceable, it shall be automatically reformed to the\nminimum extent necessary to make it enforceable. If the provision\ncannot be reformed, it shall be severed from this Public License\nwithout affecting the enforceability of the remaining terms and\nconditions.\n\nc. No term or condition of this Public License will be waived and no\nfailure to comply consented to unless expressly agreed to by the\nLicensor.\n\nd. Nothing in this Public License constitutes or may be interpreted\nas a limitation upon, or waiver of, any privileges and immunities\nthat apply to the Licensor or You, including from the legal\nprocesses of any jurisdiction or authority.\n","web":""}],"name":"Godot Engine logo","paths":["res://icon.svg"],"version":"","web":""}]}
diff --git a/examples/licenses/main.tscn b/examples/licenses/main.tscn
new file mode 100644 (file)
index 0000000..c6738c7
--- /dev/null
@@ -0,0 +1,144 @@
+[gd_scene load_steps=3 format=3 uid="uid://chr26ux2vsrxq"]
+
+[ext_resource type="Script" path="res://examples/licenses/license_selector.gd" id="1_bba6e"]
+[ext_resource type="Script" path="res://examples/licenses/license_container.gd" id="2_0yh67"]
+
+[node name="main" type="PanelContainer"]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+
+[node name="HBoxContainer" type="HBoxContainer" parent="."]
+offset_right = 1152.0
+offset_bottom = 648.0
+
+[node name="Tree" type="Tree" parent="HBoxContainer"]
+offset_right = 264.0
+offset_bottom = 648.0
+size_flags_horizontal = 3
+size_flags_stretch_ratio = 0.3
+hide_root = true
+script = ExtResource("1_bba6e")
+_license_container_path = NodePath("../PanelContainer/MarginContainer")
+
+[node name="PanelContainer" type="PanelContainer" parent="HBoxContainer"]
+offset_left = 268.0
+offset_right = 1152.0
+offset_bottom = 648.0
+size_flags_horizontal = 3
+
+[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/PanelContainer"]
+offset_right = 884.0
+offset_bottom = 648.0
+theme_override_constants/margin_left = 12
+theme_override_constants/margin_top = 12
+theme_override_constants/margin_right = 12
+theme_override_constants/margin_bottom = 12
+script = ExtResource("2_0yh67")
+_name_path = NodePath("VBoxContainer/name")
+_version_path = NodePath("VBoxContainer/version")
+_description_path = NodePath("VBoxContainer/HBoxContainer/description")
+_contact_path = NodePath("VBoxContainer/HBoxContainer/contact")
+_web_path = NodePath("VBoxContainer/HBoxContainer/web")
+_license_path = NodePath("VBoxContainer/HBoxContainer/license")
+_license_text_path = NodePath("VBoxContainer/license_text")
+
+[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/PanelContainer/MarginContainer"]
+offset_left = 12.0
+offset_top = 12.0
+offset_right = 872.0
+offset_bottom = 636.0
+
+[node name="name" type="Label" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"]
+offset_right = 860.0
+offset_bottom = 34.0
+theme_override_font_sizes/font_size = 24
+
+[node name="version" type="Label" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"]
+offset_top = 38.0
+offset_right = 860.0
+offset_bottom = 58.0
+theme_override_font_sizes/font_size = 14
+
+[node name="HSeparator" type="HSeparator" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"]
+offset_top = 62.0
+offset_right = 860.0
+offset_bottom = 66.0
+
+[node name="HBoxContainer" type="GridContainer" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"]
+offset_top = 70.0
+offset_right = 860.0
+offset_bottom = 186.0
+columns = 2
+
+[node name="label" type="Label" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
+offset_right = 89.0
+offset_bottom = 26.0
+theme_override_font_sizes/font_size = 16
+text = "Description"
+
+[node name="description" type="RichTextLabel" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
+offset_left = 93.0
+offset_right = 860.0
+offset_bottom = 26.0
+size_flags_horizontal = 3
+theme_override_font_sizes/normal_font_size = 16
+
+[node name="label2" type="Label" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
+offset_top = 30.0
+offset_right = 89.0
+offset_bottom = 56.0
+theme_override_font_sizes/font_size = 16
+text = "Contact"
+
+[node name="contact" type="RichTextLabel" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
+offset_left = 93.0
+offset_top = 30.0
+offset_right = 860.0
+offset_bottom = 56.0
+size_flags_horizontal = 3
+theme_override_font_sizes/normal_font_size = 16
+
+[node name="label3" type="Label" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
+offset_top = 60.0
+offset_right = 89.0
+offset_bottom = 86.0
+theme_override_font_sizes/font_size = 16
+text = "Web"
+
+[node name="web" type="RichTextLabel" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
+offset_left = 93.0
+offset_top = 60.0
+offset_right = 860.0
+offset_bottom = 86.0
+size_flags_horizontal = 3
+theme_override_font_sizes/normal_font_size = 16
+
+[node name="label4" type="Label" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
+offset_top = 90.0
+offset_right = 89.0
+offset_bottom = 116.0
+theme_override_font_sizes/font_size = 16
+text = "License"
+
+[node name="license" type="RichTextLabel" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"]
+offset_left = 93.0
+offset_top = 90.0
+offset_right = 860.0
+offset_bottom = 116.0
+size_flags_horizontal = 3
+theme_override_font_sizes/normal_font_size = 16
+
+[node name="HSeparator2" type="HSeparator" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"]
+offset_top = 190.0
+offset_right = 860.0
+offset_bottom = 194.0
+
+[node name="license_text" type="RichTextLabel" parent="HBoxContainer/PanelContainer/MarginContainer/VBoxContainer"]
+offset_top = 198.0
+offset_right = 860.0
+offset_bottom = 624.0
+size_flags_vertical = 3
+theme_override_font_sizes/normal_font_size = 16
diff --git a/examples/scene-manager/test.gd b/examples/scene-manager/test.gd
new file mode 100644 (file)
index 0000000..8c92bec
--- /dev/null
@@ -0,0 +1,17 @@
+extends Node
+
+var internal_variable = 42
+
+func _ready():
+       await SceneManager.scene_loaded
+       SceneManager.get_entity("Button").button_down.connect(_on_button_down)
+
+func _on_button_down():
+       if not SceneManager.is_transitioning:
+               SceneManager.change_scene(
+                       "res://demo/test2.tscn", {
+                               "pattern_enter": "fade",
+                               "pattern_leave": "squares",
+                               "on_tree_enter": func(scene): scene.internal_variable += internal_variable
+                       }
+               )
diff --git a/examples/scene-manager/test.tscn b/examples/scene-manager/test.tscn
new file mode 100644 (file)
index 0000000..37103d8
--- /dev/null
@@ -0,0 +1,25 @@
+[gd_scene load_steps=2 format=3 uid="uid://yllaweggorku"]
+
+[ext_resource type="Script" path="res://examples/scene-manager/test.gd" id="1"]
+
+[node name="Level1" type="Node"]
+script = ExtResource("1")
+
+[node name="CanvasLayer" type="CanvasLayer" parent="."]
+
+[node name="ColorRect" type="ColorRect" parent="CanvasLayer"]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+color = Color(0.298039, 0.14902, 0.14902, 1)
+
+[node name="Button" type="Button" parent="CanvasLayer/ColorRect" groups=["scene_manager_entity_nodes"]]
+layout_mode = 0
+anchor_left = 0.4
+anchor_top = 0.4
+anchor_right = 0.6
+anchor_bottom = 0.6
+theme_override_constants/outline_size = 0
+theme_override_font_sizes/font_size = 16
+text = "Change Scene"
+metadata/entity_name = "Button"
diff --git a/examples/scene-manager/test2.gd b/examples/scene-manager/test2.gd
new file mode 100644 (file)
index 0000000..e0a1126
--- /dev/null
@@ -0,0 +1,18 @@
+extends Node
+
+var internal_variable = 13
+
+func _ready():
+       await SceneManager.scene_loaded
+       SceneManager.get_entity("Button").button_down.connect(_on_button_down)
+
+func _on_button_down():
+       if not SceneManager.is_transitioning:
+               SceneManager.change_scene(
+                       "res://demo/test.tscn", {
+                               "pattern_enter": "diagonal",
+                               "pattern_leave": "curtains",
+                               "invert_on_leave": false,
+                               "on_tree_enter": func(scene): scene.internal_variable += internal_variable
+                       }
+               )
diff --git a/examples/scene-manager/test2.tscn b/examples/scene-manager/test2.tscn
new file mode 100644 (file)
index 0000000..e786c1f
--- /dev/null
@@ -0,0 +1,23 @@
+[gd_scene load_steps=2 format=3 uid="uid://dxh40aa103ybj"]
+
+[ext_resource type="Script" path="res://examples/scene-manager/test2.gd" id="1"]
+
+[node name="Level2" type="Node"]
+script = ExtResource("1")
+
+[node name="CanvasLayer" type="CanvasLayer" parent="."]
+
+[node name="ColorRect" type="ColorRect" parent="CanvasLayer"]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+color = Color(0.313726, 0.207843, 0.337255, 1)
+
+[node name="Button" type="Button" parent="CanvasLayer/ColorRect" groups=["scene_manager_entity_nodes"]]
+layout_mode = 0
+anchor_left = 0.4
+anchor_top = 0.4
+anchor_right = 0.6
+anchor_bottom = 0.6
+text = "Change Scene"
+metadata/entity_name = "Button"
diff --git a/examples/tracer/logs.txt b/examples/tracer/logs.txt
new file mode 100644 (file)
index 0000000..9cbb2a3
--- /dev/null
@@ -0,0 +1,5 @@
+[2023-11-02T13:26:06] INFO examples/test/test.gd::_ready: Game Started!
+[2023-11-02T13:26:06] DEBUG examples/test/test.gd::_ready: Initializing systems... 🧙‍♂️
+[2023-11-02T13:26:06] WARN examples/test/test.gd::_ready: Cannot find file 'data.json' 🤔
+[2023-11-02T13:26:06] ERROR examples/test/test.gd::_ready: Cannot communicate with server 😱
+[2023-11-02T13:26:06] TRACE examples/test/test.gd::_ready: This is a trace message 🕵️‍♂️
diff --git a/examples/tracer/test.gd b/examples/tracer/test.gd
new file mode 100644 (file)
index 0000000..29ba495
--- /dev/null
@@ -0,0 +1,39 @@
+extends Node2D
+
+# Shorthand
+const Level = Tracer.Level
+
+func _ready():
+       # Build a subscriber with all the bells and whistles
+       var subscriber = (
+               TraceSubscriber
+               . new()
+               . with_colored_output(true)
+               . with_level(true)
+               . with_nicer_colors(true)
+               . with_timestamp(true)
+               . with_filter(Level.Info | Level.Warn | Level.Error | Level.Debug)
+       )
+       # Initialize the subscriber
+       subscriber.init()
+
+       # Open a file for writing
+       var logs = FileAccess.open("res://examples/test/logs.txt", FileAccess.WRITE)
+       # Build a subscriber that writes to a file
+       var file_logger = (
+               TraceSubscriber
+               . new()
+               . barebones()
+               . with_writer(
+                       TraceSubscriber.writer_from_file(logs)
+               )
+       )
+       # Initialize the subscriber
+       file_logger.init()
+
+       Tracer.info("Game Started!")
+       Tracer.debug("Initializing systems... 🧙‍♂️")
+       Tracer.warn("Cannot find file 'data.json' 🤔")
+       Tracer.error("Cannot communicate with server 😱")
+       # This will not be printed
+       Tracer.trace("This is a trace message 🕵️‍♂️")
diff --git a/examples/tracer/test.tscn b/examples/tracer/test.tscn
new file mode 100644 (file)
index 0000000..6a60a51
--- /dev/null
@@ -0,0 +1,6 @@
+[gd_scene load_steps=2 format=3 uid="uid://d3njkl304ln6q"]
+
+[ext_resource type="Script" path="res://examples/tracer/test.gd" id="1_l25wv"]
+
+[node name="test" type="Node2D"]
+script = ExtResource("1_l25wv")
diff --git a/icon.svg b/icon.svg
new file mode 100644 (file)
index 0000000..3fe4f4a
--- /dev/null
+++ b/icon.svg
@@ -0,0 +1 @@
+<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z" fill="#478cbf"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>
diff --git a/icon.svg.import b/icon.svg.import
new file mode 100644 (file)
index 0000000..ce076b0
--- /dev/null
@@ -0,0 +1,37 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://crit2igyelikc"
+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.godot b/project.godot
new file mode 100644 (file)
index 0000000..f0a85a9
--- /dev/null
@@ -0,0 +1,53 @@
+; 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="Routes & Roots"
+config/version="0.1"
+run/main_scene="res://scenes/SplashScreen.tscn"
+config/features=PackedStringArray("4.3", "Mobile")
+boot_splash/bg_color=Color(1, 0.894118, 0.796078, 1)
+boot_splash/show_image=false
+config/icon="res://icon.svg"
+
+[autoload]
+
+DebugMenu="*res://addons/debug_menu/debug_menu.tscn"
+SceneManager="*res://addons/scene_manager/SceneManager.tscn"
+Tracer="*res://addons/tracer/./tracer.gd"
+
+[display]
+
+window/size/viewport_width=1920
+window/size/viewport_height=1080
+window/stretch/mode="viewport"
+
+[editor]
+
+version_control/plugin_name="GitPlugin"
+version_control/autoload_on_startup=true
+
+[editor_plugins]
+
+enabled=PackedStringArray("res://addons/ColorPreview/plugin.cfg", "res://addons/debug_menu/plugin.cfg", "res://addons/health_bar_2d/plugin.cfg", "res://addons/label_font_auto_sizer/plugin.cfg", "res://addons/licenses/plugin.cfg", "res://addons/rich_text_label_ex/plugin.cfg", "res://addons/scene_manager/plugin.cfg", "res://addons/script-ide/plugin.cfg", "res://addons/script-tabs/plugin.cfg", "res://addons/tracer/plugin.cfg")
+
+[file_customization]
+
+folder_colors={
+"res://assets/": "red",
+"res://components/": "teal",
+"res://scenes/": "blue"
+}
+
+[rendering]
+
+textures/canvas_textures/default_texture_filter=0
+renderer/rendering_method="mobile"
diff --git a/scenes/MainMenu.tscn b/scenes/MainMenu.tscn
new file mode 100644 (file)
index 0000000..bce1597
--- /dev/null
@@ -0,0 +1,214 @@
+[gd_scene load_steps=9 format=3 uid="uid://brlsxlpsaxahp"]
+
+[ext_resource type="Texture2D" uid="uid://b1hgu1e1abcgx" path="res://assets/title_screen_background.png" id="1_0ke3n"]
+[ext_resource type="Script" path="res://scenes/main_menu.gd" id="1_n2vcw"]
+[ext_resource type="Texture2D" uid="uid://cm6jp47f1d4cl" path="res://assets/ui-components/logo_routes&roots.png" id="2_1eb10"]
+[ext_resource type="PackedScene" uid="uid://c3uole0l14mxh" path="res://components/button/MainButton.tscn" id="4_pjqd4"]
+
+[sub_resource type="Animation" id="Animation_dyqmd"]
+length = 0.001
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath(".:position")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(224, 56)]
+}
+tracks/1/type = "value"
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/path = NodePath("../StartButton:position")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(384, 640)]
+}
+tracks/2/type = "value"
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/path = NodePath("../ConfigButton:position")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(320, 776)]
+}
+tracks/3/type = "value"
+tracks/3/imported = false
+tracks/3/enabled = true
+tracks/3/path = NodePath("../ExitButton:position")
+tracks/3/interp = 1
+tracks/3/loop_wrap = true
+tracks/3/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(256, 912)]
+}
+
+[sub_resource type="Animation" id="Animation_h7sqw"]
+resource_name = "logo_entrance"
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath(".:position")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0, 0.7),
+"transitions": PackedFloat32Array(1, 1),
+"update": 0,
+"values": [Vector2(248, 912), Vector2(248, 24)]
+}
+tracks/1/type = "value"
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/path = NodePath("../StartButton:position")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/keys = {
+"times": PackedFloat32Array(0.5661, 0.7326),
+"transitions": PackedFloat32Array(1, 1),
+"update": 0,
+"values": [Vector2(248, 1104), Vector2(384, 640)]
+}
+tracks/2/type = "value"
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/path = NodePath("../ConfigButton:position")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/keys = {
+"times": PackedFloat32Array(0.5661, 0.8658),
+"transitions": PackedFloat32Array(1, 1),
+"update": 0,
+"values": [Vector2(184, 1216), Vector2(320, 776)]
+}
+tracks/3/type = "value"
+tracks/3/imported = false
+tracks/3/enabled = true
+tracks/3/path = NodePath("../ExitButton:position")
+tracks/3/interp = 1
+tracks/3/loop_wrap = true
+tracks/3/keys = {
+"times": PackedFloat32Array(0.5661, 0.999),
+"transitions": PackedFloat32Array(1, 1),
+"update": 0,
+"values": [Vector2(120, 1336), Vector2(256, 912)]
+}
+
+[sub_resource type="Animation" id="Animation_410fw"]
+resource_name = "logo_bounce"
+length = 5.0
+loop_mode = 2
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath(".:position")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0, 4.995),
+"transitions": PackedFloat32Array(1, 1),
+"update": 0,
+"values": [Vector2(248, 24), Vector2(248, 72)]
+}
+
+[sub_resource type="AnimationLibrary" id="AnimationLibrary_b7mng"]
+_data = {
+"RESET": SubResource("Animation_dyqmd"),
+"entrance": SubResource("Animation_h7sqw"),
+"logo_bounce": SubResource("Animation_410fw")
+}
+
+[node name="MainMenu" type="Control"]
+layout_mode = 3
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+script = ExtResource("1_n2vcw")
+
+[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
+root_node = NodePath("../Logo")
+libraries = {
+"": SubResource("AnimationLibrary_b7mng")
+}
+autoplay = "entrance"
+
+[node name="Background" type="TextureRect" parent="."]
+layout_mode = 0
+scale = Vector2(0.5, 0.5)
+texture = ExtResource("1_0ke3n")
+
+[node name="Logo" type="TextureRect" parent="."]
+layout_mode = 0
+offset_left = 224.0
+offset_top = 56.0
+offset_right = 1740.0
+offset_bottom = 763.0
+scale = Vector2(0.5, 0.5)
+pivot_offset = Vector2(710, 364)
+texture = ExtResource("2_1eb10")
+
+[node name="StartButton" parent="." instance=ExtResource("4_pjqd4")]
+layout_mode = 0
+anchors_preset = 0
+anchor_left = 0.0
+anchor_top = 0.0
+anchor_right = 0.0
+anchor_bottom = 0.0
+offset_left = 384.0
+offset_top = 640.0
+offset_right = 1152.0
+offset_bottom = 880.0
+grow_horizontal = 1
+grow_vertical = 1
+scale = Vector2(0.5, 0.5)
+text = "Start"
+
+[node name="ConfigButton" parent="." instance=ExtResource("4_pjqd4")]
+layout_mode = 0
+anchors_preset = 0
+anchor_left = 0.0
+anchor_top = 0.0
+anchor_right = 0.0
+anchor_bottom = 0.0
+offset_left = 320.0
+offset_top = 776.0
+offset_right = 1088.0
+offset_bottom = 1016.0
+grow_horizontal = 1
+grow_vertical = 1
+scale = Vector2(0.5, 0.5)
+text = "Config"
+
+[node name="ExitButton" parent="." instance=ExtResource("4_pjqd4")]
+layout_mode = 0
+anchors_preset = 0
+anchor_left = 0.0
+anchor_top = 0.0
+anchor_right = 0.0
+anchor_bottom = 0.0
+offset_left = 256.0
+offset_top = 912.0
+offset_right = 1024.0
+offset_bottom = 1152.0
+grow_horizontal = 1
+grow_vertical = 1
+scale = Vector2(0.5, 0.5)
+text = "Exit"
+
+[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"]
+[connection signal="pressed" from="ExitButton" to="." method="_on_exit_button_pressed"]
diff --git a/scenes/SplashScreen.tscn b/scenes/SplashScreen.tscn
new file mode 100644 (file)
index 0000000..2aba58f
--- /dev/null
@@ -0,0 +1,185 @@
+[gd_scene load_steps=9 format=3 uid="uid://cy24adufhvmvm"]
+
+[ext_resource type="Texture2D" uid="uid://b3u2jhhvyo8ss" path="res://assets/vertical_divisor.png" id="1_2v5nx"]
+[ext_resource type="Script" path="res://scenes/splash_screen.gd" id="1_8mb83"]
+[ext_resource type="Texture2D" uid="uid://c2hclus3idni7" path="res://assets/logo_made_with_godot.png" id="2_6njfd"]
+[ext_resource type="Texture2D" uid="uid://bwwrm5h5uvljd" path="res://assets/logo_backpain.png" id="3_w6fb6"]
+
+[sub_resource type="Animation" id="Animation_brjr2"]
+resource_name = "entrance"
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath("LogoMadeWithGodot:position")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0, 0.3663),
+"transitions": PackedFloat32Array(0.31864, 1),
+"update": 0,
+"values": [Vector2(517, 1090), Vector2(517, 488)]
+}
+tracks/1/type = "value"
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/path = NodePath("LogoBackpain:position")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/keys = {
+"times": PackedFloat32Array(0.5661, 0.999),
+"transitions": PackedFloat32Array(0.378929, 1),
+"update": 0,
+"values": [Vector2(1088, 1090), Vector2(1088, 424)]
+}
+tracks/2/type = "value"
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/path = NodePath("ColorRect/VerticalDivisor:scale")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/keys = {
+"times": PackedFloat32Array(0.4329, 0.666),
+"transitions": PackedFloat32Array(0.406126, 1),
+"update": 0,
+"values": [Vector2(1, 0), Vector2(1, 1)]
+}
+
+[sub_resource type="Animation" id="Animation_lsi77"]
+length = 0.001
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath("LogoMadeWithGodot:position")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(517, 488)]
+}
+tracks/1/type = "value"
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/path = NodePath("LogoBackpain:position")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(1088, 424)]
+}
+tracks/2/type = "value"
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/path = NodePath("ColorRect/VerticalDivisor:scale")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(1, 1)]
+}
+
+[sub_resource type="Animation" id="Animation_mltn6"]
+resource_name = "exit"
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath("LogoMadeWithGodot:position")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0, 0.3),
+"transitions": PackedFloat32Array(3.03143, 1),
+"update": 0,
+"values": [Vector2(517, 488), Vector2(517, 1090)]
+}
+tracks/1/type = "value"
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/path = NodePath("LogoBackpain:position")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/keys = {
+"times": PackedFloat32Array(0.5994, 0.9),
+"transitions": PackedFloat32Array(3.36358, 1),
+"update": 0,
+"values": [Vector2(1088, 424), Vector2(1088, 1090)]
+}
+tracks/2/type = "value"
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/path = NodePath("ColorRect/VerticalDivisor:scale")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/keys = {
+"times": PackedFloat32Array(0.3996, 0.6993),
+"transitions": PackedFloat32Array(0.329877, 1),
+"update": 0,
+"values": [Vector2(1, 1), Vector2(1, 1e-05)]
+}
+
+[sub_resource type="AnimationLibrary" id="AnimationLibrary_pkldf"]
+_data = {
+"RESET": SubResource("Animation_lsi77"),
+"entrance": SubResource("Animation_brjr2"),
+"exit": SubResource("Animation_mltn6")
+}
+
+[node name="SplashScreen" type="Control"]
+layout_mode = 3
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+script = ExtResource("1_8mb83")
+metadata/_edit_vertical_guides_ = [960.0, 832.0, 1088.0]
+metadata/_edit_horizontal_guides_ = [540.0]
+
+[node name="ColorRect" type="ColorRect" parent="."]
+layout_mode = 1
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+color = Color(1, 0.894118, 0.796078, 1)
+
+[node name="VerticalDivisor" type="Sprite2D" parent="ColorRect"]
+position = Vector2(960, 540)
+texture = ExtResource("1_2v5nx")
+
+[node name="LogoMadeWithGodot" type="TextureRect" parent="."]
+layout_mode = 0
+offset_left = 517.0
+offset_top = 488.0
+offset_right = 1306.0
+offset_bottom = 737.001
+scale = Vector2(0.4, 0.4)
+texture = ExtResource("2_6njfd")
+
+[node name="LogoBackpain" type="TextureRect" parent="."]
+layout_mode = 0
+offset_left = 1088.0
+offset_top = 424.0
+offset_right = 1929.0
+offset_bottom = 1320.0
+scale = Vector2(0.3, 0.3)
+texture = ExtResource("3_w6fb6")
+
+[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
+libraries = {
+"": SubResource("AnimationLibrary_pkldf")
+}
+autoplay = "entrance"
+
+[node name="Timer" type="Timer" parent="."]
+wait_time = 2.0
+one_shot = true
+
+[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"]
+[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
diff --git a/scenes/main_menu.gd b/scenes/main_menu.gd
new file mode 100644 (file)
index 0000000..d0643c2
--- /dev/null
@@ -0,0 +1,23 @@
+extends Control
+
+
+@onready var animation_player = $AnimationPlayer
+
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+       pass # Replace with function body.
+
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(delta):
+       pass
+
+
+func _on_animation_player_animation_finished(anim_name):
+       if anim_name == "entrance":
+               animation_player.play("logo_bounce")
+
+
+func _on_exit_button_pressed():
+       get_tree().quit()
diff --git a/scenes/splash_screen.gd b/scenes/splash_screen.gd
new file mode 100644 (file)
index 0000000..c766b1c
--- /dev/null
@@ -0,0 +1,19 @@
+extends Control
+
+@onready var timer = $Timer
+@onready var animation_player = $AnimationPlayer
+
+
+func _on_animation_player_animation_finished(anim_name):
+       if anim_name == "entrance":
+               timer.start()
+       elif anim_name == "exit":
+               SceneManager.change_scene("res://scenes/MainMenu.tscn",
+               { 
+                       "speed": 1,
+                       "pattern": "diagonal"
+                })
+
+
+func _on_timer_timeout():
+       animation_player.play("exit")