mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-27 22:41:56 +08:00
bd85129ecc
- 在EntityBase中新增水晶和钻石物品类型 - 敌人在死亡时概率掉落水晶,BOSS额外掉落钻石 - 游戏结束时将水晶和钻石存入OutGameStorage - 调整Starter面板中钻石升级成本为0 - 在UI场景中添加水晶和钻石显示节点
61 lines
1.6 KiB
GDScript
61 lines
1.6 KiB
GDScript
@tool
|
|
extends FullscreenPanelBase
|
|
class_name SelectInitialFeedPanel
|
|
|
|
@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():
|
|
startBtn.disabled = true
|
|
UIState.closeCurrentPanel()
|
|
StarterPanel.selectingFeed = false
|
|
)
|
|
|
|
func beforeOpen(_args: Array = []):
|
|
clearFeeds()
|
|
clearWeapons()
|
|
var feedCounted = 0
|
|
var weaponCounted = 0
|
|
ComponentManager.feeds.shuffle()
|
|
for feed in ComponentManager.feeds:
|
|
var card = feed.instantiate() as Feed
|
|
card.freeToBuy = true
|
|
if card.topic == FeedName.Topic.WEAPON:
|
|
if weaponCounted < OutGameStorage.maxInitialWeaponCount:
|
|
initialWeaponSelection.add_child(card)
|
|
card.selected.connect(
|
|
func(_x):
|
|
if WorldManager.isRelease():
|
|
clearWeapons()
|
|
title2.hide()
|
|
if !title1.visible:
|
|
startBtn.pressed.emit()
|
|
)
|
|
weaponCounted += 1
|
|
else:
|
|
if feedCounted < OutGameStorage.maxInitialFeedCount:
|
|
initialFeedSelection.add_child(card)
|
|
card.selected.connect(
|
|
func(_x):
|
|
if WorldManager.isRelease():
|
|
clearFeeds()
|
|
title1.hide()
|
|
if !title2.visible:
|
|
startBtn.pressed.emit()
|
|
)
|
|
feedCounted += 1
|
|
func afterOpen(_args: Array = []):
|
|
startBtn.disabled = false
|
|
|
|
func clearFeeds():
|
|
for feed in initialFeedSelection.get_children():
|
|
feed.queue_free()
|
|
func clearWeapons():
|
|
for weapon in initialWeaponSelection.get_children():
|
|
weapon.queue_free()
|