Add tooltip component and integrate it into the scene; adjust audio volume for coin sound effect

This commit is contained in:
2025-05-03 04:34:31 +02:00
parent 8c9afeee27
commit 17387c32ea
8 changed files with 144 additions and 7 deletions

View File

@@ -0,0 +1,42 @@
class_name TooltipComponent
extends Node
@export var area2d: Area2D
@export var ui_root: Control
@export var text: String = ""
@export var tooltip_label: Label
func _ready() -> void:
if not area2d:
printerr("Tooltip node missing Area2D child.")
return
if not ui_root:
printerr("Tooltip node missing UI root child.")
return
if not tooltip_label:
printerr("Tooltip node missing tooltip label child.")
return
tooltip_label.text = text
ui_root.visible = false
area2d.body_entered.connect(_on_area2d_body_entered)
area2d.body_exited.connect(_on_area2d_body_exited)
func show_tooltip() -> void:
ui_root.visible = true
func hide_tooltip() -> void:
ui_root.visible = false
func _on_area2d_body_entered(_body: Node) -> void:
show_tooltip()
func _on_area2d_body_exited(_body: Node) -> void:
hide_tooltip()

View File

@@ -0,0 +1,13 @@
class_name SteamIntegration
extends Node
var app_id: String = "3575090"
func _init() -> void:
OS.set_environment("STEAM_APP_ID", app_id)
OS.set_environment("STEAM_GAME_ID", app_id)
func _ready() -> void:
pass