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:
@@ -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