Making Godot Easier to Use..

-=-=-=-=-=-=-=-=-=-=-=-=-=-=

-Auto indenter in code editor, this makes it much easier to paste external code.
-Zoom in 2D viewport now uses the mouse pointer as reference.
-Obscure hack to see where code/line of GDScript in C++ backtrace.
-Fixed a bug where keys would get stuck on X11 if pressed simultaneously
-Added Api on IP singleton to request local IPs.
-Premultiplied alpha support when importing texture, editing PNGs and as a blend mode.
This commit is contained in:
Juan Linietsky 2014-05-24 01:35:47 -03:00
parent f9ff086235
commit 1cad087969
54 changed files with 928 additions and 106 deletions

View file

@ -687,6 +687,26 @@ void ScriptEditor::_menu_option(int p_option) {
current->get_text_edit()->query_code_comple();
} break;
case EDIT_AUTO_INDENT: {
TextEdit *te = current->get_text_edit();
String text = te->get_text();
Ref<Script> scr = current->get_edited_script();
if (scr.is_null())
return;
int begin,end;
if (te->is_selection_active()) {
begin=te->get_selection_from_line();
end=te->get_selection_to_line();
} else {
begin=0;
end=te->get_line_count()-1;
}
scr->get_language()->auto_indent_code(text,begin,end);
te->set_text(text);
} break;
case SEARCH_FIND: {
@ -1321,6 +1341,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
edit_menu->get_popup()->add_item("Select All",EDIT_SELECT_ALL,KEY_MASK_CMD|KEY_A);
edit_menu->get_popup()->add_separator();
edit_menu->get_popup()->add_item("Complete Symbol",EDIT_COMPLETE,KEY_MASK_CMD|KEY_SPACE);
edit_menu->get_popup()->add_item("Auto Indent",EDIT_AUTO_INDENT,KEY_MASK_CMD|KEY_I);
edit_menu->get_popup()->connect("item_pressed", this,"_menu_option");