summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp7
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp7
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp5
-rw-r--r--editor/plugins/script_editor_plugin.cpp6
-rw-r--r--editor/plugins/shader_editor_plugin.cpp4
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp5
-rw-r--r--editor/plugins/sprite_editor_plugin.cpp63
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp20
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp11
-rw-r--r--editor/plugins/version_control_editor_plugin.cpp2
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp35
11 files changed, 73 insertions, 92 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index c1f62e8342..2428bf82d4 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -139,8 +139,6 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() {
set_custom_minimum_size(Size2(250, 100) * EDSCALE);
set_h_size_flags(SIZE_EXPAND_FILL);
-
- set_mouse_filter(MOUSE_FILTER_PASS);
}
//////////////////////////////////////////////////////////////////////////////
@@ -162,7 +160,7 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
Ref<Image> overlay = get_icon("PlayOverlay", "EditorIcons")->get_data();
Ref<Image> thumbnail = p_image->get_data();
thumbnail = thumbnail->duplicate();
- Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width() / 2) / 2, (thumbnail->get_height() - overlay->get_height() / 2) / 2);
+ Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width()) / 2, (thumbnail->get_height() - overlay->get_height()) / 2);
// Overlay and thumbnail need the same format for `blend_rect` to work.
thumbnail->convert(Image::FORMAT_RGBA8);
@@ -812,7 +810,7 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons
_image_update(p_code == HTTPClient::RESPONSE_NOT_MODIFIED, true, p_data, p_queue_id);
} else {
- WARN_PRINTS("Error getting image file from URL: " + image_queue[p_queue_id].image_url);
+ WARN_PRINT("Error getting image file from URL: " + image_queue[p_queue_id].image_url);
Object *obj = ObjectDB::get_instance(image_queue[p_queue_id].target);
if (obj) {
obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_icon("FileBrokenBigThumb", "EditorIcons"));
@@ -1455,7 +1453,6 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
library_scroll->add_child(library_vb_border);
library_vb_border->add_style_override("panel", border2);
library_vb_border->set_h_size_flags(SIZE_EXPAND_FILL);
- library_vb_border->set_mouse_filter(MOUSE_FILTER_PASS);
library_vb = memnew(VBoxContainer);
library_vb->set_h_size_flags(SIZE_EXPAND_FILL);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index f798714812..1d8f3a2bbd 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2599,14 +2599,14 @@ void CanvasItemEditor::_draw_guides() {
Color text_color = get_color("font_color", "Editor");
text_color.a = 0.5;
if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_V_GUIDE) {
- String str = vformat("%d px", xform.affine_inverse().xform(dragged_guide_pos).x);
+ String str = vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).x));
Ref<Font> font = get_font("font", "Label");
Size2 text_size = font->get_string_size(str);
viewport->draw_string(font, Point2(dragged_guide_pos.x + 10, RULER_WIDTH + text_size.y / 2 + 10), str, text_color);
viewport->draw_line(Point2(dragged_guide_pos.x, 0), Point2(dragged_guide_pos.x, viewport->get_size().y), guide_color, Math::round(EDSCALE));
}
if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_H_GUIDE) {
- String str = vformat("%d px", xform.affine_inverse().xform(dragged_guide_pos).y);
+ String str = vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).y));
Ref<Font> font = get_font("font", "Label");
Size2 text_size = font->get_string_size(str);
viewport->draw_string(font, Point2(RULER_WIDTH + 10, dragged_guide_pos.y + text_size.y / 2 + 10), str, text_color);
@@ -3850,6 +3850,7 @@ void CanvasItemEditor::_notification(int p_what) {
key_scale_button->set_icon(get_icon("KeyScale", "EditorIcons"));
key_insert_button->set_icon(get_icon("Key", "EditorIcons"));
key_auto_insert_button->set_icon(get_icon("AutoKey", "EditorIcons"));
+ animation_menu->set_icon(get_icon("GuiTabMenu", "EditorIcons"));
zoom_minus->set_icon(get_icon("ZoomLess", "EditorIcons"));
zoom_plus->set_icon(get_icon("ZoomMore", "EditorIcons"));
@@ -5667,7 +5668,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
animation_hb->add_child(key_auto_insert_button);
animation_menu = memnew(MenuButton);
- animation_menu->set_text(TTR("Animation"));
+ animation_menu->set_tooltip(TTR("Animation Key and Pose Options"));
animation_hb->add_child(animation_menu);
animation_menu->get_popup()->connect("id_pressed", this, "_popup_callback");
animation_menu->set_switch_on_hover(true);
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 04d595461d..35c0142d4b 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -92,6 +92,9 @@ void Polygon2DEditor::_notification(int p_what) {
b_snap_grid->set_icon(get_icon("Grid", "EditorIcons"));
b_snap_enable->set_icon(get_icon("SnapGrid", "EditorIcons"));
uv_icon_zoom->set_texture(get_icon("Zoom", "EditorIcons"));
+
+ uv_vscroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE);
+ uv_hscroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE);
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
@@ -1471,12 +1474,10 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
uv_vscroll = memnew(VScrollBar);
uv_vscroll->set_step(0.001);
uv_edit_draw->add_child(uv_vscroll);
- uv_vscroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE);
uv_vscroll->connect("value_changed", this, "_uv_scroll_changed");
uv_hscroll = memnew(HScrollBar);
uv_hscroll->set_step(0.001);
uv_edit_draw->add_child(uv_hscroll);
- uv_hscroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE);
uv_hscroll->connect("value_changed", this, "_uv_scroll_changed");
bone_scroll_main_vb = memnew(VBoxContainer);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index f13abd47a9..1da47196f8 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -3209,7 +3209,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
script_list = memnew(ItemList);
scripts_vbox->add_child(script_list);
- script_list->set_custom_minimum_size(Size2(150, 90) * EDSCALE); //need to give a bit of limit to avoid it from disappearing
+ script_list->set_custom_minimum_size(Size2(150, 60) * EDSCALE); //need to give a bit of limit to avoid it from disappearing
script_list->set_v_size_flags(SIZE_EXPAND_FILL);
script_split->set_split_offset(140);
_sort_list_on_update = true;
@@ -3254,14 +3254,14 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
overview_vbox->add_child(members_overview);
members_overview->set_allow_reselect(true);
- members_overview->set_custom_minimum_size(Size2(0, 90) * EDSCALE); //need to give a bit of limit to avoid it from disappearing
+ members_overview->set_custom_minimum_size(Size2(0, 60) * EDSCALE); //need to give a bit of limit to avoid it from disappearing
members_overview->set_v_size_flags(SIZE_EXPAND_FILL);
members_overview->set_allow_rmb_select(true);
help_overview = memnew(ItemList);
overview_vbox->add_child(help_overview);
help_overview->set_allow_reselect(true);
- help_overview->set_custom_minimum_size(Size2(0, 90) * EDSCALE); //need to give a bit of limit to avoid it from disappearing
+ help_overview->set_custom_minimum_size(Size2(0, 60) * EDSCALE); //need to give a bit of limit to avoid it from disappearing
help_overview->set_v_size_flags(SIZE_EXPAND_FILL);
tab_container = memnew(TabContainer);
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index c24a666c55..a19f0b4975 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -369,6 +369,7 @@ void ShaderEditor::_editor_settings_changed() {
shader_editor->get_text_edit()->set_indent_using_spaces(EditorSettings::get_singleton()->get("text_editor/indent/type"));
shader_editor->get_text_edit()->set_auto_indent(EditorSettings::get_singleton()->get("text_editor/indent/auto_indent"));
shader_editor->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/indent/draw_tabs"));
+ shader_editor->get_text_edit()->set_draw_spaces(EditorSettings::get_singleton()->get("text_editor/indent/draw_spaces"));
shader_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/appearance/show_line_numbers"));
shader_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/highlighting/syntax_highlighting"));
shader_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_all_occurrences"));
@@ -381,6 +382,9 @@ void ShaderEditor::_editor_settings_changed() {
shader_editor->get_text_edit()->set_v_scroll_speed(EditorSettings::get_singleton()->get("text_editor/navigation/v_scroll_speed"));
shader_editor->get_text_edit()->set_draw_minimap(EditorSettings::get_singleton()->get("text_editor/navigation/show_minimap"));
shader_editor->get_text_edit()->set_minimap_width((int)EditorSettings::get_singleton()->get("text_editor/navigation/minimap_width") * EDSCALE);
+ shader_editor->get_text_edit()->set_show_line_length_guideline(EditorSettings::get_singleton()->get("text_editor/appearance/show_line_length_guideline"));
+ shader_editor->get_text_edit()->set_line_length_guideline_column(EditorSettings::get_singleton()->get("text_editor/appearance/line_length_guideline_column"));
+ shader_editor->get_text_edit()->set_breakpoint_gutter_enabled(false);
}
void ShaderEditor::_bind_methods() {
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index bf87bfc14d..31e6b65640 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -428,8 +428,7 @@ Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) {
} else {
cm.set_perspective(get_fov(), get_size().aspect(), get_znear() + p_vector3.z, get_zfar());
}
- float screen_w, screen_h;
- cm.get_viewport_size(screen_w, screen_h);
+ Vector2 screen_he = cm.get_viewport_half_extents();
Transform camera_transform;
camera_transform.translate(cursor.pos);
@@ -437,7 +436,7 @@ Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) {
camera_transform.basis.rotate(Vector3(0, 1, 0), -cursor.y_rot);
camera_transform.translate(0, 0, cursor.distance);
- return camera_transform.xform(Vector3(((p_vector3.x / get_size().width) * 2.0 - 1.0) * screen_w, ((1.0 - (p_vector3.y / get_size().height)) * 2.0 - 1.0) * screen_h, -(get_znear() + p_vector3.z)));
+ return camera_transform.xform(Vector3(((p_vector3.x / get_size().width) * 2.0 - 1.0) * screen_he.x, ((1.0 - (p_vector3.y / get_size().height)) * 2.0 - 1.0) * screen_he.y, -(get_znear() + p_vector3.z)));
}
void SpatialEditorViewport::_select_region() {
diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp
index f5ea88eeae..6757b180a3 100644
--- a/editor/plugins/sprite_editor_plugin.cpp
+++ b/editor/plugins/sprite_editor_plugin.cpp
@@ -474,69 +474,6 @@ void SpriteEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node)
p_new_node->set_owner(this->get_tree()->get_edited_scene_root());
}
-#if 0
-void SpriteEditor::_create_uv_lines() {
-
- Ref<Mesh> sprite = node->get_sprite();
- ERR_FAIL_COND(!sprite.is_valid());
-
- Set<SpriteEditorEdgeSort> edges;
- uv_lines.clear();
- for (int i = 0; i < sprite->get_surface_count(); i++) {
- if (sprite->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES)
- continue;
- Array a = sprite->surface_get_arrays(i);
-
- PoolVector<Vector2> uv = a[p_layer == 0 ? Mesh::ARRAY_TEX_UV : Mesh::ARRAY_TEX_UV2];
- if (uv.size() == 0) {
- err_dialog->set_text(TTR("Model has no UV in this layer"));
- err_dialog->popup_centered_minsize();
- return;
- }
-
- PoolVector<Vector2>::Read r = uv.read();
-
- PoolVector<int> indices = a[Mesh::ARRAY_INDEX];
- PoolVector<int>::Read ri;
-
- int ic;
- bool use_indices;
-
- if (indices.size()) {
- ic = indices.size();
- ri = indices.read();
- use_indices = true;
- } else {
- ic = uv.size();
- use_indices = false;
- }
-
- for (int j = 0; j < ic; j += 3) {
-
- for (int k = 0; k < 3; k++) {
-
- SpriteEditorEdgeSort edge;
- if (use_indices) {
- edge.a = r[ri[j + k]];
- edge.b = r[ri[j + ((k + 1) % 3)]];
- } else {
- edge.a = r[j + k];
- edge.b = r[j + ((k + 1) % 3)];
- }
-
- if (edges.has(edge))
- continue;
-
- uv_lines.push_back(edge.a);
- uv_lines.push_back(edge.b);
- edges.insert(edge);
- }
- }
- }
-
- debug_uv_dialog->popup_centered_minsize();
-}
-#endif
void SpriteEditor::_debug_uv_draw() {
Ref<Texture> tex = node->get_texture();
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index f9b1e3b43a..94aef60f1f 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -546,6 +546,17 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
edit_draw->update();
}
}
+
+ Ref<InputEventMagnifyGesture> magnify_gesture = p_input;
+ if (magnify_gesture.is_valid()) {
+ _zoom_on_position(draw_zoom * magnify_gesture->get_factor(), magnify_gesture->get_position());
+ }
+
+ Ref<InputEventPanGesture> pan_gesture = p_input;
+ if (pan_gesture.is_valid()) {
+ hscroll->set_value(hscroll->get_value() + hscroll->get_page() * pan_gesture->get_delta().x / 8);
+ vscroll->set_value(vscroll->get_value() + vscroll->get_page() * pan_gesture->get_delta().y / 8);
+ }
}
void TextureRegionEditor::_scroll_changed(float) {
@@ -736,6 +747,9 @@ void TextureRegionEditor::_notification(int p_what) {
zoom_out->set_icon(get_icon("ZoomLess", "EditorIcons"));
zoom_reset->set_icon(get_icon("ZoomReset", "EditorIcons"));
zoom_in->set_icon(get_icon("ZoomMore", "EditorIcons"));
+
+ vscroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE);
+ hscroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE);
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
if (snap_mode == SNAP_AUTOSLICE && is_visible() && autoslice_is_dirty) {
@@ -1010,24 +1024,22 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) {
zoom_hb->add_child(zoom_out);
zoom_reset = memnew(ToolButton);
- zoom_out->set_tooltip(TTR("Zoom Reset"));
+ zoom_reset->set_tooltip(TTR("Zoom Reset"));
zoom_reset->connect("pressed", this, "_zoom_reset");
zoom_hb->add_child(zoom_reset);
zoom_in = memnew(ToolButton);
- zoom_out->set_tooltip(TTR("Zoom In"));
+ zoom_in->set_tooltip(TTR("Zoom In"));
zoom_in->connect("pressed", this, "_zoom_in");
zoom_hb->add_child(zoom_in);
vscroll = memnew(VScrollBar);
vscroll->set_step(0.001);
edit_draw->add_child(vscroll);
- vscroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE);
vscroll->connect("value_changed", this, "_scroll_changed");
hscroll = memnew(HScrollBar);
hscroll->set_step(0.001);
edit_draw->add_child(hscroll);
- hscroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE);
hscroll->connect("value_changed", this, "_scroll_changed");
updating_scroll = false;
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index a107cb020d..f889228f87 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -627,13 +627,14 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
if (r != bucket_cache_rect)
_clear_bucket_cache();
// Cache grid is not initialized
- if (bucket_cache_visited == 0) {
+ if (bucket_cache_visited == NULL) {
bucket_cache_visited = new bool[area];
invalidate_cache = true;
}
// Tile ID changed or position wasn't visited by the previous fill
- int loc = (p_start.x - r.position.x) + (p_start.y - r.position.y) * r.get_size().x;
- if (prev_id != bucket_cache_tile || !bucket_cache_visited[loc]) {
+ const int loc = (p_start.x - r.position.x) + (p_start.y - r.position.y) * r.get_size().x;
+ const bool in_range = 0 <= loc && loc < area;
+ if (prev_id != bucket_cache_tile || (in_range && !bucket_cache_visited[loc])) {
invalidate_cache = true;
}
if (invalidate_cache) {
@@ -893,7 +894,7 @@ void TileMapEditor::_draw_fill_preview(Control *p_viewport, int p_cell, const Po
void TileMapEditor::_clear_bucket_cache() {
if (bucket_cache_visited) {
delete[] bucket_cache_visited;
- bucket_cache_visited = 0;
+ bucket_cache_visited = NULL;
}
}
@@ -1924,7 +1925,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
transpose = false;
bucket_cache_tile = -1;
- bucket_cache_visited = 0;
+ bucket_cache_visited = NULL;
invalid_cell.resize(1);
invalid_cell.write[0] = TileMap::INVALID_CELL;
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp
index c53fc7e6c5..3622ca8d61 100644
--- a/editor/plugins/version_control_editor_plugin.cpp
+++ b/editor/plugins/version_control_editor_plugin.cpp
@@ -203,7 +203,7 @@ void VersionControlEditorPlugin::_refresh_stage_area() {
}
} else {
- WARN_PRINT("No VCS addon is initialized. Select a Version Control Addon from Project menu.")
+ WARN_PRINT("No VCS addon is initialized. Select a Version Control Addon from Project menu.");
}
}
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index e334d4b093..fb095692bc 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -556,6 +556,7 @@ void VisualShaderEditor::_update_graph() {
}
Ref<VisualShaderNodeUniform> uniform = vsnode;
+ Ref<VisualShaderNodeScalarUniform> scalar_uniform = vsnode;
if (uniform.is_valid()) {
graph->add_child(node);
_update_created_node(node);
@@ -570,7 +571,9 @@ void VisualShaderEditor::_update_graph() {
//shortcut
VisualShaderNode::PortType port_right = vsnode->get_output_port_type(0);
node->set_slot(0, false, VisualShaderNode::PORT_TYPE_SCALAR, Color(), true, port_right, type_color[port_right]);
- continue;
+ if (!scalar_uniform.is_valid()) {
+ continue;
+ }
}
port_offset++;
}
@@ -582,11 +585,16 @@ void VisualShaderEditor::_update_graph() {
}
}
- if (custom_editor && vsnode->get_output_port_count() > 0 && vsnode->get_output_port_name(0) == "" && (vsnode->get_input_port_count() == 0 || vsnode->get_input_port_name(0) == "")) {
+ if (custom_editor && !scalar_uniform.is_valid() && vsnode->get_output_port_count() > 0 && vsnode->get_output_port_name(0) == "" && (vsnode->get_input_port_count() == 0 || vsnode->get_input_port_name(0) == "")) {
//will be embedded in first port
} else if (custom_editor) {
+
port_offset++;
node->add_child(custom_editor);
+ if (scalar_uniform.is_valid()) {
+ custom_editor->call_deferred("_show_prop_names", true);
+ continue;
+ }
custom_editor = NULL;
}
@@ -2972,6 +2980,13 @@ public:
bool updating;
Ref<VisualShaderNode> node;
Vector<EditorProperty *> properties;
+ Vector<Label *> prop_names;
+
+ void _show_prop_names(bool p_show) {
+ for (int i = 0; i < prop_names.size(); i++) {
+ prop_names[i]->set_visible(p_show);
+ }
+ }
void setup(Ref<Resource> p_parent_resource, Vector<EditorProperty *> p_properties, const Vector<StringName> &p_names, Ref<VisualShaderNode> p_node) {
parent_resource = p_parent_resource;
@@ -2981,7 +2996,20 @@ public:
for (int i = 0; i < p_properties.size(); i++) {
- add_child(p_properties[i]);
+ HBoxContainer *hbox = memnew(HBoxContainer);
+ hbox->set_h_size_flags(SIZE_EXPAND_FILL);
+ add_child(hbox);
+
+ Label *prop_name = memnew(Label);
+ String prop_name_str = p_names[i];
+ prop_name_str = prop_name_str.capitalize() + ":";
+ prop_name->set_text(prop_name_str);
+ prop_name->set_visible(false);
+ hbox->add_child(prop_name);
+ prop_names.push_back(prop_name);
+
+ p_properties[i]->set_h_size_flags(SIZE_EXPAND_FILL);
+ hbox->add_child(p_properties[i]);
bool res_prop = Object::cast_to<EditorPropertyResource>(p_properties[i]);
if (res_prop) {
@@ -3003,6 +3031,7 @@ public:
ClassDB::bind_method("_refresh_request", &VisualShaderNodePluginDefaultEditor::_refresh_request);
ClassDB::bind_method("_resource_selected", &VisualShaderNodePluginDefaultEditor::_resource_selected);
ClassDB::bind_method("_open_inspector", &VisualShaderNodePluginDefaultEditor::_open_inspector);
+ ClassDB::bind_method("_show_prop_names", &VisualShaderNodePluginDefaultEditor::_show_prop_names);
}
};