diff --git a/components/Abstracts/FeedCardBase.tscn b/components/Abstracts/FeedCardBase.tscn index 4521371..2549d55 100644 --- a/components/Abstracts/FeedCardBase.tscn +++ b/components/Abstracts/FeedCardBase.tscn @@ -1,47 +1,48 @@ -[gd_scene load_steps=5 format=3 uid="uid://bykwevnv7keeh"] +[gd_scene format=3 uid="uid://bykwevnv7keeh"] -[ext_resource type="Script" path="res://scripts/Structs/Feed.gd" id="1_2ea75"] +[ext_resource type="Script" uid="uid://nt81whieye7h" path="res://scripts/Structs/Feed.gd" id="1_2ea75"] [ext_resource type="Theme" uid="uid://dhvs6urgf6jr5" path="res://themes/main.tres" id="2_lvrpo"] [ext_resource type="PackedScene" uid="uid://bt370a1djjg5p" path="res://components/UI/FeedName.tscn" id="4_aewpy"] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n2ewr"] -content_margin_left = 30.0 +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3g2k7"] +content_margin_left = 20.0 content_margin_top = 20.0 -content_margin_right = 30.0 +content_margin_right = 20.0 content_margin_bottom = 20.0 -bg_color = Color(0, 0, 0, 0.5) -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -border_color = Color(0, 0, 0, 0.75) -corner_radius_top_left = 5 -corner_radius_top_right = 5 -corner_radius_bottom_right = 5 -corner_radius_bottom_left = 5 +bg_color = Color(0, 0, 0, 0.70000005) +border_width_left = 10 +border_width_top = 10 +border_width_right = 10 +border_width_bottom = 10 +border_color = Color(1, 1, 1, 1) +border_blend = true +corner_radius_top_left = 15 +corner_radius_top_right = 15 +corner_radius_bottom_right = 15 +corner_radius_bottom_left = 15 +corner_detail = 1 -[node name="FeedCard" type="PanelContainer"] +[node name="FeedCard" type="PanelContainer" unique_id=1794851856] offset_right = 200.0 offset_bottom = 300.0 -theme_override_styles/panel = SubResource("StyleBoxFlat_n2ewr") +theme_override_styles/panel = SubResource("StyleBoxFlat_3g2k7") script = ExtResource("1_2ea75") -metadata/_edit_lock_ = true -[node name="container" type="VBoxContainer" parent="."] +[node name="container" type="VBoxContainer" parent="." unique_id=2054000756] layout_mode = 2 theme_override_constants/separation = 10 -[node name="selectBtn" type="Button" parent="container"] +[node name="selectBtn" type="Button" parent="container" unique_id=775671566] unique_name_in_owner = true layout_mode = 2 theme = ExtResource("2_lvrpo") text = "确定" -[node name="info" type="VBoxContainer" parent="container"] +[node name="info" type="VBoxContainer" parent="container" unique_id=1288419607] layout_mode = 2 theme_override_constants/separation = 10 -[node name="avatar" type="TextureRect" parent="container/info"] +[node name="avatar" type="TextureRect" parent="container/info" unique_id=239110315] unique_name_in_owner = true custom_minimum_size = Vector2(75, 75) layout_mode = 2 @@ -50,20 +51,20 @@ size_flags_vertical = 0 expand_mode = 1 stretch_mode = 5 -[node name="name" parent="container/info" instance=ExtResource("4_aewpy")] +[node name="name" parent="container/info" unique_id=1202819558 instance=ExtResource("4_aewpy")] unique_name_in_owner = true layout_mode = 2 quality = 1 -[node name="fields" type="VBoxContainer" parent="container"] +[node name="fields" type="VBoxContainer" parent="container" unique_id=54224040] unique_name_in_owner = true layout_mode = 2 -[node name="weapons" type="VBoxContainer" parent="container"] +[node name="weapons" type="VBoxContainer" parent="container" unique_id=2041301443] unique_name_in_owner = true layout_mode = 2 -[node name="costs" type="GridContainer" parent="container"] +[node name="costs" type="GridContainer" parent="container" unique_id=1806594453] unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 10 diff --git a/components/Scenes/FullscreenPanels/SelectInitialFeed.tscn b/components/Scenes/FullscreenPanels/SelectInitialFeed.tscn index b384e73..1fa2d51 100644 --- a/components/Scenes/FullscreenPanels/SelectInitialFeed.tscn +++ b/components/Scenes/FullscreenPanels/SelectInitialFeed.tscn @@ -27,14 +27,10 @@ size_flags_horizontal = 4 text = "在游戏开始前,你可以选择一项初始增益。" label_settings = SubResource("LabelSettings_eugsq") -[node name="container" type="ScrollContainer" parent="content/wrapper/wrapper" index="1" unique_id=465067132] -layout_mode = 2 -follow_focus = true -vertical_scroll_mode = 0 - -[node name="initialFeedSelection" type="HBoxContainer" parent="content/wrapper/wrapper/container" index="0" unique_id=1363721283] +[node name="initialFeedSelection" type="HBoxContainer" parent="content/wrapper/wrapper" index="1" unique_id=1363721283] unique_name_in_owner = true layout_mode = 2 +alignment = 1 [node name="title2" type="Label" parent="content/wrapper/wrapper" index="2" unique_id=398646662] unique_name_in_owner = true @@ -43,14 +39,10 @@ size_flags_horizontal = 4 text = "在游戏开始前,你可以选择一个初始武器。" label_settings = SubResource("LabelSettings_eugsq") -[node name="container2" type="ScrollContainer" parent="content/wrapper/wrapper" index="3" unique_id=474299205] -layout_mode = 2 -follow_focus = true -vertical_scroll_mode = 0 - -[node name="initialWeaponSelection" type="HBoxContainer" parent="content/wrapper/wrapper/container2" index="0" unique_id=1933174501] +[node name="initialWeaponSelection" type="HBoxContainer" parent="content/wrapper/wrapper" index="3" unique_id=1933174501] unique_name_in_owner = true layout_mode = 2 +alignment = 1 [node name="startBtn" type="Button" parent="content/wrapper" index="1" unique_id=298849731] unique_name_in_owner = true diff --git a/scripts/Contents/Panels/SelectIntialFeed.gd b/scripts/Contents/Panels/SelectIntialFeed.gd index 3cf7703..d46fd5b 100644 --- a/scripts/Contents/Panels/SelectIntialFeed.gd +++ b/scripts/Contents/Panels/SelectIntialFeed.gd @@ -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(): diff --git a/scripts/Tools/OutGameStorage.gd b/scripts/Tools/OutGameStorage.gd new file mode 100644 index 0000000..360d1f6 --- /dev/null +++ b/scripts/Tools/OutGameStorage.gd @@ -0,0 +1,4 @@ +class_name OutGameStorage + +static var maxInitialFeedCount: int = 3 +static var maxInitialWeaponCount: int = 3 diff --git a/scripts/Tools/OutGameStorage.gd.uid b/scripts/Tools/OutGameStorage.gd.uid new file mode 100644 index 0000000..2ea1c3b --- /dev/null +++ b/scripts/Tools/OutGameStorage.gd.uid @@ -0,0 +1 @@ +uid://dum6mef633vej