Small Godot Wild Jam game
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Darken buttons and play sound when mouse enters during event menu

+46 -1
+30
Scenes/dialogue/dialogue_container.gd
··· 3 3 @onready var npc_name_label: Label = %NpcNameLabel 4 4 @onready var npc_text_label: Label = %NpcTextLabel 5 5 @onready var fact_listlabel: Label = %FactListlabel 6 + @onready var mouse_over_sound: AudioStreamPlayer = $MouseOverSound 6 7 7 8 var correct_choice: int 9 + 10 + @onready var doc_button: TextureButton = $MarginContainer/HBoxContainer/VBoxContainer2/HBoxContainer/DocButton 11 + @onready var priest_button: TextureButton = $MarginContainer/HBoxContainer/VBoxContainer2/HBoxContainer/PriestButton 12 + @onready var close_btn: TextureButton = $MarginContainer/HBoxContainer/MarginContainer/Close 13 + 8 14 9 15 var dialogues_array: Array = [ 10 16 ['"Help... I can\'t feel my legs..."', ··· 89 95 if Global.PAUSE_ON_EVENT: 90 96 get_tree().paused = false 91 97 queue_free() 98 + 99 + 100 + func _on_button_mouse_entered() -> void: 101 + mouse_over_sound.play() 102 + 103 + enum TARGET_BUTTON {DOCTOR, PRIEST, CLOSE} 104 + 105 + func _on_button_mouse_entered_style(target: TARGET_BUTTON) -> void: 106 + match target: 107 + TARGET_BUTTON.DOCTOR: 108 + doc_button.modulate = Color.from_rgba8(200, 200, 200, 255) 109 + TARGET_BUTTON.PRIEST: 110 + priest_button.modulate = Color.from_rgba8(200, 200, 200, 255) 111 + TARGET_BUTTON.CLOSE: 112 + close_btn.modulate = Color.from_rgba8(200, 200, 200, 255) 113 + 114 + func _on_button_mouse_exit_style(target: TARGET_BUTTON) -> void: 115 + match target: 116 + TARGET_BUTTON.DOCTOR: 117 + doc_button.modulate = Color.WHITE 118 + TARGET_BUTTON.PRIEST: 119 + priest_button.modulate = Color.WHITE 120 + TARGET_BUTTON.CLOSE: 121 + close_btn.modulate = Color.WHITE
+16 -1
Scenes/dialogue/dialogue_container.tscn
··· 1 - [gd_scene load_steps=11 format=3 uid="uid://bld26qu1653j7"] 1 + [gd_scene load_steps=12 format=3 uid="uid://bld26qu1653j7"] 2 2 3 3 [ext_resource type="Script" uid="uid://klc3667wvlap" path="res://Scenes/dialogue/dialogue_container.gd" id="1_2bcfh"] 4 4 [ext_resource type="Texture2D" uid="uid://da653ustssjlf" path="res://Assets/sprites/doctor_image.png" id="1_a1ce6"] ··· 6 6 [ext_resource type="LabelSettings" uid="uid://0j6iv7y6s63s" path="res://Resources/label_settings/dialogue_label_settings.tres" id="2_gsca2"] 7 7 [ext_resource type="Texture2D" uid="uid://blimkuqy7it1d" path="res://Assets/sprites/priest_image.png" id="2_weph6"] 8 8 [ext_resource type="Texture2D" uid="uid://dbdmfowmbb455" path="res://Assets/sprites/cross.png" id="6_s0dfk"] 9 + [ext_resource type="AudioStream" uid="uid://bjy16rs73d1sx" path="res://Assets/sfx/menu_switch.wav" id="7_lqmlw"] 9 10 10 11 [sub_resource type="LabelSettings" id="LabelSettings_gbuxj"] 11 12 font_size = 48 ··· 130 131 131 132 [node name="Close" type="TextureButton" parent="MarginContainer/HBoxContainer/MarginContainer"] 132 133 layout_mode = 2 134 + mouse_default_cursor_shape = 2 133 135 texture_normal = SubResource("AtlasTexture_lqmlw") 134 136 137 + [node name="MouseOverSound" type="AudioStreamPlayer" parent="."] 138 + stream = ExtResource("7_lqmlw") 139 + bus = &"SFX" 140 + 141 + [connection signal="mouse_entered" from="MarginContainer/HBoxContainer/VBoxContainer2/HBoxContainer/DocButton" to="." method="_on_button_mouse_entered"] 142 + [connection signal="mouse_entered" from="MarginContainer/HBoxContainer/VBoxContainer2/HBoxContainer/DocButton" to="." method="_on_button_mouse_entered_style" binds= [0]] 143 + [connection signal="mouse_exited" from="MarginContainer/HBoxContainer/VBoxContainer2/HBoxContainer/DocButton" to="." method="_on_button_mouse_exit_style" binds= [0]] 135 144 [connection signal="pressed" from="MarginContainer/HBoxContainer/VBoxContainer2/HBoxContainer/DocButton" to="." method="_on_doc_button_pressed"] 145 + [connection signal="mouse_entered" from="MarginContainer/HBoxContainer/VBoxContainer2/HBoxContainer/PriestButton" to="." method="_on_button_mouse_entered"] 146 + [connection signal="mouse_entered" from="MarginContainer/HBoxContainer/VBoxContainer2/HBoxContainer/PriestButton" to="." method="_on_button_mouse_entered_style" binds= [1]] 147 + [connection signal="mouse_exited" from="MarginContainer/HBoxContainer/VBoxContainer2/HBoxContainer/PriestButton" to="." method="_on_button_mouse_exit_style" binds= [1]] 136 148 [connection signal="pressed" from="MarginContainer/HBoxContainer/VBoxContainer2/HBoxContainer/PriestButton" to="." method="_on_priest_button_pressed"] 137 149 [connection signal="button_down" from="MarginContainer/HBoxContainer/MarginContainer/Close" to="." method="_on_close_button_down"] 150 + [connection signal="mouse_entered" from="MarginContainer/HBoxContainer/MarginContainer/Close" to="." method="_on_button_mouse_entered"] 151 + [connection signal="mouse_entered" from="MarginContainer/HBoxContainer/MarginContainer/Close" to="." method="_on_button_mouse_entered_style" binds= [2]] 152 + [connection signal="mouse_exited" from="MarginContainer/HBoxContainer/MarginContainer/Close" to="." method="_on_button_mouse_exit_style" binds= [2]]