refonte de l'inspecteur #61
This commit is contained in:
@@ -22,13 +22,26 @@ func _ready():
|
||||
if item and object_sprite:
|
||||
object_sprite.apply_texture_to_sprite(item.icon, ITEM_SPRITE_SIZE)
|
||||
|
||||
func pointer_text():
|
||||
var name_suffix = ""
|
||||
|
||||
func inspected_text():
|
||||
return item.name + (" Seed" if item is Seed else "")
|
||||
if item is Seed:
|
||||
name_suffix = "Seed"
|
||||
if item is Package:
|
||||
name_suffix = "Package"
|
||||
|
||||
return item.name + (" " + name_suffix if name_suffix else "")
|
||||
|
||||
func interact_text():
|
||||
return "Take"
|
||||
|
||||
func inspector_info() -> Inspector.Info:
|
||||
return Inspector.Info.new(
|
||||
pointer_text(),
|
||||
item.description,
|
||||
item.icon
|
||||
)
|
||||
|
||||
func interact(player : Player) -> bool:
|
||||
var swapped_item = player.inventory.get_item()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user