MCPcopy
hub / github.com/4ian/GDevelop / apply

Function apply

newIDE/app/src/ObjectGroupEditor/EditedObjectGroupEditorDialog.js:83–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81 });
82
83 const apply = async () => {
84 onApply();
85 if (!initialInstances) {
86 // This can only happens for legacy function object groups.
87 // In this case, we don't do any refactoring.
88 return;
89 }
90
91 const originalSerializedVariables = getOriginalVariablesSerializedElement();
92 const changeset = gd.WholeProjectRefactorer.computeChangesetForVariablesContainer(
93 originalSerializedVariables,
94 groupVariablesContainer
95 );
96
97 gd.WholeProjectRefactorer.applyRefactoringForGroupVariablesContainer(
98 project,
99 globalObjectsContainer || objectsContainer,
100 objectsContainer,
101 initialInstances,
102 groupVariablesContainer,
103 group,
104 changeset,
105 originalSerializedVariables
106 );
107 const { eventsBasedObject } = projectScopedContainersAccessor._scope;
108 if (eventsBasedObject) {
109 for (const objectName of group.getAllObjectsNames().toJSArray()) {
110 gd.ObjectRefactorer.applyChangesToVariants(
111 eventsBasedObject,
112 objectName,
113 changeset
114 );
115 }
116 }
117 groupVariablesContainer.clearPersistentUuid();
118 };
119
120 const removeObject = React.useCallback(
121 (objectName: string) => {

Callers

nothing calls this directly

Calls 1

onApplyFunction · 0.50

Tested by

no test coverage detected