From b8bba34d83ea44ca21565b9e7581699724de835c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Sun, 14 Dec 2025 15:52:57 +0800 Subject: [PATCH] =?UTF-8?q?refactor(UI):=20=E6=B8=85=E7=90=86=E6=AD=A6?= =?UTF-8?q?=E5=99=A8=E5=B1=95=E7=A4=BA=E7=95=8C=E9=9D=A2=E7=9A=84=E5=86=97?= =?UTF-8?q?=E4=BD=99=E4=BB=A3=E7=A0=81=E5=92=8C=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除武器展示界面中不必要的可见性控制代码,统一通过脚本管理可见性 简化场景文件中的冗余属性设置,保持与脚本逻辑一致 --- components/UI/WeaponShow.tscn | 6 ++---- scripts/Statemachine/ItemShow.gd | 2 +- scripts/Statemachine/WeaponShow.gd | 4 ---- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/components/UI/WeaponShow.tscn b/components/UI/WeaponShow.tscn index 9d31994..1bf7fd3 100644 --- a/components/UI/WeaponShow.tscn +++ b/components/UI/WeaponShow.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=3 uid="uid://c7747qr83iojj"] [ext_resource type="Theme" uid="uid://b6nox1qqh50ub" path="res://themes/smallText.tres" id="1_ua7kx"] -[ext_resource type="Script" path="res://scripts/Statemachine/WeaponShow.gd" id="2_cojxr"] +[ext_resource type="Script" uid="uid://ohfsaaweoxpb" path="res://scripts/Statemachine/WeaponShow.gd" id="2_cojxr"] [ext_resource type="PackedScene" uid="uid://bbm8l3hr4ihar" path="res://components/UI/ItemShow.tscn" id="2_yqc2h"] [ext_resource type="PackedScene" uid="uid://b2qhes4apaxsj" path="res://components/Weapons/NuclearBomb.tscn" id="3_gh1wm"] [ext_resource type="Texture2D" uid="uid://cp57lmeohvo3o" path="res://resources/weapons/nuclear-bomb.png" id="4_yyc4p"] @@ -16,11 +16,10 @@ weapon = ExtResource("3_gh1wm") [node name="operation" type="Label" parent="."] unique_name_in_owner = true layout_mode = 2 -text = "提炼" +text = "获得武器" [node name="avatar" type="TextureRect" parent="."] unique_name_in_owner = true -visible = false custom_minimum_size = Vector2(20, 20) layout_mode = 2 size_flags_horizontal = 10 @@ -31,7 +30,6 @@ stretch_mode = 5 [node name="name" type="Label" parent="."] unique_name_in_owner = true -visible = false layout_mode = 2 text = "核弹控制器" diff --git a/scripts/Statemachine/ItemShow.gd b/scripts/Statemachine/ItemShow.gd index 4c5a087..05a462f 100644 --- a/scripts/Statemachine/ItemShow.gd +++ b/scripts/Statemachine/ItemShow.gd @@ -16,7 +16,7 @@ func _ready(): if autoFree: animator.play("show") await animator.animation_finished - await TickTool.millseconds(GameRule.itemShowLifetime) # 等待几秒后自动隐藏 + await TickTool.millseconds(GameRule.itemShowLifetime) animator.play("hide") await animator.animation_finished queue_free() diff --git a/scripts/Statemachine/WeaponShow.gd b/scripts/Statemachine/WeaponShow.gd index b5ee26c..05a05a4 100644 --- a/scripts/Statemachine/WeaponShow.gd +++ b/scripts/Statemachine/WeaponShow.gd @@ -22,11 +22,7 @@ func _ready(): 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