update
This commit is contained in:
58
Content/Blueprints/BP_ItemViewDataView.md
Normal file
58
Content/Blueprints/BP_ItemViewDataView.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# BP_ItemViewDataView
|
||||
|
||||
## 基本信息
|
||||
- **类型**: Blueprint (Object)
|
||||
- **父类**: Object
|
||||
- **源文件**: /Game/Blueprints/UI/Item/BP_ItemViewDataView.BP_ItemViewDataView
|
||||
- **模块**: Content/Blueprints/UI/Item
|
||||
|
||||
## 功能概述
|
||||
物品视图的数据视图对象,继承自 Object,作为物品展示的非 UI 数据层。持有 Index(int32)和 Inv(WBP_InventoryView_C*)两个变量,用于追踪当前视图索引和关联的库存视图。
|
||||
|
||||
## 设计用意
|
||||
将物品视图的数据逻辑与 UI 表现分离,作为 ViewModel 层存在。通过 Index 追踪当前浏览位置,通过 Inv 持有对 WBP_InventoryView 的引用以便更新 UI。
|
||||
|
||||
## 职责范围
|
||||
- 管理当前浏览物品的索引(Index)
|
||||
- 持有库存视图引用(Inv)以便数据更新时同步 UI
|
||||
|
||||
## 项目内依赖
|
||||
| 依赖项 | 关系 | 源文件 |
|
||||
|--------|------|--------|
|
||||
| WBP_InventoryView | 包含(变量) | /Game/Blueprints/UI/Item/WBP_InventoryView |
|
||||
|
||||
## 外部视角
|
||||
|
||||
BP_ItemViewDataView 是 Object 的子类,从外部调用者视角:
|
||||
|
||||
**公开属性(蓝图可读写)**
|
||||
- `Index`(int32)— 当前浏览的物品索引位置
|
||||
- `Inv`(WBP_InventoryView_C*)— 关联的库存视图 Widget 引用
|
||||
|
||||
**接口概览**
|
||||
- 无自定义函数,作为纯数据对象(ViewModel)存在
|
||||
- 通过 Index 追踪当前展示的物品位置
|
||||
- 通过 Inv 引用在数据更新时通知 WBP_InventoryView 刷新 UI
|
||||
|
||||
**外部交互方式**
|
||||
- 由 WBP_ItemViewBox 或 WBP_InventoryView 创建并使用
|
||||
- 外部系统可通过对象引用读取 Index 和 Inv
|
||||
|
||||
**EventGraph 事件**
|
||||
|
||||
| 事件 | 类型 | 触发时机 | 行为 |
|
||||
|------|------|----------|------|
|
||||
| (无) | — | — | EventGraph 为空,作为纯数据对象 |
|
||||
|
||||
## 使用方法
|
||||
|
||||
BP_ItemViewDataView 在项目中的典型调用流程:
|
||||
|
||||
- **列表项绑定流程** — WBP_ItemViewBox 的列表项被设置 → BP_ItemViewDataView 对象传入 → 读取 Index 和 Inv → 从 InventoryComp 获取对应位置的物品数据
|
||||
|
||||
## 用例
|
||||
|
||||
| 引用方 | 路径 | 用途 |
|
||||
|--------|------|------|
|
||||
| WBP_ItemViewBox | `/Game/Blueprints/UI/Item/WBP_ItemViewBox` | 引用作为物品视图的数据层 |
|
||||
| WBP_InventoryView | `/Game/Blueprints/UI/Item/WBP_InventoryView` | 关联数据视图对象用于 UI 展示 |
|
||||
Reference in New Issue
Block a user