/
mrFeld
/
Platformer
Обзор
Документация
Войти
/
mrFeld
/
Platformer
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Script/UI/user_interface.gd
38 строк
939 B
Neterov Vladimir
quests
19 ноя 2025, 17:36
19 ноя 2025, 17:36
ab546f8
Код
Авторство
О чём код?
extends CanvasLayer @onready var Inventory = $PlayerInventory/Inventory @onready var esc_menu = $EscMenu func _input(event): if event.is_action_pressed("Inventory"): Inventory.visible = !Inventory.visible Inventory.initialize_inventory() print($PlayerInventory.inventory) print($PlayerInventory.hotbar) if event.is_action_pressed("scroll_up"): PlayerInventory.active_item_scroll_up() elif event.is_action_pressed("scroll_down"): PlayerInventory.active_item_scroll_down() if Input.is_action_just_pressed("ui_cancel"): if $PlayerInventory/Inventory.is_visible_in_tree(): $PlayerInventory/Inventory.hide() else: if $EscMenu.is_visible_in_tree(): get_tree().paused = false all_ui_show() else: get_tree().paused = true all_ui_hide() func _ready() -> void: esc_menu.esc_menu_button_pressed.connect(all_ui_show) func all_ui_hide(): $EscMenu.show() func all_ui_show(): $EscMenu.hide()