Moving editor-only methods to their own files #9208
KoBeWi
started this conversation in
General Discussions
Replies: 1 comment
-
I'd call it |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have many methods that are editor only and they are mixed with regular Node methods and wrapped in ifdefs. Like there is whole block in CanvasItem:
https://github.com/godotengine/godot/blob/7d2ca2d8ac49cde9767e00b70f9eaf1920eb266d/scene/main/canvas_item.cpp#L1078-L1095
There are also methods, which are used only in the editor, but never got wrapped (see godotengine/godot#86743).
We are already separating compatibility methods with
compat.inc
files. What if we did the same for editor? E.g. in the above case there would becanvas_item.editor.cpp
with_bind_editor_methods()
. It would make make these methods better separated. The same can be applied to all non-editor files that have TOOLS_ENABLED stuff.Putting aside how much work it would require, would it be beneficial to the codebase?
Beta Was this translation helpful? Give feedback.
All reactions