extends Control class_name Help signal tutorial_passed func _ready(): %EnergyTutorial.hide() %PlantInfoTutorial.hide() %MutationTutorial.hide() %PlantpointsTutorial.hide() func display_energy_tutorial(): %EnergyTutorialInfo.update(3,3,false) %EnergyTutorialAnimationPlayer.play("appear") Pointer.action_disabled = true func display_plant_info_tutorial( with_card_info : CardInfo = get_false_plant_card_info() ): %PlantInfoCard.info = with_card_info %PlantInfoCard.update() %PlantInfoTutorialAnimationPlayer.play("appear") Pointer.action_disabled = true func display_mutations_tutorial(with_card_info : CardInfo = get_false_plant_card_info(true)): %MutationCard.info = with_card_info %MutationCard.update() %MutationTutorialAnimationPlayer.play("appear") Pointer.action_disabled = true func display_plant_point_tutorial(): %PlantPointTutorialAnimationPlayer.play("appear") Pointer.action_disabled = true func get_false_plant_card_info(with_mutation = false): var data = PlantData.new() var info = CardInfo.new( data.plant_name, tr("MATURE") if data.is_mature() else tr("JUVENILE") ) info.important_stat_icon = Plant.SCORE_ICON info.important_stat_text = "%d" % 0 info.type_icon = Plant.PLANT_TYPE_ICON info.stats.append_array([ CardStatInfo.new( str(1), Plant.DURATION_ICON ), CardStatInfo.new( str(2), Plant.GROWING_ICON ), CardStatInfo.new( str(6), Plant.LIFETIME_ICON ), CardStatInfo.new( str(1), Plant.SEED_ICON ), ]) if with_mutation: info.sections.append(AncientMutation.new().card_section()) return info func _on_energy_button_tutorial_button_down(): display_energy_tutorial() func _on_plant_button_tutorial_button_down(): display_plant_info_tutorial() func _on_mutation_button_tutorial_button_down(): display_mutations_tutorial() func _on_plant_point_button_tutorial_button_down(): display_plant_point_tutorial() func _on_energy_ok_button_button_down(): %EnergyTutorialAnimationPlayer.play_backwards("appear") tutorial_passed.emit() get_tree().create_timer(0.2).timeout.connect( # Put a delay to not interfere with the ok button click func(): Pointer.action_disabled = false ) func _on_plant_info_ok_button_button_down(): %PlantInfoTutorialAnimationPlayer.play_backwards("appear") tutorial_passed.emit() get_tree().create_timer(0.2).timeout.connect( # Put a delay to not interfere with the ok button click func(): Pointer.action_disabled = false ) func _on_mutation_ok_button_button_down(): %MutationTutorialAnimationPlayer.play_backwards("appear") tutorial_passed.emit() get_tree().create_timer(0.2).timeout.connect( # Put a delay to not interfere with the ok button click func(): Pointer.action_disabled = false ) func _on_plant_point_ok_button_button_down(): %PlantPointTutorialAnimationPlayer.play_backwards("appear") tutorial_passed.emit() get_tree().create_timer(0.2).timeout.connect( # Put a delay to not interfere with the ok button click func(): Pointer.action_disabled = false )