mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
2a602b0be2
实现游戏模式选择功能,包括无尽波次、Boss Rush和割草模式 添加游戏模式与波次数据的映射关系 优化UI状态管理,新增selectingFeed状态控制UI元素显示 重构Starter面板布局,添加游戏模式选项 为EnergyBlock添加掉落物品配置
51 lines
1.3 KiB
GDScript
51 lines
1.3 KiB
GDScript
@tool
|
|
extends FullscreenPanelBase
|
|
|
|
@onready var initialFeedSelection: HBoxContainer = $%initialFeedSelection
|
|
@onready var initialWeaponSelection: HBoxContainer = $%initialWeaponSelection
|
|
@onready var startBtn: Button = $%startBtn
|
|
@onready var title1: Label = $%title1
|
|
@onready var title2: Label = $%title2
|
|
|
|
func _ready():
|
|
startBtn.pressed.connect(
|
|
func():
|
|
UIState.closeCurrentPanel()
|
|
StarterPanel.selectingFeed = false
|
|
)
|
|
|
|
func beforeOpen(_args: Array = []):
|
|
clearFeeds()
|
|
clearWeapons()
|
|
ComponentManager.feeds.shuffle()
|
|
for feed in ComponentManager.feeds:
|
|
var card = feed.instantiate() as Feed
|
|
card.freeToBuy = true
|
|
if card.topic == FeedName.Topic.WEAPON:
|
|
initialWeaponSelection.add_child(card)
|
|
card.selected.connect(
|
|
func(_x):
|
|
if WorldManager.isRelease():
|
|
clearWeapons()
|
|
title2.hide()
|
|
if !title1.visible:
|
|
startBtn.pressed.emit()
|
|
)
|
|
else:
|
|
initialFeedSelection.add_child(card)
|
|
card.selected.connect(
|
|
func(_x):
|
|
if WorldManager.isRelease():
|
|
clearFeeds()
|
|
title1.hide()
|
|
if !title2.visible:
|
|
startBtn.pressed.emit()
|
|
)
|
|
|
|
func clearFeeds():
|
|
for feed in initialFeedSelection.get_children():
|
|
feed.queue_free()
|
|
func clearWeapons():
|
|
for weapon in initialWeaponSelection.get_children():
|
|
weapon.queue_free()
|