Cleanup
This commit is contained in:
@@ -76,8 +76,10 @@ var _current_mouse_pos = Vector2.ZERO
|
|||||||
var tooltip2_node: Object
|
var tooltip2_node: Object
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
$tooltip_layer/tooltip.connect("tooltip_size_updated", self, "update_tooltip_following_mouse_position", [tooltip_node])
|
if $tooltip_layer/tooltip.connect("tooltip_size_updated", self, "update_tooltip_following_mouse_position", [tooltip_node]) != 0:
|
||||||
$tooltip_layer/tooltip.connect("tooltip2_size_updated", self, "update_tooltip_following_mouse_position", [tooltip2_node])
|
escoria.logger.error(self, "Error connecting tooltip_size_updated")
|
||||||
|
if $tooltip_layer/tooltip2.connect("tooltip2_size_updated", self, "update_tooltip_following_mouse_position", [tooltip2_node]) != 0:
|
||||||
|
escoria.logger.error(self, "Error connecting tooltip2_size_updated")
|
||||||
|
|
||||||
|
|
||||||
func _enter_tree():
|
func _enter_tree():
|
||||||
@@ -100,7 +102,8 @@ func _enter_tree():
|
|||||||
if _is_gamepad_connected:
|
if _is_gamepad_connected:
|
||||||
_on_gamepad_connected()
|
_on_gamepad_connected()
|
||||||
|
|
||||||
Input.connect("joy_connection_changed", self, "_on_joy_connection_changed")
|
if Input.connect("joy_connection_changed", self, "_on_joy_connection_changed") != 0:
|
||||||
|
escoria.logger.error(self, "Error connecting joy_connection_changed")
|
||||||
|
|
||||||
|
|
||||||
func _exit_tree():
|
func _exit_tree():
|
||||||
@@ -164,9 +167,7 @@ func _process(_delta) -> void:
|
|||||||
var delta_x = int(x * AXIS_WEIGHT) if abs(x) > DEADZONE else 0
|
var delta_x = int(x * AXIS_WEIGHT) if abs(x) > DEADZONE else 0
|
||||||
var delta_y = int(y * AXIS_WEIGHT) if abs(y) > DEADZONE else 0
|
var delta_y = int(y * AXIS_WEIGHT) if abs(y) > DEADZONE else 0
|
||||||
if delta_x or delta_y:
|
if delta_x or delta_y:
|
||||||
var direction: Vector2
|
var direction = Vector2(delta_x, delta_y)
|
||||||
direction.x = delta_x
|
|
||||||
direction.y = delta_y
|
|
||||||
escoria.logger.trace("gamepad direction:", [direction])
|
escoria.logger.trace("gamepad direction:", [direction])
|
||||||
var viewport = get_viewport()
|
var viewport = get_viewport()
|
||||||
viewport.warp_mouse(viewport.get_mouse_position() + direction)
|
viewport.warp_mouse(viewport.get_mouse_position() + direction)
|
||||||
|
|||||||
@@ -33,9 +33,5 @@ func update_tooltip_text():
|
|||||||
|
|
||||||
|
|
||||||
func _on_room_ready():
|
func _on_room_ready():
|
||||||
escoria.logger.warn(
|
|
||||||
self,
|
|
||||||
"ON ROOM READY TOOLTIP2 id=" + String(id)
|
|
||||||
)
|
|
||||||
escoria.main.current_scene.game.tooltip2_node = self
|
escoria.main.current_scene.game.tooltip2_node = self
|
||||||
_room_is_ready = true
|
_room_is_ready = true
|
||||||
|
|||||||
@@ -33,9 +33,5 @@ func update_tooltip_text():
|
|||||||
|
|
||||||
|
|
||||||
func _on_room_ready():
|
func _on_room_ready():
|
||||||
escoria.logger.warn(
|
|
||||||
self,
|
|
||||||
"ON ROOM READY id=" + String(id)
|
|
||||||
)
|
|
||||||
escoria.main.current_scene.game.tooltip_node = self
|
escoria.main.current_scene.game.tooltip_node = self
|
||||||
_room_is_ready = true
|
_room_is_ready = true
|
||||||
|
|||||||
Reference in New Issue
Block a user