mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Fix object type change not properly applied when editing a behavior
This commit is contained in:
@@ -400,10 +400,23 @@ export default class EventsFunctionsExtensionEditor extends React.Component<
|
||||
};
|
||||
},
|
||||
() => {
|
||||
// If we're closing the properties of a behavior, notify parent
|
||||
// that a behavior was edited (to trigger reload of extensions)
|
||||
if (!editedEventsBasedBehavior && this.props.onBehaviorEdited)
|
||||
this.props.onBehaviorEdited();
|
||||
if (!editedEventsBasedBehavior) {
|
||||
// If we're closing the properties of a behavior, notify parent
|
||||
// that a behavior was edited (to trigger reload of extensions)
|
||||
if (this.props.onBehaviorEdited) {
|
||||
this.props.onBehaviorEdited();
|
||||
}
|
||||
|
||||
// Reload the selected events function, if any, as the behavior was
|
||||
// changed so objects containers need to be re-created. Notably, the
|
||||
// type of the object that is handled by the behavior may have changed.
|
||||
if (this.state.selectedEventsFunction) {
|
||||
this._loadEventsFunctionFrom(
|
||||
this.props.project,
|
||||
this.state.selectedEventsFunction
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user