1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 23:11:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Panels/SelectIntialFeed.gd
T
fallingshrimp 0b97de0fcc fix(武器): 调整DaoStatue伤害计算逻辑和描述
feat(游戏流程): 添加初始选择界面自动触发开始按钮逻辑
refactor(战斗系统): 分离调试和发布版的波次配置
style(资源): 更新图片导入配置为VRAM压缩格式
chore: 忽略zip文件并修复.gitignore格式
2026-04-05 07:44:04 +08:00

47 lines
1.2 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())
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()