summaryrefslogtreecommitdiff
path: root/tools/editor/property_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/property_editor.cpp')
-rw-r--r--tools/editor/property_editor.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index de10e68f33..6641297491 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -214,6 +214,12 @@ void CustomPropertyEditor::_menu_option(int p_which) {
}
}
} break;
+ case OBJ_MENU_NEW_SCRIPT: {
+
+ if (owner->cast_to<Node>())
+ EditorNode::get_singleton()->get_scene_tree_dock()->open_script_dialog(owner->cast_to<Node>());
+
+ } break;
default: {
@@ -850,8 +856,10 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
menu->clear();
menu->set_size(Size2(1,1));
-
- if (hint_text!="") {
+ if (p_name=="script/script" && hint_text=="Script" && owner->cast_to<Node>()) {
+ menu->add_icon_item(get_icon("Script","EditorIcons"),TTR("New Script"),OBJ_MENU_NEW_SCRIPT);
+ menu->add_separator();
+ } else if (hint_text!="") {
int idx=0;
for(int i=0;i<hint_text.get_slice_count(",");i++) {
@@ -3041,7 +3049,7 @@ void PropertyEditor::update_tree() {
if (E) {
descr=E->get().brief_description;
}
- class_descr_cache[type]=descr.world_wrap(80);
+ class_descr_cache[type]=descr.word_wrap(80);
}
@@ -3134,7 +3142,7 @@ void PropertyEditor::update_tree() {
if (E) {
for(int i=0;i<E->get().methods.size();i++) {
if (E->get().methods[i].name==setter.operator String()) {
- descr=E->get().methods[i].description.strip_edges().world_wrap(80);
+ descr=E->get().methods[i].description.strip_edges().word_wrap(80);
}
}
}