#13 suite du developpement d'inventaire avec le rajout des ItemObjects, description sur le GUI, items d'exemple et corrections mineures
This commit was merged in pull request #35.
This commit is contained in:
@@ -28,11 +28,13 @@ func add_items(items_to_add: Array[Item], fillup: bool = false):
|
||||
emit_signal("inventory_changed", self)
|
||||
return true
|
||||
|
||||
func lenght() -> int:
|
||||
return len(items)
|
||||
|
||||
func get_item(ind: int = 0):
|
||||
return items[ind]
|
||||
|
||||
func get_and_remove_item(ind: int = 0):
|
||||
func pop_item(ind: int = 0):
|
||||
var item_removed: Item = items.pop_at(ind)
|
||||
emit_signal("inventory_changed", self)
|
||||
return item_removed
|
||||
|
||||
@@ -2,4 +2,11 @@ extends Resource
|
||||
class_name Item
|
||||
|
||||
@export var name: String
|
||||
@export var description: String
|
||||
@export var icon: Texture2D
|
||||
|
||||
func can_use() -> bool:
|
||||
return false
|
||||
|
||||
func use() -> bool:
|
||||
return false
|
||||
@@ -1,4 +1,11 @@
|
||||
extends Item
|
||||
class_name SeedItem
|
||||
|
||||
@export var plant_type: String
|
||||
@export var plant_type: PlantType
|
||||
|
||||
func _init():
|
||||
if plant_type:
|
||||
if plant_type.name:
|
||||
name = plant_type.name
|
||||
if plant_type.seed_texture:
|
||||
icon = plant_type.seed_texture
|
||||
Reference in New Issue
Block a user