summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-09-10 16:44:03 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-09-10 16:44:03 -0300
commit491dde2eb46a3d5af60256a21a23d6c32e4bfa46 (patch)
tree7bf71d49ec7290294c330508fb59d0f8ca41b6da /tools/editor/plugins
parent67d3935eb17110d71235f52d1b2040f06c8f2b23 (diff)
Made it possible to properly draw over the 2D canvas for 2D objects. Arranged some functions to achieve this.
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp14
-rw-r--r--tools/editor/plugins/collision_polygon_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/collision_shape_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/light_occluder_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/navigation_polygon_editor_plugin.h2
-rw-r--r--tools/editor/plugins/path_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/polygon_2d_editor_plugin.h2
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp3
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.h2
9 files changed, 23 insertions, 8 deletions
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index 3468f42a6c..b0e002ba44 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -1058,7 +1058,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
if (!over_plugin_list->empty()) {
- bool discard = over_plugin_list->forward_input_event(p_event);
+ bool discard = over_plugin_list->forward_input_event(transform,p_event);
if (discard) {
accept_event();
return;
@@ -2090,6 +2090,18 @@ void CanvasItemEditor::_viewport_draw() {
}
+ {
+
+ EditorNode *en = editor;
+ EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
+
+ if (!over_plugin_list->empty()) {
+
+ over_plugin_list->forward_draw_over_canvas(transform,viewport);
+
+ }
+ }
+
if (skeleton_show_bones) {
int bone_width = EditorSettings::get_singleton()->get("2d_editor/bone_width");
Color bone_color1 = EditorSettings::get_singleton()->get("2d_editor/bone_color1");
diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h b/tools/editor/plugins/collision_polygon_2d_editor_plugin.h
index 982ba35fe8..431d3651c1 100644
--- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h
+++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.h
@@ -95,7 +95,7 @@ class CollisionPolygon2DEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
virtual String get_name() const { return "CollisionPolygon2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.h b/tools/editor/plugins/collision_shape_2d_editor_plugin.h
index 1ee81eda43..a8930dc0f2 100644
--- a/tools/editor/plugins/collision_shape_2d_editor_plugin.h
+++ b/tools/editor/plugins/collision_shape_2d_editor_plugin.h
@@ -86,7 +86,7 @@ class CollisionShape2DEditorPlugin : public EditorPlugin {
EditorNode* editor;
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return collision_shape_2d_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_shape_2d_editor->forward_input_event(p_event); }
virtual String get_name() const { return "CollisionShape2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.h b/tools/editor/plugins/light_occluder_2d_editor_plugin.h
index b570fff506..0176eb87dd 100644
--- a/tools/editor/plugins/light_occluder_2d_editor_plugin.h
+++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.h
@@ -99,7 +99,7 @@ class LightOccluder2DEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
virtual String get_name() const { return "LightOccluder2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.h b/tools/editor/plugins/navigation_polygon_editor_plugin.h
index 503b4c2662..defdebbec2 100644
--- a/tools/editor/plugins/navigation_polygon_editor_plugin.h
+++ b/tools/editor/plugins/navigation_polygon_editor_plugin.h
@@ -101,7 +101,7 @@ class NavigationPolygonEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
virtual String get_name() const { return "NavigationPolygonInstance"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/path_2d_editor_plugin.h b/tools/editor/plugins/path_2d_editor_plugin.h
index 973c17464e..acbc481e09 100644
--- a/tools/editor/plugins/path_2d_editor_plugin.h
+++ b/tools/editor/plugins/path_2d_editor_plugin.h
@@ -108,7 +108,7 @@ class Path2DEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return path2d_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return path2d_editor->forward_input_event(p_event); }
virtual String get_name() const { return "Path2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.h b/tools/editor/plugins/polygon_2d_editor_plugin.h
index d8b951ec44..33bae94340 100644
--- a/tools/editor/plugins/polygon_2d_editor_plugin.h
+++ b/tools/editor/plugins/polygon_2d_editor_plugin.h
@@ -151,7 +151,7 @@ class Polygon2DEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
virtual String get_name() const { return "Polygon2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index 41956747e1..8076a91a32 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -3469,6 +3469,8 @@ void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
if (!is_visible() || get_viewport()->gui_has_modal_stack())
return;
+#if 0
+//i don't remember this being used
{
EditorNode *en = editor;
@@ -3480,6 +3482,7 @@ void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
}
}
+#endif
switch(p_event.type) {
diff --git a/tools/editor/plugins/tile_map_editor_plugin.h b/tools/editor/plugins/tile_map_editor_plugin.h
index 4b47dccd15..2f24002770 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.h
+++ b/tools/editor/plugins/tile_map_editor_plugin.h
@@ -181,7 +181,7 @@ class TileMapEditorPlugin : public EditorPlugin {
public:
- virtual bool forward_input_event(const InputEvent& p_event) { return tile_map_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return tile_map_editor->forward_input_event(p_event); }
virtual String get_name() const { return "TileMap"; }
bool has_main_screen() const { return false; }