From eb5bf32bb8c1b5d2c59bf07cfd41a36c173b88a2 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Sun, 5 Apr 2026 19:56:45 -0400 Subject: [PATCH] Dialogue button updates --- docs/todo.txt | 7 ++++++ scenes/dialogue_scene.tscn | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 docs/todo.txt diff --git a/docs/todo.txt b/docs/todo.txt new file mode 100644 index 0000000..12c8789 --- /dev/null +++ b/docs/todo.txt @@ -0,0 +1,7 @@ +* Debug menu on F1, right now just include quick scene swapping +* Finish buttons on dialogue scene +* Reogranize files +* Singletons named 'XXXServer' +* Dialogue scene command system (ShowText, ShowSprite, MoveSprite, PlaySound, ChangeBackground, etc) +* Setup room system (everything is unpassable, carve out rooms, walls automatic, specify connections between rooms on tiles) +* Basic map editor (test map data will be harder to craft the more we add) \ No newline at end of file diff --git a/scenes/dialogue_scene.tscn b/scenes/dialogue_scene.tscn index e660f51..c592acb 100644 --- a/scenes/dialogue_scene.tscn +++ b/scenes/dialogue_scene.tscn @@ -3,6 +3,30 @@ [ext_resource type="Texture2D" uid="uid://cyl18yt5hxyb5" path="res://assets/sprites/dialogue_ui.BMP" id="1_cno1m"] [ext_resource type="Theme" uid="uid://dx26d6py3n8xi" path="res://resources/main_ui_theme.tres" id="1_qpcyj"] [ext_resource type="Texture2D" uid="uid://dj621xih5cam7" path="res://assets/sprites/dialogue_continue.BMP" id="2_qpcyj"] +[ext_resource type="AudioStream" uid="uid://5ndo4w06umsa" path="res://assets/sounds/SE020.WAV" id="4_hover"] + +[sub_resource type="GDScript" id="GDScript_hover"] +resource_name = "DialogueButtonHover" +script/source = "extends HBoxContainer + +@onready var hover_sfx: AudioStreamPlayer = $HoverSFX +@onready var hover_node: TextureRect = $Hover + +func _ready() -> void: + hover_node.visible = false + for child in get_children(): + if child is TextureButton: + child.mouse_entered.connect(_on_button_hovered.bind(child)) + child.mouse_exited.connect(_on_button_unhovered) + +func _on_button_hovered(button: TextureButton) -> void: + hover_sfx.play() + hover_node.reparent(button, false) + hover_node.visible = true + +func _on_button_unhovered() -> void: + hover_node.visible = false +" [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cno1m"] bg_color = Color(0, 0, 0, 1) @@ -112,6 +136,13 @@ animations = [{ atlas = ExtResource("1_cno1m") region = Rect2(1, 257, 22, 25) +[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_qpcyj"] +blend_mode = 1 + +[sub_resource type="AtlasTexture" id="AtlasTexture_gkt67"] +atlas = ExtResource("1_cno1m") +region = Rect2(114, 255, 18, 17) + [sub_resource type="AtlasTexture" id="AtlasTexture_qpcyj"] atlas = ExtResource("1_cno1m") region = Rect2(23, 257, 22, 25) @@ -213,6 +244,20 @@ size_flags_horizontal = 3 [node name="DialogueButtons" type="HBoxContainer" parent="VerticalScreen/DialogueBox/VerticalDBox/BottomRow" unique_id=1572455129] layout_mode = 2 +script = SubResource("GDScript_hover") + +[node name="HoverSFX" type="AudioStreamPlayer" parent="VerticalScreen/DialogueBox/VerticalDBox/BottomRow/DialogueButtons"] +stream = ExtResource("4_hover") + +[node name="Hover" type="TextureRect" parent="VerticalScreen/DialogueBox/VerticalDBox/BottomRow/DialogueButtons" unique_id=1721109871] +self_modulate = Color(1, 1, 1, 0.28235295) +material = SubResource("CanvasItemMaterial_qpcyj") +layout_mode = 0 +offset_left = 2.0 +offset_top = -7.0 +offset_right = 20.0 +offset_bottom = 18.0 +texture = SubResource("AtlasTexture_gkt67") [node name="History" type="TextureButton" parent="VerticalScreen/DialogueBox/VerticalDBox/BottomRow/DialogueButtons" unique_id=535301616] layout_mode = 2