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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user