UK2Node_SetMassFlag
Source/MassAPIUncooked/Public/OperationFlag/K2Node_SetMassFlag.h
概述 Overview
给实体或实体模板设置旗标(EEntityFlags 枚举)的蓝图 K2 节点。已弃用:不向右键菜单注册,替代品为 FName 版本 UK2Node_SetMassFlagByName。本节点是 Flag 节点中能力最全的弃用版本:DataSource 除支持 FEntityHandle / FEntityTemplateData 外还支持两者对应的数组模式(EntityHandleArray / EntityTemplateDataArray),数组模式在编译时展开为 ForEach 循环(计数器 + 分支 + 取元素 + 调用 + 自增回跳),逐个元素调用 SetFlag_Entity / SetFlag_Template。Tooltip 在数组模式附加 "(Array mode: processes each element in a loop.)"。详情面板另提供 "Show World Context Pin" 开关(bShowWorldContext,默认关闭),勾选后节点出现可选的 WorldContext 透传输入引脚。
Blueprint K2 node that sets a flag (EEntityFlags enum) on an entity or entity template. Deprecated: not registered to the right-click menu; the replacement is the FName-based UK2Node_SetMassFlagByName. This is the most capable deprecated Flag node: besides FEntityHandle / FEntityTemplateData, DataSource also supports the array modes (EntityHandleArray / EntityTemplateDataArray), which compile into a ForEach loop (counter + branch + element fetch + call + increment loop-back) calling SetFlag_Entity / SetFlag_Template per element. The tooltip appends "(Array mode: processes each element in a loop.)" in array mode. The details panel also offers a "Show World Context Pin" toggle (bShowWorldContext, off by default); checking it reveals an optional WorldContext pass-through input pin on the node.
继承 Inheritance
公开方法 Public Methods
恒返回 true:该节点标记为弃用。
Always returns true: the node is marked deprecated.
Input
无参数。
No parameters.
Output
恒返回 true。无副作用。
Always returns true. No side effects.
返回 false:非纯节点,带执行流引脚(Execute/Then)。
Returns false: not a pure node, has exec pins (Execute/Then).
Input
无参数。
No parameters.
Output
恒返回 false。
Always returns false.
返回 true:在 Details 面板显示节点属性("Show World Context Pin" 开关)。
Returns true: node properties are shown in the Details panel (the "Show World Context Pin" toggle).
Input
无参数。
No parameters.
Output
恒返回 true。
Always returns true.
按 CachedDataSourceType 返回五种标题:None → "SetMassFlag [Deprecated]",EntityHandle → "SetMassFlag-Entity [Deprecated]",EntityTemplateData → "SetMassFlag-Template [Deprecated]",EntityHandleArray → "SetMassFlag-Entities [Deprecated]",EntityTemplateDataArray → "SetMassFlag-Templates [Deprecated]"。
Returns one of five titles from CachedDataSourceType: None → "SetMassFlag [Deprecated]", EntityHandle → "SetMassFlag-Entity [Deprecated]", EntityTemplateData → "SetMassFlag-Template [Deprecated]", EntityHandleArray → "SetMassFlag-Entities [Deprecated]", EntityTemplateDataArray → "SetMassFlag-Templates [Deprecated]".
Input
| 参数 Param | 类型 Type | 说明 Description |
|---|---|---|
TitleType | ENodeTitleType::Type | 标题类型(本实现忽略)。Title type (ignored by this implementation). |
Output
返回映射后的标题文本;未知类型返回空字符串。
Returns the mapped title text; unknown types yield an empty string.
右键菜单分类路径:常量 "MassAPI|Flag"。
Right-click menu category: the constant "MassAPI|Flag".
Input
无参数。
No parameters.
Output
返回 "MassAPI|Flag"。
Returns "MassAPI|Flag".
基础文案 "Set a flag on an entity or entity template.";数组模式(EntityHandleArray / EntityTemplateDataArray)时追加 " (Array mode: processes each element in a loop.)"。
Base text "Set a flag on an entity or entity template."; in array mode (EntityHandleArray / EntityTemplateDataArray) appends " (Array mode: processes each element in a loop.)".
Input
无参数。
No parameters.
Output
返回上述 Tooltip 文本。无副作用。
Returns the tooltip text above. No side effects.
返回函数图标(Kismet.AllClasses.FunctionIcon),并把 OutColor 写为蓝色 (0.0, 0.8, 1.0)——所有 DataSource 模式同色,"设置"语义色。
Returns the function icon (Kismet.AllClasses.FunctionIcon) and writes OutColor as blue (0.0, 0.8, 1.0) — the same for every DataSource mode, the "set" semantic color.
Input
| 参数 Param | 类型 Type | 说明 Description |
|---|---|---|
OutColor | FLinearColor& | 输出参数,写入节点图标色调。Out parameter; receives the node icon tint. |
Output
返回 FSlateIcon;副作用:覆写 OutColor。
Returns an FSlateIcon; side effect: overwrites OutColor.
节点标题颜色:None 模式为黑色(未连接),其余四种模式为蓝色 (0.0, 0.8, 1.0)。
Node title color: black for None (unconnected), blue (0.0, 0.8, 1.0) for the other four modes.
Input
无参数。
No parameters.
Output
返回对应的颜色值。
Returns the corresponding color.
创建默认引脚:执行入 Execute / 出 Then;输入 DataSource(Wildcard 引用类型)、Flag(EEntityFlags 字节枚举)、bDeferred(bool,默认 false);输出 ReturnValue(bool,仅单实体模式有效,Template/Array 模式下由 UpdateDataSourceType 移除)。勾选 bShowWorldContext 时额外创建可选的 WorldContext 输入引脚(MassAPIWorldContext::CreateOn,UObject,默认值 self,置于 exec 引脚正下方)。随后调用 UpdateDataSourceType。
Creates the default pins: exec in Execute / out Then; inputs DataSource (wildcard by-reference), Flag (EEntityFlags byte enum), bDeferred (bool, default false); output ReturnValue (bool, valid only in single-entity mode; removed by UpdateDataSourceType in Template/Array modes). When bShowWorldContext is checked, an optional WorldContext input pin is additionally created (MassAPIWorldContext::CreateOn, UObject, default value self, placed directly below the exec pin). Then calls UpdateDataSourceType.
Input
无参数。
No parameters.
Output
无返回值。副作用:创建节点引脚并写入 CachedDataSourceType。
No return value. Side effect: creates node pins and fills CachedDataSourceType.
蓝图节点重建时恢复引脚状态:① 恢复 DataSource 引脚类型并保持引用标志;② 若旧 bDeferred 为 true,重建 OnFinished 委托引脚并恢复其连接;③ 更新缓存类型。
Restores pin state during blueprint node reconstruction: ① restores the DataSource pin type keeping the reference flag; ② if the old bDeferred was true, recreates the OnFinished delegate pin and restores its links; ③ updates the cached type.
Input
| 参数 Param | 类型 Type | 说明 Description |
|---|---|---|
OldPins | TArray<UEdGraphPin*>& | 重建前的旧引脚列表。The old pin list before reconstruction. |
Output
无返回值。副作用:修改引脚类型并可能创建新引脚。
No return value. Side effect: mutates pin types and may create new pins.
调用父类后刷新 UpdateDataSourceType。
Calls the parent then refreshes UpdateDataSourceType.
Input
无参数。
No parameters.
Output
无返回值。副作用:更新缓存类型、可能增删引脚。
No return value. Side effect: updates the cached type, may add/remove pins.
处理 bDeferred 复选框切换:勾选时创建 OnFinished 委托引脚并设置签名;取消勾选时断开连接并移除该引脚。变化后通知图表刷新。
Handles the bDeferred checkbox toggle: when checked creates the OnFinished delegate pin with its signature; when unchecked breaks links and removes the pin. Notifies the graph to refresh on change.
Input
| 参数 Param | 类型 Type | 说明 Description |
|---|---|---|
Pin | UEdGraphPin* | 值发生变化的引脚。The pin whose value changed. |
Output
无返回值。副作用:创建/销毁 OnFinished 引脚。
No return value. Side effect: creates/destroys the OnFinished pin.
限制 DataSource 引脚的连接:Wildcard 一律拒绝;只允许连接 FEntityHandle / FEntityTemplateData 结构体,否则返回 true 并给出 OutReason 文案。
Restricts connections on DataSource: Wildcard is always rejected; only FEntityHandle / FEntityTemplateData structs are allowed, otherwise returns true with an OutReason message.
Input
| 参数 Param | 类型 Type | 说明 Description |
|---|---|---|
MyPin | const UEdGraphPin* | 本节点的引脚。This node's pin. |
OtherPin | const UEdGraphPin* | 对方引脚。The other pin. |
OutReason | FString& | 输出参数:拒绝连接时的原因文案。Out parameter: rejection reason text. |
Output
返回 true = 禁止连接(并写入 OutReason);否则委托父类判断。
Returns true = connection disallowed (and fills OutReason); otherwise delegates to the parent.
DataSource 引脚连接变化时:有连接则同步类型(保持引用标志);断开则恢复 Wildcard。随后更新缓存类型并通知图表。
When the DataSource pin connection changes: with a link, syncs the pin type (keeping the reference flag); without a link, reverts to wildcard. Then updates the cached type and notifies the graph.
Input
| 参数 Param | 类型 Type | 说明 Description |
|---|---|---|
Pin | UEdGraphPin* | 连接列表发生变化的引脚。The pin whose connection list changed. |
Output
无返回值。副作用:改写 DataSource 引脚类型与 CachedDataSourceType。
No return value. Side effect: mutates the DataSource pin type and CachedDataSourceType.
从 DataSource 引脚的结构体类型与容器类型(是否数组)推断 CachedDataSourceType(四种有效模式之一,否则 None),并据此管理引脚:Template 或 Array 模式移除 ReturnValue 引脚;bDeferred 仅实体模式(单个或数组)显示,隐藏时同时移除 OnFinished。
Infers CachedDataSourceType from the DataSource pin's struct type and container type (array or not) — one of the four valid modes, otherwise None — and manages pins accordingly: Template and Array modes remove the ReturnValue pin; bDeferred shows only in entity modes (single or array), and hiding it also removes OnFinished.
Input
无参数(读取成员引脚)。
No parameters (reads the member pins).
Output
无返回值。副作用:写入 CachedDataSourceType,增删/隐藏引脚。
No return value. Side effect: writes CachedDataSourceType, adds/removes/hides pins.
详情面板属性编辑回调:当变化属性为 bShowWorldContext 时,按新值外科手术式增删 WorldContext 引脚(MassAPIWorldContext::SyncPinOn:勾选创建、取消勾选断开连接并移除,不走整节点重建)并通知图表刷新;其余属性仅调用父类。
Details-panel property edit callback: when the changed property is bShowWorldContext, surgically adds/removes the WorldContext pin to match (MassAPIWorldContext::SyncPinOn: create on check, break links and remove on uncheck — no full node reconstruction) and notifies the graph; all other properties only call the parent.
Input
| 参数 Param | 类型 Type | 说明 Description |
|---|---|---|
PropertyChangedEvent | FPropertyChangedEvent& | 属性变化事件。The property change event. |
Output
无返回值。副作用:可能增删 WorldContext 引脚并触发图表刷新通知。
No return value. Side effect: may add/remove the WorldContext pin and trigger a graph refresh notification.
空实现——不向蓝图右键菜单注册任何动作(弃用节点,注释说明"已弃用 — 使用 FName 版本")。
Empty implementation — registers nothing to the blueprint right-click menu (deprecated node; the comment says "已弃用 — 使用 FName 版本").Empty implementation — registers nothing to the blueprint right-click menu (deprecated node; the comment says "Deprecated — use the FName version").
Input
| 参数 Param | 类型 Type | 说明 Description |
|---|---|---|
ActionRegistrar | FBlueprintActionDatabaseRegistrar& | 蓝图动作注册器。Blueprint action registrar. |
Output
无返回值,无副作用。
No return value, no side effects.
经 HNCH 宏生成编译器 handler,在 Compile() 中:① 刷新 UpdateDataSourceType,None 时报编译错误;② 数组模式校验数组已连接,然后生成 ForEach 循环——UK2Node_TemporaryVariable 计数器 + Array_Length + IfThenElse 分支(Less_IntInt 条件)+ ExecutionSequence + Array_Get 取元素 + 每元素调用 SetFlag_Entity(实体数组,带 bDeferred/OnFinished)或 SetFlag_Template(模板数组)+ Add_IntInt 自增回跳,循环结束走 Then;③ 单元素模式直接生成 SetFlag_Entity / SetFlag_Template 调用,连接 DataSource(→ EntityHandle / TemplateData)、Flag(→ FlagToSet);④ 单实体模式额外连接 bDeferred/OnFinished 并连返回值到 ReturnValue。勾选 bShowWorldContext 时,节点的 WorldContext 代理引脚经 MASSAPI_LINK_WC 连到各内部调用的 WorldContext 输入。
Generates a compiler handler via the HNCH macros. In Compile(): ① re-runs UpdateDataSourceType, emitting a compile error for None; ② in array mode validates the array is connected, then builds a ForEach loop — a UK2Node_TemporaryVariable counter + Array_Length + IfThenElse branch (Less_IntInt condition) + ExecutionSequence + Array_Get element fetch + a per-element SetFlag_Entity (entity arrays, with bDeferred/OnFinished) or SetFlag_Template (template arrays) call + Add_IntInt increment loop-back, exiting to Then when done; ③ in single mode spawns a direct SetFlag_Entity / SetFlag_Template call, linking DataSource (→ EntityHandle / TemplateData) and Flag (→ FlagToSet); ④ in single-entity mode additionally links bDeferred/OnFinished and connects the return value to ReturnValue. When bShowWorldContext is checked, the node's WorldContext proxy pin is linked to each internal call's WorldContext input via MASSAPI_LINK_WC.
Input
| 参数 Param | 类型 Type | 说明 Description |
|---|---|---|
CompilerContext | FKismetCompilerContext& | Kismet 编译上下文。Kismet compiler context. |
SourceGraph | UEdGraph* | 源图表。The source graph. |
Output
无返回值。副作用:向编译消息日志报错(参数缺失/类型不匹配时)、生成中间循环结构与调用节点并接线。
No return value. Side effect: emits compile errors (missing arguments / type mismatch), spawns intermediate loop structures and call nodes and wires them.
引脚名称常量 Pin Name Constants
| 静态函数 Static | 返回名称 Return | 说明 Description |
|---|---|---|
DataSourcePinName() | "DataSource" | 数据源通配符引脚名。Data source wildcard pin name. |
FlagPinName() | "Flag" | 旗标枚举引脚名。Flag enum pin name. |
ReturnValuePinName() | "ReturnValue" | 返回值(bool)引脚名。Return value (bool) pin name. |
DeferredPinName() | "bDeferred" | 延迟命令标志引脚名。Deferred command flag pin name. |
OnFinishedPinName() | "OnFinished" | 延迟完成回调委托引脚名。Deferred completion delegate pin name. |
成员变量 Members
缓存的 DataSource 类型,初始为 None。由 UpdateDataSourceType 从 DataSource 引脚类型+容器类型推断,驱动节点标题/颜色/引脚集。枚举定义于 MassAPI/Public/MassAPIEnums.h。
Cached DataSource type, initialized to None. Inferred from the DataSource pin type and container by UpdateDataSourceType; drives the node title, colors and pin set. The enum is defined in MassAPI/Public/MassAPIEnums.h.
Details 面板 "Show World Context Pin" 开关,默认 false。勾选后节点出现可选的 WorldContext 输入引脚(UObject,默认值 self),编译时透传到内部调用的 WorldContext 输入;未勾选时内部调用保持 DefaultToSelf 自动填充行为——默认关闭零行为变化。引脚助手定义于 MassAPIWorldContextPin.h(MassAPIWorldContext::CreateOn / SyncPinOn)。
"Show World Context Pin" toggle in the Details panel, default false. When checked, the node gains an optional WorldContext input pin (UObject, default value self) wired through to the internal calls' WorldContext input at compile time; when unchecked, the internal calls keep their DefaultToSelf auto-fill behavior — default-off is a zero-behavior change. Pin helpers are defined in MassAPIWorldContextPin.h (MassAPIWorldContext::CreateOn / SyncPinOn).
管线角色 Pipeline Role
纯编辑器节点,无运行时管线位置。编译期由 ExpandNode(HNCH handler)展开为 UMassAPIFuncLib::SetFlag_Entity / SetFlag_Template 函数调用(数组模式为循环内调用)。已弃用——新图应使用 UK2Node_SetMassFlagByName(FName 版本,同样支持数组)。
Pure editor node with no runtime pipeline position. At compile time ExpandNode (HNCH handler) expands it into UMassAPIFuncLib::SetFlag_Entity / SetFlag_Template calls (inside a loop in array mode). Deprecated — new graphs should use UK2Node_SetMassFlagByName (the FName version, also array-capable).