2025-09-21 16:49:52 +08:00
|
|
|
@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:
|
2025-09-21 17:00:11 +08:00
|
|
|
operationLabel.text = "获得武器"
|
2025-09-21 16:49:52 +08:00
|
|
|
soulShow.visible = false
|
|
|
|
|
else:
|
2025-09-21 17:00:11 +08:00
|
|
|
operationLabel.text = "提炼灵魂"
|
2025-09-21 16:49:52 +08:00
|
|
|
soulShow.visible = true
|