fix(poc): resolve evaluator and review findings
- Add RectangleShape2D to Character and InteractiveObject collision areas - Fix HUD button signal connections in _ready() - Fix character_placed signal emitting global_position - Extract DEFAULT_DRAG_RADIUS constant in DragDropComponent - Type Variant on JSON parsed variable in SaveManager - Extract music symbol constants in HUD - Refactor duplicated drag input code in InputManager Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,20 +11,30 @@ var _is_dragging: bool = false
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event is InputEventScreenTouch:
|
||||
if event.pressed:
|
||||
_is_dragging = true
|
||||
drag_started.emit(event.position)
|
||||
_emit_drag_started(event.position)
|
||||
else:
|
||||
_is_dragging = false
|
||||
drag_ended.emit(event.position)
|
||||
_emit_drag_ended(event.position)
|
||||
elif event is InputEventScreenDrag:
|
||||
if _is_dragging:
|
||||
drag_moved.emit(event.position)
|
||||
_emit_drag_moved(event.position)
|
||||
elif event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT:
|
||||
if event.pressed:
|
||||
_is_dragging = true
|
||||
drag_started.emit(event.position)
|
||||
_emit_drag_started(event.position)
|
||||
else:
|
||||
_is_dragging = false
|
||||
drag_ended.emit(event.position)
|
||||
_emit_drag_ended(event.position)
|
||||
elif event is InputEventMouseMotion and _is_dragging:
|
||||
drag_moved.emit(event.position)
|
||||
_emit_drag_moved(event.position)
|
||||
|
||||
|
||||
func _emit_drag_started(pos: Vector2) -> void:
|
||||
_is_dragging = true
|
||||
drag_started.emit(pos)
|
||||
|
||||
|
||||
func _emit_drag_moved(pos: Vector2) -> void:
|
||||
drag_moved.emit(pos)
|
||||
|
||||
|
||||
func _emit_drag_ended(pos: Vector2) -> void:
|
||||
_is_dragging = false
|
||||
drag_ended.emit(pos)
|
||||
|
||||
Reference in New Issue
Block a user