diff --git a/Interface.tscn b/Interface.tscn index 4985bbf..616a32f 100644 --- a/Interface.tscn +++ b/Interface.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://src/Interface.gd" type="Script" id=1] +[ext_resource path="res://music/piano.ogg" type="AudioStream" id=2] [node name="Interface" type="Control" index="0"] @@ -54,14 +55,14 @@ size_flags_horizontal = 1 size_flags_vertical = 1 alignment = 0 -[node name="AboutBtn" type="Button" parent="ReferenceRect/VertContainer" index="0"] +[node name="MusicBtn" type="CheckBox" parent="ReferenceRect/VertContainer" index="0"] anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 margin_right = 147.0 -margin_bottom = 20.0 +margin_bottom = 24.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false focus_mode = 2 @@ -69,13 +70,18 @@ mouse_filter = 0 mouse_default_cursor_shape = 0 size_flags_horizontal = 1 size_flags_vertical = 1 -toggle_mode = false +custom_colors/font_color = Color( 0, 0, 0, 1 ) +custom_colors/font_color_hover = Color( 0, 0, 0, 1 ) +custom_colors/font_color_pressed = Color( 0, 0, 0, 1 ) +toggle_mode = true +pressed = true enabled_focus_mode = 2 shortcut = null group = null -text = "About" +text = "Music" flat = false -align = 1 +align = 0 +_sections_unfolded = [ "custom_colors" ] [node name="CreditsBtn" type="Button" parent="ReferenceRect/VertContainer" index="1"] @@ -83,9 +89,9 @@ anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 24.0 +margin_top = 28.0 margin_right = 147.0 -margin_bottom = 44.0 +margin_bottom = 48.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false focus_mode = 2 @@ -101,8 +107,44 @@ text = "Credits" flat = false align = 1 -[connection signal="pressed" from="ReferenceRect/VertContainer/AboutBtn" to="." method="_on_AboutBtn_pressed"] +[node name="AboutBtn" type="Button" parent="ReferenceRect/VertContainer" index="2"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 52.0 +margin_right = 147.0 +margin_bottom = 72.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +text = "About" +flat = false +align = 1 +_sections_unfolded = [ "Margin" ] + +[node name="Music" type="AudioStreamPlayer" parent="." index="1"] + +stream = ExtResource( 2 ) +volume_db = 0.0 +pitch_scale = 1.0 +autoplay = true +mix_target = 0 +bus = "Master" + +[connection signal="toggled" from="ReferenceRect/VertContainer/MusicBtn" to="." method="_on_MusicBtn_toggled"] [connection signal="pressed" from="ReferenceRect/VertContainer/CreditsBtn" to="." method="_on_CreditsBtn_pressed"] +[connection signal="pressed" from="ReferenceRect/VertContainer/AboutBtn" to="." method="_on_AboutBtn_pressed"] + diff --git a/MainScreen.tscn b/MainScreen.tscn index 7a55a1b..43fe4d4 100644 --- a/MainScreen.tscn +++ b/MainScreen.tscn @@ -6,7 +6,7 @@ [ext_resource path="res://Clothes.tscn" type="PackedScene" id=4] [ext_resource path="res://Interface.tscn" type="PackedScene" id=5] -[node name="MainScreen" type="Node2D" index="0"] +[node name="MainScreen" type="Node2D"] [node name="Background" type="Sprite" parent="." index="0"] diff --git a/music/piano.ogg b/music/piano.ogg new file mode 100644 index 0000000..0018809 Binary files /dev/null and b/music/piano.ogg differ diff --git a/music/piano.ogg.import b/music/piano.ogg.import new file mode 100644 index 0000000..4539da1 --- /dev/null +++ b/music/piano.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/piano.ogg-602f57d4990192de77ef3342b8d9390c.oggstr" + +[deps] + +source_file="res://music/piano.ogg" +dest_files=[ "res://.import/piano.ogg-602f57d4990192de77ef3342b8d9390c.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/src/Interface.gd b/src/Interface.gd index dbec17b..2579f9a 100644 --- a/src/Interface.gd +++ b/src/Interface.gd @@ -14,3 +14,9 @@ func _on_AboutBtn_pressed(): func _on_CreditsBtn_pressed(): var win_instance = credits_win.instance() add_child(win_instance) + +func _on_MusicBtn_toggled(button_pressed): + if button_pressed == true: + $Music.play() + else: + $Music.stop() diff --git a/src/WindowControl.gd b/src/WindowControl.gd index bf6f23c..83aa0ba 100644 --- a/src/WindowControl.gd +++ b/src/WindowControl.gd @@ -3,8 +3,8 @@ tool extends Control -const DEFUALT_CONTENT_HEIGHT = 216 -const DEFUALT_PANEL_SIZE = Vector2(351, 216) +const DEFUALT_CONTENT_HEIGHT = 217 +const DEFUALT_PANEL_SIZE = Vector2(351, 217) export var toolbar_title = "" export var content_text = "" diff --git a/widgets/WindowControl.tscn b/widgets/WindowControl.tscn index dd99171..6251461 100644 --- a/widgets/WindowControl.tscn +++ b/widgets/WindowControl.tscn @@ -28,7 +28,7 @@ anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 margin_right = 351.0 -margin_bottom = 247.0 +margin_bottom = 249.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false mouse_filter = 0 @@ -61,6 +61,7 @@ anchor_top = 0.0 anchor_right = 1.0 anchor_bottom = 1.0 margin_right = 1.0 +margin_bottom = 1.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false mouse_filter = 0