ajout de la traduction #70
* Fix de l'inspection de l'inventaire * Suppression des assets d'objectifs
This commit is contained in:
@@ -8,6 +8,7 @@ const ZONE_ACTIVATED_COLOR = Color.TURQUOISE
|
||||
const ZONE_DEACTIVATED_COLOR = Color.REBECCA_PURPLE
|
||||
|
||||
const CARD_VISUALISATION_TIME = 0.5
|
||||
const CARD_UP_PADDING = 20
|
||||
|
||||
@export var default_cursor : Texture2D
|
||||
|
||||
@@ -90,16 +91,23 @@ func inspect(node : Node):
|
||||
inspected = node
|
||||
if inspected is InspectableEntity:
|
||||
inspected_card_info = inspected.card_info()
|
||||
elif inspected is InventoryGuiItem and inspected.item != null:
|
||||
inspected_card_info = inspected.item.card_info()
|
||||
else :
|
||||
inspected_card_info = null
|
||||
time_last_inspected = 0
|
||||
if current_inspect.has_method("inspect"):
|
||||
current_inspect.inspect(true)
|
||||
update_inspector()
|
||||
|
||||
func update_card():
|
||||
if not inspected or time_last_inspected > CARD_VISUALISATION_TIME:
|
||||
if not inspected or inspected_card_info == null or time_last_inspected > CARD_VISUALISATION_TIME:
|
||||
%CardVisualiser.hide()
|
||||
|
||||
elif inspected != null and inspected is InspectableEntity:
|
||||
elif inspected != null and (
|
||||
inspected is InspectableEntity
|
||||
or inspected is InventoryGuiItem
|
||||
):
|
||||
|
||||
if inspected_card_info != %CardVisualiser.card_info:
|
||||
%CardVisualiser.card_info = inspected_card_info
|
||||
@@ -107,7 +115,10 @@ func update_card():
|
||||
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
%CardPosition.position = inspected.global_position - camera.global_position + screen_size / 2
|
||||
if inspected is InspectableEntity:
|
||||
%CardPosition.position = inspected.global_position - camera.global_position + screen_size / 2 + CARD_UP_PADDING * Vector2.UP
|
||||
elif inspected is InventoryGuiItem:
|
||||
%CardPosition.position = inspected.global_position + inspected.size/2 + CARD_UP_PADDING * Vector2.UP
|
||||
|
||||
if %CardVisualiser.is_mouse_over():
|
||||
time_last_inspected = 0.
|
||||
|
||||
Reference in New Issue
Block a user