From 6cb9ecfd6f6c863cd873a1b5e77972d542dfb1bc Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 24 Nov 2021 23:50:05 -0500 Subject: Added a file dialog; Hopefully it can play audio soon --- .gitignore | 2 ++ App.gd | 27 ++++++++++++++++++ App.tscn | 41 +++++++++++++++++++++++++-- Fonts/Open Sans/OpenSans-Bold.ttf | Bin 104120 -> 0 bytes Fonts/Open Sans/OpenSans-BoldItalic.ttf | Bin 92628 -> 0 bytes Fonts/Open Sans/OpenSans-ExtraBold.ttf | Bin 102076 -> 0 bytes Fonts/Open Sans/OpenSans-ExtraBoldItalic.ttf | Bin 92772 -> 0 bytes Fonts/Open Sans/OpenSans-Italic.ttf | Bin 92240 -> 0 bytes Fonts/Open Sans/OpenSans-Light.ttf | Bin 101696 -> 0 bytes Fonts/Open Sans/OpenSans-LightItalic.ttf | Bin 92488 -> 0 bytes Fonts/Open Sans/OpenSans-Regular.ttf | Bin 96932 -> 0 bytes Fonts/Open Sans/OpenSans-SemiBold.ttf | Bin 100820 -> 0 bytes Fonts/Open Sans/OpenSans-SemiBoldItalic.ttf | Bin 92180 -> 0 bytes MainTheme.tres | 3 ++ fonts/Open Sans/OpenSans-Bold.ttf | Bin 0 -> 104120 bytes fonts/Open Sans/OpenSans-BoldItalic.ttf | Bin 0 -> 92628 bytes fonts/Open Sans/OpenSans-ExtraBold.ttf | Bin 0 -> 102076 bytes fonts/Open Sans/OpenSans-ExtraBoldItalic.ttf | Bin 0 -> 92772 bytes fonts/Open Sans/OpenSans-Italic.ttf | Bin 0 -> 92240 bytes fonts/Open Sans/OpenSans-Light.ttf | Bin 0 -> 101696 bytes fonts/Open Sans/OpenSans-LightItalic.ttf | Bin 0 -> 92488 bytes fonts/Open Sans/OpenSans-Regular.ttf | Bin 0 -> 96932 bytes fonts/Open Sans/OpenSans-SemiBold.ttf | Bin 0 -> 100820 bytes fonts/Open Sans/OpenSans-SemiBoldItalic.ttf | Bin 0 -> 92180 bytes project.godot | 1 - 25 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 App.gd delete mode 100644 Fonts/Open Sans/OpenSans-Bold.ttf delete mode 100644 Fonts/Open Sans/OpenSans-BoldItalic.ttf delete mode 100644 Fonts/Open Sans/OpenSans-ExtraBold.ttf delete mode 100644 Fonts/Open Sans/OpenSans-ExtraBoldItalic.ttf delete mode 100644 Fonts/Open Sans/OpenSans-Italic.ttf delete mode 100644 Fonts/Open Sans/OpenSans-Light.ttf delete mode 100644 Fonts/Open Sans/OpenSans-LightItalic.ttf delete mode 100644 Fonts/Open Sans/OpenSans-Regular.ttf delete mode 100644 Fonts/Open Sans/OpenSans-SemiBold.ttf delete mode 100644 Fonts/Open Sans/OpenSans-SemiBoldItalic.ttf create mode 100644 MainTheme.tres create mode 100644 fonts/Open Sans/OpenSans-Bold.ttf create mode 100644 fonts/Open Sans/OpenSans-BoldItalic.ttf create mode 100644 fonts/Open Sans/OpenSans-ExtraBold.ttf create mode 100644 fonts/Open Sans/OpenSans-ExtraBoldItalic.ttf create mode 100644 fonts/Open Sans/OpenSans-Italic.ttf create mode 100644 fonts/Open Sans/OpenSans-Light.ttf create mode 100644 fonts/Open Sans/OpenSans-LightItalic.ttf create mode 100644 fonts/Open Sans/OpenSans-Regular.ttf create mode 100644 fonts/Open Sans/OpenSans-SemiBold.ttf create mode 100644 fonts/Open Sans/OpenSans-SemiBoldItalic.ttf diff --git a/.gitignore b/.gitignore index 4f48ad7..21bf0dd 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ export_presets.cfg # Mono-specific ignores .mono/ data_*/ + +output/ diff --git a/App.gd b/App.gd new file mode 100644 index 0000000..1986e1d --- /dev/null +++ b/App.gd @@ -0,0 +1,27 @@ +extends Control + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + +var audio; + +# Called when the node enters the scene tree for the first time. +func _ready(): + print("Erable is ready") + pass # Replace with function body. + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass + +func _on_PlayButton_pressed(): + pass # Replace with function body. + +func _on_BrowseButton_pressed(): + $FileDialog.popup() + +func _on_FileDialog_file_selected(path): + print(path) + audio = path + diff --git a/App.tscn b/App.tscn index d8ba906..81ab525 100644 --- a/App.tscn +++ b/App.tscn @@ -1,8 +1,13 @@ -[gd_scene format=2] +[gd_scene load_steps=3 format=2] -[node name="Control" type="Control"] +[ext_resource path="res://MainTheme.tres" type="Theme" id=1] +[ext_resource path="res://App.gd" type="Script" id=2] + +[node name="Player" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 +theme = ExtResource( 1 ) +script = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false } @@ -11,14 +16,38 @@ __meta__ = { margin_right = 96.0 margin_bottom = 48.0 text = "Play" +__meta__ = { +"_edit_use_anchors_": false +} [node name="PauseButton" type="Button" parent="."] margin_left = 112.0 margin_right = 208.0 margin_bottom = 48.0 text = "Pause" +__meta__ = { +"_edit_use_anchors_": false +} -[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +[node name="BrowseButton" type="Button" parent="."] +margin_left = 224.0 +margin_right = 312.0 +margin_bottom = 48.0 +text = "Browse" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="FileDialog" type="FileDialog" parent="."] +margin_left = 160.0 +margin_top = 112.0 +margin_right = 792.0 +margin_bottom = 488.0 +window_title = "Open a File" +mode = 0 +access = 2 +current_dir = "/" +current_path = "/" [node name="Label" type="Label" parent="."] anchor_right = 1.0 @@ -33,3 +62,9 @@ valign = 2 __meta__ = { "_edit_use_anchors_": false } + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] + +[connection signal="pressed" from="PlayButton" to="." method="_on_PlayButton_pressed"] +[connection signal="pressed" from="BrowseButton" to="." method="_on_BrowseButton_pressed"] +[connection signal="file_selected" from="FileDialog" to="." method="_on_FileDialog_file_selected"] diff --git a/Fonts/Open Sans/OpenSans-Bold.ttf b/Fonts/Open Sans/OpenSans-Bold.ttf deleted file mode 100644 index efdd5e8..0000000 Binary files a/Fonts/Open Sans/OpenSans-Bold.ttf and /dev/null differ diff --git a/Fonts/Open Sans/OpenSans-BoldItalic.ttf b/Fonts/Open Sans/OpenSans-BoldItalic.ttf deleted file mode 100644 index 9bf9b4e..0000000 Binary files a/Fonts/Open Sans/OpenSans-BoldItalic.ttf and /dev/null differ diff --git a/Fonts/Open Sans/OpenSans-ExtraBold.ttf b/Fonts/Open Sans/OpenSans-ExtraBold.ttf deleted file mode 100644 index 67fcf0f..0000000 Binary files a/Fonts/Open Sans/OpenSans-ExtraBold.ttf and /dev/null differ diff --git a/Fonts/Open Sans/OpenSans-ExtraBoldItalic.ttf b/Fonts/Open Sans/OpenSans-ExtraBoldItalic.ttf deleted file mode 100644 index 0867228..0000000 Binary files a/Fonts/Open Sans/OpenSans-ExtraBoldItalic.ttf and /dev/null differ diff --git a/Fonts/Open Sans/OpenSans-Italic.ttf b/Fonts/Open Sans/OpenSans-Italic.ttf deleted file mode 100644 index 1178567..0000000 Binary files a/Fonts/Open Sans/OpenSans-Italic.ttf and /dev/null differ diff --git a/Fonts/Open Sans/OpenSans-Light.ttf b/Fonts/Open Sans/OpenSans-Light.ttf deleted file mode 100644 index 6580d3a..0000000 Binary files a/Fonts/Open Sans/OpenSans-Light.ttf and /dev/null differ diff --git a/Fonts/Open Sans/OpenSans-LightItalic.ttf b/Fonts/Open Sans/OpenSans-LightItalic.ttf deleted file mode 100644 index 1e0c331..0000000 Binary files a/Fonts/Open Sans/OpenSans-LightItalic.ttf and /dev/null differ diff --git a/Fonts/Open Sans/OpenSans-Regular.ttf b/Fonts/Open Sans/OpenSans-Regular.ttf deleted file mode 100644 index 29bfd35..0000000 Binary files a/Fonts/Open Sans/OpenSans-Regular.ttf and /dev/null differ diff --git a/Fonts/Open Sans/OpenSans-SemiBold.ttf b/Fonts/Open Sans/OpenSans-SemiBold.ttf deleted file mode 100644 index 54e7059..0000000 Binary files a/Fonts/Open Sans/OpenSans-SemiBold.ttf and /dev/null differ diff --git a/Fonts/Open Sans/OpenSans-SemiBoldItalic.ttf b/Fonts/Open Sans/OpenSans-SemiBoldItalic.ttf deleted file mode 100644 index aebcf14..0000000 Binary files a/Fonts/Open Sans/OpenSans-SemiBoldItalic.ttf and /dev/null differ diff --git a/MainTheme.tres b/MainTheme.tres new file mode 100644 index 0000000..8a44629 --- /dev/null +++ b/MainTheme.tres @@ -0,0 +1,3 @@ +[gd_resource type="Theme" format=2] + +[resource] diff --git a/fonts/Open Sans/OpenSans-Bold.ttf b/fonts/Open Sans/OpenSans-Bold.ttf new file mode 100644 index 0000000..efdd5e8 Binary files /dev/null and b/fonts/Open Sans/OpenSans-Bold.ttf differ diff --git a/fonts/Open Sans/OpenSans-BoldItalic.ttf b/fonts/Open Sans/OpenSans-BoldItalic.ttf new file mode 100644 index 0000000..9bf9b4e Binary files /dev/null and b/fonts/Open Sans/OpenSans-BoldItalic.ttf differ diff --git a/fonts/Open Sans/OpenSans-ExtraBold.ttf b/fonts/Open Sans/OpenSans-ExtraBold.ttf new file mode 100644 index 0000000..67fcf0f Binary files /dev/null and b/fonts/Open Sans/OpenSans-ExtraBold.ttf differ diff --git a/fonts/Open Sans/OpenSans-ExtraBoldItalic.ttf b/fonts/Open Sans/OpenSans-ExtraBoldItalic.ttf new file mode 100644 index 0000000..0867228 Binary files /dev/null and b/fonts/Open Sans/OpenSans-ExtraBoldItalic.ttf differ diff --git a/fonts/Open Sans/OpenSans-Italic.ttf b/fonts/Open Sans/OpenSans-Italic.ttf new file mode 100644 index 0000000..1178567 Binary files /dev/null and b/fonts/Open Sans/OpenSans-Italic.ttf differ diff --git a/fonts/Open Sans/OpenSans-Light.ttf b/fonts/Open Sans/OpenSans-Light.ttf new file mode 100644 index 0000000..6580d3a Binary files /dev/null and b/fonts/Open Sans/OpenSans-Light.ttf differ diff --git a/fonts/Open Sans/OpenSans-LightItalic.ttf b/fonts/Open Sans/OpenSans-LightItalic.ttf new file mode 100644 index 0000000..1e0c331 Binary files /dev/null and b/fonts/Open Sans/OpenSans-LightItalic.ttf differ diff --git a/fonts/Open Sans/OpenSans-Regular.ttf b/fonts/Open Sans/OpenSans-Regular.ttf new file mode 100644 index 0000000..29bfd35 Binary files /dev/null and b/fonts/Open Sans/OpenSans-Regular.ttf differ diff --git a/fonts/Open Sans/OpenSans-SemiBold.ttf b/fonts/Open Sans/OpenSans-SemiBold.ttf new file mode 100644 index 0000000..54e7059 Binary files /dev/null and b/fonts/Open Sans/OpenSans-SemiBold.ttf differ diff --git a/fonts/Open Sans/OpenSans-SemiBoldItalic.ttf b/fonts/Open Sans/OpenSans-SemiBoldItalic.ttf new file mode 100644 index 0000000..aebcf14 Binary files /dev/null and b/fonts/Open Sans/OpenSans-SemiBoldItalic.ttf differ diff --git a/project.godot b/project.godot index e9cd0eb..8552f12 100644 --- a/project.godot +++ b/project.godot @@ -13,7 +13,6 @@ config_version=4 config/name="Erable" config/description="Audio Player" run/main_scene="res://App.tscn" -boot_splash/image=false config/icon="res://erable.png" [rendering] -- cgit v1.2.3