#59 ajout de la mention de si l'action prends de l'énergie ou non

This commit is contained in:
2025-09-05 17:01:20 +02:00
parent 2dc365736f
commit 165a4d129b
2 changed files with 15 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
extends Node
const DEFAULT_ACTION_COLOR = Color.WHITE
const ENERGY_ACTION_COLOR = Color("ffff2b")
@export var default_cursor : Texture2D
var inspected_entity : InspectableEntity = null
@@ -75,9 +78,13 @@ func update_inspector():
if can_interact and inspected_entity and inspected_entity is Interactable:
%Action.visible = true
%ActionText.text = inspected_entity.interact_text()
%Action.modulate = DEFAULT_ACTION_COLOR if inspected_entity.interaction_cost(player) == 0 else ENERGY_ACTION_COLOR
%ActionEnergyImage.visible = inspected_entity.interaction_cost(player) != 0
elif can_use_item and current_selected_item:
%Action.visible = true
%ActionText.text = current_selected_item.use_text()
%Action.modulate = DEFAULT_ACTION_COLOR if current_selected_item.use_energy == 0 else ENERGY_ACTION_COLOR
%ActionEnergyImage.visible = current_selected_item.use_energy != 0
else:
%Action.visible = false