From 7a71d561c7117e0b5babb0be132885fcc235e1cb 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, 25 Jan 2026 21:43:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(UI):=20=E6=B7=BB=E5=8A=A0=E7=A5=9D?= =?UTF-8?q?=E8=B4=BA=E6=B6=88=E6=81=AF=E7=B1=BB=E5=9E=8B=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=8F=90=E7=A4=BA=E6=A1=86=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在TipBox枚举中添加CONGRATULATION类型 - 更新提示框背景颜色和消息类型颜色映射 - 当击败boss时显示祝贺消息而非普通信息 --- components/UI/TipBox.tscn | 9 +++++---- scripts/Statemachine/EntityBase.gd | 2 +- scripts/Statemachine/TipBox.gd | 8 +++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/components/UI/TipBox.tscn b/components/UI/TipBox.tscn index 05036b2..54bd071 100644 --- a/components/UI/TipBox.tscn +++ b/components/UI/TipBox.tscn @@ -8,7 +8,7 @@ content_margin_left = 10.0 content_margin_top = 5.0 content_margin_right = 10.0 content_margin_bottom = 5.0 -bg_color = Color(0, 0, 1, 1) +bg_color = Color(0, 0.5265789, 1, 1) corner_radius_top_right = 100 corner_radius_bottom_right = 100 @@ -107,9 +107,10 @@ offset_bottom = 34.0 theme_override_styles/panel = SubResource("StyleBoxFlat_5pngc") script = ExtResource("1_7vuk3") colorMap = { -0: Color(0, 0.5265789, 1, 1), -1: Color(1, 0.48120707, 0, 1), -2: Color(1, 0, 0, 1) +0: Color(0, 0.55724907, 1, 1), +1: Color(1, 0.4649545, 0, 1), +2: Color(1, 0, 0, 1), +3: Color(1, 0.88726026, 0, 1) } [node name="label" type="RichTextLabel" parent="."] diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 76e7b22..8bd2efd 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -369,7 +369,7 @@ func tryDie(by: BulletBase = null): await die() died.emit() if isBoss: - UIState.showTip("[b]%s[/b] 已被打败!" % displayName, TipBox.MessageType.INFO) + UIState.showTip("[b]%s[/b] 已被打败!" % displayName, TipBox.MessageType.CONGRATULATION) elif isPlayer(): UIState.showTip("[b]%s[/b] 似了😭。" % displayName, TipBox.MessageType.ERROR) queue_free() diff --git a/scripts/Statemachine/TipBox.gd b/scripts/Statemachine/TipBox.gd index e5a2ef7..fe4e2d4 100644 --- a/scripts/Statemachine/TipBox.gd +++ b/scripts/Statemachine/TipBox.gd @@ -6,14 +6,16 @@ enum MessageType { INFO, WARNING, ERROR, + CONGRATULATION, } @export var text: String = "nothing" @export var messageType: MessageType = MessageType.INFO @export var colorMap = { - MessageType.INFO: Color.BLUE, - MessageType.WARNING: Color.ORANGE, - MessageType.ERROR: Color.RED, + MessageType.INFO: Color.BLACK, + MessageType.WARNING: Color.BLACK, + MessageType.ERROR: Color.BLACK, + MessageType.CONGRATULATION: Color.BLACK, } @onready var label: RichTextLabel = $%label