1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-10 05:37:12 +08:00

feat(UI): 为提示框添加类型支持并改进样式

- 新增MessageType枚举定义提示类型(INFO/WARNING/ERROR)
- 根据不同类型显示不同颜色样式
- 修改所有调用showTip的地方使用新的类型参数
- 移除自动销毁时间参数,统一使用固定显示时长
This commit is contained in:
2026-01-25 21:40:26 +08:00
parent 846458060c
commit 06c2637ebb
5 changed files with 33 additions and 15 deletions
+4 -7
View File
@@ -74,11 +74,8 @@ static func setPanel(targetName: String = "", args: Array = []):
panel.hidePanel()
static func closeCurrentPanel():
setPanel()
static func showTip(text: String, destroyAfter: float = -1):
var box = TipBox.create(text)
static func showTip(text: String, messageType: TipBox.MessageType = TipBox.MessageType.INFO):
var box = TipBox.create(text, messageType)
tips.add_child(box)
if destroyAfter > 0:
await TickTool.millseconds(destroyAfter * len(text))
box.destroy()
else:
return box
await TickTool.millseconds(500 * len(text))
box.destroy()