equipable item row with working inventory #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "equipable-item-rows"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -65,0 +106,4 @@var high_level_cat := row.categoryrow.items_categories.append(EquipableItemCategory.new(item, high_level_cat))duplicating the whole inventory
@ -10,3 +10,3 @@var key_amount := 0var high_level_categories: Array[Variant] = [var high_level_categories: Array[Script] = [missing multiple other categories so add_item will silently fail:
AccessoryRes
GlovesRes
LegsRes
@ -89,0 +153,4 @@func get_active_index_by_category(category: Script) -> int:return find_row_by_category(category).active_indexnull reference exception
@ -15,0 +25,4 @@slot_buttons[i].item_slot_texture.texture = textures[i]func set_visible_res() -> void:multiple issues; row can be null and will return a null reference. row items categories can be null, also a null reference exception. the item_cat's themselves can also be null reference, causing another exception crash
@ -0,0 +11,4 @@return get_items().find(item)func get_items() -> Array[ItemInstance]:this allocates memory for a new array, iterates through the entire category collection and copies it then does another linear search
items.find(item) is faster and more direct
Bad practices; double allocation and slower iteration over arrays adding onto the O(n) complexity