2026-01-30 11:44:42 +08:00
|
|
|
@tool
|
|
|
|
|
extends FullscreenPanelBase
|
|
|
|
|
|
|
|
|
|
@onready var initialFeedSelection: HBoxContainer = $%initialFeedSelection
|
2026-01-31 13:01:27 +08:00
|
|
|
@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())
|
2026-01-30 11:44:42 +08:00
|
|
|
|
|
|
|
|
func beforeOpen(_args: Array = []):
|
2026-01-31 13:01:27 +08:00
|
|
|
clearFeeds()
|
|
|
|
|
clearWeapons()
|
2026-01-30 12:21:02 +08:00
|
|
|
ComponentManager.feeds.shuffle()
|
2026-01-30 11:44:42 +08:00
|
|
|
for feed in ComponentManager.feeds:
|
|
|
|
|
var card = feed.instantiate() as Feed
|
2026-01-30 11:50:16 +08:00
|
|
|
card.freeToBuy = true
|
2026-01-31 13:01:27 +08:00
|
|
|
if card.topic == FeedName.Topic.WEAPON:
|
|
|
|
|
initialWeaponSelection.add_child(card)
|
|
|
|
|
card.selected.connect(
|
|
|
|
|
func(_x):
|
|
|
|
|
clearWeapons()
|
|
|
|
|
title2.hide()
|
|
|
|
|
)
|
|
|
|
|
else:
|
|
|
|
|
initialFeedSelection.add_child(card)
|
|
|
|
|
card.selected.connect(
|
|
|
|
|
func(_x):
|
|
|
|
|
clearFeeds()
|
|
|
|
|
title1.hide()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func clearFeeds():
|
|
|
|
|
for feed in initialFeedSelection.get_children():
|
|
|
|
|
feed.queue_free()
|
|
|
|
|
func clearWeapons():
|
|
|
|
|
for weapon in initialWeaponSelection.get_children():
|
|
|
|
|
weapon.queue_free()
|