Add final progression to tiny sword, fixes and tweeks required
This commit is contained in:
@@ -1,20 +1,26 @@
|
||||
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")
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
if game_state:
|
||||
game_state.goal_completed.connect(_on_goal_completed)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func _on_area_2d_mouse_entered() -> void:
|
||||
## TODO: remove this comment to enable prestige panel
|
||||
#_prestige_panel.visible = true
|
||||
pass
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user