mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
e4b0f2e5f3
- 在WeaponShow.gd中修改操作标签文本为"获得武器"和"提炼灵魂" - 在Feed.gd中添加武器获取逻辑,区分已有武器和新增武器情况 - 在EntityBase.gd中重构武器图标更新逻辑,提取为rebuildWeaponIcons方法
33 lines
851 B
GDScript
33 lines
851 B
GDScript
@tool
|
|
extends HBoxContainer
|
|
class_name WeaponShow
|
|
|
|
enum Operation {
|
|
GET,
|
|
EXTRACT,
|
|
}
|
|
|
|
@export var weapon: PackedScene = null
|
|
@export var operation: Operation = Operation.GET
|
|
|
|
@onready var operationLabel: Label = $"%operation"
|
|
@onready var avatarRect: TextureRect = $"%avatar"
|
|
@onready var nameLabel: Label = $"%name"
|
|
@onready var soulShow: ItemShow = $"%soul"
|
|
|
|
func _ready():
|
|
var weaponInstance = weapon.instantiate() as Weapon
|
|
avatarRect.texture = weaponInstance.avatarTexture
|
|
nameLabel.text = weaponInstance.displayName
|
|
soulShow.count = weaponInstance.soulLevel
|
|
if operation == Operation.GET:
|
|
operationLabel.text = "获得武器"
|
|
avatarRect.visible = true
|
|
nameLabel.visible = true
|
|
soulShow.visible = false
|
|
else:
|
|
operationLabel.text = "提炼灵魂"
|
|
avatarRect.visible = false
|
|
nameLabel.visible = false
|
|
soulShow.visible = true
|