diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/Godot.app/Contents/Info.plist | 4 | ||||
-rw-r--r-- | tools/editor/code_editor.cpp | 1 | ||||
-rw-r--r-- | tools/editor/dependency_editor.cpp | 181 | ||||
-rw-r--r-- | tools/editor/dependency_editor.h | 25 | ||||
-rw-r--r-- | tools/editor/editor_help.cpp | 2 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 25 | ||||
-rw-r--r-- | tools/editor/editor_node.h | 3 | ||||
-rw-r--r-- | tools/editor/plugins/canvas_item_editor_plugin.cpp | 12 | ||||
-rw-r--r-- | tools/editor/property_editor.cpp | 9 | ||||
-rw-r--r-- | tools/editor/scene_tree_editor.cpp | 1 | ||||
-rw-r--r-- | tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj | 2 | ||||
-rw-r--r-- | tools/ios_xcode_template/godot_ios/godot_ios-Info.plist | 2 | ||||
-rw-r--r-- | tools/ios_xcode_template/godot_ios/main.m | 35 | ||||
-rw-r--r-- | tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist | 2 | ||||
-rw-r--r-- | tools/ios_xcode_template/godot_iosTests/godot_iosTests.m | 35 |
15 files changed, 304 insertions, 35 deletions
diff --git a/tools/Godot.app/Contents/Info.plist b/tools/Godot.app/Contents/Info.plist index 3a4b51e2fe..8a89993fb9 100755 --- a/tools/Godot.app/Contents/Info.plist +++ b/tools/Godot.app/Contents/Info.plist @@ -13,7 +13,7 @@ <key>CFBundleIconFile</key> <string>Godot.icns</string> <key>CFBundleIdentifier</key> - <string>com.okamstudio.godot</string> + <string>org.godotengine.godot</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> @@ -61,7 +61,7 @@ <true/> <key>LSItemContentTypes</key> <array> - <string>com.okamstudio.scn</string> + <string>org.godotengine.scn</string> </array> </dict> </array> diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index 685763cadb..0728b3b7c1 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -614,6 +614,7 @@ CodeTextEditor::CodeTextEditor() { text_editor->add_font_override("font",get_font("source","Fonts")); text_editor->set_show_line_numbers(true); text_editor->set_brace_matching(true); + text_editor->set_auto_indent(true); line_col = memnew( Label ); add_child(line_col); diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp index c04e82a08a..7e63cfb1b4 100644 --- a/tools/editor/dependency_editor.cpp +++ b/tools/editor/dependency_editor.cpp @@ -510,3 +510,184 @@ DependencyErrorDialog::DependencyErrorDialog() { set_title("Errors loading!"); } + +////////////////////////////////////////////////////////////////////// + + + +void OrphanResourcesDialog::ok_pressed() { + + paths.clear(); + + _find_to_delete(files->get_root(),paths); + if (paths.empty()) + return; + + delete_confirm->set_text("Permanently Delete "+itos(paths.size())+" Item(s) ? (No Undo!!)"); + delete_confirm->popup_centered_minsize(); +} + +bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd,HashMap<String,int>& refs,TreeItem* p_parent){ + + + if (!efsd) + return false; + + bool has_childs=false; + + for(int i=0;i<efsd->get_subdir_count();i++) { + + TreeItem *dir_item=NULL; + if (p_parent) { + dir_item = files->create_item(p_parent); + dir_item->set_text(0,efsd->get_subdir(i)->get_name()); + dir_item->set_icon(0,get_icon("folder","FileDialog")); + + } + bool children = _fill_owners(efsd->get_subdir(i),refs,dir_item); + + if (p_parent) { + if (!children) { + memdelete(dir_item); + } else { + has_childs=true; + } + } + + } + + + for(int i=0;i<efsd->get_file_count();i++) { + + if (!p_parent) { + Vector<String> deps = efsd->get_file_deps(i); + //print_line(":::"+efsd->get_file_path(i)); + for(int j=0;j<deps.size();j++) { + + if (!refs.has(deps[j])) { + refs[deps[j]]=1; + } + } + } else { + + String path = efsd->get_file_path(i); + if (!refs.has(path)) { + TreeItem *ti=files->create_item(p_parent); + ti->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); + ti->set_text(0,efsd->get_file(i)); + ti->set_editable(0,true); + + String type=efsd->get_file_type(i); + + Ref<Texture> icon; + if (has_icon(type,"EditorIcons")) { + icon=get_icon(type,"EditorIcons"); + } else { + icon=get_icon("Object","EditorIcons"); + } + ti->set_icon(0,icon); + int ds = efsd->get_file_deps(i).size(); + ti->set_text(1,itos(ds)); + if (ds) { + ti->add_button(1,get_icon("Visible","EditorIcons")); + } + ti->set_metadata(0,path); + has_childs=true; + } + } + + } + + return has_childs; +} + + +void OrphanResourcesDialog::refresh() { + HashMap<String,int> refs; + _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(),refs,NULL); + files->clear(); + TreeItem *root=files->create_item(); + _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(),refs,root); +} + + +void OrphanResourcesDialog::show(){ + + refresh(); + popup_centered_ratio(); +} + + +void OrphanResourcesDialog::_find_to_delete(TreeItem* p_item,List<String>& paths) { + + while(p_item) { + + if (p_item->get_cell_mode(0)==TreeItem::CELL_MODE_CHECK && p_item->is_checked(0)) { + paths.push_back(p_item->get_metadata(0)); + } + + if (p_item->get_children()) { + _find_to_delete(p_item->get_children(),paths); + } + + p_item=p_item->get_next(); + } + + +} + +void OrphanResourcesDialog::_delete_confirm() { + + DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); + for (List<String>::Element *E=paths.front();E;E=E->next()) { + + da->remove(E->get()); + EditorFileSystem::get_singleton()->update_file(E->get()); + } + memdelete(da); + refresh(); +} + +void OrphanResourcesDialog::_button_pressed(Object *p_item,int p_column, int p_id) { + + TreeItem *ti=p_item->cast_to<TreeItem>(); + + String path = ti->get_metadata(0); + dep_edit->edit(path); + +} + +void OrphanResourcesDialog::_bind_methods() { + + ObjectTypeDB::bind_method(_MD("_delete_confirm"),&OrphanResourcesDialog::_delete_confirm); + ObjectTypeDB::bind_method(_MD("_button_pressed"),&OrphanResourcesDialog::_button_pressed); + +} + +OrphanResourcesDialog::OrphanResourcesDialog(){ + + VBoxContainer *vbc = memnew( VBoxContainer ); + add_child(vbc); + set_child_rect(vbc); + files = memnew( Tree ); + files->set_columns(2); + files->set_column_titles_visible(true); + files->set_column_min_width(1,100); + files->set_column_expand(0,true); + files->set_column_expand(1,false); + files->set_column_title(0,"Resource"); + files->set_column_title(1,"Owns"); + files->set_hide_root(true); + vbc->add_margin_child("Resources Without Explicit Ownership:",files,true); + set_title("Orphan Resource Explorer"); + delete_confirm = memnew( ConfirmationDialog ); + delete_confirm->set_text("Delete selected files?"); + get_ok()->set_text("Delete"); + add_child(delete_confirm); + dep_edit = memnew( DependencyEditor ); + add_child(dep_edit); + files->connect("button_pressed",this,"_button_pressed"); + delete_confirm->connect("confirmed",this,"_delete_confirm"); + set_hide_on_ok(false); + +} diff --git a/tools/editor/dependency_editor.h b/tools/editor/dependency_editor.h index 1c328e7a93..c372025ca0 100644 --- a/tools/editor/dependency_editor.h +++ b/tools/editor/dependency_editor.h @@ -91,4 +91,29 @@ public: DependencyErrorDialog(); }; + + +class OrphanResourcesDialog : public ConfirmationDialog { + OBJ_TYPE(OrphanResourcesDialog,ConfirmationDialog); + + DependencyEditor *dep_edit; + Tree *files; + ConfirmationDialog *delete_confirm; + void ok_pressed(); + + bool _fill_owners(EditorFileSystemDirectory *efsd, HashMap<String,int>& refs, TreeItem *p_parent); + + List<String> paths; + void _find_to_delete(TreeItem* p_item,List<String>& paths); + void _delete_confirm(); + void _button_pressed(Object *p_item,int p_column, int p_id); + + void refresh(); + static void _bind_methods(); +public: + + void show(); + OrphanResourcesDialog(); +}; + #endif // DEPENDENCY_EDITOR_H diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index 1a009214ac..a5a3890129 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -1097,7 +1097,7 @@ void EditorHelp::_help_callback(const String& p_topic) { line=constant_line[name]; } - class_desc->scroll_to_line(line); + class_desc->call_deferred("scroll_to_line", line); } diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 2db099d9bf..7b96db56f2 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2388,6 +2388,10 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { log->add_message("REDO: "+action); } break; + case TOOLS_ORPHAN_RESOURCES: { + + orphan_resources->show(); + } break; case EDIT_REVERT: { @@ -3543,13 +3547,14 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo if (p_set_inherited) { Ref<SceneState> state = sdata->get_state(); - state->set_path(lpath); + state->set_path(lpath); new_scene->set_scene_inherited_state(state); new_scene->set_filename(String()); - if (new_scene->get_scene_instance_state().is_valid()) - new_scene->get_scene_instance_state()->set_path(String()); + //if (new_scene->get_scene_instance_state().is_valid()) + // new_scene->get_scene_instance_state()->set_path(String()); } + new_scene->set_scene_instance_state(Ref<SceneState>()); set_edited_scene(new_scene); _get_scene_metadata(); @@ -5047,6 +5052,17 @@ EditorNode::EditorNode() { p=import_menu->get_popup(); p->connect("item_pressed",this,"_menu_option"); + tool_menu = memnew( MenuButton ); + tool_menu->set_tooltip("Miscelaneous project or scene wide tools."); + tool_menu->set_text("Tools"); + + //tool_menu->set_icon(gui_base->get_icon("Save","EditorIcons")); + left_menu_hb->add_child( tool_menu ); + + p=tool_menu->get_popup(); + p->connect("item_pressed",this,"_menu_option"); + p->add_item("Orphan Resource Explorer",TOOLS_ORPHAN_RESOURCES); + export_button = memnew( ToolButton ); export_button->set_tooltip("Export the project to many platforms."); export_button->set_text("Export"); @@ -5475,7 +5491,8 @@ EditorNode::EditorNode() { - + orphan_resources = memnew( OrphanResourcesDialog ); + gui_base->add_child(orphan_resources); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 2b91929b94..5cc9d9eaa2 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -133,6 +133,7 @@ class EditorNode : public Node { EDIT_UNDO, EDIT_REDO, EDIT_REVERT, + TOOLS_ORPHAN_RESOURCES, RESOURCE_NEW, RESOURCE_LOAD, RESOURCE_SAVE, @@ -237,6 +238,7 @@ class EditorNode : public Node { Control *viewport; MenuButton *file_menu; MenuButton *import_menu; + MenuButton *tool_menu; ToolButton *export_button; ToolButton *prev_scene; MenuButton *object_menu; @@ -333,6 +335,7 @@ class EditorNode : public Node { DependencyErrorDialog *dependency_error; DependencyEditor *dependency_fixer; + OrphanResourcesDialog *orphan_resources; TabContainer *dock_slot[DOCK_SLOT_MAX]; Rect2 dock_select_rect[DOCK_SLOT_MAX]; diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index e3f4edf967..a3164fc524 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -423,8 +423,6 @@ CanvasItem* CanvasItemEditor::_select_canvas_item_at_pos(const Point2& p_pos,Nod r=_select_canvas_item_at_pos(p_pos,p_node->get_child(i),p_parent_xform * c->get_transform(),p_canvas_xform); else { CanvasLayer *cl = p_node->cast_to<CanvasLayer>(); - if (cl) - return NULL; r=_select_canvas_item_at_pos(p_pos,p_node->get_child(i),transform ,cl ? cl->get_transform() : p_canvas_xform); //use base transform } @@ -433,7 +431,7 @@ CanvasItem* CanvasItemEditor::_select_canvas_item_at_pos(const Point2& p_pos,Nod } - if (c && c->is_visible() && !c->has_meta("_edit_lock_")) { + if (c && c->is_visible() && !c->has_meta("_edit_lock_") && !c->cast_to<CanvasLayer>()) { Rect2 rect = c->get_item_rect(); Point2 local_pos = (p_parent_xform * p_canvas_xform * c->get_transform()).affine_inverse().xform(p_pos); @@ -461,14 +459,12 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos,Node* p_nod _find_canvas_items_at_pos(p_pos,p_node->get_child(i),p_parent_xform * c->get_transform(),p_canvas_xform, r_items); else { CanvasLayer *cl = p_node->cast_to<CanvasLayer>(); - if (cl) - return; _find_canvas_items_at_pos(p_pos,p_node->get_child(i),transform ,cl ? cl->get_transform() : p_canvas_xform, r_items); //use base transform } } - if (c && c->is_visible() && !c->has_meta("_edit_lock_")) { + if (c && c->is_visible() && !c->has_meta("_edit_lock_") && !c->cast_to<CanvasLayer>()) { Rect2 rect = c->get_item_rect(); Point2 local_pos = (p_parent_xform * p_canvas_xform * c->get_transform()).affine_inverse().xform(p_pos); @@ -505,14 +501,12 @@ void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2& p_rect,Node* p_no _find_canvas_items_at_rect(p_rect,p_node->get_child(i),p_parent_xform * c->get_transform(),p_canvas_xform,r_items); else { CanvasLayer *cl = p_node->cast_to<CanvasLayer>(); - if (cl) - return; _find_canvas_items_at_rect(p_rect,p_node->get_child(i),transform,cl?cl->get_transform():p_canvas_xform,r_items); } } - if (c && c->is_visible() && !c->has_meta("_edit_lock_")) { + if (c && c->is_visible() && !c->has_meta("_edit_lock_") && !c->cast_to<CanvasLayer>()) { Rect2 rect = c->get_item_rect(); Matrix32 xform = p_parent_xform * p_canvas_xform * c->get_transform(); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 31393ebcbc..0fe3dee2ea 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -1361,7 +1361,7 @@ void CustomPropertyEditor::_modified(String p_string) { } break; case Variant::MATRIX32: { - Matrix3 m; + Matrix32 m; for(int i=0;i<6;i++) { m.elements[i/2][i%2]=value_editor[i]->get_text().to_double(); @@ -2846,6 +2846,13 @@ void PropertyEditor::update_tree() { item->set_icon( 0,get_icon("Vector","EditorIcons") ); } break; + case Variant::MATRIX32: + case Variant::MATRIX3: { + + item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); + item->set_editable( 1, true ); + item->set_text(1, obj->get(p.name)); + } break; case Variant::TRANSFORM: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index ac2f76acdc..6575603073 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -565,7 +565,6 @@ void SceneTreeEditor::_notification(int p_what) { get_tree()->disconnect("node_removed",this,"_node_removed"); tree->disconnect("item_collapsed",this,"_cell_collapsed"); clear_inherit_confirm->disconnect("confirmed",this,"_subscene_option"); - _update_tree(); } } diff --git a/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj b/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj index 7cd4da0f4a..4ae1ec8a53 100644 --- a/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj +++ b/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj @@ -192,7 +192,7 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 0500; - ORGANIZATIONNAME = Okam; + ORGANIZATIONNAME = GodotEngine; TargetAttributes = { D0BCFE5F18AEBDA3004A7AAE = { TestTargetID = D0BCFE3318AEBDA2004A7AAE; diff --git a/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist b/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist index f34ebb97f0..357970920a 100644 --- a/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist +++ b/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist @@ -9,7 +9,7 @@ <key>CFBundleExecutable</key> <string>godot_opt.iphone</string> <key>CFBundleIdentifier</key> - <string>com.okamstudios.${PRODUCT_NAME:rfc1034identifier}</string> + <string>org.godotengine.${PRODUCT_NAME:rfc1034identifier}</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> diff --git a/tools/ios_xcode_template/godot_ios/main.m b/tools/ios_xcode_template/godot_ios/main.m index dca55f40ce..6bb6bc2188 100644 --- a/tools/ios_xcode_template/godot_ios/main.m +++ b/tools/ios_xcode_template/godot_ios/main.m @@ -1,10 +1,31 @@ -// -// main.m -// godot_ios -// -// Created by Ariel m on 2/14/14. -// Copyright (c) 2014 Okam. All rights reserved. -// +/*************************************************************************/ +/* main.m */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2015 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. */ +/*************************************************************************/ #import <UIKit/UIKit.h> diff --git a/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist b/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist index 3b3eec9a51..0f69aa80eb 100644 --- a/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist +++ b/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist @@ -7,7 +7,7 @@ <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIdentifier</key> - <string>com.okamstudios.${PRODUCT_NAME:rfc1034identifier}</string> + <string>org.godotengine.${PRODUCT_NAME:rfc1034identifier}</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> diff --git a/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m b/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m index fce6288670..75e44659e0 100644 --- a/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m +++ b/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m @@ -1,10 +1,31 @@ -// -// godot_iosTests.m -// godot_iosTests -// -// Created by Ariel m on 2/14/14. -// Copyright (c) 2014 Okam. All rights reserved. -// +/*************************************************************************/ +/* godot_iosTests.m */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2015 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. */ +/*************************************************************************/ #import <XCTest/XCTest.h> |