Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some crashes. #158

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/gloot/ui/ctrl_dragable.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
11 changes: 6 additions & 5 deletions addons/gloot/ui/ctrl_inventory_grid_ex.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
10 changes: 5 additions & 5 deletions addons/gloot/ui/ctrl_item_slot.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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