création du squelette des region modifier, amélioration du tutoriel et mise en place de la run complète avec cinématique d'outro
This commit is contained in:
@@ -3,6 +3,7 @@ class_name Tutorial
|
||||
|
||||
const STEP_SCENE = preload("res://gui/game/tutorial/step_gui/step_gui.tscn")
|
||||
|
||||
signal succeded
|
||||
|
||||
var indicators : Array[InGameIndicator]
|
||||
@export var player : Player
|
||||
@@ -48,13 +49,29 @@ var indicators : Array[InGameIndicator]
|
||||
return region.data.get_score() != 0)
|
||||
),
|
||||
Step.new(
|
||||
"HARVEST_MATURE_PLANTS_WITH_SHOVEL",
|
||||
"DISCOVER_A_SEED_WITH_A_MUTATION",
|
||||
(func ():
|
||||
for e in region.entity_container.get_children():
|
||||
if e is Plant and e.harvested:
|
||||
if e is ItemObject and e.item is Seed and len(e.item.plant_mutations):
|
||||
return true
|
||||
return false)
|
||||
)
|
||||
),
|
||||
Step.new(
|
||||
"PLANT_A_SEED_WITH_A_MUTATION",
|
||||
(func ():
|
||||
for e in region.entity_container.get_children():
|
||||
if e is Plant and len(e.data.mutations):
|
||||
return true
|
||||
return false)
|
||||
),
|
||||
Step.new(
|
||||
"HARVEST_A_MATURE_PLANT_WITH_A_MUTATION",
|
||||
(func ():
|
||||
for e in region.entity_container.get_children():
|
||||
if e is Plant and e.harvested and len(e.data.mutations):
|
||||
return true
|
||||
return false)
|
||||
),
|
||||
]
|
||||
|
||||
func _ready():
|
||||
@@ -76,13 +93,23 @@ func setup_gui():
|
||||
|
||||
|
||||
func _process(_d):
|
||||
if region and region.data and "tutorial" in region.data.flags:
|
||||
if region and region.data and "tutorial" in region.data.flags and not GameInfo.game_data.tutorial_done:
|
||||
var success = true
|
||||
for i in len(steps):
|
||||
var step := steps[i]
|
||||
var step_gui := %Steps.get_children()[i] as TutorialStepGui
|
||||
step.update_succeeded()
|
||||
step_gui.suceeded = step.succeeded
|
||||
|
||||
if not step.succeeded:
|
||||
success = false
|
||||
if success:
|
||||
finish_tutorial()
|
||||
|
||||
func finish_tutorial():
|
||||
GameInfo.game_data.tutorial_done = true
|
||||
succeded.emit()
|
||||
|
||||
|
||||
class Step:
|
||||
|
||||
var text : String : get = get_text
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://c2w7h0x2blimk" path="res://gui/game/tutorial/step_gui/scripts/step_gui.gd" id="1_8qp12"]
|
||||
[ext_resource type="Texture2D" uid="uid://dk7j4cmn2avor" path="res://common/icons/circle-check.svg" id="2_8qp12"]
|
||||
[ext_resource type="FontFile" uid="uid://cc4xli25271fd" path="res://addons/dialogic/Example Assets/Fonts/Roboto-Bold.ttf" id="3_kbfp3"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_i138t"]
|
||||
|
||||
[node name="Step" type="HBoxContainer" unique_id=595946430]
|
||||
modulate = Color(1, 1, 1, 0.5)
|
||||
@@ -30,11 +32,13 @@ unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
theme_override_fonts/normal_font = ExtResource("3_kbfp3")
|
||||
theme_override_fonts/bold_font = ExtResource("4_i138t")
|
||||
theme_override_font_sizes/normal_font_size = 15
|
||||
theme_override_font_sizes/bold_font_size = 15
|
||||
theme_override_font_sizes/bold_italics_font_size = 15
|
||||
theme_override_font_sizes/italics_font_size = 15
|
||||
theme_override_font_sizes/mono_font_size = 15
|
||||
bbcode_enabled = true
|
||||
text = "Lorem Ipsum dolor sit amet and again and again and again and again"
|
||||
text = "Hello"
|
||||
fit_content = true
|
||||
|
||||
Reference in New Issue
Block a user