#include "property_selector.h" #include "editor_scale.h" #include "os/keyboard.h" void PropertySelector::_text_changed(const String& p_newtext) { _update_search(); } void PropertySelector::_sbox_input(const InputEvent& p_ie) { if (p_ie.type==InputEvent::KEY) { switch(p_ie.key.scancode) { case KEY_UP: case KEY_DOWN: case KEY_PAGEUP: case KEY_PAGEDOWN: { search_options->call("_input_event", p_ie); search_box->accept_event(); TreeItem *root = search_options->get_root(); if (!root->get_children()) break; TreeItem *current = search_options->get_selected(); TreeItem *item = search_options->get_next_selected(root); while (item) { item->deselect(0); item = search_options->get_next_selected(item); } current->select(0); } break; } } } void PropertySelector::_update_search() { if (properties) set_title(TTR("Select Property")); else set_title(TTR("Select Method")); search_options->clear(); help_bit->set_text(""); TreeItem *root = search_options->create_item(); if (properties) { List props; if (instance) { instance->get_property_list(&props,true); } else if (type!=Variant::NIL) { Variant v; if (type==Variant::INPUT_EVENT) { InputEvent ie; ie.type=event_type; v=ie; } else { Variant::CallError ce; v=Variant::construct(type,NULL,0,ce); } v.get_property_list(&props); } else { Object *obj = ObjectDB::get_instance(script); if (obj && obj->cast_to