breadwinner/scenes/player/player_ui_manager.gd
Balogh Krisztián eb197412dd minor optimization and bit more mechanics
title says all.
still need to do the connection between the player.gd and its components
breathing sounds weird becausae for some reason it stops playing the audiostream when it shouldnt???????????????? im really confused
2026-07-29 13:52:14 +02:00

32 lines
927 B
GDScript

extends Control
@onready var stamina_bar: ProgressBar = %StaminaBar
@onready var inventory_slots_panels: Array = [%InvSlot1, %InvSlot2, %InvSlot3]
var inventory: Array = [null,null,null]
#var inventory: Array = [null,null,null]
#
#var stamina: float = 100
#var selected_item: int = 0
#
#const SELECTED_COLOR = 0xcfcfcf78
#const UNSELECTED_COLOR = 0x3d3d3d78
#
#func set_stamina_bar(value:float):
#stamina = value
#
#func get_selected_item() -> PackedScene:
#return inventory[selected_item]
#
#func select_item(index: int):
#inventory_slots_panels[selected_item].color = Color.hex(UNSELECTED_COLOR)
#selected_item = index
#inventory_slots_panels[index].color = Color.hex(SELECTED_COLOR)
#
#func put_item(index: int, item: PackedScene):
#inventory[index] = item
#
#func _process(delta: float) -> void:
#stamina_bar.value = lerpf(stamina_bar.value, stamina, delta * 5)
#
#func set_ui_scale(scale:float) -> void:
#pass