1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-07-01 15:52:30 +08:00

feat(UI): 添加祝贺消息类型并更新提示框样式

- 在TipBox枚举中添加CONGRATULATION类型
- 更新提示框背景颜色和消息类型颜色映射
- 当击败boss时显示祝贺消息而非普通信息
This commit is contained in:
2026-01-25 21:43:53 +08:00
parent 06c2637ebb
commit 7a71d561c7
3 changed files with 11 additions and 8 deletions
+5 -4
View File
@@ -8,7 +8,7 @@ content_margin_left = 10.0
content_margin_top = 5.0 content_margin_top = 5.0
content_margin_right = 10.0 content_margin_right = 10.0
content_margin_bottom = 5.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_top_right = 100
corner_radius_bottom_right = 100 corner_radius_bottom_right = 100
@@ -107,9 +107,10 @@ offset_bottom = 34.0
theme_override_styles/panel = SubResource("StyleBoxFlat_5pngc") theme_override_styles/panel = SubResource("StyleBoxFlat_5pngc")
script = ExtResource("1_7vuk3") script = ExtResource("1_7vuk3")
colorMap = { colorMap = {
0: Color(0, 0.5265789, 1, 1), 0: Color(0, 0.55724907, 1, 1),
1: Color(1, 0.48120707, 0, 1), 1: Color(1, 0.4649545, 0, 1),
2: Color(1, 0, 0, 1) 2: Color(1, 0, 0, 1),
3: Color(1, 0.88726026, 0, 1)
} }
[node name="label" type="RichTextLabel" parent="."] [node name="label" type="RichTextLabel" parent="."]
+1 -1
View File
@@ -369,7 +369,7 @@ func tryDie(by: BulletBase = null):
await die() await die()
died.emit() died.emit()
if isBoss: if isBoss:
UIState.showTip("[b]%s[/b] 已被打败!" % displayName, TipBox.MessageType.INFO) UIState.showTip("[b]%s[/b] 已被打败!" % displayName, TipBox.MessageType.CONGRATULATION)
elif isPlayer(): elif isPlayer():
UIState.showTip("[b]%s[/b] 似了😭。" % displayName, TipBox.MessageType.ERROR) UIState.showTip("[b]%s[/b] 似了😭。" % displayName, TipBox.MessageType.ERROR)
queue_free() queue_free()
+5 -3
View File
@@ -6,14 +6,16 @@ enum MessageType {
INFO, INFO,
WARNING, WARNING,
ERROR, ERROR,
CONGRATULATION,
} }
@export var text: String = "nothing" @export var text: String = "nothing"
@export var messageType: MessageType = MessageType.INFO @export var messageType: MessageType = MessageType.INFO
@export var colorMap = { @export var colorMap = {
MessageType.INFO: Color.BLUE, MessageType.INFO: Color.BLACK,
MessageType.WARNING: Color.ORANGE, MessageType.WARNING: Color.BLACK,
MessageType.ERROR: Color.RED, MessageType.ERROR: Color.BLACK,
MessageType.CONGRATULATION: Color.BLACK,
} }
@onready var label: RichTextLabel = $%label @onready var label: RichTextLabel = $%label