diff --git a/addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn b/addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn
index 1a5e0676..b7b22f66 100644
--- a/addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn
+++ b/addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn
@@ -41,18 +41,18 @@ __meta__ = {
}
[node name="TextureRect" type="TextureRect" parent="main/main"]
-margin_top = 92.0
+margin_top = 55.0
margin_right = 616.0
-margin_bottom = 318.0
+margin_bottom = 355.0
texture = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="buttons" type="VBoxContainer" parent="main/main"]
-margin_top = 418.0
+margin_top = 455.0
margin_right = 616.0
-margin_bottom = 658.0
+margin_bottom = 695.0
custom_constants/separation = 10
__meta__ = {
"_edit_use_anchors_": false
diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/MusicButton.gd b/gymkhana/addons/escoria-ui-return-monkey-island/MusicButton.gd
new file mode 100644
index 00000000..d3f6fc9b
--- /dev/null
+++ b/gymkhana/addons/escoria-ui-return-monkey-island/MusicButton.gd
@@ -0,0 +1,20 @@
+extends TextureButton
+
+export(Texture) var musicEnabledTexture: Texture
+export(Texture) var musicEnabledHoverTexture: Texture
+
+export(Texture) var musicDisabledTexture: Texture
+export(Texture) var musicDisabledHoverTexture: Texture
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+ pass # Replace with function body.
+
+func _process(delta: float):
+ if escoria.game_scene.musicEnabled == true:
+ texture_normal = musicEnabledTexture
+ texture_hover = musicEnabledHoverTexture
+ else:
+ texture_normal = musicDisabledTexture
+ texture_hover = musicDisabledHoverTexture
+
diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/buttons/MusicButton.gd b/gymkhana/addons/escoria-ui-return-monkey-island/buttons/MusicButton.gd
new file mode 100644
index 00000000..be1c77e2
--- /dev/null
+++ b/gymkhana/addons/escoria-ui-return-monkey-island/buttons/MusicButton.gd
@@ -0,0 +1,10 @@
+extends Button
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+ pass # Replace with function body.
+
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+#func _process(delta):
+# pass
diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/game.gd b/gymkhana/addons/escoria-ui-return-monkey-island/game.gd
index c167f502..0e260799 100644
--- a/gymkhana/addons/escoria-ui-return-monkey-island/game.gd
+++ b/gymkhana/addons/escoria-ui-return-monkey-island/game.gd
@@ -100,7 +100,7 @@ func _ready():
func _enter_tree():
- var room_selector_parent = $CanvasLayer/ui/menu_button/VBoxContainer
+ var room_selector_parent = $CanvasLayer/ui/menu_button/HBoxContainer
if ESCProjectSettingsManager.get_setting(ESCProjectSettingsManager.ENABLE_ROOM_SELECTOR) \
and room_selector_parent.get_node_or_null("room_select") == null:
@@ -494,3 +494,24 @@ func play_video(video_file: String) -> void:
func clear_tooltip():
if tooltip_node != null:
(tooltip_node as ESCRichTooltip).clear()
+
+
+var musicEnabled = true
+
+func _on_MusicButton_pressed():
+ if musicEnabled:
+ AudioServer.set_bus_volume_db(
+ AudioServer.get_bus_index(escoria.BUS_MUSIC),
+ linear2db(0)
+ )
+ musicEnabled = false
+ else:
+ AudioServer.set_bus_volume_db(
+ AudioServer.get_bus_index(escoria.BUS_MUSIC),
+ linear2db(
+ ESCProjectSettingsManager.get_setting(
+ ESCProjectSettingsManager.MUSIC_VOLUME
+ )
+ )
+ )
+ musicEnabled = true
diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/game.tscn b/gymkhana/addons/escoria-ui-return-monkey-island/game.tscn
index e5f78bef..6bc85967 100644
--- a/gymkhana/addons/escoria-ui-return-monkey-island/game.tscn
+++ b/gymkhana/addons/escoria-ui-return-monkey-island/game.tscn
@@ -1,15 +1,21 @@
-[gd_scene load_steps=11 format=2]
+[gd_scene load_steps=17 format=2]
[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/inventory/inventory_ui.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/escoria-core/game/scenes/dialogs/esc_dialog_player.gd" type="Script" id=2]
[ext_resource path="res://addons/escoria-core/game/scenes/camera_player/camera.tscn" type="PackedScene" id=3]
[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.tscn" type="PackedScene" id=4]
[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/game.gd" type="Script" id=5]
+[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note.svg" type="Texture" id=6]
[ext_resource path="res://addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn" type="PackedScene" id=7]
[ext_resource path="res://addons/escoria-core/ui_library/menus/pause_menu/pause_menu.tscn" type="PackedScene" id=8]
[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/theme.tres" type="Theme" id=9]
+[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/icons/cog-64-hover.svg" type="Texture" id=10]
[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/icons/cog-64.svg" type="Texture" id=11]
[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/video_player/video_player.tscn" type="PackedScene" id=12]
+[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-hover.svg" type="Texture" id=13]
+[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/MusicButton.gd" type="Script" id=14]
+[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-hover-disabled.svg" type="Texture" id=15]
+[ext_resource path="res://gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-disabled.svg" type="Texture" id=16]
[node name="game" type="Node2D"]
script = ExtResource( 5 )
@@ -41,21 +47,35 @@ theme = ExtResource( 9 )
[node name="menu_button" type="Control" parent="CanvasLayer/ui"]
margin_left = 1245.0
-margin_top = -644.0
-margin_right = 1322.0
-margin_bottom = -606.0
+margin_top = -643.0
+margin_right = 1245.0
+margin_bottom = -643.0
+grow_horizontal = 2
+grow_vertical = 2
-[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/ui/menu_button"]
-margin_left = -52.0
+[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/ui/menu_button"]
+margin_left = -135.0
margin_top = 6.0
-margin_right = 24.0
-margin_bottom = 80.0
+margin_right = 21.0
+margin_bottom = 76.0
+alignment = 1
-[node name="MenuButton" type="Button" parent="CanvasLayer/ui/menu_button/VBoxContainer"]
-margin_right = 76.0
+[node name="MusicButton" type="TextureButton" parent="CanvasLayer/ui/menu_button/HBoxContainer"]
+margin_left = 44.0
+margin_right = 44.0
margin_bottom = 70.0
-icon = ExtResource( 11 )
-flat = true
+script = ExtResource( 14 )
+musicEnabledTexture = ExtResource( 6 )
+musicEnabledHoverTexture = ExtResource( 13 )
+musicDisabledTexture = ExtResource( 16 )
+musicDisabledHoverTexture = ExtResource( 15 )
+
+[node name="MenuButton" type="TextureButton" parent="CanvasLayer/ui/menu_button/HBoxContainer"]
+margin_left = 48.0
+margin_right = 112.0
+margin_bottom = 70.0
+texture_normal = ExtResource( 11 )
+texture_hover = ExtResource( 10 )
[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/ui"]
anchor_right = 1.0
@@ -98,4 +118,5 @@ offset_from_cursor_action2 = Vector2( 0, -20 )
offset_from_cursor_action3 = Vector2( 0, 55 )
offset_from_cursor_action4 = Vector2( 0, -55 )
-[connection signal="pressed" from="CanvasLayer/ui/menu_button/VBoxContainer/MenuButton" to="." method="_on_MenuButton_pressed"]
+[connection signal="pressed" from="CanvasLayer/ui/menu_button/HBoxContainer/MusicButton" to="." method="_on_MusicButton_pressed"]
+[connection signal="pressed" from="CanvasLayer/ui/menu_button/HBoxContainer/MenuButton" to="." method="_on_MenuButton_pressed"]
diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-disabled.svg b/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-disabled.svg
new file mode 100644
index 00000000..b26da9a1
--- /dev/null
+++ b/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-disabled.svg
@@ -0,0 +1,69 @@
+
+
diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-hover-disabled.svg b/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-hover-disabled.svg
new file mode 100644
index 00000000..eecbc359
--- /dev/null
+++ b/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-hover-disabled.svg
@@ -0,0 +1,69 @@
+
+
diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-hover.svg b/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-hover.svg
new file mode 100644
index 00000000..96294c2f
--- /dev/null
+++ b/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note-hover.svg
@@ -0,0 +1,61 @@
+
+
diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note.svg b/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note.svg
new file mode 100644
index 00000000..1c46694d
--- /dev/null
+++ b/gymkhana/addons/escoria-ui-return-monkey-island/icons/music-double-note.svg
@@ -0,0 +1,58 @@
+
+