ajout des mutation et refonte de l'inspecteur

* ajout des mutations #86
* changement de l'objectif #85
* refonte de l'inspecteur #71
* changement léger de la plantation
* les plantes ne donnent que des graines de leurs espèces
* refonte partielle du code, refacto
This commit is contained in:
2025-10-12 01:03:08 +02:00
parent bb24efe46b
commit ef392595de
108 changed files with 1921 additions and 477 deletions

View File

@@ -114,6 +114,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_4evne")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
@@ -128,6 +129,7 @@ offset_top = -73.5
offset_bottom = 73.5
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme = ExtResource("1_0ssee")
alignment = 1
@@ -142,6 +144,7 @@ horizontal_alignment = 1
unique_name_in_owner = true
modulate = Color(0.886275, 0.623529, 0.196078, 1)
layout_mode = 2
mouse_filter = 2
texture = SubResource("GradientTexture2D_mnweq")
expand_mode = 1
stretch_mode = 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://lpik6kwqgmjx"
path="res://.godot/imported/tablette_resized.png-1e695efa0d8b0701c7cf825b333995f0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gui/game/assets/texture/tablette_resized.png"
dest_files=["res://.godot/imported/tablette_resized.png-1e695efa0d8b0701c7cf825b333995f0.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=29 format=3 uid="uid://12nak7amd1uq"]
[gd_scene load_steps=30 format=3 uid="uid://12nak7amd1uq"]
[ext_resource type="Script" uid="uid://cqao7n800qy40" path="res://gui/game/scripts/game_gui.gd" id="1_udau0"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="2_nq5i2"]
@@ -7,6 +7,7 @@
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="4_k4juk"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_ujg5r"]
[ext_resource type="PackedScene" uid="uid://d3lff5fui1k0c" path="res://gui/game/inspector/inspector.tscn" id="6_dr1y2"]
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="7_id0t5"]
[ext_resource type="Texture2D" uid="uid://b5cuxgisrsfgt" path="res://common/icons/player-pause.svg" id="9_2wykm"]
[ext_resource type="PackedScene" uid="uid://clicjf8ts51h8" path="res://gui/game/inventory_gui/inventory_gui.tscn" id="9_id0t5"]
@@ -340,7 +341,11 @@ layout_mode = 2
fill_mode = 4
texture_progress = SubResource("GradientTexture2D_h6540")
[node name="QuotaProgressText" type="Label" parent="MarginContainer/PlayerInfo/QuotaInfo"]
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/PlayerInfo/QuotaInfo"]
layout_mode = 2
theme_override_constants/separation = 2
[node name="QuotaProgressText" type="Label" parent="MarginContainer/PlayerInfo/QuotaInfo/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "X"
@@ -348,10 +353,12 @@ label_settings = ExtResource("4_ujg5r")
horizontal_alignment = 1
vertical_alignment = 1
[node name="Inspector" parent="MarginContainer" instance=ExtResource("6_dr1y2")]
unique_name_in_owner = true
[node name="TextureRect" type="TextureRect" parent="MarginContainer/PlayerInfo/QuotaInfo/HBoxContainer"]
custom_minimum_size = Vector2(30, 30)
layout_mode = 2
size_flags_horizontal = 8
texture = ExtResource("7_id0t5")
expand_mode = 1
stretch_mode = 5
[node name="TopRightContent" type="HBoxContainer" parent="MarginContainer"]
layout_mode = 2
@@ -382,6 +389,13 @@ layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
[node name="Inspector" parent="MarginContainer" instance=ExtResource("6_dr1y2")]
unique_name_in_owner = true
custom_minimum_size = Vector2(250, 0)
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 8
[node name="PassDayFade" type="ColorRect" parent="."]
physics_interpolation_mode = 0
layout_mode = 1

View File

@@ -0,0 +1,57 @@
[gd_scene load_steps=7 format=3 uid="uid://dinju2m0oja38"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_1ddv5"]
[ext_resource type="Script" uid="uid://ymn5layeoat8" path="res://gui/game/inspector/framed_info/scripts/framed_info.gd" id="1_7tmbd"]
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="2_7tmbd"]
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="3_1ddv5"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7tmbd"]
bg_color = Color(1, 1, 1, 0.78431374)
[sub_resource type="LabelSettings" id="LabelSettings_1ddv5"]
font = ExtResource("3_1ddv5")
font_size = 18
[node name="FramedInfo" type="PanelContainer"]
self_modulate = Color(0.043137256, 0.07450981, 0.14901961, 1)
offset_right = 275.0
offset_bottom = 94.0
size_flags_horizontal = 3
size_flags_vertical = 0
theme_override_styles/panel = SubResource("StyleBoxFlat_7tmbd")
script = ExtResource("1_7tmbd")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 2
theme = ExtResource("1_1ddv5")
[node name="HFlowContainer" type="VBoxContainer" parent="MarginContainer"]
layout_mode = 2
theme_override_constants/separation = 10
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HFlowContainer"]
layout_mode = 2
theme_override_constants/separation = 10
[node name="Icon" type="TextureRect" parent="MarginContainer/HFlowContainer/HBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
texture = ExtResource("2_7tmbd")
expand_mode = 1
stretch_mode = 5
[node name="Title" type="Label" parent="MarginContainer/HFlowContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "On mature"
label_settings = SubResource("LabelSettings_1ddv5")
[node name="Desc" type="RichTextLabel" parent="MarginContainer/HFlowContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme = ExtResource("1_1ddv5")
bbcode_enabled = true
text = "On mature, do this and that and do this and that and do this and that"
fit_content = true

View File

@@ -0,0 +1,10 @@
extends PanelContainer
var framed_info :Inspector.FramedInfo = null : set = update_framed_info
func update_framed_info(f: Inspector.FramedInfo):
framed_info = f
%Icon.texture = f.icon
%Title.text = f.title
%Desc.text = f.description
self_modulate = f.bg_color

View File

@@ -0,0 +1 @@
uid://ymn5layeoat8

View File

@@ -1,11 +1,19 @@
[gd_scene load_steps=9 format=3 uid="uid://d3lff5fui1k0c"]
[gd_scene load_steps=10 format=3 uid="uid://d3lff5fui1k0c"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_f5bv4"]
[ext_resource type="Texture2D" uid="uid://c2pgaklnj5w3d" path="res://gui/game/assets/texture/Tablette info.png" id="2_a8c2j"]
[ext_resource type="Texture2D" uid="uid://lpik6kwqgmjx" path="res://gui/game/assets/texture/tablette_resized.png" id="1_qfinp"]
[ext_resource type="Script" uid="uid://b36bjfq4sng36" path="res://gui/game/inspector/scripts/inspector.gd" id="3_a8c2j"]
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="3_qfinp"]
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="4_yijvw"]
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_yijvw"]
texture = ExtResource("1_qfinp")
texture_margin_left = 30.0
texture_margin_top = 10.0
texture_margin_right = 30.0
texture_margin_bottom = 50.0
region_rect = Rect2(18, 31, 240, 334)
[sub_resource type="AtlasTexture" id="AtlasTexture_ek73b"]
atlas = ExtResource("3_qfinp")
region = Rect2(76, 75, 124, 135)
@@ -14,44 +22,32 @@ region = Rect2(76, 75, 124, 135)
font = ExtResource("4_yijvw")
font_size = 20
[sub_resource type="LabelSettings" id="LabelSettings_n4kem"]
[sub_resource type="LabelSettings" id="LabelSettings_c4yiu"]
font_size = 12
[node name="Inspector" type="TextureRect"]
custom_minimum_size = Vector2(0, 300)
[node name="Inspector" type="PanelContainer"]
offset_right = 276.0
offset_bottom = 235.0
size_flags_horizontal = 0
size_flags_vertical = 8
theme = ExtResource("1_f5bv4")
texture = ExtResource("2_a8c2j")
expand_mode = 3
stretch_mode = 4
size_flags_vertical = 0
theme_override_styles/panel = SubResource("StyleBoxTexture_yijvw")
script = ExtResource("3_a8c2j")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 40
theme_override_constants/margin_top = 40
theme_override_constants/margin_right = 25
theme_override_constants/margin_bottom = 75
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
size_flags_vertical = 0
theme = ExtResource("1_f5bv4")
[node name="Texture" type="TextureRect" parent="MarginContainer/VBoxContainer"]
[node name="Texture" type="TextureRect" parent="VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
size_flags_horizontal = 3
texture = SubResource("AtlasTexture_ek73b")
expand_mode = 1
stretch_mode = 5
[node name="Title" type="Label" parent="MarginContainer/VBoxContainer"]
[node name="Title" type="Label" parent="VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "fdqsd dqsdq dsqdqsd"
@@ -59,11 +55,20 @@ label_settings = SubResource("LabelSettings_ek73b")
horizontal_alignment = 1
autowrap_mode = 2
[node name="Desc" type="Label" parent="MarginContainer/VBoxContainer"]
[node name="StatInfos" type="HFlowContainer" parent="VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
text = "Ceci est une pelle qui sert exclusivement à faire des choses intéressantes. Ceci est une pelle qui sert exclusivement à faire des choses intéressantes. Ceci est une pelle qui sert exclusivement à faire des choses intéressantes. Ceci est une pelle qui sert exclusivement à faire des choses intéressantes. "
label_settings = SubResource("LabelSettings_n4kem")
theme_override_constants/h_separation = 8
theme_override_constants/v_separation = 8
alignment = 1
[node name="Desc" type="Label" parent="VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "Very interesting description that can be very long, like 2 or 3 lines long."
label_settings = SubResource("LabelSettings_c4yiu")
autowrap_mode = 3
clip_text = true
[node name="FramedInfos" type="VBoxContainer" parent="VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2

View File

@@ -1,6 +1,9 @@
extends Control
class_name Inspector
const FRAMED_INFO_SCENE : PackedScene = preload("res://gui/game/inspector/framed_info/framed_info.tscn")
const STAT_INFO_SCENE : PackedScene = preload("res://gui/game/inspector/stat_info/stat_info.tscn")
var info : Info = null :
set(i):
info = i
@@ -19,11 +22,33 @@ func update_info(i : Info):
%Texture.visible = i.texture != null
%Title.text = i.title
%Desc.text = i.description
%Desc.visible = i.description != ""
update_framed_infos(info.framed_infos)
update_stat_info(info.stat_infos)
func update_framed_infos(framed_infos : Array[FramedInfo]):
for c in %FramedInfos.get_children() :
c.queue_free()
for i in range(len(framed_infos)):
var frame_info_object = FRAMED_INFO_SCENE.instantiate()
%FramedInfos.add_child(frame_info_object)
frame_info_object.framed_info = framed_infos[i]
func update_stat_info(stat_infos):
%StatInfos.visible = len(stat_infos) != 0
for c in %StatInfos.get_children() :
c.queue_free()
for i in range(len(stat_infos)):
var stat_inof_object = STAT_INFO_SCENE.instantiate()
%StatInfos.add_child(stat_inof_object)
stat_inof_object.stat_info = stat_infos[i]
class Info:
var title : String
var texture: Texture
var description : String
var title : String = ""
var texture: Texture = null
var description : String = ""
var framed_infos : Array[Inspector.FramedInfo] = []
var stat_infos = []
func _init(
_title : String = "",
@@ -32,4 +57,39 @@ class Info:
):
title = _title
description = _description
texture = _texture
texture = _texture
func add_framed_info(framed_info : Inspector.FramedInfo):
framed_infos.push_front(framed_info)
func add_stat_info(s_info : Inspector.StatInfo):
stat_infos.push_front(s_info)
class FramedInfo:
var title : String
var icon: Texture
var description : String
var bg_color : Color
func _init(
_title : String = "",
_desc : String = "",
_icon : Texture = null,
_bg_color : Color = Color("0B1326")
):
title = _title
description = _desc
icon = _icon
bg_color = _bg_color
class StatInfo:
var text : String
var icon: Texture
func _init(
_text : String = "",
_icon : Texture = null,
):
text = _text
icon = _icon

View File

@@ -0,0 +1,9 @@
extends HBoxContainer
var stat_info : Inspector.StatInfo = null : set = update_stat_info
func update_stat_info(s_info : Inspector.StatInfo):
stat_info = s_info
%Icon.texture = stat_info.icon
%Text.text = str(stat_info.text)

View File

@@ -0,0 +1 @@
uid://yghu53hja4xj

View File

@@ -0,0 +1,28 @@
[gd_scene load_steps=4 format=3 uid="uid://djihfgtjuhqwy"]
[ext_resource type="Script" uid="uid://yghu53hja4xj" path="res://gui/game/inspector/stat_info/scripts/stat_info.gd" id="1_4pua2"]
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="2_pdlch"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="3_pdlch"]
[node name="StatInfo" type="HBoxContainer"]
theme_override_constants/separation = 4
alignment = 1
script = ExtResource("1_4pua2")
[node name="Icon" type="TextureRect" parent="."]
unique_name_in_owner = true
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
texture = ExtResource("2_pdlch")
expand_mode = 1
stretch_mode = 5
[node name="Text" type="RichTextLabel" parent="."]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("3_pdlch")
bbcode_enabled = true
text = "6"
fit_content = true
scroll_active = false
autowrap_mode = 0

View File

@@ -1,7 +1,8 @@
[gd_scene load_steps=11 format=3 uid="uid://dadihouw8o3jx"]
[gd_scene load_steps=12 format=3 uid="uid://dadihouw8o3jx"]
[ext_resource type="Script" uid="uid://c8qfny4dlg7ql" path="res://gui/game/inventory_gui/inventory_item/scripts/inventory_gui_item.gd" id="2_m0ja8"]
[ext_resource type="Texture2D" uid="uid://bf6nw4onkhavr" path="res://common/icons/shovel.svg" id="2_xs0u7"]
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="3_m0ja8"]
[sub_resource type="Animation" id="Animation_046xr"]
length = 0.001
@@ -33,7 +34,7 @@ tracks/0/keys = {
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CenterContainer/TextureRect:modulate")
tracks/1/path = NodePath("CenterContainer/ItemTexture:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
@@ -61,7 +62,7 @@ tracks/0/keys = {
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CenterContainer/TextureRect:modulate")
tracks/1/path = NodePath("CenterContainer/ItemTexture:modulate")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
@@ -119,7 +120,7 @@ texture = SubResource("GradientTexture2D_vgckh")
expand_mode = 2
stretch_mode = 5
[node name="TextureRect" type="TextureRect" parent="CenterContainer"]
[node name="ItemTexture" type="TextureRect" parent="CenterContainer"]
unique_name_in_owner = true
modulate = Color(0.27058825, 0.27058825, 0.27058825, 1)
custom_minimum_size = Vector2(48, 48)
@@ -128,5 +129,16 @@ texture = ExtResource("2_xs0u7")
expand_mode = 1
stretch_mode = 5
[node name="ParticleTexture" type="TextureRect" parent="CenterContainer/ItemTexture"]
unique_name_in_owner = true
layout_mode = 0
offset_left = 26.0
offset_top = 27.0
offset_right = 48.0
offset_bottom = 49.0
texture = ExtResource("3_m0ja8")
expand_mode = 1
stretch_mode = 4
[node name="BottomSpace" type="Control" parent="."]
layout_mode = 2

View File

@@ -26,11 +26,7 @@ func _on_mouse_excited():
Pointer.stop_inspect(self)
func inspector_info() -> Inspector.Info:
return Inspector.Info.new(
current_item.name,
current_item.description,
current_item.icon
)
return current_item.inspector_info()
func update(item: Item, selected : bool):
if selected and not was_selected:
@@ -41,9 +37,15 @@ func update(item: Item, selected : bool):
if item != current_item:
%SquishAnimation.play("squish")
if item and item.icon:
%TextureRect.texture = item.icon
%TextureRect.visible = item != null
%ItemTexture.texture = item.icon
var particles = item.get_particles()
if len(particles):
%ParticleTexture.texture = particles[0].texture
%ParticleTexture.modulate = particles[0].color
%ItemTexture.visible = item != null
%NoItemTextureRect.visible = item == null
%ParticleTexture.visible = item and len(item.get_particles())
current_item = item
was_selected = selected

View File

@@ -18,8 +18,8 @@ func _on_planet_updated(planet:Planet):
%DayCount.text = str(planet.get_quota_remaining_days()) + " days left"
if planet.next_quota:
var quota_progression_percent : float = (planet.decontamination_surface - planet.last_quota) / (planet.next_quota - planet.last_quota) * 100
%QuotaProgressText.text = str(roundi(planet.decontamination_surface)) + "/" + str(roundi(planet.next_quota))
var quota_progression_percent : float = (planet.garden_score - planet.last_quota) / (planet.next_quota - planet.last_quota) * 100
%QuotaProgressText.text = str(roundi(planet.garden_score)) + "/" + str(roundi(planet.next_quota))
get_tree().create_tween().tween_property(
%QuotaProgressBar,
"value",

View File

@@ -21,6 +21,7 @@ script = ExtResource("2_kij5i")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
mouse_filter = 2
theme = ExtResource("1_ga3ae")
theme_override_constants/separation = 0
@@ -38,6 +39,7 @@ unique_name_in_owner = true
custom_minimum_size = Vector2(50, 50)
layout_mode = 2
size_flags_horizontal = 4
mouse_filter = 2
texture = ExtResource("2_kc1j1")
expand_mode = 1
stretch_mode = 5

View File

@@ -59,7 +59,7 @@ class Step:
class TakeShovelStep extends Step:
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
for entity in p.planet.entityContainer.get_children():
for entity in p.planet.entity_container.get_children():
if entity is ItemObject and entity.item is Shovel:
var indicator = generate_indicator(cam, "Take the Shovel")
indicator.follow_entity(entity)
@@ -75,7 +75,7 @@ class TakeShovelStep extends Step:
class DigLootStep extends Step:
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
var indicators : Array[InGameIndicator] = []
for entity in p.planet.entityContainer.get_children():
for entity in p.planet.entity_container.get_children():
if entity is UndergroundLoot:
var indicator = generate_indicator(cam, "Dig Underground Loot")
indicator.follow_entity(entity)
@@ -85,7 +85,7 @@ class DigLootStep extends Step:
return indicators
func is_step_over(p : Player) -> bool:
for entity in p.planet.entityContainer.get_children():
for entity in p.planet.entity_container.get_children():
if entity is ItemObject and entity.item is Seed:
return true
return false
@@ -93,7 +93,7 @@ class DigLootStep extends Step:
class TakeSeedStep extends Step:
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
var indicators : Array[InGameIndicator] = []
for entity in p.planet.entityContainer.get_children():
for entity in p.planet.entity_container.get_children():
if entity is ItemObject and entity.item is Seed:
var indicator = generate_indicator(cam, "Take a seed")
indicator.follow_entity(entity)
@@ -111,18 +111,18 @@ class TakeSeedStep extends Step:
class PlantSeedStep extends Step:
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
var indicator = generate_indicator(cam, "Plant the seed in decontamined zone")
indicator.follow_game_position(Vector2(60,60) + p.planet.entityContainer.global_position)
indicator.follow_game_position(Vector2(0,0) + p.planet.entity_container.global_position)
return [indicator]
func is_step_over(p : Player) -> bool:
for entity in p.planet.entityContainer.get_children():
for entity in p.planet.entity_container.get_children():
if entity is Plant:
return true
return false
class RechargeStep extends Step:
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
for entity in p.planet.entityContainer.get_children():
for entity in p.planet.entity_container.get_children():
var indicator = generate_indicator(cam, "Recharge to pass days")
indicator.follow_entity(entity)
if entity is RechargeStation:
@@ -140,7 +140,7 @@ class WaitMaturePlant extends Step:
return []
func is_step_over(p : Player) -> bool:
for entity in p.planet.entityContainer.get_children():
for entity in p.planet.entity_container.get_children():
if entity is Plant and entity.state == Plant.State.MATURE:
return true
return false
@@ -151,7 +151,7 @@ class HarvestMaturePlant extends Step:
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
var indicators : Array[InGameIndicator] = []
for entity in p.planet.entityContainer.get_children():
for entity in p.planet.entity_container.get_children():
if entity is Plant and entity.state == Plant.State.MATURE:
var indicator = generate_indicator(cam, "Harvest mature plants with shovel")
indicator.follow_entity(entity)
@@ -163,7 +163,7 @@ class HarvestMaturePlant extends Step:
func is_step_over(p : Player) -> bool:
var actual_mature_plant_number = 0
for entity in p.planet.entityContainer.get_children():
for entity in p.planet.entity_container.get_children():
if entity is Plant and entity.state == Plant.State.MATURE:
actual_mature_plant_number += 1
return mature_plant_number != actual_mature_plant_number

View File

@@ -5,7 +5,7 @@
[ext_resource type="AudioStream" uid="uid://bym03qp4n6vep" path="res://gui/pointer/assets/sounds/click.wav" id="3_kj0cm"]
[ext_resource type="Texture2D" uid="uid://djb52fosgmv4j" path="res://common/icons/left_click.svg" id="3_pshoq"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="4_b4uwv"]
[ext_resource type="Script" uid="uid://c2en2hc6a7ils" path="res://gui/pointer/scripts/action_zone.gd" id="4_pshoq"]
[ext_resource type="Script" uid="uid://c60a1bjcuj4hd" path="res://common/vfx/circle/scripts/circle.gd" id="5_b4uwv"]
[node name="Pointer" type="Node"]
process_mode = 3
@@ -63,8 +63,10 @@ horizontal_alignment = 1
[node name="ActionZone" type="Sprite2D" parent="CanvasLayer/Inspector"]
unique_name_in_owner = true
position = Vector2(0, -1)
script = ExtResource("4_pshoq")
z_index = 4096
script = ExtResource("5_b4uwv")
opacity = 0.4
metadata/_custom_type_script = "uid://c60a1bjcuj4hd"
[node name="Audio" type="Node" parent="."]

View File

@@ -1,17 +0,0 @@
extends Sprite2D
class_name ActionZone
const OPACITY = 0.4
const ACTIVATED_COLOR = Color.TURQUOISE
const DEACTIVATED_COLOR = Color.REBECCA_PURPLE
var radius : int = 0
var active : bool = false
func _draw():
draw_circle(
Vector2.ZERO,
radius,
Color((ACTIVATED_COLOR if active else DEACTIVATED_COLOR), OPACITY)
)

View File

@@ -1 +0,0 @@
uid://c2en2hc6a7ils

View File

@@ -4,6 +4,9 @@ signal inspected_changed(info : Inspector.Info)
const DEFAULT_ACTION_COLOR = Color.WHITE
const ENERGY_ACTION_COLOR = Color("ffff2b")
const ZONE_OPACITY = 0.4
const ZONE_ACTIVATED_COLOR = Color.TURQUOISE
const ZONE_DEACTIVATED_COLOR = Color.REBECCA_PURPLE
@export var default_cursor : Texture2D
@@ -57,7 +60,7 @@ func _process(_delta):
if current_selected_item:
%ActionZone.radius = current_selected_item.usage_zone_radius
%ActionZone.active = can_use_item
%ActionZone.color = ZONE_ACTIVATED_COLOR if can_use_item else ZONE_DEACTIVATED_COLOR
else:
%ActionZone.radius = 0

View File

@@ -53,6 +53,11 @@ MarginContainer/constants/margin_bottom = 15
MarginContainer/constants/margin_left = 15
MarginContainer/constants/margin_right = 15
MarginContainer/constants/margin_top = 15
RichTextLabel/font_sizes/bold_font_size = 12
RichTextLabel/font_sizes/bold_italics_font_size = 12
RichTextLabel/font_sizes/italics_font_size = 12
RichTextLabel/font_sizes/mono_font_size = 12
RichTextLabel/font_sizes/normal_font_size = 12
VBoxContainer/constants/separation = 15
VSeparator/constants/separation = 15
VSeparator/styles/separator = SubResource("StyleBoxEmpty_hv6r3")