diff options
Diffstat (limited to 'tools')
140 files changed, 2804 insertions, 1988 deletions
diff --git a/tools/Godot.app/Contents/Info.plist b/tools/Godot.app/Contents/Info.plist index 2b58162ae8..37c80fc8a3 100755 --- a/tools/Godot.app/Contents/Info.plist +++ b/tools/Godot.app/Contents/Info.plist @@ -34,7 +34,7 @@ <string>10.6.0</string> </dict> <key>NSHighResolutionCapable</key> - <false/> + <true/> <key>CFBundleDocumentTypes</key> <array> <dict> diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index 08b90b5408..dd3c3fee32 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -754,7 +754,7 @@ void AnimationKeyEditor::_menu_track(int p_type) { undo_redo->add_undo_method(animation.ptr(),"track_set_interpolation_type",idx,animation->track_get_interpolation_type(idx)); if (animation->track_get_type(idx)==Animation::TYPE_VALUE) { - undo_redo->add_undo_method(animation.ptr(),"value_track_set_continuous",idx,animation->value_track_is_continuous(idx)); + undo_redo->add_undo_method(animation.ptr(),"value_track_set_update_mode",idx,animation->value_track_get_update_mode(idx)); } @@ -918,7 +918,7 @@ void AnimationKeyEditor::_menu_track(int p_type) { pos=animation->get_length(); timeline_pos=pos; track_pos->update(); - emit_signal("timeline_changed",pos); + emit_signal("timeline_changed",pos,true); } break; case TRACK_MENU_PREV_STEP: { @@ -934,7 +934,7 @@ void AnimationKeyEditor::_menu_track(int p_type) { pos=0; timeline_pos=pos; track_pos->update(); - emit_signal("timeline_changed",pos); + emit_signal("timeline_changed",pos,true); } break; @@ -1169,8 +1169,9 @@ void AnimationKeyEditor::_track_editor_draw() { get_icon("InterpCubic","EditorIcons") }; Ref<Texture> cont_icon[3]={ + get_icon("TrackContinuous","EditorIcons"), get_icon("TrackDiscrete","EditorIcons"), - get_icon("TrackContinuous","EditorIcons") + get_icon("TrackTrigger","EditorIcons") }; Ref<Texture> type_icon[3]={ get_icon("KeyValue","EditorIcons"), @@ -1442,15 +1443,15 @@ void AnimationKeyEditor::_track_editor_draw() { if (animation->track_get_type(idx)==Animation::TYPE_VALUE) { - int continuous = animation->value_track_is_continuous(idx)?1:0; + int umode = animation->value_track_get_update_mode(idx); icon_ofs.x-=hsep; icon_ofs.x-=down_icon->get_width(); te->draw_texture(down_icon,icon_ofs); icon_ofs.x-=hsep; - icon_ofs.x-=cont_icon[continuous]->get_width(); - te->draw_texture(cont_icon[continuous],icon_ofs); + icon_ofs.x-=cont_icon[umode]->get_width(); + te->draw_texture(cont_icon[umode],icon_ofs); } else { icon_ofs.x -= hsep*2 + cont_icon[0]->get_width() + down_icon->get_width(); @@ -1626,8 +1627,8 @@ void AnimationKeyEditor::_track_menu_selected(int p_idx) { ERR_FAIL_INDEX(cont_editing,animation->get_track_count()); undo_redo->create_action(TTR("Anim Track Change Value Mode")); - undo_redo->add_do_method(animation.ptr(),"value_track_set_continuous",cont_editing,p_idx); - undo_redo->add_undo_method(animation.ptr(),"value_track_set_continuous",cont_editing,animation->value_track_is_continuous(cont_editing)); + undo_redo->add_do_method(animation.ptr(),"value_track_set_update_mode",cont_editing,p_idx); + undo_redo->add_undo_method(animation.ptr(),"value_track_set_update_mode",cont_editing,animation->value_track_get_update_mode(cont_editing)); undo_redo->commit_action(); } @@ -1820,8 +1821,9 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { get_icon("InterpCubic","EditorIcons") }; Ref<Texture> cont_icon[3]={ + get_icon("TrackContinuous","EditorIcons"), get_icon("TrackDiscrete","EditorIcons"), - get_icon("TrackContinuous","EditorIcons") + get_icon("TrackTrigger","EditorIcons") }; Ref<Texture> type_icon[3]={ get_icon("KeyValue","EditorIcons"), @@ -1972,7 +1974,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { click.click=ClickOver::CLICK_DRAG_TIMELINE; click.at=Point2(mb.x,mb.y); click.to=click.at; - emit_signal("timeline_changed",pos); + emit_signal("timeline_changed",pos,false); } @@ -2184,8 +2186,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { track_menu->clear(); track_menu->set_size(Point2(1,1)); - static const char *cont_name[3]={"Discrete","Continuous"}; - for(int i=0;i<2;i++) { + String cont_name[3]={TTR("Continuous"),TTR("Discrete"),TTR("Trigger")}; + for(int i=0;i<3;i++) { track_menu->add_icon_item(cont_icon[i],cont_name[i]); } @@ -2594,7 +2596,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { } timeline_pos=pos; - emit_signal("timeline_changed",pos); + emit_signal("timeline_changed",pos,true); @@ -2920,6 +2922,7 @@ void AnimationKeyEditor::_notification(int p_what) { edit_button->connect("pressed",this,"_toggle_edit_curves"); loop->set_icon(get_icon("Loop","EditorIcons")); + loop_interpolation->set_icon(get_icon("LoopInterpolation","EditorIcons")); curve_edit->connect("transition_changed",this,"_curve_transition_changed"); //edit_button->add_color_override("font_color",get_color("font_color","Tree")); @@ -2940,8 +2943,9 @@ void AnimationKeyEditor::_notification(int p_what) { get_icon("InterpCubic","EditorIcons") }; Ref<Texture> cont_icon[3]={ + get_icon("TrackContinuous","EditorIcons"), get_icon("TrackDiscrete","EditorIcons"), - get_icon("TrackContinuous","EditorIcons") + get_icon("TrackTrigger","EditorIcons") }; //right_data_size_cache = remove_icon->get_width() + move_up_icon->get_width() + move_down_icon->get_width() + down_icon->get_width() *2 + interp_icon[0]->get_width() + cont_icon[0]->get_width() + add_key_icon->get_width() + hsep*11; @@ -3009,6 +3013,7 @@ void AnimationKeyEditor::_update_menu() { length->set_val(animation->get_length()); loop->set_pressed(animation->has_loop()); + loop_interpolation->set_pressed(animation->has_loop_interpolation()); step->set_val(animation->get_step()); } @@ -3311,7 +3316,7 @@ int AnimationKeyEditor::_confirm_insert(InsertData p_id,int p_last_track) { created=true; undo_redo->create_action(TTR("Anim Insert Track & Key")); - bool continuous=false; + Animation::UpdateMode update_mode=Animation::UPDATE_DISCRETE; if (p_id.type==Animation::TYPE_VALUE) { //wants a new tack @@ -3324,16 +3329,21 @@ int AnimationKeyEditor::_confirm_insert(InsertData p_id,int p_last_track) { PropertyInfo h = _find_hint_for_track(animation->get_track_count()-1,np); animation->remove_track(animation->get_track_count()-1); //hack - - continuous = - h.type==Variant::REAL || + if ( h.type==Variant::REAL || h.type==Variant::VECTOR2 || h.type==Variant::RECT2 || h.type==Variant::VECTOR3 || h.type==Variant::_AABB || h.type==Variant::QUAT || h.type==Variant::COLOR || - h.type==Variant::TRANSFORM ; + h.type==Variant::TRANSFORM ) { + + update_mode=Animation::UPDATE_CONTINUOUS; + } + + if (h.usage&PROPERTY_USAGE_ANIMATE_AS_TRIGGER) { + update_mode=Animation::UPDATE_TRIGGER; + } } } @@ -3342,7 +3352,7 @@ int AnimationKeyEditor::_confirm_insert(InsertData p_id,int p_last_track) { undo_redo->add_do_method(animation.ptr(),"add_track",p_id.type); undo_redo->add_do_method(animation.ptr(),"track_set_path",p_id.track_idx,p_id.path); if (p_id.type==Animation::TYPE_VALUE) - undo_redo->add_do_method(animation.ptr(),"value_track_set_continuous",p_id.track_idx,continuous); + undo_redo->add_do_method(animation.ptr(),"value_track_set_update_mode",p_id.track_idx,update_mode); } else { undo_redo->create_action(TTR("Anim Insert Key")); @@ -3459,6 +3469,21 @@ void AnimationKeyEditor::_animation_loop_changed() { } +void AnimationKeyEditor::_animation_loop_interpolation_changed() { + + if (updating) + return; + + if (!animation.is_null()) { + + undo_redo->create_action(TTR("Change Anim Loop Interpolation")); + undo_redo->add_do_method(animation.ptr(),"set_loop_interpolation",loop_interpolation->is_pressed()); + undo_redo->add_undo_method(animation.ptr(),"set_loop_interpolation",!loop_interpolation->is_pressed()); + undo_redo->commit_action(); + } + +} + void AnimationKeyEditor::_create_value_item(int p_type) { @@ -3536,7 +3561,7 @@ void AnimationKeyEditor::_insert_delay() { pos=animation->get_length(); timeline_pos=pos; track_pos->update(); - emit_signal("timeline_changed",pos); + emit_signal("timeline_changed",pos,true); } insert_queue=false; } @@ -3744,6 +3769,7 @@ void AnimationKeyEditor::_bind_methods() { ObjectTypeDB::bind_method(_MD("_animation_loop_changed"),&AnimationKeyEditor::_animation_loop_changed); + ObjectTypeDB::bind_method(_MD("_animation_loop_interpolation_changed"),&AnimationKeyEditor::_animation_loop_interpolation_changed); ObjectTypeDB::bind_method(_MD("_animation_len_changed"),&AnimationKeyEditor::_animation_len_changed); ObjectTypeDB::bind_method(_MD("_create_value_item"),&AnimationKeyEditor::_create_value_item); ObjectTypeDB::bind_method(_MD("_pane_drag"),&AnimationKeyEditor::_pane_drag); @@ -3759,7 +3785,7 @@ void AnimationKeyEditor::_bind_methods() { ADD_SIGNAL( MethodInfo("resource_selected", PropertyInfo( Variant::OBJECT, "res"),PropertyInfo( Variant::STRING, "prop") ) ); ADD_SIGNAL( MethodInfo("keying_changed" ) ); - ADD_SIGNAL( MethodInfo("timeline_changed", PropertyInfo(Variant::REAL,"pos") ) ); + ADD_SIGNAL( MethodInfo("timeline_changed", PropertyInfo(Variant::REAL,"pos"), PropertyInfo(Variant::BOOL,"drag") ) ); ADD_SIGNAL( MethodInfo("animation_len_changed", PropertyInfo(Variant::REAL,"len") ) ); ADD_SIGNAL( MethodInfo("animation_step_changed", PropertyInfo(Variant::REAL,"step") ) ); ADD_SIGNAL( MethodInfo("key_edited", PropertyInfo(Variant::INT,"track"), PropertyInfo(Variant::INT,"key") ) ); @@ -3854,6 +3880,12 @@ AnimationKeyEditor::AnimationKeyEditor() { hb->add_child(loop); loop->set_tooltip(TTR("Enable/Disable looping in animation.")); + loop_interpolation = memnew( ToolButton ); + loop_interpolation->set_toggle_mode(true); + loop_interpolation->connect("pressed",this,"_animation_loop_interpolation_changed"); + hb->add_child(loop_interpolation); + loop_interpolation->set_tooltip(TTR("Enable/Disable interpolation when looping animation.")); + hb->add_child( memnew( VSeparator ) ); menu_add_track = memnew( MenuButton ); diff --git a/tools/editor/animation_editor.h b/tools/editor/animation_editor.h index 413c73b4b9..c8de1d87c1 100644 --- a/tools/editor/animation_editor.h +++ b/tools/editor/animation_editor.h @@ -173,6 +173,7 @@ class AnimationKeyEditor : public VBoxContainer { //MenuButton *menu; SpinBox *length; Button *loop; + Button *loop_interpolation; bool keying; ToolButton *edit_button; ToolButton *move_up_button; @@ -238,6 +239,7 @@ class AnimationKeyEditor : public VBoxContainer { void _animation_len_changed(float p_len); void _animation_loop_changed(); + void _animation_loop_interpolation_changed(); void _step_changed(float p_len); struct InsertData { diff --git a/tools/editor/array_property_edit.cpp b/tools/editor/array_property_edit.cpp index 1ff6e644d7..b6219ce67b 100644 --- a/tools/editor/array_property_edit.cpp +++ b/tools/editor/array_property_edit.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* array_property_edit.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "array_property_edit.h" #include "editor_node.h" diff --git a/tools/editor/array_property_edit.h b/tools/editor/array_property_edit.h index 948b2a71a3..a2aa24c8ed 100644 --- a/tools/editor/array_property_edit.h +++ b/tools/editor/array_property_edit.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* array_property_edit.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef ARRAY_PROPERTY_EDIT_H #define ARRAY_PROPERTY_EDIT_H diff --git a/tools/editor/asset_library_editor_plugin.cpp b/tools/editor/asset_library_editor_plugin.cpp index 928acdbcbb..c571310ded 100644 --- a/tools/editor/asset_library_editor_plugin.cpp +++ b/tools/editor/asset_library_editor_plugin.cpp @@ -541,8 +541,12 @@ void EditorAssetLibrary::_notification(int p_what) { error_hb->add_child(tf); error_label->raise(); + } - _repository_changed(0); + if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + if(!is_hidden()) { + _repository_changed(0); // Update when shown for the first time + } } if (p_what==NOTIFICATION_PROCESS) { diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index f62209fafa..be5d9c47ff 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -247,8 +247,18 @@ void FindReplaceBar::_get_search_from(int& r_line, int& r_col) { r_col=text_edit->cursor_get_column(); if (text_edit->is_selection_active() && !replace_all_mode) { - r_line=text_edit->get_selection_from_line(); - r_col=text_edit->get_selection_to_column(); + + int selection_line=text_edit->get_selection_from_line(); + + if (text_edit->get_selection_text()==get_search_text() && r_line==selection_line) { + + int selection_from_col=text_edit->get_selection_from_column(); + + if (r_col>=selection_from_col && r_col<=text_edit->get_selection_to_column()) { + r_col=selection_line; + r_col=selection_from_col; + } + } } if (r_line==result_line && r_col>=result_col && r_col<=result_col+get_search_text().length()) { @@ -521,6 +531,9 @@ FindReplaceBar::FindReplaceBar() { error_label = memnew(Label); search_options->add_child(error_label); + error_label->add_color_override("font_color", Color(1,1,0,1)); + error_label->add_color_override("font_color_shadow", Color(0,0,0,1)); + error_label->add_constant_override("shadow_as_outline", 1); search_options->add_spacer(); diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp index e2b8f2884f..8847654ad7 100644 --- a/tools/editor/connections_dialog.cpp +++ b/tools/editor/connections_dialog.cpp @@ -35,6 +35,7 @@ #include "print_string.h" #include "editor_settings.h" #include "editor_node.h" +#include "plugins/script_editor_plugin.h" class ConnectDialogBinds : public Object { @@ -294,47 +295,33 @@ void ConnectDialog::_bind_methods() { ConnectDialog::ConnectDialog() { - int margin = get_constant("margin","Dialogs"); - int button_margin = get_constant("button_margin","Dialogs"); + VBoxContainer *vbc = memnew( VBoxContainer ); + add_child(vbc); + set_child_rect(vbc); + HBoxContainer *main_hb = memnew( HBoxContainer ); + vbc->add_child(main_hb); + main_hb->set_v_size_flags(SIZE_EXPAND_FILL); - Label * label = memnew( Label ); - label->set_pos( Point2( 8,11) ); - label->set_text(TTR("Connect To Node:")); - - - add_child(label); - label = memnew( Label ); - label->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - label->set_pos( Point2( 0.5,11) ); - label->set_text(TTR("Binds (Extra Params):")); - add_child(label); + VBoxContainer *vbc_left = memnew( VBoxContainer ); + main_hb->add_child(vbc_left); + vbc_left->set_h_size_flags(SIZE_EXPAND_FILL); tree = memnew(SceneTreeEditor(false)); - tree->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO ); - tree->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - tree->set_begin( Point2( 15,32) ); - tree->set_end( Point2( 0.5,127 ) ); + vbc_left->add_margin_child(TTR("Conect To Node:"),tree,true); - add_child(tree); - bind_editor = memnew( PropertyEditor ); - bind_editor->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - bind_editor->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - bind_editor->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - bind_editor->set_begin( Point2( 0.51,42) ); - bind_editor->set_end( Point2( 15,127 ) ); - bind_editor->get_top_label()->hide(); - add_child(bind_editor); + VBoxContainer *vbc_right = memnew( VBoxContainer ); + main_hb->add_child(vbc_right); + vbc_right->set_h_size_flags(SIZE_EXPAND_FILL); + + HBoxContainer *add_bind_hb = memnew( HBoxContainer ); type_list = memnew( OptionButton ); - type_list->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO ); - type_list->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - type_list->set_begin( Point2( 0.51,32) ); - type_list->set_end( Point2( 0.75,33 ) ); - add_child(type_list); + type_list->set_h_size_flags(SIZE_EXPAND_FILL); + add_bind_hb->add_child(type_list); type_list->add_item("bool",Variant::BOOL); @@ -356,65 +343,36 @@ ConnectDialog::ConnectDialog() { type_list->select(0); Button *add_bind = memnew( Button ); - add_bind->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO ); - add_bind->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - add_bind->set_begin( Point2( 0.76,32) ); - add_bind->set_end( Point2( 0.84,33 ) ); + add_bind->set_text(TTR("Add")); - add_child(add_bind); + add_bind_hb->add_child(add_bind); add_bind->connect("pressed",this,"_add_bind"); Button *del_bind = memnew( Button ); - del_bind->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - del_bind->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - del_bind->set_begin( Point2( 0.85,32) ); - del_bind->set_end( Point2( 15,33 ) ); del_bind->set_text(TTR("Remove")); - add_child(del_bind); + add_bind_hb->add_child(del_bind); del_bind->connect("pressed",this,"_remove_bind"); + vbc_right->add_margin_child(TTR("Add Extra Call Argument:"),add_bind_hb); - label = memnew( Label ); - label->set_anchor( MARGIN_TOP, ANCHOR_END ); - label->set_begin( Point2( 8,124) ); - label->set_end( Point2( 15,99) ); - label->set_text(TTR("Path To Node:")); + bind_editor = memnew( PropertyEditor ); + bind_editor->hide_top_label(); - add_child(label); + vbc_right->add_margin_child(TTR("Extra Call Arguments:"),bind_editor,true); - dst_path = memnew(LineEdit); - dst_path->set_anchor( MARGIN_TOP, ANCHOR_END ); - dst_path->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - dst_path->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - dst_path->set_begin( Point2( 15,105) ); - dst_path->set_end( Point2( 15,80 ) ); - add_child(dst_path); - label = memnew( Label ); - label->set_anchor( MARGIN_TOP, ANCHOR_END ); - label->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - label->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - label->set_begin( Point2( 8,78 ) ); - label->set_end( Point2( 15,52 ) ); - label->set_text(TTR("Method In Node:")); - add_child(label); + dst_path = memnew(LineEdit); + vbc->add_margin_child(TTR("Path to Node:"),dst_path); HBoxContainer *dstm_hb = memnew( HBoxContainer ); - dstm_hb->set_anchor( MARGIN_TOP, ANCHOR_END ); - dstm_hb->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - dstm_hb->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - dstm_hb->set_begin( Point2( 15,59) ); - dstm_hb->set_end( Point2( 15,39 ) ); - add_child(dstm_hb); + vbc->add_margin_child("Method In Node:",dstm_hb); dst_method = memnew(LineEdit); dst_method->set_h_size_flags(SIZE_EXPAND_FILL); dstm_hb->add_child(dst_method); - - /*dst_method_list = memnew( MenuButton ); dst_method_list->set_text("List.."); dst_method_list->set_anchor( MARGIN_RIGHT, ANCHOR_END ); @@ -567,6 +525,7 @@ void ConnectionsDock::_connect_pressed() { connect_dialog->edit(node); connect_dialog->popup_centered_ratio(); + connect_dialog->set_title(TTR("Connecting Signal:")+" "+signalname); connect_dialog->set_dst_method("_on_"+midname+"_"+signal); connect_dialog->set_dst_node(node->get_owner()?node->get_owner():node); @@ -808,11 +767,58 @@ void ConnectionsDock::_something_selected() { } +void ConnectionsDock::_something_activated() { + + TreeItem *item = tree->get_selected(); + + if (!item) + return; + + if (item->get_parent()==tree->get_root() || item->get_parent()->get_parent()==tree->get_root()) { + // a signal - connect + String signal=item->get_metadata(0).operator Dictionary()["name"]; + String midname=node->get_name(); + for(int i=0;i<midname.length();i++) { + CharType c = midname[i]; + if ((c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='_') { + //all good + } else if (c==' ') { + c='_'; + } else { + midname.remove(i); + i--; + continue; + } + + midname[i]=c; + } + + connect_dialog->edit(node); + connect_dialog->popup_centered_ratio(); + connect_dialog->set_dst_method("_on_"+midname+"_"+signal); + connect_dialog->set_dst_node(node->get_owner()?node->get_owner():node); + } else { + // a slot - go to target method + Connection c=item->get_metadata(0); + ERR_FAIL_COND(c.source!=node); //shouldn't happen but...bugcheck + + if (!c.target) + return; + + Ref<Script> script = c.target->get_script(); + + if (script.is_valid() && ScriptEditor::get_singleton()->script_go_to_method(script,c.method)) { + editor->call("_editor_select",EditorNode::EDITOR_SCRIPT); + } + } +} + void ConnectionsDock::_bind_methods() { ObjectTypeDB::bind_method("_connect",&ConnectionsDock::_connect); ObjectTypeDB::bind_method("_something_selected",&ConnectionsDock::_something_selected); + ObjectTypeDB::bind_method("_something_activated",&ConnectionsDock::_something_activated); ObjectTypeDB::bind_method("_close",&ConnectionsDock::_close); ObjectTypeDB::bind_method("_connect_pressed",&ConnectionsDock::_connect_pressed); ObjectTypeDB::bind_method("update_tree",&ConnectionsDock::update_tree); @@ -865,6 +871,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) { remove_confirm->connect("confirmed", this,"_remove_confirm"); connect_dialog->connect("connected", this,"_connect"); tree->connect("item_selected", this,"_something_selected"); + tree->connect("item_activated", this,"_something_activated"); add_constant_override("separation",3*EDSCALE); } diff --git a/tools/editor/connections_dialog.h b/tools/editor/connections_dialog.h index 96ebaf85b0..73f52abc9e 100644 --- a/tools/editor/connections_dialog.h +++ b/tools/editor/connections_dialog.h @@ -111,6 +111,7 @@ class ConnectionsDock : public VBoxContainer { void _close(); void _connect(); void _something_selected(); + void _something_activated(); UndoRedo *undo_redo; protected: diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp index b6137ddac0..5275e1beeb 100644 --- a/tools/editor/create_dialog.cpp +++ b/tools/editor/create_dialog.cpp @@ -103,7 +103,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty item->set_selectable(0,false); } else { - if (!*to_select && (search_box->get_text()=="" || p_type.findn(search_box->get_text())!=-1)) { + if (!*to_select && (search_box->get_text().is_subsequence_ofi(p_type))) { *to_select=item; } @@ -172,7 +172,7 @@ void CreateDialog::_update_search() { bool found=false; String type=I->get(); while(type!="" && ObjectTypeDB::is_type(type,base_type) && type!=base_type) { - if (type.findn(search_box->get_text())!=-1) { + if (search_box->get_text().is_subsequence_ofi(type)) { found=true; break; @@ -194,7 +194,7 @@ void CreateDialog::_update_search() { const Vector<EditorData::CustomType> &ct = EditorNode::get_editor_data().get_custom_types()[type]; for(int i=0;i<ct.size();i++) { - bool show = search_box->get_text()=="" || ct[i].name.findn(search_box->get_text())!=-1; + bool show = search_box->get_text().is_subsequence_ofi(ct[i].name); if (!show) continue; diff --git a/tools/editor/default_saver.cpp b/tools/editor/default_saver.cpp deleted file mode 100644 index 611232e04b..0000000000 --- a/tools/editor/default_saver.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/*************************************************************************/ -/* default_saver.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ diff --git a/tools/editor/default_saver.h b/tools/editor/default_saver.h deleted file mode 100644 index 2b1a1edb23..0000000000 --- a/tools/editor/default_saver.h +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************/ -/* default_saver.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef DEFAULT_SAVER_H -#define DEFAULT_SAVER_H - - - - -#endif // DEFAULT_SAVER_H diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp index 6ad7704815..ad2eb57f00 100644 --- a/tools/editor/dependency_editor.cpp +++ b/tools/editor/dependency_editor.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* dependency_editor.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "dependency_editor.h" #include "os/file_access.h" #include "scene/gui/margin_container.h" diff --git a/tools/editor/dependency_editor.h b/tools/editor/dependency_editor.h index c372025ca0..60758f8f4e 100644 --- a/tools/editor/dependency_editor.h +++ b/tools/editor/dependency_editor.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* dependency_editor.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef DEPENDENCY_EDITOR_H #define DEPENDENCY_EDITOR_H diff --git a/tools/editor/editor_asset_installer.cpp b/tools/editor/editor_asset_installer.cpp index 2967abbc0a..ec36773d8d 100644 --- a/tools/editor/editor_asset_installer.cpp +++ b/tools/editor/editor_asset_installer.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_asset_installer.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_asset_installer.h" #include "io/zip_io.h" #include "os/dir_access.h" diff --git a/tools/editor/editor_asset_installer.h b/tools/editor/editor_asset_installer.h index 713c5f14f1..d6e71dbb3c 100644 --- a/tools/editor/editor_asset_installer.h +++ b/tools/editor/editor_asset_installer.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_asset_installer.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef EDITORASSETINSTALLER_H #define EDITORASSETINSTALLER_H diff --git a/tools/editor/editor_data.h b/tools/editor/editor_data.h index 79843c4df5..319155655d 100644 --- a/tools/editor/editor_data.h +++ b/tools/editor/editor_data.h @@ -34,7 +34,6 @@ #include "list.h" #include "undo_redo.h" #include "pair.h" -#include "default_saver.h" class EditorHistory { diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp index 395c4ba680..a6e231cf18 100644 --- a/tools/editor/editor_dir_dialog.cpp +++ b/tools/editor/editor_dir_dialog.cpp @@ -30,6 +30,7 @@ #include "os/os.h" #include "os/keyboard.h" #include "tools/editor/editor_settings.h" +#include "tools/editor/editor_file_system.h" void EditorDirDialog::_update_dir(TreeItem* p_item) { @@ -77,6 +78,11 @@ void EditorDirDialog::_update_dir(TreeItem* p_item) { void EditorDirDialog::reload() { + if (!is_visible()) { + must_reload=true; + return; + } + tree->clear(); TreeItem *root = tree->create_item(); root->set_metadata(0,"res://"); @@ -84,13 +90,24 @@ void EditorDirDialog::reload() { root->set_text(0,"/"); _update_dir(root); _item_collapsed(root); + must_reload=false; + } + void EditorDirDialog::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { reload(); tree->connect("item_collapsed",this,"_item_collapsed",varray(),CONNECT_DEFERRED); + EditorFileSystem::get_singleton()->connect("filesystem_changed",this,"reload"); + + } + + if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + if (must_reload && is_visible()) { + reload(); + } } } @@ -198,6 +215,7 @@ void EditorDirDialog::_bind_methods() { ObjectTypeDB::bind_method(_MD("_item_collapsed"),&EditorDirDialog::_item_collapsed); ObjectTypeDB::bind_method(_MD("_make_dir"),&EditorDirDialog::_make_dir); ObjectTypeDB::bind_method(_MD("_make_dir_confirm"),&EditorDirDialog::_make_dir_confirm); + ObjectTypeDB::bind_method(_MD("reload"),&EditorDirDialog::reload); ADD_SIGNAL(MethodInfo("dir_selected",PropertyInfo(Variant::STRING,"dir"))); } @@ -238,4 +256,8 @@ EditorDirDialog::EditorDirDialog() { get_ok()->set_text(TTR("Choose")); + must_reload=false; + + + } diff --git a/tools/editor/editor_dir_dialog.h b/tools/editor/editor_dir_dialog.h index 1c2593219c..69f9850c30 100644 --- a/tools/editor/editor_dir_dialog.h +++ b/tools/editor/editor_dir_dialog.h @@ -53,6 +53,10 @@ class EditorDirDialog : public ConfirmationDialog { void _make_dir_confirm(); void ok_pressed(); + + bool must_reload; + + protected: void _notification(int p_what); diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index 185ec17459..5afc4a7192 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_file_dialog.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_file_dialog.h" #include "scene/gui/label.h" #include "scene/gui/center_container.h" @@ -443,7 +471,7 @@ void EditorFileDialog::update_file_list() { item_list->set_icon_mode(ItemList::ICON_MODE_TOP); item_list->set_fixed_column_width(thumbnail_size*3/2); item_list->set_max_text_lines(2); - item_list->set_min_icon_size(Size2(thumbnail_size,thumbnail_size)); + item_list->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size)); if (!has_icon("ResizedFolder","EditorIcons")) { Ref<ImageTexture> folder = get_icon("FolderBig","EditorIcons"); @@ -475,7 +503,7 @@ void EditorFileDialog::update_file_list() { item_list->set_max_columns(1); item_list->set_max_text_lines(1); item_list->set_fixed_column_width(0); - item_list->set_min_icon_size(Size2()); + item_list->set_fixed_icon_size(Size2()); if (preview->get_texture().is_valid()) preview_vb->show(); @@ -508,6 +536,11 @@ void EditorFileDialog::update_file_list() { } } + if (dirs.find("..")==NULL) { + //may happen if lacking permissions + dirs.push_back(".."); + } + dirs.sort_custom<NoCaseComparator>(); files.sort_custom<NoCaseComparator>(); diff --git a/tools/editor/editor_file_dialog.h b/tools/editor/editor_file_dialog.h index a8f62a5226..5de33e2597 100644 --- a/tools/editor/editor_file_dialog.h +++ b/tools/editor/editor_file_dialog.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* file_dialog.h */ +/* editor_file_dialog.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -26,8 +26,6 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ - - #ifndef EDITORFILEDIALOG_H #define EDITORFILEDIALOG_H diff --git a/tools/editor/editor_fonts.cpp b/tools/editor/editor_fonts.cpp index 7ec22a4068..47891eef6c 100644 --- a/tools/editor/editor_fonts.cpp +++ b/tools/editor/editor_fonts.cpp @@ -157,12 +157,18 @@ void editor_register_fonts(Ref<Theme> p_theme) { p_theme->set_font("doc_source","EditorFonts",df_doc_code); + if (editor_is_hidpi()) { //replace default theme Ref<Texture> di; Ref<StyleBox> ds; fill_default_theme(p_theme,df,df_doc,di,ds,true); + } else { + Ref<Texture> di; + Ref<StyleBox> ds; + fill_default_theme(p_theme,df,df_doc,di,ds,false); + } } diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index ac9feacd46..0b60db5ee3 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -453,7 +453,7 @@ void EditorHelpIndex::_update_class_list() { String type = E->key(); while(type != "") { - if (type.findn(filter)!=-1) { + if (filter.is_subsequence_ofi(type)) { if (to_select.empty()) { to_select = type; diff --git a/tools/editor/editor_initialize_ssl.cpp b/tools/editor/editor_initialize_ssl.cpp index e0602a88c7..c0b55b302f 100644 --- a/tools/editor/editor_initialize_ssl.cpp +++ b/tools/editor/editor_initialize_ssl.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_initialize_ssl.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_initialize_ssl.h" #include "certs_compressed.h" #include "io/stream_peer_ssl.h" diff --git a/tools/editor/editor_initialize_ssl.h b/tools/editor/editor_initialize_ssl.h index 4eaf387a0a..082d546832 100644 --- a/tools/editor/editor_initialize_ssl.h +++ b/tools/editor/editor_initialize_ssl.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_initialize_ssl.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef EDITOR_INITIALIZE_SSL_H #define EDITOR_INITIALIZE_SSL_H diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 26e40cf816..ef65d5e506 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -171,6 +171,19 @@ void EditorNode::_unhandled_input(const InputEvent& p_event) { if (p_event.type==InputEvent::KEY && p_event.key.pressed && !p_event.key.echo && !gui_base->get_viewport()->gui_has_modal_stack()) { + + if (ED_IS_SHORTCUT("editor/fullscreen_mode", p_event)) { + if (distraction_free_mode) { + distraction_free_mode = false; + _update_top_menu_visibility(); + } else { + set_docks_visible(!get_docks_visible()); + } + } + if (ED_IS_SHORTCUT("editor/distraction_free_mode", p_event)) { + set_distraction_free_mode(!get_distraction_free_mode()); + } + switch(p_event.key.scancode) { /*case KEY_F1: @@ -193,18 +206,6 @@ void EditorNode::_unhandled_input(const InputEvent& p_event) { case KEY_F6: _menu_option_confirm(RUN_PLAY_SCENE,true); break; //case KEY_F7: _menu_option_confirm(RUN_PAUSE,true); break; case KEY_F8: _menu_option_confirm(RUN_STOP,true); break;*/ - case KEY_F11: { - if (p_event.key.mod.shift) { - if (p_event.key.mod.control) { - set_distraction_free_mode(!get_distraction_free_mode()); - } else if (distraction_free_mode) { - distraction_free_mode = false; - _update_top_menu_visibility(); - } else { - set_docks_visible(!get_docks_visible()); - } - } - } break; } } @@ -217,7 +218,7 @@ void EditorNode::_notification(int p_what) { if (p_what==NOTIFICATION_EXIT_TREE) { editor_data.save_editor_external_data(); - + FileAccess::set_file_close_fail_notify_callback(NULL); log->deinit(); // do not get messages anymore } if (p_what==NOTIFICATION_PROCESS) { @@ -742,100 +743,6 @@ void EditorNode::_set_scene_metadata(const String& p_file) { } -static Error _fix_object_paths(Object* obj, Node* root, String save_path) { - - Globals* g = Globals::get_singleton(); - - String import_dir = root->get_meta("__editor_import_file__"); - import_dir = import_dir.get_base_dir(); - import_dir = DirAccess::normalize_path(import_dir); - if (import_dir[import_dir.length()-1] != '/') { - import_dir = import_dir + "/"; - }; - - String resource_dir = DirAccess::normalize_path(g->get_resource_path()); - if (resource_dir[resource_dir.length()-1] != '/') { - resource_dir = resource_dir + "/"; - }; - - - List<PropertyInfo> list; - obj->get_property_list(&list, false); - - List<PropertyInfo>::Element *E = list.front(); - - while (E) { - - Variant v = obj->get(E->get().name); - if (v.get_type() == Variant::OBJECT) { - - Ref<Resource> res = (RefPtr)v; - if (res.is_null()) { - E = E->next(); - continue; - } - - if (res->get_path() != "") { - - String res_path = res->get_path(); - res_path = Globals::get_singleton()->globalize_path(res_path); - res_path = DirAccess::normalize_path(res_path); - - if (res_path.find(resource_dir) != 0) { - - // path of resource is not inside engine's resource path - - String new_path; - - if (res_path.find(import_dir) == 0) { - - // path of resource is relative to path of import file - new_path = save_path + "/" + res_path.substr(import_dir.length(), res_path.length() - import_dir.length()); - - } else { - - // path of resource is not relative to import file - new_path = save_path + "/" + res_path.get_file(); - }; - - res->set_path(g->localize_path(new_path)); - DirAccess* d = DirAccess::create(DirAccess::ACCESS_RESOURCES); - d->make_dir_recursive(new_path.get_base_dir()); - printf("copying from %ls to %ls\n", res_path.c_str(), new_path.c_str()); - Error err = d->copy(res_path, new_path); - memdelete(d); - ERR_FAIL_COND_V(err != OK, err); - } - - } else { - - _fix_object_paths(res.operator->(), root, save_path); - }; - }; - - - E = E->next(); - }; - - return OK; -}; - -static Error _fix_imported_scene_paths(Node* node, Node* root, String save_path) { - - if (node == root || node->get_owner() == root) { - Error e = _fix_object_paths(node, root, save_path); - ERR_FAIL_COND_V(e != OK, e); - }; - - for (int i=0; i<node->get_child_count(); i++) { - - Error e = _fix_imported_scene_paths(node->get_child(i), root, save_path); - ERR_FAIL_COND_V(e != OK, e); - }; - - return OK; -}; - bool EditorNode::_find_and_save_resource(RES res,Map<RES,bool>& processed,int32_t flags) { @@ -2214,7 +2121,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { String existing; if (extensions.size()) { String root_name(get_edited_scene()->get_name()); - existing=root_name+"."+extensions.front()->get().to_lower(); + existing=root_name+".tscn";//+extensions.front()->get().to_lower(); } file->set_current_path(existing); @@ -3089,6 +2996,7 @@ void EditorNode::set_addon_plugin_enabled(const String& p_addon,bool p_enabled) if (!p_enabled) { EditorPlugin *addon = plugin_addons[p_addon]; + editor_data.remove_editor_plugin( addon ); memdelete(addon); //bye plugin_addons.erase(p_addon); _update_addon_config(); @@ -5137,6 +5045,10 @@ void EditorNode::_dropped_files(const Vector<String>& p_files,int p_screen) { EditorImportExport::get_singleton()->get_import_plugin(i)->import_from_drop(p_files,cur_path); } } +void EditorNode::_file_access_close_error_notify(const String& p_str) { + + add_io_error("Unable to write to file '"+p_str+"', file in use, locked or lacking permissions."); +} void EditorNode::_bind_methods() { @@ -5232,7 +5144,6 @@ EditorNode::EditorNode() { SceneState::set_disable_placeholders(true); editor_initialize_certificates(); //for asset sharing - InputDefault *id = Input::get_singleton()->cast_to<InputDefault>(); if (id) { @@ -5313,15 +5224,18 @@ EditorNode::EditorNode() { ObjectTypeDB::set_type_enabled("CollisionShape",true); ObjectTypeDB::set_type_enabled("CollisionShape2D",true); ObjectTypeDB::set_type_enabled("CollisionPolygon2D",true); - //ObjectTypeDB::set_type_enabled("BodyVolumeConvexPolygon",true); + + Control *theme_base = memnew( Control ); + add_child(theme_base); + theme_base->set_area_as_parent_rect(); gui_base = memnew( Panel ); - add_child(gui_base); + theme_base->add_child(gui_base); gui_base->set_area_as_parent_rect(); theme = Ref<Theme>( memnew( Theme ) ); - gui_base->set_theme( theme ); + theme_base->set_theme( theme ); editor_register_icons(theme); editor_register_fonts(theme); @@ -5336,6 +5250,8 @@ EditorNode::EditorNode() { } } + + Ref<StyleBoxTexture> focus_sbt=memnew( StyleBoxTexture ); focus_sbt->set_texture(theme->get_icon("EditorFocus","EditorIcons")); for(int i=0;i<4;i++) { @@ -5346,6 +5262,16 @@ EditorNode::EditorNode() { theme->set_stylebox("EditorFocus","EditorStyles",focus_sbt); + String custom_theme = EditorSettings::get_singleton()->get("global/custom_theme"); + if (custom_theme!="") { + Ref<Theme> theme = ResourceLoader::load(custom_theme); + if (theme.is_valid()) { + gui_base->set_theme(theme); + } + } + + + resource_preview = memnew( EditorResourcePreview ); add_child(resource_preview); progress_dialog = memnew( ProgressDialog ); @@ -5600,6 +5526,8 @@ EditorNode::EditorNode() { prev_scene->set_pos(Point2(3,24)); prev_scene->hide(); + ED_SHORTCUT("editor/fullscreen_mode",TTR("Fullscreen Mode"),KEY_MASK_SHIFT|KEY_F11); + ED_SHORTCUT("editor/distraction_free_mode",TTR("Distraction Free Mode"),KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_F11); Separator *vs=NULL; @@ -6274,7 +6202,7 @@ EditorNode::EditorNode() { logo->set_texture(gui_base->get_icon("Logo","EditorIcons") ); warning = memnew( AcceptDialog ); - add_child(warning); + gui_base->add_child(warning); @@ -6533,12 +6461,12 @@ EditorNode::EditorNode() { { List<StringName> tl; StringName ei = "EditorIcons"; - gui_base->get_theme()->get_icon_list(ei,&tl); + theme_base->get_theme()->get_icon_list(ei,&tl); for(List<StringName>::Element *E=tl.front();E;E=E->next()) { if (!ObjectTypeDB::type_exists(E->get())) continue; - icon_type_cache[E->get()]=gui_base->get_theme()->get_icon(E->get(),ei); + icon_type_cache[E->get()]=theme_base->get_theme()->get_icon(E->get(),ei); } } @@ -6574,6 +6502,7 @@ EditorNode::EditorNode() { _load_docks(); + FileAccess::set_file_close_fail_notify_callback(_file_access_close_error_notify); } @@ -6581,6 +6510,7 @@ EditorNode::EditorNode() { EditorNode::~EditorNode() { + memdelete( EditorHelp::get_doc_data() ); memdelete(editor_selection); memdelete(editor_plugins_over); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 65a5687dce..bea973a357 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -65,7 +65,6 @@ #include "tools/editor/editor_log.h" #include "tools/editor/scene_tree_dock.h" #include "tools/editor/resources_dock.h" -#include "tools/editor/optimized_save_dialog.h" #include "tools/editor/editor_run_script.h" #include "tools/editor/editor_run_native.h" @@ -574,6 +573,7 @@ private: void _update_addon_config(); + static void _file_access_close_error_notify(const String& p_str); protected: void _notification(int p_what); @@ -692,6 +692,7 @@ public: static void unregister_editor_types(); Control *get_gui_base() { return gui_base; } + Control *get_theme_base() { return gui_base->get_parent_control(); } static void add_io_error(const String& p_error); diff --git a/tools/editor/editor_plugin_settings.cpp b/tools/editor/editor_plugin_settings.cpp index 1a6be05af3..5342007e6d 100644 --- a/tools/editor/editor_plugin_settings.cpp +++ b/tools/editor/editor_plugin_settings.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_plugin_settings.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_plugin_settings.h" #include "scene/gui/margin_container.h" #include "io/config_file.h" diff --git a/tools/editor/editor_plugin_settings.h b/tools/editor/editor_plugin_settings.h index 4f3c5b8268..4a982e40e2 100644 --- a/tools/editor/editor_plugin_settings.h +++ b/tools/editor/editor_plugin_settings.h @@ -1,10 +1,37 @@ +/*************************************************************************/ +/* editor_plugin_settings.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef EDITORPLUGINSETTINGS_H #define EDITORPLUGINSETTINGS_H #include "scene/gui/dialogs.h" #include "property_editor.h" -#include "optimized_save_dialog.h" #include "undo_redo.h" #include "editor_data.h" diff --git a/tools/editor/editor_resource_preview.cpp b/tools/editor/editor_resource_preview.cpp index 05b935f26c..8975c0ec35 100644 --- a/tools/editor/editor_resource_preview.cpp +++ b/tools/editor/editor_resource_preview.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_resource_preview.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_resource_preview.h" #include "editor_settings.h" #include "os/file_access.h" diff --git a/tools/editor/editor_resource_preview.h b/tools/editor/editor_resource_preview.h index 13c3d51313..63dc5c3dd3 100644 --- a/tools/editor/editor_resource_preview.h +++ b/tools/editor/editor_resource_preview.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_resource_preview.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef EDITORRESOURCEPREVIEW_H #define EDITORRESOURCEPREVIEW_H diff --git a/tools/editor/editor_run_script.cpp b/tools/editor/editor_run_script.cpp index d34cac1530..765f36d3bc 100644 --- a/tools/editor/editor_run_script.cpp +++ b/tools/editor/editor_run_script.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_run_script.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_run_script.h" #include "editor_node.h" diff --git a/tools/editor/editor_run_script.h b/tools/editor/editor_run_script.h index 8dbefced7f..144fad5ab1 100644 --- a/tools/editor/editor_run_script.h +++ b/tools/editor/editor_run_script.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_run_script.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef EDITOR_RUN_SCRIPT_H #define EDITOR_RUN_SCRIPT_H diff --git a/tools/editor/editor_selection.cpp b/tools/editor/editor_selection.cpp deleted file mode 100644 index f3fbdba907..0000000000 --- a/tools/editor/editor_selection.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/*************************************************************************/ -/* editor_selection.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "editor_selection.h" - diff --git a/tools/editor/editor_selection.h b/tools/editor/editor_selection.h deleted file mode 100644 index d238d86567..0000000000 --- a/tools/editor/editor_selection.h +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************/ -/* editor_selection.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef EDITOR_SELECTION_H -#define EDITOR_SELECTION_H - -#endif // EDITOR_SELECTION_H diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index bf01e02330..4100644311 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -86,6 +86,10 @@ bool EditorSettings::_set(const StringName& p_name, const Variant& p_value) { props[p_name].variant=p_value; else props[p_name]=VariantContainer(p_value,last_order++); + + if (save_changed_setting) { + props[p_name].save=true; + } } emit_signal("settings_changed"); @@ -126,6 +130,7 @@ struct _EVCSort { String name; Variant::Type type; int order; + bool save; bool operator<(const _EVCSort& p_vcs) const{ return order< p_vcs.order; } }; @@ -148,15 +153,24 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const { vc.name=*k; vc.order=v->order; vc.type=v->variant.get_type(); + vc.save=v->save; + vclist.insert(vc); } for(Set<_EVCSort>::Element *E=vclist.front();E;E=E->next()) { - int pinfo = PROPERTY_USAGE_STORAGE; - if (!E->get().name.begins_with("_")) + int pinfo = 0; + if (E->get().save) { + pinfo|=PROPERTY_USAGE_STORAGE; + } + + if (!E->get().name.begins_with("_") && !E->get().name.begins_with("projects/")) { pinfo|=PROPERTY_USAGE_EDITOR; + } else { + pinfo|=PROPERTY_USAGE_STORAGE; //hiddens must always be saved + } PropertyInfo pi(E->get().type, E->get().name); pi.usage=pinfo; @@ -330,6 +344,7 @@ void EditorSettings::create() { goto fail; } + singleton->save_changed_setting=true; singleton->config_file_path=config_file_path; singleton->project_config_path=pcp; singleton->settings_path=config_path+"/"+config_dir; @@ -363,9 +378,10 @@ void EditorSettings::create() { }; singleton = Ref<EditorSettings>( memnew( EditorSettings ) ); + singleton->save_changed_setting=true; singleton->config_file_path=config_file_path; singleton->settings_path=config_path+"/"+config_dir; - singleton->_load_defaults(extra_config); + singleton->_load_defaults(extra_config); singleton->setup_language(); singleton->setup_network(); singleton->list_text_editor_themes(); @@ -502,6 +518,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["global/source_font_size"]=PropertyInfo(Variant::INT,"global/source_font_size",PROPERTY_HINT_RANGE,"10,40,1",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); set("global/custom_font",""); hints["global/custom_font"]=PropertyInfo(Variant::STRING,"global/custom_font",PROPERTY_HINT_GLOBAL_FILE,"*.fnt",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); + set("global/custom_theme",""); + hints["global/custom_theme"]=PropertyInfo(Variant::STRING,"global/custom_theme",PROPERTY_HINT_GLOBAL_FILE,"*.res,*.tres,*.theme",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); + + set("global/autoscan_project_path",""); hints["global/autoscan_project_path"]=PropertyInfo(Variant::STRING,"global/autoscan_project_path",PROPERTY_HINT_GLOBAL_DIR); set("global/default_project_path",""); @@ -547,6 +567,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["scenetree_editor/duplicate_node_name_num_separator"]=PropertyInfo(Variant::INT,"scenetree_editor/duplicate_node_name_num_separator",PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash"); //set("scenetree_editor/display_old_action_buttons",false); set("scenetree_editor/start_create_dialog_fully_expanded",false); + set("scenetree_editor/draw_relationship_lines",false); + set("scenetree_editor/relationship_line_color",Color::html("464646")); set("gridmap_editor/pick_distance", 5000.0); @@ -975,6 +997,7 @@ EditorSettings::EditorSettings() { //singleton=this; last_order=0; + save_changed_setting=true; EditorTranslationList *etl=_editor_translations; @@ -999,6 +1022,7 @@ EditorSettings::EditorSettings() { } _load_defaults(); + save_changed_setting=false; } diff --git a/tools/editor/editor_settings.h b/tools/editor/editor_settings.h index 60333b5811..d975a7ef86 100644 --- a/tools/editor/editor_settings.h +++ b/tools/editor/editor_settings.h @@ -64,7 +64,8 @@ private: int order; Variant variant; bool hide_from_editor; - VariantContainer(){ order=0; hide_from_editor=false; } + bool save; + VariantContainer(){ order=0; hide_from_editor=false; save=false;} VariantContainer(const Variant& p_variant, int p_order) { variant=p_variant; order=p_order; hide_from_editor=false; } }; @@ -85,6 +86,9 @@ private: Ref<Resource> clipboard; + bool save_changed_setting; + + void _load_defaults(Ref<ConfigFile> p_extra_config = NULL); void _load_default_text_editor_theme(); diff --git a/tools/editor/editor_vu.cpp b/tools/editor/editor_vu.cpp deleted file mode 100644 index 7a133c9736..0000000000 --- a/tools/editor/editor_vu.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/*************************************************************************/ -/* editor_vu.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "editor_vu.h" - diff --git a/tools/editor/editor_vu.h b/tools/editor/editor_vu.h deleted file mode 100644 index 78fe3eda86..0000000000 --- a/tools/editor/editor_vu.h +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************/ -/* editor_vu.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef EDITOR_VU_H -#define EDITOR_VU_H - -#endif // EDITOR_VU_H diff --git a/tools/editor/fileserver/editor_file_server.cpp b/tools/editor/fileserver/editor_file_server.cpp index ea95e4da1c..c464e10fc2 100644 --- a/tools/editor/fileserver/editor_file_server.cpp +++ b/tools/editor/fileserver/editor_file_server.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_file_server.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_file_server.h" #include "io/marshalls.h" #include "io/marshalls.h" diff --git a/tools/editor/fileserver/editor_file_server.h b/tools/editor/fileserver/editor_file_server.h index 587b2c4fdb..fcb3d8546c 100644 --- a/tools/editor/fileserver/editor_file_server.h +++ b/tools/editor/fileserver/editor_file_server.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_file_server.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef EDITOR_FILE_SERVER_H #define EDITOR_FILE_SERVER_H diff --git a/tools/editor/icons/2x/icon_capsule_shape_2d.png b/tools/editor/icons/2x/icon_capsule_shape_2d.png Binary files differnew file mode 100644 index 0000000000..7f4734618b --- /dev/null +++ b/tools/editor/icons/2x/icon_capsule_shape_2d.png diff --git a/tools/editor/icons/2x/icon_circle_shape_2d.png b/tools/editor/icons/2x/icon_circle_shape_2d.png Binary files differnew file mode 100644 index 0000000000..5975c90f91 --- /dev/null +++ b/tools/editor/icons/2x/icon_circle_shape_2d.png diff --git a/tools/editor/icons/2x/icon_concave_polygon_shape_2d.png b/tools/editor/icons/2x/icon_concave_polygon_shape_2d.png Binary files differnew file mode 100644 index 0000000000..39e4d888af --- /dev/null +++ b/tools/editor/icons/2x/icon_concave_polygon_shape_2d.png diff --git a/tools/editor/icons/2x/icon_convex_polygon_shape_2d.png b/tools/editor/icons/2x/icon_convex_polygon_shape_2d.png Binary files differnew file mode 100644 index 0000000000..38ed87089d --- /dev/null +++ b/tools/editor/icons/2x/icon_convex_polygon_shape_2d.png diff --git a/tools/editor/icons/2x/icon_line_shape_2d.png b/tools/editor/icons/2x/icon_line_shape_2d.png Binary files differnew file mode 100644 index 0000000000..5ec406ea1f --- /dev/null +++ b/tools/editor/icons/2x/icon_line_shape_2d.png diff --git a/tools/editor/icons/2x/icon_ray_shape_2d.png b/tools/editor/icons/2x/icon_ray_shape_2d.png Binary files differnew file mode 100644 index 0000000000..37eedfb7de --- /dev/null +++ b/tools/editor/icons/2x/icon_ray_shape_2d.png diff --git a/tools/editor/icons/2x/icon_rectangle_shape_2d.png b/tools/editor/icons/2x/icon_rectangle_shape_2d.png Binary files differnew file mode 100644 index 0000000000..a2754e6880 --- /dev/null +++ b/tools/editor/icons/2x/icon_rectangle_shape_2d.png diff --git a/tools/editor/icons/2x/icon_segment_shape_2d.png b/tools/editor/icons/2x/icon_segment_shape_2d.png Binary files differnew file mode 100644 index 0000000000..11b28d81df --- /dev/null +++ b/tools/editor/icons/2x/icon_segment_shape_2d.png diff --git a/tools/editor/icons/icon_capsule_shape_2d.png b/tools/editor/icons/icon_capsule_shape_2d.png Binary files differnew file mode 100644 index 0000000000..f4f990f72f --- /dev/null +++ b/tools/editor/icons/icon_capsule_shape_2d.png diff --git a/tools/editor/icons/icon_circle_shape_2d.png b/tools/editor/icons/icon_circle_shape_2d.png Binary files differnew file mode 100644 index 0000000000..281658b062 --- /dev/null +++ b/tools/editor/icons/icon_circle_shape_2d.png diff --git a/tools/editor/icons/icon_concave_polygon_shape_2d.png b/tools/editor/icons/icon_concave_polygon_shape_2d.png Binary files differnew file mode 100644 index 0000000000..71d8e62dbc --- /dev/null +++ b/tools/editor/icons/icon_concave_polygon_shape_2d.png diff --git a/tools/editor/icons/icon_convex_polygon_shape_2d.png b/tools/editor/icons/icon_convex_polygon_shape_2d.png Binary files differnew file mode 100644 index 0000000000..283bc68786 --- /dev/null +++ b/tools/editor/icons/icon_convex_polygon_shape_2d.png diff --git a/tools/editor/icons/icon_line_shape_2d.png b/tools/editor/icons/icon_line_shape_2d.png Binary files differnew file mode 100644 index 0000000000..a4fb049f3f --- /dev/null +++ b/tools/editor/icons/icon_line_shape_2d.png diff --git a/tools/editor/icons/icon_loop_interpolation.png b/tools/editor/icons/icon_loop_interpolation.png Binary files differnew file mode 100644 index 0000000000..2f92ab7bf3 --- /dev/null +++ b/tools/editor/icons/icon_loop_interpolation.png diff --git a/tools/editor/icons/icon_ray_shape_2d.png b/tools/editor/icons/icon_ray_shape_2d.png Binary files differnew file mode 100644 index 0000000000..2f102bbb91 --- /dev/null +++ b/tools/editor/icons/icon_ray_shape_2d.png diff --git a/tools/editor/icons/icon_rectangle_shape_2d.png b/tools/editor/icons/icon_rectangle_shape_2d.png Binary files differnew file mode 100644 index 0000000000..eb123c6f6a --- /dev/null +++ b/tools/editor/icons/icon_rectangle_shape_2d.png diff --git a/tools/editor/icons/icon_segment_shape_2d.png b/tools/editor/icons/icon_segment_shape_2d.png Binary files differnew file mode 100644 index 0000000000..c90255a405 --- /dev/null +++ b/tools/editor/icons/icon_segment_shape_2d.png diff --git a/tools/editor/icons/source/icon_capsule_shape_2d.svg b/tools/editor/icons/source/icon_capsule_shape_2d.svg new file mode 100644 index 0000000000..03ac3f8255 --- /dev/null +++ b/tools/editor/icons/source/icon_capsule_shape_2d.svg @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + sodipodi:docname="icon_capsule_shape_2d.svg" + inkscape:export-ydpi="90" + inkscape:export-xdpi="90" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_capsule_shape.png" + inkscape:version="0.91 r13725" + version="1.1" + id="svg2" + viewBox="0 0 16 16" + height="16" + width="16"> + <sodipodi:namedview + inkscape:snap-smooth-nodes="false" + inkscape:object-nodes="false" + inkscape:snap-intersection-paths="false" + inkscape:object-paths="false" + inkscape:window-maximized="1" + inkscape:window-y="27" + inkscape:window-x="0" + inkscape:window-height="1016" + inkscape:window-width="1920" + inkscape:snap-center="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:bbox-nodes="true" + inkscape:bbox-paths="true" + inkscape:snap-bbox="true" + units="px" + showgrid="true" + inkscape:current-layer="layer1" + inkscape:document-units="px" + inkscape:cy="10.812487" + inkscape:cx="8.3752367" + inkscape:zoom="31.999999" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base"> + <inkscape:grid + id="grid3336" + type="xygrid" /> + </sodipodi:namedview> + <defs + id="defs4" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(0,-1036.3622)" + id="layer1" + inkscape:groupmode="layer" + inkscape:label="Layer 1"> + <path + style="opacity:1;fill:#a5b7f4;fill-opacity:0.98823529;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 8 1 A 4 4 0 0 0 4 5 L 4 11 A 4 4 0 0 0 8 15 A 4 4 0 0 0 12 11 L 12 5 A 4 4 0 0 0 8 1 z M 8 3 A 2.0000174 2.0000174 0 0 1 10 5 L 10 11 A 2.0000174 2.0000174 0 0 1 8 13 A 2.0000174 2.0000174 0 0 1 6 11 L 6 5 A 2.0000174 2.0000174 0 0 1 8 3 z " + transform="translate(0,1036.3622)" + id="path4135" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_circle_shape_2d.svg b/tools/editor/icons/source/icon_circle_shape_2d.svg new file mode 100644 index 0000000000..4f81ae0e62 --- /dev/null +++ b/tools/editor/icons/source/icon_circle_shape_2d.svg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" sodipodi:docname="icon_circle_shape_2d.svg" inkscape:export-ydpi="90" inkscape:export-xdpi="90" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_box_shape.png" inkscape:version="0.91 r13725" version="1.1" id="svg2" viewBox="0 0 16 16" height="16" width="16"> + <sodipodi:namedview inkscape:snap-smooth-nodes="false" inkscape:object-nodes="false" inkscape:snap-intersection-paths="false" inkscape:object-paths="false" inkscape:window-maximized="1" inkscape:window-y="0" inkscape:window-x="0" inkscape:window-height="1055" inkscape:window-width="1920" inkscape:snap-center="true" inkscape:snap-object-midpoints="true" inkscape:snap-bbox-midpoints="true" inkscape:snap-bbox-edge-midpoints="true" inkscape:bbox-nodes="true" inkscape:bbox-paths="true" inkscape:snap-bbox="true" units="px" showgrid="true" inkscape:current-layer="layer1" inkscape:document-units="px" inkscape:cy="11.031037" inkscape:cx="-1.7366522" inkscape:zoom="22.627416" inkscape:pageshadow="2" inkscape:pageopacity="0.0" borderopacity="1.0" bordercolor="#666666" pagecolor="#ffffff" id="base"> + <inkscape:grid id="grid3336" type="xygrid" empspacing="4" /> + </sodipodi:namedview> + <defs id="defs4" /> + <metadata id="metadata7"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g transform="translate(0,-1036.3622)" id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1"> + <path style="opacity:1;fill:none;fill-opacity:1;stroke:#a5b7f3;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.98823529" d="m 8,1038.3622 a 6,6 0 0 0 -6,6 6,6 0 0 0 6,6 6,6 0 0 0 6,-6 6,6 0 0 0 -6,-6 z" id="path4157" inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_concave_polygon_shape_2d.svg b/tools/editor/icons/source/icon_concave_polygon_shape_2d.svg new file mode 100644 index 0000000000..79e71425f7 --- /dev/null +++ b/tools/editor/icons/source/icon_concave_polygon_shape_2d.svg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="16" height="16" viewBox="0 0 16 16" id="svg2" version="1.1" inkscape:version="0.91 r13725" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" sodipodi:docname="icon_concave_polygon_shape_2d.svg"> + <defs id="defs4" /> + <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="22.627416" inkscape:cx="-0.53108971" inkscape:cy="10.128279" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" units="px" inkscape:snap-bbox="true" inkscape:bbox-paths="true" inkscape:bbox-nodes="true" inkscape:snap-bbox-edge-midpoints="true" inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" inkscape:window-width="1920" inkscape:window-height="1055" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:object-paths="true" inkscape:snap-intersection-paths="true" inkscape:object-nodes="true" inkscape:snap-smooth-nodes="true" inkscape:snap-midpoints="true"> + <inkscape:grid type="xygrid" id="grid3336" /> + </sodipodi:namedview> + <metadata id="metadata7"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> + <path style="fill:none;fill-rule:evenodd;stroke:#a5b7f3;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.98823529" d="m 14,1050.3622 -12,0 0,-12 6,6 6,-6 z" id="path4139" inkscape:connector-curvature="0" sodipodi:nodetypes="cccccc" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_convex_polygon_shape_2d.svg b/tools/editor/icons/source/icon_convex_polygon_shape_2d.svg new file mode 100644 index 0000000000..fc84cf931b --- /dev/null +++ b/tools/editor/icons/source/icon_convex_polygon_shape_2d.svg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="16" height="16" viewBox="0 0 16 16" id="svg2" version="1.1" inkscape:version="0.91 r13725" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" sodipodi:docname="icon_convex_polygon_shape_2d.svg"> + <defs id="defs4" /> + <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="22.627416" inkscape:cx="-0.53108971" inkscape:cy="10.128279" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" units="px" inkscape:snap-bbox="true" inkscape:bbox-paths="true" inkscape:bbox-nodes="true" inkscape:snap-bbox-edge-midpoints="true" inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" inkscape:window-width="1920" inkscape:window-height="1055" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:object-paths="true" inkscape:snap-intersection-paths="true" inkscape:object-nodes="true" inkscape:snap-smooth-nodes="true" inkscape:snap-midpoints="true"> + <inkscape:grid type="xygrid" id="grid3336" /> + </sodipodi:namedview> + <metadata id="metadata7"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> + <path style="fill:none;fill-rule:evenodd;stroke:#a5b7f3;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.98823529" d="m 14,1050.3622 -12,0 0,-6 6,-6 6,6 z" id="path4139" inkscape:connector-curvature="0" sodipodi:nodetypes="cccccc" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_line_shape_2d.svg b/tools/editor/icons/source/icon_line_shape_2d.svg new file mode 100644 index 0000000000..551439b4f3 --- /dev/null +++ b/tools/editor/icons/source/icon_line_shape_2d.svg @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="16" height="16" viewBox="0 0 16 16" id="svg2" version="1.1" inkscape:version="0.91 r13725" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" sodipodi:docname="icon_line_shape_2d.svg"> + <defs id="defs4" /> + <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="22.627416" inkscape:cx="-0.53108971" inkscape:cy="10.128279" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" units="px" inkscape:snap-bbox="true" inkscape:bbox-paths="true" inkscape:bbox-nodes="true" inkscape:snap-bbox-edge-midpoints="true" inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" inkscape:window-width="1920" inkscape:window-height="1055" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:object-paths="true" inkscape:snap-intersection-paths="true" inkscape:object-nodes="true" inkscape:snap-smooth-nodes="true" inkscape:snap-midpoints="true"> + <inkscape:grid type="xygrid" id="grid3336" /> + </sodipodi:namedview> + <metadata id="metadata7"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> + <path style="fill:none;fill-rule:evenodd;stroke:#a5b7f3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.39215687" d="m 1,1037.3622 14,14" id="path4139" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> + <path sodipodi:nodetypes="cc" inkscape:connector-curvature="0" id="path4201" d="m 3,1039.3622 10,10" style="fill:none;fill-rule:evenodd;stroke:#a5b7f3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.58823532" /> + <path style="fill:none;fill-rule:evenodd;stroke:#a5b7f3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.98823529" d="m 5,1041.3622 6,6" id="path4203" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_ray_shape_2d.svg b/tools/editor/icons/source/icon_ray_shape_2d.svg new file mode 100644 index 0000000000..e6ac9c40fa --- /dev/null +++ b/tools/editor/icons/source/icon_ray_shape_2d.svg @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="16" height="16" viewBox="0 0 16 16" id="svg2" version="1.1" inkscape:version="0.91 r13725" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" sodipodi:docname="icon_ray_shape_2d.svg"> + <defs id="defs4" /> + <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1" inkscape:cx="-0.53108971" inkscape:cy="10.128279" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" units="px" inkscape:snap-bbox="true" inkscape:bbox-paths="true" inkscape:bbox-nodes="true" inkscape:snap-bbox-edge-midpoints="true" inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" inkscape:window-width="1920" inkscape:window-height="1055" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:object-paths="true" inkscape:snap-intersection-paths="true" inkscape:object-nodes="true" inkscape:snap-smooth-nodes="true" inkscape:snap-midpoints="true"> + <inkscape:grid type="xygrid" id="grid3336" /> + </sodipodi:namedview> + <metadata id="metadata7"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> + <path style="fill:none;fill-rule:evenodd;stroke:#a5b7f3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.98823529" d="m 8,1038.3622 0,12" id="path4203" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> + <path sodipodi:nodetypes="ccc" inkscape:connector-curvature="0" id="path4224" d="m 5,1047.3622 3,3 3,-3" style="fill:none;fill-rule:evenodd;stroke:#a5b7f3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.98823529" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_rectangle_shape_2d.svg b/tools/editor/icons/source/icon_rectangle_shape_2d.svg new file mode 100644 index 0000000000..dd0941fe85 --- /dev/null +++ b/tools/editor/icons/source/icon_rectangle_shape_2d.svg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="16" height="16" viewBox="0 0 16 16" id="svg2" version="1.1" inkscape:version="0.91 r13725" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" sodipodi:docname="icon_rectangle_shape_2d.svg"> + <defs id="defs4" /> + <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="52.6875" inkscape:cx="8" inkscape:cy="8" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" units="px" inkscape:snap-bbox="true" inkscape:bbox-paths="true" inkscape:bbox-nodes="true" inkscape:snap-bbox-edge-midpoints="true" inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" inkscape:window-width="1920" inkscape:window-height="1055" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:object-paths="true" inkscape:snap-intersection-paths="true" inkscape:object-nodes="true" inkscape:snap-smooth-nodes="true" inkscape:snap-midpoints="true"> + <inkscape:grid type="xygrid" id="grid3336" /> + </sodipodi:namedview> + <metadata id="metadata7"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> + <rect style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:none;fill-opacity:0.98823529;fill-rule:evenodd;stroke:#a5b7f3;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:0.98823529;marker:none;enable-background:accumulate" id="rect4226" width="12" height="7.9999824" x="2" y="1040.3622" rx="1.7382812e-05" ry="1.7382812e-05" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_segment_shape_2d.svg b/tools/editor/icons/source/icon_segment_shape_2d.svg new file mode 100644 index 0000000000..99c8f80e9b --- /dev/null +++ b/tools/editor/icons/source/icon_segment_shape_2d.svg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="16" height="16" viewBox="0 0 16 16" id="svg2" version="1.1" inkscape:version="0.91 r13725" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" sodipodi:docname="icon_segment_shape_2d.svg"> + <defs id="defs4" /> + <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="52.6875" inkscape:cx="8" inkscape:cy="8" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" units="px" inkscape:snap-bbox="true" inkscape:bbox-paths="true" inkscape:bbox-nodes="true" inkscape:snap-bbox-edge-midpoints="true" inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" inkscape:window-width="1920" inkscape:window-height="1055" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:object-paths="true" inkscape:snap-intersection-paths="true" inkscape:object-nodes="true" inkscape:snap-smooth-nodes="true" inkscape:snap-midpoints="true"> + <inkscape:grid type="xygrid" id="grid3336" /> + </sodipodi:namedview> + <metadata id="metadata7"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> + <path style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#a4b6f2;fill-opacity:1;fill-rule:evenodd;stroke:#a5b7f4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:0.98823529;marker:none;enable-background:accumulate" d="m 2,1050.3622 12,-12" id="path4268" inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_zoom_less.svg b/tools/editor/icons/source/icon_zoom_less.svg new file mode 100644 index 0000000000..970b1954bb --- /dev/null +++ b/tools/editor/icons/source/icon_zoom_less.svg @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_zoom_less.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32.000001" + inkscape:cx="3.0997291" + inkscape:cy="9.8345523" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <rect + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4137" + width="14" + height="1.9999478" + x="1" + y="1043.3622" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_zoom_reset.svg b/tools/editor/icons/source/icon_zoom_reset.svg new file mode 100644 index 0000000000..a82f93dfea --- /dev/null +++ b/tools/editor/icons/source/icon_zoom_reset.svg @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_zoom_reset.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="16.000001" + inkscape:cx="-8.8962151" + inkscape:cy="11.998138" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <rect + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4137" + width="2" + height="14.000017" + x="3" + y="1037.3622" /> + <rect + y="1037.3622" + x="12" + height="14.000017" + width="2" + id="rect4156" + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4160" + width="2" + height="1.9999995" + x="7" + y="1046.3622" /> + <rect + y="1040.3622" + x="7" + height="1.9999995" + width="2" + id="rect4162" + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 1,1040.3622 2,-3 2,0 0,3 z" + id="path4164" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccc" /> + <path + sodipodi:nodetypes="ccccc" + inkscape:connector-curvature="0" + id="path4166" + d="m 10,1040.3622 2,-3 2,0 0,3 z" + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + </g> +</svg> diff --git a/tools/editor/icons/svgs_2_pngs.py b/tools/editor/icons/svgs_2_pngs.py deleted file mode 100644 index d47d8ed798..0000000000 --- a/tools/editor/icons/svgs_2_pngs.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- - -# Basic exporter for svg icons (requires Inkscape) - -import os.path -from os import listdir -from os.path import isfile, join -import subprocess -import sys - -import rsvg -import cairo - -SVGS_PATH = 'source/' -OUT_DIR = './' -DPI = 90 - -if len(sys.argv) >= 2: - try: - scale = int(sys.argv[1]) - if scale > 1: - OUT_DIR = '%sx/' % scale - DPI *= scale - except: - pass - -rsvg.set_default_dpi(DPI) - -last_svg_path = None -last_svg_data = None - -def svg_to_png(svg_path, png_path, dpi): - global last_svg_path, last_svg_data - - zoom = int(dpi / 90) - if last_svg_path != svg_path: - last_svg_data = open(svg_path, 'r').read() - last_svg_path = svg_path - svg = rsvg.Handle(data=last_svg_data) - img = cairo.ImageSurface( - cairo.FORMAT_ARGB32, - svg.props.width * zoom, - svg.props.height * zoom - ) - ctx = cairo.Context(img) - ctx.set_antialias(cairo.ANTIALIAS_DEFAULT) - ctx.scale(zoom, zoom) - svg.render_cairo(ctx) - img.write_to_png('%s.png' % png_path) - svg.close() - - -def export_all(svgs_path=SVGS_PATH, out_dir=OUT_DIR, dpi=DPI): - if not os.path.isdir(out_dir): - os.makedirs(out_dir) - - file_names = [f for f in listdir(svgs_path) if isfile(join(svgs_path, f))] - - for file_name in file_names: - # name without extensions - name_only = file_name.replace('.svg', '') - - icon_from_name = name_only - out_icon_names = [name_only] # export to a png with the same file name - rotations = [] - transforms = [] - - # special cases - if special_icons.has_key(name_only): - special_icon = special_icons[name_only] - if type(special_icon) is dict: - if special_icon.has_key('output_names'): - out_icon_names += special_icon['output_names'] - - svg_file_path = '%s%s.svg' % (svgs_path, icon_from_name) - - for index, out_icon_name in enumerate(out_icon_names): - svg_to_png(svg_file_path, out_dir + out_icon_name, dpi) - - -# special cases for icons that will be exported to multiple target pngs or that require transforms. -special_icons = { - 'icon_add_track': dict( output_names=['icon_add'] ), - 'icon_new': dict( output_names=['icon_file'] ), - 'icon_animation_tree_player': dict( output_names=['icon_animation_tree'] ), - 'icon_tool_rotate': dict( output_names=['icon_reload'] ), - 'icon_multi_edit': dict( output_names=['icon_multi_node_edit'] ), - 'icon_folder': dict( output_names=['icon_load', 'icon_open'] ), - 'icon_file_list': dict( output_names=['icon_enum'] ), - 'icon_collision_2d': dict( output_names=['icon_collision_polygon_2d', 'icon_polygon_2d'] ), - 'icon_class_list': dict( output_names=['icon_filesystem'] ), - 'icon_color_ramp': dict( output_names=['icon_graph_color_ramp'] ), - 'icon_translation': dict( output_names=['icon_p_hash_translation'] ), - 'icon_shader': dict( output_names=['icon_shader_material', 'icon_material_shader'] ), - 'icon_canvas_item_shader_graph': dict( output_names=['icon_material_shader_graph'] ), - -} - -export_all() diff --git a/tools/editor/inspector_dock.cpp b/tools/editor/inspector_dock.cpp index 57d19c3ec8..7b06761e53 100644 --- a/tools/editor/inspector_dock.cpp +++ b/tools/editor/inspector_dock.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* inspector_dock.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "inspector_dock.h" #if 0 diff --git a/tools/editor/inspector_dock.h b/tools/editor/inspector_dock.h index 90f043aba8..40c153e2d4 100644 --- a/tools/editor/inspector_dock.h +++ b/tools/editor/inspector_dock.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* inspector_dock.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef INSPECTOR_DOCK_H #define INSPECTOR_DOCK_H diff --git a/tools/editor/io_plugins/editor_export_scene.cpp b/tools/editor/io_plugins/editor_export_scene.cpp index dff41a59ed..acbbf8c737 100644 --- a/tools/editor/io_plugins/editor_export_scene.cpp +++ b/tools/editor/io_plugins/editor_export_scene.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_export_scene.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_export_scene.h" #include "io/resource_loader.h" #include "io/resource_saver.h" diff --git a/tools/editor/io_plugins/editor_export_scene.h b/tools/editor/io_plugins/editor_export_scene.h index 134da6c234..2c7fe9a1ab 100644 --- a/tools/editor/io_plugins/editor_export_scene.h +++ b/tools/editor/io_plugins/editor_export_scene.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_export_scene.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef EDITOR_EXPORT_SCENE_H #define EDITOR_EXPORT_SCENE_H diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp index d5e6e3077e..a6de849e44 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -489,18 +489,22 @@ class EditorFontImportDialog : public ConfirmationDialog { Image img = tex->get_data(); f->store_line("static const int _builtin_font_img_width="+itos(img.get_width())+";"); - f->store_line("static const int _builtin_font_img_height="+itos(img.get_height())+";"); - f->store_line("static const unsigned char _builtin_font_img_data["+itos(img.get_width()*img.get_height()*2)+"]={"); - for(int i=0;i<img.get_height();i++) { + f->store_line("static const int _builtin_font_img_height="+itos(img.get_height())+";"); - for(int j=0;j<img.get_width();j++) { + String fname = p_font.basename()+".sv.png"; + ResourceSaver::save(fname,tex); + Vector<uint8_t> data=FileAccess::get_file_as_array(fname); - Color c = img.get_pixel(j,i); - int v = CLAMP(((c.r+c.g+c.b)/3.0)*255,0,255); - int a = CLAMP(c.a*255,0,255); - f->store_line(itos(v)+","+itos(a)+","); - } + f->store_line("static const int _builtin_font_img_data_size="+itos(data.size())+";"); + f->store_line("static const unsigned char _builtin_font_img_data["+itos(data.size())+"]={"); + + + + for(int i=0;i<data.size();i++) { + + f->store_line(itos(data[i])+","); + } f->store_line("};"); @@ -524,6 +528,16 @@ class EditorFontImportDialog : public ConfirmationDialog { dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().basename() + ".fnt" ); } + if (dest->get_line_edit()->get_text().extension() == dest->get_line_edit()->get_text()) { + dest->get_line_edit()->set_text(dest->get_line_edit()->get_text() + ".fnt"); + } + + if (dest->get_line_edit()->get_text().extension().to_lower() != "fnt") { + error_dialog->set_text("Invalid file extension. \nPlease use .fnt"); + error_dialog->popup_centered(Size2(200,100)); + return; + } + Ref<ResourceImportMetadata> rimd = get_rimd(); if (rimd.is_null()) { diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp index c20515f0f3..095c56a373 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_mesh_import_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_mesh_import_plugin.h" #include "tools/editor/editor_file_dialog.h" diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.h b/tools/editor/io_plugins/editor_mesh_import_plugin.h index ed30d69e18..d200603e6a 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.h +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_mesh_import_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef EDITOR_MESH_IMPORT_PLUGIN_H #define EDITOR_MESH_IMPORT_PLUGIN_H diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index f346306f61..ed766c6598 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -30,6 +30,7 @@ #include "globals.h" #include "tools/editor/editor_node.h" #include "scene/resources/packed_scene.h" +#include "scene/resources/box_shape.h" #include "os/file_access.h" #include "scene/3d/path.h" #include "scene/animation/animation_player.h" @@ -1073,7 +1074,7 @@ const EditorSceneImportDialog::FlagInfo EditorSceneImportDialog::scene_flag_name {EditorSceneImportPlugin::SCENE_FLAG_LINEARIZE_DIFFUSE_TEXTURES,("Actions"),"SRGB->Linear Of Diffuse Textures",false}, {EditorSceneImportPlugin::SCENE_FLAG_CONVERT_NORMALMAPS_TO_XY,("Actions"),"Convert Normal Maps to XY",true}, {EditorSceneImportPlugin::SCENE_FLAG_SET_LIGHTMAP_TO_UV2_IF_EXISTS,("Actions"),"Set Material Lightmap to UV2 if Tex2Array Exists",true}, - {EditorSceneImportPlugin::SCENE_FLAG_CREATE_COLLISIONS,("Create"),"Create Collisions (-col},-colonly)",true}, + {EditorSceneImportPlugin::SCENE_FLAG_CREATE_COLLISIONS,("Create"),"Create Collisions and/or Rigid Bodies (-col,-colonly,-rigid)",true}, {EditorSceneImportPlugin::SCENE_FLAG_CREATE_PORTALS,("Create"),"Create Portals (-portal)",true}, {EditorSceneImportPlugin::SCENE_FLAG_CREATE_ROOMS,("Create"),"Create Rooms (-room)",true}, {EditorSceneImportPlugin::SCENE_FLAG_SIMPLIFY_ROOMS,("Create"),"Simplify Rooms",false}, @@ -1745,6 +1746,49 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> colshape->set_owner(sb->get_owner()); } + } else if (p_flags&SCENE_FLAG_CREATE_COLLISIONS && _teststr(name,"rigid") && p_node->cast_to<MeshInstance>()) { + + if (isroot) + return p_node; + + // get mesh instance and bounding box + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + AABB aabb = mi->get_aabb(); + + // create a new rigid body collision node + RigidBody * rigid_body = memnew( RigidBody ); + Node * col = rigid_body; + ERR_FAIL_COND_V(!col,NULL); + + // remove node name postfix + col->set_name(_fixstr(name,"rigid")); + // get mesh instance xform matrix to the rigid body collision node + col->cast_to<Spatial>()->set_transform(mi->get_transform()); + // save original node by duplicating it into a new instance and correcting the name + Node * mesh = p_node->duplicate(); + mesh->set_name(_fixstr(name,"rigid")); + // reset the xform matrix of the duplicated node so it can inherit parent node xform + mesh->cast_to<Spatial>()->set_transform(Transform(Matrix3())); + // reparent the new mesh node to the rigid body collision node + p_node->add_child(mesh); + mesh->set_owner(p_node->get_owner()); + // replace the original node with the rigid body collision node + p_node->replace_by(col); + memdelete(p_node); + p_node=col; + + // create an alias for the rigid body collision node + RigidBody *rb = col->cast_to<RigidBody>(); + // create a new Box collision shape and set the right extents + Ref<BoxShape> shape = memnew( BoxShape ); + shape->set_extents(aabb.get_size() * 0.5); + CollisionShape *colshape = memnew( CollisionShape); + colshape->set_name("shape"); + colshape->set_shape(shape); + // reparent the new collision shape to the rigid body collision node + rb->add_child(colshape); + colshape->set_owner(p_node->get_owner()); + } else if (p_flags&SCENE_FLAG_CREATE_COLLISIONS &&_teststr(name,"col") && p_node->cast_to<MeshInstance>()) { diff --git a/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp b/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp index 0c388b91ca..ac3c4637c2 100644 --- a/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp +++ b/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_scene_importer_fbxconv.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_scene_importer_fbxconv.h" #include "os/file_access.h" #include "os/os.h" diff --git a/tools/editor/io_plugins/editor_scene_importer_fbxconv.h b/tools/editor/io_plugins/editor_scene_importer_fbxconv.h index 261b072b04..b0cbc07ba3 100644 --- a/tools/editor/io_plugins/editor_scene_importer_fbxconv.h +++ b/tools/editor/io_plugins/editor_scene_importer_fbxconv.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_scene_importer_fbxconv.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef EDITOR_SCENE_IMPORTER_FBXCONV_H #define EDITOR_SCENE_IMPORTER_FBXCONV_H diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index 31b6333975..1fa7a50515 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -1144,6 +1144,7 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc if (!p_external) { from->set_editor(get_name()); + from->set_source_md5(0,FileAccess::get_md5(src_path)); existing->set_path(p_path); existing->set_import_metadata(from); } diff --git a/tools/editor/multi_node_edit.cpp b/tools/editor/multi_node_edit.cpp index b5bae82ae0..fcf6e295de 100644 --- a/tools/editor/multi_node_edit.cpp +++ b/tools/editor/multi_node_edit.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* multi_node_edit.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "multi_node_edit.h" #include "editor_node.h" diff --git a/tools/editor/multi_node_edit.h b/tools/editor/multi_node_edit.h index 5a0cabf4be..6c59765227 100644 --- a/tools/editor/multi_node_edit.h +++ b/tools/editor/multi_node_edit.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* multi_node_edit.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef MULTI_NODE_EDIT_H #define MULTI_NODE_EDIT_H diff --git a/tools/editor/optimized_save_dialog.cpp b/tools/editor/optimized_save_dialog.cpp deleted file mode 100644 index 4814b3b021..0000000000 --- a/tools/editor/optimized_save_dialog.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/*************************************************************************/ -/* optimized_save_dialog.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ diff --git a/tools/editor/optimized_save_dialog.h b/tools/editor/optimized_save_dialog.h deleted file mode 100644 index bdc36eddc1..0000000000 --- a/tools/editor/optimized_save_dialog.h +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************/ -/* optimized_save_dialog.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef OPTIMIZED_SAVE_DIALOG_H -#define OPTIMIZED_SAVE_DIALOG_H - - - -#endif // OPTIMIZED_SAVE_DIALOG_H diff --git a/tools/editor/plugins/animation_data_editor_plugin.cpp b/tools/editor/plugins/animation_data_editor_plugin.cpp deleted file mode 100644 index a73c75056b..0000000000 --- a/tools/editor/plugins/animation_data_editor_plugin.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************/ -/* animation_data_editor_plugin.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "animation_data_editor_plugin.h" - -AnimationDataEditorPlugin::AnimationDataEditorPlugin() -{ -} diff --git a/tools/editor/plugins/animation_data_editor_plugin.h b/tools/editor/plugins/animation_data_editor_plugin.h deleted file mode 100644 index 0a12638474..0000000000 --- a/tools/editor/plugins/animation_data_editor_plugin.h +++ /dev/null @@ -1,38 +0,0 @@ -/*************************************************************************/ -/* animation_data_editor_plugin.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef ANIMATION_DATA_EDITOR_PLUGIN_H -#define ANIMATION_DATA_EDITOR_PLUGIN_H - -class AnimationDataEditorPlugin -{ -public: - AnimationDataEditorPlugin(); -}; - -#endif // ANIMATION_DATA_EDITOR_PLUGIN_H diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index 4bbcb396af..1455d2fc24 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -952,7 +952,7 @@ void AnimationPlayerEditor::_animation_duplicate() { } -void AnimationPlayerEditor::_seek_value_changed(float p_value) { +void AnimationPlayerEditor::_seek_value_changed(float p_value,bool p_set) { if (updating || !player || player->is_playing()) { return; @@ -980,7 +980,7 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value) { pos=anim->get_length(); } - if (player->is_valid()) { + if (player->is_valid() && !p_set) { float cpos = player->get_current_animation_pos(); player->seek_delta(pos,pos-cpos); @@ -988,6 +988,7 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value) { player->seek(pos,true); } + key_editor->set_anim_pos(pos); updating=true; @@ -1078,6 +1079,7 @@ void AnimationPlayerEditor::_editor_load(){ void AnimationPlayerEditor::_animation_key_editor_anim_len_changed(float p_len) { + frame->set_max(p_len); } @@ -1092,7 +1094,7 @@ void AnimationPlayerEditor::_animation_key_editor_anim_step_changed(float p_len) } -void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos) { +void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos,bool p_drag) { if (!is_visible()) return; @@ -1102,7 +1104,11 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos) { if (player->is_playing() ) return; - frame->set_val(p_pos); + updating=true; + frame->set_val(p_pos); + updating=false; + _seek_value_changed(p_pos,!p_drag); + EditorNode::get_singleton()->get_property_editor()->refresh(); @@ -1254,7 +1260,7 @@ void AnimationPlayerEditor::_bind_methods() { ObjectTypeDB::bind_method(_MD("_animation_edit"),&AnimationPlayerEditor::_animation_edit); ObjectTypeDB::bind_method(_MD("_animation_resource_edit"),&AnimationPlayerEditor::_animation_resource_edit); ObjectTypeDB::bind_method(_MD("_dialog_action"),&AnimationPlayerEditor::_dialog_action); - ObjectTypeDB::bind_method(_MD("_seek_value_changed"),&AnimationPlayerEditor::_seek_value_changed); + ObjectTypeDB::bind_method(_MD("_seek_value_changed"),&AnimationPlayerEditor::_seek_value_changed,DEFVAL(true)); ObjectTypeDB::bind_method(_MD("_animation_player_changed"),&AnimationPlayerEditor::_animation_player_changed); ObjectTypeDB::bind_method(_MD("_blend_edited"),&AnimationPlayerEditor::_blend_edited); // ObjectTypeDB::bind_method(_MD("_seek_frame_changed"),&AnimationPlayerEditor::_seek_frame_changed); diff --git a/tools/editor/plugins/animation_player_editor_plugin.h b/tools/editor/plugins/animation_player_editor_plugin.h index 3f3cda25b2..b0c930b66e 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.h +++ b/tools/editor/plugins/animation_player_editor_plugin.h @@ -145,7 +145,7 @@ class AnimationPlayerEditor : public VBoxContainer { void _scale_changed(const String& p_scale); void _dialog_action(String p_file); void _seek_frame_changed(const String& p_frame); - void _seek_value_changed(float p_value); + void _seek_value_changed(float p_value, bool p_set=false); void _blend_editor_next_changed(const int p_idx); void _list_changed(); @@ -158,7 +158,7 @@ class AnimationPlayerEditor : public VBoxContainer { void _animation_player_changed(Object *p_pl); - void _animation_key_editor_seek(float p_pos); + void _animation_key_editor_seek(float p_pos, bool p_drag); void _animation_key_editor_anim_len_changed(float p_new); void _animation_key_editor_anim_step_changed(float p_len); diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp index b6bb774364..1962f81e87 100644 --- a/tools/editor/plugins/baked_light_baker.cpp +++ b/tools/editor/plugins/baked_light_baker.cpp @@ -1,4 +1,31 @@ - +/*************************************************************************/ +/* baked_light_baker.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "baked_light_baker.h" #include <stdlib.h> #include <cmath> diff --git a/tools/editor/plugins/baked_light_baker.h b/tools/editor/plugins/baked_light_baker.h index 5c172f79c6..d0fddf5563 100644 --- a/tools/editor/plugins/baked_light_baker.h +++ b/tools/editor/plugins/baked_light_baker.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* baked_light_baker.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef BAKED_LIGHT_BAKER_H #define BAKED_LIGHT_BAKER_H diff --git a/tools/editor/plugins/baked_light_baker_cmpxchg.cpp b/tools/editor/plugins/baked_light_baker_cmpxchg.cpp index 42d3fc5276..c581995916 100644 --- a/tools/editor/plugins/baked_light_baker_cmpxchg.cpp +++ b/tools/editor/plugins/baked_light_baker_cmpxchg.cpp @@ -1,4 +1,31 @@ - +/*************************************************************************/ +/* baked_light_baker_cmpxchg.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "typedefs.h" diff --git a/tools/editor/plugins/baked_light_editor_plugin.cpp b/tools/editor/plugins/baked_light_editor_plugin.cpp index 3e7d7b63a1..df76f28ae0 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.cpp +++ b/tools/editor/plugins/baked_light_editor_plugin.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* baked_light_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "baked_light_editor_plugin.h" #include "scene/gui/box_container.h" #include "scene/3d/mesh_instance.h" diff --git a/tools/editor/plugins/baked_light_editor_plugin.h b/tools/editor/plugins/baked_light_editor_plugin.h index 27ab88d70b..4985d7513e 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.h +++ b/tools/editor/plugins/baked_light_editor_plugin.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* baked_light_editor_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef BAKED_LIGHT_EDITOR_PLUGIN_H #define BAKED_LIGHT_EDITOR_PLUGIN_H diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp index 14a61d46b5..5ed9f8ab5f 100644 --- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* collision_polygon_2d_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "collision_polygon_2d_editor_plugin.h" #include "canvas_item_editor_plugin.h" diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h b/tools/editor/plugins/collision_polygon_2d_editor_plugin.h index f34405b355..982ba35fe8 100644 --- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h +++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* collision_polygon_2d_editor_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef COLLISION_POLYGON_2D_EDITOR_PLUGIN_H #define COLLISION_POLYGON_2D_EDITOR_PLUGIN_H diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp b/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp index 296362447f..d0cd73dcad 100644 --- a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* collision_shape_2d_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "collision_shape_2d_editor_plugin.h" #include "canvas_item_editor_plugin.h" diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.h b/tools/editor/plugins/collision_shape_2d_editor_plugin.h index 75e9b68ea7..1ee81eda43 100644 --- a/tools/editor/plugins/collision_shape_2d_editor_plugin.h +++ b/tools/editor/plugins/collision_shape_2d_editor_plugin.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* collision_shape_2d_editor_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef COLLISION_SHAPE_2D_EDITOR_PLUGIN_H #define COLLISION_SHAPE_2D_EDITOR_PLUGIN_H diff --git a/tools/editor/plugins/color_ramp_editor_plugin.cpp b/tools/editor/plugins/color_ramp_editor_plugin.cpp index 267f3aa5bd..cb7f6a1809 100644 --- a/tools/editor/plugins/color_ramp_editor_plugin.cpp +++ b/tools/editor/plugins/color_ramp_editor_plugin.cpp @@ -1,7 +1,31 @@ -/* - * color_ramp_editor_plugin.cpp - */ - +/*************************************************************************/ +/* color_ramp_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "color_ramp_editor_plugin.h" #include "spatial_editor_plugin.h" #include "canvas_item_editor_plugin.h" diff --git a/tools/editor/plugins/color_ramp_editor_plugin.h b/tools/editor/plugins/color_ramp_editor_plugin.h index 02d691239f..300a9030b9 100644 --- a/tools/editor/plugins/color_ramp_editor_plugin.h +++ b/tools/editor/plugins/color_ramp_editor_plugin.h @@ -1,7 +1,31 @@ -/* - * color_ramp_editor_plugin.h - */ - +/*************************************************************************/ +/* color_ramp_editor_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef TOOLS_EDITOR_PLUGINS_COLOR_RAMP_EDITOR_PLUGIN_H_ #define TOOLS_EDITOR_PLUGINS_COLOR_RAMP_EDITOR_PLUGIN_H_ diff --git a/tools/editor/plugins/control_editor_plugin.cpp b/tools/editor/plugins/control_editor_plugin.cpp deleted file mode 100644 index 9dff5e6ce4..0000000000 --- a/tools/editor/plugins/control_editor_plugin.cpp +++ /dev/null @@ -1,825 +0,0 @@ -/*************************************************************************/ -/* control_editor_plugin.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#if 0 -#include "control_editor_plugin.h" -#include "print_string.h" -#include "editor_node.h" -#include "os/keyboard.h" -#include "scene/main/viewport.h" - -void ControlEditor::_add_control(Control *p_control,const EditInfo& p_info) { - - if (controls.has(p_control)) - return; - - controls.insert(p_control,p_info); - p_control->call_deferred("connect","visibility_changed",this,"_visibility_changed",varray(p_control->get_instance_ID())); -} - -void ControlEditor::_remove_control(Control *p_control) { - - p_control->call_deferred("disconnect","visibility_changed",this,"_visibility_changed"); - controls.erase(p_control); -} -void ControlEditor::_clear_controls(){ - - while(controls.size()) - _remove_control(controls.front()->key()); -} - -void ControlEditor::_visibility_changed(ObjectID p_control) { - - Object *c = ObjectDB::get_instance(p_control); - if (!c) - return; - Control *ct = c->cast_to<Control>(); - if (!ct) - return; - - _remove_control(ct); -} - - -void ControlEditor::_node_removed(Node *p_node) { - - Control *control = (Control*)p_node; //not a good cast, but safe - if (controls.has(control)) - _remove_control(control); - - if (current_window==p_node) { - _clear_controls(); - } - update(); -} - -// slow as hell -Control* ControlEditor::_select_control_at_pos(const Point2& p_pos,Node* p_node) { - - for (int i=p_node->get_child_count()-1;i>=0;i--) { - - Control *r=_select_control_at_pos(p_pos,p_node->get_child(i)); - if (r) - return r; - } - - Control *c=p_node->cast_to<Control>(); - - if (c) { - Rect2 rect = c->get_window_rect(); - if (c->get_window()==current_window) { - rect.pos=transform.xform(rect.pos).floor(); - } - if (rect.has_point(p_pos)) - return c; - } - - return NULL; -} - - -void ControlEditor::_key_move(const Vector2& p_dir, bool p_snap) { - - if (drag!=DRAG_NONE) - return; - - Vector2 motion=p_dir; - if (p_snap) - motion*=snap_val->get_text().to_double(); - - undo_redo->create_action("Edit Control"); - for(ControlMap::Element *E=controls.front();E;E=E->next()) { - Control *control = E->key(); - undo_redo->add_do_method(control,"set_pos",control->get_pos()+motion); - undo_redo->add_undo_method(control,"set_pos",control->get_pos()); - } - undo_redo->commit_action(); -} - - -void ControlEditor::_input_event(InputEvent p_event) { - - if (p_event.type==InputEvent::MOUSE_BUTTON) { - - const InputEventMouseButton &b=p_event.mouse_button; - - if (b.button_index==BUTTON_RIGHT) { - - if (controls.size() && drag!=DRAG_NONE) { - //cancel drag - for(ControlMap::Element *E=controls.front();E;E=E->next()) { - Control *control = E->key(); - control->set_pos(E->get().drag_pos); - control->set_size(E->get().drag_size); - } - - } else if (b.pressed) { - popup->set_pos(Point2(b.x,b.y)); - popup->popup(); - } - return; - } - //if (!controls.size()) - // return; - - if (b.button_index!=BUTTON_LEFT) - return; - - if (!b.pressed) { - - if (drag!=DRAG_NONE) { - - if (undo_redo) { - - undo_redo->create_action("Edit Control"); - for(ControlMap::Element *E=controls.front();E;E=E->next()) { - Control *control = E->key(); - undo_redo->add_do_method(control,"set_pos",control->get_pos()); - undo_redo->add_do_method(control,"set_size",control->get_size()); - undo_redo->add_undo_method(control,"set_pos",E->get().drag_pos); - undo_redo->add_undo_method(control,"set_size",E->get().drag_size); - } - undo_redo->commit_action(); - } - - drag=DRAG_NONE; - - } - return; - } - - - if (controls.size()==1) { - //try single control edit - Control *control = controls.front()->key(); - ERR_FAIL_COND(!current_window); - - Rect2 rect=control->get_window_rect(); - Point2 ofs=Point2();//get_global_pos(); - Rect2 draw_rect=Rect2(rect.pos-ofs,rect.size); - Point2 click=Point2(b.x,b.y); - click = transform.affine_inverse().xform(click); - Size2 handle_size=Size2(handle_len,handle_len); - - drag = DRAG_NONE; - - if (Rect2(draw_rect.pos-handle_size,handle_size).has_point(click)) - drag=DRAG_TOP_LEFT; - else if (Rect2(draw_rect.pos+draw_rect.size,handle_size).has_point(click)) - drag=DRAG_BOTTOM_RIGHT; - else if(Rect2(draw_rect.pos+Point2(draw_rect.size.width,-handle_size.y),handle_size).has_point(click)) - drag=DRAG_TOP_RIGHT; - else if (Rect2(draw_rect.pos+Point2(-handle_size.x,draw_rect.size.height),handle_size).has_point(click)) - drag=DRAG_BOTTOM_LEFT; - else if (Rect2(draw_rect.pos+Point2(Math::floor((draw_rect.size.width-handle_size.x)/2.0),-handle_size.height),handle_size).has_point(click)) - drag=DRAG_TOP; - else if( Rect2(draw_rect.pos+Point2(-handle_size.width,Math::floor((draw_rect.size.height-handle_size.y)/2.0)),handle_size).has_point(click)) - drag=DRAG_LEFT; - else if ( Rect2(draw_rect.pos+Point2(Math::floor((draw_rect.size.width-handle_size.x)/2.0),draw_rect.size.height),handle_size).has_point(click)) - drag=DRAG_BOTTOM; - else if( Rect2(draw_rect.pos+Point2(draw_rect.size.width,Math::floor((draw_rect.size.height-handle_size.y)/2.0)),handle_size).has_point(click)) - drag=DRAG_RIGHT; - - if (drag!=DRAG_NONE) { - drag_from=click; - controls[control].drag_pos=control->get_pos(); - controls[control].drag_size=control->get_size(); - controls[control].drag_limit=drag_from+controls[control].drag_size-control->get_minimum_size(); - return; - } - - - } - - //multi control edit - - Point2 click=Point2(b.x,b.y); - Node* scene = get_scene()->get_root_node()->cast_to<EditorNode>()->get_edited_scene(); - if (!scene) - return; - /* - if (current_window) { - //no window.... ? - click-=current_window->get_scroll(); - }*/ - Control *c=_select_control_at_pos(click, scene); - - Node* n = c; - while ((n && n != scene && n->get_owner() != scene) || (n && !n->is_type("Control"))) { - n = n->get_parent(); - }; - c = n->cast_to<Control>(); - - - if (b.mod.control) { //additive selection - - if (!c) - return; //nothing to add - - if (current_window && controls.size() && c->get_window()!=current_window) - return; //cant multiple select from multiple windows - - if (!controls.size()) - current_window=c->get_window(); - - if (controls.has(c)) { - //already in here, erase it - _remove_control(c); - update(); - return; - } - - //check parents! - Control *parent = c->get_parent()->cast_to<Control>(); - - while(parent) { - - if (controls.has(parent)) - return; //a parent is already selected, so this is pointless - parent=parent->get_parent()->cast_to<Control>(); - } - - //check childrens of everything! - List<Control*> to_erase; - - for(ControlMap::Element *E=controls.front();E;E=E->next()) { - parent = E->key()->get_parent()->cast_to<Control>(); - while(parent) { - if (parent==c) { - to_erase.push_back(E->key()); - break; - } - parent=parent->get_parent()->cast_to<Control>(); - } - } - - while(to_erase.size()) { - _remove_control(to_erase.front()->get()); - to_erase.pop_front(); - } - - _add_control(c,EditInfo()); - update(); - } else { - //regular selection - if (!c) { - _clear_controls(); - update(); - return; - } - - if (!controls.has(c)) { - _clear_controls(); - current_window=c->get_window(); - _add_control(c,EditInfo()); - //reselect - if (get_scene()->is_editor_hint()) { - get_scene()->get_root_node()->call("edit_node",c); - } - - } - - - - for(ControlMap::Element *E=controls.front();E;E=E->next()) { - - EditInfo &ei=E->get(); - Control *control=E->key(); - ei.drag_pos=control->get_pos(); - ei.drag_size=control->get_size(); - ei.drag_limit=drag_from+ei.drag_size-control->get_minimum_size(); - } - - drag=DRAG_ALL; - drag_from=click; - update(); - } - - } - - if (p_event.type==InputEvent::MOUSE_MOTION) { - - const InputEventMouseMotion &m=p_event.mouse_motion; - - if (drag==DRAG_NONE || !current_window) - return; - - for(ControlMap::Element *E=controls.front();E;E=E->next()) { - - Control *control = E->key(); - Point2 control_drag_pos=E->get().drag_pos; - Point2 control_drag_size=E->get().drag_size; - Point2 control_drag_limit=E->get().drag_limit; - - Point2 pos=Point2(m.x,m.y); - pos = transform.affine_inverse().xform(pos); - - switch(drag) { - case DRAG_ALL: { - - control->set_pos( snapify(control_drag_pos+(pos-drag_from)) ); - } break; - case DRAG_RIGHT: { - - control->set_size( snapify(Size2(control_drag_size.width+(pos-drag_from).x,control_drag_size.height)) ); - } break; - case DRAG_BOTTOM: { - - control->set_size( snapify(Size2(control_drag_size.width,control_drag_size.height+(pos-drag_from).y)) ); - } break; - case DRAG_BOTTOM_RIGHT: { - - control->set_size( snapify(control_drag_size+(pos-drag_from)) ); - } break; - case DRAG_TOP_LEFT: { - - if(pos.x>control_drag_limit.x) - pos.x=control_drag_limit.x; - if(pos.y>control_drag_limit.y) - pos.y=control_drag_limit.y; - - Point2 old_size = control->get_size(); - Point2 new_pos = snapify(control_drag_pos+(pos-drag_from)); - Point2 new_size = old_size + (control->get_pos() - new_pos); - - control->set_pos( new_pos ); - control->set_size( new_size ); - } break; - case DRAG_TOP: { - - if(pos.y>control_drag_limit.y) - pos.y=control_drag_limit.y; - - Point2 old_size = control->get_size(); - Point2 new_pos = snapify(control_drag_pos+Point2(0,pos.y-drag_from.y)); - Point2 new_size = old_size + (control->get_pos() - new_pos); - - control->set_pos( new_pos ); - control->set_size( new_size ); - } break; - case DRAG_LEFT: { - - if(pos.x>control_drag_limit.x) - pos.x=control_drag_limit.x; - - Point2 old_size = control->get_size(); - Point2 new_pos = snapify(control_drag_pos+Point2(pos.x-drag_from.x,0)); - Point2 new_size = old_size + (control->get_pos() - new_pos); - - control->set_pos( new_pos ); - control->set_size( new_size ); - - } break; - case DRAG_TOP_RIGHT: { - - if(pos.y>control_drag_limit.y) - pos.y=control_drag_limit.y; - - Point2 old_size = control->get_size(); - Point2 new_pos = snapify(control_drag_pos+Point2(0,pos.y-drag_from.y)); - - float new_size_y = Point2( old_size + (control->get_pos() - new_pos)).y; - float new_size_x = snapify(control_drag_size+Point2(pos.x-drag_from.x,0)).x; - - control->set_pos( new_pos ); - control->set_size( Point2(new_size_x, new_size_y) ); - } break; - case DRAG_BOTTOM_LEFT: { - - if(pos.x>control_drag_limit.x) - pos.x=control_drag_limit.x; - - Point2 old_size = control->get_size(); - Point2 new_pos = snapify(control_drag_pos+Point2(pos.x-drag_from.x,0)); - - float new_size_y = snapify(control_drag_size+Point2(0,pos.y-drag_from.y)).y; - float new_size_x = Point2( old_size + (control->get_pos() - new_pos)).x; - - control->set_pos( new_pos ); - control->set_size( Point2(new_size_x, new_size_y) ); - - - } break; - - default:{} - } - } - } - - if (p_event.type==InputEvent::KEY) { - - const InputEventKey &k=p_event.key; - - if (k.pressed) { - - if (k.scancode==KEY_UP) - _key_move(Vector2(0,-1),k.mod.shift); - else if (k.scancode==KEY_DOWN) - _key_move(Vector2(0,1),k.mod.shift); - else if (k.scancode==KEY_LEFT) - _key_move(Vector2(-1,0),k.mod.shift); - else if (k.scancode==KEY_RIGHT) - _key_move(Vector2(1,0),k.mod.shift); - } - - } - - -} - - -bool ControlEditor::get_remove_list(List<Node*> *p_list) { - - for(ControlMap::Element *E=controls.front();E;E=E->next()) { - - p_list->push_back(E->key()); - } - - return !p_list->empty(); -} - -void ControlEditor::_update_scroll(float) { - - if (updating_scroll) - return; - - if (!current_window) - return; - - Point2 ofs; - ofs.x=h_scroll->get_val(); - ofs.y=v_scroll->get_val(); - -// current_window->set_scroll(-ofs); - - transform=Matrix32(); - - transform.scale_basis(Size2(zoom,zoom)); - transform.elements[2]=-ofs*zoom; - - - RID viewport = editor->get_scene_root()->get_viewport(); - - VisualServer::get_singleton()->viewport_set_global_canvas_transform(viewport,transform); - - update(); - -} - -void ControlEditor::_notification(int p_what) { - - if (p_what==NOTIFICATION_PROCESS) { - - for(ControlMap::Element *E=controls.front();E;E=E->next()) { - - Control *control = E->key(); - Rect2 r=control->get_window_rect(); - if (r != E->get().last_rect ) { - update(); - E->get().last_rect=r; - } - } - - } - - if (p_what==NOTIFICATION_CHILDREN_CONFIGURED) { - - get_scene()->connect("node_removed",this,"_node_removed"); - } - - if (p_what==NOTIFICATION_DRAW) { - - // TODO fetch the viewport? - /* - if (!control) { - h_scroll->hide(); - v_scroll->hide(); - return; - } - */ - _update_scrollbars(); - - if (!current_window) - return; - - for(ControlMap::Element *E=controls.front();E;E=E->next()) { - - Control *control = E->key(); - - Rect2 rect=control->get_window_rect(); - RID ci=get_canvas_item(); - VisualServer::get_singleton()->canvas_item_set_clip(ci,true); - Point2 ofs=Point2();//get_global_pos(); - Rect2 draw_rect=Rect2(rect.pos-ofs,rect.size); - draw_rect.pos = transform.xform(draw_rect.pos); - Color light_edit_color=Color(1.0,0.8,0.8); - Color dark_edit_color=Color(0.4,0.1,0.1); - Size2 handle_size=Size2(handle_len,handle_len); - -#define DRAW_RECT( m_rect, m_color )\ -VisualServer::get_singleton()->canvas_item_add_rect(ci,m_rect,m_color); - -#define DRAW_EMPTY_RECT( m_rect, m_color )\ - DRAW_RECT( Rect2(m_rect.pos,Size2(m_rect.size.width,1)), m_color );\ - DRAW_RECT(Rect2(Point2(m_rect.pos.x,m_rect.pos.y+m_rect.size.height-1),Size2(m_rect.size.width,1)), m_color);\ - DRAW_RECT(Rect2(m_rect.pos,Size2(1,m_rect.size.height)), m_color);\ - DRAW_RECT(Rect2(Point2(m_rect.pos.x+m_rect.size.width-1,m_rect.pos.y),Size2(1,m_rect.size.height)), m_color); - -#define DRAW_BORDER_RECT( m_rect, m_border_color,m_color )\ - DRAW_RECT( m_rect, m_color );\ - DRAW_EMPTY_RECT( m_rect, m_border_color ); - - DRAW_EMPTY_RECT( draw_rect.grow(2), light_edit_color ); - DRAW_EMPTY_RECT( draw_rect.grow(1), dark_edit_color ); - - if (controls.size()==1) { - DRAW_BORDER_RECT( Rect2(draw_rect.pos-handle_size,handle_size), light_edit_color,dark_edit_color ); - DRAW_BORDER_RECT( Rect2(draw_rect.pos+draw_rect.size,handle_size), light_edit_color,dark_edit_color ); - DRAW_BORDER_RECT( Rect2(draw_rect.pos+Point2(draw_rect.size.width,-handle_size.y),handle_size), light_edit_color,dark_edit_color ); - DRAW_BORDER_RECT( Rect2(draw_rect.pos+Point2(-handle_size.x,draw_rect.size.height),handle_size), light_edit_color,dark_edit_color ); - - DRAW_BORDER_RECT( Rect2(draw_rect.pos+Point2(Math::floor((draw_rect.size.width-handle_size.x)/2.0),-handle_size.height),handle_size), light_edit_color,dark_edit_color ); - DRAW_BORDER_RECT( Rect2(draw_rect.pos+Point2(-handle_size.width,Math::floor((draw_rect.size.height-handle_size.y)/2.0)),handle_size), light_edit_color,dark_edit_color ); - DRAW_BORDER_RECT( Rect2(draw_rect.pos+Point2(Math::floor((draw_rect.size.width-handle_size.x)/2.0),draw_rect.size.height),handle_size), light_edit_color,dark_edit_color ); - DRAW_BORDER_RECT( Rect2(draw_rect.pos+Point2(draw_rect.size.width,Math::floor((draw_rect.size.height-handle_size.y)/2.0)),handle_size), light_edit_color,dark_edit_color ); - } - - //DRAW_EMPTY_RECT( Rect2( current_window->get_scroll()-Point2(1,1), get_size()+Size2(2,2)), Color(0.8,0.8,1.0,0.8) ); - E->get().last_rect = rect; - } - } -} - -void ControlEditor::edit(Control *p_control) { - - drag=DRAG_NONE; - - _clear_controls(); - _add_control(p_control,EditInfo()); - current_window=p_control->get_window(); - update(); - -} - - -void ControlEditor::_find_controls_span(Node *p_node, Rect2& r_rect) { - - if (!editor->get_scene()) - return; - - if (p_node!=editor->get_edited_scene() && p_node->get_owner()!=editor->get_edited_scene()) - return; - - if (p_node->cast_to<Control>()) { - Control *c = p_node->cast_to<Control>(); - if (c->get_viewport() != editor->get_viewport()->get_viewport()) - return; //bye, it's in another viewport - - if (!c->get_parent_control()) { - - Rect2 span = c->get_subtree_span_rect(); - r_rect.merge(span); - } - } - - for(int i=0;i<p_node->get_child_count();i++) { - - _find_controls_span(p_node->get_child(i),r_rect); - } -} - -void ControlEditor::_update_scrollbars() { - - - if (!editor->get_scene()) { - h_scroll->hide(); - v_scroll->hide(); - return; - } - - updating_scroll=true; - - - Size2 size = get_size(); - Size2 hmin = h_scroll->get_minimum_size(); - Size2 vmin = v_scroll->get_minimum_size(); - - v_scroll->set_begin( Point2(size.width - vmin.width, 0) ); - v_scroll->set_end( Point2(size.width, size.height) ); - - h_scroll->set_begin( Point2( 0, size.height - hmin.height) ); - h_scroll->set_end( Point2(size.width-vmin.width, size.height) ); - - - Rect2 local_rect = Rect2(Point2(),get_size()-Size2(vmin.width,hmin.height)); - - Rect2 control_rect=local_rect; - if (editor->get_edited_scene()) - _find_controls_span(editor->get_edited_scene(),control_rect); - control_rect.pos*=zoom; - control_rect.size*=zoom; - - /* - for(ControlMap::Element *E=controls.front();E;E=E->next()) { - - Control *control = E->key(); - Rect2 r = control->get_window()->get_subtree_span_rect(); - if (E==controls.front()) { - control_rect = r.merge(local_rect); - } else { - control_rect = control_rect.merge(r); - } - } - - */ - Point2 ofs; - - - if (control_rect.size.height <= local_rect.size.height) { - - v_scroll->hide(); - ofs.y=0; - } else { - - v_scroll->show(); - v_scroll->set_min(control_rect.pos.y); - v_scroll->set_max(control_rect.pos.y+control_rect.size.y); - v_scroll->set_page(local_rect.size.y); - ofs.y=-v_scroll->get_val(); - } - - if (control_rect.size.width <= local_rect.size.width) { - - h_scroll->hide(); - ofs.x=0; - } else { - - h_scroll->show(); - h_scroll->set_min(control_rect.pos.x); - h_scroll->set_max(control_rect.pos.x+control_rect.size.x); - h_scroll->set_page(local_rect.size.x); - ofs.x=-h_scroll->get_val(); - } - -// transform=Matrix32(); - transform.elements[2]=ofs*zoom; - RID viewport = editor->get_scene_root()->get_viewport(); - VisualServer::get_singleton()->viewport_set_global_canvas_transform(viewport,transform); - -// transform.scale_basis(Vector2(zoom,zoom)); - updating_scroll=false; - -} - - -Point2i ControlEditor::snapify(const Point2i& p_pos) const { - - bool active=popup->is_item_checked(0); - int snap = snap_val->get_text().to_int(); - - if (!active || snap<1) - return p_pos; - - Point2i pos=p_pos; - pos.x-=pos.x%snap; - pos.y-=pos.y%snap; - return pos; - - -} -void ControlEditor::_popup_callback(int p_op) { - - switch(p_op) { - - case SNAP_USE: { - - popup->set_item_checked(0,!popup->is_item_checked(0)); - } break; - case SNAP_CONFIGURE: { - snap_dialog->popup_centered(Size2(200,85)); - } break; - } -} - -void ControlEditor::_bind_methods() { - - ObjectTypeDB::bind_method("_input_event",&ControlEditor::_input_event); - ObjectTypeDB::bind_method("_node_removed",&ControlEditor::_node_removed); - ObjectTypeDB::bind_method("_update_scroll",&ControlEditor::_update_scroll); - ObjectTypeDB::bind_method("_popup_callback",&ControlEditor::_popup_callback); - ObjectTypeDB::bind_method("_visibility_changed",&ControlEditor::_visibility_changed); -} - -ControlEditor::ControlEditor(EditorNode *p_editor) { - - editor=p_editor; - h_scroll = memnew( HScrollBar ); - v_scroll = memnew( VScrollBar ); - - add_child(h_scroll); - add_child(v_scroll); - h_scroll->connect("value_changed", this,"_update_scroll",Vector<Variant>(),true); - v_scroll->connect("value_changed", this,"_update_scroll",Vector<Variant>(),true); - - - updating_scroll=false; - set_focus_mode(FOCUS_ALL); - handle_len=10; - - popup=memnew( PopupMenu ); - popup->add_check_item("Use Snap"); - popup->add_item("Configure Snap.."); - add_child(popup); - - snap_dialog = memnew( ConfirmationDialog ); - snap_dialog->get_ok()->hide(); - snap_dialog->get_cancel()->set_text("Close"); - add_child(snap_dialog); - - Label *l = memnew(Label); - l->set_text("Snap:"); - l->set_pos(Point2(5,5)); - snap_dialog->add_child(l); - - snap_val=memnew(LineEdit); - snap_val->set_text("5"); - snap_val->set_anchor(MARGIN_RIGHT,ANCHOR_END); - snap_val->set_begin(Point2(15,25)); - snap_val->set_end(Point2(10,25)); - snap_dialog->add_child(snap_val); - - popup->connect("item_pressed", this,"_popup_callback"); - current_window=NULL; - - zoom=0.5; -} - - -void ControlEditorPlugin::edit(Object *p_object) { - - control_editor->set_undo_redo(&get_undo_redo()); - control_editor->edit(p_object->cast_to<Control>()); -} - -bool ControlEditorPlugin::handles(Object *p_object) const { - - return p_object->is_type("Control"); -} - -void ControlEditorPlugin::make_visible(bool p_visible) { - - if (p_visible) { - control_editor->show(); - control_editor->set_process(true); - } else { - - control_editor->hide(); - control_editor->set_process(false); - } - -} - -ControlEditorPlugin::ControlEditorPlugin(EditorNode *p_node) { - - editor=p_node; - control_editor = memnew( ControlEditor(editor) ); - editor->get_viewport()->add_child(control_editor); - control_editor->set_area_as_parent_rect(); - control_editor->hide(); - - - -} - - -ControlEditorPlugin::~ControlEditorPlugin() -{ -} - - -#endif diff --git a/tools/editor/plugins/control_editor_plugin.h b/tools/editor/plugins/control_editor_plugin.h deleted file mode 100644 index 6234698ee8..0000000000 --- a/tools/editor/plugins/control_editor_plugin.h +++ /dev/null @@ -1,141 +0,0 @@ -/*************************************************************************/ -/* control_editor_plugin.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef CONTROL_EDITOR_PLUGIN_H -#define CONTROL_EDITOR_PLUGIN_H - -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - -#if 0 -class ControlEditor : public Control { - - OBJ_TYPE(ControlEditor, Control ); - - EditorNode *editor; - - enum { - SNAP_USE, - SNAP_CONFIGURE - }; - - enum DragType { - DRAG_NONE, - DRAG_LEFT, - DRAG_TOP_LEFT, - DRAG_TOP, - DRAG_TOP_RIGHT, - DRAG_RIGHT, - DRAG_BOTTOM_RIGHT, - DRAG_BOTTOM, - DRAG_BOTTOM_LEFT, - DRAG_ALL - }; - - HScrollBar *h_scroll; - VScrollBar *v_scroll; - - Matrix32 transform; - float zoom; - - Control *current_window; - PopupMenu *popup; - DragType drag; - Point2 drag_from; - - struct EditInfo { - - Point2 drag_pos; - Point2 drag_size; - Point2 drag_limit; - Rect2 last_rect; - }; - - typedef Map<Control*,EditInfo> ControlMap; - ControlMap controls; - int handle_len; - Control* _select_control_at_pos(const Point2& p_pos,Node* p_node); - - ConfirmationDialog *snap_dialog; - LineEdit *snap_val; - - void _add_control(Control *p_control,const EditInfo& p_info); - void _remove_control(Control *p_control); - void _clear_controls(); - void _visibility_changed(ObjectID p_control); - void _key_move(const Vector2& p_dir, bool p_snap); - - - Point2i snapify(const Point2i& p_pos) const; - void _popup_callback(int p_op); - bool updating_scroll; - void _update_scroll(float); - void _update_scrollbars(); - UndoRedo *undo_redo; - - void _find_controls_span(Node *p_node, Rect2& r_rect); - -protected: - void _notification(int p_what); - void _input_event(InputEvent p_event); - void _node_removed(Node *p_node); - static void _bind_methods(); -public: - - bool get_remove_list(List<Node*> *p_list); - void set_undo_redo(UndoRedo *p_undo_redo) {undo_redo=p_undo_redo; } - void edit(Control *p_control); - ControlEditor(EditorNode *p_editor); -}; - -class ControlEditorPlugin : public EditorPlugin { - - OBJ_TYPE( ControlEditorPlugin, EditorPlugin ); - - ControlEditor *control_editor; - EditorNode *editor; - -public: - - virtual String get_name() const { return "GUI"; } - bool has_main_screen() const { return true; } - virtual void edit(Object *p_object); - virtual bool handles(Object *p_object) const; - virtual void make_visible(bool p_visible); - virtual bool get_remove_list(List<Node*> *p_list) { return control_editor->get_remove_list(p_list); } - - - ControlEditorPlugin(EditorNode *p_node); - ~ControlEditorPlugin(); - -}; -#endif -#endif diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp index 300e35f94d..f5470451ba 100644 --- a/tools/editor/plugins/editor_preview_plugins.cpp +++ b/tools/editor/plugins/editor_preview_plugins.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_preview_plugins.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "editor_preview_plugins.h" #include "io/resource_loader.h" #include "tools/editor/editor_settings.h" diff --git a/tools/editor/plugins/editor_preview_plugins.h b/tools/editor/plugins/editor_preview_plugins.h index b3bfda8045..b33aefaa23 100644 --- a/tools/editor/plugins/editor_preview_plugins.h +++ b/tools/editor/plugins/editor_preview_plugins.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_preview_plugins.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef EDITORPREVIEWPLUGINS_H #define EDITORPREVIEWPLUGINS_H diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp index bf3b2fa68d..14e7b14fc3 100644 --- a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* light_occluder_2d_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "light_occluder_2d_editor_plugin.h" #include "canvas_item_editor_plugin.h" diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.h b/tools/editor/plugins/light_occluder_2d_editor_plugin.h index 5fb5631d05..b570fff506 100644 --- a/tools/editor/plugins/light_occluder_2d_editor_plugin.h +++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* light_occluder_2d_editor_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef LIGHT_OCCLUDER_2D_EDITOR_PLUGIN_H #define LIGHT_OCCLUDER_2D_EDITOR_PLUGIN_H diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/tools/editor/plugins/mesh_editor_plugin.cpp index 51a436e58d..71cf33ba1b 100644 --- a/tools/editor/plugins/mesh_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_editor_plugin.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* mesh_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "mesh_editor_plugin.h" void MeshEditor::_input_event(InputEvent p_event) { diff --git a/tools/editor/plugins/mesh_editor_plugin.h b/tools/editor/plugins/mesh_editor_plugin.h index 190dfca464..0715a96e74 100644 --- a/tools/editor/plugins/mesh_editor_plugin.h +++ b/tools/editor/plugins/mesh_editor_plugin.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* mesh_editor_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef MESH_EDITOR_PLUGIN_H #define MESH_EDITOR_PLUGIN_H diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp index 1ee388ca18..5a8cd8791e 100644 --- a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* navigation_polygon_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "navigation_polygon_editor_plugin.h" #include "canvas_item_editor_plugin.h" diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.h b/tools/editor/plugins/navigation_polygon_editor_plugin.h index f742cb011d..503b4c2662 100644 --- a/tools/editor/plugins/navigation_polygon_editor_plugin.h +++ b/tools/editor/plugins/navigation_polygon_editor_plugin.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* navigation_polygon_editor_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef NAVIGATIONPOLYGONEDITORPLUGIN_H #define NAVIGATIONPOLYGONEDITORPLUGIN_H diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp index 107ec30a91..95f330a1d5 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.cpp +++ b/tools/editor/plugins/path_2d_editor_plugin.cpp @@ -633,35 +633,35 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { sep = memnew( VSeparator); base_hb->add_child(sep); curve_edit = memnew( ToolButton ); - curve_edit->set_icon(CanvasItemEditor::get_singleton()->get_icon("CurveEdit","EditorIcons")); + curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveEdit","EditorIcons")); curve_edit->set_toggle_mode(true); curve_edit->set_focus_mode(Control::FOCUS_NONE); curve_edit->set_tooltip(TTR("Select Points")+"\n"+TTR("Shift+Drag: Select Control Points")+"\n"+keycode_get_string(KEY_MASK_CMD)+TTR("Click: Add Point")+"\n"+TTR("Right Click: Delete Point")); curve_edit->connect("pressed",this,"_mode_selected",varray(MODE_EDIT)); base_hb->add_child(curve_edit); curve_edit_curve = memnew( ToolButton ); - curve_edit_curve->set_icon(CanvasItemEditor::get_singleton()->get_icon("CurveCurve","EditorIcons")); + curve_edit_curve->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCurve","EditorIcons")); curve_edit_curve->set_toggle_mode(true); curve_edit_curve->set_focus_mode(Control::FOCUS_NONE); curve_edit_curve->set_tooltip(TTR("Select Control Points (Shift+Drag)")); curve_edit_curve->connect("pressed",this,"_mode_selected",varray(MODE_EDIT_CURVE)); base_hb->add_child(curve_edit_curve); curve_create = memnew( ToolButton ); - curve_create->set_icon(CanvasItemEditor::get_singleton()->get_icon("CurveCreate","EditorIcons")); + curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate","EditorIcons")); curve_create->set_toggle_mode(true); curve_create->set_focus_mode(Control::FOCUS_NONE); curve_create->set_tooltip(TTR("Add Point (in empty space)")+"\n"+TTR("Split Segment (in curve)")); curve_create->connect("pressed",this,"_mode_selected",varray(MODE_CREATE)); base_hb->add_child(curve_create); curve_del = memnew( ToolButton ); - curve_del->set_icon(CanvasItemEditor::get_singleton()->get_icon("CurveDelete","EditorIcons")); + curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete","EditorIcons")); curve_del->set_toggle_mode(true); curve_del->set_focus_mode(Control::FOCUS_NONE); curve_del->set_tooltip(TTR("Delete Point")); curve_del->connect("pressed",this,"_mode_selected",varray(MODE_DELETE)); base_hb->add_child(curve_del); curve_close = memnew( ToolButton ); - curve_close->set_icon(CanvasItemEditor::get_singleton()->get_icon("CurveClose","EditorIcons")); + curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveClose","EditorIcons")); curve_close->set_focus_mode(Control::FOCUS_NONE); curve_close->set_tooltip(TTR("Close Curve")); curve_close->connect("pressed",this,"_mode_selected",varray(ACTION_CLOSE)); diff --git a/tools/editor/plugins/path_editor_plugin.cpp b/tools/editor/plugins/path_editor_plugin.cpp index d7cc2bd157..33ef71efab 100644 --- a/tools/editor/plugins/path_editor_plugin.cpp +++ b/tools/editor/plugins/path_editor_plugin.cpp @@ -542,28 +542,28 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { sep->hide(); SpatialEditor::get_singleton()->add_control_to_menu_panel(sep); curve_edit = memnew( ToolButton ); - curve_edit->set_icon(SpatialEditor::get_singleton()->get_icon("CurveEdit","EditorIcons")); + curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveEdit","EditorIcons")); curve_edit->set_toggle_mode(true); curve_edit->hide(); curve_edit->set_focus_mode(Control::FOCUS_NONE); curve_edit->set_tooltip(TTR("Select Points")+"\n"+TTR("Shift+Drag: Select Control Points")+"\n"+keycode_get_string(KEY_MASK_CMD)+TTR("Click: Add Point")+"\n"+TTR("Right Click: Delete Point")); SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_edit); curve_create = memnew( ToolButton ); - curve_create->set_icon(SpatialEditor::get_singleton()->get_icon("CurveCreate","EditorIcons")); + curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate","EditorIcons")); curve_create->set_toggle_mode(true); curve_create->hide(); curve_create->set_focus_mode(Control::FOCUS_NONE); curve_create->set_tooltip(TTR("Add Point (in empty space)")+"\n"+TTR("Split Segment (in curve)")); SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_create); curve_del = memnew( ToolButton ); - curve_del->set_icon(SpatialEditor::get_singleton()->get_icon("CurveDelete","EditorIcons")); + curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete","EditorIcons")); curve_del->set_toggle_mode(true); curve_del->hide(); curve_del->set_focus_mode(Control::FOCUS_NONE); curve_del->set_tooltip(TTR("Delete Point")); SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_del); curve_close = memnew( ToolButton ); - curve_close->set_icon(SpatialEditor::get_singleton()->get_icon("CurveClose","EditorIcons")); + curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveClose","EditorIcons")); curve_close->hide(); curve_close->set_focus_mode(Control::FOCUS_NONE); curve_close->set_tooltip(TTR("Close Curve")); diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp index f873b43fd9..d78508c429 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_polygon_editor_plugin.cpp */ +/* polygon_2d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.h b/tools/editor/plugins/polygon_2d_editor_plugin.h index 0939c44264..d8b951ec44 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.h +++ b/tools/editor/plugins/polygon_2d_editor_plugin.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* polygon_2d_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef POLYGON_2D_EDITOR_PLUGIN_H #define POLYGON_2D_EDITOR_PLUGIN_H diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 8d00f2cd8a..a313b0053a 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -2147,12 +2147,17 @@ void ScriptEditor::save_all_scripts() { continue; Ref<Script> script = ste->get_edited_script(); + if (script.is_valid()) + ste->apply_code(); + if (script->get_path()!="" && script->get_path().find("local://")==-1 &&script->get_path().find("::")==-1) { //external script, save it - ste->apply_code(); + editor->save_resource(script); //ResourceSaver::save(script->get_path(),script); + } + } } @@ -2273,6 +2278,8 @@ void ScriptEditor::_editor_settings_changed() { ste->get_text_edit()->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter")); } + ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true)); + } void ScriptEditor::_autosave_scripts() { @@ -2496,6 +2503,51 @@ void ScriptEditor::set_scene_root_script( Ref<Script> p_script ) { } } +bool ScriptEditor::script_go_to_method(Ref<Script> p_script, const String& p_method) { + + Vector<String> functions; + bool found=false; + + for (int i=0;i<tab_container->get_child_count();i++) { + ScriptTextEditor *current = tab_container->get_child(i)->cast_to<ScriptTextEditor>(); + + if (current && current->get_edited_script()==p_script) { + functions=current->get_functions(); + found=true; + break; + } + } + + if (!found) { + String errortxt; + int line=-1,col; + String text=p_script->get_source_code(); + List<String> fnc; + + if (p_script->get_language()->validate(text,line,col,errortxt,p_script->get_path(),&fnc)) { + + for (List<String>::Element *E=fnc.front();E;E=E->next()) + functions.push_back(E->get()); + } + } + + String method_search = p_method + ":"; + + for (int i=0;i<functions.size();i++) { + String function=functions[i]; + + if (function.begins_with(method_search)) { + + edit(p_script); + int line=function.get_slice(":",1).to_int(); + _goto_script_line2(line-1); + return true; + } + } + + return false; +} + void ScriptEditor::set_live_auto_reload_running_scripts(bool p_enabled) { auto_reload_running_scripts=p_enabled; @@ -2568,73 +2620,72 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu = memnew( MenuButton ); menu_hb->add_child(file_menu); file_menu->set_text(TTR("File")); - file_menu->get_popup()->add_item(TTR("New"),FILE_NEW); - file_menu->get_popup()->add_item(TTR("Open"),FILE_OPEN); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new", TTR("New")), FILE_NEW); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/open", TTR("Open")), FILE_OPEN); file_menu->get_popup()->add_separator(); - file_menu->get_popup()->add_item(TTR("Save"),FILE_SAVE,KEY_MASK_ALT|KEY_MASK_CMD|KEY_S); - file_menu->get_popup()->add_item(TTR("Save As.."),FILE_SAVE_AS); - file_menu->get_popup()->add_item(TTR("Save All"),FILE_SAVE_ALL,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_S); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save", TTR("Save"), KEY_MASK_ALT|KEY_MASK_CMD|KEY_S), FILE_SAVE); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_as", TTR("Save As..")), FILE_SAVE_AS); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_all", TTR("Save All"), KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_S), FILE_SAVE_ALL); file_menu->get_popup()->add_separator(); - file_menu->get_popup()->add_item(TTR("History Prev"),WINDOW_PREV,KEY_MASK_CTRL|KEY_MASK_ALT|KEY_LEFT); - file_menu->get_popup()->add_item(TTR("History Next"),WINDOW_NEXT,KEY_MASK_CTRL|KEY_MASK_ALT|KEY_RIGHT); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/history_previous", TTR("History Prev"), KEY_MASK_CTRL|KEY_MASK_ALT|KEY_LEFT), WINDOW_PREV); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/history_next", TTR("History Next"), KEY_MASK_CTRL|KEY_MASK_ALT|KEY_RIGHT), WINDOW_NEXT); file_menu->get_popup()->add_separator(); - file_menu->get_popup()->add_item(TTR("Import Theme"), FILE_IMPORT_THEME); - file_menu->get_popup()->add_item(TTR("Reload Theme"), FILE_RELOAD_THEME); - file_menu->get_popup()->add_item(TTR("Save Theme"), FILE_SAVE_THEME); - file_menu->get_popup()->add_item(TTR("Save Theme As"), FILE_SAVE_THEME_AS); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/import_theme", TTR("Import Theme")), FILE_IMPORT_THEME); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/reload_theme", TTR("Reload Theme")), FILE_RELOAD_THEME); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_theme", TTR("Save Theme")), FILE_SAVE_THEME); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_theme_as", TTR("Save Theme As")), FILE_SAVE_THEME_AS); file_menu->get_popup()->add_separator(); - file_menu->get_popup()->add_item(TTR("Close"),FILE_CLOSE,KEY_MASK_CMD|KEY_W); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD|KEY_W), FILE_CLOSE); file_menu->get_popup()->connect("item_pressed", this,"_menu_option"); edit_menu = memnew( MenuButton ); menu_hb->add_child(edit_menu); edit_menu->set_text(TTR("Edit")); - edit_menu->get_popup()->add_item(TTR("Undo"),EDIT_UNDO,KEY_MASK_CMD|KEY_Z); - edit_menu->get_popup()->add_item(TTR("Redo"),EDIT_REDO,KEY_MASK_CMD|KEY_Y); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/undo", TTR("Undo"), KEY_MASK_CMD|KEY_Z), EDIT_UNDO); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/redo", TTR("Redo"), KEY_MASK_CMD|KEY_Y), EDIT_REDO); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item(TTR("Cut"),EDIT_CUT,KEY_MASK_CMD|KEY_X); - edit_menu->get_popup()->add_item(TTR("Copy"),EDIT_COPY,KEY_MASK_CMD|KEY_C); - edit_menu->get_popup()->add_item(TTR("Paste"),EDIT_PASTE,KEY_MASK_CMD|KEY_V); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/cut", TTR("Cut"), KEY_MASK_CMD|KEY_X), EDIT_CUT); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/copy", TTR("Copy"), KEY_MASK_CMD|KEY_C), EDIT_COPY); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/paste", TTR("Paste"), KEY_MASK_CMD|KEY_V), EDIT_PASTE); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item(TTR("Select All"),EDIT_SELECT_ALL,KEY_MASK_CMD|KEY_A); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/select_all", TTR("Select All"), KEY_MASK_CMD|KEY_A), EDIT_SELECT_ALL); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item(TTR("Move Up"),EDIT_MOVE_LINE_UP,KEY_MASK_ALT|KEY_UP); - edit_menu->get_popup()->add_item(TTR("Move Down"),EDIT_MOVE_LINE_DOWN,KEY_MASK_ALT|KEY_DOWN); - edit_menu->get_popup()->add_item(TTR("Indent Left"),EDIT_INDENT_LEFT,KEY_MASK_ALT|KEY_LEFT); - edit_menu->get_popup()->add_item(TTR("Indent Right"),EDIT_INDENT_RIGHT,KEY_MASK_ALT|KEY_RIGHT); - edit_menu->get_popup()->add_item(TTR("Toggle Comment"),EDIT_TOGGLE_COMMENT,KEY_MASK_CMD|KEY_K); - edit_menu->get_popup()->add_item(TTR("Clone Down"),EDIT_CLONE_DOWN,KEY_MASK_CMD|KEY_B); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/move_up", TTR("Move Up"), KEY_MASK_ALT|KEY_UP), EDIT_MOVE_LINE_UP); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/move_down", TTR("Move Down"), KEY_MASK_ALT|KEY_DOWN), EDIT_MOVE_LINE_DOWN); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/indent_left", TTR("Indent Left"), KEY_MASK_ALT|KEY_LEFT), EDIT_INDENT_LEFT); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/indent_right", TTR("Indent Right"), KEY_MASK_ALT|KEY_RIGHT), EDIT_INDENT_RIGHT); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_comment", TTR("Toggle Comment"), KEY_MASK_CMD|KEY_K), EDIT_TOGGLE_COMMENT); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/clone_down", TTR("Clone Down"), KEY_MASK_CMD|KEY_B), EDIT_CLONE_DOWN); edit_menu->get_popup()->add_separator(); #ifdef OSX_ENABLED - edit_menu->get_popup()->add_item(TTR("Complete Symbol"),EDIT_COMPLETE,KEY_MASK_CTRL|KEY_SPACE); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CTRL|KEY_SPACE), EDIT_COMPLETE); #else - edit_menu->get_popup()->add_item(TTR("Complete Symbol"),EDIT_COMPLETE,KEY_MASK_CMD|KEY_SPACE); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CMD|KEY_SPACE), EDIT_COMPLETE); #endif - edit_menu->get_popup()->add_item(TTR("Trim Trailing Whitespace"), EDIT_TRIM_TRAILING_WHITESAPCE, KEY_MASK_CTRL|KEY_MASK_ALT|KEY_T); - edit_menu->get_popup()->add_item(TTR("Auto Indent"),EDIT_AUTO_INDENT,KEY_MASK_CMD|KEY_I); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/trim_trailing_whitespace", TTR("Trim Trailing Whitespace"), KEY_MASK_CTRL|KEY_MASK_ALT|KEY_T), EDIT_TRIM_TRAILING_WHITESAPCE); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/auto_indent", TTR("Auto Indent"), KEY_MASK_CMD|KEY_I), EDIT_AUTO_INDENT); edit_menu->get_popup()->connect("item_pressed", this,"_menu_option"); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item(TTR("Reload Tool Script"),FILE_TOOL_RELOAD,KEY_MASK_CMD|KEY_R); - edit_menu->get_popup()->add_item(TTR("Reload Tool Script (Soft)"),FILE_TOOL_RELOAD_SOFT,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_R); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/reload_script_soft", TTR("Soft Reload Script"), KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_R), FILE_TOOL_RELOAD_SOFT); search_menu = memnew( MenuButton ); menu_hb->add_child(search_menu); search_menu->set_text(TTR("Search")); - search_menu->get_popup()->add_item(TTR("Find.."),SEARCH_FIND,KEY_MASK_CMD|KEY_F); - search_menu->get_popup()->add_item(TTR("Find Next"),SEARCH_FIND_NEXT,KEY_F3); - search_menu->get_popup()->add_item(TTR("Find Previous"),SEARCH_FIND_PREV,KEY_MASK_SHIFT|KEY_F3); - search_menu->get_popup()->add_item(TTR("Replace.."),SEARCH_REPLACE,KEY_MASK_CMD|KEY_R); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find.."), KEY_MASK_CMD|KEY_F), SEARCH_FIND); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), KEY_F3), SEARCH_FIND_NEXT); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_previous", TTR("Find Previous"), KEY_MASK_SHIFT|KEY_F3), SEARCH_FIND_PREV); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/replace", TTR("Replace.."), KEY_MASK_CMD|KEY_R), SEARCH_REPLACE); search_menu->get_popup()->add_separator(); - search_menu->get_popup()->add_item(TTR("Goto Function.."),SEARCH_LOCATE_FUNCTION,KEY_MASK_SHIFT|KEY_MASK_CMD|KEY_F); - search_menu->get_popup()->add_item(TTR("Goto Line.."),SEARCH_GOTO_LINE,KEY_MASK_CMD|KEY_L); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_function", TTR("Goto Function.."), KEY_MASK_SHIFT|KEY_MASK_CMD|KEY_F), SEARCH_LOCATE_FUNCTION); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_line", TTR("Goto Line.."), KEY_MASK_CMD|KEY_L), SEARCH_GOTO_LINE); search_menu->get_popup()->connect("item_pressed", this,"_menu_option"); script_search_menu = memnew( MenuButton ); menu_hb->add_child(script_search_menu); script_search_menu->set_text(TTR("Search")); - script_search_menu->get_popup()->add_item(TTR("Find.."),SEARCH_FIND,KEY_MASK_CMD|KEY_F); - script_search_menu->get_popup()->add_item(TTR("Find Next"),SEARCH_FIND_NEXT,KEY_F3); + script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find.."), KEY_MASK_CMD|KEY_F), SEARCH_FIND); + script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), KEY_F3), SEARCH_FIND_NEXT); script_search_menu->get_popup()->connect("item_pressed", this,"_menu_option"); script_search_menu->hide(); @@ -2642,19 +2693,19 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { debug_menu = memnew( MenuButton ); menu_hb->add_child(debug_menu); debug_menu->set_text(TTR("Debug")); - debug_menu->get_popup()->add_item(TTR("Toggle Breakpoint"),DEBUG_TOGGLE_BREAKPOINT,KEY_F9); - debug_menu->get_popup()->add_item(TTR("Remove All Breakpoints"), DEBUG_REMOVE_ALL_BREAKPOINTS, KEY_MASK_CTRL|KEY_MASK_SHIFT|KEY_F9); - debug_menu->get_popup()->add_item(TTR("Goto Next Breakpoint"), DEBUG_GOTO_NEXT_BREAKPOINT, KEY_MASK_CTRL|KEY_PERIOD); - debug_menu->get_popup()->add_item(TTR("Goto Previous Breakpoint"), DEBUG_GOTO_PREV_BREAKPOINT, KEY_MASK_CTRL|KEY_COMMA); + debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_F9), DEBUG_TOGGLE_BREAKPOINT); + debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/remove_all_breakpoints", TTR("Remove All Breakpoints"), KEY_MASK_CTRL|KEY_MASK_SHIFT|KEY_F9), DEBUG_REMOVE_ALL_BREAKPOINTS); + debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_next_breakpoint", TTR("Goto Next Breakpoint"), KEY_MASK_CTRL|KEY_PERIOD), DEBUG_GOTO_NEXT_BREAKPOINT); + debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_previous_breakpoint", TTR("Goto Previous Breakpoint"), KEY_MASK_CTRL|KEY_COMMA), DEBUG_GOTO_PREV_BREAKPOINT); debug_menu->get_popup()->add_separator(); - debug_menu->get_popup()->add_item(TTR("Step Over"),DEBUG_NEXT,KEY_F10); - debug_menu->get_popup()->add_item(TTR("Step Into"),DEBUG_STEP,KEY_F11); + debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/step_over", TTR("Step Over"), KEY_F10), DEBUG_NEXT); + debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/step_into", TTR("Step Into"), KEY_F11), DEBUG_STEP); debug_menu->get_popup()->add_separator(); - debug_menu->get_popup()->add_item(TTR("Break"),DEBUG_BREAK); - debug_menu->get_popup()->add_item(TTR("Continue"),DEBUG_CONTINUE); + debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/break", TTR("Break")), DEBUG_BREAK); + debug_menu->get_popup()->add_shortcut(ED_SHORTCUT("debugger/continue", TTR("Continue")), DEBUG_CONTINUE); debug_menu->get_popup()->add_separator(); //debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW); - debug_menu->get_popup()->add_check_item(TTR("Keep Debugger Open"),DEBUG_SHOW_KEEP_OPEN); + debug_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("debugger/keep_debugger_open", TTR("Keep Debugger Open")), DEBUG_SHOW_KEEP_OPEN); debug_menu->get_popup()->connect("item_pressed", this,"_menu_option"); debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true); @@ -2679,7 +2730,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { help_menu = memnew( MenuButton ); menu_hb->add_child(help_menu); help_menu->set_text(TTR("Help")); - help_menu->get_popup()->add_item(TTR("Contextual"), HELP_CONTEXTUAL, KEY_MASK_SHIFT|KEY_F1); + help_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/Contextual", TTR("Contextual Help"), KEY_MASK_SHIFT|KEY_F1), HELP_CONTEXTUAL); help_menu->get_popup()->connect("item_pressed", this,"_menu_option"); menu_hb->add_spacer(); @@ -2919,6 +2970,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { script_editor->hide(); EDITOR_DEF("text_editor/auto_reload_scripts_on_external_change",true); + ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true)); EDITOR_DEF("text_editor/open_dominant_script_on_scene_change",true); EDITOR_DEF("external_editor/use_external_editor",false); EDITOR_DEF("external_editor/exec_path",""); @@ -2930,6 +2982,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"external_editor/exec_path",PROPERTY_HINT_GLOBAL_FILE)); EDITOR_DEF("external_editor/exec_flags",""); + } diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h index 5a9dce759e..3d723adfe9 100644 --- a/tools/editor/plugins/script_editor_plugin.h +++ b/tools/editor/plugins/script_editor_plugin.h @@ -325,6 +325,8 @@ public: void set_scene_root_script( Ref<Script> p_script ); + bool script_go_to_method(Ref<Script> p_script, const String& p_method); + virtual void edited_scene_changed(); ScriptEditorDebugger *get_debugger() { return debugger; } diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 61dde9a9ef..f4b294daa5 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -496,14 +496,14 @@ ShaderEditor::ShaderEditor() { add_child(edit_menu); edit_menu->set_pos(Point2(5,-1)); edit_menu->set_text(TTR("Edit")); - edit_menu->get_popup()->add_item(TTR("Undo"),EDIT_UNDO,KEY_MASK_CMD|KEY_Z); - edit_menu->get_popup()->add_item(TTR("Redo"),EDIT_REDO,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_Z); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/undo", TTR("Undo"), KEY_MASK_CMD|KEY_Z), EDIT_UNDO); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/redo", TTR("Redo"), KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_Z), EDIT_REDO); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item(TTR("Cut"),EDIT_CUT,KEY_MASK_CMD|KEY_X); - edit_menu->get_popup()->add_item(TTR("Copy"),EDIT_COPY,KEY_MASK_CMD|KEY_C); - edit_menu->get_popup()->add_item(TTR("Paste"),EDIT_PASTE,KEY_MASK_CMD|KEY_V); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/cut", TTR("Cut"), KEY_MASK_CMD|KEY_X), EDIT_CUT); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/copy", TTR("Copy"), KEY_MASK_CMD|KEY_C), EDIT_COPY); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/paste", TTR("Paste"), KEY_MASK_CMD|KEY_V), EDIT_PASTE); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item(TTR("Select All"),EDIT_SELECT_ALL,KEY_MASK_CMD|KEY_A); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/select_all", TTR("Select All"), KEY_MASK_CMD|KEY_A), EDIT_SELECT_ALL); edit_menu->get_popup()->connect("item_pressed", this,"_menu_option"); @@ -511,13 +511,13 @@ ShaderEditor::ShaderEditor() { add_child(search_menu); search_menu->set_pos(Point2(38,-1)); search_menu->set_text(TTR("Search")); - search_menu->get_popup()->add_item(TTR("Find.."),SEARCH_FIND,KEY_MASK_CMD|KEY_F); - search_menu->get_popup()->add_item(TTR("Find Next"),SEARCH_FIND_NEXT,KEY_F3); - search_menu->get_popup()->add_item(TTR("Find Previous"),SEARCH_FIND_PREV,KEY_MASK_SHIFT|KEY_F3); - search_menu->get_popup()->add_item(TTR("Replace.."),SEARCH_REPLACE,KEY_MASK_CMD|KEY_R); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find.."), KEY_MASK_CMD|KEY_F), SEARCH_FIND); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), KEY_F3), SEARCH_FIND_NEXT); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_previous", TTR("Find Previous"), KEY_MASK_SHIFT|KEY_F3), SEARCH_FIND_PREV); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/replace", TTR("Replace.."), KEY_MASK_CMD|KEY_R), SEARCH_REPLACE); search_menu->get_popup()->add_separator(); // search_menu->get_popup()->add_item("Locate Symbol..",SEARCH_LOCATE_SYMBOL,KEY_MASK_CMD|KEY_K); - search_menu->get_popup()->add_item(TTR("Goto Line.."),SEARCH_GOTO_LINE,KEY_MASK_CMD|KEY_G); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_line", TTR("Goto Line.."), KEY_MASK_CMD|KEY_G), SEARCH_GOTO_LINE); search_menu->get_popup()->connect("item_pressed", this,"_menu_option"); diff --git a/tools/editor/plugins/shader_graph_editor_plugin.h b/tools/editor/plugins/shader_graph_editor_plugin.h index 8d1d08ee1d..67ee5e2d45 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.h +++ b/tools/editor/plugins/shader_graph_editor_plugin.h @@ -33,7 +33,6 @@ #include "tools/editor/editor_plugin.h" #include "tools/editor/editor_node.h" #include "scene/resources/shader.h" -#include "servers/visual/shader_graph.h" #include "scene/gui/tree.h" #include "scene/gui/button.h" #include "scene/gui/graph_edit.h" diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index e261b48f67..fdb654571a 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -996,26 +996,26 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { case TRANSFORM_VIEW: { _edit.plane=TRANSFORM_X_AXIS; - set_message(TTR("View Plane Transform."),2); + set_message(TTR("X-Axis Transform."),2); name=""; _update_name(); } break; case TRANSFORM_X_AXIS: { _edit.plane=TRANSFORM_Y_AXIS; - set_message(TTR("X-Axis Transform."),2); + set_message(TTR("Y-Axis Transform."),2); } break; case TRANSFORM_Y_AXIS: { _edit.plane=TRANSFORM_Z_AXIS; - set_message(TTR("Y-Axis Transform."),2); + set_message(TTR("Z-Axis Transform."),2); } break; case TRANSFORM_Z_AXIS: { _edit.plane=TRANSFORM_VIEW; - set_message(TTR("Z-Axis Transform."),2); + set_message(TTR("View Plane Transform."),2); } break; } diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp index 4532e91e1f..4f59287994 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp @@ -825,7 +825,7 @@ SpriteFramesEditor::SpriteFramesEditor() { tree->set_icon_mode(ItemList::ICON_MODE_TOP); tree->set_fixed_column_width(thumbnail_size*3/2); tree->set_max_text_lines(2); - tree->set_max_icon_size(Size2(thumbnail_size,thumbnail_size)); + tree->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size)); //tree->set_min_icon_size(Size2(thumbnail_size,thumbnail_size)); tree->set_drag_forwarding(this); diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/tools/editor/plugins/texture_region_editor_plugin.cpp index b69b0d7a9b..57db19b736 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.cpp +++ b/tools/editor/plugins/texture_region_editor_plugin.cpp @@ -43,6 +43,8 @@ void TextureRegionEditor::_region_draw() base_tex = node_patch9->get_texture(); else if(node_type == "StyleBoxTexture" && obj_styleBox) base_tex = obj_styleBox->get_texture(); + else if(node_type == "AtlasTexture" && atlas_tex) + base_tex = atlas_tex->get_atlas(); if (base_tex.is_null()) return; @@ -164,6 +166,8 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input) drag=true; if(node_type == "Sprite" && node_sprite ) rect_prev=node_sprite->get_region_rect(); + else if(node_type == "AtlasTexture" && atlas_tex) + rect_prev=atlas_tex->get_region(); else if(node_type == "Patch9Frame" && node_patch9) rect_prev=node_patch9->get_region_rect(); else if(node_type == "StyleBoxTexture" && obj_styleBox) @@ -191,10 +195,18 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input) undo_redo->add_do_method(node_sprite ,"set_region_rect",node_sprite->get_region_rect()); undo_redo->add_undo_method(node_sprite,"set_region_rect",rect_prev); } + else if(node_type == "AtlasTexture" && atlas_tex ){ + undo_redo->add_do_method(atlas_tex ,"set_region",atlas_tex->get_region()); + undo_redo->add_undo_method(atlas_tex,"set_region",rect_prev); + } else if(node_type == "Patch9Frame" && node_patch9){ undo_redo->add_do_method(node_patch9 ,"set_region_rect",node_patch9->get_region_rect()); undo_redo->add_undo_method(node_patch9,"set_region_rect",rect_prev); } + else if(node_type == "StyleBoxTexture" && obj_styleBox){ + undo_redo->add_do_method(obj_styleBox ,"set_region_rect",obj_styleBox->get_region_rect()); + undo_redo->add_undo_method(obj_styleBox,"set_region_rect",rect_prev); + } undo_redo->add_do_method(edit_draw,"update"); undo_redo->add_undo_method(edit_draw,"update"); undo_redo->commit_action(); @@ -355,6 +367,8 @@ void TextureRegionEditor::apply_rect(const Rect2& rect){ node_patch9->set_region_rect(rect); else if(obj_styleBox) obj_styleBox->set_region_rect(rect); + else if(atlas_tex) + atlas_tex->set_region(rect); } else if(this->editing_region == REGION_PATCH_MARGIN) { if(node_patch9) { @@ -387,10 +401,11 @@ void TextureRegionEditor::_notification(int p_what) void TextureRegionEditor::_node_removed(Object *p_obj) { - if(p_obj == node_sprite || p_obj == node_patch9 || p_obj == obj_styleBox) { - node_patch9 = NULL; - node_sprite = NULL; + if(p_obj == node_sprite || p_obj == node_patch9 || p_obj == obj_styleBox || p_obj == atlas_tex) { + node_patch9 = NULL; + node_sprite = NULL; obj_styleBox = NULL; + atlas_tex = NULL; hide(); } } @@ -421,30 +436,42 @@ void TextureRegionEditor::edit(Object *p_obj) node_sprite = p_obj->cast_to<Sprite>(); node_patch9 = NULL; obj_styleBox = NULL; + atlas_tex = NULL; + } + else if(node_type == "AtlasTexture") { + atlas_tex = p_obj->cast_to<AtlasTexture>(); + node_sprite = NULL; + node_patch9 = NULL; + obj_styleBox = NULL; } else if(node_type == "Patch9Frame") { node_patch9 = p_obj->cast_to<Patch9Frame>(); node_sprite = NULL; obj_styleBox = NULL; + atlas_tex = NULL; margin_button->show(); } else if(node_type == "StyleBoxTexture") { obj_styleBox = p_obj->cast_to<StyleBoxTexture>(); node_sprite = NULL; node_patch9 = NULL; + atlas_tex = NULL; margin_button->show(); } p_obj->connect("exit_tree",this,"_node_removed",varray(p_obj),CONNECT_ONESHOT); } else { if(node_sprite) node_sprite->disconnect("exit_tree",this,"_node_removed"); + else if(atlas_tex) + atlas_tex->disconnect("exit_tree",this,"_node_removed"); else if(node_patch9) node_patch9->disconnect("exit_tree",this,"_node_removed"); else if(obj_styleBox) obj_styleBox->disconnect("exit_tree",this,"_node_removed"); - node_sprite = NULL; - node_patch9 = NULL; + node_sprite = NULL; + node_patch9 = NULL; obj_styleBox = NULL; + atlas_tex = NULL; } } @@ -469,6 +496,8 @@ void TextureRegionEditor::_edit_node(int region) texture = node_patch9->get_texture(); else if(node_type == "StyleBoxTexture" && obj_styleBox) texture = obj_styleBox->get_texture(); + else if(node_type == "AtlasTexture" && atlas_tex) + texture = atlas_tex->get_atlas(); if (texture.is_null()) { error->set_text(TTR("No texture in this node.\nSet a texture to be able to edit region.")); @@ -482,6 +511,8 @@ void TextureRegionEditor::_edit_node(int region) tex_region = node_patch9->get_region_rect(); else if(node_type == "StyleBoxTexture" && obj_styleBox) tex_region = obj_styleBox->get_region_rect(); + else if(node_type == "AtlasTexture" && atlas_tex) + tex_region = atlas_tex->get_region(); rect = tex_region; if(region == REGION_PATCH_MARGIN) { @@ -521,6 +552,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) { node_sprite = NULL; node_patch9 = NULL; + atlas_tex = NULL; editor=p_editor; undo_redo = editor->get_undo_redo(); @@ -661,7 +693,7 @@ void TextureRegionEditorPlugin::edit(Object *p_node) bool TextureRegionEditorPlugin::handles(Object *p_obj) const { - return p_obj->is_type("Sprite") || p_obj->is_type("Patch9Frame") || p_obj->is_type("StyleBoxTexture"); + return p_obj->is_type("Sprite") || p_obj->is_type("Patch9Frame") || p_obj->is_type("StyleBoxTexture") || p_obj->is_type("AtlasTexture"); } void TextureRegionEditorPlugin::make_visible(bool p_visible) diff --git a/tools/editor/plugins/texture_region_editor_plugin.h b/tools/editor/plugins/texture_region_editor_plugin.h index 951b11e1e6..1e4888b06d 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.h +++ b/tools/editor/plugins/texture_region_editor_plugin.h @@ -38,6 +38,7 @@ #include "scene/2d/sprite.h" #include "scene/gui/patch_9_frame.h" #include "scene/resources/style_box.h" +#include "scene/resources/texture.h" class TextureRegionEditor : public HBoxContainer { @@ -82,6 +83,7 @@ class TextureRegionEditor : public HBoxContainer { Patch9Frame *node_patch9; Sprite *node_sprite; StyleBoxTexture *obj_styleBox; + AtlasTexture *atlas_tex; int editing_region; Rect2 rect; diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp index 37cb0398e7..77097b11f6 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/tools/editor/plugins/theme_editor_plugin.cpp @@ -454,11 +454,73 @@ void ThemeEditor::_dialog_cbk() { void ThemeEditor::_theme_menu_cbk(int p_option) { - if (p_option==POPUP_CREATE_TEMPLATE) { + if (p_option==POPUP_CREATE_EMPTY || p_option==POPUP_CREATE_EDITOR_EMPTY) { - file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); - file_dialog->set_current_path("custom.theme"); - file_dialog->popup_centered_ratio(); + + Ref<Theme> base_theme; + + if (p_option==POPUP_CREATE_EMPTY) { + base_theme = Theme::get_default(); + } else { + base_theme = EditorNode::get_singleton()->get_theme_base()->get_theme(); + } + + + { + + List<StringName> types; + base_theme->get_type_list(&types); + + + for (List<StringName>::Element *T=types.front();T;T=T->next()) { + StringName type = T->get(); + + List<StringName> icons; + base_theme->get_icon_list(type,&icons); + + for (List<StringName>::Element *E=icons.front();E;E=E->next()) { + theme->set_icon(E->get(),type,Ref<Texture>()); + } + + List<StringName> shaders; + base_theme->get_shader_list(type,&shaders); + + for (List<StringName>::Element *E=shaders.front();E;E=E->next()) { + theme->set_shader(E->get(),type,Ref<Shader>()); + } + + List<StringName> styleboxs; + base_theme->get_stylebox_list(type,&styleboxs); + + for (List<StringName>::Element *E=styleboxs.front();E;E=E->next()) { + theme->set_stylebox(E->get(),type,Ref<StyleBox>()); + } + + List<StringName> fonts; + base_theme->get_font_list(type,&fonts); + + for (List<StringName>::Element *E=fonts.front();E;E=E->next()) { + theme->set_font(E->get(),type,Ref<Font>()); + } + + List<StringName> colors; + base_theme->get_color_list(type,&colors); + + for (List<StringName>::Element *E=colors.front();E;E=E->next()) { + theme->set_color(E->get(),type,Color()); + } + + + List<StringName> constants; + base_theme->get_constant_list(type,&constants); + + for (List<StringName>::Element *E=constants.front();E;E=E->next()) { + theme->set_constant(E->get(),type,base_theme->get_constant(type,E->get())); + } + + } + + } return; } @@ -583,6 +645,7 @@ ThemeEditor::ThemeEditor() { add_child(panel); panel->set_area_as_parent_rect(0); panel->set_margin(MARGIN_TOP,25); + panel->set_theme(Theme::get_default()); main_vb= memnew( VBoxContainer ); panel->add_child(main_vb); @@ -601,7 +664,9 @@ ThemeEditor::ThemeEditor() { theme_menu->get_popup()->add_item(TTR("Remove Item"),POPUP_REMOVE); theme_menu->get_popup()->add_item(TTR("Remove Class Items"),POPUP_CLASS_REMOVE); theme_menu->get_popup()->add_separator(); - theme_menu->get_popup()->add_item(TTR("Create Template"),POPUP_CREATE_TEMPLATE); + theme_menu->get_popup()->add_item(TTR("Create Empty Template"),POPUP_CREATE_EMPTY); + theme_menu->get_popup()->add_item(TTR("Create Empty Editor Template"),POPUP_CREATE_EDITOR_EMPTY); + hb_menu->add_child(theme_menu); theme_menu->get_popup()->connect("item_pressed", this,"_theme_menu_cbk"); diff --git a/tools/editor/plugins/theme_editor_plugin.h b/tools/editor/plugins/theme_editor_plugin.h index 49d5ae3096..1384fa6b69 100644 --- a/tools/editor/plugins/theme_editor_plugin.h +++ b/tools/editor/plugins/theme_editor_plugin.h @@ -68,7 +68,8 @@ class ThemeEditor : public Control { POPUP_CLASS_ADD, POPUP_REMOVE, POPUP_CLASS_REMOVE, - POPUP_CREATE_TEMPLATE + POPUP_CREATE_EMPTY, + POPUP_CREATE_EDITOR_EMPTY }; int popup_mode; diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 6d5f2a519c..5a40777665 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -208,9 +208,14 @@ void TileMapEditor::_update_palette() { palette->set_max_columns(0); palette->add_constant_override("hseparation", 6); + + float min_size = EDITOR_DEF("tile_map/preview_size",64); + palette->set_fixed_icon_size(Size2(min_size, min_size)); + palette->set_fixed_column_width(min_size*3/2); palette->set_icon_mode(ItemList::ICON_MODE_TOP); palette->set_max_text_lines(2); + String filter = search_box->get_text().strip_edges(); for (List<int>::Element *E=tiles.front();E;E=E->next()) { @@ -1434,6 +1439,7 @@ void TileMapEditorPlugin::make_visible(bool p_visible) { TileMapEditorPlugin::TileMapEditorPlugin(EditorNode *p_node) { + EDITOR_DEF("tile_map/preview_size",64); tile_map_editor = memnew( TileMapEditor(p_node) ); add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE, tile_map_editor); tile_map_editor->hide(); diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 3b02c73189..3f82199fc3 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -36,7 +36,6 @@ #include "io/resource_saver.h" #include "os/os.h" #include "scene/gui/box_container.h" -#include "default_saver.h" #include "scene/gui/tab_container.h" #include "scene/gui/scroll_container.h" diff --git a/tools/editor/project_settings.h b/tools/editor/project_settings.h index 5108378ff7..79e1acf75e 100644 --- a/tools/editor/project_settings.h +++ b/tools/editor/project_settings.h @@ -31,7 +31,6 @@ #include "scene/gui/dialogs.h" #include "property_editor.h" -#include "optimized_save_dialog.h" #include "undo_redo.h" #include "editor_data.h" #include "scene/gui/tab_container.h" diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 2f0ba2da99..763734f035 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -1963,6 +1963,13 @@ bool PropertyEditor::_is_property_different(const Variant& p_current, const Vari return false; } + if (p_current.get_type()==Variant::REAL && p_orig.get_type()==Variant::REAL) { + float a = p_current; + float b = p_orig; + + return Math::abs(a-b)>CMP_EPSILON; //this must be done because, as some scenes save as text, there might be a tiny difference in floats due to numerical error + } + return bool(Variant::evaluate(Variant::OP_NOT_EQUAL,p_current,p_orig)); } @@ -2232,6 +2239,7 @@ void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) { if (_get_instanced_node_original_property(p_name,vorig) || usage) { Variant v = obj->get(p_name); + bool changed = _is_property_different(v,vorig,usage); //if ((found!=-1 && !is_disabled)!=changed) { @@ -2804,7 +2812,7 @@ void PropertyEditor::update_tree() { if (capitalize_paths) cat = cat.capitalize(); - if (cat.findn(filter)==-1 && name.findn(filter)==-1) + if (!filter.is_subsequence_ofi(cat) && !filter.is_subsequence_ofi(name)) continue; } diff --git a/tools/editor/quick_open.cpp b/tools/editor/quick_open.cpp index 72059c264f..fc2a2241ab 100644 --- a/tools/editor/quick_open.cpp +++ b/tools/editor/quick_open.cpp @@ -126,7 +126,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd) { path+="/"; if (path!="res://") { path=path.substr(6,path.length()); - if (path.findn(search_box->get_text())!=-1) { + if (search_box->get_text().is_subsequence_ofi(path)) { TreeItem *ti = search_options->create_item(root); ti->set_text(0,path); Ref<Texture> icon = get_icon("folder","FileDialog"); @@ -138,7 +138,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd) { String file = efsd->get_file_path(i); file=file.substr(6,file.length()); - if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_box->get_text()=="" || file.findn(search_box->get_text())!=-1)) { + if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_box->get_text().is_subsequence_ofi(file))) { TreeItem *ti = search_options->create_item(root); ti->set_text(0,file); diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 9612305a0f..16ae14c0b5 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -201,6 +201,7 @@ static String _get_name_num_separator() { return " "; } + void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { current_option=p_tool; @@ -519,6 +520,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { EditorNode::get_singleton()->push_item(mne.ptr()); } break; + case TOOL_ERASE: { List<Node*> remove_list = editor_selection->get_selected_node_list(); @@ -1510,12 +1512,18 @@ static bool _has_visible_children(Node* p_node) { } + static Node* _find_last_visible(Node*p_node) { Node*last=NULL; - for(int i=0;i<p_node->get_child_count();i++) { - if (_is_node_visible(p_node->get_child(i))) { - last=p_node->get_child(i); + + bool collapsed = p_node->has_meta("_editor_collapsed") ? (bool)p_node->get_meta("_editor_collapsed") : false; + + if (!collapsed) { + for(int i=0;i<p_node->get_child_count();i++) { + if (_is_node_visible(p_node->get_child(i))) { + last=p_node->get_child(i); + } } } @@ -1586,18 +1594,27 @@ void SceneTreeDock::_normalize_drop(Node*& to_node, int &to_pos,int p_type) { Node* lower_sibling=NULL; - for(int i=to_node->get_index()+1;i<to_node->get_parent()->get_child_count();i++) { - Node *c =to_node->get_parent()->get_child(i); - if (_is_node_visible(c)) { - lower_sibling=c; + + + if (_has_visible_children(to_node) ) { + to_pos=0; + } else { + + + for(int i=to_node->get_index()+1;i<to_node->get_parent()->get_child_count();i++) { + Node *c =to_node->get_parent()->get_child(i); + if (_is_node_visible(c)) { + lower_sibling=c; + break; + } } - } - if (lower_sibling) { - to_pos=lower_sibling->get_index(); - } + if (lower_sibling) { + to_pos=lower_sibling->get_index(); + } - to_node=to_node->get_parent(); + to_node=to_node->get_parent(); + } #if 0 //quite complicated, look for next visible in tree upper_sibling=_find_last_visible(upper_sibling); diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index f8ce121690..a155f0c0cf 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -94,6 +94,29 @@ void SceneTreeEditor::_subscene_option(int p_idx) { case SCENE_MENU_CLEAR_INHERITANCE: { clear_inherit_confirm->popup_centered_minsize(); } break; + case SCENE_MENU_CLEAR_INSTANCING: { + + Node*root=EditorNode::get_singleton()->get_edited_scene(); + if (!root) + break; + + + ERR_FAIL_COND(node->get_filename()==String()); + + undo_redo->create_action("Discard Instancing"); + + undo_redo->add_do_method(node,"set_filename",""); + undo_redo->add_undo_method(node,"set_filename",node->get_filename()); + + _node_replace_owner(node,node,root); + + undo_redo->add_do_method(this,"update_tree"); + undo_redo->add_undo_method(this,"update_tree"); + + undo_redo->commit_action(); + + + } break; case SCENE_MENU_OPEN_INHERITED: { if (node && node->get_scene_inherited_state().is_valid()) { emit_signal("open",node->get_scene_inherited_state()->get_path()); @@ -108,8 +131,27 @@ void SceneTreeEditor::_subscene_option(int p_idx) { } break; + + } + +} + + +void SceneTreeEditor::_node_replace_owner(Node* p_base,Node* p_node,Node* p_root) { + + if (p_base!=p_node) { + + if (p_node->get_owner()==p_base) { + + undo_redo->add_do_method(p_node,"set_owner",p_root); + undo_redo->add_undo_method(p_node,"set_owner",p_base); + } } + for(int i=0;i<p_node->get_child_count();i++) { + + _node_replace_owner(p_base,p_node->get_child(i),p_root); + } } @@ -386,7 +428,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) { item->set_as_cursor(0); } - bool keep= ( filter==String() || String(p_node->get_name()).to_lower().find(filter.to_lower())!=-1 ); + bool keep= (filter.is_subsequence_ofi(String(p_node->get_name()))); for (int i=0;i<p_node->get_child_count();i++) { @@ -606,11 +648,13 @@ void SceneTreeEditor::_notification(int p_what) { get_tree()->connect("node_removed",this,"_node_removed"); get_tree()->connect("node_configuration_warning_changed",this,"_warning_changed"); - instance_menu->set_item_icon(3,get_icon("Load","EditorIcons")); + instance_menu->set_item_icon(5,get_icon("Load","EditorIcons")); tree->connect("item_collapsed",this,"_cell_collapsed"); inheritance_menu->set_item_icon(2,get_icon("Load","EditorIcons")); clear_inherit_confirm->connect("confirmed",this,"_subscene_option",varray(SCENE_MENU_CLEAR_INHERITANCE_CONFIRM)); + EditorSettings::get_singleton()->connect("settings_changed",this,"_editor_settings_changed"); + // get_scene()->connect("tree_changed",this,"_tree_changed",Vector<Variant>(),CONNECT_DEFERRED); // get_scene()->connect("node_removed",this,"_node_removed",Vector<Variant>(),CONNECT_DEFERRED); @@ -623,6 +667,7 @@ void SceneTreeEditor::_notification(int p_what) { tree->disconnect("item_collapsed",this,"_cell_collapsed"); clear_inherit_confirm->disconnect("confirmed",this,"_subscene_option"); get_tree()->disconnect("node_configuration_warning_changed",this,"_warning_changed"); + EditorSettings::get_singleton()->disconnect("settings_changed",this,"_editor_settings_changed"); } } @@ -1006,6 +1051,21 @@ void SceneTreeEditor::_warning_changed(Node* p_for_node) { } + +void SceneTreeEditor::_editor_settings_changed() { + bool enable_rl = EditorSettings::get_singleton()->get("scenetree_editor/draw_relationship_lines"); + Color rl_color = EditorSettings::get_singleton()->get("scenetree_editor/relationship_line_color"); + + if (enable_rl) { + tree->add_constant_override("draw_relationship_lines",1); + tree->add_color_override("relationship_line_color", rl_color); + } + else + tree->add_constant_override("draw_relationship_lines",0); + +} + + void SceneTreeEditor::_bind_methods() { ObjectTypeDB::bind_method("_tree_changed",&SceneTreeEditor::_tree_changed); @@ -1026,6 +1086,8 @@ void SceneTreeEditor::_bind_methods() { ObjectTypeDB::bind_method("_node_script_changed",&SceneTreeEditor::_node_script_changed); ObjectTypeDB::bind_method("_node_visibility_changed",&SceneTreeEditor::_node_visibility_changed); + ObjectTypeDB::bind_method("_editor_settings_changed", &SceneTreeEditor::_editor_settings_changed); + ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw); ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw); ObjectTypeDB::bind_method(_MD("drop_data_fw"), &SceneTreeEditor::drop_data_fw); @@ -1109,6 +1171,8 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open instance_menu->add_check_item(TTR("Editable Children"),SCENE_MENU_EDITABLE_CHILDREN); instance_menu->add_check_item(TTR("Load As Placeholder"),SCENE_MENU_USE_PLACEHOLDER); instance_menu->add_separator(); + instance_menu->add_item(TTR("Discard Instancing"),SCENE_MENU_CLEAR_INSTANCING); + instance_menu->add_separator(); instance_menu->add_item(TTR("Open in Editor"),SCENE_MENU_OPEN); instance_menu->connect("item_pressed",this,"_subscene_option"); add_child(instance_menu); @@ -1208,4 +1272,3 @@ SceneTreeDialog::SceneTreeDialog() { SceneTreeDialog::~SceneTreeDialog() { } - diff --git a/tools/editor/scene_tree_editor.h b/tools/editor/scene_tree_editor.h index ae0afa32ec..79b7a64468 100644 --- a/tools/editor/scene_tree_editor.h +++ b/tools/editor/scene_tree_editor.h @@ -34,6 +34,7 @@ #include "scene/gui/dialogs.h" #include "undo_redo.h" #include "editor_data.h" +#include "editor_settings.h" /** @author Juan Linietsky <reduzio@gmail.com> */ @@ -61,6 +62,7 @@ class SceneTreeEditor : public Control { SCENE_MENU_CLEAR_INHERITANCE, SCENE_MENU_OPEN_INHERITED, SCENE_MENU_CLEAR_INHERITANCE_CONFIRM, + SCENE_MENU_CLEAR_INSTANCING, }; Tree *tree; @@ -117,6 +119,7 @@ class SceneTreeEditor : public Control { void _node_visibility_changed(Node *p_node); void _subscene_option(int p_idx); + void _node_replace_owner(Node* p_base,Node* p_node,Node* p_root); void _selection_changed(); @@ -130,6 +133,8 @@ class SceneTreeEditor : public Control { void _warning_changed(Node* p_for_node); + void _editor_settings_changed(); + Timer* update_timer; public: diff --git a/tools/editor/scenes.cpp b/tools/editor/scenes.cpp deleted file mode 100644 index e6569c98a9..0000000000 --- a/tools/editor/scenes.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************/ -/* scenes.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "scenes.h" - -Scenes::Scenes() -{ -} diff --git a/tools/editor/scenes.h b/tools/editor/scenes.h deleted file mode 100644 index bae9ef65f0..0000000000 --- a/tools/editor/scenes.h +++ /dev/null @@ -1,37 +0,0 @@ -/*************************************************************************/ -/* scenes.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef SCENES_H -#define SCENES_H - -class Scenes{ -public: - Scenes(); -}; - -#endif // SCENES_H diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp index 7953cf2739..44832c84eb 100644 --- a/tools/editor/scenes_dock.cpp +++ b/tools/editor/scenes_dock.cpp @@ -454,8 +454,7 @@ void ScenesDock::_update_files(bool p_keep_selection) { files->set_icon_mode(ItemList::ICON_MODE_TOP); files->set_fixed_column_width(thumbnail_size*3/2); files->set_max_text_lines(2); - files->set_min_icon_size(Size2(thumbnail_size,thumbnail_size)); - files->set_max_icon_size(Size2(thumbnail_size,thumbnail_size)); + files->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size)); if (!has_icon("ResizedFolder","EditorIcons")) { Ref<ImageTexture> folder = get_icon("FolderBig","EditorIcons"); @@ -485,7 +484,7 @@ void ScenesDock::_update_files(bool p_keep_selection) { files->set_max_columns(1); files->set_max_text_lines(1); files->set_fixed_column_width(0); - files->set_min_icon_size(Size2()); + files->set_fixed_icon_size(Size2()); } diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 37a90ba7be..6d8f54d88f 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -1731,15 +1731,17 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){ docontinue->set_tooltip(TTR("Continue")); docontinue->connect("pressed",this,"debug_continue"); - hbc->add_child( memnew( VSeparator) ); + //hbc->add_child( memnew( VSeparator) ); back = memnew( Button ); hbc->add_child(back); back->set_tooltip(TTR("Inspect Previous Instance")); + back->hide(); forward = memnew( Button ); hbc->add_child(forward); forward->set_tooltip(TTR("Inspect Next Instance")); + forward->hide(); HSplitContainer *sc = memnew( HSplitContainer ); diff --git a/tools/pck/pck_packer.cpp b/tools/pck/pck_packer.cpp index 228d37df7c..04b88ea028 100644 --- a/tools/pck/pck_packer.cpp +++ b/tools/pck/pck_packer.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* pkc_packer.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "pck_packer.h" #include "core/os/file_access.h" diff --git a/tools/pck/pck_packer.h b/tools/pck/pck_packer.h index 2bb51128e9..b1182335e2 100644 --- a/tools/pck/pck_packer.h +++ b/tools/pck/pck_packer.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* pck_packer.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "core/reference.h" class FileAccess; diff --git a/tools/scripts/svgs_2_pngs.py b/tools/scripts/svgs_2_pngs.py new file mode 100644 index 0000000000..acb50892c3 --- /dev/null +++ b/tools/scripts/svgs_2_pngs.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- + +# Basic exporter for svg icons + +from os import listdir +from os.path import isfile, join, dirname, realpath +import subprocess +import sys + +import rsvg +import cairo + +last_svg_path = None +last_svg_data = None + +SCRIPT_FOLDER = dirname(realpath(__file__)) + '/' +theme_dir_base = SCRIPT_FOLDER + '../../scene/resources/default_theme/' +theme_dir_source = theme_dir_base + 'source/' +icons_dir_base = SCRIPT_FOLDER + '../editor/icons/' +icons_dir_2x = icons_dir_base + '2x/' +icons_dir_source = icons_dir_base + 'source/' + + +def svg_to_png(svg_path, png_path, dpi): + global last_svg_path, last_svg_data + + zoom = int(dpi / 90) + if last_svg_path != svg_path: + last_svg_data = open(svg_path, 'r').read() + last_svg_path = svg_path + svg = rsvg.Handle(data=last_svg_data) + img = cairo.ImageSurface( + cairo.FORMAT_ARGB32, + svg.props.width * zoom, + svg.props.height * zoom + ) + ctx = cairo.Context(img) + ctx.set_antialias(cairo.ANTIALIAS_DEFAULT) + ctx.scale(zoom, zoom) + svg.render_cairo(ctx) + img.write_to_png('%s.png' % png_path) + svg.close() + + +def export_icons(): + svgs_path = icons_dir_source + + file_names = [f for f in listdir(svgs_path) if isfile(join(svgs_path, f))] + + for file_name in file_names: + # name without extensions + name_only = file_name.replace('.svg', '') + + out_icon_names = [name_only] # export to a png with the same file name + theme_out_icon_names = [] + # special cases + if special_icons.has_key(name_only): + special_icon = special_icons[name_only] + if type(special_icon) is dict: + if special_icon.get('avoid_self'): + out_icon_names = [] + if special_icon.has_key('output_names'): + out_icon_names += special_icon['output_names'] + if special_icon.has_key('theme_output_names'): + theme_out_icon_names += special_icon['theme_output_names'] + + source_path = '%s%s.svg' % (svgs_path, name_only) + + for out_icon_name in out_icon_names: + svg_to_png(source_path, icons_dir_base + out_icon_name, 90) + svg_to_png(source_path, icons_dir_2x + out_icon_name, 180) + for theme_out_icon_name in theme_out_icon_names: + svg_to_png(source_path, theme_dir_base + theme_out_icon_name, 90) + + + +def export_theme(): + svgs_path = theme_dir_source + file_names = [f for f in listdir(svgs_path) if isfile(join(svgs_path, f))] + + for file_name in file_names: + # name without extensions + name_only = file_name.replace('.svg', '') + + out_icon_names = [name_only] # export to a png with the same file name + # special cases + if theme_icons.has_key(name_only): + special_icon = theme_icons[name_only] + if type(special_icon) is dict: + if special_icon.has_key('output_names'): + out_icon_names += special_icon['output_names'] + + source_path = '%s%s.svg' % (svgs_path, name_only) + + for out_icon_name in out_icon_names: + svg_to_png(source_path, theme_dir_base + out_icon_name, 90) + + +# special cases for icons that will be exported to multiple target pngs or that require transforms. +special_icons = { + 'icon_add_track': dict( + output_names=['icon_add'], + theme_output_names=['icon_add', 'icon_zoom_more'] + ), + 'icon_new': dict( output_names=['icon_file'] ), + 'icon_animation_tree_player': dict( output_names=['icon_animation_tree'] ), + 'icon_tool_rotate': dict( + output_names=['icon_reload'], + theme_output_names= ['icon_reload'] + ), + 'icon_multi_edit': dict( output_names=['icon_multi_node_edit'] ), + 'icon_folder': dict( + output_names=['icon_load', 'icon_open'], + theme_output_names= ['icon_folder'] + ), + 'icon_file_list': dict( output_names=['icon_enum'] ), + 'icon_collision_2d': dict( output_names=['icon_collision_polygon_2d', 'icon_polygon_2d'] ), + 'icon_class_list': dict( output_names=['icon_filesystem'] ), + 'icon_color_ramp': dict( output_names=['icon_graph_color_ramp'] ), + 'icon_translation': dict( output_names=['icon_p_hash_translation'] ), + 'icon_shader': dict( output_names=['icon_shader_material', 'icon_material_shader'] ), + 'icon_canvas_item_shader_graph': dict( output_names=['icon_material_shader_graph'] ), + + 'icon_color_pick': dict( theme_output_names= ['icon_color_pick'], avoid_self=True ), + 'icon_play': dict( theme_output_names= ['icon_play'] ), + 'icon_stop': dict( theme_output_names= ['icon_stop'] ), + 'icon_zoom_less': dict( theme_output_names= ['icon_zoom_less'], avoid_self=True ), + 'icon_zoom_reset': dict( theme_output_names= ['icon_zoom_reset'], avoid_self=True ) +} + +theme_icons = { + 'icon_close': dict(output_names=['close', 'close_hl']), + 'tab_menu': dict(output_names=['tab_menu_hl']) +} + +export_icons() +export_theme() diff --git a/tools/translations/ko.po b/tools/translations/ko.po index 489e3a6b12..2a6ee8e06f 100644 --- a/tools/translations/ko.po +++ b/tools/translations/ko.po @@ -207,13 +207,12 @@ msgstr "" "SampleLibrary 리소스를 생성하거나, 지정해야합니다." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the 'Frames' property in " "order for AnimatedSprite3D to display frames." msgstr "" -"AnimatedSprite이 프레임을 보여주기 위해서는 'Frames' 속성에 SpriteFrames 리소" -"스 만들거나 지정해야 합니다." +"AnimatedSprite3D가 프레임을 보여주기 위해서는 'Frames' 속성에 SpriteFrames 리" +"소스 만들거나 지정해야 합니다." #: scene/gui/dialogs.cpp tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Cancel" @@ -251,24 +250,20 @@ msgid "Open" msgstr "열기" #: scene/gui/file_dialog.cpp -#, fuzzy msgid "Open a File" -msgstr "샘플 파일 열기" +msgstr "파일 열기" #: scene/gui/file_dialog.cpp -#, fuzzy msgid "Open File(s)" -msgstr "샘플 파일 열기" +msgstr "파일 열기" #: scene/gui/file_dialog.cpp -#, fuzzy msgid "Open a Directory" -msgstr "디렉토리 선택" +msgstr "디렉토리 열기" #: scene/gui/file_dialog.cpp -#, fuzzy msgid "Open a File or Directory" -msgstr "디렉토리 선택" +msgstr "디렉토리 또는 파일 열기" #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp #: tools/editor/editor_node.cpp @@ -332,7 +327,7 @@ msgstr "알트+" #: scene/gui/input_action.cpp msgid "Ctrl+" -msgstr "" +msgstr "컨트롤+" #: scene/gui/input_action.cpp tools/editor/project_settings.cpp #: tools/editor/settings_config_dialog.cpp @@ -797,22 +792,20 @@ msgid "Site:" msgstr "사이트:" #: tools/editor/asset_library_editor_plugin.cpp -#, fuzzy msgid "Support.." -msgstr "내보내기.." +msgstr "지원.." #: tools/editor/asset_library_editor_plugin.cpp msgid "Official" -msgstr "" +msgstr "공식" #: tools/editor/asset_library_editor_plugin.cpp msgid "Community" -msgstr "" +msgstr "커뮤니티" #: tools/editor/asset_library_editor_plugin.cpp -#, fuzzy msgid "Testing" -msgstr "설정" +msgstr "테스팅" #: tools/editor/asset_library_editor_plugin.cpp msgid "Assets ZIP File" @@ -1005,9 +998,8 @@ msgid "Disconnect" msgstr "연결해제" #: tools/editor/connections_dialog.cpp tools/editor/node_dock.cpp -#, fuzzy msgid "Signals" -msgstr "시그널:" +msgstr "시그널" #: tools/editor/create_dialog.cpp msgid "Create New" @@ -1200,7 +1192,7 @@ msgstr "상속한 클래스:" #: tools/editor/editor_help.cpp msgid "Brief Description:" -msgstr "짧은 설명:" +msgstr "간단한 설명:" #: tools/editor/editor_help.cpp msgid "Public Methods:" @@ -1267,9 +1259,8 @@ msgid "Setting Up.." msgstr "설정 중.." #: tools/editor/editor_log.cpp -#, fuzzy msgid " Output:" -msgstr "출력" +msgstr "출력:" #: tools/editor/editor_node.cpp tools/editor/editor_reimport_dialog.cpp msgid "Re-Importing" @@ -1382,9 +1373,8 @@ msgid "Copy Params" msgstr "속성 복사" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Paste Params" -msgstr "프레임 붙여넣기" +msgstr "속성 붙여넣기" #: tools/editor/editor_node.cpp #: tools/editor/plugins/resource_preloader_editor_plugin.cpp @@ -1404,9 +1394,8 @@ msgid "Make Sub-Resources Unique" msgstr "하위 리소스를 유일하게 만들기" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Open in Help" -msgstr "씬 열기" +msgstr "도움말에서 열기" #: tools/editor/editor_node.cpp msgid "There is no defined scene to run." @@ -1417,6 +1406,8 @@ msgid "" "No main scene has ever been defined.\n" "Select one from \"Project Settings\" under the 'application' category." msgstr "" +"메인 씬이 지정되지 않았습니다.\n" +"\"프로젝트 설정\"의 'Application' 항목에서 씬을 하나 선택해 주세요." #: tools/editor/editor_node.cpp msgid "Current scene was never saved, please save it prior to running." @@ -1535,9 +1526,8 @@ msgid "Save Layout" msgstr "레이아웃 저장" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Load Layout" -msgstr "레이아웃 저장" +msgstr "레이아웃 로드" #: tools/editor/editor_node.cpp tools/editor/project_export.cpp msgid "Default" @@ -1601,9 +1591,8 @@ msgid "Open Recent" msgstr "최근 열었던 항목" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Quick Filter Files.." -msgstr "빠른 파일 검색.." +msgstr "빠른 파일 필터링.." #: tools/editor/editor_node.cpp msgid "Convert To.." @@ -1675,9 +1664,8 @@ msgid "Export" msgstr "내보내기" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Play the project." -msgstr "프로젝트 실행 (F5)." +msgstr "프로젝트 실행." #: tools/editor/editor_node.cpp #: tools/editor/plugins/sample_library_editor_plugin.cpp @@ -1689,14 +1677,12 @@ msgid "Pause the scene" msgstr "씬 일시 정지" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Pause Scene" msgstr "씬 일시 정지" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Stop the scene." -msgstr "씬 정지 (F8)." +msgstr "씬 정지" #: tools/editor/editor_node.cpp #: tools/editor/plugins/sample_library_editor_plugin.cpp @@ -1704,14 +1690,12 @@ msgid "Stop" msgstr "정지" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Play the edited scene." -msgstr "편집 중인 씬 실행 (F6)." +msgstr "편집 중인 씬 실행" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Play Scene" -msgstr "씬 저장" +msgstr "씬 실행" #: tools/editor/editor_node.cpp msgid "Play custom scene" @@ -1722,7 +1706,6 @@ msgid "Debug options" msgstr "디버그 옵션" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Deploy with Remote Debug" msgstr "원격 디버그 배포" @@ -1731,10 +1714,12 @@ msgid "" "When exporting or deploying, the resulting executable will attempt to connect " "to the IP of this computer in order to be debugged." msgstr "" +"내보내기나 배포를 할 때, 실행 파일이 디버깅을 위해서 이 컴퓨터의 IP로 연결을 " +"시도합니다." #: tools/editor/editor_node.cpp msgid "Small Deploy with Network FS" -msgstr "" +msgstr "네트워크 파일 시스템을 갖는 작은 배포" #: tools/editor/editor_node.cpp msgid "" @@ -1745,6 +1730,11 @@ msgid "" "On Android, deploy will use the USB cable for faster performance. This option " "speeds up testing for games with a large footprint." msgstr "" +"이 옵션이 활성화 되어 있을 경우, 내보내기나 배포는 최소한의 실행파일을 생성합" +"니다.\n" +"파일 시스템은 네트워크를 통해서 에디터 상의 프로젝트가 제공합니다.\n" +"안드로이드의 경우, USB 케이블을 사용하여 배포할 경우 더 빠른 퍼포먼스를 제공합" +"니다. 이 옵션은 큰 설치 용량을 요구하는 게임의 테스트를 빠르게 할 수 있습니다." #: tools/editor/editor_node.cpp msgid "Visible Collision Shapes" @@ -1755,6 +1745,8 @@ msgid "" "Collision shapes and raycast nodes (for 2D and 3D) will be visible on the " "running game if this option is turned on." msgstr "" +"이 옵션이 활성화 되어 있을 경우, 게임이 실행되는 동안 (2D와 3D의) 충돌 모양과 " +"Raycast 노드가 표시됩니다." #: tools/editor/editor_node.cpp msgid "Visible Navigation" @@ -1765,10 +1757,12 @@ msgid "" "Navigation meshes and polygons will be visible on the running game if this " "option is turned on." msgstr "" +"이 옵션이 활성화 되어 있을 경우, 게임이 실행되는 동안 네비게이션 메쉬가 표시됩" +"니다." #: tools/editor/editor_node.cpp msgid "Sync Scene Changes" -msgstr "" +msgstr "씬 변경사항 동기화" #: tools/editor/editor_node.cpp msgid "" @@ -1777,11 +1771,14 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"이 옵션이 활성화 되어 있을 경우, 에디터상의 씬의 변경사항이 실행중인 게임에 반" +"영됩니다.\n" +"기기에 원격으로 사용되는 경우, 네트워크 파일 시스템과 함께하면 더욱 효과적입니" +"다." #: tools/editor/editor_node.cpp -#, fuzzy msgid "Sync Script Changes" -msgstr "변경사항만 갱신" +msgstr "스크립트 변경사항 동기화" #: tools/editor/editor_node.cpp msgid "" @@ -1790,6 +1787,10 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"이 옵션이 활성화 되어 있을 경우, 스크립트를 수정하고 저장하면 실행중인 게임에" +"서 다시 읽어 들입니다.\n" +"기기에 원격으로 사용되는 경우, 네트워크 파일 시스템과 함께하면 더욱 효과적입니" +"다." #: tools/editor/editor_node.cpp tools/editor/plugins/spatial_editor_plugin.cpp msgid "Settings" @@ -2051,9 +2052,8 @@ msgid "Imported Resources" msgstr "가져온 리소스" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp -#, fuzzy msgid "No bit masks to import!" -msgstr "가져올 항목이 없습니다!" +msgstr "가져올 비트 마스크가 없습니다!" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -2083,9 +2083,8 @@ msgid "Save path is empty!" msgstr "저장 경로가 없습니다!" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp -#, fuzzy msgid "Import BitMasks" -msgstr "텍스쳐 가져오기" +msgstr "비트마스크 가져오기" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -2112,7 +2111,7 @@ msgstr "수락" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp msgid "Bit Mask" -msgstr "" +msgstr "비트 마스크" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "No source font file!" @@ -2623,18 +2622,16 @@ msgid "MultiNode Set" msgstr "다중 노드 설정" #: tools/editor/node_dock.cpp -#, fuzzy msgid "Node" -msgstr "믹스 노드" +msgstr "노드" #: tools/editor/node_dock.cpp -#, fuzzy msgid "Groups" -msgstr "그룹:" +msgstr "그룹" #: tools/editor/node_dock.cpp msgid "Select a Node to edit Signals and Groups." -msgstr "" +msgstr "시그널과 그룹을 편집할 노드를 선택하세요." #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Toggle Autoplay" @@ -3944,13 +3941,12 @@ msgid "Auto Indent" msgstr "자동 들여쓰기" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Reload Tool Script" -msgstr "노드 스크립트 생성" +msgstr "툴 스크립트 다시 로드" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Reload Tool Script (Soft)" -msgstr "" +msgstr "툴 스크립트 다시 로드 (소프트)" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/shader_editor_plugin.cpp @@ -4607,20 +4603,20 @@ msgid "StyleBox Preview:" msgstr "StyleBox 미리보기:" #: tools/editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Texture Region Editor" -msgstr "Sprite 구역 편집기" +msgstr "텍스쳐 구역 편집기" #: tools/editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Scale Region Editor" -msgstr "Sprite 구역 편집기" +msgstr "스케일 구역 편집기" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "" "No texture in this node.\n" "Set a texture to be able to edit region." msgstr "" +"이 노드에 텍스쳐가 없습니다.\n" +"구역을 편집하기 위해서는 텍스쳐를 지정해야합니다." #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Can't save theme to file:" @@ -5142,14 +5138,12 @@ msgstr "" "목록에서 프로젝트를 제거하시겠습니까? (폴더와 파일들은 남아있게 됩니다.)" #: tools/editor/project_manager.cpp -#, fuzzy msgid "Project Manager" -msgstr "프로젝트 명:" +msgstr "프로젝트 매니저" #: tools/editor/project_manager.cpp -#, fuzzy msgid "Project List" -msgstr "종료하고 프로젝트 목록으로 돌아가기" +msgstr "프로젝트 목록" #: tools/editor/project_manager.cpp msgid "Run" @@ -5302,14 +5296,12 @@ msgid "Invalid name. Must not collide with an existing global constant name." msgstr "유효하지 않은 이름입니다. 전역 상수 이름과 충돌하지 않아야 합니다." #: tools/editor/project_settings.cpp -#, fuzzy msgid "Autoload '%s' already exists!" -msgstr "'%s' 액션이 이미 존재합니다!" +msgstr "자동로드에 '%s'이(가) 이미 존재합니다!" #: tools/editor/project_settings.cpp -#, fuzzy msgid "Rename Autoload" -msgstr "자동 로드 삭제" +msgstr "자동 로드 이름 변경" #: tools/editor/project_settings.cpp msgid "Toggle AutoLoad Globals" @@ -5832,9 +5824,8 @@ msgid "View Owners.." msgstr "소유자 보기.." #: tools/editor/scenes_dock.cpp -#, fuzzy msgid "Copy Path" -msgstr "속성 복사" +msgstr "경로 복사" #: tools/editor/scenes_dock.cpp msgid "Rename or Move.." @@ -6074,7 +6065,7 @@ msgstr "트리로부터 설정" #: tools/editor/settings_config_dialog.cpp msgid "Shortcuts" -msgstr "" +msgstr "단축키" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Light Radius" diff --git a/tools/translations/ru.po b/tools/translations/ru.po index aa98be2767..138aa2c858 100644 --- a/tools/translations/ru.po +++ b/tools/translations/ru.po @@ -26,7 +26,7 @@ msgid "" "order for AnimatedSprite to display frames." msgstr "" "Чтобы AnimatedSprite отображал кадры, пожалуйста установите или создайте " -"ресурс SpriteFrames в параметре 'Frames'" +"ресурс SpriteFrames в параметре 'Frames'." #: scene/2d/canvas_modulate.cpp msgid "" @@ -218,13 +218,12 @@ msgstr "" "ресурс SampleLibrary в параметре 'samples'." #: scene/3d/sprite_3d.cpp -#, fuzzy msgid "" "A SpriteFrames resource must be created or set in the 'Frames' property in " "order for AnimatedSprite3D to display frames." msgstr "" -"Чтобы AnimatedSprite отображал кадры, пожалуйста установите или создайте " -"ресурс SpriteFrames в параметре 'Frames'" +"Чтобы AnimatedSprite3D отображал кадры, пожалуйста установите или создайте " +"ресурс SpriteFrames в параметре 'Frames'." #: scene/gui/dialogs.cpp tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Cancel" @@ -262,24 +261,20 @@ msgid "Open" msgstr "Открыть" #: scene/gui/file_dialog.cpp -#, fuzzy msgid "Open a File" -msgstr "Открыть сэмпл(ы)" +msgstr "Открыть файл" #: scene/gui/file_dialog.cpp -#, fuzzy msgid "Open File(s)" -msgstr "Открыть сэмпл(ы)" +msgstr "Открыть файл(ы)" #: scene/gui/file_dialog.cpp -#, fuzzy msgid "Open a Directory" -msgstr "Выбрать каталог" +msgstr "Открыть каталог" #: scene/gui/file_dialog.cpp -#, fuzzy msgid "Open a File or Directory" -msgstr "Выбрать каталог" +msgstr "Открыть каталог или файл" #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp #: tools/editor/editor_node.cpp @@ -343,7 +338,7 @@ msgstr "Alt+" #: scene/gui/input_action.cpp msgid "Ctrl+" -msgstr "" +msgstr "Ctrl+" #: scene/gui/input_action.cpp tools/editor/project_settings.cpp #: tools/editor/settings_config_dialog.cpp @@ -715,7 +710,7 @@ msgstr "Включить индивидуальное редактировани #: tools/editor/animation_editor.cpp msgid "Anim. Optimizer" -msgstr "Оптимизатор анимации." +msgstr "Оптимизатор анимации" #: tools/editor/animation_editor.cpp msgid "Max. Linear Error:" @@ -810,22 +805,20 @@ msgid "Site:" msgstr "Сайт:" #: tools/editor/asset_library_editor_plugin.cpp -#, fuzzy msgid "Support.." -msgstr "Экспортировать.." +msgstr "Поддержка.." #: tools/editor/asset_library_editor_plugin.cpp msgid "Official" -msgstr "" +msgstr "Официально" #: tools/editor/asset_library_editor_plugin.cpp msgid "Community" -msgstr "" +msgstr "Сообщество" #: tools/editor/asset_library_editor_plugin.cpp -#, fuzzy msgid "Testing" -msgstr "Настройки" +msgstr "Тестируемые" #: tools/editor/asset_library_editor_plugin.cpp msgid "Assets ZIP File" @@ -1018,9 +1011,8 @@ msgid "Disconnect" msgstr "Отсоединить" #: tools/editor/connections_dialog.cpp tools/editor/node_dock.cpp -#, fuzzy msgid "Signals" -msgstr "Сигналы:" +msgstr "Сигналы" #: tools/editor/create_dialog.cpp msgid "Create New" @@ -1245,7 +1237,7 @@ msgstr "Описание методов:" #: tools/editor/editor_help.cpp msgid "Search Text" -msgstr "Искать текст:" +msgstr "Искать текст" #: tools/editor/editor_import_export.cpp msgid "Added:" @@ -1280,9 +1272,8 @@ msgid "Setting Up.." msgstr "Настройка.." #: tools/editor/editor_log.cpp -#, fuzzy msgid " Output:" -msgstr "Вывод" +msgstr " Вывод:" #: tools/editor/editor_node.cpp tools/editor/editor_reimport_dialog.cpp msgid "Re-Importing" @@ -1396,9 +1387,8 @@ msgid "Copy Params" msgstr "Копировать параметры" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Paste Params" -msgstr "Вставить кадр" +msgstr "Вставить параметры" #: tools/editor/editor_node.cpp #: tools/editor/plugins/resource_preloader_editor_plugin.cpp @@ -1418,9 +1408,8 @@ msgid "Make Sub-Resources Unique" msgstr "Сделать вложенные ресурсы уникальными" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Open in Help" -msgstr "Открыть сцену" +msgstr "Открыть в справке" #: tools/editor/editor_node.cpp msgid "There is no defined scene to run." @@ -1431,6 +1420,9 @@ msgid "" "No main scene has ever been defined.\n" "Select one from \"Project Settings\" under the 'application' category." msgstr "" +"Не назначена главная сцена.\n" +"Укажите её в параметре \"main_scene\" расположенном\n" +"в \"Настройки проекта - Основное - application\"." #: tools/editor/editor_node.cpp msgid "Current scene was never saved, please save it prior to running." @@ -1550,9 +1542,8 @@ msgid "Save Layout" msgstr "Сохранить макет" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Load Layout" -msgstr "Сохранить макет" +msgstr "Загрузить макет" #: tools/editor/editor_node.cpp tools/editor/project_export.cpp msgid "Default" @@ -1616,9 +1607,8 @@ msgid "Open Recent" msgstr "Открыть последнее" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Quick Filter Files.." -msgstr "Быстрый поиск файлов.." +msgstr "Быстро отсортировать файлы.." #: tools/editor/editor_node.cpp msgid "Convert To.." @@ -1690,9 +1680,8 @@ msgid "Export" msgstr "Экспорт" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Play the project." -msgstr "Запустить проект (F5)." +msgstr "Запустить проект." #: tools/editor/editor_node.cpp #: tools/editor/plugins/sample_library_editor_plugin.cpp @@ -1704,14 +1693,12 @@ msgid "Pause the scene" msgstr "Приостановить сцену" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Pause Scene" msgstr "Приостановить сцену" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Stop the scene." -msgstr "Остановить проект (F8)." +msgstr "Остановить сцену." #: tools/editor/editor_node.cpp #: tools/editor/plugins/sample_library_editor_plugin.cpp @@ -1719,14 +1706,12 @@ msgid "Stop" msgstr "Остановить" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Play the edited scene." -msgstr "Запустить текущую сцену (F6)." +msgstr "Запустить текущую сцену." #: tools/editor/editor_node.cpp -#, fuzzy msgid "Play Scene" -msgstr "Сохранить сцену" +msgstr "Запустить сцену" #: tools/editor/editor_node.cpp msgid "Play custom scene" @@ -1737,19 +1722,20 @@ msgid "Debug options" msgstr "Параметры отладки" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Deploy with Remote Debug" -msgstr "Развернуть удалённую отладку" +msgstr "Развернуть с удалённой отладкой" #: tools/editor/editor_node.cpp msgid "" "When exporting or deploying, the resulting executable will attempt to connect " "to the IP of this computer in order to be debugged." msgstr "" +"При экспорте или развёртывании, полученный исполняемый файл будет пытаться " +"подключиться к IP этого компьютера с целью отладки." #: tools/editor/editor_node.cpp msgid "Small Deploy with Network FS" -msgstr "" +msgstr "Небольшое развёртывание через сеть" #: tools/editor/editor_node.cpp msgid "" @@ -1760,6 +1746,11 @@ msgid "" "On Android, deploy will use the USB cable for faster performance. This option " "speeds up testing for games with a large footprint." msgstr "" +"Когда эта опция включена, экспорт или развёртывание будет создавать " +"минимальный исполняемый файл.\n" +"Файловая система проекта будет предоставляться редактором через сеть.\n" +"На Android развёртывание будет быстрее при подключении через USB.\n" +"Эта опция ускоряет тестирование больших проектов." #: tools/editor/editor_node.cpp msgid "Visible Collision Shapes" @@ -1770,6 +1761,8 @@ msgid "" "Collision shapes and raycast nodes (for 2D and 3D) will be visible on the " "running game if this option is turned on." msgstr "" +"Когда эта опция включена, области соприкосновений и ноды Raycast(в 2D и 3D) " +"будут видимыми в запущенной игре." #: tools/editor/editor_node.cpp msgid "Visible Navigation" @@ -1780,10 +1773,12 @@ msgid "" "Navigation meshes and polygons will be visible on the running game if this " "option is turned on." msgstr "" +"Когда эта опция включена, навигационные полисетки и полигоны будут видимыми " +"в запущенной игре." #: tools/editor/editor_node.cpp msgid "Sync Scene Changes" -msgstr "" +msgstr "Синхронизация изменений на сцене" #: tools/editor/editor_node.cpp msgid "" @@ -1792,11 +1787,14 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"Когда эта опция включена, все изменения, внесённые на сцену, в редакторе " +"будут перенесены в запущенную игру.\n" +"При удалённом использовании на устройстве, это работает более эффективно с " +"сетевой файловой системой." #: tools/editor/editor_node.cpp -#, fuzzy msgid "Sync Script Changes" -msgstr "Обновлять при изменениях" +msgstr "Синхронизация изменений в скриптах" #: tools/editor/editor_node.cpp msgid "" @@ -1805,6 +1803,10 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"Когда эта опция включена, любой сохранённый скрипт будет перезагружен в " +"запущенную игру.\n" +"При удалённом использовании на устройстве, это работает более эффективно с " +"сетевой файловой системой." #: tools/editor/editor_node.cpp tools/editor/plugins/spatial_editor_plugin.cpp msgid "Settings" @@ -2068,9 +2070,8 @@ msgid "Imported Resources" msgstr "Импортированные ресурсы" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp -#, fuzzy msgid "No bit masks to import!" -msgstr "Нет элементов для импорта!" +msgstr "Нет битовой маски для импорта!" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -2100,9 +2101,8 @@ msgid "Save path is empty!" msgstr "Путь сохранения пуст!" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp -#, fuzzy msgid "Import BitMasks" -msgstr "Импорт текстур" +msgstr "Импорт битовой маски" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -2129,7 +2129,7 @@ msgstr "Принять" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp msgid "Bit Mask" -msgstr "" +msgstr "Битовая маска" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "No source font file!" @@ -2164,7 +2164,7 @@ msgid "The quick brown fox jumps over the lazy dog." msgstr "" "Съешь ещё этих мягких французских булок да выпей чаю. \n" "The quick brown fox jumps over the lazy dog.\n" -"0123456789`!@#$%^&*()_+-=\\/" +"0123456789`!@#$%^&*()_+-=\\/." #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Test:" @@ -2646,18 +2646,18 @@ msgid "MultiNode Set" msgstr "Мульти нодовый набор" #: tools/editor/node_dock.cpp -#, fuzzy msgid "Node" -msgstr "Mix Node" +msgstr "Нод" #: tools/editor/node_dock.cpp -#, fuzzy msgid "Groups" -msgstr "Группы:" +msgstr "Группы" #: tools/editor/node_dock.cpp msgid "Select a Node to edit Signals and Groups." msgstr "" +"Выберите нод для редактирования\n" +"сигналов и групп." #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Toggle Autoplay" @@ -2774,7 +2774,7 @@ msgstr "Загрузить анимацию с диска." #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Save the current animation" -msgstr "Сохранить текущую анимацию." +msgstr "Сохранить текущую анимацию" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Display list of animations in player." @@ -2925,39 +2925,39 @@ msgstr "Дерево анимации не действительно." #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Animation Node" -msgstr "Animation Node" +msgstr "Animation нод" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "OneShot Node" -msgstr "OneShot Node" +msgstr "OneShot нод" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Mix Node" -msgstr "Mix Node" +msgstr "Mix нод" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend2 Node" -msgstr "Blend2 Node" +msgstr "Blend2 нод" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend3 Node" -msgstr "Blend3 Node" +msgstr "Blend3 нод" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend4 Node" -msgstr "Blend4 Node" +msgstr "Blend4 нод" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "TimeScale Node" -msgstr "TimeScale Node" +msgstr "TimeScale нод" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "TimeSeek Node" -msgstr "TimeSeek Node" +msgstr "TimeSeek нод" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Transition Node" -msgstr "Transition Node" +msgstr "Transition нод" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Import Animations.." @@ -3971,14 +3971,12 @@ msgid "Auto Indent" msgstr "Автоотступ" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Reload Tool Script" -msgstr "Перезагрузить скрипты" +msgstr "Перезагрузить инструм. скрипт" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Reload Tool Script (Soft)" -msgstr "Перезагрузить скрипты" +msgstr "Перезагрузить инструм. скрипт (мягко)" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/shader_editor_plugin.cpp @@ -4635,20 +4633,20 @@ msgid "StyleBox Preview:" msgstr "StyleBox предпросмотр:" #: tools/editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Texture Region Editor" -msgstr "Редактор Области Спрайта" +msgstr "Редактор области текстуры" #: tools/editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Scale Region Editor" -msgstr "Редактор Области Спрайта" +msgstr "Редактор масштабируемой области текстуры" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "" "No texture in this node.\n" "Set a texture to be able to edit region." msgstr "" +"В этом ноде нет текстуры.\n" +"Выберите текстуру, чтобы редактировать область." #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Can't save theme to file:" @@ -5171,14 +5169,12 @@ msgid "Remove project from the list? (Folder contents will not be modified)" msgstr "Удалить проект из списка? (Содержимое папки не будет изменено)" #: tools/editor/project_manager.cpp -#, fuzzy msgid "Project Manager" -msgstr "Название проекта:" +msgstr "Менеджер проектов" #: tools/editor/project_manager.cpp -#, fuzzy msgid "Project List" -msgstr "Выйти в список проектов" +msgstr "Список проектов" #: tools/editor/project_manager.cpp msgid "Run" @@ -5198,7 +5194,7 @@ msgstr "Выход" #: tools/editor/project_settings.cpp msgid "Key " -msgstr "Кнопка" +msgstr "Кнопка " #: tools/editor/project_settings.cpp msgid "Joy Button" @@ -5334,14 +5330,12 @@ msgstr "" "константы." #: tools/editor/project_settings.cpp -#, fuzzy msgid "Autoload '%s' already exists!" -msgstr "Действие '%s' уже существует!" +msgstr "Автозагрузка '%s' уже существует!" #: tools/editor/project_settings.cpp -#, fuzzy msgid "Rename Autoload" -msgstr "Удалена автозагрузка" +msgstr "Переименовать автозагрузку" #: tools/editor/project_settings.cpp msgid "Toggle AutoLoad Globals" @@ -5691,9 +5685,7 @@ msgstr "Не могу работать с нодами из внешней сц #: tools/editor/scene_tree_dock.cpp msgid "Can't operate on nodes the current scene inherits from!" -msgstr "" -"Не могу работать с нодами текущей сцены, наследуемой откуда-то!\n" -"Очистите наследование, чтобы продолжить работу с ними." +msgstr "Невозможно работать с нодами текущей сцены, наследуемой откуда-то!" #: tools/editor/scene_tree_dock.cpp msgid "Remove Node(s)" @@ -5861,7 +5853,7 @@ msgstr "Файлы не выбраны!" #: tools/editor/scenes_dock.cpp msgid "Instance" -msgstr "Экземпляр" +msgstr "Добавить экземпляр" #: tools/editor/scenes_dock.cpp msgid "Edit Dependencies.." @@ -5872,9 +5864,8 @@ msgid "View Owners.." msgstr "Просмотреть владельцев.." #: tools/editor/scenes_dock.cpp -#, fuzzy msgid "Copy Path" -msgstr "Копировать параметры" +msgstr "Копировать путь" #: tools/editor/scenes_dock.cpp msgid "Rename or Move.." @@ -6050,7 +6041,7 @@ msgstr "Дерево сцены в реальном времени:" #: tools/editor/script_editor_debugger.cpp msgid "Remote Object Properties: " -msgstr "Параметры объекта:" +msgstr "Параметры объекта: " #: tools/editor/script_editor_debugger.cpp msgid "Profiler" @@ -6114,7 +6105,7 @@ msgstr "Установить из дерева нодов" #: tools/editor/settings_config_dialog.cpp msgid "Shortcuts" -msgstr "" +msgstr "Горячие клавиши" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Light Radius" |