add props
This commit is contained in:
@@ -1,4 +1,18 @@
|
||||
class_name PauseMain extends VBoxContainer
|
||||
|
||||
func _ready() -> void:
|
||||
visible = true
|
||||
visible = false
|
||||
$HBoxContainer/ItemList.item_selected.connect(onItemSelected)
|
||||
|
||||
func open():
|
||||
visible = true
|
||||
$HBoxContainer/ItemList.clear()
|
||||
|
||||
func close():
|
||||
visible = false
|
||||
|
||||
func isOpen() -> bool:
|
||||
return visible
|
||||
|
||||
func onItemSelected(index:int) -> void:
|
||||
print("Selected item index: ", index)
|
@@ -1,17 +1,19 @@
|
||||
class_name PauseMenu extends Control
|
||||
|
||||
@export var MAIN:PauseMain
|
||||
@export var OPTIONS:PauseOptions
|
||||
|
||||
func _ready() -> void:
|
||||
hide()
|
||||
close()
|
||||
|
||||
func isOpen() -> bool:
|
||||
return visible
|
||||
|
||||
func open() -> void:
|
||||
visible = true
|
||||
MAIN.visible = true
|
||||
MAIN.open()
|
||||
|
||||
func close() -> void:
|
||||
visible = false
|
||||
MAIN.visible = false
|
||||
MAIN.close()
|
||||
OPTIONS.close()
|
10
scripts/ui/pause/PauseOptions.gd
Normal file
10
scripts/ui/pause/PauseOptions.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
class_name PauseOptions extends Control
|
||||
|
||||
func open() -> void:
|
||||
visible = true
|
||||
|
||||
func close() -> void:
|
||||
visible = false
|
||||
|
||||
func isOpen() -> bool:
|
||||
return visible
|
1
scripts/ui/pause/PauseOptions.gd.uid
Normal file
1
scripts/ui/pause/PauseOptions.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dno7duijupjj6
|
Reference in New Issue
Block a user