mirror of
https://github.com/godotengine/godot.git
synced 2025-10-28 20:24:41 +00:00
Universalize draw-over API for EditorPlugins
- Now it is usable from both `CanvasItem` and `Spatial` editors. - `EditorPlugin` API changes: - `forward_draw_over_canvas()` becomes `forward_draw_over_viewport()`. - `update_canvas()` becomes `update_overlays()`, which now triggers the update of every overlay on top of any 2D or 3D viewports present. Also now it returns the number of such viewports, which is useful whenever you need to know the number of draw-over calls you'll get. - New: `[set/is]_force_draw_over_forwarding_enabled()` to force overlaying regardless it handles the current object type, in a similar fashion as `[set/is]_input_event_forwarding_always_enabled`. This kind of overlay is also on top of those for regular handled node types. - New: `forward_force_draw_over_canvas()`, which is the callback that gets called for plugins that enable forced overlaying.
This commit is contained in:
parent
2e5dfbdb4b
commit
3f31925b18
17 changed files with 105 additions and 40 deletions
|
|
@ -2332,6 +2332,16 @@ static void draw_indicator_bar(Control &surface, real_t fill, Ref<Texture> icon)
|
|||
|
||||
void SpatialEditorViewport::_draw() {
|
||||
|
||||
EditorPluginList *over_plugin_list = EditorNode::get_singleton()->get_editor_plugins_over();
|
||||
if (!over_plugin_list->empty()) {
|
||||
over_plugin_list->forward_draw_over_viewport(surface);
|
||||
}
|
||||
|
||||
EditorPluginList *force_over_plugin_list = editor->get_editor_plugins_force_over();
|
||||
if (!force_over_plugin_list->empty()) {
|
||||
force_over_plugin_list->forward_force_draw_over_viewport(surface);
|
||||
}
|
||||
|
||||
if (surface->has_focus()) {
|
||||
Size2 size = surface->get_size();
|
||||
Rect2 r = Rect2(Point2(), size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue