1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-31 08:21:54 +08:00

feat(初始选择): 添加初始增益和武器数量限制

- 新增OutGameStorage类存储最大初始数量配置
- 修改SelectInitialFeed面板逻辑以限制选择数量
- 优化FeedCardBase样式和布局
- 移除不必要的ScrollContainer简化UI结构
This commit is contained in:
2026-05-04 07:03:18 +08:00
parent 0eabde6852
commit e53af2a163
5 changed files with 60 additions and 56 deletions
+24 -18
View File
@@ -19,30 +19,36 @@ func _ready():
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:
initialWeaponSelection.add_child(card)
card.selected.connect(
func(_x):
if WorldManager.isRelease():
clearWeapons()
title2.hide()
if !title1.visible:
startBtn.pressed.emit()
)
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:
initialFeedSelection.add_child(card)
card.selected.connect(
func(_x):
if WorldManager.isRelease():
clearFeeds()
title1.hide()
if !title2.visible:
startBtn.pressed.emit()
)
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 clearFeeds():
for feed in initialFeedSelection.get_children():