ajout d'un bouton, sur l'ecran de login, pour mettre on/off le son de la musique de fond.
This commit is contained in:
parent
a6efe8d4f6
commit
740637173f
4 changed files with 44 additions and 4 deletions
BIN
assets/GUI/images/Login-Khanat-sound-button.png
Normal file
BIN
assets/GUI/images/Login-Khanat-sound-button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
assets/GUI/images/Login-Khanat-sound-muted-button.png
Normal file
BIN
assets/GUI/images/Login-Khanat-sound-muted-button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
|
@ -12,3 +12,10 @@ func _on_play_button_pressed():
|
|||
|
||||
func _on_quit_button_pressed():
|
||||
self.get_tree().quit()
|
||||
|
||||
|
||||
func _on_sound_button_toggled( button_pressed ):
|
||||
if button_pressed:
|
||||
global.get_node( "audio_stream_player" ).stop()
|
||||
else:
|
||||
global.get_node( "audio_stream_player" ).play()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=15 format=2]
|
||||
[gd_scene load_steps=17 format=2]
|
||||
|
||||
[ext_resource path="res://assets/GUI/themes/login_theme.theme" type="Theme" id=1]
|
||||
[ext_resource path="res://gui_scene/GUI/login/login_menu.gd" type="Script" id=2]
|
||||
|
@ -9,6 +9,8 @@
|
|||
[ext_resource path="res://assets/GUI/images/Login-Khanat-settings-button.png" type="Texture" id=7]
|
||||
[ext_resource path="res://assets/GUI/images/Login-Khanat-quit-button.png" type="Texture" id=8]
|
||||
[ext_resource path="res://assets/GUI/fonts/ryzom.ttf" type="DynamicFontData" id=9]
|
||||
[ext_resource path="res://assets/GUI/images/Login-Khanat-sound-button.png" type="Texture" id=10]
|
||||
[ext_resource path="res://assets/GUI/images/Login-Khanat-sound-muted-button.png" type="Texture" id=11]
|
||||
|
||||
[sub_resource type="CanvasItemMaterial" id=1]
|
||||
|
||||
|
@ -43,7 +45,7 @@ use_filter = false
|
|||
font_data = ExtResource( 9 )
|
||||
_sections_unfolded = [ "Extra Spacing", "Font", "Settings" ]
|
||||
|
||||
[node name="login_menu" type="Control"]
|
||||
[node name="login_menu" type="Control" index="0"]
|
||||
|
||||
material = SubResource( 1 )
|
||||
anchor_left = 0.0
|
||||
|
@ -521,7 +523,7 @@ anchor_right = 0.0
|
|||
anchor_bottom = 0.0
|
||||
margin_top = 65.0
|
||||
margin_right = 510.0
|
||||
margin_bottom = 285.0
|
||||
margin_bottom = 362.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
|
@ -543,7 +545,7 @@ anchor_bottom = 0.0
|
|||
margin_left = 32.0
|
||||
margin_top = 32.0
|
||||
margin_right = 478.0
|
||||
margin_bottom = 220.0
|
||||
margin_bottom = 297.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
|
@ -556,6 +558,7 @@ _sections_unfolded = [ "Margin", "custom_constants" ]
|
|||
|
||||
[node name="email_box" type="VBoxContainer" parent="h_box_container/v_box_container/margin_container/login_box" index="0"]
|
||||
|
||||
editor/display_folded = true
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
|
@ -665,6 +668,7 @@ _sections_unfolded = [ "Material", "Placeholder", "Visibility", "custom_colors",
|
|||
|
||||
[node name="password_box" type="VBoxContainer" parent="h_box_container/v_box_container/margin_container/login_box" index="1"]
|
||||
|
||||
editor/display_folded = true
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
|
@ -775,6 +779,7 @@ _sections_unfolded = [ "Material", "Placeholder", "Visibility", "custom_colors",
|
|||
|
||||
[node name="h_box_container" type="HBoxContainer" parent="h_box_container/v_box_container/margin_container/login_box" index="2"]
|
||||
|
||||
editor/display_folded = true
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
|
@ -792,6 +797,7 @@ alignment = 0
|
|||
|
||||
[node name="checkboxs_box" type="VBoxContainer" parent="h_box_container/v_box_container/margin_container/login_box/h_box_container" index="0"]
|
||||
|
||||
editor/display_folded = true
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
|
@ -890,6 +896,31 @@ flat = false
|
|||
align = 1
|
||||
_sections_unfolded = [ "Margin", "Material", "Rect", "Size Flags", "Theme", "Visibility", "custom_colors", "custom_constants", "custom_fonts" ]
|
||||
|
||||
[node name="sound_button" type="TextureButton" parent="h_box_container/v_box_container/margin_container/login_box" index="3"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 392.0
|
||||
margin_top = 204.0
|
||||
margin_right = 446.0
|
||||
margin_bottom = 265.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 = 10
|
||||
size_flags_vertical = 1
|
||||
toggle_mode = true
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
texture_normal = ExtResource( 10 )
|
||||
texture_pressed = ExtResource( 11 )
|
||||
_sections_unfolded = [ "Size Flags", "Textures" ]
|
||||
|
||||
[connection signal="pressed" from="center_container/v_box_container/login_button" to="." method="_on_login_button_pressed"]
|
||||
|
||||
[connection signal="pressed" from="center_container/v_box_container/quit_button" to="center_container/v_box_container/quit_button" method="_on_quit_button_pressed"]
|
||||
|
@ -898,4 +929,6 @@ _sections_unfolded = [ "Margin", "Material", "Rect", "Size Flags", "Theme", "Vis
|
|||
|
||||
[connection signal="pressed" from="h_box_container/v_box_container/margin_container/login_box/h_box_container/play_button" to="." method="_on_play_button_pressed"]
|
||||
|
||||
[connection signal="toggled" from="h_box_container/v_box_container/margin_container/login_box/sound_button" to="." method="_on_sound_button_toggled"]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue