refonte de l'inspecteur #61
This commit is contained in:
@@ -3,19 +3,15 @@ class_name GameGui
|
||||
|
||||
signal pause_asked
|
||||
|
||||
func _ready():
|
||||
Pointer.connect("inspected_entity_changed", _on_inspected_entity_changed)
|
||||
|
||||
func _on_player_updated(player:Player):
|
||||
%EnergyCount.text = str(player.energy) + "/" + str(player.max_energy)
|
||||
%EnergyInfo.modulate = Color.WHITE if player.energy > 0 else Color.RED
|
||||
|
||||
update_no_energy_left_info(player.energy)
|
||||
|
||||
%ItemInfo.visible = player.inventory.get_item() != null
|
||||
if player.inventory.get_item():
|
||||
var item : Item = player.inventory.get_item()
|
||||
%ItemIcon.texture = item.icon
|
||||
%ItemName.text = item.name
|
||||
%ItemDesc.text = item.description
|
||||
|
||||
func _on_day_pass_pressed():
|
||||
|
||||
await $AnimationPlayer.animation_finished
|
||||
@@ -44,6 +40,12 @@ func _on_planet_pass_day_started(planet):
|
||||
await $PassDayAnimation.animation_finished
|
||||
$PassDayAnimation.speed_scale = 1
|
||||
|
||||
func _on_inspected_entity_changed(e : InspectableEntity):
|
||||
var info : Inspector.Info = null
|
||||
if e:
|
||||
info = e.inspector_info()
|
||||
%Inspector.info = info
|
||||
|
||||
func update_no_energy_left_info(energy):
|
||||
if energy == 0 and not %NoEnergyLeft.visible:
|
||||
%NoEnergyLeft.visible = true
|
||||
|
||||
Reference in New Issue
Block a user