JirkaDellOro / FUDGE

Furtwangen University Didactic Game Editor
https://jirkadelloro.github.io/FUDGE
MIT License
33 stars 27 forks source link

CustomComponentScript doesn't get cleared when a project will be loaded #389

Open MauriceHuchler opened 1 year ago

MauriceHuchler commented 1 year ago

When you are writing your own ƒ.ComponentScript following the example code in CustomComponentScript.ts and reload the project inside the editor using Project->Load , the component list doenst get cleared and is listed multiple times. (see picture below).

This problem also appears when loading a diffrent project. CustomComponents from other projects are shown as well.

A workaround is to close the editor entirely and restart it. A possible fix could be to clear the list of components and loading them project-based.

The picture below shows the list when you are trying to attach a component to a node.

grafik

JirkaDellOro commented 1 year ago

ScriptComponents should be held in an extra subclass array for selection, see Core->Components. This array may be separately cleared when loading a new project.

Since the subclass-array exists solely for the purpose of selection via the editor, consider moving the functionality from Core to Editor.