Dev pour la béta 1
* ajout des artefacts avec la pile et l'emplacement de graine * affichage des artefacts dans le vaisseau sur une étagère * ajout des distributeurs d'artefacts dans les régions * affichage des attributs de bases de plantes dans le vaisseau * changement de l'affichage du choix des régions * changement des icônes du détecteur
This commit is contained in:
@@ -24,11 +24,11 @@ func _ready():
|
||||
|
||||
func update(inventory : Inventory):
|
||||
|
||||
var items = inventory.items
|
||||
var items = inventory.get_all_items()
|
||||
if no_tools:
|
||||
items = items.slice(inventory.n_tools, len(items))
|
||||
items = inventory.seeds
|
||||
|
||||
if len(items) != len(inventory_item_objects) or last_n_tools != inventory.n_tools:
|
||||
if len(items) != len(inventory_item_objects) or last_n_tools != len(inventory.tools):
|
||||
create_inventory_objects(inventory)
|
||||
for i in range(len(items)):
|
||||
var item : Item= items[i]
|
||||
@@ -38,7 +38,7 @@ func update(inventory : Inventory):
|
||||
if not no_tools:
|
||||
if inventory.current_item_ind == i:
|
||||
object.state = (
|
||||
InventoryItem3D.State.TOOL if i < inventory.n_tools
|
||||
InventoryItem3D.State.TOOL if i < len(inventory.tools)
|
||||
else InventoryItem3D.State.ITEM
|
||||
)
|
||||
else:
|
||||
@@ -48,19 +48,19 @@ func update(inventory : Inventory):
|
||||
func create_inventory_objects(inventory : Inventory):
|
||||
for c in %Items3D.get_children():
|
||||
c.queue_free()
|
||||
last_n_tools = inventory.n_tools
|
||||
last_n_tools = len(inventory.tools)
|
||||
|
||||
inventory_item_objects = []
|
||||
|
||||
var items = inventory.items
|
||||
var items = inventory.get_all_items()
|
||||
if no_tools:
|
||||
items = items.slice(inventory.n_tools, len(items))
|
||||
items = inventory.seeds
|
||||
|
||||
for i in range(len(items)):
|
||||
var new_inventory_object := (inventory_item_scene.instantiate() as InventoryItem3D)
|
||||
%Items3D.add_child(new_inventory_object)
|
||||
new_inventory_object.position.x = -INVENTORY_OBJECT_SIZE * i
|
||||
if i >= inventory.n_tools and not no_tools:
|
||||
if i >= len(inventory.tools) and not no_tools:
|
||||
new_inventory_object.position.x -= SEPARATOR_SIZE
|
||||
inventory_item_objects.append(new_inventory_object)
|
||||
|
||||
@@ -75,6 +75,6 @@ func create_inventory_objects(inventory : Inventory):
|
||||
) / 2
|
||||
%ItemSeparator.position.x = (
|
||||
%Items3D.position.x
|
||||
- (inventory.n_tools) * INVENTORY_OBJECT_SIZE
|
||||
- (inventory.tools.size()) * INVENTORY_OBJECT_SIZE
|
||||
+ SEPARATOR_SIZE/2
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user