diff options
Diffstat (limited to 'scene')
| -rw-r--r-- | scene/3d/gi_probe.cpp | 21 | ||||
| -rw-r--r-- | scene/3d/gi_probe.h | 8 | ||||
| -rw-r--r-- | scene/gui/item_list.cpp | 3 | ||||
| -rw-r--r-- | scene/gui/line_edit.cpp | 6 | ||||
| -rw-r--r-- | scene/gui/tab_container.cpp | 7 | ||||
| -rw-r--r-- | scene/gui/text_edit.cpp | 6 |
6 files changed, 45 insertions, 6 deletions
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index d5a030b35c..c0ca358717 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -1134,6 +1134,10 @@ void GIProbe::_find_meshes(Node *p_at_node, Baker *p_baker) { } } +GIProbe::BakeBeginFunc GIProbe::bake_begin_function = NULL; +GIProbe::BakeStepFunc GIProbe::bake_step_function = NULL; +GIProbe::BakeEndFunc GIProbe::bake_end_function = NULL; + void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) { Baker baker; @@ -1177,14 +1181,25 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) { _find_meshes(p_from_node ? p_from_node : get_parent(), &baker); + if (bake_begin_function) { + bake_begin_function(baker.mesh_list.size() + 1); + } + int pmc = 0; for (List<Baker::PlotMesh>::Element *E = baker.mesh_list.front(); E; E = E->next()) { - print_line("plotting mesh " + itos(pmc++) + "/" + itos(baker.mesh_list.size())); + if (bake_step_function) { + bake_step_function(pmc, RTR("Plotting Meshes") + " " + itos(pmc) + "/" + itos(baker.mesh_list.size())); + } + + pmc++; _plot_mesh(E->get().local_xform, E->get().mesh, &baker, E->get().instance_materials, E->get().override_material); } + if (bake_step_function) { + bake_step_function(pmc++, RTR("Finishing Plot")); + } _fixup_plot(0, 0, 0, 0, 0, &baker); @@ -1282,6 +1297,10 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) { set_probe_data(probe_data); } + + if (bake_end_function) { + bake_end_function(); + } } void GIProbe::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb, Ref<MultiMesh> &p_multimesh, int &idx, Baker *p_baker) { diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index 5a06984a47..50d0c33d4f 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -95,6 +95,10 @@ public: }; + typedef void (*BakeBeginFunc)(int); + typedef void (*BakeStepFunc)(int, const String &); + typedef void (*BakeEndFunc)(); + private: //stuff used for bake struct Baker { @@ -190,6 +194,10 @@ protected: static void _bind_methods(); public: + static BakeBeginFunc bake_begin_function; + static BakeStepFunc bake_step_function; + static BakeEndFunc bake_end_function; + void set_probe_data(const Ref<GIProbeData> &p_data); Ref<GIProbeData> get_probe_data() const; diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 623a110263..3203b38d40 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -781,9 +781,7 @@ void ItemList::_notification(int p_what) { } if (has_focus()) { - VisualServer::get_singleton()->canvas_item_add_clip_ignore(get_canvas_item(), true); draw_style_box(get_stylebox("bg_focus"), Rect2(Point2(), size)); - VisualServer::get_singleton()->canvas_item_add_clip_ignore(get_canvas_item(), false); } if (shape_changed) { @@ -1429,7 +1427,6 @@ ItemList::ItemList() { allow_rmb_select = false; icon_scale = 1.0f; - set_clip_contents(true); } ItemList::~ItemList() { diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index f57f58c18d..40e2dba6c2 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1038,9 +1038,11 @@ void LineEdit::set_cursor_position(int p_pos) { Ref<StyleBox> style = get_stylebox("normal"); Ref<Font> font = get_font("font"); - if (cursor_pos < window_pos) { + if (cursor_pos <= window_pos) { /* Adjust window if cursor goes too much to the left */ - set_window_pos(cursor_pos); + if (window_pos > 0) + set_window_pos(window_pos - 1); + } else if (cursor_pos > window_pos) { /* Adjust window if cursor goes too much to the right */ int window_width = get_size().width - style->get_minimum_size().width; diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index cfe924ecd4..581034ddee 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -90,6 +90,10 @@ void TabContainer::_gui_input(const Ref<InputEvent> &p_event) { return; } + // Do not activate tabs when tabs is empty + if (get_tab_count() == 0) + return; + Vector<Control *> tabs = _get_tabs(); // Handle navigation buttons. @@ -298,6 +302,8 @@ void TabContainer::_notification(int p_what) { } int TabContainer::_get_tab_width(int p_index) const { + + ERR_FAIL_INDEX_V(p_index, get_tab_count(), 0); Control *control = Object::cast_to<Control>(_get_tabs()[p_index]); if (!control || control->is_set_as_toplevel()) return 0; @@ -669,6 +675,7 @@ void TabContainer::_bind_methods() { TabContainer::TabContainer() { first_tab_cache = 0; + last_tab_cache = 0; buttons_visible_cache = false; tabs_ofs_cache = 0; current = 0; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index acf6d55eb5..2d55c077f1 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4489,7 +4489,13 @@ void TextEdit::_update_completion_candidates() { completion_index = 0; completion_base = s; Vector<float> sim_cache; + bool single_quote = s.begins_with("'"); + for (int i = 0; i < completion_strings.size(); i++) { + if (single_quote && completion_strings[i].is_quoted()) { + completion_strings[i] = completion_strings[i].unquote().quote("'"); + } + if (s == completion_strings[i]) { // A perfect match, stop completion _cancel_completion(); |