Make decor occupy individual inventory slots
This commit is contained in:
parent
f2239d248a
commit
4196cda1d5
9 changed files with 516 additions and 79 deletions
|
|
@ -359,6 +359,7 @@ var _selected_inventory_kind: int = -1
|
|||
var _selected_inventory_identity: StringName
|
||||
var _inventory_move_kind: int = -1
|
||||
var _inventory_move_identity: StringName
|
||||
var _inventory_move_key: String = ""
|
||||
var _context_tooltip: PanelContainer
|
||||
var _context_tooltip_label: Label
|
||||
var _context_tooltip_source: Control
|
||||
|
|
@ -3865,6 +3866,7 @@ func _on_general_inventory_slot_activated(
|
|||
return
|
||||
_inventory_move_kind = slot.entry_kind
|
||||
_inventory_move_identity = slot.entry_identity
|
||||
_inventory_move_key = slot.entry_key
|
||||
_selected_inventory_kind = slot.entry_kind
|
||||
_selected_inventory_identity = slot.entry_identity
|
||||
_selected_bag_item_id = (
|
||||
|
|
@ -3883,15 +3885,23 @@ func _on_general_inventory_slot_activated(
|
|||
return
|
||||
var move_kind: int = _inventory_move_kind
|
||||
var move_identity: StringName = _inventory_move_identity
|
||||
var move_key: String = _inventory_move_key
|
||||
_cancel_inventory_move(false)
|
||||
if _inventory_layout == null:
|
||||
return
|
||||
_inventory_layout.move_entry(
|
||||
move_kind,
|
||||
move_identity,
|
||||
PlayerInventoryLayout.InventoryContainer.INVENTORY,
|
||||
slot.slot_index,
|
||||
)
|
||||
if not move_key.is_empty():
|
||||
_inventory_layout.move_entry_by_key(
|
||||
move_key,
|
||||
PlayerInventoryLayout.InventoryContainer.INVENTORY,
|
||||
slot.slot_index,
|
||||
)
|
||||
else:
|
||||
_inventory_layout.move_entry(
|
||||
move_kind,
|
||||
move_identity,
|
||||
PlayerInventoryLayout.InventoryContainer.INVENTORY,
|
||||
slot.slot_index,
|
||||
)
|
||||
|
||||
|
||||
func _open_general_inventory_notepad(
|
||||
|
|
@ -3944,6 +3954,7 @@ func _cancel_inventory_move(hide_tooltip: bool = true) -> bool:
|
|||
return false
|
||||
_inventory_move_kind = -1
|
||||
_inventory_move_identity = StringName()
|
||||
_inventory_move_key = ""
|
||||
if _general_inventory_grid != null:
|
||||
for slot: GeneralInventorySlotType in _general_inventory_grid.get_slots():
|
||||
slot.set_move_source(false)
|
||||
|
|
@ -4316,12 +4327,6 @@ func _sort_bag_storage_items(a: OwnedItemType, b: OwnedItemType) -> bool:
|
|||
|
||||
|
||||
func _sort_tackle_items(a: OwnedItemType, b: OwnedItemType) -> bool:
|
||||
if a.storage_slot >= 0 and b.storage_slot >= 0:
|
||||
return a.storage_slot < b.storage_slot
|
||||
if a.storage_slot >= 0:
|
||||
return true
|
||||
if b.storage_slot >= 0:
|
||||
return false
|
||||
var order_a := FishingShopStockType.get_stock_order_index(a.item_id)
|
||||
var order_b := FishingShopStockType.get_stock_order_index(b.item_id)
|
||||
if order_a >= 0 and order_b >= 0 and order_a != order_b:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue