1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-09 21:27:13 +08:00

feat(武器系统): 添加武器类型支持及相关组件

- 在FeedName.gd中新增WEAPON枚举类型及对应翻译和颜色配置
- 在Feed.gd中添加weapons数组和weaponsBox容器
- 新增WeaponShow.tscn武器展示组件
- 添加NuclearBomb.tscn核弹武器示例
- 修改ComponentManager.gd中主题文件加载路径
- 更新FeedCardBase.tscn和FeedName.tscn以支持武器显示
This commit is contained in:
2025-09-21 16:35:49 +08:00
parent 0f588a4b58
commit ace6d3bf53
7 changed files with 62 additions and 10 deletions
+3
View File
@@ -18,6 +18,7 @@ enum Topic {
PROBABILITY,
FEED,
DROP,
WEAPON,
}
@export var displayName: String = "未命名饲料"
@@ -60,6 +61,7 @@ enum Topic {
Topic.PROBABILITY: "概率",
Topic.FEED: "饲料",
Topic.DROP: "掉落物",
Topic.WEAPON: "武器",
}
@export var topicColorMap = {
Topic.SURVIVAL: Color(),
@@ -70,6 +72,7 @@ enum Topic {
Topic.PROBABILITY: Color(),
Topic.FEED: Color(),
Topic.DROP: Color(),
Topic.WEAPON: Color(),
}
@onready var qualityLabel: Label = $"%quality"
+2
View File
@@ -10,12 +10,14 @@ signal selected(applied: bool)
@export var topic: FeedName.Topic = FeedName.Topic.SURVIVAL
@export var fields: Array[FieldStore.Entity] = []
@export var fieldValues: Array[float] = []
@export var weapons: Array[PackedScene] = []
@export var costs: Array[ItemStore.ItemType] = []
@export var costCounts: Array[int] = []
@onready var avatarRect: TextureRect = $"%avatar"
@onready var nameLabel: FeedName = $"%name"
@onready var fieldsBox: VBoxContainer = $"%fields"
@onready var weaponsBox: VBoxContainer = $"%weapons"
@onready var costsBox: GridContainer = $"%costs"
@onready var selectButton: Button = $"%selectBtn"
+1 -1
View File
@@ -38,6 +38,6 @@ static func getFeed(i: int) -> PackedScene:
static func getUIComponent(t: String) -> PackedScene:
return MathTool.priority(uiComponents.get(t, false), load("res://components/UI/%s.tscn" % t))
static func getTheme(t: String) -> Theme:
return MathTool.priority(themes.get(t, false), load("res://themes/%s.tscn" % t))
return MathTool.priority(themes.get(t, false), load("res://themes/%s.tres" % t))
static func getItemTexture(t: String) -> Texture2D:
return MathTool.priority(itemTextures.get(t, false), load("res://resources/items/%s.svg" % t))