ajout de la traduction #70
* Fix de l'inspection de l'inventaire * Suppression des assets d'objectifs
This commit is contained in:
@@ -8,29 +8,27 @@ signal item_clicked()
|
||||
const MODULATE_INSPECTED_COLOR = Color.GRAY
|
||||
|
||||
var current_item : Item = null
|
||||
var item : Item = null
|
||||
var was_selected : bool = false
|
||||
|
||||
func _ready():
|
||||
mouse_entered.connect(_on_mouse_entered)
|
||||
mouse_exited.connect(_on_mouse_excited)
|
||||
mouse_entered.connect(
|
||||
func(): Pointer.inspect(self)
|
||||
)
|
||||
mouse_exited.connect(
|
||||
func(): Pointer.stop_inspect(self)
|
||||
)
|
||||
update(null, false)
|
||||
|
||||
func inspect(is_inspected : bool = true):
|
||||
modulate = MODULATE_INSPECTED_COLOR if is_inspected else Color.WHITE
|
||||
|
||||
func _on_mouse_entered():
|
||||
if current_item:
|
||||
Pointer.inspect(self)
|
||||
|
||||
func _on_mouse_excited():
|
||||
if current_item:
|
||||
Pointer.stop_inspect(self)
|
||||
|
||||
func _on_gui_input(_event: InputEvent) -> void:
|
||||
if Input.is_action_just_pressed("action"):
|
||||
emit_signal("item_clicked")
|
||||
|
||||
func update(item: Item, selected : bool):
|
||||
func update(_item: Item, selected : bool):
|
||||
item = _item
|
||||
if selected and not was_selected:
|
||||
%SelectedAnimation.play("selected")
|
||||
elif not selected and was_selected:
|
||||
|
||||
Reference in New Issue
Block a user