Convert demos to Godot 4 using regular expressions in a script

This commit is contained in:
Aaron Franke
2022-03-26 05:00:50 -05:00
parent 410d783126
commit bbe50fc9da
1095 changed files with 13628 additions and 13557 deletions

View File

@@ -1,20 +1,20 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://play_system_button_hl.png" type="Texture" id=1]
[ext_resource path="res://play_sound_button.png" type="Texture" id=2]
[ext_resource path="res://play_system_button_hl.png" type="Texture2D" id=1]
[ext_resource path="res://play_sound_button.png" type="Texture2D" id=2]
[ext_resource path="res://the_comeback2.ogg" type="AudioStream" id=3]
[ext_resource path="res://play_sound_button_hl.png" type="Texture" id=4]
[ext_resource path="res://play_system_button.png" type="Texture" id=5]
[ext_resource path="res://lcd.ttf" type="DynamicFontData" id=6]
[ext_resource path="res://play_sound_button_hl.png" type="Texture2D" id=4]
[ext_resource path="res://play_system_button.png" type="Texture2D" id=5]
[ext_resource path="res://lcd.ttf" type="FontData" id=6]
[ext_resource path="res://bpm_sync.gd" type="Script" id=7]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0, 0, 0, 1 )
bg_color = Color(0, 0, 0, 1)
[sub_resource type="DynamicFont" id=2]
[sub_resource type="Font" id=2]
size = 40
outline_size = 2
outline_color = Color( 0.588235, 0.886275, 0.435294, 0.239216 )
outline_color = Color(0.588235, 0.886275, 0.435294, 0.239216)
font_data = ExtResource( 6 )
[node name="BPMSync" type="Panel"]
@@ -27,11 +27,11 @@ __meta__ = {
}
[node name="Label" type="Label" parent="."]
margin_left = 106.895
margin_top = 427.158
margin_right = 914.895
margin_bottom = 488.158
custom_colors/font_color = Color( 0.552941, 0.984314, 0.501961, 1 )
offset_left = 106.895
offset_top = 427.158
offset_right = 914.895
offset_bottom = 488.158
custom_colors/font_color = Color(0.552941, 0.984314, 0.501961, 1)
custom_fonts/font = SubResource( 2 )
align = 1
@@ -39,19 +39,19 @@ align = 1
stream = ExtResource( 3 )
[node name="PlaySystem" type="TextureButton" parent="."]
margin_left = 214.737
margin_top = 187.368
margin_right = 342.737
margin_bottom = 315.368
offset_left = 214.737
offset_top = 187.368
offset_right = 342.737
offset_bottom = 315.368
texture_normal = ExtResource( 5 )
texture_pressed = ExtResource( 5 )
texture_hover = ExtResource( 1 )
[node name="PlaySound" type="TextureButton" parent="."]
margin_left = 622.105
margin_top = 183.158
margin_right = 750.105
margin_bottom = 311.158
offset_left = 622.105
offset_top = 183.158
offset_right = 750.105
offset_bottom = 311.158
texture_normal = ExtResource( 2 )
texture_pressed = ExtResource( 2 )
texture_hover = ExtResource( 4 )

View File

@@ -1,8 +1,8 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
@@ -10,7 +10,7 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
[params]

View File

@@ -1,8 +1,8 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/play_sound_button.png-7e88216154de1a5cb6304cbd3751ed46.stex"
type="StreamTexture2D"
path="res://.godot/imported/play_sound_button.png-7e88216154de1a5cb6304cbd3751ed46.stex"
metadata={
"vram_texture": false
}
@@ -10,7 +10,7 @@ metadata={
[deps]
source_file="res://play_sound_button.png"
dest_files=[ "res://.import/play_sound_button.png-7e88216154de1a5cb6304cbd3751ed46.stex" ]
dest_files=["res://.godot/imported/play_sound_button.png-7e88216154de1a5cb6304cbd3751ed46.stex"]
[params]

View File

@@ -1,8 +1,8 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/play_sound_button_hl.png-8d86f81fe37a5f2959088b0948283133.stex"
type="StreamTexture2D"
path="res://.godot/imported/play_sound_button_hl.png-8d86f81fe37a5f2959088b0948283133.stex"
metadata={
"vram_texture": false
}
@@ -10,7 +10,7 @@ metadata={
[deps]
source_file="res://play_sound_button_hl.png"
dest_files=[ "res://.import/play_sound_button_hl.png-8d86f81fe37a5f2959088b0948283133.stex" ]
dest_files=["res://.godot/imported/play_sound_button_hl.png-8d86f81fe37a5f2959088b0948283133.stex"]
[params]

View File

@@ -1,8 +1,8 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/play_system_button.png-683c51b4d13189b67bb57e75cbb8ef56.stex"
type="StreamTexture2D"
path="res://.godot/imported/play_system_button.png-683c51b4d13189b67bb57e75cbb8ef56.stex"
metadata={
"vram_texture": false
}
@@ -10,7 +10,7 @@ metadata={
[deps]
source_file="res://play_system_button.png"
dest_files=[ "res://.import/play_system_button.png-683c51b4d13189b67bb57e75cbb8ef56.stex" ]
dest_files=["res://.godot/imported/play_system_button.png-683c51b4d13189b67bb57e75cbb8ef56.stex"]
[params]

View File

@@ -1,8 +1,8 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/play_system_button_hl.png-1e926e5d1be4f71f60454646aaa44d20.stex"
type="StreamTexture2D"
path="res://.godot/imported/play_system_button_hl.png-1e926e5d1be4f71f60454646aaa44d20.stex"
metadata={
"vram_texture": false
}
@@ -10,7 +10,7 @@ metadata={
[deps]
source_file="res://play_system_button_hl.png"
dest_files=[ "res://.import/play_system_button_hl.png-1e926e5d1be4f71f60454646aaa44d20.stex" ]
dest_files=["res://.godot/imported/play_system_button_hl.png-1e926e5d1be4f71f60454646aaa44d20.stex"]
[params]

View File

@@ -2,12 +2,12 @@
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/the_comeback2.ogg-4b85e06ff00ff611cbd6022fc43aade8.oggstr"
path="res://.godot/imported/the_comeback2.ogg-4b85e06ff00ff611cbd6022fc43aade8.oggstr"
[deps]
source_file="res://the_comeback2.ogg"
dest_files=[ "res://.import/the_comeback2.ogg-4b85e06ff00ff611cbd6022fc43aade8.oggstr" ]
dest_files=["res://.godot/imported/the_comeback2.ogg-4b85e06ff00ff611cbd6022fc43aade8.oggstr"]
[params]

View File

@@ -1,6 +1,6 @@
extends Control
onready var item_list = get_node("ItemList")
@onready var item_list = get_node(^"ItemList")
func _ready():

View File

@@ -4,44 +4,44 @@
[ext_resource path="res://Intro.ogg" type="AudioStream" id=2]
[node name="Changer" type="Control"]
margin_right = 1023.0
margin_bottom = 598.0
offset_right = 1023.0
offset_bottom = 598.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ItemList" type="ItemList" parent="."]
margin_left = 57.0
margin_top = 33.0
margin_right = 960.0
margin_bottom = 228.0
offset_left = 57.0
offset_top = 33.0
offset_right = 960.0
offset_bottom = 228.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DeviceInfo" type="Label" parent="."]
margin_left = 321.0
margin_top = 248.0
margin_right = 660.0
margin_bottom = 284.0
offset_left = 321.0
offset_top = 248.0
offset_right = 660.0
offset_bottom = 284.0
align = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SetDevice" type="Button" parent="."]
margin_left = 425.723
margin_top = 309.733
margin_right = 556.723
margin_bottom = 354.733
offset_left = 425.723
offset_top = 309.733
offset_right = 556.723
offset_bottom = 354.733
text = "Set Device"
[node name="PlayAudio" type="Button" parent="."]
margin_left = 424.0
margin_top = 373.0
margin_right = 557.0
margin_bottom = 414.0
offset_left = 424.0
offset_top = 373.0
offset_right = 557.0
offset_bottom = 414.0
text = "Play Audio"
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]

View File

@@ -2,12 +2,12 @@
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr"
path="res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr"
[deps]
source_file="res://Intro.ogg"
dest_files=[ "res://.import/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr" ]
dest_files=["res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr"]
[params]

View File

@@ -1,8 +1,8 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
@@ -10,7 +10,7 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
[params]

View File

@@ -19,77 +19,77 @@ config/icon="res://icon.png"
ui_accept={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777221,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777222,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
]
]
}
ui_select={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null)
]
]
}
ui_cancel={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777217,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null)
]
]
}
ui_focus_next={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777218,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
ui_focus_prev={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
ui_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777231,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
]
]
}
ui_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777233,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
]
]
}
ui_up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777232,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
]
]
}
ui_down={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777234,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
]
]
}
ui_page_up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777235,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777235,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
ui_page_down={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777236,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777236,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
ui_home={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777229,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777229,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
ui_end={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777230,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777230,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
[rendering]

View File

@@ -2,12 +2,12 @@
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr"
path="res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr"
[deps]
source_file="res://Intro.ogg"
dest_files=[ "res://.import/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr" ]
dest_files=["res://.godot/imported/Intro.ogg-dfe75727d0e47692e220adf97ddb7ad9.oggstr"]
[params]

View File

@@ -10,10 +10,10 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -320.0
margin_top = -240.0
margin_right = 320.0
margin_bottom = 240.0
offset_left = -320.0
offset_top = -240.0
offset_right = 320.0
offset_bottom = 240.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
@@ -32,48 +32,48 @@ stream = ExtResource( 2 )
volume_db = -6.0
[node name="RecordButton" type="Button" parent="."]
margin_left = 120.0
margin_top = 100.0
margin_right = 240.0
margin_bottom = 140.0
offset_left = 120.0
offset_top = 100.0
offset_right = 240.0
offset_bottom = 140.0
text = "Record"
[node name="SaveButton" type="Button" parent="."]
margin_left = 120.0
margin_top = 180.0
margin_right = 240.0
margin_bottom = 220.0
offset_left = 120.0
offset_top = 180.0
offset_right = 240.0
offset_bottom = 220.0
disabled = true
text = "Save WAV To:"
[node name="Filename" type="LineEdit" parent="SaveButton"]
margin_left = 180.0
margin_right = 340.0
margin_bottom = 40.0
offset_left = 180.0
offset_right = 340.0
offset_bottom = 40.0
text = "user://record.wav"
caret_blink = true
caret_blink_speed = 0.5
[node name="PlayButton" type="Button" parent="."]
margin_left = 300.0
margin_top = 100.0
margin_right = 420.0
margin_bottom = 140.0
offset_left = 300.0
offset_top = 100.0
offset_right = 420.0
offset_bottom = 140.0
disabled = true
text = "Play"
[node name="PlayMusic" type="Button" parent="."]
margin_left = 120.0
margin_top = 260.0
margin_right = 240.0
margin_bottom = 300.0
offset_left = 120.0
offset_top = 260.0
offset_right = 240.0
offset_bottom = 300.0
text = "Play Music"
[node name="Status" type="Label" parent="."]
margin_left = 120.0
margin_top = 340.0
margin_right = 520.0
margin_bottom = 340.0
offset_left = 120.0
offset_top = 340.0
offset_right = 520.0
offset_bottom = 340.0
[connection signal="pressed" from="RecordButton" to="." method="_on_RecordButton_pressed"]
[connection signal="pressed" from="SaveButton" to="." method="_on_SaveButton_pressed"]

View File

@@ -1,8 +1,8 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
@@ -10,7 +10,7 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
[params]

View File

@@ -1,8 +1,8 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
@@ -10,7 +10,7 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
[params]

View File

@@ -14,8 +14,8 @@ const BlackKeyScene = preload("res://piano_keys/black_piano_key.tscn")
var piano_key_dict := Dictionary()
onready var white_keys = $WhiteKeys
onready var black_keys = $BlackKeys
@onready var white_keys = $WhiteKeys
@onready var black_keys = $BlackKeys
func _ready():
# Sanity checks.
@@ -59,10 +59,10 @@ func _create_piano_key(pitch_index):
var note_index = _pitch_index_to_note_index(pitch_index)
var piano_key: PianoKey
if _is_note_index_sharp(note_index):
piano_key = BlackKeyScene.instance()
piano_key = BlackKeyScene.instantiate()
black_keys.add_child(piano_key)
else:
piano_key = WhiteKeyScene.instance()
piano_key = WhiteKeyScene.instantiate()
white_keys.add_child(piano_key)
if _is_note_index_lacking_sharp(note_index):
_add_placeholder_key(black_keys)

View File

@@ -5,8 +5,8 @@
[node name="Piano" type="ColorRect"]
anchor_right = 1.0
anchor_bottom = 1.0
rect_min_size = Vector2( 200, 20 )
color = Color( 0, 0, 0, 1 )
rect_min_size = Vector2(200, 20)
color = Color(0, 0, 0, 1)
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
@@ -15,7 +15,7 @@ __meta__ = {
[node name="WhiteKeys" type="HBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
rect_min_size = Vector2( 200, 0 )
rect_min_size = Vector2(200, 0)
mouse_filter = 2
custom_constants/separation = 0
__meta__ = {
@@ -25,7 +25,7 @@ __meta__ = {
[node name="BlackKeys" type="HBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 0.6
rect_min_size = Vector2( 100, 0 )
rect_min_size = Vector2(100, 0)
mouse_filter = 2
custom_constants/separation = 0
__meta__ = {

View File

@@ -2,12 +2,12 @@
importer="wav"
type="AudioStreamSample"
path="res://.import/A440.wav-f6ecb7d5a329df710ac81894c403bbb6.sample"
path="res://.godot/imported/A440.wav-f6ecb7d5a329df710ac81894c403bbb6.sample"
[deps]
source_file="res://piano_keys/A440.wav"
dest_files=[ "res://.import/A440.wav-f6ecb7d5a329df710ac81894c403bbb6.sample" ]
dest_files=["res://.godot/imported/A440.wav-f6ecb7d5a329df710ac81894c403bbb6.sample"]
[params]

View File

@@ -4,8 +4,8 @@
[ext_resource path="res://piano_keys/piano_key_color.gd" type="Script" id=2]
[node name="PianoKey" type="Control"]
margin_right = 20.0
margin_bottom = 200.0
offset_right = 20.0
offset_bottom = 200.0
mouse_filter = 2
size_flags_horizontal = 3
script = ExtResource( 1 )
@@ -17,10 +17,10 @@ __meta__ = {
anchor_left = 0.5
anchor_right = 1.5
anchor_bottom = 1.0
margin_left = 2.0
margin_right = -2.0
offset_left = 2.0
offset_right = -2.0
size_flags_horizontal = 3
color = Color( 0, 0, 0, 1 )
color = Color(0, 0, 0, 1)
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false

View File

@@ -3,9 +3,9 @@ extends Control
var pitch_scale: float
onready var key: ColorRect = $Key
onready var start_color: Color = key.color
onready var color_timer: Timer = $ColorTimer
@onready var key: ColorRect = $Key
@onready var start_color: Color = key.color
@onready var color_timer: Timer = $ColorTimer
func setup(pitch_index: int):
@@ -15,14 +15,14 @@ func setup(pitch_index: int):
func activate():
key.color = (Color.yellow + start_color) / 2
key.color = (Color.YELLOW + start_color) / 2
var audio := AudioStreamPlayer.new()
add_child(audio)
audio.stream = preload("res://piano_keys/A440.wav")
audio.pitch_scale = pitch_scale
audio.play()
color_timer.start()
yield(get_tree().create_timer(8.0), "timeout")
await get_tree().create_timer(8.0).timeout
audio.queue_free()

View File

@@ -1,6 +1,6 @@
extends ColorRect
onready var parent = get_parent()
@onready var parent = get_parent()
# Yes, this script exists just for this one method.
func _gui_input(input_event):

View File

@@ -4,8 +4,8 @@
[ext_resource path="res://piano_keys/piano_key_color.gd" type="Script" id=2]
[node name="PianoKey" type="Control"]
margin_right = 20.0
margin_bottom = 200.0
offset_right = 20.0
offset_bottom = 200.0
size_flags_horizontal = 3
script = ExtResource( 1 )
__meta__ = {
@@ -15,8 +15,8 @@ __meta__ = {
[node name="Key" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 1.0
margin_right = -1.0
offset_left = 1.0
offset_right = -1.0
size_flags_horizontal = 3
script = ExtResource( 2 )
__meta__ = {

View File

@@ -8,12 +8,12 @@
config_version=4
_global_script_classes=[ {
_global_script_classes=[{
"base": "Control",
"class": "PianoKey",
"language": "GDScript",
"class": &"PianoKey",
"language": &"GDScript",
"path": "res://piano_keys/piano_key.gd"
} ]
}]
_global_script_class_icons={
"PianoKey": ""
}

View File

@@ -1,8 +1,8 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
@@ -10,7 +10,7 @@ metadata={
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
[params]

View File

@@ -2,12 +2,12 @@
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/maldita.ogg-16f33b83786e8d938ac9e0b887e47ec6.oggstr"
path="res://.godot/imported/maldita.ogg-16f33b83786e8d938ac9e0b887e47ec6.oggstr"
[deps]
source_file="res://maldita.ogg"
dest_files=[ "res://.import/maldita.ogg-16f33b83786e8d938ac9e0b887e47ec6.oggstr" ]
dest_files=["res://.godot/imported/maldita.ogg-16f33b83786e8d938ac9e0b887e47ec6.oggstr"]
[params]

View File

@@ -2,12 +2,12 @@
importer="wav"
type="AudioStreamSample"
path="res://.import/maldita.wav-82d9f1ad42df5bdfaeda0654a708cb7a.sample"
path="res://.godot/imported/maldita.wav-82d9f1ad42df5bdfaeda0654a708cb7a.sample"
[deps]
source_file="res://maldita.wav"
dest_files=[ "res://.import/maldita.wav-82d9f1ad42df5bdfaeda0654a708cb7a.sample" ]
dest_files=["res://.godot/imported/maldita.wav-82d9f1ad42df5bdfaeda0654a708cb7a.sample"]
[params]

View File

@@ -19,7 +19,7 @@ func _draw():
var magnitude: float = spectrum.get_magnitude_for_frequency_range(prev_hz, hz).length()
var energy = clamp((MIN_DB + linear2db(magnitude)) / MIN_DB, 0, 1)
var height = energy * HEIGHT
draw_rect(Rect2(w * i, HEIGHT - height, w, height), Color.white)
draw_rect(Rect2(w * i, HEIGHT - height, w, height), Color.WHITE)
prev_hz = hz