Files
loneseDocument/Content/Blueprints/BP_ItemViewDataView.md
meishibiezb a8bdf281ff update
2026-06-05 03:01:15 +08:00

59 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# BP_ItemViewDataView
## 基本信息
- **类型**: Blueprint (Object)
- **父类**: Object
- **源文件**: /Game/Blueprints/UI/Item/BP_ItemViewDataView.BP_ItemViewDataView
- **模块**: Content/Blueprints/UI/Item
## 功能概述
物品视图的数据视图对象,继承自 Object作为物品展示的非 UI 数据层。持有 Indexint32和 InvWBP_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 展示 |