27 lines
686 B
GDScript
27 lines
686 B
GDScript
extends Node2D
|
|
|
|
const PRESTIGE_GOAL_ID: StringName = &"gold_350k_wood_20k"
|
|
|
|
@onready var _prestige_panel: PrestigePanel = $PrestigePanel
|
|
@onready var game_state: LevelGameState = find_parent("LevelGameState")
|
|
|
|
|
|
func _ready() -> void:
|
|
if game_state:
|
|
game_state.goal_completed.connect(_on_goal_completed)
|
|
|
|
|
|
func _on_area_2d_mouse_entered() -> void:
|
|
if game_state and game_state.is_goal_completed(PRESTIGE_GOAL_ID):
|
|
_prestige_panel.visible = true
|
|
|
|
|
|
func _on_area_2d_mouse_exited() -> void:
|
|
_prestige_panel.visible = false
|
|
|
|
|
|
func _on_goal_completed(goal_id: StringName) -> void:
|
|
if goal_id == PRESTIGE_GOAL_ID:
|
|
# Prestige is now unlocked — panel will show on next hover.
|
|
pass
|