From d85ef83ac157ba0dfb4f7a21699fbbefcb48b3c5 Mon Sep 17 00:00:00 2001
From: GeWuYou <95328647+GeWuYou@users.noreply.github.com>
Date: Tue, 20 Jan 2026 12:40:53 +0800
Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E6=B7=BB=E5=8A=A0UI=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E8=A1=8C=E4=B8=BA=E6=8E=A5=E5=8F=A3=E5=92=8C=E5=AE=9E?=
=?UTF-8?q?=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在IUiPageBehavior接口中添加IsModal、BlocksInput和RequiresMask属性定义
- 在CanvasItemUiPageBehavior类中实现模态对话框相关属性
- 添加页面模态状态、输入阻断和遮罩层需求的属性支持
- 为UI页面提供统一的模态行为控制接口
- 实现对下层交互阻断功能的支持
- 完善UI页面行为抽象层的设计规范
---
.../ui/IUiPageBehavior.cs | 16 ++++++++++++++++
GFramework.Godot/ui/CanvasItemUiPageBehavior.cs | 16 ++++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/GFramework.Game.Abstractions/ui/IUiPageBehavior.cs b/GFramework.Game.Abstractions/ui/IUiPageBehavior.cs
index 6309438..ec5ea43 100644
--- a/GFramework.Game.Abstractions/ui/IUiPageBehavior.cs
+++ b/GFramework.Game.Abstractions/ui/IUiPageBehavior.cs
@@ -53,4 +53,20 @@ public interface IUiPageBehavior
/// 页面重新显示时调用的方法
///
void OnShow();
+
+ ///
+ /// 获取页面是否为模态页面
+ ///
+ bool IsModal { get; }
+
+ ///
+ /// 获取页面是否阻断下层交互
+ ///
+ bool BlocksInput { get; }
+
+ ///
+ /// 获取页面是否需要蒙版
+ ///
+ bool RequiresMask { get; }
+
}
\ No newline at end of file
diff --git a/GFramework.Godot/ui/CanvasItemUiPageBehavior.cs b/GFramework.Godot/ui/CanvasItemUiPageBehavior.cs
index 4bd7673..9cf65aa 100644
--- a/GFramework.Godot/ui/CanvasItemUiPageBehavior.cs
+++ b/GFramework.Godot/ui/CanvasItemUiPageBehavior.cs
@@ -94,4 +94,20 @@ public class CanvasItemUiPageBehavior(T owner, string key) : IUiPageBehavior
owner.Show();
OnResume();
}
+
+ ///
+ /// 获取或设置页面是否为模态对话框
+ ///
+ public bool IsModal { get; set; }
+
+ ///
+ /// 获取或设置页面是否阻止输入
+ ///
+ public bool BlocksInput { get; set; } = true;
+
+ ///
+ /// 获取或设置页面是否需要遮罩层
+ ///
+ public bool RequiresMask { get; set; }
+
}
\ No newline at end of file