MassBattle Docsv1.19.20

UK2Node_HasMassTag

UCLASS

Source/MassAPIUncooked/Public/OperationTag/K2Node_HasMassTag.h

概述 Overview

查询实体或实体模板是否带某 Mass tag 的纯蓝图节点。输入 TagType 类型选择引脚(由 FMassAPIPinFactory 挂载 SGraphPinMassTagType 下拉,过滤 FMassTagStructFilter)决定查询目标;DataSource 为 const 引用通配符(连接时推断为 FEntityHandle / FEntityTemplateData);输出 bool ReturnValue。编译时经 HNCH 展开为 UMassAPIFuncLib::HasTag_Entity / HasTag_Template。OnTagTypeChanged 仅通知图表刷新。

Pure blueprint node that checks whether an entity or entity template carries a Mass tag. The TagType type-selector pin (handled by FMassAPIPinFactory with the SGraphPinMassTagType dropdown filtered by FMassTagStructFilter) picks the query target; DataSource is a const by-reference wildcard (inferred as FEntityHandle / FEntityTemplateData on connection); the bool ReturnValue is the output. At compile time an HNCH handler expands the node into UMassAPIFuncLib::HasTag_Entity / HasTag_Template. OnTagTypeChanged only notifies the graph.

继承 Inheritance

UK2Node → UK2Node_HasMassTag

公开方法 Public Methods

IsNodePure virtual bool

返回 true:纯节点,无执行流引脚。

Returns true: pure node, no exec pins.

Input

无参数。

No parameters.

Output

恒返回 true。

Always returns true.

ShouldShowNodeProperties virtual bool

返回 true:在 Details 面板显示节点属性。

Returns true: node properties are shown in the Details panel.

Input

无参数。

No parameters.

Output

恒返回 true。

Always returns true.

GetNodeTitle virtual FText

按 CachedDataSourceType 返回标题:None → "HasMassTag",EntityHandle → "HasMassTag-Entity",EntityTemplateData → "HasMassTag-Template"。

Returns the title from CachedDataSourceType: None → "HasMassTag", EntityHandle → "HasMassTag-Entity", EntityTemplateData → "HasMassTag-Template".

Input
参数 Param类型 Type说明 Description
TitleTypeENodeTitleType::Type标题类型(本实现忽略)。Title type (ignored by this implementation).
Output

返回映射后的标题文本;未知类型返回空字符串。

Returns the mapped title text; unknown types yield an empty string.

GetMenuCategory virtual FText

右键菜单分类路径:常量 "MassAPI|Tag"。

Right-click menu category: the constant "MassAPI|Tag".

Input

无参数。

No parameters.

Output

返回 "MassAPI|Tag"。

Returns "MassAPI|Tag".

GetTooltipText virtual FText

Tooltip 文案:常量 "Check if an entity or entity template has a tag."。

Tooltip text: the constant "Check if an entity or entity template has a tag.".

Input

无参数。

No parameters.

Output

返回上述 Tooltip 文本。无副作用。

Returns the tooltip text above. No side effects.

GetIconAndTint virtual FSlateIcon

返回函数图标(Kismet.AllClasses.FunctionIcon),并把 OutColor 写为黄色 (1.0, 0.9, 0.0)——"查询/检查"语义色。

Returns the function icon (Kismet.AllClasses.FunctionIcon) and writes OutColor as yellow (1.0, 0.9, 0.0) — the "query/check" semantic color.

Input
参数 Param类型 Type说明 Description
OutColorFLinearColor&输出参数,写入节点图标色调。Out parameter; receives the node icon tint.
Output

返回 FSlateIcon;副作用:覆写 OutColor。

Returns an FSlateIcon; side effect: overwrites OutColor.

GetNodeTitleColor virtual FLinearColor

节点标题颜色:None 模式为黑色(未连接),EntityHandle / EntityTemplateData 模式为黄色 (1.0, 0.9, 0.0)。

Node title color: black for None (unconnected), yellow (1.0, 0.9, 0.0) for EntityHandle / EntityTemplateData modes.

Input

无参数。

No parameters.

Output

返回对应的颜色值。

Returns the corresponding color.

AllocateDefaultPins virtual void

纯节点:输入 DataSource(Wildcard,bIsConst=true)与 TagType(UScriptStruct 类型选择,PSC_Self);输出 ReturnValue(bool)。若 bShowWorldContext 为 true,再经 MassAPIWorldContext::CreateOn 创建可选的 WorldContext 输入引脚(纯节点无 exec 引脚,置于顶部)。随后调用 UpdateDataSourceType。

Pure node: inputs DataSource (wildcard, bIsConst=true) and TagType (UScriptStruct type selector, PSC_Self); output ReturnValue (bool). If bShowWorldContext is true, additionally creates the optional WorldContext input pin via MassAPIWorldContext::CreateOn (pure node has no exec pin, so it is placed at the top). Then calls UpdateDataSourceType.

Input

无参数。

No parameters.

Output

无返回值。副作用:创建节点引脚并写入 CachedDataSourceType。

No return value. Side effect: creates node pins and fills CachedDataSourceType.

ReallocatePinsDuringReconstruction virtual void

蓝图节点重建时恢复引脚状态:① 恢复 DataSource 引脚类型并保持 const 标志;② 更新缓存类型;③ 从旧引脚恢复 tag 类型写回 TagType。

Restores pin state during blueprint node reconstruction: ① restores the DataSource pin type keeping the const flag; ② updates the cached type; ③ recovers the tag type from old pins into TagType.

Input
参数 Param类型 Type说明 Description
OldPinsTArray<UEdGraphPin*>&重建前的旧引脚列表。The old pin list before reconstruction.
Output

无返回值。副作用:修改引脚类型与 DefaultObject。

No return value. Side effect: mutates pin types and DefaultObject.

PostReconstructNode virtual void

调用父类后刷新 UpdateDataSourceType 与 OnTagTypeChanged。

Calls the parent then refreshes UpdateDataSourceType and OnTagTypeChanged.

Input

无参数。

No parameters.

Output

无返回值。副作用:更新缓存类型。

No return value. Side effect: updates the cached type.

PinDefaultValueChanged virtual void

TagType 引脚值变化时调用 OnTagTypeChanged。

Calls OnTagTypeChanged when the TagType pin value changes.

Input
参数 Param类型 Type说明 Description
PinUEdGraphPin*值发生变化的引脚。The pin whose value changed.
Output

无返回值。副作用:通知图表刷新。

No return value. Side effect: notifies the graph to refresh.

IsConnectionDisallowed virtual bool

两类限制:DataSource 只允许 FEntityHandle / FEntityTemplateData(拒绝 Wildcard);TagType 只允许合法的 Mass tag 类型(FMassTag 子类)。均返回 true + OutReason 文案。

Two restriction groups: DataSource accepts only FEntityHandle / FEntityTemplateData (wildcard rejected); TagType accepts only valid Mass tag types (FMassTag subclasses). Each returns true with an OutReason message.

Input
参数 Param类型 Type说明 Description
MyPinconst UEdGraphPin*本节点的引脚。This node's pin.
OtherPinconst UEdGraphPin*对方引脚。The other pin.
OutReasonFString&输出参数:拒绝连接时的原因文案。Out parameter: rejection reason text.
Output

返回 true = 禁止连接(并写入 OutReason);否则委托父类判断。

Returns true = connection disallowed (and fills OutReason); otherwise delegates to the parent.

NotifyPinConnectionListChanged virtual void

DataSource 连接变化 → 同步类型(保持 const)/恢复 Wildcard + 更新缓存;TagType 断开连接 → OnTagTypeChanged。

DataSource connection changes sync the type (keeping const) / revert to wildcard and update the cache; TagType disconnect triggers OnTagTypeChanged.

Input
参数 Param类型 Type说明 Description
PinUEdGraphPin*连接列表发生变化的引脚。The pin whose connection list changed.
Output

无返回值。副作用:改写 DataSource 引脚类型与 CachedDataSourceType。

No return value. Side effect: mutates the DataSource pin type and CachedDataSourceType.

UpdateDataSourceType void

从 DataSource 引脚的结构体类型推断 CachedDataSourceType。查询类节点无需管理引脚可见性,只更新缓存。

Infers CachedDataSourceType from the DataSource pin's struct type. Query nodes need no pin visibility management, only the cache update.

Input

无参数(读取成员引脚)。

No parameters (reads the member pins).

Output

无返回值。副作用:写入 CachedDataSourceType。

No return value. Side effect: writes CachedDataSourceType.

GetTagStruct UScriptStruct*

读取 TagType 引脚的 DefaultObject 并转成 UScriptStruct;引脚未连接或未设置时返回 nullptr。

Reads the TagType pin's DefaultObject as a UScriptStruct; returns nullptr when the pin is unlinked or unset.

Input

无参数。

No parameters.

Output

返回选中的 tag 结构体指针;未设置返回 nullptr。

Returns the selected tag struct, or nullptr when unset.

GetTagStructFromOldPins UScriptStruct*

重建辅助:从旧引脚列表中找 TagType 引脚并读取其 DefaultObject;未找到或未设置返回 nullptr。

Reconstruction helper: finds the TagType pin in the old pin list and reads its DefaultObject; returns nullptr when absent or unset.

Input
参数 Param类型 Type说明 Description
OldPinsconst TArray<UEdGraphPin*>&旧引脚列表。The old pin list.
Output

返回旧 TagType 选中的结构体;无则 nullptr。

Returns the old TagType selection, or nullptr.

OnTagTypeChanged virtual void

tag 类型变化回调:仅通知图表刷新。

Tag-type change callback: only notifies the graph to refresh.

Input

无参数。

No parameters.

Output

无返回值。副作用:通知图表刷新。

No return value. Side effect: notifies the graph to refresh.

IsValidTagStruct virtual bool

校验结构体是否为 FMassTag 的派生类型;空指针返回 false。

Validates that the struct derives from FMassTag; false for null.

Input
参数 Param类型 Type说明 Description
Structconst UScriptStruct*待校验的结构体。The struct to validate.
Output

FMassTag 子类返回 true,否则 false。

true for FMassTag subclasses, otherwise false.

PostEditChangeProperty virtual void

详情面板属性编辑回调。监听 bShowWorldContext 的变化:调用 MassAPIWorldContext::SyncPinOn 外科手术式增/删 WorldContext 引脚(直接 CreatePin / 断开全部连接并移除,不走整节点重建——复刻插件内已验证的 bDeferred 模式),并通知图表刷新;此外调用父类实现。

Details-panel property edit callback. Watches bShowWorldContext: a toggle calls MassAPIWorldContext::SyncPinOn to surgically add/remove the WorldContext pin (direct CreatePin / break-all-links-and-remove, no full node reconstruction — mirroring the plugin's proven bDeferred pattern) and notifies the graph; also calls the parent implementation.

Input
参数 Param类型 Type说明 Description
PropertyChangedEventFPropertyChangedEvent&属性变化事件。The property change event.
Output

无返回值。副作用:切换开关时增删 WorldContext 引脚并通知图表刷新。

No return value. Side effect: toggling the flag adds/removes the WorldContext pin and notifies the graph.

GetMenuActions virtual void

向蓝图右键菜单注册本类节点:当 ActionRegistrar 允许时创建 UBlueprintNodeSpawner 并注册到 MassAPI|Tag 分类。

Registers this node class to the blueprint right-click menu: when the registrar is open for this class, creates a UBlueprintNodeSpawner and registers it under MassAPI|Tag.

Input
参数 Param类型 Type说明 Description
ActionRegistrarFBlueprintActionDatabaseRegistrar&蓝图动作注册器。Blueprint action registrar.
Output

无返回值。副作用:注册节点 spawner 到动作数据库。

No return value. Side effect: registers a node spawner into the action database.

ExpandNode virtual void

经 HNCH 宏生成编译器 handler,在 Compile() 中:① 刷新 UpdateDataSourceType,None 时报错;② 校验 TagType 已指定;③ 生成 HasTag_Entity / HasTag_Template 调用,连接 DataSource 与 TagType(→ TagType 参数);④ 把函数返回值连到 ReturnValue。

Generates a compiler handler via the HNCH macros. In Compile(): ① re-runs UpdateDataSourceType, erroring on None; ② validates TagType is set; ③ spawns a HasTag_Entity / HasTag_Template call, linking DataSource and TagType (→ the TagType parameter); ④ connects the function return value to ReturnValue.

Input
参数 Param类型 Type说明 Description
CompilerContextFKismetCompilerContext&Kismet 编译上下文。Kismet compiler context.
SourceGraphUEdGraph*源图表。The source graph.
Output

无返回值。副作用:向编译消息日志报错(参数缺失时)、生成中间调用节点并接线。

No return value. Side effect: emits compile errors (when arguments are missing), spawns intermediate call nodes and wires them.

引脚名称常量 Pin Name Constants

静态函数 Static返回名称 Return说明 Description
DataSourcePinName()"DataSource"数据源通配符引脚名。Data source wildcard pin name.
TagTypePinName()"TagType"tag 类型选择引脚名。Tag type selector pin name.
ReturnValuePinName()"ReturnValue"返回值(bool)引脚名。Return value (bool) pin name.

成员变量 Members

bShowWorldContext bool (UPROPERTY, EditAnywhere)

Details 面板开关(分类 "WorldContext",显示名 "Show World Context Pin"),默认 false。勾选后节点出现可选的 WorldContext 输入引脚(经 MassAPIWorldContext::CreateOn 创建;本节点为纯节点、无 exec 引脚,引脚置于顶部),编译时透传给内部调用;未勾选时内部调用保持 DefaultToSelf 行为——默认关闭为零行为变化。开关变化由 PostEditChangeProperty 经 MassAPIWorldContext::SyncPinOn 外科手术式增删引脚。助手定义于 MassAPIUncooked/Public/MassAPIWorldContextPin.h。

Details-panel toggle (category "WorldContext", display name "Show World Context Pin"), default false. When checked, an optional WorldContext input pin appears on the node (created via MassAPIWorldContext::CreateOn; this node is pure with no exec pin, so the pin is placed at the top) and is wired through to the internal calls; when unchecked the internal calls keep their DefaultToSelf behavior — default-off is a zero-behavior change. Toggles are handled in PostEditChangeProperty, which adds/removes the pin surgically via MassAPIWorldContext::SyncPinOn. The helper is defined in MassAPIUncooked/Public/MassAPIWorldContextPin.h.

CachedDataSourceType EMassFragmentSourceDataType

缓存的 DataSource 类型,初始为 None。由 UpdateDataSourceType 从 DataSource 引脚类型推断,驱动节点标题/颜色。枚举定义于 MassAPI/Public/MassAPIEnums.h。

Cached DataSource type, initialized to None. Inferred from the DataSource pin type by UpdateDataSourceType; drives the node title and colors. The enum is defined in MassAPI/Public/MassAPIEnums.h.

管线角色 Pipeline Role

纯编辑器节点,无运行时管线位置。编译期由 ExpandNode(HNCH handler)展开为 UMassAPIFuncLib::HasTag_Entity / HasTag_Template 函数调用(运行时逻辑在 MassAPI 模块的 FuncLib 中)。编辑器集成:TagType 引脚由 FMassAPIPinFactory(注册于模块 StartupModule)挂载 SGraphPinMassTagType 下拉(过滤 FMassTagStructFilter)。

Pure editor node with no runtime pipeline position. At compile time ExpandNode (HNCH handler) expands it into UMassAPIFuncLib::HasTag_Entity / HasTag_Template calls (runtime logic lives in the MassAPI module's FuncLib). Editor integration: the TagType pin is handled by FMassAPIPinFactory (registered in the module StartupModule), attaching the SGraphPinMassTagType dropdown (filtered by FMassTagStructFilter).