the sound of silence, closes #43

This commit is contained in:
2024-02-10 22:58:21 +01:00
parent c36ad18989
commit 51d062e734
9 changed files with 347 additions and 18 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"]

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
stroke-width="1.5"
viewBox="0 0 64 64"
fill="none"
color="#000000"
version="1.1"
id="svg3"
sodipodi:docname="music-double-note-disabled.svg"
inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs3" />
<sodipodi:namedview
id="namedview3"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="5.3401293"
inkscape:cx="51.215988"
inkscape:cy="36.984123"
inkscape:window-width="1920"
inkscape:window-height="971"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg3" />
<path
d="M 61.401264,38.533592 V 2.5986797 L 20.974521,9.1322999 V 45.067212"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path1"
style="fill:none;fill-opacity:1;stroke-width:5.197;stroke-dasharray:none;stroke:#000000;stroke-opacity:1" />
<path
d="m 50.375792,54.867641 h 3.675155 c 4.059581,0 7.350317,-2.925101 7.350317,-6.533623 V 38.533592 H 50.375792 c -4.059585,0 -7.350321,2.925101 -7.350321,6.53362 v 3.266806 c 0,3.608522 3.290736,6.533623 7.350321,6.533623 z"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path2"
style="fill:none;fill-opacity:1;stroke-width:5.197;stroke-dasharray:none;stroke:#000000;stroke-opacity:1" />
<path
d="m 9.9490451,61.401264 h 3.6751589 c 4.05947,0 7.350317,-2.925104 7.350317,-6.533623 V 45.067212 H 9.9490451 c -4.0594695,0 -7.3503171,2.925104 -7.3503171,6.533619 v 3.26681 c 0,3.608519 3.2908476,6.533623 7.3503171,6.533623 z"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path3"
style="fill:none;fill-opacity:1;stroke-width:5.197;stroke-dasharray:none;stroke:#000000;stroke-opacity:1" />
<path
style="fill:#ff0000;stroke:#f40a09;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:none"
d="M 7.4308899,51.792606 53.261256,12.207394"
id="path6" />
<path
style="fill:#ff0000;stroke:#f40a09;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 53.261256,51.792606 7.4308899,12.207394"
id="path6-3" />
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
stroke-width="1.5"
viewBox="0 0 64 64"
fill="none"
color="#000000"
version="1.1"
id="svg3"
sodipodi:docname="music-double-note-hover-disabled.svg"
inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs3" />
<sodipodi:namedview
id="namedview3"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="5.3401293"
inkscape:cx="51.215988"
inkscape:cy="36.984123"
inkscape:window-width="1920"
inkscape:window-height="971"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg3" />
<path
d="M 61.401264,38.533592 V 2.5986797 L 20.974521,9.1322999 V 45.067212"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path1"
style="fill:none;fill-opacity:1;stroke-width:5.197;stroke-dasharray:none;stroke:#bd2ab0;stroke-opacity:1" />
<path
d="m 50.375792,54.867641 h 3.675155 c 4.059581,0 7.350317,-2.925101 7.350317,-6.533623 V 38.533592 H 50.375792 c -4.059585,0 -7.350321,2.925101 -7.350321,6.53362 v 3.266806 c 0,3.608522 3.290736,6.533623 7.350321,6.533623 z"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path2"
style="fill:none;fill-opacity:1;stroke-width:5.197;stroke-dasharray:none;stroke:#bd2ab0;stroke-opacity:1" />
<path
d="m 9.9490451,61.401264 h 3.6751589 c 4.05947,0 7.350317,-2.925104 7.350317,-6.533623 V 45.067212 H 9.9490451 c -4.0594695,0 -7.3503171,2.925104 -7.3503171,6.533619 v 3.26681 c 0,3.608519 3.2908476,6.533623 7.3503171,6.533623 z"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path3"
style="fill:none;fill-opacity:1;stroke-width:5.197;stroke-dasharray:none;stroke:#bd2ab0;stroke-opacity:1" />
<path
style="fill:#ff0000;stroke:#f40a09;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:none"
d="M 7.4308899,51.792606 53.261256,12.207394"
id="path6" />
<path
style="fill:#ff0000;stroke:#f40a09;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
d="M 53.261256,51.792606 7.4308899,12.207394"
id="path6-3" />
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
stroke-width="1.5"
viewBox="0 0 64 64"
fill="none"
color="#000000"
version="1.1"
id="svg3"
sodipodi:docname="music-double-note-hover.svg"
inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs3" />
<sodipodi:namedview
id="namedview3"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="3.7760417"
inkscape:cx="88.055172"
inkscape:cy="40.915862"
inkscape:window-width="1920"
inkscape:window-height="971"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg3" />
<path
d="M 61.401264,38.533592 V 2.5986797 L 20.974521,9.1322999 V 45.067212"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path1"
style="fill:none;fill-opacity:1;stroke-width:5.197;stroke-dasharray:none;stroke:#bd2ab0;stroke-opacity:1" />
<path
d="m 50.375792,54.867641 h 3.675155 c 4.059581,0 7.350317,-2.925101 7.350317,-6.533623 V 38.533592 H 50.375792 c -4.059585,0 -7.350321,2.925101 -7.350321,6.53362 v 3.266806 c 0,3.608522 3.290736,6.533623 7.350321,6.533623 z"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path2"
style="fill:none;fill-opacity:1;stroke-width:5.197;stroke-dasharray:none;stroke:#bd2ab0;stroke-opacity:1" />
<path
d="m 9.9490451,61.401264 h 3.6751589 c 4.05947,0 7.350317,-2.925104 7.350317,-6.533623 V 45.067212 H 9.9490451 c -4.0594695,0 -7.3503171,2.925104 -7.3503171,6.533619 v 3.26681 c 0,3.608519 3.2908476,6.533623 7.3503171,6.533623 z"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path3"
style="fill:none;fill-opacity:1;stroke-width:5.197;stroke-dasharray:none;stroke:#bd2ab0;stroke-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
stroke-width="1.5"
viewBox="0 0 64 64"
fill="none"
color="#000000"
version="1.1"
id="svg3"
sodipodi:docname="music-double-note.svg"
inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs3" />
<sodipodi:namedview
id="namedview3"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="3.7760417"
inkscape:cx="109.50621"
inkscape:cy="128.57379"
inkscape:window-width="1920"
inkscape:window-height="971"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg3" />
<path
d="M 61.401264,38.533592 V 2.5986797 L 20.974521,9.1322999 V 45.067212"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path1" />
<path
d="m 50.375792,54.867641 h 3.675155 c 4.059581,0 7.350317,-2.925101 7.350317,-6.533623 V 38.533592 H 50.375792 c -4.059585,0 -7.350321,2.925101 -7.350321,6.53362 v 3.266806 c 0,3.608522 3.290736,6.533623 7.350321,6.533623 z"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path2" />
<path
d="m 9.9490451,61.401264 h 3.6751589 c 4.05947,0 7.350317,-2.925104 7.350317,-6.533623 V 45.067212 H 9.9490451 c -4.0594695,0 -7.3503171,2.925104 -7.3503171,6.533619 v 3.26681 c 0,3.608519 3.2908476,6.533623 7.3503171,6.533623 z"
stroke="#000000"
stroke-width="5.19747"
stroke-linecap="round"
stroke-linejoin="round"
id="path3" />
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB