From 19598527473351db0578d61559977b6ba7328f66 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Mon, 4 Dec 2023 13:13:36 +0100 Subject: [PATCH] add godot --- godot/.gitattributes | 2 ++ godot/.gitignore | 2 ++ godot/icon.svg | 1 + godot/icon.svg.import | 37 +++++++++++++++++++++++++++++++++++++ godot/main.gd | 15 +++++++++++++++ godot/main.tscn | 37 +++++++++++++++++++++++++++++++++++++ godot/project.godot | 26 ++++++++++++++++++++++++++ 7 files changed, 120 insertions(+) create mode 100644 godot/.gitattributes create mode 100644 godot/.gitignore create mode 100644 godot/icon.svg create mode 100644 godot/icon.svg.import create mode 100644 godot/main.gd create mode 100644 godot/main.tscn create mode 100644 godot/project.godot diff --git a/godot/.gitattributes b/godot/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/godot/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/godot/.gitignore b/godot/.gitignore new file mode 100644 index 0000000..4709183 --- /dev/null +++ b/godot/.gitignore @@ -0,0 +1,2 @@ +# Godot 4+ specific ignores +.godot/ diff --git a/godot/icon.svg b/godot/icon.svg new file mode 100644 index 0000000..b370ceb --- /dev/null +++ b/godot/icon.svg @@ -0,0 +1 @@ + diff --git a/godot/icon.svg.import b/godot/icon.svg.import new file mode 100644 index 0000000..3a8237f --- /dev/null +++ b/godot/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bt8enetdrugnl" +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/godot/main.gd b/godot/main.gd new file mode 100644 index 0000000..7db7f51 --- /dev/null +++ b/godot/main.gd @@ -0,0 +1,15 @@ +extends Control + + +# Called when the node enters the scene tree for the first time. +func _ready(): + $FileDialog.access = FileDialog.ACCESS_FILESYSTEM + $FileDialog.use_native_dialog = true + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _on_button_pressed(): + $FileDialog.show() + print("button pressed") diff --git a/godot/main.tscn b/godot/main.tscn new file mode 100644 index 0000000..00ed960 --- /dev/null +++ b/godot/main.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=2 format=3 uid="uid://y5v0kmse8n10"] + +[ext_resource type="Script" path="res://main.gd" id="1_2tuu3"] + +[node name="Control" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 1.0 +offset_top = 1.0 +offset_right = 1.0 +offset_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_2tuu3") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +metadata/_edit_use_anchors_ = true + +[node name="CenterContainer" type="CenterContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="Button" type="Button" parent="MarginContainer/CenterContainer"] +custom_minimum_size = Vector2(200, 200) +layout_mode = 2 +text = "Load database" + +[node name="FileDialog" type="FileDialog" parent="."] + +[connection signal="pressed" from="MarginContainer/CenterContainer/Button" to="." method="_on_button_pressed"] diff --git a/godot/project.godot b/godot/project.godot new file mode 100644 index 0000000..d74de34 --- /dev/null +++ b/godot/project.godot @@ -0,0 +1,26 @@ +; 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="FabApp" +run/main_scene="res://main.tscn" +config/features=PackedStringArray("4.2", "GL Compatibility") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=600 +window/size/viewport_height=900 + +[rendering] + +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility"