diff options
| author | Juan Linietsky | 2016-05-17 18:27:15 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-05-17 18:28:44 -0300 |
| commit | c195c0df6b36debc870216dd42e49fbda70fa861 (patch) | |
| tree | 194a26e39ace86d7a471f3e86159c2aed6be261c /scene/main/viewport.cpp | |
| parent | 3a26e14a2bab777c9ba6aedceff6e4ef2666faf0 (diff) | |
| download | godot-c195c0d.tar.gz godot-c195c0d.tar.zst godot-c195c0d.zip | |
-Added configuration warning system for nodes
-Added a new "add" and "instance" buttons for scene tree
-Added a vformat() function to ease translation work
Diffstat (limited to 'scene/main/viewport.cpp')
| -rw-r--r-- | scene/main/viewport.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 265ee53e5..c9f61beba 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1157,6 +1157,8 @@ void Viewport::set_as_render_target(bool p_enable){ render_target_texture->set_flags(render_target_texture->flags); render_target_texture->emit_changed(); + + update_configuration_warning(); } bool Viewport::is_set_as_render_target() const{ @@ -2399,6 +2401,18 @@ bool Viewport::is_input_disabled() const { Variant Viewport::gui_get_drag_data() const { return gui.drag_data; } + + +String Viewport::get_configuration_warning() const { + + if (get_parent() && !get_parent()->cast_to<Control>() && !render_target) { + + return TTR("This viewport is not set as render target. If you intend for it to display it's contents directly to the screen, make it a child of a Control so it can obtain a size. Otherwise, make it a RenderTarget and assign it's internal texture to some node for display."); + } + + return String(); +} + void Viewport::_bind_methods() { |
