hover fix
This commit is contained in:
@@ -16,7 +16,6 @@ const CARD_UP_PADDING = 50
|
||||
var all_inspected : Array[Node]
|
||||
var inspected : Node = null
|
||||
var inspected_card_info : CardInfo = null
|
||||
var time_last_inspected : float = 0.
|
||||
var player : Player # renseigné par Player
|
||||
var can_interact : bool = false
|
||||
var current_selected_item : Item = null
|
||||
@@ -60,9 +59,6 @@ func _process(delta):
|
||||
else :
|
||||
%ActionProgressBar.value = 0.
|
||||
|
||||
var current_inspected := get_current_inspected()
|
||||
if current_inspected != inspected:
|
||||
time_last_inspected += delta
|
||||
%Inspector.position = get_viewport().get_mouse_position()
|
||||
|
||||
if not action_disabled and current_selected_item and SceneManager.actual_scene.scene_id == "REGION":
|
||||
@@ -75,7 +71,7 @@ func _process(delta):
|
||||
|
||||
update_card()
|
||||
|
||||
update_inspector(current_inspected)
|
||||
update_inspector(get_current_inspected())
|
||||
|
||||
func process_player_actions(delta : float):
|
||||
can_interact = (
|
||||
@@ -154,7 +150,6 @@ func inspect(node: Node):
|
||||
func update_card():
|
||||
if (
|
||||
not inspected or inspected_card_info == null
|
||||
or time_last_inspected > CARD_VISUALISATION_TIME
|
||||
or get_tree().paused
|
||||
or action_disabled
|
||||
):
|
||||
@@ -188,17 +183,19 @@ func update_card():
|
||||
|
||||
func update_inspector(current_inspected:Node):
|
||||
|
||||
if current_inspected and inspected != current_inspected:
|
||||
if inspected and inspected.has_method("inspect"):
|
||||
inspected.inspect(false)
|
||||
inspected = current_inspected
|
||||
if inspected.has_method("card_info"):
|
||||
inspected_card_info = inspected.card_info()
|
||||
else:
|
||||
inspected_card_info = null
|
||||
time_last_inspected = 0
|
||||
if inspected.has_method("inspect"):
|
||||
inspected.inspect(true)
|
||||
if current_inspected:
|
||||
if inspected != current_inspected:
|
||||
if inspected and inspected.has_method("inspect"):
|
||||
inspected.inspect(false)
|
||||
inspected = current_inspected
|
||||
if inspected.has_method("card_info"):
|
||||
inspected_card_info = inspected.card_info()
|
||||
else:
|
||||
inspected_card_info = null
|
||||
if inspected.has_method("inspect"):
|
||||
inspected.inspect(true)
|
||||
else:
|
||||
inspected = null
|
||||
|
||||
if player and not action_disabled and (get_tree() and not get_tree().paused):
|
||||
if can_interact and inspected and inspected is Interactable:
|
||||
|
||||
Reference in New Issue
Block a user