Skip to content

Commit

Permalink
[unreal]恢复edit_on_instance装饰器支持 (#1949)
Browse files Browse the repository at this point in the history
Signed-off-by: morirain <[email protected]>
  • Loading branch information
morirain authored Dec 18, 2024
1 parent 7116a53 commit 31f6dd5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
9 changes: 6 additions & 3 deletions unreal/Puerts/Content/JavaScript/PuertsEditor/CodeAnalyze.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions unreal/Puerts/PuertsEditor/CodeAnalyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1058,10 +1058,12 @@ function watch(configFilePath:string) {
}
});
}
//if (!hasDecorator(symbol.valueDeclaration, "edit_on_instance")) {
// flags = flags | BigInt(PropertyFlags.CPF_DisableEditOnInstance);
//}

if (hasDecorator(symbol.valueDeclaration, "edit_on_instance")) {
flags &= ~BigInt(PropertyFlags.CPF_DisableEditOnInstance);
} else {
flags |= BigInt(PropertyFlags.CPF_DisableEditOnInstance);
}

// bp.AddMemberVariable(symbol.getName(), propPinType.pinType, propPinType.pinValueType, Number(flags & 0xffffffffn), Number(flags >> 32n), cond);
bp.AddMemberVariableWithMetaData(symbol.getName(), propPinType.pinType, propPinType.pinValueType, Number(flags & 0xffffffffn), Number(flags >> 32n), cond, uemeta.compilePropertyMetaData(symbol));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ void UPEBlueprintAsset::AddMemberVariable(FName NewVarName, FPEGraphPinType InGr

// The following code recalculates the final flags.
// Variables added to the blueprint via FBlueprintEditorUtils::AddMemberVariable come with some default flags.
InFlags |= CPF_Edit | CPF_BlueprintVisible | CPF_DisableEditOnInstance;
InFlags |= CPF_Edit | CPF_BlueprintVisible;

if (Blueprint->NewVariables[VarIndex].VarType.PinCategory == UEdGraphSchema_K2::PC_MCDelegate)
{
Expand Down

0 comments on commit 31f6dd5

Please sign in to comment.