Cleanup EditorPluginList

- Removes unused / unnecessary methods.
- Removes the `Object` parent. No `Object` features are used by this class.
- Makes the actual list a `LocalVector` instead of a `Vector`. It's not shared.
- Moves the class into a separate file. `editor_node.{h,cpp}` are bloated.
- Simplify some call sites of `EditorPluginList` methods.
This commit is contained in:
Haoyu Qiu
2025-07-26 14:20:34 +08:00
parent 3bf0f771ee
commit fb476d0b0c
7 changed files with 181 additions and 158 deletions

View File

@ -1013,35 +1013,6 @@ public:
void run_editor_script(const Ref<Script> &p_script);
};
class EditorPluginList : public Object {
GDSOFTCLASS(EditorPluginList, Object);
private:
Vector<EditorPlugin *> plugins_list;
public:
void set_plugins_list(Vector<EditorPlugin *> p_plugins_list) {
plugins_list = p_plugins_list;
}
Vector<EditorPlugin *> &get_plugins_list() {
return plugins_list;
}
void make_visible(bool p_visible);
void edit(Object *p_object);
bool forward_gui_input(const Ref<InputEvent> &p_event);
void forward_canvas_draw_over_viewport(Control *p_overlay);
void forward_canvas_force_draw_over_viewport(Control *p_overlay);
EditorPlugin::AfterGUIInput forward_3d_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled);
void forward_3d_draw_over_viewport(Control *p_overlay);
void forward_3d_force_draw_over_viewport(Control *p_overlay);
void add_plugin(EditorPlugin *p_plugin);
void remove_plugin(EditorPlugin *p_plugin);
void clear();
bool is_empty();
};
struct EditorProgressBG {
String task;
void step(int p_step = -1) { EditorNode::progress_task_step_bg(task, p_step); }