diff --git a/default_bus_layout.tres b/default_bus_layout.tres new file mode 100644 index 0000000..608b482 --- /dev/null +++ b/default_bus_layout.tres @@ -0,0 +1,9 @@ +[gd_resource type="AudioBusLayout" format=2] + +[resource] +bus/1/name = "SFX" +bus/1/solo = false +bus/1/mute = false +bus/1/bypass_fx = false +bus/1/volume_db = 0.0 +bus/1/send = "Master" diff --git a/music/gigantic-greasy-giraffe.ogg b/music/gigantic-greasy-giraffe.ogg new file mode 100644 index 0000000..87105ee Binary files /dev/null and b/music/gigantic-greasy-giraffe.ogg differ diff --git a/music/gigantic-greasy-giraffe.ogg.import b/music/gigantic-greasy-giraffe.ogg.import new file mode 100644 index 0000000..c74051a --- /dev/null +++ b/music/gigantic-greasy-giraffe.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/gigantic-greasy-giraffe.ogg-f6c5f1ef0e57d5d768517fa39e6be36c.oggstr" + +[deps] + +source_file="res://music/gigantic-greasy-giraffe.ogg" +dest_files=[ "res://.import/gigantic-greasy-giraffe.ogg-f6c5f1ef0e57d5d768517fa39e6be36c.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/project.godot b/project.godot index 354232b..7c0e44e 100644 --- a/project.godot +++ b/project.godot @@ -135,6 +135,11 @@ clear={ "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":76,"unicode":0,"echo":false,"script":null) ] } +mute={ +"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":77,"unicode":0,"echo":false,"script":null) + ] +} [network] diff --git a/scenes/file_browser.gd b/scenes/file_browser.gd index 100486b..1af3fa2 100644 --- a/scenes/file_browser.gd +++ b/scenes/file_browser.gd @@ -177,6 +177,7 @@ func item_deleted(item): func close(): text_edit.hide() + emit_signal("saved") func save(): match mode: @@ -189,7 +190,6 @@ func save(): helpers.write_file(fixme_path+open_file, text_edit.text) update() - emit_signal("saved") close() func _set_commit(new_commit): diff --git a/scenes/game.tscn b/scenes/game.tscn index c37a93b..3c49aaa 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,6 +1,12 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://scenes/game.gd" type="Script" id=1] +[ext_resource path="res://music/gigantic-greasy-giraffe.ogg" type="AudioStream" id=2] [node name="Node" type="Node"] script = ExtResource( 1 ) + +[node name="Music" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 2 ) +volume_db = -15.0 +autoplay = true diff --git a/scenes/level_select.gd b/scenes/level_select.gd index 1dfcf39..9561796 100644 --- a/scenes/level_select.gd +++ b/scenes/level_select.gd @@ -63,3 +63,12 @@ func reload(): + + +func toggle_music(): + var music = game.find_node("Music") + if music.volume_db > -20: + music.volume_db -= 100 + else: + music.volume_db += 100 + diff --git a/scenes/level_select.tscn b/scenes/level_select.tscn index ff1e8b8..2ee1296 100644 --- a/scenes/level_select.tscn +++ b/scenes/level_select.tscn @@ -56,14 +56,24 @@ margin_left = 138.588 margin_top = 59.3009 margin_right = 226.588 margin_bottom = 98.3009 +focus_mode = 0 +enabled_focus_mode = 0 text = "Reload" __meta__ = { "_edit_use_anchors_": false } -[node name="TextureRect" type="TextureRect" parent="Button2"] -margin_right = 40.0 -margin_bottom = 40.0 +[node name="Button3" type="Button" parent="."] +margin_left = 241.005 +margin_top = 58.856 +margin_right = 387.005 +margin_bottom = 97.856 +focus_mode = 0 +enabled_focus_mode = 0 +text = "Toggle music" +__meta__ = { +"_edit_use_anchors_": false +} [node name="HelpLabel" type="Label" parent="."] visible = false @@ -91,4 +101,5 @@ __meta__ = { } [connection signal="pressed" from="Button" to="." method="back"] [connection signal="pressed" from="Button2" to="." method="reload"] +[connection signal="pressed" from="Button3" to="." method="toggle_music"] [connection signal="pressed" from="HelpLabel/Button3" to="." method="onSurveyPressed"] diff --git a/scenes/main.gd b/scenes/main.gd index de94ab2..b814629 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -66,7 +66,7 @@ func load_level(level_id): $Menu/CLIBadge.active = true $Menu/CLIBadge.sparkling = false - AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), true) + AudioServer.set_bus_mute(AudioServer.get_bus_index("SFX"), true) levels.chapters[game.current_chapter].levels[game.current_level].construct() @@ -112,7 +112,7 @@ func load_level(level_id): add_child(t) t.start() yield(t, "timeout") - AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), false) + AudioServer.set_bus_mute(AudioServer.get_bus_index("SFX"), false) # FIXME: Need to clean these up when switching levels somehow. # chapter_select.select(game.current_chapter) @@ -204,6 +204,8 @@ func update_repos(): var repo = repositories[r] repo.update_everything() file_browser.update() + + input.grab_focus() func toggle_cards(): cards.visible = not cards.visible diff --git a/scenes/node.tscn b/scenes/node.tscn index d335ec1..643a44c 100644 --- a/scenes/node.tscn +++ b/scenes/node.tscn @@ -59,6 +59,7 @@ __meta__ = { [node name="Pop" type="AudioStreamPlayer2D" parent="."] stream = ExtResource( 5 ) +bus = "SFX" [node name="Area2D" type="Area2D" parent="."] diff --git a/scenes/title.tscn b/scenes/title.tscn index 22126a1..bcac0d2 100644 --- a/scenes/title.tscn +++ b/scenes/title.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=7 format=2] [ext_resource path="res://styles/theme.tres" type="Theme" id=1] -[ext_resource path="res://nodes/head.svg" type="Texture" id=2] +[ext_resource path="res://nodes/head1.svg" type="Texture" id=2] [ext_resource path="res://scenes/title.gd" type="Script" id=3] [ext_resource path="res://fonts/cabin-bold.ttf" type="DynamicFontData" id=4] [ext_resource path="res://fonts/default.tres" type="DynamicFont" id=5] @@ -24,16 +24,18 @@ __meta__ = { [node name="ColorRect" type="ColorRect" parent="."] anchor_right = 1.0 anchor_bottom = 1.0 +margin_top = -0.889893 +margin_bottom = -0.889893 color = Color( 0, 0, 0, 1 ) __meta__ = { "_edit_use_anchors_": false } [node name="Label" type="Label" parent="."] -margin_left = 794.213 -margin_top = 255.807 -margin_right = 1117.21 -margin_bottom = 365.807 +margin_left = 795.993 +margin_top = 243.349 +margin_right = 1166.99 +margin_bottom = 353.349 custom_fonts/font = SubResource( 1 ) text = "Git Guru" __meta__ = { @@ -53,15 +55,28 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="Label3" type="Label" parent="."] +margin_left = 692.22 +margin_top = 373.555 +margin_right = 1192.22 +margin_bottom = 429.555 +custom_fonts/font = ExtResource( 5 ) +custom_colors/font_color = Color( 0.533333, 0.392157, 0.392157, 1 ) +text = "Original score by winniehell" +align = 1 +__meta__ = { +"_edit_use_anchors_": false +} + [node name="head" type="Sprite" parent="."] -position = Vector2( 949.453, 168.805 ) +position = Vector2( 944.114, 185.713 ) texture = ExtResource( 2 ) [node name="VBoxContainer" type="VBoxContainer" parent="."] -margin_left = 771.152 -margin_top = 416.996 -margin_right = 1123.15 -margin_bottom = 599.996 +margin_left = 765.813 +margin_top = 465.05 +margin_right = 1117.81 +margin_bottom = 648.05 __meta__ = { "_edit_use_anchors_": false }