diff --git a/addons/gloot/ui/ctrl_dragable.gd b/addons/gloot/ui/ctrl_dragable.gd index 2581275f..56ca9a95 100644 --- a/addons/gloot/ui/ctrl_dragable.gd +++ b/addons/gloot/ui/ctrl_dragable.gd @@ -98,7 +98,7 @@ func _notification(what) -> void: _preview_node.queue_free() -func _process(_delta) -> void: +func _physics_process(_delta) -> void: if drag_preview: drag_preview.global_position = get_global_mouse_position() - get_grab_offset() diff --git a/addons/gloot/ui/ctrl_inventory_grid_ex.gd b/addons/gloot/ui/ctrl_inventory_grid_ex.gd index c4ca67bb..1ce23c09 100644 --- a/addons/gloot/ui/ctrl_inventory_grid_ex.gd +++ b/addons/gloot/ui/ctrl_inventory_grid_ex.gd @@ -59,11 +59,12 @@ func _refresh_selection() -> void: func _refresh_field_background_grid() -> void: - if _field_background_grid: - remove_child(_field_background_grid) - _field_background_grid.queue_free() - _field_background_grid = null - _field_backgrounds = [] + if _field_background_grid == null: + return + remove_child(_field_background_grid) + _field_background_grid.queue_free() + _field_background_grid = null + _field_backgrounds = [] _create_field_background_grid() diff --git a/addons/gloot/ui/ctrl_item_slot.gd b/addons/gloot/ui/ctrl_item_slot.gd index cff4351b..e07d7cdd 100644 --- a/addons/gloot/ui/ctrl_item_slot.gd +++ b/addons/gloot/ui/ctrl_item_slot.gd @@ -212,9 +212,9 @@ func _refresh() -> void: func _clear() -> void: - if _label: - _label.text = "" - if _ctrl_inventory_item_rect: - _ctrl_inventory_item_rect.item = null - _ctrl_inventory_item_rect.texture = default_item_icon + if _label == null || _ctrl_inventory_item_rect == null: + return + _label.text = "" + _ctrl_inventory_item_rect.item = null + _ctrl_inventory_item_rect.texture = default_item_icon