summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/SCsub160
-rw-r--r--tools/editor/animation_editor.cpp381
-rw-r--r--tools/editor/animation_editor.h15
-rw-r--r--tools/editor/array_property_edit.cpp60
-rw-r--r--tools/editor/array_property_edit.h9
-rw-r--r--tools/editor/asset_library_editor_plugin.cpp128
-rw-r--r--tools/editor/asset_library_editor_plugin.h28
-rw-r--r--tools/editor/call_dialog.cpp31
-rw-r--r--tools/editor/call_dialog.h6
-rw-r--r--tools/editor/code_editor.cpp119
-rw-r--r--tools/editor/code_editor.h13
-rw-r--r--tools/editor/connections_dialog.cpp72
-rw-r--r--tools/editor/connections_dialog.h12
-rw-r--r--tools/editor/create_dialog.cpp93
-rw-r--r--tools/editor/create_dialog.h6
-rw-r--r--tools/editor/dependency_editor.cpp22
-rw-r--r--tools/editor/dependency_editor.h12
-rw-r--r--tools/editor/doc_code_font.h2
-rw-r--r--tools/editor/doc_font.h2
-rw-r--r--tools/editor/doc_title_font.h2
-rw-r--r--tools/editor/editor_asset_installer.cpp8
-rw-r--r--tools/editor/editor_asset_installer.h4
-rw-r--r--tools/editor/editor_autoload_settings.cpp108
-rw-r--r--tools/editor/editor_autoload_settings.h4
-rw-r--r--tools/editor/editor_data.cpp30
-rw-r--r--tools/editor/editor_data.h4
-rw-r--r--tools/editor/editor_dir_dialog.cpp22
-rw-r--r--tools/editor/editor_dir_dialog.h4
-rw-r--r--tools/editor/editor_file_dialog.cpp188
-rw-r--r--tools/editor/editor_file_dialog.h10
-rw-r--r--tools/editor/editor_file_system.cpp60
-rw-r--r--tools/editor/editor_file_system.h8
-rw-r--r--tools/editor/editor_fonts.cpp18
-rw-r--r--tools/editor/editor_fonts.h2
-rw-r--r--tools/editor/editor_help.cpp499
-rw-r--r--tools/editor/editor_help.h12
-rw-r--r--tools/editor/editor_icons.h2
-rw-r--r--tools/editor/editor_import_export.cpp169
-rw-r--r--tools/editor/editor_import_export.h16
-rw-r--r--tools/editor/editor_initialize_ssl.cpp9
-rw-r--r--tools/editor/editor_initialize_ssl.h2
-rw-r--r--tools/editor/editor_log.cpp32
-rw-r--r--tools/editor/editor_log.h12
-rw-r--r--tools/editor/editor_name_dialog.cpp8
-rw-r--r--tools/editor/editor_name_dialog.h6
-rw-r--r--tools/editor/editor_node.cpp616
-rw-r--r--tools/editor/editor_node.h19
-rw-r--r--tools/editor/editor_path.cpp112
-rw-r--r--tools/editor/editor_path.h12
-rw-r--r--tools/editor/editor_plugin.cpp104
-rw-r--r--tools/editor/editor_plugin.h11
-rw-r--r--tools/editor/editor_plugin_settings.cpp8
-rw-r--r--tools/editor/editor_plugin_settings.h4
-rw-r--r--tools/editor/editor_profiler.cpp48
-rw-r--r--tools/editor/editor_profiler.h8
-rw-r--r--tools/editor/editor_reimport_dialog.cpp4
-rw-r--r--tools/editor/editor_reimport_dialog.h4
-rw-r--r--tools/editor/editor_resource_preview.cpp30
-rw-r--r--tools/editor/editor_resource_preview.h6
-rw-r--r--tools/editor/editor_run.cpp38
-rw-r--r--tools/editor/editor_run.h4
-rw-r--r--tools/editor/editor_run_native.cpp29
-rw-r--r--tools/editor/editor_run_native.h4
-rw-r--r--tools/editor/editor_run_script.cpp8
-rw-r--r--tools/editor/editor_run_script.h4
-rw-r--r--tools/editor/editor_settings.cpp454
-rw-r--r--tools/editor/editor_settings.h7
-rw-r--r--tools/editor/editor_sub_scene.cpp16
-rw-r--r--tools/editor/editor_sub_scene.h4
-rw-r--r--tools/editor/editor_themes.cpp6
-rw-r--r--tools/editor/editor_themes.h2
-rw-r--r--tools/editor/file_type_cache.cpp6
-rw-r--r--tools/editor/file_type_cache.h4
-rw-r--r--tools/editor/fileserver/SCsub4
-rw-r--r--tools/editor/fileserver/editor_file_server.cpp12
-rw-r--r--tools/editor/fileserver/editor_file_server.h4
-rw-r--r--tools/editor/filesystem_dock.cpp174
-rw-r--r--tools/editor/filesystem_dock.h14
-rw-r--r--tools/editor/groups_editor.cpp8
-rw-r--r--tools/editor/groups_editor.h4
-rw-r--r--tools/editor/icons/2x/icon_bit_map.pngbin0 -> 148 bytes
-rw-r--r--tools/editor/icons/2x/icon_cube_map.pngbin0 -> 159 bytes
-rw-r--r--tools/editor/icons/2x/icon_curve_2d.pngbin0 -> 591 bytes
-rw-r--r--tools/editor/icons/2x/icon_curve_3d.pngbin0 -> 522 bytes
-rw-r--r--tools/editor/icons/2x/icon_environment.pngbin0 -> 1270 bytes
-rw-r--r--tools/editor/icons/2x/icon_fixed_spatial_material.pngbin0 -> 1619 bytes
-rw-r--r--tools/editor/icons/2x/icon_g_i_probe.pngbin0 -> 680 bytes
-rw-r--r--tools/editor/icons/2x/icon_g_i_probe_data.pngbin0 -> 662 bytes
-rw-r--r--tools/editor/icons/2x/icon_image_sky_box.pngbin0 -> 904 bytes
-rw-r--r--tools/editor/icons/2x/icon_interp_wrap_clamp.pngbin0 -> 348 bytes
-rw-r--r--tools/editor/icons/2x/icon_interp_wrap_loop.pngbin0 -> 548 bytes
-rw-r--r--tools/editor/icons/2x/icon_joypad.png (renamed from tools/editor/icons/2x/icon_joystick.png)bin380 -> 380 bytes
-rw-r--r--tools/editor/icons/2x/icon_large_texture.pngbin0 -> 211 bytes
-rw-r--r--tools/editor/icons/2x/icon_load.pngbin228 -> 523 bytes
-rw-r--r--tools/editor/icons/2x/icon_mesh_library.pngbin0 -> 631 bytes
-rw-r--r--tools/editor/icons/2x/icon_navigation_mesh.pngbin0 -> 806 bytes
-rw-r--r--tools/editor/icons/2x/icon_navigation_polygon.pngbin0 -> 640 bytes
-rw-r--r--tools/editor/icons/2x/icon_packed_data_container.pngbin0 -> 253 bytes
-rw-r--r--tools/editor/icons/2x/icon_particles_shader.pngbin0 -> 657 bytes
-rw-r--r--tools/editor/icons/2x/icon_patch_9_rect.png (renamed from tools/editor/icons/2x/icon_patch_9_frame.png)bin162 -> 162 bytes
-rw-r--r--tools/editor/icons/2x/icon_polygon_path_finder.pngbin0 -> 491 bytes
-rw-r--r--tools/editor/icons/2x/icon_reference_rect.png (renamed from tools/editor/icons/2x/icon_reference_frame.png)bin160 -> 160 bytes
-rw-r--r--tools/editor/icons/2x/icon_reflection_probe.pngbin0 -> 533 bytes
-rw-r--r--tools/editor/icons/2x/icon_room.pngbin666 -> 567 bytes
-rw-r--r--tools/editor/icons/2x/icon_room_bounds.pngbin0 -> 631 bytes
-rw-r--r--tools/editor/icons/2x/icon_sample_library.pngbin0 -> 568 bytes
-rw-r--r--tools/editor/icons/2x/icon_script_create.pngbin0 -> 491 bytes
-rw-r--r--tools/editor/icons/2x/icon_short_cut.pngbin0 -> 473 bytes
-rw-r--r--tools/editor/icons/2x/icon_spatial_shader.pngbin0 -> 704 bytes
-rw-r--r--tools/editor/icons/2x/icon_sprite_frames.pngbin0 -> 691 bytes
-rw-r--r--tools/editor/icons/2x/icon_style_box_empty.pngbin0 -> 555 bytes
-rw-r--r--tools/editor/icons/2x/icon_style_box_flat.pngbin0 -> 695 bytes
-rw-r--r--tools/editor/icons/2x/icon_style_box_texture.pngbin0 -> 693 bytes
-rw-r--r--tools/editor/icons/2x/icon_test_cube.pngbin612 -> 596 bytes
-rw-r--r--tools/editor/icons/2x/icon_texture_rect.png (renamed from tools/editor/icons/2x/icon_texture_frame.png)bin201 -> 201 bytes
-rw-r--r--tools/editor/icons/2x/icon_theme.pngbin0 -> 809 bytes
-rw-r--r--tools/editor/icons/2x/icon_tile_set.pngbin0 -> 242 bytes
-rw-r--r--tools/editor/icons/2x/icon_viewport_texture.pngbin0 -> 404 bytes
-rw-r--r--tools/editor/icons/2x/icon_world.pngbin0 -> 502 bytes
-rw-r--r--tools/editor/icons/2x/icon_world_2d.pngbin0 -> 584 bytes
-rw-r--r--tools/editor/icons/SCsub130
-rw-r--r--tools/editor/icons/icon_bit_map.pngbin0 -> 113 bytes
-rw-r--r--tools/editor/icons/icon_cube_map.pngbin0 -> 134 bytes
-rw-r--r--tools/editor/icons/icon_curve_2d.pngbin0 -> 342 bytes
-rw-r--r--tools/editor/icons/icon_curve_3d.pngbin0 -> 336 bytes
-rw-r--r--tools/editor/icons/icon_environment.pngbin0 -> 588 bytes
-rw-r--r--tools/editor/icons/icon_fixed_spatial_material.pngbin0 -> 681 bytes
-rw-r--r--tools/editor/icons/icon_g_i_probe.pngbin0 -> 341 bytes
-rw-r--r--tools/editor/icons/icon_g_i_probe_data.pngbin0 -> 350 bytes
-rw-r--r--tools/editor/icons/icon_image_sky_box.pngbin0 -> 434 bytes
-rw-r--r--tools/editor/icons/icon_interp_wrap_clamp.pngbin0 -> 233 bytes
-rw-r--r--tools/editor/icons/icon_interp_wrap_loop.pngbin0 -> 309 bytes
-rw-r--r--tools/editor/icons/icon_joypad.png (renamed from tools/editor/icons/icon_joystick.png)bin239 -> 239 bytes
-rw-r--r--tools/editor/icons/icon_large_texture.pngbin0 -> 156 bytes
-rw-r--r--tools/editor/icons/icon_load.pngbin170 -> 271 bytes
-rw-r--r--tools/editor/icons/icon_mesh_library.pngbin0 -> 349 bytes
-rw-r--r--tools/editor/icons/icon_navigation_mesh.pngbin0 -> 450 bytes
-rw-r--r--tools/editor/icons/icon_navigation_polygon.pngbin0 -> 384 bytes
-rw-r--r--tools/editor/icons/icon_packed_data_container.pngbin0 -> 176 bytes
-rw-r--r--tools/editor/icons/icon_particles_shader.pngbin0 -> 367 bytes
-rw-r--r--tools/editor/icons/icon_patch_9_rect.png (renamed from tools/editor/icons/icon_patch_9_frame.png)bin128 -> 128 bytes
-rw-r--r--tools/editor/icons/icon_polygon_path_finder.pngbin0 -> 307 bytes
-rw-r--r--tools/editor/icons/icon_reference_rect.png (renamed from tools/editor/icons/icon_reference_frame.png)bin128 -> 128 bytes
-rw-r--r--tools/editor/icons/icon_reflection_probe.pngbin0 -> 370 bytes
-rw-r--r--tools/editor/icons/icon_room.pngbin333 -> 375 bytes
-rw-r--r--tools/editor/icons/icon_room_bounds.pngbin0 -> 363 bytes
-rw-r--r--tools/editor/icons/icon_sample_library.pngbin0 -> 333 bytes
-rw-r--r--tools/editor/icons/icon_script_create.pngbin0 -> 288 bytes
-rw-r--r--tools/editor/icons/icon_short_cut.pngbin0 -> 272 bytes
-rw-r--r--tools/editor/icons/icon_spatial_shader.pngbin0 -> 483 bytes
-rw-r--r--tools/editor/icons/icon_sprite_frames.pngbin0 -> 332 bytes
-rw-r--r--tools/editor/icons/icon_style_box_empty.pngbin0 -> 333 bytes
-rw-r--r--tools/editor/icons/icon_style_box_flat.pngbin0 -> 398 bytes
-rw-r--r--tools/editor/icons/icon_style_box_texture.pngbin0 -> 411 bytes
-rw-r--r--tools/editor/icons/icon_test_cube.pngbin392 -> 435 bytes
-rw-r--r--tools/editor/icons/icon_texture_rect.png (renamed from tools/editor/icons/icon_texture_frame.png)bin158 -> 158 bytes
-rw-r--r--tools/editor/icons/icon_theme.pngbin0 -> 451 bytes
-rw-r--r--tools/editor/icons/icon_tile_set.pngbin0 -> 174 bytes
-rw-r--r--tools/editor/icons/icon_viewport_texture.pngbin0 -> 227 bytes
-rw-r--r--tools/editor/icons/icon_world.pngbin0 -> 254 bytes
-rw-r--r--tools/editor/icons/icon_world_2d.pngbin0 -> 328 bytes
-rw-r--r--tools/editor/icons/source/icon_bit_map.svg82
-rw-r--r--tools/editor/icons/source/icon_cube_map.svg120
-rw-r--r--tools/editor/icons/source/icon_curve_2d.svg82
-rw-r--r--tools/editor/icons/source/icon_curve_3d.svg82
-rw-r--r--tools/editor/icons/source/icon_environment.svg82
-rw-r--r--tools/editor/icons/source/icon_fixed_spatial_material.svg147
-rw-r--r--tools/editor/icons/source/icon_g_i_probe.svg110
-rw-r--r--tools/editor/icons/source/icon_g_i_probe_data.svg108
-rw-r--r--tools/editor/icons/source/icon_image_sky_box.svg116
-rw-r--r--tools/editor/icons/source/icon_interp_wrap_clamp.svg110
-rw-r--r--tools/editor/icons/source/icon_interp_wrap_loop.svg121
-rw-r--r--tools/editor/icons/source/icon_joypad.svg (renamed from tools/editor/icons/source/icon_joystick.svg)2
-rw-r--r--tools/editor/icons/source/icon_large_texture.svg80
-rw-r--r--tools/editor/icons/source/icon_load.svg147
-rw-r--r--tools/editor/icons/source/icon_mesh_library.svg78
-rw-r--r--tools/editor/icons/source/icon_navigation_mesh.svg78
-rw-r--r--tools/editor/icons/source/icon_navigation_polygon.svg88
-rw-r--r--tools/editor/icons/source/icon_packed_data_container.svg138
-rw-r--r--tools/editor/icons/source/icon_particles_shader.svg159
-rw-r--r--tools/editor/icons/source/icon_patch_9_rect.svg (renamed from tools/editor/icons/source/icon_patch_9_frame.svg)2
-rw-r--r--tools/editor/icons/source/icon_polygon_path_finder.svg77
-rw-r--r--tools/editor/icons/source/icon_reference_rect.svg (renamed from tools/editor/icons/source/icon_reference_frame.svg)2
-rw-r--r--tools/editor/icons/source/icon_reflection_probe.svg82
-rw-r--r--tools/editor/icons/source/icon_room.svg29
-rw-r--r--tools/editor/icons/source/icon_room_bounds.svg78
-rw-r--r--tools/editor/icons/source/icon_sample_library.svg87
-rw-r--r--tools/editor/icons/source/icon_script_create.svg99
-rw-r--r--tools/editor/icons/source/icon_shader.svg130
-rw-r--r--tools/editor/icons/source/icon_short_cut.svg89
-rw-r--r--tools/editor/icons/source/icon_spatial_shader.svg165
-rw-r--r--tools/editor/icons/source/icon_sprite_frames.svg119
-rw-r--r--tools/editor/icons/source/icon_style_box_empty.svg140
-rw-r--r--tools/editor/icons/source/icon_style_box_flat.svg149
-rw-r--r--tools/editor/icons/source/icon_style_box_texture.svg140
-rw-r--r--tools/editor/icons/source/icon_test_cube.svg20
-rw-r--r--tools/editor/icons/source/icon_texture_rect.svg (renamed from tools/editor/icons/source/icon_texture_frame.svg)2
-rw-r--r--tools/editor/icons/source/icon_theme.svg144
-rw-r--r--tools/editor/icons/source/icon_tile_set.svg80
-rw-r--r--tools/editor/icons/source/icon_viewport_texture.svg80
-rw-r--r--tools/editor/icons/source/icon_world.svg89
-rw-r--r--tools/editor/icons/source/icon_world_2d.svg82
-rw-r--r--tools/editor/inspector_dock.cpp2
-rw-r--r--tools/editor/inspector_dock.h4
-rw-r--r--tools/editor/io_plugins/SCsub4
-rw-r--r--tools/editor/io_plugins/editor_atlas.cpp2
-rw-r--r--tools/editor/io_plugins/editor_atlas.h2
-rw-r--r--tools/editor/io_plugins/editor_bitmask_import_plugin.cpp26
-rw-r--r--tools/editor/io_plugins/editor_bitmask_import_plugin.h4
-rw-r--r--tools/editor/io_plugins/editor_export_scene.cpp6
-rw-r--r--tools/editor/io_plugins/editor_export_scene.h4
-rw-r--r--tools/editor/io_plugins/editor_font_import_plugin.cpp126
-rw-r--r--tools/editor/io_plugins/editor_font_import_plugin.h4
-rw-r--r--tools/editor/io_plugins/editor_import_collada.cpp317
-rw-r--r--tools/editor/io_plugins/editor_import_collada.h4
-rw-r--r--tools/editor/io_plugins/editor_mesh_import_plugin.cpp22
-rw-r--r--tools/editor/io_plugins/editor_mesh_import_plugin.h4
-rw-r--r--tools/editor/io_plugins/editor_sample_import_plugin.cpp66
-rw-r--r--tools/editor/io_plugins/editor_sample_import_plugin.h8
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp186
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.h11
-rw-r--r--tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp61
-rw-r--r--tools/editor/io_plugins/editor_scene_importer_fbxconv.h6
-rw-r--r--tools/editor/io_plugins/editor_texture_import_plugin.cpp243
-rw-r--r--tools/editor/io_plugins/editor_texture_import_plugin.h10
-rw-r--r--tools/editor/io_plugins/editor_translation_import_plugin.cpp26
-rw-r--r--tools/editor/io_plugins/editor_translation_import_plugin.h4
-rw-r--r--tools/editor/multi_node_edit.cpp11
-rw-r--r--tools/editor/multi_node_edit.h4
-rw-r--r--tools/editor/node_dock.cpp4
-rw-r--r--tools/editor/node_dock.h2
-rw-r--r--tools/editor/output_strings.cpp14
-rw-r--r--tools/editor/output_strings.h4
-rw-r--r--tools/editor/pane_drag.cpp6
-rw-r--r--tools/editor/pane_drag.h6
-rw-r--r--tools/editor/plugins/SCsub4
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.cpp140
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.h10
-rw-r--r--tools/editor/plugins/animation_tree_editor_plugin.cpp116
-rw-r--r--tools/editor/plugins/animation_tree_editor_plugin.h8
-rw-r--r--tools/editor/plugins/baked_light_baker.cpp96
-rw-r--r--tools/editor/plugins/baked_light_baker.h18
-rw-r--r--tools/editor/plugins/baked_light_baker_cmpxchg.cpp2
-rw-r--r--tools/editor/plugins/baked_light_editor_plugin.cpp25
-rw-r--r--tools/editor/plugins/baked_light_editor_plugin.h16
-rw-r--r--tools/editor/plugins/camera_editor_plugin.cpp10
-rw-r--r--tools/editor/plugins/camera_editor_plugin.h8
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp775
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.h83
-rw-r--r--tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp20
-rw-r--r--tools/editor/plugins/collision_polygon_2d_editor_plugin.h10
-rw-r--r--tools/editor/plugins/collision_polygon_editor_plugin.cpp41
-rw-r--r--tools/editor/plugins/collision_polygon_editor_plugin.h18
-rw-r--r--tools/editor/plugins/collision_shape_2d_editor_plugin.cpp14
-rw-r--r--tools/editor/plugins/collision_shape_2d_editor_plugin.h10
-rw-r--r--tools/editor/plugins/color_ramp_editor_plugin.cpp10
-rw-r--r--tools/editor/plugins/color_ramp_editor_plugin.h4
-rw-r--r--tools/editor/plugins/cube_grid_theme_editor_plugin.cpp25
-rw-r--r--tools/editor/plugins/cube_grid_theme_editor_plugin.h9
-rw-r--r--tools/editor/plugins/editor_preview_plugins.cpp91
-rw-r--r--tools/editor/plugins/editor_preview_plugins.h5
-rw-r--r--tools/editor/plugins/gi_probe_editor_plugin.cpp57
-rw-r--r--tools/editor/plugins/gi_probe_editor_plugin.h37
-rw-r--r--tools/editor/plugins/item_list_editor_plugin.cpp20
-rw-r--r--tools/editor/plugins/item_list_editor_plugin.h12
-rw-r--r--tools/editor/plugins/light_occluder_2d_editor_plugin.cpp22
-rw-r--r--tools/editor/plugins/light_occluder_2d_editor_plugin.h10
-rw-r--r--tools/editor/plugins/material_editor_plugin.cpp35
-rw-r--r--tools/editor/plugins/material_editor_plugin.h9
-rw-r--r--tools/editor/plugins/mesh_editor_plugin.cpp18
-rw-r--r--tools/editor/plugins/mesh_editor_plugin.h11
-rw-r--r--tools/editor/plugins/mesh_instance_editor_plugin.cpp14
-rw-r--r--tools/editor/plugins/mesh_instance_editor_plugin.h4
-rw-r--r--tools/editor/plugins/multimesh_editor_plugin.cpp73
-rw-r--r--tools/editor/plugins/multimesh_editor_plugin.h6
-rw-r--r--tools/editor/plugins/navigation_polygon_editor_plugin.cpp40
-rw-r--r--tools/editor/plugins/navigation_polygon_editor_plugin.h12
-rw-r--r--tools/editor/plugins/particles_2d_editor_plugin.cpp30
-rw-r--r--tools/editor/plugins/particles_2d_editor_plugin.h4
-rw-r--r--tools/editor/plugins/particles_editor_plugin.cpp25
-rw-r--r--tools/editor/plugins/particles_editor_plugin.h11
-rw-r--r--tools/editor/plugins/path_2d_editor_plugin.cpp30
-rw-r--r--tools/editor/plugins/path_2d_editor_plugin.h10
-rw-r--r--tools/editor/plugins/path_editor_plugin.cpp32
-rw-r--r--tools/editor/plugins/path_editor_plugin.h17
-rw-r--r--tools/editor/plugins/polygon_2d_editor_plugin.cpp113
-rw-r--r--tools/editor/plugins/polygon_2d_editor_plugin.h14
-rw-r--r--tools/editor/plugins/resource_preloader_editor_plugin.cpp50
-rw-r--r--tools/editor/plugins/resource_preloader_editor_plugin.h8
-rw-r--r--tools/editor/plugins/rich_text_editor_plugin.cpp10
-rw-r--r--tools/editor/plugins/rich_text_editor_plugin.h6
-rw-r--r--tools/editor/plugins/sample_editor_plugin.cpp32
-rw-r--r--tools/editor/plugins/sample_editor_plugin.h10
-rw-r--r--tools/editor/plugins/sample_library_editor_plugin.cpp48
-rw-r--r--tools/editor/plugins/sample_library_editor_plugin.h10
-rw-r--r--tools/editor/plugins/sample_player_editor_plugin.cpp8
-rw-r--r--tools/editor/plugins/sample_player_editor_plugin.h6
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp255
-rw-r--r--tools/editor/plugins/script_editor_plugin.h16
-rw-r--r--tools/editor/plugins/script_text_editor.cpp255
-rw-r--r--tools/editor/plugins/script_text_editor.h17
-rw-r--r--tools/editor/plugins/shader_editor_plugin.cpp312
-rw-r--r--tools/editor/plugins/shader_editor_plugin.h31
-rw-r--r--tools/editor/plugins/shader_graph_editor_plugin.cpp154
-rw-r--r--tools/editor/plugins/shader_graph_editor_plugin.h20
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp495
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.h35
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.cpp64
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.h10
-rw-r--r--tools/editor/plugins/stream_editor_plugin.cpp8
-rw-r--r--tools/editor/plugins/stream_editor_plugin.h6
-rw-r--r--tools/editor/plugins/style_box_editor_plugin.cpp14
-rw-r--r--tools/editor/plugins/style_box_editor_plugin.h8
-rw-r--r--tools/editor/plugins/texture_editor_plugin.cpp12
-rw-r--r--tools/editor/plugins/texture_editor_plugin.h6
-rw-r--r--tools/editor/plugins/texture_region_editor_plugin.cpp110
-rw-r--r--tools/editor/plugins/texture_region_editor_plugin.h14
-rw-r--r--tools/editor/plugins/theme_editor_plugin.cpp38
-rw-r--r--tools/editor/plugins/theme_editor_plugin.h8
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.cpp189
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.h27
-rw-r--r--tools/editor/plugins/tile_set_editor_plugin.cpp14
-rw-r--r--tools/editor/plugins/tile_set_editor_plugin.h6
-rw-r--r--tools/editor/progress_dialog.cpp22
-rw-r--r--tools/editor/progress_dialog.h6
-rw-r--r--tools/editor/project_export.cpp387
-rw-r--r--tools/editor/project_export.h21
-rw-r--r--tools/editor/project_manager.cpp214
-rw-r--r--tools/editor/project_manager.h12
-rw-r--r--tools/editor/project_settings.cpp308
-rw-r--r--tools/editor/project_settings.h4
-rw-r--r--tools/editor/property_editor.cpp655
-rw-r--r--tools/editor/property_editor.h27
-rw-r--r--tools/editor/property_selector.cpp34
-rw-r--r--tools/editor/property_selector.h2
-rw-r--r--tools/editor/pvrtc_compress.cpp8
-rw-r--r--tools/editor/pvrtc_compress.h2
-rw-r--r--tools/editor/quick_open.cpp16
-rw-r--r--tools/editor/quick_open.h4
-rw-r--r--tools/editor/register_exporters.h2
-rw-r--r--tools/editor/reparent_dialog.cpp8
-rw-r--r--tools/editor/reparent_dialog.h4
-rw-r--r--tools/editor/resources_dock.cpp36
-rw-r--r--tools/editor/resources_dock.h4
-rw-r--r--tools/editor/run_settings_dialog.cpp8
-rw-r--r--tools/editor/run_settings_dialog.h4
-rw-r--r--tools/editor/scene_tree_dock.cpp320
-rw-r--r--tools/editor/scene_tree_dock.h15
-rw-r--r--tools/editor/scene_tree_editor.cpp161
-rw-r--r--tools/editor/scene_tree_editor.h14
-rw-r--r--tools/editor/script_create_dialog.cpp164
-rw-r--r--tools/editor/script_create_dialog.h10
-rw-r--r--tools/editor/script_editor_debugger.cpp123
-rw-r--r--tools/editor/script_editor_debugger.h5
-rw-r--r--tools/editor/settings_config_dialog.cpp28
-rw-r--r--tools/editor/settings_config_dialog.h4
-rw-r--r--tools/editor/spatial_editor_gizmos.cpp619
-rw-r--r--tools/editor/spatial_editor_gizmos.h148
358 files changed, 11524 insertions, 5771 deletions
diff --git a/tools/editor/SCsub b/tools/editor/SCsub
index 34651b36f2..caf45d25be 100644
--- a/tools/editor/SCsub
+++ b/tools/editor/SCsub
@@ -1,86 +1,80 @@
-Import('env')
-
-
-def make_doc_header(target,source,env):
-
- src = source[0].srcnode().abspath
- dst = target[0].srcnode().abspath
- f = open(src,"rb")
- g = open(dst,"wb")
- buf = f.read()
- decomp_size = len(buf)
- import zlib
- buf = zlib.compress(buf)
-
-
- g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
- g.write("#ifndef _DOC_DATA_RAW_H\n")
- g.write("#define _DOC_DATA_RAW_H\n")
- g.write("static const int _doc_data_compressed_size="+str(len(buf))+";\n")
- g.write("static const int _doc_data_uncompressed_size="+str(decomp_size)+";\n")
- g.write("static const unsigned char _doc_data_compressed[]={\n")
- for i in range(len(buf)):
- g.write(str(ord(buf[i]))+",\n")
- g.write("};\n")
- g.write("#endif")
-
-
-
-def make_certs_header(target,source,env):
-
- src = source[0].srcnode().abspath
- dst = target[0].srcnode().abspath
- f = open(src,"rb")
- g = open(dst,"wb")
- buf = f.read()
- decomp_size = len(buf)
- import zlib
- buf = zlib.compress(buf)
-
-
- g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
- g.write("#ifndef _CERTS_RAW_H\n")
- g.write("#define _CERTS_RAW_H\n")
- g.write("static const int _certs_compressed_size="+str(len(buf))+";\n")
- g.write("static const int _certs_uncompressed_size="+str(decomp_size)+";\n")
- g.write("static const unsigned char _certs_compressed[]={\n")
- for i in range(len(buf)):
- g.write(str(ord(buf[i]))+",\n")
- g.write("};\n")
- g.write("#endif")
+#!/usr/bin/env python
+Import('env')
-
-
-
-
-if (env["tools"]=="yes"):
-
- reg_exporters_inc='#include "register_exporters.h"\n'
- reg_exporters='void register_exporters() {\n'
- for e in env.platform_exporters:
- env.tool_sources.append("#platform/"+e+"/export/export.cpp")
- reg_exporters+='\tregister_'+e+'_exporter();\n'
- reg_exporters_inc+='#include "platform/'+e+'/export/export.h"\n'
- reg_exporters+='}\n'
- f = open("register_exporters.cpp","wb")
- f.write(reg_exporters_inc)
- f.write(reg_exporters)
- f.close()
-
- env.Depends("#tools/editor/doc_data_compressed.h","#doc/base/classes.xml")
- env.Command("#tools/editor/doc_data_compressed.h","#doc/base/classes.xml",make_doc_header)
-
- env.Depends("#tools/editor/certs_compressed.h","#tools/certs/ca-certificates.crt")
- env.Command("#tools/editor/certs_compressed.h","#tools/certs/ca-certificates.crt",make_certs_header)
-
- #make_doc_header(env.File("#tools/editor/doc_data_raw.h").srcnode().abspath,env.File("#doc/base/classes.xml").srcnode().abspath,env)
-
- env.add_source_files(env.tool_sources,"*.cpp")
-
- Export('env')
- SConscript('icons/SCsub');
- SConscript('plugins/SCsub');
- SConscript('fileserver/SCsub');
- SConscript('io_plugins/SCsub');
+def make_doc_header(target, source, env):
+
+ src = source[0].srcnode().abspath
+ dst = target[0].srcnode().abspath
+ f = open(src, "rb")
+ g = open(dst, "wb")
+ buf = f.read()
+ decomp_size = len(buf)
+ import zlib
+ buf = zlib.compress(buf)
+
+ g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
+ g.write("#ifndef _DOC_DATA_RAW_H\n")
+ g.write("#define _DOC_DATA_RAW_H\n")
+ g.write("static const int _doc_data_compressed_size=" + str(len(buf)) + ";\n")
+ g.write("static const int _doc_data_uncompressed_size=" + str(decomp_size) + ";\n")
+ g.write("static const unsigned char _doc_data_compressed[]={\n")
+ for i in range(len(buf)):
+ g.write(str(ord(buf[i])) + ",\n")
+ g.write("};\n")
+ g.write("#endif")
+
+
+def make_certs_header(target, source, env):
+
+ src = source[0].srcnode().abspath
+ dst = target[0].srcnode().abspath
+ f = open(src, "rb")
+ g = open(dst, "wb")
+ buf = f.read()
+ decomp_size = len(buf)
+ import zlib
+ buf = zlib.compress(buf)
+
+ g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
+ g.write("#ifndef _CERTS_RAW_H\n")
+ g.write("#define _CERTS_RAW_H\n")
+ g.write("static const int _certs_compressed_size=" + str(len(buf)) + ";\n")
+ g.write("static const int _certs_uncompressed_size=" + str(decomp_size) + ";\n")
+ g.write("static const unsigned char _certs_compressed[]={\n")
+ for i in range(len(buf)):
+ g.write(str(ord(buf[i])) + ",\n")
+ g.write("};\n")
+ g.write("#endif")
+
+
+if (env["tools"] == "yes"):
+
+ reg_exporters_inc = '#include "register_exporters.h"\n'
+ reg_exporters = 'void register_exporters() {\n'
+ for e in env.platform_exporters:
+ env.tool_sources.append("#platform/" + e + "/export/export.cpp")
+ reg_exporters += '\tregister_' + e + '_exporter();\n'
+ reg_exporters_inc += '#include "platform/' + e + '/export/export.h"\n'
+ reg_exporters += '}\n'
+ f = open("register_exporters.cpp", "wb")
+ f.write(reg_exporters_inc)
+ f.write(reg_exporters)
+ f.close()
+
+ env.Depends("#tools/editor/doc_data_compressed.h", "#doc/base/classes.xml")
+ env.Command("#tools/editor/doc_data_compressed.h", "#doc/base/classes.xml", make_doc_header)
+
+ env.Depends("#tools/editor/certs_compressed.h", "#tools/certs/ca-certificates.crt")
+ env.Command("#tools/editor/certs_compressed.h", "#tools/certs/ca-certificates.crt", make_certs_header)
+
+ # make_doc_header(env.File("#tools/editor/doc_data_raw.h").srcnode().abspath,env.File("#doc/base/classes.xml").srcnode().abspath,env)
+
+ env.add_source_files(env.tool_sources, "*.cpp")
+
+ Export('env')
+ SConscript('icons/SCsub')
+ SConscript('plugins/SCsub')
+ SConscript('fileserver/SCsub')
+ SConscript('io_plugins/SCsub')
diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp
index 2f67df1fc3..cb95f5fb7d 100644
--- a/tools/editor/animation_editor.cpp
+++ b/tools/editor/animation_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -48,7 +48,7 @@
class AnimationCurveEdit : public Control {
- OBJ_TYPE( AnimationCurveEdit, Control );
+ GDCLASS( AnimationCurveEdit, Control );
public:
enum Mode {
MODE_DISABLED,
@@ -157,7 +157,7 @@ private:
}
}
- void _input_event(const InputEvent& p_ev) {
+ void _gui_input(const InputEvent& p_ev) {
if (p_ev.type==InputEvent::MOUSE_MOTION && p_ev.mouse_motion.button_mask&BUTTON_MASK_LEFT) {
if (mode==MODE_DISABLED)
@@ -198,8 +198,8 @@ public:
static void _bind_methods() {
- // ObjectTypeDB::bind_method("_update_obj",&AnimationKeyEdit::_update_obj);
- ObjectTypeDB::bind_method("_input_event",&AnimationCurveEdit::_input_event);
+ //ClassDB::bind_method("_update_obj",&AnimationKeyEdit::_update_obj);
+ ClassDB::bind_method("_gui_input",&AnimationCurveEdit::_gui_input);
ADD_SIGNAL(MethodInfo("transition_changed"));
}
@@ -243,15 +243,15 @@ public:
class AnimationKeyEdit : public Object {
- OBJ_TYPE(AnimationKeyEdit,Object);
+ GDCLASS(AnimationKeyEdit,Object);
public:
bool setting;
bool hidden;
static void _bind_methods() {
- ObjectTypeDB::bind_method("_update_obj",&AnimationKeyEdit::_update_obj);
- ObjectTypeDB::bind_method("_key_ofs_changed",&AnimationKeyEdit::_key_ofs_changed);
+ ClassDB::bind_method("_update_obj",&AnimationKeyEdit::_update_obj);
+ ClassDB::bind_method("_key_ofs_changed",&AnimationKeyEdit::_key_ofs_changed);
}
//PopupDialog *ke_dialog;
@@ -612,7 +612,7 @@ public:
if (res.is_valid()) {
hint=PROPERTY_HINT_RESOURCE_TYPE;
- hint_string=res->get_type();
+ hint_string=res->get_class();
}
}
@@ -647,8 +647,10 @@ public:
} break;
}
- //if (animation->track_get_type(track)!=Animation::TYPE_METHOD)
- // p_list->push_back( PropertyInfo( Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING));
+ /*
+ if (animation->track_get_type(track)!=Animation::TYPE_METHOD)
+ p_list->push_back( PropertyInfo( Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING));
+ */
}
UndoRedo *undo_redo;
@@ -1040,7 +1042,7 @@ void AnimationKeyEditor::_animation_optimize() {
- animation->optimize(optimize_linear_error->get_val(),optimize_angular_error->get_val(),optimize_max_angle->get_val());
+ animation->optimize(optimize_linear_error->get_value(),optimize_angular_error->get_value(),optimize_max_angle->get_value());
track_editor->update();
undo_redo->clear_history();
@@ -1049,7 +1051,7 @@ void AnimationKeyEditor::_animation_optimize() {
float AnimationKeyEditor::_get_zoom_scale() const {
- float zv = zoom->get_val();
+ float zv = zoom->get_value();
if (zv<1) {
zv = 1.0-zv;
return Math::pow(1.0+zv,8.0)*100;
@@ -1072,7 +1074,7 @@ void AnimationKeyEditor::_track_pos_draw() {
int settings_limit = size.width - right_data_size_cache;
int name_limit = settings_limit * name_column_ratio;
- float keys_from= h_scroll->get_val();
+ float keys_from= h_scroll->get_value();
float zoom_scale = _get_zoom_scale();
float keys_to=keys_from+(settings_limit-name_limit) / zoom_scale;
@@ -1081,7 +1083,7 @@ void AnimationKeyEditor::_track_pos_draw() {
//will move to separate control! (for speedup)
if (timeline_pos >= keys_from && timeline_pos<keys_to) {
//draw position
- int pixel = (timeline_pos - h_scroll->get_val()) * zoom_scale;
+ int pixel = (timeline_pos - h_scroll->get_value()) * zoom_scale;
pixel+=name_limit;
track_pos->draw_line(ofs+Point2(pixel,0),ofs+Point2(pixel,size.height),Color(1,0.3,0.3,0.8));
@@ -1090,7 +1092,6 @@ void AnimationKeyEditor::_track_pos_draw() {
void AnimationKeyEditor::_track_editor_draw() {
- VisualServer::get_singleton()->canvas_item_set_clip(track_editor->get_canvas_item(),true);
if (animation.is_valid() && animation->get_track_count()) {
if (selected_track < 0)
@@ -1157,6 +1158,12 @@ void AnimationKeyEditor::_track_editor_draw() {
Ref<Texture> add_key_icon = get_icon("TrackAddKey","EditorIcons");
Ref<Texture> add_key_icon_hl = get_icon("TrackAddKeyHl","EditorIcons");
Ref<Texture> down_icon = get_icon("select_arrow","Tree");
+
+ Ref<Texture> wrap_icon[2]={
+ get_icon("InterpWrapClamp","EditorIcons"),
+ get_icon("InterpWrapLoop","EditorIcons"),
+ };
+
Ref<Texture> interp_icon[3]={
get_icon("InterpRaw","EditorIcons"),
get_icon("InterpLinear","EditorIcons"),
@@ -1181,7 +1188,7 @@ void AnimationKeyEditor::_track_editor_draw() {
Ref<Texture> type_hover=get_icon("KeyHover","EditorIcons");
Ref<Texture> type_selected=get_icon("KeySelected","EditorIcons");
- int right_separator_ofs = down_icon->get_width() *2 + add_key_icon->get_width() + interp_icon[0]->get_width() + cont_icon[0]->get_width() + hsep*7;
+ int right_separator_ofs = down_icon->get_width() *3 + add_key_icon->get_width() + interp_icon[0]->get_width() + wrap_icon[0]->get_width() + cont_icon[0]->get_width() + hsep*9;
int h = font->get_height()+sep;
@@ -1227,8 +1234,8 @@ void AnimationKeyEditor::_track_editor_draw() {
if (l<=0)
l=0.001; //avoid crashor
- int end_px = (l - h_scroll->get_val()) * scale;
- int begin_px = -h_scroll->get_val() * scale;
+ int end_px = (l - h_scroll->get_value()) * scale;
+ int begin_px = -h_scroll->get_value() * scale;
Color notimecol;
notimecol.r=timecolor.gray();
notimecol.g=notimecol.r;
@@ -1254,7 +1261,7 @@ void AnimationKeyEditor::_track_editor_draw() {
- keys_from= h_scroll->get_val();
+ keys_from= h_scroll->get_value();
keys_to=keys_from+zoomw / scale;
{
@@ -1331,8 +1338,8 @@ void AnimationKeyEditor::_track_editor_draw() {
for(int i=0;i<zoomw;i++) {
- float pos = h_scroll->get_val() + double(i)/scale;
- float prev = h_scroll->get_val() + (double(i)-1.0)/scale;
+ float pos = h_scroll->get_value() + double(i)/scale;
+ float prev = h_scroll->get_value() + (double(i)-1.0)/scale;
int sc = int(Math::floor(pos*SC_ADJ));
@@ -1356,7 +1363,7 @@ void AnimationKeyEditor::_track_editor_draw() {
//this code sucks, i always forget how it works
- int idx = v_scroll->get_val() + i;
+ int idx = v_scroll->get_value() + i;
if (idx>=animation->get_track_count())
break;
int y = h+i*h+sep;
@@ -1421,6 +1428,20 @@ void AnimationKeyEditor::_track_editor_draw() {
icon_ofs.x-=hsep;
*/
+ track_ofs[0]=size.width-icon_ofs.x;
+ icon_ofs.x-=down_icon->get_width();
+ te->draw_texture(down_icon,icon_ofs);
+
+ int wrap_type = animation->track_get_interpolation_loop_wrap(idx)?1:0;
+ icon_ofs.x-=hsep;
+ icon_ofs.x-=wrap_icon[wrap_type]->get_width();
+ te->draw_texture(wrap_icon[wrap_type],icon_ofs);
+
+ icon_ofs.x-=hsep;
+ te->draw_line(Point2(icon_ofs.x,ofs.y+y),Point2(icon_ofs.x,ofs.y+y+h),sepcolor);
+
+ track_ofs[1]=size.width-icon_ofs.x;
+
icon_ofs.x-=down_icon->get_width();
te->draw_texture(down_icon,icon_ofs);
@@ -1433,6 +1454,8 @@ void AnimationKeyEditor::_track_editor_draw() {
icon_ofs.x-=hsep;
te->draw_line(Point2(icon_ofs.x,ofs.y+y),Point2(icon_ofs.x,ofs.y+y+h),sepcolor);
+ track_ofs[2]=size.width-icon_ofs.x;
+
if (animation->track_get_type(idx)==Animation::TYPE_VALUE) {
@@ -1453,10 +1476,14 @@ void AnimationKeyEditor::_track_editor_draw() {
icon_ofs.x-=hsep;
te->draw_line(Point2(icon_ofs.x,ofs.y+y),Point2(icon_ofs.x,ofs.y+y+h),sepcolor);
+ track_ofs[3]=size.width-icon_ofs.x;
+
icon_ofs.x-=hsep;
icon_ofs.x-=add_key_icon->get_width();
te->draw_texture((mouse_over.over==MouseOver::OVER_ADD_KEY && mouse_over.track==idx)?add_key_icon_hl:add_key_icon,icon_ofs);
+ track_ofs[4]=size.width-icon_ofs.x;
+
//draw the keys;
int tt = animation->track_get_type(idx);
float key_vofs = Math::floor((h - type_icon[tt]->get_height())/2);
@@ -1552,14 +1579,14 @@ void AnimationKeyEditor::_track_editor_draw() {
}
float motion = from_t+(click.to.x - click.at.x)/zoom_scale;
- if (step->get_val())
- motion = Math::stepify(motion,step->get_val());
+ if (step->get_value())
+ motion = Math::stepify(motion,step->get_value());
for(Map<SelectedKey,KeyInfo>::Element *E=selection.front();E;E=E->next()) {
int idx = E->key().track;
- int i = idx-v_scroll->get_val();
+ int i = idx-v_scroll->get_value();
if (i<0 || i>=fit)
continue;
int y = h+i*h+sep;
@@ -1621,6 +1648,14 @@ void AnimationKeyEditor::_track_menu_selected(int p_idx) {
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();
+ } else if (wrap_editing!=-1) {
+
+ ERR_FAIL_INDEX(wrap_editing,animation->get_track_count());
+
+ undo_redo->create_action(TTR("Anim Track Change Wrap Mode"));
+ undo_redo->add_do_method(animation.ptr(),"track_set_interpolation_loop_wrap",wrap_editing,p_idx?true:false);
+ undo_redo->add_undo_method(animation.ptr(),"track_set_interpolation_loop_wrap",wrap_editing,animation->track_get_interpolation_loop_wrap(wrap_editing));
+ undo_redo->commit_action();
} else {
switch (p_idx) {
@@ -1811,7 +1846,7 @@ void AnimationKeyEditor::_anim_delete_keys() {
}
}
-void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
+void AnimationKeyEditor::_track_editor_gui_input(const InputEvent& p_input) {
Control *te=track_editor;
Ref<StyleBox> style = get_stylebox("normal","TextEdit");
@@ -1833,6 +1868,10 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
Ref<Texture> hsize_icon = get_icon("Hsize","EditorIcons");
Ref<Texture> add_key_icon = get_icon("TrackAddKey","EditorIcons");
+ Ref<Texture> wrap_icon[2]={
+ get_icon("InterpWrapClamp","EditorIcons"),
+ get_icon("InterpWrapLoop","EditorIcons"),
+ };
Ref<Texture> interp_icon[3]={
get_icon("InterpRaw","EditorIcons"),
get_icon("InterpLinear","EditorIcons"),
@@ -1848,7 +1887,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
get_icon("KeyXform","EditorIcons"),
get_icon("KeyCall","EditorIcons")
};
- int right_separator_ofs = down_icon->get_width() *2 + add_key_icon->get_width() + interp_icon[0]->get_width() + cont_icon[0]->get_width() + hsep*7;
+ int right_separator_ofs = down_icon->get_width() *3 + add_key_icon->get_width() + interp_icon[0]->get_width() + wrap_icon[0]->get_width() + cont_icon[0]->get_width() + hsep*9;
int h = font->get_height()+sep;
@@ -1888,16 +1927,16 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
if (p_input.is_action("ui_up"))
selected_track--;
- if (v_scroll->is_visible() && p_input.is_action("ui_page_up"))
+ if (v_scroll->is_visible_in_tree() && p_input.is_action("ui_page_up"))
selected_track--;
if (selected_track<0)
selected_track=0;
- if (v_scroll->is_visible()) {
- if (v_scroll->get_val() > selected_track)
- v_scroll->set_val(selected_track);
+ if (v_scroll->is_visible_in_tree()) {
+ if (v_scroll->get_value() > selected_track)
+ v_scroll->set_value(selected_track);
}
@@ -1910,14 +1949,14 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
if (p_input.is_action("ui_down"))
selected_track++;
- else if (v_scroll->is_visible() && p_input.is_action("ui_page_down"))
+ else if (v_scroll->is_visible_in_tree() && p_input.is_action("ui_page_down"))
selected_track+=v_scroll->get_page();
if (selected_track >= animation->get_track_count())
selected_track=animation->get_track_count()-1;
- if (v_scroll->is_visible() && v_scroll->get_page()+v_scroll->get_val() < selected_track+1) {
- v_scroll->set_val(selected_track-v_scroll->get_page()+1);
+ if (v_scroll->is_visible_in_tree() && v_scroll->get_page()+v_scroll->get_value() < selected_track+1) {
+ v_scroll->set_value(selected_track-v_scroll->get_page()+1);
}
track_editor->update();
@@ -1933,12 +1972,20 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
if (mb.button_index==BUTTON_WHEEL_UP && mb.pressed) {
- v_scroll->set_val( v_scroll->get_val() - v_scroll->get_page() / 8 );
+ if (mb.mod.command) {
+ zoom->set_value(zoom->get_value() + zoom->get_step());
+ } else {
+ v_scroll->set_value( v_scroll->get_value() - v_scroll->get_page() / 8 );
+ }
}
if (mb.button_index==BUTTON_WHEEL_DOWN && mb.pressed) {
- v_scroll->set_val( v_scroll->get_val() + v_scroll->get_page() / 8 );
+ if (mb.mod.command) {
+ zoom->set_value(zoom->get_value() - zoom->get_step());
+ } else {
+ v_scroll->set_value( v_scroll->get_value() + v_scroll->get_page() / 8 );
+ }
}
if (mb.button_index==BUTTON_RIGHT && mb.pressed) {
@@ -1958,7 +2005,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
mpos.y -= h;
int idx = mpos.y / h;
- idx+=v_scroll->get_val();
+ idx+=v_scroll->get_value();
if (idx <0 || idx>=animation->get_track_count())
break;
@@ -1966,7 +2013,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
} else if (mpos.x < settings_limit) {
float pos = mpos.x - name_limit;
pos/=_get_zoom_scale();
- pos+=h_scroll->get_val();
+ pos+=h_scroll->get_value();
float w_time = (type_icon[0]->get_width() / _get_zoom_scale())/2.0;
int kidx = animation->track_find_key(idx,pos);
@@ -2046,6 +2093,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
interp_editing=-1;
cont_editing=-1;
+ wrap_editing=-1;
track_menu->popup();
}
@@ -2075,7 +2123,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
//seek
//int zoomw = settings_limit-name_limit;
float scale = _get_zoom_scale();
- float pos = h_scroll->get_val() + (mpos.x-name_limit) / scale;
+ float pos = h_scroll->get_value() + (mpos.x-name_limit) / scale;
if (animation->get_step())
pos=Math::stepify(pos,animation->get_step());
@@ -2097,7 +2145,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
mpos.y -= h;
int idx = mpos.y / h;
- idx+=v_scroll->get_val();
+ idx+=v_scroll->get_value();
if (idx <0)
break;
@@ -2138,7 +2186,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
float pos = mpos.x - name_limit;
pos/=_get_zoom_scale();
- pos+=h_scroll->get_val();
+ pos+=h_scroll->get_value();
float w_time = (type_icon[0]->get_width() / _get_zoom_scale())/2.0;
int kidx = animation->track_find_key(idx,pos);
@@ -2269,7 +2317,33 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
ofsx-=hsep*3+move_up_icon->get_width();
*/
- if (ofsx < down_icon->get_width() + interp_icon[0]->get_width() + hsep*2) {
+
+ if (ofsx < track_ofs[1]) {
+
+ track_menu->clear();
+ track_menu->set_size(Point2(1,1));
+ static const char *interp_name[2]={"Clamp Loop Interp","Wrap Loop Interp"};
+ for(int i=0;i<2;i++) {
+ track_menu->add_icon_item(wrap_icon[i],interp_name[i]);
+ }
+
+ int popup_y = ofs.y+((int(mpos.y)/h)+2)*h;
+ int popup_x = size.width-track_ofs[1];
+
+ track_menu->set_pos(te->get_global_pos()+Point2(popup_x,popup_y));
+
+
+ wrap_editing=idx;
+ interp_editing=-1;
+ cont_editing=-1;
+
+ track_menu->popup();
+
+ return;
+ }
+
+
+ if (ofsx < track_ofs[2]) {
track_menu->clear();
track_menu->set_size(Point2(1,1));
@@ -2278,24 +2352,22 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
track_menu->add_icon_item(interp_icon[i],interp_name[i]);
}
- int lofs = remove_icon->get_width() + move_up_icon->get_width() + move_down_icon->get_width() + down_icon->get_width() *2 + hsep*7;//interp_icon[0]->get_width() + cont_icon[0]->get_width() ;
int popup_y = ofs.y+((int(mpos.y)/h)+2)*h;
- int popup_x = ofs.x+size.width-lofs;
+ int popup_x = size.width-track_ofs[2];
track_menu->set_pos(te->get_global_pos()+Point2(popup_x,popup_y));
interp_editing=idx;
cont_editing=-1;
+ wrap_editing=-1;
track_menu->popup();
return;
}
- ofsx-=hsep*2+interp_icon[0]->get_width()+down_icon->get_width();
-
- if (ofsx < down_icon->get_width() + cont_icon[0]->get_width()) {
+ if (ofsx < track_ofs[3]) {
track_menu->clear();
track_menu->set_size(Point2(1,1));
@@ -2304,13 +2376,14 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
track_menu->add_icon_item(cont_icon[i],cont_name[i]);
}
- int lofs = settings_limit;
+
int popup_y = ofs.y+((int(mpos.y)/h)+2)*h;
- int popup_x = ofs.x+lofs;
+ int popup_x = size.width-track_ofs[3];
track_menu->set_pos(te->get_global_pos()+Point2(popup_x,popup_y));
interp_editing=-1;
+ wrap_editing=-1;
cont_editing=idx;
track_menu->popup();
@@ -2318,9 +2391,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
return;
}
- ofsx-=hsep*3+cont_icon[0]->get_width()+down_icon->get_width();
-
- if (ofsx < add_key_icon->get_width()) {
+ if (ofsx < track_ofs[4]) {
Animation::TrackType tt = animation->track_get_type(idx);
@@ -2395,7 +2466,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
float zoom_scale=_get_zoom_scale();
- float keys_from = h_scroll->get_val();
+ float keys_from = h_scroll->get_value();
float keys_to = keys_from + (settings_limit-name_limit) / zoom_scale;
float from_time = keys_from + ( click.at.x - (name_limit+ofs.x)) / zoom_scale;
@@ -2415,8 +2486,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
to_time = keys_to;
- int from_track = int(click.at.y-ofs.y-h-sep) / h + v_scroll->get_val();
- int to_track = int(click.to.y-ofs.y-h-sep) / h + v_scroll->get_val();
+ int from_track = int(click.at.y-ofs.y-h-sep) / h + v_scroll->get_value();
+ int to_track = int(click.to.y-ofs.y-h-sep) / h + v_scroll->get_value();
int from_mod = int(click.at.y-ofs.y-sep) % h;
int to_mod = int(click.to.y-ofs.y-sep) % h;
@@ -2444,8 +2515,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
break;
}
- int tracks_from = v_scroll->get_val();
- int tracks_to = v_scroll->get_val()+fit-1;
+ int tracks_from = v_scroll->get_value();
+ int tracks_to = v_scroll->get_value()+fit-1;
if (tracks_to>=animation->get_track_count())
tracks_to=animation->get_track_count()-1;
@@ -2528,8 +2599,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
}
float motion = from_t+(click.to.x - click.at.x)/_get_zoom_scale();
- if (step->get_val())
- motion = Math::stepify(motion,step->get_val());
+ if (step->get_value())
+ motion = Math::stepify(motion,step->get_value());
@@ -2572,8 +2643,10 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
for(Map<SelectedKey,KeyInfo>::Element *E=selection.back();E;E=E->prev()) {
float newpos=E->get().pos-from_t+motion;
- //if (newpos<0)
- // continue; //no add at the begining
+ /*
+ if (newpos<0)
+ continue; //no add at the begining
+ */
undo_redo->add_do_method(animation.ptr(),"track_insert_key",E->key().track,newpos,animation->track_get_key_value(E->key().track,E->key().key),animation->track_get_key_transition(E->key().track,E->key().key));
}
@@ -2582,8 +2655,10 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
for(Map<SelectedKey,KeyInfo>::Element *E=selection.back();E;E=E->prev()) {
float newpos=E->get().pos+-from_t+motion;
- //if (newpos<0)
- // continue; //no remove what no inserted
+ /*
+ if (newpos<0)
+ continue; //no remove what no inserted
+ */
undo_redo->add_undo_method(animation.ptr(),"track_remove_key_at_pos",E->key().track,newpos);
}
@@ -2621,7 +2696,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
float oldpos=E->get().pos;
float newpos=oldpos-from_t+motion;
//if (newpos>=0)
- undo_redo->add_do_method(this,"_select_at_anim",animation,E->key().track,newpos);
+ undo_redo->add_do_method(this,"_select_at_anim",animation,E->key().track,newpos);
undo_redo->add_undo_method(this,"_select_at_anim",animation,E->key().track,oldpos);
}
@@ -2692,7 +2767,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
//int zoomw = settings_limit-name_limit;
float scale = _get_zoom_scale();
- float pos = h_scroll->get_val() + (mpos.x-name_limit) / scale;
+ float pos = h_scroll->get_value() + (mpos.x-name_limit) / scale;
if (animation->get_step()) {
pos=Math::stepify(pos,animation->get_step());
@@ -2702,10 +2777,10 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
if (pos>=animation->get_length())
pos=animation->get_length();
- if (pos < h_scroll->get_val()) {
- h_scroll->set_val(pos);
- } else if (pos > h_scroll->get_val() + (settings_limit - name_limit) / scale) {
- h_scroll->set_val( pos - (settings_limit - name_limit) / scale );
+ if (pos < h_scroll->get_value()) {
+ h_scroll->set_value(pos);
+ } else if (pos > h_scroll->get_value() + (settings_limit - name_limit) / scale) {
+ h_scroll->set_value( pos - (settings_limit - name_limit) / scale );
}
timeline_pos=pos;
@@ -2719,18 +2794,18 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
click.to=Point2(mb.x,mb.y);
if (click.to.y<h && click.at.y>h && mb.relative_y<0) {
- float prev = v_scroll->get_val();
- v_scroll->set_val( v_scroll->get_val() -1 );
- if (prev!=v_scroll->get_val())
+ float prev = v_scroll->get_value();
+ v_scroll->set_value( v_scroll->get_value() -1 );
+ if (prev!=v_scroll->get_value())
click.at.y+=h;
}
if (click.to.y>size.height && click.at.y<size.height && mb.relative_y>0) {
- float prev = v_scroll->get_val();
- v_scroll->set_val( v_scroll->get_val() +1 );
- if (prev!=v_scroll->get_val())
+ float prev = v_scroll->get_value();
+ v_scroll->set_value( v_scroll->get_value() +1 );
+ if (prev!=v_scroll->get_value())
click.at.y-=h;
}
@@ -2747,7 +2822,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
int rel = mb.relative_x;
float relf = rel / _get_zoom_scale();
- h_scroll->set_val( h_scroll->get_val() - relf );
+ h_scroll->set_value( h_scroll->get_value() - relf );
}
if (mb.button_mask==0) {
@@ -2773,7 +2848,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
mpos.y -= h;
int idx = mpos.y / h;
- idx+=v_scroll->get_val();
+ idx+=v_scroll->get_value();
if (idx <0 || idx>=animation->get_track_count())
break;
@@ -2789,7 +2864,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
float pos = mpos.x - name_limit;
pos/=_get_zoom_scale();
- pos+=h_scroll->get_val();
+ pos+=h_scroll->get_value();
float w_time = (type_icon[0]->get_width() / _get_zoom_scale())/2.0;
int kidx = animation->track_find_key(idx,pos);
@@ -2932,7 +3007,15 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
*/
- if (ofsx < down_icon->get_width() + interp_icon[0]->get_width() + hsep*2) {
+ if (ofsx < down_icon->get_width() + wrap_icon[0]->get_width() + hsep*3) {
+
+ mouse_over.over=MouseOver::OVER_WRAP;
+ return;
+ }
+
+ ofsx-=hsep*3+wrap_icon[0]->get_width() + down_icon->get_width();
+
+ if (ofsx < down_icon->get_width() + interp_icon[0]->get_width() + hsep*3) {
mouse_over.over=MouseOver::OVER_INTERP;
return;
@@ -3004,7 +3087,7 @@ void AnimationKeyEditor::_notification(int p_what) {
tpp->add_item(TTR("In-Out"),TRACK_MENU_SET_ALL_TRANS_INOUT);
tpp->add_item(TTR("Out-In"),TRACK_MENU_SET_ALL_TRANS_OUTIN);
tpp->set_name(TTR("Transitions"));
- tpp->connect("item_pressed",this,"_menu_track");
+ tpp->connect("id_pressed",this,"_menu_track");
optimize_dialog->connect("confirmed",this,"_animation_optimize");
menu_track->get_popup()->add_child(tpp);
@@ -3060,13 +3143,18 @@ void AnimationKeyEditor::_notification(int p_what) {
get_icon("TrackTrigger","EditorIcons")
};
+ Ref<Texture> wrap_icon[2]={
+ get_icon("InterpWrapClamp","EditorIcons"),
+ get_icon("InterpWrapLoop","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;
- right_data_size_cache = down_icon->get_width() *2 + add_key_icon->get_width() + interp_icon[0]->get_width() + cont_icon[0]->get_width() + hsep*7;
+ right_data_size_cache = down_icon->get_width() *3 + add_key_icon->get_width() + interp_icon[0]->get_width() + cont_icon[0]->get_width() + wrap_icon[0]->get_width() + hsep*8;
}
call_select->connect("selected",this,"_add_call_track");
-// rename_anim->set_icon( get_icon("Rename","EditorIcons") );
+ //rename_anim->set_icon( get_icon("Rename","EditorIcons") );
/*
edit_anim->set_icon( get_icon("Edit","EditorIcons") );
blend_anim->set_icon( get_icon("Blend","EditorIcons") );
@@ -3074,8 +3162,8 @@ void AnimationKeyEditor::_notification(int p_what) {
stop->set_icon( get_icon("Stop","EditorIcons") );
pause->set_icon( get_icon("Pause","EditorIcons") );
*/
-// menu->set_icon(get_icon("Animation","EditorIcons"));
-// play->set_icon(get_icon("AnimationPlay","EditorIcons"));
+ //menu->set_icon(get_icon("Animation","EditorIcons"));
+ //play->set_icon(get_icon("AnimationPlay","EditorIcons"));
//menu->set_icon(get_icon("Animation","EditorIcons"));
_update_menu();
@@ -3104,8 +3192,8 @@ void AnimationKeyEditor::_update_paths() {
//timeline->set_max(animation->get_length());
//timeline->set_step(0.01);
track_editor->update();
- length->set_val(animation->get_length());
- step->set_val(animation->get_step());
+ length->set_value(animation->get_length());
+ step->set_value(animation->get_step());
}
}
@@ -3122,9 +3210,9 @@ void AnimationKeyEditor::_update_menu() {
if (animation.is_valid()) {
- length->set_val(animation->get_length());
+ length->set_value(animation->get_length());
loop->set_pressed(animation->has_loop());
- step->set_val(animation->get_step());
+ step->set_value(animation->get_step());
}
track_editor->update();
@@ -3166,12 +3254,12 @@ void AnimationKeyEditor::set_animation(const Ref<Animation>& p_anim) {
void AnimationKeyEditor::set_root(Node *p_root) {
if (root)
- root->disconnect("exit_tree",this,"_root_removed");
+ root->disconnect("tree_exited",this,"_root_removed");
root=p_root;
if (root)
- root->connect("exit_tree",this,"_root_removed",make_binds(),CONNECT_ONESHOT);
+ root->connect("tree_exited",this,"_root_removed",make_binds(),CONNECT_ONESHOT);
}
@@ -3188,7 +3276,7 @@ Node *AnimationKeyEditor::get_root() const {
void AnimationKeyEditor::update_keying() {
- bool keying_enabled=is_visible() && animation.is_valid();
+ bool keying_enabled=is_visible_in_tree() && animation.is_valid();
if (keying_enabled==keying)
return;
@@ -3207,14 +3295,14 @@ bool AnimationKeyEditor::has_keying() const {
void AnimationKeyEditor::_query_insert(const InsertData& p_id) {
- if (insert_frame!=OS::get_singleton()->get_frames_drawn()) {
+ if (insert_frame!=Engine::get_singleton()->get_frames_drawn()) {
//clear insert list for the frame if frame changed
- if (insert_confirm->is_visible())
+ if (insert_confirm->is_visible_in_tree())
return; //do nothing
insert_data.clear();
insert_query=false;
}
- insert_frame=OS::get_singleton()->get_frames_drawn();
+ insert_frame=Engine::get_singleton()->get_frames_drawn();
for (List<InsertData>::Element *E=insert_data.front();E;E=E->next()) {
//prevent insertion of multiple tracks
@@ -3225,7 +3313,7 @@ void AnimationKeyEditor::_query_insert(const InsertData& p_id) {
insert_data.push_back(p_id);
if (p_id.track_idx==-1) {
- if (bool(EDITOR_DEF("animation/confirm_insert_track",true))) {
+ if (bool(EDITOR_DEF("editors/animation/confirm_insert_track",true))) {
//potential new key, does not exist
if (insert_data.size()==1)
insert_confirm->set_text(vformat(TTR("Create NEW track for %s and insert key?"),p_id.query));
@@ -3443,7 +3531,7 @@ int AnimationKeyEditor::_confirm_insert(InsertData p_id,int p_last_track) {
h.type==Variant::VECTOR2 ||
h.type==Variant::RECT2 ||
h.type==Variant::VECTOR3 ||
- h.type==Variant::_AABB ||
+ h.type==Variant::RECT3 ||
h.type==Variant::QUAT ||
h.type==Variant::COLOR ||
h.type==Variant::TRANSFORM ) {
@@ -3702,7 +3790,7 @@ void AnimationKeyEditor::_scale() {
}
- float s = scale->get_val();
+ float s = scale->get_value();
if (s==0) {
ERR_PRINT("Can't scale to 0");
}
@@ -3833,48 +3921,48 @@ void AnimationKeyEditor::cleanup() {
void AnimationKeyEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_root_removed"),&AnimationKeyEditor::_root_removed);
- ObjectTypeDB::bind_method(_MD("_scale"),&AnimationKeyEditor::_scale);
- ObjectTypeDB::bind_method(_MD("set_root"),&AnimationKeyEditor::set_root);
+ ClassDB::bind_method(_MD("_root_removed"),&AnimationKeyEditor::_root_removed);
+ ClassDB::bind_method(_MD("_scale"),&AnimationKeyEditor::_scale);
+ ClassDB::bind_method(_MD("set_root"),&AnimationKeyEditor::set_root);
-// ObjectTypeDB::bind_method(_MD("_confirm_insert"),&AnimationKeyEditor::_confirm_insert);
- ObjectTypeDB::bind_method(_MD("_confirm_insert_list"),&AnimationKeyEditor::_confirm_insert_list);
+ //ClassDB::bind_method(_MD("_confirm_insert"),&AnimationKeyEditor::_confirm_insert);
+ ClassDB::bind_method(_MD("_confirm_insert_list"),&AnimationKeyEditor::_confirm_insert_list);
- ObjectTypeDB::bind_method(_MD("_update_paths"),&AnimationKeyEditor::_update_paths);
- ObjectTypeDB::bind_method(_MD("_track_editor_draw"),&AnimationKeyEditor::_track_editor_draw);
+ ClassDB::bind_method(_MD("_update_paths"),&AnimationKeyEditor::_update_paths);
+ ClassDB::bind_method(_MD("_track_editor_draw"),&AnimationKeyEditor::_track_editor_draw);
- ObjectTypeDB::bind_method(_MD("_animation_changed"),&AnimationKeyEditor::_animation_changed);
- ObjectTypeDB::bind_method(_MD("_scroll_changed"),&AnimationKeyEditor::_scroll_changed);
- ObjectTypeDB::bind_method(_MD("_track_editor_input_event"),&AnimationKeyEditor::_track_editor_input_event);
- ObjectTypeDB::bind_method(_MD("_track_name_changed"),&AnimationKeyEditor::_track_name_changed);
- ObjectTypeDB::bind_method(_MD("_track_menu_selected"),&AnimationKeyEditor::_track_menu_selected);
- ObjectTypeDB::bind_method(_MD("_menu_add_track"),&AnimationKeyEditor::_menu_add_track);
- ObjectTypeDB::bind_method(_MD("_menu_track"),&AnimationKeyEditor::_menu_track);
- ObjectTypeDB::bind_method(_MD("_clear_selection_for_anim"),&AnimationKeyEditor::_clear_selection_for_anim);
- ObjectTypeDB::bind_method(_MD("_select_at_anim"),&AnimationKeyEditor::_select_at_anim);
- ObjectTypeDB::bind_method(_MD("_track_pos_draw"),&AnimationKeyEditor::_track_pos_draw);
- ObjectTypeDB::bind_method(_MD("_insert_delay"),&AnimationKeyEditor::_insert_delay);
- ObjectTypeDB::bind_method(_MD("_step_changed"),&AnimationKeyEditor::_step_changed);
+ ClassDB::bind_method(_MD("_animation_changed"),&AnimationKeyEditor::_animation_changed);
+ ClassDB::bind_method(_MD("_scroll_changed"),&AnimationKeyEditor::_scroll_changed);
+ ClassDB::bind_method(_MD("_track_editor_gui_input"),&AnimationKeyEditor::_track_editor_gui_input);
+ ClassDB::bind_method(_MD("_track_name_changed"),&AnimationKeyEditor::_track_name_changed);
+ ClassDB::bind_method(_MD("_track_menu_selected"),&AnimationKeyEditor::_track_menu_selected);
+ ClassDB::bind_method(_MD("_menu_add_track"),&AnimationKeyEditor::_menu_add_track);
+ ClassDB::bind_method(_MD("_menu_track"),&AnimationKeyEditor::_menu_track);
+ ClassDB::bind_method(_MD("_clear_selection_for_anim"),&AnimationKeyEditor::_clear_selection_for_anim);
+ ClassDB::bind_method(_MD("_select_at_anim"),&AnimationKeyEditor::_select_at_anim);
+ ClassDB::bind_method(_MD("_track_pos_draw"),&AnimationKeyEditor::_track_pos_draw);
+ ClassDB::bind_method(_MD("_insert_delay"),&AnimationKeyEditor::_insert_delay);
+ ClassDB::bind_method(_MD("_step_changed"),&AnimationKeyEditor::_step_changed);
- ObjectTypeDB::bind_method(_MD("_animation_loop_changed"),&AnimationKeyEditor::_animation_loop_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);
+ ClassDB::bind_method(_MD("_animation_loop_changed"),&AnimationKeyEditor::_animation_loop_changed);
+ ClassDB::bind_method(_MD("_animation_len_changed"),&AnimationKeyEditor::_animation_len_changed);
+ ClassDB::bind_method(_MD("_create_value_item"),&AnimationKeyEditor::_create_value_item);
+ ClassDB::bind_method(_MD("_pane_drag"),&AnimationKeyEditor::_pane_drag);
- ObjectTypeDB::bind_method(_MD("_animation_len_update"),&AnimationKeyEditor::_animation_len_update);
+ ClassDB::bind_method(_MD("_animation_len_update"),&AnimationKeyEditor::_animation_len_update);
- ObjectTypeDB::bind_method(_MD("set_animation"),&AnimationKeyEditor::set_animation);
- ObjectTypeDB::bind_method(_MD("_animation_optimize"),&AnimationKeyEditor::_animation_optimize);
- ObjectTypeDB::bind_method(_MD("_curve_transition_changed"),&AnimationKeyEditor::_curve_transition_changed);
- ObjectTypeDB::bind_method(_MD("_toggle_edit_curves"),&AnimationKeyEditor::_toggle_edit_curves);
- ObjectTypeDB::bind_method(_MD("_add_call_track"),&AnimationKeyEditor::_add_call_track);
+ ClassDB::bind_method(_MD("set_animation"),&AnimationKeyEditor::set_animation);
+ ClassDB::bind_method(_MD("_animation_optimize"),&AnimationKeyEditor::_animation_optimize);
+ ClassDB::bind_method(_MD("_curve_transition_changed"),&AnimationKeyEditor::_curve_transition_changed);
+ ClassDB::bind_method(_MD("_toggle_edit_curves"),&AnimationKeyEditor::_toggle_edit_curves);
+ ClassDB::bind_method(_MD("_add_call_track"),&AnimationKeyEditor::_add_call_track);
ADD_SIGNAL( MethodInfo("resource_selected", PropertyInfo( Variant::OBJECT, "res"),PropertyInfo( Variant::STRING, "prop") ) );
@@ -3906,7 +3994,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
h_scroll = memnew( HScrollBar );
h_scroll->connect("value_changed",this,"_scroll_changed");
add_child(h_scroll);
- h_scroll->set_val(0);
+ h_scroll->set_value(0);
HBoxContainer *hb = memnew( HBoxContainer );
@@ -3919,7 +4007,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
//menu->set_pos(Point2());
//add_child(menu);
- zoomicon = memnew( TextureFrame );
+ zoomicon = memnew( TextureRect );
hb->add_child(zoomicon);
zoomicon->set_tooltip(TTR("Animation zoom."));
@@ -3928,7 +4016,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
zoom->set_step(0.01);
zoom->set_min(0.0);
zoom->set_max(2.0);
- zoom->set_val(1.0);
+ zoom->set_value(1.0);
zoom->set_h_size_flags(SIZE_EXPAND_FILL);
zoom->set_stretch_ratio(2);
hb->add_child(zoom);
@@ -3960,7 +4048,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
step->set_min(0.00);
step->set_max(128);
step->set_step(0.01);
- step->set_val(0.0);
+ step->set_value(0.0);
step->set_h_size_flags(SIZE_EXPAND_FILL);
step->set_stretch_ratio(1);
step->set_tooltip(TTR("Cursor step snap (in seconds)."));
@@ -3978,7 +4066,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
menu_add_track = memnew( MenuButton );
hb->add_child(menu_add_track);
- menu_add_track->get_popup()->connect("item_pressed",this,"_menu_add_track");
+ menu_add_track->get_popup()->connect("id_pressed",this,"_menu_add_track");
menu_add_track->set_tooltip(TTR("Add new tracks."));
move_up_button = memnew( ToolButton );
@@ -4006,7 +4094,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
menu_track = memnew( MenuButton );
hb->add_child(menu_track);
- menu_track->get_popup()->connect("item_pressed",this,"_menu_track");
+ menu_track->get_popup()->connect("id_pressed",this,"_menu_track");
menu_track->set_tooltip(TTR("Track tools"));
edit_button = memnew( ToolButton );
@@ -4022,18 +4110,18 @@ AnimationKeyEditor::AnimationKeyEditor() {
optimize_dialog->set_title(TTR("Anim. Optimizer"));
VBoxContainer *optimize_vb = memnew( VBoxContainer );
optimize_dialog->add_child(optimize_vb);
- optimize_dialog->set_child_rect(optimize_vb);
+
optimize_linear_error = memnew( SpinBox );
optimize_linear_error->set_max(1.0);
optimize_linear_error->set_min(0.001);
optimize_linear_error->set_step(0.001);
- optimize_linear_error->set_val(0.05);
+ optimize_linear_error->set_value(0.05);
optimize_vb->add_margin_child(TTR("Max. Linear Error:"),optimize_linear_error);
optimize_angular_error = memnew( SpinBox );
optimize_angular_error->set_max(1.0);
optimize_angular_error->set_min(0.001);
optimize_angular_error->set_step(0.001);
- optimize_angular_error->set_val(0.01);
+ optimize_angular_error->set_value(0.01);
optimize_vb->add_margin_child(TTR("Max. Angular Error:"),optimize_angular_error);
optimize_max_angle = memnew( SpinBox );
@@ -4041,7 +4129,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
optimize_max_angle->set_max(360.0);
optimize_max_angle->set_min(0.0);
optimize_max_angle->set_step(0.1);
- optimize_max_angle->set_val(22);
+ optimize_max_angle->set_value(22);
optimize_dialog->get_ok()->set_text(TTR("Optimize"));
@@ -4061,9 +4149,9 @@ AnimationKeyEditor::AnimationKeyEditor() {
/* l = memnew( Label );
l->set_text("Base: ");
l->set_pos(Point2(0,3));
-// dr_panel->add_child(l);*/
+ //dr_panel->add_child(l);*/
-// menu->get_popup()->connect("item_pressed",this,"_menu_callback");
+ //menu->get_popup()->connect("id_pressed",this,"_menu_callback");
hb = memnew( HBoxContainer);
@@ -4074,7 +4162,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
track_editor = memnew( Control );
track_editor->connect("draw",this,"_track_editor_draw");
hb->add_child(track_editor);
- track_editor->connect("input_event",this,"_track_editor_input_event");
+ track_editor->connect("gui_input",this,"_track_editor_gui_input");
track_editor->set_focus_mode(Control::FOCUS_ALL);
track_editor->set_h_size_flags(SIZE_EXPAND_FILL);
@@ -4082,7 +4170,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
track_pos = memnew( Control );
track_pos->set_area_as_parent_rect();
- track_pos->set_ignore_mouse(true);
+ track_pos->set_mouse_filter(MOUSE_FILTER_IGNORE);
track_editor->add_child(track_pos);
track_pos->connect("draw",this,"_track_pos_draw");
@@ -4099,7 +4187,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
v_scroll = memnew( VScrollBar );
hb->add_child(v_scroll);
v_scroll->connect("value_changed",this,"_scroll_changed");
- v_scroll->set_val(0);
+ v_scroll->set_value(0);
key_editor_tab = memnew(TabContainer);
hb->add_child(key_editor_tab);
@@ -4119,7 +4207,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
add_child(type_menu);
for(int i=0;i<Variant::VARIANT_MAX;i++)
type_menu->add_item(Variant::get_type_name(Variant::Type(i)),i);
- type_menu->connect("item_pressed",this,"_create_value_item");
+ type_menu->connect("id_pressed",this,"_create_value_item");
VBoxContainer *curve_vb = memnew( VBoxContainer );
curve_vb->set_name(TTR("Transition"));
@@ -4158,7 +4246,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
track_name->connect("text_entered",this,"_track_name_changed");
track_menu = memnew( PopupMenu );
add_child(track_menu);
- track_menu->connect("item_pressed",this,"_track_menu_selected");
+ track_menu->connect("id_pressed",this,"_track_menu_selected");
key_editor_tab->hide();
@@ -4190,7 +4278,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
scale_dialog = memnew( ConfirmationDialog );
VBoxContainer *vbc = memnew( VBoxContainer );
scale_dialog->add_child(vbc);
- scale_dialog->set_child_rect(vbc);
+
scale = memnew( SpinBox );
scale->set_min(-99999);
scale->set_max(99999);
@@ -4207,7 +4295,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
add_child(cleanup_dialog);
VBoxContainer *cleanup_vb = memnew( VBoxContainer );
cleanup_dialog->add_child(cleanup_vb);
- cleanup_dialog->set_child_rect(cleanup_vb);
+
cleanup_keys = memnew( CheckButton );
cleanup_keys->set_text(TTR("Remove invalid keys"));
cleanup_keys->set_pressed(true);
@@ -4229,6 +4317,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
add_constant_override("separation",get_constant("separation","VBoxContainer"));
+ track_editor->set_clip_contents(true);
}
diff --git a/tools/editor/animation_editor.h b/tools/editor/animation_editor.h
index 3078b3288b..c4539cd763 100644
--- a/tools/editor/animation_editor.h
+++ b/tools/editor/animation_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,7 +33,7 @@
#include "scene/gui/slider.h"
#include "scene/gui/menu_button.h"
#include "scene/gui/spin_box.h"
-#include "scene/gui/texture_frame.h"
+#include "scene/gui/texture_rect.h"
#include "scene/gui/scroll_bar.h"
#include "scene/gui/tool_button.h"
#include "scene/gui/file_dialog.h"
@@ -51,7 +51,7 @@ class AnimationCurveEdit;
class AnimationKeyEditor : public VBoxContainer {
- OBJ_TYPE( AnimationKeyEditor, VBoxContainer );
+ GDCLASS( AnimationKeyEditor, VBoxContainer );
/*
enum {
@@ -113,6 +113,7 @@ class AnimationKeyEditor : public VBoxContainer {
OVER_KEY,
OVER_VALUE,
OVER_INTERP,
+ OVER_WRAP,
OVER_UP,
OVER_DOWN,
OVER_REMOVE,
@@ -166,7 +167,9 @@ class AnimationKeyEditor : public VBoxContainer {
int track_name_editing;
int interp_editing;
int cont_editing;
+ int wrap_editing;
int selected_track;
+ int track_ofs[5];
int last_menu_track_opt;
LineEdit *track_name;
@@ -174,7 +177,7 @@ class AnimationKeyEditor : public VBoxContainer {
PopupMenu *type_menu;
Control *ec;
- TextureFrame *zoomicon;
+ TextureRect *zoomicon;
HSlider *zoom;
//MenuButton *menu;
SpinBox *length;
@@ -274,7 +277,7 @@ class AnimationKeyEditor : public VBoxContainer {
float _get_zoom_scale() const;
void _track_editor_draw();
- void _track_editor_input_event(const InputEvent& p_input);
+ void _track_editor_gui_input(const InputEvent& p_input);
void _track_pos_draw();
@@ -344,7 +347,7 @@ public:
void insert_value_key(const String& p_property, const Variant& p_value, bool p_advance);
void insert_transform_key(Spatial *p_node,const String& p_sub,const Transform& p_xform);
- void show_select_node_warning(bool p_show) { select_anim_warning->set_hidden(!p_show); }
+ void show_select_node_warning(bool p_show) { select_anim_warning->set_visible(p_show); }
AnimationKeyEditor();
~AnimationKeyEditor();
};
diff --git a/tools/editor/array_property_edit.cpp b/tools/editor/array_property_edit.cpp
index b6219ce67b..b587c4f830 100644
--- a/tools/editor/array_property_edit.cpp
+++ b/tools/editor/array_property_edit.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -100,13 +100,19 @@ bool ArrayPropertyEdit::_set(const StringName& p_name, const Variant& p_value){
ur->add_undo_method(this,"_set_value",i,arr.get(i));
}
- } else if (newsize>size && size) {
+ } else if (newsize>size) {
Variant init;
Variant::CallError ce;
- init = Variant::construct(arr.get(size-1).get_type(),NULL,0,ce);
- for(int i=size;i<newsize;i++) {
- ur->add_do_method(this,"_set_value",i,init);
+ Variant::Type new_type = subtype;
+ if(new_type==Variant::NIL && size) {
+ new_type = arr.get(size-1).get_type();
+ }
+ if(new_type!=Variant::NIL) {
+ init = Variant::construct(new_type,NULL,0,ce);
+ for(int i=size;i<newsize;i++) {
+ ur->add_do_method(this,"_set_value",i,init);
+ }
}
}
@@ -223,28 +229,52 @@ void ArrayPropertyEdit::_get_property_list( List<PropertyInfo> *p_list) const{
for(int i=0;i<items;i++) {
Variant v=arr.get(i+offset);
- if (arr.get_type()==Variant::ARRAY) {
+ bool is_typed = arr.get_type()!=Variant::ARRAY || subtype!=Variant::NIL;
+
+ if (!is_typed) {
p_list->push_back(PropertyInfo(Variant::INT,"indices/"+itos(i+offset)+"_type",PROPERTY_HINT_ENUM,vtypes));
}
- if (arr.get_type()!=Variant::ARRAY || v.get_type()!=Variant::NIL) {
+
+ if (is_typed || v.get_type()!=Variant::NIL ) {
PropertyInfo pi(v.get_type(),"indices/"+itos(i+offset));
- if (v.get_type()==Variant::OBJECT) {
+ if(subtype!=Variant::NIL) {
+ pi.type = Variant::Type(subtype);
+ pi.hint = PropertyHint(subtype_hint);
+ pi.hint_string = subtype_hint_string;
+ } else if (v.get_type()==Variant::OBJECT) {
pi.hint=PROPERTY_HINT_RESOURCE_TYPE;
pi.hint_string="Resource";
}
+
p_list->push_back(pi);
}
}
}
-void ArrayPropertyEdit::edit(Object* p_obj,const StringName& p_prop,Variant::Type p_deftype) {
+void ArrayPropertyEdit::edit(Object* p_obj,const StringName& p_prop,const String& p_hint_string,Variant::Type p_deftype) {
page=0;
property=p_prop;
obj=p_obj->get_instance_ID();
default_type=p_deftype;
+ if(!p_hint_string.empty()) {
+ int hint_subtype_seperator = p_hint_string.find(":");
+ if(hint_subtype_seperator >= 0) {
+ String subtype_string = p_hint_string.substr(0,hint_subtype_seperator);
+
+ int slash_pos = subtype_string.find("/");
+ if(slash_pos >= 0) {
+ subtype_hint = PropertyHint(subtype_string.substr(slash_pos+1, subtype_string.size()-slash_pos-1).to_int());
+ subtype_string = subtype_string.substr(0,slash_pos);
+ }
+
+ subtype_hint_string = p_hint_string.substr(hint_subtype_seperator+1, p_hint_string.size() - hint_subtype_seperator-1);
+ subtype=Variant::Type(subtype_string.to_int());
+ }
+ }
+
}
Node *ArrayPropertyEdit::get_node() {
@@ -258,10 +288,10 @@ Node *ArrayPropertyEdit::get_node() {
void ArrayPropertyEdit::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_set_size"),&ArrayPropertyEdit::_set_size);
- ObjectTypeDB::bind_method(_MD("_set_value"),&ArrayPropertyEdit::_set_value);
- ObjectTypeDB::bind_method(_MD("_notif_change"),&ArrayPropertyEdit::_notif_change);
- ObjectTypeDB::bind_method(_MD("_notif_changev"),&ArrayPropertyEdit::_notif_changev);
+ ClassDB::bind_method(_MD("_set_size"),&ArrayPropertyEdit::_set_size);
+ ClassDB::bind_method(_MD("_set_value"),&ArrayPropertyEdit::_set_value);
+ ClassDB::bind_method(_MD("_notif_change"),&ArrayPropertyEdit::_notif_change);
+ ClassDB::bind_method(_MD("_notif_changev"),&ArrayPropertyEdit::_notif_changev);
}
ArrayPropertyEdit::ArrayPropertyEdit()
@@ -274,5 +304,7 @@ ArrayPropertyEdit::ArrayPropertyEdit()
vtypes+=Variant::get_type_name( Variant::Type(i) );
}
default_type=Variant::NIL;
-
+ subtype=Variant::NIL;
+ subtype_hint=PROPERTY_HINT_NONE;
+ subtype_hint_string="";
}
diff --git a/tools/editor/array_property_edit.h b/tools/editor/array_property_edit.h
index a2aa24c8ed..6ca700bf80 100644
--- a/tools/editor/array_property_edit.h
+++ b/tools/editor/array_property_edit.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,12 +33,15 @@
class ArrayPropertyEdit : public Reference {
- OBJ_TYPE(ArrayPropertyEdit,Reference);
+ GDCLASS(ArrayPropertyEdit,Reference);
int page;
ObjectID obj;
StringName property;
String vtypes;
+ String subtype_hint_string;
+ PropertyHint subtype_hint;
+ Variant::Type subtype;
Variant get_array() const;
Variant::Type default_type;
@@ -56,7 +59,7 @@ protected:
public:
- void edit(Object* p_obj, const StringName& p_prop, Variant::Type p_deftype);
+ void edit(Object* p_obj, const StringName& p_prop, const String& p_hint_string, Variant::Type p_deftype);
Node *get_node();
diff --git a/tools/editor/asset_library_editor_plugin.cpp b/tools/editor/asset_library_editor_plugin.cpp
index 3fd5d2b5d1..ad17364685 100644
--- a/tools/editor/asset_library_editor_plugin.cpp
+++ b/tools/editor/asset_library_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -29,7 +29,7 @@
#include "asset_library_editor_plugin.h"
#include "editor_node.h"
#include "editor_settings.h"
-
+#include "io/json.h"
@@ -89,10 +89,10 @@ void EditorAssetLibraryItem::_author_clicked(){
void EditorAssetLibraryItem::_bind_methods() {
- ObjectTypeDB::bind_method("set_image",&EditorAssetLibraryItem::set_image);
- ObjectTypeDB::bind_method("_asset_clicked",&EditorAssetLibraryItem::_asset_clicked);
- ObjectTypeDB::bind_method("_category_clicked",&EditorAssetLibraryItem::_category_clicked);
- ObjectTypeDB::bind_method("_author_clicked",&EditorAssetLibraryItem::_author_clicked);
+ ClassDB::bind_method("set_image",&EditorAssetLibraryItem::set_image);
+ ClassDB::bind_method("_asset_clicked",&EditorAssetLibraryItem::_asset_clicked);
+ ClassDB::bind_method("_category_clicked",&EditorAssetLibraryItem::_category_clicked);
+ ClassDB::bind_method("_author_clicked",&EditorAssetLibraryItem::_author_clicked);
ADD_SIGNAL( MethodInfo("asset_selected"));
ADD_SIGNAL( MethodInfo("category_selected"));
ADD_SIGNAL( MethodInfo("author_selected"));
@@ -147,7 +147,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() {
vb->add_child(rating_hb);
for(int i=0;i<5;i++) {
- stars[i]=memnew(TextureFrame);
+ stars[i]=memnew(TextureRect);
rating_hb->add_child(stars[i]);
}
price = memnew( Label );
@@ -157,7 +157,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() {
set_custom_minimum_size(Size2(250,100));
set_h_size_flags(SIZE_EXPAND_FILL);
- set_stop_mouse(false);
+ set_mouse_filter(MOUSE_FILTER_PASS);
}
//////////////////////////////////////////////////////////////////////////////
@@ -199,9 +199,9 @@ void EditorAssetLibraryItemDescription::set_image(int p_type,int p_index,const R
}
void EditorAssetLibraryItemDescription::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("set_image"),&EditorAssetLibraryItemDescription::set_image);
- ObjectTypeDB::bind_method(_MD("_link_click"),&EditorAssetLibraryItemDescription::_link_click);
- ObjectTypeDB::bind_method(_MD("_preview_click"),&EditorAssetLibraryItemDescription::_preview_click);
+ ClassDB::bind_method(_MD("set_image"),&EditorAssetLibraryItemDescription::set_image);
+ ClassDB::bind_method(_MD("_link_click"),&EditorAssetLibraryItemDescription::_link_click);
+ ClassDB::bind_method(_MD("_preview_click"),&EditorAssetLibraryItemDescription::_preview_click);
}
@@ -270,7 +270,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {
VBoxContainer *vbox = memnew( VBoxContainer );
add_child(vbox);
- set_child_rect(vbox);
+
HBoxContainer *hbox = memnew( HBoxContainer);
@@ -296,7 +296,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {
desc_bg->add_child(description);
desc_bg->add_style_override("panel",get_stylebox("normal","TextEdit"));
- preview = memnew( TextureFrame );
+ preview = memnew( TextureRect );
preview->set_custom_minimum_size(Size2(640,345));
hbox->add_child(preview);
@@ -321,7 +321,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {
}
///////////////////////////////////////////////////////////////////////////////////
-void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data) {
+void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data) {
String error_text;
@@ -379,12 +379,12 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int
}
progress->set_max( download->get_body_size() );
- progress->set_val(download->get_downloaded_bytes());
+ progress->set_value(download->get_downloaded_bytes());
print_line("max: "+itos(download->get_body_size())+" bytes: "+itos(download->get_downloaded_bytes()));
install->set_disabled(false);
- progress->set_val(download->get_downloaded_bytes());
+ progress->set_value(download->get_downloaded_bytes());
status->set_text("Success! ("+String::humanize_size(download->get_downloaded_bytes())+")");
set_process(false);
@@ -411,7 +411,7 @@ void EditorAssetLibraryItemDownload::_notification(int p_what) {
if (p_what==NOTIFICATION_PROCESS) {
progress->set_max( download->get_body_size() );
- progress->set_val(download->get_downloaded_bytes());
+ progress->set_value(download->get_downloaded_bytes());
int cstatus = download->get_http_client_status();
@@ -472,10 +472,10 @@ void EditorAssetLibraryItemDownload::_make_request() {
void EditorAssetLibraryItemDownload::_bind_methods() {
- ObjectTypeDB::bind_method("_http_download_completed",&EditorAssetLibraryItemDownload::_http_download_completed);
- ObjectTypeDB::bind_method("_install",&EditorAssetLibraryItemDownload::_install);
- ObjectTypeDB::bind_method("_close",&EditorAssetLibraryItemDownload::_close);
- ObjectTypeDB::bind_method("_make_request",&EditorAssetLibraryItemDownload::_make_request);
+ ClassDB::bind_method("_http_download_completed",&EditorAssetLibraryItemDownload::_http_download_completed);
+ ClassDB::bind_method("_install",&EditorAssetLibraryItemDownload::_install);
+ ClassDB::bind_method("_close",&EditorAssetLibraryItemDownload::_close);
+ ClassDB::bind_method("_make_request",&EditorAssetLibraryItemDownload::_make_request);
ADD_SIGNAL(MethodInfo("install_asset",PropertyInfo(Variant::STRING,"zip_path"),PropertyInfo(Variant::STRING,"name")));
@@ -485,7 +485,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
HBoxContainer *hb = memnew( HBoxContainer);
add_child(hb);
- icon = memnew( TextureFrame );
+ icon = memnew( TextureRect );
hb->add_child(icon);
VBoxContainer *vb = memnew( VBoxContainer );
@@ -555,7 +555,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
void EditorAssetLibrary::_notification(int p_what) {
if (p_what==NOTIFICATION_READY) {
- TextureFrame *tf = memnew(TextureFrame);
+ TextureRect *tf = memnew(TextureRect);
tf->set_texture(get_icon("Error","EditorIcons"));
reverse->set_icon(get_icon("Updown","EditorIcons"));
@@ -564,7 +564,7 @@ void EditorAssetLibrary::_notification(int p_what) {
}
if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
- if(!is_hidden()) {
+ if(is_visible()) {
_repository_changed(0); // Update when shown for the first time
}
}
@@ -574,24 +574,24 @@ void EditorAssetLibrary::_notification(int p_what) {
HTTPClient::Status s = request->get_http_client_status();
bool visible = s!=HTTPClient::STATUS_DISCONNECTED;
- if (visible != !load_status->is_hidden()) {
- load_status->set_hidden(!visible);
+ if (visible != load_status->is_visible()) {
+ load_status->set_visible(visible);
}
if (visible) {
switch(s) {
case HTTPClient::STATUS_RESOLVING: {
- load_status->set_val(0.1);
+ load_status->set_value(0.1);
} break;
case HTTPClient::STATUS_CONNECTING: {
- load_status->set_val(0.2);
+ load_status->set_value(0.2);
} break;
case HTTPClient::STATUS_REQUESTING: {
- load_status->set_val(0.3);
+ load_status->set_value(0.3);
} break;
case HTTPClient::STATUS_BODY: {
- load_status->set_val(0.4);
+ load_status->set_value(0.4);
} break;
default: {}
@@ -599,8 +599,8 @@ void EditorAssetLibrary::_notification(int p_what) {
}
bool no_downloads = downloads_hb->get_child_count()==0;
- if (no_downloads != downloads_scroll->is_hidden()) {
- downloads_scroll->set_hidden(no_downloads);
+ if (no_downloads == downloads_scroll->is_visible()) {
+ downloads_scroll->set_visible(!no_downloads);
}
}
@@ -691,12 +691,12 @@ void EditorAssetLibrary::_select_asset(int p_id){
description->popup_centered_minsize();*/
}
-void EditorAssetLibrary::_image_update(bool use_cache, bool final, const ByteArray& p_data, int p_queue_id) {
+void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByteArray& p_data, int p_queue_id) {
Object *obj = ObjectDB::get_instance(image_queue[p_queue_id].target);
if (obj) {
bool image_set = false;
- ByteArray image_data = p_data;
+ PoolByteArray image_data = p_data;
if(use_cache) {
String cache_filename_base = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp").plus_file("assetimage_"+image_queue[p_queue_id].image_url.md5_text());
@@ -704,11 +704,11 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const ByteArr
FileAccess* file = FileAccess::open(cache_filename_base+".data", FileAccess::READ);
if(file) {
- ByteArray cached_data;
+ PoolByteArray cached_data;
int len=file->get_32();
cached_data.resize(len);
- ByteArray::Write w=cached_data.write();
+ PoolByteArray::Write w=cached_data.write();
file->get_buffer(w.ptr(), len);
image_data = cached_data;
@@ -717,7 +717,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const ByteArr
}
int len=image_data.size();
- ByteArray::Read r=image_data.read();
+ PoolByteArray::Read r=image_data.read();
Image image(r.ptr(),len);
if (!image.empty()) {
float max_height = 10000;
@@ -745,7 +745,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const ByteArr
}
}
-void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data,int p_queue_id) {
+void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data,int p_queue_id) {
ERR_FAIL_COND( !image_queue.has(p_queue_id) );
@@ -767,7 +767,7 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons
}
int len=p_data.size();
- ByteArray::Read r=p_data.read();
+ PoolByteArray::Read r=p_data.read();
file = FileAccess::open(cache_filename_base+".data", FileAccess::WRITE);
if(file) {
file->store_32(len);
@@ -855,7 +855,7 @@ void EditorAssetLibrary::_request_image(ObjectID p_for,String p_image_url,ImageT
add_child(iq.request);
- _image_update(true, false, ByteArray(), iq.queue_id);
+ _image_update(true, false, PoolByteArray(), iq.queue_id);
_update_image_queue();
@@ -1021,14 +1021,14 @@ void EditorAssetLibrary::_api_request(const String& p_request, RequestType p_req
-void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data) {
+void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data) {
String str;
{
int datalen=p_data.size();
- ByteArray::Read r = p_data.read();
+ PoolByteArray::Read r = p_data.read();
str.parse_utf8((const char*)r.ptr(),datalen);
}
@@ -1076,8 +1076,16 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const
}
print_line("response: "+itos(p_status)+" code: "+itos(p_code));
+
Dictionary d;
- d.parse_json(str);
+ {
+ Variant js;
+ String errs;
+ int errl;
+ JSON::parse(str,js,errs,errl);
+ d=js;
+ }
+
print_line(Variant(d).get_construct_string());
@@ -1288,20 +1296,20 @@ void EditorAssetLibrary::_install_external_asset(String p_zip_path,String p_titl
void EditorAssetLibrary::_bind_methods() {
- ObjectTypeDB::bind_method("_http_request_completed",&EditorAssetLibrary::_http_request_completed);
- ObjectTypeDB::bind_method("_select_asset",&EditorAssetLibrary::_select_asset);
- ObjectTypeDB::bind_method("_select_author",&EditorAssetLibrary::_select_author);
- ObjectTypeDB::bind_method("_select_category",&EditorAssetLibrary::_select_category);
- ObjectTypeDB::bind_method("_image_request_completed",&EditorAssetLibrary::_image_request_completed);
- ObjectTypeDB::bind_method("_search",&EditorAssetLibrary::_search,DEFVAL(0));
- ObjectTypeDB::bind_method("_install_asset",&EditorAssetLibrary::_install_asset);
- ObjectTypeDB::bind_method("_manage_plugins",&EditorAssetLibrary::_manage_plugins);
- ObjectTypeDB::bind_method("_asset_open",&EditorAssetLibrary::_asset_open);
- ObjectTypeDB::bind_method("_asset_file_selected",&EditorAssetLibrary::_asset_file_selected);
- ObjectTypeDB::bind_method("_repository_changed",&EditorAssetLibrary::_repository_changed);
- ObjectTypeDB::bind_method("_support_toggled",&EditorAssetLibrary::_support_toggled);
- ObjectTypeDB::bind_method("_rerun_search",&EditorAssetLibrary::_rerun_search);
- ObjectTypeDB::bind_method("_install_external_asset",&EditorAssetLibrary::_install_external_asset);
+ ClassDB::bind_method("_http_request_completed",&EditorAssetLibrary::_http_request_completed);
+ ClassDB::bind_method("_select_asset",&EditorAssetLibrary::_select_asset);
+ ClassDB::bind_method("_select_author",&EditorAssetLibrary::_select_author);
+ ClassDB::bind_method("_select_category",&EditorAssetLibrary::_select_category);
+ ClassDB::bind_method("_image_request_completed",&EditorAssetLibrary::_image_request_completed);
+ ClassDB::bind_method("_search",&EditorAssetLibrary::_search,DEFVAL(0));
+ ClassDB::bind_method("_install_asset",&EditorAssetLibrary::_install_asset);
+ ClassDB::bind_method("_manage_plugins",&EditorAssetLibrary::_manage_plugins);
+ ClassDB::bind_method("_asset_open",&EditorAssetLibrary::_asset_open);
+ ClassDB::bind_method("_asset_file_selected",&EditorAssetLibrary::_asset_file_selected);
+ ClassDB::bind_method("_repository_changed",&EditorAssetLibrary::_repository_changed);
+ ClassDB::bind_method("_support_toggled",&EditorAssetLibrary::_support_toggled);
+ ClassDB::bind_method("_rerun_search",&EditorAssetLibrary::_rerun_search);
+ ClassDB::bind_method("_install_external_asset",&EditorAssetLibrary::_install_external_asset);
@@ -1418,7 +1426,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
support->get_popup()->add_check_item(TTR("Testing"),SUPPORT_TESTING);
support->get_popup()->set_item_checked(SUPPORT_OFFICIAL,true);
support->get_popup()->set_item_checked(SUPPORT_COMMUNITY,true);
- support->get_popup()->connect("item_pressed",this,"_support_toggled");
+ support->get_popup()->connect("id_pressed",this,"_support_toggled");
/////////
@@ -1446,7 +1454,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
library_scroll->add_child(library_vb_border);
library_vb_border->add_style_override("panel",border2);
library_vb_border->set_h_size_flags(SIZE_EXPAND_FILL);
- library_vb_border->set_stop_mouse(false);
+ library_vb_border->set_mouse_filter(MOUSE_FILTER_PASS);
@@ -1454,7 +1462,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
library_vb->set_h_size_flags(SIZE_EXPAND_FILL);
library_vb_border->add_child(library_vb);
-// margin_panel->set_stop_mouse(false);
+ //margin_panel->set_stop_mouse(false);
asset_top_page = memnew( HBoxContainer );
library_vb->add_child(asset_top_page);
diff --git a/tools/editor/asset_library_editor_plugin.h b/tools/editor/asset_library_editor_plugin.h
index fe40255af9..0598ea90ea 100644
--- a/tools/editor/asset_library_editor_plugin.h
+++ b/tools/editor/asset_library_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -52,13 +52,13 @@
class EditorAssetLibraryItem : public PanelContainer {
- OBJ_TYPE( EditorAssetLibraryItem, PanelContainer );
+ GDCLASS( EditorAssetLibraryItem, PanelContainer );
TextureButton *icon;
LinkButton* title;
LinkButton* category;
LinkButton* author;
- TextureFrame *stars[5];
+ TextureRect *stars[5];
Label* price;
int asset_id;
@@ -88,7 +88,7 @@ public:
class EditorAssetLibraryItemDescription : public ConfirmationDialog {
- OBJ_TYPE(EditorAssetLibraryItemDescription, ConfirmationDialog);
+ GDCLASS(EditorAssetLibraryItemDescription, ConfirmationDialog);
EditorAssetLibraryItem *item;
RichTextLabel *description;
@@ -104,7 +104,7 @@ class EditorAssetLibraryItemDescription : public ConfirmationDialog {
};
Vector<Preview> preview_images;
- TextureFrame *preview;
+ TextureRect *preview;
void set_image(int p_type,int p_index,const Ref<Texture>& p_image);
@@ -135,10 +135,10 @@ public:
class EditorAssetLibraryItemDownload : public PanelContainer {
- OBJ_TYPE(EditorAssetLibraryItemDownload, PanelContainer);
+ GDCLASS(EditorAssetLibraryItemDownload, PanelContainer);
- TextureFrame *icon;
+ TextureRect *icon;
Label* title;
ProgressBar *progress;
Button *install;
@@ -162,7 +162,7 @@ class EditorAssetLibraryItemDownload : public PanelContainer {
void _close();
void _install();
void _make_request();
- void _http_download_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data);
+ void _http_download_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data);
protected:
@@ -178,7 +178,7 @@ public:
};
class EditorAssetLibrary : public PanelContainer {
- OBJ_TYPE(EditorAssetLibrary,PanelContainer);
+ GDCLASS(EditorAssetLibrary,PanelContainer);
String host;
@@ -259,8 +259,8 @@ class EditorAssetLibrary : public PanelContainer {
int last_queue_id;
Map<int,ImageQueue> image_queue;
- void _image_update(bool use_cache, bool final, const ByteArray& p_data, int p_queue_id);
- void _image_request_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data, int p_queue_id);
+ void _image_update(bool use_cache, bool final, const PoolByteArray& p_data, int p_queue_id);
+ void _image_request_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data, int p_queue_id);
void _request_image(ObjectID p_for,String p_image_url,ImageType p_type,int p_image_index);
void _update_image_queue();
@@ -298,8 +298,8 @@ class EditorAssetLibrary : public PanelContainer {
void _search(int p_page=0);
void _rerun_search(int p_ignore);
void _api_request(const String& p_request, RequestType p_request_type, const String &p_arguments="");
- void _http_request_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data);
- void _http_download_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data);
+ void _http_request_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data);
+ void _http_download_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data);
void _repository_changed(int p_repository_id);
void _support_toggled(int p_support);
@@ -318,7 +318,7 @@ public:
class AssetLibraryEditorPlugin : public EditorPlugin {
- OBJ_TYPE( AssetLibraryEditorPlugin, EditorPlugin );
+ GDCLASS( AssetLibraryEditorPlugin, EditorPlugin );
EditorAssetLibrary *addon_library;
EditorNode *editor;
diff --git a/tools/editor/call_dialog.cpp b/tools/editor/call_dialog.cpp
index 0c6c64a33b..f8966093f6 100644
--- a/tools/editor/call_dialog.cpp
+++ b/tools/editor/call_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -28,6 +28,7 @@
/*************************************************************************/
#include "call_dialog.h"
+#if 0
#include "scene/gui/label.h"
#include "object_type_db.h"
#include "print_string.h"
@@ -35,7 +36,7 @@
class CallDialogParams : public Object {
- OBJ_TYPE( CallDialogParams, Object );
+ GDCLASS( CallDialogParams, Object );
public:
bool _set(const StringName& p_name, const Variant& p_value) {
@@ -170,11 +171,11 @@ void CallDialog::_update_method_list() {
List<String> inheritance_list;
- String type = object->get_type();
+ String type = object->get_class();
while(type!="") {
inheritance_list.push_back( type );
- type=ObjectTypeDB::type_inherits_from(type);
+ type=ClassDB::get_parent_class(type);
}
TreeItem *selected_item=NULL;
@@ -182,7 +183,7 @@ void CallDialog::_update_method_list() {
for(int i=0;i<inheritance_list.size();i++) {
String type=inheritance_list[i];
- String parent_type=ObjectTypeDB::type_inherits_from(type);
+ String parent_type=ClassDB::get_parent_class(type);
TreeItem *type_item=NULL;
@@ -192,7 +193,7 @@ void CallDialog::_update_method_list() {
N=E->next();
- if (parent_type!="" && ObjectTypeDB::get_method(parent_type,E->get().name)!=NULL) {
+ if (parent_type!="" && ClassDB::get_method(parent_type,E->get().name)!=NULL) {
E=N;
continue;
}
@@ -224,9 +225,9 @@ void CallDialog::_update_method_list() {
void CallDialog::_bind_methods() {
- ObjectTypeDB::bind_method("_call",&CallDialog::_call);
- ObjectTypeDB::bind_method("_cancel",&CallDialog::_cancel);
- ObjectTypeDB::bind_method("_item_selected", &CallDialog::_item_selected);
+ ClassDB::bind_method("_call",&CallDialog::_call);
+ ClassDB::bind_method("_cancel",&CallDialog::_cancel);
+ ClassDB::bind_method("_item_selected", &CallDialog::_item_selected);
}
@@ -239,7 +240,7 @@ void CallDialog::set_object(Object *p_object,StringName p_selected) {
return_value->clear();
_update_method_list();
- method_label->set_text(vformat(TTR("Method List For '%s':"),p_object->get_type()));
+ method_label->set_text(vformat(TTR("Method List For '%s':"),p_object->get_class()));
}
CallDialog::CallDialog() {
@@ -268,7 +269,6 @@ CallDialog::CallDialog() {
tree = memnew( Tree );
- tree->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO );
tree->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
tree->set_begin( Point2( 20,50 ) );
tree->set_margin(MARGIN_BOTTOM, 44 );
@@ -283,7 +283,7 @@ CallDialog::CallDialog() {
property_editor->set_anchor_and_margin( MARGIN_RIGHT, ANCHOR_END, 15 );
property_editor->set_anchor_and_margin( MARGIN_TOP, ANCHOR_BEGIN, 50 );
- property_editor->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 );
+ //property_editor->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 );
property_editor->set_anchor_and_margin( MARGIN_BOTTOM, ANCHOR_END, 90 );
property_editor->get_scene_tree()->set_hide_root( true );
property_editor->hide_top_label();
@@ -296,21 +296,21 @@ CallDialog::CallDialog() {
add_child(method_label);
Label *label = memnew( Label );
- label->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.53 );
+ //label->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.53 );
label->set_anchor_and_margin( MARGIN_TOP, ANCHOR_BEGIN, 25 );
label->set_text(TTR("Arguments:"));
add_child(label);
return_label = memnew( Label );
- return_label->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.53 );
+ //return_label->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.53 );
return_label->set_anchor_and_margin( MARGIN_TOP, ANCHOR_END, 85 );
return_label->set_text(TTR("Return:"));
add_child(return_label);
return_value = memnew( LineEdit );
- return_value->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 );
+ //return_value->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 );
return_value->set_anchor_and_margin( MARGIN_RIGHT, ANCHOR_END, 15 );
return_value->set_anchor_and_margin( MARGIN_TOP, ANCHOR_END, 65 );
@@ -338,3 +338,4 @@ CallDialog::~CallDialog()
{
memdelete(call_params);
}
+#endif
diff --git a/tools/editor/call_dialog.h b/tools/editor/call_dialog.h
index a2ca925ff1..b0ebe68d86 100644
--- a/tools/editor/call_dialog.h
+++ b/tools/editor/call_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -39,12 +39,13 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
+#if 0
class CallDialogParams;
class CallDialog : public Popup {
- OBJ_TYPE( CallDialog, Popup );
+ GDCLASS( CallDialog, Popup );
Label* method_label;
@@ -81,3 +82,4 @@ public:
};
#endif
+#endif
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp
index 9240e3527c..00767fd297 100644
--- a/tools/editor/code_editor.cpp
+++ b/tools/editor/code_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -91,7 +91,7 @@ void FindReplaceBar::_notification(int p_what) {
} else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
- set_process_unhandled_input(is_visible());
+ set_process_unhandled_input(is_visible_in_tree());
}
}
@@ -377,7 +377,7 @@ void FindReplaceBar::popup_search() {
void FindReplaceBar::popup_replace() {
- if (!replace_hbc->is_visible() || !replace_options_hbc->is_visible()) {
+ if (!replace_hbc->is_visible_in_tree() || !replace_options_hbc->is_visible_in_tree()) {
replace_text->clear();
replace_hbc->show();
replace_options_hbc->show();
@@ -396,7 +396,7 @@ void FindReplaceBar::_search_options_changed(bool p_pressed) {
void FindReplaceBar::_editor_text_changed() {
- if (is_visible()) {
+ if (is_visible_in_tree()) {
preserve_cursor=true;
search_current();
preserve_cursor=false;
@@ -459,19 +459,19 @@ void FindReplaceBar::set_text_edit(TextEdit *p_text_edit) {
void FindReplaceBar::_bind_methods() {
- ObjectTypeDB::bind_method("_unhandled_input",&FindReplaceBar::_unhandled_input);
+ ClassDB::bind_method("_unhandled_input",&FindReplaceBar::_unhandled_input);
- ObjectTypeDB::bind_method("_editor_text_changed",&FindReplaceBar::_editor_text_changed);
- ObjectTypeDB::bind_method("_search_text_changed",&FindReplaceBar::_search_text_changed);
- ObjectTypeDB::bind_method("_search_text_entered",&FindReplaceBar::_search_text_entered);
- ObjectTypeDB::bind_method("_replace_text_entered",&FindReplaceBar::_replace_text_entered);
- ObjectTypeDB::bind_method("_search_current",&FindReplaceBar::search_current);
- ObjectTypeDB::bind_method("_search_next",&FindReplaceBar::search_next);
- ObjectTypeDB::bind_method("_search_prev",&FindReplaceBar::search_prev);
- ObjectTypeDB::bind_method("_replace_pressed",&FindReplaceBar::_replace);
- ObjectTypeDB::bind_method("_replace_all_pressed",&FindReplaceBar::_replace_all);
- ObjectTypeDB::bind_method("_search_options_changed",&FindReplaceBar::_search_options_changed);
- ObjectTypeDB::bind_method("_hide_pressed",&FindReplaceBar::_hide_bar);
+ ClassDB::bind_method("_editor_text_changed",&FindReplaceBar::_editor_text_changed);
+ ClassDB::bind_method("_search_text_changed",&FindReplaceBar::_search_text_changed);
+ ClassDB::bind_method("_search_text_entered",&FindReplaceBar::_search_text_entered);
+ ClassDB::bind_method("_replace_text_entered",&FindReplaceBar::_replace_text_entered);
+ ClassDB::bind_method("_search_current",&FindReplaceBar::search_current);
+ ClassDB::bind_method("_search_next",&FindReplaceBar::search_next);
+ ClassDB::bind_method("_search_prev",&FindReplaceBar::search_prev);
+ ClassDB::bind_method("_replace_pressed",&FindReplaceBar::_replace);
+ ClassDB::bind_method("_replace_all_pressed",&FindReplaceBar::_replace_all);
+ ClassDB::bind_method("_search_options_changed",&FindReplaceBar::_search_options_changed);
+ ClassDB::bind_method("_hide_pressed",&FindReplaceBar::_hide_bar);
ADD_SIGNAL(MethodInfo("search"));
}
@@ -714,7 +714,7 @@ void FindReplaceDialog::_replace() {
}
text_edit->set_v_scroll(vsval);
-// text_edit->set_h_scroll(hsval);
+ //text_edit->set_h_scroll(hsval);
error_label->set_text(vformat(TTR("Replaced %d ocurrence(s)."),rc));
@@ -801,7 +801,7 @@ void FindReplaceDialog::_skip_pressed() {
bool FindReplaceDialog::is_replace_mode() const {
- return replace_text->is_visible();
+ return replace_text->is_visible_in_tree();
}
bool FindReplaceDialog::is_replace_all_mode() const {
@@ -826,7 +826,7 @@ void FindReplaceDialog::ok_pressed() {
void FindReplaceDialog::_search_text_entered(const String& p_text) {
- if (replace_text->is_visible())
+ if (replace_text->is_visible_in_tree())
return;
emit_signal("search");
_search();
@@ -835,7 +835,7 @@ void FindReplaceDialog::_search_text_entered(const String& p_text) {
void FindReplaceDialog::_replace_text_entered(const String& p_text) {
- if (!replace_text->is_visible())
+ if (!replace_text->is_visible_in_tree())
return;
emit_signal("search");
@@ -884,10 +884,10 @@ void FindReplaceDialog::search_next() {
void FindReplaceDialog::_bind_methods() {
- ObjectTypeDB::bind_method("_search_text_entered",&FindReplaceDialog::_search_text_entered);
- ObjectTypeDB::bind_method("_replace_text_entered",&FindReplaceDialog::_replace_text_entered);
- ObjectTypeDB::bind_method("_prompt_changed",&FindReplaceDialog::_prompt_changed);
- ObjectTypeDB::bind_method("_skip_pressed",&FindReplaceDialog::_skip_pressed);
+ ClassDB::bind_method("_search_text_entered",&FindReplaceDialog::_search_text_entered);
+ ClassDB::bind_method("_replace_text_entered",&FindReplaceDialog::_replace_text_entered);
+ ClassDB::bind_method("_prompt_changed",&FindReplaceDialog::_prompt_changed);
+ ClassDB::bind_method("_skip_pressed",&FindReplaceDialog::_skip_pressed);
ADD_SIGNAL(MethodInfo("search"));
ADD_SIGNAL(MethodInfo("skip"));
@@ -895,11 +895,11 @@ void FindReplaceDialog::_bind_methods() {
FindReplaceDialog::FindReplaceDialog() {
- set_self_opacity(0.8);
+ set_self_modulate(Color(1,1,1,0.8));
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
- set_child_rect(vb);
+
search_text = memnew( LineEdit );
@@ -951,7 +951,7 @@ FindReplaceDialog::FindReplaceDialog() {
VBoxContainer *rvb = memnew( VBoxContainer);
opt_mg->add_child(rvb);
replace_vb=rvb;
-// rvb ->add_child(memnew(HSeparator));
+ //rvb ->add_child(memnew(HSeparator));
rvb ->add_child(memnew(Label));
prompt = memnew( CheckButton );
@@ -995,7 +995,7 @@ FindReplaceDialog::FindReplaceDialog() {
/*** CODE EDITOR ****/
-void CodeTextEditor::_text_editor_input_event(const InputEvent& p_event) {
+void CodeTextEditor::_text_editor_gui_input(const InputEvent& p_event) {
if (p_event.type==InputEvent::MOUSE_BUTTON) {
@@ -1043,7 +1043,7 @@ void CodeTextEditor::_reset_zoom() {
Ref<DynamicFont> font = text_editor->get_font("font"); // reset source font size to default
if (font.is_valid()) {
- EditorSettings::get_singleton()->set("global/source_font_size",14);
+ EditorSettings::get_singleton()->set("interface/source_font_size",14);
font->set_size(14);
}
}
@@ -1051,7 +1051,7 @@ void CodeTextEditor::_reset_zoom() {
void CodeTextEditor::_line_col_changed() {
line_nb->set_text(itos(text_editor->cursor_get_line() + 1));
- col_nb->set_text(itos(text_editor->cursor_get_column()));
+ col_nb->set_text(itos(text_editor->cursor_get_column() + 1));
}
void CodeTextEditor::_text_changed() {
@@ -1061,7 +1061,7 @@ void CodeTextEditor::_text_changed() {
}
void CodeTextEditor::_code_complete_timer_timeout() {
- if (!is_visible())
+ if (!is_visible_in_tree())
return;
if (enable_complete_timer)
text_editor->query_code_comple();
@@ -1097,7 +1097,7 @@ void CodeTextEditor::_font_resize_timeout() {
int size=font->get_size()+font_resize_val;
if (size>=8 && size<=96) {
- EditorSettings::get_singleton()->set("global/source_font_size",size);
+ EditorSettings::get_singleton()->set("interface/source_font_size",size);
font->set_size(size);
}
@@ -1105,6 +1105,24 @@ void CodeTextEditor::_font_resize_timeout() {
}
}
+void CodeTextEditor::update_editor_settings() {
+
+ text_editor->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/completion/auto_brace_complete"));
+ text_editor->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/cursor/scroll_past_end_of_file"));
+ text_editor->set_tab_size(EditorSettings::get_singleton()->get("text_editor/indent/tab_size"));
+ text_editor->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/indent/draw_tabs"));
+ text_editor->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_line_numbers"));
+ text_editor->set_line_numbers_zero_padded(EditorSettings::get_singleton()->get("text_editor/line_numbers/line_numbers_zero_padded"));
+ text_editor->set_show_line_length_guideline(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_line_length_guideline"));
+ text_editor->set_line_length_guideline_column(EditorSettings::get_singleton()->get("text_editor/line_numbers/line_length_guideline_column"));
+ text_editor->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/highlighting/syntax_highlighting"));
+ text_editor->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_all_occurrences"));
+ text_editor->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink"));
+ text_editor->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink_speed"));
+ text_editor->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_breakpoint_gutter"));
+ text_editor->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/cursor/block_caret"));
+}
+
void CodeTextEditor::set_error(const String& p_error) {
if (p_error!="") {
@@ -1119,7 +1137,7 @@ void CodeTextEditor::set_error(const String& p_error) {
void CodeTextEditor::_update_font() {
// FONTS
- String editor_font = EDITOR_DEF("text_editor/font", "");
+ String editor_font = EDITOR_DEF("text_editor/theme/font", "");
bool font_overridden = false;
if (editor_font!="") {
Ref<Font> fnt = ResourceLoader::load(editor_font);
@@ -1140,19 +1158,19 @@ void CodeTextEditor::_on_settings_change() {
// AUTO BRACE COMPLETION
text_editor->set_auto_brace_completion(
- EDITOR_DEF("text_editor/auto_brace_complete", true)
+ EDITOR_DEF("text_editor/completion/auto_brace_complete", true)
);
code_complete_timer->set_wait_time(
- EDITOR_DEF("text_editor/code_complete_delay",.3f)
+ EDITOR_DEF("text_editor/completion/code_complete_delay",.3f)
);
- enable_complete_timer = EDITOR_DEF("text_editor/enable_code_completion_delay",true);
+ enable_complete_timer = EDITOR_DEF("text_editor/completion/enable_code_completion_delay",true);
// call hint settings
text_editor->set_callhint_settings(
- EDITOR_DEF("text_editor/put_callhint_tooltip_below_current_line", true),
- EDITOR_DEF("text_editor/callhint_tooltip_offset", Vector2())
+ EDITOR_DEF("text_editor/completion/put_callhint_tooltip_below_current_line", true),
+ EDITOR_DEF("text_editor/completion/callhint_tooltip_offset", Vector2())
);
}
@@ -1177,14 +1195,14 @@ void CodeTextEditor::_notification(int p_what) {
void CodeTextEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_text_editor_input_event",&CodeTextEditor::_text_editor_input_event);
- ObjectTypeDB::bind_method("_line_col_changed",&CodeTextEditor::_line_col_changed);
- ObjectTypeDB::bind_method("_text_changed",&CodeTextEditor::_text_changed);
- ObjectTypeDB::bind_method("_on_settings_change",&CodeTextEditor::_on_settings_change);
- ObjectTypeDB::bind_method("_text_changed_idle_timeout",&CodeTextEditor::_text_changed_idle_timeout);
- ObjectTypeDB::bind_method("_code_complete_timer_timeout",&CodeTextEditor::_code_complete_timer_timeout);
- ObjectTypeDB::bind_method("_complete_request",&CodeTextEditor::_complete_request);
- ObjectTypeDB::bind_method("_font_resize_timeout",&CodeTextEditor::_font_resize_timeout);
+ ClassDB::bind_method("_text_editor_gui_input",&CodeTextEditor::_text_editor_gui_input);
+ ClassDB::bind_method("_line_col_changed",&CodeTextEditor::_line_col_changed);
+ ClassDB::bind_method("_text_changed",&CodeTextEditor::_text_changed);
+ ClassDB::bind_method("_on_settings_change",&CodeTextEditor::_on_settings_change);
+ ClassDB::bind_method("_text_changed_idle_timeout",&CodeTextEditor::_text_changed_idle_timeout);
+ ClassDB::bind_method("_code_complete_timer_timeout",&CodeTextEditor::_code_complete_timer_timeout);
+ ClassDB::bind_method("_complete_request",&CodeTextEditor::_complete_request);
+ ClassDB::bind_method("_font_resize_timeout",&CodeTextEditor::_font_resize_timeout);
ADD_SIGNAL(MethodInfo("validate_script"));
ADD_SIGNAL(MethodInfo("load_theme_settings"));
@@ -1234,14 +1252,14 @@ CodeTextEditor::CodeTextEditor() {
idle = memnew( Timer );
add_child(idle);
idle->set_one_shot(true);
- idle->set_wait_time(EDITOR_DEF("text_editor/idle_parse_delay",2));
+ idle->set_wait_time(EDITOR_DEF("text_editor/completion/idle_parse_delay",2));
code_complete_timer = memnew(Timer);
add_child(code_complete_timer);
code_complete_timer->set_one_shot(true);
- enable_complete_timer = EDITOR_DEF("text_editor/enable_code_completion_delay",true);
+ enable_complete_timer = EDITOR_DEF("text_editor/completion/enable_code_completion_delay",true);
- code_complete_timer->set_wait_time(EDITOR_DEF("text_editor/code_complete_delay",.3f));
+ code_complete_timer->set_wait_time(EDITOR_DEF("text_editor/completion/code_complete_delay",.3f));
error = memnew( Label );
status_bar->add_child(error);
@@ -1279,7 +1297,7 @@ CodeTextEditor::CodeTextEditor() {
col_nb->set_autowrap(true); // workaround to prevent resizing the label on each change
col_nb->set_custom_minimum_size(Size2(40,1)*EDSCALE);
- text_editor->connect("input_event", this,"_text_editor_input_event");
+ text_editor->connect("gui_input", this,"_text_editor_gui_input");
text_editor->connect("cursor_changed", this,"_line_col_changed");
text_editor->connect("text_changed", this,"_text_changed");
text_editor->connect("request_completion", this,"_complete_request");
@@ -1287,6 +1305,7 @@ CodeTextEditor::CodeTextEditor() {
cs.push_back(".");
cs.push_back(",");
cs.push_back("(");
+ cs.push_back("$");
text_editor->set_completion(true,cs);
idle->connect("timeout", this,"_text_changed_idle_timeout");
diff --git a/tools/editor/code_editor.h b/tools/editor/code_editor.h
index 6f59dda1ee..a000f02010 100644
--- a/tools/editor/code_editor.h
+++ b/tools/editor/code_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -42,7 +42,7 @@
class GotoLineDialog : public ConfirmationDialog {
- OBJ_TYPE(GotoLineDialog,ConfirmationDialog);
+ GDCLASS(GotoLineDialog,ConfirmationDialog);
Label *line_label;
LineEdit *line;
@@ -62,7 +62,7 @@ public:
class FindReplaceBar : public HBoxContainer {
- OBJ_TYPE(FindReplaceBar,HBoxContainer);
+ GDCLASS(FindReplaceBar,HBoxContainer);
LineEdit *search_text;
ToolButton *find_prev;
@@ -134,7 +134,7 @@ public:
class FindReplaceDialog : public ConfirmationDialog {
- OBJ_TYPE(FindReplaceDialog,ConfirmationDialog);
+ GDCLASS(FindReplaceDialog,ConfirmationDialog);
LineEdit *search_text;
LineEdit *replace_text;
@@ -194,7 +194,7 @@ typedef void (*CodeTextEditorCodeCompleteFunc)(void* p_ud,const String& p_code,
class CodeTextEditor : public VBoxContainer {
- OBJ_TYPE(CodeTextEditor,VBoxContainer);
+ GDCLASS(CodeTextEditor,VBoxContainer);
TextEdit *text_editor;
FindReplaceBar *find_replace_bar;
@@ -217,7 +217,7 @@ class CodeTextEditor : public VBoxContainer {
void _complete_request();
void _font_resize_timeout();
- void _text_editor_input_event(const InputEvent& p_event);
+ void _text_editor_gui_input(const InputEvent& p_event);
void _zoom_in();
void _zoom_out();
void _reset_zoom();
@@ -242,6 +242,7 @@ protected:
public:
+ void update_editor_settings();
void set_error(const String& p_error);
void update_line_and_column() { _line_col_changed(); }
TextEdit *get_text_edit() { return text_editor; }
diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp
index c4f2435675..92dd206030 100644
--- a/tools/editor/connections_dialog.cpp
+++ b/tools/editor/connections_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -39,7 +39,7 @@
class ConnectDialogBinds : public Object {
- OBJ_TYPE( ConnectDialogBinds, Object );
+ GDCLASS( ConnectDialogBinds, Object );
public:
Vector<Variant> params;
@@ -127,7 +127,7 @@ void ConnectDialog::_tree_node_selected() {
if (E->get().name.length() && E->get().name[0]=='_')
continue; // hidden method, not show!
- if (ObjectTypeDB::has_method(node->get_type(),"Node") || ObjectTypeDB::has_method(node->get_type(),"Control",true))
+ if (ClassDB::has_method(node->get_type(),"Node") || ClassDB::has_method(node->get_type(),"Control",true))
continue; //avoid too much unnecesary stuff
String method=E->get().name+"(";
@@ -181,6 +181,14 @@ void ConnectDialog::ok_pressed() {
error->popup_centered_minsize();
return;
}
+ Node* target = tree->get_selected();
+ if (target->get_script().is_null()) {
+ if (!target->has_method(dst_method->get_text())) {
+ error->set_text(TTR("Target method not found! Specify a valid method or attach a script to target Node."));
+ error->popup_centered_minsize();
+ return;
+ }
+ }
emit_signal("connected");
hide();
@@ -241,8 +249,8 @@ void ConnectDialog::_add_bind() {
case Variant::VECTOR3: value = Vector3(); break;
case Variant::PLANE: value = Plane(); break;
case Variant::QUAT: value = Quat(); break;
- case Variant::_AABB: value = AABB(); break;
- case Variant::MATRIX3: value = Matrix3(); break;
+ case Variant::RECT3: value = Rect3(); break;
+ case Variant::BASIS: value = Basis(); break;
case Variant::TRANSFORM: value = Transform(); break;
case Variant::COLOR: value = Color(); break;
case Variant::IMAGE: value = Image(); break;
@@ -282,13 +290,13 @@ void ConnectDialog::set_dst_method(const StringName& p_method) {
void ConnectDialog::_bind_methods() {
- //ObjectTypeDB::bind_method("_ok",&ConnectDialog::_ok_pressed);
- ObjectTypeDB::bind_method("_cancel",&ConnectDialog::_cancel_pressed);
- //ObjectTypeDB::bind_method("_dst_method_list_selected",&ConnectDialog::_dst_method_list_selected);
- ObjectTypeDB::bind_method("_tree_node_selected",&ConnectDialog::_tree_node_selected);
+ //ClassDB::bind_method("_ok",&ConnectDialog::_ok_pressed);
+ ClassDB::bind_method("_cancel",&ConnectDialog::_cancel_pressed);
+ //ClassDB::bind_method("_dst_method_list_selected",&ConnectDialog::_dst_method_list_selected);
+ ClassDB::bind_method("_tree_node_selected",&ConnectDialog::_tree_node_selected);
- ObjectTypeDB::bind_method("_add_bind",&ConnectDialog::_add_bind);
- ObjectTypeDB::bind_method("_remove_bind",&ConnectDialog::_remove_bind);
+ ClassDB::bind_method("_add_bind",&ConnectDialog::_add_bind);
+ ClassDB::bind_method("_remove_bind",&ConnectDialog::_remove_bind);
ADD_SIGNAL( MethodInfo("connected") );
}
@@ -297,7 +305,7 @@ ConnectDialog::ConnectDialog() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+
HBoxContainer *main_hb = memnew( HBoxContainer );
vbc->add_child(main_hb);
@@ -335,8 +343,8 @@ ConnectDialog::ConnectDialog() {
type_list->add_item("Vector3",Variant::VECTOR3);
type_list->add_item("Plane",Variant::PLANE);
type_list->add_item("Quat",Variant::QUAT);
- type_list->add_item("AABB",Variant::_AABB);
- type_list->add_item("Matrix3",Variant::MATRIX3);
+ type_list->add_item("Rect3",Variant::RECT3);
+ type_list->add_item("Basis",Variant::BASIS);
type_list->add_item("Transform",Variant::TRANSFORM);
//type_list->add_separator();
type_list->add_item("Color",Variant::COLOR);
@@ -387,7 +395,7 @@ ConnectDialog::ConnectDialog() {
make_callback = memnew( CheckButton );
make_callback->set_toggle_mode(true);
- make_callback->set_pressed( EDITOR_DEF("text_editor/create_signal_callbacks",true));
+ make_callback->set_pressed( EDITOR_DEF("text_editor/tools/create_signal_callbacks",true));
make_callback->set_text(TTR("Make Function"));
dstm_hb->add_child(make_callback);
@@ -413,7 +421,7 @@ ConnectDialog::ConnectDialog() {
-// dst_method_list->get_popup()->connect("item_pressed", this,"_dst_method_list_selected");
+ //dst_method_list->get_popup()->connect("id_pressed", this,"_dst_method_list_selected");
tree->connect("node_selected", this,"_tree_node_selected");
set_as_toplevel(true);
@@ -424,7 +432,7 @@ ConnectDialog::ConnectDialog() {
add_child(error);
error->get_ok()->set_text(TTR("Close"));
get_ok()->set_text(TTR("Connect"));
-// error->get_cancel()->set_text("Close");
+ //error->get_cancel()->set_text("Close");
@@ -467,7 +475,7 @@ void ConnectionsDock::_connect() {
bool defer=connect_dialog->get_deferred();
bool oshot=connect_dialog->get_oneshot();
Vector<Variant> binds = connect_dialog->get_binds();
- StringArray args = it->get_metadata(0).operator Dictionary()["args"];
+ PoolStringArray args = it->get_metadata(0).operator Dictionary()["args"];
int flags = CONNECT_PERSIST | (defer?CONNECT_DEFERRED:0) | (oshot?CONNECT_ONESHOT:0);
undo_redo->create_action(vformat(TTR("Connect '%s' to '%s'"),signal,String(dst_method)));
@@ -608,7 +616,7 @@ void ConnectionsDock::update_tree() {
//node_signals.sort_custom<_ConnectionsDockMethodInfoSort>();
bool did_script=false;
- StringName base = node->get_type();
+ StringName base = node->get_class();
while(base) {
@@ -624,16 +632,16 @@ void ConnectionsDock::update_tree() {
if (scr->get_path().is_resource_file())
name=scr->get_path().get_file();
else
- name=scr->get_type();
+ name=scr->get_class();
- if (has_icon(scr->get_type(),"EditorIcons")) {
- icon=get_icon(scr->get_type(),"EditorIcons");
+ if (has_icon(scr->get_class(),"EditorIcons")) {
+ icon=get_icon(scr->get_class(),"EditorIcons");
}
}
} else {
- ObjectTypeDB::get_signal_list(base,&node_signals,true);
+ ClassDB::get_signal_list(base,&node_signals,true);
if (has_icon(base,"EditorIcons")) {
icon=get_icon(base,"EditorIcons");
}
@@ -660,7 +668,7 @@ void ConnectionsDock::update_tree() {
String signaldesc;
signaldesc=mi.name+"(";
- StringArray argnames;
+ PoolStringArray argnames;
if (mi.arguments.size()) {
signaldesc+=" ";
for(int i=0;i<mi.arguments.size();i++) {
@@ -732,7 +740,7 @@ void ConnectionsDock::update_tree() {
if (!did_script) {
did_script=true;
} else {
- base=ObjectTypeDB::type_inherits_from(base);
+ base=ClassDB::get_parent_class(base);
}
}
@@ -817,12 +825,12 @@ void ConnectionsDock::_something_activated() {
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);
+ ClassDB::bind_method("_connect",&ConnectionsDock::_connect);
+ ClassDB::bind_method("_something_selected",&ConnectionsDock::_something_selected);
+ ClassDB::bind_method("_something_activated",&ConnectionsDock::_something_activated);
+ ClassDB::bind_method("_close",&ConnectionsDock::_close);
+ ClassDB::bind_method("_connect_pressed",&ConnectionsDock::_connect_pressed);
+ ClassDB::bind_method("update_tree",&ConnectionsDock::update_tree);
}
@@ -849,7 +857,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) {
hb->add_spacer();
hb->add_child(connect_button);
connect_button->connect("pressed",this,"_connect_pressed");
-// add_child(tree);
+ //add_child(tree);
connect_dialog = memnew( ConnectDialog );
connect_dialog->set_as_toplevel(true);
diff --git a/tools/editor/connections_dialog.h b/tools/editor/connections_dialog.h
index 73f52abc9e..64b292bc34 100644
--- a/tools/editor/connections_dialog.h
+++ b/tools/editor/connections_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -48,7 +48,7 @@ class ConnectDialogBinds;
class ConnectDialog : public ConfirmationDialog {
- OBJ_TYPE( ConnectDialog, ConfirmationDialog );
+ GDCLASS( ConnectDialog, ConfirmationDialog );
ConfirmationDialog *error;
@@ -77,7 +77,7 @@ protected:
public:
- bool get_make_callback() { return !make_callback->is_hidden() && make_callback->is_pressed(); }
+ bool get_make_callback() { return make_callback->is_visible() && make_callback->is_pressed(); }
NodePath get_dst_path() const;
StringName get_dst_method() const;
bool get_deferred() const;
@@ -86,8 +86,8 @@ public:
void set_dst_method(const StringName& p_method);
void set_dst_node(Node* p_node);
-// Button *get_ok() { return ok; }
-// Button *get_cancel() { return cancel; }
+ //Button *get_ok() { return ok; }
+ //Button *get_cancel() { return cancel; }
void edit(Node *p_node);
ConnectDialog();
@@ -97,7 +97,7 @@ public:
class ConnectionsDock : public VBoxContainer {
- OBJ_TYPE( ConnectionsDock , VBoxContainer );
+ GDCLASS( ConnectionsDock , VBoxContainer );
Button *connect_button;
EditorNode *editor;
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp
index 320939cb97..b69234e704 100644
--- a/tools/editor/create_dialog.cpp
+++ b/tools/editor/create_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -141,7 +141,7 @@ void CreateDialog::_sbox_input(const InputEvent& p_ie) {
p_ie.key.scancode == KEY_PAGEUP ||
p_ie.key.scancode == KEY_PAGEDOWN ) ) {
- search_options->call("_input_event",p_ie);
+ search_options->call("_gui_input",p_ie);
search_box->accept_event();
}
@@ -151,10 +151,10 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
if (p_types.has(p_type))
return;
- if (!ObjectTypeDB::is_type(p_type,base_type) || p_type==base_type)
+ if (!ClassDB::is_parent_class(p_type,base_type) || p_type==base_type)
return;
- String inherits=ObjectTypeDB::type_inherits_from(p_type);
+ String inherits=ClassDB::get_parent_class(p_type);
TreeItem *parent=p_root;
@@ -172,7 +172,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
TreeItem *item = search_options->create_item(parent);
item->set_text(0,p_type);
- if (!ObjectTypeDB::can_instance(p_type)) {
+ if (!ClassDB::can_instance(p_type)) {
item->set_custom_color(0, Color(0.5,0.5,0.5) );
item->set_selectable(0,false);
} else {
@@ -183,7 +183,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
}
- if (bool(EditorSettings::get_singleton()->get("scenetree_editor/start_create_dialog_fully_expanded"))) {
+ if (bool(EditorSettings::get_singleton()->get("docks/scene_tree/start_create_dialog_fully_expanded"))) {
item->set_collapsed(false);
} else {
// don't collapse search results
@@ -191,7 +191,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
// don't collapse the root node
collapse &= (item != p_root);
// don't collapse abstract nodes on the first tree level
- collapse &= ((parent != p_root) || (ObjectTypeDB::can_instance(p_type)));
+ collapse &= ((parent != p_root) || (ClassDB::can_instance(p_type)));
item->set_collapsed(collapse);
}
@@ -222,7 +222,7 @@ void CreateDialog::_update_search() {
*/
List<StringName> type_list;
- ObjectTypeDB::get_type_list(&type_list);
+ ClassDB::get_class_list(&type_list);
HashMap<String,TreeItem*> types;
@@ -245,7 +245,7 @@ void CreateDialog::_update_search() {
if (base_type=="Node" && type.begins_with("Editor"))
continue; // do not show editor nodes
- if (!ObjectTypeDB::can_instance(type))
+ if (!ClassDB::can_instance(type))
continue; // cant create what can't be instanced
if (search_box->get_text()=="") {
@@ -254,14 +254,14 @@ void CreateDialog::_update_search() {
bool found=false;
String type=I->get();
- while(type!="" && ObjectTypeDB::is_type(type,base_type) && type!=base_type) {
+ while(type!="" && ClassDB::is_parent_class(type,base_type) && type!=base_type) {
if (search_box->get_text().is_subsequence_ofi(type)) {
found=true;
break;
}
- type=ObjectTypeDB::type_inherits_from(type);
+ type=ClassDB::get_parent_class(type);
}
@@ -269,7 +269,7 @@ void CreateDialog::_update_search() {
add_type(I->get(),types,root,&to_select);
}
- if (EditorNode::get_editor_data().get_custom_types().has(type) && ObjectTypeDB::is_type(type, base_type)) {
+ if (EditorNode::get_editor_data().get_custom_types().has(type) && ClassDB::is_parent_class(type, base_type)) {
//there are custom types based on this... cool.
//print_line("there are custom types");
@@ -369,7 +369,7 @@ void CreateDialog::_notification(int p_what) {
if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
- if (is_visible()) {
+ if (is_visible_in_tree()) {
search_box->call_deferred("grab_focus"); // still not visible
search_box->select_all();
@@ -400,8 +400,11 @@ Object *CreateDialog::instance_selected() {
if (selected) {
- String custom = selected->get_metadata(0);
+ Variant md = selected->get_metadata(0);
+ String custom;
+ if (md.get_type()!=Variant::NIL)
+ custom=md;
if (custom!=String()) {
if (EditorNode::get_editor_data().get_custom_types().has(custom)) {
@@ -412,9 +415,9 @@ Object *CreateDialog::instance_selected() {
Ref<Script> script = EditorNode::get_editor_data().get_custom_types()[custom][i].script;
String name = selected->get_text(0);
- Object *ob = ObjectTypeDB::instance(custom);
+ Object *ob = ClassDB::instance(custom);
ERR_FAIL_COND_V(!ob,NULL);
- if (ob->is_type("Node")) {
+ if (ob->is_class("Node")) {
ob->call("set_name",name);
}
ob->set_script(script.get_ref_ptr());
@@ -427,7 +430,7 @@ Object *CreateDialog::instance_selected() {
}
} else {
- return ObjectTypeDB::instance(selected->get_text(0));
+ return ClassDB::instance(selected->get_text(0));
}
}
@@ -621,20 +624,20 @@ void CreateDialog::drop_data_fw(const Point2& p_point,const Variant& p_data,Cont
void CreateDialog::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_text_changed"),&CreateDialog::_text_changed);
- ObjectTypeDB::bind_method(_MD("_confirmed"),&CreateDialog::_confirmed);
- ObjectTypeDB::bind_method(_MD("_sbox_input"),&CreateDialog::_sbox_input);
- ObjectTypeDB::bind_method(_MD("_item_selected"),&CreateDialog::_item_selected);
- ObjectTypeDB::bind_method(_MD("_favorite_toggled"),&CreateDialog::_favorite_toggled);
- ObjectTypeDB::bind_method(_MD("_history_selected"),&CreateDialog::_history_selected);
- ObjectTypeDB::bind_method(_MD("_favorite_selected"),&CreateDialog::_favorite_selected);
- ObjectTypeDB::bind_method(_MD("_history_activated"),&CreateDialog::_history_activated);
- ObjectTypeDB::bind_method(_MD("_favorite_activated"),&CreateDialog::_favorite_activated);
+ ClassDB::bind_method(_MD("_text_changed"),&CreateDialog::_text_changed);
+ ClassDB::bind_method(_MD("_confirmed"),&CreateDialog::_confirmed);
+ ClassDB::bind_method(_MD("_sbox_input"),&CreateDialog::_sbox_input);
+ ClassDB::bind_method(_MD("_item_selected"),&CreateDialog::_item_selected);
+ ClassDB::bind_method(_MD("_favorite_toggled"),&CreateDialog::_favorite_toggled);
+ ClassDB::bind_method(_MD("_history_selected"),&CreateDialog::_history_selected);
+ ClassDB::bind_method(_MD("_favorite_selected"),&CreateDialog::_favorite_selected);
+ ClassDB::bind_method(_MD("_history_activated"),&CreateDialog::_history_activated);
+ ClassDB::bind_method(_MD("_favorite_activated"),&CreateDialog::_favorite_activated);
- ObjectTypeDB::bind_method("get_drag_data_fw",&CreateDialog::get_drag_data_fw);
- ObjectTypeDB::bind_method("can_drop_data_fw",&CreateDialog::can_drop_data_fw);
- ObjectTypeDB::bind_method("drop_data_fw",&CreateDialog::drop_data_fw);
+ ClassDB::bind_method("get_drag_data_fw",&CreateDialog::get_drag_data_fw);
+ ClassDB::bind_method("can_drop_data_fw",&CreateDialog::can_drop_data_fw);
+ ClassDB::bind_method("drop_data_fw",&CreateDialog::drop_data_fw);
ADD_SIGNAL(MethodInfo("create"));
@@ -646,7 +649,7 @@ CreateDialog::CreateDialog() {
HSplitContainer *hbc = memnew( HSplitContainer );
add_child(hbc);
- set_child_rect(hbc);
+
VBoxContainer *lvbc = memnew( VBoxContainer);
hbc->add_child(lvbc);
@@ -682,7 +685,7 @@ CreateDialog::CreateDialog() {
favorite->connect("pressed",this,"_favorite_toggled");
vbc->add_margin_child(TTR("Search:"),search_hb);
search_box->connect("text_changed",this,"_text_changed");
- search_box->connect("input_event",this,"_sbox_input");
+ search_box->connect("gui_input",this,"_sbox_input");
search_options = memnew( Tree );
vbc->add_margin_child(TTR("Matches:"),search_options,true);
get_ok()->set_text(TTR("Create"));
@@ -691,7 +694,7 @@ CreateDialog::CreateDialog() {
set_hide_on_ok(false);
search_options->connect("item_activated",this,"_confirmed");
search_options->connect("cell_selected",this,"_item_selected");
-// search_options->set_hide_root(true);
+ //search_options->set_hide_root(true);
base_type="Object";
help_bit = memnew( EditorHelpBit );
@@ -740,10 +743,10 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
if (p_types.has(p_type))
return;
- if (!ObjectTypeDB::is_type(p_type,base) || p_type==base)
+ if (!ClassDB::is_type(p_type,base) || p_type==base)
return;
- String inherits=ObjectTypeDB::type_inherits_from(p_type);
+ String inherits=ClassDB::type_inherits_from(p_type);
TreeItem *parent=p_root;
@@ -761,7 +764,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
TreeItem *item = tree->create_item(parent);
item->set_text(0,p_type);
- if (!ObjectTypeDB::can_instance(p_type)) {
+ if (!ClassDB::can_instance(p_type)) {
item->set_custom_color(0, Color(0.5,0.5,0.5) );
item->set_selectable(0,false);
}
@@ -782,7 +785,7 @@ void CreateDialog::update_tree() {
tree->clear();
List<String> type_list;
- ObjectTypeDB::get_type_list(&type_list);
+ ClassDB::get_type_list(&type_list);
HashMap<String,TreeItem*> types;
@@ -798,7 +801,7 @@ void CreateDialog::update_tree() {
String type=I->get();
- if (!ObjectTypeDB::can_instance(type))
+ if (!ClassDB::can_instance(type))
continue; // cant create what can't be instanced
if (filter->get_text()=="")
add_type(type,types,root);
@@ -806,14 +809,14 @@ void CreateDialog::update_tree() {
bool found=false;
String type=I->get();
- while(type!="" && ObjectTypeDB::is_type(type,base) && type!=base) {
+ while(type!="" && ClassDB::is_type(type,base) && type!=base) {
if (type.findn(filter->get_text())!=-1) {
found=true;
break;
}
- type=ObjectTypeDB::type_inherits_from(type);
+ type=ClassDB::type_inherits_from(type);
}
@@ -875,7 +878,7 @@ Object *CreateDialog::instance_selected() {
if (ct[i].name==name) {
- Object* obj = ObjectTypeDB::instance(base);
+ Object* obj = ClassDB::instance(base);
ERR_FAIL_COND_V(!obj,NULL);
obj->set_script(ct[i].script.get_ref_ptr());
if (ct[i].icon.is_valid())
@@ -891,16 +894,16 @@ Object *CreateDialog::instance_selected() {
}
- return ObjectTypeDB::instance(tree->get_selected()->get_text(0));
+ return ClassDB::instance(tree->get_selected()->get_text(0));
}
void CreateDialog::_bind_methods() {
- ObjectTypeDB::bind_method("_create",&CreateDialog::_create);
- ObjectTypeDB::bind_method("_cancel",&CreateDialog::_cancel);
- ObjectTypeDB::bind_method("_text_changed", &CreateDialog::_text_changed);
+ ClassDB::bind_method("_create",&CreateDialog::_create);
+ ClassDB::bind_method("_cancel",&CreateDialog::_cancel);
+ ClassDB::bind_method("_text_changed", &CreateDialog::_text_changed);
ADD_SIGNAL( MethodInfo("create"));
}
@@ -929,7 +932,7 @@ CreateDialog::CreateDialog() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+
get_ok()->set_text("Create");
diff --git a/tools/editor/create_dialog.h b/tools/editor/create_dialog.h
index 706a06ae16..5ecb4db2c3 100644
--- a/tools/editor/create_dialog.h
+++ b/tools/editor/create_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -45,7 +45,7 @@
class CreateDialog : public ConfirmationDialog {
- OBJ_TYPE(CreateDialog,ConfirmationDialog )
+ GDCLASS(CreateDialog,ConfirmationDialog )
Vector<String> favorite_list;
@@ -108,7 +108,7 @@ public:
class CreateDialog : public ConfirmationDialog {
- OBJ_TYPE( CreateDialog, ConfirmationDialog );
+ GDCLASS( CreateDialog, ConfirmationDialog );
Tree *tree;
Button *create;
diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp
index 049bcefc75..20e185104b 100644
--- a/tools/editor/dependency_editor.cpp
+++ b/tools/editor/dependency_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -250,9 +250,9 @@ void DependencyEditor::edit(const String& p_path) {
void DependencyEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_searched"),&DependencyEditor::_searched);
- ObjectTypeDB::bind_method(_MD("_load_pressed"),&DependencyEditor::_load_pressed);
- ObjectTypeDB::bind_method(_MD("_fix_all"),&DependencyEditor::_fix_all);
+ ClassDB::bind_method(_MD("_searched"),&DependencyEditor::_searched);
+ ClassDB::bind_method(_MD("_load_pressed"),&DependencyEditor::_load_pressed);
+ ClassDB::bind_method(_MD("_fix_all"),&DependencyEditor::_fix_all);
}
@@ -261,7 +261,7 @@ DependencyEditor::DependencyEditor() {
VBoxContainer *vb = memnew( VBoxContainer );
vb->set_name(TTR("Dependencies"));
add_child(vb);
- set_child_rect(vb);
+
tree = memnew( Tree );
tree->set_columns(2);
@@ -354,7 +354,7 @@ DependencyEditorOwners::DependencyEditorOwners() {
owners = memnew( ItemList );
add_child(owners);
- set_child_rect(owners);
+
}
@@ -459,7 +459,7 @@ DependencyRemoveDialog::DependencyRemoveDialog() {
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
- set_child_rect(vb);
+
text = memnew( Label );
vb->add_child(text);
@@ -522,7 +522,7 @@ DependencyErrorDialog::DependencyErrorDialog() {
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
- set_child_rect(vb);
+
files = memnew( Tree );
@@ -690,8 +690,8 @@ void OrphanResourcesDialog::_button_pressed(Object *p_item,int p_column, int p_i
void OrphanResourcesDialog::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_delete_confirm"),&OrphanResourcesDialog::_delete_confirm);
- ObjectTypeDB::bind_method(_MD("_button_pressed"),&OrphanResourcesDialog::_button_pressed);
+ ClassDB::bind_method(_MD("_delete_confirm"),&OrphanResourcesDialog::_delete_confirm);
+ ClassDB::bind_method(_MD("_button_pressed"),&OrphanResourcesDialog::_button_pressed);
}
@@ -699,7 +699,7 @@ 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);
diff --git a/tools/editor/dependency_editor.h b/tools/editor/dependency_editor.h
index 60758f8f4e..a96ffe5fcf 100644
--- a/tools/editor/dependency_editor.h
+++ b/tools/editor/dependency_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,7 +37,7 @@
class EditorFileSystemDirectory;
class DependencyEditor : public AcceptDialog {
- OBJ_TYPE(DependencyEditor,AcceptDialog);
+ GDCLASS(DependencyEditor,AcceptDialog);
Tree *tree;
@@ -71,7 +71,7 @@ public:
};
class DependencyEditorOwners : public AcceptDialog {
- OBJ_TYPE(DependencyEditorOwners,AcceptDialog);
+ GDCLASS(DependencyEditorOwners,AcceptDialog);
ItemList *owners;
String editing;
@@ -84,7 +84,7 @@ public:
};
class DependencyRemoveDialog : public ConfirmationDialog {
- OBJ_TYPE(DependencyRemoveDialog,ConfirmationDialog);
+ GDCLASS(DependencyRemoveDialog,ConfirmationDialog);
Label *text;
@@ -103,7 +103,7 @@ public:
class DependencyErrorDialog : public ConfirmationDialog {
- OBJ_TYPE(DependencyErrorDialog,ConfirmationDialog);
+ GDCLASS(DependencyErrorDialog,ConfirmationDialog);
String for_file;
@@ -122,7 +122,7 @@ public:
class OrphanResourcesDialog : public ConfirmationDialog {
- OBJ_TYPE(OrphanResourcesDialog,ConfirmationDialog);
+ GDCLASS(OrphanResourcesDialog,ConfirmationDialog);
DependencyEditor *dep_edit;
Tree *files;
diff --git a/tools/editor/doc_code_font.h b/tools/editor/doc_code_font.h
index 879c873ea1..55f335ab78 100644
--- a/tools/editor/doc_code_font.h
+++ b/tools/editor/doc_code_font.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/doc_font.h b/tools/editor/doc_font.h
index a3c3b58b21..b598ee26f8 100644
--- a/tools/editor/doc_font.h
+++ b/tools/editor/doc_font.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/doc_title_font.h b/tools/editor/doc_title_font.h
index 75a3f049f0..afa0f61eda 100644
--- a/tools/editor/doc_title_font.h
+++ b/tools/editor/doc_title_font.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/editor_asset_installer.cpp b/tools/editor/editor_asset_installer.cpp
index b6051886c0..9992100ff8 100644
--- a/tools/editor/editor_asset_installer.cpp
+++ b/tools/editor/editor_asset_installer.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -196,7 +196,7 @@ void EditorAssetInstaller::open(const String& p_path,int p_depth) {
ti->set_icon(0,get_icon("folder","FileDialog"));
} else {
String file = path.get_file();
- String extension = file.extension().to_lower();
+ String extension = file.get_extension().to_lower();
if (extension_guess.has(extension)) {
ti->set_icon(0,extension_guess[extension]);
} else {
@@ -331,7 +331,7 @@ void EditorAssetInstaller::ok_pressed() {
void EditorAssetInstaller::_bind_methods() {
- ObjectTypeDB::bind_method("_item_edited",&EditorAssetInstaller::_item_edited);
+ ClassDB::bind_method("_item_edited",&EditorAssetInstaller::_item_edited);
}
@@ -339,7 +339,7 @@ EditorAssetInstaller::EditorAssetInstaller() {
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
- set_child_rect(vb);
+
tree = memnew( Tree );
vb->add_margin_child("Package Contents:",tree,true);
diff --git a/tools/editor/editor_asset_installer.h b/tools/editor/editor_asset_installer.h
index d6e71dbb3c..2d0486a6f6 100644
--- a/tools/editor/editor_asset_installer.h
+++ b/tools/editor/editor_asset_installer.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -34,7 +34,7 @@
#include "scene/gui/tree.h"
class EditorAssetInstaller : public ConfirmationDialog {
- OBJ_TYPE( EditorAssetInstaller, ConfirmationDialog );
+ GDCLASS( EditorAssetInstaller, ConfirmationDialog );
Tree *tree;
String package_path;
diff --git a/tools/editor/editor_autoload_settings.cpp b/tools/editor/editor_autoload_settings.cpp
index 97062b1480..087bf1a3b7 100644
--- a/tools/editor/editor_autoload_settings.cpp
+++ b/tools/editor/editor_autoload_settings.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -62,7 +62,7 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String& p_name, Strin
return false;
}
- if (ObjectTypeDB::type_exists(p_name)) {
+ if (ClassDB::class_exists(p_name)) {
if (r_error)
*r_error = TTR("Invalid name. Must not collide with an existing engine class name.");
@@ -116,13 +116,12 @@ void EditorAutoloadSettings::_autoload_add() {
UndoRedo* undo_redo = EditorNode::get_singleton()->get_undo_redo();
undo_redo->create_action(TTR("Add AutoLoad"));
- undo_redo->add_do_property(Globals::get_singleton(), name, "*" + path);
- undo_redo->add_do_method(Globals::get_singleton(), "set_persisting", name, true);
+ undo_redo->add_do_property(GlobalConfig::get_singleton(), name, "*" + path);
- if (Globals::get_singleton()->has(name)) {
- undo_redo->add_undo_property(Globals::get_singleton(), name, Globals::get_singleton()->get(name));
+ if (GlobalConfig::get_singleton()->has(name)) {
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name));
} else {
- undo_redo->add_undo_property(Globals::get_singleton(), name, Variant());
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, Variant());
}
undo_redo->add_do_method(this, "update_autoload");
@@ -171,7 +170,7 @@ void EditorAutoloadSettings::_autoload_edited() {
return;
}
- if (Globals::get_singleton()->has("autoload/" + name)) {
+ if (GlobalConfig::get_singleton()->has("autoload/" + name)) {
ti->set_text(0, old_name);
EditorNode::get_singleton()->show_warning(vformat(TTR("Autoload '%s' already exists!"), name));
return;
@@ -181,21 +180,18 @@ void EditorAutoloadSettings::_autoload_edited() {
name = "autoload/" + name;
- bool persisting = Globals::get_singleton()->get(selected_autoload);
- int order = Globals::get_singleton()->get(selected_autoload);
- String path = Globals::get_singleton()->get(selected_autoload);
+ int order = GlobalConfig::get_singleton()->get_order(selected_autoload);
+ String path = GlobalConfig::get_singleton()->get(selected_autoload);
undo_redo->create_action(TTR("Rename Autoload"));
- undo_redo->add_do_property(Globals::get_singleton(), name, path);
- undo_redo->add_do_method(Globals::get_singleton(), "set_persisting", name, persisting);
- undo_redo->add_do_method(Globals::get_singleton(), "set_order", name, order);
- undo_redo->add_do_method(Globals::get_singleton(), "clear", selected_autoload);
+ undo_redo->add_do_property(GlobalConfig::get_singleton(), name, path);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", name, order);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(), "clear", selected_autoload);
- undo_redo->add_undo_property(Globals::get_singleton(), selected_autoload, path);
- undo_redo->add_undo_method(Globals::get_singleton(), "set_persisting", selected_autoload, persisting);
- undo_redo->add_undo_method(Globals::get_singleton(), "set_order", selected_autoload, order);
- undo_redo->add_undo_method(Globals::get_singleton(), "clear", name);
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(), selected_autoload, path);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", selected_autoload, order);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(), "clear", name);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -212,8 +208,8 @@ void EditorAutoloadSettings::_autoload_edited() {
bool checked = ti->is_checked(2);
String base = "autoload/" + ti->get_text(0);
- int order = Globals::get_singleton()->get_order(base);
- String path = Globals::get_singleton()->get(base);
+ int order = GlobalConfig::get_singleton()->get_order(base);
+ String path = GlobalConfig::get_singleton()->get(base);
if (path.begins_with("*"))
path = path.substr(1, path.length());
@@ -223,11 +219,11 @@ void EditorAutoloadSettings::_autoload_edited() {
undo_redo->create_action(TTR("Toggle AutoLoad Globals"));
- undo_redo->add_do_property(Globals::get_singleton(), base, path);
- undo_redo->add_undo_property(Globals::get_singleton(), base, Globals::get_singleton()->get(base));
+ undo_redo->add_do_property(GlobalConfig::get_singleton(), base, path);
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(), base, GlobalConfig::get_singleton()->get(base));
- undo_redo->add_do_method(Globals::get_singleton(),"set_order", base, order);
- undo_redo->add_undo_method(Globals::get_singleton(),"set_order", base, order);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(),"set_order", base, order);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set_order", base, order);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -267,16 +263,16 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu
String swap_name = "autoload/" + swap->get_text(0);
- int order = Globals::get_singleton()->get_order(name);
- int swap_order = Globals::get_singleton()->get_order(swap_name);
+ int order = GlobalConfig::get_singleton()->get_order(name);
+ int swap_order = GlobalConfig::get_singleton()->get_order(swap_name);
undo_redo->create_action(TTR("Move Autoload"));
- undo_redo->add_do_method(Globals::get_singleton(), "set_order", name, swap_order);
- undo_redo->add_undo_method(Globals::get_singleton(), "set_order", name, order);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", name, swap_order);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", name, order);
- undo_redo->add_do_method(Globals::get_singleton(), "set_order", swap_name, order);
- undo_redo->add_undo_method(Globals::get_singleton(), "set_order", swap_name, swap_order);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", swap_name, order);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", swap_name, swap_order);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -288,15 +284,15 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu
} break;
case BUTTON_DELETE: {
- int order = Globals::get_singleton()->get_order(name);
+ int order = GlobalConfig::get_singleton()->get_order(name);
undo_redo->create_action(TTR("Remove Autoload"));
- undo_redo->add_do_property(Globals::get_singleton(), name, Variant());
+ undo_redo->add_do_property(GlobalConfig::get_singleton(), name, Variant());
- undo_redo->add_undo_property(Globals::get_singleton(), name, Globals::get_singleton()->get(name));
- undo_redo->add_undo_method(Globals::get_singleton(), "set_persisting", name, true);
- undo_redo->add_undo_method(Globals::get_singleton(), "set_order", order);
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name));
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_persisting", name, true);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", order);
undo_redo->add_do_method(this, "update_autoload");
undo_redo->add_undo_method(this, "update_autoload");
@@ -311,7 +307,7 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu
void EditorAutoloadSettings::_autoload_file_callback(const String& p_path) {
- autoload_add_name->set_text(p_path.get_file().basename());
+ autoload_add_name->set_text(p_path.get_file().get_basename());
}
void EditorAutoloadSettings::update_autoload() {
@@ -327,7 +323,7 @@ void EditorAutoloadSettings::update_autoload() {
TreeItem *root = tree->create_item();
List<PropertyInfo> props;
- Globals::get_singleton()->get_property_list(&props);
+ GlobalConfig::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
@@ -337,14 +333,14 @@ void EditorAutoloadSettings::update_autoload() {
continue;
String name = pi.name.get_slice("/", 1);
- String path = Globals::get_singleton()->get(pi.name);
+ String path = GlobalConfig::get_singleton()->get(pi.name);
if (name.empty())
continue;
AutoLoadInfo info;
info.name = pi.name;
- info.order = Globals::get_singleton()->get_order(pi.name);
+ info.order = GlobalConfig::get_singleton()->get_order(pi.name);
autoload_cache.push_back(info);
@@ -381,7 +377,7 @@ Variant EditorAutoloadSettings::get_drag_data_fw(const Point2& p_point, Control
if (autoload_cache.size() <= 1)
return false;
- StringArray autoloads;
+ PoolStringArray autoloads;
TreeItem *next = tree->get_next_selected(NULL);
@@ -399,7 +395,7 @@ Variant EditorAutoloadSettings::get_drag_data_fw(const Point2& p_point, Control
for (int i = 0; i < max_size; i++) {
Label *label = memnew( Label(autoloads[i]) );
- label->set_self_opacity(Math::lerp(1, 0, float(i)/PREVIEW_LIST_MAX_SIZE));
+ label->set_self_modulate(Color(1,1,1,Math::lerp(1, 0, float(i)/PREVIEW_LIST_MAX_SIZE)));
preview->add_child(label);
}
@@ -464,7 +460,7 @@ void EditorAutoloadSettings::drop_data_fw(const Point2& p_point, const Variant&
move_to_back = true;
}
- int order = Globals::get_singleton()->get_order("autoload/" + name);
+ int order = GlobalConfig::get_singleton()->get_order("autoload/" + name);
AutoLoadInfo aux;
List<AutoLoadInfo>::Element *E = NULL;
@@ -475,13 +471,13 @@ void EditorAutoloadSettings::drop_data_fw(const Point2& p_point, const Variant&
}
Dictionary drop_data = p_data;
- StringArray autoloads = drop_data["autoloads"];
+ PoolStringArray autoloads = drop_data["autoloads"];
Vector<int> orders;
orders.resize(autoload_cache.size());
for (int i = 0; i < autoloads.size(); i++) {
- aux.order = Globals::get_singleton()->get_order("autoload/" + autoloads[i]);
+ aux.order = GlobalConfig::get_singleton()->get_order("autoload/" + autoloads[i]);
List<AutoLoadInfo>::Element *I = autoload_cache.find(aux);
@@ -511,8 +507,8 @@ void EditorAutoloadSettings::drop_data_fw(const Point2& p_point, const Variant&
i = 0;
for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) {
- undo_redo->add_do_method(Globals::get_singleton(), "set_order", E->get().name, orders[i++]);
- undo_redo->add_undo_method(Globals::get_singleton(), "set_order", E->get().name, E->get().order);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", E->get().name, orders[i++]);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", E->get().name, E->get().order);
}
orders.clear();
@@ -528,17 +524,17 @@ void EditorAutoloadSettings::drop_data_fw(const Point2& p_point, const Variant&
void EditorAutoloadSettings::_bind_methods() {
- ObjectTypeDB::bind_method("_autoload_add", &EditorAutoloadSettings::_autoload_add);
- ObjectTypeDB::bind_method("_autoload_selected", &EditorAutoloadSettings::_autoload_selected);
- ObjectTypeDB::bind_method("_autoload_edited", &EditorAutoloadSettings::_autoload_edited);
- ObjectTypeDB::bind_method("_autoload_button_pressed", &EditorAutoloadSettings::_autoload_button_pressed);
- ObjectTypeDB::bind_method("_autoload_file_callback", &EditorAutoloadSettings::_autoload_file_callback);
+ ClassDB::bind_method("_autoload_add", &EditorAutoloadSettings::_autoload_add);
+ ClassDB::bind_method("_autoload_selected", &EditorAutoloadSettings::_autoload_selected);
+ ClassDB::bind_method("_autoload_edited", &EditorAutoloadSettings::_autoload_edited);
+ ClassDB::bind_method("_autoload_button_pressed", &EditorAutoloadSettings::_autoload_button_pressed);
+ ClassDB::bind_method("_autoload_file_callback", &EditorAutoloadSettings::_autoload_file_callback);
- ObjectTypeDB::bind_method("get_drag_data_fw", &EditorAutoloadSettings::get_drag_data_fw);
- ObjectTypeDB::bind_method("can_drop_data_fw", &EditorAutoloadSettings::can_drop_data_fw);
- ObjectTypeDB::bind_method("drop_data_fw", &EditorAutoloadSettings::drop_data_fw);
+ ClassDB::bind_method("get_drag_data_fw", &EditorAutoloadSettings::get_drag_data_fw);
+ ClassDB::bind_method("can_drop_data_fw", &EditorAutoloadSettings::can_drop_data_fw);
+ ClassDB::bind_method("drop_data_fw", &EditorAutoloadSettings::drop_data_fw);
- ObjectTypeDB::bind_method("update_autoload", &EditorAutoloadSettings::update_autoload);
+ ClassDB::bind_method("update_autoload", &EditorAutoloadSettings::update_autoload);
ADD_SIGNAL(MethodInfo("autoload_changed"));
}
diff --git a/tools/editor/editor_autoload_settings.h b/tools/editor/editor_autoload_settings.h
index b61c44b9c2..2afe239000 100644
--- a/tools/editor/editor_autoload_settings.h
+++ b/tools/editor/editor_autoload_settings.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -36,7 +36,7 @@
class EditorAutoloadSettings : public VBoxContainer {
- OBJ_TYPE( EditorAutoloadSettings, VBoxContainer );
+ GDCLASS( EditorAutoloadSettings, VBoxContainer );
enum {
BUTTON_MOVE_UP,
diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp
index 8fc18b5b39..08b03ae65f 100644
--- a/tools/editor/editor_data.cpp
+++ b/tools/editor/editor_data.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -524,8 +524,10 @@ void EditorData::remove_scene(int p_idx){
bool EditorData::_find_updated_instances(Node* p_root,Node *p_node,Set<String> &checked_paths) {
-// if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner()))
-// return false;
+ /*
+ if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner()))
+ return false;
+ */
Ref<SceneState> ss;
@@ -584,7 +586,7 @@ bool EditorData::check_and_update_scene(int p_idx) {
Error err = pscene->pack(edited_scene[p_idx].root);
ERR_FAIL_COND_V(err!=OK,false);
ep.step(TTR("Updating scene.."),1);
- Node *new_scene = pscene->instance(true);
+ Node *new_scene = pscene->instance(PackedScene::GEN_EDIT_STATE_MAIN);
ERR_FAIL_COND_V(!new_scene,false);
//transfer selection
@@ -667,7 +669,7 @@ String EditorData::get_scene_type(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,edited_scene.size(),String());
if (!edited_scene[p_idx].root)
return "";
- return edited_scene[p_idx].root->get_type();
+ return edited_scene[p_idx].root->get_class();
}
void EditorData::move_edited_scene_to_index(int p_idx) {
@@ -814,7 +816,7 @@ EditorData::EditorData() {
current_edited_scene=-1;
-// load_imported_scenes_from_globals();
+ //load_imported_scenes_from_globals();
}
///////////
@@ -851,7 +853,7 @@ void EditorSelection::add_node(Node *p_node) {
}
selection[p_node]=meta;
- p_node->connect("exit_tree",this,"_node_removed",varray(p_node),CONNECT_ONESHOT);
+ p_node->connect("tree_exited",this,"_node_removed",varray(p_node),CONNECT_ONESHOT);
//emit_signal("selection_changed");
}
@@ -869,7 +871,7 @@ void EditorSelection::remove_node(Node *p_node) {
if (meta)
memdelete(meta);
selection.erase(p_node);
- p_node->disconnect("exit_tree",this,"_node_removed");
+ p_node->disconnect("tree_exited",this,"_node_removed");
//emit_signal("selection_changed");
}
bool EditorSelection::is_selected(Node * p_node) const {
@@ -903,12 +905,12 @@ Array EditorSelection::_get_selected_nodes() {
void EditorSelection::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_node_removed"),&EditorSelection::_node_removed);
- ObjectTypeDB::bind_method(_MD("clear"),&EditorSelection::clear);
- ObjectTypeDB::bind_method(_MD("add_node","node:Node"),&EditorSelection::add_node);
- ObjectTypeDB::bind_method(_MD("remove_node","node:Node"),&EditorSelection::remove_node);
- ObjectTypeDB::bind_method(_MD("get_selected_nodes"),&EditorSelection::_get_selected_nodes);
- ObjectTypeDB::bind_method(_MD("get_transformable_selected_nodes"),&EditorSelection::_get_transformable_selected_nodes);
+ ClassDB::bind_method(_MD("_node_removed"),&EditorSelection::_node_removed);
+ ClassDB::bind_method(_MD("clear"),&EditorSelection::clear);
+ ClassDB::bind_method(_MD("add_node","node:Node"),&EditorSelection::add_node);
+ ClassDB::bind_method(_MD("remove_node","node:Node"),&EditorSelection::remove_node);
+ ClassDB::bind_method(_MD("get_selected_nodes"),&EditorSelection::_get_selected_nodes);
+ ClassDB::bind_method(_MD("get_transformable_selected_nodes"),&EditorSelection::_get_transformable_selected_nodes);
ADD_SIGNAL( MethodInfo("selection_changed") );
}
diff --git a/tools/editor/editor_data.h b/tools/editor/editor_data.h
index 59f9d4e4f3..f0bc5983a2 100644
--- a/tools/editor/editor_data.h
+++ b/tools/editor/editor_data.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -218,7 +218,7 @@ public:
class EditorSelection : public Object {
- OBJ_TYPE(EditorSelection,Object);
+ GDCLASS(EditorSelection,Object);
public:
Map<Node*,Object*> selection;
diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp
index cf0732501e..e2b7d475b0 100644
--- a/tools/editor/editor_dir_dialog.cpp
+++ b/tools/editor/editor_dir_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -46,7 +46,7 @@ void EditorDirDialog::_update_dir(TreeItem* p_item) {
List<String> dirs;
bool ishidden;
- bool show_hidden = EditorSettings::get_singleton()->get("file_dialog/show_hidden_files");
+ bool show_hidden = EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files");
while(p!="") {
@@ -78,7 +78,7 @@ void EditorDirDialog::_update_dir(TreeItem* p_item) {
void EditorDirDialog::reload() {
- if (!is_visible()) {
+ if (!is_visible_in_tree()) {
must_reload=true;
return;
}
@@ -111,7 +111,7 @@ void EditorDirDialog::_notification(int p_what) {
}
if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
- if (must_reload && is_visible()) {
+ if (must_reload && is_visible_in_tree()) {
reload();
}
}
@@ -145,7 +145,7 @@ void EditorDirDialog::set_current_path(const String& p_path) {
if (p.begins_with("res://"))
p = p.replace_first("res://","");
- Vector<String> dirs = p.split("/");
+ Vector<String> dirs = p.split("/",false);
TreeItem *r=tree->get_root();
for(int i=0;i<dirs.size();i++) {
@@ -224,10 +224,10 @@ void EditorDirDialog::_make_dir_confirm() {
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);
+ ClassDB::bind_method(_MD("_item_collapsed"),&EditorDirDialog::_item_collapsed);
+ ClassDB::bind_method(_MD("_make_dir"),&EditorDirDialog::_make_dir);
+ ClassDB::bind_method(_MD("_make_dir_confirm"),&EditorDirDialog::_make_dir_confirm);
+ ClassDB::bind_method(_MD("reload"),&EditorDirDialog::reload);
ADD_SIGNAL(MethodInfo("dir_selected",PropertyInfo(Variant::STRING,"dir")));
}
@@ -243,7 +243,7 @@ EditorDirDialog::EditorDirDialog() {
tree = memnew( Tree );
add_child(tree);
- set_child_rect(tree);
+
tree->connect("item_activated",this,"_ok");
makedir = add_button(TTR("Create Folder"),OS::get_singleton()->get_swap_ok_cancel()?true:false,"makedir");
@@ -255,7 +255,7 @@ EditorDirDialog::EditorDirDialog() {
VBoxContainer *makevb= memnew( VBoxContainer );
makedialog->add_child(makevb);
- makedialog->set_child_rect(makevb);
+ //makedialog->set_child_rect(makevb);
makedirname = memnew( LineEdit );
makevb->add_margin_child(TTR("Name:"),makedirname);
diff --git a/tools/editor/editor_dir_dialog.h b/tools/editor/editor_dir_dialog.h
index 69f9850c30..0577ff0442 100644
--- a/tools/editor/editor_dir_dialog.h
+++ b/tools/editor/editor_dir_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -34,7 +34,7 @@
#include "scene/gui/tree.h"
class EditorDirDialog : public ConfirmationDialog {
- OBJ_TYPE(EditorDirDialog,ConfirmationDialog);
+ GDCLASS(EditorDirDialog,ConfirmationDialog);
ConfirmationDialog *makedialog;
diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp
index b8abd1d32c..d4ca515493 100644
--- a/tools/editor/editor_file_dialog.cpp
+++ b/tools/editor/editor_file_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -87,10 +87,10 @@ void EditorFileDialog::_notification(int p_what) {
} else if (p_what==EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
- bool show_hidden=EditorSettings::get_singleton()->get("file_dialog/show_hidden_files");
+ bool show_hidden=EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files");
if (show_hidden_files!=show_hidden)
set_show_hidden_files(show_hidden);
- set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("file_dialog/display_mode").operator int());
+ set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("filesystem/file_dialog/display_mode").operator int());
}
}
@@ -121,7 +121,7 @@ void EditorFileDialog::_unhandled_input(const InputEvent& p_event) {
if (ED_IS_SHORTCUT("file_dialog/toggle_hidden_files", p_event)) {
bool show=!show_hidden_files;
set_show_hidden_files(show);
- EditorSettings::get_singleton()->set("file_dialog/show_hidden_files",show);
+ EditorSettings::get_singleton()->set("filesystem/file_dialog/show_hidden_files",show);
handled=true;
}
if (ED_IS_SHORTCUT("file_dialog/toggle_favorite", p_event)) {
@@ -218,10 +218,10 @@ void EditorFileDialog::_post_popup() {
else
item_list->grab_focus();
- if (is_visible() && get_current_file()!="")
+ if (is_visible_in_tree() && get_current_file()!="")
_request_single_thumbnail(get_current_dir().plus_file(get_current_file()));
- if (is_visible()) {
+ if (is_visible_in_tree()) {
Ref<Texture> folder = get_icon("folder","FileDialog");
recent->clear();
@@ -313,7 +313,7 @@ void EditorFileDialog::_action_pressed() {
String fbase=dir_access->get_current_dir();
- DVector<String> files;
+ PoolVector<String> files;
for(int i=0;i<item_list->get_item_count();i++) {
if (item_list->is_selected(i))
files.push_back( fbase.plus_file(item_list->get_item_text(i) ));
@@ -336,15 +336,21 @@ void EditorFileDialog::_action_pressed() {
hide();
}else if (mode==MODE_OPEN_ANY || mode==MODE_OPEN_DIR) {
-
String path=dir_access->get_current_dir();
- /*if (tree->get_selected()) {
- Dictionary d = tree->get_selected()->get_metadata(0);
- if (d["dir"]) {
- path=path+"/"+String(d["name"]);
- }
- }*/
+
path=path.replace("\\","/");
+
+ for(int i=0;i<item_list->get_item_count();i++) {
+ if (item_list->is_selected(i)) {
+ Dictionary d=item_list->get_item_metadata(i);
+ if (d["dir"]) {
+ path=path.plus_file(d["name"]);
+
+ break;
+ }
+ }
+ }
+
_save_to_recent();
emit_signal("dir_selected",path);
hide();
@@ -484,7 +490,7 @@ void EditorFileDialog::_item_dc_selected(int p_item) {
void EditorFileDialog::update_file_list() {
- int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
thumbnail_size*=EDSCALE;
Ref<Texture> folder_thumbnail;
Ref<Texture> file_thumbnail;
@@ -571,25 +577,26 @@ void EditorFileDialog::update_file_list() {
files.sort_custom<NoCaseComparator>();
while(!dirs.empty()) {
+ const String& dir_name=dirs.front()->get();
- if (dirs.front()->get()!=".") {
- item_list->add_item(dirs.front()->get()+"/");
- if (display_mode==DISPLAY_THUMBNAILS) {
+ item_list->add_item(dir_name+"/");
- item_list->set_item_icon(item_list->get_item_count()-1,folder_thumbnail);
- } else {
+ if (display_mode==DISPLAY_THUMBNAILS) {
- item_list->set_item_icon(item_list->get_item_count()-1,folder);
- }
+ item_list->set_item_icon(item_list->get_item_count()-1,folder_thumbnail);
+ } else {
- Dictionary d;
- d["name"]=dirs.front()->get();
- d["path"]=String();
- d["dir"]=true;
- item_list->set_item_metadata( item_list->get_item_count() -1, d);
+ item_list->set_item_icon(item_list->get_item_count()-1,folder);
}
- dirs.pop_front();
+ Dictionary d;
+ d["name"]=dir_name;
+ d["path"]=String();
+ d["dir"]=true;
+
+ item_list->set_item_metadata( item_list->get_item_count() -1, d);
+
+ dirs.pop_front();
}
dirs.clear();
@@ -706,8 +713,10 @@ void EditorFileDialog::update_file_list() {
}
// ??
- //if (tree->get_root() && tree->get_root()->get_children())
- // tree->get_root()->get_children()->select(0);
+ /*
+ if (tree->get_root() && tree->get_root()->get_children())
+ tree->get_root()->get_children()->select(0);
+ */
files.clear();
@@ -799,7 +808,7 @@ void EditorFileDialog::set_current_file(const String& p_file) {
file->grab_focus();
}
- if (is_visible())
+ if (is_visible_in_tree())
_request_single_thumbnail(get_current_dir().plus_file(get_current_file()));
@@ -875,7 +884,7 @@ void EditorFileDialog::set_access(Access p_access) {
void EditorFileDialog::invalidate() {
- if (is_visible()) {
+ if (is_visible_in_tree()) {
update_file_list();
invalidated=false;
} else {
@@ -1153,58 +1162,58 @@ EditorFileDialog::DisplayMode EditorFileDialog::get_display_mode() const{
void EditorFileDialog::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_unhandled_input"),&EditorFileDialog::_unhandled_input);
-
- ObjectTypeDB::bind_method(_MD("_item_selected"),&EditorFileDialog::_item_selected);
- ObjectTypeDB::bind_method(_MD("_item_db_selected"),&EditorFileDialog::_item_dc_selected);
- ObjectTypeDB::bind_method(_MD("_dir_entered"),&EditorFileDialog::_dir_entered);
- ObjectTypeDB::bind_method(_MD("_file_entered"),&EditorFileDialog::_file_entered);
- ObjectTypeDB::bind_method(_MD("_action_pressed"),&EditorFileDialog::_action_pressed);
- ObjectTypeDB::bind_method(_MD("_cancel_pressed"),&EditorFileDialog::_cancel_pressed);
- ObjectTypeDB::bind_method(_MD("_filter_selected"),&EditorFileDialog::_filter_selected);
- ObjectTypeDB::bind_method(_MD("_save_confirm_pressed"),&EditorFileDialog::_save_confirm_pressed);
-
- ObjectTypeDB::bind_method(_MD("clear_filters"),&EditorFileDialog::clear_filters);
- ObjectTypeDB::bind_method(_MD("add_filter","filter"),&EditorFileDialog::add_filter);
- ObjectTypeDB::bind_method(_MD("get_current_dir"),&EditorFileDialog::get_current_dir);
- ObjectTypeDB::bind_method(_MD("get_current_file"),&EditorFileDialog::get_current_file);
- ObjectTypeDB::bind_method(_MD("get_current_path"),&EditorFileDialog::get_current_path);
- ObjectTypeDB::bind_method(_MD("set_current_dir","dir"),&EditorFileDialog::set_current_dir);
- ObjectTypeDB::bind_method(_MD("set_current_file","file"),&EditorFileDialog::set_current_file);
- ObjectTypeDB::bind_method(_MD("set_current_path","path"),&EditorFileDialog::set_current_path);
- ObjectTypeDB::bind_method(_MD("set_mode","mode"),&EditorFileDialog::set_mode);
- ObjectTypeDB::bind_method(_MD("get_mode"),&EditorFileDialog::get_mode);
- ObjectTypeDB::bind_method(_MD("get_vbox:VBoxContainer"),&EditorFileDialog::get_vbox);
- ObjectTypeDB::bind_method(_MD("set_access","access"),&EditorFileDialog::set_access);
- ObjectTypeDB::bind_method(_MD("get_access"),&EditorFileDialog::get_access);
- ObjectTypeDB::bind_method(_MD("set_show_hidden_files","show"),&EditorFileDialog::set_show_hidden_files);
- ObjectTypeDB::bind_method(_MD("is_showing_hidden_files"),&EditorFileDialog::is_showing_hidden_files);
- ObjectTypeDB::bind_method(_MD("_select_drive"),&EditorFileDialog::_select_drive);
- ObjectTypeDB::bind_method(_MD("_make_dir"),&EditorFileDialog::_make_dir);
- ObjectTypeDB::bind_method(_MD("_make_dir_confirm"),&EditorFileDialog::_make_dir_confirm);
- ObjectTypeDB::bind_method(_MD("_update_file_list"),&EditorFileDialog::update_file_list);
- ObjectTypeDB::bind_method(_MD("_update_dir"),&EditorFileDialog::update_dir);
- ObjectTypeDB::bind_method(_MD("_thumbnail_done"),&EditorFileDialog::_thumbnail_done);
- ObjectTypeDB::bind_method(_MD("set_display_mode","mode"),&EditorFileDialog::set_display_mode);
- ObjectTypeDB::bind_method(_MD("get_display_mode"),&EditorFileDialog::get_display_mode);
- ObjectTypeDB::bind_method(_MD("_thumbnail_result"),&EditorFileDialog::_thumbnail_result);
- ObjectTypeDB::bind_method(_MD("set_disable_overwrite_warning","disable"),&EditorFileDialog::set_disable_overwrite_warning);
- ObjectTypeDB::bind_method(_MD("is_overwrite_warning_disabled"),&EditorFileDialog::is_overwrite_warning_disabled);
-
- ObjectTypeDB::bind_method(_MD("_recent_selected"),&EditorFileDialog::_recent_selected);
- ObjectTypeDB::bind_method(_MD("_go_back"),&EditorFileDialog::_go_back);
- ObjectTypeDB::bind_method(_MD("_go_forward"),&EditorFileDialog::_go_forward);
- ObjectTypeDB::bind_method(_MD("_go_up"),&EditorFileDialog::_go_up);
-
- ObjectTypeDB::bind_method(_MD("_favorite_toggled"),&EditorFileDialog::_favorite_toggled);
- ObjectTypeDB::bind_method(_MD("_favorite_selected"),&EditorFileDialog::_favorite_selected);
- ObjectTypeDB::bind_method(_MD("_favorite_move_up"),&EditorFileDialog::_favorite_move_up);
- ObjectTypeDB::bind_method(_MD("_favorite_move_down"),&EditorFileDialog::_favorite_move_down);
-
- ObjectTypeDB::bind_method(_MD("invalidate"),&EditorFileDialog::invalidate);
+ ClassDB::bind_method(_MD("_unhandled_input"),&EditorFileDialog::_unhandled_input);
+
+ ClassDB::bind_method(_MD("_item_selected"),&EditorFileDialog::_item_selected);
+ ClassDB::bind_method(_MD("_item_db_selected"),&EditorFileDialog::_item_dc_selected);
+ ClassDB::bind_method(_MD("_dir_entered"),&EditorFileDialog::_dir_entered);
+ ClassDB::bind_method(_MD("_file_entered"),&EditorFileDialog::_file_entered);
+ ClassDB::bind_method(_MD("_action_pressed"),&EditorFileDialog::_action_pressed);
+ ClassDB::bind_method(_MD("_cancel_pressed"),&EditorFileDialog::_cancel_pressed);
+ ClassDB::bind_method(_MD("_filter_selected"),&EditorFileDialog::_filter_selected);
+ ClassDB::bind_method(_MD("_save_confirm_pressed"),&EditorFileDialog::_save_confirm_pressed);
+
+ ClassDB::bind_method(_MD("clear_filters"),&EditorFileDialog::clear_filters);
+ ClassDB::bind_method(_MD("add_filter","filter"),&EditorFileDialog::add_filter);
+ ClassDB::bind_method(_MD("get_current_dir"),&EditorFileDialog::get_current_dir);
+ ClassDB::bind_method(_MD("get_current_file"),&EditorFileDialog::get_current_file);
+ ClassDB::bind_method(_MD("get_current_path"),&EditorFileDialog::get_current_path);
+ ClassDB::bind_method(_MD("set_current_dir","dir"),&EditorFileDialog::set_current_dir);
+ ClassDB::bind_method(_MD("set_current_file","file"),&EditorFileDialog::set_current_file);
+ ClassDB::bind_method(_MD("set_current_path","path"),&EditorFileDialog::set_current_path);
+ ClassDB::bind_method(_MD("set_mode","mode"),&EditorFileDialog::set_mode);
+ ClassDB::bind_method(_MD("get_mode"),&EditorFileDialog::get_mode);
+ ClassDB::bind_method(_MD("get_vbox:VBoxContainer"),&EditorFileDialog::get_vbox);
+ ClassDB::bind_method(_MD("set_access","access"),&EditorFileDialog::set_access);
+ ClassDB::bind_method(_MD("get_access"),&EditorFileDialog::get_access);
+ ClassDB::bind_method(_MD("set_show_hidden_files","show"),&EditorFileDialog::set_show_hidden_files);
+ ClassDB::bind_method(_MD("is_showing_hidden_files"),&EditorFileDialog::is_showing_hidden_files);
+ ClassDB::bind_method(_MD("_select_drive"),&EditorFileDialog::_select_drive);
+ ClassDB::bind_method(_MD("_make_dir"),&EditorFileDialog::_make_dir);
+ ClassDB::bind_method(_MD("_make_dir_confirm"),&EditorFileDialog::_make_dir_confirm);
+ ClassDB::bind_method(_MD("_update_file_list"),&EditorFileDialog::update_file_list);
+ ClassDB::bind_method(_MD("_update_dir"),&EditorFileDialog::update_dir);
+ ClassDB::bind_method(_MD("_thumbnail_done"),&EditorFileDialog::_thumbnail_done);
+ ClassDB::bind_method(_MD("set_display_mode","mode"),&EditorFileDialog::set_display_mode);
+ ClassDB::bind_method(_MD("get_display_mode"),&EditorFileDialog::get_display_mode);
+ ClassDB::bind_method(_MD("_thumbnail_result"),&EditorFileDialog::_thumbnail_result);
+ ClassDB::bind_method(_MD("set_disable_overwrite_warning","disable"),&EditorFileDialog::set_disable_overwrite_warning);
+ ClassDB::bind_method(_MD("is_overwrite_warning_disabled"),&EditorFileDialog::is_overwrite_warning_disabled);
+
+ ClassDB::bind_method(_MD("_recent_selected"),&EditorFileDialog::_recent_selected);
+ ClassDB::bind_method(_MD("_go_back"),&EditorFileDialog::_go_back);
+ ClassDB::bind_method(_MD("_go_forward"),&EditorFileDialog::_go_forward);
+ ClassDB::bind_method(_MD("_go_up"),&EditorFileDialog::_go_up);
+
+ ClassDB::bind_method(_MD("_favorite_toggled"),&EditorFileDialog::_favorite_toggled);
+ ClassDB::bind_method(_MD("_favorite_selected"),&EditorFileDialog::_favorite_selected);
+ ClassDB::bind_method(_MD("_favorite_move_up"),&EditorFileDialog::_favorite_move_up);
+ ClassDB::bind_method(_MD("_favorite_move_down"),&EditorFileDialog::_favorite_move_down);
+
+ ClassDB::bind_method(_MD("invalidate"),&EditorFileDialog::invalidate);
ADD_SIGNAL(MethodInfo("file_selected",PropertyInfo( Variant::STRING,"path")));
- ADD_SIGNAL(MethodInfo("files_selected",PropertyInfo( Variant::STRING_ARRAY,"paths")));
+ ADD_SIGNAL(MethodInfo("files_selected",PropertyInfo( Variant::POOL_STRING_ARRAY,"paths")));
ADD_SIGNAL(MethodInfo("dir_selected",PropertyInfo( Variant::STRING,"dir")));
BIND_CONSTANT( MODE_OPEN_FILE );
@@ -1282,7 +1291,6 @@ EditorFileDialog::EditorFileDialog() {
disable_overwrite_warning=false;
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
mode=MODE_SAVE_FILE;
set_title(TTR("Save a File"));
@@ -1399,7 +1407,7 @@ EditorFileDialog::EditorFileDialog() {
filter_hb->add_child(preview_vb);
CenterContainer *prev_cc = memnew( CenterContainer );
preview_vb->add_margin_child(TTR("Preview:"),prev_cc);
- preview = memnew( TextureFrame );
+ preview = memnew( TextureRect );
prev_cc->add_child(preview);
preview_vb->hide();
@@ -1439,7 +1447,7 @@ EditorFileDialog::EditorFileDialog() {
makedialog->set_title(TTR("Create Folder"));
VBoxContainer *makevb= memnew( VBoxContainer );
makedialog->add_child(makevb);
- makedialog->set_child_rect(makevb);
+
makedirname = memnew( LineEdit );
makevb->add_margin_child(TTR("Name:"),makedirname);
add_child(makedialog);
@@ -1483,11 +1491,11 @@ EditorFileDialog::~EditorFileDialog() {
void EditorLineEditFileChooser::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_browse"),&EditorLineEditFileChooser::_browse);
- ObjectTypeDB::bind_method(_MD("_chosen"),&EditorLineEditFileChooser::_chosen);
- ObjectTypeDB::bind_method(_MD("get_button:Button"),&EditorLineEditFileChooser::get_button);
- ObjectTypeDB::bind_method(_MD("get_line_edit:LineEdit"),&EditorLineEditFileChooser::get_line_edit);
- ObjectTypeDB::bind_method(_MD("get_file_dialog:EditorFileDialog"),&EditorLineEditFileChooser::get_file_dialog);
+ ClassDB::bind_method(_MD("_browse"),&EditorLineEditFileChooser::_browse);
+ ClassDB::bind_method(_MD("_chosen"),&EditorLineEditFileChooser::_chosen);
+ ClassDB::bind_method(_MD("get_button:Button"),&EditorLineEditFileChooser::get_button);
+ ClassDB::bind_method(_MD("get_line_edit:LineEdit"),&EditorLineEditFileChooser::get_line_edit);
+ ClassDB::bind_method(_MD("get_file_dialog:EditorFileDialog"),&EditorLineEditFileChooser::get_file_dialog);
}
diff --git a/tools/editor/editor_file_dialog.h b/tools/editor/editor_file_dialog.h
index 14683856c0..193cbc513c 100644
--- a/tools/editor/editor_file_dialog.h
+++ b/tools/editor/editor_file_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -35,14 +35,14 @@
#include "scene/gui/option_button.h"
#include "os/dir_access.h"
#include "scene/gui/box_container.h"
-#include "scene/gui/texture_frame.h"
+#include "scene/gui/texture_rect.h"
#include "scene/gui/tool_button.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
class EditorFileDialog : public ConfirmationDialog {
- OBJ_TYPE( EditorFileDialog, ConfirmationDialog );
+ GDCLASS( EditorFileDialog, ConfirmationDialog );
public:
@@ -93,7 +93,7 @@ private:
OptionButton *drives;
ItemList *item_list;
- TextureFrame *preview;
+ TextureRect *preview;
VBoxContainer *preview_vb;
HBoxContainer *list_hb;
LineEdit *file;
@@ -227,7 +227,7 @@ public:
class EditorLineEditFileChooser : public HBoxContainer {
- OBJ_TYPE( EditorLineEditFileChooser, HBoxContainer );
+ GDCLASS( EditorLineEditFileChooser, HBoxContainer );
Button *button;
LineEdit *line_edit;
EditorFileDialog *dialog;
diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp
index be1af16576..1d32415be9 100644
--- a/tools/editor/editor_file_system.cpp
+++ b/tools/editor/editor_file_system.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -203,18 +203,18 @@ EditorFileSystemDirectory *EditorFileSystemDirectory::get_parent() {
void EditorFileSystemDirectory::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("get_subdir_count"),&EditorFileSystemDirectory::get_subdir_count);
- ObjectTypeDB::bind_method(_MD("get_subdir","idx"),&EditorFileSystemDirectory::get_subdir);
- ObjectTypeDB::bind_method(_MD("get_file_count"),&EditorFileSystemDirectory::get_file_count);
- ObjectTypeDB::bind_method(_MD("get_file","idx"),&EditorFileSystemDirectory::get_file);
- ObjectTypeDB::bind_method(_MD("get_file_path","idx"),&EditorFileSystemDirectory::get_file_path);
- ObjectTypeDB::bind_method(_MD("get_file_type","idx"),&EditorFileSystemDirectory::get_file_type);
- ObjectTypeDB::bind_method(_MD("is_missing_sources","idx"),&EditorFileSystemDirectory::is_missing_sources);
- ObjectTypeDB::bind_method(_MD("get_name"),&EditorFileSystemDirectory::get_name);
- ObjectTypeDB::bind_method(_MD("get_path"),&EditorFileSystemDirectory::get_path);
- ObjectTypeDB::bind_method(_MD("get_parent:EditorFileSystemDirectory"),&EditorFileSystemDirectory::get_parent);
- ObjectTypeDB::bind_method(_MD("find_file_index","name"),&EditorFileSystemDirectory::find_file_index);
- ObjectTypeDB::bind_method(_MD("find_dir_index","name"),&EditorFileSystemDirectory::find_dir_index);
+ ClassDB::bind_method(_MD("get_subdir_count"),&EditorFileSystemDirectory::get_subdir_count);
+ ClassDB::bind_method(_MD("get_subdir","idx"),&EditorFileSystemDirectory::get_subdir);
+ ClassDB::bind_method(_MD("get_file_count"),&EditorFileSystemDirectory::get_file_count);
+ ClassDB::bind_method(_MD("get_file","idx"),&EditorFileSystemDirectory::get_file);
+ ClassDB::bind_method(_MD("get_file_path","idx"),&EditorFileSystemDirectory::get_file_path);
+ ClassDB::bind_method(_MD("get_file_type","idx"),&EditorFileSystemDirectory::get_file_type);
+ ClassDB::bind_method(_MD("is_missing_sources","idx"),&EditorFileSystemDirectory::is_missing_sources);
+ ClassDB::bind_method(_MD("get_name"),&EditorFileSystemDirectory::get_name);
+ ClassDB::bind_method(_MD("get_path"),&EditorFileSystemDirectory::get_path);
+ ClassDB::bind_method(_MD("get_parent:EditorFileSystemDirectory"),&EditorFileSystemDirectory::get_parent);
+ ClassDB::bind_method(_MD("find_file_index","name"),&EditorFileSystemDirectory::find_file_index);
+ ClassDB::bind_method(_MD("find_dir_index","name"),&EditorFileSystemDirectory::find_dir_index);
}
@@ -286,7 +286,7 @@ void EditorFileSystem::_scan_filesystem() {
sources_changed.clear();
file_cache.clear();
- String project=Globals::get_singleton()->get_resource_path();
+ String project=GlobalConfig::get_singleton()->get_resource_path();
String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("filesystem_cache");
FileAccess *f =FileAccess::open(fscache,FileAccess::READ);
@@ -378,7 +378,7 @@ void EditorFileSystem::_scan_filesystem() {
//save back the findings
-// String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("file_cache");
+ //String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("file_cache");
f=FileAccess::open(fscache,FileAccess::WRITE);
_save_filesystem_cache(new_filesystem,f);
@@ -488,7 +488,7 @@ bool EditorFileSystem::_update_scan_actions() {
void EditorFileSystem::scan() {
- if (bool(Globals::get_singleton()->get("debug/disable_scan")))
+ if (false /*&& bool(Globals::get_singleton()->get("debug/disable_scan"))*/)
return;
if (scanning || scanning_sources|| thread)
@@ -502,7 +502,7 @@ void EditorFileSystem::scan() {
_scan_filesystem();
if (filesystem)
memdelete(filesystem);
-// file_type_cache.clear();
+ //file_type_cache.clear();
filesystem=new_filesystem;
new_filesystem=NULL;
_update_scan_actions();
@@ -670,7 +670,7 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess
for (List<String>::Element*E=files.front();E;E=E->next(),idx++) {
- String ext = E->get().extension().to_lower();
+ String ext = E->get().get_extension().to_lower();
if (!valid_extensions.has(ext))
continue; //invalid
@@ -789,7 +789,7 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const S
} else {
- String ext = f.extension().to_lower();
+ String ext = f.get_extension().to_lower();
if (!valid_extensions.has(ext))
continue; //invalid
@@ -1088,7 +1088,7 @@ bool EditorFileSystem::_find_file(const String& p_file,EditorFileSystemDirectory
return false;
- String f = Globals::get_singleton()->localize_path(p_file);
+ String f = GlobalConfig::get_singleton()->localize_path(p_file);
if (!f.begins_with("res://"))
return false;
@@ -1198,13 +1198,13 @@ EditorFileSystemDirectory* EditorFileSystem::find_file(const String& p_file,int*
}
-EditorFileSystemDirectory *EditorFileSystem::get_path(const String& p_path) {
+EditorFileSystemDirectory *EditorFileSystem::get_filesystem_path(const String& p_path) {
if (!filesystem || scanning)
return NULL;
- String f = Globals::get_singleton()->localize_path(p_path);
+ String f = GlobalConfig::get_singleton()->localize_path(p_path);
if (!f.begins_with("res://"))
return NULL;
@@ -1346,14 +1346,14 @@ void EditorFileSystem::update_file(const String& p_file) {
void EditorFileSystem::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("get_filesystem:EditorFileSystemDirectory"),&EditorFileSystem::get_filesystem);
- ObjectTypeDB::bind_method(_MD("is_scanning"),&EditorFileSystem::is_scanning);
- ObjectTypeDB::bind_method(_MD("get_scanning_progress"),&EditorFileSystem::get_scanning_progress);
- ObjectTypeDB::bind_method(_MD("scan"),&EditorFileSystem::scan);
- ObjectTypeDB::bind_method(_MD("scan_sources"),&EditorFileSystem::scan_sources);
- ObjectTypeDB::bind_method(_MD("update_file","path"),&EditorFileSystem::update_file);
- ObjectTypeDB::bind_method(_MD("get_path:EditorFileSystemDirectory","path"),&EditorFileSystem::get_path);
- ObjectTypeDB::bind_method(_MD("get_file_type","path"),&EditorFileSystem::get_file_type);
+ ClassDB::bind_method(_MD("get_filesystem:EditorFileSystemDirectory"),&EditorFileSystem::get_filesystem);
+ ClassDB::bind_method(_MD("is_scanning"),&EditorFileSystem::is_scanning);
+ ClassDB::bind_method(_MD("get_scanning_progress"),&EditorFileSystem::get_scanning_progress);
+ ClassDB::bind_method(_MD("scan"),&EditorFileSystem::scan);
+ ClassDB::bind_method(_MD("scan_sources"),&EditorFileSystem::scan_sources);
+ ClassDB::bind_method(_MD("update_file","path"),&EditorFileSystem::update_file);
+ ClassDB::bind_method(_MD("get_filesystem_path:EditorFileSystemDirectory","path"),&EditorFileSystem::get_filesystem_path);
+ ClassDB::bind_method(_MD("get_file_type","path"),&EditorFileSystem::get_file_type);
ADD_SIGNAL( MethodInfo("filesystem_changed") );
ADD_SIGNAL( MethodInfo("sources_changed",PropertyInfo(Variant::BOOL,"exist")) );
diff --git a/tools/editor/editor_file_system.h b/tools/editor/editor_file_system.h
index fb768fb358..3a26f46aa9 100644
--- a/tools/editor/editor_file_system.h
+++ b/tools/editor/editor_file_system.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -39,7 +39,7 @@ class FileAccess;
struct EditorProgressBG;
class EditorFileSystemDirectory : public Object {
- OBJ_TYPE( EditorFileSystemDirectory,Object );
+ GDCLASS( EditorFileSystemDirectory,Object );
String name;
uint64_t modified_time;
@@ -122,7 +122,7 @@ public:
class EditorFileSystem : public Node {
- OBJ_TYPE( EditorFileSystem, Node );
+ GDCLASS( EditorFileSystem, Node );
_THREAD_SAFE_CLASS_
@@ -233,7 +233,7 @@ public:
void get_changed_sources(List<String> *r_changed);
void update_file(const String& p_file);
String find_resource_from_source(const String& p_path) const;
- EditorFileSystemDirectory *get_path(const String& p_path);
+ EditorFileSystemDirectory *get_filesystem_path(const String& p_path);
String get_file_type(const String& p_file) const;
EditorFileSystemDirectory* find_file(const String& p_file,int* r_index) const;
diff --git a/tools/editor/editor_fonts.cpp b/tools/editor/editor_fonts.cpp
index bcf41cbac8..3c846fc538 100644
--- a/tools/editor/editor_fonts.cpp
+++ b/tools/editor/editor_fonts.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -122,18 +122,18 @@ void editor_register_fonts(Ref<Theme> p_theme) {
dfmono->set_font_ptr(_font_source_code_pro,_font_source_code_pro_size);
//dfd->set_force_autohinter(true); //just looks better..i think?
- MAKE_DROID_SANS(df,int(EditorSettings::get_singleton()->get("global/font_size"))*EDSCALE);
+ MAKE_DROID_SANS(df,int(EditorSettings::get_singleton()->get("interface/font_size"))*EDSCALE);
p_theme->set_default_theme_font(df);
-// Ref<BitmapFont> doc_font = make_font(_bi_font_doc_font_height,_bi_font_doc_font_ascent,0,_bi_font_doc_font_charcount,_bi_font_doc_font_characters,p_theme->get_icon("DocFont","EditorIcons"));
-// Ref<BitmapFont> doc_title_font = make_font(_bi_font_doc_title_font_height,_bi_font_doc_title_font_ascent,0,_bi_font_doc_title_font_charcount,_bi_font_doc_title_font_characters,p_theme->get_icon("DocTitleFont","EditorIcons"));
-// Ref<BitmapFont> doc_code_font = make_font(_bi_font_doc_code_font_height,_bi_font_doc_code_font_ascent,0,_bi_font_doc_code_font_charcount,_bi_font_doc_code_font_characters,p_theme->get_icon("DocCodeFont","EditorIcons"));
+ //Ref<BitmapFont> doc_font = make_font(_bi_font_doc_font_height,_bi_font_doc_font_ascent,0,_bi_font_doc_font_charcount,_bi_font_doc_font_characters,p_theme->get_icon("DocFont","EditorIcons"));
+ //Ref<BitmapFont> doc_title_font = make_font(_bi_font_doc_title_font_height,_bi_font_doc_title_font_ascent,0,_bi_font_doc_title_font_charcount,_bi_font_doc_title_font_characters,p_theme->get_icon("DocTitleFont","EditorIcons"));
+ //Ref<BitmapFont> doc_code_font = make_font(_bi_font_doc_code_font_height,_bi_font_doc_code_font_ascent,0,_bi_font_doc_code_font_charcount,_bi_font_doc_code_font_characters,p_theme->get_icon("DocCodeFont","EditorIcons"));
- MAKE_DROID_SANS(df_title,int(EDITOR_DEF("help/help_title_font_size",18))*EDSCALE);
+ MAKE_DROID_SANS(df_title,int(EDITOR_DEF("text_editor/help/help_title_font_size",18))*EDSCALE);
- MAKE_DROID_SANS(df_doc,int(EDITOR_DEF("help/help_font_size",16))*EDSCALE);
+ MAKE_DROID_SANS(df_doc,int(EDITOR_DEF("text_editor/help/help_font_size",16))*EDSCALE);
p_theme->set_font("doc","EditorFonts",df_doc);
@@ -142,7 +142,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
Ref<DynamicFont> df_code;
df_code.instance();
- df_code->set_size(int(EditorSettings::get_singleton()->get("global/source_font_size"))*EDSCALE);
+ df_code->set_size(int(EditorSettings::get_singleton()->get("interface/source_font_size"))*EDSCALE);
df_code->set_font_data(dfmono);
MAKE_FALLBACKS(df_code);
@@ -150,7 +150,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
Ref<DynamicFont> df_doc_code;
df_doc_code.instance();
- df_doc_code->set_size(int(EDITOR_DEF("help/help_source_font_size",14))*EDSCALE);
+ df_doc_code->set_size(int(EDITOR_DEF("text_editor/help/help_source_font_size",14))*EDSCALE);
df_doc_code->set_font_data(dfmono);
MAKE_FALLBACKS(df_doc_code);
diff --git a/tools/editor/editor_fonts.h b/tools/editor/editor_fonts.h
index 3b2422c3e3..0e8ce20609 100644
--- a/tools/editor/editor_fonts.h
+++ b/tools/editor/editor_fonts.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp
index 4f83dc2f66..f96a02bc52 100644
--- a/tools/editor/editor_help.cpp
+++ b/tools/editor/editor_help.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -71,7 +71,7 @@ void EditorHelpSearch::_sbox_input(const InputEvent& p_ie) {
p_ie.key.scancode == KEY_PAGEUP ||
p_ie.key.scancode == KEY_PAGEDOWN ) ) {
- search_options->call("_input_event",p_ie);
+ search_options->call("_gui_input",p_ie);
search_box->accept_event();
}
@@ -88,7 +88,7 @@ void EditorHelpSearch::_update_search() {
*/
List<StringName> type_list;
- ObjectTypeDB::get_type_list(&type_list);
+ ClassDB::get_class_list(&type_list);
DocData *doc=EditorHelp::get_doc_data();
String term = search_box->get_text();
@@ -287,7 +287,7 @@ void EditorHelpSearch::_notification(int p_what) {
if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
- if (is_visible()) {
+ if (is_visible_in_tree()) {
search_box->call_deferred("grab_focus"); // still not visible
search_box->select_all();
@@ -299,10 +299,10 @@ void EditorHelpSearch::_notification(int p_what) {
void EditorHelpSearch::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_text_changed"),&EditorHelpSearch::_text_changed);
- ObjectTypeDB::bind_method(_MD("_confirmed"),&EditorHelpSearch::_confirmed);
- ObjectTypeDB::bind_method(_MD("_sbox_input"),&EditorHelpSearch::_sbox_input);
- ObjectTypeDB::bind_method(_MD("_update_search"),&EditorHelpSearch::_update_search);
+ ClassDB::bind_method(_MD("_text_changed"),&EditorHelpSearch::_text_changed);
+ ClassDB::bind_method(_MD("_confirmed"),&EditorHelpSearch::_confirmed);
+ ClassDB::bind_method(_MD("_sbox_input"),&EditorHelpSearch::_sbox_input);
+ ClassDB::bind_method(_MD("_update_search"),&EditorHelpSearch::_update_search);
ADD_SIGNAL(MethodInfo("go_to_help"));
@@ -314,7 +314,7 @@ EditorHelpSearch::EditorHelpSearch() {
editor=EditorNode::get_singleton();
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+
HBoxContainer *sb_hb = memnew( HBoxContainer);
search_box = memnew( LineEdit );
sb_hb->add_child(search_box);
@@ -324,7 +324,7 @@ EditorHelpSearch::EditorHelpSearch() {
sb_hb->add_child(sb);
vbc->add_margin_child(TTR("Search:"),sb_hb);
search_box->connect("text_changed",this,"_text_changed");
- search_box->connect("input_event",this,"_sbox_input");
+ search_box->connect("gui_input",this,"_sbox_input");
search_options = memnew( Tree );
vbc->add_margin_child(TTR("Matches:"),search_options,true);
get_ok()->set_text(TTR("Open"));
@@ -334,7 +334,7 @@ EditorHelpSearch::EditorHelpSearch() {
search_options->connect("item_activated",this,"_confirmed");
set_title(TTR("Search Help"));
-// search_options->set_hide_root(true);
+ //search_options->set_hide_root(true);
}
@@ -349,8 +349,10 @@ void EditorHelpIndex::add_type(const String& p_type,HashMap<String,TreeItem*>& p
if (p_types.has(p_type))
return;
-// if (!ObjectTypeDB::is_type(p_type,base) || p_type==base)
-// return;
+ /*
+ if (!ClassDB::is_type(p_type,base) || p_type==base)
+ return;
+ */
String inherits=EditorHelp::get_doc_data()->class_list[p_type].inherits;
@@ -488,17 +490,17 @@ void EditorHelpIndex::_sbox_input(const InputEvent& p_ie) {
p_ie.key.scancode == KEY_PAGEUP ||
p_ie.key.scancode == KEY_PAGEDOWN ) ) {
- class_list->call("_input_event",p_ie);
+ class_list->call("_gui_input",p_ie);
search_box->accept_event();
}
}
void EditorHelpIndex::_bind_methods() {
- ObjectTypeDB::bind_method("_tree_item_selected",&EditorHelpIndex::_tree_item_selected);
- ObjectTypeDB::bind_method("_text_changed",&EditorHelpIndex::_text_changed);
- ObjectTypeDB::bind_method("_sbox_input",&EditorHelpIndex::_sbox_input);
- ObjectTypeDB::bind_method("select_class",&EditorHelpIndex::select_class);
+ ClassDB::bind_method("_tree_item_selected",&EditorHelpIndex::_tree_item_selected);
+ ClassDB::bind_method("_text_changed",&EditorHelpIndex::_text_changed);
+ ClassDB::bind_method("_sbox_input",&EditorHelpIndex::_sbox_input);
+ ClassDB::bind_method("select_class",&EditorHelpIndex::select_class);
ADD_SIGNAL( MethodInfo("open_class"));
}
@@ -508,7 +510,6 @@ EditorHelpIndex::EditorHelpIndex() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
search_box = memnew( LineEdit );
vbc->add_margin_child(TTR("Search:"), search_box);
@@ -517,7 +518,7 @@ EditorHelpIndex::EditorHelpIndex() {
register_text_enter(search_box);
search_box->connect("text_changed", this, "_text_changed");
- search_box->connect("input_event", this, "_sbox_input");
+ search_box->connect("gui_input", this, "_sbox_input");
class_list = memnew( Tree );
vbc->add_margin_child(TTR("Class List:")+" ", class_list, true);
@@ -539,7 +540,7 @@ DocData *EditorHelp::doc=NULL;
void EditorHelp::_unhandled_key_input(const InputEvent& p_ev) {
- if (!is_visible())
+ if (!is_visible_in_tree())
return;
if ( p_ev.key.mod.control && p_ev.key.scancode==KEY_F) {
@@ -572,15 +573,15 @@ void EditorHelp::_button_pressed(int p_idx) {
if (p_idx==PAGE_CLASS_LIST) {
- // edited_class->set_pressed(false);
- // class_list_button->set_pressed(true);
- // tabs->set_current_tab(PAGE_CLASS_LIST);
+ //edited_class->set_pressed(false);
+ //class_list_button->set_pressed(true);
+ //tabs->set_current_tab(PAGE_CLASS_LIST);
} else if (p_idx==PAGE_CLASS_DESC) {
- // edited_class->set_pressed(true);
- // class_list_button->set_pressed(false);
- // tabs->set_current_tab(PAGE_CLASS_DESC);
+ //edited_class->set_pressed(true);
+ //class_list_button->set_pressed(false);
+ //tabs->set_current_tab(PAGE_CLASS_DESC);
} else if (p_idx==PAGE_CLASS_PREV) {
@@ -620,7 +621,7 @@ void EditorHelp::_class_desc_select(const String& p_select) {
-// print_line("LINK: "+p_select);
+ //print_line("LINK: "+p_select);
if (p_select.begins_with("#")) {
//_goto_desc(p_select.substr(1,p_select.length()));
emit_signal("go_to_help","class_name:"+p_select.substr(1,p_select.length()));
@@ -660,7 +661,7 @@ void EditorHelp::_add_type(const String& p_type) {
t="void";
bool can_ref = (t!="int" && t!="real" && t!="bool" && t!="void");
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/base_type_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/base_type_color"));
if (can_ref)
class_desc->push_meta("#"+t); //class
class_desc->add_text(t);
@@ -675,7 +676,7 @@ void EditorHelp::_scroll_changed(double p_scroll) {
if (scroll_locked)
return;
- if (class_desc->get_v_scroll()->is_hidden())
+ if (!class_desc->get_v_scroll()->is_visible())
p_scroll=0;
//history[p].scroll=p_scroll;
@@ -719,9 +720,9 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
h_color=Color(1,1,1,1);
class_desc->push_font(doc_title_font);
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->add_text(TTR("Class:")+" ");
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/base_type_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/base_type_color"));
_add_text(p_class);
class_desc->pop();
class_desc->pop();
@@ -730,7 +731,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
if (cd.inherits!="") {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Inherits:")+" ");
class_desc->pop();
@@ -754,7 +755,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
class_desc->add_newline();
}
- if (ObjectTypeDB::type_exists(cd.name)) {
+ if (ClassDB::class_exists(cd.name)) {
bool found = false;
bool prev = false;
@@ -764,7 +765,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
if (E->get().inherits == cd.name) {
if (!found) {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Inherited by:")+" ");
class_desc->pop();
@@ -795,7 +796,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
if (cd.brief_description!="") {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Brief Description:"));
class_desc->pop();
@@ -803,7 +804,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
//class_desc->add_newline();
class_desc->add_newline();
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
class_desc->push_font( doc_font );
class_desc->push_indent(1);
_add_text(cd.brief_description);
@@ -814,37 +815,132 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
class_desc->add_newline();
}
+ Set<String> skip_methods;
+ bool property_descr=false;
+
+ if (cd.properties.size()) {
+
+
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
+ class_desc->push_font(doc_title_font);
+ class_desc->add_text(TTR("Members:"));
+ class_desc->pop();
+ class_desc->pop();
+ //class_desc->add_newline();
+
+ class_desc->push_indent(1);
+ class_desc->push_table(2);
+ class_desc->set_table_column_expand(1,1);
+
+ for(int i=0;i<cd.properties.size();i++) {
+ property_line[cd.properties[i].name]=class_desc->get_line_count()-2; //gets overriden if description
+
+ class_desc->push_cell();
+ class_desc->push_align(RichTextLabel::ALIGN_RIGHT);
+ class_desc->push_font(doc_code_font);
+ _add_type(cd.properties[i].type);
+ class_desc->add_text(" ");
+ class_desc->pop();
+ class_desc->pop();
+ class_desc->pop();
+
+ bool describe=false;
+
+ if (cd.properties[i].setter!="") {
+ skip_methods.insert(cd.properties[i].setter);
+ describe=true;
+
+ }
+ if (cd.properties[i].getter!="") {
+ skip_methods.insert(cd.properties[i].getter);
+ describe=true;
+ }
+
+ if (cd.properties[i].description!="") {
+ describe=true;
+
+ }
+ class_desc->push_cell();
+ if (describe) {
+ class_desc->push_meta("@"+cd.properties[i].name);
+ }
+
+ class_desc->push_font(doc_code_font);
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
+ _add_text(cd.properties[i].name);
+
+ if (describe) {
+ class_desc->pop();
+ }
+
+
+ if (cd.properties[i].brief_description!="") {
+ class_desc->push_font(doc_font);
+ class_desc->add_text(" ");
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/comment_color"));
+ _add_text(cd.properties[i].description);
+ class_desc->pop();
+ class_desc->pop();
+
+ }
+
+ if (describe) {
+ property_descr=true;
+ }
+
+
+ class_desc->pop();
+ class_desc->pop();
+ class_desc->pop();
+
+ }
+
+
+ class_desc->pop(); //table
+ class_desc->pop();
+ class_desc->add_newline();
+ class_desc->add_newline();
+ }
+
+
bool method_descr=false;
- bool sort_methods = EditorSettings::get_singleton()->get("help/sort_functions_alphabetically");
+ bool sort_methods = EditorSettings::get_singleton()->get("text_editor/help/sort_functions_alphabetically");
+ Vector<DocData::MethodDoc> methods;
- if (cd.methods.size()) {
+ for(int i=0;i<cd.methods.size();i++) {
+ if (skip_methods.has(cd.methods[i].name))
+ continue;
+ methods.push_back(cd.methods[i]);
+ }
+
+ if (methods.size()) {
if (sort_methods)
- cd.methods.sort();
+ methods.sort();
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Public Methods:"));
class_desc->pop();
class_desc->pop();
//class_desc->add_newline();
-// class_desc->add_newline();
+ //class_desc->add_newline();
class_desc->push_indent(1);
class_desc->push_table(2);
class_desc->set_table_column_expand(1,1);
- for(int i=0;i<cd.methods.size();i++) {
+ for(int i=0;i<methods.size();i++) {
class_desc->push_cell();
- method_line[cd.methods[i].name]=class_desc->get_line_count()-2; //gets overriden if description
+ method_line[methods[i].name]=class_desc->get_line_count()-2; //gets overriden if description
class_desc->push_align(RichTextLabel::ALIGN_RIGHT);
class_desc->push_font(doc_code_font);
- _add_type(cd.methods[i].return_type);
+ _add_type(methods[i].return_type);
//class_desc->add_text(" ");
class_desc->pop(); //align
class_desc->pop(); //font
@@ -852,58 +948,58 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
class_desc->push_cell();
class_desc->push_font(doc_code_font);
- if (cd.methods[i].description!="") {
+ if (methods[i].description!="") {
method_descr=true;
- class_desc->push_meta("@"+cd.methods[i].name);
+ class_desc->push_meta("@"+methods[i].name);
}
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
- _add_text(cd.methods[i].name);
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
+ _add_text(methods[i].name);
class_desc->pop();
- if (cd.methods[i].description!="")
+ if (methods[i].description!="")
class_desc->pop();
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
- class_desc->add_text(cd.methods[i].arguments.size()?"( ":"(");
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
+ class_desc->add_text(methods[i].arguments.size()?"( ":"(");
class_desc->pop();
- for(int j=0;j<cd.methods[i].arguments.size();j++) {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
+ for(int j=0;j<methods[i].arguments.size();j++) {
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
if (j>0)
class_desc->add_text(", ");
- _add_type(cd.methods[i].arguments[j].type);
+ _add_type(methods[i].arguments[j].type);
class_desc->add_text(" ");
- _add_text(cd.methods[i].arguments[j].name);
- if (cd.methods[i].arguments[j].default_value!="") {
+ _add_text(methods[i].arguments[j].name);
+ if (methods[i].arguments[j].default_value!="") {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
class_desc->add_text("=");
class_desc->pop();
- _add_text(cd.methods[i].arguments[j].default_value);
+ _add_text(methods[i].arguments[j].default_value);
}
class_desc->pop();
}
- if (cd.methods[i].qualifiers.find("vararg")!=-1) {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
+ if (methods[i].qualifiers.find("vararg")!=-1) {
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
class_desc->add_text(",");
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
class_desc->add_text(" ... ");
class_desc->pop();
class_desc->pop();
}
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
- class_desc->add_text(cd.methods[i].arguments.size()?" )":")");
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
+ class_desc->add_text(methods[i].arguments.size()?" )":")");
class_desc->pop();
- if (cd.methods[i].qualifiers!="") {
+ if (methods[i].qualifiers!="") {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->add_text(" ");
- _add_text(cd.methods[i].qualifiers);
+ _add_text(methods[i].qualifiers);
class_desc->pop();
}
class_desc->pop();//monofont
-// class_desc->add_newline();
+ //class_desc->add_newline();
class_desc->pop(); //cell
}
@@ -914,53 +1010,11 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
}
- if (cd.properties.size()) {
-
-
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
- class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Members:"));
- class_desc->pop();
- class_desc->pop();
- class_desc->add_newline();
-
- class_desc->push_indent(1);
-
- //class_desc->add_newline();
-
- for(int i=0;i<cd.properties.size();i++) {
-
- property_line[cd.properties[i].name]=class_desc->get_line_count()-2; //gets overriden if description
- class_desc->push_font(doc_code_font);
- _add_type(cd.properties[i].type);
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
- class_desc->add_text(" ");
- _add_text(cd.properties[i].name);
- class_desc->pop();
- class_desc->pop();
-
- if (cd.properties[i].description!="") {
- class_desc->push_font(doc_font);
- class_desc->add_text(" ");
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/comment_color"));
- _add_text(cd.properties[i].description);
- class_desc->pop();
- class_desc->pop();
-
- }
-
- class_desc->add_newline();
- }
-
-
- class_desc->pop();
- class_desc->add_newline();
- }
if (cd.theme_properties.size()) {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("GUI Theme Items:"));
class_desc->pop();
@@ -976,7 +1030,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
theme_property_line[cd.theme_properties[i].name]=class_desc->get_line_count()-2; //gets overriden if description
class_desc->push_font(doc_code_font);
_add_type(cd.theme_properties[i].type);
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
class_desc->add_text(" ");
_add_text(cd.theme_properties[i].name);
class_desc->pop();
@@ -985,7 +1039,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
if (cd.theme_properties[i].description!="") {
class_desc->push_font(doc_font);
class_desc->add_text(" ");
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/comment_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/comment_color"));
_add_text(cd.theme_properties[i].description);
class_desc->pop();
class_desc->pop();
@@ -1004,7 +1058,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
if (sort_methods) {
cd.signals.sort();
}
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Signals:"));
class_desc->pop();
@@ -1021,14 +1075,14 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
class_desc->push_font(doc_code_font); // monofont
//_add_type("void");
//class_desc->add_text(" ");
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
_add_text(cd.signals[i].name);
class_desc->pop();
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
class_desc->add_text(cd.signals[i].arguments.size()?"( ":"(");
class_desc->pop();
for(int j=0;j<cd.signals[i].arguments.size();j++) {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
if (j>0)
class_desc->add_text(", ");
_add_type(cd.signals[i].arguments[j].type);
@@ -1036,7 +1090,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
_add_text(cd.signals[i].arguments[j].name);
if (cd.signals[i].arguments[j].default_value!="") {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
class_desc->add_text("=");
class_desc->pop();
_add_text(cd.signals[i].arguments[j].default_value);
@@ -1045,13 +1099,13 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
class_desc->pop();
}
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
class_desc->add_text(cd.signals[i].arguments.size()?" )":")");
class_desc->pop();
class_desc->pop(); // end monofont
if (cd.signals[i].description!="") {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/comment_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/comment_color"));
class_desc->add_text(" ");
_add_text(cd.signals[i].description);
class_desc->pop();
@@ -1069,7 +1123,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
if (cd.constants.size()) {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Constants:"));
class_desc->pop();
@@ -1083,20 +1137,20 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
constant_line[cd.constants[i].name]=class_desc->get_line_count()-2;
class_desc->push_font(doc_code_font);
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/base_type_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/base_type_color"));
_add_text(cd.constants[i].name);
class_desc->pop();
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
class_desc->add_text(" = ");
class_desc->pop();
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
_add_text(cd.constants[i].value);
class_desc->pop();
class_desc->pop();
if (cd.constants[i].description!="") {
class_desc->push_font(doc_font);
class_desc->add_text(" ");
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/comment_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/comment_color"));
_add_text(cd.constants[i].description);
class_desc->pop();
class_desc->pop();
@@ -1114,7 +1168,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
if (cd.description!="") {
description_line=class_desc->get_line_count()-2;
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Description:"));
class_desc->pop();
@@ -1122,7 +1176,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
class_desc->add_newline();
class_desc->add_newline();
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
class_desc->push_font( doc_font );
class_desc->push_indent(1);
_add_text(cd.description);
@@ -1133,9 +1187,92 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
class_desc->add_newline();
}
+ if (property_descr) {
+
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
+ class_desc->push_font(doc_title_font);
+ class_desc->add_text(TTR("Property Description:"));
+ class_desc->pop();
+ class_desc->pop();
+
+ class_desc->add_newline();
+ class_desc->add_newline();
+
+
+ for(int i=0;i<cd.properties.size();i++) {
+
+ method_line[cd.properties[i].name]=class_desc->get_line_count()-2;
+
+ class_desc->push_font(doc_code_font);
+ _add_type(cd.properties[i].type);
+
+ class_desc->add_text(" ");
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
+ _add_text(cd.properties[i].name);
+ class_desc->pop(); //color
+
+ class_desc->add_text(" ");
+
+ class_desc->pop(); //font
+
+ if (cd.properties[i].setter!="") {
+
+ class_desc->push_font( doc_font );
+
+ class_desc->push_indent(2);
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
+ class_desc->add_text("Setter: ");
+ class_desc->pop();
+
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
+ class_desc->add_text(cd.properties[i].setter+"(value)");
+ class_desc->pop(); //color
+
+ class_desc->pop(); //indent
+
+ class_desc->pop(); //font
+
+ }
+
+ if (cd.properties[i].getter!="") {
+
+ class_desc->push_font( doc_font );
+
+ class_desc->push_indent(2);
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
+ class_desc->add_text("Getter: ");
+ class_desc->pop();
+
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
+ class_desc->add_text(cd.properties[i].getter+"()");
+ class_desc->pop(); //color
+
+ class_desc->pop(); //indent
+
+ class_desc->pop(); //font
+
+ }
+
+ class_desc->add_newline();
+
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
+ class_desc->push_font( doc_font );
+ class_desc->push_indent(1);
+ _add_text(cd.properties[i].description);
+ class_desc->pop();
+ class_desc->pop();
+ class_desc->pop();
+ class_desc->add_newline();
+ class_desc->add_newline();
+ class_desc->add_newline();
+
+ }
+
+ }
+
if (method_descr) {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Method Description:"));
class_desc->pop();
@@ -1145,46 +1282,46 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
class_desc->add_newline();
- for(int i=0;i<cd.methods.size();i++) {
+ for(int i=0;i<methods.size();i++) {
- method_line[cd.methods[i].name]=class_desc->get_line_count()-2;
+ method_line[methods[i].name]=class_desc->get_line_count()-2;
class_desc->push_font(doc_code_font);
- _add_type(cd.methods[i].return_type);
+ _add_type(methods[i].return_type);
class_desc->add_text(" ");
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
- _add_text(cd.methods[i].name);
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
+ _add_text(methods[i].name);
class_desc->pop();
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
- class_desc->add_text(cd.methods[i].arguments.size()?"( ":"(");
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
+ class_desc->add_text(methods[i].arguments.size()?"( ":"(");
class_desc->pop();
- for(int j=0;j<cd.methods[i].arguments.size();j++) {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
+ for(int j=0;j<methods[i].arguments.size();j++) {
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
if (j>0)
class_desc->add_text(", ");
- _add_type(cd.methods[i].arguments[j].type);
+ _add_type(methods[i].arguments[j].type);
class_desc->add_text(" ");
- _add_text(cd.methods[i].arguments[j].name);
- if (cd.methods[i].arguments[j].default_value!="") {
+ _add_text(methods[i].arguments[j].name);
+ if (methods[i].arguments[j].default_value!="") {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
class_desc->add_text("=");
class_desc->pop();
- _add_text(cd.methods[i].arguments[j].default_value);
+ _add_text(methods[i].arguments[j].default_value);
}
class_desc->pop();
}
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color"));
- class_desc->add_text(cd.methods[i].arguments.size()?" )":")");
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"));
+ class_desc->add_text(methods[i].arguments.size()?" )":")");
class_desc->pop();
- if (cd.methods[i].qualifiers!="") {
+ if (methods[i].qualifiers!="") {
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
class_desc->add_text(" ");
- _add_text(cd.methods[i].qualifiers);
+ _add_text(methods[i].qualifiers);
class_desc->pop();
}
@@ -1192,10 +1329,10 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
class_desc->pop();
class_desc->add_newline();
- class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
+ class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
class_desc->push_font( doc_font );
class_desc->push_indent(1);
- _add_text(cd.methods[i].description);
+ _add_text(methods[i].description);
class_desc->pop();
class_desc->pop();
class_desc->pop();
@@ -1272,7 +1409,7 @@ static void _add_text_to_rt(const String& p_bbcode,RichTextLabel *p_rt) {
DocData *doc = EditorHelp::get_doc_data();
String base_path;
- /*p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/text_color"));
+ /*p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"));
p_rt->push_font( get_font("normal","Fonts") );
p_rt->push_indent(1);*/
int pos = 0;
@@ -1388,7 +1525,7 @@ static void _add_text_to_rt(const String& p_bbcode,RichTextLabel *p_rt) {
} else if (tag.begins_with("method ")) {
String m = tag.substr(7,tag.length());
- p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
p_rt->push_meta("@"+m);
p_rt->add_text(m+"()");
p_rt->pop();
@@ -1398,7 +1535,7 @@ static void _add_text_to_rt(const String& p_bbcode,RichTextLabel *p_rt) {
} else if (doc->class_list.has(tag)) {
- p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
+ p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"));
p_rt->push_meta("#"+tag);
p_rt->add_text(tag);
p_rt->pop();
@@ -1414,7 +1551,7 @@ static void _add_text_to_rt(const String& p_bbcode,RichTextLabel *p_rt) {
} else if (tag=="i") {
//use italics font
- Color text_color = EditorSettings::get_singleton()->get("text_editor/text_color");
+ Color text_color = EditorSettings::get_singleton()->get("text_editor/highlighting/text_color");
//no italics so emphasize with color
text_color.r*=1.1;
text_color.g*=1.1;
@@ -1599,8 +1736,8 @@ void EditorHelp::_notification(int p_what) {
case NOTIFICATION_READY: {
-// forward->set_icon(get_icon("Forward","EditorIcons"));
-// back->set_icon(get_icon("Back","EditorIcons"));
+ //forward->set_icon(get_icon("Forward","EditorIcons"));
+ //back->set_icon(get_icon("Back","EditorIcons"));
_update_doc();
} break;
@@ -1629,7 +1766,7 @@ void EditorHelp::_search_cbk() {
_search(search->get_text());
}
-String EditorHelp::get_class_name() {
+String EditorHelp::get_class() {
return edited_class;
}
@@ -1640,27 +1777,27 @@ void EditorHelp::search_again() {
int EditorHelp::get_scroll() const {
- return class_desc->get_v_scroll()->get_val();
+ return class_desc->get_v_scroll()->get_value();
}
void EditorHelp::set_scroll(int p_scroll) {
- class_desc->get_v_scroll()->set_val(p_scroll);
+ class_desc->get_v_scroll()->set_value(p_scroll);
}
void EditorHelp::_bind_methods() {
- ObjectTypeDB::bind_method("_class_list_select",&EditorHelp::_class_list_select);
- ObjectTypeDB::bind_method("_class_desc_select",&EditorHelp::_class_desc_select);
- ObjectTypeDB::bind_method("_class_desc_input",&EditorHelp::_class_desc_input);
-// ObjectTypeDB::bind_method("_button_pressed",&EditorHelp::_button_pressed);
- ObjectTypeDB::bind_method("_scroll_changed",&EditorHelp::_scroll_changed);
- ObjectTypeDB::bind_method("_request_help",&EditorHelp::_request_help);
- ObjectTypeDB::bind_method("_unhandled_key_input",&EditorHelp::_unhandled_key_input);
- ObjectTypeDB::bind_method("_search",&EditorHelp::_search);
- ObjectTypeDB::bind_method("_search_cbk",&EditorHelp::_search_cbk);
- ObjectTypeDB::bind_method("_help_callback",&EditorHelp::_help_callback);
+ ClassDB::bind_method("_class_list_select",&EditorHelp::_class_list_select);
+ ClassDB::bind_method("_class_desc_select",&EditorHelp::_class_desc_select);
+ ClassDB::bind_method("_class_desc_input",&EditorHelp::_class_desc_input);
+ //ClassDB::bind_method("_button_pressed",&EditorHelp::_button_pressed);
+ ClassDB::bind_method("_scroll_changed",&EditorHelp::_scroll_changed);
+ ClassDB::bind_method("_request_help",&EditorHelp::_request_help);
+ ClassDB::bind_method("_unhandled_key_input",&EditorHelp::_unhandled_key_input);
+ ClassDB::bind_method("_search",&EditorHelp::_search);
+ ClassDB::bind_method("_search_cbk",&EditorHelp::_search_cbk);
+ ClassDB::bind_method("_help_callback",&EditorHelp::_help_callback);
ADD_SIGNAL(MethodInfo("go_to_help"));
@@ -1672,7 +1809,7 @@ EditorHelp::EditorHelp() {
VBoxContainer *vbc = this;
- EDITOR_DEF("help/sort_functions_alphabetically",true);
+ EDITOR_DEF("text_editor/help/sort_functions_alphabetically",true);
//class_list->connect("meta_clicked",this,"_class_list_select");
//class_list->set_selection_enabled(true);
@@ -1680,7 +1817,7 @@ EditorHelp::EditorHelp() {
{
Panel *pc = memnew( Panel );
Ref<StyleBoxFlat> style( memnew( StyleBoxFlat ) );
- style->set_bg_color( EditorSettings::get_singleton()->get("text_editor/background_color") );
+ style->set_bg_color( EditorSettings::get_singleton()->get("text_editor/highlighting/background_color") );
pc->set_v_size_flags(SIZE_EXPAND_FILL);
pc->add_style_override("panel", style); //get_stylebox("normal","TextEdit"));
vbc->add_child(pc);
@@ -1688,7 +1825,7 @@ EditorHelp::EditorHelp() {
pc->add_child(class_desc);
class_desc->set_area_as_parent_rect(8);
class_desc->connect("meta_clicked",this,"_class_desc_select");
- class_desc->connect("input_event",this,"_class_desc_input");
+ class_desc->connect("gui_input",this,"_class_desc_input");
}
class_desc->get_v_scroll()->connect("value_changed",this,"_scroll_changed");
@@ -1703,21 +1840,21 @@ EditorHelp::EditorHelp() {
add_child(search_dialog);
VBoxContainer *search_vb = memnew( VBoxContainer );
search_dialog->add_child(search_vb);
- search_dialog->set_child_rect(search_vb);
+
search = memnew( LineEdit );
search_dialog->register_text_enter(search);
search_vb->add_margin_child(TTR("Search Text"),search);
search_dialog->get_ok()->set_text(TTR("Find"));
search_dialog->connect("confirmed",this,"_search_cbk");
search_dialog->set_hide_on_ok(false);
- search_dialog->set_self_opacity(0.8);
+ search_dialog->set_self_modulate(Color(1,1,1,0.8));
/*class_search = memnew( EditorHelpSearch(editor) );
editor->get_gui_base()->add_child(class_search);
class_search->connect("go_to_help",this,"_help_callback");*/
-// prev_search_page=-1;
+ //prev_search_page=-1;
}
EditorHelp::~EditorHelp() {
@@ -1737,8 +1874,7 @@ void EditorHelpBit::_go_to_help(String p_what) {
void EditorHelpBit::_meta_clicked(String p_select) {
-
- // print_line("LINK: "+p_select);
+ //print_line("LINK: "+p_select);
if (p_select.begins_with("#")) {
//_goto_desc(p_select.substr(1,p_select.length()));
_go_to_help("class_name:"+p_select.substr(1,p_select.length()));
@@ -1752,10 +1888,11 @@ void EditorHelpBit::_meta_clicked(String p_select) {
_go_to_help("class_method:"+m.get_slice(".",0)+":"+m.get_slice(".",0));
} else {
-//
- // if (!method_line.has(m))
- // return;
- //class_desc->scroll_to_line(method_line[m]);
+ /*
+ if (!method_line.has(m))
+ return;
+ class_desc->scroll_to_line(method_line[m]);
+ */
}
}
@@ -1765,7 +1902,7 @@ void EditorHelpBit::_meta_clicked(String p_select) {
void EditorHelpBit::_bind_methods() {
- ObjectTypeDB::bind_method("_meta_clicked",&EditorHelpBit::_meta_clicked);
+ ClassDB::bind_method("_meta_clicked",&EditorHelpBit::_meta_clicked);
ADD_SIGNAL(MethodInfo("request_hide"));
}
diff --git a/tools/editor/editor_help.h b/tools/editor/editor_help.h
index b0dc2809fe..85bac27705 100644
--- a/tools/editor/editor_help.h
+++ b/tools/editor/editor_help.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -47,7 +47,7 @@ class EditorNode;
class EditorHelpSearch : public ConfirmationDialog {
- OBJ_TYPE(EditorHelpSearch,ConfirmationDialog )
+ GDCLASS(EditorHelpSearch,ConfirmationDialog )
EditorNode *editor;
LineEdit *search_box;
@@ -75,7 +75,7 @@ public:
};
class EditorHelpIndex : public ConfirmationDialog {
- OBJ_TYPE( EditorHelpIndex, ConfirmationDialog );
+ GDCLASS( EditorHelpIndex, ConfirmationDialog );
LineEdit *search_box;
Tree *class_list;
@@ -104,7 +104,7 @@ public:
class EditorHelp : public VBoxContainer {
- OBJ_TYPE( EditorHelp, VBoxContainer );
+ GDCLASS( EditorHelp, VBoxContainer );
enum Page {
@@ -187,7 +187,7 @@ public:
void popup_search();
void search_again();
- String get_class_name();
+ String get_class();
void set_focused() { class_desc->grab_focus(); }
@@ -202,7 +202,7 @@ public:
class EditorHelpBit : public Panel {
- OBJ_TYPE( EditorHelpBit, Panel);
+ GDCLASS( EditorHelpBit, Panel);
RichTextLabel *rich_text;
void _go_to_help(String p_what);
diff --git a/tools/editor/editor_icons.h b/tools/editor/editor_icons.h
index 191b908682..7e8d8c0828 100644
--- a/tools/editor/editor_icons.h
+++ b/tools/editor/editor_icons.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp
index d90a175811..cf83052ee0 100644
--- a/tools/editor/editor_import_export.cpp
+++ b/tools/editor/editor_import_export.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -46,8 +46,8 @@
String EditorImportPlugin::validate_source_path(const String& p_path) {
- String gp = Globals::get_singleton()->globalize_path(p_path);
- String rp = Globals::get_singleton()->get_resource_path();
+ String gp = GlobalConfig::get_singleton()->globalize_path(p_path);
+ String rp = GlobalConfig::get_singleton()->get_resource_path();
if (!rp.ends_with("/"))
rp+="/";
@@ -57,7 +57,7 @@ String EditorImportPlugin::validate_source_path(const String& p_path) {
String EditorImportPlugin::expand_source_path(const String& p_path) {
if (p_path.is_rel_path()) {
- return Globals::get_singleton()->get_resource_path().plus_file(p_path).simplify_path();
+ return GlobalConfig::get_singleton()->get_resource_path().plus_file(p_path).simplify_path();
} else {
return p_path;
}
@@ -77,19 +77,19 @@ String EditorImportPlugin::_expand_source_path(const String& p_path) {
void EditorImportPlugin::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("validate_source_path","path"),&EditorImportPlugin::_validate_source_path);
- ObjectTypeDB::bind_method(_MD("expand_source_path","path"),&EditorImportPlugin::_expand_source_path);
+ ClassDB::bind_method(_MD("validate_source_path","path"),&EditorImportPlugin::_validate_source_path);
+ ClassDB::bind_method(_MD("expand_source_path","path"),&EditorImportPlugin::_expand_source_path);
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::STRING,"get_name"));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::STRING,"get_visible_name"));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("import_dialog",PropertyInfo(Variant::STRING,"from")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::INT,"import",PropertyInfo(Variant::STRING,"path"),PropertyInfo(Variant::OBJECT,"from",PROPERTY_HINT_RESOURCE_TYPE,"ResourceImportMetadata")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::RAW_ARRAY,"custom_export",PropertyInfo(Variant::STRING,"path"),PropertyInfo(Variant::OBJECT,"platform",PROPERTY_HINT_RESOURCE_TYPE,"EditorExportPlatform")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("import_from_drop",PropertyInfo(Variant::STRING_ARRAY,"files"),PropertyInfo(Variant::STRING,"dest_path")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("reimport_multiple_files",PropertyInfo(Variant::STRING_ARRAY,"files")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"can_reimport_multiple_files"));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::STRING,"get_name"));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::STRING,"get_visible_name"));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("import_dialog",PropertyInfo(Variant::STRING,"from")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::INT,"import",PropertyInfo(Variant::STRING,"path"),PropertyInfo(Variant::OBJECT,"from",PROPERTY_HINT_RESOURCE_TYPE,"ResourceImportMetadata")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::POOL_BYTE_ARRAY,"custom_export",PropertyInfo(Variant::STRING,"path"),PropertyInfo(Variant::OBJECT,"platform",PROPERTY_HINT_RESOURCE_TYPE,"EditorExportPlatform")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("import_from_drop",PropertyInfo(Variant::POOL_STRING_ARRAY,"files"),PropertyInfo(Variant::STRING,"dest_path")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("reimport_multiple_files",PropertyInfo(Variant::POOL_STRING_ARRAY,"files")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"can_reimport_multiple_files"));
-// BIND_VMETHOD( mi );
+ //BIND_VMETHOD( mi );
}
String EditorImportPlugin::get_name() const {
@@ -175,7 +175,7 @@ EditorImportPlugin::EditorImportPlugin() {
void EditorExportPlugin::_bind_methods() {
MethodInfo mi = MethodInfo("custom_export:Variant",PropertyInfo(Variant::STRING,"name"),PropertyInfo(Variant::OBJECT,"platform",PROPERTY_HINT_RESOURCE_TYPE,"EditorExportPlatform"));
- mi.return_val.type=Variant::RAW_ARRAY;
+ mi.return_val.type=Variant::POOL_BYTE_ARRAY;
BIND_VMETHOD( mi );
}
@@ -188,7 +188,7 @@ Vector<uint8_t> EditorExportPlugin::custom_export(String& p_path,const Ref<Edito
Variant d = get_script_instance()->call("custom_export",p_path,p_platform);
if (d.get_type()==Variant::NIL)
return Vector<uint8_t>();
- if (d.get_type()==Variant::RAW_ARRAY)
+ if (d.get_type()==Variant::POOL_BYTE_ARRAY)
return d;
ERR_FAIL_COND_V(d.get_type()!=Variant::DICTIONARY,Vector<uint8_t>());
@@ -420,11 +420,12 @@ Vector<StringName> EditorExportPlatform::get_dependencies(bool p_bundles) const
{
List<String> l;
- // SceneLoader::get_recognized_extensions(&l);
- // for(List<String>::Element *E=l.front();E;E=E->next()) {
- //
- // scene_extensions.insert(E->get());
- // }
+ /*
+ SceneLoader::get_recognized_extensions(&l);
+ for(List<String>::Element *E=l.front();E;E=E->next()) {
+ scene_extensions.insert(E->get());
+ }
+ */
ResourceLoader::get_recognized_extensions_for_type("",&l);
for(List<String>::Element *E=l.front();E;E=E->next()) {
@@ -765,7 +766,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
{
MD5_CTX ctx;
MD5Init(&ctx);
- String path = Globals::get_singleton()->get_resource_path()+"::"+String(E->get())+"::"+get_name();
+ String path = GlobalConfig::get_singleton()->get_resource_path()+"::"+String(E->get())+"::"+get_name();
MD5Update(&ctx,(unsigned char*)path.utf8().get_data(),path.utf8().length());
MD5Final(&ctx);
md5 = String::md5(ctx.digest);
@@ -783,7 +784,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
if (atlas_valid) {
//compare options
- Dictionary options;
+ /*Dictionary options;
options.parse_json(f->get_line());
if (!options.has("lossy_quality") || float(options["lossy_quality"])!=group_lossy_quality)
atlas_valid=false;
@@ -794,7 +795,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
if (!atlas_valid)
print_line("JSON INVALID");
-
+*/
}
@@ -874,11 +875,11 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
int flags=0;
- if (Globals::get_singleton()->get("image_loader/filter"))
+ if (GlobalConfig::get_singleton()->get("image_loader/filter"))
flags|=EditorTextureImportPlugin::IMAGE_FLAG_FILTER;
- if (!Globals::get_singleton()->get("image_loader/gen_mipmaps"))
+ if (!GlobalConfig::get_singleton()->get("image_loader/gen_mipmaps"))
flags|=EditorTextureImportPlugin::IMAGE_FLAG_NO_MIPMAPS;
- if (!Globals::get_singleton()->get("image_loader/repeat"))
+ if (!GlobalConfig::get_singleton()->get("image_loader/repeat"))
flags|=EditorTextureImportPlugin::IMAGE_FLAG_REPEAT;
flags|=EditorTextureImportPlugin::IMAGE_FLAG_FIX_BORDER_ALPHA;
@@ -921,7 +922,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
options["lossy_quality"]=group_lossy_quality;
options["shrink"]=EditorImportExport::get_singleton()->image_export_group_get_shrink(E->get());
options["image_format"]=group_format;
- f->store_line(options.to_json());
+ //f->store_line(options.to_json());
f->store_line(image_list_md5);
}
@@ -949,7 +950,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
return ERR_CANT_CREATE;
}
Vector<uint8_t> data = FileAccess::get_file_as_array(path);
- String dst_path = F->get().operator String().basename()+".atex";
+ String dst_path = F->get().operator String().get_basename()+".atex";
err = p_func(p_udata,dst_path,data,counter++,files.size());
saved.insert(dst_path);
if (err)
@@ -958,7 +959,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
if (f) {
//recreating deps..
String depline;
-// depline=String(F->get())+"::"+itos(FileAccess::get_modified_time(F->get()))+"::"+FileAccess::get_md5(F->get()); name unneccesary by top md5
+ //depline=String(F->get())+"::"+itos(FileAccess::get_modified_time(F->get()))+"::"+FileAccess::get_md5(F->get()); name unneccesary by top md5
depline=itos(FileAccess::get_modified_time(F->get()))+"::"+FileAccess::get_md5(F->get());
depline+="::"+itos(region.pos.x)+"::"+itos(region.pos.y)+"::"+itos(region.size.x)+"::"+itos(region.size.y);
depline+="::"+itos(margin.pos.x)+"::"+itos(margin.pos.y)+"::"+itos(margin.size.x)+"::"+itos(margin.size.y);
@@ -987,7 +988,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
StringName engine_cfg="res://engine.cfg";
StringName boot_splash;
{
- String splash=Globals::get_singleton()->get("application/boot_splash"); //avoid splash from being converted
+ String splash=GlobalConfig::get_singleton()->get("application/boot_splash"); //avoid splash from being converted
splash=splash.strip_edges();
if (splash!=String()) {
if (!splash.begins_with("res://"))
@@ -998,7 +999,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
}
StringName custom_cursor;
{
- String splash=Globals::get_singleton()->get("display/custom_mouse_cursor"); //avoid splash from being converted
+ String splash=GlobalConfig::get_singleton()->get("display/custom_mouse_cursor"); //avoid splash from being converted
splash=splash.strip_edges();
if (splash!=String()) {
if (!splash.begins_with("res://"))
@@ -1084,7 +1085,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
String remap_file="engine.cfb";
String engine_cfb =EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmp"+remap_file;
- Globals::get_singleton()->save_custom(engine_cfb,custom);
+ GlobalConfig::get_singleton()->save_custom(engine_cfb,custom);
Vector<uint8_t> data = FileAccess::get_file_as_array(engine_cfb);
Error err = p_func(p_udata,"res://"+remap_file,data,counter,files.size());
@@ -1115,8 +1116,8 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
host="localhost";
if (p_flags&EXPORT_DUMB_CLIENT) {
- int port = EditorSettings::get_singleton()->get("file_server/port");
- String passwd = EditorSettings::get_singleton()->get("file_server/password");
+ int port = EditorSettings::get_singleton()->get("filesystem/file_server/port");
+ String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password");
r_flags.push_back("-rfs");
r_flags.push_back(host+":"+itos(port));
if (passwd!="") {
@@ -1129,7 +1130,7 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
r_flags.push_back("-rdebug");
- r_flags.push_back(host+":"+String::num(GLOBAL_DEF("debug/debug_port", 6007)));
+ r_flags.push_back(host+":"+String::num(GLOBAL_DEF("network/debug/remote_port", 6007)));
List<String> breakpoints;
ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
@@ -2174,9 +2175,9 @@ bool EditorImportExport::sample_get_trim() const{
return sample_action_trim;
}
-DVector<String> EditorImportExport::_get_export_file_list() {
+PoolVector<String> EditorImportExport::_get_export_file_list() {
- DVector<String> fl;
+ PoolVector<String> fl;
for (Map<StringName,FileAction>::Element *E=files.front();E;E=E->next()) {
fl.push_back(E->key());
@@ -2185,9 +2186,9 @@ DVector<String> EditorImportExport::_get_export_file_list() {
return fl;
}
-DVector<String> EditorImportExport::_get_export_platforms() {
+PoolVector<String> EditorImportExport::_get_export_platforms() {
- DVector<String> ep;
+ PoolVector<String> ep;
for (Map<StringName,Ref<EditorExportPlatform> >::Element *E=exporters.front();E;E=E->next()) {
ep.push_back(E->key());
@@ -2199,49 +2200,49 @@ DVector<String> EditorImportExport::_get_export_platforms() {
void EditorImportExport::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::add_import_plugin);
- ObjectTypeDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::remove_import_plugin);
- ObjectTypeDB::bind_method(_MD("get_import_plugin_count"),&EditorImportExport::get_import_plugin_count);
- ObjectTypeDB::bind_method(_MD("get_import_plugin:EditorImportPlugin","idx"),&EditorImportExport::get_import_plugin);
- ObjectTypeDB::bind_method(_MD("get_import_plugin_by_name:EditorImportPlugin","name"),&EditorImportExport::get_import_plugin_by_name);
-
- ObjectTypeDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::add_export_plugin);
- ObjectTypeDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::remove_export_plugin);
- ObjectTypeDB::bind_method(_MD("get_export_plugin_count"),&EditorImportExport::get_export_plugin_count);
- ObjectTypeDB::bind_method(_MD("get_export_plugin:EditorExportPlugin","idx"),&EditorImportExport::get_export_plugin);
-
- ObjectTypeDB::bind_method(_MD("set_export_file_action","file","action"),&EditorImportExport::set_export_file_action);
- ObjectTypeDB::bind_method(_MD("get_export_file_action","file"),&EditorImportExport::get_export_file_action);
- ObjectTypeDB::bind_method(_MD("get_export_file_list"),&EditorImportExport::_get_export_file_list);
-
- ObjectTypeDB::bind_method(_MD("add_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform);
- //ObjectTypeDB::bind_method(_MD("remove_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform);
- ObjectTypeDB::bind_method(_MD("get_export_platform:EditorExportPlatform","name"),&EditorImportExport::get_export_platform);
- ObjectTypeDB::bind_method(_MD("get_export_platforms"),&EditorImportExport::_get_export_platforms);
-
- ObjectTypeDB::bind_method(_MD("set_export_filter","filter"),&EditorImportExport::set_export_filter);
- ObjectTypeDB::bind_method(_MD("get_export_filter"),&EditorImportExport::get_export_filter);
-
- ObjectTypeDB::bind_method(_MD("set_export_custom_filter","filter"),&EditorImportExport::set_export_custom_filter);
- ObjectTypeDB::bind_method(_MD("get_export_custom_filter"),&EditorImportExport::get_export_custom_filter);
-
- ObjectTypeDB::bind_method(_MD("set_export_custom_filter_exclude","filter_exclude"),&EditorImportExport::set_export_custom_filter_exclude);
- ObjectTypeDB::bind_method(_MD("get_export_custom_filter_exclude"),&EditorImportExport::get_export_custom_filter_exclude);
-
-
- ObjectTypeDB::bind_method(_MD("image_export_group_create"),&EditorImportExport::image_export_group_create);
- ObjectTypeDB::bind_method(_MD("image_export_group_remove"),&EditorImportExport::image_export_group_remove);
- ObjectTypeDB::bind_method(_MD("image_export_group_set_image_action"),&EditorImportExport::image_export_group_set_image_action);
- ObjectTypeDB::bind_method(_MD("image_export_group_set_make_atlas"),&EditorImportExport::image_export_group_set_make_atlas);
- ObjectTypeDB::bind_method(_MD("image_export_group_set_shrink"),&EditorImportExport::image_export_group_set_shrink);
- ObjectTypeDB::bind_method(_MD("image_export_group_get_image_action"),&EditorImportExport::image_export_group_get_image_action);
- ObjectTypeDB::bind_method(_MD("image_export_group_get_make_atlas"),&EditorImportExport::image_export_group_get_make_atlas);
- ObjectTypeDB::bind_method(_MD("image_export_group_get_shrink"),&EditorImportExport::image_export_group_get_shrink);
- ObjectTypeDB::bind_method(_MD("image_add_to_export_group"),&EditorImportExport::image_add_to_export_group);
- ObjectTypeDB::bind_method(_MD("script_set_action"),&EditorImportExport::script_set_action);
- ObjectTypeDB::bind_method(_MD("script_set_encryption_key"),&EditorImportExport::script_set_encryption_key);
- ObjectTypeDB::bind_method(_MD("script_get_action"),&EditorImportExport::script_get_action);
- ObjectTypeDB::bind_method(_MD("script_get_encryption_key"),&EditorImportExport::script_get_encryption_key);
+ ClassDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::add_import_plugin);
+ ClassDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::remove_import_plugin);
+ ClassDB::bind_method(_MD("get_import_plugin_count"),&EditorImportExport::get_import_plugin_count);
+ ClassDB::bind_method(_MD("get_import_plugin:EditorImportPlugin","idx"),&EditorImportExport::get_import_plugin);
+ ClassDB::bind_method(_MD("get_import_plugin_by_name:EditorImportPlugin","name"),&EditorImportExport::get_import_plugin_by_name);
+
+ ClassDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::add_export_plugin);
+ ClassDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::remove_export_plugin);
+ ClassDB::bind_method(_MD("get_export_plugin_count"),&EditorImportExport::get_export_plugin_count);
+ ClassDB::bind_method(_MD("get_export_plugin:EditorExportPlugin","idx"),&EditorImportExport::get_export_plugin);
+
+ ClassDB::bind_method(_MD("set_export_file_action","file","action"),&EditorImportExport::set_export_file_action);
+ ClassDB::bind_method(_MD("get_export_file_action","file"),&EditorImportExport::get_export_file_action);
+ ClassDB::bind_method(_MD("get_export_file_list"),&EditorImportExport::_get_export_file_list);
+
+ ClassDB::bind_method(_MD("add_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform);
+ //ClassDB::bind_method(_MD("remove_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform);
+ ClassDB::bind_method(_MD("get_export_platform:EditorExportPlatform","name"),&EditorImportExport::get_export_platform);
+ ClassDB::bind_method(_MD("get_export_platforms"),&EditorImportExport::_get_export_platforms);
+
+ ClassDB::bind_method(_MD("set_export_filter","filter"),&EditorImportExport::set_export_filter);
+ ClassDB::bind_method(_MD("get_export_filter"),&EditorImportExport::get_export_filter);
+
+ ClassDB::bind_method(_MD("set_export_custom_filter","filter"),&EditorImportExport::set_export_custom_filter);
+ ClassDB::bind_method(_MD("get_export_custom_filter"),&EditorImportExport::get_export_custom_filter);
+
+ ClassDB::bind_method(_MD("set_export_custom_filter_exclude","filter_exclude"),&EditorImportExport::set_export_custom_filter_exclude);
+ ClassDB::bind_method(_MD("get_export_custom_filter_exclude"),&EditorImportExport::get_export_custom_filter_exclude);
+
+
+ ClassDB::bind_method(_MD("image_export_group_create"),&EditorImportExport::image_export_group_create);
+ ClassDB::bind_method(_MD("image_export_group_remove"),&EditorImportExport::image_export_group_remove);
+ ClassDB::bind_method(_MD("image_export_group_set_image_action"),&EditorImportExport::image_export_group_set_image_action);
+ ClassDB::bind_method(_MD("image_export_group_set_make_atlas"),&EditorImportExport::image_export_group_set_make_atlas);
+ ClassDB::bind_method(_MD("image_export_group_set_shrink"),&EditorImportExport::image_export_group_set_shrink);
+ ClassDB::bind_method(_MD("image_export_group_get_image_action"),&EditorImportExport::image_export_group_get_image_action);
+ ClassDB::bind_method(_MD("image_export_group_get_make_atlas"),&EditorImportExport::image_export_group_get_make_atlas);
+ ClassDB::bind_method(_MD("image_export_group_get_shrink"),&EditorImportExport::image_export_group_get_shrink);
+ ClassDB::bind_method(_MD("image_add_to_export_group"),&EditorImportExport::image_add_to_export_group);
+ ClassDB::bind_method(_MD("script_set_action"),&EditorImportExport::script_set_action);
+ ClassDB::bind_method(_MD("script_set_encryption_key"),&EditorImportExport::script_set_encryption_key);
+ ClassDB::bind_method(_MD("script_get_action"),&EditorImportExport::script_get_action);
+ ClassDB::bind_method(_MD("script_get_encryption_key"),&EditorImportExport::script_get_encryption_key);
diff --git a/tools/editor/editor_import_export.h b/tools/editor/editor_import_export.h
index e21fd8c8f8..fb75373f17 100644
--- a/tools/editor/editor_import_export.h
+++ b/tools/editor/editor_import_export.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,7 +40,7 @@ struct EditorProgress;
class EditorImportPlugin : public Reference {
- OBJ_TYPE( EditorImportPlugin, Reference);
+ GDCLASS( EditorImportPlugin, Reference);
protected:
@@ -70,7 +70,7 @@ public:
class EditorExportPlugin : public Reference {
- OBJ_TYPE( EditorExportPlugin, Reference);
+ GDCLASS( EditorExportPlugin, Reference);
protected:
static void _bind_methods();
@@ -84,7 +84,7 @@ public:
class EditorExportPlatform : public Reference {
- OBJ_TYPE( EditorExportPlatform,Reference );
+ GDCLASS( EditorExportPlatform,Reference );
public:
@@ -187,7 +187,7 @@ public:
class EditorExportPlatformPC : public EditorExportPlatform {
- OBJ_TYPE( EditorExportPlatformPC,EditorExportPlatform );
+ GDCLASS( EditorExportPlatformPC,EditorExportPlatform );
public:
@@ -247,7 +247,7 @@ public:
class EditorImportExport : public Node {
- OBJ_TYPE(EditorImportExport,Node);
+ GDCLASS(EditorImportExport,Node);
public:
enum FileAction {
@@ -321,8 +321,8 @@ protected:
static EditorImportExport* singleton;
- DVector<String> _get_export_file_list();
- DVector<String> _get_export_platforms();
+ PoolVector<String> _get_export_file_list();
+ PoolVector<String> _get_export_platforms();
static void _bind_methods();
public:
diff --git a/tools/editor/editor_initialize_ssl.cpp b/tools/editor/editor_initialize_ssl.cpp
index c0b55b302f..9ac4f90e9f 100644
--- a/tools/editor/editor_initialize_ssl.cpp
+++ b/tools/editor/editor_initialize_ssl.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -34,11 +34,12 @@
void editor_initialize_certificates() {
- ByteArray data;
- data.resize(_certs_uncompressed_size);
+ PoolByteArray data;
+ data.resize(_certs_uncompressed_size+1);
{
- ByteArray::Write w = data.write();
+ PoolByteArray::Write w = data.write();
Compression::decompress(w.ptr(),_certs_uncompressed_size,_certs_compressed,_certs_compressed_size,Compression::MODE_DEFLATE);
+ w[_certs_uncompressed_size]=0; //make sure it ends at zero
}
StreamPeerSSL::load_certs_from_memory(data);
diff --git a/tools/editor/editor_initialize_ssl.h b/tools/editor/editor_initialize_ssl.h
index 082d546832..0b34ac1d7e 100644
--- a/tools/editor/editor_initialize_ssl.h
+++ b/tools/editor/editor_initialize_ssl.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/editor_log.cpp b/tools/editor/editor_log.cpp
index 20613467d3..fd2da2e4c0 100644
--- a/tools/editor/editor_log.cpp
+++ b/tools/editor/editor_log.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -44,8 +44,10 @@ void EditorLog::_error_handler(void *p_self, const char*p_func, const char*p_fil
err_str=String(p_file)+":"+itos(p_line)+" - "+String(p_error);
}
-// if (!self->is_visible())
-// self->emit_signal("show_request");
+ /*
+ if (!self->is_visible_in_tree())
+ self->emit_signal("show_request");
+ */
err_str=" "+err_str;
self->log->add_newline();
@@ -67,6 +69,10 @@ void EditorLog::_error_handler(void *p_self, const char*p_func, const char*p_fil
icon = self->get_icon("ScriptError","EditorIcons");
} break;
+ case ERR_HANDLER_SHADER: {
+
+ icon = self->get_icon("Shader","EditorIcons");
+ } break;
}
@@ -125,7 +131,7 @@ void EditorLog::add_message(const String& p_msg,bool p_error) {
log->add_newline();
log->add_text(p_msg);
-// button->set_text(p_msg);
+ //button->set_text(p_msg);
if (p_error)
log->pop();
@@ -160,9 +166,9 @@ void EditorLog::_undo_redo_cbk(void *p_self,const String& p_name) {
void EditorLog::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_clear_request"),&EditorLog::_clear_request );
-
- //ObjectTypeDB::bind_method(_MD("_dragged"),&EditorLog::_dragged );
+ ClassDB::bind_method(_MD("_clear_request"),&EditorLog::_clear_request );
+ ClassDB::bind_method("_override_logger_styles",&EditorLog::_override_logger_styles );
+ //ClassDB::bind_method(_MD("_dragged"),&EditorLog::_dragged );
ADD_SIGNAL( MethodInfo("clear_request"));
}
@@ -193,18 +199,17 @@ EditorLog::EditorLog() {
ec->set_custom_minimum_size(Size2(0,180));
ec->set_v_size_flags(SIZE_EXPAND_FILL);
-
- PanelContainer *pc = memnew( PanelContainer );
- pc->add_style_override("panel",get_stylebox("normal","TextEdit"));
+ pc = memnew( PanelContainer );
ec->add_child(pc);
pc->set_area_as_parent_rect();
+ pc->connect("tree_entered", this, "_override_logger_styles");
log = memnew( RichTextLabel );
log->set_scroll_follow(true);
log->set_selection_enabled(true);
log->set_focus_mode(FOCUS_CLICK);
pc->add_child(log);
- add_message(VERSION_FULL_NAME" (c) 2008-2016 Juan Linietsky, Ariel Manzur.");
+ add_message(VERSION_FULL_NAME" (c) 2008-2017 Juan Linietsky, Ariel Manzur.");
//log->add_text("Initialization Complete.\n"); //because it looks cool.
eh.errfunc=_error_handler;
@@ -224,6 +229,11 @@ void EditorLog::deinit() {
}
+void EditorLog::_override_logger_styles() {
+
+ pc->add_style_override("panel",get_stylebox("normal","TextEdit"));
+
+}
EditorLog::~EditorLog() {
diff --git a/tools/editor/editor_log.h b/tools/editor/editor_log.h
index 699be710d8..965d8d6420 100644
--- a/tools/editor/editor_log.h
+++ b/tools/editor/editor_log.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -36,20 +36,21 @@
//#include "scene/gui/empty_control.h"
#include "scene/gui/box_container.h"
#include "scene/gui/panel_container.h"
-#include "scene/gui/texture_frame.h"
+#include "scene/gui/texture_rect.h"
#include "scene/gui/tool_button.h"
#include "pane_drag.h"
#include "os/thread.h"
class EditorLog : public VBoxContainer {
- OBJ_TYPE( EditorLog, VBoxContainer );
+ GDCLASS( EditorLog, VBoxContainer );
Button *clearbutton;
Label *title;
RichTextLabel *log;
HBoxContainer *title_hb;
-// PaneDrag *pd;
+ //PaneDrag *pd;
Control *ec;
+ PanelContainer *pc;
static void _error_handler(void *p_self, const char*p_func, const char*p_file,int p_line, const char*p_error,const char*p_errorexp,ErrorHandlerType p_type);
@@ -57,13 +58,14 @@ class EditorLog : public VBoxContainer {
Thread::ID current;
-// void _dragged(const Point2& p_ofs);
+ //void _dragged(const Point2& p_ofs);
void _clear_request();
static void _undo_redo_cbk(void *p_self,const String& p_name);
protected:
static void _bind_methods();
void _notification(int p_what);
+ void _override_logger_styles();
public:
void add_message(const String& p_msg, bool p_error=false);
diff --git a/tools/editor/editor_name_dialog.cpp b/tools/editor/editor_name_dialog.cpp
index c221b908e0..e7dcea4d40 100644
--- a/tools/editor/editor_name_dialog.cpp
+++ b/tools/editor/editor_name_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -31,7 +31,7 @@
#include "object_type_db.h"
#include "os/keyboard.h"
-void EditorNameDialog::_line_input_event(const InputEvent& p_event) {
+void EditorNameDialog::_line_gui_input(const InputEvent& p_event) {
if (p_event.type == InputEvent::KEY) {
@@ -72,7 +72,7 @@ void EditorNameDialog::ok_pressed() {
void EditorNameDialog::_bind_methods() {
- ObjectTypeDB::bind_method("_line_input_event",&EditorNameDialog::_line_input_event);
+ ClassDB::bind_method("_line_gui_input",&EditorNameDialog::_line_gui_input);
ADD_SIGNAL(MethodInfo("name_confirmed",PropertyInfo( Variant::STRING,"name")));
}
@@ -85,5 +85,5 @@ EditorNameDialog::EditorNameDialog()
name->set_margin(MARGIN_TOP,5);
name->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_BEGIN,5);
name->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,5);
- name->connect("input_event", this, "_line_input_event");
+ name->connect("gui_input", this, "_line_gui_input");
}
diff --git a/tools/editor/editor_name_dialog.h b/tools/editor/editor_name_dialog.h
index 9e66908899..d6bc7eca94 100644
--- a/tools/editor/editor_name_dialog.h
+++ b/tools/editor/editor_name_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -35,11 +35,11 @@
class EditorNameDialog : public ConfirmationDialog {
- OBJ_TYPE( EditorNameDialog, ConfirmationDialog );
+ GDCLASS( EditorNameDialog, ConfirmationDialog );
LineEdit *name;
- void _line_input_event(const InputEvent& p_event);
+ void _line_gui_input(const InputEvent& p_event);
protected:
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index fe97fe2881..bb33f19a2b 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -99,8 +99,10 @@
#include "plugins/light_occluder_2d_editor_plugin.h"
#include "plugins/color_ramp_editor_plugin.h"
#include "plugins/collision_shape_2d_editor_plugin.h"
+#include "plugins/gi_probe_editor_plugin.h"
#include "main/input_default.h"
// end
+#include "tools/editor/editor_settings.h"
#include "tools/editor/io_plugins/editor_texture_import_plugin.h"
#include "tools/editor/io_plugins/editor_scene_import_plugin.h"
#include "tools/editor/io_plugins/editor_font_import_plugin.h"
@@ -118,7 +120,7 @@ EditorNode *EditorNode::singleton=NULL;
void EditorNode::_update_scene_tabs() {
- bool show_rb = EditorSettings::get_singleton()->get("global/show_script_in_scene_tabs");
+ bool show_rb = EditorSettings::get_singleton()->get("interface/show_script_in_scene_tabs");
scene_tabs->clear_tabs();
Ref<Texture> script_icon = gui_base->get_icon("Script","EditorIcons");
@@ -155,7 +157,7 @@ void EditorNode::_update_scene_tabs() {
void EditorNode::_update_title() {
- String appname = Globals::get_singleton()->get("application/name");
+ String appname = GlobalConfig::get_singleton()->get("application/name");
String title = appname.empty()?String(VERSION_FULL_NAME):String(_MKSTR(VERSION_NAME) + String(" - ") + appname);
String edited = editor_data.get_edited_scene_root()?editor_data.get_edited_scene_root()->get_filename():String();
if (!edited.empty())
@@ -239,7 +241,7 @@ void EditorNode::_notification(int p_what) {
}
#endif
- if (opening_prev && confirmation->is_hidden())
+ if (opening_prev && !confirmation->is_visible())
opening_prev=false;
if (unsaved_cache != (saved_version!=editor_data.get_undo_redo().get_version())) {
@@ -256,7 +258,7 @@ void EditorNode::_notification(int p_what) {
//get_root_node()->set_rect(viewport->get_global_rect());
//update the circle
- uint64_t frame = OS::get_singleton()->get_frames_drawn();
+ uint64_t frame = Engine::get_singleton()->get_frames_drawn();
uint32_t tick = OS::get_singleton()->get_ticks_msec();
if (frame!=circle_step_frame && (tick-circle_step_msec)>(1000/8)) {
@@ -266,14 +268,14 @@ void EditorNode::_notification(int p_what) {
circle_step=0;
circle_step_msec=tick;
- circle_step_frame=frame+1;
-
- update_menu->set_icon(gui_base->get_icon("Progress"+itos(circle_step+1),"EditorIcons"));
+ circle_step_frame=frame+1;
+ // update the circle itself only when its enabled
+ if (!update_menu->get_popup()->is_item_checked(3)){
+ update_menu->set_icon(gui_base->get_icon("Progress"+itos(circle_step+1),"EditorIcons"));
+ }
}
- scene_root->set_size_override(true,Size2(Globals::get_singleton()->get("display/width"),Globals::get_singleton()->get("display/height")));
-
editor_selection->update();
{
@@ -283,16 +285,16 @@ void EditorNode::_notification(int p_what) {
if (peak<-80)
peak=-80;
- float vu = audio_vu->get_val();
+ float vu = audio_vu->get_value();
if (peak > vu) {
- audio_vu->set_val(peak);
+ audio_vu->set_value(peak);
} else {
float new_vu = vu - get_process_delta_time()*70.0;
if (new_vu<-80)
new_vu=-80;
if (new_vu !=-80 && vu !=-80)
- audio_vu->set_val(new_vu);
+ audio_vu->set_value(new_vu);
}
}
@@ -300,7 +302,7 @@ void EditorNode::_notification(int p_what) {
}
if (p_what==NOTIFICATION_ENTER_TREE) {
-
+ get_tree()->get_root()->set_disable_3d(true);
//MessageQueue::get_singleton()->push_call(this,"_get_scene_metadata");
get_tree()->set_editor_hint(true);
get_tree()->get_root()->set_as_audio_listener(false);
@@ -320,8 +322,8 @@ void EditorNode::_notification(int p_what) {
}
if (p_what==NOTIFICATION_READY) {
- VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport(),true);
- VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport(),true);
+ VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(),true);
+ VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(),true);
VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(),true);
_editor_select(EDITOR_3D);
@@ -389,7 +391,7 @@ void EditorNode::_notification(int p_what) {
}
*/
- if (bool(EDITOR_DEF("resources/auto_reload_modified_images",true))) {
+ if (bool(EDITOR_DEF("filesystem/resources/auto_reload_modified_images",true))) {
_menu_option_confirm(DEPENDENCY_LOAD_CHANGED_IMAGES,true);
}
@@ -405,7 +407,7 @@ void EditorNode::_notification(int p_what) {
};
if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
- scene_tabs->set_tab_close_display_policy( (bool(EDITOR_DEF("global/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY) );
+ scene_tabs->set_tab_close_display_policy( (bool(EDITOR_DEF("interface/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY) );
}
}
@@ -432,7 +434,7 @@ void EditorNode::_fs_changed() {
void EditorNode::_sources_changed(bool p_exist) {
- if (p_exist && bool(EditorSettings::get_singleton()->get("import/automatic_reimport_on_sources_changed"))) {
+ if (p_exist && bool(EditorSettings::get_singleton()->get("filesystem/import/automatic_reimport_on_sources_changed"))) {
p_exist=false;
List<String> changed_sources;
@@ -553,12 +555,14 @@ void EditorNode::save_resource_in_path(const Ref<Resource>& p_resource,const Str
editor_data.apply_changes_in_editors();
int flg=0;
- if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources"))
+ if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources"))
flg|=ResourceSaver::FLAG_COMPRESS;
- //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative"))
- // flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
+ /*
+ if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative"))
+ flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
+ */
- String path = Globals::get_singleton()->localize_path(p_path);
+ String path = GlobalConfig::get_singleton()->localize_path(p_path);
Error err = ResourceSaver::save(path,p_resource,flg|ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS);
if (err!=OK) {
@@ -566,7 +570,7 @@ void EditorNode::save_resource_in_path(const Ref<Resource>& p_resource,const Str
accept->popup_centered_minsize();
return;
}
-// EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type());
+ //EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type());
((Resource*)p_resource.ptr())->set_path(path);
emit_signal("resource_saved",p_resource);
@@ -595,7 +599,7 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String&
List<String> preferred;
for(int i=0;i<extensions.size();i++) {
- if (p_resource->is_type("Script") && (extensions[i]=="tres" || extensions[i]=="res" || extensions[i]=="xml")) {
+ if (p_resource->is_class("Script") && (extensions[i]=="tres" || extensions[i]=="res" || extensions[i]=="xml")) {
//this serves no purpose and confused people
continue;
}
@@ -612,7 +616,7 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String&
file->set_current_file(p_resource->get_path().get_file());
} else {
if (extensions.size()) {
- file->set_current_file("new_"+p_resource->get_type().to_lower()+"."+preferred.front()->get().to_lower());
+ file->set_current_file("new_"+p_resource->get_class().to_lower()+"."+preferred.front()->get().to_lower());
} else {
file->set_current_file(String());
}
@@ -621,7 +625,7 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String&
file->set_current_path(p_resource->get_path());
if (extensions.size()) {
- String ext=p_resource->get_path().extension().to_lower();
+ String ext=p_resource->get_path().get_extension().to_lower();
if (extensions.find(ext)==NULL) {
file->set_current_path(p_resource->get_path().replacen("."+ext,"."+extensions.front()->get()));
}
@@ -630,7 +634,7 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String&
String existing;
if (extensions.size()) {
- existing="new_"+p_resource->get_type().to_lower()+"."+preferred.front()->get().to_lower();
+ existing="new_"+p_resource->get_class().to_lower()+"."+preferred.front()->get().to_lower();
}
file->set_current_path(existing);
@@ -664,11 +668,11 @@ void EditorNode::_dialog_display_file_error(String p_file,Error p_error) {
case ERR_FILE_CANT_WRITE: {
- accept->set_text(TTR("Can't open file for writing:")+" "+p_file.extension());
+ accept->set_text(TTR("Can't open file for writing:")+" "+p_file.get_extension());
} break;
case ERR_FILE_UNRECOGNIZED: {
- accept->set_text(TTR("Requested file format unknown:")+" "+p_file.extension());
+ accept->set_text(TTR("Requested file format unknown:")+" "+p_file.get_extension());
} break;
default: {
@@ -768,7 +772,7 @@ bool EditorNode::_find_and_save_resource(RES res,Map<RES,bool>& processed,int32_
bool subchanged = _find_and_save_edited_subresources(res.ptr(),processed,flags);
-// print_line("checking if edited: "+res->get_type()+" :: "+res->get_name()+" :: "+res->get_path()+" :: "+itos(changed)+" :: SR "+itos(subchanged));
+ //print_line("checking if edited: "+res->get_type()+" :: "+res->get_name()+" :: "+res->get_path()+" :: "+itos(changed)+" :: SR "+itos(subchanged));
if (res->get_path().is_resource_file()) {
if (changed || subchanged) {
@@ -862,12 +866,12 @@ void EditorNode::_save_edited_subresources(Node* scene,Map<RES,bool>& processed,
void EditorNode::_find_node_types(Node* p_node, int&count_2d, int&count_3d) {
- if (p_node->is_type("Viewport") || (p_node!=editor_data.get_edited_scene_root() && p_node->get_owner()!=editor_data.get_edited_scene_root()))
+ if (p_node->is_class("Viewport") || (p_node!=editor_data.get_edited_scene_root() && p_node->get_owner()!=editor_data.get_edited_scene_root()))
return;
- if (p_node->is_type("CanvasItem"))
+ if (p_node->is_class("CanvasItem"))
count_2d++;
- else if (p_node->is_type("Spatial"))
+ else if (p_node->is_class("Spatial"))
count_3d++;
for(int i=0;i<p_node->get_child_count();i++)
@@ -888,10 +892,10 @@ void EditorNode::_save_scene_with_preview(String p_file) {
RID viewport;
bool is2d;
if (c3d<c2d) {
- viewport=scene_root->get_viewport();
+ viewport=scene_root->get_viewport_rid();
is2d=true;
} else {
- viewport=SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_viewport();
+ viewport=SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_viewport_rid();
is2d=false;
}
@@ -907,11 +911,12 @@ void EditorNode::_save_scene_with_preview(String p_file) {
_editor_select(is2d?EDITOR_2D:EDITOR_3D);
- VS::get_singleton()->viewport_queue_screen_capture(viewport);
+
save.step(TTR("Creating Thumbnail"),2);
save.step(TTR("Creating Thumbnail"),3);
- Image img = VS::get_singleton()->viewport_get_screen_capture(viewport);
- int preview_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");;
+#if 0
+ Image img = VS::get_singleton()->viewport_texture(scree_capture(viewport);
+ int preview_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");;
preview_size*=EDSCALE;
int width,height;
if (img.get_width() > preview_size && img.get_width() >= img.get_height()) {
@@ -928,7 +933,7 @@ void EditorNode::_save_scene_with_preview(String p_file) {
height=img.get_height();
}
- img.convert(Image::FORMAT_RGB);
+ img.convert(Image::FORMAT_RGB8);
img.resize(width,height);
String pfile = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/last_scene_preview.png");
@@ -940,7 +945,7 @@ void EditorNode::_save_scene_with_preview(String p_file) {
if (editor_data.get_edited_scene_import_metadata().is_null())
editor_data.set_edited_scene_import_metadata(Ref<ResourceImportMetadata>( memnew( ResourceImportMetadata ) ) );
editor_data.get_edited_scene_import_metadata()->set_option("thumbnail",imgdata);
-
+#endif
//tamanio tel thumbnail
if (screen!=-1) {
_editor_select(screen);
@@ -1000,10 +1005,12 @@ void EditorNode::_save_scene(String p_file, int idx) {
sdata->set_import_metadata(editor_data.get_edited_scene_import_metadata(idx));
int flg=0;
- if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources"))
+ if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources"))
flg|=ResourceSaver::FLAG_COMPRESS;
- //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative"))
- // flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
+ /*
+ if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative"))
+ flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
+ */
flg|=ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS;
@@ -1012,7 +1019,7 @@ void EditorNode::_save_scene(String p_file, int idx) {
_save_edited_subresources(scene,processed,flg);
editor_data.save_editor_external_data();
if (err==OK) {
- scene->set_filename( Globals::get_singleton()->localize_path(p_file) );
+ scene->set_filename( GlobalConfig::get_singleton()->localize_path(p_file) );
//EditorFileSystem::get_singleton()->update_file(p_file,sdata->get_type());
if (idx < 0 || idx == editor_data.get_edited_scene())
set_current_version(editor_data.get_undo_redo().get_version());
@@ -1056,7 +1063,7 @@ void EditorNode::_import_action(const String& p_action) {
EditorImport::generate_version_hashes(src);
- Node *dst = SceneLoader::load(editor_data.get_imported_scene(Globals::get_singleton()->localize_path(_tmp_import_path)));
+ Node *dst = SceneLoader::load(editor_data.get_imported_scene(GlobalConfig::get_singleton()->localize_path(_tmp_import_path)));
if (!dst) {
@@ -1164,9 +1171,8 @@ void EditorNode::_dialog_action(String p_file) {
} break;
case SETTINGS_PICK_MAIN_SCENE: {
- Globals::get_singleton()->set("application/main_scene",p_file);
- Globals::get_singleton()->set_persisting("application/main_scene",true);
- Globals::get_singleton()->save();
+ GlobalConfig::get_singleton()->set("application/main_scene",p_file);
+ GlobalConfig::get_singleton()->save();
//would be nice to show the project manager opened with the hilighted field..
} break;
case FILE_SAVE_OPTIMIZED: {
@@ -1243,7 +1249,7 @@ void EditorNode::_dialog_action(String p_file) {
ml = Ref<MeshLibrary>( memnew( MeshLibrary ));
}
- MeshLibraryEditor::update_library_file(editor_data.get_edited_scene_root(),ml,true);
+ //MeshLibraryEditor::update_library_file(editor_data.get_edited_scene_root(),ml,true);
Error err = ResourceSaver::save(p_file,ml);
if (err) {
@@ -1342,9 +1348,11 @@ void EditorNode::_dialog_action(String p_file) {
unzCloseCurrentFile(pkg);
print_line(fname);
- //for(int i=0;i<512;i++) {
- // print_line(itos(data[i]));
- //}
+ /*
+ for(int i=0;i<512;i++) {
+ print_line(itos(data[i]));
+ }
+ */
file=file.get_file();
@@ -1508,8 +1516,8 @@ void EditorNode::_prepare_history() {
already.insert(id);
Ref<Texture> icon = gui_base->get_icon("Object","EditorIcons");
- if (gui_base->has_icon(obj->get_type(),"EditorIcons"))
- icon=gui_base->get_icon(obj->get_type(),"EditorIcons");
+ if (gui_base->has_icon(obj->get_class(),"EditorIcons"))
+ icon=gui_base->get_icon(obj->get_class(),"EditorIcons");
else
icon=base_icon;
@@ -1521,12 +1529,12 @@ void EditorNode::_prepare_history() {
else if (r->get_name()!=String()) {
text=r->get_name();
} else {
- text=r->get_type();
+ text=r->get_class();
}
} else if (obj->cast_to<Node>()) {
text=obj->cast_to<Node>()->get_name();
} else {
- text=obj->get_type();
+ text=obj->get_class();
}
if (i==editor_history.get_history_pos()) {
@@ -1614,8 +1622,8 @@ void EditorNode::_edit_current() {
object_menu->set_disabled(true);
- bool is_resource = current_obj->is_type("Resource");
- bool is_node = current_obj->is_type("Node");
+ bool is_resource = current_obj->is_class("Resource");
+ bool is_node = current_obj->is_class("Node");
resource_save_button->set_disabled(!is_resource);
if (is_resource) {
@@ -1664,12 +1672,15 @@ void EditorNode::_edit_current() {
if (main_plugin) {
- if (main_plugin!=editor_plugin_screen && (!ScriptEditor::get_singleton() || !ScriptEditor::get_singleton()->is_visible() || ScriptEditor::get_singleton()->can_take_away_focus())) {
+ // special case if use of external editor is true
+ if (main_plugin->get_name() == "Script" && bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))){
+ main_plugin->edit(current_obj);
+ }
+ else if (main_plugin!=editor_plugin_screen && (!ScriptEditor::get_singleton() || !ScriptEditor::get_singleton()->is_visible_in_tree() || ScriptEditor::get_singleton()->can_take_away_focus())) {
// update screen main_plugin
if (!changing_scene) {
-
if (editor_plugin_screen)
editor_plugin_screen->make_visible(false);
editor_plugin_screen=main_plugin;
@@ -1842,7 +1853,6 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
run_filename=scene->get_filename();
} else {
- args=run_settings_dialog->get_custom_arguments();
current_filename=scene->get_filename();
}
@@ -1887,7 +1897,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
}
- if (bool(EDITOR_DEF("run/auto_save_before_running",true))) {
+ if (bool(EDITOR_DEF("run/auto_save/save_before_running",true))) {
if (unsaved_cache) {
@@ -1917,9 +1927,14 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
log->clear();
}
+ if (bool(EDITOR_DEF("run/always_open_output_on_play", true))) {
+ make_bottom_panel_item_visible(log);
+ }
List<String> breakpoints;
editor_data.get_editor_breakpoints(&breakpoints);
+
+ args = GlobalConfig::get_singleton()->get("editor/main_run_args");
Error error = editor_run.run(run_filename,args,breakpoints,current_filename);
@@ -2145,7 +2160,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
if (scene->get_filename()!="") {
file->set_current_path(scene->get_filename());
if (extensions.size()) {
- String ext=scene->get_filename().extension().to_lower();
+ String ext=scene->get_filename().get_extension().to_lower();
if (extensions.find(ext)==NULL) {
file->set_current_path(scene->get_filename().replacen("."+ext,"."+extensions.front()->get()));
}
@@ -2208,8 +2223,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
if (scene->get_filename()!="") {
cpath = scene->get_filename();
- String fn = cpath.substr(0,cpath.length() - cpath.extension().size());
- String ext=cpath.extension();
+ String fn = cpath.substr(0,cpath.length() - cpath.get_extension().size());
+ String ext=cpath.get_extension();
cpath=fn+".pot";
@@ -2488,7 +2503,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
}
instanced_scene->generate_instance_state();
- instanced_scene->set_filename( Globals::get_singleton()->localize_path(external_file) );
+ instanced_scene->set_filename( GlobalConfig::get_singleton()->localize_path(external_file) );
editor_data.get_undo_redo().create_action("Instance Scene");
editor_data.get_undo_redo().add_do_method(parent,"add_child",instanced_scene);
@@ -2497,8 +2512,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
editor_data.get_undo_redo().add_undo_method(parent,"remove_child",instanced_scene);
editor_data.get_undo_redo().commit_action();
-// parent->add_child(instanced_scene);
-// instanced_scene->set_owner(edited_scene);
+ //parent->add_child(instanced_scene);
+ //instanced_scene->set_owner(edited_scene);
_last_instanced_scene=instanced_scene;
} break;
@@ -2571,7 +2586,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
if (current) {
_editor_select(EDITOR_SCRIPT);
- emit_signal("request_help",current->get_type());
+ emit_signal("request_help",current->get_class());
}
@@ -2629,12 +2644,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
_set_editing_top_editors(current);
} break;
- case OBJECT_CALL_METHOD: {
-
- editor_data.apply_changes_in_editors();;
- call_dialog->set_object(current);
- call_dialog->popup_centered_ratio();
- } break;
case RUN_PLAY: {
_menu_option_confirm(RUN_STOP,true);
_call_build();
@@ -2678,8 +2687,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
} break;
case RUN_PLAY_NATIVE: {
-
- bool autosave = EDITOR_DEF("run/auto_save_before_running",true);
+
+ bool autosave = EDITOR_DEF("run/auto_save/save_before_running",true);
if (autosave) {
_menu_option_confirm(FILE_SAVE_ALL_SCENES, false);
}
@@ -2797,6 +2806,10 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
update_menu->get_popup()->set_item_checked(1,true);
OS::get_singleton()->set_low_processor_usage_mode(true);
} break;
+ case SETTINGS_UPDATE_SPINNER_HIDE: {
+ update_menu->set_icon(gui_base->get_icon("Collapse","EditorIcons"));
+ update_menu->get_popup()->toggle_item_checked(3);
+ } break;
case SETTINGS_PREFERENCES: {
settings_config_dialog->popup_edit_settings();
@@ -3068,11 +3081,9 @@ void EditorNode::_update_addon_config() {
}
if (enabled_addons.size()==0) {
- Globals::get_singleton()->set("editor_plugins/enabled",Variant());
- Globals::get_singleton()->set_persisting("editor_plugins/enabled",false);
+ GlobalConfig::get_singleton()->set("editor_plugins/enabled",Variant());
} else {
- Globals::get_singleton()->set("editor_plugins/enabled",enabled_addons);
- Globals::get_singleton()->set_persisting("editor_plugins/enabled",true);
+ GlobalConfig::get_singleton()->set("editor_plugins/enabled",enabled_addons);
}
project_settings->queue_save();
@@ -3171,15 +3182,17 @@ void EditorNode::_remove_edited_scene() {
_update_title();
_update_scene_tabs();
-// if (editor_data.get_edited_scene_count()==1) {
-// //make new scene appear saved
-// set_current_version(editor_data.get_undo_redo().get_version());
-// unsaved_cache=false;
-// }
+ /*
+ if (editor_data.get_edited_scene_count()==1) {
+ //make new scene appear saved
+ set_current_version(editor_data.get_undo_redo().get_version());
+ unsaved_cache=false;
+ }
+ */
}
void EditorNode::_remove_scene(int index) {
-// printf("Attempting to remove scene %d (current is %d)\n", index, editor_data.get_edited_scene());
+ //printf("Attempting to remove scene %d (current is %d)\n", index, editor_data.get_edited_scene());
if (editor_data.get_edited_scene() == index) {
//Scene to remove is current scene
@@ -3265,7 +3278,7 @@ Error EditorNode::save_translatable_strings(const String& p_to_file) {
OS::Time time = OS::get_singleton()->get_time();
f->store_line("# Translation Strings Dump.");
f->store_line("# Created By.");
- f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2016 Juan Linietsky, Ariel Manzur.");
+ f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2017 Juan Linietsky, Ariel Manzur.");
f->store_line("# From Scene: ");
f->store_line("# \t"+get_edited_scene()->get_filename());
f->store_line("");
@@ -3273,8 +3286,8 @@ Error EditorNode::save_translatable_strings(const String& p_to_file) {
f->store_line("msgstr \"\"");
f->store_line("\"Report-Msgid-Bugs-To: <define>\\n\"");
f->store_line("\"POT-Creation-Date: "+itos(date.year)+"-"+itos(date.month)+"-"+itos(date.day)+" "+itos(time.hour)+":"+itos(time.min)+"0000\\n\"");
-// f->store_line("\"PO-Revision-Date: 2006-08-30 13:56-0700\\n\"");
-// f->store_line("\"Last-Translator: Rubén C. Díaz Alonso <outime@gmail.com>\\n\"");
+ //f->store_line("\"PO-Revision-Date: 2006-08-30 13:56-0700\\n\"");
+ //f->store_line("\"Last-Translator: Rubén C. Díaz Alonso <outime@gmail.com>\\n\"");
f->store_line("\"Language-Team: <define>\\n\"");
f->store_line("\"MIME-Version: 1.0\\n\"");
f->store_line("\"Content-Type: text/plain; charset=UTF-8\\n\"");
@@ -3337,7 +3350,7 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres
}
- String src_scene=Globals::get_singleton()->localize_path(get_edited_scene()->get_filename());
+ String src_scene=GlobalConfig::get_singleton()->localize_path(get_edited_scene()->get_filename());
String path=p_scene;
@@ -3348,13 +3361,13 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres
print_line("rel path!?");
path=src_scene.get_base_dir()+"/"+path;
}
- path = Globals::get_singleton()->localize_path(path);
+ path = GlobalConfig::get_singleton()->localize_path(path);
print_line("path: "+path);
String preset = "optimizer_presets/"+p_preset;
- if (!Globals::get_singleton()->has(preset)) {
+ if (!GlobalConfig::get_singleton()->has(preset)) {
//accept->"()->hide();
accept->get_ok()->set_text("I see..");
@@ -3365,7 +3378,7 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres
}
- Dictionary d = Globals::get_singleton()->get(preset);
+ Dictionary d = GlobalConfig::get_singleton()->get(preset);
ERR_FAIL_COND_V(!d.has("__type__"),ERR_INVALID_DATA);
String type=d["__type__"];
@@ -3395,8 +3408,10 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres
uint32_t flags=0;
-// if (saver->is_bundle_scenes_enabled())
-// flags|=ResourceSaver::FLAG_BUNDLE_INSTANCED_SCENES;
+ /*
+ if (saver->is_bundle_scenes_enabled())
+ flags|=ResourceSaver::FLAG_BUNDLE_INSTANCED_SCENES;
+ */
if (saver->is_bundle_resources_enabled())
flags|=ResourceSaver::FLAG_BUNDLE_RESOURCES;
if (saver->is_remove_editor_data_enabled())
@@ -3454,8 +3469,8 @@ Dictionary EditorNode::_get_main_scene_state() {
Dictionary state;
state["main_tab"]=_get_current_main_editor();
- state["scene_tree_offset"]=scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->get_val();
- state["property_edit_offset"]=get_property_editor()->get_scene_tree()->get_vscroll_bar()->get_val();
+ state["scene_tree_offset"]=scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->get_value();
+ state["property_edit_offset"]=get_property_editor()->get_scene_tree()->get_vscroll_bar()->get_value();
state["saved_version"]=saved_version;
state["node_filter"]=scene_tree_dock->get_filter();
//print_line(" getting main tab: "+itos(state["main_tab"]));
@@ -3521,9 +3536,9 @@ void EditorNode::_set_main_scene_state(Dictionary p_state,Node* p_for_scene) {
if (p_state.has("scene_tree_offset"))
- scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->set_val(p_state["scene_tree_offset"]);
+ scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->set_value(p_state["scene_tree_offset"]);
if (p_state.has("property_edit_offset"))
- get_property_editor()->get_scene_tree()->get_vscroll_bar()->set_val(p_state["property_edit_offset"]);
+ get_property_editor()->get_scene_tree()->get_vscroll_bar()->set_value(p_state["property_edit_offset"]);
if (p_state.has("node_filter"))
scene_tree_dock->set_filter(p_state["node_filter"]);
@@ -3651,7 +3666,7 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
if (p_clear_errors)
load_errors->clear();
- String lpath = Globals::get_singleton()->localize_path(p_scene);
+ String lpath = GlobalConfig::get_singleton()->localize_path(p_scene);
if (!lpath.begins_with("res://")) {
@@ -3740,7 +3755,7 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
sdata->set_path(lpath,true); //take over path
}
- Node*new_scene=sdata->instance(true);
+ Node*new_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_MAIN);
if (!new_scene) {
@@ -3779,8 +3794,10 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
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>());
@@ -3796,7 +3813,7 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
*/
editor_data.set_edited_scene_import_metadata( sdata->get_import_metadata() );
-// editor_data.get_undo_redo().clear_history();
+ //editor_data.get_undo_redo().clear_history();
saved_version=editor_data.get_undo_redo().get_version();
_update_title();
_update_scene_tabs();
@@ -3888,17 +3905,17 @@ void EditorNode::update_keying() {
void EditorNode::_close_messages() {
-// left_split->set_dragger_visible(false);
+ //left_split->set_dragger_visible(false);
old_split_ofs = center_split->get_split_offset();
center_split->set_split_offset(0);
-// scene_root_parent->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_END,0);
+ //scene_root_parent->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_END,0);
}
void EditorNode::_show_messages() {
-// left_split->set_dragger_visible(true);
+ //left_split->set_dragger_visible(true);
center_split->set_split_offset(old_split_ofs);
-// scene_root_parent->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_END,log->get_margin(MARGIN_TOP));
+ //scene_root_parent->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_END,log->get_margin(MARGIN_TOP));
}
@@ -3929,7 +3946,7 @@ void EditorNode::animation_editor_make_visible(bool p_visible) {
} else {
//pd_anim->hide();
animation_editor->hide();
-// scene_root_parent->set_margin(MARGIN_TOP,0);
+ //scene_root_parent->set_margin(MARGIN_TOP,0);
if (!animation_vb->get_parent_control())
return;
animation_vb->get_parent_control()->minimum_size_changed();
@@ -3942,7 +3959,7 @@ void EditorNode::animation_editor_make_visible(bool p_visible) {
#endif
void EditorNode::_add_to_recent_scenes(const String& p_scene) {
- String base="_"+Globals::get_singleton()->get_resource_path().replace("\\","::").replace("/","::");
+ String base="_"+GlobalConfig::get_singleton()->get_resource_path().replace("\\","::").replace("/","::");
Vector<String> rc = EDITOR_DEF(base+"/_recent_scenes",Array());
String name = p_scene;
name=name.replace("res://","");
@@ -3960,7 +3977,7 @@ void EditorNode::_add_to_recent_scenes(const String& p_scene) {
void EditorNode::_open_recent_scene(int p_idx) {
- String base="_"+Globals::get_singleton()->get_resource_path().replace("\\","::").replace("/","::");
+ String base="_"+GlobalConfig::get_singleton()->get_resource_path().replace("\\","::").replace("/","::");
Vector<String> rc = EDITOR_DEF(base+"/_recent_scenes",Array());
ERR_FAIL_INDEX(p_idx,rc.size());
@@ -3984,7 +4001,7 @@ void EditorNode::_open_recent_scene(int p_idx) {
void EditorNode::_save_optimized() {
-// save_optimized_copy(optimized_save->get_optimized_scene(),optimized_save->get_preset());
+ //save_optimized_copy(optimized_save->get_optimized_scene(),optimized_save->get_preset());
#if 0
String path = optimized_save->get_optimized_scene();
@@ -4016,13 +4033,13 @@ void EditorNode::_save_optimized() {
}
- project_settings->add_remapped_path(Globals::get_singleton()->localize_path(get_edited_scene()->get_filename()),Globals::get_singleton()->localize_path(path),platform);
+ project_settings->add_remapped_path(GlobalConfig::get_singleton()->localize_path(get_edited_scene()->get_filename()),GlobalConfig::get_singleton()->localize_path(path),platform);
#endif
}
void EditorNode::_update_recent_scenes() {
- String base="_"+Globals::get_singleton()->get_resource_path().replace("\\","::").replace("/","::");
+ String base="_"+GlobalConfig::get_singleton()->get_resource_path().replace("\\","::").replace("/","::");
Vector<String> rc = EDITOR_DEF(base+"/_recent_scenes",Array());
recent_scenes->clear();
for(int i=0;i<rc.size();i++) {
@@ -4136,25 +4153,25 @@ bool EditorNode::is_scene_in_use(const String& p_path) {
void EditorNode::register_editor_types() {
- ObjectTypeDB::register_type<EditorPlugin>();
- ObjectTypeDB::register_type<EditorImportPlugin>();
- ObjectTypeDB::register_type<EditorExportPlugin>();
- ObjectTypeDB::register_type<EditorScenePostImport>();
- ObjectTypeDB::register_type<EditorScript>();
- ObjectTypeDB::register_type<EditorSelection>();
- ObjectTypeDB::register_type<EditorFileDialog>();
- //ObjectTypeDB::register_type<EditorImportExport>();
- ObjectTypeDB::register_type<EditorSettings>();
- ObjectTypeDB::register_type<EditorSpatialGizmo>();
- ObjectTypeDB::register_type<EditorResourcePreview>();
- ObjectTypeDB::register_type<EditorResourcePreviewGenerator>();
- ObjectTypeDB::register_type<EditorFileSystem>();
- ObjectTypeDB::register_type<EditorFileSystemDirectory>();
+ ClassDB::register_class<EditorPlugin>();
+ ClassDB::register_class<EditorImportPlugin>();
+ ClassDB::register_class<EditorExportPlugin>();
+ ClassDB::register_class<EditorScenePostImport>();
+ ClassDB::register_class<EditorScript>();
+ ClassDB::register_class<EditorSelection>();
+ ClassDB::register_class<EditorFileDialog>();
+ //ClassDB::register_type<EditorImportExport>();
+ ClassDB::register_class<EditorSettings>();
+ ClassDB::register_class<EditorSpatialGizmo>();
+ ClassDB::register_class<EditorResourcePreview>();
+ ClassDB::register_class<EditorResourcePreviewGenerator>();
+ ClassDB::register_class<EditorFileSystem>();
+ ClassDB::register_class<EditorFileSystemDirectory>();
- //ObjectTypeDB::register_type<EditorImporter>();
-// ObjectTypeDB::register_type<EditorPostImport>();
+ //ClassDB::register_type<EditorImporter>();
+ //ClassDB::register_type<EditorPostImport>();
}
void EditorNode::unregister_editor_types() {
@@ -4212,7 +4229,7 @@ void EditorNode::progress_end_task_bg(const String& p_task) {
Ref<Texture> EditorNode::_file_dialog_get_icon(const String& p_path) {
- EditorFileSystemDirectory *efsd = EditorFileSystem::get_singleton()->get_path(p_path.get_base_dir());
+ EditorFileSystemDirectory *efsd = EditorFileSystem::get_singleton()->get_filesystem_path(p_path.get_base_dir());
if (efsd) {
String file = p_path.get_file();
@@ -4505,7 +4522,7 @@ void EditorNode::_save_docks_to_config(Ref<ConfigFile> p_layout, const String& p
for(int i=0;i<DOCK_SLOT_MAX/2;i++) {
- if (splits[i]->is_visible()) {
+ if (splits[i]->is_visible_in_tree()) {
p_layout->set_value(p_section,"dock_split_"+itos(i+1),splits[i]->get_split_offset());
}
}
@@ -4604,7 +4621,7 @@ void EditorNode::_update_dock_slots_visibility() {
for(int i=0;i<DOCK_SLOT_MAX;i++) {
- if (!dock_slot[i]->is_hidden() && dock_slot[i]->get_tab_count()) {
+ if (dock_slot[i]->is_visible() && dock_slot[i]->get_tab_count()) {
dock_slot[i]->set_current_tab(0);
}
}
@@ -4712,7 +4729,7 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String&
for(int i=0;i<DOCK_SLOT_MAX;i++) {
- if (!dock_slot[i]->is_hidden() && dock_slot[i]->get_tab_count()) {
+ if (dock_slot[i]->is_visible() && dock_slot[i]->get_tab_count()) {
dock_slot[i]->set_current_tab(0);
}
}
@@ -4950,7 +4967,7 @@ void EditorNode::remove_bottom_panel_item(Control *p_item) {
for(int i=0;i<bottom_panel_items.size();i++) {
if (bottom_panel_items[i].control==p_item) {
- if (p_item->is_visible()) {
+ if (p_item->is_visible_in_tree()) {
_bottom_panel_switch(false,0);
}
bottom_panel_vb->remove_child(bottom_panel_items[i].control);
@@ -4977,7 +4994,7 @@ void EditorNode::_bottom_panel_switch(bool p_enable,int p_idx) {
for(int i=0;i<bottom_panel_items.size();i++) {
bottom_panel_items[i].button->set_pressed(i==p_idx);
- bottom_panel_items[i].control->set_hidden(i!=p_idx);
+ bottom_panel_items[i].control->set_visible(i==p_idx);
}
center_split->set_dragger_visibility(SplitContainer::DRAGGER_VISIBLE);
center_split->set_collapsed(false);
@@ -4985,7 +5002,7 @@ void EditorNode::_bottom_panel_switch(bool p_enable,int p_idx) {
for(int i=0;i<bottom_panel_items.size();i++) {
bottom_panel_items[i].button->set_pressed(false);
- bottom_panel_items[i].control->set_hidden(true);
+ bottom_panel_items[i].control->set_visible(false);
}
center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN);
center_split->set_collapsed(true);
@@ -5052,7 +5069,7 @@ Variant EditorNode::drag_resource(const Ref<Resource>& p_res,Control* p_from) {
Control *drag_control = memnew( Control );
- TextureFrame *drag_preview = memnew( TextureFrame );
+ TextureRect *drag_preview = memnew( TextureRect );
Label* label=memnew( Label );
waiting_for_sources_changed=true; //
@@ -5075,7 +5092,7 @@ Variant EditorNode::drag_resource(const Ref<Resource>& p_res,Control* p_from) {
} else if (p_res->get_name()!="") {
label->set_text(p_res->get_name());
} else {
- label->set_text(p_res->get_type());
+ label->set_text(p_res->get_class());
}
@@ -5274,94 +5291,103 @@ void EditorNode::_call_build() {
void EditorNode::_bind_methods() {
- ObjectTypeDB::bind_method("_menu_option",&EditorNode::_menu_option);
- ObjectTypeDB::bind_method("_menu_confirm_current",&EditorNode::_menu_confirm_current);
- ObjectTypeDB::bind_method("_dialog_action",&EditorNode::_dialog_action);
- ObjectTypeDB::bind_method("_resource_selected",&EditorNode::_resource_selected,DEFVAL(""));
- ObjectTypeDB::bind_method("_property_editor_forward",&EditorNode::_property_editor_forward);
- ObjectTypeDB::bind_method("_property_editor_back",&EditorNode::_property_editor_back);
- ObjectTypeDB::bind_method("_editor_select",&EditorNode::_editor_select);
- ObjectTypeDB::bind_method("_node_renamed",&EditorNode::_node_renamed);
- ObjectTypeDB::bind_method("edit_node",&EditorNode::edit_node);
- ObjectTypeDB::bind_method("_imported",&EditorNode::_imported);
- ObjectTypeDB::bind_method("_unhandled_input",&EditorNode::_unhandled_input);
-
- ObjectTypeDB::bind_method("_get_scene_metadata",&EditorNode::_get_scene_metadata);
- ObjectTypeDB::bind_method("set_edited_scene",&EditorNode::set_edited_scene);
- ObjectTypeDB::bind_method("open_request",&EditorNode::open_request);
- ObjectTypeDB::bind_method("_instance_request",&EditorNode::_instance_request);
- ObjectTypeDB::bind_method("update_keying",&EditorNode::update_keying);
- ObjectTypeDB::bind_method("_property_keyed",&EditorNode::_property_keyed);
- ObjectTypeDB::bind_method("_transform_keyed",&EditorNode::_transform_keyed);
- ObjectTypeDB::bind_method("_close_messages",&EditorNode::_close_messages);
- ObjectTypeDB::bind_method("_show_messages",&EditorNode::_show_messages);
- ObjectTypeDB::bind_method("_vp_resized",&EditorNode::_vp_resized);
- ObjectTypeDB::bind_method("_quick_opened",&EditorNode::_quick_opened);
- ObjectTypeDB::bind_method("_quick_run",&EditorNode::_quick_run);
-
- ObjectTypeDB::bind_method("_resource_created",&EditorNode::_resource_created);
-
- ObjectTypeDB::bind_method("_import_action",&EditorNode::_import_action);
- //ObjectTypeDB::bind_method("_import",&EditorNode::_import);
-// ObjectTypeDB::bind_method("_import_conflicts_solved",&EditorNode::_import_conflicts_solved);
- ObjectTypeDB::bind_method("_open_recent_scene",&EditorNode::_open_recent_scene);
-// ObjectTypeDB::bind_method("_open_recent_scene_confirm",&EditorNode::_open_recent_scene_confirm);
-
- ObjectTypeDB::bind_method("_save_optimized",&EditorNode::_save_optimized);
-
- ObjectTypeDB::bind_method("stop_child_process",&EditorNode::stop_child_process);
-
- ObjectTypeDB::bind_method("_sources_changed",&EditorNode::_sources_changed);
- ObjectTypeDB::bind_method("_fs_changed",&EditorNode::_fs_changed);
- ObjectTypeDB::bind_method("_dock_select_draw",&EditorNode::_dock_select_draw);
- ObjectTypeDB::bind_method("_dock_select_input",&EditorNode::_dock_select_input);
- ObjectTypeDB::bind_method("_dock_pre_popup",&EditorNode::_dock_pre_popup);
- ObjectTypeDB::bind_method("_dock_split_dragged",&EditorNode::_dock_split_dragged);
- ObjectTypeDB::bind_method("_save_docks",&EditorNode::_save_docks);
- ObjectTypeDB::bind_method("_dock_popup_exit",&EditorNode::_dock_popup_exit);
- ObjectTypeDB::bind_method("_dock_move_left",&EditorNode::_dock_move_left);
- ObjectTypeDB::bind_method("_dock_move_right",&EditorNode::_dock_move_right);
-
- ObjectTypeDB::bind_method("_layout_menu_option",&EditorNode::_layout_menu_option);
-
- ObjectTypeDB::bind_method("set_current_scene",&EditorNode::set_current_scene);
- ObjectTypeDB::bind_method("set_current_version",&EditorNode::set_current_version);
- ObjectTypeDB::bind_method("_scene_tab_changed",&EditorNode::_scene_tab_changed);
- ObjectTypeDB::bind_method("_scene_tab_closed",&EditorNode::_scene_tab_closed);
- ObjectTypeDB::bind_method("_scene_tab_script_edited",&EditorNode::_scene_tab_script_edited);
- ObjectTypeDB::bind_method("_set_main_scene_state",&EditorNode::_set_main_scene_state);
- ObjectTypeDB::bind_method("_update_scene_tabs",&EditorNode::_update_scene_tabs);
-
- ObjectTypeDB::bind_method("_prepare_history",&EditorNode::_prepare_history);
- ObjectTypeDB::bind_method("_select_history",&EditorNode::_select_history);
-
- ObjectTypeDB::bind_method("_toggle_search_bar",&EditorNode::_toggle_search_bar);
- ObjectTypeDB::bind_method("_clear_search_box",&EditorNode::_clear_search_box);
- ObjectTypeDB::bind_method("_clear_undo_history",&EditorNode::_clear_undo_history);
- ObjectTypeDB::bind_method("_dropped_files",&EditorNode::_dropped_files);
- ObjectTypeDB::bind_method("_toggle_distraction_free_mode",&EditorNode::_toggle_distraction_free_mode);
-
-
-
- ObjectTypeDB::bind_method(_MD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin);
- ObjectTypeDB::bind_method(_MD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin);
- ObjectTypeDB::bind_method(_MD("get_gui_base"), &EditorNode::get_gui_base);
- ObjectTypeDB::bind_method(_MD("_bottom_panel_switch"), &EditorNode::_bottom_panel_switch);
+ ClassDB::bind_method("_menu_option",&EditorNode::_menu_option);
+ ClassDB::bind_method("_menu_confirm_current",&EditorNode::_menu_confirm_current);
+ ClassDB::bind_method("_dialog_action",&EditorNode::_dialog_action);
+ ClassDB::bind_method("_resource_selected",&EditorNode::_resource_selected,DEFVAL(""));
+ ClassDB::bind_method("_property_editor_forward",&EditorNode::_property_editor_forward);
+ ClassDB::bind_method("_property_editor_back",&EditorNode::_property_editor_back);
+ ClassDB::bind_method("_editor_select",&EditorNode::_editor_select);
+ ClassDB::bind_method("_node_renamed",&EditorNode::_node_renamed);
+ ClassDB::bind_method("edit_node",&EditorNode::edit_node);
+ ClassDB::bind_method("_imported",&EditorNode::_imported);
+ ClassDB::bind_method("_unhandled_input",&EditorNode::_unhandled_input);
+
+ ClassDB::bind_method("_get_scene_metadata",&EditorNode::_get_scene_metadata);
+ ClassDB::bind_method("set_edited_scene",&EditorNode::set_edited_scene);
+ ClassDB::bind_method("open_request",&EditorNode::open_request);
+ ClassDB::bind_method("_instance_request",&EditorNode::_instance_request);
+ ClassDB::bind_method("update_keying",&EditorNode::update_keying);
+ ClassDB::bind_method("_property_keyed",&EditorNode::_property_keyed);
+ ClassDB::bind_method("_transform_keyed",&EditorNode::_transform_keyed);
+ ClassDB::bind_method("_close_messages",&EditorNode::_close_messages);
+ ClassDB::bind_method("_show_messages",&EditorNode::_show_messages);
+ ClassDB::bind_method("_vp_resized",&EditorNode::_vp_resized);
+ ClassDB::bind_method("_quick_opened",&EditorNode::_quick_opened);
+ ClassDB::bind_method("_quick_run",&EditorNode::_quick_run);
+
+ ClassDB::bind_method("_resource_created",&EditorNode::_resource_created);
+
+ ClassDB::bind_method("_import_action",&EditorNode::_import_action);
+ //ClassDB::bind_method("_import",&EditorNode::_import);
+ //ClassDB::bind_method("_import_conflicts_solved",&EditorNode::_import_conflicts_solved);
+ ClassDB::bind_method("_open_recent_scene",&EditorNode::_open_recent_scene);
+ //ClassDB::bind_method("_open_recent_scene_confirm",&EditorNode::_open_recent_scene_confirm);
+
+ ClassDB::bind_method("_save_optimized",&EditorNode::_save_optimized);
+
+ ClassDB::bind_method("stop_child_process",&EditorNode::stop_child_process);
+
+ ClassDB::bind_method("_sources_changed",&EditorNode::_sources_changed);
+ ClassDB::bind_method("_fs_changed",&EditorNode::_fs_changed);
+ ClassDB::bind_method("_dock_select_draw",&EditorNode::_dock_select_draw);
+ ClassDB::bind_method("_dock_select_input",&EditorNode::_dock_select_input);
+ ClassDB::bind_method("_dock_pre_popup",&EditorNode::_dock_pre_popup);
+ ClassDB::bind_method("_dock_split_dragged",&EditorNode::_dock_split_dragged);
+ ClassDB::bind_method("_save_docks",&EditorNode::_save_docks);
+ ClassDB::bind_method("_dock_popup_exit",&EditorNode::_dock_popup_exit);
+ ClassDB::bind_method("_dock_move_left",&EditorNode::_dock_move_left);
+ ClassDB::bind_method("_dock_move_right",&EditorNode::_dock_move_right);
+
+ ClassDB::bind_method("_layout_menu_option",&EditorNode::_layout_menu_option);
+
+ ClassDB::bind_method("set_current_scene",&EditorNode::set_current_scene);
+ ClassDB::bind_method("set_current_version",&EditorNode::set_current_version);
+ ClassDB::bind_method("_scene_tab_changed",&EditorNode::_scene_tab_changed);
+ ClassDB::bind_method("_scene_tab_closed",&EditorNode::_scene_tab_closed);
+ ClassDB::bind_method("_scene_tab_script_edited",&EditorNode::_scene_tab_script_edited);
+ ClassDB::bind_method("_set_main_scene_state",&EditorNode::_set_main_scene_state);
+ ClassDB::bind_method("_update_scene_tabs",&EditorNode::_update_scene_tabs);
+
+ ClassDB::bind_method("_prepare_history",&EditorNode::_prepare_history);
+ ClassDB::bind_method("_select_history",&EditorNode::_select_history);
+
+ ClassDB::bind_method("_toggle_search_bar",&EditorNode::_toggle_search_bar);
+ ClassDB::bind_method("_clear_search_box",&EditorNode::_clear_search_box);
+ ClassDB::bind_method("_clear_undo_history",&EditorNode::_clear_undo_history);
+ ClassDB::bind_method("_dropped_files",&EditorNode::_dropped_files);
+ ClassDB::bind_method("_toggle_distraction_free_mode",&EditorNode::_toggle_distraction_free_mode);
+
+
+
+ ClassDB::bind_method(_MD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin);
+ ClassDB::bind_method(_MD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin);
+ ClassDB::bind_method(_MD("get_gui_base"), &EditorNode::get_gui_base);
+ ClassDB::bind_method(_MD("_bottom_panel_switch"), &EditorNode::_bottom_panel_switch);
ADD_SIGNAL( MethodInfo("play_pressed") );
ADD_SIGNAL( MethodInfo("pause_pressed") );
ADD_SIGNAL( MethodInfo("stop_pressed") );
ADD_SIGNAL( MethodInfo("request_help") );
- ADD_SIGNAL( MethodInfo("script_add_function_request",PropertyInfo(Variant::OBJECT,"obj"),PropertyInfo(Variant::STRING,"function"),PropertyInfo(Variant::STRING_ARRAY,"args")) );
+ ADD_SIGNAL( MethodInfo("script_add_function_request",PropertyInfo(Variant::OBJECT,"obj"),PropertyInfo(Variant::STRING,"function"),PropertyInfo(Variant::POOL_STRING_ARRAY,"args")) );
ADD_SIGNAL( MethodInfo("resource_saved",PropertyInfo(Variant::OBJECT,"obj")) );
}
+static Node* _resource_get_edited_scene() {
+
+ return EditorNode::get_singleton()->get_edited_scene();
+}
+
EditorNode::EditorNode() {
+ Resource::_get_local_scene_func=_resource_get_edited_scene;
+
+ VisualServer::get_singleton()->textures_keep_original(true);
+
EditorHelp::generate_doc(); //before any editor classes are crated
SceneState::set_disable_placeholders(true);
editor_initialize_certificates(); //for asset sharing
@@ -5396,7 +5422,7 @@ EditorNode::EditorNode() {
bool use_single_dock_column = false;
{
- int dpi_mode = EditorSettings::get_singleton()->get("global/hidpi_mode");
+ int dpi_mode = EditorSettings::get_singleton()->get("interface/hidpi_mode");
if (dpi_mode==0) {
editor_set_scale( OS::get_singleton()->get_screen_dpi(0) > 150 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x>2000 ? 2.0 : 1.0 );
@@ -5415,9 +5441,9 @@ EditorNode::EditorNode() {
ResourceLoader::set_abort_on_missing_resources(false);
- FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"));
- EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"));
- EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EditorSettings::get_singleton()->get("file_dialog/display_mode").operator int());
+ FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"));
+ EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"));
+ EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EditorSettings::get_singleton()->get("filesystem/file_dialog/display_mode").operator int());
ResourceLoader::set_error_notify_func(this,_load_error_notify);
ResourceLoader::set_dependency_error_notify_func(this,_dependency_error_report);
@@ -5448,11 +5474,11 @@ EditorNode::EditorNode() {
editor_import_export->load_config();
- GLOBAL_DEF("editor/main_run_args","$exec -path $path -scene $scene $main_scene");
+ GLOBAL_DEF("editor/main_run_args","$scene");
- ObjectTypeDB::set_type_enabled("CollisionShape",true);
- ObjectTypeDB::set_type_enabled("CollisionShape2D",true);
- ObjectTypeDB::set_type_enabled("CollisionPolygon2D",true);
+ ClassDB::set_class_enabled("CollisionShape",true);
+ ClassDB::set_class_enabled("CollisionShape2D",true);
+ ClassDB::set_class_enabled("CollisionPolygon2D",true);
Control *theme_base = memnew( Control );
add_child(theme_base);
@@ -5503,7 +5529,7 @@ EditorNode::EditorNode() {
menu_hb = memnew( HBoxContainer );
main_vbox->add_child(menu_hb);
-// top_dark_vb->add_child(scene_tabs);
+ //top_dark_vb->add_child(scene_tabs);
//left
left_l_hsplit = memnew( HSplitContainer );
main_vbox->add_child(left_l_hsplit);
@@ -5605,14 +5631,14 @@ EditorNode::EditorNode() {
dock_select = memnew( Control );
dock_select->set_custom_minimum_size(Size2(128,64)*EDSCALE);
- dock_select->connect("input_event",this,"_dock_select_input");
+ dock_select->connect("gui_input",this,"_dock_select_input");
dock_select->connect("draw",this,"_dock_select_draw");
- dock_select->connect("mouse_exit",this,"_dock_popup_exit");
+ dock_select->connect("mouse_exited",this,"_dock_popup_exit");
dock_select->set_v_size_flags(Control::SIZE_EXPAND_FILL);
dock_vb->add_child(dock_select);
- dock_select_popoup->set_child_rect(dock_vb);
+
dock_select_popoup->set_as_minsize();
dock_select_rect_over=-1;
dock_popup_selected=-1;
@@ -5651,7 +5677,7 @@ EditorNode::EditorNode() {
scene_tabs=memnew( Tabs );
scene_tabs->add_tab("unsaved");
scene_tabs->set_tab_align(Tabs::ALIGN_CENTER);
- scene_tabs->set_tab_close_display_policy( (bool(EDITOR_DEF("global/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY) );
+ scene_tabs->set_tab_close_display_policy( (bool(EDITOR_DEF("interface/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY) );
scene_tabs->connect("tab_changed",this,"_scene_tab_changed");
scene_tabs->connect("right_button_pressed",this,"_scene_tab_script_edited");
scene_tabs->connect("tab_close", this, "_scene_tab_closed");
@@ -5662,6 +5688,7 @@ EditorNode::EditorNode() {
scene_root_parent->set_custom_minimum_size(Size2(0,80)*EDSCALE);
+
//Ref<StyleBox> sp = scene_root_parent->get_stylebox("panel","TabContainer");
//scene_root_parent->add_style_override("panel",sp);
@@ -5675,16 +5702,18 @@ EditorNode::EditorNode() {
scene_root = memnew( Viewport );
+ scene_root->set_disable_3d(true);
+
//scene_root_base->add_child(scene_root);
//scene_root->set_meta("_editor_disable_input",true);
- VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport(),true);
+ VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport_rid(),true);
scene_root->set_disable_input(true);
scene_root->set_as_audio_listener_2d(true);
- scene_root->set_size_override(true,Size2(Globals::get_singleton()->get("display/width"),Globals::get_singleton()->get("display/height")));
+ //scene_root->set_size_override(true,Size2(GlobalConfig::get_singleton()->get("display/width"),GlobalConfig::get_singleton()->get("display/height")));
-// scene_root->set_world_2d( Ref<World2D>( memnew( World2D )) );
+ //scene_root->set_world_2d( Ref<World2D>( memnew( World2D )) );
viewport = memnew( VBoxContainer );
@@ -5695,6 +5724,7 @@ EditorNode::EditorNode() {
scene_root_parent->add_child(viewport);
+
PanelContainer *top_region = memnew( PanelContainer );
top_region->add_style_override("panel",gui_base->get_stylebox("hover","Button"));
HBoxContainer *left_menu_hb = memnew( HBoxContainer );
@@ -5754,11 +5784,11 @@ EditorNode::EditorNode() {
pm_export->add_separator();
pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_MeshLibrary", TTR("MeshLibrary..")), FILE_EXPORT_MESH_LIBRARY);
pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_TileSet", TTR("TileSet..")), FILE_EXPORT_TILESET);
- pm_export->connect("item_pressed",this,"_menu_option");
+ pm_export->connect("id_pressed",this,"_menu_option");
p->add_separator();
- p->add_item(TTR("Undo"),EDIT_UNDO,KEY_MASK_CMD+KEY_Z);
- p->add_item(TTR("Redo"),EDIT_REDO,KEY_MASK_CMD+KEY_MASK_SHIFT+KEY_Z);
+ p->add_shortcut(ED_SHORTCUT("editor/undo", TTR("Undo"),KEY_MASK_CMD+KEY_Z),EDIT_UNDO,true);
+ p->add_shortcut(ED_SHORTCUT("editor/redo", TTR("Redo"),KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_Z),EDIT_REDO,true);
p->add_separator();
p->add_item(TTR("Run Script"),FILE_RUN_SCRIPT,KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_R);
p->add_separator();
@@ -5776,7 +5806,7 @@ EditorNode::EditorNode() {
recent_scenes = memnew( PopupMenu );
recent_scenes->set_name("RecentScenes");
p->add_child(recent_scenes);
- recent_scenes->connect("item_pressed",this,"_open_recent_scene");
+ recent_scenes->connect("id_pressed",this,"_open_recent_scene");
{
Control *sp = memnew( Control );
@@ -5833,7 +5863,7 @@ EditorNode::EditorNode() {
left_menu_hb->add_child( import_menu );
p=import_menu->get_popup();
- p->connect("item_pressed",this,"_menu_option");
+ p->connect("id_pressed",this,"_menu_option");
tool_menu = memnew( MenuButton );
tool_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools."));
@@ -5843,7 +5873,7 @@ EditorNode::EditorNode() {
left_menu_hb->add_child( tool_menu );
p=tool_menu->get_popup();
- p->connect("item_pressed",this,"_menu_option");
+ p->connect("id_pressed",this,"_menu_option");
p->add_item(TTR("Orphan Resource Explorer"),TOOLS_ORPHAN_RESOURCES);
export_button = memnew( ToolButton );
@@ -5862,7 +5892,7 @@ EditorNode::EditorNode() {
play_cc = memnew( CenterContainer );
- play_cc->set_ignore_mouse(true);
+ play_cc->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
gui_base->add_child( play_cc );
play_cc->set_area_as_parent_rect();
play_cc->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_BEGIN,10);
@@ -5913,11 +5943,11 @@ EditorNode::EditorNode() {
native_play_button->set_text("NTV");
menu_hb->add_child(native_play_button);
native_play_button->hide();
- native_play_button->get_popup()->connect("item_pressed",this,"_run_in_device");
+ native_play_button->get_popup()->connect("id_pressed",this,"_run_in_device");
run_native->connect("native_run",this,"_menu_option",varray(RUN_PLAY_NATIVE));
-// VSeparator *s1 = memnew( VSeparator );
-// play_hb->add_child(s1);
+ //VSeparator *s1 = memnew( VSeparator );
+ //play_hb->add_child(s1);
play_scene_button = memnew( ToolButton );
play_hb->add_child(play_scene_button);
@@ -5947,6 +5977,7 @@ EditorNode::EditorNode() {
debug_button->set_tooltip(TTR("Debug options"));
p=debug_button->get_popup();
+ p->set_hide_on_item_selection(false);
p->add_check_item(TTR("Deploy with Remote Debug"),RUN_DEPLOY_REMOTE_DEBUG);
p->set_item_tooltip(p->get_item_count()-1,TTR("When exporting or deploying, the resulting executable will attempt to connect to the IP of this computer in order to be debugged."));
p->add_check_item(TTR("Small Deploy with Network FS"),RUN_FILE_SERVER);
@@ -5961,7 +5992,7 @@ EditorNode::EditorNode() {
p->set_item_tooltip(p->get_item_count()-1,TTR("When this option is turned on, any changes made to the scene in the editor will be replicated in the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
p->add_check_item(TTR("Sync Script Changes"),RUN_RELOAD_SCRIPTS);
p->set_item_tooltip(p->get_item_count()-1,TTR("When this option is turned on, any script that is saved will be reloaded on the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
- p->connect("item_pressed",this,"_menu_option");
+ p->connect("id_pressed",this,"_menu_option");
/*
run_settings_button = memnew( ToolButton );
@@ -6005,7 +6036,7 @@ EditorNode::EditorNode() {
audio_vu->set_max(24);
audio_vu->set_min(-80);
audio_vu->set_step(0.01);
- audio_vu->set_val(0);
+ audio_vu->set_value(0);
{
Control *sp = memnew( Control );
@@ -6035,7 +6066,7 @@ EditorNode::EditorNode() {
editor_layouts = memnew( PopupMenu );
editor_layouts->set_name("Layouts");
p->add_child(editor_layouts);
- editor_layouts->connect("item_pressed",this,"_layout_menu_option");
+ editor_layouts->connect("id_pressed",this,"_layout_menu_option");
p->add_submenu_item(TTR("Editor Layout"), "Layouts");
p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode",TTR("Toggle Fullscreen"),KEY_MASK_SHIFT|KEY_F11),SETTINGS_TOGGLE_FULLSCREN);
@@ -6064,6 +6095,8 @@ EditorNode::EditorNode() {
p=update_menu->get_popup();
p->add_check_item(TTR("Update Always"),SETTINGS_UPDATE_ALWAYS);
p->add_check_item(TTR("Update Changes"),SETTINGS_UPDATE_CHANGES);
+ p->add_separator();
+ p->add_check_item(TTR("Disable Update Spinner"),SETTINGS_UPDATE_SPINNER_HIDE);
p->set_item_checked(1,true);
//sources_button->connect();
@@ -6145,7 +6178,7 @@ EditorNode::EditorNode() {
prop_editor_hb->add_child(resource_save_button);
resource_save_button->get_popup()->add_item(TTR("Save"),RESOURCE_SAVE);
resource_save_button->get_popup()->add_item(TTR("Save As.."),RESOURCE_SAVE_AS);
- resource_save_button->get_popup()->connect("item_pressed",this,"_menu_option");
+ resource_save_button->get_popup()->connect("id_pressed",this,"_menu_option");
resource_save_button->set_focus_mode(Control::FOCUS_NONE);
resource_save_button->set_disabled(true);
@@ -6173,7 +6206,7 @@ EditorNode::EditorNode() {
editor_history_menu->set_icon( gui_base->get_icon("History","EditorIcons"));
prop_editor_hb->add_child(editor_history_menu);
editor_history_menu->connect("about_to_show",this,"_prepare_history");
- editor_history_menu->get_popup()->connect("item_pressed",this,"_select_history");
+ editor_history_menu->get_popup()->connect("id_pressed",this,"_select_history");
prop_editor_hb = memnew( HBoxContainer ); //again...
@@ -6240,7 +6273,7 @@ EditorNode::EditorNode() {
scenes_dock = memnew( FileSystemDock(this) );
scenes_dock->set_name(TTR("FileSystem"));
- scenes_dock->set_display_mode(int(EditorSettings::get_singleton()->get("filesystem_dock/display_mode")));
+ scenes_dock->set_display_mode(int(EditorSettings::get_singleton()->get("docks/filesystem/display_mode")));
if (use_single_dock_column) {
dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(scenes_dock);
@@ -6301,8 +6334,8 @@ EditorNode::EditorNode() {
bottom_pc->add_child(bottom_hb);*/
-// center_vb->add_child( log->get_button() );
-// log->get_button()->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ //center_vb->add_child( log->get_button() );
+ //log->get_button()->set_h_size_flags(Control::SIZE_EXPAND_FILL);
//progress_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL);
@@ -6326,9 +6359,7 @@ EditorNode::EditorNode() {
- call_dialog = memnew( CallDialog );
- call_dialog->hide();
- gui_base->add_child( call_dialog );
+
@@ -6352,7 +6383,7 @@ EditorNode::EditorNode() {
-// optimized_save = memnew( OptimizedSaveDialog(&editor_data) );
+ //optimized_save = memnew( OptimizedSaveDialog(&editor_data) );
//gui_base->add_child(optimized_save);
//optimized_save->connect("confirmed",this,"_save_optimized");
@@ -6409,11 +6440,11 @@ EditorNode::EditorNode() {
about->get_ok()->set_text(TTR("Thanks!"));
about->set_hide_on_ok(true);
Label *about_text = memnew( Label );
- about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2016 Juan Linietsky, Ariel Manzur.\n");
+ about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2017 Juan Linietsky, Ariel Manzur.\n");
about_text->set_pos(Point2(gui_base->get_icon("Logo","EditorIcons")->get_size().width+30,20));
gui_base->add_child(about);
about->add_child(about_text);
- TextureFrame *logo = memnew( TextureFrame );
+ TextureRect *logo = memnew( TextureRect );
about->add_child(logo);
logo->set_pos(Point2(20,20));
logo->set_texture(gui_base->get_icon("Logo","EditorIcons") );
@@ -6484,11 +6515,11 @@ EditorNode::EditorNode() {
- file_menu->get_popup()->connect("item_pressed", this,"_menu_option");
- object_menu->get_popup()->connect("item_pressed", this,"_menu_option");
+ file_menu->get_popup()->connect("id_pressed", this,"_menu_option");
+ object_menu->get_popup()->connect("id_pressed", this,"_menu_option");
- update_menu->get_popup()->connect("item_pressed", this,"_menu_option");
- settings_menu->get_popup()->connect("item_pressed", this,"_menu_option");
+ update_menu->get_popup()->connect("id_pressed", this,"_menu_option");
+ settings_menu->get_popup()->connect("id_pressed", this,"_menu_option");
file->connect("file_selected", this,"_dialog_action");
@@ -6505,8 +6536,8 @@ EditorNode::EditorNode() {
Ref<EditorSceneImportPlugin> _scene_import = memnew(EditorSceneImportPlugin(this) );
Ref<EditorSceneImporterCollada> _collada_import = memnew( EditorSceneImporterCollada);
_scene_import->add_importer(_collada_import);
-// Ref<EditorSceneImporterFBXConv> _fbxconv_import = memnew( EditorSceneImporterFBXConv);
-// _scene_import->add_importer(_fbxconv_import);
+ //Ref<EditorSceneImporterFBXConv> _fbxconv_import = memnew( EditorSceneImporterFBXConv);
+ //_scene_import->add_importer(_fbxconv_import);
editor_import_export->add_import_plugin( _scene_import);
// TODO: This plugin has no code, it should be either implemented or dropped (GH-3667)
// editor_import_export->add_import_plugin( Ref<EditorSceneAnimationImportPlugin>( memnew(EditorSceneAnimationImportPlugin(this))));
@@ -6537,10 +6568,11 @@ EditorNode::EditorNode() {
//more visually meaningful to have this later
raise_bottom_panel_item(AnimationPlayerEditor::singleton);
- add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,true) ) );
+ add_editor_plugin( memnew( ShaderEditorPlugin(this) ) );
+/* add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,true) ) );
add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,false) ) );
- add_editor_plugin( memnew( ShaderEditorPlugin(this,true) ) );
- add_editor_plugin( memnew( ShaderEditorPlugin(this,false) ) );
+
+ add_editor_plugin( memnew( ShaderEditorPlugin(this,false) ) );*/
add_editor_plugin( memnew( CameraEditorPlugin(this) ) );
add_editor_plugin( memnew( SampleEditorPlugin(this) ) );
add_editor_plugin( memnew( SampleLibraryEditorPlugin(this) ) );
@@ -6549,31 +6581,32 @@ EditorNode::EditorNode() {
add_editor_plugin( memnew( MeshInstanceEditorPlugin(this) ) );
add_editor_plugin( memnew( AnimationTreeEditorPlugin(this) ) );
//add_editor_plugin( memnew( SamplePlayerEditorPlugin(this) ) ); - this is kind of useless at this point
- add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) );
+ //add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) );
//add_editor_plugin( memnew( StreamEditorPlugin(this) ) );
add_editor_plugin( memnew( StyleBoxEditorPlugin(this) ) );
- add_editor_plugin( memnew( ParticlesEditorPlugin(this) ) );
+ //add_editor_plugin( memnew( ParticlesEditorPlugin(this) ) );
add_editor_plugin( memnew( ResourcePreloaderEditorPlugin(this) ) );
add_editor_plugin( memnew( ItemListEditorPlugin(this) ) );
//add_editor_plugin( memnew( RichTextEditorPlugin(this) ) );
- add_editor_plugin( memnew( CollisionPolygonEditorPlugin(this) ) );
+ //add_editor_plugin( memnew( CollisionPolygonEditorPlugin(this) ) );
add_editor_plugin( memnew( CollisionPolygon2DEditorPlugin(this) ) );
add_editor_plugin( memnew( TileSetEditorPlugin(this) ) );
add_editor_plugin( memnew( TileMapEditorPlugin(this) ) );
add_editor_plugin( memnew( SpriteFramesEditorPlugin(this) ) );
add_editor_plugin( memnew( TextureRegionEditorPlugin(this) ) );
add_editor_plugin( memnew( Particles2DEditorPlugin(this) ) );
+ add_editor_plugin( memnew( GIProbeEditorPlugin(this) ) );
add_editor_plugin( memnew( Path2DEditorPlugin(this) ) );
- add_editor_plugin( memnew( PathEditorPlugin(this) ) );
- add_editor_plugin( memnew( BakedLightEditorPlugin(this) ) );
+ //add_editor_plugin( memnew( PathEditorPlugin(this) ) );
+ //add_editor_plugin( memnew( BakedLightEditorPlugin(this) ) );
add_editor_plugin( memnew( Polygon2DEditorPlugin(this) ) );
add_editor_plugin( memnew( LightOccluder2DEditorPlugin(this) ) );
add_editor_plugin( memnew( NavigationPolygonEditorPlugin(this) ) );
add_editor_plugin( memnew( ColorRampEditorPlugin(this) ) );
add_editor_plugin( memnew( CollisionShape2DEditorPlugin(this) ) );
add_editor_plugin( memnew( TextureEditorPlugin(this) ) );
- add_editor_plugin( memnew( MaterialEditorPlugin(this) ) );
- add_editor_plugin( memnew( MeshEditorPlugin(this) ) );
+ //add_editor_plugin( memnew( MaterialEditorPlugin(this) ) );
+ //add_editor_plugin( memnew( MeshEditorPlugin(this) ) );
for(int i=0;i<EditorPlugins::get_plugin_count();i++)
add_editor_plugin( EditorPlugins::create(i,this) );
@@ -6582,18 +6615,18 @@ EditorNode::EditorNode() {
plugin_init_callbacks[i]();
}
- resource_preview->add_preview_generator( Ref<EditorTexturePreviewPlugin>( memnew(EditorTexturePreviewPlugin )));
+ /*resource_preview->add_preview_generator( Ref<EditorTexturePreviewPlugin>( memnew(EditorTexturePreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorPackedScenePreviewPlugin>( memnew(EditorPackedScenePreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorMaterialPreviewPlugin>( memnew(EditorMaterialPreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorScriptPreviewPlugin>( memnew(EditorScriptPreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorSamplePreviewPlugin>( memnew(EditorSamplePreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorMeshPreviewPlugin>( memnew(EditorMeshPreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorBitmapPreviewPlugin>( memnew(EditorBitmapPreviewPlugin )));
-
+*/
circle_step_msec=OS::get_singleton()->get_ticks_msec();
- circle_step_frame=OS::get_singleton()->get_frames_drawn();
+ circle_step_frame=Engine::get_singleton()->get_frames_drawn();
circle_step=0;
_rebuild_import_menu();
@@ -6601,7 +6634,7 @@ EditorNode::EditorNode() {
editor_plugin_screen=NULL;
editor_plugins_over = memnew(EditorPluginList);
-// force_top_viewport(true);
+ //force_top_viewport(true);
_edit_current();
current=NULL;
@@ -6609,8 +6642,8 @@ EditorNode::EditorNode() {
Physics2DServer::get_singleton()->set_active(false); // no physics by default if editor
ScriptServer::set_scripting_enabled(false); // no scripting by default if editor
- Globals::get_singleton()->set("debug/indicators_enabled",true);
- Globals::get_singleton()->set("render/room_cull_enabled",false);
+
+ //GlobalConfig::get_singleton()->set("render/room_cull_enabled",false);
reference_resource_mem=true;
save_external_resources_mem=true;
@@ -6624,7 +6657,7 @@ EditorNode::EditorNode() {
//store project name in ssettings
String project_name;
//figure it out from path
- project_name=Globals::get_singleton()->get_resource_path().replace("\\","/");
+ project_name=GlobalConfig::get_singleton()->get_resource_path().replace("\\","/");
print_line("path: "+project_name);
if (project_name.length() && project_name[project_name.length()-1]=='/')
project_name=project_name.substr(0,project_name.length()-1);
@@ -6632,7 +6665,7 @@ EditorNode::EditorNode() {
project_name=project_name.replace("/","::");
if (project_name!="") {
- EditorSettings::get_singleton()->set("projects/"+project_name,Globals::get_singleton()->get_resource_path());
+ EditorSettings::get_singleton()->set("projects/"+project_name,GlobalConfig::get_singleton()->get_resource_path());
EditorSettings::get_singleton()->raise_order("projects/"+project_name);
EditorSettings::get_singleton()->save();
}
@@ -6663,15 +6696,16 @@ EditorNode::EditorNode() {
set_process_unhandled_input(true);
_playing_edited=false;
-// Panel *errors = memnew( Panel );
+ //Panel *errors = memnew( Panel );
load_errors = memnew( RichTextLabel );
-// load_errors->set_readonly(true);
+ //load_errors->set_readonly(true);
load_error_dialog = memnew( AcceptDialog );
load_error_dialog->add_child(load_errors);
load_error_dialog->set_title(TTR("Load Errors"));
- load_error_dialog->set_child_rect(load_errors);
+ //load_error_dialog->set_child_rect(load_errors);
gui_base->add_child(load_error_dialog);
+
//EditorImport::add_importer( Ref<EditorImporterCollada>( memnew(EditorImporterCollada )));
EditorFileSystem::get_singleton()->connect("sources_changed",this,"_sources_changed");
@@ -6684,7 +6718,7 @@ EditorNode::EditorNode() {
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()))
+ if (!ClassDB::class_exists(E->get()))
continue;
icon_type_cache[E->get()]=theme_base->get_theme()->get_icon(E->get(),ei);
}
@@ -6700,8 +6734,8 @@ EditorNode::EditorNode() {
pick_main_scene->get_ok()->set_text("Select");
pick_main_scene->connect("confirmed",this,"_menu_option",varray(SETTINGS_PICK_MAIN_SCENE));
-// Ref<ImageTexture> it = gui_base->get_icon("logo","Icons");
-// OS::get_singleton()->set_icon( it->get_data() );
+ //Ref<ImageTexture> it = gui_base->get_icon("logo","Icons");
+ //OS::get_singleton()->set_icon( it->get_data() );
for(int i=0;i<_init_callbacks.size();i++)
_init_callbacks[i]();
@@ -6713,7 +6747,7 @@ EditorNode::EditorNode() {
{
_initializing_addons=true;
- Vector<String> addons = Globals::get_singleton()->get("editor_plugins/enabled");
+ Vector<String> addons = GlobalConfig::get_singleton()->get("editor_plugins/enabled");
for(int i=0;i<addons.size();i++) {
set_addon_plugin_enabled(addons[i],true);
@@ -6762,12 +6796,12 @@ void EditorPluginList::edit(Object* p_object) {
}
-bool EditorPluginList::forward_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) {
+bool EditorPluginList::forward_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) {
bool discard = false;
for (int i = 0; i < plugins_list.size(); i++) {
- if (plugins_list[i]->forward_canvas_input_event(p_canvas_xform,p_event)) {
+ if (plugins_list[i]->forward_canvas_gui_input(p_canvas_xform,p_event)) {
discard = true;
}
}
@@ -6775,11 +6809,11 @@ bool EditorPluginList::forward_input_event(const Matrix32& p_canvas_xform,const
return discard;
}
-bool EditorPluginList::forward_spatial_input_event(Camera* p_camera, const InputEvent& p_event) {
+bool EditorPluginList::forward_spatial_gui_input(Camera* p_camera, const InputEvent& p_event) {
bool discard = false;
for (int i = 0; i < plugins_list.size(); i++) {
- if (plugins_list[i]->forward_spatial_input_event(p_camera, p_event)) {
+ if (plugins_list[i]->forward_spatial_gui_input(p_camera, p_event)) {
discard = true;
}
}
@@ -6787,7 +6821,7 @@ bool EditorPluginList::forward_spatial_input_event(Camera* p_camera, const Input
return discard;
}
-void EditorPluginList::forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control* p_canvas) {
+void EditorPluginList::forward_draw_over_canvas(const Transform2D& p_canvas_xform,Control* p_canvas) {
for (int i = 0; i < plugins_list.size(); i++) {
plugins_list[i]->forward_draw_over_canvas(p_canvas_xform,p_canvas);
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 2fae5daced..dd5ff1e175 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -79,7 +79,7 @@
#include "fileserver/editor_file_server.h"
#include "editor_resource_preview.h"
-
+#include "scene/gui/viewport_container.h"
#include "progress_dialog.h"
@@ -101,7 +101,7 @@ class EditorPluginList;
class EditorNode : public Node {
- OBJ_TYPE( EditorNode, Node );
+ GDCLASS( EditorNode, Node );
public:
enum DockSlot {
@@ -159,7 +159,6 @@ private:
OBJECT_COPY_PARAMS,
OBJECT_PASTE_PARAMS,
OBJECT_UNIQUE_RESOURCES,
- OBJECT_CALL_METHOD,
OBJECT_REQUEST_HELP,
RUN_PLAY,
@@ -179,6 +178,7 @@ private:
RUN_RELOAD_SCRIPTS,
SETTINGS_UPDATE_ALWAYS,
SETTINGS_UPDATE_CHANGES,
+ SETTINGS_UPDATE_SPINNER_HIDE,
SETTINGS_EXPORT_PREFERENCES,
SETTINGS_PREFERENCES,
SETTINGS_OPTIMIZED_PRESETS,
@@ -207,7 +207,7 @@ private:
//Ref<ResourceImportMetadata> scene_import_metadata;
- Control* scene_root_parent;
+ PanelContainer* scene_root_parent;
Control *gui_base;
VBoxContainer *main_vbox;
@@ -286,7 +286,7 @@ private:
CreateDialog *create_dialog;
- CallDialog *call_dialog;
+ //CallDialog *call_dialog;
ConfirmationDialog *confirmation;
ConfirmationDialog *import_confirmation;
ConfirmationDialog *open_recent_confirmation;
@@ -700,6 +700,7 @@ public:
void notify_child_process_exited();
+ OS::ProcessID get_child_process_id() const { return editor_run.get_pid(); }
void stop_child_process();
Ref<Theme> get_editor_theme() const { return theme; }
@@ -791,9 +792,9 @@ public:
void make_visible(bool p_visible);
void edit(Object *p_object);
- bool forward_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event);
- bool forward_spatial_input_event(Camera* p_camera, const InputEvent& p_event);
- void forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control* p_canvas);
+ bool forward_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event);
+ bool forward_spatial_gui_input(Camera* p_camera, const InputEvent& p_event);
+ void forward_draw_over_canvas(const Transform2D& p_canvas_xform,Control* p_canvas);
void clear();
bool empty();
diff --git a/tools/editor/editor_path.cpp b/tools/editor/editor_path.cpp
index 6b804b6a24..b359522e4f 100644
--- a/tools/editor/editor_path.cpp
+++ b/tools/editor/editor_path.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -27,33 +27,106 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "editor_path.h"
+#include "editor_scale.h"
+#include "editor_node.h"
+void EditorPath::_add_children_to_popup(Object* p_obj,int p_depth) {
+
+ if (p_depth>8)
+ return;
+
+ List<PropertyInfo> pinfo;
+ p_obj->get_property_list(&pinfo);
+ for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) {
+
+ if (!(E->get().usage&PROPERTY_USAGE_EDITOR))
+ continue;
+ if (E->get().hint!=PROPERTY_HINT_RESOURCE_TYPE)
+ continue;
+
+ Variant value = p_obj->get(E->get().name);
+ if (value.get_type()!=Variant::OBJECT)
+ continue;
+ Object *obj = value;
+ if (!obj)
+ continue;
+
+ Ref<Texture> icon;
+
+ if (has_icon(obj->get_class(),"EditorIcons"))
+ icon=get_icon(obj->get_class(),"EditorIcons");
+ else
+ icon=get_icon("Object","EditorIcons");
+
+ int index = popup->get_item_count();
+ popup->add_icon_item(icon,E->get().name.capitalize(),objects.size());
+ popup->set_item_h_offset(index,p_depth*10*EDSCALE);
+ objects.push_back(obj->get_instance_ID());
+
+ _add_children_to_popup(obj,p_depth+1);
+ }
+}
+
+void EditorPath::_gui_input(const InputEvent& p_event) {
+
+ if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_LEFT && p_event.mouse_button.pressed) {
+
+
+ Object *obj = ObjectDB::get_instance(history->get_path_object( history->get_path_size()-1));
+ if (!obj)
+ return;
+
+
+
+ objects.clear();
+ popup->clear();
+ _add_children_to_popup(obj);
+ popup->set_pos( get_global_pos() + Vector2(0,get_size().height));
+ popup->set_size( Size2(get_size().width,1));
+ popup->popup();
+ }
+}
void EditorPath::_notification(int p_what) {
switch(p_what) {
+ case NOTIFICATION_MOUSE_ENTER: {
+ mouse_over=true;
+ update();
+ } break;
+ case NOTIFICATION_MOUSE_EXIT: {
+ mouse_over=false;
+ update();
+ } break;
case NOTIFICATION_DRAW: {
RID ci=get_canvas_item();
Ref<Font> label_font = get_font("font","Label");
Size2i size = get_size();
Ref<Texture> sn = get_icon("SmallNext","EditorIcons");
+ Ref<StyleBox> sb = get_stylebox("pressed","Button");
+
+
+ int ofs=sb->get_margin(MARGIN_LEFT);
+
+ if (mouse_over) {
+ draw_style_box(sb,Rect2(Point2(),get_size()));
+ }
- int ofs=5;
for(int i=0;i<history->get_path_size();i++) {
Object *obj = ObjectDB::get_instance(history->get_path_object(i));
if (!obj)
continue;
- String type = obj->get_type();
+ String type = obj->get_class();
Ref<Texture> icon;
- if (has_icon(obj->get_type(),"EditorIcons"))
- icon=get_icon(obj->get_type(),"EditorIcons");
+ if (has_icon(obj->get_class(),"EditorIcons"))
+ icon=get_icon(obj->get_class(),"EditorIcons");
else
icon=get_icon("Object","EditorIcons");
@@ -78,17 +151,17 @@ void EditorPath::_notification(int p_what) {
name=r->get_name();
if (name=="")
- name=r->get_type();
+ name=r->get_class();
} else if (obj->cast_to<Node>()) {
name=obj->cast_to<Node>()->get_name();
} else if (obj->cast_to<Resource>() && obj->cast_to<Resource>()->get_name()!="") {
name=obj->cast_to<Resource>()->get_name();
} else {
- name=obj->get_type();
+ name=obj->get_class();
}
- set_tooltip(obj->get_type());
+ set_tooltip(obj->get_class());
label_font->draw(ci,Point2i(ofs,(size.height-label_font->get_height())/2+label_font->get_ascent()),name,Color(1,1,1),left);
@@ -108,11 +181,34 @@ void EditorPath::_notification(int p_what) {
void EditorPath::update_path() {
+
update();
}
+void EditorPath::_popup_select(int p_idx) {
+
+ ERR_FAIL_INDEX(p_idx,objects.size());
+
+ Object* obj = ObjectDB::get_instance(objects[p_idx]);
+ if (!obj)
+ return;
+
+ EditorNode::get_singleton()->push_item(obj);
+}
+
+void EditorPath::_bind_methods() {
+
+ ClassDB::bind_method("_gui_input",&EditorPath::_gui_input);
+ ClassDB::bind_method("_popup_select",&EditorPath::_popup_select);
+}
+
EditorPath::EditorPath(EditorHistory *p_history) {
history=p_history;
+ mouse_over=false;
+ popup = memnew( PopupMenu );
+ popup->connect("id_pressed",this,"_popup_select");
+ add_child(popup);
+
}
diff --git a/tools/editor/editor_path.h b/tools/editor/editor_path.h
index 11e1005ba3..fd5b469d07 100644
--- a/tools/editor/editor_path.h
+++ b/tools/editor/editor_path.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -30,19 +30,27 @@
#define EDITOR_PATH_H
#include "scene/gui/control.h"
+#include "scene/gui/popup_menu.h"
#include "editor_data.h"
class EditorPath : public Control {
- OBJ_TYPE(EditorPath,Control);
+ GDCLASS(EditorPath,Control);
EditorHistory *history;
+ Vector<ObjectID> objects;
+ PopupMenu *popup;
+ bool mouse_over;
EditorPath();
+ void _popup_select(int p_idx);
+ void _gui_input(const InputEvent& p_event);
+ void _add_children_to_popup(Object* p_obj,int p_depth=0);
protected:
+ static void _bind_methods();
void _notification(int p_what);
public:
diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp
index 4b82d5e59c..8769fe2cd8 100644
--- a/tools/editor/editor_plugin.cpp
+++ b/tools/editor/editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -76,6 +76,11 @@ Control * EditorPlugin::get_editor_viewport() {
return EditorNode::get_singleton()->get_viewport();
}
+void EditorPlugin::edit_resource(const Ref<Resource>& p_resource){
+
+ EditorNode::get_singleton()->edit_resource(p_resource);
+}
+
void EditorPlugin::add_control_to_container(CustomControlContainer p_location,Control *p_control) {
switch(p_location) {
@@ -136,15 +141,15 @@ Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial* p_spatial) {
return Ref<SpatialEditorGizmo>();
}
-bool EditorPlugin::forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) {
+bool EditorPlugin::forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) {
- if (get_script_instance() && get_script_instance()->has_method("forward_canvas_input_event")) {
- return get_script_instance()->call("forward_canvas_input_event",p_canvas_xform,p_event);
+ if (get_script_instance() && get_script_instance()->has_method("forward_canvas_gui_input")) {
+ return get_script_instance()->call("forward_canvas_gui_input",p_canvas_xform,p_event);
}
return false;
}
-void EditorPlugin::forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control *p_canvas) {
+void EditorPlugin::forward_draw_over_canvas(const Transform2D& p_canvas_xform,Control *p_canvas) {
if (get_script_instance() && get_script_instance()->has_method("forward_draw_over_canvas")) {
get_script_instance()->call("forward_draw_over_canvas",p_canvas_xform,p_canvas);
@@ -155,10 +160,10 @@ void EditorPlugin::update_canvas() {
CanvasItemEditor::get_singleton()->get_viewport_control()->update();
}
-bool EditorPlugin::forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event) {
+bool EditorPlugin::forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) {
- if (get_script_instance() && get_script_instance()->has_method("forward_spatial_input_event")) {
- return get_script_instance()->call("forward_spatial_input_event",p_camera,p_event);
+ if (get_script_instance() && get_script_instance()->has_method("forward_spatial_gui_input")) {
+ return get_script_instance()->call("forward_spatial_gui_input",p_camera,p_event);
}
return false;
@@ -248,7 +253,7 @@ void EditorPlugin::apply_changes() {
void EditorPlugin::get_breakpoints(List<String> *p_breakpoints) {
if (get_script_instance() && get_script_instance()->has_method("get_breakpoints")) {
- StringArray arr = get_script_instance()->call("get_breakpoints");
+ PoolStringArray arr = get_script_instance()->call("get_breakpoints");
for(int i=0;i<arr.size();i++)
p_breakpoints->push_back(arr[i]);
}
@@ -341,56 +346,57 @@ EditorFileSystem *EditorPlugin::get_resource_file_system() {
void EditorPlugin::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("add_control_to_container","container","control:Control"),&EditorPlugin::add_control_to_container);
- ObjectTypeDB::bind_method(_MD("add_control_to_bottom_panel:ToolButton","control:Control","title"),&EditorPlugin::add_control_to_bottom_panel);
- ObjectTypeDB::bind_method(_MD("add_control_to_dock","slot","control:Control"),&EditorPlugin::add_control_to_dock);
- ObjectTypeDB::bind_method(_MD("remove_control_from_docks","control:Control"),&EditorPlugin::remove_control_from_docks);
- ObjectTypeDB::bind_method(_MD("remove_control_from_bottom_panel","control:Control"),&EditorPlugin::remove_control_from_bottom_panel);
- ObjectTypeDB::bind_method(_MD("add_custom_type","type","base","script:Script","icon:Texture"),&EditorPlugin::add_custom_type);
- ObjectTypeDB::bind_method(_MD("remove_custom_type","type"),&EditorPlugin::remove_custom_type);
- ObjectTypeDB::bind_method(_MD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport);
+ ClassDB::bind_method(_MD("add_control_to_container","container","control:Control"),&EditorPlugin::add_control_to_container);
+ ClassDB::bind_method(_MD("add_control_to_bottom_panel:ToolButton","control:Control","title"),&EditorPlugin::add_control_to_bottom_panel);
+ ClassDB::bind_method(_MD("add_control_to_dock","slot","control:Control"),&EditorPlugin::add_control_to_dock);
+ ClassDB::bind_method(_MD("remove_control_from_docks","control:Control"),&EditorPlugin::remove_control_from_docks);
+ ClassDB::bind_method(_MD("remove_control_from_bottom_panel","control:Control"),&EditorPlugin::remove_control_from_bottom_panel);
+ ClassDB::bind_method(_MD("add_custom_type","type","base","script:Script","icon:Texture"),&EditorPlugin::add_custom_type);
+ ClassDB::bind_method(_MD("remove_custom_type","type"),&EditorPlugin::remove_custom_type);
+ ClassDB::bind_method(_MD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport);
- ObjectTypeDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::add_import_plugin);
- ObjectTypeDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::remove_import_plugin);
+ ClassDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::add_import_plugin);
+ ClassDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::remove_import_plugin);
- ObjectTypeDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::add_export_plugin);
- ObjectTypeDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::remove_export_plugin);
+ ClassDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::add_export_plugin);
+ ClassDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::remove_export_plugin);
- ObjectTypeDB::bind_method(_MD("get_resource_previewer:EditorResourcePreview"),&EditorPlugin::get_resource_previewer);
- ObjectTypeDB::bind_method(_MD("get_resource_filesystem:EditorFileSystem"),&EditorPlugin::get_resource_file_system);
+ ClassDB::bind_method(_MD("get_resource_previewer:EditorResourcePreview"),&EditorPlugin::get_resource_previewer);
+ ClassDB::bind_method(_MD("get_resource_filesystem:EditorFileSystem"),&EditorPlugin::get_resource_file_system);
- ObjectTypeDB::bind_method(_MD("inspect_object","object","for_property"),&EditorPlugin::inspect_object,DEFVAL(String()));
- ObjectTypeDB::bind_method(_MD("update_canvas"),&EditorPlugin::update_canvas);
+ ClassDB::bind_method(_MD("inspect_object","object","for_property"),&EditorPlugin::inspect_object,DEFVAL(String()));
+ ClassDB::bind_method(_MD("update_canvas"),&EditorPlugin::update_canvas);
- ObjectTypeDB::bind_method(_MD("make_bottom_panel_item_visible","item:Control"), &EditorPlugin::make_bottom_panel_item_visible);
- ObjectTypeDB::bind_method(_MD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel);
+ ClassDB::bind_method(_MD("make_bottom_panel_item_visible","item:Control"), &EditorPlugin::make_bottom_panel_item_visible);
+ ClassDB::bind_method(_MD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel);
- ObjectTypeDB::bind_method(_MD("get_base_control:Control"),&EditorPlugin::get_base_control);
- ObjectTypeDB::bind_method(_MD("get_undo_redo:UndoRedo"),&EditorPlugin::_get_undo_redo);
- ObjectTypeDB::bind_method(_MD("get_selection:EditorSelection"),&EditorPlugin::get_selection);
- ObjectTypeDB::bind_method(_MD("get_editor_settings:EditorSettings"),&EditorPlugin::get_editor_settings);
- ObjectTypeDB::bind_method(_MD("queue_save_layout"),&EditorPlugin::queue_save_layout);
+ ClassDB::bind_method(_MD("get_base_control:Control"),&EditorPlugin::get_base_control);
+ ClassDB::bind_method(_MD("get_undo_redo:UndoRedo"),&EditorPlugin::_get_undo_redo);
+ ClassDB::bind_method(_MD("get_selection:EditorSelection"),&EditorPlugin::get_selection);
+ ClassDB::bind_method(_MD("get_editor_settings:EditorSettings"),&EditorPlugin::get_editor_settings);
+ ClassDB::bind_method(_MD("queue_save_layout"),&EditorPlugin::queue_save_layout);
+ ClassDB::bind_method(_MD("edit_resource"),&EditorPlugin::edit_resource);
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"forward_canvas_input_event",PropertyInfo(Variant::MATRIX32,"canvas_xform"),PropertyInfo(Variant::INPUT_EVENT,"event")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("forward_draw_over_canvas",PropertyInfo(Variant::MATRIX32,"canvas_xform"),PropertyInfo(Variant::OBJECT,"canvas:Control")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"forward_spatial_input_event",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera"),PropertyInfo(Variant::INPUT_EVENT,"event")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"forward_canvas_gui_input",PropertyInfo(Variant::TRANSFORM2D,"canvas_xform"),PropertyInfo(Variant::INPUT_EVENT,"event")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("forward_draw_over_canvas",PropertyInfo(Variant::TRANSFORM2D,"canvas_xform"),PropertyInfo(Variant::OBJECT,"canvas:Control")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"forward_spatial_gui_input",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera"),PropertyInfo(Variant::INPUT_EVENT,"event")));
MethodInfo gizmo = MethodInfo(Variant::OBJECT,"create_spatial_gizmo",PropertyInfo(Variant::OBJECT,"for_spatial:Spatial"));
gizmo.return_val.hint=PROPERTY_HINT_RESOURCE_TYPE;
gizmo.return_val.hint_string="EditorSpatialGizmo";
- ObjectTypeDB::add_virtual_method(get_type_static(),gizmo);
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::STRING,"get_name"));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"has_main_screen"));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("make_visible",PropertyInfo(Variant::BOOL,"visible")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("edit",PropertyInfo(Variant::OBJECT,"object")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"handles",PropertyInfo(Variant::OBJECT,"object")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::DICTIONARY,"get_state"));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("set_state",PropertyInfo(Variant::DICTIONARY,"state")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("clear"));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("save_external_data"));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("apply_changes"));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::STRING_ARRAY,"get_breakpoints"));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("set_window_layout",PropertyInfo(Variant::OBJECT,"layout",PROPERTY_HINT_RESOURCE_TYPE,"ConfigFile")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("get_window_layout",PropertyInfo(Variant::OBJECT,"layout",PROPERTY_HINT_RESOURCE_TYPE,"ConfigFile")));
+ ClassDB::add_virtual_method(get_class_static(),gizmo);
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::STRING,"get_name"));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"has_main_screen"));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("make_visible",PropertyInfo(Variant::BOOL,"visible")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("edit",PropertyInfo(Variant::OBJECT,"object")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"handles",PropertyInfo(Variant::OBJECT,"object")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::DICTIONARY,"get_state"));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("set_state",PropertyInfo(Variant::DICTIONARY,"state")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("clear"));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("save_external_data"));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("apply_changes"));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::POOL_STRING_ARRAY,"get_breakpoints"));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("set_window_layout",PropertyInfo(Variant::OBJECT,"layout",PROPERTY_HINT_RESOURCE_TYPE,"ConfigFile")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo("get_window_layout",PropertyInfo(Variant::OBJECT,"layout",PROPERTY_HINT_RESOURCE_TYPE,"ConfigFile")));
BIND_CONSTANT( CONTAINER_TOOLBAR );
BIND_CONSTANT( CONTAINER_SPATIAL_EDITOR_MENU );
diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h
index 2700c49a6c..9943e94d98 100644
--- a/tools/editor/editor_plugin.h
+++ b/tools/editor/editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -53,7 +53,7 @@ class EditorFileSystem;
class EditorPlugin : public Node {
- OBJ_TYPE( EditorPlugin, Node );
+ GDCLASS( EditorPlugin, Node );
friend class EditorData;
UndoRedo *undo_redo;
@@ -101,11 +101,12 @@ public:
void remove_control_from_docks(Control *p_control);
void remove_control_from_bottom_panel(Control *p_control);
Control* get_editor_viewport();
+ void edit_resource(const Ref<Resource>& p_resource);
virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial);
- virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform, const InputEvent& p_event);
- virtual void forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control *p_canvas);
- virtual bool forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event);
+ virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform, const InputEvent& p_event);
+ virtual void forward_draw_over_canvas(const Transform2D& p_canvas_xform,Control *p_canvas);
+ virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event);
virtual String get_name() const;
virtual bool has_main_screen() const;
virtual void make_visible(bool p_visible);
diff --git a/tools/editor/editor_plugin_settings.cpp b/tools/editor/editor_plugin_settings.cpp
index 5342007e6d..208e576a8a 100644
--- a/tools/editor/editor_plugin_settings.cpp
+++ b/tools/editor/editor_plugin_settings.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -81,7 +81,7 @@ void EditorPluginSettings::update_plugins() {
plugins.sort();
- Vector<String> active_plugins = Globals::get_singleton()->get("plugins/active");
+ Vector<String> active_plugins = GlobalConfig::get_singleton()->get("plugins/active");
for(int i=0;i<plugins.size();i++) {
@@ -171,8 +171,8 @@ void EditorPluginSettings::_plugin_activity_changed() {
void EditorPluginSettings::_bind_methods() {
- ObjectTypeDB::bind_method("update_plugins",&EditorPluginSettings::update_plugins);
- ObjectTypeDB::bind_method("_plugin_activity_changed",&EditorPluginSettings::_plugin_activity_changed);
+ ClassDB::bind_method("update_plugins",&EditorPluginSettings::update_plugins);
+ ClassDB::bind_method("_plugin_activity_changed",&EditorPluginSettings::_plugin_activity_changed);
}
EditorPluginSettings::EditorPluginSettings() {
diff --git a/tools/editor/editor_plugin_settings.h b/tools/editor/editor_plugin_settings.h
index 4a982e40e2..e24880a21d 100644
--- a/tools/editor/editor_plugin_settings.h
+++ b/tools/editor/editor_plugin_settings.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,7 +37,7 @@
class EditorPluginSettings : public VBoxContainer {
- OBJ_TYPE(EditorPluginSettings,VBoxContainer);
+ GDCLASS(EditorPluginSettings,VBoxContainer);
Button* update_list;
Tree *plugin_list;
diff --git a/tools/editor/editor_profiler.cpp b/tools/editor/editor_profiler.cpp
index 13327f0be9..5279711b0f 100644
--- a/tools/editor/editor_profiler.cpp
+++ b/tools/editor/editor_profiler.cpp
@@ -28,7 +28,7 @@ void EditorProfiler::add_frame_metric(const Metric& p_metric,bool p_final) {
if (!seeking) {
- cursor_metric_edit->set_val(frame_metrics[last_metric].frame_number);
+ cursor_metric_edit->set_value(frame_metrics[last_metric].frame_number);
if (hover_metric!=-1) {
hover_metric++;
if (hover_metric>=frame_metrics.size()) {
@@ -70,7 +70,7 @@ void EditorProfiler::clear() {
updating_frame=true;
cursor_metric_edit->set_min(0);
cursor_metric_edit->set_max(0);
- cursor_metric_edit->set_val(0);
+ cursor_metric_edit->set_value(0);
updating_frame=false;
hover_metric=-1;
seeking=false;
@@ -154,7 +154,7 @@ void EditorProfiler::_update_plot() {
}
- DVector<uint8_t>::Write wr = graph_image.write();
+ PoolVector<uint8_t>::Write wr = graph_image.write();
@@ -336,9 +336,9 @@ void EditorProfiler::_update_plot() {
}
- wr = DVector<uint8_t>::Write();
+ wr = PoolVector<uint8_t>::Write();
- Image img(w,h,0,Image::FORMAT_RGBA,graph_image);
+ Image img(w,h,0,Image::FORMAT_RGBA8,graph_image);
if (reset_texture) {
@@ -453,7 +453,7 @@ void EditorProfiler::_graph_tex_draw() {
if (seeking) {
int max_frames = frame_metrics.size();
- int frame = cursor_metric_edit->get_val() - (frame_metrics[last_metric].frame_number-max_frames+1);
+ int frame = cursor_metric_edit->get_value() - (frame_metrics[last_metric].frame_number-max_frames+1);
if (frame<0)
frame=0;
@@ -559,7 +559,7 @@ void EditorProfiler::_graph_tex_input(const InputEvent& p_ev){
}
if (valid)
- cursor_metric_edit->set_val(frame_metrics[metric].frame_number);
+ cursor_metric_edit->set_value(frame_metrics[metric].frame_number);
updating_frame=false;
@@ -590,7 +590,7 @@ int EditorProfiler::_get_cursor_index() const {
if (!frame_metrics[last_metric].valid)
return 0;
- int diff = (frame_metrics[last_metric].frame_number-cursor_metric_edit->get_val());
+ int diff = (frame_metrics[last_metric].frame_number-cursor_metric_edit->get_value());
int idx = last_metric - diff;
while (idx<0) {
@@ -617,16 +617,16 @@ void EditorProfiler::_combo_changed(int) {
void EditorProfiler::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_update_frame"),&EditorProfiler::_update_frame);
- ObjectTypeDB::bind_method(_MD("_update_plot"),&EditorProfiler::_update_plot);
- ObjectTypeDB::bind_method(_MD("_activate_pressed"),&EditorProfiler::_activate_pressed);
- ObjectTypeDB::bind_method(_MD("_graph_tex_draw"),&EditorProfiler::_graph_tex_draw);
- ObjectTypeDB::bind_method(_MD("_graph_tex_input"),&EditorProfiler::_graph_tex_input);
- ObjectTypeDB::bind_method(_MD("_graph_tex_mouse_exit"),&EditorProfiler::_graph_tex_mouse_exit);
- ObjectTypeDB::bind_method(_MD("_cursor_metric_changed"),&EditorProfiler::_cursor_metric_changed);
- ObjectTypeDB::bind_method(_MD("_combo_changed"),&EditorProfiler::_combo_changed);
+ ClassDB::bind_method(_MD("_update_frame"),&EditorProfiler::_update_frame);
+ ClassDB::bind_method(_MD("_update_plot"),&EditorProfiler::_update_plot);
+ ClassDB::bind_method(_MD("_activate_pressed"),&EditorProfiler::_activate_pressed);
+ ClassDB::bind_method(_MD("_graph_tex_draw"),&EditorProfiler::_graph_tex_draw);
+ ClassDB::bind_method(_MD("_graph_tex_input"),&EditorProfiler::_graph_tex_input);
+ ClassDB::bind_method(_MD("_graph_tex_mouse_exit"),&EditorProfiler::_graph_tex_mouse_exit);
+ ClassDB::bind_method(_MD("_cursor_metric_changed"),&EditorProfiler::_cursor_metric_changed);
+ ClassDB::bind_method(_MD("_combo_changed"),&EditorProfiler::_combo_changed);
- ObjectTypeDB::bind_method(_MD("_item_edited"),&EditorProfiler::_item_edited);
+ ClassDB::bind_method(_MD("_item_edited"),&EditorProfiler::_item_edited);
ADD_SIGNAL( MethodInfo("enable_profiling",PropertyInfo(Variant::BOOL,"enable")));
ADD_SIGNAL( MethodInfo("break_request"));
@@ -708,13 +708,13 @@ EditorProfiler::EditorProfiler()
variables->connect("item_edited",this,"_item_edited");
- graph = memnew( TextureFrame );
+ graph = memnew( TextureRect );
graph->set_expand(true);
- graph->set_stop_mouse(true);
- graph->set_ignore_mouse(false);
+ graph->set_mouse_filter(MOUSE_FILTER_STOP);
+ //graph->set_ignore_mouse(false);
graph->connect("draw",this,"_graph_tex_draw");
- graph->connect("input_event",this,"_graph_tex_input");
- graph->connect("mouse_exit",this,"_graph_tex_mouse_exit");
+ graph->connect("gui_input",this,"_graph_tex_input");
+ graph->connect("mouse_exited",this,"_graph_tex_mouse_exit");
h_split->add_child(graph);
graph->set_h_size_flags(SIZE_EXPAND_FILL);
@@ -724,7 +724,7 @@ EditorProfiler::EditorProfiler()
int metric_size=CLAMP(int(EDITOR_DEF("debugger/profiler_frame_history_size",600)),60,1024);
frame_metrics.resize(metric_size);
last_metric=-1;
-// cursor_metric=-1;
+ //cursor_metric=-1;
hover_metric=-1;
@@ -750,6 +750,6 @@ EditorProfiler::EditorProfiler()
seeking=false;
graph_height=1;
-// activate->set_disabled(true);
+ //activate->set_disabled(true);
}
diff --git a/tools/editor/editor_profiler.h b/tools/editor/editor_profiler.h
index f5cea118ce..52b38cdae8 100644
--- a/tools/editor/editor_profiler.h
+++ b/tools/editor/editor_profiler.h
@@ -3,7 +3,7 @@
#include "scene/gui/box_container.h"
-#include "scene/gui/texture_frame.h"
+#include "scene/gui/texture_rect.h"
#include "scene/gui/button.h"
#include "scene/gui/label.h"
#include "scene/gui/tree.h"
@@ -14,7 +14,7 @@
class EditorProfiler : public VBoxContainer {
- OBJ_TYPE(EditorProfiler,VBoxContainer)
+ GDCLASS(EditorProfiler,VBoxContainer)
public:
@@ -71,9 +71,9 @@ public:
private:
Button *activate;
- TextureFrame *graph;
+ TextureRect *graph;
Ref<ImageTexture> graph_texture;
- DVector<uint8_t> graph_image;
+ PoolVector<uint8_t> graph_image;
Tree *variables;
HSplitContainer *h_split;
diff --git a/tools/editor/editor_reimport_dialog.cpp b/tools/editor/editor_reimport_dialog.cpp
index b6311a7604..c6a8f13dc7 100644
--- a/tools/editor/editor_reimport_dialog.cpp
+++ b/tools/editor/editor_reimport_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -135,7 +135,7 @@ EditorReImportDialog::EditorReImportDialog() {
tree = memnew( Tree );
add_child(tree);
tree->set_hide_root(true);
- set_child_rect(tree);
+ //set_child_rect(tree);
set_title(TTR("Re-Import Changed Resources"));
error = memnew( AcceptDialog);
add_child(error);
diff --git a/tools/editor/editor_reimport_dialog.h b/tools/editor/editor_reimport_dialog.h
index 0c2d0eb52c..68e1ca0597 100644
--- a/tools/editor/editor_reimport_dialog.h
+++ b/tools/editor/editor_reimport_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -34,7 +34,7 @@
class EditorReImportDialog : public ConfirmationDialog {
- OBJ_TYPE(EditorReImportDialog,ConfirmationDialog);
+ GDCLASS(EditorReImportDialog,ConfirmationDialog);
Tree *tree;
Vector<TreeItem*> items;
diff --git a/tools/editor/editor_resource_preview.cpp b/tools/editor/editor_resource_preview.cpp
index 6afc3e2a34..76ae53d821 100644
--- a/tools/editor/editor_resource_preview.cpp
+++ b/tools/editor/editor_resource_preview.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -69,9 +69,9 @@ Ref<Texture> EditorResourcePreviewGenerator::generate_from_path(const String& p_
void EditorResourcePreviewGenerator::_bind_methods() {
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"handles",PropertyInfo(Variant::STRING,"type")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::OBJECT,"generate:Texture",PropertyInfo(Variant::OBJECT,"from",PROPERTY_HINT_RESOURCE_TYPE,"Resource")));
- ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::OBJECT,"generate_from_path:Texture",PropertyInfo(Variant::STRING,"path",PROPERTY_HINT_FILE)));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"handles",PropertyInfo(Variant::STRING,"type")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::OBJECT,"generate:Texture",PropertyInfo(Variant::OBJECT,"from",PROPERTY_HINT_RESOURCE_TYPE,"Resource")));
+ ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::OBJECT,"generate_from_path:Texture",PropertyInfo(Variant::STRING,"path",PROPERTY_HINT_FILE)));
}
@@ -127,7 +127,7 @@ Ref<Texture> EditorResourcePreview::_generate_preview(const QueueItem& p_item,co
String type;
if (p_item.resource.is_valid())
- type=p_item.resource->get_type();
+ type=p_item.resource->get_class();
else
type=ResourceLoader::get_resource_type(p_item.path);
//print_line("resource type is: "+type);
@@ -154,7 +154,7 @@ Ref<Texture> EditorResourcePreview::_generate_preview(const QueueItem& p_item,co
// cache the preview in case it's a resource on disk
if (generated.is_valid()) {
//print_line("was generated");
- int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
thumbnail_size*=EDSCALE;
//wow it generated a preview... save cache
ResourceSaver::save(cache_base+".png",generated);
@@ -207,7 +207,7 @@ void EditorResourcePreview::_thread() {
//print_line("pop from queue "+item.path);
- int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
thumbnail_size*=EDSCALE;
@@ -221,7 +221,7 @@ void EditorResourcePreview::_thread() {
String temp_path=EditorSettings::get_singleton()->get_settings_path().plus_file("tmp");
- String cache_base = Globals::get_singleton()->globalize_path(item.path).md5_text();
+ String cache_base = GlobalConfig::get_singleton()->globalize_path(item.path).md5_text();
cache_base = temp_path.plus_file("resthumb-"+cache_base);
//does not have it, try to load a cached thumbnail
@@ -267,6 +267,8 @@ void EditorResourcePreview::_thread() {
memdelete(f);
}
+ cache_valid=false;
+
if (cache_valid) {
texture = ResourceLoader::load(cache_base+".png","ImageTexture",true);
@@ -374,13 +376,13 @@ EditorResourcePreview* EditorResourcePreview::get_singleton() {
void EditorResourcePreview::_bind_methods() {
- ObjectTypeDB::bind_method("_preview_ready",&EditorResourcePreview::_preview_ready);
+ ClassDB::bind_method("_preview_ready",&EditorResourcePreview::_preview_ready);
- ObjectTypeDB::bind_method(_MD("queue_resource_preview","path","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_resource_preview);
- ObjectTypeDB::bind_method(_MD("queue_edited_resource_preview","resource:Resource","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_edited_resource_preview);
- ObjectTypeDB::bind_method(_MD("add_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::add_preview_generator);
- ObjectTypeDB::bind_method(_MD("remove_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::remove_preview_generator);
- ObjectTypeDB::bind_method(_MD("check_for_invalidation","path"),&EditorResourcePreview::check_for_invalidation);
+ ClassDB::bind_method(_MD("queue_resource_preview","path","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_resource_preview);
+ ClassDB::bind_method(_MD("queue_edited_resource_preview","resource:Resource","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_edited_resource_preview);
+ ClassDB::bind_method(_MD("add_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::add_preview_generator);
+ ClassDB::bind_method(_MD("remove_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::remove_preview_generator);
+ ClassDB::bind_method(_MD("check_for_invalidation","path"),&EditorResourcePreview::check_for_invalidation);
ADD_SIGNAL(MethodInfo("preview_invalidated",PropertyInfo(Variant::STRING,"path")));
diff --git a/tools/editor/editor_resource_preview.h b/tools/editor/editor_resource_preview.h
index 2756360130..e4a593330d 100644
--- a/tools/editor/editor_resource_preview.h
+++ b/tools/editor/editor_resource_preview.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -55,7 +55,7 @@
class EditorResourcePreviewGenerator : public Reference {
- OBJ_TYPE(EditorResourcePreviewGenerator,Reference );
+ GDCLASS(EditorResourcePreviewGenerator,Reference );
protected:
@@ -72,7 +72,7 @@ public:
class EditorResourcePreview : public Node {
- OBJ_TYPE(EditorResourcePreview,Node);
+ GDCLASS(EditorResourcePreview,Node);
static EditorResourcePreview* singleton;
diff --git a/tools/editor/editor_run.cpp b/tools/editor/editor_run.cpp
index fb0f24c084..7d79412b3b 100644
--- a/tools/editor/editor_run.cpp
+++ b/tools/editor/editor_run.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -39,7 +39,7 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List
List<String> args;
- String resource_path = Globals::get_singleton()->get_resource_path();
+ String resource_path = GlobalConfig::get_singleton()->get_resource_path();
if (resource_path!="") {
args.push_back("-path");
@@ -49,17 +49,11 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List
if (true) {
args.push_back("-rdebug");
- args.push_back("localhost:"+String::num(GLOBAL_DEF("debug/debug_port", 6007)));
+ args.push_back("localhost:"+String::num(GLOBAL_GET("network/debug/remote_port")));
}
- if (p_custom_args!="") {
-
- Vector<String> cargs=p_custom_args.split(" ",false);
- for(int i=0;i<cargs.size();i++) {
-
- args.push_back(cargs[i].replace("%20"," ").replace("$scene",p_edited_scene.replace(" ","%20")));
- }
- }
+ args.push_back("-epid");
+ args.push_back(String::num(OS::get_singleton()->get_process_ID()));
if (debug_collisions) {
args.push_back("-debugcol");
@@ -69,7 +63,7 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List
args.push_back("-debugnav");
}
- int screen = EditorSettings::get_singleton()->get("game_window_placement/screen");
+ int screen = EditorSettings::get_singleton()->get("run/window_placement/screen");
if (screen==0) {
screen=OS::get_singleton()->get_current_screen();
@@ -84,19 +78,19 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List
Size2 desired_size;
- desired_size.x=Globals::get_singleton()->get("display/width");
- desired_size.y=Globals::get_singleton()->get("display/height");
+ desired_size.x=GlobalConfig::get_singleton()->get("display/width");
+ desired_size.y=GlobalConfig::get_singleton()->get("display/height");
Size2 test_size;
- test_size.x=Globals::get_singleton()->get("display/test_width");
- test_size.y=Globals::get_singleton()->get("display/test_height");
+ test_size.x=GlobalConfig::get_singleton()->get("display/test_width");
+ test_size.y=GlobalConfig::get_singleton()->get("display/test_height");
if (test_size.x>0 && test_size.y>0) {
desired_size=test_size;
}
- int window_placement=EditorSettings::get_singleton()->get("game_window_placement/rect");
+ int window_placement=EditorSettings::get_singleton()->get("run/window_placement/rect");
switch(window_placement) {
case 0: { // default
@@ -110,7 +104,7 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List
args.push_back(itos(pos.x)+"x"+itos(pos.y));
} break;
case 2: { // custom pos
- Vector2 pos = EditorSettings::get_singleton()->get("game_window_placement/rect_custom_position");
+ Vector2 pos = EditorSettings::get_singleton()->get("run/window_placement/rect_custom_position");
pos+=screen_rect.pos;
args.push_back("-p");
args.push_back(itos(pos.x)+"x"+itos(pos.y));
@@ -132,6 +126,7 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List
}
+
if (p_breakpoints.size()) {
args.push_back("-bp");
@@ -146,7 +141,12 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List
args.push_back(bpoints);
}
- args.push_back(p_scene);
+ if (p_custom_args!="") {
+ Vector<String> cargs=p_custom_args.split(" ",false);
+ for(int i=0;i<cargs.size();i++) {
+ args.push_back(cargs[i].replace("$scene",p_scene).replace(" ","%20"));
+ }
+ }
String exec = OS::get_singleton()->get_executable_path();
diff --git a/tools/editor/editor_run.h b/tools/editor/editor_run.h
index 0b96a2c91c..78fa892488 100644
--- a/tools/editor/editor_run.h
+++ b/tools/editor/editor_run.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -53,6 +53,8 @@ public:
void run_native_notify() { status=STATUS_PLAY; }
void stop();
+ OS::ProcessID get_pid() const { return pid; }
+
void set_debug_collisions(bool p_debug);
bool get_debug_collisions() const;
diff --git a/tools/editor/editor_run_native.cpp b/tools/editor/editor_run_native.cpp
index edbcc71284..caa1bf5db7 100644
--- a/tools/editor/editor_run_native.cpp
+++ b/tools/editor/editor_run_native.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -54,7 +54,8 @@ void EditorRunNative::_notification(int p_what) {
Ref<ImageTexture> small_icon = memnew( ImageTexture);
small_icon->create_from_image(im);
MenuButton *mb = memnew( MenuButton );
- mb->get_popup()->connect("item_pressed",this,"_run_native",varray(E->get()));
+ mb->get_popup()->connect("id_pressed",this,"_run_native",varray(E->get()));
+ mb->connect("pressed",this,"_run_native",varray(-1, E->get()));
mb->set_icon(small_icon);
add_child(mb);
menus[E->get()]=mb;
@@ -79,13 +80,16 @@ void EditorRunNative::_notification(int p_what) {
if (dc==0) {
mb->hide();
} else {
-
mb->get_popup()->clear();
mb->show();
- for(int i=0;i<dc;i++) {
-
- mb->get_popup()->add_icon_item(get_icon("Play","EditorIcons"),eep->get_device_name(i));
- mb->get_popup()->set_item_tooltip(mb->get_popup()->get_item_count() -1,eep->get_device_info(i));
+ if (dc == 1) {
+ mb->set_tooltip(eep->get_device_name(0) + "\n\n" + eep->get_device_info(0).strip_edges());
+ } else {
+ mb->set_tooltip("Select device from the list");
+ for(int i=0;i<dc;i++) {
+ mb->get_popup()->add_icon_item(get_icon("Play","EditorIcons"),eep->get_device_name(i));
+ mb->get_popup()->set_item_tooltip(mb->get_popup()->get_item_count() -1,eep->get_device_info(i).strip_edges());
+ }
}
}
}
@@ -96,11 +100,18 @@ void EditorRunNative::_notification(int p_what) {
}
-
void EditorRunNative::_run_native(int p_idx,const String& p_platform) {
Ref<EditorExportPlatform> eep = EditorImportExport::get_singleton()->get_export_platform(p_platform);
ERR_FAIL_COND(eep.is_null());
+ if (p_idx == -1) {
+ if (eep->get_device_count() == 1) {
+ menus[p_platform]->get_popup()->hide();
+ p_idx = 0;
+ } else {
+ return;
+ }
+ }
emit_signal("native_run");
int flags=0;
@@ -118,7 +129,7 @@ void EditorRunNative::_run_native(int p_idx,const String& p_platform) {
void EditorRunNative::_bind_methods() {
- ObjectTypeDB::bind_method("_run_native",&EditorRunNative::_run_native);
+ ClassDB::bind_method("_run_native",&EditorRunNative::_run_native);
ADD_SIGNAL(MethodInfo("native_run"));
}
diff --git a/tools/editor/editor_run_native.h b/tools/editor/editor_run_native.h
index 04dad6b6aa..c62021148b 100644
--- a/tools/editor/editor_run_native.h
+++ b/tools/editor/editor_run_native.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -34,7 +34,7 @@
class EditorRunNative : public HBoxContainer {
- OBJ_TYPE(EditorRunNative,BoxContainer);
+ GDCLASS(EditorRunNative,BoxContainer);
Map<StringName,MenuButton*> menus;
bool first;
diff --git a/tools/editor/editor_run_script.cpp b/tools/editor/editor_run_script.cpp
index 765f36d3bc..4a3cbfbccb 100644
--- a/tools/editor/editor_run_script.cpp
+++ b/tools/editor/editor_run_script.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -46,7 +46,7 @@ void EditorScript::add_root_node(Node *p_node) {
return;
}
-// editor->set_edited_scene(p_node);
+ //editor->set_edited_scene(p_node);
}
Node *EditorScript::get_scene() {
@@ -86,8 +86,8 @@ void EditorScript::set_editor(EditorNode *p_editor) {
void EditorScript::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("add_root_node","node"),&EditorScript::add_root_node);
- ObjectTypeDB::bind_method(_MD("get_scene"),&EditorScript::get_scene);
+ ClassDB::bind_method(_MD("add_root_node","node"),&EditorScript::add_root_node);
+ ClassDB::bind_method(_MD("get_scene"),&EditorScript::get_scene);
BIND_VMETHOD( MethodInfo("_run") );
diff --git a/tools/editor/editor_run_script.h b/tools/editor/editor_run_script.h
index 144fad5ab1..3ab8525cc6 100644
--- a/tools/editor/editor_run_script.h
+++ b/tools/editor/editor_run_script.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -35,7 +35,7 @@
class EditorNode;
class EditorScript : public Reference {
- OBJ_TYPE( EditorScript, Reference );
+ GDCLASS( EditorScript, Reference );
EditorNode *editor;
protected:
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index 4778a7ce90..807183ae46 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -3,9 +3,9 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* http:/www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -47,6 +47,9 @@
#include "io/compression.h"
#include "os/keyboard.h"
+
+
+
Ref<EditorSettings> EditorSettings::singleton=NULL;
EditorSettings *EditorSettings::get_singleton() {
@@ -123,8 +126,10 @@ bool EditorSettings::_get(const StringName& p_name,Variant &r_ret) const {
}
const VariantContainer *v=props.getptr(p_name);
- if (!v)
+ if (!v) {
+ //print_line("WARNING NOT FOUND: "+String(p_name));
return false;
+ }
r_ret = v->variant;
return true;
}
@@ -238,6 +243,7 @@ void EditorSettings::create() {
String exe_path = OS::get_singleton()->get_executable_path().get_base_dir();
DirAccess* d = DirAccess::create_for_path(exe_path);
+
if (d->file_exists(exe_path + "/._sc_")) {
// editor is self contained
@@ -257,7 +263,7 @@ void EditorSettings::create() {
}
};
- ObjectTypeDB::register_type<EditorSettings>(); //otherwise it can't be unserialized
+ ClassDB::register_class<EditorSettings>(); //otherwise it can't be unserialized
String config_file_path;
if (config_path!=""){
@@ -307,7 +313,7 @@ void EditorSettings::create() {
dir->change_dir("config");
- String pcp=Globals::get_singleton()->get_resource_path();
+ String pcp=GlobalConfig::get_singleton()->get_resource_path();
if (pcp.ends_with("/"))
pcp=config_path.substr(0,pcp.size()-1);
pcp=pcp.get_file()+"-"+pcp.md5_text();
@@ -322,21 +328,14 @@ void EditorSettings::create() {
// path at least is validated, so validate config file
-
- config_file_path = config_path+"/"+config_dir+"/editor_settings.tres";
+ String config_file_name = "editor_settings-" + String(_MKSTR(VERSION_MAJOR)) + ".tres";
+ config_file_path = config_path + "/" + config_dir + "/" + config_file_name;
String open_path = config_file_path;
- if (!dir->file_exists("editor_settings.tres")) {
+ if (!dir->file_exists(config_file_name)) {
- open_path = config_path+"/"+config_dir+"/editor_settings.xml";
-
- if (!dir->file_exists("editor_settings.xml")) {
-
- memdelete(dir);
- WARN_PRINT("Config file does not exist, creating.");
- goto fail;
- }
+ goto fail;
}
memdelete(dir);
@@ -402,9 +401,9 @@ String EditorSettings::get_settings_path() const {
void EditorSettings::setup_language() {
- String lang = get("global/editor_language");
+ String lang = get("interface/editor_language");
if (lang=="en")
- return; //none to do
+ return;//none to do
for(int i=0;i<translations.size();i++) {
if (translations[i]->get_locale()==lang) {
@@ -506,154 +505,159 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
best="en";
}
- set("global/editor_language",best);
- hints["global/editor_language"]=PropertyInfo(Variant::STRING,"global/editor_language",PROPERTY_HINT_ENUM,lang_hint,PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
+ set("interface/editor_language",best);
+ hints["interface/editor_language"]=PropertyInfo(Variant::STRING,"interface/editor_language",PROPERTY_HINT_ENUM,lang_hint,PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
}
- set("global/hidpi_mode",0);
- hints["global/hidpi_mode"]=PropertyInfo(Variant::INT,"global/hidpi_mode",PROPERTY_HINT_ENUM,"Auto,VeryLoDPI,LoDPI,MidDPI,HiDPI",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
- set("global/show_script_in_scene_tabs",false);
- set("global/font_size",14);
- hints["global/font_size"]=PropertyInfo(Variant::INT,"global/font_size",PROPERTY_HINT_RANGE,"10,40,1",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
- set("global/source_font_size",14);
- hints["global/source_font_size"]=PropertyInfo(Variant::INT,"global/source_font_size",PROPERTY_HINT_RANGE,"8,96,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","");
- hints["global/default_project_path"]=PropertyInfo(Variant::STRING,"global/default_project_path",PROPERTY_HINT_GLOBAL_DIR);
- set("global/default_project_export_path","");
+ set("interface/hidpi_mode",0);
+ hints["interface/hidpi_mode"]=PropertyInfo(Variant::INT,"interface/hidpi_mode",PROPERTY_HINT_ENUM,"Auto,VeryLoDPI,LoDPI,MidDPI,HiDPI",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
+ set("interface/show_script_in_scene_tabs",false);
+ set("interface/font_size",14);
+ hints["interface/font_size"]=PropertyInfo(Variant::INT,"interface/font_size",PROPERTY_HINT_RANGE,"10,40,1",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
+ set("interface/source_font_size",14);
+ hints["interface/source_font_size"]=PropertyInfo(Variant::INT,"interface/source_font_size",PROPERTY_HINT_RANGE,"8,96,1",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
+ set("interface/custom_font","");
+ hints["interface/custom_font"]=PropertyInfo(Variant::STRING,"interface/custom_font",PROPERTY_HINT_GLOBAL_FILE,"*.fnt",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
+ set("interface/custom_theme","");
+ hints["interface/custom_theme"]=PropertyInfo(Variant::STRING,"interface/custom_theme",PROPERTY_HINT_GLOBAL_FILE,"*.res,*.tres,*.theme",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
+
+
+ set("filesystem/directories/autoscan_project_path","");
+ hints["filesystem/directories/autoscan_project_path"]=PropertyInfo(Variant::STRING,"filesystem/directories/autoscan_project_path",PROPERTY_HINT_GLOBAL_DIR);
+ set("filesystem/directories/default_project_path","");
+ hints["filesystem/directories/default_project_path"]=PropertyInfo(Variant::STRING,"filesystem/directories/default_project_path",PROPERTY_HINT_GLOBAL_DIR);
+ set("filesystem/directories/default_project_export_path","");
hints["global/default_project_export_path"]=PropertyInfo(Variant::STRING,"global/default_project_export_path",PROPERTY_HINT_GLOBAL_DIR);
- set("global/show_script_in_scene_tabs",false);
+ set("interface/show_script_in_scene_tabs",false);
+
+
+ set("text_editor/theme/color_theme","Default");
+ hints["text_editor/theme/color_theme"]=PropertyInfo(Variant::STRING,"text_editor/theme/color_theme",PROPERTY_HINT_ENUM,"Default");
+ set("text_editor/theme/line_spacing",4);
- set("text_editor/color_theme","Default");
- hints["text_editor/color_theme"]=PropertyInfo(Variant::STRING,"text_editor/color_theme",PROPERTY_HINT_ENUM,"Default");
_load_default_text_editor_theme();
- set("text_editor/syntax_highlighting", true);
-
- set("text_editor/highlight_all_occurrences", true);
- set("text_editor/scroll_past_end_of_file", false);
-
- set("text_editor/tab_size", 4);
- hints["text_editor/tab_size"]=PropertyInfo(Variant::INT,"text_editor/tab_size",PROPERTY_HINT_RANGE,"1, 64, 1"); // size of 0 crashes.
- set("text_editor/draw_tabs", true);
-
- set("text_editor/show_line_numbers", true);
- set("text_editor/show_breakpoint_gutter", true);
-
- set("text_editor/trim_trailing_whitespace_on_save", false);
- set("text_editor/idle_parse_delay",2);
- set("text_editor/create_signal_callbacks",true);
- set("text_editor/autosave_interval_secs",0);
-
- set("text_editor/block_caret", false);
- set("text_editor/caret_blink", false);
- set("text_editor/caret_blink_speed", 0.65);
- hints["text_editor/caret_blink_speed"]=PropertyInfo(Variant::REAL,"text_editor/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1, 10, 0.1");
-
- set("text_editor/font","");
- hints["text_editor/font"]=PropertyInfo(Variant::STRING,"text_editor/font",PROPERTY_HINT_GLOBAL_FILE,"*.fnt");
- set("text_editor/auto_brace_complete", false);
- set("text_editor/restore_scripts_on_load",true);
-
-
- set("scenetree_editor/duplicate_node_name_num_separator",0);
- 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("grid_map/pick_distance", 5000.0);
-
- set("3d_editor/grid_color",Color(0,1,0,0.2));
- hints["3d_editor/grid_color"]=PropertyInfo(Variant::COLOR,"3d_editor/grid_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
-
- set("3d_editor/default_fov",45.0);
- set("3d_editor/default_z_near",0.1);
- set("3d_editor/default_z_far",500.0);
-
- set("3d_editor/navigation_scheme",0);
- hints["3d_editor/navigation_scheme"]=PropertyInfo(Variant::INT,"3d_editor/navigation_scheme",PROPERTY_HINT_ENUM,"Godot,Maya,Modo");
- set("3d_editor/zoom_style",0);
- hints["3d_editor/zoom_style"]=PropertyInfo(Variant::INT,"3d_editor/zoom_style",PROPERTY_HINT_ENUM,"Vertical, Horizontal");
- set("3d_editor/orbit_modifier",0);
- hints["3d_editor/orbit_modifier"]=PropertyInfo(Variant::INT,"3d_editor/orbit_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl");
- set("3d_editor/pan_modifier",1);
- hints["3d_editor/pan_modifier"]=PropertyInfo(Variant::INT,"3d_editor/pan_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl");
- set("3d_editor/zoom_modifier",4);
- hints["3d_editor/zoom_modifier"]=PropertyInfo(Variant::INT,"3d_editor/zoom_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl");
- set("3d_editor/emulate_numpad",false);
- set("3d_editor/emulate_3_button_mouse", false);
-
- set("2d_editor/bone_width",5);
- set("2d_editor/bone_color1",Color(1.0,1.0,1.0,0.9));
- set("2d_editor/bone_color2",Color(0.75,0.75,0.75,0.9));
- set("2d_editor/bone_selected_color",Color(0.9,0.45,0.45,0.9));
- set("2d_editor/bone_ik_color",Color(0.9,0.9,0.45,0.9));
-
- set("2d_editor/keep_margins_when_changing_anchors", false);
-
- set("game_window_placement/rect",0);
- hints["game_window_placement/rect"]=PropertyInfo(Variant::INT,"game_window_placement/rect",PROPERTY_HINT_ENUM,"Default,Centered,Custom Position,Force Maximized,Force Full Screen");
+ set("text_editor/highlighting/syntax_highlighting", true);
+
+ set("text_editor/highlighting/highlight_all_occurrences", true);
+ set("text_editor/cursor/scroll_past_end_of_file", false);
+
+ set("text_editor/indent/tab_size", 4);
+ hints["text_editor/indent/tab_size"]=PropertyInfo(Variant::INT,"text_editor/indent/tab_size",PROPERTY_HINT_RANGE,"1, 64, 1"); // size of 0 crashes.
+ set("text_editor/indent/draw_tabs", true);
+
+ set("text_editor/line_numbers/show_line_numbers", true);
+ set("text_editor/line_numbers/line_numbers_zero_padded", false);
+ set("text_editor/line_numbers/show_breakpoint_gutter", true);
+ set("text_editor/line_numbers/show_line_length_guideline", false);
+ set("text_editor/line_numbers/line_length_guideline_column", 80);
+ hints["text_editor/line_numbers/line_length_guideline_column"]=PropertyInfo(Variant::INT,"text_editor/line_numbers/line_length_guideline_column",PROPERTY_HINT_RANGE,"20, 160, 10");
+
+ set("text_editor/files/trim_trailing_whitespace_on_save", false);
+ set("text_editor/completion/idle_parse_delay",2);
+ set("text_editor/tools/create_signal_callbacks",true);
+ set("text_editor/files/autosave_interval_secs",0);
+
+ set("text_editor/cursor/block_caret", false);
+ set("text_editor/cursor/caret_blink", false);
+ set("text_editor/cursor/caret_blink_speed", 0.65);
+ hints["text_editor/cursor/caret_blink_speed"]=PropertyInfo(Variant::REAL,"text_editor/cursor/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1, 10, 0.1");
+
+ set("text_editor/theme/font","");
+ hints["text_editor/theme/font"]=PropertyInfo(Variant::STRING,"text_editor/theme/font",PROPERTY_HINT_GLOBAL_FILE,"*.fnt");
+ set("text_editor/completion/auto_brace_complete", false);
+ set("text_editor/files/restore_scripts_on_load",true);
+
+
+ //set("docks/scene_tree/display_old_action_buttons",false);
+ set("docks/scene_tree/start_create_dialog_fully_expanded",false);
+ set("docks/scene_tree/draw_relationship_lines",false);
+ set("docks/scene_tree/relationship_line_color",Color::html("464646"));
+
+ set("editors/grid_map/pick_distance", 5000.0);
+
+ set("editors/3d/grid_color",Color(0,1,0,0.2));
+ hints["editors/3d/grid_color"]=PropertyInfo(Variant::COLOR,"editors/3d/grid_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
+
+ set("editors/3d/default_fov",45.0);
+ set("editors/3d/default_z_near",0.1);
+ set("editors/3d/default_z_far",500.0);
+
+ set("editors/3d/navigation_scheme",0);
+ hints["editors/3d/navigation_scheme"]=PropertyInfo(Variant::INT,"editors/3d/navigation_scheme",PROPERTY_HINT_ENUM,"Godot,Maya,Modo");
+ set("editors/3d/zoom_style",0);
+ hints["editors/3d/zoom_style"]=PropertyInfo(Variant::INT,"editors/3d/zoom_style",PROPERTY_HINT_ENUM,"Vertical, Horizontal");
+ set("editors/3d/orbit_modifier",0);
+ hints["editors/3d/orbit_modifier"]=PropertyInfo(Variant::INT,"editors/3d/orbit_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl");
+ set("editors/3d/pan_modifier",1);
+ hints["editors/3d/pan_modifier"]=PropertyInfo(Variant::INT,"editors/3d/pan_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl");
+ set("editors/3d/zoom_modifier",4);
+ hints["editors/3d/zoom_modifier"]=PropertyInfo(Variant::INT,"editors/3d/zoom_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl");
+ set("editors/3d/emulate_numpad",false);
+ set("editors/3d/emulate_3_button_mouse", false);
+
+ set("editors/2d/bone_width",5);
+ set("editors/2d/bone_color1",Color(1.0,1.0,1.0,0.9));
+ set("editors/2d/bone_color2",Color(0.75,0.75,0.75,0.9));
+ set("editors/2d/bone_selected_color",Color(0.9,0.45,0.45,0.9));
+ set("editors/2d/bone_ik_color",Color(0.9,0.9,0.45,0.9));
+
+ set("editors/2d/keep_margins_when_changing_anchors", false);
+
+ set("run/window_placement/rect",0);
+ hints["run/window_placement/rect"]=PropertyInfo(Variant::INT,"run/window_placement/rect",PROPERTY_HINT_ENUM,"Default,Centered,Custom Position,Force Maximized,Force Full Screen");
String screen_hints=TTR("Default (Same as Editor)");
for(int i=0;i<OS::get_singleton()->get_screen_count();i++) {
screen_hints+=",Monitor "+itos(i+1);
}
- set("game_window_placement/rect_custom_position",Vector2());
- set("game_window_placement/screen",0);
- hints["game_window_placement/screen"]=PropertyInfo(Variant::INT,"game_window_placement/screen",PROPERTY_HINT_ENUM,screen_hints);
+ set("run/window_placement/rect_custom_position",Vector2());
+ set("run/window_placement/screen",0);
+ hints["run/window_placement/screen"]=PropertyInfo(Variant::INT,"run/window_placement/screen",PROPERTY_HINT_ENUM,screen_hints);
- set("on_save/compress_binary_resources",true);
- set("on_save/save_modified_external_resources",true);
- //set("on_save/save_paths_as_relative",false);
- //set("on_save/save_paths_without_extension",false);
+ set("filesystem/on_save/compress_binary_resources",true);
+ set("filesystem/on_save/save_modified_external_resources",true);
+ //set("filesystem/on_save/save_paths_as_relative",false);
+ //set("filesystem/on_save/save_paths_without_extension",false);
- set("text_editor/create_signal_callbacks",true);
+ set("text_editor/tools/create_signal_callbacks",true);
- set("file_dialog/show_hidden_files", false);
- set("file_dialog/display_mode", 0);
- hints["file_dialog/display_mode"]=PropertyInfo(Variant::INT,"file_dialog/display_mode",PROPERTY_HINT_ENUM,"Thumbnails,List");
- set("file_dialog/thumbnail_size", 64);
- hints["file_dialog/thumbnail_size"]=PropertyInfo(Variant::INT,"file_dialog/thumbnail_size",PROPERTY_HINT_RANGE,"32,128,16");
+ set("filesystem/file_dialog/show_hidden_files", false);
+ set("filesystem/file_dialog/display_mode", 0);
+ hints["filesystem/file_dialog/display_mode"]=PropertyInfo(Variant::INT,"filesystem/file_dialog/display_mode",PROPERTY_HINT_ENUM,"Thumbnails,List");
+ set("filesystem/file_dialog/thumbnail_size", 64);
+ hints["filesystem/file_dialog/thumbnail_size"]=PropertyInfo(Variant::INT,"filesystem/file_dialog/thumbnail_size",PROPERTY_HINT_RANGE,"32,128,16");
- set("filesystem_dock/display_mode", 0);
- hints["filesystem_dock/display_mode"]=PropertyInfo(Variant::INT,"filesystem_dock/display_mode",PROPERTY_HINT_ENUM,"Thumbnails,List");
- set("filesystem_dock/thumbnail_size", 64);
- hints["filesystem_dock/thumbnail_size"]=PropertyInfo(Variant::INT,"filesystem_dock/thumbnail_size",PROPERTY_HINT_RANGE,"32,128,16");
+ set("docks/filesystem/display_mode", 0);
+ hints["docks/filesystem/display_mode"]=PropertyInfo(Variant::INT,"docks/filesystem/display_mode",PROPERTY_HINT_ENUM,"Thumbnails,List");
+ set("docks/filesystem/thumbnail_size", 64);
+ hints["docks/filesystem/thumbnail_size"]=PropertyInfo(Variant::INT,"docks/filesystem/thumbnail_size",PROPERTY_HINT_RANGE,"32,128,16");
- set("animation/autorename_animation_tracks",true);
- set("animation/confirm_insert_track",true);
+ set("editors/animation/autorename_animation_tracks",true);
+ set("editors/animation/confirm_insert_track",true);
- set("property_editor/texture_preview_width",48);
- set("property_editor/auto_refresh_interval",0.3);
- set("help/doc_path","");
+ set("docks/property_editor/texture_preview_width",48);
+ set("docks/property_editor/auto_refresh_interval",0.3);
+ set("text_editor/help/doc_path","");
- set("import/ask_save_before_reimport",false);
+ set("filesystem/import/ask_save_before_reimport",false);
- set("import/pvrtc_texture_tool","");
+ set("filesystem/import/pvrtc_texture_tool","");
#ifdef WINDOWS_ENABLED
- hints["import/pvrtc_texture_tool"]=PropertyInfo(Variant::STRING,"import/pvrtc_texture_tool",PROPERTY_HINT_GLOBAL_FILE,"*.exe");
+ hints["filesystem/import/pvrtc_texture_tool"]=PropertyInfo(Variant::STRING,"import/pvrtc_texture_tool",PROPERTY_HINT_GLOBAL_FILE,"*.exe");
#else
hints["import/pvrtc_texture_tool"]=PropertyInfo(Variant::STRING,"import/pvrtc_texture_tool",PROPERTY_HINT_GLOBAL_FILE,"");
#endif
- // TODO: Rename to "import/pvrtc_fast_conversion" to match other names?
- set("PVRTC/fast_conversion",false);
+ // TODO: Rename to "filesystem/import/pvrtc_fast_conversion" to match other names?
+ set("filesystem/import/pvrtc_fast_conversion",false);
- set("run/auto_save_before_running",true);
- set("resources/save_compressed_resources",true);
- set("resources/auto_reload_modified_images",true);
+ set("run/auto_save/save_before_running",true);
+ set("filesystem/resources/save_compressed_resources",true);
+ set("filesystem/resources/auto_reload_modified_images",true);
- set("import/automatic_reimport_on_sources_changed",true);
+ set("filesystem/import/automatic_reimport_on_sources_changed",true);
if (p_extra_config.is_valid()) {
@@ -687,34 +691,34 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
}
void EditorSettings::_load_default_text_editor_theme() {
- set("text_editor/background_color",Color::html("3b000000"));
- set("text_editor/completion_background_color", Color::html("2C2A32"));
- set("text_editor/completion_selected_color", Color::html("434244"));
- set("text_editor/completion_existing_color", Color::html("21dfdfdf"));
- set("text_editor/completion_scroll_color", Color::html("ffffff"));
- set("text_editor/completion_font_color", Color::html("aaaaaa"));
- set("text_editor/caret_color",Color::html("aaaaaa"));
- set("text_editor/caret_background_color", Color::html("000000"));
- set("text_editor/line_number_color",Color::html("66aaaaaa"));
- set("text_editor/text_color",Color::html("aaaaaa"));
- set("text_editor/text_selected_color",Color::html("000000"));
- set("text_editor/keyword_color",Color::html("ffffb3"));
- set("text_editor/base_type_color",Color::html("a4ffd4"));
- set("text_editor/engine_type_color",Color::html("83d3ff"));
- set("text_editor/function_color",Color::html("66a2ce"));
- set("text_editor/member_variable_color",Color::html("e64e59"));
- set("text_editor/comment_color",Color::html("676767"));
- set("text_editor/string_color",Color::html("ef6ebe"));
- set("text_editor/number_color",Color::html("EB9532"));
- set("text_editor/symbol_color",Color::html("badfff"));
- set("text_editor/selection_color",Color::html("7b5dbe"));
- set("text_editor/brace_mismatch_color",Color(1,0.2,0.2));
- set("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15));
- set("text_editor/mark_color", Color(1.0,0.4,0.4,0.4));
- set("text_editor/breakpoint_color", Color(0.8,0.8,0.4,0.2));
- set("text_editor/word_highlighted_color",Color(0.8,0.9,0.9,0.15));
- set("text_editor/search_result_color",Color(0.05,0.25,0.05,1));
- set("text_editor/search_result_border_color",Color(0.1,0.45,0.1,1));
+ set("text_editor/highlighting/background_color",Color::html("3b000000"));
+ set("text_editor/highlighting/completion_background_color", Color::html("2C2A32"));
+ set("text_editor/highlighting/completion_selected_color", Color::html("434244"));
+ set("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf"));
+ set("text_editor/highlighting/completion_scroll_color", Color::html("ffffff"));
+ set("text_editor/highlighting/completion_font_color", Color::html("aaaaaa"));
+ set("text_editor/highlighting/caret_color",Color::html("aaaaaa"));
+ set("text_editor/highlighting/caret_background_color", Color::html("000000"));
+ set("text_editor/highlighting/line_number_color",Color::html("66aaaaaa"));
+ set("text_editor/highlighting/text_color",Color::html("aaaaaa"));
+ set("text_editor/highlighting/text_selected_color",Color::html("000000"));
+ set("text_editor/highlighting/keyword_color",Color::html("ffffb3"));
+ set("text_editor/highlighting/base_type_color",Color::html("a4ffd4"));
+ set("text_editor/highlighting/engine_type_color",Color::html("83d3ff"));
+ set("text_editor/highlighting/function_color",Color::html("66a2ce"));
+ set("text_editor/highlighting/member_variable_color",Color::html("e64e59"));
+ set("text_editor/highlighting/comment_color",Color::html("676767"));
+ set("text_editor/highlighting/string_color",Color::html("ef6ebe"));
+ set("text_editor/highlighting/number_color",Color::html("EB9532"));
+ set("text_editor/highlighting/symbol_color",Color::html("badfff"));
+ set("text_editor/highlighting/selection_color",Color::html("7b5dbe"));
+ set("text_editor/highlighting/brace_mismatch_color",Color(1,0.2,0.2));
+ set("text_editor/highlighting/current_line_color",Color(0.3,0.5,0.8,0.15));
+ set("text_editor/highlighting/mark_color", Color(1.0,0.4,0.4,0.4));
+ set("text_editor/highlighting/breakpoint_color", Color(0.8,0.8,0.4,0.2));
+ set("text_editor/highlighting/word_highlighted_color",Color(0.8,0.9,0.9,0.15));
+ set("text_editor/highlighting/search_result_color",Color(0.05,0.25,0.05,1));
+ set("text_editor/highlighting/search_result_border_color",Color(0.1,0.45,0.1,1));
}
void EditorSettings::notify_changes() {
@@ -842,24 +846,24 @@ void EditorSettings::list_text_editor_themes() {
d->list_dir_begin();
String file = d->get_next();
while(file != String()) {
- if (file.extension() == "tet" && file.basename().to_lower() != "default") {
- themes += "," + file.basename();
+ if (file.get_extension() == "tet" && file.get_basename().to_lower() != "default") {
+ themes += "," + file.get_basename();
}
file = d->get_next();
}
d->list_dir_end();
memdelete(d);
}
- add_property_hint(PropertyInfo(Variant::STRING,"text_editor/color_theme",PROPERTY_HINT_ENUM,themes));
+ add_property_hint(PropertyInfo(Variant::STRING,"text_editor/theme/color_theme",PROPERTY_HINT_ENUM,themes));
}
void EditorSettings::load_text_editor_theme() {
- if (get("text_editor/color_theme") == "Default") {
+ if (get("text_editor/theme/color_theme") == "Default") {
_load_default_text_editor_theme(); // sorry for "Settings changed" console spam
return;
}
- String theme_path = get_settings_path() + "/text_editor_themes/" + get("text_editor/color_theme") + ".tet";
+ String theme_path = get_settings_path() + "/text_editor_themes/" + get("text_editor/theme/color_theme") + ".tet";
Ref<ConfigFile> cf = memnew( ConfigFile );
Error err = cf->load(theme_path);
@@ -876,11 +880,11 @@ void EditorSettings::load_text_editor_theme() {
String val = cf->get_value("color_theme", key);
// don't load if it's not already there!
- if (has("text_editor/" + key)) {
+ if (has("text_editor/highlighting/" + key)) {
// make sure it is actually a color
if (val.is_valid_html_color() && key.find("color") >= 0) {
- props["text_editor/"+key].variant = Color::html(val); // change manually to prevent "Settings changed" console spam
+ props["text_editor/highlighting/"+key].variant = Color::html(val); // change manually to prevent "Settings changed" console spam
}
}
}
@@ -909,7 +913,7 @@ bool EditorSettings::import_text_editor_theme(String p_file) {
bool EditorSettings::save_text_editor_theme() {
- String p_file = get("text_editor/color_theme");
+ String p_file = get("text_editor/theme/color_theme");
if (p_file.get_file().to_lower() == "default") {
return false;
@@ -933,7 +937,7 @@ bool EditorSettings::save_text_editor_theme_as(String p_file) {
String theme_name = p_file.substr(0, p_file.length() - 4).get_file();
if (p_file.get_base_dir() == get_settings_path() + "/text_editor_themes") {
- set("text_editor/color_theme", theme_name);
+ set("text_editor/theme/color_theme", theme_name);
load_text_editor_theme();
}
return true;
@@ -944,34 +948,34 @@ bool EditorSettings::save_text_editor_theme_as(String p_file) {
bool EditorSettings::_save_text_editor_theme(String p_file) {
String theme_section = "color_theme";
Ref<ConfigFile> cf = memnew( ConfigFile ); // hex is better?
- cf->set_value(theme_section, "background_color", ((Color)get("text_editor/background_color")).to_html());
- cf->set_value(theme_section, "completion_background_color", ((Color)get("text_editor/completion_background_color")).to_html());
- cf->set_value(theme_section, "completion_selected_color", ((Color)get("text_editor/completion_selected_color")).to_html());
- cf->set_value(theme_section, "completion_existing_color", ((Color)get("text_editor/completion_existing_color")).to_html());
- cf->set_value(theme_section, "completion_scroll_color", ((Color)get("text_editor/completion_scroll_color")).to_html());
- cf->set_value(theme_section, "completion_font_color", ((Color)get("text_editor/completion_font_color")).to_html());
- cf->set_value(theme_section, "caret_color", ((Color)get("text_editor/caret_color")).to_html());
- cf->set_value(theme_section, "caret_background_color", ((Color)get("text_editor/caret_background_color")).to_html());
- cf->set_value(theme_section, "line_number_color", ((Color)get("text_editor/line_number_color")).to_html());
- cf->set_value(theme_section, "text_color", ((Color)get("text_editor/text_color")).to_html());
- cf->set_value(theme_section, "text_selected_color", ((Color)get("text_editor/text_selected_color")).to_html());
- cf->set_value(theme_section, "keyword_color", ((Color)get("text_editor/keyword_color")).to_html());
- cf->set_value(theme_section, "base_type_color", ((Color)get("text_editor/base_type_color")).to_html());
- cf->set_value(theme_section, "engine_type_color", ((Color)get("text_editor/engine_type_color")).to_html());
- cf->set_value(theme_section, "function_color", ((Color)get("text_editor/function_color")).to_html());
- cf->set_value(theme_section, "member_variable_color", ((Color)get("text_editor/member_variable_color")).to_html());
- cf->set_value(theme_section, "comment_color", ((Color)get("text_editor/comment_color")).to_html());
- cf->set_value(theme_section, "string_color", ((Color)get("text_editor/string_color")).to_html());
- cf->set_value(theme_section, "number_color", ((Color)get("text_editor/number_color")).to_html());
- cf->set_value(theme_section, "symbol_color", ((Color)get("text_editor/symbol_color")).to_html());
- cf->set_value(theme_section, "selection_color", ((Color)get("text_editor/selection_color")).to_html());
- cf->set_value(theme_section, "brace_mismatch_color", ((Color)get("text_editor/brace_mismatch_color")).to_html());
- cf->set_value(theme_section, "current_line_color", ((Color)get("text_editor/current_line_color")).to_html());
- cf->set_value(theme_section, "mark_color", ((Color)get("text_editor/mark_color")).to_html());
- cf->set_value(theme_section, "breakpoint_color", ((Color)get("text_editor/breakpoint_color")).to_html());
- cf->set_value(theme_section, "word_highlighted_color", ((Color)get("text_editor/word_highlighted_color")).to_html());
- cf->set_value(theme_section, "search_result_color", ((Color)get("text_editor/search_result_color")).to_html());
- cf->set_value(theme_section, "search_result_border_color", ((Color)get("text_editor/search_result_border_color")).to_html());
+ cf->set_value(theme_section, "background_color", ((Color)get("text_editor/highlighting/background_color")).to_html());
+ cf->set_value(theme_section, "completion_background_color", ((Color)get("text_editor/highlighting/completion_background_color")).to_html());
+ cf->set_value(theme_section, "completion_selected_color", ((Color)get("text_editor/highlighting/completion_selected_color")).to_html());
+ cf->set_value(theme_section, "completion_existing_color", ((Color)get("text_editor/highlighting/completion_existing_color")).to_html());
+ cf->set_value(theme_section, "completion_scroll_color", ((Color)get("text_editor/highlighting/completion_scroll_color")).to_html());
+ cf->set_value(theme_section, "completion_font_color", ((Color)get("text_editor/highlighting/completion_font_color")).to_html());
+ cf->set_value(theme_section, "caret_color", ((Color)get("text_editor/highlighting/caret_color")).to_html());
+ cf->set_value(theme_section, "caret_background_color", ((Color)get("text_editor/highlighting/caret_background_color")).to_html());
+ cf->set_value(theme_section, "line_number_color", ((Color)get("text_editor/highlighting/line_number_color")).to_html());
+ cf->set_value(theme_section, "text_color", ((Color)get("text_editor/highlighting/text_color")).to_html());
+ cf->set_value(theme_section, "text_selected_color", ((Color)get("text_editor/highlighting/text_selected_color")).to_html());
+ cf->set_value(theme_section, "keyword_color", ((Color)get("text_editor/highlighting/keyword_color")).to_html());
+ cf->set_value(theme_section, "base_type_color", ((Color)get("text_editor/highlighting/base_type_color")).to_html());
+ cf->set_value(theme_section, "engine_type_color", ((Color)get("text_editor/highlighting/engine_type_color")).to_html());
+ cf->set_value(theme_section, "function_color", ((Color)get("text_editor/highlighting/function_color")).to_html());
+ cf->set_value(theme_section, "member_variable_color", ((Color)get("text_editor/highlighting/member_variable_color")).to_html());
+ cf->set_value(theme_section, "comment_color", ((Color)get("text_editor/highlighting/comment_color")).to_html());
+ cf->set_value(theme_section, "string_color", ((Color)get("text_editor/highlighting/string_color")).to_html());
+ cf->set_value(theme_section, "number_color", ((Color)get("text_editor/highlighting/number_color")).to_html());
+ cf->set_value(theme_section, "symbol_color", ((Color)get("text_editor/highlighting/symbol_color")).to_html());
+ cf->set_value(theme_section, "selection_color", ((Color)get("text_editor/highlighting/selection_color")).to_html());
+ cf->set_value(theme_section, "brace_mismatch_color", ((Color)get("text_editor/highlighting/brace_mismatch_color")).to_html());
+ cf->set_value(theme_section, "current_line_color", ((Color)get("text_editor/highlighting/current_line_color")).to_html());
+ cf->set_value(theme_section, "mark_color", ((Color)get("text_editor/highlighting/mark_color")).to_html());
+ cf->set_value(theme_section, "breakpoint_color", ((Color)get("text_editor/highlighting/breakpoint_color")).to_html());
+ cf->set_value(theme_section, "word_highlighted_color", ((Color)get("text_editor/highlighting/word_highlighted_color")).to_html());
+ cf->set_value(theme_section, "search_result_color", ((Color)get("text_editor/highlighting/search_result_color")).to_html());
+ cf->set_value(theme_section, "search_result_border_color", ((Color)get("text_editor/highlighting/search_result_border_color")).to_html());
Error err = cf->save(p_file);
@@ -1022,19 +1026,42 @@ void EditorSettings::set_optimize_save(bool p_optimize) {
optimize_save=p_optimize;
}
+String EditorSettings::get_last_selected_language()
+{
+ Ref<ConfigFile> cf = memnew( ConfigFile );
+ String path = get_project_settings_path().plus_file("project_metadata.cfg");
+ Error err = cf->load(path);
+ if (err != OK) {
+ return "";
+ }
+ Variant last_selected_language = cf->get_value("script_setup", "last_selected_language");
+ if (last_selected_language.get_type() != Variant::STRING)
+ return "";
+ return static_cast<String>(last_selected_language);
+}
+
+void EditorSettings::set_last_selected_language(String p_language)
+{
+ Ref<ConfigFile> cf = memnew( ConfigFile );
+ String path = get_project_settings_path().plus_file("project_metadata.cfg");
+ cf->load(path);
+ cf->set_value("script_setup", "last_selected_language", p_language);
+ cf->save(path);
+}
+
void EditorSettings::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("erase","property"),&EditorSettings::erase);
- ObjectTypeDB::bind_method(_MD("get_settings_path"),&EditorSettings::get_settings_path);
- ObjectTypeDB::bind_method(_MD("get_project_settings_path"),&EditorSettings::get_project_settings_path);
+ ClassDB::bind_method(_MD("erase","property"),&EditorSettings::erase);
+ ClassDB::bind_method(_MD("get_settings_path"),&EditorSettings::get_settings_path);
+ ClassDB::bind_method(_MD("get_project_settings_path"),&EditorSettings::get_project_settings_path);
- ObjectTypeDB::bind_method(_MD("add_property_info", "info"),&EditorSettings::_add_property_info_bind);
+ ClassDB::bind_method(_MD("add_property_info", "info"),&EditorSettings::_add_property_info_bind);
- ObjectTypeDB::bind_method(_MD("set_favorite_dirs","dirs"),&EditorSettings::set_favorite_dirs);
- ObjectTypeDB::bind_method(_MD("get_favorite_dirs"),&EditorSettings::get_favorite_dirs);
+ ClassDB::bind_method(_MD("set_favorite_dirs","dirs"),&EditorSettings::set_favorite_dirs);
+ ClassDB::bind_method(_MD("get_favorite_dirs"),&EditorSettings::get_favorite_dirs);
- ObjectTypeDB::bind_method(_MD("set_recent_dirs","dirs"),&EditorSettings::set_recent_dirs);
- ObjectTypeDB::bind_method(_MD("get_recent_dirs"),&EditorSettings::get_recent_dirs);
+ ClassDB::bind_method(_MD("set_recent_dirs","dirs"),&EditorSettings::set_recent_dirs);
+ ClassDB::bind_method(_MD("get_recent_dirs"),&EditorSettings::get_recent_dirs);
ADD_SIGNAL(MethodInfo("settings_changed"));
@@ -1071,7 +1098,6 @@ EditorSettings::EditorSettings() {
}
_load_defaults();
- save_changed_setting=false;
}
@@ -1079,7 +1105,7 @@ EditorSettings::EditorSettings() {
EditorSettings::~EditorSettings() {
-// singleton=NULL;
+ //singleton=NULL;
}
Ref<ShortCut> ED_GET_SHORTCUT(const String& p_path) {
diff --git a/tools/editor/editor_settings.h b/tools/editor/editor_settings.h
index 2a7d3bb4f0..c11feef667 100644
--- a/tools/editor/editor_settings.h
+++ b/tools/editor/editor_settings.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -41,7 +41,7 @@ class EditorPlugin;
class EditorSettings : public Resource {
- OBJ_TYPE( EditorSettings, Resource );
+ GDCLASS( EditorSettings, Resource );
private:
_THREAD_SAFE_CLASS_
@@ -160,6 +160,9 @@ public:
void set_optimize_save(bool p_optimize);
+ String get_last_selected_language();
+ void set_last_selected_language(String p_language);
+
EditorSettings();
~EditorSettings();
diff --git a/tools/editor/editor_sub_scene.cpp b/tools/editor/editor_sub_scene.cpp
index d32dbcd2e6..34c3d47006 100644
--- a/tools/editor/editor_sub_scene.cpp
+++ b/tools/editor/editor_sub_scene.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -75,7 +75,7 @@ void EditorSubScene::_notification(int p_what) {
if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
- if (!is_visible()) {
+ if (!is_visible_in_tree()) {
}
@@ -90,8 +90,8 @@ void EditorSubScene::_fill_tree(Node* p_node,TreeItem *p_parent) {
it->set_text(0,p_node->get_name());
it->set_editable(0,false);
it->set_selectable(0,true);
- if (has_icon(p_node->get_type(),"EditorIcons")) {
- it->set_icon(0,get_icon(p_node->get_type(),"EditorIcons"));
+ if (has_icon(p_node->get_class(),"EditorIcons")) {
+ it->set_icon(0,get_icon(p_node->get_class(),"EditorIcons"));
}
@@ -186,9 +186,9 @@ void EditorSubScene::clear() {
void EditorSubScene::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_path_selected"),&EditorSubScene::_path_selected);
- ObjectTypeDB::bind_method(_MD("_path_changed"),&EditorSubScene::_path_changed);
- ObjectTypeDB::bind_method(_MD("_path_browse"),&EditorSubScene::_path_browse);
+ ClassDB::bind_method(_MD("_path_selected"),&EditorSubScene::_path_selected);
+ ClassDB::bind_method(_MD("_path_changed"),&EditorSubScene::_path_changed);
+ ClassDB::bind_method(_MD("_path_browse"),&EditorSubScene::_path_browse);
ADD_SIGNAL( MethodInfo("subscene_selected"));
}
@@ -203,7 +203,7 @@ EditorSubScene::EditorSubScene() {
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
- set_child_rect(vb);
+ //set_child_rect(vb);
HBoxContainer *hb = memnew( HBoxContainer );
path = memnew( LineEdit );
diff --git a/tools/editor/editor_sub_scene.h b/tools/editor/editor_sub_scene.h
index 3dd86eefda..cc9faffc77 100644
--- a/tools/editor/editor_sub_scene.h
+++ b/tools/editor/editor_sub_scene.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -35,7 +35,7 @@
class EditorSubScene : public ConfirmationDialog {
- OBJ_TYPE(EditorSubScene,ConfirmationDialog);
+ GDCLASS(EditorSubScene,ConfirmationDialog);
LineEdit *path;
diff --git a/tools/editor/editor_themes.cpp b/tools/editor/editor_themes.cpp
index 08f14ec167..56654cad7a 100644
--- a/tools/editor/editor_themes.cpp
+++ b/tools/editor/editor_themes.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -62,12 +62,12 @@ Ref<Theme> create_custom_theme()
{
Ref<Theme> theme;
- String custom_theme = EditorSettings::get_singleton()->get("global/custom_theme");
+ String custom_theme = EditorSettings::get_singleton()->get("interface/custom_theme");
if (custom_theme!="") {
theme = ResourceLoader::load(custom_theme);
}
- String global_font = EditorSettings::get_singleton()->get("global/custom_font");
+ String global_font = EditorSettings::get_singleton()->get("interface/custom_font");
if (global_font!="") {
Ref<Font> fnt = ResourceLoader::load(global_font);
if (fnt.is_valid()) {
diff --git a/tools/editor/editor_themes.h b/tools/editor/editor_themes.h
index db49801600..83e7dde78a 100644
--- a/tools/editor/editor_themes.h
+++ b/tools/editor/editor_themes.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/file_type_cache.cpp b/tools/editor/file_type_cache.cpp
index 8a47f49b03..176205a7df 100644
--- a/tools/editor/file_type_cache.cpp
+++ b/tools/editor/file_type_cache.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -55,7 +55,7 @@ void FileTypeCache::set_file_type(const String& p_path,const String& p_type){
void FileTypeCache::load() {
GLOBAL_LOCK_FUNCTION
- String project=Globals::get_singleton()->get_resource_path();
+ String project=GlobalConfig::get_singleton()->get_resource_path();
FileAccess *f =FileAccess::open(project+"/file_type_cache.cch",FileAccess::READ);
if (!f) {
@@ -81,7 +81,7 @@ void FileTypeCache::load() {
void FileTypeCache::save() {
GLOBAL_LOCK_FUNCTION
- String project=Globals::get_singleton()->get_resource_path();
+ String project=GlobalConfig::get_singleton()->get_resource_path();
FileAccess *f =FileAccess::open(project+"/file_type_cache.cch",FileAccess::WRITE);
if (!f) {
diff --git a/tools/editor/file_type_cache.h b/tools/editor/file_type_cache.h
index 18451cbe19..25755f168c 100644
--- a/tools/editor/file_type_cache.h
+++ b/tools/editor/file_type_cache.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,7 +33,7 @@
class FileTypeCache : Object {
- OBJ_TYPE(FileTypeCache,Object);
+ GDCLASS(FileTypeCache,Object);
HashMap<String,String> file_type_map;
diff --git a/tools/editor/fileserver/SCsub b/tools/editor/fileserver/SCsub
index 363a2ce4c0..4bf55189cc 100644
--- a/tools/editor/fileserver/SCsub
+++ b/tools/editor/fileserver/SCsub
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
Import('env')
Export('env')
-env.add_source_files(env.tool_sources,"*.cpp")
+env.add_source_files(env.tool_sources, "*.cpp")
diff --git a/tools/editor/fileserver/editor_file_server.cpp b/tools/editor/fileserver/editor_file_server.cpp
index c464e10fc2..6330b06d3e 100644
--- a/tools/editor/fileserver/editor_file_server.cpp
+++ b/tools/editor/fileserver/editor_file_server.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -38,7 +38,7 @@
void EditorFileServer::_close_client(ClientData *cd) {
- cd->connection->disconnect();
+ cd->connection->disconnect_from_host();
cd->efs->wait_mutex->lock();
cd->efs->to_wait.insert(cd->thread);
cd->efs->wait_mutex->unlock();
@@ -321,8 +321,8 @@ void EditorFileServer::start() {
stop();
- port=EDITOR_DEF("file_server/port",6010);
- password=EDITOR_DEF("file_server/password","");
+ port=EDITOR_DEF("filesystem/file_server/port",6010);
+ password=EDITOR_DEF("filesystem/file_server/password","");
cmd=CMD_ACTIVATE;
}
@@ -346,8 +346,8 @@ EditorFileServer::EditorFileServer() {
cmd=CMD_NONE;
thread=Thread::create(_thread_start,this);
- EDITOR_DEF("file_server/port",6010);
- EDITOR_DEF("file_server/password","");
+ EDITOR_DEF("filesystem/file_server/port",6010);
+ EDITOR_DEF("filesystem/file_server/password","");
}
EditorFileServer::~EditorFileServer() {
diff --git a/tools/editor/fileserver/editor_file_server.h b/tools/editor/fileserver/editor_file_server.h
index fcb3d8546c..31f8ae84b8 100644
--- a/tools/editor/fileserver/editor_file_server.h
+++ b/tools/editor/fileserver/editor_file_server.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,7 +37,7 @@
class EditorFileServer : public Object {
- OBJ_TYPE(EditorFileServer,Object);
+ GDCLASS(EditorFileServer,Object);
enum Command {
CMD_NONE,
diff --git a/tools/editor/filesystem_dock.cpp b/tools/editor/filesystem_dock.cpp
index 8a94c6e340..792eb54dd4 100644
--- a/tools/editor/filesystem_dock.cpp
+++ b/tools/editor/filesystem_dock.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -38,14 +38,16 @@
#include "editor_settings.h"
#include "scene/main/viewport.h"
-
bool FileSystemDock::_create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir) {
-
TreeItem *item = tree->create_item(p_parent);
String dname=p_dir->get_name();
if (dname=="")
dname="res://";
+ else {
+ // collapse every tree item but the root folder
+ item->set_collapsed(true);
+ }
item->set_text(0,dname);
item->set_icon(0,get_icon("Folder","EditorIcons"));
@@ -160,7 +162,8 @@ void FileSystemDock::_notification(int p_what) {
button_hist_next->set_icon( get_icon("Forward","EditorIcons"));
button_hist_prev->set_icon( get_icon("Back","EditorIcons"));
- file_options->connect("item_pressed",this,"_file_option");
+ file_options->connect("id_pressed",this,"_file_option");
+ folder_options->connect("id_pressed",this,"_folder_option");
button_back->connect("pressed",this,"_go_to_tree",varray(),CONNECT_DEFERRED);
@@ -174,7 +177,7 @@ void FileSystemDock::_notification(int p_what) {
} break;
case NOTIFICATION_PROCESS: {
if (EditorFileSystem::get_singleton()->is_scanning()) {
- scanning_progress->set_val(EditorFileSystem::get_singleton()->get_scanning_progress()*100);
+ scanning_progress->set_value(EditorFileSystem::get_singleton()->get_scanning_progress()*100);
}
} break;
case NOTIFICATION_EXIT_TREE: {
@@ -183,7 +186,7 @@ void FileSystemDock::_notification(int p_what) {
case NOTIFICATION_DRAG_BEGIN: {
Dictionary dd = get_viewport()->gui_get_drag_data();
- if (tree->is_visible() && dd.has("type") ) {
+ if (tree->is_visible_in_tree() && dd.has("type") ) {
if ( (String(dd["type"])=="files") || (String(dd["type"])=="files_and_dirs") || (String(dd["type"])=="resource")) {
tree->set_drop_mode_flags(Tree::DROP_MODE_ON_ITEM);
}
@@ -201,7 +204,7 @@ void FileSystemDock::_notification(int p_what) {
} break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
- int new_mode = int(EditorSettings::get_singleton()->get("filesystem_dock/display_mode"));
+ int new_mode = int(EditorSettings::get_singleton()->get("docks/filesystem/display_mode"));
if (new_mode != display_mode) {
set_display_mode(new_mode);
@@ -234,13 +237,6 @@ void FileSystemDock::_dir_selected() {
button_favorite->set_pressed(found);
- if (ti->get_parent() && ti->get_parent()->get_parent()==tree->get_root() && !ti->get_parent()->get_prev()) {
-
- //a favorite!!!
- } else {
-
-
- }
if (!split_mode) {
_open_pressed(); //go directly to dir
@@ -296,7 +292,7 @@ void FileSystemDock::_thumbnail_done(const String& p_path,const Ref<Texture>& p_
bool valid=false;
- if (!search_box->is_hidden()) {
+ if (search_box->is_visible()) {
valid=true;
} else {
valid=(path==p_path.get_base_dir());
@@ -330,7 +326,7 @@ void FileSystemDock::_change_file_display() {
button_display_mode->set_icon( get_icon("FileList","EditorIcons"));
}
- EditorSettings::get_singleton()->set("filesystem_dock/display_mode", display_mode);
+ EditorSettings::get_singleton()->set("docks/filesystem/display_mode", display_mode);
_update_files(true);
}
@@ -400,11 +396,11 @@ void FileSystemDock::_update_files(bool p_keep_selection) {
current_path->set_text(path);
- EditorFileSystemDirectory *efd = EditorFileSystem::get_singleton()->get_path(path);
+ EditorFileSystemDirectory *efd = EditorFileSystem::get_singleton()->get_filesystem_path(path);
if (!efd)
return;
- int thumbnail_size = EditorSettings::get_singleton()->get("filesystem_dock/thumbnail_size");
+ int thumbnail_size = EditorSettings::get_singleton()->get("docks/filesystem/thumbnail_size");
thumbnail_size*=EDSCALE;
Ref<Texture> folder_thumbnail;
Ref<Texture> file_thumbnail;
@@ -628,7 +624,7 @@ void FileSystemDock::_go_to_dir(const String& p_dir){
void FileSystemDock::_preview_invalidated(const String& p_path) {
- if (p_path.get_base_dir()==path && search_box->get_text()==String() && file_list_vb->is_visible()) {
+ if (p_path.get_base_dir()==path && search_box->get_text()==String() && file_list_vb->is_visible_in_tree()) {
for(int i=0;i<files->get_item_count();i++) {
@@ -653,13 +649,13 @@ void FileSystemDock::_fs_changed() {
scanning_vb->hide();
split_box->show();
- if (!tree->is_hidden()) {
+ if (tree->is_visible()) {
button_favorite->show();
_update_tree();
}
- if (!file_list_vb->is_hidden()) {
+ if (file_list_vb->is_visible()) {
_update_files(true);
}
@@ -675,9 +671,9 @@ void FileSystemDock::_set_scannig_mode() {
scanning_vb->show();
set_process(true);
if (EditorFileSystem::get_singleton()->is_scanning()) {
- scanning_progress->set_val(EditorFileSystem::get_singleton()->get_scanning_progress()*100);
+ scanning_progress->set_value(EditorFileSystem::get_singleton()->get_scanning_progress()*100);
} else {
- scanning_progress->set_val(0);
+ scanning_progress->set_value(0);
}
}
@@ -689,14 +685,14 @@ void FileSystemDock::_fw_history() {
path=history[history_pos];
- if (!tree->is_hidden()) {
+ if (tree->is_visible()) {
_update_tree();
tree->grab_focus();
tree->ensure_cursor_is_visible();
}
- if (!file_list_vb->is_hidden()) {
+ if (file_list_vb->is_visible()) {
_update_files(false);
current_path->set_text(path);
}
@@ -714,13 +710,13 @@ void FileSystemDock::_bw_history() {
path=history[history_pos];
- if (!tree->is_hidden()) {
+ if (tree->is_visible()) {
_update_tree();
tree->grab_focus();
tree->ensure_cursor_is_visible();
}
- if (!file_list_vb->is_hidden()) {
+ if (file_list_vb->is_visible()) {
_update_files(false);
current_path->set_text(path);
}
@@ -836,7 +832,7 @@ void FileSystemDock::_move_operation(const String& p_to_path) {
return;
}
- EditorFileSystemDirectory *efsd=EditorFileSystem::get_singleton()->get_path(move_dirs[i]);
+ EditorFileSystemDirectory *efsd=EditorFileSystem::get_singleton()->get_filesystem_path(move_dirs[i]);
if (!efsd)
continue;
_find_inside_move_files(efsd,inside_files);
@@ -934,7 +930,7 @@ void FileSystemDock::_file_option(int p_option) {
String path = files->get_item_metadata(idx);
if (p_option == FILE_SHOW_IN_EXPLORER) {
- String dir = Globals::get_singleton()->globalize_path(path);
+ String dir = GlobalConfig::get_singleton()->globalize_path(path);
dir = dir.substr(0, dir.find_last("/"));
OS::get_singleton()->shell_open(String("file://")+dir);
return;
@@ -1019,7 +1015,7 @@ void FileSystemDock::_file_option(int p_option) {
if (move_dirs.empty() && move_files.size()==1) {
rename_dialog->clear_filters();
- rename_dialog->add_filter("*."+move_files[0].extension());
+ rename_dialog->add_filter("*."+move_files[0].get_extension());
rename_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE);
rename_dialog->set_current_path(move_files[0]);
rename_dialog->popup_centered_ratio();
@@ -1103,6 +1099,30 @@ void FileSystemDock::_file_option(int p_option) {
}
}
+void FileSystemDock::_folder_option(int p_option) {
+
+ TreeItem *item = tree->get_selected();
+ TreeItem *child = item->get_children();
+
+ switch(p_option) {
+
+ case FOLDER_EXPAND_ALL:
+ item->set_collapsed(false);
+ while(child) {
+ child->set_collapsed(false);
+ child = child->get_next();
+ }
+ break;
+
+ case FOLDER_COLLAPSE_ALL:
+ while(child) {
+ child->set_collapsed(true);
+ child = child->get_next();
+ }
+ break;
+ }
+}
+
void FileSystemDock::_open_pressed(){
@@ -1129,14 +1149,25 @@ void FileSystemDock::_open_pressed(){
current_path->set_text(path);
_push_to_history();
-// emit_signal("open",path);
+ //emit_signal("open",path);
+
+}
+
+void FileSystemDock::_dir_rmb_pressed(const Vector2& p_pos) {
+ folder_options->clear();
+ folder_options->set_size(Size2(1,1));
+
+ folder_options->add_item(TTR("Expand all"),FOLDER_EXPAND_ALL);
+ folder_options->add_item(TTR("Collapse all"),FOLDER_COLLAPSE_ALL);
+ folder_options->set_pos(files->get_global_pos() + p_pos);
+ folder_options->popup();
}
void FileSystemDock::_search_changed(const String& p_text) {
- if (!search_box->is_visible())
+ if (!search_box->is_visible_in_tree())
return; //wtf
_update_files(false);
@@ -1211,8 +1242,10 @@ Variant FileSystemDock::get_drag_data_fw(const Point2& p_point,Control* p_from)
if (seldirs.empty() && selfiles.empty())
return Variant();
- //if (seldirs.size() && selfiles.size())
- // return Variant(); //can't really mix files and dirs (i think?) - yes you can, commenting
+ /*
+ if (seldirs.size() && selfiles.size())
+ return Variant(); //can't really mix files and dirs (i think?) - yes you can, commenting
+ */
/*if (selfiles.size()==1) {
Ref<Resource> resource = ResourceLoader::load(files->get_item_metadata(selfiles.front()->get()));
@@ -1588,36 +1621,38 @@ void FileSystemDock::_files_list_rmb_select(int p_item,const Vector2& p_pos) {
void FileSystemDock::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_update_tree"),&FileSystemDock::_update_tree);
- ObjectTypeDB::bind_method(_MD("_rescan"),&FileSystemDock::_rescan);
- ObjectTypeDB::bind_method(_MD("_favorites_pressed"),&FileSystemDock::_favorites_pressed);
-// ObjectTypeDB::bind_method(_MD("_instance_pressed"),&ScenesDock::_instance_pressed);
- ObjectTypeDB::bind_method(_MD("_open_pressed"),&FileSystemDock::_open_pressed);
-
- ObjectTypeDB::bind_method(_MD("_thumbnail_done"),&FileSystemDock::_thumbnail_done);
- ObjectTypeDB::bind_method(_MD("_select_file"), &FileSystemDock::_select_file);
- ObjectTypeDB::bind_method(_MD("_go_to_tree"), &FileSystemDock::_go_to_tree);
- ObjectTypeDB::bind_method(_MD("_go_to_dir"), &FileSystemDock::_go_to_dir);
- ObjectTypeDB::bind_method(_MD("_change_file_display"), &FileSystemDock::_change_file_display);
- ObjectTypeDB::bind_method(_MD("_fw_history"), &FileSystemDock::_fw_history);
- ObjectTypeDB::bind_method(_MD("_bw_history"), &FileSystemDock::_bw_history);
- ObjectTypeDB::bind_method(_MD("_fs_changed"), &FileSystemDock::_fs_changed);
- ObjectTypeDB::bind_method(_MD("_dir_selected"), &FileSystemDock::_dir_selected);
- ObjectTypeDB::bind_method(_MD("_file_option"), &FileSystemDock::_file_option);
- ObjectTypeDB::bind_method(_MD("_move_operation"), &FileSystemDock::_move_operation);
- ObjectTypeDB::bind_method(_MD("_rename_operation"), &FileSystemDock::_rename_operation);
-
- ObjectTypeDB::bind_method(_MD("_search_changed"), &FileSystemDock::_search_changed);
-
- ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &FileSystemDock::get_drag_data_fw);
- ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &FileSystemDock::can_drop_data_fw);
- ObjectTypeDB::bind_method(_MD("drop_data_fw"), &FileSystemDock::drop_data_fw);
- ObjectTypeDB::bind_method(_MD("_files_list_rmb_select"),&FileSystemDock::_files_list_rmb_select);
-
- ObjectTypeDB::bind_method(_MD("_preview_invalidated"),&FileSystemDock::_preview_invalidated);
-
-
- ADD_SIGNAL(MethodInfo("instance", PropertyInfo(Variant::STRING_ARRAY, "files")));
+ ClassDB::bind_method(_MD("_update_tree"),&FileSystemDock::_update_tree);
+ ClassDB::bind_method(_MD("_rescan"),&FileSystemDock::_rescan);
+ ClassDB::bind_method(_MD("_favorites_pressed"),&FileSystemDock::_favorites_pressed);
+ //ClassDB::bind_method(_MD("_instance_pressed"),&ScenesDock::_instance_pressed);
+ ClassDB::bind_method(_MD("_open_pressed"),&FileSystemDock::_open_pressed);
+ ClassDB::bind_method(_MD("_dir_rmb_pressed"),&FileSystemDock::_dir_rmb_pressed);
+
+ ClassDB::bind_method(_MD("_thumbnail_done"),&FileSystemDock::_thumbnail_done);
+ ClassDB::bind_method(_MD("_select_file"), &FileSystemDock::_select_file);
+ ClassDB::bind_method(_MD("_go_to_tree"), &FileSystemDock::_go_to_tree);
+ ClassDB::bind_method(_MD("_go_to_dir"), &FileSystemDock::_go_to_dir);
+ ClassDB::bind_method(_MD("_change_file_display"), &FileSystemDock::_change_file_display);
+ ClassDB::bind_method(_MD("_fw_history"), &FileSystemDock::_fw_history);
+ ClassDB::bind_method(_MD("_bw_history"), &FileSystemDock::_bw_history);
+ ClassDB::bind_method(_MD("_fs_changed"), &FileSystemDock::_fs_changed);
+ ClassDB::bind_method(_MD("_dir_selected"), &FileSystemDock::_dir_selected);
+ ClassDB::bind_method(_MD("_file_option"), &FileSystemDock::_file_option);
+ ClassDB::bind_method(_MD("_folder_option"), &FileSystemDock::_folder_option);
+ ClassDB::bind_method(_MD("_move_operation"), &FileSystemDock::_move_operation);
+ ClassDB::bind_method(_MD("_rename_operation"), &FileSystemDock::_rename_operation);
+
+ ClassDB::bind_method(_MD("_search_changed"), &FileSystemDock::_search_changed);
+
+ ClassDB::bind_method(_MD("get_drag_data_fw"), &FileSystemDock::get_drag_data_fw);
+ ClassDB::bind_method(_MD("can_drop_data_fw"), &FileSystemDock::can_drop_data_fw);
+ ClassDB::bind_method(_MD("drop_data_fw"), &FileSystemDock::drop_data_fw);
+ ClassDB::bind_method(_MD("_files_list_rmb_select"),&FileSystemDock::_files_list_rmb_select);
+
+ ClassDB::bind_method(_MD("_preview_invalidated"),&FileSystemDock::_preview_invalidated);
+
+
+ ADD_SIGNAL(MethodInfo("instance", PropertyInfo(Variant::POOL_STRING_ARRAY, "files")));
ADD_SIGNAL(MethodInfo("open"));
}
@@ -1667,7 +1702,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
button_favorite->set_focus_mode(FOCUS_NONE);
-// Control *spacer = memnew( Control);
+ //Control *spacer = memnew( Control);
@@ -1693,6 +1728,9 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
file_options = memnew( PopupMenu );
add_child(file_options);
+ folder_options = memnew ( PopupMenu );
+ add_child(folder_options);
+
split_box = memnew( VSplitContainer );
add_child(split_box);
split_box->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -1702,12 +1740,14 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
tree->set_hide_root(true);
split_box->add_child(tree);
tree->set_drag_forwarding(this);
+ tree->set_allow_rmb_select(true);
//tree->set_v_size_flags(SIZE_EXPAND_FILL);
tree->connect("item_edited",this,"_favorite_toggled");
tree->connect("item_activated",this,"_open_pressed");
tree->connect("cell_selected",this,"_dir_selected");
+ tree->connect("item_rmb_selected",this,"_dir_rmb_pressed");
files = memnew( ItemList );
files->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -1732,8 +1772,8 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
path_hb->add_child(search_box);
search_box->connect("text_changed",this,"_search_changed");
- search_icon = memnew( TextureFrame );
- search_icon->set_stretch_mode(TextureFrame::STRETCH_KEEP_CENTERED);
+ search_icon = memnew( TextureRect );
+ search_icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
path_hb->add_child(search_icon);
button_display_mode = memnew( ToolButton );
diff --git a/tools/editor/filesystem_dock.h b/tools/editor/filesystem_dock.h
index f5b96760fc..0b0a73b9a2 100644
--- a/tools/editor/filesystem_dock.h
+++ b/tools/editor/filesystem_dock.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -52,7 +52,7 @@ class EditorNode;
class FileSystemDock : public VBoxContainer {
- OBJ_TYPE( FileSystemDock, VBoxContainer );
+ GDCLASS( FileSystemDock, VBoxContainer );
public:
enum DisplayMode {
@@ -73,6 +73,11 @@ private:
FILE_COPY_PATH
};
+ enum FolderMenu {
+ FOLDER_EXPAND_ALL,
+ FOLDER_COLLAPSE_ALL
+ };
+
VBoxContainer *scanning_vb;
ProgressBar *scanning_progress;
@@ -90,13 +95,14 @@ private:
Button *button_hist_prev;
LineEdit *current_path;
LineEdit *search_box;
- TextureFrame *search_icon;
+ TextureRect *search_icon;
HBoxContainer *path_hb;
bool split_mode;
DisplayMode display_mode;
PopupMenu *file_options;
+ PopupMenu *folder_options;
DependencyEditor *deps_editor;
DependencyEditorOwners *owners_editor;
@@ -134,6 +140,7 @@ private:
void _file_option(int p_option);
+ void _folder_option(int p_option);
void _update_files(bool p_keep_selection);
void _change_file_display();
@@ -151,6 +158,7 @@ private:
void _favorites_pressed();
void _open_pressed();
+ void _dir_rmb_pressed(const Vector2& local_mouse_pos);
void _search_changed(const String& p_text);
diff --git a/tools/editor/groups_editor.cpp b/tools/editor/groups_editor.cpp
index 5b7bc1da78..07b2bca385 100644
--- a/tools/editor/groups_editor.cpp
+++ b/tools/editor/groups_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -147,9 +147,9 @@ void GroupsEditor::set_current(Node* p_node) {
void GroupsEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_add_group",&GroupsEditor::_add_group);
- ObjectTypeDB::bind_method("_remove_group",&GroupsEditor::_remove_group);
- ObjectTypeDB::bind_method("update_tree",&GroupsEditor::update_tree);
+ ClassDB::bind_method("_add_group",&GroupsEditor::_add_group);
+ ClassDB::bind_method("_remove_group",&GroupsEditor::_remove_group);
+ ClassDB::bind_method("update_tree",&GroupsEditor::update_tree);
}
GroupsEditor::GroupsEditor() {
diff --git a/tools/editor/groups_editor.h b/tools/editor/groups_editor.h
index 6edb577140..9ab75c6cfd 100644
--- a/tools/editor/groups_editor.h
+++ b/tools/editor/groups_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -41,7 +41,7 @@
class GroupsEditor : public VBoxContainer {
- OBJ_TYPE(GroupsEditor,VBoxContainer);
+ GDCLASS(GroupsEditor,VBoxContainer);
Node *node;
diff --git a/tools/editor/icons/2x/icon_bit_map.png b/tools/editor/icons/2x/icon_bit_map.png
new file mode 100644
index 0000000000..7372b85944
--- /dev/null
+++ b/tools/editor/icons/2x/icon_bit_map.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_cube_map.png b/tools/editor/icons/2x/icon_cube_map.png
new file mode 100644
index 0000000000..0edf82a88e
--- /dev/null
+++ b/tools/editor/icons/2x/icon_cube_map.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_curve_2d.png b/tools/editor/icons/2x/icon_curve_2d.png
new file mode 100644
index 0000000000..69a6f9a9dc
--- /dev/null
+++ b/tools/editor/icons/2x/icon_curve_2d.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_curve_3d.png b/tools/editor/icons/2x/icon_curve_3d.png
new file mode 100644
index 0000000000..e989df4769
--- /dev/null
+++ b/tools/editor/icons/2x/icon_curve_3d.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_environment.png b/tools/editor/icons/2x/icon_environment.png
new file mode 100644
index 0000000000..4c4c30b0e5
--- /dev/null
+++ b/tools/editor/icons/2x/icon_environment.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_fixed_spatial_material.png b/tools/editor/icons/2x/icon_fixed_spatial_material.png
new file mode 100644
index 0000000000..b95e78d6cc
--- /dev/null
+++ b/tools/editor/icons/2x/icon_fixed_spatial_material.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_g_i_probe.png b/tools/editor/icons/2x/icon_g_i_probe.png
new file mode 100644
index 0000000000..921f1cca42
--- /dev/null
+++ b/tools/editor/icons/2x/icon_g_i_probe.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_g_i_probe_data.png b/tools/editor/icons/2x/icon_g_i_probe_data.png
new file mode 100644
index 0000000000..69c4ed7184
--- /dev/null
+++ b/tools/editor/icons/2x/icon_g_i_probe_data.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_image_sky_box.png b/tools/editor/icons/2x/icon_image_sky_box.png
new file mode 100644
index 0000000000..487178afab
--- /dev/null
+++ b/tools/editor/icons/2x/icon_image_sky_box.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_interp_wrap_clamp.png b/tools/editor/icons/2x/icon_interp_wrap_clamp.png
new file mode 100644
index 0000000000..93a5bc56ee
--- /dev/null
+++ b/tools/editor/icons/2x/icon_interp_wrap_clamp.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_interp_wrap_loop.png b/tools/editor/icons/2x/icon_interp_wrap_loop.png
new file mode 100644
index 0000000000..3e656f7b07
--- /dev/null
+++ b/tools/editor/icons/2x/icon_interp_wrap_loop.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_joystick.png b/tools/editor/icons/2x/icon_joypad.png
index 285d048544..285d048544 100644
--- a/tools/editor/icons/2x/icon_joystick.png
+++ b/tools/editor/icons/2x/icon_joypad.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_large_texture.png b/tools/editor/icons/2x/icon_large_texture.png
new file mode 100644
index 0000000000..dd1ec86d39
--- /dev/null
+++ b/tools/editor/icons/2x/icon_large_texture.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_load.png b/tools/editor/icons/2x/icon_load.png
index 2e797c448b..759381d636 100644
--- a/tools/editor/icons/2x/icon_load.png
+++ b/tools/editor/icons/2x/icon_load.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_mesh_library.png b/tools/editor/icons/2x/icon_mesh_library.png
new file mode 100644
index 0000000000..2495e4a037
--- /dev/null
+++ b/tools/editor/icons/2x/icon_mesh_library.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_navigation_mesh.png b/tools/editor/icons/2x/icon_navigation_mesh.png
new file mode 100644
index 0000000000..35b893c3bb
--- /dev/null
+++ b/tools/editor/icons/2x/icon_navigation_mesh.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_navigation_polygon.png b/tools/editor/icons/2x/icon_navigation_polygon.png
new file mode 100644
index 0000000000..3f4845e206
--- /dev/null
+++ b/tools/editor/icons/2x/icon_navigation_polygon.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_packed_data_container.png b/tools/editor/icons/2x/icon_packed_data_container.png
new file mode 100644
index 0000000000..958e41ede2
--- /dev/null
+++ b/tools/editor/icons/2x/icon_packed_data_container.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_particles_shader.png b/tools/editor/icons/2x/icon_particles_shader.png
new file mode 100644
index 0000000000..26ce8f6809
--- /dev/null
+++ b/tools/editor/icons/2x/icon_particles_shader.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_patch_9_frame.png b/tools/editor/icons/2x/icon_patch_9_rect.png
index 5762a0392e..5762a0392e 100644
--- a/tools/editor/icons/2x/icon_patch_9_frame.png
+++ b/tools/editor/icons/2x/icon_patch_9_rect.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_polygon_path_finder.png b/tools/editor/icons/2x/icon_polygon_path_finder.png
new file mode 100644
index 0000000000..ee6423c265
--- /dev/null
+++ b/tools/editor/icons/2x/icon_polygon_path_finder.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_reference_frame.png b/tools/editor/icons/2x/icon_reference_rect.png
index 63fe559fa7..63fe559fa7 100644
--- a/tools/editor/icons/2x/icon_reference_frame.png
+++ b/tools/editor/icons/2x/icon_reference_rect.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_reflection_probe.png b/tools/editor/icons/2x/icon_reflection_probe.png
new file mode 100644
index 0000000000..5604b403df
--- /dev/null
+++ b/tools/editor/icons/2x/icon_reflection_probe.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_room.png b/tools/editor/icons/2x/icon_room.png
index e5e5bb52f8..946f95e955 100644
--- a/tools/editor/icons/2x/icon_room.png
+++ b/tools/editor/icons/2x/icon_room.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_room_bounds.png b/tools/editor/icons/2x/icon_room_bounds.png
new file mode 100644
index 0000000000..94da9c437d
--- /dev/null
+++ b/tools/editor/icons/2x/icon_room_bounds.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_sample_library.png b/tools/editor/icons/2x/icon_sample_library.png
new file mode 100644
index 0000000000..3f76a78aca
--- /dev/null
+++ b/tools/editor/icons/2x/icon_sample_library.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_script_create.png b/tools/editor/icons/2x/icon_script_create.png
new file mode 100644
index 0000000000..f1e25efe1c
--- /dev/null
+++ b/tools/editor/icons/2x/icon_script_create.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_short_cut.png b/tools/editor/icons/2x/icon_short_cut.png
new file mode 100644
index 0000000000..58c3e08ca4
--- /dev/null
+++ b/tools/editor/icons/2x/icon_short_cut.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_spatial_shader.png b/tools/editor/icons/2x/icon_spatial_shader.png
new file mode 100644
index 0000000000..68f6cf8dac
--- /dev/null
+++ b/tools/editor/icons/2x/icon_spatial_shader.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_sprite_frames.png b/tools/editor/icons/2x/icon_sprite_frames.png
new file mode 100644
index 0000000000..263f5c4aad
--- /dev/null
+++ b/tools/editor/icons/2x/icon_sprite_frames.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_style_box_empty.png b/tools/editor/icons/2x/icon_style_box_empty.png
new file mode 100644
index 0000000000..e790af4de4
--- /dev/null
+++ b/tools/editor/icons/2x/icon_style_box_empty.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_style_box_flat.png b/tools/editor/icons/2x/icon_style_box_flat.png
new file mode 100644
index 0000000000..1cd5c7f69a
--- /dev/null
+++ b/tools/editor/icons/2x/icon_style_box_flat.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_style_box_texture.png b/tools/editor/icons/2x/icon_style_box_texture.png
new file mode 100644
index 0000000000..a93e0228bd
--- /dev/null
+++ b/tools/editor/icons/2x/icon_style_box_texture.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_test_cube.png b/tools/editor/icons/2x/icon_test_cube.png
index 13d54db87d..f2e523be3f 100644
--- a/tools/editor/icons/2x/icon_test_cube.png
+++ b/tools/editor/icons/2x/icon_test_cube.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_texture_frame.png b/tools/editor/icons/2x/icon_texture_rect.png
index 50d715dd09..50d715dd09 100644
--- a/tools/editor/icons/2x/icon_texture_frame.png
+++ b/tools/editor/icons/2x/icon_texture_rect.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_theme.png b/tools/editor/icons/2x/icon_theme.png
new file mode 100644
index 0000000000..55b51428dd
--- /dev/null
+++ b/tools/editor/icons/2x/icon_theme.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_tile_set.png b/tools/editor/icons/2x/icon_tile_set.png
new file mode 100644
index 0000000000..9fbd0b4719
--- /dev/null
+++ b/tools/editor/icons/2x/icon_tile_set.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_viewport_texture.png b/tools/editor/icons/2x/icon_viewport_texture.png
new file mode 100644
index 0000000000..f798f1d221
--- /dev/null
+++ b/tools/editor/icons/2x/icon_viewport_texture.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_world.png b/tools/editor/icons/2x/icon_world.png
new file mode 100644
index 0000000000..51b587c01e
--- /dev/null
+++ b/tools/editor/icons/2x/icon_world.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_world_2d.png b/tools/editor/icons/2x/icon_world_2d.png
new file mode 100644
index 0000000000..e9cfa10461
--- /dev/null
+++ b/tools/editor/icons/2x/icon_world_2d.png
Binary files differ
diff --git a/tools/editor/icons/SCsub b/tools/editor/icons/SCsub
index 44e28f49e6..f86ae2b10d 100644
--- a/tools/editor/icons/SCsub
+++ b/tools/editor/icons/SCsub
@@ -1,96 +1,96 @@
-Import('env')
-
-def make_editor_icons_action(target, source, env):
+#!/usr/bin/env python
- import os
- import cStringIO
+Import('env')
- dst = target[0].srcnode().abspath
- pixmaps = source
- s = cStringIO.StringIO()
+def make_editor_icons_action(target, source, env):
- s.write("#include \"editor_icons.h\"\n\n")
- s.write("#include \"editor_scale.h\"\n\n")
- s.write("#include \"scene/resources/theme.h\"\n\n")
+ import os
+ import cStringIO
- hidpi_list=[]
+ dst = target[0].srcnode().abspath
+ pixmaps = source
- for x in pixmaps:
+ s = cStringIO.StringIO()
- x=str(x)
- var_str=os.path.basename(x)[:-4]+"_png";
- #print(var_str)
+ s.write("#include \"editor_icons.h\"\n\n")
+ s.write("#include \"editor_scale.h\"\n\n")
+ s.write("#include \"scene/resources/theme.h\"\n\n")
- s.write("static const unsigned char "+ var_str +"[]={\n");
+ hidpi_list = []
- pngf=open(x,"rb");
+ for x in pixmaps:
- b=pngf.read(1);
- while(len(b)==1):
- s.write(hex(ord(b)))
- b=pngf.read(1);
- if (len(b)==1):
- s.write(",")
+ x = str(x)
+ var_str = os.path.basename(x)[:-4] + "_png"
+ # print(var_str)
- s.write("\n};\n\n");
+ s.write("static const unsigned char " + var_str + "[]={\n")
- pngf.close();
- var_str=os.path.basename(x)[:-4]+"_hidpi_png";
- try:
+ pngf = open(x, "rb")
- pngf = open(os.path.dirname(x)+"/2x/"+os.path.basename(x), "rb")
+ b = pngf.read(1)
+ while(len(b) == 1):
+ s.write(hex(ord(b)))
+ b = pngf.read(1)
+ if (len(b) == 1):
+ s.write(",")
- s.write("static const unsigned char "+ var_str +"[]={\n");
+ s.write("\n};\n\n")
- b=pngf.read(1);
- while(len(b)==1):
- s.write(hex(ord(b)))
- b=pngf.read(1);
- if (len(b)==1):
- s.write(",")
+ pngf.close()
+ var_str = os.path.basename(x)[:-4] + "_hidpi_png"
+ try:
- s.write("\n};\n\n\n");
- hidpi_list.append(x)
+ pngf = open(os.path.dirname(x) + "/2x/" + os.path.basename(x), "rb")
- except:
- s.write("static const unsigned char* "+ var_str +"=NULL;\n\n\n");
+ s.write("static const unsigned char " + var_str + "[]={\n")
+ b = pngf.read(1)
+ while(len(b) == 1):
+ s.write(hex(ord(b)))
+ b = pngf.read(1)
+ if (len(b) == 1):
+ s.write(",")
+ s.write("\n};\n\n\n")
+ hidpi_list.append(x)
+ except:
+ s.write("static const unsigned char* " + var_str + "=NULL;\n\n\n")
- s.write("static Ref<ImageTexture> make_icon(const uint8_t* p_png,const uint8_t* p_hidpi_png) {\n")
- s.write("\tRef<ImageTexture> texture( memnew( ImageTexture ) );\n")
- s.write("\tbool use_hidpi_image=(editor_get_scale()>1.0&&p_hidpi_png);\n")
- s.write("\tImage img(use_hidpi_image?p_hidpi_png:p_png);\n")
- s.write("\tif (editor_get_scale()>1.0 && !p_hidpi_png) { img.convert(Image::FORMAT_RGBA); img.expand_x2_hq2x(); use_hidpi_image=true;}\n")
- s.write("\timg.resize(img.get_width()*EDSCALE/(use_hidpi_image?2:1),img.get_height()*EDSCALE/(use_hidpi_image?2:1));\n")
- s.write("\ttexture->create_from_image( img,ImageTexture::FLAG_FILTER );\n")
- s.write("\treturn texture;\n")
- s.write("}\n\n")
+ s.write("static Ref<ImageTexture> make_icon(const uint8_t* p_png,const uint8_t* p_hidpi_png) {\n")
+ s.write("\tRef<ImageTexture> texture( memnew( ImageTexture ) );\n")
+ s.write("\tbool use_hidpi_image=(editor_get_scale()>1.0&&p_hidpi_png);\n")
+ s.write("\tImage img(use_hidpi_image?p_hidpi_png:p_png);\n")
+ s.write("\tif (editor_get_scale()>1.0 && !p_hidpi_png) { img.convert(Image::FORMAT_RGBA8); img.expand_x2_hq2x(); use_hidpi_image=true;}\n")
+ s.write("\timg.resize(img.get_width()*EDSCALE/(use_hidpi_image?2:1),img.get_height()*EDSCALE/(use_hidpi_image?2:1));\n")
+ s.write("\ttexture->create_from_image( img,ImageTexture::FLAG_FILTER );\n")
+ s.write("\treturn texture;\n")
+ s.write("}\n\n")
- s.write("void editor_register_icons(Ref<Theme> p_theme) {\n\n")
+ s.write("void editor_register_icons(Ref<Theme> p_theme) {\n\n")
- for x in pixmaps:
+ for x in pixmaps:
- x=os.path.basename(str(x))
- type=x[5:-4].title().replace("_","");
- var_str=x[:-4]+"_png";
- var_str_hidpi=x[:-4]+"_hidpi_png";
- s.write("\tp_theme->set_icon(\""+type+"\",\"EditorIcons\",make_icon("+var_str+","+var_str_hidpi+"));\n");
+ x = os.path.basename(str(x))
+ type = x[5:-4].title().replace("_", "")
+ var_str = x[:-4] + "_png"
+ var_str_hidpi = x[:-4] + "_hidpi_png"
+ s.write("\tp_theme->set_icon(\"" + type + "\",\"EditorIcons\",make_icon(" + var_str + "," + var_str_hidpi + "));\n")
- s.write("\n\n}\n\n");
+ s.write("\n\n}\n\n")
- f = open(dst,"wb")
- f.write(s.getvalue())
- f.close()
- s.close()
+ f = open(dst, "wb")
+ f.write(s.getvalue())
+ f.close()
+ s.close()
make_editor_icons_builder = Builder(action=make_editor_icons_action,
- suffix = '.cpp',
- src_suffix = '.png')
-env['BUILDERS']['MakeEditorIconsBuilder']=make_editor_icons_builder
-env.Alias('editor_icons',[env.MakeEditorIconsBuilder('#tools/editor/editor_icons.cpp',Glob("*.png"))])
+ suffix='.cpp',
+ src_suffix='.png')
+env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder
+env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#tools/editor/editor_icons.cpp', Glob("*.png"))])
env.tool_sources.append("#tools/editor/editor_icons.cpp")
Export('env')
diff --git a/tools/editor/icons/icon_bit_map.png b/tools/editor/icons/icon_bit_map.png
new file mode 100644
index 0000000000..50dd8157d1
--- /dev/null
+++ b/tools/editor/icons/icon_bit_map.png
Binary files differ
diff --git a/tools/editor/icons/icon_cube_map.png b/tools/editor/icons/icon_cube_map.png
new file mode 100644
index 0000000000..9c4c6fdc9f
--- /dev/null
+++ b/tools/editor/icons/icon_cube_map.png
Binary files differ
diff --git a/tools/editor/icons/icon_curve_2d.png b/tools/editor/icons/icon_curve_2d.png
new file mode 100644
index 0000000000..ce46dcaad4
--- /dev/null
+++ b/tools/editor/icons/icon_curve_2d.png
Binary files differ
diff --git a/tools/editor/icons/icon_curve_3d.png b/tools/editor/icons/icon_curve_3d.png
new file mode 100644
index 0000000000..561837e4de
--- /dev/null
+++ b/tools/editor/icons/icon_curve_3d.png
Binary files differ
diff --git a/tools/editor/icons/icon_environment.png b/tools/editor/icons/icon_environment.png
new file mode 100644
index 0000000000..c8c4da3e8f
--- /dev/null
+++ b/tools/editor/icons/icon_environment.png
Binary files differ
diff --git a/tools/editor/icons/icon_fixed_spatial_material.png b/tools/editor/icons/icon_fixed_spatial_material.png
new file mode 100644
index 0000000000..2e52c45a46
--- /dev/null
+++ b/tools/editor/icons/icon_fixed_spatial_material.png
Binary files differ
diff --git a/tools/editor/icons/icon_g_i_probe.png b/tools/editor/icons/icon_g_i_probe.png
new file mode 100644
index 0000000000..a15ae18675
--- /dev/null
+++ b/tools/editor/icons/icon_g_i_probe.png
Binary files differ
diff --git a/tools/editor/icons/icon_g_i_probe_data.png b/tools/editor/icons/icon_g_i_probe_data.png
new file mode 100644
index 0000000000..0aabcc49cb
--- /dev/null
+++ b/tools/editor/icons/icon_g_i_probe_data.png
Binary files differ
diff --git a/tools/editor/icons/icon_image_sky_box.png b/tools/editor/icons/icon_image_sky_box.png
new file mode 100644
index 0000000000..cf80258577
--- /dev/null
+++ b/tools/editor/icons/icon_image_sky_box.png
Binary files differ
diff --git a/tools/editor/icons/icon_interp_wrap_clamp.png b/tools/editor/icons/icon_interp_wrap_clamp.png
new file mode 100644
index 0000000000..1024bd7d29
--- /dev/null
+++ b/tools/editor/icons/icon_interp_wrap_clamp.png
Binary files differ
diff --git a/tools/editor/icons/icon_interp_wrap_loop.png b/tools/editor/icons/icon_interp_wrap_loop.png
new file mode 100644
index 0000000000..3a7ddacdb2
--- /dev/null
+++ b/tools/editor/icons/icon_interp_wrap_loop.png
Binary files differ
diff --git a/tools/editor/icons/icon_joystick.png b/tools/editor/icons/icon_joypad.png
index 5df471109a..5df471109a 100644
--- a/tools/editor/icons/icon_joystick.png
+++ b/tools/editor/icons/icon_joypad.png
Binary files differ
diff --git a/tools/editor/icons/icon_large_texture.png b/tools/editor/icons/icon_large_texture.png
new file mode 100644
index 0000000000..1727e2409f
--- /dev/null
+++ b/tools/editor/icons/icon_large_texture.png
Binary files differ
diff --git a/tools/editor/icons/icon_load.png b/tools/editor/icons/icon_load.png
index cc05e98ebb..81835efa25 100644
--- a/tools/editor/icons/icon_load.png
+++ b/tools/editor/icons/icon_load.png
Binary files differ
diff --git a/tools/editor/icons/icon_mesh_library.png b/tools/editor/icons/icon_mesh_library.png
new file mode 100644
index 0000000000..0bb37b1da3
--- /dev/null
+++ b/tools/editor/icons/icon_mesh_library.png
Binary files differ
diff --git a/tools/editor/icons/icon_navigation_mesh.png b/tools/editor/icons/icon_navigation_mesh.png
new file mode 100644
index 0000000000..e3bb7f775f
--- /dev/null
+++ b/tools/editor/icons/icon_navigation_mesh.png
Binary files differ
diff --git a/tools/editor/icons/icon_navigation_polygon.png b/tools/editor/icons/icon_navigation_polygon.png
new file mode 100644
index 0000000000..bfc4bfb542
--- /dev/null
+++ b/tools/editor/icons/icon_navigation_polygon.png
Binary files differ
diff --git a/tools/editor/icons/icon_packed_data_container.png b/tools/editor/icons/icon_packed_data_container.png
new file mode 100644
index 0000000000..af89da48a9
--- /dev/null
+++ b/tools/editor/icons/icon_packed_data_container.png
Binary files differ
diff --git a/tools/editor/icons/icon_particles_shader.png b/tools/editor/icons/icon_particles_shader.png
new file mode 100644
index 0000000000..3b5c5644b2
--- /dev/null
+++ b/tools/editor/icons/icon_particles_shader.png
Binary files differ
diff --git a/tools/editor/icons/icon_patch_9_frame.png b/tools/editor/icons/icon_patch_9_rect.png
index bdd1467144..bdd1467144 100644
--- a/tools/editor/icons/icon_patch_9_frame.png
+++ b/tools/editor/icons/icon_patch_9_rect.png
Binary files differ
diff --git a/tools/editor/icons/icon_polygon_path_finder.png b/tools/editor/icons/icon_polygon_path_finder.png
new file mode 100644
index 0000000000..9d76d872db
--- /dev/null
+++ b/tools/editor/icons/icon_polygon_path_finder.png
Binary files differ
diff --git a/tools/editor/icons/icon_reference_frame.png b/tools/editor/icons/icon_reference_rect.png
index b253af477f..b253af477f 100644
--- a/tools/editor/icons/icon_reference_frame.png
+++ b/tools/editor/icons/icon_reference_rect.png
Binary files differ
diff --git a/tools/editor/icons/icon_reflection_probe.png b/tools/editor/icons/icon_reflection_probe.png
new file mode 100644
index 0000000000..a6646114fb
--- /dev/null
+++ b/tools/editor/icons/icon_reflection_probe.png
Binary files differ
diff --git a/tools/editor/icons/icon_room.png b/tools/editor/icons/icon_room.png
index 9390391279..840db145fd 100644
--- a/tools/editor/icons/icon_room.png
+++ b/tools/editor/icons/icon_room.png
Binary files differ
diff --git a/tools/editor/icons/icon_room_bounds.png b/tools/editor/icons/icon_room_bounds.png
new file mode 100644
index 0000000000..15b198e821
--- /dev/null
+++ b/tools/editor/icons/icon_room_bounds.png
Binary files differ
diff --git a/tools/editor/icons/icon_sample_library.png b/tools/editor/icons/icon_sample_library.png
new file mode 100644
index 0000000000..5921aa86e7
--- /dev/null
+++ b/tools/editor/icons/icon_sample_library.png
Binary files differ
diff --git a/tools/editor/icons/icon_script_create.png b/tools/editor/icons/icon_script_create.png
new file mode 100644
index 0000000000..86c19f748b
--- /dev/null
+++ b/tools/editor/icons/icon_script_create.png
Binary files differ
diff --git a/tools/editor/icons/icon_short_cut.png b/tools/editor/icons/icon_short_cut.png
new file mode 100644
index 0000000000..22e15c3889
--- /dev/null
+++ b/tools/editor/icons/icon_short_cut.png
Binary files differ
diff --git a/tools/editor/icons/icon_spatial_shader.png b/tools/editor/icons/icon_spatial_shader.png
new file mode 100644
index 0000000000..7608fc9036
--- /dev/null
+++ b/tools/editor/icons/icon_spatial_shader.png
Binary files differ
diff --git a/tools/editor/icons/icon_sprite_frames.png b/tools/editor/icons/icon_sprite_frames.png
new file mode 100644
index 0000000000..5576b24f2e
--- /dev/null
+++ b/tools/editor/icons/icon_sprite_frames.png
Binary files differ
diff --git a/tools/editor/icons/icon_style_box_empty.png b/tools/editor/icons/icon_style_box_empty.png
new file mode 100644
index 0000000000..f595eaaa57
--- /dev/null
+++ b/tools/editor/icons/icon_style_box_empty.png
Binary files differ
diff --git a/tools/editor/icons/icon_style_box_flat.png b/tools/editor/icons/icon_style_box_flat.png
new file mode 100644
index 0000000000..6ec6a6dd35
--- /dev/null
+++ b/tools/editor/icons/icon_style_box_flat.png
Binary files differ
diff --git a/tools/editor/icons/icon_style_box_texture.png b/tools/editor/icons/icon_style_box_texture.png
new file mode 100644
index 0000000000..f649508418
--- /dev/null
+++ b/tools/editor/icons/icon_style_box_texture.png
Binary files differ
diff --git a/tools/editor/icons/icon_test_cube.png b/tools/editor/icons/icon_test_cube.png
index 6a16fb5092..4d11a69c3e 100644
--- a/tools/editor/icons/icon_test_cube.png
+++ b/tools/editor/icons/icon_test_cube.png
Binary files differ
diff --git a/tools/editor/icons/icon_texture_frame.png b/tools/editor/icons/icon_texture_rect.png
index 84e4a90bfb..84e4a90bfb 100644
--- a/tools/editor/icons/icon_texture_frame.png
+++ b/tools/editor/icons/icon_texture_rect.png
Binary files differ
diff --git a/tools/editor/icons/icon_theme.png b/tools/editor/icons/icon_theme.png
new file mode 100644
index 0000000000..55d799c722
--- /dev/null
+++ b/tools/editor/icons/icon_theme.png
Binary files differ
diff --git a/tools/editor/icons/icon_tile_set.png b/tools/editor/icons/icon_tile_set.png
new file mode 100644
index 0000000000..a1c3fccddd
--- /dev/null
+++ b/tools/editor/icons/icon_tile_set.png
Binary files differ
diff --git a/tools/editor/icons/icon_viewport_texture.png b/tools/editor/icons/icon_viewport_texture.png
new file mode 100644
index 0000000000..ae744cc407
--- /dev/null
+++ b/tools/editor/icons/icon_viewport_texture.png
Binary files differ
diff --git a/tools/editor/icons/icon_world.png b/tools/editor/icons/icon_world.png
new file mode 100644
index 0000000000..d54b979cad
--- /dev/null
+++ b/tools/editor/icons/icon_world.png
Binary files differ
diff --git a/tools/editor/icons/icon_world_2d.png b/tools/editor/icons/icon_world_2d.png
new file mode 100644
index 0000000000..ebe54262ff
--- /dev/null
+++ b/tools/editor/icons/icon_world_2d.png
Binary files differ
diff --git a/tools/editor/icons/source/icon_bit_map.svg b/tools/editor/icons/source/icon_bit_map.svg
new file mode 100644
index 0000000000..fbaf573af6
--- /dev/null
+++ b/tools/editor/icons/source/icon_bit_map.svg
@@ -0,0 +1,82 @@
+<?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.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_bit_map.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"
+ inkscape:cx="-0.178935"
+ inkscape:cy="8.367044"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 1 1 L 1 3 L 3 3 L 3 1 L 1 1 z M 3 3 L 3 5 L 5 5 L 5 3 L 3 3 z M 5 3 L 7 3 L 7 1 L 5 1 L 5 3 z M 7 3 L 7 5 L 9 5 L 9 3 L 7 3 z M 9 3 L 11 3 L 11 1 L 9 1 L 9 3 z M 11 3 L 11 5 L 13 5 L 13 3 L 11 3 z M 13 3 L 15 3 L 15 1 L 13 1 L 13 3 z M 13 5 L 13 7 L 15 7 L 15 5 L 13 5 z M 13 7 L 11 7 L 11 9 L 13 9 L 13 7 z M 13 9 L 13 11 L 15 11 L 15 9 L 13 9 z M 13 11 L 11 11 L 11 13 L 13 13 L 13 11 z M 13 13 L 13 15 L 15 15 L 15 13 L 13 13 z M 11 13 L 9 13 L 9 15 L 11 15 L 11 13 z M 9 13 L 9 11 L 7 11 L 7 13 L 9 13 z M 7 13 L 5 13 L 5 15 L 7 15 L 7 13 z M 5 13 L 5 11 L 3 11 L 3 13 L 5 13 z M 3 13 L 1 13 L 1 15 L 3 15 L 3 13 z M 3 11 L 3 9 L 1 9 L 1 11 L 3 11 z M 3 9 L 5 9 L 5 7 L 3 7 L 3 9 z M 3 7 L 3 5 L 1 5 L 1 7 L 3 7 z M 5 7 L 7 7 L 7 5 L 5 5 L 5 7 z M 7 7 L 7 9 L 9 9 L 9 7 L 7 7 z M 9 7 L 11 7 L 11 5 L 9 5 L 9 7 z M 9 9 L 9 11 L 11 11 L 11 9 L 9 9 z M 7 9 L 5 9 L 5 11 L 7 11 L 7 9 z "
+ id="rect4170"
+ transform="translate(0,1036.3622)" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_cube_map.svg b/tools/editor/icons/source/icon_cube_map.svg
new file mode 100644
index 0000000000..4fd86b1233
--- /dev/null
+++ b/tools/editor/icons/source/icon_cube_map.svg
@@ -0,0 +1,120 @@
+<?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_cube_map.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="true"
+ inkscape:object-nodes="true"
+ 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="11.01934"
+ inkscape:cx="19.581751"
+ inkscape:zoom="16"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:snap-midpoints="true">
+ <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">
+ <rect
+ style="opacity:1;fill:#84ffb1;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4161"
+ width="4"
+ height="4"
+ x="0"
+ y="1042.3622" />
+ <rect
+ y="1042.3622"
+ x="4"
+ height="4"
+ width="4"
+ id="rect4167"
+ style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="opacity:1;fill:#84ffb1;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4169"
+ width="4"
+ height="4"
+ x="8"
+ y="1042.3622" />
+ <rect
+ y="1042.3622"
+ x="12"
+ height="4"
+ width="4"
+ id="rect4171"
+ style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="opacity:1;fill:#84c2ff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4173"
+ width="4"
+ height="4"
+ x="4"
+ y="1038.3622" />
+ <rect
+ y="1046.3622"
+ x="4"
+ height="4"
+ width="4"
+ id="rect4175"
+ style="opacity:1;fill:#84c2ff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_curve_2d.svg b/tools/editor/icons/source/icon_curve_2d.svg
new file mode 100644
index 0000000000..34719e37de
--- /dev/null
+++ b/tools/editor/icons/source/icon_curve_2d.svg
@@ -0,0 +1,82 @@
+<?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_curve_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="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="7.8406355"
+ inkscape:cx="5.0331401"
+ 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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="translate(0,-1036.3622)"
+ id="layer1"
+ inkscape:groupmode="layer"
+ inkscape:label="Layer 1">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 14,1037.3613 c -3.166667,0 -5.1044619,0.854 -6.0820312,2.3203 C 6.9403994,1041.148 7,1042.8613 7,1044.3613 c 0,1.5 -0.059601,2.7867 -0.5820312,3.5703 -0.5224307,0.7837 -1.5846355,1.4297 -4.4179688,1.4297 a 1.0001,1.0001 0 1 0 0,2 c 3.1666667,0 5.1044619,-0.8539 6.0820312,-2.3203 C 9.0596006,1047.5747 9,1045.8613 9,1044.3613 c 0,-1.5 0.059601,-2.7866 0.5820312,-3.5703 0.5224308,-0.7836 1.5846358,-1.4297 4.4179688,-1.4297 a 1.0001,1.0001 0 1 0 0,-2 z"
+ id="path4154"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_curve_3d.svg b/tools/editor/icons/source/icon_curve_3d.svg
new file mode 100644
index 0000000000..66034968b2
--- /dev/null
+++ b/tools/editor/icons/source/icon_curve_3d.svg
@@ -0,0 +1,82 @@
+<?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.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_curve_3d.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254834"
+ inkscape:cx="8.9774722"
+ inkscape:cy="7.1326353"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ 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;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 8.0039062,1037.3555 a 1.0001,1.0001 0 0 0 -0.4511718,0.1113 l -6,3 a 1.0001,1.0001 0 0 0 0,1.7891 l 6,3 a 1.0001,1.0001 0 0 0 0.8945312,0 L 13,1042.9805 l 0,3.7636 -5,2.5 -5.5527344,-2.7773 a 1.0001331,1.0001331 0 0 0 -0.8945312,1.7891 l 6,3 a 1.0001,1.0001 0 0 0 0.8945312,0 l 6.0000004,-3 A 1.0001,1.0001 0 0 0 15,1047.3613 l 0,-6 a 1.0001,1.0001 0 0 0 -1.447266,-0.8945 L 8,1043.2441 l -3.7636719,-1.8828 4.2109375,-2.1054 a 1.0001,1.0001 0 0 0 -0.4433594,-1.9004 z"
+ id="path4160"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_environment.svg b/tools/editor/icons/source/icon_environment.svg
new file mode 100644
index 0000000000..45add2c7f7
--- /dev/null
+++ b/tools/editor/icons/source/icon_environment.svg
@@ -0,0 +1,82 @@
+<?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/icon_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_environment.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"
+ inkscape:cx="10.741006"
+ inkscape:cy="10.690232"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-smooth-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ empspacing="4" />
+ </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="opacity:1;fill:#e1e1e1;fill-opacity:0.99215686;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ d="M 8 1 A 7 7 0 0 0 1 8 A 7 7 0 0 0 8 15 A 7 7 0 0 0 15 8 A 7 7 0 0 0 8 1 z M 7.0273438 2.0820312 C 6.3462908 2.6213949 5.3431503 3.5860946 4.6757812 5 L 2.8105469 5 A 6 6 0 0 1 7.0273438 2.0820312 z M 8.9785156 2.0859375 A 6 6 0 0 1 13.1875 5 L 11.324219 5 C 10.658501 3.5895934 9.6595492 2.6261235 8.9785156 2.0859375 z M 8 2.6054688 C 8.3858776 2.856627 9.3974911 3.6104334 10.185547 5 L 5.8144531 5 C 6.6025089 3.6104334 7.6141224 2.856627 8 2.6054688 z M 2.3515625 6 L 4.2949219 6 C 4.1145279 6.6059544 4 7.2695302 4 8 C 4 8.7306855 4.1144398 9.3938115 4.2949219 10 L 2.3496094 10 A 6 6 0 0 1 2 8 A 6 6 0 0 1 2.3515625 6 z M 5.3398438 6 L 10.660156 6 C 10.868048 6.5934731 11 7.2583063 11 8 C 11 8.7421382 10.866303 9.4061377 10.658203 10 L 5.3417969 10 C 5.1336971 9.4061377 5 8.7421382 5 8 C 5 7.2583063 5.1319522 6.5934731 5.3398438 6 z M 11.705078 6 L 13.650391 6 A 6 6 0 0 1 14 8 A 6 6 0 0 1 13.648438 10 L 11.705078 10 C 11.88556 9.3938115 12 8.7306855 12 8 C 12 7.2695302 11.885472 6.6059544 11.705078 6 z M 2.8125 11 L 4.6777344 11 C 5.343895 12.410381 6.3427806 13.374042 7.0234375 13.914062 A 6 6 0 0 1 2.8125 11 z M 5.8144531 11 L 10.185547 11 C 9.3971916 12.390235 8.3853773 13.145488 8 13.396484 C 7.6146227 13.145488 6.6028084 12.390235 5.8144531 11 z M 11.322266 11 L 13.189453 11 A 6 6 0 0 1 8.9707031 13.917969 C 9.651376 13.378771 10.654456 12.413873 11.322266 11 z "
+ transform="translate(0,1036.3622)"
+ id="path4158" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_fixed_spatial_material.svg b/tools/editor/icons/source/icon_fixed_spatial_material.svg
new file mode 100644
index 0000000000..575b0d06c6
--- /dev/null
+++ b/tools/editor/icons/source/icon_fixed_spatial_material.svg
@@ -0,0 +1,147 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ 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.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_fixed_spatial_material.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4257">
+ <stop
+ style="stop-color:#ff70ac;stop-opacity:1"
+ offset="0"
+ id="stop4259" />
+ <stop
+ id="stop4273"
+ offset="0.17862372"
+ style="stop-color:#9f70ff;stop-opacity:1" />
+ <stop
+ id="stop4271"
+ offset="0.3572498"
+ style="stop-color:#70deff;stop-opacity:1" />
+ <stop
+ id="stop4269"
+ offset="0.53587586"
+ style="stop-color:#70ffb9;stop-opacity:1" />
+ <stop
+ id="stop4267"
+ offset="0.71450192"
+ style="stop-color:#9dff70;stop-opacity:1" />
+ <stop
+ id="stop4265"
+ offset="0.89312798"
+ style="stop-color:#ffeb70;stop-opacity:1" />
+ <stop
+ style="stop-color:#ff7070;stop-opacity:1"
+ offset="1"
+ id="stop4261" />
+ </linearGradient>
+ <clipPath
+ id="clipPath4189"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4191"
+ d="m 6.3750001,1025.8622 a 1.6876688,1.5001498 0 0 0 -1.6875,1.5 l 0,18 a 1.6876688,1.5001498 0 0 0 1.6875,1.5 l 10.1217039,0 c -0.747392,-0.8796 -1.304338,-1.8888 -1.562256,-3 l -6.8719479,0 0,-15 16.8749999,0 0,3.3486 a 3.4281247,3.0472216 0 0 1 1.282105,1.1279 c 0.537834,0.828 1.294284,1.677 2.092895,2.5723 l 0,-8.5488 a 1.6876688,1.5001498 0 0 0 -1.6875,-1.5 l -20.2499999,0 z m 11.8124999,4.5 0,1.5 -1.6875,0 0,1.5 -3.375,0 0,1.5 -1.6875,0 0,1.5 -1.6874999,0 0,1.5 3.3749999,0 3.375,0 0.02637,0 c 0.246127,-0.317 0.496441,-0.6239 0.738282,-0.9053 1.145331,-1.3327 2.270672,-2.4711 3.015746,-3.6182 a 3.4281247,3.0472216 0 0 1 1.282105,-1.1279 l 0,-0.3486 -1.6875,0 0,-1.5 -1.6875,0 z m 5.0625,4.5 c -1.948558,3 -5.0625,5.0146 -5.0625,7.5 0,2.4853 2.266559,4.5 5.0625,4.5 2.795941,0 5.0625,-2.0147 5.0625,-4.5 0,-2.4854 -3.113942,-4.5 -5.0625,-7.5 z"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ </clipPath>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4257"
+ id="radialGradient4263"
+ cx="13.333239"
+ cy="1043.3622"
+ fx="13.333239"
+ fy="1043.3622"
+ r="7"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.93305925,0.79975529,-0.85714494,-0.99999821,914.75331,2076.0592)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627417"
+ inkscape:cx="12.314693"
+ inkscape:cy="10.250946"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:object-nodes="false"
+ inkscape:snap-smooth-nodes="false"
+ inkscape:snap-midpoints="false">
+ <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
+ inkscape:connector-curvature="0"
+ style="fill:url(#radialGradient4263);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 8,1037.3622 -7,3 0,8 7,3 7,-3 0,-8 -7,-3 z"
+ id="path4151" />
+ <path
+ style="fill:#ffffff;fill-opacity:0.72222221;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 1,1040.3622 7,3 7,-3 -7,-3 z"
+ id="path4149"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4145"
+ d="m 8,1051.3622 7,-3 0,-8 -7,3 z"
+ style="fill:#000000;fill-opacity:0.46969697;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_g_i_probe.svg b/tools/editor/icons/source/icon_g_i_probe.svg
new file mode 100644
index 0000000000..d803a5f63d
--- /dev/null
+++ b/tools/editor/icons/source/icon_g_i_probe.svg
@@ -0,0 +1,110 @@
+<?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.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_g_i_probe.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"
+ inkscape:cx="4.4024065"
+ inkscape:cy="8.249577"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ 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="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="m 11,1040.3622 a 3.9999826,3.9999826 0 0 0 -4,4 3.9999826,3.9999826 0 0 0 4,4 3.9999826,3.9999826 0 0 0 4,-4 3.9999826,3.9999826 0 0 0 -4,-4 z m 0,2 a 2.0000174,2.0000174 0 0 1 2,2 2.0000174,2.0000174 0 0 1 -2,2 2.0000174,2.0000174 0 0 1 -2,-2 2.0000174,2.0000174 0 0 1 2,-2 z"
+ id="path4255"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ id="rect4265"
+ width="4"
+ height="2.0000348"
+ x="9"
+ y="1046.3622" />
+ <rect
+ style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ id="rect4269"
+ width="2"
+ height="1.0000174"
+ x="10"
+ y="1050.3622" />
+ <rect
+ y="1047.3622"
+ x="9"
+ height="2.0000348"
+ width="4"
+ id="rect4274"
+ style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ ry="1.0000174" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 6,1050.3622 -4,0 0,-12 10,0"
+ id="path4293"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccc" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_g_i_probe_data.svg b/tools/editor/icons/source/icon_g_i_probe_data.svg
new file mode 100644
index 0000000000..96fa62723c
--- /dev/null
+++ b/tools/editor/icons/source/icon_g_i_probe_data.svg
@@ -0,0 +1,108 @@
+<?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.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_g_i_probe_data.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"
+ inkscape:cx="11.914815"
+ inkscape:cy="6.460794"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ 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="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+ d="M 11 4 A 3.9999826 3.9999826 0 0 0 7 8 A 3.9999826 3.9999826 0 0 0 9 11.458984 L 9 12 C 9 12.55401 9.4459904 13 10 13 L 12 13 C 12.55401 13 13 12.55401 13 12 L 13 11.458984 A 3.9999826 3.9999826 0 0 0 15 8 A 3.9999826 3.9999826 0 0 0 11 4 z M 11 6 A 2.0000174 2.0000174 0 0 1 13 8 A 2.0000174 2.0000174 0 0 1 11 10 A 2.0000174 2.0000174 0 0 1 9 8 A 2.0000174 2.0000174 0 0 1 11 6 z M 10 14 L 10 15 L 12 15 L 12 14 L 10 14 z "
+ transform="translate(0,1036.3622)"
+ id="path4255" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 2,1037.3613 a 1.0001,1.0001 0 0 0 -1,1 l 0,12 a 1.0001,1.0001 0 0 0 1,1 l 4,0 0,-2 -3,0 0,-10 9,0 0,-2 -10,0 z"
+ id="path4293"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4170"
+ width="2"
+ height="2"
+ x="4"
+ y="1040.3622" />
+ <rect
+ y="1043.3622"
+ x="4"
+ height="2"
+ width="2"
+ id="rect4172"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4174"
+ width="2"
+ height="2"
+ x="4"
+ y="1046.3622" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_image_sky_box.svg b/tools/editor/icons/source/icon_image_sky_box.svg
new file mode 100644
index 0000000000..9a89c04e58
--- /dev/null
+++ b/tools/editor/icons/source/icon_image_sky_box.svg
@@ -0,0 +1,116 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ sodipodi:docname="icon_image_sky_box.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="true"
+ inkscape:object-nodes="true"
+ 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="9.413879"
+ inkscape:cx="10.701686"
+ inkscape:zoom="32"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:snap-midpoints="true">
+ <inkscape:grid
+ id="grid3336"
+ type="xygrid"
+ empspacing="4" />
+ </sodipodi:namedview>
+ <defs
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4142">
+ <stop
+ style="stop-color:#84c2ff;stop-opacity:1"
+ offset="0"
+ id="stop4144" />
+ <stop
+ style="stop-color:#46a3ff;stop-opacity:1"
+ offset="1"
+ id="stop4146" />
+ </linearGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4142"
+ id="radialGradient4148"
+ cx="9.9399967"
+ cy="1051.0801"
+ fx="9.9399967"
+ fy="1051.0801"
+ r="7"
+ gradientTransform="matrix(1.3337828e-5,-1.9999995,1.5714282,2.7945105e-6,-1643.697,1071.2392)"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <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">
+ <rect
+ style="opacity:1;fill:url(#radialGradient4148);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4140"
+ width="14"
+ height="13.999983"
+ x="1"
+ y="1037.3622"
+ ry="2.0000174" />
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 6 4 A 1 1 0 0 0 5 5 A 1 1 0 0 0 6 6 A 1 1 0 0 0 7 5 A 1 1 0 0 0 6 4 z M 11 5 A 2 2 0 0 0 9 7 A 1 1 0 0 0 8 8 A 1 1 0 0 0 9 9 L 13 9 A 1 1 0 0 0 14 8 A 1 1 0 0 0 13 7 A 2 2 0 0 0 11 5 z M 3 9 A 1 1 0 0 0 2 10 A 1 1 0 0 0 3 11 L 5 11 A 1 1 0 0 0 4 12 A 1 1 0 0 0 5 13 L 8 13 A 1 1 0 0 0 9 12 A 1 1 0 0 0 8 11 L 6 11 A 1 1 0 0 0 7 10 A 1 1 0 0 0 6 9 L 3 9 z "
+ transform="translate(0,1036.3622)"
+ id="path4150" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_interp_wrap_clamp.svg b/tools/editor/icons/source/icon_interp_wrap_clamp.svg
new file mode 100644
index 0000000000..068e79ace0
--- /dev/null
+++ b/tools/editor/icons/source/icon_interp_wrap_clamp.svg
@@ -0,0 +1,110 @@
+<?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="8"
+ viewBox="0 0 16 8"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_bone.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_interp_wrap_clamp.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254834"
+ inkscape:cx="8.8989222"
+ inkscape:cy="4.5067976"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ showguides="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="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,-1044.3622)">
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4154"
+ width="2"
+ height="5.9999828"
+ x="1"
+ y="1045.3622"
+ rx="1.7382812e-05"
+ ry="1.7382812e-05" />
+ <rect
+ ry="1.7382812e-05"
+ rx="1.7382812e-05"
+ y="1045.3622"
+ x="13"
+ height="5.9999828"
+ width="2"
+ id="rect4156"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 5,1048.3622 6,0"
+ id="path4158"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 6,1046.3622 -2,2 2,2"
+ id="path4160"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4162"
+ d="m 10,1046.3622 2,2 -2,2"
+ style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_interp_wrap_loop.svg b/tools/editor/icons/source/icon_interp_wrap_loop.svg
new file mode 100644
index 0000000000..bfca46331b
--- /dev/null
+++ b/tools/editor/icons/source/icon_interp_wrap_loop.svg
@@ -0,0 +1,121 @@
+<?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="8"
+ viewBox="0 0 16 8"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_bone.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_interp_wrap_loop.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254834"
+ inkscape:cx="7.8700453"
+ inkscape:cy="4.2719762"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ showguides="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="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,-1044.3622)">
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 12 1 L 12 3 A 1.0000174 1.0000174 0 0 1 13 4 A 1.0000174 1.0000174 0 0 1 12 5 L 12 7 A 3 3 0 0 0 15 4 A 3 3 0 0 0 12 1 z "
+ id="path4159"
+ transform="translate(0,1044.3622)" />
+ <path
+ cx="12"
+ cy="1048.3622"
+ r="3"
+ id="path4161"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 4 1 A 3 3 0 0 0 1 4 A 3 3 0 0 0 4 7 L 4 5 A 1.0000174 1.0000174 0 0 1 3 4 A 1.0000174 1.0000174 0 0 1 4 3 L 4 1 z "
+ id="path4176"
+ transform="translate(0,1044.3622)" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4180"
+ width="3"
+ height="2"
+ x="9"
+ y="1045.3622"
+ rx="6.5185495e-06"
+ ry="1.7382799e-05" />
+ <rect
+ ry="1.7382799e-05"
+ rx="6.5185495e-06"
+ y="1049.3622"
+ x="4"
+ height="2"
+ width="3"
+ id="rect4182"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:#e0e0e0;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+ d="m 7,1048.3622 0,4 3,-2 z"
+ id="path4186"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4190"
+ d="m 9,1044.3622 0,4 -3,-2 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/source/icon_joystick.svg b/tools/editor/icons/source/icon_joypad.svg
index 5395060175..fb84462919 100644
--- a/tools/editor/icons/source/icon_joystick.svg
+++ b/tools/editor/icons/source/icon_joypad.svg
@@ -18,7 +18,7 @@
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_key.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_joystick.svg">
+ sodipodi:docname="icon_joypad.svg">
<defs
id="defs4" />
<sodipodi:namedview
diff --git a/tools/editor/icons/source/icon_large_texture.svg b/tools/editor/icons/source/icon_large_texture.svg
new file mode 100644
index 0000000000..4db0342041
--- /dev/null
+++ b/tools/editor/icons/source/icon_large_texture.svg
@@ -0,0 +1,80 @@
+<?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_sprite.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_large_texture.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"
+ inkscape:cx="10.856598"
+ inkscape:cy="8.2673025"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-intersection-paths="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="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ d="M 1 1 L 1 2 L 1 4 L 2 4 L 2 2 L 4 2 L 4 1 L 1 1 z M 12 1 L 12 2 L 14 2 L 14 4 L 15 4 L 15 1 L 12 1 z M 9 6 L 9 7 L 8 7 L 8 8 L 6 8 L 6 9 L 5 9 L 5 10 L 4 10 L 4 11 L 6 11 L 8 11 L 10 11 L 12 11 L 12 9 L 11 9 L 11 8 L 11 7 L 10 7 L 10 6 L 9 6 z M 1 12 L 1 14 L 1 15 L 4 15 L 4 14 L 2 14 L 2 12 L 1 12 z M 14 12 L 14 14 L 12 14 L 12 15 L 15 15 L 15 14 L 15 12 L 14 12 z "
+ transform="translate(0,1036.3622)"
+ id="rect4179" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_load.svg b/tools/editor/icons/source/icon_load.svg
new file mode 100644
index 0000000000..395a5c1b8a
--- /dev/null
+++ b/tools/editor/icons/source/icon_load.svg
@@ -0,0 +1,147 @@
+<?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/godotengine/godot/tools/editor/icons/2x/icon_load.png"
+ inkscape:export-xdpi="180"
+ inkscape:export-ydpi="180"
+ sodipodi:docname="icon_load.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.627417"
+ inkscape:cx="6.3187685"
+ inkscape:cy="7.6629717"
+ 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:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ showguides="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ spacingx="1"
+ spacingy="1"
+ empspacing="2" />
+ </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="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4153"
+ width="1"
+ height="8.9999657"
+ x="1"
+ y="1040.3622" />
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 3,1038.3622 c -1.1045695,0 -2,0.8954 -2,2 l 1,0 c 0,-0.5523 0.4477153,-1 1,-1 z"
+ id="path4155"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 6,6 C 5.643017,6.0002824 5.313257,6.1908435 5.1347656,6.5 5.0426478,6.6588009 4.9960226,6.8398957 5,7.0234375 L 4,13 c -0.091144,0.544728 -0.4477153,1 -1,1 l 0,1 9,0 c 1.10457,0 1.818405,-0.910429 2,-2 L 15,7 C 15.003977,6.8164581 14.957352,6.6588009 14.865234,6.5 14.686743,6.1908437 14.356983,6.0002826 14,6 Z"
+ transform="translate(0,1036.3622)"
+ id="rect4159"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccsccsscccc" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4182"
+ width="2"
+ height="1"
+ x="3"
+ y="1038.3622" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ inkscape:connector-curvature="0"
+ id="path4184"
+ d="m 5,1038.3622 c 1.10457,0 2,0.8954 2,2 l -1,0 c 0,-0.5523 -0.4477153,-1 -1,-1 z"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ inkscape:connector-curvature="0"
+ id="path4188"
+ d="m 3,1051.3622 c -1.1045695,0 -2,-0.8954 -2,-2 l 1,0 c 0,0.5523 0.4477153,1 1,1 z"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ y="1040.3622"
+ x="7"
+ height="1"
+ width="4"
+ id="rect4192"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ d="M 7,1041.3622 A 1,1 0 0 1 6.2928932,1041.0693 1,1 0 0 1 6,1040.3622 l 1,0 z"
+ sodipodi:end="3.1415927"
+ sodipodi:start="1.5707963"
+ sodipodi:ry="1"
+ sodipodi:rx="1"
+ sodipodi:cy="1040.3622"
+ sodipodi:cx="7"
+ sodipodi:type="arc"
+ id="path4208"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4210"
+ sodipodi:type="arc"
+ sodipodi:cx="-11"
+ sodipodi:cy="-1041.3622"
+ sodipodi:rx="1"
+ sodipodi:ry="1"
+ sodipodi:start="1.5707963"
+ sodipodi:end="3.1415927"
+ d="m -11,-1040.3622 a 1,1 0 0 1 -0.707107,-0.2929 A 1,1 0 0 1 -12,-1041.3622 l 1,0 z"
+ transform="scale(-1,-1)" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_mesh_library.svg b/tools/editor/icons/source/icon_mesh_library.svg
new file mode 100644
index 0000000000..b908a4db6e
--- /dev/null
+++ b/tools/editor/icons/source/icon_mesh_library.svg
@@ -0,0 +1,78 @@
+<?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_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_mesh_library.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="31.999999"
+ inkscape:cx="10.839298"
+ inkscape:cy="6.916789"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ empspacing="4" />
+ </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="opacity:1;fill:#ffd684;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 3 1 A 2 2 0 0 0 1 3 A 2 2 0 0 0 2 4.7304688 L 2 11.271484 A 2 2 0 0 0 1 13 A 2 2 0 0 0 3 15 A 2 2 0 0 0 4.7304688 14 L 7 14 L 7 12 L 4.7285156 12 A 2 2 0 0 0 4 11.269531 L 4 5.4140625 L 7 8.4140625 L 7 8 A 2.0002 2.0002 0 0 1 7.8085938 6.3945312 L 5.4140625 4 L 11.271484 4 A 2 2 0 0 0 12 4.7304688 L 12 6 A 2.0002 2.0002 0 0 1 12.998047 6.2714844 A 2.0002 2.0002 0 0 1 14 6 L 14 4.7285156 A 2 2 0 0 0 15 3 A 2 2 0 0 0 13 1 A 2 2 0 0 0 11.269531 2 L 4.7285156 2 A 2 2 0 0 0 3 1 z M 9 8 L 9 9 L 9 14 L 9 15 L 14 15 C 14.552285 15 15 14.5523 15 14 L 15 9 C 15 8.4477 14.552285 8 14 8 L 14 12 L 13 11 L 12 12 L 12 8 L 9 8 z "
+ transform="translate(0,1036.3622)"
+ id="path4162" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_navigation_mesh.svg b/tools/editor/icons/source/icon_navigation_mesh.svg
new file mode 100644
index 0000000000..31ab5df8ad
--- /dev/null
+++ b/tools/editor/icons/source/icon_navigation_mesh.svg
@@ -0,0 +1,78 @@
+<?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_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_navigation_mesh.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="31.999999"
+ inkscape:cx="9.4708391"
+ inkscape:cy="9.3796697"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ empspacing="4" />
+ </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="opacity:1;fill:#ffd684;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 3 1 A 2 2 0 0 0 1 3 A 2 2 0 0 0 2 4.7304688 L 2 11.271484 A 2 2 0 0 0 1 13 A 2 2 0 0 0 3 15 A 2 2 0 0 0 4.7304688 14 L 7.2382812 14 L 7.9882812 12 L 4.7285156 12 A 2 2 0 0 0 4 11.269531 L 4 5.4140625 L 8.6972656 10.111328 L 9.46875 8.0546875 L 5.4140625 4 L 11.271484 4 A 2 2 0 0 0 12 4.7304688 L 12 5.0019531 A 2.0002 2.0002 0 0 1 12.023438 5.0019531 A 2.0002 2.0002 0 0 1 13.873047 6.2988281 L 14 6.6367188 L 14 4.7285156 A 2 2 0 0 0 15 3 A 2 2 0 0 0 13 1 A 2 2 0 0 0 11.269531 2 L 4.7285156 2 A 2 2 0 0 0 3 1 z M 12 7 L 9 15 L 12 13 L 15 15 L 12 7 z "
+ transform="translate(0,1036.3622)"
+ id="path4162" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_navigation_polygon.svg b/tools/editor/icons/source/icon_navigation_polygon.svg
new file mode 100644
index 0000000000..f3b6fcbcc3
--- /dev/null
+++ b/tools/editor/icons/source/icon_navigation_polygon.svg
@@ -0,0 +1,88 @@
+<?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_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_navigation_polygon.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="11.686357"
+ inkscape:cy="9.3308993"
+ 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="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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <g
+ id="layer1-5"
+ inkscape:label="Layer 1"
+ style="fill:#e0e0e0;fill-opacity:1">
+ <path
+ id="path4144-6"
+ transform="translate(0,1036.3622)"
+ d="M 2,1 A 1.0001,1.0001 0 0 0 1,2 l 0,12 a 1.0001,1.0001 0 0 0 1,1 l 4.9023438,0 A 2.1002099,2.1002099 0 0 1 7.0332031,14.263672 L 7.5078125,13 3,13 3,3 11.585938,3 7.2929688,7.2929688 a 1.0001,1.0001 0 0 0 0,1.4140624 L 8.6191406,10.033203 10.033203,6.2636719 a 2.1002099,2.1002099 0 0 1 1.992188,-1.3613281 2.1002099,2.1002099 0 0 1 0.435547,0.050781 L 14.707031,2.7070312 A 1.0001,1.0001 0 0 0 14,1 L 2,1 Z"
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4163"
+ d="m 15,1051.3622 -3,-8 -3,8 3,-2 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>
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_packed_data_container.svg b/tools/editor/icons/source/icon_packed_data_container.svg
new file mode 100644
index 0000000000..70aed22f2c
--- /dev/null
+++ b/tools/editor/icons/source/icon_packed_data_container.svg
@@ -0,0 +1,138 @@
+<?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.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_packed_data_container.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.627417"
+ inkscape:cx="17.645108"
+ inkscape:cy="9.7856584"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ 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:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 2,1038.3622 0,12 12,0 0,-12 z"
+ id="path4154"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4167"
+ width="2"
+ height="2.0000174"
+ x="4"
+ y="1040.3622" />
+ <rect
+ y="1043.3622"
+ x="4"
+ height="2.0000174"
+ width="2"
+ id="rect4183"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4185"
+ width="2"
+ height="2.0000174"
+ x="4"
+ y="1046.3622" />
+ <rect
+ y="1040.3622"
+ x="7"
+ height="2.0000174"
+ width="2"
+ id="rect4187"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4189"
+ width="2"
+ height="2.0000174"
+ x="7"
+ y="1043.3622" />
+ <rect
+ y="1046.3622"
+ x="7"
+ height="2.0000174"
+ width="2"
+ id="rect4191"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4193"
+ width="2"
+ height="2.0000174"
+ x="10"
+ y="1040.3622" />
+ <rect
+ y="1043.3622"
+ x="10"
+ height="2.0000174"
+ width="2"
+ id="rect4195"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_particles_shader.svg b/tools/editor/icons/source/icon_particles_shader.svg
new file mode 100644
index 0000000000..b4c2ef7ccd
--- /dev/null
+++ b/tools/editor/icons/source/icon_particles_shader.svg
@@ -0,0 +1,159 @@
+<?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_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_particles_shader.svg">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4253">
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ id="path4255"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4199">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4201"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4208">
+ <path
+ style="opacity:1;fill:#a5b7f5;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ d="M 8,1037.3622 A 4.4999948,4.9999847 0 0 0 3.5859375,1041.3934 3,3 0 0 0 1,1044.3622 a 3,3 0 0 0 3,3 l 8,0 a 3,3 0 0 0 3,-3 3,3 0 0 0 -2.589844,-2.9668 A 4.4999948,4.9999847 0 0 0 8,1037.3622 Z m -4,11 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z m 8,0 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z m -4,1 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z"
+ id="path4210"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.999999"
+ inkscape:cx="8.2922739"
+ inkscape:cy="6.6952763"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="true"
+ inkscape:snap-intersection-paths="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-smooth-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ empspacing="4" />
+ </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)">
+ <g
+ id="g4271"
+ clip-path="url(#clipPath4208)"
+ transform="translate(0,1.8694115e-5)">
+ <rect
+ y="1037.3622"
+ x="0"
+ height="2.0000031"
+ width="16"
+ id="rect4159"
+ style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4161"
+ width="16"
+ height="2.0000029"
+ x="0"
+ y="1039.3622" />
+ <rect
+ style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4163"
+ width="16"
+ height="1.9999999"
+ x="0"
+ y="1041.3622" />
+ <rect
+ y="1043.3622"
+ x="0"
+ height="2.0000024"
+ width="16"
+ id="rect4165"
+ style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ y="1045.3622"
+ x="0"
+ height="2.0000021"
+ width="16"
+ id="rect4167"
+ style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4169"
+ width="16"
+ height="1.9999987"
+ x="0"
+ y="1049.3622" />
+ <rect
+ style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4146"
+ width="16"
+ height="2.0000021"
+ x="0"
+ y="1047.3622" />
+ </g>
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_patch_9_frame.svg b/tools/editor/icons/source/icon_patch_9_rect.svg
index f12789c19e..c5a09603a6 100644
--- a/tools/editor/icons/source/icon_patch_9_frame.svg
+++ b/tools/editor/icons/source/icon_patch_9_rect.svg
@@ -18,7 +18,7 @@
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_patch_9_frame.svg">
+ sodipodi:docname="icon_patch_9_rect.svg">
<defs
id="defs4" />
<sodipodi:namedview
diff --git a/tools/editor/icons/source/icon_polygon_path_finder.svg b/tools/editor/icons/source/icon_polygon_path_finder.svg
new file mode 100644
index 0000000000..c2f8d80c3d
--- /dev/null
+++ b/tools/editor/icons/source/icon_polygon_path_finder.svg
@@ -0,0 +1,77 @@
+<?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_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_polygon_path_finder.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="31.999999"
+ inkscape:cx="4.2632138"
+ inkscape:cy="9.710537"
+ 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="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)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 2 1 C 1.4477381 1.0000552 1.0000552 1.4477381 1 2 L 1 3 L 3 3 L 3 1 L 2 1 z M 5 1 L 5 3 L 7 3 L 7 1 L 5 1 z M 9 1 L 9 3 L 11 3 L 11 1 L 9 1 z M 13 1 L 13 3 L 14.414062 3 L 14.707031 2.7070312 C 15.336587 2.0770367 14.890637 1.0003496 14 1 L 13 1 z M 1 5 L 1 7 L 3 7 L 3 5 L 1 5 z M 12 7 L 9 15 L 12 13 L 15 15 L 12 7 z M 1 9 L 1 11 L 3 11 L 3 9 L 1 9 z M 1 13 L 1 14 C 1.0000552 14.552262 1.4477381 14.999945 2 15 L 3 15 L 3 13 L 1 13 z M 5 13 L 5 15 L 6.9023438 15 C 6.9015603 14.748705 6.9458828 14.499309 7.0332031 14.263672 L 7.5078125 13 L 5 13 z "
+ transform="translate(0,1036.3622)"
+ id="path4144" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_reference_frame.svg b/tools/editor/icons/source/icon_reference_rect.svg
index 76c3247f1b..cee814360d 100644
--- a/tools/editor/icons/source/icon_reference_frame.svg
+++ b/tools/editor/icons/source/icon_reference_rect.svg
@@ -18,7 +18,7 @@
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_reference_frame.svg">
+ sodipodi:docname="icon_reference_rect.svg">
<defs
id="defs4" />
<sodipodi:namedview
diff --git a/tools/editor/icons/source/icon_reflection_probe.svg b/tools/editor/icons/source/icon_reflection_probe.svg
new file mode 100644
index 0000000000..64b6493d6d
--- /dev/null
+++ b/tools/editor/icons/source/icon_reflection_probe.svg
@@ -0,0 +1,82 @@
+<?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.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_reflection_probe.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"
+ inkscape:cx="8.348015"
+ inkscape:cy="11.115501"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ 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;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 7.9628906 1.0019531 A 1.0001 1.0001 0 0 0 7.5527344 1.1054688 L 1.5527344 4.1054688 A 1.0001 1.0001 0 0 0 1 5 L 1 11 A 1.0001 1.0001 0 0 0 1.5527344 11.894531 L 7.5527344 14.894531 A 1.0001 1.0001 0 0 0 8.4472656 14.894531 L 14.447266 11.894531 A 1.0001 1.0001 0 0 0 15 11 L 15 5 A 1.0001 1.0001 0 0 0 14.447266 4.1054688 L 8.4472656 1.1054688 A 1.0001 1.0001 0 0 0 7.9628906 1.0019531 z M 7 3.6191406 L 7 12.382812 L 3 10.382812 L 3 5.6191406 L 7 3.6191406 z M 9 3.6191406 L 13 5.6191406 L 13 10.382812 L 9 12.382812 L 9 3.6191406 z "
+ transform="translate(0,1036.3622)"
+ id="path4139" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_room.svg b/tools/editor/icons/source/icon_room.svg
index 8a2ccc30c8..599bbeb770 100644
--- a/tools/editor/icons/source/icon_room.svg
+++ b/tools/editor/icons/source/icon_room.svg
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="22.627416"
- inkscape:cx="11.210875"
- inkscape:cy="4.4642701"
+ inkscape:cx="11.166681"
+ inkscape:cy="6.6297847"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -60,7 +60,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -69,27 +69,10 @@
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
- <g
- id="layer1-7"
- inkscape:label="Layer 1"
- transform="translate(0,1.1802001e-5)"
- style="stroke:#fc9c9c;stroke-opacity:0.99607843">
- <path
- sodipodi:nodetypes="ccccccc"
- inkscape:connector-curvature="0"
- id="path4139"
- d="m 8,1050.3622 -6,-3 0,-6 6,-3 6,3 0,6 z"
- style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
- </g>
<path
- style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
- d="M 7 2 L 7 7.3828125 L 1.5527344 10.105469 L 2.4472656 11.894531 L 8 9.1191406 L 13.552734 11.894531 L 14.447266 10.105469 L 9 7.3828125 L 9 2 L 7 2 z "
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 7.9628906 1.0019531 A 1.0001 1.0001 0 0 0 7.5527344 1.1054688 L 1.5527344 4.1054688 A 1.0001 1.0001 0 0 0 1 5 L 1 11 A 1.0001 1.0001 0 0 0 1.5527344 11.894531 L 7.5527344 14.894531 A 1.0001 1.0001 0 0 0 8.4472656 14.894531 L 14.447266 11.894531 A 1.0001 1.0001 0 0 0 15 11 L 15 5 A 1.0001 1.0001 0 0 0 14.447266 4.1054688 L 8.4472656 1.1054688 A 1.0001 1.0001 0 0 0 7.9628906 1.0019531 z M 9 3.6191406 L 13 5.6191406 L 13 9.3828125 L 9 7.3828125 L 9 3.6191406 z M 8 9.1191406 L 11.763672 11 L 8 12.882812 L 4.2363281 11 L 8 9.1191406 z "
transform="translate(0,1036.3622)"
- id="path4200" />
- <path
- style="fill:#fc9c9c;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:0.99607843"
- d="m 2,1047.3622 0,-6 6,-3 0,6 z"
- id="path4209"
- inkscape:connector-curvature="0" />
+ id="path4139" />
</g>
</svg>
diff --git a/tools/editor/icons/source/icon_room_bounds.svg b/tools/editor/icons/source/icon_room_bounds.svg
new file mode 100644
index 0000000000..8f7e6e6c83
--- /dev/null
+++ b/tools/editor/icons/source/icon_room_bounds.svg
@@ -0,0 +1,78 @@
+<?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_node_2d.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_room_bounds.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="31.999999"
+ inkscape:cx="9.5548877"
+ inkscape:cy="9.0516113"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ empspacing="4" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 1 1 L 1 2 L 1 3 L 2 3 L 2 2 L 3 2 L 3 1 L 2 1 L 1 1 z M 13 1 L 13 2 L 14 2 L 14 3 L 15 3 L 15 2 L 15 1 L 14 1 L 13 1 z M 7.9628906 1.0019531 A 1.0001 1.0001 0 0 0 7.5527344 1.1054688 L 1.5527344 4.1054688 A 1.0001 1.0001 0 0 0 1 5 L 1 11 A 1.0001 1.0001 0 0 0 1.5527344 11.894531 L 7.5527344 14.894531 A 1.0001 1.0001 0 0 0 8.4472656 14.894531 L 14.447266 11.894531 A 1.0001 1.0001 0 0 0 15 11 L 15 5 A 1.0001 1.0001 0 0 0 14.447266 4.1054688 L 8.4472656 1.1054688 A 1.0001 1.0001 0 0 0 7.9628906 1.0019531 z M 9 3.6191406 L 13 5.6191406 L 13 9.3828125 L 9 7.3828125 L 9 3.6191406 z M 8 9.1191406 L 11.763672 11 L 8 12.882812 L 4.2363281 11 L 8 9.1191406 z M 1 13 L 1 14 L 1 15 L 2 15 L 3 15 L 3 14 L 2 14 L 2 13 L 1 13 z M 14 13 L 14 14 L 13 14 L 13 15 L 14 15 L 15 15 L 15 14 L 15 13 L 14 13 z "
+ transform="translate(0,1036.3622)"
+ id="path4139" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_sample_library.svg b/tools/editor/icons/source/icon_sample_library.svg
new file mode 100644
index 0000000000..78b01430c2
--- /dev/null
+++ b/tools/editor/icons/source/icon_sample_library.svg
@@ -0,0 +1,87 @@
+<?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_dependency_changed_hl.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_sample_library.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="21.70867"
+ inkscape:cx="6.3137691"
+ inkscape:cy="6.7376711"
+ 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:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 9,8 0,1 0,5 0,1 5,0 c 0.552285,0 1,-0.447715 1,-1 L 15,9 C 15,8.4477153 14.552285,8 14,8 l 0,4 -1,-1 -1,1 0,-4 z"
+ transform="translate(0,1036.3622)"
+ id="rect4161"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccssscccccc" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ff8484;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 7.0214844,1037.3633 a 1.0001,1.0001 0 0 0 -1,0.875 l -0.5898438,4.7226 -0.5234375,-1.0468 a 1.0001,1.0001 0 0 0 -0.8945312,-0.5528 l -2,0 a 1.0001,1.0001 0 1 0 0,2 l 1.3828125,0 1.7226562,3.4473 a 1.0001,1.0001 0 0 0 1.8867188,-0.3223 l 0.5898437,-4.7226 0.5234375,1.0449 a 1.0001,1.0001 0 0 0 0.8945313,0.5527 l 3.0000001,0 a 1.0001,1.0001 0 1 0 0,-2 l -2.3808595,0 -1.7246094,-3.4472 a 1.0001,1.0001 0 0 0 -0.8867187,-0.5508 z"
+ id="path4181"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_script_create.svg b/tools/editor/icons/source/icon_script_create.svg
new file mode 100644
index 0000000000..0cf16a9c3b
--- /dev/null
+++ b/tools/editor/icons/source/icon_script_create.svg
@@ -0,0 +1,99 @@
+<?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/godotengine/godot/tools/editor/icons/con_script_create.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_script_create.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="21.189633"
+ inkscape:cx="7.8202901"
+ inkscape:cy="11.917121"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ showguides="false"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ empspacing="4" />
+ </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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ d="M 6 1 L 6 2 C 5.4477153 2 5 2.4477153 5 3 L 5 13 L 4 13 L 4 11 L 2 11 L 2 13 C 2.0002826 13.356983 2.1908437 13.686743 2.5 13.865234 C 2.6519425 13.953279 2.8243914 13.999759 3 14 L 3 15 L 8 15 L 9 15 L 9 14 L 8 14 L 8 10 L 10 10 L 10 8 L 12 8 L 12 5 L 15 5 L 15 3 C 15 1.8954305 14.104569 1 13 1 L 6 1 z "
+ transform="translate(0,1036.3622)"
+ id="rect4255" />
+ <path
+ style="opacity:1;fill:#b4b4b4;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ d="M 6 1 C 4.8954305 1 4 1.8954305 4 3 L 4 10 L 2 10 L 1 10 L 1 11 L 1 13 C 1 14.104569 1.8954305 15 3 15 C 4.1045695 15 5 14.104569 5 13 L 5 3 C 5 2.4477153 5.4477153 2 6 2 C 6.5522847 2 7 2.4477153 7 3 L 7 4 L 7 5 L 7 6 L 8 6 L 12 6 L 12 5 L 8 5 L 8 4 L 8 3 C 8 1.8954305 7.1045695 1 6 1 z M 2 11 L 4 11 L 4 13 C 4 13.552285 3.5522847 14 3 14 C 2.4477153 14 2 13.552285 2 13 L 2 11 z "
+ id="path4265"
+ transform="translate(0,1036.3622)" />
+ <circle
+ cy="1048.3622"
+ cx="3"
+ id="ellipse4234"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ ry="1.0000174"
+ rx="1" />
+ <path
+ style="fill:#84ffb1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 13,1049.3622 2,0 0,-2 -2,0 0,-2 -2,0 0,2 -2,0 0,2 2,0 0,2 2,0 z"
+ id="path8069"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccc" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_shader.svg b/tools/editor/icons/source/icon_shader.svg
index 4c7b5aafc1..ba12b007ad 100644
--- a/tools/editor/icons/source/icon_shader.svg
+++ b/tools/editor/icons/source/icon_shader.svg
@@ -7,7 +7,6 @@
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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16"
@@ -22,30 +21,6 @@
sodipodi:docname="icon_shader.svg">
<defs
id="defs4">
- <linearGradient
- inkscape:collect="always"
- id="linearGradient4174">
- <stop
- style="stop-color:#ff5353;stop-opacity:1"
- offset="0"
- id="stop4176" />
- <stop
- id="stop4186"
- offset="0.29999271"
- style="stop-color:#f1e17a;stop-opacity:1" />
- <stop
- id="stop4184"
- offset="0.55557561"
- style="stop-color:#6bfcef;stop-opacity:1" />
- <stop
- style="stop-color:#9765fd;stop-opacity:1"
- offset="0.8889094"
- id="stop4188" />
- <stop
- style="stop-color:#ff6092;stop-opacity:1"
- offset="1"
- id="stop4178" />
- </linearGradient>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4253">
@@ -55,17 +30,6 @@
id="path4255"
inkscape:connector-curvature="0" />
</clipPath>
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient4174"
- id="radialGradient4161"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.2857125,1.428583,-1.4285914,1.2857189,1540.5411,-308.80327)"
- cx="7.5384259"
- cy="1041.7489"
- fx="7.5384259"
- fy="1041.7489"
- r="7" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4199">
@@ -83,9 +47,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="45.254832"
- inkscape:cx="1.7751371"
- inkscape:cy="8.8192435"
+ inkscape:zoom="31.999999"
+ inkscape:cx="6.7591143"
+ inkscape:cy="9.6862321"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -183,93 +147,5 @@
x="3"
y="1040.8622" />
</g>
- <path
- inkscape:connector-curvature="0"
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 29.5,1037.3622 -7,3 0,8 7,3 7,-3 0,-8 -7,-3 z"
- id="path4151" />
- <path
- style="fill:#ffff91;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 22.5,1046.3622 7,3 7,-3 -7,-3 z"
- id="path4223"
- inkscape:connector-curvature="0" />
- <path
- inkscape:connector-curvature="0"
- id="path4221"
- d="m 22.5,1043.3622 7,3 7,-3 -7,-3 z"
- style="fill:#ff91ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
- <path
- style="fill:#00ffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 29.5,1045.3622 -7,-3 0,-2 7,3 z"
- id="path4143"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccccc" />
- <path
- inkscape:connector-curvature="0"
- id="path4145"
- d="m 29.5,1045.3622 7,-3 0,-2 -7,3 z"
- style="fill:#00d8d8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- sodipodi:nodetypes="ccccc" />
- <path
- style="fill:#91ffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 22.5,1040.3622 7,3 7,-3 -7,-3 z"
- id="path4149"
- inkscape:connector-curvature="0" />
- <path
- sodipodi:nodetypes="ccccc"
- style="fill:#d800d8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 29.5,1048.3622 7,-3 0,-2 -7,3 z"
- id="path4208"
- inkscape:connector-curvature="0" />
- <path
- inkscape:connector-curvature="0"
- id="path4215"
- d="m 29.5,1048.3622 -7,-3 0,-2 7,3 z"
- style="fill:#ff00ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- sodipodi:nodetypes="ccccc" />
- <path
- inkscape:connector-curvature="0"
- id="path4217"
- d="m 29.5,1051.3622 7,-3 0,-2 -7,3 z"
- style="fill:#d8d800;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- sodipodi:nodetypes="ccccc" />
- <path
- sodipodi:nodetypes="ccccc"
- style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 29.5,1051.3622 -7,-3 0,-2 7,3 z"
- id="path4219"
- inkscape:connector-curvature="0" />
- <g
- inkscape:label="Layer 1"
- id="layer1-5"
- transform="translate(18,1)">
- <path
- id="path4151-1"
- d="m 29.5,1037.3622 -7,3 0,8 7,3 7,-3 0,-8 -7,-3 z"
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- inkscape:connector-curvature="0" />
- <path
- inkscape:connector-curvature="0"
- id="path4149-2"
- d="m 22.5,1040.3622 7,3 7,-3 -7,-3 z"
- style="fill:#00ffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
- <path
- sodipodi:nodetypes="ccccc"
- inkscape:connector-curvature="0"
- id="path4143-0"
- d="m 29.5,1051.3622 -7,-3 0,-8 7,3 z"
- style="fill:#ff00ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
- <path
- sodipodi:nodetypes="ccccc"
- style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="m 29.5,1051.3622 7,-3 0,-8 -7,3 z"
- id="path4145-0"
- inkscape:connector-curvature="0" />
- </g>
- <path
- style="opacity:1;fill:url(#radialGradient4161);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
- d="m 64,1037.3622 a 7,7.0000001 0 0 0 -7,7 7,7.0000001 0 0 0 7,7 7,7.0000001 0 0 0 7,-7 7,7.0000001 0 0 0 -7,-7 z m -2,2 a 2,2 0 0 1 2,2 2,2 0 0 1 -2,2 2,2 0 0 1 -2,-2 2,2 0 0 1 2,-2 z"
- id="path4159"
- inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/tools/editor/icons/source/icon_short_cut.svg b/tools/editor/icons/source/icon_short_cut.svg
new file mode 100644
index 0000000000..05069e8ea1
--- /dev/null
+++ b/tools/editor/icons/source/icon_short_cut.svg
@@ -0,0 +1,89 @@
+<?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_key.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_short_cut.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254835"
+ inkscape:cx="7.0902833"
+ inkscape:cy="8.378548"
+ 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:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ 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="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 4 2 C 3.4477153 2 3 2.4477 3 3 L 3 12.083984 C 3.0004015 12.589984 3.4479991 13 4 13 L 12 13 C 12.552001 13 12.999599 12.589984 13 12.083984 L 13 3 C 13 2.4477 12.552285 2 12 2 L 4 2 z M 1 4 L 1 13 A 2 2 0 0 0 3 15 L 13 15 A 2 2 0 0 0 15 13 L 15 4 L 14 4 L 14 13 A 0.9999826 0.9999826 0 0 1 13 14 L 3 14 A 1 1 0 0 1 2 13 L 2 4 L 1 4 z M 7 4 L 10 4 L 9 7 L 11 7 L 7 11 L 8 8 L 6 8 L 7 4 z "
+ transform="translate(0,1036.3622)"
+ id="rect4155" />
+ <rect
+ style="opacity:1;fill:#ffffff;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect4194"
+ width="7"
+ height="14"
+ x="27"
+ y="1038.3622" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_spatial_shader.svg b/tools/editor/icons/source/icon_spatial_shader.svg
new file mode 100644
index 0000000000..329354b716
--- /dev/null
+++ b/tools/editor/icons/source/icon_spatial_shader.svg
@@ -0,0 +1,165 @@
+<?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.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_spatial_shader.svg">
+ <defs
+ id="defs4">
+ <clipPath
+ id="clipPath4253"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4255"
+ d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </clipPath>
+ <clipPath
+ id="clipPath4199"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z"
+ id="path4201"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4280">
+ <g
+ id="g4282"
+ inkscape:label="Layer 1"
+ transform="translate(0,1.1802001e-5)"
+ style="stroke:#fc9c9c;stroke-opacity:0.99607843">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 7.9628906,1.0019531 A 1.0001,1.0001 0 0 0 7.5527344,1.1054688 l -6,3 A 1.0001,1.0001 0 0 0 1,5 l 0,6 a 1.0001,1.0001 0 0 0 0.5527344,0.894531 l 6,3 a 1.0001,1.0001 0 0 0 0.8945312,0 l 6.0000004,-3 A 1.0001,1.0001 0 0 0 15,11 L 15,5 A 1.0001,1.0001 0 0 0 14.447266,4.1054688 l -6.0000004,-3 A 1.0001,1.0001 0 0 0 7.9628906,1.0019531 Z M 8,3.1191406 11.763672,5 8,6.8828125 4.2363281,5 8,3.1191406 Z m -5,3.5 4,2 0,3.7636714 -4,-2 0,-3.7636714 z m 10,0 0,3.7636714 -4,2 0,-3.7636714 4,-2 z"
+ transform="translate(0,1036.3622)"
+ id="path4284"
+ inkscape:connector-curvature="0" />
+ </g>
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627417"
+ inkscape:cx="7.8442401"
+ inkscape:cy="13.929239"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ inkscape:object-nodes="false"
+ inkscape:snap-smooth-nodes="false"
+ 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)">
+ <g
+ id="g4271"
+ clip-path="url(#clipPath4280)">
+ <rect
+ y="1037.3622"
+ x="0"
+ height="2.0000031"
+ width="16"
+ id="rect4159"
+ style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4161"
+ width="16"
+ height="2.0000029"
+ x="0"
+ y="1039.3622" />
+ <rect
+ style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4163"
+ width="16"
+ height="1.9999999"
+ x="0"
+ y="1041.3622" />
+ <rect
+ y="1043.3622"
+ x="0"
+ height="2.0000024"
+ width="16"
+ id="rect4165"
+ style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ y="1045.3622"
+ x="0"
+ height="2.0000021"
+ width="16"
+ id="rect4167"
+ style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4169"
+ width="16"
+ height="1.9999987"
+ x="0"
+ y="1049.3622" />
+ <rect
+ style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4146"
+ width="16"
+ height="2.0000021"
+ x="0"
+ y="1047.3622" />
+ </g>
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_sprite_frames.svg b/tools/editor/icons/source/icon_sprite_frames.svg
new file mode 100644
index 0000000000..dc445da773
--- /dev/null
+++ b/tools/editor/icons/source/icon_sprite_frames.svg
@@ -0,0 +1,119 @@
+<?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_sprite_frames.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254835"
+ inkscape:cx="10.147205"
+ inkscape:cy="8.653875"
+ 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
+ y="1046.3622"
+ x="10"
+ height="2.0000086"
+ width="2"
+ id="rect4230"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4232"
+ width="2"
+ height="2.0000086"
+ x="13"
+ y="1046.3622" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4234"
+ width="2"
+ height="2.0000086"
+ x="10"
+ y="1049.3622" />
+ <rect
+ y="1049.3622"
+ x="13"
+ height="2.0000086"
+ width="2"
+ id="rect4236"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 6 1 A 5 5 0 0 0 1 6 A 5 5 0 0 0 6 11 A 5 5 0 0 0 11 6 A 5 5 0 0 0 6 1 z M 3 5 A 1 1 0 0 1 4 6 A 1 1 0 0 1 3 7 A 1 1 0 0 1 2 6 A 1 1 0 0 1 3 5 z M 9 5 A 1 1 0 0 1 10 6 A 1 1 0 0 1 9 7 A 1 1 0 0 1 8 6 A 1 1 0 0 1 9 5 z M 7.9960938 7.4921875 A 0.50005 0.50005 0 0 1 8.3535156 8.3535156 C 7.7356645 8.9714156 6.8611111 9.25 6 9.25 C 5.1388889 9.25 4.2643355 8.9714156 3.6464844 8.3535156 A 0.50005 0.50005 0 0 1 3.9941406 7.4960938 A 0.50005 0.50005 0 0 1 4.3535156 7.6464844 C 4.7356645 8.0286844 5.3611111 8.25 6 8.25 C 6.6388889 8.25 7.2643355 8.0286844 7.6464844 7.6464844 A 0.50005 0.50005 0 0 1 7.9960938 7.4921875 z "
+ transform="translate(0,1036.3622)"
+ id="path4238" />
+ <rect
+ y="1043.3622"
+ x="13"
+ height="2.0000086"
+ width="2"
+ id="rect4246"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ y="1049.3622"
+ x="7"
+ height="2.0000086"
+ width="2"
+ id="rect4248"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_style_box_empty.svg b/tools/editor/icons/source/icon_style_box_empty.svg
new file mode 100644
index 0000000000..c881fe1c10
--- /dev/null
+++ b/tools/editor/icons/source/icon_style_box_empty.svg
@@ -0,0 +1,140 @@
+<?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_center_container.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_style_box_empty.svg">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4313">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 6.3750001,1025.8622 c -0.931942,2e-4 -1.6874069,0.6716 -1.6875,1.5 l 0,1.5 3.375,0 0,-3 -1.6875,0 z m 5.0624999,0 0,3 3.375,0 0,-3 -3.375,0 z m 6.75,0 0,3 3.375,0 0,-3 -3.375,0 z m 6.75,0 0,3 3.375,0 0,-1.5 c -9.3e-5,-0.8284 -0.755558,-1.4998 -1.6875,-1.5 l -1.6875,0 z m -20.2499999,6 0,3 3.375,0 0,-3 -3.375,0 z m 20.2499999,0 0,0.3486 c 0.532973,0.2675 0.975667,0.657 1.282105,1.128 0.537834,0.828 1.294284,1.6769 2.092895,2.5722 l 0,-4.0488 -3.375,0 z m -1.6875,3 c -1.948558,3 -5.0625,5.0147 -5.0625,7.5 0,2.4854 2.266559,4.5 5.0625,4.5 2.795941,0 5.0625,-2.0146 5.0625,-4.5 0,-2.4853 -3.113942,-4.5 -5.0625,-7.5 z m -18.5624999,3 0,3 3.375,0 0,-3 -3.375,0 z m 0,6 0,1.5 c 9.31e-5,0.8284 0.755558,1.4998 1.6875,1.5 l 1.6875,0 0,-3 -3.375,0 z m 6.7499999,0 0,3 3.375,0 0,-3 -3.375,0 z"
+ id="path4315"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="10.442024"
+ inkscape:cy="8.6470776"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-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)">
+ <g
+ id="g4181"
+ mask="none"
+ clip-path="url(#clipPath4313)"
+ transform="matrix(0.59259259,0,0,0.66666674,-1.7777778,353.45399)">
+ <rect
+ y="1025.8622"
+ x="3"
+ height="3.0000043"
+ width="27"
+ id="rect4159"
+ style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4161"
+ width="27"
+ height="3.0000041"
+ x="3"
+ y="1028.8622" />
+ <rect
+ style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4163"
+ width="27"
+ height="2.9999995"
+ x="3"
+ y="1031.8622" />
+ <rect
+ y="1034.8622"
+ x="3"
+ height="3.0000031"
+ width="27"
+ id="rect4165"
+ style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ y="1037.8622"
+ x="3"
+ height="3.0000029"
+ width="27"
+ id="rect4167"
+ style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4169"
+ width="27"
+ height="2.9999976"
+ x="3"
+ y="1043.8622" />
+ <rect
+ style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4146"
+ width="27"
+ height="3.0000029"
+ x="3"
+ y="1040.8622" />
+ </g>
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_style_box_flat.svg b/tools/editor/icons/source/icon_style_box_flat.svg
new file mode 100644
index 0000000000..9071014ff3
--- /dev/null
+++ b/tools/editor/icons/source/icon_style_box_flat.svg
@@ -0,0 +1,149 @@
+<?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_center_container.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_style_box_flat.svg">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4313">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 6.3750001,1025.8622 c -0.931942,2e-4 -1.6874069,0.6716 -1.6875,1.5 l 0,1.5 3.375,0 0,-3 -1.6875,0 z m 5.0624999,0 0,3 3.375,0 0,-3 -3.375,0 z m 6.75,0 0,3 3.375,0 0,-3 -3.375,0 z m 6.75,0 0,3 3.375,0 0,-1.5 c -9.3e-5,-0.8284 -0.755558,-1.4998 -1.6875,-1.5 l -1.6875,0 z m -20.2499999,6 0,3 3.375,0 0,-3 -3.375,0 z m 20.2499999,0 0,0.3486 c 0.532973,0.2675 0.975667,0.657 1.282105,1.128 0.537834,0.828 1.294284,1.6769 2.092895,2.5722 l 0,-4.0488 -3.375,0 z m -1.6875,3 c -1.948558,3 -5.0625,5.0147 -5.0625,7.5 0,2.4854 2.266559,4.5 5.0625,4.5 2.795941,0 5.0625,-2.0146 5.0625,-4.5 0,-2.4853 -3.113942,-4.5 -5.0625,-7.5 z m -18.5624999,3 0,3 3.375,0 0,-3 -3.375,0 z m 0,6 0,1.5 c 9.31e-5,0.8284 0.755558,1.4998 1.6875,1.5 l 1.6875,0 0,-3 -3.375,0 z m 6.7499999,0 0,3 3.375,0 0,-3 -3.375,0 z"
+ id="path4315"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4391">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 6.3750001,1025.8622 c -0.931942,2e-4 -1.6874069,0.6716 -1.6875,1.5 l 0,18 c 9.31e-5,0.8284 0.755558,1.4998 1.6875,1.5 l 10.1876219,0 c -1.081633,-1.2612 -1.750122,-2.8111 -1.750122,-4.5 0,-2.3563 1.351562,-4.0453 2.494995,-5.376 1.143433,-1.3305 2.270438,-2.4714 3.019043,-3.624 0.571813,-0.8788 1.604865,-1.4416 2.745483,-1.4941 1.267652,-0.06 2.465974,0.5173 3.101441,1.4941 0.549842,0.8466 1.32435,1.7113 2.139038,2.625 l 0,-8.625 c -9.3e-5,-0.8284 -0.755558,-1.4998 -1.6875,-1.5 l -20.2499999,0 z m 16.8749999,9 c -1.948558,3 -5.0625,5.0147 -5.0625,7.5 0,2.4854 2.266559,4.5 5.0625,4.5 2.795941,0 5.0625,-2.0146 5.0625,-4.5 0,-2.4853 -3.113942,-4.5 -5.0625,-7.5 z"
+ id="path4393"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="32"
+ inkscape:cx="11.34212"
+ inkscape:cy="7.7545325"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-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)">
+ <g
+ id="g4181"
+ mask="none"
+ clip-path="url(#clipPath4391)"
+ transform="matrix(0.59259259,0,0,0.66666674,-1.7777778,353.45399)">
+ <rect
+ y="1025.8622"
+ x="3"
+ height="3.0000043"
+ width="27"
+ id="rect4159"
+ style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4161"
+ width="27"
+ height="3.0000041"
+ x="3"
+ y="1028.8622" />
+ <rect
+ style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4163"
+ width="27"
+ height="2.9999995"
+ x="3"
+ y="1031.8622" />
+ <rect
+ y="1034.8622"
+ x="3"
+ height="3.0000031"
+ width="27"
+ id="rect4165"
+ style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ y="1037.8622"
+ x="3"
+ height="3.0000029"
+ width="27"
+ id="rect4167"
+ style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4169"
+ width="27"
+ height="2.9999976"
+ x="3"
+ y="1043.8622" />
+ <rect
+ style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4146"
+ width="27"
+ height="3.0000029"
+ x="3"
+ y="1040.8622" />
+ </g>
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_style_box_texture.svg b/tools/editor/icons/source/icon_style_box_texture.svg
new file mode 100644
index 0000000000..30b1f1af68
--- /dev/null
+++ b/tools/editor/icons/source/icon_style_box_texture.svg
@@ -0,0 +1,140 @@
+<?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_center_container.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_style_box_texture.svg">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4189">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 6.3750001,1025.8622 a 1.6876688,1.5001498 0 0 0 -1.6875,1.5 l 0,18 a 1.6876688,1.5001498 0 0 0 1.6875,1.5 l 10.1217039,0 c -0.747392,-0.8796 -1.304338,-1.8888 -1.562256,-3 l -6.8719479,0 0,-15 16.8749999,0 0,3.3486 a 3.4281247,3.0472216 0 0 1 1.282105,1.1279 c 0.537834,0.828 1.294284,1.677 2.092895,2.5723 l 0,-8.5488 a 1.6876688,1.5001498 0 0 0 -1.6875,-1.5 l -20.2499999,0 z m 11.8124999,4.5 0,1.5 -1.6875,0 0,1.5 -3.375,0 0,1.5 -1.6875,0 0,1.5 -1.6874999,0 0,1.5 3.3749999,0 3.375,0 0.02637,0 c 0.246127,-0.317 0.496441,-0.6239 0.738282,-0.9053 1.145331,-1.3327 2.270672,-2.4711 3.015746,-3.6182 a 3.4281247,3.0472216 0 0 1 1.282105,-1.1279 l 0,-0.3486 -1.6875,0 0,-1.5 -1.6875,0 z m 5.0625,4.5 c -1.948558,3 -5.0625,5.0146 -5.0625,7.5 0,2.4853 2.266559,4.5 5.0625,4.5 2.795941,0 5.0625,-2.0147 5.0625,-4.5 0,-2.4854 -3.113942,-4.5 -5.0625,-7.5 z"
+ id="path4191"
+ inkscape:connector-curvature="0" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627417"
+ inkscape:cx="9.8110364"
+ inkscape:cy="10.993538"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-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 />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <g
+ id="g4181"
+ mask="none"
+ clip-path="url(#clipPath4189)"
+ transform="matrix(0.59259259,0,0,0.66666674,-1.7777778,353.454)">
+ <rect
+ y="1025.8622"
+ x="3"
+ height="3.0000043"
+ width="27"
+ id="rect4159"
+ style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4161"
+ width="27"
+ height="3.0000041"
+ x="3"
+ y="1028.8622" />
+ <rect
+ style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4163"
+ width="27"
+ height="2.9999995"
+ x="3"
+ y="1031.8622" />
+ <rect
+ y="1034.8622"
+ x="3"
+ height="3.0000031"
+ width="27"
+ id="rect4165"
+ style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ y="1037.8622"
+ x="3"
+ height="3.0000029"
+ width="27"
+ id="rect4167"
+ style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4169"
+ width="27"
+ height="2.9999976"
+ x="3"
+ y="1043.8622" />
+ <rect
+ style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4146"
+ width="27"
+ height="3.0000029"
+ x="3"
+ y="1040.8622" />
+ </g>
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_test_cube.svg b/tools/editor/icons/source/icon_test_cube.svg
index 8b5db2dc5d..c42c0bb674 100644
--- a/tools/editor/icons/source/icon_test_cube.svg
+++ b/tools/editor/icons/source/icon_test_cube.svg
@@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="45.254834"
- inkscape:cx="7.2538994"
- inkscape:cy="5.8068101"
+ inkscape:cx="7.5411615"
+ inkscape:cy="7.1105382"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -64,7 +64,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -79,16 +79,10 @@
transform="translate(0,1.1802001e-5)"
style="stroke:#fc9c9c;stroke-opacity:0.99607843">
<path
- sodipodi:nodetypes="ccccccc"
- inkscape:connector-curvature="0"
- id="path4139"
- d="m 8,1050.3622 -6,-3 0,-6 6,-3 6,3 0,6 z"
- style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" />
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 7.9628906 1.0019531 A 1.0001 1.0001 0 0 0 7.5527344 1.1054688 L 1.5527344 4.1054688 A 1.0001 1.0001 0 0 0 1 5 L 1 11 A 1.0001 1.0001 0 0 0 1.5527344 11.894531 L 7.5527344 14.894531 A 1.0001 1.0001 0 0 0 8.4472656 14.894531 L 14.447266 11.894531 A 1.0001 1.0001 0 0 0 15 11 L 15 5 A 1.0001 1.0001 0 0 0 14.447266 4.1054688 L 8.4472656 1.1054688 A 1.0001 1.0001 0 0 0 7.9628906 1.0019531 z M 8 3.1191406 L 11.763672 5 L 8 6.8828125 L 4.2363281 5 L 8 3.1191406 z M 3 6.6191406 L 7 8.6191406 L 7 12.382812 L 3 10.382812 L 3 6.6191406 z M 13 6.6191406 L 13 10.382812 L 9 12.382812 L 9 8.6191406 L 13 6.6191406 z "
+ transform="translate(0,1036.3622)"
+ id="path4139" />
</g>
- <path
- style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
- d="M 2.4472656 4.1054688 L 1.5527344 5.8945312 L 7 8.6191406 L 7 14 L 9 14 L 9 8.6191406 L 14.447266 5.8945312 L 13.552734 4.1054688 L 8 6.8828125 L 2.4472656 4.1054688 z "
- transform="translate(0,1036.3622)"
- id="path4155" />
</g>
</svg>
diff --git a/tools/editor/icons/source/icon_texture_frame.svg b/tools/editor/icons/source/icon_texture_rect.svg
index afab41de41..88d9b4081f 100644
--- a/tools/editor/icons/source/icon_texture_frame.svg
+++ b/tools/editor/icons/source/icon_texture_rect.svg
@@ -18,7 +18,7 @@
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
- sodipodi:docname="icon_texture_frame.svg">
+ sodipodi:docname="icon_texture_rect.svg">
<defs
id="defs4" />
<sodipodi:namedview
diff --git a/tools/editor/icons/source/icon_theme.svg b/tools/editor/icons/source/icon_theme.svg
new file mode 100644
index 0000000000..2cacb9755a
--- /dev/null
+++ b/tools/editor/icons/source/icon_theme.svg
@@ -0,0 +1,144 @@
+<?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_bone.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_theme.svg">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath4370">
+ <g
+ id="g4372"
+ inkscape:label="Layer 1"
+ transform="matrix(1.6875,0,0,1.4999998,2.9999999,-530.18094)">
+ <path
+ id="path4374"
+ transform="translate(0,1036.3622)"
+ d="M 7,1 6.4355469,3.2578125 A 5.0000172,5.0000172 0 0 0 5.7460938,3.5371094 L 3.7578125,2.34375 2.34375,3.7578125 3.5390625,5.7519531 A 5.0000172,5.0000172 0 0 0 3.2539062,6.4375 L 1,7 1,9 3.2578125,9.5644531 A 5.0000172,5.0000172 0 0 0 3.5371094,10.251953 L 2.34375,12.242188 3.7578125,13.65625 5.7519531,12.460938 A 5.0000172,5.0000172 0 0 0 6.4375,12.746094 L 7,15 9,15 9.5644531,12.742188 a 5.0000172,5.0000172 0 0 0 0.6874999,-0.279297 l 1.990235,1.193359 1.414062,-1.414062 -1.195312,-1.994141 A 5.0000172,5.0000172 0 0 0 12.746094,9.5625 L 15,9 15,7 12.742188,6.4355469 a 5.0000172,5.0000172 0 0 0 -0.279297,-0.6875 L 13.65625,3.7578125 12.242188,2.34375 10.248047,3.5390625 A 5.0000172,5.0000172 0 0 0 9.5625,3.2539062 L 9,1 7,1 Z M 8,6 A 2.0000174,2.0000174 0 0 1 10,8 2.0000174,2.0000174 0 0 1 8,10 2.0000174,2.0000174 0 0 1 6,8 2.0000174,2.0000174 0 0 1 8,6 Z"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ </g>
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16"
+ inkscape:cx="10.857726"
+ inkscape:cy="9.3127855"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ showguides="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)">
+ <g
+ id="g4181"
+ mask="none"
+ clip-path="url(#clipPath4370)"
+ transform="matrix(0.59259259,0,0,0.66666674,-1.7777777,353.454)">
+ <rect
+ y="1025.8622"
+ x="3"
+ height="3.0000043"
+ width="27"
+ id="rect4159"
+ style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4161-3"
+ width="27"
+ height="3.0000041"
+ x="3"
+ y="1028.8622" />
+ <rect
+ style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4163-6"
+ width="27"
+ height="2.9999995"
+ x="3"
+ y="1031.8622" />
+ <rect
+ y="1034.8622"
+ x="3"
+ height="3.0000031"
+ width="27"
+ id="rect4165-1"
+ style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ y="1037.8622"
+ x="3"
+ height="3.0000029"
+ width="27"
+ id="rect4167"
+ style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4169"
+ width="27"
+ height="2.9999976"
+ x="3"
+ y="1043.8622" />
+ <rect
+ style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4146"
+ width="27"
+ height="3.0000029"
+ x="3"
+ y="1040.8622" />
+ </g>
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_tile_set.svg b/tools/editor/icons/source/icon_tile_set.svg
new file mode 100644
index 0000000000..e697f03888
--- /dev/null
+++ b/tools/editor/icons/source/icon_tile_set.svg
@@ -0,0 +1,80 @@
+<?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_dependency_changed_hl.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_tile_set.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="30.700696"
+ inkscape:cx="7.5612844"
+ inkscape:cy="6.4018109"
+ 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:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="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="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 1 1 L 1 3 L 3 3 L 3 1 L 1 1 z M 4 1 L 4 3 L 6 3 L 6 1 L 4 1 z M 7 1 L 7 3 L 9 3 L 9 1 L 7 1 z M 10 1 L 10 3 L 12 3 L 12 1 L 10 1 z M 13 1 L 13 3 L 15 3 L 15 1 L 13 1 z M 1 4 L 1 6 L 3 6 L 3 4 L 1 4 z M 4 4 L 4 6 L 6 6 L 6 4 L 4 4 z M 7 4 L 7 6 L 9 6 L 9 4 L 7 4 z M 10 4 L 10 6 L 12 6 L 12 4 L 10 4 z M 13 4 L 13 6 L 15 6 L 15 4 L 13 4 z M 1 7 L 1 9 L 3 9 L 3 7 L 1 7 z M 4 7 L 4 9 L 6 9 L 6 7 L 4 7 z M 9 8 L 9 9 L 9 14 L 9 15 L 14 15 C 14.552285 15 15 14.552285 15 14 L 15 9 C 15 8.4477153 14.552285 8 14 8 L 14 12 L 13 11 L 12 12 L 12 8 L 9 8 z M 1 10 L 1 12 L 3 12 L 3 10 L 1 10 z M 4 10 L 4 12 L 6 12 L 6 10 L 4 10 z M 1 13 L 1 15 L 3 15 L 3 13 L 1 13 z M 4 13 L 4 15 L 6 15 L 6 13 L 4 13 z "
+ transform="translate(0,1036.3622)"
+ id="rect4161" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_viewport_texture.svg b/tools/editor/icons/source/icon_viewport_texture.svg
new file mode 100644
index 0000000000..4cf6532059
--- /dev/null
+++ b/tools/editor/icons/source/icon_viewport_texture.svg
@@ -0,0 +1,80 @@
+<?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_sprite.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_viewport_texture.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.627417"
+ inkscape:cx="18.523635"
+ inkscape:cy="6.064799"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-intersection-paths="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="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843"
+ d="M 3 2 C 2.4695977 2.0000801 1.9609485 2.2108464 1.5859375 2.5859375 C 1.2108464 2.9609485 1.0000801 3.4695977 1 4 L 1 12 C 1.0000803 12.530402 1.2108465 13.039051 1.5859375 13.414062 C 1.9609484 13.789154 2.4695976 13.99992 3 14 L 13 14 C 14.104569 14 15 13.104569 15 12 L 15 4 C 15 2.8954305 14.104569 2 13 2 L 3 2 z M 3 3 L 13 3 C 13.552281 3.0000096 13.99999 3.4477192 14 4 L 14 12 C 13.99999 12.552281 13.552281 12.99999 13 13 L 3 13 C 2.4477192 12.99999 2.0000096 12.552281 2 12 L 2 4 C 2.0000096 3.4477192 2.4477192 3.0000096 3 3 z M 9 6 L 9 7 L 8 7 L 8 8 L 6 8 L 6 9 L 5 9 L 5 10 L 4 10 L 4 11 L 6 11 L 8 11 L 10 11 L 12 11 L 12 9 L 11 9 L 11 8 L 11 7 L 10 7 L 10 6 L 9 6 z "
+ transform="translate(0,1036.3622)"
+ id="rect4179" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_world.svg b/tools/editor/icons/source/icon_world.svg
new file mode 100644
index 0000000000..b2be396217
--- /dev/null
+++ b/tools/editor/icons/source/icon_world.svg
@@ -0,0 +1,89 @@
+<?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.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_world.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254834"
+ inkscape:cx="10.207753"
+ inkscape:cy="6.6325397"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ 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)">
+ <circle
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4219"
+ cx="5.9999828"
+ cy="1046.3622"
+ r="4.9999828" />
+ <circle
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4221"
+ cx="12"
+ cy="1039.3622"
+ r="1" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_world_2d.svg b/tools/editor/icons/source/icon_world_2d.svg
new file mode 100644
index 0000000000..cb4427808a
--- /dev/null
+++ b/tools/editor/icons/source/icon_world_2d.svg
@@ -0,0 +1,82 @@
+<?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.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_world_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.627417"
+ inkscape:cx="17.648364"
+ inkscape:cy="4.8796811"
+ 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="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:object-paths="false"
+ inkscape:snap-intersection-paths="false"
+ 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;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 2,1037.3613 a 1.0001,1.0001 0 0 0 -1,1 l 0,10 a 1.0001,1.0001 0 0 0 1,1 c 2.3666667,0 3.9746094,0.4629 5.7246094,0.9629 1.75,0.5 3.6420576,1.0371 6.2753906,1.0371 a 1.0001,1.0001 0 0 0 1,-1 l 0,-10 a 1.0001,1.0001 0 0 0 -1,-1 c -2.366667,0 -3.974609,-0.4609 -5.7246094,-0.9609 -1.75,-0.5 -3.6420573,-1.0391 -6.2753906,-1.0391 z m 1,2.0957 c 1.798426,0.1158 3.2574477,0.448 4.7246094,0.8672 1.4977347,0.4279 3.1940466,0.8188 5.2753906,0.9414 l 0,8.002 c -1.79849,-0.1158 -3.2574125,-0.448 -4.7246094,-0.8672 C 6.7776425,1047.9725 5.0813715,1047.5796 3,1047.457 l 0,-8 z"
+ id="path4157"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/tools/editor/inspector_dock.cpp b/tools/editor/inspector_dock.cpp
index 7b06761e53..253f9bcc01 100644
--- a/tools/editor/inspector_dock.cpp
+++ b/tools/editor/inspector_dock.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/inspector_dock.h b/tools/editor/inspector_dock.h
index 40c153e2d4..be6ed5fa87 100644
--- a/tools/editor/inspector_dock.h
+++ b/tools/editor/inspector_dock.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -38,7 +38,7 @@
#if 0
class InspectorDock : public VBoxContainer
{
- OBJ_TYPE(InspectorDock,VBoxContainer);
+ GDCLASS(InspectorDock,VBoxContainer);
PropertyEditor *property_editor;
diff --git a/tools/editor/io_plugins/SCsub b/tools/editor/io_plugins/SCsub
index 363a2ce4c0..4bf55189cc 100644
--- a/tools/editor/io_plugins/SCsub
+++ b/tools/editor/io_plugins/SCsub
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
Import('env')
Export('env')
-env.add_source_files(env.tool_sources,"*.cpp")
+env.add_source_files(env.tool_sources, "*.cpp")
diff --git a/tools/editor/io_plugins/editor_atlas.cpp b/tools/editor/io_plugins/editor_atlas.cpp
index f69e383fb0..ac776f4ff5 100644
--- a/tools/editor/io_plugins/editor_atlas.cpp
+++ b/tools/editor/io_plugins/editor_atlas.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/io_plugins/editor_atlas.h b/tools/editor/io_plugins/editor_atlas.h
index 0135e76622..e0cf76576e 100644
--- a/tools/editor/io_plugins/editor_atlas.h
+++ b/tools/editor/io_plugins/editor_atlas.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
index 757d2ed5d4..722b02f77b 100644
--- a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp
@@ -11,7 +11,7 @@
class _EditorBitMaskImportOptions : public Object {
- OBJ_TYPE(_EditorBitMaskImportOptions, Object);
+ GDCLASS(_EditorBitMaskImportOptions, Object);
public:
bool _set(const StringName& p_name, const Variant& p_value) {
@@ -42,7 +42,7 @@ public:
class EditorBitMaskImportDialog : public ConfirmationDialog {
- OBJ_TYPE(EditorBitMaskImportDialog, ConfirmationDialog);
+ GDCLASS(EditorBitMaskImportDialog, ConfirmationDialog);
EditorBitMaskImportPlugin *plugin;
@@ -145,7 +145,7 @@ public:
error_dialog->popup_centered(Size2(200, 100)*EDSCALE);
}
- dst = dst.plus_file(bitmasks[i].get_file().basename() + ".pbm");
+ dst = dst.plus_file(bitmasks[i].get_file().get_basename() + ".pbm");
plugin->import(dst, imd);
}
@@ -162,12 +162,12 @@ public:
static void _bind_methods() {
- ObjectTypeDB::bind_method("_choose_files", &EditorBitMaskImportDialog::_choose_files);
- ObjectTypeDB::bind_method("_choose_save_dir", &EditorBitMaskImportDialog::_choose_save_dir);
- ObjectTypeDB::bind_method("_import", &EditorBitMaskImportDialog::_import);
- ObjectTypeDB::bind_method("_browse", &EditorBitMaskImportDialog::_browse);
- ObjectTypeDB::bind_method("_browse_target", &EditorBitMaskImportDialog::_browse_target);
- // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) );
+ ClassDB::bind_method("_choose_files", &EditorBitMaskImportDialog::_choose_files);
+ ClassDB::bind_method("_choose_save_dir", &EditorBitMaskImportDialog::_choose_save_dir);
+ ClassDB::bind_method("_import", &EditorBitMaskImportDialog::_import);
+ ClassDB::bind_method("_browse", &EditorBitMaskImportDialog::_browse);
+ ClassDB::bind_method("_browse_target", &EditorBitMaskImportDialog::_browse_target);
+ //ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) );
}
EditorBitMaskImportDialog(EditorBitMaskImportPlugin *p_plugin) {
@@ -179,7 +179,7 @@ public:
VBoxContainer *vbc = memnew(VBoxContainer);
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
HBoxContainer *hbc = memnew(HBoxContainer);
@@ -225,7 +225,7 @@ public:
save_select = memnew(EditorDirDialog);
add_child(save_select);
- // save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
+ //save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
save_select->connect("dir_selected", this, "_choose_save_dir");
get_ok()->connect("pressed", this, "_import");
@@ -235,7 +235,7 @@ public:
error_dialog = memnew(ConfirmationDialog);
add_child(error_dialog);
error_dialog->get_ok()->set_text(TTR("Accept"));
- // error_dialog->get_cancel()->hide();
+ //error_dialog->get_cancel()->hide();
set_hide_on_ok(false);
}
@@ -294,7 +294,7 @@ void EditorBitMaskImportPlugin::import_from_drop(const Vector<String>& p_drop, c
ImageLoader::get_recognized_extensions(&valid_extensions);
for(int i=0;i<p_drop.size();i++) {
- String extension=p_drop[i].extension().to_lower();
+ String extension=p_drop[i].get_extension().to_lower();
for (List<String>::Element *E=valid_extensions.front();E;E=E->next()) {
diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.h b/tools/editor/io_plugins/editor_bitmask_import_plugin.h
index d9ca33cd97..28dddca50a 100644
--- a/tools/editor/io_plugins/editor_bitmask_import_plugin.h
+++ b/tools/editor/io_plugins/editor_bitmask_import_plugin.h
@@ -9,7 +9,7 @@ class EditorBitMaskImportDialog;
class EditorBitMaskImportPlugin : public EditorImportPlugin {
- OBJ_TYPE(EditorBitMaskImportPlugin, EditorImportPlugin);
+ GDCLASS(EditorBitMaskImportPlugin, EditorImportPlugin);
EditorBitMaskImportDialog *dialog;
public:
@@ -30,7 +30,7 @@ public:
class EditorBitMaskExportPlugin : public EditorExportPlugin {
- OBJ_TYPE(EditorBitMaskExportPlugin, EditorExportPlugin);
+ GDCLASS(EditorBitMaskExportPlugin, EditorExportPlugin);
public:
diff --git a/tools/editor/io_plugins/editor_export_scene.cpp b/tools/editor/io_plugins/editor_export_scene.cpp
index acbbf8c737..ea67128f3c 100644
--- a/tools/editor/io_plugins/editor_export_scene.cpp
+++ b/tools/editor/io_plugins/editor_export_scene.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -42,7 +42,7 @@ Vector<uint8_t> EditorSceneExportPlugin::custom_export(String& p_path,const Ref<
}
- String extension = p_path.extension();
+ String extension = p_path.get_extension();
//step 1 check if scene
@@ -61,7 +61,7 @@ Vector<uint8_t> EditorSceneExportPlugin::custom_export(String& p_path,const Ref<
uint64_t sd=0;
String smd5;
- String gp = Globals::get_singleton()->globalize_path(p_path);
+ String gp = GlobalConfig::get_singleton()->globalize_path(p_path);
String md5=gp.md5_text();
String tmp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/");
diff --git a/tools/editor/io_plugins/editor_export_scene.h b/tools/editor/io_plugins/editor_export_scene.h
index 2c7fe9a1ab..13493220cb 100644
--- a/tools/editor/io_plugins/editor_export_scene.h
+++ b/tools/editor/io_plugins/editor_export_scene.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,7 +33,7 @@
class EditorSceneExportPlugin : public EditorExportPlugin {
- OBJ_TYPE( EditorSceneExportPlugin, EditorExportPlugin );
+ GDCLASS( EditorSceneExportPlugin, EditorExportPlugin );
public:
virtual Vector<uint8_t> custom_export(String& p_path,const Ref<EditorExportPlatform> &p_platform);
diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp
index df3741f0d4..099535b1ef 100644
--- a/tools/editor/io_plugins/editor_font_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -44,7 +44,7 @@
class _EditorFontImportOptions : public Object {
- OBJ_TYPE(_EditorFontImportOptions,Object);
+ GDCLASS(_EditorFontImportOptions,Object);
public:
enum FontMode {
@@ -384,7 +384,7 @@ public:
class EditorFontImportDialog : public ConfirmationDialog {
- OBJ_TYPE(EditorFontImportDialog, ConfirmationDialog);
+ GDCLASS(EditorFontImportDialog, ConfirmationDialog);
EditorLineEditFileChooser *source;
@@ -418,7 +418,7 @@ class EditorFontImportDialog : public ConfirmationDialog {
//print_line("pre src path "+source->get_line_edit()->get_text());
//print_line("src path "+src_path);
imd->add_source(src_path);
- imd->set_option("font/size",font_size->get_val());
+ imd->set_option("font/size",font_size->get_value());
return imd;
@@ -439,7 +439,7 @@ class EditorFontImportDialog : public ConfirmationDialog {
test_label->set_text("");
test_label->set_text(test_string->get_text());
- test_label->add_color_override("font_color",test_color->get_color());
+ test_label->add_color_override("font_color",test_color->get_pick_color());
}
void _update() {
@@ -468,7 +468,7 @@ class EditorFontImportDialog : public ConfirmationDialog {
Ref<ImageTexture> tex = font->get_texture(0);
if (tex.is_null())
return;
- FileAccessRef f=FileAccess::open(p_font.basename()+".inc",FileAccess::WRITE);
+ FileAccessRef f=FileAccess::open(p_font.get_basename()+".inc",FileAccess::WRITE);
Vector<CharType> ck = font->get_char_keys();
f->store_line("static const int _builtin_font_height="+itos(font->get_height())+";");
@@ -499,7 +499,7 @@ class EditorFontImportDialog : public ConfirmationDialog {
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())+";");
- String fname = p_font.basename()+".sv.png";
+ String fname = p_font.get_basename()+".sv.png";
ResourceSaver::save(fname,tex);
Vector<uint8_t> data=FileAccess::get_file_as_array(fname);
@@ -533,14 +533,14 @@ class EditorFontImportDialog : public ConfirmationDialog {
}
if (dest->get_line_edit()->get_text().get_file()==".fnt") {
- 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" );
+ dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().get_basename() + ".fnt" );
}
- if (dest->get_line_edit()->get_text().extension() == dest->get_line_edit()->get_text()) {
+ if (dest->get_line_edit()->get_text().get_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") {
+ if (dest->get_line_edit()->get_text().get_extension().to_lower() != "fnt") {
error_dialog->set_text(TTR("Invalid file extension.\nPlease use .fnt."));
error_dialog->popup_centered(Size2(200,100));
return;
@@ -572,14 +572,14 @@ class EditorFontImportDialog : public ConfirmationDialog {
static void _bind_methods() {
- ObjectTypeDB::bind_method("_update",&EditorFontImportDialog::_update);
- ObjectTypeDB::bind_method("_update_text",&EditorFontImportDialog::_update_text);
- ObjectTypeDB::bind_method("_update_text2",&EditorFontImportDialog::_update_text2);
- ObjectTypeDB::bind_method("_update_text3",&EditorFontImportDialog::_update_text3);
- ObjectTypeDB::bind_method("_prop_changed",&EditorFontImportDialog::_prop_changed);
- ObjectTypeDB::bind_method("_src_changed",&EditorFontImportDialog::_src_changed);
- ObjectTypeDB::bind_method("_font_size_changed",&EditorFontImportDialog::_font_size_changed);
- ObjectTypeDB::bind_method("_import",&EditorFontImportDialog::_import);
+ ClassDB::bind_method("_update",&EditorFontImportDialog::_update);
+ ClassDB::bind_method("_update_text",&EditorFontImportDialog::_update_text);
+ ClassDB::bind_method("_update_text2",&EditorFontImportDialog::_update_text2);
+ ClassDB::bind_method("_update_text3",&EditorFontImportDialog::_update_text3);
+ ClassDB::bind_method("_prop_changed",&EditorFontImportDialog::_prop_changed);
+ ClassDB::bind_method("_src_changed",&EditorFontImportDialog::_src_changed);
+ ClassDB::bind_method("_font_size_changed",&EditorFontImportDialog::_font_size_changed);
+ ClassDB::bind_method("_import",&EditorFontImportDialog::_import);
}
@@ -619,7 +619,7 @@ public:
}
source->get_line_edit()->set_text(src);
- font_size->set_val(rimd->get_option("font/size"));
+ font_size->set_value(rimd->get_option("font/size"));
}
}
@@ -634,7 +634,7 @@ public:
plugin=p_plugin;
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
HBoxContainer *hbc = memnew( HBoxContainer);
vbc->add_child(hbc);
VBoxContainer *vbl = memnew( VBoxContainer );
@@ -658,17 +658,19 @@ public:
vbl->add_margin_child(TTR("Source Font Size:"),font_size);
font_size->set_min(3);
font_size->set_max(256);
- font_size->set_val(16);
+ font_size->set_value(16);
font_size->connect("value_changed",this,"_font_size_changed");
dest = memnew( EditorLineEditFileChooser );
//
List<String> fl;
Ref<BitmapFont> font= memnew(BitmapFont);
dest->get_file_dialog()->add_filter("*.fnt ; Font" );
- //ResourceSaver::get_recognized_extensions(font,&fl);
- //for(List<String>::Element *E=fl.front();E;E=E->next()) {
- // dest->get_file_dialog()->add_filter("*."+E->get());
- //}
+ /*
+ ResourceSaver::get_recognized_extensions(font,&fl);
+ for(List<String>::Element *E=fl.front();E;E=E->next()) {
+ dest->get_file_dialog()->add_filter("*."+E->get());
+ }
+ */
vbl->add_margin_child(TTR("Dest Resource:"),dest);
HBoxContainer *testhb = memnew( HBoxContainer );
@@ -679,7 +681,7 @@ public:
testhb->add_child(test_string);
test_color = memnew( ColorPickerButton );
- test_color->set_color(get_color("font_color","Label"));
+ test_color->set_pick_color(get_color("font_color","Label"));
test_color->set_h_size_flags(SIZE_EXPAND_FILL);
test_color->set_stretch_ratio(1);
test_color->connect("color_changed",this,"_update_text3");
@@ -689,7 +691,7 @@ public:
vbl->add_margin_child(TTR("Test:")+" ",testhb);
/*
HBoxContainer *upd_hb = memnew( HBoxContainer );
-// vbl->add_child(upd_hb);
+ //vbl->add_child(upd_hb);
upd_hb->add_spacer();
Button *update = memnew( Button);
upd_hb->add_child(update);
@@ -754,7 +756,7 @@ struct _EditorFontData {
int texture;
Image blit;
Point2i blit_ofs;
-// bool printable;
+ //bool printable;
};
@@ -780,13 +782,13 @@ static unsigned char get_SDF_radial(
int x, int y,
int max_radius )
{
- // hideous brute force method
+ //hideous brute force method
float d2 = max_radius*max_radius+1.0;
unsigned char v = fontmap[x+y*w];
for( int radius = 1; (radius <= max_radius) && (radius*radius < d2); ++radius )
{
int line, lo, hi;
- // north
+ //north
line = y - radius;
if( (line >= 0) && (line < h) )
{
@@ -797,7 +799,7 @@ static unsigned char get_SDF_radial(
int idx = line * w + lo;
for( int i = lo; i <= hi; ++i )
{
- // check this pixel
+ //check this pixel
if( fontmap[idx] != v )
{
float nx = i - x;
@@ -808,11 +810,11 @@ static unsigned char get_SDF_radial(
d2 = nd2;
}
}
- // move on
+ //move on
++idx;
}
}
- // south
+ //south
line = y + radius;
if( (line >= 0) && (line < h) )
{
@@ -823,7 +825,7 @@ static unsigned char get_SDF_radial(
int idx = line * w + lo;
for( int i = lo; i <= hi; ++i )
{
- // check this pixel
+ //check this pixel
if( fontmap[idx] != v )
{
float nx = i - x;
@@ -834,11 +836,11 @@ static unsigned char get_SDF_radial(
d2 = nd2;
}
}
- // move on
+ //move on
++idx;
}
}
- // west
+ //west
line = x - radius;
if( (line >= 0) && (line < w) )
{
@@ -849,7 +851,7 @@ static unsigned char get_SDF_radial(
int idx = lo * w + line;
for( int i = lo; i <= hi; ++i )
{
- // check this pixel
+ //check this pixel
if( fontmap[idx] != v )
{
float nx = line - x;
@@ -860,11 +862,11 @@ static unsigned char get_SDF_radial(
d2 = nd2;
}
}
- // move on
+ //move on
idx += w;
}
}
- // east
+ //east
line = x + radius;
if( (line >= 0) && (line < w) )
{
@@ -875,7 +877,7 @@ static unsigned char get_SDF_radial(
int idx = lo * w + line;
for( int i = lo; i <= hi; ++i )
{
- // check this pixel
+ //check this pixel
if( fontmap[idx] != v )
{
float nx = line - x;
@@ -886,7 +888,7 @@ static unsigned char get_SDF_radial(
d2 = nd2;
}
}
- // move on
+ //move on
idx += w;
}
}
@@ -913,7 +915,7 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
String src_path = EditorImportPlugin::expand_source_path(from->get_source_path(0));
- if (src_path.extension().to_lower()=="fnt") {
+ if (src_path.get_extension().to_lower()=="fnt") {
if (ResourceLoader::load(src_path).is_valid()) {
EditorNode::get_singleton()->show_warning(TTR("Path:")+" "+src_path+"\n"+TTR("This file is already a Godot font file, please supply a BMFont type file instead."));
@@ -981,14 +983,14 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
FT_GlyphSlot slot = face->glyph;
-// error = FT_Set_Charmap(face,ft_encoding_unicode ); /* encoding.. */
+ //error = FT_Set_Charmap(face,ft_encoding_unicode ); /* encoding.. */
/* PRINT CHARACTERS TO INDIVIDUAL BITMAPS */
-// int space_size=5; //size for space, if none found.. 5!
-// int min_valign=500; //some ridiculous number
+ //int space_size=5; //size for space, if none found.. 5!
+ //int min_valign=500; //some ridiculous number
FT_ULong charcode;
FT_UInt gindex;
@@ -1080,10 +1082,10 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
if (font_mode==_EditorFontImportOptions::FONT_DISTANCE_FIELD) {
- // oversize the holding buffer so I can smooth it!
+ //oversize the holding buffer so I can smooth it!
int sw = w + scaler * 4;
int sh = h + scaler * 4;
- // do the SDF
+ //do the SDF
int sdfw = sw / scaler;
int sdfh = sh / scaler;
@@ -1139,7 +1141,7 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
if (font_mode==_EditorFontImportOptions::FONT_DISTANCE_FIELD) {
- // oversize the holding buffer so I can smooth it!
+ //oversize the holding buffer so I can smooth it!
int sw = w + scaler * 4;
int sh = h + scaler * 4;
@@ -1330,7 +1332,7 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
if (err==OK) {
for(int i=0;i<height;i++){
- color[i]=img.get_pixel(0,i*img.get_height()/height);
+ //color[i]=img.get_pixel(0,i*img.get_height()/height);
}
} else {
@@ -1380,10 +1382,10 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
int ow=font_data_list[i]->width;
int oh=font_data_list[i]->height;
- DVector<uint8_t> pixels;
+ PoolVector<uint8_t> pixels;
pixels.resize(s.x*s.y*4);
- DVector<uint8_t>::Write w = pixels.write();
+ PoolVector<uint8_t>::Write w = pixels.write();
//print_line("val: "+itos(font_data_list[i]->valign));
for(int y=0;y<s.height;y++) {
@@ -1512,9 +1514,9 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
}
- w=DVector<uint8_t>::Write();
+ w=PoolVector<uint8_t>::Write();
- Image img(s.width,s.height,0,Image::FORMAT_RGBA,pixels);
+ Image img(s.width,s.height,0,Image::FORMAT_RGBA8,pixels);
font_data_list[i]->blit=img;
font_data_list[i]->blit_ofs=o;
@@ -1537,7 +1539,7 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
res_size.y=nearest_power_of_2(res_size.y);
print_line("Atlas size: "+res_size);
- Image atlas(res_size.x,res_size.y,0,Image::FORMAT_RGBA);
+ Image atlas(res_size.x,res_size.y,0,Image::FORMAT_RGBA8);
for(int i=0;i<font_data_list.size();i++) {
@@ -1552,10 +1554,10 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
if (from->has_option("advanced/premultiply_alpha") && bool(from->get_option("advanced/premultiply_alpha"))) {
- DVector<uint8_t> data = atlas.get_data();
+ PoolVector<uint8_t> data = atlas.get_data();
int dl = data.size();
{
- DVector<uint8_t>::Write w = data.write();
+ PoolVector<uint8_t>::Write w = data.write();
for(int i=0;i<dl;i+=4) {
@@ -1565,12 +1567,12 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
}
}
- atlas=Image(res_size.x,res_size.y,0,Image::FORMAT_RGBA,data);
+ atlas=Image(res_size.x,res_size.y,0,Image::FORMAT_RGBA8,data);
}
if (from->has_option("color/monochrome") && bool(from->get_option("color/monochrome"))) {
- atlas.convert(Image::FORMAT_GRAYSCALE_ALPHA);
+ atlas.convert(Image::FORMAT_LA8);
}
@@ -1578,8 +1580,8 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe
//debug the texture
Ref<ImageTexture> atlast = memnew( ImageTexture );
atlast->create_from_image(atlas);
-// atlast->create_from_image(font_data_list[5]->blit);
- TextureFrame *tf = memnew( TextureFrame );
+ //atlast->create_from_image(font_data_list[5]->blit);
+ TextureRect *tf = memnew( TextureRect );
tf->set_texture(atlast);
dialog->add_child(tf);
}
@@ -1682,12 +1684,12 @@ Error EditorFontImportPlugin::import(const String& p_path, const Ref<ResourceImp
void EditorFontImportPlugin::import_from_drop(const Vector<String>& p_drop, const String &p_dest_path) {
for(int i=0;i<p_drop.size();i++) {
- String ext = p_drop[i].extension().to_lower();
+ String ext = p_drop[i].get_extension().to_lower();
String file = p_drop[i].get_file();
if (ext=="ttf" || ext=="otf" || ext=="fnt") {
import_dialog();
- dialog->set_source_and_dest(p_drop[i],p_dest_path.plus_file(file.basename()+".fnt"));
+ dialog->set_source_and_dest(p_drop[i],p_dest_path.plus_file(file.get_basename()+".fnt"));
break;
}
}
diff --git a/tools/editor/io_plugins/editor_font_import_plugin.h b/tools/editor/io_plugins/editor_font_import_plugin.h
index 25914e6f83..73c699c090 100644
--- a/tools/editor/io_plugins/editor_font_import_plugin.h
+++ b/tools/editor/io_plugins/editor_font_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,7 +37,7 @@ class EditorFontImportDialog;
class EditorFontImportPlugin : public EditorImportPlugin {
- OBJ_TYPE(EditorFontImportPlugin,EditorImportPlugin);
+ GDCLASS(EditorFontImportPlugin,EditorImportPlugin);
EditorFontImportDialog *dialog;
public:
diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp
index 1130e2be30..1cbb594a51 100644
--- a/tools/editor/io_plugins/editor_import_collada.cpp
+++ b/tools/editor/io_plugins/editor_import_collada.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -85,11 +85,11 @@ struct ColladaImport {
Error _create_scene(Collada::Node *p_node, Spatial *p_parent);
Error _create_resources(Collada::Node *p_node);
Error _create_material(const String& p_material);
- Error _create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,const Map<String,Collada::NodeGeometry::Material>& p_material_map,const Collada::MeshData &meshdata,const Transform& p_local_xform,const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_data, const Collada::MorphControllerData *p_morph_data,Vector<Ref<Mesh> > p_morph_meshes=Vector<Ref<Mesh> >());
+ Error _create_mesh_surfaces(bool p_optimize, Ref<Mesh>& p_mesh, const Map<String,Collada::NodeGeometry::Material>& p_material_map, const Collada::MeshData &meshdata, const Transform& p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_data, const Collada::MorphControllerData *p_morph_data, Vector<Ref<Mesh> > p_morph_meshes=Vector<Ref<Mesh> >(), bool p_for_morph=false);
Error load(const String& p_path, int p_flags, bool p_force_make_tangents=false);
void _fix_param_animation_tracks();
- void create_animation(int p_clip,bool p_make_tracks_in_all_bones);
- void create_animations(bool p_make_tracks_in_all_bones);
+ void create_animation(int p_clip,bool p_make_tracks_in_all_bones, bool p_import_value_tracks);
+ void create_animations(bool p_make_tracks_in_all_bones, bool p_import_value_tracks);
Set<String> tracks_in_clips;
Vector<String> missing_textures;
@@ -236,20 +236,22 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) {
return OK;
//well, it's an ambient light..
Light *l = memnew( DirectionalLight );
-// l->set_color(Light::COLOR_AMBIENT,ld.color);
- l->set_color(Light::COLOR_DIFFUSE,Color(0,0,0));
- l->set_color(Light::COLOR_SPECULAR,Color(0,0,0));
+ //l->set_color(Light::COLOR_AMBIENT,ld.color);
+ //l->set_color(Light::COLOR_DIFFUSE,Color(0,0,0));
+ //l->set_color(Light::COLOR_SPECULAR,Color(0,0,0));
node = l;
} else if (ld.mode==Collada::LightData::MODE_DIRECTIONAL) {
//well, it's an ambient light..
Light *l = memnew( DirectionalLight );
- //if (found_ambient) //use it here
- // l->set_color(Light::COLOR_AMBIENT,ambient);
+ /*
+ if (found_ambient) //use it here
+ l->set_color(Light::COLOR_AMBIENT,ambient);
l->set_color(Light::COLOR_DIFFUSE,ld.color);
l->set_color(Light::COLOR_SPECULAR,Color(1,1,1));
+ */
node = l;
} else {
@@ -259,14 +261,14 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) {
l=memnew( OmniLight );
else {
l=memnew( SpotLight );
- l->set_parameter(Light::PARAM_SPOT_ANGLE,ld.spot_angle);
- l->set_parameter(Light::PARAM_SPOT_ATTENUATION,ld.spot_exp);
+ //l->set_parameter(Light::PARAM_SPOT_ANGLE,ld.spot_angle);
+ //l->set_parameter(Light::PARAM_SPOT_ATTENUATION,ld.spot_exp);
}
//
- l->set_color(Light::COLOR_DIFFUSE,ld.color);
- l->set_color(Light::COLOR_SPECULAR,Color(1,1,1));
- l->approximate_opengl_attenuation(ld.constant_att,ld.linear_att,ld.quad_att);
+ //l->set_color(Light::COLOR_DIFFUSE,ld.color);
+ //l->set_color(Light::COLOR_SPECULAR,Color(1,1,1));
+ //l->approximate_opengl_attenuation(ld.constant_att,ld.linear_att,ld.quad_att);
node=l;
}
@@ -377,7 +379,7 @@ Error ColladaImport::_create_material(const String& p_target) {
ERR_FAIL_COND_V(!collada.state.effect_map.has(src_mat.instance_effect),ERR_INVALID_PARAMETER);
Collada::Effect &effect=collada.state.effect_map[src_mat.instance_effect];
- Ref<FixedMaterial> material= memnew( FixedMaterial );
+ Ref<FixedSpatialMaterial> material= memnew( FixedSpatialMaterial );
if (src_mat.name!="")
material->set_name(src_mat.name);
@@ -394,14 +396,15 @@ Error ColladaImport::_create_material(const String& p_target) {
Ref<Texture> texture = ResourceLoader::load(texfile,"Texture");
if (texture.is_valid()) {
- material->set_texture(FixedMaterial::PARAM_DIFFUSE,texture);
- material->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,1));
+ material->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,texture);
+ material->set_albedo(Color(1,1,1,1));
+ //material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1,1));
} else {
missing_textures.push_back(texfile.get_file());
}
}
} else {
- material->set_parameter(FixedMaterial::PARAM_DIFFUSE,effect.diffuse.color);
+ //material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,effect.diffuse.color);
}
// SPECULAR
@@ -413,16 +416,18 @@ Error ColladaImport::_create_material(const String& p_target) {
Ref<Texture> texture = ResourceLoader::load(texfile,"Texture");
if (texture.is_valid()) {
+ material->set_texture(FixedSpatialMaterial::TEXTURE_SPECULAR,texture);
+ material->set_specular(Color(1,1,1,1));
- material->set_texture(FixedMaterial::PARAM_SPECULAR,texture);
- material->set_parameter(FixedMaterial::PARAM_SPECULAR,Color(1,1,1,1));
+ //material->set_texture(FixedSpatialMaterial::PARAM_SPECULAR,texture);
+ //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,Color(1,1,1,1));
} else {
missing_textures.push_back(texfile.get_file());
}
}
} else {
- material->set_parameter(FixedMaterial::PARAM_SPECULAR,effect.specular.color);
+ //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,effect.specular.color);
}
// EMISSION
@@ -435,15 +440,17 @@ Error ColladaImport::_create_material(const String& p_target) {
Ref<Texture> texture = ResourceLoader::load(texfile,"Texture");
if (texture.is_valid()) {
- material->set_texture(FixedMaterial::PARAM_EMISSION,texture);
- material->set_parameter(FixedMaterial::PARAM_EMISSION,Color(1,1,1,1));
+ material->set_texture(FixedSpatialMaterial::TEXTURE_EMISSION,texture);
+ material->set_emission(Color(1,1,1,1));
+
+ //material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,Color(1,1,1,1));
}else {
- missing_textures.push_back(texfile.get_file());
+ //missing_textures.push_back(texfile.get_file());
}
}
} else {
- material->set_parameter(FixedMaterial::PARAM_EMISSION,effect.emission.color);
+ //material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,effect.emission.color);
}
// NORMAL
@@ -455,19 +462,23 @@ Error ColladaImport::_create_material(const String& p_target) {
Ref<Texture> texture = ResourceLoader::load(texfile,"Texture");
if (texture.is_valid()) {
+ material->set_texture(FixedSpatialMaterial::TEXTURE_NORMAL,texture);
+ //material->set_emission(Color(1,1,1,1));
- material->set_texture(FixedMaterial::PARAM_NORMAL,texture);
+ //material->set_texture(FixedSpatialMaterial::PARAM_NORMAL,texture);
}else {
- missing_textures.push_back(texfile.get_file());
+ //missing_textures.push_back(texfile.get_file());
}
}
}
- material->set_parameter(FixedMaterial::PARAM_SPECULAR_EXP,effect.shininess);
- material->set_flag(Material::FLAG_DOUBLE_SIDED,effect.double_sided);
- material->set_flag(Material::FLAG_UNSHADED,effect.unshaded);
+ //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,effect.shininess);
+ if (effect.double_sided) {
+ material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ }
+ material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,effect.unshaded);
@@ -476,15 +487,15 @@ Error ColladaImport::_create_material(const String& p_target) {
}
-static void _generate_normals(const DVector<int>& p_indices,const DVector<Vector3>& p_vertices,DVector<Vector3>&r_normals) {
+static void _generate_normals(const PoolVector<int>& p_indices,const PoolVector<Vector3>& p_vertices,PoolVector<Vector3>&r_normals) {
r_normals.resize(p_vertices.size());
- DVector<Vector3>::Write narrayw = r_normals.write();
+ PoolVector<Vector3>::Write narrayw = r_normals.write();
int iacount=p_indices.size()/3;
- DVector<int>::Read index_arrayr = p_indices.read();
- DVector<Vector3>::Read vertex_arrayr = p_vertices.read();
+ PoolVector<int>::Read index_arrayr = p_indices.read();
+ PoolVector<Vector3>::Read vertex_arrayr = p_vertices.read();
for(int idx=0;idx<iacount;idx++) {
@@ -510,7 +521,7 @@ static void _generate_normals(const DVector<int>& p_indices,const DVector<Vector
}
-static void _generate_tangents_and_binormals(const DVector<int>& p_indices,const DVector<Vector3>& p_vertices,const DVector<Vector3>& p_uvs,const DVector<Vector3>& p_normals,DVector<real_t>&r_tangents) {
+static void _generate_tangents_and_binormals(const PoolVector<int>& p_indices,const PoolVector<Vector3>& p_vertices,const PoolVector<Vector3>& p_uvs,const PoolVector<Vector3>& p_normals,PoolVector<real_t>&r_tangents) {
int vlen=p_vertices.size();
@@ -522,10 +533,10 @@ static void _generate_tangents_and_binormals(const DVector<int>& p_indices,const
int iacount=p_indices.size()/3;
- DVector<int>::Read index_arrayr = p_indices.read();
- DVector<Vector3>::Read vertex_arrayr = p_vertices.read();
- DVector<Vector3>::Read narrayr = p_normals.read();
- DVector<Vector3>::Read uvarrayr = p_uvs.read();
+ PoolVector<int>::Read index_arrayr = p_indices.read();
+ PoolVector<Vector3>::Read vertex_arrayr = p_vertices.read();
+ PoolVector<Vector3>::Read narrayr = p_normals.read();
+ PoolVector<Vector3>::Read uvarrayr = p_uvs.read();
for(int idx=0;idx<iacount;idx++) {
@@ -579,7 +590,7 @@ static void _generate_tangents_and_binormals(const DVector<int>& p_indices,const
}
r_tangents.resize(vlen*4);
- DVector<real_t>::Write tarrayw = r_tangents.write();
+ PoolVector<real_t>::Write tarrayw = r_tangents.write();
for(int idx=0;idx<vlen;idx++) {
Vector3 tangent = tangents[idx];
@@ -597,7 +608,7 @@ static void _generate_tangents_and_binormals(const DVector<int>& p_indices,const
}
}
-Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,const Map<String,Collada::NodeGeometry::Material>& p_material_map,const Collada::MeshData &meshdata,const Transform& p_local_xform,const Vector<int> &bone_remap, const Collada::SkinControllerData *skin_controller, const Collada::MorphControllerData *p_morph_data,Vector<Ref<Mesh> > p_morph_meshes) {
+Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,const Map<String,Collada::NodeGeometry::Material>& p_material_map,const Collada::MeshData &meshdata,const Transform& p_local_xform,const Vector<int> &bone_remap, const Collada::SkinControllerData *skin_controller, const Collada::MorphControllerData *p_morph_data,Vector<Ref<Mesh> > p_morph_meshes,bool p_for_morph) {
bool local_xform_mirror=p_local_xform.basis.determinant() < 0;
@@ -615,12 +626,12 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
ERR_FAIL_COND_V( !collada.state.mesh_data_map.has(target), ERR_INVALID_DATA );
String name = collada.state.mesh_data_map[target].name;
- p_mesh->add_morph_target(name);
+ p_mesh->add_blend_shape(name);
}
if (p_morph_data->mode=="RELATIVE")
- p_mesh->set_morph_target_mode(Mesh::MORPH_MODE_RELATIVE);
+ p_mesh->set_blend_shape_mode(Mesh::BLEND_SHAPE_MODE_RELATIVE);
else if (p_morph_data->mode=="NORMALIZED")
- p_mesh->set_morph_target_mode(Mesh::MORPH_MODE_NORMALIZED);
+ p_mesh->set_blend_shape_mode(Mesh::BLEND_SHAPE_MODE_NORMALIZED);
}
@@ -1022,9 +1033,9 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
}
- DVector<int> index_array;
+ PoolVector<int> index_array;
index_array.resize(indices_list.size());
- DVector<int>::Write index_arrayw = index_array.write();
+ PoolVector<int>::Write index_arrayw = index_array.write();
int iidx=0;
for(List<int>::Element *F=indices_list.front();F;F=F->next()) {
@@ -1032,7 +1043,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
index_arrayw[iidx++]=F->get();
}
- index_arrayw=DVector<int>::Write();
+ index_arrayw=PoolVector<int>::Write();
/*****************/
@@ -1042,7 +1053,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
{
- Ref<FixedMaterial> material;
+ Ref<FixedSpatialMaterial> material;
//find material
Mesh::PrimitiveType primitive=Mesh::PRIMITIVE_TRIANGLES;
@@ -1066,14 +1077,14 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
- DVector<Vector3> final_vertex_array;
- DVector<Vector3> final_normal_array;
- DVector<float> final_tangent_array;
- DVector<Color> final_color_array;
- DVector<Vector3> final_uv_array;
- DVector<Vector3> final_uv2_array;
- DVector<float> final_bone_array;
- DVector<float> final_weight_array;
+ PoolVector<Vector3> final_vertex_array;
+ PoolVector<Vector3> final_normal_array;
+ PoolVector<float> final_tangent_array;
+ PoolVector<Color> final_color_array;
+ PoolVector<Vector3> final_uv_array;
+ PoolVector<Vector3> final_uv2_array;
+ PoolVector<int> final_bone_array;
+ PoolVector<float> final_weight_array;
uint32_t final_format=0;
@@ -1108,65 +1119,67 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
int vlen = vertex_array.size();
{ //vertices
- DVector<Vector3> varray;
+ PoolVector<Vector3> varray;
varray.resize(vertex_array.size());
- DVector<Vector3>::Write varrayw = varray.write();
+ PoolVector<Vector3>::Write varrayw = varray.write();
for(int k=0;k<vlen;k++)
varrayw[k]=vertex_array[k].vertex;
- varrayw = DVector<Vector3>::Write();
+ varrayw = PoolVector<Vector3>::Write();
final_vertex_array=varray;
}
if (uv_src) { //compute uv first, may be needed for computing tangent/bionrmal
- DVector<Vector3> uvarray;
+ PoolVector<Vector3> uvarray;
uvarray.resize(vertex_array.size());
- DVector<Vector3>::Write uvarrayw = uvarray.write();
+ PoolVector<Vector3>::Write uvarrayw = uvarray.write();
for(int k=0;k<vlen;k++) {
uvarrayw[k]=vertex_array[k].uv;
}
- uvarrayw = DVector<Vector3>::Write();
+ uvarrayw = PoolVector<Vector3>::Write();
final_uv_array=uvarray;
}
if (uv2_src) { //compute uv first, may be needed for computing tangent/bionrmal
- DVector<Vector3> uv2array;
+ PoolVector<Vector3> uv2array;
uv2array.resize(vertex_array.size());
- DVector<Vector3>::Write uv2arrayw = uv2array.write();
+ PoolVector<Vector3>::Write uv2arrayw = uv2array.write();
for(int k=0;k<vlen;k++) {
uv2arrayw[k]=vertex_array[k].uv2;
}
- uv2arrayw = DVector<Vector3>::Write();
+ uv2arrayw = PoolVector<Vector3>::Write();
final_uv2_array=uv2array;
}
if (normal_src) {
- DVector<Vector3> narray;
+ PoolVector<Vector3> narray;
narray.resize(vertex_array.size());
- DVector<Vector3>::Write narrayw = narray.write();
+ PoolVector<Vector3>::Write narrayw = narray.write();
for(int k=0;k<vlen;k++) {
narrayw[k]=vertex_array[k].normal;
}
- narrayw = DVector<Vector3>::Write();
+ narrayw = PoolVector<Vector3>::Write();
final_normal_array=narray;
- //DVector<Vector3> altnaray;
- //_generate_normals(index_array,final_vertex_array,altnaray);
+ /*
+ PoolVector<Vector3> altnaray;
+ _generate_normals(index_array,final_vertex_array,altnaray);
- //for(int i=0;i<altnaray.size();i++)
- // print_line(rtos(altnaray[i].dot(final_normal_array[i])));
+ for(int i=0;i<altnaray.size();i++)
+ print_line(rtos(altnaray[i].dot(final_normal_array[i])));
+ */
} else if (primitive==Mesh::PRIMITIVE_TRIANGLES) {
//generate normals (even if unused later)
@@ -1180,9 +1193,9 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
if (final_normal_array.size() && uv_src && binormal_src && tangent_src && !force_make_tangents) {
- DVector<real_t> tarray;
+ PoolVector<real_t> tarray;
tarray.resize(vertex_array.size()*4);
- DVector<real_t>::Write tarrayw = tarray.write();
+ PoolVector<real_t>::Write tarrayw = tarray.write();
for(int k=0;k<vlen;k++) {
@@ -1193,10 +1206,10 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
}
- tarrayw = DVector<real_t>::Write();
+ tarrayw = PoolVector<real_t>::Write();
final_tangent_array=tarray;
- } else if (final_normal_array.size() && primitive==Mesh::PRIMITIVE_TRIANGLES && final_uv_array.size() && (force_make_tangents || (material.is_valid() && material->get_texture(FixedMaterial::PARAM_NORMAL).is_valid()))){
+ } else if (final_normal_array.size() && primitive==Mesh::PRIMITIVE_TRIANGLES && final_uv_array.size() && (force_make_tangents || (material.is_valid()))){
//if this uses triangles, there are uvs and the material is using a normalmap, generate tangents and binormals, because they WILL be needed
//generate binormals/tangents
_generate_tangents_and_binormals(index_array,final_vertex_array,final_uv_array,final_normal_array,final_tangent_array);
@@ -1208,27 +1221,27 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
if (color_src) {
- DVector<Color> colorarray;
+ PoolVector<Color> colorarray;
colorarray.resize(vertex_array.size());
- DVector<Color>::Write colorarrayw = colorarray.write();
+ PoolVector<Color>::Write colorarrayw = colorarray.write();
for(int k=0;k<vlen;k++) {
colorarrayw[k]=vertex_array[k].color;
}
- colorarrayw = DVector<Color>::Write();
+ colorarrayw = PoolVector<Color>::Write();
final_color_array=colorarray;
}
if (has_weights) {
- DVector<float> weightarray;
- DVector<float> bonearray;
+ PoolVector<float> weightarray;
+ PoolVector<int> bonearray;
weightarray.resize(vertex_array.size()*4);
- DVector<float>::Write weightarrayw = weightarray.write();
+ PoolVector<float>::Write weightarrayw = weightarray.write();
bonearray.resize(vertex_array.size()*4);
- DVector<float>::Write bonearrayw = bonearray.write();
+ PoolVector<int>::Write bonearrayw = bonearray.write();
for(int k=0;k<vlen;k++) {
float sum=0;
@@ -1237,7 +1250,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
if (l<vertex_array[k].weights.size()) {
weightarrayw[k*VS::ARRAY_WEIGHTS_SIZE+l]=vertex_array[k].weights[l].weight;
sum+=weightarrayw[k*VS::ARRAY_WEIGHTS_SIZE+l];
- bonearrayw[k*VS::ARRAY_WEIGHTS_SIZE+l]=vertex_array[k].weights[l].bone_idx;
+ bonearrayw[k*VS::ARRAY_WEIGHTS_SIZE+l]=int(vertex_array[k].weights[l].bone_idx);
//COLLADA_PRINT(itos(k)+": "+rtos(bonearrayw[k*VS::ARRAY_WEIGHTS_SIZE+l])+":"+rtos(weightarray[k*VS::ARRAY_WEIGHTS_SIZE+l]));
} else {
@@ -1248,13 +1261,15 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
}
-// if (sum<0.8)
-// COLLADA_PRINT("ERROR SUMMING INDEX "+itos(k)+" had weights: "+itos(vertex_array[k].weights.size()));
+ /*
+ if (sum<0.8)
+ COLLADA_PRINT("ERROR SUMMING INDEX "+itos(k)+" had weights: "+itos(vertex_array[k].weights.size()));
+ */
}
- weightarrayw = DVector<float>::Write();
- bonearrayw = DVector<float>::Write();
+ weightarrayw = PoolVector<float>::Write();
+ bonearrayw = PoolVector<int>::Write();
final_weight_array = weightarray;
final_bone_array = bonearray;
@@ -1317,7 +1332,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
// morph anything but "POSITIONS" seem to exit. Because of this, normals and binormals/tangents have to be regenerated here,
// which may result in inaccurate (but most of the time good enough) results.
- DVector<Vector3> vertices;
+ PoolVector<Vector3> vertices;
vertices.resize(vlen);
ERR_FAIL_COND_V( md.vertices.size() != 1, ERR_INVALID_DATA);
@@ -1336,7 +1351,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
//read vertices from morph target
- DVector<Vector3>::Write vertw = vertices.write();
+ PoolVector<Vector3>::Write vertw = vertices.write();
for(int m_i=0;m_i<m->array.size()/stride;m_i++) {
@@ -1372,9 +1387,9 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
//vertices are in place, now generate everything else
- vertw = DVector<Vector3>::Write();
- DVector<Vector3> normals;
- DVector<float> tangents;
+ vertw = PoolVector<Vector3>::Write();
+ PoolVector<Vector3> normals;
+ PoolVector<float> tangents;
print_line("vertex source id: "+vertex_src_id);
if(md.vertices[vertex_src_id].sources.has("NORMAL")){
//has normals
@@ -1393,7 +1408,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
//read normals from morph target
- DVector<Vector3>::Write vertw = normals.write();
+ PoolVector<Vector3>::Write vertw = normals.write();
for(int m_i=0;m_i<m->array.size()/stride;m_i++) {
@@ -1459,16 +1474,22 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con
#endif
for(int mi=0;mi<p_morph_meshes.size();mi++) {
- // print_line("want surface "+itos(mi)+" has "+itos(p_morph_meshes[mi]->get_surface_count()));
+ //print_line("want surface "+itos(mi)+" has "+itos(p_morph_meshes[mi]->get_surface_count()));
Array a = p_morph_meshes[mi]->surface_get_arrays(surface);
- a[Mesh::ARRAY_BONES]=Variant();
- a[Mesh::ARRAY_WEIGHTS]=Variant();
+ //add valid weight and bone arrays if they exist, TODO check if they are unique to shape (generally not)
+
+ if (final_weight_array.size())
+ a[Mesh::ARRAY_WEIGHTS]=final_weight_array;
+ if (final_bone_array.size())
+ a[Mesh::ARRAY_BONES]=final_bone_array;
+
a[Mesh::ARRAY_INDEX]=Variant();
//a.resize(Mesh::ARRAY_MAX); //no need for index
mr.push_back(a);
}
- p_mesh->add_surface(Mesh::PRIMITIVE_TRIANGLES,d,mr);
+
+ p_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES,d,mr,p_for_morph?0:Mesh::ARRAY_COMPRESS_DEFAULT);
if (material.is_valid()) {
p_mesh->surface_set_material(surface, material);
@@ -1692,7 +1713,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) {
if (collada.state.mesh_data_map.has(meshid)) {
Ref<Mesh> mesh=Ref<Mesh>(memnew( Mesh ));
const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid];
- Error err = _create_mesh_surfaces(false,mesh,ng->material_map,meshdata,apply_xform,bone_remap,skin,NULL);
+ Error err = _create_mesh_surfaces(false,mesh,ng->material_map,meshdata,apply_xform,bone_remap,skin,NULL,Vector<Ref<Mesh> >(),true);
ERR_FAIL_COND_V(err,err);
morphs.push_back(mesh);
@@ -1898,7 +1919,7 @@ void ColladaImport::_fix_param_animation_tracks() {
}
-void ColladaImport::create_animations(bool p_make_tracks_in_all_bones) {
+void ColladaImport::create_animations(bool p_make_tracks_in_all_bones, bool p_import_value_tracks) {
_fix_param_animation_tracks();
@@ -1943,14 +1964,14 @@ void ColladaImport::create_animations(bool p_make_tracks_in_all_bones) {
}
- create_animation(-1,p_make_tracks_in_all_bones);
+ create_animation(-1,p_make_tracks_in_all_bones, p_import_value_tracks);
//print_line("clipcount: "+itos(collada.state.animation_clips.size()));
for(int i=0;i<collada.state.animation_clips.size();i++)
- create_animation(i,p_make_tracks_in_all_bones);
+ create_animation(i, p_make_tracks_in_all_bones, p_import_value_tracks);
}
-void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones) {
+void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones, bool p_import_value_tracks) {
Ref<Animation> animation = Ref<Animation>( memnew( Animation ));
@@ -2251,64 +2272,68 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
+ if (p_import_value_tracks) {
+ for (int i = 0; i < valid_animated_properties.size(); i++) {
- for(int i=0;i<valid_animated_properties.size();i++) {
+ int ti = valid_animated_properties[i];
- int ti = valid_animated_properties[i];
+ if (p_clip == -1) {
- if (p_clip==-1) {
+ if (track_filter.has(ti))
+ continue;
+ }
+ else {
- if (track_filter.has(ti))
- continue;
- } else {
+ if (!track_filter.has(ti))
+ continue;
- if (!track_filter.has(ti))
- continue;
+ }
- }
+ Collada::AnimationTrack &at = collada.state.animation_tracks[ti];
- Collada::AnimationTrack &at = collada.state.animation_tracks[ ti ];
+ // take snapshots
+ if (!collada.state.scene_map.has(at.target))
+ continue;
- // take snapshots
- if (!collada.state.scene_map.has(at.target))
- continue;
+ NodeMap &nm = node_map[at.target];
+ String path = scene->get_path_to(nm.node);
- NodeMap &nm = node_map[at.target];
- String path = scene->get_path_to(nm.node);
+ animation->add_track(Animation::TYPE_VALUE);
+ int track = animation->get_track_count() - 1;
- animation->add_track(Animation::TYPE_VALUE);
- int track = animation->get_track_count() -1;
+ path = path + ":" + at.param;
+ animation->track_set_path(track, path);
+ animation->track_set_imported(track, true); //helps merging later
- path = path +":"+at.param;
- animation->track_set_path( track , path );
- animation->track_set_imported( track , true ); //helps merging later
+ for (int i = 0; i < at.keys.size(); i++) {
- for(int i=0;i<at.keys.size();i++) {
+ float time = at.keys[i].time;
+ Variant value;
+ Vector<float> data = at.keys[i].data;
+ if (data.size() == 1) {
+ //push a float
+ value = data[0];
- float time = at.keys[i].time;
- Variant value;
- Vector<float> data = at.keys[i].data;
- if (data.size()==1) {
- //push a float
- value=data[0];
+ }
+ else if (data.size() == 16) {
+ //matrix
+ print_line("value keys for matrices not supported");
+ }
+ else {
- } else if (data.size()==16) {
- //matrix
- print_line("value keys for matrices not supported");
- } else {
+ print_line("don't know what to do with this amount of value keys: " + itos(data.size()));
+ }
- print_line("don't know what to do with this amount of value keys: "+itos(data.size()));
+ animation->track_insert_key(track, time, value);
}
- animation->track_insert_key(track,time,value);
- }
-
- tracks_found=true;
+ tracks_found = true;
+ }
}
@@ -2356,9 +2381,11 @@ Node* EditorSceneImporterCollada::import_scene(const String& p_path, uint32_t p_
if (state.missing_textures.size()) {
- //for(int i=0;i<state.missing_textures.size();i++) {
-// EditorNode::add_io_error("Texture Not Found: "+state.missing_textures[i]);
-// }
+ /*
+ for(int i=0;i<state.missing_textures.size();i++) {
+ EditorNode::add_io_error("Texture Not Found: "+state.missing_textures[i]);
+ }
+ */
if (r_missing_deps) {
@@ -2373,7 +2400,7 @@ Node* EditorSceneImporterCollada::import_scene(const String& p_path, uint32_t p_
if (p_flags&IMPORT_ANIMATION) {
- state.create_animations(p_flags&IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS);
+ state.create_animations(p_flags&IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS,p_flags&EditorSceneImporter::IMPORT_ANIMATION_KEEP_VALUE_TRACKS);
AnimationPlayer *ap = memnew( AnimationPlayer );
for(int i=0;i<state.animations.size();i++) {
String name;
@@ -2410,7 +2437,7 @@ Ref<Animation> EditorSceneImporterCollada::import_animation(const String& p_path
ERR_FAIL_COND_V(err!=OK,RES());
- state.create_animations(p_flags&EditorSceneImporter::IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS);
+ state.create_animations(p_flags&EditorSceneImporter::IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS,p_flags&EditorSceneImporter::IMPORT_ANIMATION_KEEP_VALUE_TRACKS);
if (state.scene)
memdelete(state.scene);
@@ -2419,7 +2446,7 @@ Ref<Animation> EditorSceneImporterCollada::import_animation(const String& p_path
Ref<Animation> anim=state.animations[0];
anim=state.animations[0];
print_line("Anim Load OK");
- String base = p_path.basename().to_lower();
+ String base = p_path.get_basename().to_lower();
if (p_flags&IMPORT_ANIMATION_DETECT_LOOP) {
if (base.begins_with("loop") || base.ends_with("loop") || base.begins_with("cycle") || base.ends_with("cycle")) {
diff --git a/tools/editor/io_plugins/editor_import_collada.h b/tools/editor/io_plugins/editor_import_collada.h
index de45dc38f4..f6642778ed 100644
--- a/tools/editor/io_plugins/editor_import_collada.h
+++ b/tools/editor/io_plugins/editor_import_collada.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -35,7 +35,7 @@
class EditorSceneImporterCollada : public EditorSceneImporter {
- OBJ_TYPE(EditorSceneImporterCollada,EditorSceneImporter );
+ GDCLASS(EditorSceneImporterCollada,EditorSceneImporter );
public:
virtual uint32_t get_import_flags() const;
diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp
index da608292c1..fa0c36be98 100644
--- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,7 +40,7 @@
class _EditorMeshImportOptions : public Object {
- OBJ_TYPE(_EditorMeshImportOptions,Object);
+ GDCLASS(_EditorMeshImportOptions,Object);
public:
@@ -148,7 +148,7 @@ public:
class EditorMeshImportDialog : public ConfirmationDialog {
- OBJ_TYPE(EditorMeshImportDialog,ConfirmationDialog);
+ GDCLASS(EditorMeshImportDialog,ConfirmationDialog);
EditorMeshImportPlugin *plugin;
@@ -259,7 +259,7 @@ public:
imd->add_source(EditorImportPlugin::validate_source_path(meshes[i]));
- String file_path = dst.plus_file(meshes[i].get_file().basename()+".msh");
+ String file_path = dst.plus_file(meshes[i].get_file().get_basename()+".msh");
plugin->import(file_path,imd);
}
@@ -278,11 +278,11 @@ public:
static void _bind_methods() {
- ObjectTypeDB::bind_method("_choose_files",&EditorMeshImportDialog::_choose_files);
- ObjectTypeDB::bind_method("_choose_save_dir",&EditorMeshImportDialog::_choose_save_dir);
- ObjectTypeDB::bind_method("_import",&EditorMeshImportDialog::_import);
- ObjectTypeDB::bind_method("_browse",&EditorMeshImportDialog::_browse);
- ObjectTypeDB::bind_method("_browse_target",&EditorMeshImportDialog::_browse_target);
+ ClassDB::bind_method("_choose_files",&EditorMeshImportDialog::_choose_files);
+ ClassDB::bind_method("_choose_save_dir",&EditorMeshImportDialog::_choose_save_dir);
+ ClassDB::bind_method("_import",&EditorMeshImportDialog::_import);
+ ClassDB::bind_method("_browse",&EditorMeshImportDialog::_browse);
+ ClassDB::bind_method("_browse_target",&EditorMeshImportDialog::_browse_target);
}
EditorMeshImportDialog(EditorMeshImportPlugin *p_plugin) {
@@ -294,7 +294,7 @@ public:
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
HBoxContainer *hbc = memnew( HBoxContainer );
vbc->add_margin_child(TTR("Source Mesh(es):"),hbc);
@@ -568,7 +568,7 @@ void EditorMeshImportPlugin::import_from_drop(const Vector<String>& p_drop, cons
Vector<String> files;
for(int i=0;i<p_drop.size();i++) {
- String ext = p_drop[i].extension().to_lower();
+ String ext = p_drop[i].get_extension().to_lower();
String file = p_drop[i].get_file();
if (ext=="obj") {
diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.h b/tools/editor/io_plugins/editor_mesh_import_plugin.h
index d200603e6a..1f15fee3a7 100644
--- a/tools/editor/io_plugins/editor_mesh_import_plugin.h
+++ b/tools/editor/io_plugins/editor_mesh_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -38,7 +38,7 @@ class EditorMeshImportDialog;
class EditorMeshImportPlugin : public EditorImportPlugin {
- OBJ_TYPE(EditorMeshImportPlugin,EditorImportPlugin);
+ GDCLASS(EditorMeshImportPlugin,EditorImportPlugin);
EditorMeshImportDialog *dialog;
diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp
index 7dc74e58dd..eeb61fc443 100644
--- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -39,7 +39,7 @@
class _EditorSampleImportOptions : public Object {
- OBJ_TYPE(_EditorSampleImportOptions,Object);
+ GDCLASS(_EditorSampleImportOptions,Object);
public:
enum CompressMode {
@@ -166,7 +166,7 @@ public:
class EditorSampleImportDialog : public ConfirmationDialog {
- OBJ_TYPE(EditorSampleImportDialog,ConfirmationDialog);
+ GDCLASS(EditorSampleImportDialog,ConfirmationDialog);
EditorSampleImportPlugin *plugin;
@@ -296,7 +296,7 @@ public:
error_dialog->popup_centered(Size2(200,100)*EDSCALE);
}
- dst = dst.plus_file(samples[i].get_file().basename()+".smp");
+ dst = dst.plus_file(samples[i].get_file().get_basename()+".smp");
plugin->import(dst,imd);
}
@@ -318,12 +318,12 @@ public:
static void _bind_methods() {
- ObjectTypeDB::bind_method("_choose_files",&EditorSampleImportDialog::_choose_files);
- ObjectTypeDB::bind_method("_choose_save_dir",&EditorSampleImportDialog::_choose_save_dir);
- ObjectTypeDB::bind_method("_import",&EditorSampleImportDialog::_import);
- ObjectTypeDB::bind_method("_browse",&EditorSampleImportDialog::_browse);
- ObjectTypeDB::bind_method("_browse_target",&EditorSampleImportDialog::_browse_target);
- // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) );
+ ClassDB::bind_method("_choose_files",&EditorSampleImportDialog::_choose_files);
+ ClassDB::bind_method("_choose_save_dir",&EditorSampleImportDialog::_choose_save_dir);
+ ClassDB::bind_method("_import",&EditorSampleImportDialog::_import);
+ ClassDB::bind_method("_browse",&EditorSampleImportDialog::_browse);
+ ClassDB::bind_method("_browse_target",&EditorSampleImportDialog::_browse_target);
+ //ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) );
}
EditorSampleImportDialog(EditorSampleImportPlugin *p_plugin) {
@@ -335,7 +335,7 @@ public:
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
HBoxContainer *hbc = memnew( HBoxContainer );
@@ -373,7 +373,7 @@ public:
save_select = memnew( EditorDirDialog );
add_child(save_select);
- // save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
+ //save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
save_select->connect("dir_selected", this,"_choose_save_dir");
get_ok()->connect("pressed", this,"_import");
@@ -383,7 +383,7 @@ public:
error_dialog = memnew ( ConfirmationDialog );
add_child(error_dialog);
error_dialog->get_ok()->set_text(TTR("Accept"));
- // error_dialog->get_cancel()->hide();
+ //error_dialog->get_cancel()->hide();
set_hide_on_ok(false);
options = memnew( _EditorSampleImportOptions );
@@ -443,8 +443,8 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI
data.resize(len*chans);
{
- DVector<uint8_t> src_data = smp->get_data();
- DVector<uint8_t>::Read sr = src_data.read();
+ PoolVector<uint8_t> src_data = smp->get_data();
+ PoolVector<uint8_t>::Read sr = src_data.read();
for(int i=0;i<len*chans;i++) {
@@ -602,7 +602,7 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI
}
- DVector<uint8_t> dst_data;
+ PoolVector<uint8_t> dst_data;
Sample::Format dst_format;
if ( compression == _EditorSampleImportOptions::COMPRESS_MODE_RAM) {
@@ -629,8 +629,8 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI
right[i]=data[i*2+1];
}
- DVector<uint8_t> bleft;
- DVector<uint8_t> bright;
+ PoolVector<uint8_t> bleft;
+ PoolVector<uint8_t> bright;
_compress_ima_adpcm(left,bleft);
_compress_ima_adpcm(right,bright);
@@ -638,9 +638,9 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI
int dl = bleft.size();
dst_data.resize( dl *2 );
- DVector<uint8_t>::Write w=dst_data.write();
- DVector<uint8_t>::Read rl=bleft.read();
- DVector<uint8_t>::Read rr=bright.read();
+ PoolVector<uint8_t>::Write w=dst_data.write();
+ PoolVector<uint8_t>::Read rl=bleft.read();
+ PoolVector<uint8_t>::Read rr=bright.read();
for(int i=0;i<dl;i++) {
w[i*2+0]=rl[i];
@@ -648,14 +648,14 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI
}
}
-// print_line("compressing ima-adpcm, resulting buffersize is "+itos(dst_data.size())+" from "+itos(data.size()));
+ //print_line("compressing ima-adpcm, resulting buffersize is "+itos(dst_data.size())+" from "+itos(data.size()));
} else {
dst_format=is16?Sample::FORMAT_PCM16:Sample::FORMAT_PCM8;
dst_data.resize( data.size() * (is16?2:1));
{
- DVector<uint8_t>::Write w = dst_data.write();
+ PoolVector<uint8_t>::Write w = dst_data.write();
int ds=data.size();
for(int i=0;i<ds;i++) {
@@ -700,7 +700,7 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI
}
-void EditorSampleImportPlugin::_compress_ima_adpcm(const Vector<float>& p_data,DVector<uint8_t>& dst_data) {
+void EditorSampleImportPlugin::_compress_ima_adpcm(const Vector<float>& p_data,PoolVector<uint8_t>& dst_data) {
/*p_sample_data->data = (void*)malloc(len);
@@ -730,7 +730,7 @@ void EditorSampleImportPlugin::_compress_ima_adpcm(const Vector<float>& p_data,D
datalen++;
dst_data.resize(datalen/2+4);
- DVector<uint8_t>::Write w = dst_data.write();
+ PoolVector<uint8_t>::Write w = dst_data.write();
int i,step_idx=0,prev=0;
@@ -758,12 +758,14 @@ void EditorSampleImportPlugin::_compress_ima_adpcm(const Vector<float>& p_data,D
xm_sample=CLAMP(in[i]*32767.0,-32768,32767);
- //if (xm_sample==32767 || xm_sample==-32768)
- // printf("clippy!\n",xm_sample);
+ /*
+ if (xm_sample==32767 || xm_sample==-32768)
+ printf("clippy!\n",xm_sample);
+ */
}
- // xm_sample=xm_sample+xm_prev;
- // xm_prev=xm_sample;
+ //xm_sample=xm_sample+xm_prev;
+ //xm_prev=xm_sample;
diff = (int)xm_sample - prev ;
@@ -828,7 +830,7 @@ void EditorSampleImportPlugin::import_from_drop(const Vector<String>& p_drop, co
Vector<String> files;
for(int i=0;i<p_drop.size();i++) {
- String ext = p_drop[i].extension().to_lower();
+ String ext = p_drop[i].get_extension().to_lower();
if (ext=="wav") {
@@ -887,7 +889,7 @@ Vector<uint8_t> EditorSampleExportPlugin::custom_export(String& p_path,const Ref
- if (EditorImportExport::get_singleton()->sample_get_action()==EditorImportExport::SAMPLE_ACTION_NONE || p_path.extension().to_lower()!="wav") {
+ if (EditorImportExport::get_singleton()->sample_get_action()==EditorImportExport::SAMPLE_ACTION_NONE || p_path.get_extension().to_lower()!="wav") {
return Vector<uint8_t>();
}
@@ -911,7 +913,7 @@ Vector<uint8_t> EditorSampleExportPlugin::custom_export(String& p_path,const Ref
ERR_FAIL_COND_V(err!=OK,Vector<uint8_t>());
- p_path=p_path.basename()+".converted.smp";
+ p_path=p_path.get_basename()+".converted.smp";
return FileAccess::get_file_as_array(savepath);
}
diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.h b/tools/editor/io_plugins/editor_sample_import_plugin.h
index a2686ebe4f..6d781756b2 100644
--- a/tools/editor/io_plugins/editor_sample_import_plugin.h
+++ b/tools/editor/io_plugins/editor_sample_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,10 +37,10 @@ class EditorSampleImportDialog;
class EditorSampleImportPlugin : public EditorImportPlugin {
- OBJ_TYPE(EditorSampleImportPlugin,EditorImportPlugin);
+ GDCLASS(EditorSampleImportPlugin,EditorImportPlugin);
EditorSampleImportDialog *dialog;
- void _compress_ima_adpcm(const Vector<float>& p_data,DVector<uint8_t>& dst_data);
+ void _compress_ima_adpcm(const Vector<float>& p_data,PoolVector<uint8_t>& dst_data);
public:
static EditorSampleImportPlugin *singleton;
@@ -59,7 +59,7 @@ public:
class EditorSampleExportPlugin : public EditorExportPlugin {
- OBJ_TYPE( EditorSampleExportPlugin, EditorExportPlugin);
+ GDCLASS( EditorSampleExportPlugin, EditorExportPlugin);
public:
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
index 190b56faba..79c88e7407 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -82,7 +82,7 @@ EditorScenePostImport::EditorScenePostImport() {
class EditorImportAnimationOptions : public VBoxContainer {
- OBJ_TYPE( EditorImportAnimationOptions, VBoxContainer );
+ GDCLASS( EditorImportAnimationOptions, VBoxContainer );
@@ -147,7 +147,7 @@ public:
class EditorSceneImportDialog : public ConfirmationDialog {
- OBJ_TYPE(EditorSceneImportDialog,ConfirmationDialog);
+ GDCLASS(EditorSceneImportDialog,ConfirmationDialog);
struct FlagInfo {
@@ -175,6 +175,7 @@ class EditorSceneImportDialog : public ConfirmationDialog {
EditorDirDialog *save_select;
OptionButton *texture_action;
CreateDialog *root_type_choose;
+ LineEdit *root_node_name;
ConfirmationDialog *confirm_open;
@@ -373,10 +374,10 @@ void EditorImportAnimationOptions::_item_edited() {
void EditorImportAnimationOptions::_bind_methods() {
- ObjectTypeDB::bind_method("_changed",&EditorImportAnimationOptions::_changed);
- ObjectTypeDB::bind_method("_item_edited",&EditorImportAnimationOptions::_item_edited);
- ObjectTypeDB::bind_method("_button_action",&EditorImportAnimationOptions::_button_action);
-// ObjectTypeDB::bind_method("_changedp",&EditorImportAnimationOptions::_changedp);
+ ClassDB::bind_method("_changed",&EditorImportAnimationOptions::_changed);
+ ClassDB::bind_method("_item_edited",&EditorImportAnimationOptions::_item_edited);
+ ClassDB::bind_method("_button_action",&EditorImportAnimationOptions::_button_action);
+ //ClassDB::bind_method("_changedp",&EditorImportAnimationOptions::_changedp);
ADD_SIGNAL(MethodInfo("changed"));
}
@@ -389,7 +390,7 @@ void EditorImportAnimationOptions::_notification(int p_what) {
flags->connect("item_edited",this,"_changed");
clips_tree->connect("item_edited",this,"_item_edited");
clips_tree->connect("button_pressed",this,"_button_action",varray(),CONNECT_DEFERRED);
-// format->connect("item_selected",this,"_changedp");
+ //format->connect("item_selected",this,"_changedp");
}
}
@@ -639,6 +640,7 @@ void EditorSceneImportDialog::_choose_file(const String& p_path) {
} else {
#endif
save_path->set_text("");
+ root_node_name->set_text("");
//save_path->set_text(p_path.get_file().basename()+".scn");
#if 0
}
@@ -656,6 +658,9 @@ void EditorSceneImportDialog::_choose_file(const String& p_path) {
import_path->set_text(p_path);
+ if (root_node_name->get_text().size()==0){
+ root_node_name->set_text(import_path->get_text().get_file().get_basename());
+ }
}
void EditorSceneImportDialog::_choose_save_file(const String& p_path) {
@@ -665,9 +670,9 @@ void EditorSceneImportDialog::_choose_save_file(const String& p_path) {
void EditorSceneImportDialog::_choose_script(const String& p_path) {
- String p = Globals::get_singleton()->localize_path(p_path);
+ String p = GlobalConfig::get_singleton()->localize_path(p_path);
if (!p.is_resource_file())
- p=Globals::get_singleton()->get_resource_path().path_to(p_path.get_base_dir())+p_path.get_file();
+ p=GlobalConfig::get_singleton()->get_resource_path().path_to(p_path.get_base_dir())+p_path.get_file();
script_path->set_text(p);
}
@@ -720,7 +725,7 @@ void EditorSceneImportDialog::_import(bool p_and_open) {
if (texture_action->get_selected()==0)
dst_path=save_path->get_text();//.get_base_dir();
else
- dst_path=Globals::get_singleton()->get("import/shared_textures");
+ dst_path=GlobalConfig::get_singleton()->get("import/shared_textures");
uint32_t flags=0;
@@ -758,7 +763,7 @@ void EditorSceneImportDialog::_import(bool p_and_open) {
// Scenes should always be imported as binary format since vertex data is large and would take
// up a lot of space and time to load if imported as text format (GH-5778)
- String save_file = save_path->get_text().plus_file(import_path->get_text().get_file().basename()+".scn");
+ String save_file = save_path->get_text().plus_file(import_path->get_text().get_file().get_basename()+".scn");
print_line("Saving to: "+save_file);
@@ -788,6 +793,10 @@ void EditorSceneImportDialog::_import(bool p_and_open) {
if (!root_default->is_pressed()) {
rim->set_option("root_type",root_type->get_text());
}
+ if (root_node_name->get_text().size()==0) {
+ root_node_name->set_text(import_path->get_text().get_file().get_basename());
+ }
+ rim->set_option("root_name",root_node_name->get_text());
List<String> missing;
Error err = plugin->import1(rim,&scene,&missing);
@@ -885,9 +894,9 @@ void EditorSceneImportDialog::_browse() {
void EditorSceneImportDialog::_browse_target() {
+ save_select->popup_centered_ratio();
if (save_path->get_text()!="")
save_select->set_current_path(save_path->get_text());
- save_select->popup_centered_ratio();
}
@@ -946,7 +955,11 @@ void EditorSceneImportDialog::popup_import(const String &p_from) {
root_default->set_pressed(true);
root_type->set_disabled(true);
}
-
+ if (rimd->has_option("root_name")) {
+ root_node_name->set_text(rimd->get_option("root_name"));
+ } else {
+ root_node_name->set_text(root_type->get_text()); // backward compatibility for 2.1 or before
+ }
script_path->set_text(rimd->get_option("post_import_script"));
save_path->set_text(p_from.get_base_dir());
@@ -1045,19 +1058,19 @@ void EditorSceneImportDialog::_set_root_type() {
void EditorSceneImportDialog::_bind_methods() {
- ObjectTypeDB::bind_method("_choose_file",&EditorSceneImportDialog::_choose_file);
- ObjectTypeDB::bind_method("_choose_save_file",&EditorSceneImportDialog::_choose_save_file);
- ObjectTypeDB::bind_method("_choose_script",&EditorSceneImportDialog::_choose_script);
- ObjectTypeDB::bind_method("_import",&EditorSceneImportDialog::_import,DEFVAL(false));
- ObjectTypeDB::bind_method("_browse",&EditorSceneImportDialog::_browse);
- ObjectTypeDB::bind_method("_browse_target",&EditorSceneImportDialog::_browse_target);
- ObjectTypeDB::bind_method("_browse_script",&EditorSceneImportDialog::_browse_script);
- ObjectTypeDB::bind_method("_dialog_hid",&EditorSceneImportDialog::_dialog_hid);
- ObjectTypeDB::bind_method("_import_confirm",&EditorSceneImportDialog::_import_confirm);
- ObjectTypeDB::bind_method("_open_and_import",&EditorSceneImportDialog::_open_and_import);
- ObjectTypeDB::bind_method("_root_default_pressed",&EditorSceneImportDialog::_root_default_pressed);
- ObjectTypeDB::bind_method("_root_type_pressed",&EditorSceneImportDialog::_root_type_pressed);
- ObjectTypeDB::bind_method("_set_root_type",&EditorSceneImportDialog::_set_root_type);
+ ClassDB::bind_method("_choose_file",&EditorSceneImportDialog::_choose_file);
+ ClassDB::bind_method("_choose_save_file",&EditorSceneImportDialog::_choose_save_file);
+ ClassDB::bind_method("_choose_script",&EditorSceneImportDialog::_choose_script);
+ ClassDB::bind_method("_import",&EditorSceneImportDialog::_import,DEFVAL(false));
+ ClassDB::bind_method("_browse",&EditorSceneImportDialog::_browse);
+ ClassDB::bind_method("_browse_target",&EditorSceneImportDialog::_browse_target);
+ ClassDB::bind_method("_browse_script",&EditorSceneImportDialog::_browse_script);
+ ClassDB::bind_method("_dialog_hid",&EditorSceneImportDialog::_dialog_hid);
+ ClassDB::bind_method("_import_confirm",&EditorSceneImportDialog::_import_confirm);
+ ClassDB::bind_method("_open_and_import",&EditorSceneImportDialog::_open_and_import);
+ ClassDB::bind_method("_root_default_pressed",&EditorSceneImportDialog::_root_default_pressed);
+ ClassDB::bind_method("_root_type_pressed",&EditorSceneImportDialog::_root_type_pressed);
+ ClassDB::bind_method("_set_root_type",&EditorSceneImportDialog::_set_root_type);
ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) );
@@ -1102,7 +1115,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce
set_title(TTR("Import 3D Scene"));
HBoxContainer *import_hb = memnew( HBoxContainer );
add_child(import_hb);
- set_child_rect(import_hb);
+ //set_child_rect(import_hb);
VBoxContainer *vbc = memnew( VBoxContainer );
import_hb->add_child(vbc);
@@ -1224,7 +1237,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce
error_dialog = memnew ( ConfirmationDialog );
add_child(error_dialog);
error_dialog->get_ok()->set_text(TTR("Accept"));
-// error_dialog->get_cancel()->hide();
+ //error_dialog->get_cancel()->hide();
HBoxContainer *custom_root_hb = memnew( HBoxContainer );
@@ -1241,7 +1254,9 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce
root_default->connect("pressed",this,"_root_default_pressed");
custom_root_hb->add_child(root_default);
-
+ root_node_name = memnew( LineEdit );
+ root_node_name->set_h_size_flags(SIZE_EXPAND_FILL);
+ vbc->add_margin_child(TTR("Root Node Name:"),root_node_name);
/*
this_import = memnew( OptionButton );
this_import->add_item("Overwrite Existing Scene");
@@ -1260,7 +1275,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce
set_hide_on_ok(false);
GLOBAL_DEF("import/shared_textures","res://");
- Globals::get_singleton()->set_custom_property_info("import/shared_textures",PropertyInfo(Variant::STRING,"import/shared_textures",PROPERTY_HINT_DIR));
+ GlobalConfig::get_singleton()->set_custom_property_info("import/shared_textures",PropertyInfo(Variant::STRING,"import/shared_textures",PROPERTY_HINT_DIR));
import_hb->add_constant_override("separation",30);
@@ -1287,7 +1302,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce
add_child(confirm_import);
VBoxContainer *cvb = memnew( VBoxContainer );
confirm_import->add_child(cvb);
- confirm_import->set_child_rect(cvb);
+ //confirm_import->set_child_rect(cvb);
PanelContainer *pc = memnew( PanelContainer );
pc->add_style_override("panel",get_stylebox("normal","TextEdit"));
@@ -1379,7 +1394,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag
Ref<Resource> res = p_var;
if (res.is_valid()) {
- if (res->is_type("Texture") && !image_map.has(res)) {
+ if (res->is_class("Texture") && !image_map.has(res)) {
image_map.insert(res,TEXTURE_ROLE_DEFAULT);
@@ -1392,7 +1407,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag
for(List<PropertyInfo>::Element *E=pl.front();E;E=E->next()) {
if (E->get().type==Variant::OBJECT || E->get().type==Variant::ARRAY || E->get().type==Variant::DICTIONARY) {
- if (E->get().type==Variant::OBJECT && res->cast_to<FixedMaterial>() && (E->get().name=="textures/diffuse" || E->get().name=="textures/detail" || E->get().name=="textures/emission")) {
+ if (E->get().type==Variant::OBJECT && res->cast_to<FixedSpatialMaterial>() && (E->get().name=="textures/diffuse" || E->get().name=="textures/detail" || E->get().name=="textures/emission")) {
Ref<ImageTexture> tex =res->get(E->get().name);
if (tex.is_valid()) {
@@ -1400,14 +1415,16 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag
image_map.insert(tex,TEXTURE_ROLE_DIFFUSE);
}
- } else if (E->get().type==Variant::OBJECT && res->cast_to<FixedMaterial>() && (E->get().name=="textures/normal")) {
+ } else if (E->get().type==Variant::OBJECT && res->cast_to<FixedSpatialMaterial>() && (E->get().name=="textures/normal")) {
Ref<ImageTexture> tex =res->get(E->get().name);
if (tex.is_valid()) {
image_map.insert(tex,TEXTURE_ROLE_NORMALMAP);
+ /*
if (p_flags&SCENE_FLAG_CONVERT_NORMALMAPS_TO_XY)
- res->cast_to<FixedMaterial>()->set_fixed_flag(FixedMaterial::FLAG_USE_XY_NORMALMAP,true);
+ res->cast_to<FixedSpatialMaterial>()->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_XY_NORMALMAP,true);
+ */
}
@@ -1514,12 +1531,12 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
Ref<Mesh> m = mi->get_mesh();
for(int i=0;i<m->get_surface_count();i++) {
- Ref<FixedMaterial> fm = m->surface_get_material(i);
+ Ref<FixedSpatialMaterial> fm = m->surface_get_material(i);
if (fm.is_valid()) {
- fm->set_flag(Material::FLAG_UNSHADED,true);
- fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
- fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- fm->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true);
+ //fm->set_flag(Material::FLAG_UNSHADED,true);
+ //fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
+ //fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
+ //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
}
}
}
@@ -1537,23 +1554,23 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
for(int i=0;i<m->get_surface_count();i++) {
- Ref<FixedMaterial> mat = m->surface_get_material(i);
+ Ref<FixedSpatialMaterial> mat = m->surface_get_material(i);
if (!mat.is_valid())
continue;
if (p_flags&SCENE_FLAG_DETECT_ALPHA && _teststr(mat->get_name(),"alpha")) {
- mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true);
- mat->set_name(_fixstr(mat->get_name(),"alpha"));
+ //mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
+ //mat->set_name(_fixstr(mat->get_name(),"alpha"));
}
if (p_flags&SCENE_FLAG_DETECT_VCOLOR && _teststr(mat->get_name(),"vcol")) {
- mat->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY,true);
- mat->set_name(_fixstr(mat->get_name(),"vcol"));
+ //mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true);
+ //mat->set_name(_fixstr(mat->get_name(),"vcol"));
}
if (p_flags&SCENE_FLAG_SET_LIGHTMAP_TO_UV2_IF_EXISTS && m->surface_get_format(i)&Mesh::ARRAY_FORMAT_TEX_UV2) {
- mat->set_flag(Material::FLAG_LIGHTMAP_ON_UV2,true);
+ //mat->set_flag(Material::FLAG_LIGHTMAP_ON_UV2,true);
}
}
@@ -1612,23 +1629,23 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
float dist = d.to_double();
mi->set_flag(GeometryInstance::FLAG_BILLBOARD,true);
mi->set_flag(GeometryInstance::FLAG_BILLBOARD_FIX_Y,true);
- mi->set_draw_range_begin(dist);
- mi->set_draw_range_end(100000);
+ //mi->set_draw_range_begin(dist);
+ //mi->set_draw_range_end(100000);
- mip->set_draw_range_begin(0);
- mip->set_draw_range_end(dist);
+ //mip->set_draw_range_begin(0);
+ //mip->set_draw_range_end(dist);
if (mi->get_mesh().is_valid()) {
Ref<Mesh> m = mi->get_mesh();
for(int i=0;i<m->get_surface_count();i++) {
- Ref<FixedMaterial> fm = m->surface_get_material(i);
+ Ref<FixedSpatialMaterial> fm = m->surface_get_material(i);
if (fm.is_valid()) {
- fm->set_flag(Material::FLAG_UNSHADED,true);
- fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
- fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- fm->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true);
+ //fm->set_flag(Material::FLAG_UNSHADED,true);
+ //fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
+ //fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
+ //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
}
}
}
@@ -1660,23 +1677,23 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
d=d.substr(1,d.length());
if (d.length() && d[0]>='0' && d[0]<='9') {
float dist = d.to_double();
- mi->set_draw_range_begin(dist);
- mi->set_draw_range_end(100000);
+ /// mi->set_draw_range_begin(dist);
+ // mi->set_draw_range_end(100000);
- mip->set_draw_range_begin(0);
- mip->set_draw_range_end(dist);
+ // mip->set_draw_range_begin(0);
+ // mip->set_draw_range_end(dist);
/*if (mi->get_mesh().is_valid()) {
Ref<Mesh> m = mi->get_mesh();
for(int i=0;i<m->get_surface_count();i++) {
- Ref<FixedMaterial> fm = m->surface_get_material(i);
+ Ref<FixedSpatialMaterial> fm = m->surface_get_material(i);
if (fm.is_valid()) {
fm->set_flag(Material::FLAG_UNSHADED,true);
fm->set_flag(Material::FLAG_DOUBLE_SIDED,true);
fm->set_hint(Material::HINT_NO_DEPTH_DRAW,true);
- fm->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true);
+ fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
}
}
}*/
@@ -1692,7 +1709,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
String str=name;
int layer = str.substr(str.find("lm")+3,str.length()).to_int();
- mi->set_baked_light_texture_id(layer);
+ //mi->set_baked_light_texture_id(layer);
}
if (p_flags&SCENE_FLAG_CREATE_COLLISIONS && _teststr(name,"colonly")) {
@@ -1758,7 +1775,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
// get mesh instance and bounding box
MeshInstance *mi = p_node->cast_to<MeshInstance>();
- AABB aabb = mi->get_aabb();
+ Rect3 aabb = mi->get_aabb();
// create a new rigid body collision node
RigidBody * rigid_body = memnew( RigidBody );
@@ -1773,7 +1790,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
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()));
+ mesh->cast_to<Spatial>()->set_transform(Transform(Basis()));
// reparent the new mesh node to the rigid body collision node
p_node->add_child(mesh);
mesh->set_owner(p_node->get_owner());
@@ -1882,14 +1899,14 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
return p_node;
MeshInstance *mi = p_node->cast_to<MeshInstance>();
- DVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID);
+ PoolVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID);
BSP_Tree bsptree(faces);
Ref<RoomBounds> area = memnew( RoomBounds );
- area->set_bounds(faces);
- area->set_geometry_hint(faces);
+ //area->set_bounds(faces);
+ //area->set_geometry_hint(faces);
Room * room = memnew( Room );
@@ -1917,7 +1934,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
memdelete(p_node);
p_node=room;
- room->compute_room_from_subtree();
+ //room->compute_room_from_subtree();
} else if (p_flags&SCENE_FLAG_CREATE_PORTALS &&_teststr(name,"portal") && p_node->cast_to<MeshInstance>()) {
@@ -1925,7 +1942,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
return p_node;
MeshInstance *mi = p_node->cast_to<MeshInstance>();
- DVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID);
+ PoolVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID);
ERR_FAIL_COND_V(faces.size()==0,NULL);
//step 1 compute the plane
@@ -2044,18 +2061,18 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
for(int i=0;i<mesh->get_surface_count();i++) {
- Ref<FixedMaterial> fm = mesh->surface_get_material(i);
+ Ref<FixedSpatialMaterial> fm = mesh->surface_get_material(i);
if (fm.is_valid()) {
String name = fm->get_name();
- if (_teststr(name,"alpha")) {
- fm->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true);
+ /* if (_teststr(name,"alpha")) {
+ fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true);
name=_fixstr(name,"alpha");
}
if (_teststr(name,"vcol")) {
- fm->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY,true);
+ fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true);
name=_fixstr(name,"vcol");
- }
+ }*/
fm->set_name(name);
}
}
@@ -2109,7 +2126,7 @@ Error EditorSceneImportPlugin::import1(const Ref<ResourceImportMetadata>& p_from
String src_path=EditorImportPlugin::expand_source_path(from->get_source_path(0));
Ref<EditorSceneImporter> importer;
- String ext=src_path.extension().to_lower();
+ String ext=src_path.get_extension().to_lower();
EditorProgress progress("import",TTR("Import Scene"),104);
@@ -2149,14 +2166,18 @@ Error EditorSceneImportPlugin::import1(const Ref<ResourceImportMetadata>& p_from
uint32_t import_flags=0;
if (animation_flags&EditorSceneAnimationImportPlugin::ANIMATION_DETECT_LOOP)
import_flags|=EditorSceneImporter::IMPORT_ANIMATION_DETECT_LOOP;
+ if (animation_flags&EditorSceneAnimationImportPlugin::ANIMATION_KEEP_VALUE_TRACKS)
+ import_flags |= EditorSceneImporter::IMPORT_ANIMATION_KEEP_VALUE_TRACKS;
if (animation_flags&EditorSceneAnimationImportPlugin::ANIMATION_OPTIMIZE)
import_flags|=EditorSceneImporter::IMPORT_ANIMATION_OPTIMIZE;
if (animation_flags&EditorSceneAnimationImportPlugin::ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS)
import_flags|=EditorSceneImporter::IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS;
if (scene_flags&SCENE_FLAG_IMPORT_ANIMATIONS)
import_flags|=EditorSceneImporter::IMPORT_ANIMATION;
- //if (scene_flags&SCENE_FLAG_FAIL_ON_MISSING_IMAGES)
- // import_flags|=EditorSceneImporter::IMPORT_FAIL_ON_MISSING_DEPENDENCIES;
+ /*
+ if (scene_flags&SCENE_FLAG_FAIL_ON_MISSING_IMAGES)
+ import_flags|=EditorSceneImporter::IMPORT_FAIL_ON_MISSING_DEPENDENCIES;
+ */
if (scene_flags&SCENE_FLAG_GENERATE_TANGENT_ARRAYS)
import_flags|=EditorSceneImporter::IMPORT_GENERATE_TANGENT_ARRAYS;
@@ -2172,7 +2193,7 @@ Error EditorSceneImportPlugin::import1(const Ref<ResourceImportMetadata>& p_from
if (from->has_option("root_type")) {
String type = from->get_option("root_type");
- Object *base = ObjectTypeDB::instance(type);
+ Object *base = ClassDB::instance(type);
Node *base_node = NULL;
if (base)
base_node=base->cast_to<Node>();
@@ -2185,6 +2206,7 @@ Error EditorSceneImportPlugin::import1(const Ref<ResourceImportMetadata>& p_from
}
}
+ scene->set_name(from->get_option("root_name"));
_tag_import_paths(scene,scene);
*r_node=scene;
@@ -2783,7 +2805,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
String path = texture->get_path();
String fname= path.get_file();
- String target_path = Globals::get_singleton()->localize_path(target_res_path.plus_file(fname));
+ String target_path = GlobalConfig::get_singleton()->localize_path(target_res_path.plus_file(fname));
progress.step(TTR("Import Image:")+" "+fname,3+(idx)*100/imagemap.size());
idx++;
@@ -2803,7 +2825,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
{
- target_path=target_path.basename()+".tex";
+ target_path=target_path.get_basename()+".tex";
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
@@ -2918,7 +2940,7 @@ void EditorSceneImportPlugin::import_from_drop(const Vector<String>& p_drop,cons
//bool warn_compatible=false;
for(int i=0;i<p_drop.size();i++) {
- String extension = p_drop[i].extension().to_lower();
+ String extension = p_drop[i].get_extension().to_lower();
for(List<String>::Element *E=extensions.front();E;E=E->next()) {
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.h b/tools/editor/io_plugins/editor_scene_import_plugin.h
index c31d3a33d3..61153e3654 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.h
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -51,7 +51,7 @@ class EditorSceneImportDialog;
class EditorSceneImporter : public Reference {
- OBJ_TYPE(EditorSceneImporter,Reference );
+ GDCLASS(EditorSceneImporter,Reference );
public:
enum ImportFlags {
@@ -60,6 +60,7 @@ public:
IMPORT_ANIMATION_DETECT_LOOP=4,
IMPORT_ANIMATION_OPTIMIZE=8,
IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS=16,
+ IMPORT_ANIMATION_KEEP_VALUE_TRACKS=32,
IMPORT_GENERATE_TANGENT_ARRAYS=256,
IMPORT_FAIL_ON_MISSING_DEPENDENCIES=512
@@ -82,7 +83,7 @@ public:
class EditorScenePostImport : public Reference {
- OBJ_TYPE(EditorScenePostImport,Reference );
+ GDCLASS(EditorScenePostImport,Reference );
protected:
static void _bind_methods();
@@ -95,7 +96,7 @@ public:
class EditorSceneImportPlugin : public EditorImportPlugin {
- OBJ_TYPE(EditorSceneImportPlugin,EditorImportPlugin);
+ GDCLASS(EditorSceneImportPlugin,EditorImportPlugin);
EditorSceneImportDialog *dialog;
@@ -173,7 +174,7 @@ public:
class EditorSceneAnimationImportPlugin : public EditorImportPlugin {
- OBJ_TYPE(EditorSceneAnimationImportPlugin,EditorImportPlugin);
+ GDCLASS(EditorSceneAnimationImportPlugin,EditorImportPlugin);
public:
diff --git a/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp b/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp
index ac3c4637c2..e1b0719941 100644
--- a/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp
+++ b/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,7 +33,7 @@
#include "scene/3d/mesh_instance.h"
#include "scene/animation/animation_player.h"
-
+#if 0
String EditorSceneImporterFBXConv::_id(const String& p_id) const {
return p_id.replace(":","_").replace("/","_");
@@ -336,7 +336,7 @@ void EditorSceneImporterFBXConv::_add_surface(State& state,Ref<Mesh>& m,const Di
int idx = m->get_surface_count();
Array array = state.surface_cache[id].array;
- DVector<float> indices = array[Mesh::ARRAY_BONES];
+ PoolVector<float> indices = array[Mesh::ARRAY_BONES];
if (indices.size() && part.has("bones")) {
@@ -361,7 +361,7 @@ void EditorSceneImporterFBXConv::_add_surface(State& state,Ref<Mesh>& m,const Di
int ilen=indices.size();
{
- DVector<float>::Write iw=indices.write();
+ PoolVector<float>::Write iw=indices.write();
for(int j=0;j<ilen;j++) {
int b = iw[j];
ERR_CONTINUE(!index_map.has(b));
@@ -482,29 +482,29 @@ void EditorSceneImporterFBXConv::_parse_materials(State& state) {
ERR_CONTINUE(!material.has("id"));
String id = _id(material["id"]);
- Ref<FixedMaterial> mat = memnew( FixedMaterial );
+ Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial );
if (material.has("diffuse")) {
- mat->set_parameter(FixedMaterial::PARAM_DIFFUSE,_get_color(material["diffuse"]));
+ mat->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,_get_color(material["diffuse"]));
}
if (material.has("specular")) {
- mat->set_parameter(FixedMaterial::PARAM_SPECULAR,_get_color(material["specular"]));
+ mat->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,_get_color(material["specular"]));
}
if (material.has("emissive")) {
- mat->set_parameter(FixedMaterial::PARAM_EMISSION,_get_color(material["emissive"]));
+ mat->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,_get_color(material["emissive"]));
}
if (material.has("shininess")) {
float exp = material["shininess"];
- mat->set_parameter(FixedMaterial::PARAM_SPECULAR_EXP,exp);
+ mat->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,exp);
}
if (material.has("opacity")) {
- Color c = mat->get_parameter(FixedMaterial::PARAM_DIFFUSE);
+ Color c = mat->get_parameter(FixedSpatialMaterial::PARAM_DIFFUSE);
c.a=material["opacity"];
- mat->set_parameter(FixedMaterial::PARAM_DIFFUSE,c);
+ mat->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,c);
}
@@ -536,15 +536,15 @@ void EditorSceneImporterFBXConv::_parse_materials(State& state) {
String type=texture["type"];
if (type=="DIFFUSE")
- mat->set_texture(FixedMaterial::PARAM_DIFFUSE,tex);
+ mat->set_texture(FixedSpatialMaterial::PARAM_DIFFUSE,tex);
else if (type=="SPECULAR")
- mat->set_texture(FixedMaterial::PARAM_SPECULAR,tex);
+ mat->set_texture(FixedSpatialMaterial::PARAM_SPECULAR,tex);
else if (type=="SHININESS")
- mat->set_texture(FixedMaterial::PARAM_SPECULAR_EXP,tex);
+ mat->set_texture(FixedSpatialMaterial::PARAM_SPECULAR_EXP,tex);
else if (type=="NORMAL")
- mat->set_texture(FixedMaterial::PARAM_NORMAL,tex);
+ mat->set_texture(FixedSpatialMaterial::PARAM_NORMAL,tex);
else if (type=="EMISSIVE")
- mat->set_texture(FixedMaterial::PARAM_EMISSION,tex);
+ mat->set_texture(FixedSpatialMaterial::PARAM_EMISSION,tex);
}
}
@@ -680,11 +680,11 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) {
case Mesh::ARRAY_VERTEX:
case Mesh::ARRAY_NORMAL: {
- DVector<Vector3> vtx;
+ PoolVector<Vector3> vtx;
vtx.resize(array.size());
{
int len=array.size();
- DVector<Vector3>::Write w = vtx.write();
+ PoolVector<Vector3>::Write w = vtx.write();
for(int l=0;l<len;l++) {
int pos = array[l];
@@ -701,12 +701,12 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) {
if (binormal_ofs<0)
break;
- DVector<float> tangents;
+ PoolVector<float> tangents;
tangents.resize(array.size()*4);
{
int len=array.size();
- DVector<float>::Write w = tangents.write();
+ PoolVector<float>::Write w = tangents.write();
for(int l=0;l<len;l++) {
int pos = array[l];
@@ -736,11 +736,11 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) {
} break;
case Mesh::ARRAY_COLOR: {
- DVector<Color> cols;
+ PoolVector<Color> cols;
cols.resize(array.size());
{
int len=array.size();
- DVector<Color>::Write w = cols.write();
+ PoolVector<Color>::Write w = cols.write();
for(int l=0;l<len;l++) {
int pos = array[l];
@@ -756,11 +756,11 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) {
case Mesh::ARRAY_TEX_UV:
case Mesh::ARRAY_TEX_UV2: {
- DVector<Vector2> uvs;
+ PoolVector<Vector2> uvs;
uvs.resize(array.size());
{
int len=array.size();
- DVector<Vector2>::Write w = uvs.write();
+ PoolVector<Vector2>::Write w = uvs.write();
for(int l=0;l<len;l++) {
int pos = array[l];
@@ -775,14 +775,14 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) {
case Mesh::ARRAY_BONES:
case Mesh::ARRAY_WEIGHTS: {
- DVector<float> arr;
+ PoolVector<float> arr;
arr.resize(array.size()*4);
int po=k==Mesh::ARRAY_WEIGHTS?1:0;
lofs=ofs[Mesh::ARRAY_BONES];
{
int len=array.size();
- DVector<float>::Write w = arr.write();
+ PoolVector<float>::Write w = arr.write();
for(int l=0;l<len;l++) {
int pos = array[l];
@@ -801,12 +801,12 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) {
} break;
case Mesh::ARRAY_INDEX: {
- DVector<int> arr;
+ PoolVector<int> arr;
arr.resize(indices.size());
{
int len=indices.size();
- DVector<int>::Write w = arr.write();
+ PoolVector<int>::Write w = arr.write();
for(int l=0;l<len;l++) {
w[l]=iarray[ indices[l] ];
@@ -838,10 +838,10 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) {
}
if (pt==Mesh::PRIMITIVE_TRIANGLES) {
- DVector<int> ia=arrays[Mesh::ARRAY_INDEX];
+ PoolVector<int> ia=arrays[Mesh::ARRAY_INDEX];
int len=ia.size();
{
- DVector<int>::Write w=ia.write();
+ PoolVector<int>::Write w=ia.write();
for(int l=0;l<len;l+=3) {
SWAP(w[l+1],w[l+2]);
}
@@ -1132,3 +1132,4 @@ EditorSceneImporterFBXConv::EditorSceneImporterFBXConv() {
#endif
}
+#endif
diff --git a/tools/editor/io_plugins/editor_scene_importer_fbxconv.h b/tools/editor/io_plugins/editor_scene_importer_fbxconv.h
index b0cbc07ba3..1bf96ba0e5 100644
--- a/tools/editor/io_plugins/editor_scene_importer_fbxconv.h
+++ b/tools/editor/io_plugins/editor_scene_importer_fbxconv.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -32,10 +32,11 @@
#include "tools/editor/io_plugins/editor_scene_import_plugin.h"
#include "scene/3d/skeleton.h"
+#if 0
class EditorSceneImporterFBXConv : public EditorSceneImporter {
- OBJ_TYPE(EditorSceneImporterFBXConv,EditorSceneImporter );
+ GDCLASS(EditorSceneImporterFBXConv,EditorSceneImporter );
struct BoneInfo {
@@ -107,3 +108,4 @@ public:
};
#endif // EDITOR_SCENE_IMPORTER_FBXCONV_H
+#endif
diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
index 60642999f2..5ba7d0c417 100644
--- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -38,6 +38,7 @@
#include "scene/gui/check_button.h"
#include "scene/gui/button_group.h"
#include "scene/gui/margin_container.h"
+#include "scene/io/resource_format_image.h"
static const char *flag_names[]={
("Streaming Format"),
@@ -105,12 +106,12 @@ void EditorImportTextureOptions::set_flags(uint32_t p_flags){
void EditorImportTextureOptions::set_quality(float p_quality) {
- quality->set_val(p_quality);
+ quality->set_value(p_quality);
}
float EditorImportTextureOptions::get_quality() const {
- return quality->get_val();
+ return quality->get_value();
}
@@ -147,8 +148,8 @@ void EditorImportTextureOptions::_changed() {
void EditorImportTextureOptions::_bind_methods() {
- ObjectTypeDB::bind_method("_changed",&EditorImportTextureOptions::_changed);
- ObjectTypeDB::bind_method("_changedp",&EditorImportTextureOptions::_changedp);
+ ClassDB::bind_method("_changed",&EditorImportTextureOptions::_changed);
+ ClassDB::bind_method("_changedp",&EditorImportTextureOptions::_changedp);
ADD_SIGNAL(MethodInfo("changed"));
}
@@ -199,7 +200,7 @@ EditorImportTextureOptions::EditorImportTextureOptions() {
hs->set_min(0);
hs->set_max(1.0);
hs->set_step(0.01);
- hs->set_val(0.7);
+ hs->set_value(0.7);
quality=hs;
quality_vb->add_margin_child(TTR("Texture Compression Quality (WebP):"),quality_hb);
@@ -235,7 +236,7 @@ EditorImportTextureOptions::EditorImportTextureOptions() {
class EditorTextureImportDialog : public ConfirmationDialog {
- OBJ_TYPE(EditorTextureImportDialog,ConfirmationDialog);
+ GDCLASS(EditorTextureImportDialog,ConfirmationDialog);
@@ -343,7 +344,7 @@ void EditorTextureImportDialog::_choose_save_dir(const String& p_path) {
void EditorTextureImportDialog::_import() {
-// ImportMonitorBlock imb;
+ //ImportMonitorBlock imb;
Vector<String> files=import_path->get_text().split(",");
@@ -395,7 +396,7 @@ void EditorTextureImportDialog::_import() {
imd->set_option("flags",texture_options->get_flags());
imd->set_option("quality",texture_options->get_quality());
imd->set_option("atlas",true);
- imd->set_option("atlas_size",int(size->get_val()));
+ imd->set_option("atlas_size",int(size->get_value()));
imd->set_option("large",false);
imd->set_option("crop",crop_source->is_pressed());
imd->set_option("mode",mode);
@@ -429,7 +430,7 @@ void EditorTextureImportDialog::_import() {
imd->set_option("quality",texture_options->get_quality());
imd->set_option("atlas",false);
imd->set_option("large",true);
- imd->set_option("large_cell_size",int(size->get_val()));
+ imd->set_option("large_cell_size",int(size->get_value()));
imd->set_option("crop",crop_source->is_pressed());
imd->set_option("mode",mode);
@@ -447,7 +448,7 @@ void EditorTextureImportDialog::_import() {
for(int i=0;i<files.size();i++) {
String dst_file = dst_path.plus_file(files[i].get_file());
- dst_file=dst_file.basename()+".tex";
+ dst_file=dst_file.get_basename()+".tex";
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
//imd->set_editor();
imd->add_source(EditorImportPlugin::validate_source_path(files[i]));
@@ -538,7 +539,7 @@ void EditorTextureImportDialog::_notification(int p_what) {
List<String> extensions;
ImageLoader::get_recognized_extensions(&extensions);
- // ResourceLoader::get_recognized_extensions_for_type("PackedTexture",&extensions);
+ //ResourceLoader::get_recognized_extensions_for_type("PackedTexture",&extensions);
file_select->clear_filters();
for(int i=0;i<extensions.size();i++) {
@@ -568,7 +569,7 @@ void EditorTextureImportDialog::_mode_changed(int p_mode) {
if (p_mode==EditorTextureImportPlugin::MODE_ATLAS) {
size_label->set_text(TTR("Max Texture Size:"));
- size->set_val(2048);
+ size->set_value(2048);
crop_source->show();
size_label->show();
size->show();
@@ -586,7 +587,7 @@ void EditorTextureImportDialog::_mode_changed(int p_mode) {
if (p_mode==EditorTextureImportPlugin::MODE_LARGE) {
size_label->set_text(TTR("Cell Size:"));
- size->set_val(256);
+ size->set_value(256);
size_label->show();
size->show();
@@ -635,14 +636,14 @@ void EditorTextureImportDialog::_mode_changed(int p_mode) {
void EditorTextureImportDialog::_bind_methods() {
- ObjectTypeDB::bind_method("_choose_files",&EditorTextureImportDialog::_choose_files);
- ObjectTypeDB::bind_method("_choose_file",&EditorTextureImportDialog::_choose_file);
- ObjectTypeDB::bind_method("_choose_save_dir",&EditorTextureImportDialog::_choose_save_dir);
- ObjectTypeDB::bind_method("_import",&EditorTextureImportDialog::_import);
- ObjectTypeDB::bind_method("_browse",&EditorTextureImportDialog::_browse);
- ObjectTypeDB::bind_method("_browse_target",&EditorTextureImportDialog::_browse_target);
- ObjectTypeDB::bind_method("_mode_changed",&EditorTextureImportDialog::_mode_changed);
-// ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) );
+ ClassDB::bind_method("_choose_files",&EditorTextureImportDialog::_choose_files);
+ ClassDB::bind_method("_choose_file",&EditorTextureImportDialog::_choose_file);
+ ClassDB::bind_method("_choose_save_dir",&EditorTextureImportDialog::_choose_save_dir);
+ ClassDB::bind_method("_import",&EditorTextureImportDialog::_import);
+ ClassDB::bind_method("_browse",&EditorTextureImportDialog::_browse);
+ ClassDB::bind_method("_browse_target",&EditorTextureImportDialog::_browse_target);
+ ClassDB::bind_method("_mode_changed",&EditorTextureImportDialog::_mode_changed);
+ //ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) );
}
EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin* p_plugin) {
@@ -656,14 +657,14 @@ EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin*
mode_hb = memnew( HBoxContainer );
add_child(mode_hb);
- set_child_rect(mode_hb);
+ //set_child_rect(mode_hb);
VBoxContainer *vbcg = memnew( VBoxContainer);
mode_hb->add_child(vbcg);
mode_hb->add_constant_override("separation",15);
- ButtonGroup *bg = memnew( ButtonGroup );
+ VBoxContainer *bg = memnew( VBoxContainer );
vbcg->add_margin_child("Import Mode",bg);
for(int i=0;i<EditorTextureImportPlugin::MODE_MAX;i++) {
@@ -726,7 +727,7 @@ EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin*
size->set_max(16384);
- size->set_val(256);
+ size->set_value(256);
size_mc=vbc->add_margin_child(TTR("Cell Size:"),size);
size_label=vbc->get_child(size_mc->get_index()-1)->cast_to<Label>();
@@ -759,20 +760,22 @@ EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin*
save_select = memnew( EditorDirDialog );
add_child(save_select);
-// save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
+ //save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
save_select->connect("dir_selected", this,"_choose_save_dir");
get_ok()->connect("pressed", this,"_import");
get_ok()->set_text(TTR("Import"));
//move stuff up
- //for(int i=0;i<4;i++)
- // vbc->move_child( vbc->get_child( vbc->get_child_count() -1), 0);
+ /*
+ for(int i=0;i<4;i++)
+ vbc->move_child( vbc->get_child( vbc->get_child_count() -1), 0);
+ */
error_dialog = memnew ( ConfirmationDialog );
add_child(error_dialog);
error_dialog->get_ok()->set_text(TTR("Accept"));
-// error_dialog->get_cancel()->hide();
+ //error_dialog->get_cancel()->hide();
set_hide_on_ok(false);
@@ -783,8 +786,8 @@ EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin*
_mode_changed(EditorTextureImportPlugin::MODE_TEXTURE_3D);
-// GLOBAL_DEF("import/shared_textures","res://");
-// Globals::get_singleton()->set_custom_property_info("import/shared_textures",PropertyInfo(Variant::STRING,"import/shared_textures",PROPERTY_HINT_DIR));
+ //GLOBAL_DEF("import/shared_textures","res://");
+ //Globals::get_singleton()->set_custom_property_info("import/shared_textures",PropertyInfo(Variant::STRING,"import/shared_textures",PROPERTY_HINT_DIR));
}
@@ -842,33 +845,27 @@ void EditorTextureImportPlugin::compress_image(EditorExportPlatform::ImageCompre
//do absolutely nothing
- } break;
- case EditorExportPlatform::IMAGE_COMPRESSION_INDEXED: {
-
- //quantize
- image.quantize();
-
- } break;
+ } break;
case EditorExportPlatform::IMAGE_COMPRESSION_BC: {
// for maximum compatibility, BC shall always use mipmaps and be PO2
image.resize_to_po2();
- if (image.get_mipmaps()==0)
+ if (!image.has_mipmaps())
image.generate_mipmaps();
- image.compress(Image::COMPRESS_BC);
+ image.compress(Image::COMPRESS_S3TC);
/*
if (has_alpha) {
if (flags&IMAGE_FLAG_ALPHA_BIT) {
- image.convert(Image::FORMAT_BC3);
+ image.convert(Image::FORMAT_DXT5);
} else {
- image.convert(Image::FORMAT_BC2);
+ image.convert(Image::FORMAT_DXT3);
}
} else {
- image.convert(Image::FORMAT_BC1);
+ image.convert(Image::FORMAT_DXT1);
}*/
@@ -879,24 +876,24 @@ void EditorTextureImportPlugin::compress_image(EditorExportPlatform::ImageCompre
// for maximum compatibility (hi apple!), PVRT shall always
// use mipmaps, be PO2 and square
- if (image.get_mipmaps()==0)
+ if (!image.has_mipmaps())
image.generate_mipmaps();
image.resize_to_po2(true);
if (p_smaller) {
image.compress(Image::COMPRESS_PVRTC2);
- //image.convert(has_alpha ? Image::FORMAT_PVRTC2_ALPHA : Image::FORMAT_PVRTC2);
+ //image.convert(has_alpha ? Image::FORMAT_PVRTC2A : Image::FORMAT_PVRTC2);
} else {
image.compress(Image::COMPRESS_PVRTC4);
- //image.convert(has_alpha ? Image::FORMAT_PVRTC4_ALPHA : Image::FORMAT_PVRTC4);
+ //image.convert(has_alpha ? Image::FORMAT_PVRTC4A : Image::FORMAT_PVRTC4);
}
} break;
case EditorExportPlatform::IMAGE_COMPRESSION_ETC1: {
image.resize_to_po2(); //square or not?
- if (image.get_mipmaps()==0)
+ if (!image.has_mipmaps())
image.generate_mipmaps();
if (!image.detect_alpha()) {
//ETC1 is only opaque
@@ -929,18 +926,18 @@ Error EditorTextureImportPlugin::_process_texture_data(Ref<ImageTexture> &textur
ERR_FAIL_COND_V(image.empty(),ERR_INVALID_DATA);
bool has_alpha=image.detect_alpha();
- if (!has_alpha && image.get_format()==Image::FORMAT_RGBA) {
+ if (!has_alpha && image.get_format()==Image::FORMAT_RGBA8) {
- image.convert(Image::FORMAT_RGB);
+ image.convert(Image::FORMAT_RGB8);
}
- if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) {
+ if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) {
image.fix_alpha_edges();
}
- if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_PREMULT_ALPHA) {
+ if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_PREMULT_ALPHA) {
image.premultiply_alpha();
}
@@ -949,10 +946,12 @@ Error EditorTextureImportPlugin::_process_texture_data(Ref<ImageTexture> &textur
image.normalmap_to_xy();
}
- //if ((image.get_format()==Image::FORMAT_RGB || image.get_format()==Image::FORMAT_RGBA) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) {
+ /*
+ if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) {
- // image.srgb_to_linear();
- //}
+ image.srgb_to_linear();
+ }
+ */
if (shrink>1) {
@@ -988,18 +987,18 @@ Error EditorTextureImportPlugin::_process_texture_data(Ref<ImageTexture> &textur
bool has_alpha=image.detect_alpha();
- if (!has_alpha && image.get_format()==Image::FORMAT_RGBA) {
+ if (!has_alpha && image.get_format()==Image::FORMAT_RGBA8) {
- image.convert(Image::FORMAT_RGB);
+ image.convert(Image::FORMAT_RGB8);
}
- if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) {
+ if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) {
image.fix_alpha_edges();
}
- if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_PREMULT_ALPHA) {
+ if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_PREMULT_ALPHA) {
image.premultiply_alpha();
}
@@ -1008,11 +1007,13 @@ Error EditorTextureImportPlugin::_process_texture_data(Ref<ImageTexture> &textur
image.normalmap_to_xy();
}
- //if ((image.get_format()==Image::FORMAT_RGB || image.get_format()==Image::FORMAT_RGBA) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) {
-//
- // print_line("CONVERT BECAUSE: "+itos(flags));
- // image.srgb_to_linear();
- //}
+ /*
+ if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) {
+
+ print_line("CONVERT BECAUSE: "+itos(flags));
+ image.srgb_to_linear();
+ }
+ */
int orig_w=image.get_width();
int orig_h=image.get_height();
@@ -1199,14 +1200,14 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
Image src = tsources[i];
if (alpha) {
- src.convert(Image::FORMAT_RGBA);
+ src.convert(Image::FORMAT_RGBA8);
} else {
- src.convert(Image::FORMAT_RGB);
+ src.convert(Image::FORMAT_RGB8);
}
- DVector<uint8_t> data = src.get_data();
+ PoolVector<uint8_t> data = src.get_data();
MD5_CTX md5;
- DVector<uint8_t>::Read r=data.read();
+ PoolVector<uint8_t>::Read r=data.read();
MD5Init(&md5);
int len=data.size();
for(int j=0;j<len;j++) {
@@ -1279,7 +1280,7 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
atlas_h=nearest_power_of_2(dst_size.height);
}
Image atlas;
- atlas.create(atlas_w,atlas_h,0,alpha?Image::FORMAT_RGBA:Image::FORMAT_RGB);
+ atlas.create(atlas_w,atlas_h,0,alpha?Image::FORMAT_RGBA8:Image::FORMAT_RGB8);
atlases.resize(from->get_source_count());
@@ -1312,9 +1313,9 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
String spath = from->get_source_path(E->get()).get_file();
if (p_external) {
- apath = p_path.get_base_dir().plus_file(spath.basename()+"."+from->get_source_path(E->get()).md5_text()+".atex");
+ apath = p_path.get_base_dir().plus_file(spath.get_basename()+"."+from->get_source_path(E->get()).md5_text()+".atex");
} else {
- apath = p_path.get_base_dir().plus_file(spath.basename()+".atex");
+ apath = p_path.get_base_dir().plus_file(spath.get_basename()+".atex");
}
Ref<AtlasTexture> at;
@@ -1377,7 +1378,7 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
if (p_external) {
//used by exporter
- Array rects(true);
+ Array rects;
for(int i=0;i<atlases.size();i++) {
rects.push_back(atlases[i]->get_region());
rects.push_back(atlases[i]->get_margin());
@@ -1410,18 +1411,18 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
ERR_FAIL_COND_V(image.empty(),ERR_INVALID_DATA);
bool has_alpha=image.detect_alpha();
- if (!has_alpha && image.get_format()==Image::FORMAT_RGBA) {
+ if (!has_alpha && image.get_format()==Image::FORMAT_RGBA8) {
- image.convert(Image::FORMAT_RGB);
+ image.convert(Image::FORMAT_RGB8);
}
- if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) {
+ if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) {
image.fix_alpha_edges();
}
- if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_PREMULT_ALPHA) {
+ if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_PREMULT_ALPHA) {
image.premultiply_alpha();
}
@@ -1430,10 +1431,12 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
image.normalmap_to_xy();
}
- //if ((image.get_format()==Image::FORMAT_RGB || image.get_format()==Image::FORMAT_RGBA) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) {
+ /*
+ if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) {
- // image.srgb_to_linear();
- //}
+ image.srgb_to_linear();
+ }
+ */
if (shrink>1) {
@@ -1469,18 +1472,18 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
bool has_alpha=image.detect_alpha();
- if (!has_alpha && image.get_format()==Image::FORMAT_RGBA) {
+ if (!has_alpha && image.get_format()==Image::FORMAT_RGBA8) {
- image.convert(Image::FORMAT_RGB);
+ image.convert(Image::FORMAT_RGB8);
}
- if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) {
+ if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) {
image.fix_alpha_edges();
}
- if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_PREMULT_ALPHA) {
+ if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_PREMULT_ALPHA) {
image.premultiply_alpha();
}
@@ -1489,11 +1492,13 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
image.normalmap_to_xy();
}
- //if ((image.get_format()==Image::FORMAT_RGB || image.get_format()==Image::FORMAT_RGBA) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) {
-//
- // print_line("CONVERT BECAUSE: "+itos(flags));
- // image.srgb_to_linear();
- //}
+ /*
+ if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) {
+
+ print_line("CONVERT BECAUSE: "+itos(flags));
+ image.srgb_to_linear();
+ }
+ */
int orig_w=image.get_width();
int orig_h=image.get_height();
@@ -1589,16 +1594,9 @@ Vector<uint8_t> EditorTextureImportPlugin::custom_export(const String& p_path, c
} break; //use default
}
+ String validated_path=EditorImportPlugin::validate_source_path(p_path);
- int flags=0;
-
- if (Globals::get_singleton()->get("image_loader/filter"))
- flags|=IMAGE_FLAG_FILTER;
- if (!Globals::get_singleton()->get("image_loader/gen_mipmaps"))
- flags|=IMAGE_FLAG_NO_MIPMAPS;
- if (!Globals::get_singleton()->get("image_loader/repeat"))
- flags|=IMAGE_FLAG_REPEAT;
-
+ int flags=texture_flags_to_export_flags(ResourceFormatLoaderImage::load_image_flags(validated_path));
flags|=IMAGE_FLAG_FIX_BORDER_ALPHA;
print_line("group format"+itos(group_format));
@@ -1607,9 +1605,9 @@ Vector<uint8_t> EditorTextureImportPlugin::custom_export(const String& p_path, c
rimd->set_option("quality",group_lossy_quality);
rimd->set_option("atlas",false);
rimd->set_option("shrink",group_shrink);
- rimd->add_source(EditorImportPlugin::validate_source_path(p_path),FileAccess::get_md5(p_path));
+ rimd->add_source(validated_path,FileAccess::get_md5(p_path));
- } else if (EditorImportExport::get_singleton()->get_image_formats().has(p_path.extension().to_lower()) && EditorImportExport::get_singleton()->get_export_image_action()!=EditorImportExport::IMAGE_ACTION_NONE) {
+ } else if (EditorImportExport::get_singleton()->get_image_formats().has(p_path.get_extension().to_lower()) && EditorImportExport::get_singleton()->get_export_image_action()!=EditorImportExport::IMAGE_ACTION_NONE) {
//handled by general image export settings
rimd = Ref<ResourceImportMetadata>( memnew( ResourceImportMetadata ) );
@@ -1619,22 +1617,16 @@ Vector<uint8_t> EditorTextureImportPlugin::custom_export(const String& p_path, c
case EditorImportExport::IMAGE_ACTION_COMPRESS_RAM: rimd->set_option("format",IMAGE_FORMAT_COMPRESS_RAM); break;
}
- int flags=0;
-
- if (Globals::get_singleton()->get("image_loader/filter"))
- flags|=IMAGE_FLAG_FILTER;
- if (!Globals::get_singleton()->get("image_loader/gen_mipmaps"))
- flags|=IMAGE_FLAG_NO_MIPMAPS;
- if (!Globals::get_singleton()->get("image_loader/repeat"))
- flags|=IMAGE_FLAG_REPEAT;
+ String validated_path=EditorImportPlugin::validate_source_path(p_path);
+ int flags=texture_flags_to_export_flags(ResourceFormatLoaderImage::load_image_flags(validated_path));
flags|=IMAGE_FLAG_FIX_BORDER_ALPHA;
rimd->set_option("shrink",EditorImportExport::get_singleton()->get_export_image_shrink());
rimd->set_option("flags",flags);
rimd->set_option("quality",EditorImportExport::get_singleton()->get_export_image_quality());
rimd->set_option("atlas",false);
- rimd->add_source(EditorImportPlugin::validate_source_path(p_path),FileAccess::get_md5(p_path));
+ rimd->add_source(validated_path,FileAccess::get_md5(p_path));
} else {
return Vector<uint8_t>();
@@ -1657,7 +1649,7 @@ Vector<uint8_t> EditorTextureImportPlugin::custom_export(const String& p_path, c
uint8_t f4[4];
encode_uint32(flags,&f4[0]);
MD5Init(&ctx);
- String gp = Globals::get_singleton()->globalize_path(p_path);
+ String gp = GlobalConfig::get_singleton()->globalize_path(p_path);
CharString cs = gp.utf8();
MD5Update(&ctx,(unsigned char*)cs.get_data(),cs.length());
MD5Update(&ctx,f4,4);
@@ -1726,6 +1718,33 @@ Vector<uint8_t> EditorTextureImportPlugin::custom_export(const String& p_path, c
return ret;
}
+uint32_t EditorTextureImportPlugin::texture_flags_to_export_flags(uint32_t p_tex_flags) const {
+
+ uint32_t flags=0;
+
+ if (!(p_tex_flags&Texture::FLAG_MIPMAPS)) {
+ flags|=IMAGE_FLAG_NO_MIPMAPS;
+ }
+ if (p_tex_flags&Texture::FLAG_REPEAT) {
+ flags|=IMAGE_FLAG_REPEAT;
+ }
+ if (p_tex_flags&Texture::FLAG_FILTER) {
+ flags|=IMAGE_FLAG_FILTER;
+ }
+ if (p_tex_flags&Texture::FLAG_ANISOTROPIC_FILTER) {
+ flags|=IMAGE_FLAG_USE_ANISOTROPY;
+ }
+ if (p_tex_flags&Texture::FLAG_CONVERT_TO_LINEAR) {
+ flags|=IMAGE_FLAG_CONVERT_TO_LINEAR;
+ }
+ /* // no correspondence yet
+ if (p_tex_flags&Texture::TEXTURE_FLAG_MIRRORED_REPEAT) {
+ flags|=;
+ }*/
+
+ return flags;
+}
+
void EditorTextureImportPlugin::import_from_drop(const Vector<String>& p_drop,const String& p_dest_path) {
Vector<String> valid;
@@ -1734,7 +1753,7 @@ void EditorTextureImportPlugin::import_from_drop(const Vector<String>& p_drop,co
ImageLoader::get_recognized_extensions(&valid_extensions);
for(int i=0;i<p_drop.size();i++) {
- String extension=p_drop[i].extension().to_lower();
+ String extension=p_drop[i].get_extension().to_lower();
for (List<String>::Element *E=valid_extensions.front();E;E=E->next()) {
@@ -1842,21 +1861,21 @@ EditorTextureImportPlugin::EditorTextureImportPlugin(EditorNode *p_editor) {
if (pl.is_valid()) {
Vector<uint8_t> ce = pl->custom_export(p_path,p_platform);
if (ce.size()) {
- p_path=p_path.basename()+".converted.tex";
+ p_path=p_path.get_basename()+".converted.tex";
return ce;
}
}
} else if (EditorImportExport::get_singleton()->get_export_image_action()!=EditorImportExport::IMAGE_ACTION_NONE){
- String xt = p_path.extension().to_lower();
+ String xt = p_path.get_extension().to_lower();
if (EditorImportExport::get_singleton()->get_image_formats().has(xt)) { //should check for more I guess?
Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture");
if (pl.is_valid()) {
Vector<uint8_t> ce = pl->custom_export(p_path,p_platform);
if (ce.size()) {
- p_path=p_path.basename()+".converted.tex";
+ p_path=p_path.get_basename()+".converted.tex";
return ce;
}
}
diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.h b/tools/editor/io_plugins/editor_texture_import_plugin.h
index 5c8abd10a4..b2117f1475 100644
--- a/tools/editor/io_plugins/editor_texture_import_plugin.h
+++ b/tools/editor/io_plugins/editor_texture_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -49,7 +49,7 @@ class EditorTextureImportDialog;
class EditorTextureImportPlugin : public EditorImportPlugin {
- OBJ_TYPE(EditorTextureImportPlugin,EditorImportPlugin);
+ GDCLASS(EditorTextureImportPlugin,EditorImportPlugin);
public:
@@ -72,6 +72,8 @@ private:
Error _process_texture_data(Ref<ImageTexture> &texture, int format, float quality, int flags,EditorExportPlatform::ImageCompression p_compr,int tex_flags,float shrink);
void compress_image(EditorExportPlatform::ImageCompression p_mode,Image& image,bool p_smaller);
+
+ uint32_t texture_flags_to_export_flags(uint32_t p_tex_flags) const;
public:
@@ -117,7 +119,7 @@ public:
class EditorTextureExportPlugin : public EditorExportPlugin {
- OBJ_TYPE( EditorTextureExportPlugin, EditorExportPlugin);
+ GDCLASS( EditorTextureExportPlugin, EditorExportPlugin);
public:
@@ -128,7 +130,7 @@ public:
class EditorImportTextureOptions : public VBoxContainer {
- OBJ_TYPE( EditorImportTextureOptions, VBoxContainer );
+ GDCLASS( EditorImportTextureOptions, VBoxContainer );
OptionButton *format;
diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.cpp b/tools/editor/io_plugins/editor_translation_import_plugin.cpp
index 9ee3e98486..d9288f5990 100644
--- a/tools/editor/io_plugins/editor_translation_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_translation_import_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -41,7 +41,7 @@
class EditorTranslationImportDialog : public ConfirmationDialog {
- OBJ_TYPE(EditorTranslationImportDialog,ConfirmationDialog);
+ GDCLASS(EditorTranslationImportDialog,ConfirmationDialog);
EditorTranslationImportPlugin *plugin;
@@ -255,7 +255,7 @@ public:
imd->set_option("skip_first",ignore_first->is_pressed());
imd->set_option("compress",compress->is_pressed());
- String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().basename()+"."+locale+".xl");
+ String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().get_basename()+"."+locale+".xl");
Error err = plugin->import(savefile,imd);
if (err!=OK) {
error_dialog->set_text(TTR("Couldn't import!"));
@@ -282,12 +282,12 @@ public:
static void _bind_methods() {
- ObjectTypeDB::bind_method("_choose_file",&EditorTranslationImportDialog::_choose_file);
- ObjectTypeDB::bind_method("_choose_save_dir",&EditorTranslationImportDialog::_choose_save_dir);
- ObjectTypeDB::bind_method("_import",&EditorTranslationImportDialog::_import);
- ObjectTypeDB::bind_method("_browse",&EditorTranslationImportDialog::_browse);
- ObjectTypeDB::bind_method("_browse_target",&EditorTranslationImportDialog::_browse_target);
- // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) );
+ ClassDB::bind_method("_choose_file",&EditorTranslationImportDialog::_choose_file);
+ ClassDB::bind_method("_choose_save_dir",&EditorTranslationImportDialog::_choose_save_dir);
+ ClassDB::bind_method("_import",&EditorTranslationImportDialog::_import);
+ ClassDB::bind_method("_browse",&EditorTranslationImportDialog::_browse);
+ ClassDB::bind_method("_browse_target",&EditorTranslationImportDialog::_browse_target);
+ //ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) );
}
EditorTranslationImportDialog(EditorTranslationImportPlugin *p_plugin) {
@@ -299,7 +299,7 @@ public:
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
@@ -356,7 +356,7 @@ public:
save_select = memnew( EditorDirDialog );
add_child(save_select);
- // save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
+ //save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
save_select->connect("dir_selected", this,"_choose_save_dir");
get_ok()->connect("pressed", this,"_import");
@@ -366,7 +366,7 @@ public:
error_dialog = memnew ( ConfirmationDialog );
add_child(error_dialog);
error_dialog->get_ok()->set_text(TTR("Accept"));
- // error_dialog->get_cancel()->hide();
+ //error_dialog->get_cancel()->hide();
set_hide_on_ok(false);
@@ -400,7 +400,7 @@ void EditorTranslationImportPlugin::import_from_drop(const Vector<String>& p_dro
for(int i=0;i<p_drop.size();i++) {
- String ext = p_drop[i].extension().to_lower();
+ String ext = p_drop[i].get_extension().to_lower();
if (ext=="csv") {
diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.h b/tools/editor/io_plugins/editor_translation_import_plugin.h
index 532f2cedcc..38727bd778 100644
--- a/tools/editor/io_plugins/editor_translation_import_plugin.h
+++ b/tools/editor/io_plugins/editor_translation_import_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,7 +37,7 @@ class EditorTranslationImportDialog;
class EditorTranslationImportPlugin : public EditorImportPlugin {
- OBJ_TYPE(EditorTranslationImportPlugin,EditorImportPlugin);
+ GDCLASS(EditorTranslationImportPlugin,EditorImportPlugin);
EditorTranslationImportDialog *dialog;
public:
diff --git a/tools/editor/multi_node_edit.cpp b/tools/editor/multi_node_edit.cpp
index 4d27b8e349..47b776ed06 100644
--- a/tools/editor/multi_node_edit.cpp
+++ b/tools/editor/multi_node_edit.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -53,7 +53,14 @@ bool MultiNodeEdit::_set(const StringName& p_name, const Variant& p_value){
if (!n)
continue;
- ur->add_do_property(n,name,p_value);
+ if (p_value.get_type() == Variant::NODE_PATH) {
+ Node *tonode = n->get_node(p_value);
+ NodePath p_path = n->get_path_to(tonode);
+ ur->add_do_property(n,name,p_path);
+ } else {
+ ur->add_do_property(n,name,p_value);
+ }
+
ur->add_undo_property(n,name,n->get(name));
diff --git a/tools/editor/multi_node_edit.h b/tools/editor/multi_node_edit.h
index fd50dc5bf4..290c529d48 100644
--- a/tools/editor/multi_node_edit.h
+++ b/tools/editor/multi_node_edit.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,7 +33,7 @@
class MultiNodeEdit : public Reference {
- OBJ_TYPE(MultiNodeEdit,Reference);
+ GDCLASS(MultiNodeEdit,Reference);
List<NodePath> nodes;
struct PLData {
diff --git a/tools/editor/node_dock.cpp b/tools/editor/node_dock.cpp
index fb5a50e633..a8e66a8680 100644
--- a/tools/editor/node_dock.cpp
+++ b/tools/editor/node_dock.cpp
@@ -20,8 +20,8 @@ void NodeDock::show_connections(){
void NodeDock::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("show_groups"),&NodeDock::show_groups);
- ObjectTypeDB::bind_method(_MD("show_connections"),&NodeDock::show_connections);
+ ClassDB::bind_method(_MD("show_groups"),&NodeDock::show_groups);
+ ClassDB::bind_method(_MD("show_connections"),&NodeDock::show_connections);
}
void NodeDock::_notification(int p_what) {
diff --git a/tools/editor/node_dock.h b/tools/editor/node_dock.h
index 02312b90b5..fd4105d1b2 100644
--- a/tools/editor/node_dock.h
+++ b/tools/editor/node_dock.h
@@ -6,7 +6,7 @@
class NodeDock : public VBoxContainer {
- OBJ_TYPE(NodeDock,VBoxContainer);
+ GDCLASS(NodeDock,VBoxContainer);
ToolButton *connections_button;
ToolButton *groups_button;
diff --git a/tools/editor/output_strings.cpp b/tools/editor/output_strings.cpp
index a6126466c4..cb43bb9230 100644
--- a/tools/editor/output_strings.cpp
+++ b/tools/editor/output_strings.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -68,7 +68,7 @@ void OutputStrings::_notification(int p_what) {
if (following) {
updating=true;
- v_scroll->set_val( v_scroll->get_max() - v_scroll->get_page() );
+ v_scroll->set_value( v_scroll->get_max() - v_scroll->get_page() );
updating=false;
}
@@ -82,11 +82,11 @@ void OutputStrings::_notification(int p_what) {
Ref<Texture> icon_error = get_icon("Error","EditorIcons");
Ref<Texture> icon_warning = get_icon("Warning","EditorIcons");
- // int lines = (size_height-(int)margin.y) / font_height;
+ //int lines = (size_height-(int)margin.y) / font_height;
Point2 ofs=tree_st->get_offset();
- LineMap::Element *E = line_map.find(v_scroll->get_val());
- float h_ofs = (int)h_scroll->get_val();
+ LineMap::Element *E = line_map.find(v_scroll->get_value());
+ float h_ofs = (int)h_scroll->get_value();
Point2 icon_ofs=Point2(0,(font_height-(int)icon_error->get_height())/2);
while( E && ofs.y < (size_height-(int)margin.y) ) {
@@ -194,8 +194,8 @@ void OutputStrings::add_line(const String& p_text, const Variant& p_meta, const
void OutputStrings::_bind_methods() {
- ObjectTypeDB::bind_method("_vscroll_changed",&OutputStrings::_vscroll_changed);
- ObjectTypeDB::bind_method("_hscroll_changed",&OutputStrings::_hscroll_changed);
+ ClassDB::bind_method("_vscroll_changed",&OutputStrings::_vscroll_changed);
+ ClassDB::bind_method("_hscroll_changed",&OutputStrings::_hscroll_changed);
}
OutputStrings::OutputStrings() {
diff --git a/tools/editor/output_strings.h b/tools/editor/output_strings.h
index 29c6ea799f..cc721ef652 100644
--- a/tools/editor/output_strings.h
+++ b/tools/editor/output_strings.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -36,7 +36,7 @@
class OutputStrings : public Control {
- OBJ_TYPE( OutputStrings, Control );
+ GDCLASS( OutputStrings, Control );
public:
enum LineType {
diff --git a/tools/editor/pane_drag.cpp b/tools/editor/pane_drag.cpp
index 8e8c2941ec..122abd37b9 100644
--- a/tools/editor/pane_drag.cpp
+++ b/tools/editor/pane_drag.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -29,7 +29,7 @@
#include "pane_drag.h"
-void PaneDrag::_input_event(const InputEvent& p_input) {
+void PaneDrag::_gui_input(const InputEvent& p_input) {
if (p_input.type==InputEvent::MOUSE_MOTION && p_input.mouse_motion.button_mask&BUTTON_MASK_LEFT) {
@@ -64,7 +64,7 @@ Size2 PaneDrag::get_minimum_size() const {
void PaneDrag::_bind_methods() {
- ObjectTypeDB::bind_method("_input_event",&PaneDrag::_input_event);
+ ClassDB::bind_method("_gui_input",&PaneDrag::_gui_input);
ADD_SIGNAL(MethodInfo("dragged",PropertyInfo(Variant::VECTOR2,"amount")));
}
diff --git a/tools/editor/pane_drag.h b/tools/editor/pane_drag.h
index 24f2ef7ed8..8796fc2594 100644
--- a/tools/editor/pane_drag.h
+++ b/tools/editor/pane_drag.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,14 +33,14 @@
class PaneDrag : public Control {
- OBJ_TYPE( PaneDrag, Control );
+ GDCLASS( PaneDrag, Control );
bool mouse_over;
protected:
- void _input_event(const InputEvent& p_input);
+ void _gui_input(const InputEvent& p_input);
void _notification(int p_what);
virtual Size2 get_minimum_size() const;
static void _bind_methods();
diff --git a/tools/editor/plugins/SCsub b/tools/editor/plugins/SCsub
index 363a2ce4c0..4bf55189cc 100644
--- a/tools/editor/plugins/SCsub
+++ b/tools/editor/plugins/SCsub
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
Import('env')
Export('env')
-env.add_source_files(env.tool_sources,"*.cpp")
+env.add_source_files(env.tool_sources, "*.cpp")
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp
index b4d54c6b1e..59ab3bc467 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_player_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -50,7 +50,7 @@ void AnimationPlayerEditor::_node_removed(Node *p_node) {
}
}
-void AnimationPlayerEditor::_input_event(InputEvent p_event) {
+void AnimationPlayerEditor::_gui_input(InputEvent p_event) {
}
@@ -77,14 +77,14 @@ void AnimationPlayerEditor::_notification(int p_what) {
}
}
}
- frame->set_val(player->get_current_animation_pos());
+ frame->set_value(player->get_current_animation_pos());
key_editor->set_anim_pos(player->get_current_animation_pos());
EditorNode::get_singleton()->get_property_editor()->refresh();
} else if (last_active) {
//need the last frame after it stopped
- frame->set_val(player->get_current_animation_pos());
+ frame->set_value(player->get_current_animation_pos());
}
last_active=player->is_playing();
@@ -94,14 +94,14 @@ void AnimationPlayerEditor::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
-// editor->connect("hide_animation_player_editors",this,"_hide_anim_editors");
+ //editor->connect("hide_animation_player_editors",this,"_hide_anim_editors");
add_anim->set_icon( get_icon("New","EditorIcons") );
rename_anim->set_icon( get_icon("Rename","EditorIcons") );
duplicate_anim->set_icon( get_icon("Duplicate","EditorIcons") );
autoplay->set_icon( get_icon("AutoPlay","EditorIcons") );
load_anim->set_icon( get_icon("Folder","EditorIcons") );
save_anim->set_icon(get_icon("Save", "EditorIcons"));
- save_anim->get_popup()->connect("item_pressed", this, "_animation_save_menu");
+ save_anim->get_popup()->connect("id_pressed", this, "_animation_save_menu");
remove_anim->set_icon( get_icon("Remove","EditorIcons") );
blend_anim->set_icon( get_icon("Blend","EditorIcons") );
@@ -115,7 +115,7 @@ void AnimationPlayerEditor::_notification(int p_what) {
resource_edit_anim->set_icon( get_icon("EditResource","EditorIcons") );
pin->set_icon(get_icon("Pin","EditorIcons") );
tool_anim->set_icon(get_icon("Tools","EditorIcons"));
- tool_anim->get_popup()->connect("item_pressed",this,"_animation_tool_menu");
+ tool_anim->get_popup()->connect("id_pressed",this,"_animation_tool_menu");
blend_editor.next->connect("item_selected", this, "_blend_editor_next_changed");
@@ -375,12 +375,14 @@ void AnimationPlayerEditor::_animation_load() {
void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource>& p_resource, const String& p_path) {
int flg = 0;
- if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources"))
+ if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources"))
flg |= ResourceSaver::FLAG_COMPRESS;
- //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative"))
- // flg |= ResourceSaver::FLAG_RELATIVE_PATHS;
+ /*
+ if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative"))
+ flg |= ResourceSaver::FLAG_RELATIVE_PATHS;
+ */
- String path = Globals::get_singleton()->localize_path(p_path);
+ String path = GlobalConfig::get_singleton()->localize_path(p_path);
Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS);
if (err != OK) {
@@ -388,7 +390,7 @@ void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource>& p_resou
accept->popup_centered_minsize();
return;
}
- // EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type());
+ //EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type());
((Resource*)p_resource.ptr())->set_path(path);
editor->emit_signal("resource_saved", p_resource);
@@ -421,7 +423,7 @@ void AnimationPlayerEditor::_animation_save_as(const Ref<Resource>& p_resource)
if (p_resource->get_path() != "") {
file->set_current_path(p_resource->get_path());
if (extensions.size()) {
- String ext = p_resource->get_path().extension().to_lower();
+ String ext = p_resource->get_path().get_extension().to_lower();
if (extensions.find(ext) == NULL) {
file->set_current_path(p_resource->get_path().replacen("." + ext, "." + extensions.front()->get()));
}
@@ -431,7 +433,7 @@ void AnimationPlayerEditor::_animation_save_as(const Ref<Resource>& p_resource)
String existing;
if (extensions.size()) {
- existing = "new_" + p_resource->get_type().to_lower() + "." + extensions.front()->get().to_lower();
+ existing = "new_" + p_resource->get_class().to_lower() + "." + extensions.front()->get().to_lower();
}
file->set_current_path(existing);
@@ -648,8 +650,8 @@ Dictionary AnimationPlayerEditor::get_state() const {
Dictionary d;
- d["visible"]=is_visible();
- if (EditorNode::get_singleton()->get_edited_scene() && is_visible() && player) {
+ d["visible"]=is_visible_in_tree();
+ if (EditorNode::get_singleton()->get_edited_scene() && is_visible_in_tree() && player) {
d["player"]=EditorNode::get_singleton()->get_edited_scene()->get_path_to(player);
d["animation"]=player->get_current_animation();
@@ -666,13 +668,13 @@ void AnimationPlayerEditor::set_state(const Dictionary& p_state) {
return;
Node *n = EditorNode::get_singleton()->get_edited_scene()->get_node(p_state["player"]);
- if (n && n->cast_to<AnimationPlayer>()) {
+ if (n && n->cast_to<AnimationPlayer>() && EditorNode::get_singleton()->get_editor_selection()->is_selected(n)) {
player=n->cast_to<AnimationPlayer>();
_update_player();
show();
set_process(true);
ensure_visibility();
-// EditorNode::get_singleton()->animation_panel_make_visible(true);
+ //EditorNode::get_singleton()->animation_panel_make_visible(true);
if (p_state.has("animation")) {
String anim = p_state["animation"];
@@ -723,7 +725,7 @@ void AnimationPlayerEditor::_dialog_action(String p_file) {
Ref<Resource> res = ResourceLoader::load(p_file, "Animation");
ERR_FAIL_COND(res.is_null());
- ERR_FAIL_COND(!res->is_type("Animation"));
+ ERR_FAIL_COND(!res->is_class("Animation"));
if (p_file.find_last("/") != -1) {
p_file = p_file.substr(p_file.find_last("/") + 1, p_file.length());
@@ -768,7 +770,7 @@ void AnimationPlayerEditor::_dialog_action(String p_file) {
void AnimationPlayerEditor::_scale_changed(const String& p_scale) {
- player->set_speed(p_scale.to_double());
+ player->set_speed_scale(p_scale.to_double());
}
void AnimationPlayerEditor::_update_animation() {
@@ -790,7 +792,7 @@ void AnimationPlayerEditor::_update_animation() {
stop->set_pressed(true);
}
- scale->set_text( String::num(player->get_speed(),2) );
+ scale->set_text( String::num(player->get_speed_scale(),2) );
String current=player->get_current_animation();
for (int i=0;i<animation->get_item_count();i++) {
@@ -897,7 +899,7 @@ void AnimationPlayerEditor::edit(AnimationPlayer *p_player) {
} else {
key_editor->show_select_node_warning(true);
-// hide();
+ //hide();
}
@@ -999,10 +1001,10 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value,bool p_set) {
void AnimationPlayerEditor::_animation_player_changed(Object *p_pl) {
- if (player==p_pl && is_visible()) {
+ if (player==p_pl && is_visible_in_tree()) {
_update_player();
- if (blend_editor.dialog->is_visible())
+ if (blend_editor.dialog->is_visible_in_tree())
_animation_blend(); //update
}
}
@@ -1011,7 +1013,7 @@ void AnimationPlayerEditor::_animation_player_changed(Object *p_pl) {
void AnimationPlayerEditor::_list_changed() {
- if(is_visible())
+ if(is_visible_in_tree())
_update_player();
}
#if 0
@@ -1099,7 +1101,7 @@ void AnimationPlayerEditor::_animation_key_editor_anim_step_changed(float p_len)
void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos,bool p_drag) {
- if (!is_visible())
+ if (!is_visible_in_tree())
return;
if (!player)
return;
@@ -1108,7 +1110,7 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos,bool p_drag)
return;
updating=true;
- frame->set_val(p_pos);
+ frame->set_value(p_pos);
updating=false;
_seek_value_changed(p_pos,!p_drag);
@@ -1128,7 +1130,7 @@ void AnimationPlayerEditor::_hide_anim_editors() {
key_editor->set_animation(Ref<Animation>());
key_editor->set_root(NULL);
key_editor->show_select_node_warning(true);
-// editor->animation_editor_make_visible(false);
+ //editor->animation_editor_make_visible(false);
}
@@ -1220,7 +1222,7 @@ void AnimationPlayerEditor::_animation_save_menu(int p_option) {
void AnimationPlayerEditor::_unhandled_key_input(const InputEvent& p_ev) {
- if (is_visible() && p_ev.type==InputEvent::KEY && p_ev.key.pressed && !p_ev.key.echo && !p_ev.key.mod.alt && !p_ev.key.mod.control && !p_ev.key.mod.meta) {
+ if (is_visible_in_tree() && p_ev.type==InputEvent::KEY && p_ev.key.pressed && !p_ev.key.echo && !p_ev.key.mod.alt && !p_ev.key.mod.control && !p_ev.key.mod.meta) {
switch(p_ev.key.scancode) {
@@ -1245,42 +1247,42 @@ void AnimationPlayerEditor::_unhandled_key_input(const InputEvent& p_ev) {
void AnimationPlayerEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_input_event"),&AnimationPlayerEditor::_input_event);
- ObjectTypeDB::bind_method(_MD("_node_removed"),&AnimationPlayerEditor::_node_removed);
- ObjectTypeDB::bind_method(_MD("_play_pressed"),&AnimationPlayerEditor::_play_pressed);
- ObjectTypeDB::bind_method(_MD("_play_from_pressed"),&AnimationPlayerEditor::_play_from_pressed);
- ObjectTypeDB::bind_method(_MD("_play_bw_pressed"),&AnimationPlayerEditor::_play_bw_pressed);
- ObjectTypeDB::bind_method(_MD("_play_bw_from_pressed"),&AnimationPlayerEditor::_play_bw_from_pressed);
- ObjectTypeDB::bind_method(_MD("_stop_pressed"),&AnimationPlayerEditor::_stop_pressed);
- ObjectTypeDB::bind_method(_MD("_autoplay_pressed"),&AnimationPlayerEditor::_autoplay_pressed);
- ObjectTypeDB::bind_method(_MD("_pause_pressed"),&AnimationPlayerEditor::_pause_pressed);
- ObjectTypeDB::bind_method(_MD("_animation_selected"),&AnimationPlayerEditor::_animation_selected);
- ObjectTypeDB::bind_method(_MD("_animation_name_edited"),&AnimationPlayerEditor::_animation_name_edited);
- ObjectTypeDB::bind_method(_MD("_animation_new"),&AnimationPlayerEditor::_animation_new);
- ObjectTypeDB::bind_method(_MD("_animation_rename"),&AnimationPlayerEditor::_animation_rename);
- ObjectTypeDB::bind_method(_MD("_animation_load"),&AnimationPlayerEditor::_animation_load);
- ObjectTypeDB::bind_method(_MD("_animation_remove"),&AnimationPlayerEditor::_animation_remove);
- ObjectTypeDB::bind_method(_MD("_animation_blend"),&AnimationPlayerEditor::_animation_blend);
- 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,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);
- ObjectTypeDB::bind_method(_MD("_scale_changed"),&AnimationPlayerEditor::_scale_changed);
- //ObjectTypeDB::bind_method(_MD("_editor_store_all"),&AnimationPlayerEditor::_editor_store_all);
+ ClassDB::bind_method(_MD("_gui_input"),&AnimationPlayerEditor::_gui_input);
+ ClassDB::bind_method(_MD("_node_removed"),&AnimationPlayerEditor::_node_removed);
+ ClassDB::bind_method(_MD("_play_pressed"),&AnimationPlayerEditor::_play_pressed);
+ ClassDB::bind_method(_MD("_play_from_pressed"),&AnimationPlayerEditor::_play_from_pressed);
+ ClassDB::bind_method(_MD("_play_bw_pressed"),&AnimationPlayerEditor::_play_bw_pressed);
+ ClassDB::bind_method(_MD("_play_bw_from_pressed"),&AnimationPlayerEditor::_play_bw_from_pressed);
+ ClassDB::bind_method(_MD("_stop_pressed"),&AnimationPlayerEditor::_stop_pressed);
+ ClassDB::bind_method(_MD("_autoplay_pressed"),&AnimationPlayerEditor::_autoplay_pressed);
+ ClassDB::bind_method(_MD("_pause_pressed"),&AnimationPlayerEditor::_pause_pressed);
+ ClassDB::bind_method(_MD("_animation_selected"),&AnimationPlayerEditor::_animation_selected);
+ ClassDB::bind_method(_MD("_animation_name_edited"),&AnimationPlayerEditor::_animation_name_edited);
+ ClassDB::bind_method(_MD("_animation_new"),&AnimationPlayerEditor::_animation_new);
+ ClassDB::bind_method(_MD("_animation_rename"),&AnimationPlayerEditor::_animation_rename);
+ ClassDB::bind_method(_MD("_animation_load"),&AnimationPlayerEditor::_animation_load);
+ ClassDB::bind_method(_MD("_animation_remove"),&AnimationPlayerEditor::_animation_remove);
+ ClassDB::bind_method(_MD("_animation_blend"),&AnimationPlayerEditor::_animation_blend);
+ ClassDB::bind_method(_MD("_animation_edit"),&AnimationPlayerEditor::_animation_edit);
+ ClassDB::bind_method(_MD("_animation_resource_edit"),&AnimationPlayerEditor::_animation_resource_edit);
+ ClassDB::bind_method(_MD("_dialog_action"),&AnimationPlayerEditor::_dialog_action);
+ ClassDB::bind_method(_MD("_seek_value_changed"),&AnimationPlayerEditor::_seek_value_changed,DEFVAL(true));
+ ClassDB::bind_method(_MD("_animation_player_changed"),&AnimationPlayerEditor::_animation_player_changed);
+ ClassDB::bind_method(_MD("_blend_edited"),&AnimationPlayerEditor::_blend_edited);
+ //ClassDB::bind_method(_MD("_seek_frame_changed"),&AnimationPlayerEditor::_seek_frame_changed);
+ ClassDB::bind_method(_MD("_scale_changed"),&AnimationPlayerEditor::_scale_changed);
+ //ClassDB::bind_method(_MD("_editor_store_all"),&AnimationPlayerEditor::_editor_store_all);
///jectTypeDB::bind_method(_MD("_editor_load_all"),&AnimationPlayerEditor::_editor_load_all);
- ObjectTypeDB::bind_method(_MD("_list_changed"),&AnimationPlayerEditor::_list_changed);
- ObjectTypeDB::bind_method(_MD("_animation_key_editor_seek"),&AnimationPlayerEditor::_animation_key_editor_seek);
- ObjectTypeDB::bind_method(_MD("_animation_key_editor_anim_len_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_len_changed);
- ObjectTypeDB::bind_method(_MD("_animation_key_editor_anim_step_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_step_changed);
- ObjectTypeDB::bind_method(_MD("_hide_anim_editors"),&AnimationPlayerEditor::_hide_anim_editors);
- ObjectTypeDB::bind_method(_MD("_animation_duplicate"),&AnimationPlayerEditor::_animation_duplicate);
- ObjectTypeDB::bind_method(_MD("_blend_editor_next_changed"),&AnimationPlayerEditor::_blend_editor_next_changed);
- ObjectTypeDB::bind_method(_MD("_unhandled_key_input"),&AnimationPlayerEditor::_unhandled_key_input);
- ObjectTypeDB::bind_method(_MD("_animation_tool_menu"),&AnimationPlayerEditor::_animation_tool_menu);
- ObjectTypeDB::bind_method(_MD("_animation_save_menu"), &AnimationPlayerEditor::_animation_save_menu);
+ ClassDB::bind_method(_MD("_list_changed"),&AnimationPlayerEditor::_list_changed);
+ ClassDB::bind_method(_MD("_animation_key_editor_seek"),&AnimationPlayerEditor::_animation_key_editor_seek);
+ ClassDB::bind_method(_MD("_animation_key_editor_anim_len_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_len_changed);
+ ClassDB::bind_method(_MD("_animation_key_editor_anim_step_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_step_changed);
+ ClassDB::bind_method(_MD("_hide_anim_editors"),&AnimationPlayerEditor::_hide_anim_editors);
+ ClassDB::bind_method(_MD("_animation_duplicate"),&AnimationPlayerEditor::_animation_duplicate);
+ ClassDB::bind_method(_MD("_blend_editor_next_changed"),&AnimationPlayerEditor::_blend_editor_next_changed);
+ ClassDB::bind_method(_MD("_unhandled_key_input"),&AnimationPlayerEditor::_unhandled_key_input);
+ ClassDB::bind_method(_MD("_animation_tool_menu"),&AnimationPlayerEditor::_animation_tool_menu);
+ ClassDB::bind_method(_MD("_animation_save_menu"), &AnimationPlayerEditor::_animation_save_menu);
@@ -1477,7 +1479,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) {
blend_editor.dialog->set_hide_on_ok(true);
VBoxContainer *blend_vb = memnew( VBoxContainer);
blend_editor.dialog->add_child(blend_vb);
- blend_editor.dialog->set_child_rect(blend_vb);
+ //blend_editor.dialog->set_child_rect(blend_vb);
blend_editor.tree = memnew( Tree );
blend_editor.tree->set_columns(2);
blend_vb->add_margin_child(TTR("Blend Times:"),blend_editor.tree,true);
@@ -1542,7 +1544,7 @@ void AnimationPlayerEditorPlugin::edit(Object *p_object) {
bool AnimationPlayerEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("AnimationPlayer");
+ return p_object->is_class("AnimationPlayer");
}
void AnimationPlayerEditorPlugin::make_visible(bool p_visible) {
@@ -1552,11 +1554,11 @@ void AnimationPlayerEditorPlugin::make_visible(bool p_visible) {
editor->make_bottom_panel_item_visible(anim_editor);
anim_editor->set_process(true);
anim_editor->ensure_visibility();
-// editor->animation_panel_make_visible(true);
+ //editor->animation_panel_make_visible(true);
} else {
-// anim_editor->hide();
-// anim_editor->set_idle_process(false);
+ //anim_editor->hide();
+ //anim_editor->set_idle_process(false);
}
}
diff --git a/tools/editor/plugins/animation_player_editor_plugin.h b/tools/editor/plugins/animation_player_editor_plugin.h
index b0c930b66e..840c39ba49 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.h
+++ b/tools/editor/plugins/animation_player_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -44,7 +44,7 @@
class AnimationKeyEditor;
class AnimationPlayerEditor : public VBoxContainer {
- OBJ_TYPE(AnimationPlayerEditor, VBoxContainer );
+ GDCLASS(AnimationPlayerEditor, VBoxContainer );
EditorNode *editor;
AnimationPlayer *player;
@@ -73,7 +73,7 @@ class AnimationPlayerEditor : public VBoxContainer {
Button *play_bw;
Button *play_bw_from;
-// Button *pause;
+ //Button *pause;
Button *add_anim;
Button *autoplay;
Button *rename_anim;
@@ -171,7 +171,7 @@ class AnimationPlayerEditor : public VBoxContainer {
protected:
void _notification(int p_what);
- void _input_event(InputEvent p_event);
+ void _gui_input(InputEvent p_event);
void _node_removed(Node *p_node);
static void _bind_methods();
public:
@@ -193,7 +193,7 @@ public:
class AnimationPlayerEditorPlugin : public EditorPlugin {
- OBJ_TYPE( AnimationPlayerEditorPlugin, EditorPlugin );
+ GDCLASS( AnimationPlayerEditorPlugin, EditorPlugin );
AnimationPlayerEditor *anim_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/tools/editor/plugins/animation_tree_editor_plugin.cpp
index 24914e4bc5..eedebab1c9 100644
--- a/tools/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_tree_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -183,20 +183,20 @@ void AnimationTreeEditor::_edit_dialog_changed() {
case AnimationTreePlayer::NODE_MIX:
- anim_tree->mix_node_set_amount(edited_node,edit_scroll[0]->get_val());
+ anim_tree->mix_node_set_amount(edited_node,edit_scroll[0]->get_value());
break;
case AnimationTreePlayer::NODE_BLEND2:
- anim_tree->blend2_node_set_amount(edited_node,edit_scroll[0]->get_val());
+ anim_tree->blend2_node_set_amount(edited_node,edit_scroll[0]->get_value());
break;
case AnimationTreePlayer::NODE_BLEND3:
- anim_tree->blend3_node_set_amount(edited_node,edit_scroll[0]->get_val());
+ anim_tree->blend3_node_set_amount(edited_node,edit_scroll[0]->get_value());
break;
case AnimationTreePlayer::NODE_BLEND4:
- anim_tree->blend4_node_set_amount(edited_node,Point2(edit_scroll[0]->get_val(),edit_scroll[1]->get_val()));
+ anim_tree->blend4_node_set_amount(edited_node,Point2(edit_scroll[0]->get_value(),edit_scroll[1]->get_value()));
break;
@@ -265,7 +265,7 @@ void AnimationTreeEditor::_popup_edit_dialog() {
filter_button->hide();
edit_check->hide();;
- Point2 pos = anim_tree->node_get_pos(edited_node)-Point2(h_scroll->get_val(),v_scroll->get_val());
+ Point2 pos = anim_tree->node_get_pos(edited_node)-Point2(h_scroll->get_value(),v_scroll->get_value());
Ref<StyleBox> style = get_stylebox("panel","PopupMenu");
Size2 size = get_node_size(edited_node);
Point2 popup_pos( pos.x+style->get_margin(MARGIN_LEFT), pos.y+size.y-style->get_margin(MARGIN_BOTTOM));
@@ -380,7 +380,7 @@ void AnimationTreeEditor::_popup_edit_dialog() {
edit_label[0]->show();
edit_scroll[0]->set_min(0);
edit_scroll[0]->set_max(1);
- edit_scroll[0]->set_val(anim_tree->mix_node_get_amount(edited_node));
+ edit_scroll[0]->set_value(anim_tree->mix_node_get_amount(edited_node));
edit_scroll[0]->set_begin(Point2(15,25));
edit_scroll[0]->show();
edit_dialog->set_size(Size2(150,50));
@@ -392,7 +392,7 @@ void AnimationTreeEditor::_popup_edit_dialog() {
edit_label[0]->show();
edit_scroll[0]->set_min(0);
edit_scroll[0]->set_max(1);
- edit_scroll[0]->set_val(anim_tree->blend2_node_get_amount(edited_node));
+ edit_scroll[0]->set_value(anim_tree->blend2_node_get_amount(edited_node));
edit_scroll[0]->set_begin(Point2(15,25));
edit_scroll[0]->show();
filter_button->set_begin(Point2(10,47));
@@ -407,7 +407,7 @@ void AnimationTreeEditor::_popup_edit_dialog() {
edit_label[0]->show();
edit_scroll[0]->set_min(-1);
edit_scroll[0]->set_max(1);
- edit_scroll[0]->set_val(anim_tree->blend3_node_get_amount(edited_node));
+ edit_scroll[0]->set_value(anim_tree->blend3_node_get_amount(edited_node));
edit_scroll[0]->set_begin(Point2(15,25));
edit_scroll[0]->show();
edit_dialog->set_size(Size2(150,50));
@@ -420,7 +420,7 @@ void AnimationTreeEditor::_popup_edit_dialog() {
edit_label[0]->show();
edit_scroll[0]->set_min(0);
edit_scroll[0]->set_max(1);
- edit_scroll[0]->set_val(anim_tree->blend4_node_get_amount(edited_node).x);
+ edit_scroll[0]->set_value(anim_tree->blend4_node_get_amount(edited_node).x);
edit_scroll[0]->set_begin(Point2(15,25));
edit_scroll[0]->show();
edit_label[1]->set_text(TTR("Blend 1:"));
@@ -428,7 +428,7 @@ void AnimationTreeEditor::_popup_edit_dialog() {
edit_label[1]->show();
edit_scroll[1]->set_min(0);
edit_scroll[1]->set_max(1);
- edit_scroll[1]->set_val(anim_tree->blend4_node_get_amount(edited_node).y);
+ edit_scroll[1]->set_value(anim_tree->blend4_node_get_amount(edited_node).y);
edit_scroll[1]->set_begin(Point2(15,75));
edit_scroll[1]->show();
edit_dialog->set_size(Size2(150,100));
@@ -500,7 +500,7 @@ void AnimationTreeEditor::_draw_node(const StringName& p_node) {
}
- pos-=Point2(h_scroll->get_val(),v_scroll->get_val());
+ pos-=Point2(h_scroll->get_value(),v_scroll->get_value());
style->draw(ci,Rect2(pos,size));
@@ -621,9 +621,9 @@ void AnimationTreeEditor::_draw_node(const StringName& p_node) {
#if 0
void AnimationTreeEditor::_node_param_changed() {
-// anim_tree->node_set_param( click_node,property_editor->get_variant() );
-// update();
-// _write_anim_tree_graph();
+ //anim_tree->node_set_param( click_node,property_editor->get_variant() );
+ //update();
+ //_write_anim_tree_graph();
}
#endif
@@ -644,7 +644,7 @@ AnimationTreeEditor::ClickType AnimationTreeEditor::_locate_click(const Point2&
Point2 pos = anim_tree->node_get_pos(node);
Size2 size = get_node_size(node);
- pos-=Point2(h_scroll->get_val(),v_scroll->get_val());
+ pos-=Point2(h_scroll->get_value(),v_scroll->get_value());
if (!Rect2(pos,size).has_point(p_click))
continue;
@@ -709,7 +709,7 @@ Point2 AnimationTreeEditor::_get_slot_pos(const StringName& p_node,bool p_input,
}
- pos-=Point2(h_scroll->get_val(),v_scroll->get_val());
+ pos-=Point2(h_scroll->get_value(),v_scroll->get_value());
float w = size.width-style->get_minimum_size().width;
@@ -759,7 +759,7 @@ void AnimationTreeEditor::_node_edit_property(const StringName& p_node) {
}
#endif
-void AnimationTreeEditor::_input_event(InputEvent p_event) {
+void AnimationTreeEditor::_gui_input(InputEvent p_event) {
switch(p_event.type) {
@@ -792,7 +792,7 @@ void AnimationTreeEditor::_input_event(InputEvent p_event) {
renaming_edit=false;
_popup_edit_dialog();
//open editor
- // _node_edit_property(click_node);
+ //_node_edit_property(click_node);
} break;
default:{}
}
@@ -856,12 +856,12 @@ void AnimationTreeEditor::_input_event(InputEvent p_event) {
if (dst_click_type==CLICK_INPUT_SLOT && click_type==CLICK_OUTPUT_SLOT) {
- anim_tree->connect(click_node,id,slot);
+ anim_tree->connect_nodes(click_node,id,slot);
}
if (click_type==CLICK_INPUT_SLOT && dst_click_type==CLICK_OUTPUT_SLOT) {
- anim_tree->connect(id,click_node,click_slot);
+ anim_tree->connect_nodes(id,click_node,click_slot);
}
} break;
@@ -892,8 +892,8 @@ void AnimationTreeEditor::_input_event(InputEvent p_event) {
}
if ((p_event.mouse_motion.button_mask&4 || Input::get_singleton()->is_key_pressed(KEY_SPACE))) {
- h_scroll->set_val( h_scroll->get_val() - p_event.mouse_motion.relative_x );
- v_scroll->set_val( v_scroll->get_val() - p_event.mouse_motion.relative_y );
+ h_scroll->set_value( h_scroll->get_value() - p_event.mouse_motion.relative_x );
+ v_scroll->set_value( v_scroll->get_value() - p_event.mouse_motion.relative_y );
update();
}
@@ -947,7 +947,6 @@ void AnimationTreeEditor::_notification(int p_what) {
_update_scrollbars();
//VisualServer::get_singleton()->canvas_item_add_rect(get_canvas_item(),Rect2(Point2(),get_size()),Color(0,0,0,1));
get_stylebox("bg","Tree")->draw(get_canvas_item(),Rect2(Point2(),get_size()));
- VisualServer::get_singleton()->canvas_item_set_clip(get_canvas_item(),true);
for(List<StringName>::Element *E=order.front();E;E=E->next()) {
@@ -1026,7 +1025,7 @@ void AnimationTreeEditor::_update_scrollbars() {
v_scroll->show();
v_scroll->set_max(min.height);
v_scroll->set_page(size.height - hmin.height);
- offset.y=v_scroll->get_val();
+ offset.y=v_scroll->get_value();
}
if (min.width < size.width - vmin.width) {
@@ -1038,14 +1037,14 @@ void AnimationTreeEditor::_update_scrollbars() {
h_scroll->show();
h_scroll->set_max(min.width);
h_scroll->set_page(size.width - vmin.width);
- offset.x=h_scroll->get_val();
+ offset.x=h_scroll->get_value();
}
}
void AnimationTreeEditor::_scroll_moved(float) {
- offset.x=h_scroll->get_val();
- offset.y=v_scroll->get_val();
+ offset.x=h_scroll->get_value();
+ offset.y=v_scroll->get_value();
update();
}
@@ -1058,7 +1057,7 @@ void AnimationTreeEditor::_node_menu_item(int p_item) {
if (rclick_type==CLICK_INPUT_SLOT) {
- anim_tree->disconnect(rclick_node,rclick_slot);
+ anim_tree->disconnect_nodes(rclick_node,rclick_slot);
update();
}
@@ -1073,7 +1072,7 @@ void AnimationTreeEditor::_node_menu_item(int p_item) {
const AnimationTreePlayer::Connection &c=E->get();
if( c.dst_node==rclick_node) {
- anim_tree->disconnect(c.dst_node,c.dst_input);
+ anim_tree->disconnect_nodes(c.dst_node,c.dst_input);
}
}
update();
@@ -1323,23 +1322,23 @@ void AnimationTreeEditor::_edit_filters() {
void AnimationTreeEditor::_bind_methods() {
- ObjectTypeDB::bind_method( "_add_menu_item", &AnimationTreeEditor::_add_menu_item );
- ObjectTypeDB::bind_method( "_node_menu_item", &AnimationTreeEditor::_node_menu_item );
- ObjectTypeDB::bind_method( "_input_event", &AnimationTreeEditor::_input_event );
-// ObjectTypeDB::bind_method( "_node_param_changed", &AnimationTreeEditor::_node_param_changed );
- ObjectTypeDB::bind_method( "_scroll_moved", &AnimationTreeEditor::_scroll_moved );
- ObjectTypeDB::bind_method( "_edit_dialog_changeds", &AnimationTreeEditor::_edit_dialog_changeds );
- ObjectTypeDB::bind_method( "_edit_dialog_changede", &AnimationTreeEditor::_edit_dialog_changede );
- ObjectTypeDB::bind_method( "_edit_dialog_changedf", &AnimationTreeEditor::_edit_dialog_changedf );
- ObjectTypeDB::bind_method( "_edit_dialog_changed", &AnimationTreeEditor::_edit_dialog_changed );
- ObjectTypeDB::bind_method( "_edit_dialog_animation_changed", &AnimationTreeEditor::_edit_dialog_animation_changed );
- ObjectTypeDB::bind_method( "_edit_dialog_edit_animation", &AnimationTreeEditor::_edit_dialog_edit_animation );
- ObjectTypeDB::bind_method( "_play_toggled", &AnimationTreeEditor::_play_toggled );
- ObjectTypeDB::bind_method( "_edit_oneshot_start", &AnimationTreeEditor::_edit_oneshot_start );
- ObjectTypeDB::bind_method( "_file_dialog_selected", &AnimationTreeEditor::_file_dialog_selected);
- ObjectTypeDB::bind_method( "_master_anim_menu_item", &AnimationTreeEditor::_master_anim_menu_item);
- ObjectTypeDB::bind_method( "_edit_filters", &AnimationTreeEditor::_edit_filters);
- ObjectTypeDB::bind_method( "_filter_edited", &AnimationTreeEditor::_filter_edited);
+ ClassDB::bind_method( "_add_menu_item", &AnimationTreeEditor::_add_menu_item );
+ ClassDB::bind_method( "_node_menu_item", &AnimationTreeEditor::_node_menu_item );
+ ClassDB::bind_method( "_gui_input", &AnimationTreeEditor::_gui_input );
+ //ClassDB::bind_method( "_node_param_changed", &AnimationTreeEditor::_node_param_changed );
+ ClassDB::bind_method( "_scroll_moved", &AnimationTreeEditor::_scroll_moved );
+ ClassDB::bind_method( "_edit_dialog_changeds", &AnimationTreeEditor::_edit_dialog_changeds );
+ ClassDB::bind_method( "_edit_dialog_changede", &AnimationTreeEditor::_edit_dialog_changede );
+ ClassDB::bind_method( "_edit_dialog_changedf", &AnimationTreeEditor::_edit_dialog_changedf );
+ ClassDB::bind_method( "_edit_dialog_changed", &AnimationTreeEditor::_edit_dialog_changed );
+ ClassDB::bind_method( "_edit_dialog_animation_changed", &AnimationTreeEditor::_edit_dialog_animation_changed );
+ ClassDB::bind_method( "_edit_dialog_edit_animation", &AnimationTreeEditor::_edit_dialog_edit_animation );
+ ClassDB::bind_method( "_play_toggled", &AnimationTreeEditor::_play_toggled );
+ ClassDB::bind_method( "_edit_oneshot_start", &AnimationTreeEditor::_edit_oneshot_start );
+ ClassDB::bind_method( "_file_dialog_selected", &AnimationTreeEditor::_file_dialog_selected);
+ ClassDB::bind_method( "_master_anim_menu_item", &AnimationTreeEditor::_master_anim_menu_item);
+ ClassDB::bind_method( "_edit_filters", &AnimationTreeEditor::_edit_filters);
+ ClassDB::bind_method( "_filter_edited", &AnimationTreeEditor::_filter_edited);
}
@@ -1371,7 +1370,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
p->add_separator();
p->add_item(TTR("Clear"),MENU_GRAPH_CLEAR);
- p->connect("item_pressed", this,"_add_menu_item");
+ p->connect("id_pressed", this,"_add_menu_item");
play_button = memnew(Button);
play_button->set_pos(Point2(25,0));
@@ -1407,16 +1406,16 @@ AnimationTreeEditor::AnimationTreeEditor() {
master_anim_popup = memnew( PopupMenu );
add_child(master_anim_popup);
- master_anim_popup->connect("item_pressed",this,"_master_anim_menu_item");
+ master_anim_popup->connect("id_pressed",this,"_master_anim_menu_item");
- node_popup->connect("item_pressed", this,"_node_menu_item");
+ node_popup->connect("id_pressed", this,"_node_menu_item");
updating_edit=false;
edit_dialog = memnew( PopupPanel );
-// edit_dialog->get_ok()->hide();
-// edit_dialog->get_cancel()->hide();
+ //edit_dialog->get_ok()->hide();
+ //edit_dialog->get_cancel()->hide();
add_child(edit_dialog);
edit_option = memnew( OptionButton );
@@ -1464,7 +1463,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
file_dialog = memnew( EditorFileDialog );
file_dialog->set_enable_multiple_selection(true);
- file_dialog->set_current_dir(Globals::get_singleton()->get_resource_path());
+ file_dialog->set_current_dir(GlobalConfig::get_singleton()->get_resource_path());
add_child(file_dialog);
file_dialog->connect("file_selected", this, "_file_dialog_selected");
@@ -1474,7 +1473,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
filter = memnew( Tree );
filter_dialog->add_child(filter);
- filter_dialog->set_child_rect(filter);
+ //filter_dialog->set_child_rect(filter);
filter->connect("item_edited",this,"_filter_edited");
filter_button = memnew( Button );
@@ -1485,6 +1484,7 @@ AnimationTreeEditor::AnimationTreeEditor() {
filter_button->set_text(TTR("Filters.."));
filter_button->connect("pressed", this,"_edit_filters");
+ set_clip_contents(true);
}
@@ -1496,20 +1496,20 @@ void AnimationTreeEditorPlugin::edit(Object *p_object) {
bool AnimationTreeEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("AnimationTreePlayer");
+ return p_object->is_class("AnimationTreePlayer");
}
void AnimationTreeEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
-// editor->hide_animation_player_editors();
-// editor->animation_panel_make_visible(true);
+ //editor->hide_animation_player_editors();
+ //editor->animation_panel_make_visible(true);
button->show();
editor->make_bottom_panel_item_visible(anim_tree_editor);
anim_tree_editor->set_fixed_process(true);
} else {
- if (anim_tree_editor->is_visible())
+ if (anim_tree_editor->is_visible_in_tree())
editor->hide_bottom_panel();
button->hide();
anim_tree_editor->set_fixed_process(false);
diff --git a/tools/editor/plugins/animation_tree_editor_plugin.h b/tools/editor/plugins/animation_tree_editor_plugin.h
index 4884a22d90..253ad1878d 100644
--- a/tools/editor/plugins/animation_tree_editor_plugin.h
+++ b/tools/editor/plugins/animation_tree_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -42,7 +42,7 @@
class AnimationTreeEditor : public Control {
- OBJ_TYPE(AnimationTreeEditor, Control );
+ GDCLASS(AnimationTreeEditor, Control );
static const char* _node_type_names[];
@@ -160,7 +160,7 @@ class AnimationTreeEditor : public Control {
protected:
void _notification(int p_what);
- void _input_event(InputEvent p_event);
+ void _gui_input(InputEvent p_event);
static void _bind_methods();
public:
@@ -172,7 +172,7 @@ public:
class AnimationTreeEditorPlugin : public EditorPlugin {
- OBJ_TYPE( AnimationTreeEditorPlugin, EditorPlugin );
+ GDCLASS( AnimationTreeEditorPlugin, EditorPlugin );
AnimationTreeEditor *anim_tree_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp
index f43bec1cd3..0b12d080e4 100644
--- a/tools/editor/plugins/baked_light_baker.cpp
+++ b/tools/editor/plugins/baked_light_baker.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,7 +33,7 @@
#include "tools/editor/editor_node.h"
#include "tools/editor/editor_settings.h"
-
+#if 0
void baked_light_baker_add_64f(double *dst,double value);
void baked_light_baker_add_64i(int64_t *dst,int64_t value);
@@ -91,15 +91,15 @@ BakedLightBaker::MeshTexture* BakedLightBaker::_get_mat_tex(const Ref<Texture>&
if (image.empty())
return NULL;
- if (image.get_format()!=Image::FORMAT_RGBA) {
+ if (image.get_format()!=Image::FORMAT_RGBA8) {
if (image.get_format()>Image::FORMAT_INDEXED_ALPHA) {
Error err = image.decompress();
if (err)
return NULL;
}
- if (image.get_format()!=Image::FORMAT_RGBA)
- image.convert(Image::FORMAT_RGBA);
+ if (image.get_format()!=Image::FORMAT_RGBA8)
+ image.convert(Image::FORMAT_RGBA8);
}
if (imgtex->get_flags()&Texture::FLAG_CONVERT_TO_LINEAR) {
@@ -108,8 +108,8 @@ BakedLightBaker::MeshTexture* BakedLightBaker::_get_mat_tex(const Ref<Texture>&
image=copy;
}
- DVector<uint8_t> dvt=image.get_data();
- DVector<uint8_t>::Read r=dvt.read();
+ PoolVector<uint8_t> dvt=image.get_data();
+ PoolVector<uint8_t>::Read r=dvt.read();
MeshTexture mt;
mt.tex_w=image.get_width();
mt.tex_h=image.get_height();
@@ -143,18 +143,18 @@ void BakedLightBaker::_add_mesh(const Ref<Mesh>& p_mesh,const Ref<Material>& p_m
MeshMaterial mm;
- Ref<FixedMaterial> fm = mat;
+ Ref<FixedSpatialMaterial> fm = mat;
if (fm.is_valid()) {
//fixed route
- mm.diffuse.color=fm->get_parameter(FixedMaterial::PARAM_DIFFUSE);
+ mm.diffuse.color=fm->get_parameter(FixedSpatialMaterial::PARAM_DIFFUSE);
if (linear_color)
mm.diffuse.color=mm.diffuse.color.to_linear();
- mm.diffuse.tex=_get_mat_tex(fm->get_texture(FixedMaterial::PARAM_DIFFUSE));
- mm.specular.color=fm->get_parameter(FixedMaterial::PARAM_SPECULAR);
+ mm.diffuse.tex=_get_mat_tex(fm->get_texture(FixedSpatialMaterial::PARAM_DIFFUSE));
+ mm.specular.color=fm->get_parameter(FixedSpatialMaterial::PARAM_SPECULAR);
if (linear_color)
mm.specular.color=mm.specular.color.to_linear();
- mm.specular.tex=_get_mat_tex(fm->get_texture(FixedMaterial::PARAM_SPECULAR));
+ mm.specular.tex=_get_mat_tex(fm->get_texture(FixedSpatialMaterial::PARAM_SPECULAR));
} else {
mm.diffuse.color=Color(1,1,1,1);
@@ -194,14 +194,14 @@ void BakedLightBaker::_add_mesh(const Ref<Mesh>& p_mesh,const Ref<Material>& p_m
Array a = p_mesh->surface_get_arrays(i);
- DVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX];
- DVector<Vector3>::Read vr=vertices.read();
- DVector<Vector2> uv;
- DVector<Vector2>::Read uvr;
- DVector<Vector2> uv2;
- DVector<Vector2>::Read uv2r;
- DVector<Vector3> normal;
- DVector<Vector3>::Read normalr;
+ PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX];
+ PoolVector<Vector3>::Read vr=vertices.read();
+ PoolVector<Vector2> uv;
+ PoolVector<Vector2>::Read uvr;
+ PoolVector<Vector2> uv2;
+ PoolVector<Vector2>::Read uv2r;
+ PoolVector<Vector3> normal;
+ PoolVector<Vector3>::Read normalr;
bool read_uv=false;
bool read_normal=false;
@@ -236,8 +236,8 @@ void BakedLightBaker::_add_mesh(const Ref<Mesh>& p_mesh,const Ref<Material>& p_m
if (p_mesh->surface_get_format(i)&Mesh::ARRAY_FORMAT_INDEX) {
- DVector<int> indices = a[Mesh::ARRAY_INDEX];
- DVector<int>::Read ir = indices.read();
+ PoolVector<int> indices = a[Mesh::ARRAY_INDEX];
+ PoolVector<int>::Read ir = indices.read();
for(int i=0;i<facecount;i++) {
Triangle &t=triangles[tbase+i];
@@ -1006,8 +1006,10 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c
Triangle *triangle=NULL;
- //for(int i=0;i<max_depth;i++)
- // stack[i]=0;
+ /*
+ for(int i=0;i<max_depth;i++)
+ stack[i]=0;
+ */
int level=0;
//AABB ray_aabb;
@@ -1059,7 +1061,7 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c
bool valid = b.aabb.smits_intersect_ray(p_begin,n,0,len);
//bool valid = b.aabb.intersects_segment(p_begin,p_end);
- // bool valid = b.aabb.intersects(ray_aabb);
+ //bool valid = b.aabb.intersects(ray_aabb);
if (!valid) {
@@ -1234,7 +1236,7 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c
}
//specular later
-// _plot_light_point(r_point,octree,octree_aabb,p_light);
+ //_plot_light_point(r_point,octree,octree_aabb,p_light);
Color plot_light=res_light.linear_interpolate(diffuse_at_point,tint);
@@ -1678,7 +1680,7 @@ void BakedLightBaker::throw_rays(ThreadStack& thread_stack,int p_amount) {
dl.rays_thrown++;
baked_light_baker_add_64i(&total_rays,1);
_throw_ray(thread_stack,dl.bake_direct,from,to,dl.radius,col,dl.attenuation_table.ptr(),0,dl.radius,max_bounces,true);
-// _throw_ray(i,from,to,dl.radius,col,NULL,0,dl.radius,max_bounces,true);
+ //_throw_ray(i,from,to,dl.radius,col,NULL,0,dl.radius,max_bounces,true);
}
} break;
@@ -1710,7 +1712,7 @@ void BakedLightBaker::throw_rays(ThreadStack& thread_stack,int p_amount) {
dl.rays_thrown++;
baked_light_baker_add_64i(&total_rays,1);
_throw_ray(thread_stack,dl.bake_direct,from,to,dl.radius,col,dl.attenuation_table.ptr(),0,dl.radius,max_bounces,true);
- // _throw_ray(i,from,to,dl.radius,col,NULL,0,dl.radius,max_bounces,true);
+ //_throw_ray(i,from,to,dl.radius,col,NULL,0,dl.radius,max_bounces,true);
}
} break;
@@ -1788,7 +1790,7 @@ void BakedLightBaker::bake(const Ref<BakedLight> &p_light, Node* p_node) {
}
-void BakedLightBaker::update_octree_sampler(DVector<int> &p_sampler) {
+void BakedLightBaker::update_octree_sampler(PoolVector<int> &p_sampler) {
BakedLightBaker::Octant *octants=octant_pool.ptr();
double norm = 1.0/double(total_rays);
@@ -1845,7 +1847,7 @@ void BakedLightBaker::update_octree_sampler(DVector<int> &p_sampler) {
}
p_sampler.resize(tmp_smp.size());
- DVector<int>::Write w = p_sampler.write();
+ PoolVector<int>::Write w = p_sampler.write();
int ss = tmp_smp.size();
for(int i=0;i<ss;i++) {
w[i]=tmp_smp[i];
@@ -1859,7 +1861,7 @@ void BakedLightBaker::update_octree_sampler(DVector<int> &p_sampler) {
double mult = baked_light->get_energy_multiplier();
float saturation = baked_light->get_saturation();
- DVector<int>::Write w = p_sampler.write();
+ PoolVector<int>::Write w = p_sampler.write();
encode_uint32(octree_depth,(uint8_t*)&w[2]);
encode_uint32(linear_color,(uint8_t*)&w[3]);
@@ -1900,7 +1902,7 @@ void BakedLightBaker::update_octree_sampler(DVector<int> &p_sampler) {
}
-void BakedLightBaker::update_octree_images(DVector<uint8_t> &p_octree,DVector<uint8_t> &p_light) {
+void BakedLightBaker::update_octree_images(PoolVector<uint8_t> &p_octree,PoolVector<uint8_t> &p_light) {
int len = baked_octree_texture_w*baked_octree_texture_h*4;
@@ -1910,10 +1912,10 @@ void BakedLightBaker::update_octree_images(DVector<uint8_t> &p_octree,DVector<ui
p_light.resize(ilen);
- DVector<uint8_t>::Write w = p_octree.write();
+ PoolVector<uint8_t>::Write w = p_octree.write();
zeromem(w.ptr(),len);
- DVector<uint8_t>::Write iw = p_light.write();
+ PoolVector<uint8_t>::Write iw = p_light.write();
zeromem(iw.ptr(),ilen);
float gamma = baked_light->get_gamma_adjust();
@@ -2010,8 +2012,10 @@ void BakedLightBaker::update_octree_images(DVector<uint8_t> &p_octree,DVector<ui
//write colors
for(int j=0;j<8;j++) {
- //if (!oct.children[j])
- // continue;
+ /*
+ if (!oct.children[j])
+ continue;
+ */
uint8_t *iptr=&lptr[ofs+lchild_offsets[j]];
float r=oct.light_accum[j][0]*norm;
@@ -2291,7 +2295,7 @@ void BakedLightBaker::_plot_pixel_to_lightmap(int x, int y, int width, int heigh
bool valid = b.aabb.smits_intersect_ray(from,n,0,len);
//bool valid = b.aabb.intersects_segment(p_begin,p_end);
- // bool valid = b.aabb.intersects(ray_aabb);
+ //bool valid = b.aabb.intersects(ray_aabb);
if (!valid) {
@@ -2612,14 +2616,14 @@ Error BakedLightBaker::transfer_to_lightmaps() {
}
}
- DVector<uint8_t> dv;
+ PoolVector<uint8_t> dv;
dv.resize(baked_textures[i].data.size());
{
- DVector<uint8_t>::Write w = dv.write();
+ PoolVector<uint8_t>::Write w = dv.write();
copymem(w.ptr(),baked_textures[i].data.ptr(),baked_textures[i].data.size());
}
- Image img(baked_textures[i].width,baked_textures[i].height,0,Image::FORMAT_RGBA,dv);
+ Image img(baked_textures[i].width,baked_textures[i].height,0,Image::FORMAT_RGBA8,dv);
Ref<ImageTexture> tex = memnew( ImageTexture );
tex->create_from_image(img);
baked_light->set_lightmap_texture(i,tex);
@@ -2649,10 +2653,13 @@ void BakedLightBaker::clear() {
/*
* ???
for(int i=0;i<octant_pool.size();i++) {
- //if (octant_pool[i].leaf) {
- // memdelete_arr( octant_pool[i].light );
- //} Vector<double> norm_arr;
- //norm_arr.resize(lights.size());
+ /*
+ if (octant_pool[i].leaf) {
+ memdelete_arr( octant_pool[i].light );
+ }
+ Vector<double> norm_arr;
+ norm_arr.resize(lights.size());
+ */
for(int i=0;i<lights.size();i++) {
norm_arr[i] = 1.0/get_normalization(i);
@@ -2720,3 +2727,4 @@ BakedLightBaker::~BakedLightBaker() {
clear();
}
+#endif
diff --git a/tools/editor/plugins/baked_light_baker.h b/tools/editor/plugins/baked_light_baker.h
index d0fddf5563..89788338d9 100644
--- a/tools/editor/plugins/baked_light_baker.h
+++ b/tools/editor/plugins/baked_light_baker.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -34,6 +34,8 @@
#include "scene/3d/mesh_instance.h"
#include "os/thread.h"
+#if 0
+
class BakedLightBaker {
public:
@@ -43,10 +45,11 @@ public:
OCTANT_POOL_CHUNK=1000000
};
- //struct OctantLight {
-
- // double accum[8][3];
- //};
+ /*
+ struct OctantLight {
+ double accum[8][3];
+ };
+ */
struct Octant {
bool leaf;
@@ -362,8 +365,8 @@ public:
Error transfer_to_lightmaps();
- void update_octree_sampler(DVector<int> &p_sampler);
- void update_octree_images(DVector<uint8_t> &p_octree,DVector<uint8_t> &p_light);
+ void update_octree_sampler(PoolVector<int> &p_sampler);
+ void update_octree_images(PoolVector<uint8_t> &p_octree,PoolVector<uint8_t> &p_light);
Ref<BakedLight> get_baked_light() { return baked_light; }
@@ -375,3 +378,4 @@ public:
};
#endif // BAKED_LIGHT_BAKER_H
+#endif
diff --git a/tools/editor/plugins/baked_light_baker_cmpxchg.cpp b/tools/editor/plugins/baked_light_baker_cmpxchg.cpp
index c581995916..5e9228b7de 100644
--- a/tools/editor/plugins/baked_light_baker_cmpxchg.cpp
+++ b/tools/editor/plugins/baked_light_baker_cmpxchg.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/plugins/baked_light_editor_plugin.cpp b/tools/editor/plugins/baked_light_editor_plugin.cpp
index a58a0c25e2..26c3144188 100644
--- a/tools/editor/plugins/baked_light_editor_plugin.cpp
+++ b/tools/editor/plugins/baked_light_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,7 +33,7 @@
#include "io/resource_saver.h"
-
+#if 0
void BakedLightEditor::_end_baking() {
@@ -88,7 +88,7 @@ void BakedLightEditor::_notification(int p_option) {
float max_lum=0;
{
- DVector<Color>::Write cw=colors.write();
+ PoolVector<Color>::Write cw=colors.write();
BakedLightBaker::Octant *octants=baker->octant_pool.ptr();
BakedLightBaker::Octant *oct = &octants[baker->leaf_list];
int vert_idx=0;
@@ -105,8 +105,10 @@ void BakedLightEditor::_notification(int p_option) {
colors[i].b=oct->light_accum[i][2]/norm;
float lum = colors[i].get_v();
- //if (lum<0.05)
- // color.a=0;
+ /*
+ if (lum<0.05)
+ color.a=0;
+ */
if (lum>max_lum)
max_lum=lum;
@@ -141,11 +143,11 @@ void BakedLightEditor::_notification(int p_option) {
baker->update_octree_images(octree_texture,light_texture);
baker->update_octree_sampler(octree_sampler);
- // print_line("sampler size: "+itos(octree_sampler.size()*4));
+ //print_line("sampler size: "+itos(octree_sampler.size()*4));
#if 1
//debug
- Image img(baker->baked_octree_texture_w,baker->baked_octree_texture_h,0,Image::FORMAT_RGBA,octree_texture);
+ Image img(baker->baked_octree_texture_w,baker->baked_octree_texture_h,0,Image::FORMAT_RGBA8,octree_texture);
Ref<ImageTexture> it = memnew( ImageTexture );
it->create_from_image(img);
ResourceSaver::save("baked_octree.png",it);
@@ -283,10 +285,10 @@ void BakedLightEditor::_bake_lightmaps() {
void BakedLightEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_menu_option",&BakedLightEditor::_menu_option);
- ObjectTypeDB::bind_method("_bake_pressed",&BakedLightEditor::_bake_pressed);
- ObjectTypeDB::bind_method("_clear_pressed",&BakedLightEditor::_clear_pressed);
- ObjectTypeDB::bind_method("_bake_lightmaps",&BakedLightEditor::_bake_lightmaps);
+ ClassDB::bind_method("_menu_option",&BakedLightEditor::_menu_option);
+ ClassDB::bind_method("_bake_pressed",&BakedLightEditor::_bake_pressed);
+ ClassDB::bind_method("_clear_pressed",&BakedLightEditor::_clear_pressed);
+ ClassDB::bind_method("_bake_lightmaps",&BakedLightEditor::_bake_lightmaps);
}
BakedLightEditor::BakedLightEditor() {
@@ -373,3 +375,4 @@ BakedLightEditorPlugin::~BakedLightEditorPlugin()
}
+#endif
diff --git a/tools/editor/plugins/baked_light_editor_plugin.h b/tools/editor/plugins/baked_light_editor_plugin.h
index 4985d7513e..e311fe9f17 100644
--- a/tools/editor/plugins/baked_light_editor_plugin.h
+++ b/tools/editor/plugins/baked_light_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,19 +40,19 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
-
+#if 0
class MeshInstance;
class BakedLightEditor : public Control {
- OBJ_TYPE(BakedLightEditor, Control );
+ GDCLASS(BakedLightEditor, Control );
float update_timeout;
- DVector<uint8_t> octree_texture;
- DVector<uint8_t> light_texture;
- DVector<int> octree_sampler;
+ PoolVector<uint8_t> octree_texture;
+ PoolVector<uint8_t> light_texture;
+ PoolVector<int> octree_sampler;
BakedLightBaker *baker;
AcceptDialog *err_dialog;
@@ -97,7 +97,7 @@ public:
class BakedLightEditorPlugin : public EditorPlugin {
- OBJ_TYPE( BakedLightEditorPlugin, EditorPlugin );
+ GDCLASS( BakedLightEditorPlugin, EditorPlugin );
BakedLightEditor *baked_light_editor;
EditorNode *editor;
@@ -116,5 +116,5 @@ public:
};
#endif // MULTIMESH_EDITOR_PLUGIN_H
-
+#endif
diff --git a/tools/editor/plugins/camera_editor_plugin.cpp b/tools/editor/plugins/camera_editor_plugin.cpp
index 9c25de695c..1c8c392d65 100644
--- a/tools/editor/plugins/camera_editor_plugin.cpp
+++ b/tools/editor/plugins/camera_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -61,7 +61,7 @@ void CameraEditor::_pressed() {
void CameraEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_pressed"),&CameraEditor::_pressed);
+ ClassDB::bind_method(_MD("_pressed"),&CameraEditor::_pressed);
}
@@ -108,16 +108,14 @@ void CameraEditorPlugin::edit(Object *p_object) {
bool CameraEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("Camera");
+ return p_object->is_class("Camera");
}
void CameraEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
-// SpatialEditor::get_singleton()->set_can_preview(p_object->cast_to<Camera>());
-
+ //SpatialEditor::get_singleton()->set_can_preview(p_object->cast_to<Camera>());
} else {
-
SpatialEditor::get_singleton()->set_can_preview(NULL);
}
diff --git a/tools/editor/plugins/camera_editor_plugin.h b/tools/editor/plugins/camera_editor_plugin.h
index ea016ecb4d..7e79d0ec74 100644
--- a/tools/editor/plugins/camera_editor_plugin.h
+++ b/tools/editor/plugins/camera_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -39,7 +39,7 @@
class CameraEditor : public Control {
- OBJ_TYPE(CameraEditor, Control );
+ GDCLASS(CameraEditor, Control );
Panel *panel;
Button * preview;
@@ -58,9 +58,9 @@ public:
class CameraEditorPlugin : public EditorPlugin {
- OBJ_TYPE( CameraEditorPlugin, EditorPlugin );
+ GDCLASS( CameraEditorPlugin, EditorPlugin );
-// CameraEditor *camera_editor;
+ //CameraEditor *camera_editor;
EditorNode *editor;
public:
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index b0e002ba44..66dd98590d 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -32,13 +32,20 @@
#include "os/keyboard.h"
#include "scene/main/viewport.h"
#include "scene/main/canvas_layer.h"
-#include "scene/2d/node_2d.h"
+#include "scene/2d/sprite.h"
+#include "scene/2d/light_2d.h"
+#include "scene/2d/particles_2d.h"
+#include "scene/2d/polygon_2d.h"
+#include "scene/2d/screen_button.h"
#include "globals.h"
#include "os/input.h"
#include "tools/editor/editor_settings.h"
#include "scene/gui/grid_container.h"
+#include "scene/gui/patch_9_rect.h"
#include "tools/editor/animation_editor.h"
#include "tools/editor/plugins/animation_player_editor_plugin.h"
+#include "tools/editor/script_editor_debugger.h"
+#include "tools/editor/plugins/script_editor_plugin.h"
#include "scene/resources/packed_scene.h"
@@ -48,7 +55,7 @@
class SnapDialog : public ConfirmationDialog {
- OBJ_TYPE(SnapDialog,ConfirmationDialog);
+ GDCLASS(SnapDialog,ConfirmationDialog);
friend class CanvasItemEditor;
@@ -72,7 +79,7 @@ public:
container = memnew( VBoxContainer );
add_child(container);
- set_child_rect(container);
+ //set_child_rect(container);
child_container = memnew( GridContainer );
child_container->set_columns(3);
@@ -142,21 +149,21 @@ public:
}
void set_fields(const Point2 p_grid_offset, const Size2 p_grid_step, const float p_rotation_offset, const float p_rotation_step) {
- grid_offset_x->set_val(p_grid_offset.x);
- grid_offset_y->set_val(p_grid_offset.y);
- grid_step_x->set_val(p_grid_step.x);
- grid_step_y->set_val(p_grid_step.y);
- rotation_offset->set_val(p_rotation_offset * (180 / Math_PI));
- rotation_step->set_val(p_rotation_step * (180 / Math_PI));
+ grid_offset_x->set_value(p_grid_offset.x);
+ grid_offset_y->set_value(p_grid_offset.y);
+ grid_step_x->set_value(p_grid_step.x);
+ grid_step_y->set_value(p_grid_step.y);
+ rotation_offset->set_value(p_rotation_offset * (180 / Math_PI));
+ rotation_step->set_value(p_rotation_step * (180 / Math_PI));
}
void get_fields(Point2 &p_grid_offset, Size2 &p_grid_step, float &p_rotation_offset, float &p_rotation_step) {
- p_grid_offset.x = grid_offset_x->get_val();
- p_grid_offset.y = grid_offset_y->get_val();
- p_grid_step.x = grid_step_x->get_val();
- p_grid_step.y = grid_step_y->get_val();
- p_rotation_offset = rotation_offset->get_val() / (180 / Math_PI);
- p_rotation_step = rotation_step->get_val() / (180 / Math_PI);
+ p_grid_offset.x = grid_offset_x->get_value();
+ p_grid_offset.y = grid_offset_y->get_value();
+ p_grid_step.x = grid_step_x->get_value();
+ p_grid_step.y = grid_step_y->get_value();
+ p_rotation_offset = rotation_offset->get_value() / (180 / Math_PI);
+ p_rotation_step = rotation_step->get_value() / (180 / Math_PI);
}
};
@@ -172,7 +179,7 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) {
if (n2d && n2d->edit_has_pivot()) {
Vector2 offset = n2d->edit_get_pivot();
- Vector2 gpos = n2d->get_global_pos();
+ Vector2 gpos = n2d->get_global_position();
Vector2 local_mouse_pos = n2d->get_canvas_transform().affine_inverse().xform(mouse_pos);
@@ -187,8 +194,8 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) {
if (!n2dc)
continue;
- undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_pos());
- undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_pos());
+ undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_position());
+ undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_position());
}
@@ -202,7 +209,7 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) {
void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) {
- if (!is_visible() || get_viewport()->gui_has_modal_stack())
+ if (!is_visible_in_tree() || get_viewport()->gui_has_modal_stack())
return;
if (p_ev.key.mod.control)
@@ -279,8 +286,8 @@ Dictionary CanvasItemEditor::get_state() const {
Dictionary state;
state["zoom"]=zoom;
- state["ofs"]=Point2(h_scroll->get_val(),v_scroll->get_val());
-// state["ofs"]=-transform.get_origin();
+ state["ofs"]=Point2(h_scroll->get_value(),v_scroll->get_value());
+ //state["ofs"]=-transform.get_origin();
state["snap_offset"]=snap_offset;
state["snap_step"]=snap_step;
state["snap_rotation_offset"]=snap_rotation_offset;
@@ -303,8 +310,8 @@ void CanvasItemEditor::set_state(const Dictionary& p_state){
if (state.has("ofs")) {
_update_scrollbars(); // i wonder how safe is calling this here..
Point2 ofs=p_state["ofs"];
- h_scroll->set_val(ofs.x);
- v_scroll->set_val(ofs.y);
+ h_scroll->set_value(ofs.x);
+ v_scroll->set_value(ofs.y);
}
if (state.has("snap_step")) {
@@ -418,7 +425,7 @@ void CanvasItemEditor::_node_removed(Node *p_node) {
void CanvasItemEditor::_keying_changed() {
- if (AnimationPlayerEditor::singleton->get_key_editor()->is_visible())
+ if (AnimationPlayerEditor::singleton->get_key_editor()->is_visible_in_tree())
animation_hb->show();
else
animation_hb->hide();
@@ -433,7 +440,7 @@ bool CanvasItemEditor::_is_part_of_subscene(CanvasItem *p_item) {
}
// slow but modern computers should have no problem
-CanvasItem* CanvasItemEditor::_select_canvas_item_at_pos(const Point2& p_pos,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform) {
+CanvasItem* CanvasItemEditor::_select_canvas_item_at_pos(const Point2& p_pos,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform) {
if (!p_node)
return NULL;
@@ -458,7 +465,7 @@ CanvasItem* CanvasItemEditor::_select_canvas_item_at_pos(const Point2& p_pos,Nod
return r;
}
- if (c && c->is_visible() && !c->has_meta("_edit_lock_") && !_is_part_of_subscene(c) && !c->cast_to<CanvasLayer>()) {
+ if (c && c->is_visible_in_tree() && !c->has_meta("_edit_lock_") && !_is_part_of_subscene(c) && !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);
@@ -472,7 +479,7 @@ CanvasItem* CanvasItemEditor::_select_canvas_item_at_pos(const Point2& p_pos,Nod
return NULL;
}
-void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform, Vector<_SelectResult> &r_items) {
+void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform, Vector<_SelectResult> &r_items) {
if (!p_node)
return;
if (p_node->cast_to<Viewport>())
@@ -491,7 +498,7 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos,Node* p_nod
}
- if (c && c->is_visible() && !c->has_meta("_edit_lock_") && !c->cast_to<CanvasLayer>()) {
+ if (c && c->is_visible_in_tree() && !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);
@@ -512,7 +519,7 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos,Node* p_nod
return;
}
-void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2& p_rect,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform,List<CanvasItem*> *r_items) {
+void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2& p_rect,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform,List<CanvasItem*> *r_items) {
if (!p_node)
return;
@@ -522,21 +529,28 @@ void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2& p_rect,Node* p_no
CanvasItem *c=p_node->cast_to<CanvasItem>();
- for (int i=p_node->get_child_count()-1;i>=0;i--) {
-
- if (c && !c->is_set_as_toplevel())
- _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>();
- _find_canvas_items_at_rect(p_rect,p_node->get_child(i),transform,cl?cl->get_transform():p_canvas_xform,r_items);
+ bool inherited=p_node!=get_tree()->get_edited_scene_root() && p_node->get_filename()!="";
+ bool editable=false;
+ if (inherited){
+ editable=EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(p_node);
+ }
+ bool lock_children=p_node->has_meta("_edit_group_") && p_node->get_meta("_edit_group_");
+ if (!lock_children && (!inherited || editable)) {
+ for (int i=p_node->get_child_count()-1;i>=0;i--) {
+
+ if (c && !c->is_set_as_toplevel())
+ _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>();
+ _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_") && !c->cast_to<CanvasLayer>()) {
+ if (c && c->is_visible_in_tree() && !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();
+ Transform2D xform = p_parent_xform * p_canvas_xform * c->get_transform();
if ( p_rect.has_point( xform.xform( rect.pos ) ) &&
p_rect.has_point( xform.xform( rect.pos+Vector2(rect.size.x,0) ) ) &&
@@ -619,7 +633,7 @@ bool CanvasItemEditor::_select(CanvasItem *item, Point2 p_click_pos, bool p_appe
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
@@ -662,7 +676,7 @@ void CanvasItemEditor::_key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
@@ -694,11 +708,11 @@ void CanvasItemEditor::_key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE
if (Node2D *node_2d = canvas_item->cast_to<Node2D>()) {
if (p_move_mode == MOVE_LOCAL_WITH_ROT) {
- Matrix32 m;
- m.rotate( node_2d->get_rot() );
+ Transform2D m;
+ m.rotate( node_2d->get_rotation() );
drag = m.xform(drag);
}
- node_2d->set_pos(node_2d->get_pos() + drag);
+ node_2d->set_position(node_2d->get_position() + drag);
} else if (Control *control = canvas_item->cast_to<Control>()) {
@@ -724,7 +738,7 @@ Point2 CanvasItemEditor::_find_topleftmost_point() {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
@@ -733,7 +747,7 @@ Point2 CanvasItemEditor::_find_topleftmost_point() {
Rect2 rect=canvas_item->get_item_rect();
- Matrix32 xform=canvas_item->get_global_transform_with_canvas();
+ Transform2D xform=canvas_item->get_global_transform_with_canvas();
r2.expand_to(xform.xform(rect.pos));
r2.expand_to(xform.xform(rect.pos+Vector2(rect.size.x,0)));
@@ -755,7 +769,7 @@ int CanvasItemEditor::get_item_count() {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -777,7 +791,7 @@ CanvasItem *CanvasItemEditor::get_single_item() {
for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
@@ -791,15 +805,15 @@ CanvasItem *CanvasItemEditor::get_single_item() {
return single_item;
}
-CanvasItemEditor::DragType CanvasItemEditor::_find_drag_type(const Matrix32& p_xform, const Rect2& p_local_rect, const Point2& p_click, Vector2& r_point) {
+CanvasItemEditor::DragType CanvasItemEditor::_find_drag_type(const Transform2D& p_xform, const Rect2& p_local_rect, const Point2& p_click, Vector2& r_point) {
CanvasItem *canvas_item = get_single_item();
ERR_FAIL_COND_V(!canvas_item,DRAG_NONE);
Rect2 rect=canvas_item->get_item_rect();
- Matrix32 xforml=canvas_item->get_global_transform_with_canvas();
- Matrix32 xform=transform * xforml;
+ Transform2D xforml=canvas_item->get_global_transform_with_canvas();
+ Transform2D xform=transform * xforml;
Vector2 endpoints[4]={
@@ -947,7 +961,7 @@ void CanvasItemEditor::_dialog_value_changed(double) {
case ZOOM_SET: {
- zoom=dialog_val->get_val()/100.0;
+ zoom=dialog_val->get_value()/100.0;
_update_scroll(0);
viewport->update();
@@ -989,7 +1003,7 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton& b) {
if (!scene)
return;
- _find_canvas_items_at_pos(click, scene,transform,Matrix32(), selection_results);
+ _find_canvas_items_at_pos(click, scene,transform,Transform2D(), selection_results);
for(int i=0;i<selection_results.size();i++) {
CanvasItem *item=selection_results[i].item;
@@ -1026,7 +1040,7 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton& b) {
if (item->has_meta("_editor_icon"))
icon=item->get_meta("_editor_icon");
else
- icon=get_icon( has_icon(item->get_type(),"EditorIcons")?item->get_type():String("Object"),"EditorIcons");
+ icon=get_icon( has_icon(item->get_class(),"EditorIcons")?item->get_class():String("Object"),"EditorIcons");
String node_path="/"+root_name+"/"+root_path.rel_path_to(item->get_path());
@@ -1034,7 +1048,7 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton& b) {
selection_menu->set_item_icon(i, icon );
selection_menu->set_item_metadata(i, node_path);
selection_menu->set_item_tooltip(i,String(item->get_name())+
- "\nType: "+item->get_type()+"\nPath: "+node_path);
+ "\nType: "+item->get_class()+"\nPath: "+node_path);
}
additive_selection=b.mod.shift;
@@ -1050,7 +1064,7 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton& b) {
}
-void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
+void CanvasItemEditor::_viewport_gui_input(const InputEvent& p_event) {
{
@@ -1058,7 +1072,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
if (!over_plugin_list->empty()) {
- bool discard = over_plugin_list->forward_input_event(transform,p_event);
+ bool discard = over_plugin_list->forward_gui_input(transform,p_event);
if (discard) {
accept_event();
return;
@@ -1082,8 +1096,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
{
Point2 ofs(b.x,b.y);
ofs = ofs/prev_zoom - ofs/zoom;
- h_scroll->set_val( h_scroll->get_val() + ofs.x );
- v_scroll->set_val( v_scroll->get_val() + ofs.y );
+ h_scroll->set_value( h_scroll->get_value() + ofs.x );
+ v_scroll->set_value( v_scroll->get_value() + ofs.y );
}
_update_scroll(0);
viewport->update();
@@ -1100,8 +1114,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
{
Point2 ofs(b.x,b.y);
ofs = ofs/prev_zoom - ofs/zoom;
- h_scroll->set_val( h_scroll->get_val() + ofs.x );
- v_scroll->set_val( v_scroll->get_val() + ofs.y );
+ h_scroll->set_value( h_scroll->get_value() + ofs.x );
+ v_scroll->set_value( v_scroll->get_value() + ofs.y );
}
_update_scroll(0);
@@ -1138,7 +1152,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
@@ -1173,8 +1187,10 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
}
return;
}
- //if (!canvas_items.size())
- // return;
+ /*
+ if (!canvas_items.size())
+ return;
+ */
if (b.button_index==BUTTON_LEFT && tool==TOOL_LIST_SELECT) {
if (b.pressed)
@@ -1233,7 +1249,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
@@ -1281,7 +1297,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
if (bsfrom.y>bsto.y)
SWAP(bsfrom.y,bsto.y);
- _find_canvas_items_at_rect(Rect2(bsfrom,bsto-bsfrom),scene,transform,Matrix32(),&selitems);
+ _find_canvas_items_at_rect(Rect2(bsfrom,bsto-bsfrom),scene,transform,Transform2D(),&selitems);
for(List<CanvasItem*>::Element *E=selitems.front();E;E=E->next()) {
@@ -1303,7 +1319,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
{
bone_ik_list.clear();
float closest_dist=1e20;
- int bone_width = EditorSettings::get_singleton()->get("2d_editor/bone_width");
+ int bone_width = EditorSettings::get_singleton()->get("editors/2dbone_width");
for(Map<ObjectID,BoneList>::Element *E=bone_list.front();E;E=E->next()) {
if (E->get().from == E->get().to)
@@ -1341,7 +1357,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
if (!pi)
break;
- float len=pi->get_global_transform().get_origin().distance_to(b->get_global_pos());
+ float len=pi->get_global_transform().get_origin().distance_to(b->get_global_position());
b=pi->cast_to<Node2D>();
if (!b)
break;
@@ -1401,9 +1417,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
return;
}
- Matrix32 xform = transform * canvas_item->get_global_transform_with_canvas();
+ Transform2D xform = transform * canvas_item->get_global_transform_with_canvas();
Rect2 rect=canvas_item->get_item_rect();
- // float handle_radius = handle_len * 1.4144; //magic number, guess what it means!
+ //float handle_radius = handle_len * 1.4144; //magic number, guess what it means!
if (tool==TOOL_SELECT) {
drag = _find_drag_type(xform,rect,click,drag_point_from);
@@ -1444,7 +1460,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
@@ -1490,7 +1506,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
}
if (!c) {
- c =_select_canvas_item_at_pos(click, scene,transform,Matrix32());
+ c =_select_canvas_item_at_pos(click, scene,transform,Transform2D());
CanvasItem* cn = c;
@@ -1505,7 +1521,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
Node* n = c;
- while ((n && n != scene && n->get_owner() != scene) || (n && !n->is_type("CanvasItem"))) {
+ while ((n && n != scene && n->get_owner() != scene) || (n && !n->is_class("CanvasItem"))) {
n = n->get_parent();
};
c = n->cast_to<CanvasItem>();
@@ -1540,8 +1556,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
if ( (m.button_mask&BUTTON_MASK_LEFT && tool == TOOL_PAN) || m.button_mask&BUTTON_MASK_MIDDLE || (m.button_mask&BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE))) {
- h_scroll->set_val( h_scroll->get_val() - m.relative_x/zoom);
- v_scroll->set_val( v_scroll->get_val() - m.relative_y/zoom);
+ h_scroll->set_value( h_scroll->get_value() - m.relative_x/zoom);
+ v_scroll->set_value( v_scroll->get_value() - m.relative_y/zoom);
}
return;
@@ -1554,7 +1570,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
@@ -1587,10 +1603,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
if (node) {
- Matrix32 rot;
- rot.elements[1] = (dfrom - center).normalized();
- rot.elements[0] = rot.elements[1].tangent();
- node->set_rot(snap_angle(rot.xform_inv(dto-center).angle() + node->get_rot(), node->get_rot()));
+ real_t angle = node->get_rotation();
+ node->set_rotation(snap_angle( angle + (dfrom - center).angle_to(dto-center), angle ));
display_rotate_to = dto;
display_rotate_from = center;
viewport->update();
@@ -1602,10 +1616,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
if (node) {
- Matrix32 rot;
- rot.elements[1] = (dfrom - center).normalized();
- rot.elements[0] = rot.elements[1].tangent();
- node->set_rotation(snap_angle(rot.xform_inv(dto-center).angle() + node->get_rotation(), node->get_rotation()));
+ real_t angle = node->get_rotation();
+ node->set_rotation(snap_angle( angle + (dfrom - center).angle_to(dto-center), angle ));
display_rotate_to = dto;
display_rotate_from = center;
viewport->update();
@@ -1642,7 +1654,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
Vector2 minsize = canvas_item->edit_get_minimum_size();
if (uniform) {
- float aspect = local_rect.size.get_aspect();
+ float aspect = local_rect.size.aspect();
switch(drag) {
case DRAG_BOTTOM_LEFT:
case DRAG_TOP_RIGHT: {
@@ -1738,7 +1750,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
Node2D *n2d = canvas_item->cast_to<Node2D>();
- Matrix32 final_xform = bone_orig_xform;
+ Transform2D final_xform = bone_orig_xform;
@@ -1840,11 +1852,11 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
if (!E->prev()) {
//last goes to what it was
- final_xform.set_origin(n->get_global_pos());
+ final_xform.set_origin(n->get_global_position());
n->set_global_transform(final_xform);
} else {
- Vector2 rel = (E->prev()->get().node->get_global_pos() - n->get_global_pos()).normalized();
+ Vector2 rel = (E->prev()->get().node->get_global_position() - n->get_global_position()).normalized();
Vector2 rel2 = (E->prev()->get().pos - E->get().pos).normalized();
float rot = rel.angle_to(rel2);
if (n->get_global_transform().basis_determinant()<0) {
@@ -1910,7 +1922,7 @@ void CanvasItemEditor::_viewport_draw() {
if (snap_show_grid) {
Size2 s = viewport->get_size();
int last_cell;
- Matrix32 xform = transform.affine_inverse();
+ Transform2D xform = transform.affine_inverse();
if (snap_step.x!=0) {
for(int i=0;i<s.width;i++) {
@@ -1937,9 +1949,9 @@ void CanvasItemEditor::_viewport_draw() {
if (viewport->has_focus()) {
Size2 size = viewport->get_size();
- if (v_scroll->is_visible())
+ if (v_scroll->is_visible_in_tree())
size.width-=v_scroll->get_size().width;
- if (h_scroll->is_visible())
+ if (h_scroll->is_visible_in_tree())
size.height-=h_scroll->get_size().height;
get_stylebox("EditorFocus","EditorStyles")->draw(ci,Rect2(Point2(),size));
@@ -1948,7 +1960,6 @@ void CanvasItemEditor::_viewport_draw() {
Ref<Texture> lock = get_icon("Lock","EditorIcons");
Ref<Texture> group = get_icon("Group","EditorIcons");
- VisualServer::get_singleton()->canvas_item_set_clip(ci,true);
bool single = get_single_item()!=NULL;
@@ -1960,7 +1971,7 @@ void CanvasItemEditor::_viewport_draw() {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
@@ -1971,7 +1982,7 @@ void CanvasItemEditor::_viewport_draw() {
Rect2 rect=canvas_item->get_item_rect();
- Matrix32 xform=transform * canvas_item->get_global_transform_with_canvas();
+ Transform2D xform=transform * canvas_item->get_global_transform_with_canvas();
VisualServer::get_singleton()->canvas_item_add_set_transform(ci,xform);
Vector2 endpoints[4]={
@@ -1984,7 +1995,7 @@ void CanvasItemEditor::_viewport_draw() {
Color c = Color(1,0.6,0.4,0.7);
- VisualServer::get_singleton()->canvas_item_add_set_transform(ci,Matrix32());
+ VisualServer::get_singleton()->canvas_item_add_set_transform(ci,Transform2D());
for(int i=0;i<4;i++) {
viewport->draw_line(endpoints[i],endpoints[(i+1)%4],c,2);
@@ -2034,7 +2045,7 @@ void CanvasItemEditor::_viewport_draw() {
}
pivot_button->set_disabled(!pivot_found);
- VisualServer::get_singleton()->canvas_item_add_set_transform(ci,Matrix32());
+ VisualServer::get_singleton()->canvas_item_add_set_transform(ci,Transform2D());
@@ -2060,7 +2071,7 @@ void CanvasItemEditor::_viewport_draw() {
VisualServer::get_singleton()->canvas_item_add_line(ci,transform.xform(display_rotate_from), transform.xform(display_rotate_to),rotate_color);
}
- Size2 screen_size = Size2( Globals::get_singleton()->get("display/width"), Globals::get_singleton()->get("display/height") );
+ Size2 screen_size = Size2( GlobalConfig::get_singleton()->get("display/width"), GlobalConfig::get_singleton()->get("display/height") );
Vector2 screen_endpoints[4]= {
transform.xform(Vector2(0,0)),
@@ -2103,11 +2114,11 @@ void CanvasItemEditor::_viewport_draw() {
}
if (skeleton_show_bones) {
- int bone_width = EditorSettings::get_singleton()->get("2d_editor/bone_width");
- Color bone_color1 = EditorSettings::get_singleton()->get("2d_editor/bone_color1");
- Color bone_color2 = EditorSettings::get_singleton()->get("2d_editor/bone_color2");
- Color bone_ik_color = EditorSettings::get_singleton()->get("2d_editor/bone_ik_color");
- Color bone_selected_color = EditorSettings::get_singleton()->get("2d_editor/bone_selected_color");
+ int bone_width = EditorSettings::get_singleton()->get("editors/2dbone_width");
+ Color bone_color1 = EditorSettings::get_singleton()->get("editors/2dbone_color1");
+ Color bone_color2 = EditorSettings::get_singleton()->get("editors/2dbone_color2");
+ Color bone_ik_color = EditorSettings::get_singleton()->get("editors/2dbone_ik_color");
+ Color bone_selected_color = EditorSettings::get_singleton()->get("editors/2dbone_selected_color");
for(Map<ObjectID,BoneList>::Element*E=bone_list.front();E;E=E->next()) {
@@ -2133,8 +2144,8 @@ void CanvasItemEditor::_viewport_draw() {
if (!pn2d)
continue;
- Vector2 from = transform.xform(pn2d->get_global_pos());
- Vector2 to = transform.xform(n2d->get_global_pos());
+ Vector2 from = transform.xform(pn2d->get_global_position());
+ Vector2 to = transform.xform(n2d->get_global_position());
E->get().from=from;
E->get().to=to;
@@ -2189,7 +2200,7 @@ void CanvasItemEditor::_notification(int p_what) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -2206,7 +2217,7 @@ void CanvasItemEditor::_notification(int p_what) {
Rect2 r=canvas_item->get_item_rect();
- Matrix32 xform = canvas_item->get_transform();
+ Transform2D xform = canvas_item->get_transform();
if (r != se->prev_rect || xform!=se->prev_xform) {
viewport->update();
@@ -2217,7 +2228,7 @@ void CanvasItemEditor::_notification(int p_what) {
}
bool show_anchor = all_control && has_control;
- if (show_anchor != !anchor_menu->is_hidden()) {
+ if (show_anchor != anchor_menu->is_visible()) {
if (show_anchor)
anchor_menu->show();
else
@@ -2321,7 +2332,7 @@ void CanvasItemEditor::edit(CanvasItem *p_canvas_item) {
}
-void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2& r_rect, const Matrix32& p_xform) {
+void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2& r_rect, const Transform2D& p_xform) {
@@ -2333,12 +2344,12 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2& r_rect, cons
for (int i=p_node->get_child_count()-1;i>=0;i--) {
-// CanvasItem *r=NULL;
+ //CanvasItem *r=NULL;
if (c && !c->is_set_as_toplevel())
_find_canvas_items_span(p_node->get_child(i),r_rect,p_xform * c->get_transform());
else
- _find_canvas_items_span(p_node->get_child(i),r_rect,Matrix32());
+ _find_canvas_items_span(p_node->get_child(i),r_rect,Transform2D());
}
@@ -2346,7 +2357,7 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2& r_rect, cons
if (c) {
Rect2 rect = c->get_item_rect();
- Matrix32 xform = p_xform * c->get_transform();
+ Transform2D xform = p_xform * c->get_transform();
LockList lock;
@@ -2395,7 +2406,7 @@ void CanvasItemEditor::_update_scrollbars() {
h_scroll->set_end( Point2(size.width-vmin.width, size.height) );
- Size2 screen_rect = Size2( Globals::get_singleton()->get("display/width"), Globals::get_singleton()->get("display/height") );
+ Size2 screen_rect = Size2( GlobalConfig::get_singleton()->get("display/width"), GlobalConfig::get_singleton()->get("display/height") );
Rect2 local_rect = Rect2(Point2(),viewport->get_size()-Size2(vmin.width,hmin.height));
@@ -2407,7 +2418,7 @@ void CanvasItemEditor::_update_scrollbars() {
if (editor->get_edited_scene())
- _find_canvas_items_span(editor->get_edited_scene(),canvas_item_rect,Matrix32());
+ _find_canvas_items_span(editor->get_edited_scene(),canvas_item_rect,Transform2D());
List<Map<ObjectID,BoneList>::Element*> bone_to_erase;
@@ -2442,13 +2453,13 @@ void CanvasItemEditor::_update_scrollbars() {
v_scroll->set_page(local_rect.size.y/zoom);
if (first_update) {
//so 0,0 is visible
- v_scroll->set_val(-10);
- h_scroll->set_val(-10);
+ v_scroll->set_value(-10);
+ h_scroll->set_value(-10);
first_update=false;
}
- ofs.y=v_scroll->get_val();
+ ofs.y=v_scroll->get_value();
}
if (canvas_item_rect.size.width <= (local_rect.size.x/zoom)) {
@@ -2461,17 +2472,17 @@ void CanvasItemEditor::_update_scrollbars() {
h_scroll->set_min(canvas_item_rect.pos.x);
h_scroll->set_max(canvas_item_rect.pos.x+canvas_item_rect.size.x);
h_scroll->set_page(local_rect.size.x/zoom);
- ofs.x=h_scroll->get_val();
+ ofs.x=h_scroll->get_value();
}
-// transform=Matrix32();
+ //transform=Matrix32();
transform.elements[2]=-ofs*zoom;
editor->get_scene_root()->set_global_canvas_transform(transform);
updating_scroll=false;
-// transform.scale_basis(Vector2(zoom,zoom));
+ //transform.scale_basis(Vector2(zoom,zoom));
}
@@ -2483,12 +2494,12 @@ void CanvasItemEditor::_update_scroll(float) {
return;
Point2 ofs;
- ofs.x=h_scroll->get_val();
- ofs.y=v_scroll->get_val();
+ ofs.x=h_scroll->get_value();
+ ofs.y=v_scroll->get_value();
-// current_window->set_scroll(-ofs);
+ //current_window->set_scroll(-ofs);
- transform=Matrix32();
+ transform=Transform2D();
transform.scale_basis(Size2(zoom,zoom));
transform.elements[2]=-ofs;
@@ -2597,7 +2608,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
dialog_val->set_min(0.1);
dialog_val->set_step(0.1);
dialog_val->set_max(800);
- dialog_val->set_val(zoom*100);
+ dialog_val->set_value(zoom*100);
value_dialog->popup_centered(Size2(200,85));
updating_value_dialog=false;
@@ -2610,7 +2621,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -2628,7 +2639,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -2649,7 +2660,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -2667,7 +2678,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -2688,7 +2699,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -2809,7 +2820,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -2819,9 +2830,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
Node2D *n2d = canvas_item->cast_to<Node2D>();
if (key_pos)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/pos",n2d->get_pos(),existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/pos",n2d->get_position(),existing);
if (key_rot)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/rot",Math::rad2deg(n2d->get_rot()),existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/rot",Math::rad2deg(n2d->get_rotation()),existing);
if (key_scale)
AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/scale",n2d->get_scale(),existing);
@@ -2851,9 +2862,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(List<Node2D*>::Element *F=ik_chain.front();F;F=F->next()) {
if (key_pos)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/pos",F->get()->get_pos(),existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/pos",F->get()->get_position(),existing);
if (key_rot)
- AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/rot",Math::rad2deg(F->get()->get_rot()),existing);
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/rot",Math::rad2deg(F->get()->get_rotation()),existing);
if (key_scale)
AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/scale",F->get()->get_scale(),existing);
@@ -2922,7 +2933,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -2933,8 +2944,8 @@ void CanvasItemEditor::_popup_callback(int p_op) {
Node2D *n2d = canvas_item->cast_to<Node2D>();
PoseClipboard pc;
- pc.pos=n2d->get_pos();
- pc.rot=n2d->get_rot();
+ pc.pos=n2d->get_position();
+ pc.rot=n2d->get_rotation();
pc.scale=n2d->get_scale();
pc.id=n2d->get_instance_ID();
pose_clipboard.push_back(pc);
@@ -2960,8 +2971,8 @@ void CanvasItemEditor::_popup_callback(int p_op) {
undo_redo->add_do_method(n2d,"set_pos",E->get().pos);
undo_redo->add_do_method(n2d,"set_rot",E->get().rot);
undo_redo->add_do_method(n2d,"set_scale",E->get().scale);
- undo_redo->add_undo_method(n2d,"set_pos",n2d->get_pos());
- undo_redo->add_undo_method(n2d,"set_rot",n2d->get_rot());
+ undo_redo->add_undo_method(n2d,"set_pos",n2d->get_position());
+ undo_redo->add_undo_method(n2d,"set_rot",n2d->get_rotation());
undo_redo->add_undo_method(n2d,"set_scale",n2d->get_scale());
}
undo_redo->commit_action();
@@ -2974,7 +2985,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -2984,9 +2995,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
Node2D *n2d = canvas_item->cast_to<Node2D>();
if (key_pos)
- n2d->set_pos(Vector2());
+ n2d->set_position(Vector2());
if (key_rot)
- n2d->set_rot(0);
+ n2d->set_rotation(0);
if (key_scale)
n2d->set_scale(Vector2(1,1));
} else if (canvas_item->cast_to<Control>()) {
@@ -2995,8 +3006,10 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (key_pos)
ctrl->set_pos(Point2());
- //if (key_scale)
- // AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size());
+ /*
+ if (key_scale)
+ AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size());
+ */
}
}
@@ -3020,7 +3033,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
Node2D *n2d = E->key()->cast_to<Node2D>();
if (!n2d)
continue;
- if (!n2d->is_visible())
+ if (!n2d->is_visible_in_tree())
continue;
if (!n2d->get_parent_item())
continue;
@@ -3042,7 +3055,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
Node2D *n2d = E->key()->cast_to<Node2D>();
if (!n2d)
continue;
- if (!n2d->is_visible())
+ if (!n2d->is_visible_in_tree())
continue;
n2d->set_meta("_edit_bone_",Variant());
@@ -3060,7 +3073,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
- if (!canvas_item || !canvas_item->is_visible())
+ if (!canvas_item || !canvas_item->is_visible_in_tree())
continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
@@ -3084,7 +3097,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
CanvasItem *n2d = E->key()->cast_to<CanvasItem>();
if (!n2d)
continue;
- if (!n2d->is_visible())
+ if (!n2d->is_visible_in_tree())
continue;
n2d->set_meta("_edit_ik_",Variant());
@@ -3142,7 +3155,7 @@ void CanvasItemEditor::_focus_selection(int p_op) {
// counting invisible items, for now
- //if (!canvas_item->is_visible()) continue;
+ //if (!canvas_item->is_visible_in_tree()) continue;
++count;
Rect2 item_rect = canvas_item->get_item_rect();
@@ -3151,7 +3164,7 @@ void CanvasItemEditor::_focus_selection(int p_op) {
Vector2 scale = canvas_item->get_global_transform().get_scale();
real_t angle = canvas_item->get_global_transform().get_rotation();
- Matrix32 t(angle, Vector2(0.f,0.f));
+ Transform2D t(angle, Vector2(0.f,0.f));
item_rect = t.xform(item_rect);
Rect2 canvas_item_rect(pos + scale*item_rect.pos, scale*item_rect.size);
if (count == 1) {
@@ -3166,8 +3179,8 @@ void CanvasItemEditor::_focus_selection(int p_op) {
center = rect.pos + rect.size/2;
Vector2 offset = viewport->get_size()/2 - editor->get_scene_root()->get_global_canvas_transform().xform(center);
- h_scroll->set_val(h_scroll->get_val() - offset.x/zoom);
- v_scroll->set_val(v_scroll->get_val() - offset.y/zoom);
+ h_scroll->set_value(h_scroll->get_value() - offset.x/zoom);
+ v_scroll->set_value(v_scroll->get_value() - offset.y/zoom);
} else { // VIEW_FRAME_TO_SELECTION
@@ -3185,20 +3198,20 @@ void CanvasItemEditor::_focus_selection(int p_op) {
void CanvasItemEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_node_removed",&CanvasItemEditor::_node_removed);
- ObjectTypeDB::bind_method("_update_scroll",&CanvasItemEditor::_update_scroll);
- ObjectTypeDB::bind_method("_popup_callback",&CanvasItemEditor::_popup_callback);
- ObjectTypeDB::bind_method("_visibility_changed",&CanvasItemEditor::_visibility_changed);
- ObjectTypeDB::bind_method("_dialog_value_changed",&CanvasItemEditor::_dialog_value_changed);
- ObjectTypeDB::bind_method("_get_editor_data",&CanvasItemEditor::_get_editor_data);
- ObjectTypeDB::bind_method("_tool_select",&CanvasItemEditor::_tool_select);
- ObjectTypeDB::bind_method("_keying_changed",&CanvasItemEditor::_keying_changed);
- ObjectTypeDB::bind_method("_unhandled_key_input",&CanvasItemEditor::_unhandled_key_input);
- ObjectTypeDB::bind_method("_viewport_draw",&CanvasItemEditor::_viewport_draw);
- ObjectTypeDB::bind_method("_viewport_input_event",&CanvasItemEditor::_viewport_input_event);
- ObjectTypeDB::bind_method("_snap_changed",&CanvasItemEditor::_snap_changed);
- ObjectTypeDB::bind_method(_MD("_selection_result_pressed"),&CanvasItemEditor::_selection_result_pressed);
- ObjectTypeDB::bind_method(_MD("_selection_menu_hide"),&CanvasItemEditor::_selection_menu_hide);
+ ClassDB::bind_method("_node_removed",&CanvasItemEditor::_node_removed);
+ ClassDB::bind_method("_update_scroll",&CanvasItemEditor::_update_scroll);
+ ClassDB::bind_method("_popup_callback",&CanvasItemEditor::_popup_callback);
+ ClassDB::bind_method("_visibility_changed",&CanvasItemEditor::_visibility_changed);
+ ClassDB::bind_method("_dialog_value_changed",&CanvasItemEditor::_dialog_value_changed);
+ ClassDB::bind_method("_get_editor_data",&CanvasItemEditor::_get_editor_data);
+ ClassDB::bind_method("_tool_select",&CanvasItemEditor::_tool_select);
+ ClassDB::bind_method("_keying_changed",&CanvasItemEditor::_keying_changed);
+ ClassDB::bind_method("_unhandled_key_input",&CanvasItemEditor::_unhandled_key_input);
+ ClassDB::bind_method("_viewport_draw",&CanvasItemEditor::_viewport_draw);
+ ClassDB::bind_method("_viewport_gui_input",&CanvasItemEditor::_viewport_gui_input);
+ ClassDB::bind_method("_snap_changed",&CanvasItemEditor::_snap_changed);
+ ClassDB::bind_method(_MD("_selection_result_pressed"),&CanvasItemEditor::_selection_result_pressed);
+ ClassDB::bind_method(_MD("_selection_menu_hide"),&CanvasItemEditor::_selection_menu_hide);
ADD_SIGNAL( MethodInfo("item_lock_status_changed") );
ADD_SIGNAL( MethodInfo("item_group_status_changed") );
@@ -3320,15 +3333,17 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
vp_base->set_v_size_flags(SIZE_EXPAND_FILL);
palette_split->add_child(vp_base);
- Control *vp = memnew (Control);
+ ViewportContainer *vp = memnew (ViewportContainer);
+ vp->set_stretch(true);
vp_base->add_child(vp);
vp->set_area_as_parent_rect();
vp->add_child(p_editor->get_scene_root());
- viewport = memnew( Control );
+ viewport = memnew( CanvasItemEditorViewport(p_editor, this) );
vp_base->add_child(viewport);
viewport->set_area_as_parent_rect();
+ viewport->set_clip_contents(true);
h_scroll = memnew( HScrollBar );
v_scroll = memnew( VScrollBar );
@@ -3336,7 +3351,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
viewport->add_child(h_scroll);
viewport->add_child(v_scroll);
viewport->connect("draw",this,"_viewport_draw");
- viewport->connect("input_event",this,"_viewport_input_event");
+ viewport->connect("gui_input",this,"_viewport_gui_input");
h_scroll->connect("value_changed", this,"_update_scroll",Vector<Variant>(),true);
@@ -3421,7 +3436,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
edit_menu = memnew( MenuButton );
edit_menu->set_text(TTR("Edit"));
hb->add_child(edit_menu);
- edit_menu->get_popup()->connect("item_pressed", this,"_popup_callback");
+ edit_menu->get_popup()->connect("id_pressed", this,"_popup_callback");
PopupMenu *p;
p = edit_menu->get_popup();
@@ -3446,7 +3461,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
skeleton_menu->add_separator();
skeleton_menu->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_set_ik_chain", TTR("Make IK Chain")), SKELETON_SET_IK_CHAIN);
skeleton_menu->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_ik_chain", TTR("Clear IK Chain")), SKELETON_CLEAR_IK_CHAIN);
- skeleton_menu->connect("item_pressed", this,"_popup_callback");
+ skeleton_menu->connect("id_pressed", this,"_popup_callback");
/*
@@ -3458,7 +3473,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
view_menu = memnew( MenuButton );
view_menu->set_text(TTR("View"));
hb->add_child(view_menu);
- view_menu->get_popup()->connect("item_pressed", this,"_popup_callback");
+ view_menu->get_popup()->connect("id_pressed", this,"_popup_callback");
p = view_menu->get_popup();
@@ -3473,7 +3488,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
anchor_menu = memnew( MenuButton );
anchor_menu->set_text(TTR("Anchor"));
hb->add_child(anchor_menu);
- anchor_menu->get_popup()->connect("item_pressed", this,"_popup_callback");
+ anchor_menu->get_popup()->connect("id_pressed", this,"_popup_callback");
anchor_menu->hide();
//p = anchor_menu->get_popup();
@@ -3519,7 +3534,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
animation_menu = memnew( MenuButton );
animation_menu->set_text(TTR("Animation"));
animation_hb->add_child(animation_menu);
- animation_menu->get_popup()->connect("item_pressed", this,"_popup_callback");
+ animation_menu->get_popup()->connect("id_pressed", this,"_popup_callback");
p = animation_menu->get_popup();
@@ -3556,7 +3571,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
selection_menu = memnew( PopupMenu );
add_child(selection_menu);
selection_menu->set_custom_minimum_size(Vector2(100, 0));
- selection_menu->connect("item_pressed", this, "_selection_result_pressed");
+ selection_menu->connect("id_pressed", this, "_selection_result_pressed");
selection_menu->connect("popup_hide", this, "_selection_menu_hide");
key_pos=true;
@@ -3596,7 +3611,7 @@ void CanvasItemEditorPlugin::edit(Object *p_object) {
bool CanvasItemEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("CanvasItem");
+ return p_object->is_class("CanvasItem");
}
void CanvasItemEditorPlugin::make_visible(bool p_visible) {
@@ -3604,14 +3619,14 @@ void CanvasItemEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
canvas_item_editor->show();
canvas_item_editor->set_fixed_process(true);
- VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport(),false);
+ VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(),false);
canvas_item_editor->viewport->grab_focus();
} else {
canvas_item_editor->hide();
canvas_item_editor->set_fixed_process(false);
- VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport(),true);
+ VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(),true);
}
}
@@ -3642,3 +3657,405 @@ CanvasItemEditorPlugin::~CanvasItemEditorPlugin()
}
+void CanvasItemEditorViewport::_on_mouse_exit() {
+ if (!selector->is_visible()){
+ _remove_preview();
+ }
+}
+
+void CanvasItemEditorViewport::_on_select_type(Object* selected) {
+ CheckBox* check = selected->cast_to<CheckBox>();
+ String type = check->get_text();
+ selector_label->set_text(vformat(TTR("Add %s"),type));
+ label->set_text(vformat(TTR("Adding %s..."),type));
+}
+
+void CanvasItemEditorViewport::_on_change_type() {
+ if (!button_group->get_pressed_button())
+ return;
+
+ CheckBox* check=button_group->get_pressed_button()->cast_to<CheckBox>();
+ default_type=check->get_text();
+ _perform_drop_data();
+ selector->hide();
+}
+
+void CanvasItemEditorViewport::_create_preview(const Vector<String>& files) const {
+ label->set_pos(get_global_pos()+Point2(14,14));
+ label_desc->set_pos(label->get_pos()+Point2(0,label->get_size().height));
+ for (int i=0;i<files.size();i++) {
+ String path=files[i];
+ RES res=ResourceLoader::load(path);
+ String type=res->get_class();
+ if (type=="ImageTexture" || type=="PackedScene") {
+ if (type=="ImageTexture") {
+ Ref<ImageTexture> texture=Ref<ImageTexture> ( ResourceCache::get(path)->cast_to<ImageTexture>() );
+ Sprite* sprite=memnew(Sprite);
+ sprite->set_texture(texture);
+ sprite->set_modulate(Color(1,1,1,0.7f));
+ preview->add_child(sprite);
+ label->show();
+ label_desc->show();
+ } else if (type=="PackedScene") {
+ Ref<PackedScene> scn=ResourceLoader::load(path);
+ if (scn.is_valid()){
+ Node* instance=scn->instance();
+ if (instance){
+ preview->add_child(instance);
+ }
+ }
+ }
+ editor->get_scene_root()->add_child(preview);
+ }
+ }
+}
+
+void CanvasItemEditorViewport::_remove_preview() {
+ if (preview->get_parent()){
+ editor->get_scene_root()->remove_child(preview);
+ for (int i=preview->get_child_count()-1;i>=0;i--){
+ Node* node=preview->get_child(i);
+ memdelete(node);
+ }
+ label->hide();
+ label_desc->hide();
+ }
+}
+
+bool CanvasItemEditorViewport::_cyclical_dependency_exists(const String& p_target_scene_path, Node* p_desired_node) {
+ if (p_desired_node->get_filename()==p_target_scene_path) {
+ return true;
+ }
+
+ int childCount=p_desired_node->get_child_count();
+ for (int i=0;i<childCount;i++) {
+ Node* child=p_desired_node->get_child(i);
+ if(_cyclical_dependency_exists(p_target_scene_path,child)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void CanvasItemEditorViewport::_create_nodes(Node* parent, Node* child, String& path, const Point2& p_point) {
+ child->set_name(path.get_file().get_basename());
+ Ref<ImageTexture> texture=Ref<ImageTexture> ( ResourceCache::get(path)->cast_to<ImageTexture>() );
+ Size2 texture_size = texture->get_size();
+
+ editor_data->get_undo_redo().add_do_method(parent,"add_child",child);
+ editor_data->get_undo_redo().add_do_method(child,"set_owner",editor->get_edited_scene());
+ editor_data->get_undo_redo().add_do_reference(child);
+ editor_data->get_undo_redo().add_undo_method(parent,"remove_child",child);
+
+ String new_name=parent->validate_child_name(child);
+ ScriptEditorDebugger *sed=ScriptEditor::get_singleton()->get_debugger();
+ editor_data->get_undo_redo().add_do_method(sed,"live_debug_create_node",editor->get_edited_scene()->get_path_to(parent),child->get_class(),new_name);
+ editor_data->get_undo_redo().add_undo_method(sed,"live_debug_remove_node",NodePath(String(editor->get_edited_scene()->get_path_to(parent))+"/"+new_name));
+
+ // handle with different property for texture
+ String property = "texture";
+ List<PropertyInfo> props;
+ child->get_property_list(&props);
+ for(const List<PropertyInfo>::Element *E=props.front();E;E=E->next() ) {
+ if (E->get().name=="config/texture") { // Particles2D
+ property="config/texture";
+ break;
+ } else if (E->get().name=="texture/texture") { // Polygon2D
+ property="texture/texture";
+ break;
+ } else if (E->get().name=="normal") { // TouchScreenButton
+ property="normal";
+ break;
+ }
+ }
+ editor_data->get_undo_redo().add_do_property(child,property,texture);
+
+ // make visible for certain node type
+ if (default_type=="Patch9Rect") {
+ editor_data->get_undo_redo().add_do_property(child,"rect/size",texture_size);
+ } else if (default_type=="Polygon2D") {
+ PoolVector<Vector2> list;
+ list.push_back(Vector2(0,0));
+ list.push_back(Vector2(texture_size.width,0));
+ list.push_back(Vector2(texture_size.width,texture_size.height));
+ list.push_back(Vector2(0,texture_size.height));
+ editor_data->get_undo_redo().add_do_property(child,"polygon",list);
+ }
+
+ // locate at preview position
+ Point2 pos;
+ if (parent->has_method("get_global_pos")) {
+ pos=parent->call("get_global_pos");
+ }
+ Transform2D trans=canvas->get_canvas_transform();
+ Point2 target_pos = (p_point-trans.get_origin())/trans.get_scale().x-pos;
+ if (default_type=="Polygon2D" || default_type=="TouchScreenButton" || default_type=="TextureRect" || default_type=="Patch9Rect") {
+ target_pos -= texture_size/2;
+ }
+ editor_data->get_undo_redo().add_do_method(child,"set_pos",target_pos);
+}
+
+bool CanvasItemEditorViewport::_create_instance(Node* parent, String& path, const Point2& p_point) {
+ Ref<PackedScene> sdata=ResourceLoader::load(path);
+ if (!sdata.is_valid()) { // invalid scene
+ return false;
+ }
+
+ Node* instanced_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
+ if (!instanced_scene) { // error on instancing
+ return false;
+ }
+
+ if (editor->get_edited_scene()->get_filename()!="") { // cyclical instancing
+ if (_cyclical_dependency_exists(editor->get_edited_scene()->get_filename(), instanced_scene)) {
+ memdelete(instanced_scene);
+ return false;
+ }
+ }
+
+ instanced_scene->set_filename( GlobalConfig::get_singleton()->localize_path(path) );
+
+ editor_data->get_undo_redo().add_do_method(parent,"add_child",instanced_scene);
+ editor_data->get_undo_redo().add_do_method(instanced_scene,"set_owner",editor->get_edited_scene());
+ editor_data->get_undo_redo().add_do_reference(instanced_scene);
+ editor_data->get_undo_redo().add_undo_method(parent,"remove_child",instanced_scene);
+
+ String new_name=parent->validate_child_name(instanced_scene);
+ ScriptEditorDebugger *sed=ScriptEditor::get_singleton()->get_debugger();
+ editor_data->get_undo_redo().add_do_method(sed,"live_debug_instance_node",editor->get_edited_scene()->get_path_to(parent),path,new_name);
+ editor_data->get_undo_redo().add_undo_method(sed,"live_debug_remove_node",NodePath(String(editor->get_edited_scene()->get_path_to(parent))+"/"+new_name));
+
+ Point2 pos;
+ Node2D* parent_node2d=parent->cast_to<Node2D>();
+ if (parent_node2d) {
+ pos=parent_node2d->get_global_position();
+ } else {
+ Control* parent_control=parent->cast_to<Control>();
+ if (parent_control) {
+ pos=parent_control->get_global_pos();
+ }
+ }
+ Transform2D trans=canvas->get_canvas_transform();
+ editor_data->get_undo_redo().add_do_method(instanced_scene,"set_pos",(p_point-trans.get_origin())/trans.get_scale().x-pos);
+
+ return true;
+}
+
+void CanvasItemEditorViewport::_perform_drop_data(){
+ _remove_preview();
+
+ Vector<String> error_files;
+
+ editor_data->get_undo_redo().create_action(TTR("Create Node"));
+
+ for (int i=0;i<selected_files.size();i++) {
+ String path=selected_files[i];
+ RES res=ResourceLoader::load(path);
+ if (res.is_null()) {
+ continue;
+ }
+ String type=res->get_class();
+ if (type=="ImageTexture") {
+ Node* child;
+ if (default_type=="Light2D") child=memnew(Light2D);
+ else if (default_type=="Particles2D") child=memnew(Particles2D);
+ else if (default_type=="Polygon2D") child=memnew(Polygon2D);
+ else if (default_type=="TouchScreenButton") child=memnew(TouchScreenButton);
+ else if (default_type=="TextureRect") child=memnew(TextureRect);
+ else if (default_type=="Patch9Rect") child=memnew(NinePatchRect);
+ else child=memnew(Sprite); // default
+
+ _create_nodes(target_node, child, path, drop_pos);
+ } else if (type=="PackedScene") {
+ bool success=_create_instance(target_node, path, drop_pos);
+ if (!success) {
+ error_files.push_back(path);
+ }
+ }
+ }
+
+ editor_data->get_undo_redo().commit_action();
+
+ if (error_files.size()>0) {
+ String files_str;
+ for (int i=0;i<error_files.size();i++) {
+ files_str += error_files[i].get_file().get_basename() + ",";
+ }
+ files_str=files_str.substr(0,files_str.length()-1);
+ accept->get_ok()->set_text(TTR("Ugh"));
+ accept->set_text(vformat(TTR("Error instancing scene from %s"),files_str.c_str()));
+ accept->popup_centered_minsize();
+ }
+}
+
+bool CanvasItemEditorViewport::can_drop_data(const Point2& p_point,const Variant& p_data) const {
+ Dictionary d=p_data;
+ if (d.has("type")) {
+ if (String(d["type"])=="files") {
+ Vector<String> files=d["files"];
+ bool can_instance=false;
+ for (int i=0;i<files.size();i++) { // check if dragged files contain resource or scene can be created at least one
+ RES res=ResourceLoader::load(files[i]);
+ if (res.is_null()) {
+ continue;
+ }
+ String type=res->get_class();
+ if (type=="PackedScene") {
+ Ref<PackedScene> sdata=ResourceLoader::load(files[i]);
+ Node* instanced_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
+ if (!instanced_scene) {
+ continue;
+ }
+ memdelete(instanced_scene);
+ }
+ can_instance=true;
+ break;
+ }
+ if (can_instance) {
+ if (!preview->get_parent()){ // create preview only once
+ _create_preview(files);
+ }
+ Transform2D trans=canvas->get_canvas_transform();
+ preview->set_position((p_point-trans.get_origin())/trans.get_scale().x);
+ label->set_text(vformat(TTR("Adding %s..."),default_type));
+ }
+ return can_instance;
+ }
+ }
+ label->hide();
+ return false;
+}
+
+void CanvasItemEditorViewport::drop_data(const Point2& p_point,const Variant& p_data) {
+ bool is_shift=Input::get_singleton()->is_key_pressed(KEY_SHIFT);
+ bool is_alt=Input::get_singleton()->is_key_pressed(KEY_ALT);
+
+ selected_files.clear();
+ Dictionary d=p_data;
+ if (d.has("type") && String(d["type"])=="files"){
+ selected_files=d["files"];
+ }
+
+ List<Node*> list=editor->get_editor_selection()->get_selected_node_list();
+ if (list.size()==0) {
+ accept->get_ok()->set_text(TTR("OK :("));
+ accept->set_text(TTR("No parent to instance a child at."));
+ accept->popup_centered_minsize();
+ _remove_preview();
+ return;
+ }
+ if (list.size()!=1) {
+ accept->get_ok()->set_text(TTR("I see.."));
+ accept->set_text(TTR("This operation requires a single selected node."));
+ accept->popup_centered_minsize();
+ _remove_preview();
+ return;
+ }
+
+ target_node=list[0];
+ if (is_shift && target_node!=editor->get_edited_scene()) {
+ target_node=target_node->get_parent();
+ }
+ drop_pos=p_point;
+
+ if (is_alt) {
+ List<BaseButton*> btn_list;
+ button_group->get_buttons(&btn_list);
+
+ for (int i=0;i<btn_list.size();i++) {
+ CheckBox* check=btn_list[i]->cast_to<CheckBox>();
+ check->set_pressed(check->get_text()==default_type);
+ }
+ selector_label->set_text(vformat(TTR("Add %s"),default_type));
+ selector->popup_centered_minsize();
+ } else {
+ _perform_drop_data();
+ }
+}
+
+void CanvasItemEditorViewport::_notification(int p_what) {
+ if (p_what==NOTIFICATION_ENTER_TREE) {
+ connect("mouse_exited",this,"_on_mouse_exit");
+ } else if (p_what==NOTIFICATION_EXIT_TREE) {
+ disconnect("mouse_exited",this,"_on_mouse_exit");
+ }
+}
+
+void CanvasItemEditorViewport::_bind_methods() {
+ ClassDB::bind_method(_MD("_on_select_type"),&CanvasItemEditorViewport::_on_select_type);
+ ClassDB::bind_method(_MD("_on_change_type"),&CanvasItemEditorViewport::_on_change_type);
+ ClassDB::bind_method(_MD("_on_mouse_exit"),&CanvasItemEditorViewport::_on_mouse_exit);
+}
+
+CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasItemEditor* p_canvas) {
+ default_type="Sprite";
+ // Node2D
+ types.push_back("Sprite");
+ types.push_back("Light2D");
+ types.push_back("Particles2D");
+ types.push_back("Polygon2D");
+ types.push_back("TouchScreenButton");
+ // Control
+ types.push_back("TextureRect");
+ types.push_back("Patch9Rect");
+
+ target_node=NULL;
+ editor=p_node;
+ editor_data=editor->get_scene_tree_dock()->get_editor_data();
+ canvas=p_canvas;
+ preview=memnew( Node2D );
+ accept=memnew( AcceptDialog );
+ editor->get_gui_base()->add_child(accept);
+
+ selector=memnew( WindowDialog );
+ selector->set_title(TTR("Change default type"));
+
+ VBoxContainer* vbc=memnew(VBoxContainer);
+ vbc->add_constant_override("separation",10*EDSCALE);
+ vbc->set_custom_minimum_size(Size2(200,260)*EDSCALE);
+
+ selector_label=memnew(Label);
+ selector_label->set_align(Label::ALIGN_CENTER);
+ selector_label->set_valign(Label::VALIGN_BOTTOM);
+ selector_label->set_custom_minimum_size(Size2(0,30)*EDSCALE);
+ vbc->add_child(selector_label);
+
+ button_group.instance();
+
+ btn_group=memnew( VBoxContainer );
+ btn_group->set_h_size_flags(0);
+ btn_group->connect("button_selected", this, "_on_select_type");
+
+ for (int i=0;i<types.size();i++) {
+ CheckBox* check=memnew(CheckBox);
+ check->set_text(types[i]);
+ btn_group->add_child(check);
+ check->set_button_group(button_group);
+ }
+ vbc->add_child(btn_group);
+
+ Button* ok=memnew(Button);
+ ok->set_text(TTR("OK"));
+ ok->set_h_size_flags(0);
+ vbc->add_child(ok);
+ ok->connect("pressed", this, "_on_change_type");
+
+ selector->add_child(vbc);
+ editor->get_gui_base()->add_child(selector);
+
+ label=memnew(Label);
+ label->add_color_override("font_color", Color(1,1,0,1));
+ label->add_color_override("font_color_shadow", Color(0,0,0,1));
+ label->add_constant_override("shadow_as_outline", 1*EDSCALE);
+ label->hide();
+ editor->get_gui_base()->add_child(label);
+
+ label_desc=memnew(Label);
+ label_desc->set_text(TTR("Drag & drop + Shift : Add node as sibling\nDrag & drop + Alt : Change node type"));
+ label_desc->add_color_override("font_color", Color(0.6,0.6,0.6,1));
+ label_desc->add_color_override("font_color_shadow", Color(0.2,0.2,0.2,1));
+ label_desc->add_constant_override("shadow_as_outline", 1*EDSCALE);
+ label_desc->add_constant_override("line_spacing", 0);
+ label_desc->hide();
+ editor->get_gui_base()->add_child(label_desc);
+}
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.h b/tools/editor/plugins/canvas_item_editor_plugin.h
index 9f4bc46eb4..f4f628fe28 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.h
+++ b/tools/editor/plugins/canvas_item_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -31,26 +31,27 @@
#include "tools/editor/editor_plugin.h"
#include "tools/editor/editor_node.h"
+#include "scene/gui/button_group.h"
+#include "scene/gui/check_box.h"
+#include "scene/gui/label.h"
#include "scene/gui/spin_box.h"
#include "scene/gui/panel_container.h"
#include "scene/gui/box_container.h"
#include "scene/2d/canvas_item.h"
-
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-
-
+class CanvasItemEditorViewport;
class CanvasItemEditorSelectedItem : public Object {
- OBJ_TYPE(CanvasItemEditorSelectedItem,Object);
+ GDCLASS(CanvasItemEditorSelectedItem,Object);
public:
Variant undo_state;
Vector2 undo_pivot;
- Matrix32 prev_xform;
+ Transform2D prev_xform;
float prev_rot;
Rect2 prev_rect;
@@ -59,7 +60,7 @@ public:
class CanvasItemEditor : public VBoxContainer {
- OBJ_TYPE(CanvasItemEditor, VBoxContainer );
+ GDCLASS(CanvasItemEditor, VBoxContainer );
EditorNode *editor;
@@ -165,7 +166,7 @@ class CanvasItemEditor : public VBoxContainer {
VScrollBar *v_scroll;
HBoxContainer *hb;
- Matrix32 transform;
+ Transform2D transform;
float zoom;
Vector2 snap_offset;
Vector2 snap_step;
@@ -211,7 +212,7 @@ class CanvasItemEditor : public VBoxContainer {
struct BoneList {
- Matrix32 xform;
+ Transform2D xform;
Vector2 from;
Vector2 to;
ObjectID bone;
@@ -221,7 +222,7 @@ class CanvasItemEditor : public VBoxContainer {
uint64_t bone_last_frame;
Map<ObjectID,BoneList> bone_list;
- Matrix32 bone_orig_xform;
+ Transform2D bone_orig_xform;
struct BoneIK {
@@ -299,9 +300,9 @@ class CanvasItemEditor : public VBoxContainer {
int handle_len;
bool _is_part_of_subscene(CanvasItem *p_item);
- CanvasItem* _select_canvas_item_at_pos(const Point2 &p_pos,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform);
- void _find_canvas_items_at_pos(const Point2 &p_pos,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform, Vector<_SelectResult> &r_items);
- void _find_canvas_items_at_rect(const Rect2& p_rect,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform,List<CanvasItem*> *r_items);
+ CanvasItem* _select_canvas_item_at_pos(const Point2 &p_pos,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform);
+ void _find_canvas_items_at_pos(const Point2 &p_pos,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform, Vector<_SelectResult> &r_items);
+ void _find_canvas_items_at_rect(const Rect2& p_rect,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform,List<CanvasItem*> *r_items);
bool _select(CanvasItem *item, Point2 p_click_pos, bool p_append, bool p_drag=true);
@@ -321,7 +322,7 @@ class CanvasItemEditor : public VBoxContainer {
void _key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE p_move_mode);
void _list_select(const InputEventMouseButton& b);
- DragType _find_drag_type(const Matrix32& p_xform, const Rect2& p_local_rect, const Point2& p_click, Vector2& r_point);
+ DragType _find_drag_type(const Transform2D& p_xform, const Rect2& p_local_rect, const Point2& p_click, Vector2& r_point);
void _popup_callback(int p_op);
bool updating_scroll;
@@ -341,7 +342,7 @@ class CanvasItemEditor : public VBoxContainer {
Point2 _find_topleftmost_point();
- void _find_canvas_items_span(Node *p_node, Rect2& r_rect, const Matrix32& p_xform);
+ void _find_canvas_items_span(Node *p_node, Rect2& r_rect, const Transform2D& p_xform);
Object *_get_editor_data(Object *p_what);
@@ -352,7 +353,7 @@ class CanvasItemEditor : public VBoxContainer {
void _unhandled_key_input(const InputEvent& p_ev);
- void _viewport_input_event(const InputEvent& p_event);
+ void _viewport_gui_input(const InputEvent& p_event);
void _viewport_draw();
void _focus_selection(int p_op);
@@ -406,7 +407,7 @@ public:
Vector2 snap_point(Vector2 p_target, Vector2 p_start = Vector2(0, 0)) const;
float snap_angle(float p_target, float p_start = 0) const;
- Matrix32 get_canvas_transform() const { return transform; }
+ Transform2D get_canvas_transform() const { return transform; }
static CanvasItemEditor *get_singleton() { return singleton; }
Dictionary get_state() const;
@@ -430,7 +431,7 @@ public:
class CanvasItemEditorPlugin : public EditorPlugin {
- OBJ_TYPE( CanvasItemEditorPlugin, EditorPlugin );
+ GDCLASS( CanvasItemEditorPlugin, EditorPlugin );
CanvasItemEditor *canvas_item_editor;
EditorNode *editor;
@@ -453,4 +454,50 @@ public:
};
+class CanvasItemEditorViewport : public VBoxContainer {
+ GDCLASS( CanvasItemEditorViewport, VBoxContainer );
+
+ String default_type;
+ Vector<String> types;
+
+ Vector<String> selected_files;
+ Node* target_node;
+ Point2 drop_pos;
+
+ EditorNode* editor;
+ EditorData* editor_data;
+ CanvasItemEditor* canvas;
+ Node2D* preview;
+ AcceptDialog* accept;
+ WindowDialog* selector;
+ Label* selector_label;
+ Label* label;
+ Label* label_desc;
+ VBoxContainer* btn_group;
+ Ref<ButtonGroup> button_group;
+
+ void _on_mouse_exit();
+ void _on_select_type(Object* selected);
+ void _on_change_type();
+
+ void _create_preview(const Vector<String>& files) const;
+ void _remove_preview();
+
+ bool _cyclical_dependency_exists(const String& p_target_scene_path, Node* p_desired_node);
+ void _create_nodes(Node* parent, Node* child, String& path, const Point2& p_point);
+ bool _create_instance(Node* parent, String& path, const Point2& p_point);
+ void _perform_drop_data();
+
+ static void _bind_methods();
+
+protected:
+ void _notification(int p_what);
+
+public:
+ virtual bool can_drop_data(const Point2& p_point,const Variant& p_data) const;
+ virtual void drop_data(const Point2& p_point,const Variant& p_data);
+
+ CanvasItemEditorViewport(EditorNode *p_node, CanvasItemEditor* p_canvas);
+};
+
#endif
diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp
index 95364e8921..263d96ecdf 100644
--- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -99,7 +99,7 @@ void CollisionPolygon2DEditor::_wip_close() {
edited_point=-1;
}
-bool CollisionPolygon2DEditor::forward_input_event(const InputEvent& p_event) {
+bool CollisionPolygon2DEditor::forward_gui_input(const InputEvent& p_event) {
if (!node)
@@ -111,7 +111,7 @@ bool CollisionPolygon2DEditor::forward_input_event(const InputEvent& p_event) {
const InputEventMouseButton &mb=p_event.mouse_button;
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Vector2 gpoint = Point2(mb.x,mb.y);
@@ -122,7 +122,7 @@ bool CollisionPolygon2DEditor::forward_input_event(const InputEvent& p_event) {
Vector<Vector2> poly = node->get_polygon();
//first check if a point is to be added (segment split)
- real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8);
+ real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8);
switch(mode) {
@@ -346,7 +346,7 @@ void CollisionPolygon2DEditor::_canvas_draw() {
poly=node->get_polygon();
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Ref<Texture> handle= get_icon("EditorHandle","EditorIcons");
for(int i=0;i<poly.size();i++) {
@@ -398,9 +398,9 @@ void CollisionPolygon2DEditor::edit(Node *p_collision_polygon) {
void CollisionPolygon2DEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_menu_option"),&CollisionPolygon2DEditor::_menu_option);
- ObjectTypeDB::bind_method(_MD("_canvas_draw"),&CollisionPolygon2DEditor::_canvas_draw);
- ObjectTypeDB::bind_method(_MD("_node_removed"),&CollisionPolygon2DEditor::_node_removed);
+ ClassDB::bind_method(_MD("_menu_option"),&CollisionPolygon2DEditor::_menu_option);
+ ClassDB::bind_method(_MD("_canvas_draw"),&CollisionPolygon2DEditor::_canvas_draw);
+ ClassDB::bind_method(_MD("_node_removed"),&CollisionPolygon2DEditor::_node_removed);
}
@@ -432,7 +432,7 @@ CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
- options->get_popup()->connect("item_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
mode = MODE_EDIT;
@@ -448,7 +448,7 @@ void CollisionPolygon2DEditorPlugin::edit(Object *p_object) {
bool CollisionPolygon2DEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("CollisionPolygon2D");
+ return p_object->is_class("CollisionPolygon2D");
}
void CollisionPolygon2DEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h b/tools/editor/plugins/collision_polygon_2d_editor_plugin.h
index 431d3651c1..2c573c1dcf 100644
--- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h
+++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -43,7 +43,7 @@ class CanvasItemEditor;
class CollisionPolygon2DEditor : public HBoxContainer {
- OBJ_TYPE(CollisionPolygon2DEditor, HBoxContainer );
+ GDCLASS(CollisionPolygon2DEditor, HBoxContainer );
UndoRedo *undo_redo;
enum Mode {
@@ -81,21 +81,21 @@ protected:
static void _bind_methods();
public:
- bool forward_input_event(const InputEvent& p_event);
+ bool forward_gui_input(const InputEvent& p_event);
void edit(Node *p_collision_polygon);
CollisionPolygon2DEditor(EditorNode *p_editor);
};
class CollisionPolygon2DEditorPlugin : public EditorPlugin {
- OBJ_TYPE( CollisionPolygon2DEditorPlugin, EditorPlugin );
+ GDCLASS( CollisionPolygon2DEditorPlugin, EditorPlugin );
CollisionPolygon2DEditor *collision_polygon_editor;
EditorNode *editor;
public:
- virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "CollisionPolygon2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp
index 0b06b3ba21..010d6f1a47 100644
--- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,6 +33,8 @@
#include "scene/3d/camera.h"
#include "canvas_item_editor_plugin.h"
+#if 0
+
void CollisionPolygonEditor::_notification(int p_what) {
switch(p_what) {
@@ -107,7 +109,7 @@ void CollisionPolygonEditor::_wip_close() {
}
-bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event) {
+bool CollisionPolygonEditor::forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) {
if (!node)
return false;
@@ -145,7 +147,7 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const
Vector<Vector2> poly = node->get_polygon();
//first check if a point is to be added (segment split)
- real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8);
+ real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8);
switch(mode) {
@@ -476,11 +478,11 @@ void CollisionPolygonEditor::_polygon_draw() {
Array a;
a.resize(Mesh::ARRAY_MAX);
- DVector<Vector3> va;
+ PoolVector<Vector3> va;
{
va.resize(poly.size());
- DVector<Vector3>::Write w=va.write();
+ PoolVector<Vector3>::Write w=va.write();
for(int i=0;i<poly.size();i++) {
@@ -527,9 +529,9 @@ void CollisionPolygonEditor::edit(Node *p_collision_polygon) {
void CollisionPolygonEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_menu_option"),&CollisionPolygonEditor::_menu_option);
- ObjectTypeDB::bind_method(_MD("_polygon_draw"),&CollisionPolygonEditor::_polygon_draw);
- ObjectTypeDB::bind_method(_MD("_node_removed"),&CollisionPolygonEditor::_node_removed);
+ ClassDB::bind_method(_MD("_menu_option"),&CollisionPolygonEditor::_menu_option);
+ ClassDB::bind_method(_MD("_polygon_draw"),&CollisionPolygonEditor::_polygon_draw);
+ ClassDB::bind_method(_MD("_node_removed"),&CollisionPolygonEditor::_node_removed);
}
@@ -559,7 +561,7 @@ CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
- options->get_popup()->connect("item_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
mode = MODE_EDIT;
@@ -568,25 +570,25 @@ CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) {
imgeom->set_transform(Transform(Matrix3(),Vector3(0,0,0.00001)));
- line_material = Ref<FixedMaterial>( memnew( FixedMaterial ));
+ line_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
line_material->set_flag(Material::FLAG_UNSHADED, true);
line_material->set_line_width(3.0);
- line_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- line_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true);
- line_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1));
+ line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
+ line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, true);
+ line_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1));
- handle_material = Ref<FixedMaterial>( memnew( FixedMaterial ));
+ handle_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
handle_material->set_flag(Material::FLAG_UNSHADED, true);
- handle_material->set_fixed_flag(FixedMaterial::FLAG_USE_POINT_SIZE, true);
- handle_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1));
- handle_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- handle_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, false);
+ handle_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_POINT_SIZE, true);
+ handle_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1));
+ handle_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
+ handle_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, false);
Ref<Texture> handle=editor->get_gui_base()->get_icon("Editor3DHandle","EditorIcons");
handle_material->set_point_size(handle->get_width());
- handle_material->set_texture(FixedMaterial::PARAM_DIFFUSE,handle);
+ handle_material->set_texture(FixedSpatialMaterial::PARAM_DIFFUSE,handle);
pointsm = memnew( MeshInstance );
imgeom->add_child(pointsm);
@@ -642,3 +644,4 @@ CollisionPolygonEditorPlugin::~CollisionPolygonEditorPlugin()
{
}
+#endif
diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.h b/tools/editor/plugins/collision_polygon_editor_plugin.h
index 45e287ef00..cd722048db 100644
--- a/tools/editor/plugins/collision_polygon_editor_plugin.h
+++ b/tools/editor/plugins/collision_polygon_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,11 +40,13 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
+
+#if 0
class CanvasItemEditor;
class CollisionPolygonEditor : public HBoxContainer {
- OBJ_TYPE(CollisionPolygonEditor, HBoxContainer );
+ GDCLASS(CollisionPolygonEditor, HBoxContainer );
UndoRedo *undo_redo;
enum Mode {
@@ -60,8 +62,8 @@ class CollisionPolygonEditor : public HBoxContainer {
ToolButton *button_edit;
- Ref<FixedMaterial> line_material;
- Ref<FixedMaterial> handle_material;
+ Ref<FixedSpatialMaterial> line_material;
+ Ref<FixedSpatialMaterial> handle_material;
EditorNode *editor;
Panel *panel;
@@ -90,7 +92,7 @@ protected:
static void _bind_methods();
public:
- virtual bool forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event);
+ virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event);
void edit(Node *p_collision_polygon);
CollisionPolygonEditor(EditorNode *p_editor);
~CollisionPolygonEditor();
@@ -98,14 +100,14 @@ public:
class CollisionPolygonEditorPlugin : public EditorPlugin {
- OBJ_TYPE( CollisionPolygonEditorPlugin, EditorPlugin );
+ GDCLASS( CollisionPolygonEditorPlugin, EditorPlugin );
CollisionPolygonEditor *collision_polygon_editor;
EditorNode *editor;
public:
- virtual bool forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event) { return collision_polygon_editor->forward_spatial_input_event(p_camera,p_event); }
+ virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) { return collision_polygon_editor->forward_spatial_gui_input(p_camera,p_event); }
virtual String get_name() const { return "CollisionPolygon"; }
bool has_main_screen() const { return false; }
@@ -117,5 +119,5 @@ public:
~CollisionPolygonEditorPlugin();
};
-
+#endif
#endif // COLLISION_POLYGON_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 d0cd73dcad..626ca9e132 100644
--- a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -303,7 +303,7 @@ void CollisionShape2DEditor::commit_handle(int idx, Variant& p_org) {
undo_redo->commit_action();
}
-bool CollisionShape2DEditor::forward_input_event(const InputEvent& p_event) {
+bool CollisionShape2DEditor::forward_gui_input(const InputEvent& p_event) {
if (!node) {
return false;
@@ -321,7 +321,7 @@ bool CollisionShape2DEditor::forward_input_event(const InputEvent& p_event) {
case InputEvent::MOUSE_BUTTON: {
const InputEventMouseButton& mb = p_event.mouse_button;
- Matrix32 gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Point2 gpoint(mb.x,mb.y);
@@ -436,7 +436,7 @@ void CollisionShape2DEditor::_canvas_draw() {
}
Control *c = canvas_item_editor->get_viewport_control();
- Matrix32 gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Ref<Texture> h = get_icon("EditorHandle","EditorIcons");
Vector2 size = h->get_size()*0.5;
@@ -555,8 +555,8 @@ void CollisionShape2DEditor::edit(Node* p_node) {
void CollisionShape2DEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_canvas_draw",&CollisionShape2DEditor::_canvas_draw);
- ObjectTypeDB::bind_method("_get_current_shape_type",&CollisionShape2DEditor::_get_current_shape_type);
+ ClassDB::bind_method("_canvas_draw",&CollisionShape2DEditor::_canvas_draw);
+ ClassDB::bind_method("_get_current_shape_type",&CollisionShape2DEditor::_get_current_shape_type);
}
CollisionShape2DEditor::CollisionShape2DEditor(EditorNode* p_editor) {
@@ -578,7 +578,7 @@ void CollisionShape2DEditorPlugin::edit(Object* p_obj) {
bool CollisionShape2DEditorPlugin::handles(Object* p_obj) const {
- return p_obj->is_type("CollisionShape2D");
+ return p_obj->is_class("CollisionShape2D");
}
void CollisionShape2DEditorPlugin::make_visible(bool visible) {
diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.h b/tools/editor/plugins/collision_shape_2d_editor_plugin.h
index a8930dc0f2..37708db5e0 100644
--- a/tools/editor/plugins/collision_shape_2d_editor_plugin.h
+++ b/tools/editor/plugins/collision_shape_2d_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,7 +37,7 @@
class CanvasItemEditor;
class CollisionShape2DEditor : public Control {
- OBJ_TYPE(CollisionShape2DEditor, Control);
+ GDCLASS(CollisionShape2DEditor, Control);
enum ShapeType {
CAPSULE_SHAPE,
@@ -73,20 +73,20 @@ protected:
static void _bind_methods();
public:
- bool forward_input_event(const InputEvent& p_event);
+ bool forward_gui_input(const InputEvent& p_event);
void edit(Node* p_node);
CollisionShape2DEditor(EditorNode* p_editor);
};
class CollisionShape2DEditorPlugin : public EditorPlugin {
- OBJ_TYPE(CollisionShape2DEditorPlugin, EditorPlugin);
+ GDCLASS(CollisionShape2DEditorPlugin, EditorPlugin);
CollisionShape2DEditor* collision_shape_2d_editor;
EditorNode* editor;
public:
- virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_shape_2d_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return collision_shape_2d_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "CollisionShape2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/color_ramp_editor_plugin.cpp b/tools/editor/plugins/color_ramp_editor_plugin.cpp
index 4e2045edc6..90ec1e9f4e 100644
--- a/tools/editor/plugins/color_ramp_editor_plugin.cpp
+++ b/tools/editor/plugins/color_ramp_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -54,7 +54,7 @@ void ColorRampEditorPlugin::edit(Object *p_object) {
bool ColorRampEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("ColorRamp");
+ return p_object->is_class("ColorRamp");
}
@@ -75,7 +75,7 @@ void ColorRampEditorPlugin::_ramp_changed() {
UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo();
- //Not sure if I should convert this data to DVector
+ //Not sure if I should convert this data to PoolVector
Vector<float> new_offsets=ramp_editor->get_offsets();
Vector<Color> new_colors=ramp_editor->get_colors();
Vector<float> old_offsets=color_ramp_ref->get_offsets();
@@ -106,6 +106,6 @@ ColorRampEditorPlugin::~ColorRampEditorPlugin(){
}
void ColorRampEditorPlugin::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("ramp_changed"),&ColorRampEditorPlugin::_ramp_changed);
- ObjectTypeDB::bind_method(_MD("undo_redo_color_ramp","offsets","colors"),&ColorRampEditorPlugin::_undo_redo_color_ramp);
+ ClassDB::bind_method(_MD("ramp_changed"),&ColorRampEditorPlugin::_ramp_changed);
+ ClassDB::bind_method(_MD("undo_redo_color_ramp","offsets","colors"),&ColorRampEditorPlugin::_undo_redo_color_ramp);
}
diff --git a/tools/editor/plugins/color_ramp_editor_plugin.h b/tools/editor/plugins/color_ramp_editor_plugin.h
index 300a9030b9..2f55ad65f1 100644
--- a/tools/editor/plugins/color_ramp_editor_plugin.h
+++ b/tools/editor/plugins/color_ramp_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -35,7 +35,7 @@
class ColorRampEditorPlugin : public EditorPlugin {
- OBJ_TYPE( ColorRampEditorPlugin, EditorPlugin );
+ GDCLASS( ColorRampEditorPlugin, EditorPlugin );
bool _2d;
Ref<ColorRamp> color_ramp_ref;
diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp
index b6f3db73f7..563b8298eb 100644
--- a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp
+++ b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -28,6 +28,7 @@
/*************************************************************************/
#include "cube_grid_theme_editor_plugin.h"
+#if 0
#include "scene/3d/mesh_instance.h"
#include "scene/3d/physics_body.h"
#include "scene/main/viewport.h"
@@ -150,8 +151,8 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library,
VS::ViewportRect vr;
vr.x=0;
vr.y=0;
- vr.width=EditorSettings::get_singleton()->get("grid_map/preview_size");
- vr.height=EditorSettings::get_singleton()->get("grid_map/preview_size");
+ vr.width=EditorSettings::get_singleton()->get("editors/grid_map/preview_size");
+ vr.height=EditorSettings::get_singleton()->get("editors/grid_map/preview_size");
VS::get_singleton()->viewport_set_rect(vp,vr);
VS::get_singleton()->viewport_set_as_render_target(vp,true);
VS::get_singleton()->viewport_set_render_target_update_mode(vp,VS::RENDER_TARGET_UPDATE_ALWAYS);
@@ -178,8 +179,8 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library,
Vector3 ofs = aabb.pos + aabb.size*0.5;
aabb.pos-=ofs;
Transform xform;
- xform.basis=Matrix3().rotated(Vector3(0,1,0),Math_PI*0.25);
- xform.basis = Matrix3().rotated(Vector3(1,0,0),-Math_PI*0.25)*xform.basis;
+ xform.basis=Matrix3().rotated(Vector3(0,1,0),-Math_PI*0.25);
+ xform.basis = Matrix3().rotated(Vector3(1,0,0),Math_PI*0.25)*xform.basis;
AABB rot_aabb = xform.xform(aabb);
print_line("rot_aabb: "+rot_aabb);
float m = MAX(rot_aabb.size.x,rot_aabb.size.y)*0.5;
@@ -202,7 +203,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library,
it->create_from_image(img);
p_library->set_item_preview(id,it);
-// print_line("loaded image, size: "+rtos(m)+" dist: "+rtos(dist)+" empty?"+itos(img.empty())+" w: "+itos(it->get_width())+" h: "+itos(it->get_height()));
+ //print_line("loaded image, size: "+rtos(m)+" dist: "+rtos(dist)+" empty?"+itos(img.empty())+" w: "+itos(it->get_width())+" h: "+itos(it->get_height()));
VS::get_singleton()->free(inst);
}
@@ -275,9 +276,9 @@ void MeshLibraryEditor::_menu_cbk(int p_option) {
void MeshLibraryEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_menu_cbk",&MeshLibraryEditor::_menu_cbk);
- ObjectTypeDB::bind_method("_menu_confirm",&MeshLibraryEditor::_menu_confirm);
- ObjectTypeDB::bind_method("_import_scene_cbk",&MeshLibraryEditor::_import_scene_cbk);
+ ClassDB::bind_method("_menu_cbk",&MeshLibraryEditor::_menu_cbk);
+ ClassDB::bind_method("_menu_confirm",&MeshLibraryEditor::_menu_confirm);
+ ClassDB::bind_method("_import_scene_cbk",&MeshLibraryEditor::_import_scene_cbk);
}
MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) {
@@ -309,7 +310,7 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) {
options->get_popup()->add_item(TTR("Import from Scene"),MENU_OPTION_IMPORT_FROM_SCENE);
options->get_popup()->add_item(TTR("Update from Scene"),MENU_OPTION_UPDATE_FROM_SCENE);
options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE),true);
- options->get_popup()->connect("item_pressed", this,"_menu_cbk");
+ options->get_popup()->connect("id_pressed", this,"_menu_cbk");
menu=options;
editor=p_editor;
cd = memnew(ConfirmationDialog);
@@ -342,7 +343,7 @@ void MeshLibraryEditorPlugin::make_visible(bool p_visible){
MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) {
- EDITOR_DEF("grid_map/preview_size",64);
+ EDITOR_DEF("editors/grid_map/preview_size",64);
theme_editor = memnew( MeshLibraryEditor(p_node) );
p_node->get_viewport()->add_child(theme_editor);
@@ -353,4 +354,4 @@ MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) {
theme_editor->hide();
}
-
+#endif
diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.h b/tools/editor/plugins/cube_grid_theme_editor_plugin.h
index 72ee171e19..f32f601023 100644
--- a/tools/editor/plugins/cube_grid_theme_editor_plugin.h
+++ b/tools/editor/plugins/cube_grid_theme_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -32,10 +32,10 @@
#include "scene/resources/mesh_library.h"
#include "tools/editor/editor_node.h"
-
+#if 0
class MeshLibraryEditor : public Control {
- OBJ_TYPE( MeshLibraryEditor, Control );
+ GDCLASS( MeshLibraryEditor, Control );
Ref<MeshLibrary> theme;
@@ -74,7 +74,7 @@ public:
class MeshLibraryEditorPlugin : public EditorPlugin {
- OBJ_TYPE( MeshLibraryEditorPlugin, EditorPlugin );
+ GDCLASS( MeshLibraryEditorPlugin, EditorPlugin );
MeshLibraryEditor *theme_editor;
EditorNode *editor;
@@ -93,3 +93,4 @@ public:
#endif // CUBE_GRID_THEME_EDITOR_PLUGIN_H
+#endif
diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp
index b1bce60484..478fa2308d 100644
--- a/tools/editor/plugins/editor_preview_plugins.cpp
+++ b/tools/editor/plugins/editor_preview_plugins.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,9 +37,10 @@
#include "scene/resources/bit_mask.h"
#include "tools/editor/editor_scale.h"
+#if 0
bool EditorTexturePreviewPlugin::handles(const String& p_type) const {
- return (ObjectTypeDB::is_type(p_type,"ImageTexture") || ObjectTypeDB::is_type(p_type, "AtlasTexture"));
+ return (ClassDB::is_type(p_type,"ImageTexture") || ClassDB::is_type(p_type, "AtlasTexture"));
}
Ref<Texture> EditorTexturePreviewPlugin::generate(const RES& p_from) {
@@ -64,13 +65,13 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES& p_from) {
img.clear_mipmaps();
- int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
thumbnail_size*=EDSCALE;
if (img.is_compressed()) {
if (img.decompress()!=OK)
return Ref<Texture>();
- } else if (img.get_format()!=Image::FORMAT_RGB && img.get_format()!=Image::FORMAT_RGBA) {
- img.convert(Image::FORMAT_RGBA);
+ } else if (img.get_format()!=Image::FORMAT_RGB8 && img.get_format()!=Image::FORMAT_RGBA8) {
+ img.convert(Image::FORMAT_RGBA8);
}
int width,height;
@@ -106,7 +107,7 @@ EditorTexturePreviewPlugin::EditorTexturePreviewPlugin() {
bool EditorBitmapPreviewPlugin::handles(const String& p_type) const {
- return ObjectTypeDB::is_type(p_type,"BitMap");
+ return ClassDB::is_type(p_type,"BitMap");
}
Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) {
@@ -117,12 +118,12 @@ Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) {
return Ref<Texture>();
}
- DVector<uint8_t> data;
+ PoolVector<uint8_t> data;
data.resize(bm->get_size().width*bm->get_size().height);
{
- DVector<uint8_t>::Write w=data.write();
+ PoolVector<uint8_t>::Write w=data.write();
for(int i=0;i<bm->get_size().width;i++) {
for(int j=0;j<bm->get_size().height;j++) {
@@ -138,15 +139,15 @@ Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) {
}
- Image img(bm->get_size().width,bm->get_size().height,0,Image::FORMAT_GRAYSCALE,data);
+ Image img(bm->get_size().width,bm->get_size().height,0,Image::FORMAT_L8,data);
- int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
thumbnail_size*=EDSCALE;
if (img.is_compressed()) {
if (img.decompress()!=OK)
return Ref<Texture>();
- } else if (img.get_format()!=Image::FORMAT_RGB && img.get_format()!=Image::FORMAT_RGBA) {
- img.convert(Image::FORMAT_RGBA);
+ } else if (img.get_format()!=Image::FORMAT_RGB8 && img.get_format()!=Image::FORMAT_RGBA8) {
+ img.convert(Image::FORMAT_RGBA8);
}
int width,height;
@@ -192,14 +193,14 @@ Ref<Texture> EditorPackedScenePreviewPlugin::_gen_from_imd(Ref<ResourceImportMet
Variant tn = p_imd->get_option("thumbnail");
//print_line(Variant::get_type_name(tn.get_type()));
- DVector<uint8_t> thumbnail = tn;
+ PoolVector<uint8_t> thumbnail = tn;
int len = thumbnail.size();
if (len==0)
return Ref<Texture>();
- DVector<uint8_t>::Read r = thumbnail.read();
+ PoolVector<uint8_t>::Read r = thumbnail.read();
Image img(r.ptr(),len);
if (img.empty())
@@ -213,7 +214,7 @@ Ref<Texture> EditorPackedScenePreviewPlugin::_gen_from_imd(Ref<ResourceImportMet
bool EditorPackedScenePreviewPlugin::handles(const String& p_type) const {
- return ObjectTypeDB::is_type(p_type,"PackedScene");
+ return ClassDB::is_type(p_type,"PackedScene");
}
Ref<Texture> EditorPackedScenePreviewPlugin::generate(const RES& p_from) {
@@ -235,7 +236,7 @@ EditorPackedScenePreviewPlugin::EditorPackedScenePreviewPlugin() {
bool EditorMaterialPreviewPlugin::handles(const String& p_type) const {
- return ObjectTypeDB::is_type(p_type,"Material"); //any material
+ return ClassDB::is_type(p_type,"Material"); //any material
}
Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES& p_from) {
@@ -247,7 +248,7 @@ Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES& p_from) {
VS::get_singleton()->viewport_queue_screen_capture(viewport);
VS::get_singleton()->viewport_set_render_target_update_mode(viewport,VS::RENDER_TARGET_UPDATE_ONCE); //once used for capture
-// print_line("queue capture!");
+ //print_line("queue capture!");
Image img;
int timeout=1000;
@@ -263,7 +264,7 @@ Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES& p_from) {
//print_line("captured!");
VS::get_singleton()->mesh_surface_set_material(sphere,0,RID());
- int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
thumbnail_size*=EDSCALE;
img.resize(thumbnail_size,thumbnail_size);
@@ -310,10 +311,10 @@ EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() {
int lons=32;
float radius=1.0;
- DVector<Vector3> vertices;
- DVector<Vector3> normals;
- DVector<Vector2> uvs;
- DVector<float> tangents;
+ PoolVector<Vector3> vertices;
+ PoolVector<Vector3> normals;
+ PoolVector<Vector2> uvs;
+ PoolVector<float> tangents;
Matrix3 tt = Matrix3(Vector3(0,1,0),Math_PI*0.5);
for(int i = 1; i <= lats; i++) {
@@ -404,7 +405,7 @@ static bool _is_text_char(CharType c) {
bool EditorScriptPreviewPlugin::handles(const String& p_type) const {
- return ObjectTypeDB::is_type(p_type,"Script");
+ return ClassDB::is_type(p_type,"Script");
}
Ref<Texture> EditorScriptPreviewPlugin::generate(const RES& p_from) {
@@ -432,17 +433,17 @@ Ref<Texture> EditorScriptPreviewPlugin::generate(const RES& p_from) {
int line = 0;
int col=0;
- int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
thumbnail_size*=EDSCALE;
- Image img(thumbnail_size,thumbnail_size,0,Image::FORMAT_RGBA);
+ Image img(thumbnail_size,thumbnail_size,0,Image::FORMAT_RGBA8);
- Color bg_color = EditorSettings::get_singleton()->get("text_editor/background_color");
+ Color bg_color = EditorSettings::get_singleton()->get("text_editor/highlighting/background_color");
bg_color.a=1.0;
- Color keyword_color = EditorSettings::get_singleton()->get("text_editor/keyword_color");
- Color text_color = EditorSettings::get_singleton()->get("text_editor/text_color");
- Color symbol_color = EditorSettings::get_singleton()->get("text_editor/symbol_color");
+ Color keyword_color = EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color");
+ Color text_color = EditorSettings::get_singleton()->get("text_editor/highlighting/text_color");
+ Color symbol_color = EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color");
for(int i=0;i<thumbnail_size;i++) {
@@ -523,7 +524,7 @@ EditorScriptPreviewPlugin::EditorScriptPreviewPlugin() {
bool EditorSamplePreviewPlugin::handles(const String& p_type) const {
- return ObjectTypeDB::is_type(p_type,"Sample");
+ return ClassDB::is_type(p_type,"Sample");
}
Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) {
@@ -532,17 +533,17 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) {
ERR_FAIL_COND_V(smp.is_null(),Ref<Texture>());
- int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
thumbnail_size*=EDSCALE;
- DVector<uint8_t> img;
+ PoolVector<uint8_t> img;
int w = thumbnail_size;
int h = thumbnail_size;
img.resize(w*h*3);
- DVector<uint8_t>::Write imgdata = img.write();
+ PoolVector<uint8_t>::Write imgdata = img.write();
uint8_t * imgw = imgdata.ptr();
- DVector<uint8_t> data = smp->get_data();
- DVector<uint8_t>::Read sampledata = data.read();
+ PoolVector<uint8_t> data = smp->get_data();
+ PoolVector<uint8_t>::Read sampledata = data.read();
const uint8_t *sdata=sampledata.ptr();
bool stereo = smp->is_stereo();
@@ -775,10 +776,10 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) {
}
}
- imgdata = DVector<uint8_t>::Write();
+ imgdata = PoolVector<uint8_t>::Write();
Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture));
- ptex->create_from_image(Image(w,h,0,Image::FORMAT_RGB,img),0);
+ ptex->create_from_image(Image(w,h,0,Image::FORMAT_RGB8,img),0);
return ptex;
}
@@ -792,7 +793,7 @@ EditorSamplePreviewPlugin::EditorSamplePreviewPlugin() {
bool EditorMeshPreviewPlugin::handles(const String& p_type) const {
- return ObjectTypeDB::is_type(p_type,"Mesh"); //any Mesh
+ return ClassDB::is_type(p_type,"Mesh"); //any Mesh
}
Ref<Texture> EditorMeshPreviewPlugin::generate(const RES& p_from) {
@@ -806,8 +807,8 @@ Ref<Texture> EditorMeshPreviewPlugin::generate(const RES& p_from) {
Vector3 ofs = aabb.pos + aabb.size*0.5;
aabb.pos-=ofs;
Transform xform;
- xform.basis=Matrix3().rotated(Vector3(0,1,0),Math_PI*0.125);
- xform.basis = Matrix3().rotated(Vector3(1,0,0),-Math_PI*0.125)*xform.basis;
+ xform.basis=Matrix3().rotated(Vector3(0,1,0),-Math_PI*0.125);
+ xform.basis = Matrix3().rotated(Vector3(1,0,0),Math_PI*0.125)*xform.basis;
AABB rot_aabb = xform.xform(aabb);
float m = MAX(rot_aabb.size.x,rot_aabb.size.y)*0.5;
if (m==0)
@@ -824,7 +825,7 @@ Ref<Texture> EditorMeshPreviewPlugin::generate(const RES& p_from) {
VS::get_singleton()->viewport_queue_screen_capture(viewport);
VS::get_singleton()->viewport_set_render_target_update_mode(viewport,VS::RENDER_TARGET_UPDATE_ONCE); //once used for capture
-// print_line("queue capture!");
+ //print_line("queue capture!");
Image img;
int timeout=1000;
@@ -840,7 +841,7 @@ Ref<Texture> EditorMeshPreviewPlugin::generate(const RES& p_from) {
//print_line("captured!");
VS::get_singleton()->instance_set_base(mesh_instance,RID());
- int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");
thumbnail_size*=EDSCALE;
img.resize(thumbnail_size,thumbnail_size);
@@ -866,7 +867,7 @@ EditorMeshPreviewPlugin::EditorMeshPreviewPlugin() {
camera = VS::get_singleton()->camera_create();
VS::get_singleton()->viewport_attach_camera(viewport,camera);
VS::get_singleton()->camera_set_transform(camera,Transform(Matrix3(),Vector3(0,0,3)));
-// VS::get_singleton()->camera_set_perspective(camera,45,0.1,10);
+ //VS::get_singleton()->camera_set_perspective(camera,45,0.1,10);
VS::get_singleton()->camera_set_orthogonal(camera,1.0,0.01,1000.0);
light = VS::get_singleton()->light_create(VS::LIGHT_DIRECTIONAL);
@@ -880,7 +881,7 @@ EditorMeshPreviewPlugin::EditorMeshPreviewPlugin() {
VS::get_singleton()->instance_set_transform(light_instance2,Transform().looking_at(Vector3(0,1,0),Vector3(0,0,1)));
-// sphere = VS::get_singleton()->mesh_create();
+ //sphere = VS::get_singleton()->mesh_create();
mesh_instance = VS::get_singleton()->instance_create();
VS::get_singleton()->instance_set_scenario(mesh_instance,scenario);
@@ -888,6 +889,7 @@ EditorMeshPreviewPlugin::EditorMeshPreviewPlugin() {
}
+
EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() {
//VS::get_singleton()->free(sphere);
@@ -901,3 +903,4 @@ EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() {
VS::get_singleton()->free(scenario);
}
+#endif
diff --git a/tools/editor/plugins/editor_preview_plugins.h b/tools/editor/plugins/editor_preview_plugins.h
index b33aefaa23..3c1689e61e 100644
--- a/tools/editor/plugins/editor_preview_plugins.h
+++ b/tools/editor/plugins/editor_preview_plugins.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -31,6 +31,7 @@
#include "tools/editor/editor_resource_preview.h"
+#if 0
class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator {
public:
@@ -123,5 +124,5 @@ public:
~EditorMeshPreviewPlugin();
};
-
+#endif
#endif // EDITORPREVIEWPLUGINS_H
diff --git a/tools/editor/plugins/gi_probe_editor_plugin.cpp b/tools/editor/plugins/gi_probe_editor_plugin.cpp
new file mode 100644
index 0000000000..f550b7972a
--- /dev/null
+++ b/tools/editor/plugins/gi_probe_editor_plugin.cpp
@@ -0,0 +1,57 @@
+#include "gi_probe_editor_plugin.h"
+
+
+void GIProbeEditorPlugin::_bake() {
+
+ if (gi_probe) {
+ gi_probe->bake();
+ }
+}
+
+
+void GIProbeEditorPlugin::edit(Object *p_object) {
+
+ GIProbe * s = p_object->cast_to<GIProbe>();
+ if (!s)
+ return;
+
+ gi_probe=s;
+}
+
+bool GIProbeEditorPlugin::handles(Object *p_object) const {
+
+ return p_object->is_class("GIProbe");
+}
+
+void GIProbeEditorPlugin::make_visible(bool p_visible) {
+
+ if (p_visible) {
+ bake->show();
+ } else {
+
+ bake->hide();
+ }
+
+}
+
+void GIProbeEditorPlugin::_bind_methods() {
+
+ ClassDB::bind_method("_bake",&GIProbeEditorPlugin::_bake);
+}
+
+GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) {
+
+ editor=p_node;
+ bake = memnew( Button );
+ bake->set_icon(editor->get_gui_base()->get_icon("BakedLight","EditorIcons"));
+ bake->hide();;
+ bake->connect("pressed",this,"_bake");
+ add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU,bake);
+ gi_probe=NULL;
+}
+
+
+GIProbeEditorPlugin::~GIProbeEditorPlugin() {
+
+ memdelete(bake);
+}
diff --git a/tools/editor/plugins/gi_probe_editor_plugin.h b/tools/editor/plugins/gi_probe_editor_plugin.h
new file mode 100644
index 0000000000..8d2ec17d2f
--- /dev/null
+++ b/tools/editor/plugins/gi_probe_editor_plugin.h
@@ -0,0 +1,37 @@
+#ifndef GIPROBEEDITORPLUGIN_H
+#define GIPROBEEDITORPLUGIN_H
+
+#include "tools/editor/editor_plugin.h"
+#include "tools/editor/editor_node.h"
+#include "scene/resources/material.h"
+#include "scene/3d/gi_probe.h"
+
+
+
+class GIProbeEditorPlugin : public EditorPlugin {
+
+ GDCLASS( GIProbeEditorPlugin, EditorPlugin );
+
+ GIProbe *gi_probe;
+
+ Button *bake;
+ EditorNode *editor;
+
+ void _bake();
+protected:
+
+ static void _bind_methods();
+public:
+
+ virtual String get_name() const { return "GIProbe"; }
+ bool has_main_screen() const { return false; }
+ virtual void edit(Object *p_node);
+ virtual bool handles(Object *p_node) const;
+ virtual void make_visible(bool p_visible);
+
+ GIProbeEditorPlugin(EditorNode *p_node);
+ ~GIProbeEditorPlugin();
+
+};
+
+#endif // GIPROBEEDITORPLUGIN_H
diff --git a/tools/editor/plugins/item_list_editor_plugin.cpp b/tools/editor/plugins/item_list_editor_plugin.cpp
index b711e13193..f31074a9dc 100644
--- a/tools/editor/plugins/item_list_editor_plugin.cpp
+++ b/tools/editor/plugins/item_list_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -119,7 +119,7 @@ void ItemListOptionButtonPlugin::set_object(Object *p_object) {
bool ItemListOptionButtonPlugin::handles(Object *p_object) const {
- return p_object->is_type("OptionButton");
+ return p_object->is_class("OptionButton");
}
int ItemListOptionButtonPlugin::get_flags() const {
@@ -153,7 +153,7 @@ ItemListOptionButtonPlugin::ItemListOptionButtonPlugin() {
void ItemListPopupMenuPlugin::set_object(Object *p_object) {
- if (p_object->is_type("MenuButton"))
+ if (p_object->is_class("MenuButton"))
pp = p_object->cast_to<MenuButton>()->get_popup();
else
pp = p_object->cast_to<PopupMenu>();
@@ -161,7 +161,7 @@ void ItemListPopupMenuPlugin::set_object(Object *p_object) {
bool ItemListPopupMenuPlugin::handles(Object *p_object) const {
- return p_object->is_type("PopupMenu") || p_object->is_type("MenuButton");
+ return p_object->is_class("PopupMenu") || p_object->is_class("MenuButton");
}
int ItemListPopupMenuPlugin::get_flags() const {
@@ -260,8 +260,8 @@ void ItemListEditor::edit(Node *p_item_list) {
item_plugins[i]->set_object(p_item_list);
property_editor->edit(item_plugins[i]);
- if (has_icon(item_list->get_type(), "EditorIcons"))
- toolbar_button->set_icon(get_icon(item_list->get_type(), "EditorIcons"));
+ if (has_icon(item_list->get_class(), "EditorIcons"))
+ toolbar_button->set_icon(get_icon(item_list->get_class(), "EditorIcons"));
else
toolbar_button->set_icon(Ref<Texture>());
@@ -287,9 +287,9 @@ bool ItemListEditor::handles(Object *p_object) const {
void ItemListEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_edit_items",&ItemListEditor::_edit_items);
- ObjectTypeDB::bind_method("_add_button",&ItemListEditor::_add_pressed);
- ObjectTypeDB::bind_method("_delete_button",&ItemListEditor::_delete_pressed);
+ ClassDB::bind_method("_edit_items",&ItemListEditor::_edit_items);
+ ClassDB::bind_method("_add_button",&ItemListEditor::_add_pressed);
+ ClassDB::bind_method("_delete_button",&ItemListEditor::_delete_pressed);
}
ItemListEditor::ItemListEditor() {
@@ -309,7 +309,7 @@ ItemListEditor::ItemListEditor() {
VBoxContainer *vbc = memnew( VBoxContainer );
dialog->add_child(vbc);
- dialog->set_child_rect(vbc);
+ //dialog->set_child_rect(vbc);
HBoxContainer *hbc = memnew( HBoxContainer );
hbc->set_h_size_flags(SIZE_EXPAND_FILL);
diff --git a/tools/editor/plugins/item_list_editor_plugin.h b/tools/editor/plugins/item_list_editor_plugin.h
index 95d316b199..74700d615e 100644
--- a/tools/editor/plugins/item_list_editor_plugin.h
+++ b/tools/editor/plugins/item_list_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -44,7 +44,7 @@
class ItemListPlugin : public Object {
- OBJ_TYPE(ItemListPlugin,Object);
+ GDCLASS(ItemListPlugin,Object);
protected:
@@ -100,7 +100,7 @@ public:
class ItemListOptionButtonPlugin : public ItemListPlugin {
- OBJ_TYPE(ItemListOptionButtonPlugin,ItemListPlugin);
+ GDCLASS(ItemListOptionButtonPlugin,ItemListPlugin);
OptionButton *ob;
public:
@@ -130,7 +130,7 @@ public:
class ItemListPopupMenuPlugin : public ItemListPlugin {
- OBJ_TYPE(ItemListPopupMenuPlugin,ItemListPlugin);
+ GDCLASS(ItemListPopupMenuPlugin,ItemListPlugin);
PopupMenu *pp;
public:
@@ -171,7 +171,7 @@ public:
class ItemListEditor : public HBoxContainer {
- OBJ_TYPE(ItemListEditor,HBoxContainer);
+ GDCLASS(ItemListEditor,HBoxContainer);
Node *item_list;
@@ -209,7 +209,7 @@ public:
class ItemListEditorPlugin : public EditorPlugin {
- OBJ_TYPE(ItemListEditorPlugin,EditorPlugin);
+ GDCLASS(ItemListEditorPlugin,EditorPlugin);
ItemListEditor *item_list_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp
index 56e58bc983..f6a51632a0 100644
--- a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -102,7 +102,7 @@ void LightOccluder2DEditor::_wip_close(bool p_closed) {
edited_point=-1;
}
-bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) {
+bool LightOccluder2DEditor::forward_gui_input(const InputEvent& p_event) {
if (!node)
@@ -121,7 +121,7 @@ bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) {
const InputEventMouseButton &mb=p_event.mouse_button;
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Vector2 gpoint = Point2(mb.x,mb.y);
@@ -132,7 +132,7 @@ bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) {
Vector<Vector2> poly = Variant(node->get_occluder_polygon()->get_polygon());
//first check if a point is to be added (segment split)
- real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8);
+ real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8);
switch(mode) {
@@ -361,7 +361,7 @@ void LightOccluder2DEditor::_canvas_draw() {
poly=Variant(node->get_occluder_polygon()->get_polygon());
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Ref<Texture> handle= get_icon("EditorHandle","EditorIcons");
for(int i=0;i<poly.size();i++) {
@@ -427,10 +427,10 @@ void LightOccluder2DEditor::_create_poly() {
void LightOccluder2DEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_menu_option"),&LightOccluder2DEditor::_menu_option);
- ObjectTypeDB::bind_method(_MD("_canvas_draw"),&LightOccluder2DEditor::_canvas_draw);
- ObjectTypeDB::bind_method(_MD("_node_removed"),&LightOccluder2DEditor::_node_removed);
- ObjectTypeDB::bind_method(_MD("_create_poly"),&LightOccluder2DEditor::_create_poly);
+ ClassDB::bind_method(_MD("_menu_option"),&LightOccluder2DEditor::_menu_option);
+ ClassDB::bind_method(_MD("_canvas_draw"),&LightOccluder2DEditor::_canvas_draw);
+ ClassDB::bind_method(_MD("_node_removed"),&LightOccluder2DEditor::_node_removed);
+ ClassDB::bind_method(_MD("_create_poly"),&LightOccluder2DEditor::_create_poly);
}
@@ -468,7 +468,7 @@ LightOccluder2DEditor::LightOccluder2DEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
- options->get_popup()->connect("item_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
mode = MODE_EDIT;
@@ -484,7 +484,7 @@ void LightOccluder2DEditorPlugin::edit(Object *p_object) {
bool LightOccluder2DEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("LightOccluder2D");
+ return p_object->is_class("LightOccluder2D");
}
void LightOccluder2DEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.h b/tools/editor/plugins/light_occluder_2d_editor_plugin.h
index 0176eb87dd..431c01fe75 100644
--- a/tools/editor/plugins/light_occluder_2d_editor_plugin.h
+++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -44,7 +44,7 @@ class CanvasItemEditor;
class LightOccluder2DEditor : public HBoxContainer {
- OBJ_TYPE(LightOccluder2DEditor, HBoxContainer );
+ GDCLASS(LightOccluder2DEditor, HBoxContainer );
UndoRedo *undo_redo;
enum Mode {
@@ -85,21 +85,21 @@ protected:
public:
Vector2 snap_point(const Vector2& p_point) const;
- bool forward_input_event(const InputEvent& p_event);
+ bool forward_gui_input(const InputEvent& p_event);
void edit(Node *p_collision_polygon);
LightOccluder2DEditor(EditorNode *p_editor);
};
class LightOccluder2DEditorPlugin : public EditorPlugin {
- OBJ_TYPE( LightOccluder2DEditorPlugin, EditorPlugin );
+ GDCLASS( LightOccluder2DEditorPlugin, EditorPlugin );
LightOccluder2DEditor *collision_polygon_editor;
EditorNode *editor;
public:
- virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "LightOccluder2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/material_editor_plugin.cpp b/tools/editor/plugins/material_editor_plugin.cpp
index 876fab0d6e..e9bcf063fd 100644
--- a/tools/editor/plugins/material_editor_plugin.cpp
+++ b/tools/editor/plugins/material_editor_plugin.cpp
@@ -1,7 +1,9 @@
#include "material_editor_plugin.h"
#include "scene/main/viewport.h"
-void MaterialEditor::_input_event(InputEvent p_event) {
+#if 0
+
+void MaterialEditor::_gui_input(InputEvent p_event) {
}
@@ -91,8 +93,8 @@ void MaterialEditor::_button_pressed(Node* p_button) {
void MaterialEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_input_event"),&MaterialEditor::_input_event);
- ObjectTypeDB::bind_method(_MD("_button_pressed"),&MaterialEditor::_button_pressed);
+ ClassDB::bind_method(_MD("_gui_input"),&MaterialEditor::_gui_input);
+ ClassDB::bind_method(_MD("_button_pressed"),&MaterialEditor::_button_pressed);
}
@@ -127,8 +129,8 @@ MaterialEditor::MaterialEditor() {
viewport->add_child(box_instance);
Transform box_xform;
- box_xform.basis.rotate(Vector3(1,0,0),Math::deg2rad(-25));
- box_xform.basis = box_xform.basis * Matrix3().rotated(Vector3(0,1,0),Math::deg2rad(-25));
+ box_xform.basis.rotate(Vector3(1,0,0),Math::deg2rad(25));
+ box_xform.basis = box_xform.basis * Matrix3().rotated(Vector3(0,1,0),Math::deg2rad(25));
box_xform.basis.scale(Vector3(0.8,0.8,0.8));
box_instance->set_transform(box_xform);
@@ -141,10 +143,10 @@ MaterialEditor::MaterialEditor() {
int lons=32;
float radius=1.0;
- DVector<Vector3> vertices;
- DVector<Vector3> normals;
- DVector<Vector2> uvs;
- DVector<float> tangents;
+ PoolVector<Vector3> vertices;
+ PoolVector<Vector3> normals;
+ PoolVector<Vector2> uvs;
+ PoolVector<float> tangents;
Matrix3 tt = Matrix3(Vector3(0,1,0),Math_PI*0.5);
for(int i = 1; i <= lats; i++) {
@@ -219,10 +221,10 @@ MaterialEditor::MaterialEditor() {
box_mesh.instance();
- DVector<Vector3> vertices;
- DVector<Vector3> normals;
- DVector<float> tangents;
- DVector<Vector3> uvs;
+ PoolVector<Vector3> vertices;
+ PoolVector<Vector3> normals;
+ PoolVector<float> tangents;
+ PoolVector<Vector3> uvs;
int vtx_idx=0;
#define ADD_VTX(m_idx);\
@@ -280,7 +282,7 @@ MaterialEditor::MaterialEditor() {
d[VisualServer::ARRAY_TEX_UV]= uvs ;
d[VisualServer::ARRAY_VERTEX]= vertices ;
- DVector<int> indices;
+ PoolVector<int> indices;
indices.resize(vertices.size());
for(int i=0;i<vertices.size();i++)
indices.set(i,i);
@@ -353,11 +355,11 @@ void MaterialEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
material_editor->show();
-// material_editor->set_process(true);
+ //material_editor->set_process(true);
} else {
material_editor->hide();
-// material_editor->set_process(false);
+ //material_editor->set_process(false);
}
}
@@ -379,3 +381,4 @@ MaterialEditorPlugin::~MaterialEditorPlugin()
}
+#endif
diff --git a/tools/editor/plugins/material_editor_plugin.h b/tools/editor/plugins/material_editor_plugin.h
index 49e92493b3..556e56e66b 100644
--- a/tools/editor/plugins/material_editor_plugin.h
+++ b/tools/editor/plugins/material_editor_plugin.h
@@ -8,10 +8,10 @@
#include "scene/3d/mesh_instance.h"
#include "scene/3d/camera.h"
-
+#if 0
class MaterialEditor : public Control {
- OBJ_TYPE(MaterialEditor, Control);
+ GDCLASS(MaterialEditor, Control);
Viewport *viewport;
@@ -39,7 +39,7 @@ class MaterialEditor : public Control {
protected:
void _notification(int p_what);
- void _input_event(InputEvent p_event);
+ void _gui_input(InputEvent p_event);
static void _bind_methods();
public:
@@ -50,7 +50,7 @@ public:
class MaterialEditorPlugin : public EditorPlugin {
- OBJ_TYPE( MaterialEditorPlugin, EditorPlugin );
+ GDCLASS( MaterialEditorPlugin, EditorPlugin );
MaterialEditor *material_editor;
EditorNode *editor;
@@ -69,3 +69,4 @@ public:
};
#endif // MATERIAL_EDITOR_PLUGIN_H
+#endif
diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/tools/editor/plugins/mesh_editor_plugin.cpp
index b70cbad25f..49cb02c9d8 100644
--- a/tools/editor/plugins/mesh_editor_plugin.cpp
+++ b/tools/editor/plugins/mesh_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -28,7 +28,8 @@
/*************************************************************************/
#include "mesh_editor_plugin.h"
-void MeshEditor::_input_event(InputEvent p_event) {
+#if 0
+void MeshEditor::_gui_input(InputEvent p_event) {
if (p_event.type==InputEvent::MOUSE_MOTION && p_event.mouse_motion.button_mask&BUTTON_MASK_LEFT) {
@@ -81,8 +82,8 @@ void MeshEditor::_notification(int p_what) {
void MeshEditor::_update_rotation() {
Transform t;
- t.basis.rotate(Vector3(0, 1, 0), rot_y);
- t.basis.rotate(Vector3(1, 0, 0), rot_x);
+ t.basis.rotate(Vector3(0, 1, 0), -rot_y);
+ t.basis.rotate(Vector3(1, 0, 0), -rot_x);
mesh_instance->set_transform(t);
}
@@ -135,8 +136,8 @@ void MeshEditor::_button_pressed(Node* p_button) {
void MeshEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_input_event"),&MeshEditor::_input_event);
- ObjectTypeDB::bind_method(_MD("_button_pressed"),&MeshEditor::_button_pressed);
+ ClassDB::bind_method(_MD("_gui_input"),&MeshEditor::_gui_input);
+ ClassDB::bind_method(_MD("_button_pressed"),&MeshEditor::_button_pressed);
}
@@ -217,11 +218,11 @@ void MeshEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
mesh_editor->show();
-// mesh_editor->set_process(true);
+ //mesh_editor->set_process(true);
} else {
mesh_editor->hide();
-// mesh_editor->set_process(false);
+ //mesh_editor->set_process(false);
}
}
@@ -241,3 +242,4 @@ MeshEditorPlugin::MeshEditorPlugin(EditorNode *p_node) {
MeshEditorPlugin::~MeshEditorPlugin()
{
}
+#endif
diff --git a/tools/editor/plugins/mesh_editor_plugin.h b/tools/editor/plugins/mesh_editor_plugin.h
index 0715a96e74..136290ffd4 100644
--- a/tools/editor/plugins/mesh_editor_plugin.h
+++ b/tools/editor/plugins/mesh_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -29,6 +29,8 @@
#ifndef MESH_EDITOR_PLUGIN_H
#define MESH_EDITOR_PLUGIN_H
+#if 0
+
#include "tools/editor/editor_plugin.h"
#include "tools/editor/editor_node.h"
#include "scene/resources/material.h"
@@ -38,7 +40,7 @@
class MeshEditor : public Control {
- OBJ_TYPE(MeshEditor, Control);
+ GDCLASS(MeshEditor, Control);
@@ -63,7 +65,7 @@ class MeshEditor : public Control {
void _update_rotation();
protected:
void _notification(int p_what);
- void _input_event(InputEvent p_event);
+ void _gui_input(InputEvent p_event);
static void _bind_methods();
public:
@@ -74,7 +76,7 @@ public:
class MeshEditorPlugin : public EditorPlugin {
- OBJ_TYPE( MeshEditorPlugin, EditorPlugin );
+ GDCLASS( MeshEditorPlugin, EditorPlugin );
MeshEditor *mesh_editor;
EditorNode *editor;
@@ -93,3 +95,4 @@ public:
};
#endif // MESH_EDITOR_PLUGIN_H
+#endif
diff --git a/tools/editor/plugins/mesh_instance_editor_plugin.cpp b/tools/editor/plugins/mesh_instance_editor_plugin.cpp
index c952feb1da..de29991057 100644
--- a/tools/editor/plugins/mesh_instance_editor_plugin.cpp
+++ b/tools/editor/plugins/mesh_instance_editor_plugin.cpp
@@ -189,7 +189,7 @@ void MeshInstanceEditor::_create_outline_mesh() {
return;
}
- Ref<Mesh> mesho = mesh->create_outline(outline_size->get_val());
+ Ref<Mesh> mesho = mesh->create_outline(outline_size->get_value());
if (mesho.is_null()) {
err_dialog->set_text(TTR("Could not create outline!"));
@@ -218,8 +218,8 @@ void MeshInstanceEditor::_create_outline_mesh() {
void MeshInstanceEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_menu_option",&MeshInstanceEditor::_menu_option);
- ObjectTypeDB::bind_method("_create_outline_mesh",&MeshInstanceEditor::_create_outline_mesh);
+ ClassDB::bind_method("_menu_option",&MeshInstanceEditor::_menu_option);
+ ClassDB::bind_method("_create_outline_mesh",&MeshInstanceEditor::_create_outline_mesh);
}
MeshInstanceEditor::MeshInstanceEditor() {
@@ -241,7 +241,7 @@ MeshInstanceEditor::MeshInstanceEditor() {
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Create Outline Mesh.."),MENU_OPTION_CREATE_OUTLINE_MESH);
- options->get_popup()->connect("item_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this,"_menu_option");
outline_dialog = memnew( ConfirmationDialog );
outline_dialog->set_title(TTR("Create Outline Mesh"));
@@ -249,13 +249,13 @@ MeshInstanceEditor::MeshInstanceEditor() {
VBoxContainer *outline_dialog_vbc = memnew( VBoxContainer );
outline_dialog->add_child(outline_dialog_vbc);
- outline_dialog->set_child_rect(outline_dialog_vbc);
+ //outline_dialog->set_child_rect(outline_dialog_vbc);
outline_size = memnew( SpinBox );
outline_size->set_min(0.001);
outline_size->set_max(1024);
outline_size->set_step(0.001);
- outline_size->set_val(0.05);
+ outline_size->set_value(0.05);
outline_dialog_vbc->add_margin_child(TTR("Outline Size:"),outline_size);
add_child(outline_dialog);
@@ -274,7 +274,7 @@ void MeshInstanceEditorPlugin::edit(Object *p_object) {
bool MeshInstanceEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("MeshInstance");
+ return p_object->is_class("MeshInstance");
}
void MeshInstanceEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/mesh_instance_editor_plugin.h b/tools/editor/plugins/mesh_instance_editor_plugin.h
index a698cf382f..23dcbfc9b1 100644
--- a/tools/editor/plugins/mesh_instance_editor_plugin.h
+++ b/tools/editor/plugins/mesh_instance_editor_plugin.h
@@ -10,7 +10,7 @@
class MeshInstanceEditor : public Node {
- OBJ_TYPE(MeshInstanceEditor, Node );
+ GDCLASS(MeshInstanceEditor, Node );
enum Menu {
@@ -48,7 +48,7 @@ public:
class MeshInstanceEditorPlugin : public EditorPlugin {
- OBJ_TYPE( MeshInstanceEditorPlugin, EditorPlugin );
+ GDCLASS( MeshInstanceEditorPlugin, EditorPlugin );
MeshInstanceEditor *mesh_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/multimesh_editor_plugin.cpp b/tools/editor/plugins/multimesh_editor_plugin.cpp
index 8a0c6b3fe8..cce1c52215 100644
--- a/tools/editor/plugins/multimesh_editor_plugin.cpp
+++ b/tools/editor/plugins/multimesh_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -125,7 +125,7 @@ void MultiMeshEditor::_populate() {
Transform geom_xform = node->get_global_transform().affine_inverse() * ss_instance->get_global_transform();
- DVector<Face3> geometry = ss_instance->get_faces(VisualInstance::FACES_SOLID);
+ PoolVector<Face3> geometry = ss_instance->get_faces(VisualInstance::FACES_SOLID);
if (geometry.size()==0) {
@@ -137,7 +137,7 @@ void MultiMeshEditor::_populate() {
//make all faces local
int gc = geometry.size();
- DVector<Face3>::Write w = geometry.write();
+ PoolVector<Face3>::Write w = geometry.write();
for(int i=0;i<gc;i++) {
for(int j=0;j<3;j++) {
@@ -147,7 +147,7 @@ void MultiMeshEditor::_populate() {
- w = DVector<Face3>::Write();
+ w = PoolVector<Face3>::Write();
#if 0
node->get_multimesh()->set_instance_count(populate_amount->get_val());
node->populate_parent(populate_rotate_random->get_val(),populate_tilt_random->get_val(),populate_scale_random->get_val(),populate_scale->get_val());
@@ -164,12 +164,12 @@ void MultiMeshEditor::_populate() {
ERR_FAIL_COND(!vi);
#endif
- DVector<Face3> faces = geometry;
+ PoolVector<Face3> faces = geometry;
ERR_EXPLAIN(TTR("Parent has no solid faces to populate."));
int facecount=faces.size();
ERR_FAIL_COND(!facecount);
- DVector<Face3>::Read r = faces.read();
+ PoolVector<Face3>::Read r = faces.read();
@@ -193,22 +193,24 @@ void MultiMeshEditor::_populate() {
Ref<MultiMesh> multimesh = memnew( MultiMesh );
multimesh->set_mesh(mesh);
- int instance_count=populate_amount->get_val();
+ int instance_count=populate_amount->get_value();
+ multimesh->set_transform_format(MultiMesh::TRANSFORM_3D);
+ multimesh->set_color_format(MultiMesh::COLOR_NONE);
multimesh->set_instance_count(instance_count);
- float _tilt_random = populate_tilt_random->get_val();
- float _rotate_random = populate_rotate_random->get_val();
- float _scale_random = populate_scale_random->get_val();
- float _scale = populate_scale->get_val();
+ float _tilt_random = populate_tilt_random->get_value();
+ float _rotate_random = populate_rotate_random->get_value();
+ float _scale_random = populate_scale_random->get_value();
+ float _scale = populate_scale->get_value();
int axis = populate_axis->get_selected();
Transform axis_xform;
if (axis==Vector3::AXIS_Z) {
- axis_xform.rotate(Vector3(1,0,0),Math_PI*0.5);
+ axis_xform.rotate(Vector3(1,0,0),-Math_PI*0.5);
}
if (axis==Vector3::AXIS_X) {
- axis_xform.rotate(Vector3(0,0,1),Math_PI*0.5);
+ axis_xform.rotate(Vector3(0,0,1),-Math_PI*0.5);
}
for(int i=0;i<instance_count;i++) {
@@ -234,11 +236,12 @@ void MultiMeshEditor::_populate() {
xform = xform * axis_xform;
- Matrix3 post_xform;
+ Basis post_xform;
+
+ post_xform.rotate(xform.basis.get_axis(1),-Math::random(-_rotate_random,_rotate_random)*Math_PI);
+ post_xform.rotate(xform.basis.get_axis(2),-Math::random(-_tilt_random,_tilt_random)*Math_PI);
+ post_xform.rotate(xform.basis.get_axis(0),-Math::random(-_tilt_random,_tilt_random)*Math_PI);
- post_xform.rotate(xform.basis.get_axis(0),Math::random(-_tilt_random,_tilt_random)*Math_PI);
- post_xform.rotate(xform.basis.get_axis(2),Math::random(-_tilt_random,_tilt_random)*Math_PI);
- post_xform.rotate(xform.basis.get_axis(1),Math::random(-_rotate_random,_rotate_random)*Math_PI);
xform.basis = post_xform * xform.basis;
//xform.basis.orthonormalize();
@@ -247,10 +250,10 @@ void MultiMeshEditor::_populate() {
multimesh->set_instance_transform(i,xform);
- multimesh->set_instance_color(i,Color(1,1,1,1));
+
}
- multimesh->generate_aabb();
+
node->set_multimesh(multimesh);
@@ -281,11 +284,11 @@ void MultiMeshEditor::_menu_option(int p_option) {
surface_source->set_text("..");
mesh_source->set_text("..");
populate_axis->select(1);
- populate_rotate_random->set_val(0);
- populate_tilt_random->set_val(0);
- populate_scale_random->set_val(0);
- populate_scale->set_val(1);
- populate_amount->set_val(128);
+ populate_rotate_random->set_value(0);
+ populate_tilt_random->set_value(0);
+ populate_scale_random->set_value(0);
+ populate_scale->set_value(1);
+ populate_amount->set_value(128);
_last_pp_node=node;
}
@@ -315,10 +318,10 @@ void MultiMeshEditor::_browse(bool p_source) {
void MultiMeshEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_menu_option",&MultiMeshEditor::_menu_option);
- ObjectTypeDB::bind_method("_populate",&MultiMeshEditor::_populate);
- ObjectTypeDB::bind_method("_browsed",&MultiMeshEditor::_browsed);
- ObjectTypeDB::bind_method("_browse",&MultiMeshEditor::_browse);
+ ClassDB::bind_method("_menu_option",&MultiMeshEditor::_menu_option);
+ ClassDB::bind_method("_populate",&MultiMeshEditor::_populate);
+ ClassDB::bind_method("_browsed",&MultiMeshEditor::_browsed);
+ ClassDB::bind_method("_browse",&MultiMeshEditor::_browse);
}
MultiMeshEditor::MultiMeshEditor() {
@@ -331,7 +334,7 @@ MultiMeshEditor::MultiMeshEditor() {
options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MultiMeshInstance","EditorIcons"));
options->get_popup()->add_item(TTR("Populate Surface"));
- options->get_popup()->connect("item_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this,"_menu_option");
populate_dialog = memnew( ConfirmationDialog );
populate_dialog->set_title(TTR("Populate MultiMesh"));
@@ -339,7 +342,7 @@ MultiMeshEditor::MultiMeshEditor() {
VBoxContainer *vbc = memnew( VBoxContainer );
populate_dialog->add_child(vbc);
- populate_dialog->set_child_rect(vbc);
+ //populate_dialog->set_child_rect(vbc);
HBoxContainer *hbc = memnew( HBoxContainer );
@@ -385,14 +388,16 @@ MultiMeshEditor::MultiMeshEditor() {
populate_scale_random = memnew( SpinBox );
populate_scale_random->set_min(0);
populate_scale_random->set_max(1);
- populate_scale_random->set_val(0);
+ populate_scale_random->set_value(0);
+ populate_scale_random->set_step(0.01);
vbc->add_margin_child(TTR("Random Scale:"),populate_scale_random);
populate_scale = memnew( SpinBox );
populate_scale->set_min(0.001);
populate_scale->set_max(4096);
- populate_scale->set_val(1);
+ populate_scale->set_value(1);
+ populate_scale->set_step(0.01);
vbc->add_margin_child(TTR("Scale:"),populate_scale);
@@ -403,7 +408,7 @@ MultiMeshEditor::MultiMeshEditor() {
populate_amount->set_end( Point2(5,237));
populate_amount->set_min(1);
populate_amount->set_max(65536);
- populate_amount->set_val(128);
+ populate_amount->set_value(128);
vbc->add_margin_child(TTR("Amount:"),populate_amount);
populate_dialog->get_ok()->set_text(TTR("Populate"));
@@ -427,7 +432,7 @@ void MultiMeshEditorPlugin::edit(Object *p_object) {
bool MultiMeshEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("MultiMeshInstance");
+ return p_object->is_class("MultiMeshInstance");
}
void MultiMeshEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/multimesh_editor_plugin.h b/tools/editor/plugins/multimesh_editor_plugin.h
index 245da1eeb7..e322850238 100644
--- a/tools/editor/plugins/multimesh_editor_plugin.h
+++ b/tools/editor/plugins/multimesh_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,7 +40,7 @@
class MultiMeshEditor : public Control {
- OBJ_TYPE(MultiMeshEditor, Control );
+ GDCLASS(MultiMeshEditor, Control );
friend class MultiMeshEditorPlugin;
@@ -86,7 +86,7 @@ public:
class MultiMeshEditorPlugin : public EditorPlugin {
- OBJ_TYPE( MultiMeshEditorPlugin, EditorPlugin );
+ GDCLASS( MultiMeshEditorPlugin, EditorPlugin );
MultiMeshEditor *multimesh_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp
index 22546c72f3..b2d62af7bb 100644
--- a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp
+++ b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -116,7 +116,7 @@ void NavigationPolygonEditor::_wip_close() {
edited_point=-1;
}
-bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) {
+bool NavigationPolygonEditor::forward_gui_input(const InputEvent& p_event) {
if (!node)
@@ -137,7 +137,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) {
const InputEventMouseButton &mb=p_event.mouse_button;
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Vector2 gpoint = Point2(mb.x,mb.y);
@@ -148,7 +148,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) {
//first check if a point is to be added (segment split)
- real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8);
+ real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8);
switch(mode) {
@@ -211,10 +211,10 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) {
for(int j=0;j<node->get_navigation_polygon()->get_outline_count();j++) {
- DVector<Vector2> points=node->get_navigation_polygon()->get_outline(j);
+ PoolVector<Vector2> points=node->get_navigation_polygon()->get_outline(j);
int pc=points.size();
- DVector<Vector2>::Read poly=points.read();
+ PoolVector<Vector2>::Read poly=points.read();
for(int i=0;i<pc;i++) {
@@ -240,7 +240,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) {
if (closest_idx>=0) {
pre_move_edit=node->get_navigation_polygon()->get_outline(closest_outline);
- DVector<Point2> poly = pre_move_edit;
+ PoolVector<Point2> poly = pre_move_edit;
poly.insert(closest_idx+1,xform.affine_inverse().xform(closest_pos));
edited_point=closest_idx+1;
edited_outline=closest_outline;
@@ -260,10 +260,10 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) {
for(int j=0;j<node->get_navigation_polygon()->get_outline_count();j++) {
- DVector<Vector2> points=node->get_navigation_polygon()->get_outline(j);
+ PoolVector<Vector2> points=node->get_navigation_polygon()->get_outline(j);
int pc=points.size();
- DVector<Vector2>::Read poly=points.read();
+ PoolVector<Vector2>::Read poly=points.read();
for(int i=0;i<pc;i++) {
@@ -296,7 +296,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) {
//apply
- DVector<Vector2> poly = node->get_navigation_polygon()->get_outline(edited_outline);
+ PoolVector<Vector2> poly = node->get_navigation_polygon()->get_outline(edited_outline);
ERR_FAIL_INDEX_V(edited_point,poly.size(),false);
poly.set(edited_point,edited_point_pos);
undo_redo->create_action(TTR("Edit Poly"));
@@ -322,10 +322,10 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) {
for(int j=0;j<node->get_navigation_polygon()->get_outline_count();j++) {
- DVector<Vector2> points=node->get_navigation_polygon()->get_outline(j);
+ PoolVector<Vector2> points=node->get_navigation_polygon()->get_outline(j);
int pc=points.size();
- DVector<Vector2>::Read poly=points.read();
+ PoolVector<Vector2>::Read poly=points.read();
for(int i=0;i<pc;i++) {
@@ -345,7 +345,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) {
if (closest_idx>=0) {
- DVector<Vector2> poly = node->get_navigation_polygon()->get_outline(closest_outline);
+ PoolVector<Vector2> poly = node->get_navigation_polygon()->get_outline(closest_outline);
if (poly.size()>3) {
undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
@@ -411,7 +411,7 @@ void NavigationPolygonEditor::_canvas_draw() {
if (node->get_navigation_polygon().is_null())
return;
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Ref<Texture> handle= get_icon("EditorHandle","EditorIcons");
@@ -477,10 +477,10 @@ void NavigationPolygonEditor::edit(Node *p_collision_polygon) {
void NavigationPolygonEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_menu_option"),&NavigationPolygonEditor::_menu_option);
- ObjectTypeDB::bind_method(_MD("_canvas_draw"),&NavigationPolygonEditor::_canvas_draw);
- ObjectTypeDB::bind_method(_MD("_node_removed"),&NavigationPolygonEditor::_node_removed);
- ObjectTypeDB::bind_method(_MD("_create_nav"),&NavigationPolygonEditor::_create_nav);
+ ClassDB::bind_method(_MD("_menu_option"),&NavigationPolygonEditor::_menu_option);
+ ClassDB::bind_method(_MD("_canvas_draw"),&NavigationPolygonEditor::_canvas_draw);
+ ClassDB::bind_method(_MD("_node_removed"),&NavigationPolygonEditor::_node_removed);
+ ClassDB::bind_method(_MD("_create_nav"),&NavigationPolygonEditor::_create_nav);
}
@@ -515,7 +515,7 @@ NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
- options->get_popup()->connect("item_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
mode = MODE_EDIT;
@@ -532,7 +532,7 @@ void NavigationPolygonEditorPlugin::edit(Object *p_object) {
bool NavigationPolygonEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("NavigationPolygonInstance");
+ return p_object->is_class("NavigationPolygonInstance");
}
void NavigationPolygonEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.h b/tools/editor/plugins/navigation_polygon_editor_plugin.h
index defdebbec2..50df4df744 100644
--- a/tools/editor/plugins/navigation_polygon_editor_plugin.h
+++ b/tools/editor/plugins/navigation_polygon_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -44,7 +44,7 @@ class CanvasItemEditor;
class NavigationPolygonEditor : public HBoxContainer {
- OBJ_TYPE(NavigationPolygonEditor, HBoxContainer );
+ GDCLASS(NavigationPolygonEditor, HBoxContainer );
UndoRedo *undo_redo;
enum Mode {
@@ -70,7 +70,7 @@ class NavigationPolygonEditor : public HBoxContainer {
int edited_outline;
int edited_point;
Vector2 edited_point_pos;
- DVector<Vector2> pre_move_edit;
+ PoolVector<Vector2> pre_move_edit;
Vector<Vector2> wip;
bool wip_active;
@@ -87,21 +87,21 @@ protected:
static void _bind_methods();
public:
- bool forward_input_event(const InputEvent& p_event);
+ bool forward_gui_input(const InputEvent& p_event);
void edit(Node *p_collision_polygon);
NavigationPolygonEditor(EditorNode *p_editor);
};
class NavigationPolygonEditorPlugin : public EditorPlugin {
- OBJ_TYPE( NavigationPolygonEditorPlugin, EditorPlugin );
+ GDCLASS( NavigationPolygonEditorPlugin, EditorPlugin );
NavigationPolygonEditor *collision_polygon_editor;
EditorNode *editor;
public:
- virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "NavigationPolygonInstance"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/particles_2d_editor_plugin.cpp b/tools/editor/plugins/particles_2d_editor_plugin.cpp
index ce25f34c1f..331a958518 100644
--- a/tools/editor/plugins/particles_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/particles_2d_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -43,7 +43,7 @@ void Particles2DEditorPlugin::edit(Object *p_object) {
bool Particles2DEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("Particles2D");
+ return p_object->is_class("Particles2D");
}
void Particles2DEditorPlugin::make_visible(bool p_visible) {
@@ -62,20 +62,20 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) {
print_line("file: "+p_file);
- int epc=epoints->get_val();
+ int epc=epoints->get_value();
Image img;
Error err = ImageLoader::load_image(p_file,&img);
ERR_EXPLAIN(TTR("Error loading image:")+" "+p_file);
ERR_FAIL_COND(err!=OK);
- img.convert(Image::FORMAT_GRAYSCALE_ALPHA);
- ERR_FAIL_COND(img.get_format()!=Image::FORMAT_GRAYSCALE_ALPHA);
+ img.convert(Image::FORMAT_LA8);
+ ERR_FAIL_COND(img.get_format()!=Image::FORMAT_LA8);
Size2i s = Size2(img.get_width(),img.get_height());
ERR_FAIL_COND(s.width==0 || s.height==0);
- DVector<uint8_t> data = img.get_data();
- DVector<uint8_t>::Read r = data.read();
+ PoolVector<uint8_t> data = img.get_data();
+ PoolVector<uint8_t>::Read r = data.read();
Vector<Point2i> valid_positions;
valid_positions.resize(s.width*s.height);
@@ -95,9 +95,9 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) {
ERR_EXPLAIN(TTR("No pixels with transparency > 128 in image.."));
ERR_FAIL_COND(valid_positions.size()==0);
- DVector<Point2> epoints;
+ PoolVector<Point2> epoints;
epoints.resize(epc);
- DVector<Point2>::Write w = epoints.write();
+ PoolVector<Point2>::Write w = epoints.write();
Size2 extents = Size2(img.get_width()*0.5,img.get_height()*0.5);
@@ -108,7 +108,7 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) {
w[i]=p/extents;
}
- w = DVector<Point2>::Write();
+ w = PoolVector<Point2>::Write();
undo_redo->create_action(TTR("Set Emission Mask"));
undo_redo->add_do_method(particles,"set_emission_points",epoints);
@@ -131,7 +131,7 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) {
case MENU_CLEAR_EMISSION_MASK: {
undo_redo->create_action(TTR("Clear Emission Mask"));
- undo_redo->add_do_method(particles,"set_emission_points",DVector<Vector2>());
+ undo_redo->add_do_method(particles,"set_emission_points",PoolVector<Vector2>());
undo_redo->add_undo_method(particles,"set_emission_points",particles->get_emission_points());
undo_redo->commit_action();
} break;
@@ -144,7 +144,7 @@ void Particles2DEditorPlugin::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
- menu->get_popup()->connect("item_pressed",this,"_menu_callback");
+ menu->get_popup()->connect("id_pressed",this,"_menu_callback");
menu->set_icon(menu->get_popup()->get_icon("Particles2D","EditorIcons"));
file->connect("file_selected",this,"_file_selected");
}
@@ -152,8 +152,8 @@ void Particles2DEditorPlugin::_notification(int p_what) {
void Particles2DEditorPlugin::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_menu_callback"),&Particles2DEditorPlugin::_menu_callback);
- ObjectTypeDB::bind_method(_MD("_file_selected"),&Particles2DEditorPlugin::_file_selected);
+ ClassDB::bind_method(_MD("_menu_callback"),&Particles2DEditorPlugin::_menu_callback);
+ ClassDB::bind_method(_MD("_file_selected"),&Particles2DEditorPlugin::_file_selected);
}
@@ -189,7 +189,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) {
epoints->set_min(1);
epoints->set_max(8192);
epoints->set_step(1);
- epoints->set_val(512);
+ epoints->set_value(512);
file->get_vbox()->add_margin_child(TTR("Generated Point Count:"),epoints);
}
diff --git a/tools/editor/plugins/particles_2d_editor_plugin.h b/tools/editor/plugins/particles_2d_editor_plugin.h
index ce2056b482..c532a5fe73 100644
--- a/tools/editor/plugins/particles_2d_editor_plugin.h
+++ b/tools/editor/plugins/particles_2d_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -39,7 +39,7 @@
class Particles2DEditorPlugin : public EditorPlugin {
- OBJ_TYPE( Particles2DEditorPlugin, EditorPlugin );
+ GDCLASS( Particles2DEditorPlugin, EditorPlugin );
enum {
diff --git a/tools/editor/plugins/particles_editor_plugin.cpp b/tools/editor/plugins/particles_editor_plugin.cpp
index 7e20cc3f54..382dc29c61 100644
--- a/tools/editor/plugins/particles_editor_plugin.cpp
+++ b/tools/editor/plugins/particles_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -26,6 +26,8 @@
/* 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 "particles_editor_plugin.h"
#include "io/resource_loader.h"
#include "servers/visual/particle_system_sw.h"
@@ -75,7 +77,7 @@ void ParticlesEditor::_node_selected(const NodePath& p_path){
Transform geom_xform = node->get_global_transform().affine_inverse() * vi->get_global_transform();
int gc = geometry.size();
- DVector<Face3>::Write w = geometry.write();
+ PoolVector<Face3>::Write w = geometry.write();
for(int i=0;i<gc;i++) {
@@ -85,7 +87,7 @@ void ParticlesEditor::_node_selected(const NodePath& p_path){
}
- w = DVector<Face3>::Write();
+ w = PoolVector<Face3>::Write();
emission_dialog->popup_centered(Size2(300,130));
}
@@ -200,7 +202,7 @@ void ParticlesEditor::edit(Particles *p_particles) {
void ParticlesEditor::_generate_emission_points() {
/// hacer codigo aca
- DVector<Vector3> points;
+ PoolVector<Vector3> points;
if (emission_fill->get_selected()==0) {
@@ -254,7 +256,7 @@ void ParticlesEditor::_generate_emission_points() {
return;
}
- DVector<Face3>::Read r = geometry.read();
+ PoolVector<Face3>::Read r = geometry.read();
AABB aabb;
@@ -330,12 +332,12 @@ void ParticlesEditor::_generate_emission_points() {
void ParticlesEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_menu_option",&ParticlesEditor::_menu_option);
- ObjectTypeDB::bind_method("_resource_seleted",&ParticlesEditor::_resource_seleted);
- ObjectTypeDB::bind_method("_node_selected",&ParticlesEditor::_node_selected);
- ObjectTypeDB::bind_method("_generate_emission_points",&ParticlesEditor::_generate_emission_points);
+ ClassDB::bind_method("_menu_option",&ParticlesEditor::_menu_option);
+ ClassDB::bind_method("_resource_seleted",&ParticlesEditor::_resource_seleted);
+ ClassDB::bind_method("_node_selected",&ParticlesEditor::_node_selected);
+ ClassDB::bind_method("_generate_emission_points",&ParticlesEditor::_generate_emission_points);
- //ObjectTypeDB::bind_method("_populate",&ParticlesEditor::_populate);
+ //ClassDB::bind_method("_populate",&ParticlesEditor::_populate);
}
@@ -354,7 +356,7 @@ ParticlesEditor::ParticlesEditor() {
options->get_popup()->add_item(TTR("Create Emitter From Node"),MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE);
options->get_popup()->add_item(TTR("Clear Emitter"),MENU_OPTION_CLEAR_EMISSION_VOLUME);
- options->get_popup()->connect("item_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this,"_menu_option");
emission_dialog = memnew( ConfirmationDialog );
emission_dialog->set_title(TTR("Create Emitter"));
@@ -456,3 +458,4 @@ ParticlesEditorPlugin::~ParticlesEditorPlugin()
}
+#endif
diff --git a/tools/editor/plugins/particles_editor_plugin.h b/tools/editor/plugins/particles_editor_plugin.h
index ff80bffc29..c32fbe5ada 100644
--- a/tools/editor/plugins/particles_editor_plugin.h
+++ b/tools/editor/plugins/particles_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,10 +37,10 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-
+#if 0
class ParticlesEditor : public Control {
- OBJ_TYPE(ParticlesEditor, Control );
+ GDCLASS(ParticlesEditor, Control );
Panel *panel;
MenuButton *options;
@@ -69,7 +69,7 @@ class ParticlesEditor : public Control {
};
- DVector<Face3> geometry;
+ PoolVector<Face3> geometry;
void _generate_emission_points();
void _resource_seleted(const String& p_res);
@@ -94,7 +94,7 @@ public:
class ParticlesEditorPlugin : public EditorPlugin {
- OBJ_TYPE( ParticlesEditorPlugin, EditorPlugin );
+ GDCLASS( ParticlesEditorPlugin, EditorPlugin );
ParticlesEditor *particles_editor;
EditorNode *editor;
@@ -113,3 +113,4 @@ public:
};
#endif // PARTICLES_EDITOR_PLUGIN_H
+#endif
diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp
index 95f330a1d5..8e475e56f7 100644
--- a/tools/editor/plugins/path_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/path_2d_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -38,7 +38,7 @@ void Path2DEditor::_notification(int p_what) {
case NOTIFICATION_READY: {
-// button_create->set_icon( get_icon("Edit","EditorIcons"));
+ //button_create->set_icon( get_icon("Edit","EditorIcons"));
//button_edit->set_icon( get_icon("MovePoint","EditorIcons"));
//set_pressed_button(button_edit);
//button_edit->set_pressed(true);
@@ -62,12 +62,12 @@ void Path2DEditor::_node_removed(Node *p_node) {
}
-bool Path2DEditor::forward_input_event(const InputEvent& p_event) {
+bool Path2DEditor::forward_gui_input(const InputEvent& p_event) {
if (!node)
return false;
- if (!node->is_visible())
+ if (!node->is_visible_in_tree())
return false;
if (!node->get_curve().is_valid())
@@ -79,14 +79,14 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) {
const InputEventMouseButton &mb=p_event.mouse_button;
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Vector2 gpoint = Point2(mb.x,mb.y);
Vector2 cpoint = !mb.mod.alt? canvas_item_editor->snap_point(xform.affine_inverse().xform(gpoint))
: node->get_global_transform().affine_inverse().xform( canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint)) );
//first check if a point is to be added (segment split)
- real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8);
+ real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8);
@@ -421,7 +421,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) {
if ( action!=ACTION_NONE) {
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Vector2 gpoint = Point2(mm.x,mm.y);
Vector2 cpoint = !mm.mod.alt? canvas_item_editor->snap_point(xform.affine_inverse().xform(gpoint))
: node->get_global_transform().affine_inverse().xform( canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint)) );
@@ -475,13 +475,13 @@ void Path2DEditor::_canvas_draw() {
if (!node)
return ;
- if (!node->is_visible())
+ if (!node->is_visible_in_tree())
return;
if (!node->get_curve().is_valid())
return ;
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Ref<Texture> handle= get_icon("EditorHandle","EditorIcons");
Size2 handle_size = handle->get_size();
@@ -550,10 +550,10 @@ void Path2DEditor::edit(Node *p_path2d) {
void Path2DEditor::_bind_methods() {
- //ObjectTypeDB::bind_method(_MD("_menu_option"),&Path2DEditor::_menu_option);
- ObjectTypeDB::bind_method(_MD("_canvas_draw"),&Path2DEditor::_canvas_draw);
- ObjectTypeDB::bind_method(_MD("_node_visibility_changed"),&Path2DEditor::_node_visibility_changed);
- ObjectTypeDB::bind_method(_MD("_mode_selected"),&Path2DEditor::_mode_selected);
+ //ClassDB::bind_method(_MD("_menu_option"),&Path2DEditor::_menu_option);
+ ClassDB::bind_method(_MD("_canvas_draw"),&Path2DEditor::_canvas_draw);
+ ClassDB::bind_method(_MD("_node_visibility_changed"),&Path2DEditor::_node_visibility_changed);
+ ClassDB::bind_method(_MD("_mode_selected"),&Path2DEditor::_mode_selected);
}
void Path2DEditor::_mode_selected(int p_mode) {
@@ -624,7 +624,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
- options->get_popup()->connect("item_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
base_hb = memnew( HBoxContainer );
@@ -683,7 +683,7 @@ void Path2DEditorPlugin::edit(Object *p_object) {
bool Path2DEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("Path2D");
+ return p_object->is_class("Path2D");
}
void Path2DEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/path_2d_editor_plugin.h b/tools/editor/plugins/path_2d_editor_plugin.h
index acbc481e09..aa940e4edf 100644
--- a/tools/editor/plugins/path_2d_editor_plugin.h
+++ b/tools/editor/plugins/path_2d_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -42,7 +42,7 @@ class CanvasItemEditor;
class Path2DEditor : public HBoxContainer {
- OBJ_TYPE(Path2DEditor, HBoxContainer);
+ GDCLASS(Path2DEditor, HBoxContainer);
UndoRedo *undo_redo;
@@ -94,21 +94,21 @@ protected:
static void _bind_methods();
public:
- bool forward_input_event(const InputEvent& p_event);
+ bool forward_gui_input(const InputEvent& p_event);
void edit(Node *p_path2d);
Path2DEditor(EditorNode *p_editor);
};
class Path2DEditorPlugin : public EditorPlugin {
- OBJ_TYPE( Path2DEditorPlugin, EditorPlugin );
+ GDCLASS( Path2DEditorPlugin, EditorPlugin );
Path2DEditor *path2d_editor;
EditorNode *editor;
public:
- virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return path2d_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return path2d_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "Path2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/path_editor_plugin.cpp b/tools/editor/plugins/path_editor_plugin.cpp
index 33ef71efab..4f0afe9e94 100644
--- a/tools/editor/plugins/path_editor_plugin.cpp
+++ b/tools/editor/plugins/path_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -31,6 +31,7 @@
#include "scene/resources/curve.h"
#include "os/keyboard.h"
+#if 0
String PathSpatialGizmo::get_handle_name(int p_idx) const {
Ref<Curve3D> c = path->get_curve();
@@ -103,6 +104,12 @@ void PathSpatialGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_po
if (p.intersects_ray(ray_from,ray_dir,&inters)) {
+ if(SpatialEditor::get_singleton()->is_snap_enabled())
+ {
+ float snap = SpatialEditor::get_singleton()->get_translate_snap();
+ inters.snap(snap);
+ }
+
Vector3 local = gi.xform(inters);
c->set_point_pos(p_idx,local);
}
@@ -278,7 +285,7 @@ Ref<SpatialEditorGizmo> PathEditorPlugin::create_spatial_gizmo(Spatial* p_spatia
return Ref<SpatialEditorGizmo>();
}
-bool PathEditorPlugin::forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event) {
+bool PathEditorPlugin::forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) {
if (!path)
return false;
@@ -442,7 +449,7 @@ void PathEditorPlugin::edit(Object *p_object) {
pre->get_curve()->emit_signal("changed");
}
}
-// collision_polygon_editor->edit(p_object->cast_to<Node>());
+ //collision_polygon_editor->edit(p_object->cast_to<Node>());
}
bool PathEditorPlugin::handles(Object *p_object) const {
@@ -509,8 +516,8 @@ void PathEditorPlugin::_notification(int p_what) {
void PathEditorPlugin::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_mode_changed"),&PathEditorPlugin::_mode_changed);
- ObjectTypeDB::bind_method(_MD("_close_curve"),&PathEditorPlugin::_close_curve);
+ ClassDB::bind_method(_MD("_mode_changed"),&PathEditorPlugin::_mode_changed);
+ ClassDB::bind_method(_MD("_close_curve"),&PathEditorPlugin::_close_curve);
}
PathEditorPlugin* PathEditorPlugin::singleton=NULL;
@@ -522,21 +529,21 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) {
editor=p_node;
singleton=this;
- path_material = Ref<FixedMaterial>( memnew( FixedMaterial ));
- path_material->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.5,0.5,1.0,0.8) );
- path_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
+ path_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ path_material->set_parameter( FixedSpatialMaterial::PARAM_DIFFUSE,Color(0.5,0.5,1.0,0.8) );
+ path_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
path_material->set_line_width(3);
path_material->set_flag(Material::FLAG_DOUBLE_SIDED,true);
path_material->set_flag(Material::FLAG_UNSHADED,true);
- path_thin_material = Ref<FixedMaterial>( memnew( FixedMaterial ));
- path_thin_material->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.5,0.5,1.0,0.4) );
- path_thin_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
+ path_thin_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ path_thin_material->set_parameter( FixedSpatialMaterial::PARAM_DIFFUSE,Color(0.5,0.5,1.0,0.4) );
+ path_thin_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true);
path_thin_material->set_line_width(1);
path_thin_material->set_flag(Material::FLAG_DOUBLE_SIDED,true);
path_thin_material->set_flag(Material::FLAG_UNSHADED,true);
-// SpatialEditor::get_singleton()->add_gizmo_plugin(this);
+ //SpatialEditor::get_singleton()->add_gizmo_plugin(this);
sep = memnew( VSeparator);
sep->hide();
@@ -593,3 +600,4 @@ PathEditorPlugin::~PathEditorPlugin()
{
}
+#endif
diff --git a/tools/editor/plugins/path_editor_plugin.h b/tools/editor/plugins/path_editor_plugin.h
index 0afd957af7..79e978dc1d 100644
--- a/tools/editor/plugins/path_editor_plugin.h
+++ b/tools/editor/plugins/path_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -32,9 +32,10 @@
#include "tools/editor/spatial_editor_gizmos.h"
#include "scene/3d/path.h"
+# if 0
class PathSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(PathSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(PathSpatialGizmo,EditorSpatialGizmo);
Path* path;
mutable Vector3 original;
@@ -53,7 +54,7 @@ public:
class PathEditorPlugin : public EditorPlugin {
- OBJ_TYPE( PathEditorPlugin, EditorPlugin );
+ GDCLASS( PathEditorPlugin, EditorPlugin );
Separator *sep;
@@ -78,11 +79,11 @@ public:
Path *get_edited_path() { return path; }
static PathEditorPlugin* singleton;
- Ref<FixedMaterial> path_material;
- Ref<FixedMaterial> path_thin_material;
- virtual bool forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event);
+ Ref<FixedSpatialMaterial> path_material;
+ Ref<FixedSpatialMaterial> path_thin_material;
+ virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event);
-// virtual bool forward_input_event(const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ //virtual bool forward_gui_input(const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial);
virtual String get_name() const { return "Path"; }
bool has_main_screen() const { return false; }
@@ -95,5 +96,5 @@ public:
};
-
+#endif
#endif // PATH_EDITOR_PLUGIN_H
diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp
index 19d1ccc06f..dc56348700 100644
--- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -102,8 +102,8 @@ void Polygon2DEditor::_menu_option(int p_option) {
}
- DVector<Vector2> points = node->get_polygon();
- DVector<Vector2> uvs = node->get_uv();
+ PoolVector<Vector2> points = node->get_polygon();
+ PoolVector<Vector2> uvs = node->get_uv();
if (uvs.size()!=points.size()) {
undo_redo->create_action(TTR("Create UV Map"));
undo_redo->add_do_method(node,"set_uv",points);
@@ -119,10 +119,10 @@ void Polygon2DEditor::_menu_option(int p_option) {
} break;
case UVEDIT_POLYGON_TO_UV: {
- DVector<Vector2> points = node->get_polygon();
+ PoolVector<Vector2> points = node->get_polygon();
if (points.size()==0)
break;
- DVector<Vector2> uvs = node->get_uv();
+ PoolVector<Vector2> uvs = node->get_uv();
undo_redo->create_action(TTR("Create UV Map"));
undo_redo->add_do_method(node,"set_uv",points);
undo_redo->add_undo_method(node,"set_uv",uvs);
@@ -134,8 +134,8 @@ void Polygon2DEditor::_menu_option(int p_option) {
} break;
case UVEDIT_UV_TO_POLYGON: {
- DVector<Vector2> points = node->get_polygon();
- DVector<Vector2> uvs = node->get_uv();
+ PoolVector<Vector2> points = node->get_polygon();
+ PoolVector<Vector2> uvs = node->get_uv();
if (uvs.size()==0)
break;
@@ -149,11 +149,11 @@ void Polygon2DEditor::_menu_option(int p_option) {
} break;
case UVEDIT_UV_CLEAR: {
- DVector<Vector2> uvs = node->get_uv();
+ PoolVector<Vector2> uvs = node->get_uv();
if (uvs.size()==0)
break;
undo_redo->create_action(TTR("Create UV Map"));
- undo_redo->add_do_method(node,"set_uv",DVector<Vector2>());
+ undo_redo->add_do_method(node,"set_uv",PoolVector<Vector2>());
undo_redo->add_undo_method(node,"set_uv",uvs);
undo_redo->add_do_method(uv_edit_draw,"update");
undo_redo->add_undo_method(uv_edit_draw,"update");
@@ -216,7 +216,7 @@ void Polygon2DEditor::_wip_close() {
edited_point=-1;
}
-bool Polygon2DEditor::forward_input_event(const InputEvent& p_event) {
+bool Polygon2DEditor::forward_gui_input(const InputEvent& p_event) {
if (node==NULL)
return false;
@@ -227,7 +227,7 @@ bool Polygon2DEditor::forward_input_event(const InputEvent& p_event) {
const InputEventMouseButton &mb=p_event.mouse_button;
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Vector2 gpoint = Point2(mb.x,mb.y);
@@ -239,7 +239,7 @@ bool Polygon2DEditor::forward_input_event(const InputEvent& p_event) {
Vector<Vector2> poly = Variant(node->get_polygon());
//first check if a point is to be added (segment split)
- real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8);
+ real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8);
switch(mode) {
@@ -463,7 +463,7 @@ void Polygon2DEditor::_canvas_draw() {
poly=Variant(node->get_polygon());
- Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Ref<Texture> handle= get_icon("EditorHandle","EditorIcons");
for(int i=0;i<poly.size();i++) {
@@ -499,7 +499,7 @@ void Polygon2DEditor::_uv_mode(int p_mode) {
void Polygon2DEditor::_uv_input(const InputEvent& p_input) {
- Matrix32 mtx;
+ Transform2D mtx;
mtx.elements[2]=-uv_draw_ofs;
mtx.scale_basis(Vector2(uv_draw_zoom,uv_draw_zoom));
@@ -567,10 +567,10 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) {
} else if (mb.button_index==BUTTON_WHEEL_UP && mb.pressed) {
- uv_zoom->set_val( uv_zoom->get_val()/0.9 );
+ uv_zoom->set_value( uv_zoom->get_value()/0.9 );
} else if (mb.button_index==BUTTON_WHEEL_DOWN && mb.pressed) {
- uv_zoom->set_val( uv_zoom->get_val()*0.9);
+ uv_zoom->set_value( uv_zoom->get_value()*0.9);
}
} else if (p_input.type==InputEvent::MOUSE_MOTION) {
@@ -580,8 +580,8 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) {
if (mm.button_mask&BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) {
Vector2 drag(mm.relative_x,mm.relative_y);
- uv_hscroll->set_val( uv_hscroll->get_val()-drag.x );
- uv_vscroll->set_val( uv_vscroll->get_val()-drag.y );
+ uv_hscroll->set_value( uv_hscroll->get_value()-drag.x );
+ uv_vscroll->set_value( uv_vscroll->get_value()-drag.y );
} else if (uv_drag) {
@@ -593,13 +593,13 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) {
case UV_MODE_EDIT_POINT: {
- DVector<Vector2> uv_new=uv_prev;
+ PoolVector<Vector2> uv_new=uv_prev;
uv_new.set( uv_drag_index, uv_new[uv_drag_index]+drag );
node->set_uv(uv_new);
} break;
case UV_MODE_MOVE: {
- DVector<Vector2> uv_new=uv_prev;
+ PoolVector<Vector2> uv_new=uv_prev;
for(int i=0;i<uv_new.size();i++)
uv_new.set( i, uv_new[i]+drag );
@@ -610,7 +610,7 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) {
case UV_MODE_ROTATE: {
Vector2 center;
- DVector<Vector2> uv_new=uv_prev;
+ PoolVector<Vector2> uv_new=uv_prev;
for(int i=0;i<uv_new.size();i++)
center+=uv_prev[i];
@@ -630,7 +630,7 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) {
case UV_MODE_SCALE: {
Vector2 center;
- DVector<Vector2> uv_new=uv_prev;
+ PoolVector<Vector2> uv_new=uv_prev;
for(int i=0;i<uv_new.size();i++)
center+=uv_prev[i];
@@ -668,9 +668,9 @@ void Polygon2DEditor::_uv_scroll_changed(float) {
if (updating_uv_scroll)
return;
- uv_draw_ofs.x=uv_hscroll->get_val();
- uv_draw_ofs.y=uv_vscroll->get_val();
- uv_draw_zoom=uv_zoom->get_val();
+ uv_draw_ofs.x=uv_hscroll->get_value();
+ uv_draw_ofs.y=uv_vscroll->get_value();
+ uv_draw_zoom=uv_zoom->get_value();
uv_edit_draw->update();
}
@@ -680,14 +680,13 @@ void Polygon2DEditor::_uv_draw() {
if (base_tex.is_null())
return;
- Matrix32 mtx;
+ Transform2D mtx;
mtx.elements[2]=-uv_draw_ofs;
mtx.scale_basis(Vector2(uv_draw_zoom,uv_draw_zoom));
- VS::get_singleton()->canvas_item_set_clip(uv_edit_draw->get_canvas_item(),true);
VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(),mtx);
uv_edit_draw->draw_texture(base_tex,Point2());
- VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(),Matrix32());
+ VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(),Transform2D());
if (snap_show_grid) {
Size2 s = uv_edit_draw->get_size();
@@ -716,7 +715,7 @@ void Polygon2DEditor::_uv_draw() {
}
}
- DVector<Vector2> uvs = node->get_uv();
+ PoolVector<Vector2> uvs = node->get_uv();
Ref<Texture> handle = get_icon("EditorHandle","EditorIcons");
Rect2 rect(Point2(),mtx.basis_xform(base_tex->get_size()));
@@ -735,13 +734,13 @@ void Polygon2DEditor::_uv_draw() {
uv_hscroll->set_min(rect.pos.x);
uv_hscroll->set_max(rect.pos.x+rect.size.x);
uv_hscroll->set_page(uv_edit_draw->get_size().x);
- uv_hscroll->set_val(uv_draw_ofs.x);
+ uv_hscroll->set_value(uv_draw_ofs.x);
uv_hscroll->set_step(0.001);
uv_vscroll->set_min(rect.pos.y);
uv_vscroll->set_max(rect.pos.y+rect.size.y);
uv_vscroll->set_page(uv_edit_draw->get_size().y);
- uv_vscroll->set_val(uv_draw_ofs.y);
+ uv_vscroll->set_value(uv_draw_ofs.y);
uv_vscroll->set_step(0.001);
updating_uv_scroll=false;
@@ -776,19 +775,19 @@ void Polygon2DEditor::edit(Node *p_collision_polygon) {
void Polygon2DEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_menu_option"),&Polygon2DEditor::_menu_option);
- ObjectTypeDB::bind_method(_MD("_canvas_draw"),&Polygon2DEditor::_canvas_draw);
- ObjectTypeDB::bind_method(_MD("_uv_mode"),&Polygon2DEditor::_uv_mode);
- ObjectTypeDB::bind_method(_MD("_uv_draw"),&Polygon2DEditor::_uv_draw);
- ObjectTypeDB::bind_method(_MD("_uv_input"),&Polygon2DEditor::_uv_input);
- ObjectTypeDB::bind_method(_MD("_uv_scroll_changed"),&Polygon2DEditor::_uv_scroll_changed);
- ObjectTypeDB::bind_method(_MD("_node_removed"),&Polygon2DEditor::_node_removed);
- ObjectTypeDB::bind_method(_MD("_set_use_snap"),&Polygon2DEditor::_set_use_snap);
- ObjectTypeDB::bind_method(_MD("_set_show_grid"),&Polygon2DEditor::_set_show_grid);
- ObjectTypeDB::bind_method(_MD("_set_snap_off_x"),&Polygon2DEditor::_set_snap_off_x);
- ObjectTypeDB::bind_method(_MD("_set_snap_off_y"),&Polygon2DEditor::_set_snap_off_y);
- ObjectTypeDB::bind_method(_MD("_set_snap_step_x"),&Polygon2DEditor::_set_snap_step_x);
- ObjectTypeDB::bind_method(_MD("_set_snap_step_y"),&Polygon2DEditor::_set_snap_step_y);
+ ClassDB::bind_method(_MD("_menu_option"),&Polygon2DEditor::_menu_option);
+ ClassDB::bind_method(_MD("_canvas_draw"),&Polygon2DEditor::_canvas_draw);
+ ClassDB::bind_method(_MD("_uv_mode"),&Polygon2DEditor::_uv_mode);
+ ClassDB::bind_method(_MD("_uv_draw"),&Polygon2DEditor::_uv_draw);
+ ClassDB::bind_method(_MD("_uv_input"),&Polygon2DEditor::_uv_input);
+ ClassDB::bind_method(_MD("_uv_scroll_changed"),&Polygon2DEditor::_uv_scroll_changed);
+ ClassDB::bind_method(_MD("_node_removed"),&Polygon2DEditor::_node_removed);
+ ClassDB::bind_method(_MD("_set_use_snap"),&Polygon2DEditor::_set_use_snap);
+ ClassDB::bind_method(_MD("_set_show_grid"),&Polygon2DEditor::_set_show_grid);
+ ClassDB::bind_method(_MD("_set_snap_off_x"),&Polygon2DEditor::_set_snap_off_x);
+ ClassDB::bind_method(_MD("_set_snap_off_y"),&Polygon2DEditor::_set_snap_off_y);
+ ClassDB::bind_method(_MD("_set_snap_step_x"),&Polygon2DEditor::_set_snap_step_x);
+ ClassDB::bind_method(_MD("_set_snap_step_y"),&Polygon2DEditor::_set_snap_step_y);
}
@@ -840,7 +839,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
options->set_area_as_parent_rect();
options->set_text("Polygon");
//options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE);
- options->get_popup()->connect("item_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
mode = MODE_EDIT;
@@ -850,11 +849,11 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
uv_edit = memnew( AcceptDialog );
add_child(uv_edit);
uv_edit->set_title(TTR("Polygon 2D UV Editor"));
- uv_edit->set_self_opacity(0.9);
+ uv_edit->set_self_modulate(Color(1,1,1,0.9));
VBoxContainer *uv_main_vb = memnew( VBoxContainer );
uv_edit->add_child(uv_main_vb);
- uv_edit->set_child_rect(uv_main_vb);
+ //uv_edit->set_child_rect(uv_main_vb);
HBoxContainer *uv_mode_hb = memnew( HBoxContainer );
uv_main_vb->add_child(uv_mode_hb);
for(int i=0;i<UV_MODE_MAX;i++) {
@@ -885,7 +884,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
uv_menu->get_popup()->add_item(TTR("UV->Polygon"),UVEDIT_UV_TO_POLYGON);
uv_menu->get_popup()->add_separator();
uv_menu->get_popup()->add_item(TTR("Clear UV"),UVEDIT_UV_CLEAR);
- uv_menu->get_popup()->connect("item_pressed",this,"_menu_option");
+ uv_menu->get_popup()->connect("id_pressed",this,"_menu_option");
uv_mode_hb->add_child( memnew( VSeparator ));
@@ -914,7 +913,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
sb_off_x->set_min(-256);
sb_off_x->set_max(256);
sb_off_x->set_step(1);
- sb_off_x->set_val(snap_offset.x);
+ sb_off_x->set_value(snap_offset.x);
sb_off_x->set_suffix("px");
sb_off_x->connect("value_changed", this, "_set_snap_off_x");
uv_mode_hb->add_child(sb_off_x);
@@ -923,7 +922,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
sb_off_y->set_min(-256);
sb_off_y->set_max(256);
sb_off_y->set_step(1);
- sb_off_y->set_val(snap_offset.y);
+ sb_off_y->set_value(snap_offset.y);
sb_off_y->set_suffix("px");
sb_off_y->connect("value_changed", this, "_set_snap_off_y");
uv_mode_hb->add_child(sb_off_y);
@@ -935,7 +934,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
sb_step_x->set_min(-256);
sb_step_x->set_max(256);
sb_step_x->set_step(1);
- sb_step_x->set_val(snap_step.x);
+ sb_step_x->set_value(snap_step.x);
sb_step_x->set_suffix("px");
sb_step_x->connect("value_changed", this, "_set_snap_step_x");
uv_mode_hb->add_child(sb_step_x);
@@ -944,18 +943,18 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
sb_step_y->set_min(-256);
sb_step_y->set_max(256);
sb_step_y->set_step(1);
- sb_step_y->set_val(snap_step.y);
+ sb_step_y->set_value(snap_step.y);
sb_step_y->set_suffix("px");
sb_step_y->connect("value_changed", this, "_set_snap_step_y");
uv_mode_hb->add_child(sb_step_y);
uv_mode_hb->add_child( memnew( VSeparator ));
- uv_icon_zoom = memnew( TextureFrame );
+ uv_icon_zoom = memnew( TextureRect );
uv_mode_hb->add_child( uv_icon_zoom );
uv_zoom = memnew( HSlider );
uv_zoom->set_min(0.01);
uv_zoom->set_max(4);
- uv_zoom->set_val(1);
+ uv_zoom->set_value(1);
uv_zoom->set_step(0.01);
uv_mode_hb->add_child(uv_zoom);
uv_zoom->set_custom_minimum_size(Size2(200,0));
@@ -975,7 +974,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
uv_hscroll->connect("value_changed",this,"_uv_scroll_changed");
uv_edit_draw->connect("draw",this,"_uv_draw");
- uv_edit_draw->connect("input_event",this,"_uv_input");
+ uv_edit_draw->connect("gui_input",this,"_uv_input");
uv_draw_zoom=1.0;
uv_drag_index=-1;
uv_drag=false;
@@ -984,6 +983,8 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) {
error = memnew( AcceptDialog);
add_child(error);
+ uv_edit_draw->set_clip_contents(true);
+
}
@@ -995,7 +996,7 @@ void Polygon2DEditorPlugin::edit(Object *p_object) {
bool Polygon2DEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("Polygon2D");
+ return p_object->is_class("Polygon2D");
}
void Polygon2DEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.h b/tools/editor/plugins/polygon_2d_editor_plugin.h
index 33bae94340..6011ee1f87 100644
--- a/tools/editor/plugins/polygon_2d_editor_plugin.h
+++ b/tools/editor/plugins/polygon_2d_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -42,7 +42,7 @@ class CanvasItemEditor;
class Polygon2DEditor : public HBoxContainer {
- OBJ_TYPE(Polygon2DEditor, HBoxContainer );
+ GDCLASS(Polygon2DEditor, HBoxContainer );
UndoRedo *undo_redo;
enum Mode {
@@ -77,11 +77,11 @@ class Polygon2DEditor : public HBoxContainer {
HScrollBar *uv_hscroll;
VScrollBar *uv_vscroll;
MenuButton *uv_menu;
- TextureFrame *uv_icon_zoom;
+ TextureRect *uv_icon_zoom;
Vector2 uv_draw_ofs;
float uv_draw_zoom;
- DVector<Vector2> uv_prev;
+ PoolVector<Vector2> uv_prev;
int uv_drag_index;
bool uv_drag;
UVMode uv_move_current;
@@ -137,21 +137,21 @@ protected:
public:
- bool forward_input_event(const InputEvent& p_event);
+ bool forward_gui_input(const InputEvent& p_event);
void edit(Node *p_collision_polygon);
Polygon2DEditor(EditorNode *p_editor);
};
class Polygon2DEditorPlugin : public EditorPlugin {
- OBJ_TYPE( Polygon2DEditorPlugin, EditorPlugin );
+ GDCLASS( Polygon2DEditorPlugin, EditorPlugin );
Polygon2DEditor *collision_polygon_editor;
EditorNode *editor;
public:
- virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "Polygon2D"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.cpp b/tools/editor/plugins/resource_preloader_editor_plugin.cpp
index cce0ba3d62..0799732e02 100644
--- a/tools/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/tools/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -30,11 +30,11 @@
#include "io/resource_loader.h"
#include "globals.h"
#include "tools/editor/editor_settings.h"
-#include "scene/resources/scene_preloader.h"
-void ResourcePreloaderEditor::_input_event(InputEvent p_event) {
+
+void ResourcePreloaderEditor::_gui_input(InputEvent p_event) {
}
@@ -52,7 +52,7 @@ void ResourcePreloaderEditor::_notification(int p_what) {
if (p_what==NOTIFICATION_READY) {
-// NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true);
+ //NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true);
}
if (p_what==NOTIFICATION_DRAW) {
@@ -79,7 +79,7 @@ void ResourcePreloaderEditor::_files_load_request(const Vector<String>& p_paths)
}
- String basename = path.get_file().basename();
+ String basename = path.get_file().get_basename();
String name=basename;
int counter=1;
while(preloader->has_resource(name)) {
@@ -179,7 +179,7 @@ void ResourcePreloaderEditor::_paste_pressed() {
if (name=="")
name=r->get_path().get_file();
if (name=="")
- name=r->get_type();
+ name=r->get_class();
String basename = name;
int counter=1;
@@ -248,7 +248,7 @@ void ResourcePreloaderEditor::_update_library() {
ERR_CONTINUE(r.is_null());
ti->set_tooltip(0,r->get_path());
- String type = r->get_type();
+ String type = r->get_class();
ti->set_text(1,type);
ti->set_selectable(1,false);
@@ -347,7 +347,7 @@ void ResourcePreloaderEditor::drop_data_fw(const Point2& p_point,const Variant&
if (r->get_name()!="") {
basename=r->get_name();
} else if (r->get_path().is_resource_file()) {
- basename = r->get_path().basename();
+ basename = r->get_path().get_basename();
} else {
basename="Resource";
}
@@ -381,19 +381,19 @@ void ResourcePreloaderEditor::drop_data_fw(const Point2& p_point,const Variant&
void ResourcePreloaderEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_input_event"),&ResourcePreloaderEditor::_input_event);
- ObjectTypeDB::bind_method(_MD("_load_pressed"),&ResourcePreloaderEditor::_load_pressed);
- ObjectTypeDB::bind_method(_MD("_item_edited"),&ResourcePreloaderEditor::_item_edited);
- ObjectTypeDB::bind_method(_MD("_delete_pressed"),&ResourcePreloaderEditor::_delete_pressed);
- ObjectTypeDB::bind_method(_MD("_paste_pressed"),&ResourcePreloaderEditor::_paste_pressed);
- ObjectTypeDB::bind_method(_MD("_delete_confirm_pressed"),&ResourcePreloaderEditor::_delete_confirm_pressed);
- ObjectTypeDB::bind_method(_MD("_files_load_request"),&ResourcePreloaderEditor::_files_load_request);
- ObjectTypeDB::bind_method(_MD("_update_library"),&ResourcePreloaderEditor::_update_library);
+ ClassDB::bind_method(_MD("_gui_input"),&ResourcePreloaderEditor::_gui_input);
+ ClassDB::bind_method(_MD("_load_pressed"),&ResourcePreloaderEditor::_load_pressed);
+ ClassDB::bind_method(_MD("_item_edited"),&ResourcePreloaderEditor::_item_edited);
+ ClassDB::bind_method(_MD("_delete_pressed"),&ResourcePreloaderEditor::_delete_pressed);
+ ClassDB::bind_method(_MD("_paste_pressed"),&ResourcePreloaderEditor::_paste_pressed);
+ ClassDB::bind_method(_MD("_delete_confirm_pressed"),&ResourcePreloaderEditor::_delete_confirm_pressed);
+ ClassDB::bind_method(_MD("_files_load_request"),&ResourcePreloaderEditor::_files_load_request);
+ ClassDB::bind_method(_MD("_update_library"),&ResourcePreloaderEditor::_update_library);
- ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &ResourcePreloaderEditor::get_drag_data_fw);
- ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &ResourcePreloaderEditor::can_drop_data_fw);
- ObjectTypeDB::bind_method(_MD("drop_data_fw"), &ResourcePreloaderEditor::drop_data_fw);
+ ClassDB::bind_method(_MD("get_drag_data_fw"), &ResourcePreloaderEditor::get_drag_data_fw);
+ ClassDB::bind_method(_MD("can_drop_data_fw"), &ResourcePreloaderEditor::can_drop_data_fw);
+ ClassDB::bind_method(_MD("drop_data_fw"), &ResourcePreloaderEditor::drop_data_fw);
}
@@ -462,7 +462,7 @@ void ResourcePreloaderEditorPlugin::edit(Object *p_object) {
bool ResourcePreloaderEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("ResourcePreloader");
+ return p_object->is_class("ResourcePreloader");
}
void ResourcePreloaderEditorPlugin::make_visible(bool p_visible) {
@@ -471,14 +471,14 @@ void ResourcePreloaderEditorPlugin::make_visible(bool p_visible) {
//preloader_editor->show();
button->show();
editor->make_bottom_panel_item_visible(preloader_editor);
-// preloader_editor->set_process(true);
+ //preloader_editor->set_process(true);
} else {
- if (preloader_editor->is_visible())
+ if (preloader_editor->is_visible_in_tree())
editor->hide_bottom_panel();
button->hide();
//preloader_editor->hide();
-// preloader_editor->set_process(false);
+ //preloader_editor->set_process(false);
}
}
@@ -492,8 +492,8 @@ ResourcePreloaderEditorPlugin::ResourcePreloaderEditorPlugin(EditorNode *p_node)
button=editor->add_bottom_panel_item("ResourcePreloader",preloader_editor);
button->hide();
-// preloader_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END);
-// preloader_editor->set_margin( MARGIN_TOP, 120 );
+ //preloader_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END);
+ //preloader_editor->set_margin( MARGIN_TOP, 120 );
diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.h b/tools/editor/plugins/resource_preloader_editor_plugin.h
index 4f0cb4be37..6990301ded 100644
--- a/tools/editor/plugins/resource_preloader_editor_plugin.h
+++ b/tools/editor/plugins/resource_preloader_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,7 +40,7 @@
class ResourcePreloaderEditor : public PanelContainer {
- OBJ_TYPE(ResourcePreloaderEditor, PanelContainer );
+ GDCLASS(ResourcePreloaderEditor, PanelContainer );
Button *load;
Button *_delete;
@@ -74,7 +74,7 @@ class ResourcePreloaderEditor : public PanelContainer {
protected:
void _notification(int p_what);
- void _input_event(InputEvent p_event);
+ void _gui_input(InputEvent p_event);
static void _bind_methods();
public:
@@ -86,7 +86,7 @@ public:
class ResourcePreloaderEditorPlugin : public EditorPlugin {
- OBJ_TYPE( ResourcePreloaderEditorPlugin, EditorPlugin );
+ GDCLASS( ResourcePreloaderEditorPlugin, EditorPlugin );
ResourcePreloaderEditor *preloader_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/rich_text_editor_plugin.cpp b/tools/editor/plugins/rich_text_editor_plugin.cpp
index bec48ca293..f91af2fa60 100644
--- a/tools/editor/plugins/rich_text_editor_plugin.cpp
+++ b/tools/editor/plugins/rich_text_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -89,8 +89,8 @@ void RichTextEditor::_menu_option(int p_option) {
void RichTextEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_menu_option"),&RichTextEditor::_menu_option);
- ObjectTypeDB::bind_method(_MD("_file_selected"),&RichTextEditor::_file_selected);
+ ClassDB::bind_method(_MD("_menu_option"),&RichTextEditor::_menu_option);
+ ClassDB::bind_method(_MD("_file_selected"),&RichTextEditor::_file_selected);
}
@@ -110,7 +110,7 @@ RichTextEditor::RichTextEditor() {
options->get_popup()->add_item(TTR("Parse BBCode"),PARSE_BBCODE);
options->get_popup()->add_item(TTR("Clear"),CLEAR);
- options->get_popup()->connect("item_pressed", this,"_menu_option");
+ options->get_popup()->connect("id_pressed", this,"_menu_option");
file_dialog = memnew( EditorFileDialog );
add_child(file_dialog);
file_dialog->add_filter("*.txt");
@@ -126,7 +126,7 @@ void RichTextEditorPlugin::edit(Object *p_object) {
bool RichTextEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("RichTextLabel");
+ return p_object->is_class("RichTextLabel");
}
void RichTextEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/rich_text_editor_plugin.h b/tools/editor/plugins/rich_text_editor_plugin.h
index ae1d04be01..cf97d7517c 100644
--- a/tools/editor/plugins/rich_text_editor_plugin.h
+++ b/tools/editor/plugins/rich_text_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,7 +40,7 @@
class RichTextEditor : public Control {
- OBJ_TYPE(RichTextEditor, Control );
+ GDCLASS(RichTextEditor, Control );
friend class RichTextEditorPlugin;
@@ -70,7 +70,7 @@ public:
class RichTextEditorPlugin : public EditorPlugin {
- OBJ_TYPE( RichTextEditorPlugin, EditorPlugin );
+ GDCLASS( RichTextEditorPlugin, EditorPlugin );
RichTextEditor *rich_text_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp
index 7965fa54ae..cbeaeb7d60 100644
--- a/tools/editor/plugins/sample_editor_plugin.cpp
+++ b/tools/editor/plugins/sample_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -35,7 +35,7 @@
-void SampleEditor::_input_event(InputEvent p_event) {
+void SampleEditor::_gui_input(InputEvent p_event) {
}
@@ -77,15 +77,15 @@ void SampleEditor::_stop_pressed() {
void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<ImageTexture> &p_texture) {
- DVector<uint8_t> data = p_sample->get_data();
+ PoolVector<uint8_t> data = p_sample->get_data();
- DVector<uint8_t> img;
+ PoolVector<uint8_t> img;
int w = p_texture->get_width();
int h = p_texture->get_height();
img.resize(w*h*3);
- DVector<uint8_t>::Write imgdata = img.write();
+ PoolVector<uint8_t>::Write imgdata = img.write();
uint8_t * imgw = imgdata.ptr();
- DVector<uint8_t>::Read sampledata = data.read();
+ PoolVector<uint8_t>::Read sampledata = data.read();
const uint8_t *sdata=sampledata.ptr();
bool stereo = p_sample->is_stereo();
@@ -308,10 +308,10 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag
}
}
- imgdata = DVector<uint8_t>::Write();
+ imgdata = PoolVector<uint8_t>::Write();
- p_texture->set_data(Image(w,h,0,Image::FORMAT_RGB,img));
+ p_texture->set_data(Image(w,h,0,Image::FORMAT_RGB8,img));
}
@@ -348,9 +348,9 @@ void SampleEditor::edit(Ref<Sample> p_sample) {
void SampleEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_input_event"),&SampleEditor::_input_event);
- ObjectTypeDB::bind_method(_MD("_play_pressed"),&SampleEditor::_play_pressed);
- ObjectTypeDB::bind_method(_MD("_stop_pressed"),&SampleEditor::_stop_pressed);
+ ClassDB::bind_method(_MD("_gui_input"),&SampleEditor::_gui_input);
+ ClassDB::bind_method(_MD("_play_pressed"),&SampleEditor::_play_pressed);
+ ClassDB::bind_method(_MD("_stop_pressed"),&SampleEditor::_stop_pressed);
}
@@ -361,7 +361,7 @@ SampleEditor::SampleEditor() {
add_style_override("panel", get_stylebox("panel","Panel"));
library = Ref<SampleLibrary>(memnew(SampleLibrary));
player->set_sample_library(library);
- sample_texframe = memnew( TextureFrame );
+ sample_texframe = memnew( TextureRect );
add_child(sample_texframe);
sample_texframe->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_BEGIN,5);
sample_texframe->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,5);
@@ -392,7 +392,7 @@ SampleEditor::SampleEditor() {
add_child(stop);
peakdisplay=Ref<ImageTexture>( memnew( ImageTexture) );
- peakdisplay->create( EDITOR_DEF("audio/sample_editor_preview_width",512),EDITOR_DEF("audio/sample_editor_preview_height",128),Image::FORMAT_RGB);
+ peakdisplay->create( EDITOR_DEF("editors/sample_editor/preview_width",512),EDITOR_DEF("editors/sample_editor/preview_height",128),Image::FORMAT_RGB8);
sample_texframe->set_expand(true);
sample_texframe->set_texture(peakdisplay);
@@ -415,18 +415,18 @@ void SampleEditorPlugin::edit(Object *p_object) {
bool SampleEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("Sample");
+ return p_object->is_class("Sample");
}
void SampleEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
sample_editor->show();
-// sample_editor->set_process(true);
+ //sample_editor->set_process(true);
} else {
sample_editor->hide();
-// sample_editor->set_process(false);
+ //sample_editor->set_process(false);
}
}
diff --git a/tools/editor/plugins/sample_editor_plugin.h b/tools/editor/plugins/sample_editor_plugin.h
index 22dc75b53b..6a416ddfbf 100644
--- a/tools/editor/plugins/sample_editor_plugin.h
+++ b/tools/editor/plugins/sample_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -39,7 +39,7 @@
class SampleEditor : public Panel {
- OBJ_TYPE(SampleEditor, Panel );
+ GDCLASS(SampleEditor, Panel );
SamplePlayer *player;
@@ -47,7 +47,7 @@ class SampleEditor : public Panel {
Ref<ImageTexture> peakdisplay;
Ref<Sample> sample;
Ref<SampleLibrary> library;
- TextureFrame *sample_texframe;
+ TextureRect *sample_texframe;
Button *stop;
Button *play;
@@ -57,7 +57,7 @@ class SampleEditor : public Panel {
protected:
void _notification(int p_what);
- void _input_event(InputEvent p_event);
+ void _gui_input(InputEvent p_event);
static void _bind_methods();
public:
@@ -69,7 +69,7 @@ public:
class SampleEditorPlugin : public EditorPlugin {
- OBJ_TYPE( SampleEditorPlugin, EditorPlugin );
+ GDCLASS( SampleEditorPlugin, EditorPlugin );
SampleEditor *sample_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/sample_library_editor_plugin.cpp b/tools/editor/plugins/sample_library_editor_plugin.cpp
index 2a6940332c..c3e2481b5a 100644
--- a/tools/editor/plugins/sample_library_editor_plugin.cpp
+++ b/tools/editor/plugins/sample_library_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -35,7 +35,7 @@
#include "sample_editor_plugin.h"
-void SampleLibraryEditor::_input_event(InputEvent p_event) {
+void SampleLibraryEditor::_gui_input(InputEvent p_event) {
}
@@ -58,7 +58,7 @@ void SampleLibraryEditor::_notification(int p_what) {
if (p_what==NOTIFICATION_READY) {
-// NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true);
+ //NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true);
}
if (p_what==NOTIFICATION_DRAW) {
@@ -66,7 +66,7 @@ void SampleLibraryEditor::_notification(int p_what) {
}
}
-void SampleLibraryEditor::_file_load_request(const DVector<String>& p_path) {
+void SampleLibraryEditor::_file_load_request(const PoolVector<String>& p_path) {
for(int i=0;i<p_path.size();i++) {
@@ -81,7 +81,7 @@ void SampleLibraryEditor::_file_load_request(const DVector<String>& p_path) {
dialog->popup_centered_minsize();
return; ///beh should show an error i guess
}
- String basename = path.get_file().basename();
+ String basename = path.get_file().get_basename();
String name=basename;
int counter=0;
while(sample_library->has_sample(name)) {
@@ -236,7 +236,7 @@ void SampleLibraryEditor::_update_library() {
// Preview/edit
Ref<ImageTexture> preview( memnew( ImageTexture ));
- preview->create(128,16,Image::FORMAT_RGB);
+ preview->create(128,16,Image::FORMAT_RGB8);
SampleEditor::generate_preview_texture(smp,preview);
ti->set_cell_mode(1,TreeItem::CELL_MODE_ICON);
ti->set_selectable(1,false);
@@ -376,7 +376,7 @@ void SampleLibraryEditor::drop_data_fw(const Point2& p_point,const Variant& p_da
if (sample->get_name()!="") {
basename=sample->get_name();
} else if (sample->get_path().is_resource_file()) {
- basename = sample->get_path().basename();
+ basename = sample->get_path().get_basename();
} else {
basename="Sample";
}
@@ -400,7 +400,7 @@ void SampleLibraryEditor::drop_data_fw(const Point2& p_point,const Variant& p_da
if (String(d["type"])=="files") {
- DVector<String> files = d["files"];
+ PoolVector<String> files = d["files"];
_file_load_request(files);
@@ -411,17 +411,17 @@ void SampleLibraryEditor::drop_data_fw(const Point2& p_point,const Variant& p_da
void SampleLibraryEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_input_event"),&SampleLibraryEditor::_input_event);
- ObjectTypeDB::bind_method(_MD("_load_pressed"),&SampleLibraryEditor::_load_pressed);
- ObjectTypeDB::bind_method(_MD("_item_edited"),&SampleLibraryEditor::_item_edited);
- ObjectTypeDB::bind_method(_MD("_delete_pressed"),&SampleLibraryEditor::_delete_pressed);
- ObjectTypeDB::bind_method(_MD("_file_load_request"),&SampleLibraryEditor::_file_load_request);
- ObjectTypeDB::bind_method(_MD("_update_library"),&SampleLibraryEditor::_update_library);
- ObjectTypeDB::bind_method(_MD("_button_pressed"),&SampleLibraryEditor::_button_pressed);
+ ClassDB::bind_method(_MD("_gui_input"),&SampleLibraryEditor::_gui_input);
+ ClassDB::bind_method(_MD("_load_pressed"),&SampleLibraryEditor::_load_pressed);
+ ClassDB::bind_method(_MD("_item_edited"),&SampleLibraryEditor::_item_edited);
+ ClassDB::bind_method(_MD("_delete_pressed"),&SampleLibraryEditor::_delete_pressed);
+ ClassDB::bind_method(_MD("_file_load_request"),&SampleLibraryEditor::_file_load_request);
+ ClassDB::bind_method(_MD("_update_library"),&SampleLibraryEditor::_update_library);
+ ClassDB::bind_method(_MD("_button_pressed"),&SampleLibraryEditor::_button_pressed);
- ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &SampleLibraryEditor::get_drag_data_fw);
- ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &SampleLibraryEditor::can_drop_data_fw);
- ObjectTypeDB::bind_method(_MD("drop_data_fw"), &SampleLibraryEditor::drop_data_fw);
+ ClassDB::bind_method(_MD("get_drag_data_fw"), &SampleLibraryEditor::get_drag_data_fw);
+ ClassDB::bind_method(_MD("can_drop_data_fw"), &SampleLibraryEditor::can_drop_data_fw);
+ ClassDB::bind_method(_MD("drop_data_fw"), &SampleLibraryEditor::drop_data_fw);
}
@@ -497,7 +497,7 @@ void SampleLibraryEditorPlugin::edit(Object *p_object) {
bool SampleLibraryEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("SampleLibrary");
+ return p_object->is_class("SampleLibrary");
}
void SampleLibraryEditorPlugin::make_visible(bool p_visible) {
@@ -506,14 +506,14 @@ void SampleLibraryEditorPlugin::make_visible(bool p_visible) {
//sample_library_editor->show();
button->show();
editor->make_bottom_panel_item_visible(sample_library_editor);
-// sample_library_editor->set_process(true);
+ //sample_library_editor->set_process(true);
} else {
- if (sample_library_editor->is_visible())
+ if (sample_library_editor->is_visible_in_tree())
editor->hide_bottom_panel();
button->hide();
-// sample_library_editor->set_process(false);
+ //sample_library_editor->set_process(false);
}
}
@@ -529,8 +529,8 @@ SampleLibraryEditorPlugin::SampleLibraryEditorPlugin(EditorNode *p_node) {
button->hide();
//sample_library_editor->set_area_as_parent_rect();
-// sample_library_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END);
-// sample_library_editor->set_margin( MARGIN_TOP, 120 );
+ //sample_library_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END);
+ //sample_library_editor->set_margin( MARGIN_TOP, 120 );
//sample_library_editor->hide();
diff --git a/tools/editor/plugins/sample_library_editor_plugin.h b/tools/editor/plugins/sample_library_editor_plugin.h
index f9fb184b7c..1856d338ed 100644
--- a/tools/editor/plugins/sample_library_editor_plugin.h
+++ b/tools/editor/plugins/sample_library_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -42,7 +42,7 @@
class SampleLibraryEditor : public Panel {
- OBJ_TYPE(SampleLibraryEditor, Panel );
+ GDCLASS(SampleLibraryEditor, Panel );
@@ -59,7 +59,7 @@ class SampleLibraryEditor : public Panel {
void _load_pressed();
- void _file_load_request(const DVector<String>& p_path);
+ void _file_load_request(const PoolVector<String>& p_path);
void _delete_pressed();
void _update_library();
void _item_edited();
@@ -74,7 +74,7 @@ class SampleLibraryEditor : public Panel {
protected:
void _notification(int p_what);
- void _input_event(InputEvent p_event);
+ void _gui_input(InputEvent p_event);
static void _bind_methods();
public:
@@ -85,7 +85,7 @@ public:
class SampleLibraryEditorPlugin : public EditorPlugin {
- OBJ_TYPE( SampleLibraryEditorPlugin, EditorPlugin );
+ GDCLASS( SampleLibraryEditorPlugin, EditorPlugin );
SampleLibraryEditor *sample_library_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/sample_player_editor_plugin.cpp b/tools/editor/plugins/sample_player_editor_plugin.cpp
index 3085ad87d8..ae958a5c6e 100644
--- a/tools/editor/plugins/sample_player_editor_plugin.cpp
+++ b/tools/editor/plugins/sample_player_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -50,8 +50,8 @@ void SamplePlayerEditor::_node_removed(Node *p_node) {
void SamplePlayerEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_play"),&SamplePlayerEditor::_play);
- ObjectTypeDB::bind_method(_MD("_stop"),&SamplePlayerEditor::_stop);
+ ClassDB::bind_method(_MD("_play"),&SamplePlayerEditor::_play);
+ ClassDB::bind_method(_MD("_stop"),&SamplePlayerEditor::_stop);
}
@@ -153,7 +153,7 @@ void SamplePlayerEditorPlugin::edit(Object *p_object) {
bool SamplePlayerEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("SamplePlayer2D") || p_object->is_type("SamplePlayer") || p_object->is_type("SpatialSamplePlayer");
+ return p_object->is_class("SamplePlayer2D") || p_object->is_class("SamplePlayer") || p_object->is_class("SpatialSamplePlayer");
}
void SamplePlayerEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/sample_player_editor_plugin.h b/tools/editor/plugins/sample_player_editor_plugin.h
index 013b042487..d18496b4fd 100644
--- a/tools/editor/plugins/sample_player_editor_plugin.h
+++ b/tools/editor/plugins/sample_player_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -41,7 +41,7 @@
class SamplePlayerEditor : public Control {
- OBJ_TYPE(SamplePlayerEditor, Control );
+ GDCLASS(SamplePlayerEditor, Control );
Panel *panel;
Button * play;
@@ -66,7 +66,7 @@ public:
class SamplePlayerEditorPlugin : public EditorPlugin {
- OBJ_TYPE( SamplePlayerEditorPlugin, EditorPlugin );
+ GDCLASS( SamplePlayerEditorPlugin, EditorPlugin );
SamplePlayerEditor *sample_player_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index fd25843de9..fa53e87fad 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -183,7 +183,7 @@ void ScriptEditorQuickOpen::_sbox_input(const InputEvent& p_ie) {
p_ie.key.scancode == KEY_PAGEUP ||
p_ie.key.scancode == KEY_PAGEDOWN ) ) {
- search_options->call("_input_event",p_ie);
+ search_options->call("_gui_input",p_ie);
search_box->accept_event();
}
@@ -240,9 +240,9 @@ void ScriptEditorQuickOpen::_notification(int p_what) {
void ScriptEditorQuickOpen::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_text_changed"),&ScriptEditorQuickOpen::_text_changed);
- ObjectTypeDB::bind_method(_MD("_confirmed"),&ScriptEditorQuickOpen::_confirmed);
- ObjectTypeDB::bind_method(_MD("_sbox_input"),&ScriptEditorQuickOpen::_sbox_input);
+ ClassDB::bind_method(_MD("_text_changed"),&ScriptEditorQuickOpen::_text_changed);
+ ClassDB::bind_method(_MD("_confirmed"),&ScriptEditorQuickOpen::_confirmed);
+ ClassDB::bind_method(_MD("_sbox_input"),&ScriptEditorQuickOpen::_sbox_input);
ADD_SIGNAL(MethodInfo("goto_line",PropertyInfo(Variant::INT,"line")));
@@ -254,11 +254,11 @@ ScriptEditorQuickOpen::ScriptEditorQuickOpen() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
search_box = memnew( LineEdit );
vbc->add_margin_child(TTR("Search:"),search_box);
search_box->connect("text_changed",this,"_text_changed");
- search_box->connect("input_event",this,"_sbox_input");
+ search_box->connect("gui_input",this,"_sbox_input");
search_options = memnew( Tree );
vbc->add_margin_child(TTR("Matches:"),search_options,true);
get_ok()->set_text(TTR("Open"));
@@ -278,7 +278,7 @@ ScriptEditor *ScriptEditor::script_editor=NULL;
String ScriptEditor::_get_debug_tooltip(const String&p_text,Node *_se) {
-// ScriptEditorBase *se=_se->cast_to<ScriptEditorBase>();
+ //ScriptEditorBase *se=_se->cast_to<ScriptEditorBase>();
String val = debugger->get_var_value(p_text);
if (val!=String()) {
@@ -311,7 +311,7 @@ void ScriptEditor::_breaked(bool p_breaked,bool p_can_debug) {
void ScriptEditor::_show_debugger(bool p_show) {
-// debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW), p_show);
+ //debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW), p_show);
}
void ScriptEditor::_script_created(Ref<Script> p_script) {
@@ -426,14 +426,14 @@ void ScriptEditor::_go_to_tab(int p_idx) {
script_name_label->set_text(c->cast_to<ScriptEditorBase>()->get_name());
script_icon->set_texture(c->cast_to<ScriptEditorBase>()->get_icon());
- if (is_visible())
+ if (is_visible_in_tree())
c->cast_to<ScriptEditorBase>()->ensure_focus();
}
if (c->cast_to<EditorHelp>()) {
- script_name_label->set_text(c->cast_to<EditorHelp>()->get_class_name());
+ script_name_label->set_text(c->cast_to<EditorHelp>()->get_class());
script_icon->set_texture(get_icon("Help","EditorIcons"));
- if (is_visible())
+ if (is_visible_in_tree())
c->cast_to<EditorHelp>()->set_focused();
}
@@ -605,7 +605,7 @@ void ScriptEditor::_reload_scripts(){
}
- Ref<Script> rel_script = ResourceLoader::load(script->get_path(),script->get_type(),true);
+ Ref<Script> rel_script = ResourceLoader::load(script->get_path(),script->get_class(),true);
ERR_CONTINUE(!rel_script.is_valid());
script->set_source_code( rel_script->get_source_code() );
script->set_last_modified_time( rel_script->get_last_modified_time() );
@@ -672,7 +672,7 @@ bool ScriptEditor::_test_script_times_on_disk(Ref<Script> p_for_script) {
bool need_ask=false;
bool need_reload=false;
- bool use_autoreload=bool(EDITOR_DEF("text_editor/auto_reload_scripts_on_external_change",false));
+ bool use_autoreload=bool(EDITOR_DEF("text_editor/files/auto_reload_scripts_on_external_change",false));
@@ -755,29 +755,10 @@ void ScriptEditor::_menu_option(int p_option) {
} break;
case FILE_SAVE_ALL: {
- if (!_test_script_times_on_disk())
+ if (_test_script_times_on_disk())
return;
save_all_scripts();
-
-#if 0
- for(int i=0;i<tab_container->get_child_count();i++) {
-
- ScriptTextEditor *se = tab_container->get_child(i)->cast_to<ScriptTextEditor>();
- if (!se)
- continue;
-
-
- Ref<Script> script = se->get_edited_script();
-
- if (script->get_path()=="" || script->get_path().find("local://")!=-1 || script->get_path().find("::")!=-1)
- continue; //internal script, who cares
-
-
- editor->save_resource( script );
- }
-
-#endif
} break;
case FILE_IMPORT_THEME: {
file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE);
@@ -802,7 +783,7 @@ void ScriptEditor::_menu_option(int p_option) {
file_dialog_option = FILE_SAVE_THEME_AS;
file_dialog->clear_filters();
file_dialog->add_filter("*.tet");
- file_dialog->set_current_path(EditorSettings::get_singleton()->get_settings_path() + "/text_editor_themes/" + EditorSettings::get_singleton()->get("text_editor/color_theme"));
+ file_dialog->set_current_path(EditorSettings::get_singleton()->get_settings_path() + "/text_editor_themes/" + EditorSettings::get_singleton()->get("text_editor/theme/color_theme"));
file_dialog->popup_centered_ratio();
file_dialog->set_title(TTR("Save Theme As.."));
} break;
@@ -817,7 +798,7 @@ void ScriptEditor::_menu_option(int p_option) {
if (tab_container->get_tab_count()>0) {
EditorHelp *eh = tab_container->get_child( tab_container->get_current_tab() )->cast_to<EditorHelp>();
if (eh) {
- current=eh->get_class_name();
+ current=eh->get_class();
}
}
@@ -964,7 +945,7 @@ void ScriptEditor::_menu_option(int p_option) {
}
}
- EditorHelp *help = tab_container->get_child(selected)->cast_to<EditorHelp>();
+ EditorHelp *help = tab_container->get_current_tab_control()->cast_to<EditorHelp>();
if (help) {
switch(p_option) {
@@ -1010,7 +991,7 @@ void ScriptEditor::_notification(int p_what) {
script_split->connect("dragged",this,"_script_split_dragged");
autosave_timer->connect("timeout",this,"_autosave_scripts");
{
- float autosave_time = EditorSettings::get_singleton()->get("text_editor/autosave_interval_secs");
+ float autosave_time = EditorSettings::get_singleton()->get("text_editor/files/autosave_interval_secs");
if (autosave_time>0) {
autosave_timer->set_wait_time(autosave_time);
autosave_timer->start();
@@ -1123,7 +1104,7 @@ static const Node * _find_node_with_script(const Node* p_node, const RefPtr & p_
Dictionary ScriptEditor::get_state() const {
-// apply_scripts();
+ //apply_scripts();
Dictionary state;
#if 0
@@ -1300,7 +1281,7 @@ void ScriptEditor::ensure_select_current() {
Ref<Script> script = se->get_edited_script();
- if (!grab_focus_block && is_visible())
+ if (!grab_focus_block && is_visible_in_tree())
se->ensure_focus();
@@ -1362,12 +1343,12 @@ struct _ScriptEditorItemData {
void ScriptEditor::_update_script_colors() {
- bool script_temperature_enabled = EditorSettings::get_singleton()->get("text_editor/script_temperature_enabled");
- bool highlight_current = EditorSettings::get_singleton()->get("text_editor/highlight_current_script");
+ bool script_temperature_enabled = EditorSettings::get_singleton()->get("text_editor/open_scripts/script_temperature_enabled");
+ bool highlight_current = EditorSettings::get_singleton()->get("text_editor/open_scripts/highlight_current_script");
- int hist_size = EditorSettings::get_singleton()->get("text_editor/script_temperature_history_size");
- Color hot_color=EditorSettings::get_singleton()->get("text_editor/script_temperature_hot_color");
- Color cold_color=EditorSettings::get_singleton()->get("text_editor/script_temperature_cold_color");
+ int hist_size = EditorSettings::get_singleton()->get("text_editor/open_scripts/script_temperature_history_size");
+ Color hot_color=EditorSettings::get_singleton()->get("text_editor/open_scripts/script_temperature_hot_color");
+ Color cold_color=EditorSettings::get_singleton()->get("text_editor/open_scripts/script_temperature_cold_color");
for(int i=0;i<script_list->get_item_count();i++) {
@@ -1380,7 +1361,7 @@ void ScriptEditor::_update_script_colors() {
bool current = tab_container->get_current_tab() == c;
if (current && highlight_current) {
- script_list->set_item_custom_bg_color(i, EditorSettings::get_singleton()->get("text_editor/current_script_background_color"));
+ script_list->set_item_custom_bg_color(i, EditorSettings::get_singleton()->get("text_editor/open_scripts/current_script_background_color"));
} else if (script_temperature_enabled) {
@@ -1414,7 +1395,7 @@ void ScriptEditor::_update_script_names() {
}
script_list->clear();
- bool split_script_help = EditorSettings::get_singleton()->get("text_editor/group_help_pages");
+ bool split_script_help = EditorSettings::get_singleton()->get("text_editor/open_scripts/group_help_pages");
Vector<_ScriptEditorItemData> sedata;
@@ -1442,7 +1423,7 @@ void ScriptEditor::_update_script_names() {
EditorHelp *eh = tab_container->get_child(i)->cast_to<EditorHelp>();
if (eh) {
- String name = eh->get_class_name();
+ String name = eh->get_class();
Ref<Texture> icon = get_icon("Help","EditorIcons");
String tooltip = name+" Class Reference";
@@ -1500,12 +1481,12 @@ void ScriptEditor::edit(const Ref<Script>& p_script, bool p_grab_focus) {
// see if already has it
- bool open_dominant = EditorSettings::get_singleton()->get("text_editor/open_dominant_script_on_scene_change");
+ bool open_dominant = EditorSettings::get_singleton()->get("text_editor/files/open_dominant_script_on_scene_change");
- if (p_script->get_path().is_resource_file() && bool(EditorSettings::get_singleton()->get("external_editor/use_external_editor"))) {
+ if (p_script->get_path().is_resource_file() && bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) {
- String path = EditorSettings::get_singleton()->get("external_editor/exec_path");
- String flags = EditorSettings::get_singleton()->get("external_editor/exec_flags");
+ String path = EditorSettings::get_singleton()->get("text_editor/external/exec_path");
+ String flags = EditorSettings::get_singleton()->get("text_editor/external/exec_flags");
List<String> args;
flags=flags.strip_edges();
if (flags!=String()) {
@@ -1514,7 +1495,7 @@ void ScriptEditor::edit(const Ref<Script>& p_script, bool p_grab_focus) {
args.push_back(flagss[i]);
}
- args.push_back(Globals::get_singleton()->globalize_path(p_script->get_path()));
+ args.push_back(GlobalConfig::get_singleton()->globalize_path(p_script->get_path()));
Error err = OS::get_singleton()->execute(path,args,false);
if (err==OK)
return;
@@ -1535,7 +1516,7 @@ void ScriptEditor::edit(const Ref<Script>& p_script, bool p_grab_focus) {
_go_to_tab(i);
script_list->select( script_list->find_metadata(i) );
}
- if (is_visible())
+ if (is_visible_in_tree())
se->ensure_focus();
}
return;
@@ -1639,6 +1620,7 @@ void ScriptEditor::apply_scripts() const {
void ScriptEditor::_editor_play() {
debugger->start();
+ debug_menu->get_popup()->grab_focus();
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true );
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_STEP), true );
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_BREAK), false );
@@ -1672,7 +1654,7 @@ void ScriptEditor::_editor_stop() {
}
-void ScriptEditor::_add_callback(Object *p_obj, const String& p_function, const StringArray& p_args) {
+void ScriptEditor::_add_callback(Object *p_obj, const String& p_function, const PoolStringArray& p_args) {
//print_line("add callback! hohoho"); kinda sad to remove this
ERR_FAIL_COND(!p_obj);
@@ -1712,8 +1694,8 @@ void ScriptEditor::_save_layout() {
void ScriptEditor::_editor_settings_changed() {
- trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/trim_trailing_whitespace_on_save");
- float autosave_time = EditorSettings::get_singleton()->get("text_editor/autosave_interval_secs");
+ trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/files/trim_trailing_whitespace_on_save");
+ float autosave_time = EditorSettings::get_singleton()->get("text_editor/files/autosave_interval_secs");
if (autosave_time>0) {
autosave_timer->set_wait_time(autosave_time);
autosave_timer->start();
@@ -1722,9 +1704,9 @@ void ScriptEditor::_editor_settings_changed() {
}
if (current_theme == "") {
- current_theme = EditorSettings::get_singleton()->get("text_editor/color_theme");
- } else if (current_theme != EditorSettings::get_singleton()->get("text_editor/color_theme")) {
- current_theme = EditorSettings::get_singleton()->get("text_editor/color_theme");
+ current_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme");
+ } else if (current_theme != EditorSettings::get_singleton()->get("text_editor/theme/color_theme")) {
+ current_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme");
EditorSettings::get_singleton()->load_text_editor_theme();
}
@@ -1738,7 +1720,7 @@ void ScriptEditor::_editor_settings_changed() {
}
_update_script_colors();
- ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true));
+ ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/files/auto_reload_and_parse_scripts_on_save",true));
}
@@ -1762,7 +1744,7 @@ void ScriptEditor::_script_split_dragged(float) {
}
void ScriptEditor::_unhandled_input(const InputEvent& p_event) {
- if (p_event.key.pressed || !is_visible()) return;
+ if (p_event.key.pressed || !is_visible_in_tree()) return;
if (ED_IS_SHORTCUT("script_editor/next_script", p_event)) {
int next_tab = script_list->get_current() + 1;
next_tab %= script_list->get_item_count();
@@ -1779,7 +1761,7 @@ void ScriptEditor::_unhandled_input(const InputEvent& p_event) {
void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {
- if (!bool(EDITOR_DEF("text_editor/restore_scripts_on_load",true))) {
+ if (!bool(EDITOR_DEF("text_editor/files/restore_scripts_on_load",true))) {
return;
}
@@ -1845,7 +1827,7 @@ void ScriptEditor::get_window_layout(Ref<ConfigFile> p_layout) {
if (eh) {
- helps.push_back(eh->get_class_name());
+ helps.push_back(eh->get_class());
}
@@ -1859,12 +1841,14 @@ void ScriptEditor::get_window_layout(Ref<ConfigFile> p_layout) {
void ScriptEditor::_help_class_open(const String& p_class) {
+ if (p_class=="")
+ return;
for(int i=0;i<tab_container->get_child_count();i++) {
EditorHelp *eh = tab_container->get_child(i)->cast_to<EditorHelp>();
- if (eh && eh->get_class_name()==p_class) {
+ if (eh && eh->get_class()==p_class) {
_go_to_tab(i);
_update_script_names();
@@ -1892,7 +1876,7 @@ void ScriptEditor::_help_class_goto(const String& p_desc) {
EditorHelp *eh = tab_container->get_child(i)->cast_to<EditorHelp>();
- if (eh && eh->get_class_name()==cname) {
+ if (eh && eh->get_class()==cname) {
_go_to_tab(i);
eh->go_to_help(p_desc);
@@ -1927,19 +1911,14 @@ void ScriptEditor::_update_selected_editor_menu() {
se->get_edit_menu()->hide();
}
- EditorHelp *eh = tab_container->get_child(i)->cast_to<EditorHelp>();
-
- if (eh) {
-
- if (current)
- script_search_menu->show();
- else
- script_search_menu->hide();
- }
-
-
}
+ EditorHelp *eh=tab_container->get_current_tab_control()->cast_to<EditorHelp>();
+ if (eh) {
+ script_search_menu->show();
+ } else {
+ script_search_menu->hide();
+ }
}
void ScriptEditor::_update_history_pos(int p_new_pos) {
@@ -1995,9 +1974,9 @@ void ScriptEditor::_history_back(){
}
void ScriptEditor::set_scene_root_script( Ref<Script> p_script ) {
- bool open_dominant = EditorSettings::get_singleton()->get("text_editor/open_dominant_script_on_scene_change");
+ bool open_dominant = EditorSettings::get_singleton()->get("text_editor/files/open_dominant_script_on_scene_change");
- if (bool(EditorSettings::get_singleton()->get("external_editor/use_external_editor")))
+ if (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")))
return;
if (open_dominant && p_script.is_valid() && _can_open_in_editor(p_script.ptr())) {
@@ -2050,43 +2029,43 @@ void ScriptEditor::register_create_script_editor_function(CreateScriptEditorFunc
void ScriptEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_file_dialog_action",&ScriptEditor::_file_dialog_action);
- ObjectTypeDB::bind_method("_tab_changed",&ScriptEditor::_tab_changed);
- ObjectTypeDB::bind_method("_menu_option",&ScriptEditor::_menu_option);
- ObjectTypeDB::bind_method("_close_current_tab",&ScriptEditor::_close_current_tab);
- ObjectTypeDB::bind_method("_close_docs_tab", &ScriptEditor::_close_docs_tab);
- ObjectTypeDB::bind_method("_close_all_tabs", &ScriptEditor::_close_all_tabs);
- ObjectTypeDB::bind_method("_editor_play",&ScriptEditor::_editor_play);
- ObjectTypeDB::bind_method("_editor_pause",&ScriptEditor::_editor_pause);
- ObjectTypeDB::bind_method("_editor_stop",&ScriptEditor::_editor_stop);
- ObjectTypeDB::bind_method("_add_callback",&ScriptEditor::_add_callback);
- ObjectTypeDB::bind_method("_reload_scripts",&ScriptEditor::_reload_scripts);
- ObjectTypeDB::bind_method("_resave_scripts",&ScriptEditor::_resave_scripts);
- ObjectTypeDB::bind_method("_res_saved_callback",&ScriptEditor::_res_saved_callback);
- ObjectTypeDB::bind_method("_goto_script_line",&ScriptEditor::_goto_script_line);
- ObjectTypeDB::bind_method("_goto_script_line2",&ScriptEditor::_goto_script_line2);
- ObjectTypeDB::bind_method("_help_search",&ScriptEditor::_help_search);
- ObjectTypeDB::bind_method("_save_history",&ScriptEditor::_save_history);
-
-
-
- ObjectTypeDB::bind_method("_breaked",&ScriptEditor::_breaked);
- ObjectTypeDB::bind_method("_show_debugger",&ScriptEditor::_show_debugger);
- ObjectTypeDB::bind_method("_get_debug_tooltip",&ScriptEditor::_get_debug_tooltip);
- ObjectTypeDB::bind_method("_autosave_scripts",&ScriptEditor::_autosave_scripts);
- ObjectTypeDB::bind_method("_editor_settings_changed",&ScriptEditor::_editor_settings_changed);
- ObjectTypeDB::bind_method("_update_script_names",&ScriptEditor::_update_script_names);
- ObjectTypeDB::bind_method("_tree_changed",&ScriptEditor::_tree_changed);
- ObjectTypeDB::bind_method("_script_selected",&ScriptEditor::_script_selected);
- ObjectTypeDB::bind_method("_script_created",&ScriptEditor::_script_created);
- ObjectTypeDB::bind_method("_script_split_dragged",&ScriptEditor::_script_split_dragged);
- ObjectTypeDB::bind_method("_help_class_open",&ScriptEditor::_help_class_open);
- ObjectTypeDB::bind_method("_help_class_goto",&ScriptEditor::_help_class_goto);
- ObjectTypeDB::bind_method("_request_help",&ScriptEditor::_help_class_open);
- ObjectTypeDB::bind_method("_history_forward",&ScriptEditor::_history_forward);
- ObjectTypeDB::bind_method("_history_back",&ScriptEditor::_history_back);
- ObjectTypeDB::bind_method("_live_auto_reload_running_scripts",&ScriptEditor::_live_auto_reload_running_scripts);
- ObjectTypeDB::bind_method("_unhandled_input",&ScriptEditor::_unhandled_input);
+ ClassDB::bind_method("_file_dialog_action",&ScriptEditor::_file_dialog_action);
+ ClassDB::bind_method("_tab_changed",&ScriptEditor::_tab_changed);
+ ClassDB::bind_method("_menu_option",&ScriptEditor::_menu_option);
+ ClassDB::bind_method("_close_current_tab",&ScriptEditor::_close_current_tab);
+ ClassDB::bind_method("_close_docs_tab", &ScriptEditor::_close_docs_tab);
+ ClassDB::bind_method("_close_all_tabs", &ScriptEditor::_close_all_tabs);
+ ClassDB::bind_method("_editor_play",&ScriptEditor::_editor_play);
+ ClassDB::bind_method("_editor_pause",&ScriptEditor::_editor_pause);
+ ClassDB::bind_method("_editor_stop",&ScriptEditor::_editor_stop);
+ ClassDB::bind_method("_add_callback",&ScriptEditor::_add_callback);
+ ClassDB::bind_method("_reload_scripts",&ScriptEditor::_reload_scripts);
+ ClassDB::bind_method("_resave_scripts",&ScriptEditor::_resave_scripts);
+ ClassDB::bind_method("_res_saved_callback",&ScriptEditor::_res_saved_callback);
+ ClassDB::bind_method("_goto_script_line",&ScriptEditor::_goto_script_line);
+ ClassDB::bind_method("_goto_script_line2",&ScriptEditor::_goto_script_line2);
+ ClassDB::bind_method("_help_search",&ScriptEditor::_help_search);
+ ClassDB::bind_method("_save_history",&ScriptEditor::_save_history);
+
+
+
+ ClassDB::bind_method("_breaked",&ScriptEditor::_breaked);
+ ClassDB::bind_method("_show_debugger",&ScriptEditor::_show_debugger);
+ ClassDB::bind_method("_get_debug_tooltip",&ScriptEditor::_get_debug_tooltip);
+ ClassDB::bind_method("_autosave_scripts",&ScriptEditor::_autosave_scripts);
+ ClassDB::bind_method("_editor_settings_changed",&ScriptEditor::_editor_settings_changed);
+ ClassDB::bind_method("_update_script_names",&ScriptEditor::_update_script_names);
+ ClassDB::bind_method("_tree_changed",&ScriptEditor::_tree_changed);
+ ClassDB::bind_method("_script_selected",&ScriptEditor::_script_selected);
+ ClassDB::bind_method("_script_created",&ScriptEditor::_script_created);
+ ClassDB::bind_method("_script_split_dragged",&ScriptEditor::_script_split_dragged);
+ ClassDB::bind_method("_help_class_open",&ScriptEditor::_help_class_open);
+ ClassDB::bind_method("_help_class_goto",&ScriptEditor::_help_class_goto);
+ ClassDB::bind_method("_request_help",&ScriptEditor::_help_class_open);
+ ClassDB::bind_method("_history_forward",&ScriptEditor::_history_forward);
+ ClassDB::bind_method("_history_back",&ScriptEditor::_history_back);
+ ClassDB::bind_method("_live_auto_reload_running_scripts",&ScriptEditor::_live_auto_reload_running_scripts);
+ ClassDB::bind_method("_unhandled_input",&ScriptEditor::_unhandled_input);
}
@@ -2149,7 +2128,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS);
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()->add_shortcut(ED_SHORTCUT("script_editor/close_all", TTR("Close All")), CLOSE_ALL);
- file_menu->get_popup()->connect("item_pressed", this,"_menu_option");
+ file_menu->get_popup()->connect("id_pressed", this,"_menu_option");
@@ -2158,7 +2137,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
script_search_menu->set_text(TTR("Search"));
script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find.."), KEY_MASK_CMD|KEY_F), HELP_SEARCH_FIND);
script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), KEY_F3), HELP_SEARCH_FIND_NEXT);
- script_search_menu->get_popup()->connect("item_pressed", this,"_menu_option");
+ script_search_menu->get_popup()->connect("id_pressed", this,"_menu_option");
script_search_menu->hide();
@@ -2174,7 +2153,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
debug_menu->get_popup()->add_separator();
//debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW);
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()->connect("id_pressed", this,"_menu_option");
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true);
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_STEP), true );
@@ -2191,7 +2170,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
window_menu->get_popup()->add_item(TTR("Move Left"),WINDOW_MOVE_LEFT,KEY_MASK_CMD|KEY_LEFT);
window_menu->get_popup()->add_item(TTR("Move Right"),WINDOW_MOVE_RIGHT,KEY_MASK_CMD|KEY_RIGHT);
window_menu->get_popup()->add_separator();
- window_menu->get_popup()->connect("item_pressed", this,"_menu_option");
+ window_menu->get_popup()->connect("id_pressed", this,"_menu_option");
#endif
@@ -2199,7 +2178,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
menu_hb->add_spacer();
- script_icon = memnew( TextureFrame );
+ script_icon = memnew( TextureRect );
menu_hb->add_child(script_icon);
script_name_label = memnew( Label );
menu_hb->add_child(script_name_label);
@@ -2268,7 +2247,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
{
VBoxContainer *vbc = memnew( VBoxContainer );
disk_changed->add_child(vbc);
- disk_changed->set_child_rect(vbc);
+ //disk_changed->set_child_rect(vbc);
Label *dl = memnew( Label );
dl->set_text(TTR("The following files are newer on disk.\nWhat action should be taken?:"));
@@ -2314,7 +2293,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
help_index->connect("open_class",this,"_help_class_open");
history_pos=-1;
-// debugger_gui->hide();
+ //debugger_gui->hide();
edit_pass=0;
trim_trailing_whitespace_on_save = false;
@@ -2349,7 +2328,7 @@ bool ScriptEditorPlugin::handles(Object *p_object) const {
return valid;
}
- return p_object->is_type("Script");
+ return p_object->is_class("Script");
}
void ScriptEditorPlugin::make_visible(bool p_visible) {
@@ -2437,20 +2416,20 @@ 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","");
- EDITOR_DEF("text_editor/script_temperature_enabled",true);
- EDITOR_DEF("text_editor/highlight_current_script", true);
- EDITOR_DEF("text_editor/script_temperature_history_size",15);
- EDITOR_DEF("text_editor/script_temperature_hot_color",Color(1,0,0,0.3));
- EDITOR_DEF("text_editor/script_temperature_cold_color",Color(0,0,1,0.3));
- EDITOR_DEF("text_editor/current_script_background_color",Color(0.81,0.81,0.14,0.63));
- EDITOR_DEF("text_editor/group_help_pages",true);
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"external_editor/exec_path",PROPERTY_HINT_GLOBAL_FILE));
- EDITOR_DEF("external_editor/exec_flags","");
+ EDITOR_DEF("text_editor/files/auto_reload_scripts_on_external_change",true);
+ ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/files/auto_reload_and_parse_scripts_on_save",true));
+ EDITOR_DEF("text_editor/files/open_dominant_script_on_scene_change",true);
+ EDITOR_DEF("text_editor/external/use_external_editor",false);
+ EDITOR_DEF("text_editor/external/exec_path","");
+ EDITOR_DEF("text_editor/open_scripts/script_temperature_enabled",true);
+ EDITOR_DEF("text_editor/open_scripts/highlight_current_script", true);
+ EDITOR_DEF("text_editor/open_scripts/script_temperature_history_size",15);
+ EDITOR_DEF("text_editor/open_scripts/script_temperature_hot_color",Color(1,0,0,0.3));
+ EDITOR_DEF("text_editor/open_scripts/script_temperature_cold_color",Color(0,0,1,0.3));
+ EDITOR_DEF("text_editor/open_scripts/current_script_background_color",Color(0.81,0.81,0.14,0.63));
+ EDITOR_DEF("text_editor/open_scripts/group_help_pages",true);
+ EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"text_editor/external/exec_path",PROPERTY_HINT_GLOBAL_FILE));
+ EDITOR_DEF("text_editor/external/exec_flags","");
}
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index 10f3bce14e..655568e262 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -45,7 +45,7 @@
class ScriptEditorQuickOpen : public ConfirmationDialog {
- OBJ_TYPE(ScriptEditorQuickOpen,ConfirmationDialog )
+ GDCLASS(ScriptEditorQuickOpen,ConfirmationDialog )
LineEdit *search_box;
Tree *search_options;
@@ -77,7 +77,7 @@ class ScriptEditorDebugger;
class ScriptEditorBase : public Control {
- OBJ_TYPE( ScriptEditorBase, Control );
+ GDCLASS( ScriptEditorBase, Control );
protected:
static void _bind_methods();
public:
@@ -99,7 +99,7 @@ public:
virtual void reload(bool p_soft)=0;
virtual void get_breakpoints(List<int> *p_breakpoints)=0;
virtual bool goto_method(const String& p_method)=0;
- virtual void add_callback(const String& p_function,StringArray p_args)=0;
+ virtual void add_callback(const String& p_function,PoolStringArray p_args)=0;
virtual void update_settings()=0;
virtual void set_debugger_active(bool p_active)=0;
virtual bool can_lose_focus_on_node_selection() { return true; }
@@ -118,7 +118,7 @@ class EditorScriptCodeCompletionCache;
class ScriptEditor : public VBoxContainer {
- OBJ_TYPE(ScriptEditor, VBoxContainer );
+ GDCLASS(ScriptEditor, VBoxContainer );
EditorNode *editor;
@@ -179,7 +179,7 @@ class ScriptEditor : public VBoxContainer {
String current_theme;
- TextureFrame *script_icon;
+ TextureRect *script_icon;
Label *script_name_label;
ToolButton *script_back;
@@ -243,7 +243,7 @@ class ScriptEditor : public VBoxContainer {
int edit_pass;
- void _add_callback(Object *p_obj, const String& p_function, const StringArray& p_args);
+ void _add_callback(Object *p_obj, const String& p_function, const PoolStringArray& p_args);
void _res_saved_callback(const Ref<Resource>& p_res);
bool trim_trailing_whitespace_on_save;
@@ -343,7 +343,7 @@ public:
class ScriptEditorPlugin : public EditorPlugin {
- OBJ_TYPE( ScriptEditorPlugin, EditorPlugin );
+ GDCLASS( ScriptEditorPlugin, EditorPlugin );
ScriptEditor *script_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/script_text_editor.cpp b/tools/editor/plugins/script_text_editor.cpp
index ca0398f069..95e7afa04c 100644
--- a/tools/editor/plugins/script_text_editor.cpp
+++ b/tools/editor/plugins/script_text_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -60,7 +60,7 @@ void ScriptTextEditor::apply_code() {
if (script.is_null())
return;
-// print_line("applying code");
+ //print_line("applying code");
script->set_source_code(code_editor->get_text_edit()->get_text());
script->update_exports();
}
@@ -100,31 +100,32 @@ void ScriptTextEditor::_load_theme_settings() {
/* keyword color */
- text_edit->set_custom_bg_color(EDITOR_DEF("text_editor/background_color",Color(0,0,0,0)));
- text_edit->add_color_override("completion_background_color", EDITOR_DEF("text_editor/completion_background_color", Color(0,0,0,0)));
- text_edit->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244")));
- text_edit->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/completion_existing_color", Color::html("21dfdfdf")));
- text_edit->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/completion_scroll_color", Color::html("ffffff")));
- text_edit->add_color_override("completion_font_color", EDITOR_DEF("text_editor/completion_font_color", Color::html("aaaaaa")));
- text_edit->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
- text_edit->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0)));
- text_edit->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));
- text_edit->add_color_override("caret_background_color",EDITOR_DEF("text_editor/caret_background_color",Color(0,0,0)));
- text_edit->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1)));
- text_edit->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1)));
- text_edit->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2)));
- text_edit->add_color_override("current_line_color",EDITOR_DEF("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15)));
- text_edit->add_color_override("word_highlighted_color",EDITOR_DEF("text_editor/word_highlighted_color",Color(0.8,0.9,0.9,0.15)));
- text_edit->add_color_override("number_color",EDITOR_DEF("text_editor/number_color",Color(0.9,0.6,0.0,2)));
- text_edit->add_color_override("function_color",EDITOR_DEF("text_editor/function_color",Color(0.4,0.6,0.8)));
- text_edit->add_color_override("member_variable_color",EDITOR_DEF("text_editor/member_variable_color",Color(0.9,0.3,0.3)));
- text_edit->add_color_override("mark_color", EDITOR_DEF("text_editor/mark_color", Color(1.0,0.4,0.4,0.4)));
- text_edit->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/breakpoint_color", Color(0.8,0.8,0.4,0.2)));
- text_edit->add_color_override("search_result_color",EDITOR_DEF("text_editor/search_result_color",Color(0.05,0.25,0.05,1)));
- text_edit->add_color_override("search_result_border_color",EDITOR_DEF("text_editor/search_result_border_color",Color(0.1,0.45,0.1,1)));
- text_edit->add_constant_override("line_spacing", EDITOR_DEF("text_editor/line_spacing",4));
-
- Color keyword_color= EDITOR_DEF("text_editor/keyword_color",Color(0.5,0.0,0.2));
+ text_edit->add_color_override("background_color", EDITOR_DEF("text_editor/highlighting/background_color",Color(0,0,0,0)));
+ text_edit->add_color_override("completion_background_color", EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0,0,0,0)));
+ text_edit->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244")));
+ text_edit->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")));
+ text_edit->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")));
+ text_edit->add_color_override("completion_font_color", EDITOR_DEF("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")));
+ text_edit->add_color_override("font_color",EDITOR_DEF("text_editor/highlighting/text_color",Color(0,0,0)));
+ text_edit->add_color_override("line_number_color",EDITOR_DEF("text_editor/highlighting/line_number_color",Color(0,0,0)));
+ text_edit->add_color_override("caret_color",EDITOR_DEF("text_editor/highlighting/caret_color",Color(0,0,0)));
+ text_edit->add_color_override("caret_background_color",EDITOR_DEF("text_editor/highlighting/caret_background_color",Color(0,0,0)));
+ text_edit->add_color_override("font_selected_color",EDITOR_DEF("text_editor/highlighting/text_selected_color",Color(1,1,1)));
+ text_edit->add_color_override("selection_color",EDITOR_DEF("text_editor/highlighting/selection_color",Color(0.2,0.2,1)));
+ text_edit->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/highlighting/brace_mismatch_color",Color(1,0.2,0.2)));
+ text_edit->add_color_override("current_line_color",EDITOR_DEF("text_editor/highlighting/current_line_color",Color(0.3,0.5,0.8,0.15)));
+ text_edit->add_color_override("word_highlighted_color",EDITOR_DEF("text_editor/highlighting/word_highlighted_color",Color(0.8,0.9,0.9,0.15)));
+ text_edit->add_color_override("number_color",EDITOR_DEF("text_editor/highlighting/number_color",Color(0.9,0.6,0.0,2)));
+ text_edit->add_color_override("function_color",EDITOR_DEF("text_editor/highlighting/function_color",Color(0.4,0.6,0.8)));
+ text_edit->add_color_override("member_variable_color",EDITOR_DEF("text_editor/highlighting/member_variable_color",Color(0.9,0.3,0.3)));
+ text_edit->add_color_override("mark_color", EDITOR_DEF("text_editor/highlighting/mark_color", Color(1.0,0.4,0.4,0.4)));
+ text_edit->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/highlighting/breakpoint_color", Color(0.8,0.8,0.4,0.2)));
+ text_edit->add_color_override("search_result_color",EDITOR_DEF("text_editor/highlighting/search_result_color",Color(0.05,0.25,0.05,1)));
+ text_edit->add_color_override("search_result_border_color",EDITOR_DEF("text_editor/highlighting/search_result_border_color",Color(0.1,0.45,0.1,1)));
+ text_edit->add_color_override("symbol_color",EDITOR_DEF("text_editor/highlighting/symbol_color",Color::hex(0x005291ff)));
+ text_edit->add_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing",4));
+
+ Color keyword_color= EDITOR_DEF("text_editor/highlighting/keyword_color",Color(0.5,0.0,0.2));
List<String> keywords;
script->get_language()->get_reserved_words(&keywords);
@@ -134,7 +135,7 @@ void ScriptTextEditor::_load_theme_settings() {
}
//colorize core types
- Color basetype_color= EDITOR_DEF("text_editor/base_type_color",Color(0.3,0.3,0.0));
+ Color basetype_color= EDITOR_DEF("text_editor/highlighting/base_type_color",Color(0.3,0.3,0.0));
text_edit->add_keyword_color("Vector2",basetype_color);
text_edit->add_keyword_color("Vector3",basetype_color);
@@ -150,10 +151,10 @@ void ScriptTextEditor::_load_theme_settings() {
text_edit->add_keyword_color("NodePath",basetype_color);
//colorize engine types
- Color type_color= EDITOR_DEF("text_editor/engine_type_color",Color(0.0,0.2,0.4));
+ Color type_color= EDITOR_DEF("text_editor/highlighting/engine_type_color",Color(0.0,0.2,0.4));
List<StringName> types;
- ObjectTypeDB::get_type_list(&types);
+ ClassDB::get_class_list(&types);
for(List<StringName>::Element *E=types.front();E;E=E->next()) {
@@ -165,7 +166,7 @@ void ScriptTextEditor::_load_theme_settings() {
}
//colorize comments
- Color comment_color = EDITOR_DEF("text_editor/comment_color",Color::hex(0x797e7eff));
+ Color comment_color = EDITOR_DEF("text_editor/highlighting/comment_color",Color::hex(0x797e7eff));
List<String> comments;
script->get_language()->get_comment_delimiters(&comments);
@@ -179,7 +180,7 @@ void ScriptTextEditor::_load_theme_settings() {
}
//colorize strings
- Color string_color = EDITOR_DEF("text_editor/string_color",Color::hex(0x6b6f00ff));
+ Color string_color = EDITOR_DEF("text_editor/highlighting/string_color",Color::hex(0x6b6f00ff));
List<String> strings;
script->get_language()->get_string_delimiters(&strings);
@@ -190,11 +191,6 @@ void ScriptTextEditor::_load_theme_settings() {
String end = string.get_slice_count(" ")>1?string.get_slice(" ",1):String();
text_edit->add_color_region(beg,end,string_color,end=="");
}
-
- //colorize symbols
- Color symbol_color= EDITOR_DEF("text_editor/symbol_color",Color::hex(0x005291ff));
- text_edit->set_symbol_color(symbol_color);
-
}
@@ -229,7 +225,7 @@ void ScriptTextEditor::_notification(int p_what) {
}
}
-void ScriptTextEditor::add_callback(const String& p_function,StringArray p_args) {
+void ScriptTextEditor::add_callback(const String& p_function,PoolStringArray p_args) {
String code = code_editor->get_text_edit()->get_text();
int pos = script->get_language()->find_function(p_function,code);
@@ -249,17 +245,7 @@ void ScriptTextEditor::add_callback(const String& p_function,StringArray p_args)
void ScriptTextEditor::update_settings() {
- code_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
- code_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
- code_editor->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
- code_editor->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/draw_tabs"));
- code_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/show_line_numbers"));
- code_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/syntax_highlighting"));
- code_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences"));
- code_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
- code_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
- code_editor->get_text_edit()->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter"));
- code_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
+ code_editor->update_editor_settings();
}
bool ScriptTextEditor::is_unsaved() {
@@ -346,7 +332,7 @@ String ScriptTextEditor::get_name() {
} else if (script->get_name()!="")
name=script->get_name();
else
- name=script->get_type()+"("+itos(script->get_instance_ID())+")";
+ name=script->get_class()+"("+itos(script->get_instance_ID())+")";
return name;
@@ -354,8 +340,8 @@ String ScriptTextEditor::get_name() {
Ref<Texture> ScriptTextEditor::get_icon() {
- if (get_parent_control() && get_parent_control()->has_icon(script->get_type(),"EditorIcons")) {
- return get_parent_control()->get_icon(script->get_type(),"EditorIcons");
+ if (get_parent_control() && get_parent_control()->has_icon(script->get_class(),"EditorIcons")) {
+ return get_parent_control()->get_icon(script->get_class(),"EditorIcons");
}
return Ref<Texture>();
@@ -452,7 +438,7 @@ static void _find_changed_scripts_for_external_editor(Node* p_base, Node*p_curre
void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_for_script) {
- if (!bool(EditorSettings::get_singleton()->get("external_editor/use_external_editor")))
+ if (!bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")))
return;
Set<Ref<Script> > scripts;
@@ -479,7 +465,7 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo
if (last_date!=date) {
- Ref<Script> rel_script = ResourceLoader::load(script->get_path(),script->get_type(),true);
+ Ref<Script> rel_script = ResourceLoader::load(script->get_path(),script->get_class(),true);
ERR_CONTINUE(!rel_script.is_valid());
script->set_source_code( rel_script->get_source_code() );
script->set_last_modified_time( rel_script->get_last_modified_time() );
@@ -498,6 +484,7 @@ void ScriptTextEditor::_code_complete_scripts(void* p_ud,const String& p_code, L
void ScriptTextEditor::_code_complete_script(const String& p_code, List<String>* r_options) {
+ if (color_panel->is_visible_in_tree()) return;
Node *base = get_tree()->get_edited_scene_root();
if (base) {
base = _find_node_for_script(base,base,script);
@@ -557,10 +544,10 @@ void ScriptTextEditor::_lookup_symbol(const String& p_symbol,int p_row, int p_co
StringName cname = result.class_name;
bool success;
while(true) {
- ObjectTypeDB::get_integer_constant(cname,result.class_member,&success);
+ ClassDB::get_integer_constant(cname,result.class_member,&success);
if (success) {
result.class_name=cname;
- cname=ObjectTypeDB::type_inherits_from(cname);
+ cname=ClassDB::get_parent_class(cname);
} else {
break;
}
@@ -579,9 +566,9 @@ void ScriptTextEditor::_lookup_symbol(const String& p_symbol,int p_row, int p_co
StringName cname = result.class_name;
while(true) {
- if (ObjectTypeDB::has_method(cname,result.class_member)) {
+ if (ClassDB::has_method(cname,result.class_member)) {
result.class_name=cname;
- cname=ObjectTypeDB::type_inherits_from(cname);
+ cname=ClassDB::get_parent_class(cname);
} else {
break;
}
@@ -882,6 +869,9 @@ void ScriptTextEditor::_edit_option(int p_op) {
case EDIT_TRIM_TRAILING_WHITESAPCE: {
trim_trailing_whitespace();
} break;
+ case EDIT_PICK_COLOR: {
+ color_panel->popup();
+ } break;
case SEARCH_FIND: {
@@ -983,18 +973,19 @@ void ScriptTextEditor::_edit_option(int p_op) {
void ScriptTextEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_validate_script",&ScriptTextEditor::_validate_script);
- ObjectTypeDB::bind_method("_load_theme_settings",&ScriptTextEditor::_load_theme_settings);
- ObjectTypeDB::bind_method("_breakpoint_toggled",&ScriptTextEditor::_breakpoint_toggled);
- ObjectTypeDB::bind_method("_edit_option",&ScriptTextEditor::_edit_option);
- ObjectTypeDB::bind_method("_goto_line",&ScriptTextEditor::_goto_line);
- ObjectTypeDB::bind_method("_lookup_symbol",&ScriptTextEditor::_lookup_symbol);
-
+ ClassDB::bind_method("_validate_script",&ScriptTextEditor::_validate_script);
+ ClassDB::bind_method("_load_theme_settings",&ScriptTextEditor::_load_theme_settings);
+ ClassDB::bind_method("_breakpoint_toggled",&ScriptTextEditor::_breakpoint_toggled);
+ ClassDB::bind_method("_edit_option",&ScriptTextEditor::_edit_option);
+ ClassDB::bind_method("_goto_line",&ScriptTextEditor::_goto_line);
+ ClassDB::bind_method("_lookup_symbol",&ScriptTextEditor::_lookup_symbol);
+ ClassDB::bind_method("_text_edit_gui_input", &ScriptTextEditor::_text_edit_gui_input);
+ ClassDB::bind_method("_color_changed", &ScriptTextEditor::_color_changed);
- ObjectTypeDB::bind_method("get_drag_data_fw",&ScriptTextEditor::get_drag_data_fw);
- ObjectTypeDB::bind_method("can_drop_data_fw",&ScriptTextEditor::can_drop_data_fw);
- ObjectTypeDB::bind_method("drop_data_fw",&ScriptTextEditor::drop_data_fw);
+ ClassDB::bind_method("get_drag_data_fw",&ScriptTextEditor::get_drag_data_fw);
+ ClassDB::bind_method("can_drop_data_fw",&ScriptTextEditor::can_drop_data_fw);
+ ClassDB::bind_method("drop_data_fw",&ScriptTextEditor::drop_data_fw);
}
@@ -1168,6 +1159,97 @@ void ScriptTextEditor::drop_data_fw(const Point2& p_point,const Variant& p_data,
}
+void ScriptTextEditor::_text_edit_gui_input(const InputEvent& ev) {
+ if (ev.type == InputEvent::MOUSE_BUTTON) {
+ InputEventMouseButton mb = ev.mouse_button;
+ if (mb.button_index == BUTTON_RIGHT && !mb.pressed) {
+
+ int col, row;
+ TextEdit* tx = code_editor->get_text_edit();
+ tx->_get_mouse_pos(Point2i(mb.global_x, mb.global_y)-tx->get_global_pos(), row, col);
+ Vector2 mpos = Vector2(mb.global_x, mb.global_y)-tx->get_global_pos();
+ bool have_selection = (tx->get_selection_text().length() > 0);
+ bool have_color = (tx->get_word_at_pos(mpos) == "Color");
+ if (have_color) {
+
+ String line = tx->get_line(row);
+ color_line = row;
+ int begin = 0;
+ int end = 0;
+ bool valid = false;
+ for (int i = col; i < line.length(); i++) {
+ if (line[i] == '(') {
+ begin = i;
+ continue;
+ }
+ else if (line[i] == ')') {
+ end = i+1;
+ valid = true;
+ break;
+ }
+ }
+ if (valid) {
+ color_args = line.substr(begin, end-begin);
+ String stripped = color_args.replace(" ", "").replace("(", "").replace(")", "");
+ Vector<float> color = stripped.split_floats(",");
+ if (color.size() > 2) {
+ float alpha = color.size() > 3 ? color[3] : 1.0f;
+ color_picker->set_pick_color(Color(color[0], color[1], color[2], alpha));
+ }
+ color_panel->set_pos(get_global_transform().xform(get_local_mouse_pos()));
+ Size2 ms = Size2(300, color_picker->get_combined_minimum_size().height+10);
+ color_panel->set_size(ms);
+ } else {
+ have_color = false;
+ }
+ }
+ _make_context_menu(have_selection, have_color);
+ }
+ }
+}
+
+void ScriptTextEditor::_color_changed(const Color& p_color) {
+ String new_args;
+ if (p_color.a == 1.0f) {
+ new_args = String("("+rtos(p_color.r)+", "+rtos(p_color.g)+", "+rtos(p_color.b)+")");
+ } else {
+ new_args = String("("+rtos(p_color.r)+", "+rtos(p_color.g)+", "+rtos(p_color.b)+", "+rtos(p_color.a)+")");
+ }
+
+ String line = code_editor->get_text_edit()->get_line(color_line);
+ String new_line = line.replace(color_args, new_args);
+ color_args = new_args;
+ code_editor->get_text_edit()->set_line(color_line, new_line);
+}
+
+void ScriptTextEditor::_make_context_menu(bool p_selection, bool p_color) {
+
+ context_menu->clear();
+ if (p_selection) {
+ context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT);
+ context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY);
+ }
+
+ context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE);
+ context_menu->add_separator();
+ context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL);
+ context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO);
+ context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO);
+
+ if (p_selection) {
+ context_menu->add_separator();
+ context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left"), EDIT_INDENT_LEFT);
+ context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_right"), EDIT_INDENT_RIGHT);
+ context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_comment"), EDIT_TOGGLE_COMMENT);
+ }
+ if (p_color) {
+ context_menu->add_separator();
+ context_menu->add_item(TTR("Pick Color"), EDIT_PICK_COLOR);
+ }
+ context_menu->set_pos(get_global_transform().xform(get_local_mouse_pos()));
+ context_menu->set_size(Vector2(1, 1));
+ context_menu->popup();
+}
ScriptTextEditor::ScriptTextEditor() {
@@ -1180,23 +1262,26 @@ ScriptTextEditor::ScriptTextEditor() {
code_editor->get_text_edit()->connect("breakpoint_toggled", this, "_breakpoint_toggled");
code_editor->get_text_edit()->connect("symbol_lookup", this, "_lookup_symbol");
+ update_settings();
- code_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
- code_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
- code_editor->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
- code_editor->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/draw_tabs"));
- code_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/show_line_numbers"));
- code_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/syntax_highlighting"));
- code_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences"));
- code_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
- code_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
- code_editor->get_text_edit()->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter"));
- code_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
code_editor->get_text_edit()->set_callhint_settings(
- EditorSettings::get_singleton()->get("text_editor/put_callhint_tooltip_below_current_line"),
- EditorSettings::get_singleton()->get("text_editor/callhint_tooltip_offset"));
+ EditorSettings::get_singleton()->get("text_editor/completion/put_callhint_tooltip_below_current_line"),
+ EditorSettings::get_singleton()->get("text_editor/completion/callhint_tooltip_offset"));
code_editor->get_text_edit()->set_select_identifiers_on_hover(true);
+ code_editor->get_text_edit()->set_context_menu_enabled(false);
+ code_editor->get_text_edit()->connect("gui_input", this, "_text_edit_gui_input");
+
+ context_menu = memnew(PopupMenu);
+ add_child(context_menu);
+ context_menu->connect("id_pressed", this, "_edit_option");
+
+ color_panel = memnew(PopupPanel);
+ add_child(color_panel);
+ color_picker = memnew(ColorPicker);
+ color_panel->add_child(color_picker);
+ color_panel->set_child_rect(color_picker); //NOT
+ color_picker->connect("color_changed", this, "_color_changed");
edit_hb = memnew (HBoxContainer);
@@ -1225,7 +1310,7 @@ ScriptTextEditor::ScriptTextEditor() {
#endif
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/trim_trailing_whitespace"), EDIT_TRIM_TRAILING_WHITESAPCE);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/auto_indent"), EDIT_AUTO_INDENT);
- edit_menu->get_popup()->connect("item_pressed", this,"_edit_option");
+ edit_menu->get_popup()->connect("id_pressed", this,"_edit_option");
edit_menu->get_popup()->add_separator();
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_breakpoint"), DEBUG_TOGGLE_BREAKPOINT);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_breakpoints"), DEBUG_REMOVE_ALL_BREAKPOINTS);
@@ -1245,7 +1330,7 @@ ScriptTextEditor::ScriptTextEditor() {
search_menu->get_popup()->add_separator();
search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/contextual_help"), HELP_CONTEXTUAL);
- search_menu->get_popup()->connect("item_pressed", this,"_edit_option");
+ search_menu->get_popup()->connect("id_pressed", this,"_edit_option");
edit_hb->add_child(edit_menu);
@@ -1279,6 +1364,10 @@ void ScriptTextEditor::register_editor() {
ED_SHORTCUT("script_text_editor/select_all", TTR("Select All"), KEY_MASK_CMD|KEY_A);
ED_SHORTCUT("script_text_editor/move_up", TTR("Move Up"), KEY_MASK_ALT|KEY_UP);
ED_SHORTCUT("script_text_editor/move_down", TTR("Move Down"), KEY_MASK_ALT|KEY_DOWN);
+
+ //leave these at zero, same can be accomplished with tab/shift-tab, including selection
+ //the next/previous in history shortcut in this case makes a lot more sene.
+
ED_SHORTCUT("script_text_editor/indent_left", TTR("Indent Left"), 0);
ED_SHORTCUT("script_text_editor/indent_right", TTR("Indent Right"), 0);
ED_SHORTCUT("script_text_editor/toggle_comment", TTR("Toggle Comment"), KEY_MASK_CMD|KEY_K);
diff --git a/tools/editor/plugins/script_text_editor.h b/tools/editor/plugins/script_text_editor.h
index 2c7eac6095..e30a78340e 100644
--- a/tools/editor/plugins/script_text_editor.h
+++ b/tools/editor/plugins/script_text_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -30,11 +30,12 @@
#define SCRIPT_TEXT_EDITOR_H
#include "script_editor_plugin.h"
+#include "scene/gui/color_picker.h"
class ScriptTextEditor : public ScriptEditorBase {
- OBJ_TYPE( ScriptTextEditor, ScriptEditorBase );
+ GDCLASS( ScriptTextEditor, ScriptEditorBase );
CodeTextEditor *code_editor;
@@ -47,10 +48,16 @@ class ScriptTextEditor : public ScriptEditorBase {
MenuButton *edit_menu;
MenuButton *search_menu;
+ PopupMenu *context_menu;
GotoLineDialog *goto_line_dialog;
ScriptEditorQuickOpen *quick_open;
+ PopupPanel *color_panel;
+ ColorPicker *color_picker;
+ int color_line;
+ String color_args;
+
enum {
EDIT_UNDO,
EDIT_REDO,
@@ -67,6 +74,7 @@ class ScriptTextEditor : public ScriptEditorBase {
EDIT_INDENT_RIGHT,
EDIT_INDENT_LEFT,
EDIT_CLONE_DOWN,
+ EDIT_PICK_COLOR,
SEARCH_FIND,
SEARCH_FIND_NEXT,
SEARCH_FIND_PREV,
@@ -96,6 +104,9 @@ protected:
static void _bind_methods();
void _edit_option(int p_op);
+ void _make_context_menu(bool p_selection, bool p_color);
+ void _text_edit_gui_input(const InputEvent& ev);
+ void _color_changed(const Color& p_color);
void _goto_line(int p_line) { goto_line(p_line); }
void _lookup_symbol(const String& p_symbol,int p_row, int p_column);
@@ -126,7 +137,7 @@ public:
virtual void reload(bool p_soft);
virtual void get_breakpoints(List<int> *p_breakpoints);
- virtual void add_callback(const String& p_function,StringArray p_args);
+ virtual void add_callback(const String& p_function,PoolStringArray p_args);
virtual void update_settings();
virtual bool goto_method(const String& p_method);
diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp
index b3317e8313..90d0f7fc93 100644
--- a/tools/editor/plugins/shader_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,7 +37,7 @@
#include "tools/editor/editor_node.h"
#include "tools/editor/property_editor.h"
#include "os/os.h"
-
+#include "servers/visual/shader_types.h"
/*** SETTINGS EDITOR ****/
@@ -51,19 +51,14 @@ Ref<Shader> ShaderTextEditor::get_edited_shader() const {
return shader;
}
-void ShaderTextEditor::set_edited_shader(const Ref<Shader>& p_shader,ShaderLanguage::ShaderType p_type) {
+void ShaderTextEditor::set_edited_shader(const Ref<Shader>& p_shader) {
shader=p_shader;
- type=p_type;
+
_load_theme_settings();
- if (p_type==ShaderLanguage::SHADER_MATERIAL_LIGHT || p_type==ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT)
- get_text_edit()->set_text(shader->get_light_code());
- else if (p_type==ShaderLanguage::SHADER_MATERIAL_VERTEX || p_type==ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX)
- get_text_edit()->set_text(shader->get_vertex_code());
- else
- get_text_edit()->set_text(shader->get_fragment_code());
+ get_text_edit()->set_text(p_shader->get_code());
_line_col_changed();
@@ -77,34 +72,53 @@ void ShaderTextEditor::_load_theme_settings() {
/* keyword color */
- get_text_edit()->set_custom_bg_color(EDITOR_DEF("text_editor/background_color",Color(0,0,0,0)));
- get_text_edit()->add_color_override("completion_background_color", EDITOR_DEF("text_editor/completion_background_color", Color(0,0,0,0)));
- get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244")));
- get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/completion_existing_color", Color::html("21dfdfdf")));
- get_text_edit()->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/completion_scroll_color", Color::html("ffffff")));
- get_text_edit()->add_color_override("completion_font_color", EDITOR_DEF("text_editor/completion_font_color", Color::html("aaaaaa")));
- get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
- get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0)));
- get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));
- get_text_edit()->add_color_override("caret_background_color",EDITOR_DEF("text_editor/caret_background_color",Color(0,0,0)));
- get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1)));
- get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1)));
- get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2)));
- get_text_edit()->add_color_override("current_line_color",EDITOR_DEF("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15)));
- get_text_edit()->add_color_override("word_highlighted_color",EDITOR_DEF("text_editor/word_highlighted_color",Color(0.8,0.9,0.9,0.15)));
- get_text_edit()->add_color_override("number_color",EDITOR_DEF("text_editor/number_color",Color(0.9,0.6,0.0,2)));
- get_text_edit()->add_color_override("function_color",EDITOR_DEF("text_editor/function_color",Color(0.4,0.6,0.8)));
- get_text_edit()->add_color_override("member_variable_color",EDITOR_DEF("text_editor/member_variable_color",Color(0.9,0.3,0.3)));
- get_text_edit()->add_color_override("mark_color", EDITOR_DEF("text_editor/mark_color", Color(1.0,0.4,0.4,0.4)));
- get_text_edit()->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/breakpoint_color", Color(0.8,0.8,0.4,0.2)));
- get_text_edit()->add_color_override("search_result_color",EDITOR_DEF("text_editor/search_result_color",Color(0.05,0.25,0.05,1)));
- get_text_edit()->add_color_override("search_result_border_color",EDITOR_DEF("text_editor/search_result_border_color",Color(0.1,0.45,0.1,1)));
-
- Color keyword_color= EDITOR_DEF("text_editor/keyword_color",Color(0.5,0.0,0.2));
+ get_text_edit()->add_color_override("background_color", EDITOR_DEF("text_editor/highlighting/background_color",Color(0,0,0,0)));
+ get_text_edit()->add_color_override("completion_background_color", EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0,0,0,0)));
+ get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244")));
+ get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")));
+ get_text_edit()->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")));
+ get_text_edit()->add_color_override("completion_font_color", EDITOR_DEF("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")));
+ get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/highlighting/text_color",Color(0,0,0)));
+ get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/highlighting/line_number_color",Color(0,0,0)));
+ get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/highlighting/caret_color",Color(0,0,0)));
+ get_text_edit()->add_color_override("caret_background_color",EDITOR_DEF("text_editor/highlighting/caret_background_color",Color(0,0,0)));
+ get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/highlighting/text_selected_color",Color(1,1,1)));
+ get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/highlighting/selection_color",Color(0.2,0.2,1)));
+ get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/highlighting/brace_mismatch_color",Color(1,0.2,0.2)));
+ get_text_edit()->add_color_override("current_line_color",EDITOR_DEF("text_editor/highlighting/current_line_color",Color(0.3,0.5,0.8,0.15)));
+ get_text_edit()->add_color_override("word_highlighted_color",EDITOR_DEF("text_editor/highlighting/word_highlighted_color",Color(0.8,0.9,0.9,0.15)));
+ get_text_edit()->add_color_override("number_color",EDITOR_DEF("text_editor/highlighting/number_color",Color(0.9,0.6,0.0,2)));
+ get_text_edit()->add_color_override("function_color",EDITOR_DEF("text_editor/highlighting/function_color",Color(0.4,0.6,0.8)));
+ get_text_edit()->add_color_override("member_variable_color",EDITOR_DEF("text_editor/highlighting/member_variable_color",Color(0.9,0.3,0.3)));
+ get_text_edit()->add_color_override("mark_color", EDITOR_DEF("text_editor/highlighting/mark_color", Color(1.0,0.4,0.4,0.4)));
+ get_text_edit()->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/highlighting/breakpoint_color", Color(0.8,0.8,0.4,0.2)));
+ get_text_edit()->add_color_override("search_result_color",EDITOR_DEF("text_editor/highlighting/search_result_color",Color(0.05,0.25,0.05,1)));
+ get_text_edit()->add_color_override("search_result_border_color",EDITOR_DEF("text_editor/highlighting/search_result_border_color",Color(0.1,0.45,0.1,1)));
+ get_text_edit()->add_color_override("symbol_color",EDITOR_DEF("text_editor/highlighting/symbol_color",Color::hex(0x005291ff)));
+
+ Color keyword_color= EDITOR_DEF("text_editor/highlighting/keyword_color",Color(0.5,0.0,0.2));
List<String> keywords;
- ShaderLanguage::get_keyword_list(type,&keywords);
+ ShaderLanguage::get_keyword_list(&keywords);
+
+ if (shader.is_valid()) {
+
+
+ for(const Map< StringName, Map<StringName,ShaderLanguage::DataType> >::Element *E=ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())).front();E;E=E->next()) {
+
+ for (const Map<StringName,ShaderLanguage::DataType>::Element *F=E->get().front();F;F=F->next()) {
+ keywords.push_back(F->key());
+ }
+
+ }
+
+ for(const Set<String>::Element *E =ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())).front();E;E=E->next()) {
+
+ keywords.push_back(E->get());
+
+ }
+ }
for(List<String>::Element *E=keywords.front();E;E=E->next()) {
@@ -113,11 +127,11 @@ void ShaderTextEditor::_load_theme_settings() {
}
//colorize core types
-// Color basetype_color= EDITOR_DEF("text_editor/base_type_color",Color(0.3,0.3,0.0));
+ //Color basetype_color= EDITOR_DEF("text_editor/base_type_color",Color(0.3,0.3,0.0));
//colorize comments
- Color comment_color = EDITOR_DEF("text_editor/comment_color",Color::hex(0x797e7eff));
+ Color comment_color = EDITOR_DEF("text_editor/highlighting/comment_color",Color::hex(0x797e7eff));
get_text_edit()->add_color_region("/*","*/",comment_color,false);
get_text_edit()->add_color_region("//","",comment_color,false);
@@ -135,29 +149,36 @@ void ShaderTextEditor::_load_theme_settings() {
String end = string.get_slice_count(" ")>1?string.get_slice(" ",1):String();
get_text_edit()->add_color_region(beg,end,string_color,end=="");
}*/
+}
- //colorize symbols
- Color symbol_color= EDITOR_DEF("text_editor/symbol_color",Color::hex(0x005291ff));
- get_text_edit()->set_symbol_color(symbol_color);
+void ShaderTextEditor::_code_complete_script(const String& p_code, List<String>* r_options) {
-}
+ print_line("code complete");
+ ShaderLanguage sl;
+ String calltip;
-void ShaderTextEditor::_validate_script() {
+ Error err = sl.complete(p_code,ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())),ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())),r_options,calltip);
+
+ if (calltip!="") {
+ get_text_edit()->set_code_hint(calltip);
+ }
+}
- String errortxt;
- int line,col;
+void ShaderTextEditor::_validate_script() {
String code=get_text_edit()->get_text();
//List<StringName> params;
//shader->get_param_list(&params);
- Error err = ShaderLanguage::compile(code,type,NULL,NULL,&errortxt,&line,&col);
+ ShaderLanguage sl;
+
+ Error err = sl.compile(code,ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())),ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())));
if (err!=OK) {
- String error_text="error("+itos(line+1)+","+itos(col)+"): "+errortxt;
+ String error_text="error("+itos(sl.get_error_line())+"): "+sl.get_error_text();
set_error(error_text);
- get_text_edit()->set_line_as_marked(line,true);
+ get_text_edit()->set_line_as_marked(sl.get_error_line(),true);
} else {
for(int i=0;i<get_text_edit()->get_line_count();i++)
@@ -187,9 +208,7 @@ ShaderTextEditor::ShaderTextEditor() {
void ShaderEditor::_menu_option(int p_option) {
- ShaderTextEditor *current = tab_container->get_current_tab_control()->cast_to<ShaderTextEditor>();
- if (!current)
- return;
+ ShaderTextEditor *current = shader_editor;
switch(p_option) {
case EDIT_UNDO: {
@@ -234,9 +253,9 @@ void ShaderEditor::_menu_option(int p_option) {
current->get_find_replace_bar()->popup_replace();
} break;
-// case SEARCH_LOCATE_SYMBOL: {
+ //case SEARCH_LOCATE_SYMBOL: {
-// } break;
+ //} break;
case SEARCH_GOTO_LINE: {
goto_line_dialog->popup_find_line(current->get_text_edit());
@@ -245,24 +264,11 @@ void ShaderEditor::_menu_option(int p_option) {
}
}
-void ShaderEditor::_tab_changed(int p_which) {
-
- ShaderTextEditor *shader_editor = tab_container->get_tab_control(p_which)->cast_to<ShaderTextEditor>();
-
- if (shader_editor && is_inside_tree())
- shader_editor->get_text_edit()->grab_focus();
-
- ensure_select_current();
-}
void ShaderEditor::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
- close->set_normal_texture( get_icon("Close","EditorIcons"));
- close->set_hover_texture( get_icon("CloseHover","EditorIcons"));
- close->set_pressed_texture( get_icon("Close","EditorIcons"));
- close->connect("pressed",this,"_close_callback");
}
if (p_what==NOTIFICATION_DRAW) {
@@ -365,59 +371,32 @@ void ShaderEditor::clear() {
void ShaderEditor::_params_changed() {
- fragment_editor->_validate_script();
- vertex_editor->_validate_script();
- light_editor->_validate_script();
+ shader_editor->_validate_script();
}
void ShaderEditor::_editor_settings_changed() {
- vertex_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
- vertex_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
- vertex_editor->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
- vertex_editor->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/draw_tabs"));
- vertex_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/show_line_numbers"));
- vertex_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/syntax_highlighting"));
- vertex_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences"));
- vertex_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
- vertex_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
- vertex_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing"));
- vertex_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
-
- fragment_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
- fragment_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
- fragment_editor->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
- fragment_editor->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/draw_tabs"));
- fragment_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/show_line_numbers"));
- fragment_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/syntax_highlighting"));
- fragment_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences"));
- fragment_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
- fragment_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
- fragment_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing"));
- fragment_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
-
- light_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
- light_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
- light_editor->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
- light_editor->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/draw_tabs"));
- light_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/show_line_numbers"));
- light_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/syntax_highlighting"));
- light_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences"));
- light_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
- light_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
- light_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing"));
- light_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
+ shader_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/completion/auto_brace_complete"));
+ shader_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/cursor/scroll_past_end_of_file"));
+ shader_editor->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/indent/tab_size"));
+ shader_editor->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/indent/draw_tabs"));
+ shader_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_line_numbers"));
+ shader_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/highlighting/syntax_highlighting"));
+ shader_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_all_occurrences"));
+ shader_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink"));
+ shader_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink_speed"));
+ shader_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/theme/line_spacing"));
+ shader_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/cursor/block_caret"));
}
void ShaderEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_editor_settings_changed",&ShaderEditor::_editor_settings_changed);
- ObjectTypeDB::bind_method("_tab_changed",&ShaderEditor::_tab_changed);
- ObjectTypeDB::bind_method("_menu_option",&ShaderEditor::_menu_option);
- ObjectTypeDB::bind_method("_params_changed",&ShaderEditor::_params_changed);
- ObjectTypeDB::bind_method("_close_callback",&ShaderEditor::_close_callback);
- ObjectTypeDB::bind_method("apply_shaders",&ShaderEditor::apply_shaders);
-// ObjectTypeDB::bind_method("_close_current_tab",&ShaderEditor::_close_current_tab);
+ ClassDB::bind_method("_editor_settings_changed",&ShaderEditor::_editor_settings_changed);
+
+ ClassDB::bind_method("_menu_option",&ShaderEditor::_menu_option);
+ ClassDB::bind_method("_params_changed",&ShaderEditor::_params_changed);
+ ClassDB::bind_method("apply_shaders",&ShaderEditor::apply_shaders);
+ //ClassDB::bind_method("_close_current_tab",&ShaderEditor::_close_current_tab);
}
void ShaderEditor::ensure_select_current() {
@@ -441,16 +420,7 @@ void ShaderEditor::edit(const Ref<Shader>& p_shader) {
shader=p_shader;
- if (shader->get_mode()==Shader::MODE_MATERIAL) {
- vertex_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_MATERIAL_VERTEX);
- fragment_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_MATERIAL_FRAGMENT);
- light_editor->set_edited_shader(shader,ShaderLanguage::SHADER_MATERIAL_LIGHT);
- } else if (shader->get_mode()==Shader::MODE_CANVAS_ITEM) {
-
- vertex_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX);
- fragment_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT);
- light_editor->set_edited_shader(shader,ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT);
- }
+ shader_editor->set_edited_shader(p_shader);
//vertex_editor->set_edited_shader(shader,ShaderLanguage::SHADER_MATERIAL_VERTEX);
// see if already has it
@@ -474,35 +444,21 @@ void ShaderEditor::apply_shaders() {
if (shader.is_valid()) {
- shader->set_code(vertex_editor->get_text_edit()->get_text(),fragment_editor->get_text_edit()->get_text(),light_editor->get_text_edit()->get_text(),0,0);
+ shader->set_code(shader_editor->get_text_edit()->get_text());
shader->set_edited(true);
}
}
-void ShaderEditor::_close_callback() {
-
- hide();
-}
-
ShaderEditor::ShaderEditor() {
- tab_container = memnew( TabContainer );
- add_child(tab_container);
- tab_container->set_area_as_parent_rect();
- tab_container->set_begin(Point2(0,0));
- //tab_container->set_begin(Point2(0,0));
-
- close = memnew( TextureButton );
- close->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_END,20);
- close->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,4);
- close->set_anchor_and_margin(MARGIN_TOP,ANCHOR_BEGIN,2);
- add_child(close);
+ HBoxContainer *hbc = memnew( HBoxContainer);
+ add_child(hbc);
edit_menu = memnew( MenuButton );
- add_child(edit_menu);
+ hbc->add_child(edit_menu);
edit_menu->set_pos(Point2(5,-1));
edit_menu->set_text(TTR("Edit"));
edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/undo", TTR("Undo"), KEY_MASK_CMD|KEY_Z), EDIT_UNDO);
@@ -513,11 +469,11 @@ ShaderEditor::ShaderEditor() {
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_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");
+ edit_menu->get_popup()->connect("id_pressed", this,"_menu_option");
search_menu = memnew( MenuButton );
- add_child(search_menu);
+ hbc->add_child(search_menu);
search_menu->set_pos(Point2(38,-1));
search_menu->set_text(TTR("Search"));
search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find.."), KEY_MASK_CMD|KEY_F), SEARCH_FIND);
@@ -525,39 +481,20 @@ ShaderEditor::ShaderEditor() {
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("Locate Symbol..",SEARCH_LOCATE_SYMBOL,KEY_MASK_CMD|KEY_K);
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");
-
-
- tab_container->connect("tab_changed", this,"_tab_changed");
-
- erase_tab_confirm = memnew( ConfirmationDialog );
- add_child(erase_tab_confirm);
- erase_tab_confirm->connect("confirmed", this,"_close_current_tab");
+ search_menu->get_popup()->connect("id_pressed", this,"_menu_option");
goto_line_dialog = memnew(GotoLineDialog);
add_child(goto_line_dialog);
- vertex_editor = memnew( ShaderTextEditor );
- tab_container->add_child(vertex_editor);
- vertex_editor->set_name(TTR("Vertex"));
+ shader_editor = memnew( ShaderTextEditor );
+ add_child(shader_editor);
+ shader_editor->set_v_size_flags(SIZE_EXPAND_FILL);
- fragment_editor = memnew( ShaderTextEditor );
- tab_container->add_child(fragment_editor);
- fragment_editor->set_name(TTR("Fragment"));
- light_editor = memnew( ShaderTextEditor );
- tab_container->add_child(light_editor);
- light_editor->set_name(TTR("Lighting"));
-
- tab_container->set_current_tab(1);
-
-
- vertex_editor->connect("script_changed", this,"apply_shaders");
- fragment_editor->connect("script_changed", this,"apply_shaders");
- light_editor->connect("script_changed", this,"apply_shaders");
+ shader_editor->connect("script_changed", this,"apply_shaders");
EditorSettings::get_singleton()->connect("settings_changed",this,"_editor_settings_changed");
_editor_settings_changed();
@@ -567,15 +504,7 @@ ShaderEditor::ShaderEditor() {
void ShaderEditorPlugin::edit(Object *p_object) {
Shader* s = p_object->cast_to<Shader>();
- if (!s || s->cast_to<ShaderGraph>()) {
- shader_editor->hide(); //Dont edit ShaderGraph
- return;
- }
-
- if (_2d && s->get_mode()==Shader::MODE_CANVAS_ITEM)
- shader_editor->edit(s);
- else if (!_2d && s->get_mode()==Shader::MODE_MATERIAL)
- shader_editor->edit(s);
+ shader_editor->edit(s);
}
@@ -583,24 +512,27 @@ bool ShaderEditorPlugin::handles(Object *p_object) const {
bool handles = true;
Shader *shader=p_object->cast_to<Shader>();
+ /*
if (!shader || shader->cast_to<ShaderGraph>()) // Dont handle ShaderGraph's
handles = false;
- if (handles && _2d)
- handles = shader->get_mode()==Shader::MODE_CANVAS_ITEM;
- else if (handles && !_2d)
- return shader->get_mode()==Shader::MODE_MATERIAL;
-
- if (!handles)
- shader_editor->hide();
- return handles;
+ */
+
+ return shader!=NULL;
}
void ShaderEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
- shader_editor->show();
+ button->show();
+ editor->make_bottom_panel_item_visible(shader_editor);
+
} else {
+
+ button->hide();
+ if (shader_editor->is_visible_in_tree())
+ editor->hide_bottom_panel();
shader_editor->apply_shaders();
+
}
}
@@ -634,19 +566,14 @@ void ShaderEditorPlugin::apply_changes() {
shader_editor->apply_shaders();
}
-ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node, bool p_2d) {
+ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node) {
+
editor=p_node;
shader_editor = memnew( ShaderEditor );
- _2d=p_2d;
- if (p_2d)
- add_control_to_container(CONTAINER_CANVAS_EDITOR_BOTTOM,shader_editor);
- else
- add_control_to_container(CONTAINER_SPATIAL_EDITOR_BOTTOM,shader_editor);
-// editor->get_viewport()->add_child(shader_editor);
-// shader_editor->set_area_as_parent_rect();
- shader_editor->hide();
+ shader_editor->set_custom_minimum_size(Size2(0,300));
+ button=editor->add_bottom_panel_item("Shader",shader_editor);
}
@@ -654,3 +581,4 @@ ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node, bool p_2d) {
ShaderEditorPlugin::~ShaderEditorPlugin() {
}
+
diff --git a/tools/editor/plugins/shader_editor_plugin.h b/tools/editor/plugins/shader_editor_plugin.h
index 9219a1fbc2..e94b4d9c25 100644
--- a/tools/editor/plugins/shader_editor_plugin.h
+++ b/tools/editor/plugins/shader_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -38,33 +38,34 @@
#include "scene/resources/shader.h"
#include "servers/visual/shader_language.h"
-
class ShaderTextEditor : public CodeTextEditor {
- OBJ_TYPE( ShaderTextEditor, CodeTextEditor );
+ GDCLASS( ShaderTextEditor, CodeTextEditor );
Ref<Shader> shader;
- ShaderLanguage::ShaderType type;
protected:
static void _bind_methods();
virtual void _load_theme_settings();
+
+ virtual void _code_complete_script(const String& p_code, List<String>* r_options);
+
public:
virtual void _validate_script();
Ref<Shader> get_edited_shader() const;
- void set_edited_shader(const Ref<Shader>& p_shader,ShaderLanguage::ShaderType p_type);
+ void set_edited_shader(const Ref<Shader>& p_shader);
ShaderTextEditor();
};
-class ShaderEditor : public Control {
+class ShaderEditor : public VBoxContainer {
- OBJ_TYPE(ShaderEditor, Control );
+ GDCLASS(ShaderEditor, VBoxContainer );
enum {
@@ -88,22 +89,17 @@ class ShaderEditor : public Control {
MenuButton *settings_menu;
uint64_t idle;
- TabContainer *tab_container;
GotoLineDialog *goto_line_dialog;
ConfirmationDialog *erase_tab_confirm;
- TextureButton *close;
- ShaderTextEditor *vertex_editor;
- ShaderTextEditor *fragment_editor;
- ShaderTextEditor *light_editor;
+ ShaderTextEditor *shader_editor;
+
- void _tab_changed(int p_which);
void _menu_option(int p_optin);
void _params_changed();
mutable Ref<Shader> shader;
- void _close_callback();
void _editor_settings_changed();
@@ -129,11 +125,13 @@ public:
class ShaderEditorPlugin : public EditorPlugin {
- OBJ_TYPE( ShaderEditorPlugin, EditorPlugin );
+ GDCLASS( ShaderEditorPlugin, EditorPlugin );
bool _2d;
ShaderEditor *shader_editor;
EditorNode *editor;
+ Button *button;
+
public:
virtual String get_name() const { return "Shader"; }
@@ -150,8 +148,9 @@ public:
virtual void save_external_data();
virtual void apply_changes();
- ShaderEditorPlugin(EditorNode *p_node,bool p_2d);
+ ShaderEditorPlugin(EditorNode *p_node);
~ShaderEditorPlugin();
};
+
#endif
diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp
index 3ab906f84e..d989c5b30d 100644
--- a/tools/editor/plugins/shader_graph_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -28,6 +28,7 @@
/*************************************************************************/
#include "shader_graph_editor_plugin.h"
+#if 0
#include "scene/gui/check_box.h"
#include "scene/gui/menu_button.h"
@@ -36,7 +37,7 @@
#include "os/keyboard.h"
#include "canvas_item_editor_plugin.h"
-void GraphColorRampEdit::_input_event(const InputEvent& p_event) {
+void GraphColorRampEdit::_gui_input(const InputEvent& p_event) {
if (p_event.type==InputEvent::KEY && p_event.key.pressed && p_event.key.scancode==KEY_DELETE && grabbed!=-1) {
@@ -295,8 +296,8 @@ Vector<Color> GraphColorRampEdit::get_colors() const{
void GraphColorRampEdit::_bind_methods(){
- ObjectTypeDB::bind_method(_MD("_input_event"),&GraphColorRampEdit::_input_event);
- ObjectTypeDB::bind_method(_MD("_color_changed"),&GraphColorRampEdit::_color_changed);
+ ClassDB::bind_method(_MD("_gui_input"),&GraphColorRampEdit::_gui_input);
+ ClassDB::bind_method(_MD("_color_changed"),&GraphColorRampEdit::_color_changed);
ADD_SIGNAL(MethodInfo("ramp_changed"));
}
@@ -309,13 +310,13 @@ GraphColorRampEdit::GraphColorRampEdit(){
popup = memnew( PopupPanel );
picker = memnew( ColorPicker );
popup->add_child(picker);
- popup->set_child_rect(picker);
+ /popup->set_child_rect(picker);
add_child(popup);
}
////////////
-void GraphCurveMapEdit::_input_event(const InputEvent& p_event) {
+void GraphCurveMapEdit::_gui_input(const InputEvent& p_event) {
if (p_event.type==InputEvent::KEY && p_event.key.pressed && p_event.key.scancode==KEY_DELETE && grabbed!=-1) {
@@ -657,7 +658,7 @@ Vector<Vector2> GraphCurveMapEdit::get_points() const {
void GraphCurveMapEdit::_bind_methods(){
- ObjectTypeDB::bind_method(_MD("_input_event"),&GraphCurveMapEdit::_input_event);
+ ClassDB::bind_method(_MD("_gui_input"),&GraphCurveMapEdit::_gui_input);
ADD_SIGNAL(MethodInfo("curve_changed"));
}
@@ -985,13 +986,13 @@ void ShaderGraphView::_color_ramp_changed(int p_id,Node* p_ramp) {
Vector<float> offsets=cr->get_offsets();
Vector<Color> colors=cr->get_colors();
- DVector<float> new_offsets;
- DVector<Color> new_colors;
+ PoolVector<float> new_offsets;
+ PoolVector<Color> new_colors;
{
new_offsets.resize(offsets.size());
new_colors.resize(colors.size());
- DVector<float>::Write ow=new_offsets.write();
- DVector<Color>::Write cw=new_colors.write();
+ PoolVector<float>::Write ow=new_offsets.write();
+ PoolVector<Color>::Write cw=new_colors.write();
for(int i=0;i<new_offsets.size();i++) {
ow[i]=offsets[i];
cw[i]=colors[i];
@@ -1000,8 +1001,8 @@ void ShaderGraphView::_color_ramp_changed(int p_id,Node* p_ramp) {
}
- DVector<float> old_offsets=graph->color_ramp_node_get_offsets(type,p_id);
- DVector<Color> old_colors=graph->color_ramp_node_get_colors(type,p_id);
+ PoolVector<float> old_offsets=graph->color_ramp_node_get_offsets(type,p_id);
+ PoolVector<Color> old_colors=graph->color_ramp_node_get_colors(type,p_id);
if (old_offsets.size()!=new_offsets.size())
ur->create_action(TTR("Add/Remove to Color Ramp"));
@@ -1026,10 +1027,10 @@ void ShaderGraphView::_curve_changed(int p_id,Node* p_curve) {
Vector<Point2> points=cr->get_points();
- DVector<Vector2> new_points;
+ PoolVector<Vector2> new_points;
{
new_points.resize(points.size());
- DVector<Vector2>::Write ow=new_points.write();
+ PoolVector<Vector2>::Write ow=new_points.write();
for(int i=0;i<new_points.size();i++) {
ow[i]=points[i];
}
@@ -1037,7 +1038,7 @@ void ShaderGraphView::_curve_changed(int p_id,Node* p_curve) {
}
- DVector<Vector2> old_points=graph->curve_map_node_get_points(type,p_id);
+ PoolVector<Vector2> old_points=graph->curve_map_node_get_points(type,p_id);
if (old_points.size()!=new_points.size())
ur->create_action(TTR("Add/Remove to Curve Map"));
@@ -1377,7 +1378,7 @@ ToolButton *ShaderGraphView::make_editor(String text,GraphNode* gn,int p_id,int
edit->set_icon(ped_popup->get_icon("Matrix", "EditorIcons"));
break;
case Variant::COLOR: {
- Image icon_color = Image(15,15,false,Image::FORMAT_RGB);
+ Image icon_color = Image(15,15,false,Image::FORMAT_RGB8);
Color c = graph->default_get_value(type,p_id,param);
for (int x=1;x<14;x++)
for (int y=1;y<14;y++)
@@ -2130,14 +2131,14 @@ void ShaderGraphView::_create_node(int p_id) {
gn->set_title("ColorRamp");
GraphColorRampEdit * ramp = memnew( GraphColorRampEdit );
- DVector<real_t> offsets = graph->color_ramp_node_get_offsets(type,p_id);
- DVector<Color> colors = graph->color_ramp_node_get_colors(type,p_id);
+ PoolVector<real_t> offsets = graph->color_ramp_node_get_offsets(type,p_id);
+ PoolVector<Color> colors = graph->color_ramp_node_get_colors(type,p_id);
int oc = offsets.size();
if (oc) {
- DVector<real_t>::Read rofs = offsets.read();
- DVector<Color>::Read rcol = colors.read();
+ PoolVector<real_t>::Read rofs = offsets.read();
+ PoolVector<Color>::Read rcol = colors.read();
Vector<float> ofsv;
Vector<Color> colorv;
@@ -2183,12 +2184,12 @@ void ShaderGraphView::_create_node(int p_id) {
gn->set_title("CurveMap");
GraphCurveMapEdit * map = memnew( GraphCurveMapEdit );
- DVector<Vector2> points = graph->curve_map_node_get_points(type,p_id);
+ PoolVector<Vector2> points = graph->curve_map_node_get_points(type,p_id);
int oc = points.size();
if (oc) {
- DVector<Vector2>::Read rofs = points.read();
+ PoolVector<Vector2>::Read rofs = points.read();
Vector<Vector2> ofsv;
@@ -2314,12 +2315,12 @@ void ShaderGraphView::_create_node(int p_id) {
gn->add_child(le);
le->set_text(graph->input_node_get_name(type,p_id));
le->connect("text_entered",this,"_input_name_changed",varray(p_id,le));
- TextureFrame *tex = memnew( TextureFrame );
+ TextureRect *tex = memnew( TextureRect );
tex->set_expand(true);
tex->set_custom_minimum_size(Size2(80,80));
tex->set_drag_forwarding(this);
gn->add_child(tex);
- tex->set_ignore_mouse(false);
+ tex->set_mouse_filter(MOUSE_FILTER_PASS);
tex->set_texture(graph->texture_input_node_get_value(type,p_id));
ToolButton *edit = memnew( ToolButton );
edit->set_text("edit..");
@@ -2529,7 +2530,7 @@ void ShaderGraphView::_sg_updated() {
Variant ShaderGraphView::get_drag_data_fw(const Point2 &p_point, Control *p_from)
{
- TextureFrame* frame = p_from->cast_to<TextureFrame>();
+ TextureRect* frame = p_from->cast_to<TextureRect>();
if (!frame)
return Variant();
@@ -2575,7 +2576,7 @@ void ShaderGraphView::drop_data_fw(const Point2 &p_point, const Variant &p_data,
if (!can_drop_data_fw(p_point, p_data, p_from))
return;
- TextureFrame *frame = p_from->cast_to<TextureFrame>();
+ TextureRect *frame = p_from->cast_to<TextureRect>();
if (!frame)
return;
@@ -2694,49 +2695,49 @@ void ShaderGraphView::add_node(int p_type, const Vector2 &location) {
void ShaderGraphView::_bind_methods() {
- ObjectTypeDB::bind_method("_update_graph",&ShaderGraphView::_update_graph);
- ObjectTypeDB::bind_method("_begin_node_move", &ShaderGraphView::_begin_node_move);
- ObjectTypeDB::bind_method("_node_moved",&ShaderGraphView::_node_moved);
- ObjectTypeDB::bind_method("_end_node_move", &ShaderGraphView::_end_node_move);
- ObjectTypeDB::bind_method("_move_node",&ShaderGraphView::_move_node);
- ObjectTypeDB::bind_method("_node_removed",&ShaderGraphView::_node_removed);
- ObjectTypeDB::bind_method("_connection_request",&ShaderGraphView::_connection_request);
- ObjectTypeDB::bind_method("_disconnection_request",&ShaderGraphView::_disconnection_request);
- ObjectTypeDB::bind_method("_duplicate_nodes_request", &ShaderGraphView::_duplicate_nodes_request);
- ObjectTypeDB::bind_method("_duplicate_nodes", &ShaderGraphView::_duplicate_nodes);
- ObjectTypeDB::bind_method("_delete_nodes_request", &ShaderGraphView::_delete_nodes_request);
-
- ObjectTypeDB::bind_method("_default_changed",&ShaderGraphView::_default_changed);
- ObjectTypeDB::bind_method("_scalar_const_changed",&ShaderGraphView::_scalar_const_changed);
- ObjectTypeDB::bind_method("_vec_const_changed",&ShaderGraphView::_vec_const_changed);
- ObjectTypeDB::bind_method("_rgb_const_changed",&ShaderGraphView::_rgb_const_changed);
- ObjectTypeDB::bind_method("_xform_const_changed",&ShaderGraphView::_xform_const_changed);
- ObjectTypeDB::bind_method("_scalar_op_changed",&ShaderGraphView::_scalar_op_changed);
- ObjectTypeDB::bind_method("_vec_op_changed",&ShaderGraphView::_vec_op_changed);
- ObjectTypeDB::bind_method("_vec_scalar_op_changed",&ShaderGraphView::_vec_scalar_op_changed);
- ObjectTypeDB::bind_method("_rgb_op_changed",&ShaderGraphView::_rgb_op_changed);
- ObjectTypeDB::bind_method("_xform_inv_rev_changed",&ShaderGraphView::_xform_inv_rev_changed);
- ObjectTypeDB::bind_method("_scalar_func_changed",&ShaderGraphView::_scalar_func_changed);
- ObjectTypeDB::bind_method("_vec_func_changed",&ShaderGraphView::_vec_func_changed);
- ObjectTypeDB::bind_method("_scalar_input_changed",&ShaderGraphView::_scalar_input_changed);
- ObjectTypeDB::bind_method("_vec_input_changed",&ShaderGraphView::_vec_input_changed);
- ObjectTypeDB::bind_method("_xform_input_changed",&ShaderGraphView::_xform_input_changed);
- ObjectTypeDB::bind_method("_rgb_input_changed",&ShaderGraphView::_rgb_input_changed);
- ObjectTypeDB::bind_method("_tex_input_change",&ShaderGraphView::_tex_input_change);
- ObjectTypeDB::bind_method("_cube_input_change",&ShaderGraphView::_cube_input_change);
- ObjectTypeDB::bind_method("_input_name_changed",&ShaderGraphView::_input_name_changed);
- ObjectTypeDB::bind_method("_tex_edited",&ShaderGraphView::_tex_edited);
- ObjectTypeDB::bind_method("_variant_edited",&ShaderGraphView::_variant_edited);
- ObjectTypeDB::bind_method("_cube_edited",&ShaderGraphView::_cube_edited);
- ObjectTypeDB::bind_method("_comment_edited",&ShaderGraphView::_comment_edited);
- ObjectTypeDB::bind_method("_color_ramp_changed",&ShaderGraphView::_color_ramp_changed);
- ObjectTypeDB::bind_method("_curve_changed",&ShaderGraphView::_curve_changed);
-
- ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &ShaderGraphView::get_drag_data_fw);
- ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &ShaderGraphView::can_drop_data_fw);
- ObjectTypeDB::bind_method(_MD("drop_data_fw"), &ShaderGraphView::drop_data_fw);
-
- ObjectTypeDB::bind_method("_sg_updated",&ShaderGraphView::_sg_updated);
+ ClassDB::bind_method("_update_graph",&ShaderGraphView::_update_graph);
+ ClassDB::bind_method("_begin_node_move", &ShaderGraphView::_begin_node_move);
+ ClassDB::bind_method("_node_moved",&ShaderGraphView::_node_moved);
+ ClassDB::bind_method("_end_node_move", &ShaderGraphView::_end_node_move);
+ ClassDB::bind_method("_move_node",&ShaderGraphView::_move_node);
+ ClassDB::bind_method("_node_removed",&ShaderGraphView::_node_removed);
+ ClassDB::bind_method("_connection_request",&ShaderGraphView::_connection_request);
+ ClassDB::bind_method("_disconnection_request",&ShaderGraphView::_disconnection_request);
+ ClassDB::bind_method("_duplicate_nodes_request", &ShaderGraphView::_duplicate_nodes_request);
+ ClassDB::bind_method("_duplicate_nodes", &ShaderGraphView::_duplicate_nodes);
+ ClassDB::bind_method("_delete_nodes_request", &ShaderGraphView::_delete_nodes_request);
+
+ ClassDB::bind_method("_default_changed",&ShaderGraphView::_default_changed);
+ ClassDB::bind_method("_scalar_const_changed",&ShaderGraphView::_scalar_const_changed);
+ ClassDB::bind_method("_vec_const_changed",&ShaderGraphView::_vec_const_changed);
+ ClassDB::bind_method("_rgb_const_changed",&ShaderGraphView::_rgb_const_changed);
+ ClassDB::bind_method("_xform_const_changed",&ShaderGraphView::_xform_const_changed);
+ ClassDB::bind_method("_scalar_op_changed",&ShaderGraphView::_scalar_op_changed);
+ ClassDB::bind_method("_vec_op_changed",&ShaderGraphView::_vec_op_changed);
+ ClassDB::bind_method("_vec_scalar_op_changed",&ShaderGraphView::_vec_scalar_op_changed);
+ ClassDB::bind_method("_rgb_op_changed",&ShaderGraphView::_rgb_op_changed);
+ ClassDB::bind_method("_xform_inv_rev_changed",&ShaderGraphView::_xform_inv_rev_changed);
+ ClassDB::bind_method("_scalar_func_changed",&ShaderGraphView::_scalar_func_changed);
+ ClassDB::bind_method("_vec_func_changed",&ShaderGraphView::_vec_func_changed);
+ ClassDB::bind_method("_scalar_input_changed",&ShaderGraphView::_scalar_input_changed);
+ ClassDB::bind_method("_vec_input_changed",&ShaderGraphView::_vec_input_changed);
+ ClassDB::bind_method("_xform_input_changed",&ShaderGraphView::_xform_input_changed);
+ ClassDB::bind_method("_rgb_input_changed",&ShaderGraphView::_rgb_input_changed);
+ ClassDB::bind_method("_tex_input_change",&ShaderGraphView::_tex_input_change);
+ ClassDB::bind_method("_cube_input_change",&ShaderGraphView::_cube_input_change);
+ ClassDB::bind_method("_input_name_changed",&ShaderGraphView::_input_name_changed);
+ ClassDB::bind_method("_tex_edited",&ShaderGraphView::_tex_edited);
+ ClassDB::bind_method("_variant_edited",&ShaderGraphView::_variant_edited);
+ ClassDB::bind_method("_cube_edited",&ShaderGraphView::_cube_edited);
+ ClassDB::bind_method("_comment_edited",&ShaderGraphView::_comment_edited);
+ ClassDB::bind_method("_color_ramp_changed",&ShaderGraphView::_color_ramp_changed);
+ ClassDB::bind_method("_curve_changed",&ShaderGraphView::_curve_changed);
+
+ ClassDB::bind_method(_MD("get_drag_data_fw"), &ShaderGraphView::get_drag_data_fw);
+ ClassDB::bind_method(_MD("can_drop_data_fw"), &ShaderGraphView::can_drop_data_fw);
+ ClassDB::bind_method(_MD("drop_data_fw"), &ShaderGraphView::drop_data_fw);
+
+ ClassDB::bind_method("_sg_updated",&ShaderGraphView::_sg_updated);
}
ShaderGraphView::ShaderGraphView(ShaderGraph::ShaderType p_type) {
@@ -2806,7 +2807,7 @@ void ShaderGraphEditor::_notification(int p_what) {
if (addsep)
popup->add_separator();
}
- popup->connect("item_pressed",this,"_add_node");
+ popup->connect("id_pressed",this,"_add_node");
}
@@ -2814,8 +2815,8 @@ void ShaderGraphEditor::_notification(int p_what) {
void ShaderGraphEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_add_node",&ShaderGraphEditor::_add_node);
- ObjectTypeDB::bind_method("_popup_requested",&ShaderGraphEditor::_popup_requested);
+ ClassDB::bind_method("_add_node",&ShaderGraphEditor::_add_node);
+ ClassDB::bind_method("_popup_requested",&ShaderGraphEditor::_popup_requested);
}
@@ -2932,9 +2933,9 @@ ShaderGraphEditorPlugin::ShaderGraphEditorPlugin(EditorNode *p_node, bool p_2d)
SpatialEditor::get_singleton()->get_shader_split()->add_child(shader_editor);
- // editor->get_viewport()->add_child(shader_editor);
- // shader_editor->set_area_as_parent_rect();
- // shader_editor->hide();
+ //editor->get_viewport()->add_child(shader_editor);
+ //shader_editor->set_area_as_parent_rect();
+ //shader_editor->hide();
}
@@ -2945,3 +2946,4 @@ ShaderGraphEditorPlugin::~ShaderGraphEditorPlugin()
+#endif
diff --git a/tools/editor/plugins/shader_graph_editor_plugin.h b/tools/editor/plugins/shader_graph_editor_plugin.h
index 67ee5e2d45..477a45bd1f 100644
--- a/tools/editor/plugins/shader_graph_editor_plugin.h
+++ b/tools/editor/plugins/shader_graph_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -43,10 +43,10 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
-
+#if 0
class GraphColorRampEdit : public Control {
- OBJ_TYPE(GraphColorRampEdit,Control);
+ GDCLASS(GraphColorRampEdit,Control);
struct Point {
@@ -70,7 +70,7 @@ class GraphColorRampEdit : public Control {
void _color_changed(const Color& p_color);
protected:
- void _input_event(const InputEvent& p_event);
+ void _gui_input(const InputEvent& p_event);
void _notification(int p_what);
static void _bind_methods();
public:
@@ -85,7 +85,7 @@ public:
class GraphCurveMapEdit : public Control {
- OBJ_TYPE(GraphCurveMapEdit,Control);
+ GDCLASS(GraphCurveMapEdit,Control);
struct Point {
@@ -104,7 +104,7 @@ class GraphCurveMapEdit : public Control {
void _plot_curve(const Vector2& p_a,const Vector2& p_b,const Vector2& p_c,const Vector2& p_d);
protected:
- void _input_event(const InputEvent& p_event);
+ void _gui_input(const InputEvent& p_event);
void _notification(int p_what);
static void _bind_methods();
public:
@@ -117,7 +117,7 @@ public:
class ShaderGraphView : public Control {
- OBJ_TYPE(ShaderGraphView,Control);
+ GDCLASS(ShaderGraphView,Control);
@@ -198,7 +198,7 @@ public:
class ShaderGraphEditor : public VBoxContainer {
- OBJ_TYPE(ShaderGraphEditor,VBoxContainer);
+ GDCLASS(ShaderGraphEditor,VBoxContainer);
PopupMenu *popup;
TabContainer *tabs;
@@ -220,7 +220,7 @@ public:
class ShaderGraphEditorPlugin : public EditorPlugin {
- OBJ_TYPE( ShaderGraphEditorPlugin, EditorPlugin );
+ GDCLASS( ShaderGraphEditorPlugin, EditorPlugin );
bool _2d;
ShaderGraphEditor *shader_editor;
@@ -239,4 +239,4 @@ public:
};
#endif
-
+#endif
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index 9701b8030d..0f01f71294 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -61,8 +61,8 @@ void SpatialEditorViewport::_update_camera() {
Transform camera_transform;
camera_transform.translate(cursor.pos);
- camera_transform.basis.rotate(Vector3(0, 1, 0), cursor.y_rot);
- camera_transform.basis.rotate(Vector3(1, 0, 0), cursor.x_rot);
+ camera_transform.basis.rotate(Vector3(1, 0, 0), -cursor.x_rot);
+ camera_transform.basis.rotate(Vector3(0, 1, 0), -cursor.y_rot);
if (orthogonal)
camera_transform.translate(0, 0, 4096);
@@ -274,11 +274,11 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b
Vector3 ray=_get_ray(p_pos);
Vector3 pos=_get_ray_pos(p_pos);
- Vector<RID> instances=VisualServer::get_singleton()->instances_cull_ray(pos,ray,get_tree()->get_root()->get_world()->get_scenario() );
+ Vector<ObjectID> instances=VisualServer::get_singleton()->instances_cull_ray(pos,ray,get_tree()->get_root()->get_world()->get_scenario() );
Set<Ref<SpatialEditorGizmo> > found_gizmos;
//uint32_t closest=0;
-// float closest_dist=0;
+ //float closest_dist=0;
r_includes_current=false;
@@ -286,8 +286,7 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b
for (int i=0;i<instances.size();i++) {
- uint32_t id=VisualServer::get_singleton()->instance_get_object_instance_ID(instances[i]);
- Object *obj=ObjectDB::get_instance(id);
+ Object *obj=ObjectDB::get_instance(instances[i]);
if (!obj)
continue;
@@ -405,15 +404,15 @@ void SpatialEditorViewport::_find_items_at_pos(const Point2& p_pos,bool &r_inclu
Vector3 ray=_get_ray(p_pos);
Vector3 pos=_get_ray_pos(p_pos);
- Vector<RID> instances=VisualServer::get_singleton()->instances_cull_ray(pos,ray,get_tree()->get_root()->get_world()->get_scenario() );
+ Vector<ObjectID> instances=VisualServer::get_singleton()->instances_cull_ray(pos,ray,get_tree()->get_root()->get_world()->get_scenario() );
Set<Ref<SpatialEditorGizmo> > found_gizmos;
r_includes_current=false;
for (int i=0;i<instances.size();i++) {
- uint32_t id=VisualServer::get_singleton()->instance_get_object_instance_ID(instances[i]);
- Object *obj=ObjectDB::get_instance(id);
+ Object *obj=ObjectDB::get_instance(instances[i]);
+
if (!obj)
continue;
@@ -469,14 +468,14 @@ Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3& p_pos) {
CameraMatrix cm;
- cm.set_perspective(get_fov(),get_size().get_aspect(),get_znear(),get_zfar());
+ cm.set_perspective(get_fov(),get_size().aspect(),get_znear(),get_zfar());
float screen_w,screen_h;
cm.get_viewport_size(screen_w,screen_h);
Transform camera_transform;
camera_transform.translate( cursor.pos );
- camera_transform.basis.rotate(Vector3(0,1,0),cursor.y_rot);
- camera_transform.basis.rotate(Vector3(1,0,0),cursor.x_rot);
+ camera_transform.basis.rotate(Vector3(1,0,0),-cursor.x_rot);
+ camera_transform.basis.rotate(Vector3(0,1,0),-cursor.y_rot);
camera_transform.translate(0,0,cursor.distance);
return camera_transform.xform(Vector3( ((p_pos.x/get_size().width)*2.0-1.0)*screen_w, ((1.0-(p_pos.y/get_size().height))*2.0-1.0)*screen_h,-get_znear()));
@@ -534,14 +533,12 @@ void SpatialEditorViewport::_select_region() {
frustum.push_back( far );
- Vector<RID> instances=VisualServer::get_singleton()->instances_cull_convex(frustum,get_tree()->get_root()->get_world()->get_scenario());
+ Vector<ObjectID> instances=VisualServer::get_singleton()->instances_cull_convex(frustum,get_tree()->get_root()->get_world()->get_scenario());
for (int i=0;i<instances.size();i++) {
- uint32_t id=VisualServer::get_singleton()->instance_get_object_instance_ID(instances[i]);
-
- Object *obj=ObjectDB::get_instance(id);
+ Object *obj=ObjectDB::get_instance(instances[i]);
if (!obj)
continue;
Spatial *sp = obj->cast_to<Spatial>();
@@ -583,8 +580,8 @@ void SpatialEditorViewport::_compute_edit(const Point2& p_point) {
List<Node*> &selection = editor_selection->get_selected_node_list();
-// Vector3 center;
-// int nc=0;
+ //Vector3 center;
+ //int nc=0;
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
Spatial *sp = E->get()->cast_to<Spatial>();
@@ -596,16 +593,14 @@ void SpatialEditorViewport::_compute_edit(const Point2& p_point) {
continue;
se->original=se->sp->get_global_transform();
-// center+=se->original.origin;
-// nc++;
+ //center+=se->original.origin;
+ //nc++;
}
-
-// if (nc)
-// _edit.center=center/float(nc);
-
-
-
+ /*
+ if (nc)
+ _edit.center=center/float(nc);
+ */
}
static int _get_key_modifier(const String& p_property) {
@@ -621,23 +616,6 @@ static int _get_key_modifier(const String& p_property) {
return 0;
}
-SpatialEditorViewport::NavigationScheme SpatialEditorViewport::_get_navigation_schema(const String& p_property) {
- switch(EditorSettings::get_singleton()->get(p_property).operator int()) {
- case 0: return NAVIGATION_GODOT;
- case 1: return NAVIGATION_MAYA;
- case 2: return NAVIGATION_MODO;
- }
- return NAVIGATION_GODOT;
-}
-
-SpatialEditorViewport::NavigationZoomStyle SpatialEditorViewport::_get_navigation_zoom_style(const String& p_property) {
- switch(EditorSettings::get_singleton()->get(p_property).operator int()) {
- case 0: return NAVIGATION_ZOOM_VERTICAL;
- case 1: return NAVIGATION_ZOOM_HORIZONTAL;
- }
- return NAVIGATION_ZOOM_VERTICAL;
-}
-
bool SpatialEditorViewport::_gizmo_select(const Vector2& p_screenpos,bool p_hilite_only) {
if (!spatial_editor->is_gizmo_visible())
@@ -795,7 +773,7 @@ void SpatialEditorViewport::_list_select(InputEventMouseButton b) {
if (spat->has_meta("_editor_icon"))
icon=spat->get_meta("_editor_icon");
else
- icon=get_icon( has_icon(spat->get_type(),"EditorIcons")?spat->get_type():String("Object"),"EditorIcons");
+ icon=get_icon( has_icon(spat->get_class(),"EditorIcons")?spat->get_class():String("Object"),"EditorIcons");
String node_path="/"+root_name+"/"+root_path.rel_path_to(spat->get_path());
@@ -803,7 +781,7 @@ void SpatialEditorViewport::_list_select(InputEventMouseButton b) {
selection_menu->set_item_icon(i, icon );
selection_menu->set_item_metadata(i, node_path);
selection_menu->set_item_tooltip(i,String(spat->get_name())+
- "\nType: "+spat->get_type()+"\nPath: "+node_path);
+ "\nType: "+spat->get_class()+"\nPath: "+node_path);
}
selection_menu->set_global_pos(Vector2( b.global_x, b.global_y ));
@@ -827,7 +805,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
if (!over_plugin_list->empty()) {
- bool discard = over_plugin_list->forward_spatial_input_event(camera,p_event);
+ bool discard = over_plugin_list->forward_spatial_gui_input(camera,p_event);
if (discard)
return;
}
@@ -857,7 +835,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
} break;
case BUTTON_RIGHT: {
- NavigationScheme nav_scheme = _get_navigation_schema("3d_editor/navigation_scheme");
+ NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int();
if (b.pressed && _edit.gizmo.is_valid()) {
//restore
@@ -877,7 +855,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
if (b.mod.control) {
- Vector<RID> instances=VisualServer::get_singleton()->instances_cull_ray(ray_origin,ray_dir,get_tree()->get_root()->get_world()->get_scenario() );
+ Vector<ObjectID> instances=VisualServer::get_singleton()->instances_cull_ray(ray_origin,ray_dir,get_tree()->get_root()->get_world()->get_scenario() );
Plane p(ray_origin,_get_camera_normal());
@@ -886,8 +864,9 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
for (int i=0;i<instances.size();i++) {
- uint32_t id=VisualServer::get_singleton()->instance_get_object_instance_ID(instances[i]);
- Object *obj=ObjectDB::get_instance(id);
+
+ Object *obj=ObjectDB::get_instance(instances[i]);
+
if (!obj)
continue;
@@ -896,14 +875,14 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
continue;
//optimize by checking AABB (although should pre sort by distance)
- AABB aabb = vi->get_global_transform().xform(vi->get_aabb());
+ Rect3 aabb = vi->get_global_transform().xform(vi->get_aabb());
if (p.distance_to(aabb.get_support(-ray_dir))>min_d)
continue;
- DVector<Face3> faces = vi->get_faces(VisualInstance::FACES_SOLID);
+ PoolVector<Face3> faces = vi->get_faces(VisualInstance::FACES_SOLID);
int c = faces.size();
if (c>0) {
- DVector<Face3>::Read r = faces.read();
+ PoolVector<Face3>::Read r = faces.read();
for(int j=0;j<c;j++) {
@@ -1016,7 +995,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
if (b.pressed) {
- NavigationScheme nav_scheme = _get_navigation_schema("3d_editor/navigation_scheme");
+ NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int();
if ( (nav_scheme==NAVIGATION_MAYA || nav_scheme==NAVIGATION_MODO) && b.mod.alt) {
break;
}
@@ -1253,7 +1232,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
}
- NavigationScheme nav_scheme = _get_navigation_schema("3d_editor/navigation_scheme");
+ NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int();
NavigationMode nav_mode = NAVIGATION_NONE;
if (_edit.gizmo.is_valid()) {
@@ -1354,7 +1333,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
Transform original=se->original;
- Transform base=Transform( Matrix3(), _edit.center);
+ Transform base=Transform( Basis(), _edit.center);
Transform t=base * (r * (base.inverse() * original));
sp->set_global_transform(t);
@@ -1486,7 +1465,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
Transform r;
- r.basis.rotate(plane.normal,-angle);
+ r.basis.rotate(plane.normal,angle);
List<Node*> &selection = editor_selection->get_selected_node_list();
@@ -1503,8 +1482,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
Transform original=se->original;
- Transform base=Transform( Matrix3(), _edit.center);
- Transform t=base * (r * (base.inverse() * original));
+ Transform base=Transform( Basis(), _edit.center);
+ Transform t=base * r * base.inverse() * original;
sp->set_global_transform(t);
}
@@ -1560,7 +1539,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
nav_mode = NAVIGATION_PAN;
}
- } else if (EditorSettings::get_singleton()->get("3d_editor/emulate_3_button_mouse")) {
+ } else if (EditorSettings::get_singleton()->get("editors/3d/emulate_3_button_mouse")) {
// Handle trackpad (no external mouse) use case
int mod = 0;
if (m.mod.shift)
@@ -1593,8 +1572,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
Transform camera_transform;
camera_transform.translate(cursor.pos);
- camera_transform.basis.rotate(Vector3(0,1,0),cursor.y_rot);
- camera_transform.basis.rotate(Vector3(1,0,0),cursor.x_rot);
+ camera_transform.basis.rotate(Vector3(1,0,0),-cursor.x_rot);
+ camera_transform.basis.rotate(Vector3(0,1,0),-cursor.y_rot);
Vector3 translation(-m.relative_x*pan_speed,m.relative_y*pan_speed,0);
translation*=cursor.distance/DISTANCE_DEFAULT;
camera_transform.translate(translation);
@@ -1608,7 +1587,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
if (nav_scheme==NAVIGATION_MAYA && m.mod.shift)
zoom_speed *= zoom_speed_modifier;
- NavigationZoomStyle zoom_style = _get_navigation_zoom_style("3d_editor/zoom_style");
+ NavigationZoomStyle zoom_style = (NavigationZoomStyle)EditorSettings::get_singleton()->get("3d_editor/zoom_style").operator int();
if (zoom_style == NAVIGATION_ZOOM_HORIZONTAL) {
if ( m.relative_x > 0)
cursor.distance*=1-m.relative_x*zoom_speed;
@@ -1742,7 +1721,7 @@ void SpatialEditorViewport::_notification(int p_what) {
if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
- bool visible=is_visible();
+ bool visible=is_visible_in_tree();
set_process(visible);
@@ -1793,7 +1772,7 @@ void SpatialEditorViewport::_notification(int p_what) {
if (se->aabb.has_no_surface()) {
- se->aabb=vi?vi->get_aabb():AABB( Vector3(-0.2,-0.2,-0.2),Vector3(0.4,0.4,0.4));
+ se->aabb=vi?vi->get_aabb():Rect3( Vector3(-0.2,-0.2,-0.2),Vector3(0.4,0.4,0.4));
}
Transform t=sp->get_global_transform();
@@ -1825,13 +1804,37 @@ void SpatialEditorViewport::_notification(int p_what) {
surface->update();
}
+ //update shadow atlas if changed
+
+ int shadowmap_size = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/size");
+ int atlas_q0 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_0_subdiv");
+ int atlas_q1 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_1_subdiv");
+ int atlas_q2 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_2_subdiv");
+ int atlas_q3 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_3_subdiv");
+
+
+ viewport->set_shadow_atlas_size(shadowmap_size);
+ viewport->set_shadow_atlas_quadrant_subdiv(0,Viewport::ShadowAtlasQuadrantSubdiv(atlas_q0));
+ viewport->set_shadow_atlas_quadrant_subdiv(1,Viewport::ShadowAtlasQuadrantSubdiv(atlas_q1));
+ viewport->set_shadow_atlas_quadrant_subdiv(2,Viewport::ShadowAtlasQuadrantSubdiv(atlas_q2));
+ viewport->set_shadow_atlas_quadrant_subdiv(3,Viewport::ShadowAtlasQuadrantSubdiv(atlas_q3));
+
+ //update msaa if changed
+
+ int msaa_mode = GlobalConfig::get_singleton()->get("rendering/antialias/msaa");
+ viewport->set_msaa(Viewport::MSAA(msaa_mode));
+
+ bool hdr = GlobalConfig::get_singleton()->get("rendering/dynamic_range/hdr");
+ viewport->set_hdr(hdr);
+
+
}
if (p_what==NOTIFICATION_ENTER_TREE) {
surface->connect("draw",this,"_draw");
- surface->connect("input_event",this,"_sinput");
- surface->connect("mouse_enter",this,"_smouseenter");
+ surface->connect("gui_input",this,"_sinput");
+ surface->connect("mouse_entered",this,"_smouseenter");
preview_camera->set_icon(get_icon("Camera","EditorIcons"));
_init_gizmo_instance(index);
}
@@ -1892,8 +1895,8 @@ void SpatialEditorViewport::_draw() {
if (previewing) {
- Size2 ss = Size2( Globals::get_singleton()->get("display/width"), Globals::get_singleton()->get("display/height") );
- float aspect = ss.get_aspect();
+ Size2 ss = Size2( GlobalConfig::get_singleton()->get("display/width"), GlobalConfig::get_singleton()->get("display/height") );
+ float aspect = ss.aspect();
Size2 s = get_size();
Rect2 draw_rect;
@@ -1978,6 +1981,11 @@ void SpatialEditorViewport::_menu_option(int p_option) {
_update_name();
} break;
+ case VIEW_CENTER_TO_ORIGIN: {
+
+ cursor.pos = Vector3(0,0,0);
+
+ } break;
case VIEW_CENTER_TO_SELECTION: {
focus_selection();
@@ -2061,9 +2069,9 @@ void SpatialEditorViewport::_menu_option(int p_option) {
bool current = view_menu->get_popup()->is_item_checked( idx );
current=!current;
if (current)
- camera->set_visible_layers( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+index))|(1<<GIZMO_EDIT_LAYER)|(1<<GIZMO_GRID_LAYER) );
+ camera->set_cull_mask( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+index))|(1<<GIZMO_EDIT_LAYER)|(1<<GIZMO_GRID_LAYER) );
else
- camera->set_visible_layers( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+index))|(1<<GIZMO_GRID_LAYER) );
+ camera->set_cull_mask( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+index))|(1<<GIZMO_GRID_LAYER) );
view_menu->get_popup()->set_item_checked( idx, current );
} break;
@@ -2089,7 +2097,7 @@ void SpatialEditorViewport::_init_gizmo_instance(int p_idx) {
move_gizmo_instance[i]=VS::get_singleton()->instance_create();
VS::get_singleton()->instance_set_base(move_gizmo_instance[i],spatial_editor->get_move_gizmo(i)->get_rid());
VS::get_singleton()->instance_set_scenario(move_gizmo_instance[i],get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,false);
+ VS::get_singleton()->instance_set_visible(move_gizmo_instance[i],false);
//VS::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_DEPH_SCALE,true);
VS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
VS::get_singleton()->instance_set_layer_mask(move_gizmo_instance[i],layer);
@@ -2097,7 +2105,7 @@ void SpatialEditorViewport::_init_gizmo_instance(int p_idx) {
rotate_gizmo_instance[i]=VS::get_singleton()->instance_create();
VS::get_singleton()->instance_set_base(rotate_gizmo_instance[i],spatial_editor->get_rotate_gizmo(i)->get_rid());
VS::get_singleton()->instance_set_scenario(rotate_gizmo_instance[i],get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,false);
+ VS::get_singleton()->instance_set_visible(rotate_gizmo_instance[i],false);
//VS::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_DEPH_SCALE,true);
VS::get_singleton()->instance_geometry_set_cast_shadows_setting(rotate_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
VS::get_singleton()->instance_set_layer_mask(rotate_gizmo_instance[i],layer);
@@ -2123,9 +2131,9 @@ void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) {
if (!p_activate) {
- previewing->disconnect("exit_tree",this,"_preview_exited_scene");
+ previewing->disconnect("tree_exited",this,"_preview_exited_scene");
previewing=NULL;
- VS::get_singleton()->viewport_attach_camera( viewport->get_viewport(), camera->get_camera() ); //restore
+ VS::get_singleton()->viewport_attach_camera( viewport->get_viewport_rid(), camera->get_camera() ); //restore
if (!preview)
preview_camera->hide();
view_menu->show();
@@ -2134,8 +2142,8 @@ void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) {
} else {
previewing=preview;
- previewing->connect("exit_tree",this,"_preview_exited_scene");
- VS::get_singleton()->viewport_attach_camera( viewport->get_viewport(), preview->get_camera() ); //replace
+ previewing->connect("tree_exited",this,"_preview_exited_scene");
+ VS::get_singleton()->viewport_attach_camera( viewport->get_viewport_rid(), preview->get_camera() ); //replace
view_menu->hide();
surface->update();
@@ -2178,7 +2186,7 @@ void SpatialEditorViewport::set_can_preview(Camera* p_preview) {
void SpatialEditorViewport::update_transform_gizmo_view() {
- if (!is_visible())
+ if (!is_visible_in_tree())
return;
Transform xform = spatial_editor->get_gizmo_transform();
@@ -2195,7 +2203,7 @@ void SpatialEditorViewport::update_transform_gizmo_view() {
if (dd==0)
dd=0.0001;
- float gsize = EditorSettings::get_singleton()->get("3d_editor/manipulator_gizmo_size");
+ float gsize = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_size");
gizmo_scale=(gsize/Math::abs(dd));
Vector3 scale = Vector3(1,1,1) * gizmo_scale;
@@ -2206,9 +2214,9 @@ void SpatialEditorViewport::update_transform_gizmo_view() {
for(int i=0;i<3;i++) {
VisualServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform );
- VisualServer::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,spatial_editor->is_gizmo_visible()&& (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_MOVE) );
+ VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i],spatial_editor->is_gizmo_visible()&& (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_MOVE) );
VisualServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform );
- VisualServer::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_ROTATE) );
+ VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i],spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_ROTATE) );
}
}
@@ -2239,8 +2247,8 @@ void SpatialEditorViewport::set_state(const Dictionary& p_state) {
Node *pv = EditorNode::get_singleton()->get_edited_scene()->get_node(p_state["previewing"]);
if (pv && pv->cast_to<Camera>()) {
previewing=pv->cast_to<Camera>();
- previewing->connect("exit_tree",this,"_preview_exited_scene");
- VS::get_singleton()->viewport_attach_camera( viewport->get_viewport(), previewing->get_camera() ); //replace
+ previewing->connect("tree_exited",this,"_preview_exited_scene");
+ VS::get_singleton()->viewport_attach_camera( viewport->get_viewport_rid(), previewing->get_camera() ); //replace
view_menu->hide();
surface->update();
preview_camera->set_pressed(true);
@@ -2269,15 +2277,15 @@ Dictionary SpatialEditorViewport::get_state() const {
void SpatialEditorViewport::_bind_methods(){
- ObjectTypeDB::bind_method(_MD("_draw"),&SpatialEditorViewport::_draw);
- ObjectTypeDB::bind_method(_MD("_smouseenter"),&SpatialEditorViewport::_smouseenter);
- ObjectTypeDB::bind_method(_MD("_sinput"),&SpatialEditorViewport::_sinput);
- ObjectTypeDB::bind_method(_MD("_menu_option"),&SpatialEditorViewport::_menu_option);
- ObjectTypeDB::bind_method(_MD("_toggle_camera_preview"),&SpatialEditorViewport::_toggle_camera_preview);
- ObjectTypeDB::bind_method(_MD("_preview_exited_scene"),&SpatialEditorViewport::_preview_exited_scene);
- ObjectTypeDB::bind_method(_MD("update_transform_gizmo_view"),&SpatialEditorViewport::update_transform_gizmo_view);
- ObjectTypeDB::bind_method(_MD("_selection_result_pressed"),&SpatialEditorViewport::_selection_result_pressed);
- ObjectTypeDB::bind_method(_MD("_selection_menu_hide"),&SpatialEditorViewport::_selection_menu_hide);
+ ClassDB::bind_method(_MD("_draw"),&SpatialEditorViewport::_draw);
+ ClassDB::bind_method(_MD("_smouseenter"),&SpatialEditorViewport::_smouseenter);
+ ClassDB::bind_method(_MD("_sinput"),&SpatialEditorViewport::_sinput);
+ ClassDB::bind_method(_MD("_menu_option"),&SpatialEditorViewport::_menu_option);
+ ClassDB::bind_method(_MD("_toggle_camera_preview"),&SpatialEditorViewport::_toggle_camera_preview);
+ ClassDB::bind_method(_MD("_preview_exited_scene"),&SpatialEditorViewport::_preview_exited_scene);
+ ClassDB::bind_method(_MD("update_transform_gizmo_view"),&SpatialEditorViewport::update_transform_gizmo_view);
+ ClassDB::bind_method(_MD("_selection_result_pressed"),&SpatialEditorViewport::_selection_result_pressed);
+ ClassDB::bind_method(_MD("_selection_menu_hide"),&SpatialEditorViewport::_selection_menu_hide);
ADD_SIGNAL( MethodInfo("toggle_maximize_view", PropertyInfo(Variant::OBJECT, "viewport")) );
}
@@ -2350,18 +2358,20 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
message_time=0;
spatial_editor=p_spatial_editor;
- Control *c=memnew(Control);
+ ViewportContainer *c=memnew(ViewportContainer);
+ c->set_stretch(true);
add_child(c);
c->set_area_as_parent_rect();
viewport = memnew( Viewport );
viewport->set_disable_input(true);
+
c->add_child(viewport);
surface = memnew( Control );
add_child(surface);
surface->set_area_as_parent_rect();
camera = memnew(Camera);
camera->set_disable_gizmo(true);
- camera->set_visible_layers( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+p_index))|(1<<GIZMO_EDIT_LAYER)|(1<<GIZMO_GRID_LAYER) );
+ camera->set_cull_mask( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+p_index))|(1<<GIZMO_EDIT_LAYER)|(1<<GIZMO_GRID_LAYER) );
//camera->set_environment(SpatialEditor::get_singleton()->get_viewport_environment());
viewport->add_child(camera);
camera->make_current();
@@ -2370,7 +2380,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
view_menu = memnew( MenuButton );
surface->add_child(view_menu);
view_menu->set_pos( Point2(4,4));
- view_menu->set_self_opacity(0.5);
+ view_menu->set_self_modulate(Color(1,1,1,0.5));
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/top_view"), VIEW_TOP);
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/bottom_view"), VIEW_BOTTOM);
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/left_view"), VIEW_LEFT);
@@ -2391,9 +2401,10 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(VIEW_GIZMOS),true);
view_menu->get_popup()->add_separator();
+ view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_origin"), VIEW_CENTER_TO_ORIGIN);
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_selection"), VIEW_CENTER_TO_SELECTION);
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_selection_with_view"), VIEW_ALIGN_SELECTION_WITH_VIEW);
- view_menu->get_popup()->connect("item_pressed",this,"_menu_option");
+ view_menu->get_popup()->connect("id_pressed",this,"_menu_option");
preview_camera = memnew( Button );
preview_camera->set_toggle_mode(true);
@@ -2410,7 +2421,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
selection_menu = memnew( PopupMenu );
add_child(selection_menu);
selection_menu->set_custom_minimum_size(Vector2(100, 0));
- selection_menu->connect("item_pressed", this, "_selection_result_pressed");
+ selection_menu->connect("id_pressed", this, "_selection_result_pressed");
selection_menu->connect("popup_hide", this, "_selection_menu_hide");
if (p_index==0) {
@@ -2456,10 +2467,10 @@ void SpatialEditor::select_gizmo_hilight_axis(int p_axis) {
void SpatialEditor::update_transform_gizmo() {
List<Node*> &selection = editor_selection->get_selected_node_list();
- AABB center;
+ Rect3 center;
bool first=true;
- Matrix3 gizmo_basis;
+ Basis gizmo_basis;
bool local_gizmo_coords = transform_menu->get_popup()->is_item_checked( transform_menu->get_popup()->get_item_index(MENU_TRANSFORM_LOCAL_COORDS) );
@@ -2483,9 +2494,9 @@ void SpatialEditor::update_transform_gizmo() {
}
} else {
center.expand_to(xf.origin);
- gizmo_basis=Matrix3();
+ gizmo_basis=Basis();
}
-// count++;
+ //count++;
}
Vector3 pcenter = center.pos+center.size*0.5;
@@ -2521,7 +2532,7 @@ Object *SpatialEditor::_get_editor_data(Object *p_what) {
void SpatialEditor::_generate_selection_box() {
- AABB aabb( Vector3(), Vector3(1,1,1) );
+ Rect3 aabb( Vector3(), Vector3(1,1,1) );
aabb.grow_by( aabb.get_longest_axis_size()/20.0 );
Ref<SurfaceTool> st = memnew( SurfaceTool );
@@ -2549,11 +2560,12 @@ void SpatialEditor::_generate_selection_box() {
}
- Ref<FixedMaterial> mat = memnew( FixedMaterial );
- mat->set_flag(Material::FLAG_UNSHADED,true);
- mat->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1));
- mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true);
- mat->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY,true);
+ Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial );
+ mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true);
+ mat->set_albedo(Color(1,1,1));
+ mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT,true);
+ mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true);
+ mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true);
st->set_material(mat);
selection_box = st->commit();
}
@@ -2595,7 +2607,7 @@ Dictionary SpatialEditor::get_state() const {
d["viewports"]=vpdata;
d["default_light"]=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_LIGHT) );;
- d["ambient_light_color"]=settings_ambient_color->get_color();
+ d["ambient_light_color"]=settings_ambient_color->get_pick_color();
d["default_srgb"]=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_SRGB) );;
d["show_grid"]=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_GRID) );;
@@ -2660,11 +2672,11 @@ void SpatialEditor::set_state(const Dictionary& p_state) {
}
if (d.has("zfar"))
- settings_zfar->set_val(float(d["zfar"]));
+ settings_zfar->set_value(float(d["zfar"]));
if (d.has("znear"))
- settings_znear->set_val(float(d["znear"]));
+ settings_znear->set_value(float(d["znear"]));
if (d.has("fov"))
- settings_fov->set_val(float(d["fov"]));
+ settings_fov->set_value(float(d["fov"]));
if (d.has("default_light")) {
bool use = d["default_light"];
@@ -2684,15 +2696,15 @@ void SpatialEditor::set_state(const Dictionary& p_state) {
}
if (d.has("ambient_light_color")) {
- settings_ambient_color->set_color(d["ambient_light_color"]);
- viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,d["ambient_light_color"]);
+ settings_ambient_color->set_pick_color(d["ambient_light_color"]);
+ //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,d["ambient_light_color"]);
}
if (d.has("default_srgb")) {
bool use = d["default_srgb"];
- viewport_environment->set_enable_fx(Environment::FX_SRGB,use);
- view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_SRGB), use );
+ //viewport_environment->set_enable_fx(Environment::FX_SRGB,use);
+ //view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_SRGB), use );
}
if (d.has("show_grid")) {
bool use = d["show_grid"];
@@ -2707,7 +2719,7 @@ void SpatialEditor::set_state(const Dictionary& p_state) {
if (use!=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN))) {
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), use );
- VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,use);
+ VisualServer::get_singleton()->instance_set_visible(origin_instance,use);
}
}
@@ -2747,16 +2759,16 @@ void SpatialEditor::edit(Spatial *p_spatial) {
}
}
+ /*
if (p_spatial) {
- //_validate_selection();
- //if (selected.has(p_spatial->get_instance_ID()) && selected.size()==1)
- // return;
- //_select(p_spatial->get_instance_ID(),false,true);
+ _validate_selection();
+ if (selected.has(p_spatial->get_instance_ID()) && selected.size()==1)
+ return;
+ _select(p_spatial->get_instance_ID(),false,true);
// should become the selection
}
-
-
+ */
}
void SpatialEditor::_xform_dialog_action() {
@@ -2772,21 +2784,10 @@ void SpatialEditor::_xform_dialog_action() {
rotate[i]=Math::deg2rad(xform_rotate[i]->get_text().to_double());
scale[i]=xform_scale[i]->get_text().to_double();
}
-
+
+ t.basis.scale(scale);
+ t.basis.rotate(rotate);
t.origin=translate;
- for(int i=0;i<3;i++) {
- if (!rotate[i])
- continue;
- Vector3 axis;
- axis[i]=1.0;
- t.basis.rotate(axis,rotate[i]);
- }
-
- for(int i=0;i<3;i++) {
- if (scale[i]==1)
- continue;
- t.basis.set_axis(i,t.basis.get_axis(i)*scale[i]);
- }
undo_redo->create_action(TTR("XForm Dialog"));
@@ -2834,8 +2835,8 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
tool_button[i]->set_pressed(i==p_option);
tool_mode=(ToolMode)p_option;
- // static const char *_mode[]={"Selection Mode.","Translation Mode.","Rotation Mode.","Scale Mode.","List Selection Mode."};
-// set_message(_mode[p_option],3);
+ //static const char *_mode[]={"Selection Mode.","Translation Mode.","Rotation Mode.","Scale Mode.","List Selection Mode."};
+ //set_message(_mode[p_option],3);
update_transform_gizmo();
} break;
@@ -2892,9 +2893,9 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
bool is_checked = view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(p_option) );
if (is_checked) {
- viewport_environment->set_enable_fx(Environment::FX_SRGB,false);
+ //viewport_environment->set_enable_fx(Environment::FX_SRGB,false);
} else {
- viewport_environment->set_enable_fx(Environment::FX_SRGB,true);
+ //viewport_environment->set_enable_fx(Environment::FX_SRGB,true);
}
is_checked = ! is_checked;
@@ -2932,9 +2933,9 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
}
viewports[0]->set_area_as_parent_rect();
- viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
+ //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
viewports[2]->set_area_as_parent_rect();
- viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
+ //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false );
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), true );
@@ -2956,9 +2957,9 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
}
viewports[0]->set_area_as_parent_rect();
- viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
+ //viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
viewports[2]->set_area_as_parent_rect();
- viewports[2]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
+ //viewports[2]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false );
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false );
@@ -2978,13 +2979,13 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
viewports[i]->show();
}
viewports[0]->set_area_as_parent_rect();
- viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
+ //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
viewports[2]->set_area_as_parent_rect();
- viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
- viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
+ //viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
+ //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
viewports[3]->set_area_as_parent_rect();
- viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
- viewports[3]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
+ //viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
+ //viewports[3]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false );
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false );
@@ -3004,13 +3005,13 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
viewports[i]->show();
}
viewports[0]->set_area_as_parent_rect();
- viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
- viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
+ //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
+ //viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
viewports[2]->set_area_as_parent_rect();
- viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
- viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
+ //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
+ //viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
viewports[3]->set_area_as_parent_rect();
- viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
+ //viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false );
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false );
@@ -3027,17 +3028,17 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
viewports[i]->show();
}
viewports[0]->set_area_as_parent_rect();
- viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
- viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
+ //viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
+ //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
viewports[1]->set_area_as_parent_rect();
- viewports[1]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
- viewports[1]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
+ //viewports[1]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
+ //viewports[1]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5);
viewports[2]->set_area_as_parent_rect();
- viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
- viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
+ //viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5);
+ //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
viewports[3]->set_area_as_parent_rect();
- viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
- viewports[3]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
+ //viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5);
+ //viewports[3]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5);
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false );
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false );
@@ -3090,7 +3091,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
bool is_checked = view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(p_option) );
is_checked=!is_checked;
- VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,is_checked);
+ VisualServer::get_singleton()->instance_set_visible(origin_instance,is_checked);
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(p_option), is_checked);
} break;
@@ -3102,7 +3103,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
for(int i=0;i<3;++i) {
if (grid_enable[i]) {
- VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,grid_enabled);
+ VisualServer::get_singleton()->instance_set_visible(grid_instance[i],grid_enabled);
grid_visible[i]=grid_enabled;
}
}
@@ -3129,7 +3130,7 @@ void SpatialEditor::_init_indicators() {
- light_transform.rotate(Vector3(1,0,0),Math_PI/5.0);
+ light_transform.rotate(Vector3(1,0,0),-Math_PI/5.0);
VisualServer::get_singleton()->instance_set_transform(light_instance,light_transform);
@@ -3140,18 +3141,20 @@ void SpatialEditor::_init_indicators() {
{
- indicator_mat = VisualServer::get_singleton()->fixed_material_create();
- VisualServer::get_singleton()->material_set_flag( indicator_mat, VisualServer::MATERIAL_FLAG_UNSHADED, true );
- VisualServer::get_singleton()->material_set_flag( indicator_mat, VisualServer::MATERIAL_FLAG_ONTOP, false );
- VisualServer::get_singleton()->fixed_material_set_flag(indicator_mat, VisualServer::FIXED_MATERIAL_FLAG_USE_ALPHA,true);
- VisualServer::get_singleton()->fixed_material_set_flag(indicator_mat, VisualServer::FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY,true);
+ indicator_mat.instance();;
+ indicator_mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true);
+ indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true);
+ indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true);
+ indicator_mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true);
- DVector<Color> grid_colors[3];
- DVector<Vector3> grid_points[3];
+ indicator_mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT,true);
+
+ PoolVector<Color> grid_colors[3];
+ PoolVector<Vector3> grid_points[3];
Vector<Color> origin_colors;
Vector<Vector3> origin_points;
- Color grid_color = EditorSettings::get_singleton()->get("3d_editor/grid_color");
+ Color grid_color = EditorSettings::get_singleton()->get("editors/3d/grid_color");
for(int i=0;i<3;i++) {
Vector3 axis;
@@ -3186,13 +3189,13 @@ void SpatialEditor::_init_indicators() {
d.resize(VS::ARRAY_MAX);
d[VisualServer::ARRAY_VERTEX]=grid_points[i];
d[VisualServer::ARRAY_COLOR]=grid_colors[i];
- VisualServer::get_singleton()->mesh_add_surface(grid[i],VisualServer::PRIMITIVE_LINES,d);
- VisualServer::get_singleton()->mesh_surface_set_material(grid[i],0,indicator_mat);
+ VisualServer::get_singleton()->mesh_add_surface_from_arrays(grid[i],VisualServer::PRIMITIVE_LINES,d);
+ VisualServer::get_singleton()->mesh_surface_set_material(grid[i],0,indicator_mat->get_rid());
grid_instance[i] = VisualServer::get_singleton()->instance_create2(grid[i],get_tree()->get_root()->get_world()->get_scenario());
grid_visible[i]=false;
grid_enable[i]=false;
- VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,false);
+ VisualServer::get_singleton()->instance_set_visible(grid_instance[i],false);
VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
VS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << SpatialEditorViewport::GIZMO_GRID_LAYER);
@@ -3205,13 +3208,13 @@ void SpatialEditor::_init_indicators() {
d[VisualServer::ARRAY_VERTEX]=origin_points;
d[VisualServer::ARRAY_COLOR]=origin_colors;
- VisualServer::get_singleton()->mesh_add_surface(origin,VisualServer::PRIMITIVE_LINES,d);
- VisualServer::get_singleton()->mesh_surface_set_material(origin,0,indicator_mat);
+ VisualServer::get_singleton()->mesh_add_surface_from_arrays(origin,VisualServer::PRIMITIVE_LINES,d);
+ VisualServer::get_singleton()->mesh_surface_set_material(origin,0,indicator_mat->get_rid());
-// origin = VisualServer::get_singleton()->poly_create();
-// VisualServer::get_singleton()->poly_add_primitive(origin,origin_points,Vector<Vector3>(),origin_colors,Vector<Vector3>());
-// VisualServer::get_singleton()->poly_set_material(origin,indicator_mat,true);
+ //origin = VisualServer::get_singleton()->poly_create();
+ //VisualServer::get_singleton()->poly_add_primitive(origin,origin_points,Vector<Vector3>(),origin_colors,Vector<Vector3>());
+ //VisualServer::get_singleton()->poly_set_material(origin,indicator_mat,true);
origin_instance = VisualServer::get_singleton()->instance_create2(origin,get_tree()->get_root()->get_world()->get_scenario());
VS::get_singleton()->instance_set_layer_mask(origin_instance,1<<SpatialEditorViewport::GIZMO_GRID_LAYER);
@@ -3219,7 +3222,7 @@ void SpatialEditor::_init_indicators() {
- VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[1],VS::INSTANCE_FLAG_VISIBLE,true);
+ VisualServer::get_singleton()->instance_set_visible(grid_instance[1],true);
grid_enable[1]=true;
grid_visible[1]=true;
grid_enabled=true;
@@ -3229,7 +3232,7 @@ void SpatialEditor::_init_indicators() {
{
cursor_mesh = VisualServer::get_singleton()->mesh_create();
- DVector<Vector3> cursor_points;
+ PoolVector<Vector3> cursor_points;
float cs = 0.25;
cursor_points.push_back(Vector3(+cs,0,0));
cursor_points.push_back(Vector3(-cs,0,0));
@@ -3237,17 +3240,15 @@ void SpatialEditor::_init_indicators() {
cursor_points.push_back(Vector3(0,-cs,0));
cursor_points.push_back(Vector3(0,0,+cs));
cursor_points.push_back(Vector3(0,0,-cs));
- cursor_material=VisualServer::get_singleton()->fixed_material_create();
- VisualServer::get_singleton()->fixed_material_set_param(cursor_material,VS::FIXED_MATERIAL_PARAM_DIFFUSE,Color(0,1,1));
- VisualServer::get_singleton()->material_set_flag( cursor_material, VisualServer::MATERIAL_FLAG_UNSHADED, true );
- VisualServer::get_singleton()->fixed_material_set_flag(cursor_material, VisualServer::FIXED_MATERIAL_FLAG_USE_ALPHA,true);
- VisualServer::get_singleton()->fixed_material_set_flag(cursor_material, VisualServer::FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY,true);
+ cursor_material.instance();
+ cursor_material->set_albedo(Color(0,1,1));
+ cursor_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true);
Array d;
d.resize(VS::ARRAY_MAX);
d[VS::ARRAY_VERTEX]=cursor_points;
- VisualServer::get_singleton()->mesh_add_surface(cursor_mesh,VS::PRIMITIVE_LINES,d);
- VisualServer::get_singleton()->mesh_surface_set_material(cursor_mesh,0,cursor_material);
+ VisualServer::get_singleton()->mesh_add_surface_from_arrays(cursor_mesh,VS::PRIMITIVE_LINES,d);
+ VisualServer::get_singleton()->mesh_surface_set_material(cursor_mesh,0,cursor_material->get_rid());
cursor_instance = VisualServer::get_singleton()->instance_create2(cursor_mesh,get_tree()->get_root()->get_world()->get_scenario());
VS::get_singleton()->instance_set_layer_mask(cursor_instance,1<<SpatialEditorViewport::GIZMO_GRID_LAYER);
@@ -3263,13 +3264,13 @@ void SpatialEditor::_init_indicators() {
//move gizmo
- float gizmo_alph = EditorSettings::get_singleton()->get("3d_editor/manipulator_gizmo_opacity");
+ float gizmo_alph = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_opacity");
- gizmo_hl = Ref<FixedMaterial>( memnew( FixedMaterial ) );
- gizmo_hl->set_flag(Material::FLAG_UNSHADED, true);
- gizmo_hl->set_flag(Material::FLAG_ONTOP, true);
- gizmo_hl->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- gizmo_hl->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,gizmo_alph+0.2f));
+ gizmo_hl = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ) );
+ gizmo_hl->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ gizmo_hl->set_flag(FixedSpatialMaterial::FLAG_ONTOP, true);
+ gizmo_hl->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ gizmo_hl->set_albedo(Color(1,1,1,gizmo_alph+0.2f));
for(int i=0;i<3;i++) {
@@ -3277,14 +3278,14 @@ void SpatialEditor::_init_indicators() {
rotate_gizmo[i]=Ref<Mesh>( memnew( Mesh ) );
- Ref<FixedMaterial> mat = memnew( FixedMaterial );
- mat->set_flag(Material::FLAG_UNSHADED, true);
- mat->set_flag(Material::FLAG_ONTOP, true);
- mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
+ Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial );
+ mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP, true);
+ mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
Color col;
col[i]=1.0;
col.a= gizmo_alph;
- mat->set_parameter(FixedMaterial::PARAM_DIFFUSE,col);
+ mat->set_albedo(col);
gizmo_color[i]=mat;
@@ -3323,8 +3324,8 @@ void SpatialEditor::_init_indicators() {
for(int k = 0; k < 7 ; k++) {
- Matrix3 ma(ivec,Math_PI*2*float(k)/arrow_sides);
- Matrix3 mb(ivec,Math_PI*2*float(k+1)/arrow_sides);
+ Basis ma(ivec,Math_PI*2*float(k)/arrow_sides);
+ Basis mb(ivec,Math_PI*2*float(k+1)/arrow_sides);
for(int j=0;j<arrow_points-1;j++) {
@@ -3368,8 +3369,8 @@ void SpatialEditor::_init_indicators() {
for(int k = 0; k < 33 ; k++) {
- Matrix3 ma(ivec,Math_PI*2*float(k)/32);
- Matrix3 mb(ivec,Math_PI*2*float(k+1)/32);
+ Basis ma(ivec,Math_PI*2*float(k)/32);
+ Basis mb(ivec,Math_PI*2*float(k+1)/32);
for(int j=0;j<4;j++) {
@@ -3430,8 +3431,6 @@ void SpatialEditor::_finish_indicators() {
VisualServer::get_singleton()->free(cursor_instance);
VisualServer::get_singleton()->free(cursor_mesh);
- VisualServer::get_singleton()->free(indicator_mat);
- VisualServer::get_singleton()->free(cursor_material);
}
void SpatialEditor::_instance_scene() {
@@ -3466,7 +3465,7 @@ void SpatialEditor::_instance_scene() {
void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
- if (!is_visible() || get_viewport()->gui_has_modal_stack())
+ if (!is_visible_in_tree() || get_viewport()->gui_has_modal_stack())
return;
#if 0
@@ -3476,7 +3475,7 @@ void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
EditorNode *en = editor;
EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
- if (!over_plugin_list->empty() && over_plugin_list->forward_input_event(p_event)) {
+ if (!over_plugin_list->empty() && over_plugin_list->forward_gui_input(p_event)) {
return; //ate the over input event
}
@@ -3673,17 +3672,17 @@ void SpatialEditor::_node_removed(Node* p_node) {
void SpatialEditor::_bind_methods() {
-// ObjectTypeDB::bind_method("_input_event",&SpatialEditor::_input_event);
- ObjectTypeDB::bind_method("_unhandled_key_input",&SpatialEditor::_unhandled_key_input);
- ObjectTypeDB::bind_method("_node_removed",&SpatialEditor::_node_removed);
- ObjectTypeDB::bind_method("_menu_item_pressed",&SpatialEditor::_menu_item_pressed);
- ObjectTypeDB::bind_method("_xform_dialog_action",&SpatialEditor::_xform_dialog_action);
- ObjectTypeDB::bind_method("_instance_scene",&SpatialEditor::_instance_scene);
- ObjectTypeDB::bind_method("_get_editor_data",&SpatialEditor::_get_editor_data);
- ObjectTypeDB::bind_method("_request_gizmo",&SpatialEditor::_request_gizmo);
- ObjectTypeDB::bind_method("_default_light_angle_input",&SpatialEditor::_default_light_angle_input);
- ObjectTypeDB::bind_method("_update_ambient_light_color",&SpatialEditor::_update_ambient_light_color);
- ObjectTypeDB::bind_method("_toggle_maximize_view",&SpatialEditor::_toggle_maximize_view);
+ //ClassDB::bind_method("_gui_input",&SpatialEditor::_gui_input);
+ ClassDB::bind_method("_unhandled_key_input",&SpatialEditor::_unhandled_key_input);
+ ClassDB::bind_method("_node_removed",&SpatialEditor::_node_removed);
+ ClassDB::bind_method("_menu_item_pressed",&SpatialEditor::_menu_item_pressed);
+ ClassDB::bind_method("_xform_dialog_action",&SpatialEditor::_xform_dialog_action);
+ ClassDB::bind_method("_instance_scene",&SpatialEditor::_instance_scene);
+ ClassDB::bind_method("_get_editor_data",&SpatialEditor::_get_editor_data);
+ ClassDB::bind_method("_request_gizmo",&SpatialEditor::_request_gizmo);
+ ClassDB::bind_method("_default_light_angle_input",&SpatialEditor::_default_light_angle_input);
+ ClassDB::bind_method("_update_ambient_light_color",&SpatialEditor::_update_ambient_light_color);
+ ClassDB::bind_method("_toggle_maximize_view",&SpatialEditor::_toggle_maximize_view);
ADD_SIGNAL( MethodInfo("transform_key_request") );
@@ -3692,9 +3691,9 @@ void SpatialEditor::_bind_methods() {
void SpatialEditor::clear() {
- settings_fov->set_val(EDITOR_DEF("3d_editor/default_fov",60.0));
- settings_znear->set_val(EDITOR_DEF("3d_editor/default_z_near",0.1));
- settings_zfar->set_val(EDITOR_DEF("3d_editor/default_z_far",1500.0));
+ settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov",60.0));
+ settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near",0.1));
+ settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far",1500.0));
for(int i=0;i<4;i++) {
viewports[i]->reset();
@@ -3704,11 +3703,11 @@ void SpatialEditor::clear() {
_menu_item_pressed(MENU_VIEW_DISPLAY_NORMAL);
- VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,true);
+ VisualServer::get_singleton()->instance_set_visible(origin_instance,true);
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), true);
for(int i=0;i<3;++i) {
if (grid_enable[i]) {
- VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,true);
+ VisualServer::get_singleton()->instance_set_visible(grid_instance[i],true);
grid_visible[i]=true;
}
}
@@ -3724,8 +3723,8 @@ void SpatialEditor::clear() {
settings_default_light_rot_x=Math_PI*0.3;
settings_default_light_rot_y=Math_PI*0.2;
- viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0.15,0.15,0.15));
- settings_ambient_color->set_color(Color(0.15,0.15,0.15));
+ //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0.15,0.15,0.15));
+ settings_ambient_color->set_pick_color(Color(0.15,0.15,0.15));
if (!light_instance.is_valid())
_menu_item_pressed(MENU_VIEW_USE_DEFAULT_LIGHT);
@@ -3737,15 +3736,15 @@ void SpatialEditor::clear() {
void SpatialEditor::_update_ambient_light_color(const Color& p_color) {
- viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,settings_ambient_color->get_color());
+ //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,settings_ambient_color->get_color());
}
void SpatialEditor::_update_default_light_angle() {
Transform t;
- t.basis.rotate(Vector3(1,0,0),settings_default_light_rot_x);
- t.basis.rotate(Vector3(0,1,0),settings_default_light_rot_y);
+ t.basis.rotate(Vector3(1,0,0),-settings_default_light_rot_x);
+ t.basis.rotate(Vector3(0,1,0),-settings_default_light_rot_y);
settings_dlight->set_transform(t);
if (light_instance.is_valid()) {
VS::get_singleton()->instance_set_transform(light_instance,t);
@@ -3858,6 +3857,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
ED_SHORTCUT("spatial_editor/switch_perspective_orthogonal", TTR("Switch Perspective/Orthogonal view"), KEY_KP_5);
ED_SHORTCUT("spatial_editor/snap", TTR("Snap"), KEY_S);
ED_SHORTCUT("spatial_editor/insert_anim_key", TTR("Insert Animation Key"), KEY_K);
+ ED_SHORTCUT("spatial_editor/focus_origin", TTR("Focus Origin"), KEY_O);
ED_SHORTCUT("spatial_editor/focus_selection", TTR("Focus Selection"), KEY_F);
ED_SHORTCUT("spatial_editor/align_selection_with_view", TTR("Align Selection With View"), KEY_MASK_ALT+KEY_MASK_CMD+KEY_F);
@@ -3877,7 +3877,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
p->add_separator();
p->add_shortcut(ED_SHORTCUT("spatial_editor/transform_dialog", TTR("Transform Dialog..")), MENU_TRANSFORM_DIALOG);
- p->connect("item_pressed", this,"_menu_item_pressed");
+ p->connect("id_pressed", this,"_menu_item_pressed");
view_menu = memnew( MenuButton );
view_menu->set_text(TTR("View"));
@@ -3915,7 +3915,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
p->set_item_checked( p->get_item_index(MENU_VIEW_GRID), true );
- p->connect("item_pressed", this,"_menu_item_pressed");
+ p->connect("id_pressed", this,"_menu_item_pressed");
/* REST OF MENU */
@@ -3949,7 +3949,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
VBoxContainer *snap_dialog_vbc = memnew( VBoxContainer );
snap_dialog->add_child(snap_dialog_vbc);
- snap_dialog->set_child_rect(snap_dialog_vbc);
+ //snap_dialog->set_child_rect(snap_dialog_vbc);
snap_translate = memnew( LineEdit );
snap_translate->set_text("1");
@@ -3971,13 +3971,13 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
settings_vbc = memnew( VBoxContainer );
settings_vbc->set_custom_minimum_size(Size2(200,0));
settings_dialog->add_child(settings_vbc);
- settings_dialog->set_child_rect(settings_vbc);
+ //settings_dialog->set_child_rect(settings_vbc);
- settings_light_base = memnew( Control );
+ settings_light_base = memnew( ViewportContainer );
settings_light_base->set_custom_minimum_size(Size2(128,128));
- settings_light_base->connect("input_event",this,"_default_light_angle_input");
+ settings_light_base->connect("gui_input",this,"_default_light_angle_input");
settings_vbc->add_margin_child(TTR("Default Light Normal:"),settings_light_base);
settings_light_vp = memnew( Viewport );
settings_light_vp->set_disable_input(true);
@@ -4005,31 +4005,28 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
settings_ambient_color = memnew( ColorPickerButton );
settings_vbc->add_margin_child(TTR("Ambient Light Color:"),settings_ambient_color);
settings_ambient_color->connect("color_changed",this,"_update_ambient_light_color");
-
- viewport_environment->set_enable_fx(Environment::FX_AMBIENT_LIGHT,true);
- viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0.15,0.15,0.15));
- settings_ambient_color->set_color(Color(0.15,0.15,0.15));
+ settings_ambient_color->set_pick_color(Color(0.15,0.15,0.15));
settings_fov = memnew( SpinBox );
settings_fov->set_max(179);
settings_fov->set_min(1);
settings_fov->set_step(0.01);
- settings_fov->set_val(EDITOR_DEF("3d_editor/default_fov",60.0));
+ settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov",60.0));
settings_vbc->add_margin_child(TTR("Perspective FOV (deg.):"),settings_fov);
settings_znear = memnew( SpinBox );
settings_znear->set_max(10000);
settings_znear->set_min(0.1);
settings_znear->set_step(0.01);
- settings_znear->set_val(EDITOR_DEF("3d_editor/default_z_near",0.1));
+ settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near",0.1));
settings_vbc->add_margin_child(TTR("View Z-Near:"),settings_znear);
settings_zfar = memnew( SpinBox );
settings_zfar->set_max(10000);
settings_zfar->set_min(0.1);
settings_zfar->set_step(0.01);
- settings_zfar->set_val(EDITOR_DEF("3d_editor/default_z_far",1500));
+ settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far",1500));
settings_vbc->add_margin_child(TTR("View Z-Far:"),settings_zfar);
//settings_dialog->get_cancel()->hide();
@@ -4097,9 +4094,9 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
set_process_unhandled_key_input(true);
add_to_group("_spatial_editor_group");
- EDITOR_DEF("3d_editor/manipulator_gizmo_size",80);
+ EDITOR_DEF("editors/3d/manipulator_gizmo_size",80);
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT,"3d_editor/manipulator_gizmo_size",PROPERTY_HINT_RANGE,"16,1024,1"));
- EDITOR_DEF("3d_editor/manipulator_gizmo_opacity",0.2);
+ EDITOR_DEF("editors/3d/manipulator_gizmo_opacity",0.2);
over_gizmo_handle=-1;
}
@@ -4138,7 +4135,7 @@ void SpatialEditorPlugin::edit(Object *p_object) {
bool SpatialEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("Spatial");
+ return p_object->is_class("Spatial");
}
Dictionary SpatialEditorPlugin::get_state() const {
@@ -4152,12 +4149,12 @@ void SpatialEditorPlugin::set_state(const Dictionary& p_state) {
void SpatialEditor::snap_cursor_to_plane(const Plane& p_plane) {
-// cursor.pos=p_plane.project(cursor.pos);
+ //cursor.pos=p_plane.project(cursor.pos);
}
void SpatialEditorPlugin::_bind_methods() {
- ObjectTypeDB::bind_method("snap_cursor_to_plane",&SpatialEditorPlugin::snap_cursor_to_plane);
+ ClassDB::bind_method("snap_cursor_to_plane",&SpatialEditorPlugin::snap_cursor_to_plane);
}
diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/tools/editor/plugins/spatial_editor_plugin.h
index 975092a01d..6e5243e6ab 100644
--- a/tools/editor/plugins/spatial_editor_plugin.h
+++ b/tools/editor/plugins/spatial_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -45,7 +45,7 @@ class SpatialEditorGizmos;
class SpatialEditorGizmo : public SpatialGizmo {
- OBJ_TYPE(SpatialEditorGizmo,SpatialGizmo);
+ GDCLASS(SpatialEditorGizmo,SpatialGizmo);
bool selected;
public:
@@ -66,7 +66,7 @@ public:
class SpatialEditorViewport : public Control {
- OBJ_TYPE( SpatialEditorViewport, Control );
+ GDCLASS( SpatialEditorViewport, Control );
friend class SpatialEditor;
enum {
@@ -76,6 +76,7 @@ friend class SpatialEditor;
VIEW_RIGHT,
VIEW_FRONT,
VIEW_REAR,
+ VIEW_CENTER_TO_ORIGIN,
VIEW_CENTER_TO_SELECTION,
VIEW_ALIGN_SELECTION_WITH_VIEW,
VIEW_PERSPECTIVE,
@@ -155,13 +156,11 @@ private:
NAVIGATION_MAYA,
NAVIGATION_MODO,
};
- NavigationScheme _get_navigation_schema(const String& p_property);
enum NavigationZoomStyle {
NAVIGATION_ZOOM_VERTICAL,
NAVIGATION_ZOOM_HORIZONTAL
};
- NavigationZoomStyle _get_navigation_zoom_style(const String& p_property);
enum NavigationMode {
NAVIGATION_NONE,
@@ -266,11 +265,11 @@ public:
class SpatialEditorSelectedItem : public Object {
- OBJ_TYPE(SpatialEditorSelectedItem,Object);
+ GDCLASS(SpatialEditorSelectedItem,Object);
public:
- AABB aabb;
+ Rect3 aabb;
Transform original; // original location when moving
Transform last_xform; // last transform
Spatial *sp;
@@ -282,7 +281,7 @@ public:
class SpatialEditor : public VBoxContainer {
- OBJ_TYPE(SpatialEditor, VBoxContainer );
+ GDCLASS(SpatialEditor, VBoxContainer );
public:
enum ToolMode {
@@ -331,8 +330,8 @@ private:
bool grid_enabled;
Ref<Mesh> move_gizmo[3], rotate_gizmo[3];
- Ref<FixedMaterial> gizmo_color[3];
- Ref<FixedMaterial> gizmo_hl;
+ Ref<FixedSpatialMaterial> gizmo_color[3];
+ Ref<FixedSpatialMaterial> gizmo_hl;
int over_gizmo_handle;
@@ -344,8 +343,8 @@ private:
RID indicators_instance;
RID cursor_mesh;
RID cursor_instance;
- RID indicator_mat;
- RID cursor_material;
+ Ref<FixedSpatialMaterial> indicator_mat;
+ Ref<FixedSpatialMaterial> cursor_material;
/*
struct Selected {
@@ -430,7 +429,7 @@ private:
float settings_default_light_rot_x;
float settings_default_light_rot_y;
- Control *settings_light_base;
+ ViewportContainer *settings_light_base;
Viewport *settings_light_vp;
ColorPickerButton *settings_ambient_color;
Image settings_light_dir_image;
@@ -480,7 +479,7 @@ protected:
void _notification(int p_what);
- //void _input_event(InputEvent p_event);
+ //void _gui_input(InputEvent p_event);
void _unhandled_key_input(InputEvent p_event);
static void _bind_methods();
@@ -490,9 +489,9 @@ public:
static SpatialEditor *get_singleton() { return singleton; }
void snap_cursor_to_plane(const Plane& p_plane);
- float get_znear() const { return settings_znear->get_val(); }
- float get_zfar() const { return settings_zfar->get_val(); }
- float get_fov() const { return settings_fov->get_val(); }
+ float get_znear() const { return settings_znear->get_value(); }
+ float get_zfar() const { return settings_zfar->get_value(); }
+ float get_fov() const { return settings_fov->get_value(); }
Transform get_gizmo_transform() const { return gizmo.transform; }
bool is_gizmo_visible() const { return gizmo.visible; }
@@ -545,7 +544,7 @@ public:
class SpatialEditorPlugin : public EditorPlugin {
- OBJ_TYPE( SpatialEditorPlugin, EditorPlugin );
+ GDCLASS( SpatialEditorPlugin, EditorPlugin );
SpatialEditor *spatial_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
index 41beaa96a1..095b059836 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -35,7 +35,7 @@
-void SpriteFramesEditor::_input_event(InputEvent p_event) {
+void SpriteFramesEditor::_gui_input(InputEvent p_event) {
}
@@ -56,7 +56,7 @@ void SpriteFramesEditor::_notification(int p_what) {
if (p_what==NOTIFICATION_READY) {
-// NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true);
+ //NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true);
}
if (p_what==NOTIFICATION_DRAW) {
@@ -64,7 +64,7 @@ void SpriteFramesEditor::_notification(int p_what) {
}
}
-void SpriteFramesEditor::_file_load_request(const DVector<String>& p_path,int p_at_pos) {
+void SpriteFramesEditor::_file_load_request(const PoolVector<String>& p_path,int p_at_pos) {
ERR_FAIL_COND(!frames->has_animation(edited_anim));
@@ -605,7 +605,7 @@ void SpriteFramesEditor::_update_library(bool p_skip_selector) {
tree->select(tree->get_item_count()-1);
}
- anim_speed->set_val(frames->get_animation_speed(edited_anim));
+ anim_speed->set_value(frames->get_animation_speed(edited_anim));
anim_loop->set_pressed(frames->get_animation_loop(edited_anim));
updating=false;
@@ -700,7 +700,7 @@ bool SpriteFramesEditor::can_drop_data_fw(const Point2& p_point,const Variant& p
String file = files[0];
String ftype = EditorFileSystem::get_singleton()->get_file_type(file);
- if (!ObjectTypeDB::is_type(ftype,"Texture")) {
+ if (!ClassDB::is_parent_class(ftype,"Texture")) {
return false;
}
@@ -744,7 +744,7 @@ void SpriteFramesEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat
if (String(d["type"])=="files") {
- DVector<String> files = d["files"];
+ PoolVector<String> files = d["files"];
_file_load_request(files,at_pos);
}
@@ -754,27 +754,27 @@ void SpriteFramesEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat
void SpriteFramesEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_input_event"),&SpriteFramesEditor::_input_event);
- ObjectTypeDB::bind_method(_MD("_load_pressed"),&SpriteFramesEditor::_load_pressed);
- ObjectTypeDB::bind_method(_MD("_empty_pressed"),&SpriteFramesEditor::_empty_pressed);
- ObjectTypeDB::bind_method(_MD("_empty2_pressed"),&SpriteFramesEditor::_empty2_pressed);
- ObjectTypeDB::bind_method(_MD("_item_edited"),&SpriteFramesEditor::_item_edited);
- ObjectTypeDB::bind_method(_MD("_delete_pressed"),&SpriteFramesEditor::_delete_pressed);
- ObjectTypeDB::bind_method(_MD("_paste_pressed"),&SpriteFramesEditor::_paste_pressed);
- ObjectTypeDB::bind_method(_MD("_delete_confirm_pressed"),&SpriteFramesEditor::_delete_confirm_pressed);
- ObjectTypeDB::bind_method(_MD("_file_load_request","files","atpos"),&SpriteFramesEditor::_file_load_request,DEFVAL(-1));
- ObjectTypeDB::bind_method(_MD("_update_library","skipsel"),&SpriteFramesEditor::_update_library,DEFVAL(false));
- ObjectTypeDB::bind_method(_MD("_up_pressed"),&SpriteFramesEditor::_up_pressed);
- ObjectTypeDB::bind_method(_MD("_down_pressed"),&SpriteFramesEditor::_down_pressed);
- ObjectTypeDB::bind_method(_MD("_animation_select"),&SpriteFramesEditor::_animation_select);
- ObjectTypeDB::bind_method(_MD("_animation_name_edited"),&SpriteFramesEditor::_animation_name_edited);
- ObjectTypeDB::bind_method(_MD("_animation_add"),&SpriteFramesEditor::_animation_add);
- ObjectTypeDB::bind_method(_MD("_animation_remove"),&SpriteFramesEditor::_animation_remove);
- ObjectTypeDB::bind_method(_MD("_animation_loop_changed"),&SpriteFramesEditor::_animation_loop_changed);
- ObjectTypeDB::bind_method(_MD("_animation_fps_changed"),&SpriteFramesEditor::_animation_fps_changed);
- ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &SpriteFramesEditor::get_drag_data_fw);
- ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &SpriteFramesEditor::can_drop_data_fw);
- ObjectTypeDB::bind_method(_MD("drop_data_fw"), &SpriteFramesEditor::drop_data_fw);
+ ClassDB::bind_method(_MD("_gui_input"),&SpriteFramesEditor::_gui_input);
+ ClassDB::bind_method(_MD("_load_pressed"),&SpriteFramesEditor::_load_pressed);
+ ClassDB::bind_method(_MD("_empty_pressed"),&SpriteFramesEditor::_empty_pressed);
+ ClassDB::bind_method(_MD("_empty2_pressed"),&SpriteFramesEditor::_empty2_pressed);
+ ClassDB::bind_method(_MD("_item_edited"),&SpriteFramesEditor::_item_edited);
+ ClassDB::bind_method(_MD("_delete_pressed"),&SpriteFramesEditor::_delete_pressed);
+ ClassDB::bind_method(_MD("_paste_pressed"),&SpriteFramesEditor::_paste_pressed);
+ ClassDB::bind_method(_MD("_delete_confirm_pressed"),&SpriteFramesEditor::_delete_confirm_pressed);
+ ClassDB::bind_method(_MD("_file_load_request","files","atpos"),&SpriteFramesEditor::_file_load_request,DEFVAL(-1));
+ ClassDB::bind_method(_MD("_update_library","skipsel"),&SpriteFramesEditor::_update_library,DEFVAL(false));
+ ClassDB::bind_method(_MD("_up_pressed"),&SpriteFramesEditor::_up_pressed);
+ ClassDB::bind_method(_MD("_down_pressed"),&SpriteFramesEditor::_down_pressed);
+ ClassDB::bind_method(_MD("_animation_select"),&SpriteFramesEditor::_animation_select);
+ ClassDB::bind_method(_MD("_animation_name_edited"),&SpriteFramesEditor::_animation_name_edited);
+ ClassDB::bind_method(_MD("_animation_add"),&SpriteFramesEditor::_animation_add);
+ ClassDB::bind_method(_MD("_animation_remove"),&SpriteFramesEditor::_animation_remove);
+ ClassDB::bind_method(_MD("_animation_loop_changed"),&SpriteFramesEditor::_animation_loop_changed);
+ ClassDB::bind_method(_MD("_animation_fps_changed"),&SpriteFramesEditor::_animation_fps_changed);
+ ClassDB::bind_method(_MD("get_drag_data_fw"), &SpriteFramesEditor::get_drag_data_fw);
+ ClassDB::bind_method(_MD("can_drop_data_fw"), &SpriteFramesEditor::can_drop_data_fw);
+ ClassDB::bind_method(_MD("drop_data_fw"), &SpriteFramesEditor::drop_data_fw);
}
@@ -929,7 +929,7 @@ void SpriteFramesEditorPlugin::edit(Object *p_object) {
bool SpriteFramesEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("SpriteFrames");
+ return p_object->is_class("SpriteFrames");
}
void SpriteFramesEditorPlugin::make_visible(bool p_visible) {
@@ -937,14 +937,14 @@ void SpriteFramesEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
button->show();
editor->make_bottom_panel_item_visible(frames_editor);
-// frames_editor->set_process(true);
+ //frames_editor->set_process(true);
} else {
button->hide();
- if (frames_editor->is_visible())
+ if (frames_editor->is_visible_in_tree())
editor->hide_bottom_panel();
-// frames_editor->set_process(false);
+ //frames_editor->set_process(false);
}
}
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.h b/tools/editor/plugins/sprite_frames_editor_plugin.h
index f0aa84c23a..36a022b7e4 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.h
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -41,7 +41,7 @@
class SpriteFramesEditor : public PanelContainer {
- OBJ_TYPE(SpriteFramesEditor, PanelContainer );
+ GDCLASS(SpriteFramesEditor, PanelContainer );
Button *load;
Button *_delete;
@@ -73,7 +73,7 @@ class SpriteFramesEditor : public PanelContainer {
void _load_pressed();
void _load_scene_pressed();
- void _file_load_request(const DVector<String>& p_path, int p_at_pos=-1);
+ void _file_load_request(const PoolVector<String>& p_path, int p_at_pos=-1);
void _paste_pressed();
void _empty_pressed();
void _empty2_pressed();
@@ -104,7 +104,7 @@ class SpriteFramesEditor : public PanelContainer {
protected:
void _notification(int p_what);
- void _input_event(InputEvent p_event);
+ void _gui_input(InputEvent p_event);
static void _bind_methods();
public:
@@ -116,7 +116,7 @@ public:
class SpriteFramesEditorPlugin : public EditorPlugin {
- OBJ_TYPE( SpriteFramesEditorPlugin, EditorPlugin );
+ GDCLASS( SpriteFramesEditorPlugin, EditorPlugin );
SpriteFramesEditor *frames_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/stream_editor_plugin.cpp b/tools/editor/plugins/stream_editor_plugin.cpp
index d896784074..00d7b208c8 100644
--- a/tools/editor/plugins/stream_editor_plugin.cpp
+++ b/tools/editor/plugins/stream_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -59,8 +59,8 @@ void StreamEditor::_stop() {
void StreamEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_play"),&StreamEditor::_play);
- ObjectTypeDB::bind_method(_MD("_stop"),&StreamEditor::_stop);
+ ClassDB::bind_method(_MD("_play"),&StreamEditor::_play);
+ ClassDB::bind_method(_MD("_stop"),&StreamEditor::_stop);
}
@@ -104,7 +104,7 @@ void StreamEditorPlugin::edit(Object *p_object) {
bool StreamEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("StreamPlayer") || p_object->is_type("SpatialStreamPlayer");
+ return p_object->is_class("StreamPlayer") || p_object->is_class("SpatialStreamPlayer");
}
void StreamEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/stream_editor_plugin.h b/tools/editor/plugins/stream_editor_plugin.h
index 5730612d61..af29f64f93 100644
--- a/tools/editor/plugins/stream_editor_plugin.h
+++ b/tools/editor/plugins/stream_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,7 +40,7 @@
class StreamEditor : public Control {
- OBJ_TYPE(StreamEditor, Control );
+ GDCLASS(StreamEditor, Control );
Button * play;
Button * stop;
@@ -62,7 +62,7 @@ public:
class StreamEditorPlugin : public EditorPlugin {
- OBJ_TYPE( StreamEditorPlugin, EditorPlugin );
+ GDCLASS( StreamEditorPlugin, EditorPlugin );
StreamEditor *stream_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/style_box_editor_plugin.cpp b/tools/editor/plugins/style_box_editor_plugin.cpp
index d5c885bd55..396ebd0052 100644
--- a/tools/editor/plugins/style_box_editor_plugin.cpp
+++ b/tools/editor/plugins/style_box_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -48,10 +48,10 @@ void StyleBoxEditor::_sb_changed() {
void StyleBoxEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_sb_changed",&StyleBoxEditor::_sb_changed);
-// ObjectTypeDB::bind_method("_import",&StyleBoxEditor::_import);
-// ObjectTypeDB::bind_method("_import_accept",&StyleBoxEditor::_import_accept);
-// ObjectTypeDB::bind_method("_preview_text_changed",&StyleBoxEditor::_preview_text_changed);
+ ClassDB::bind_method("_sb_changed",&StyleBoxEditor::_sb_changed);
+ //ClassDB::bind_method("_import",&StyleBoxEditor::_import);
+ //ClassDB::bind_method("_import_accept",&StyleBoxEditor::_import_accept);
+ //ClassDB::bind_method("_preview_text_changed",&StyleBoxEditor::_preview_text_changed);
}
StyleBoxEditor::StyleBoxEditor() {
@@ -85,7 +85,7 @@ void StyleBoxEditorPlugin::edit(Object *p_node) {
bool StyleBoxEditorPlugin::handles(Object *p_node) const{
- return p_node->is_type("StyleBox");
+ return p_node->is_class("StyleBox");
}
void StyleBoxEditorPlugin::make_visible(bool p_visible){
@@ -95,7 +95,7 @@ void StyleBoxEditorPlugin::make_visible(bool p_visible){
EditorNode::get_singleton()->make_bottom_panel_item_visible(stylebox_editor);
} else {
- if (stylebox_editor->is_visible())
+ if (stylebox_editor->is_visible_in_tree())
EditorNode::get_singleton()->hide_bottom_panel();
button->hide();
}
diff --git a/tools/editor/plugins/style_box_editor_plugin.h b/tools/editor/plugins/style_box_editor_plugin.h
index 737f830bbb..29e98efd8b 100644
--- a/tools/editor/plugins/style_box_editor_plugin.h
+++ b/tools/editor/plugins/style_box_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -30,14 +30,14 @@
#define STYLE_BOX_EDITOR_PLUGIN_H
#include "scene/resources/style_box.h"
-#include "scene/gui/texture_frame.h"
+#include "scene/gui/texture_rect.h"
#include "scene/gui/option_button.h"
#include "tools/editor/editor_node.h"
class StyleBoxEditor : public Control {
- OBJ_TYPE( StyleBoxEditor, Control );
+ GDCLASS( StyleBoxEditor, Control );
Panel *panel;
Panel *preview;
@@ -61,7 +61,7 @@ public:
class StyleBoxEditorPlugin : public EditorPlugin {
- OBJ_TYPE( StyleBoxEditorPlugin, EditorPlugin );
+ GDCLASS( StyleBoxEditorPlugin, EditorPlugin );
StyleBoxEditor *stylebox_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/texture_editor_plugin.cpp b/tools/editor/plugins/texture_editor_plugin.cpp
index 1305e91105..a846a908d2 100644
--- a/tools/editor/plugins/texture_editor_plugin.cpp
+++ b/tools/editor/plugins/texture_editor_plugin.cpp
@@ -4,7 +4,7 @@
#include "globals.h"
#include "tools/editor/editor_settings.h"
-void TextureEditor::_input_event(InputEvent p_event) {
+void TextureEditor::_gui_input(InputEvent p_event) {
}
@@ -49,7 +49,7 @@ void TextureEditor::_notification(int p_what) {
if (texture->cast_to<ImageTexture>()) {
format = Image::get_format_name(texture->cast_to<ImageTexture>()->get_format());
} else {
- format=texture->get_type();
+ format=texture->get_class();
}
String text = itos(texture->get_width())+"x"+itos(texture->get_height())+" "+format;
@@ -84,7 +84,7 @@ void TextureEditor::edit(Ref<Texture> p_texture) {
void TextureEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_input_event"),&TextureEditor::_input_event);
+ ClassDB::bind_method(_MD("_gui_input"),&TextureEditor::_gui_input);
}
@@ -106,18 +106,18 @@ void TextureEditorPlugin::edit(Object *p_object) {
bool TextureEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("Texture");
+ return p_object->is_class("Texture");
}
void TextureEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
texture_editor->show();
-// texture_editor->set_process(true);
+ //texture_editor->set_process(true);
} else {
texture_editor->hide();
-// texture_editor->set_process(false);
+ //texture_editor->set_process(false);
}
}
diff --git a/tools/editor/plugins/texture_editor_plugin.h b/tools/editor/plugins/texture_editor_plugin.h
index 5f58f4fcdb..4b05f7f7ab 100644
--- a/tools/editor/plugins/texture_editor_plugin.h
+++ b/tools/editor/plugins/texture_editor_plugin.h
@@ -10,14 +10,14 @@
class TextureEditor : public Control {
- OBJ_TYPE(TextureEditor, Control);
+ GDCLASS(TextureEditor, Control);
Ref<Texture> texture;
protected:
void _notification(int p_what);
- void _input_event(InputEvent p_event);
+ void _gui_input(InputEvent p_event);
static void _bind_methods();
public:
@@ -28,7 +28,7 @@ public:
class TextureEditorPlugin : public EditorPlugin {
- OBJ_TYPE( TextureEditorPlugin, EditorPlugin );
+ GDCLASS( TextureEditorPlugin, EditorPlugin );
TextureEditor *texture_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/tools/editor/plugins/texture_region_editor_plugin.cpp
index 43086fb208..1ad880c4d6 100644
--- a/tools/editor/plugins/texture_region_editor_plugin.cpp
+++ b/tools/editor/plugins/texture_region_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* */
/* Author: Mariano Suligoy */
/* */
@@ -57,14 +57,13 @@ void TextureRegionEditor::_region_draw()
if (base_tex.is_null())
return;
- Matrix32 mtx;
+ Transform2D mtx;
mtx.elements[2]=-draw_ofs;
mtx.scale_basis(Vector2(draw_zoom,draw_zoom));
- VS::get_singleton()->canvas_item_set_clip(edit_draw->get_canvas_item(),true);
VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(),mtx);
edit_draw->draw_texture(base_tex,Point2());
- VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(),Matrix32());
+ VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(),Transform2D());
if (snap_mode == SNAP_GRID) {
Size2 s = edit_draw->get_size();
@@ -166,13 +165,13 @@ void TextureRegionEditor::_region_draw()
hscroll->set_min(scroll_rect.pos.x);
hscroll->set_max(scroll_rect.pos.x+scroll_rect.size.x);
hscroll->set_page(edit_draw->get_size().x);
- hscroll->set_val(draw_ofs.x);
+ hscroll->set_value(draw_ofs.x);
hscroll->set_step(0.001);
vscroll->set_min(scroll_rect.pos.y);
vscroll->set_max(scroll_rect.pos.y+scroll_rect.size.y);
vscroll->set_page(edit_draw->get_size().y);
- vscroll->set_val(draw_ofs.y);
+ vscroll->set_value(draw_ofs.y);
vscroll->set_step(0.001);
updating_scroll=false;
@@ -204,7 +203,7 @@ void TextureRegionEditor::_region_draw()
void TextureRegionEditor::_region_input(const InputEvent& p_input)
{
- Matrix32 mtx;
+ Transform2D mtx;
mtx.elements[2]=-draw_ofs;
mtx.scale_basis(Vector2(draw_zoom,draw_zoom));
@@ -388,9 +387,9 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input)
drag_index = -1;
}
}
- } else if (mb.button_index == BUTTON_WHEEL_UP) {
+ } else if (mb.button_index == BUTTON_WHEEL_UP && mb.pressed) {
_zoom_in();
- } else if (mb.button_index == BUTTON_WHEEL_DOWN) {
+ } else if (mb.button_index == BUTTON_WHEEL_DOWN && mb.pressed) {
_zoom_out();
}
} else if (p_input.type==InputEvent::MOUSE_MOTION) {
@@ -400,8 +399,8 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input)
if (mm.button_mask&BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) {
Vector2 draged(mm.relative_x,mm.relative_y);
- hscroll->set_val( hscroll->get_val()-draged.x );
- vscroll->set_val( vscroll->get_val()-draged.y );
+ hscroll->set_value( hscroll->get_value()-draged.x );
+ vscroll->set_value( vscroll->get_value()-draged.y );
} else if (drag) {
@@ -500,15 +499,15 @@ void TextureRegionEditor::_scroll_changed(float)
if (updating_scroll)
return;
- draw_ofs.x=hscroll->get_val();
- draw_ofs.y=vscroll->get_val();
+ draw_ofs.x=hscroll->get_value();
+ draw_ofs.y=vscroll->get_value();
edit_draw->update();
}
void TextureRegionEditor::_set_snap_mode(int p_mode)
{
- snap_mode = p_mode;
snap_mode_button->get_popup()->set_item_checked(snap_mode,false);
+ snap_mode = p_mode;
snap_mode_button->set_text(snap_mode_button->get_popup()->get_item_text(p_mode));
snap_mode_button->get_popup()->set_item_checked(snap_mode,true);
@@ -615,21 +614,21 @@ void TextureRegionEditor::_node_removed(Object *p_obj)
void TextureRegionEditor::_bind_methods()
{
- ObjectTypeDB::bind_method(_MD("_edit_region"),&TextureRegionEditor::_edit_region);
- ObjectTypeDB::bind_method(_MD("_region_draw"),&TextureRegionEditor::_region_draw);
- ObjectTypeDB::bind_method(_MD("_region_input"),&TextureRegionEditor::_region_input);
- ObjectTypeDB::bind_method(_MD("_scroll_changed"),&TextureRegionEditor::_scroll_changed);
- ObjectTypeDB::bind_method(_MD("_node_removed"),&TextureRegionEditor::_node_removed);
- ObjectTypeDB::bind_method(_MD("_set_snap_mode"),&TextureRegionEditor::_set_snap_mode);
- ObjectTypeDB::bind_method(_MD("_set_snap_off_x"),&TextureRegionEditor::_set_snap_off_x);
- ObjectTypeDB::bind_method(_MD("_set_snap_off_y"),&TextureRegionEditor::_set_snap_off_y);
- ObjectTypeDB::bind_method(_MD("_set_snap_step_x"),&TextureRegionEditor::_set_snap_step_x);
- ObjectTypeDB::bind_method(_MD("_set_snap_step_y"),&TextureRegionEditor::_set_snap_step_y);
- ObjectTypeDB::bind_method(_MD("_set_snap_sep_x"),&TextureRegionEditor::_set_snap_sep_x);
- ObjectTypeDB::bind_method(_MD("_set_snap_sep_y"),&TextureRegionEditor::_set_snap_sep_y);
- ObjectTypeDB::bind_method(_MD("_zoom_in"),&TextureRegionEditor::_zoom_in);
- ObjectTypeDB::bind_method(_MD("_zoom_reset"),&TextureRegionEditor::_zoom_reset);
- ObjectTypeDB::bind_method(_MD("_zoom_out"),&TextureRegionEditor::_zoom_out);
+ ClassDB::bind_method(_MD("_edit_region"),&TextureRegionEditor::_edit_region);
+ ClassDB::bind_method(_MD("_region_draw"),&TextureRegionEditor::_region_draw);
+ ClassDB::bind_method(_MD("_region_input"),&TextureRegionEditor::_region_input);
+ ClassDB::bind_method(_MD("_scroll_changed"),&TextureRegionEditor::_scroll_changed);
+ ClassDB::bind_method(_MD("_node_removed"),&TextureRegionEditor::_node_removed);
+ ClassDB::bind_method(_MD("_set_snap_mode"),&TextureRegionEditor::_set_snap_mode);
+ ClassDB::bind_method(_MD("_set_snap_off_x"),&TextureRegionEditor::_set_snap_off_x);
+ ClassDB::bind_method(_MD("_set_snap_off_y"),&TextureRegionEditor::_set_snap_off_y);
+ ClassDB::bind_method(_MD("_set_snap_step_x"),&TextureRegionEditor::_set_snap_step_x);
+ ClassDB::bind_method(_MD("_set_snap_step_y"),&TextureRegionEditor::_set_snap_step_y);
+ ClassDB::bind_method(_MD("_set_snap_sep_x"),&TextureRegionEditor::_set_snap_sep_x);
+ ClassDB::bind_method(_MD("_set_snap_sep_y"),&TextureRegionEditor::_set_snap_sep_y);
+ ClassDB::bind_method(_MD("_zoom_in"),&TextureRegionEditor::_zoom_in);
+ ClassDB::bind_method(_MD("_zoom_reset"),&TextureRegionEditor::_zoom_reset);
+ ClassDB::bind_method(_MD("_zoom_out"),&TextureRegionEditor::_zoom_out);
}
void TextureRegionEditor::edit(Object *p_obj)
@@ -644,7 +643,7 @@ void TextureRegionEditor::edit(Object *p_obj)
atlas_tex->disconnect("atlas_changed",this,"_edit_region");
if (p_obj) {
node_sprite = p_obj->cast_to<Sprite>();
- node_patch9 = p_obj->cast_to<Patch9Frame>();
+ node_patch9 = p_obj->cast_to<NinePatchRect>();
if (p_obj->cast_to<StyleBoxTexture>())
obj_styleBox = Ref<StyleBoxTexture>(p_obj->cast_to<StyleBoxTexture>());
if (p_obj->cast_to<AtlasTexture>()) {
@@ -653,17 +652,18 @@ void TextureRegionEditor::edit(Object *p_obj)
} else {
p_obj->connect("texture_changed",this,"_edit_region");
}
- p_obj->connect("exit_tree",this,"_node_removed",varray(p_obj),CONNECT_ONESHOT);
+ p_obj->add_change_receptor(this);
+ p_obj->connect("tree_exited",this,"_node_removed",varray(p_obj),CONNECT_ONESHOT);
_edit_region();
} else {
if(node_sprite)
- node_sprite->disconnect("exit_tree",this,"_node_removed");
+ node_sprite->disconnect("tree_exited",this,"_node_removed");
else if(node_patch9)
- node_patch9->disconnect("exit_tree",this,"_node_removed");
+ node_patch9->disconnect("tree_exited",this,"_node_removed");
else if(obj_styleBox.is_valid())
- obj_styleBox->disconnect("exit_tree",this,"_node_removed");
+ obj_styleBox->disconnect("tree_exited",this,"_node_removed");
else if(atlas_tex.is_valid())
- atlas_tex->disconnect("exit_tree",this,"_node_removed");
+ atlas_tex->disconnect("tree_exited",this,"_node_removed");
node_sprite = NULL;
node_patch9 = NULL;
@@ -673,6 +673,12 @@ void TextureRegionEditor::edit(Object *p_obj)
edit_draw->update();
}
+void TextureRegionEditor::_changed_callback(Object *p_changed, const char *p_prop) {
+ if ((String)p_prop == "region_rect") {
+ _edit_region();
+ }
+}
+
void TextureRegionEditor::_edit_region()
{
Ref<Texture> texture = NULL;
@@ -811,7 +817,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
for (int i = 0; i < 4; i++)
p->set_item_as_checkable(i,true);
p->set_item_checked(0,true);
- p->connect("item_pressed", this, "_set_snap_mode");
+ p->connect("id_pressed", this, "_set_snap_mode");
hb_grid = memnew( HBoxContainer );
hb_tools->add_child(hb_grid);
hb_grid->add_child( memnew( VSeparator ));
@@ -822,7 +828,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
sb_off_x->set_min(-256);
sb_off_x->set_max(256);
sb_off_x->set_step(1);
- sb_off_x->set_val(snap_offset.x);
+ sb_off_x->set_value(snap_offset.x);
sb_off_x->set_suffix("px");
sb_off_x->connect("value_changed", this, "_set_snap_off_x");
hb_grid->add_child(sb_off_x);
@@ -831,7 +837,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
sb_off_y->set_min(-256);
sb_off_y->set_max(256);
sb_off_y->set_step(1);
- sb_off_y->set_val(snap_offset.y);
+ sb_off_y->set_value(snap_offset.y);
sb_off_y->set_suffix("px");
sb_off_y->connect("value_changed", this, "_set_snap_off_y");
hb_grid->add_child(sb_off_y);
@@ -843,7 +849,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
sb_step_x->set_min(-256);
sb_step_x->set_max(256);
sb_step_x->set_step(1);
- sb_step_x->set_val(snap_step.x);
+ sb_step_x->set_value(snap_step.x);
sb_step_x->set_suffix("px");
sb_step_x->connect("value_changed", this, "_set_snap_step_x");
hb_grid->add_child(sb_step_x);
@@ -852,7 +858,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
sb_step_y->set_min(-256);
sb_step_y->set_max(256);
sb_step_y->set_step(1);
- sb_step_y->set_val(snap_step.y);
+ sb_step_y->set_value(snap_step.y);
sb_step_y->set_suffix("px");
sb_step_y->connect("value_changed", this, "_set_snap_step_y");
hb_grid->add_child(sb_step_y);
@@ -864,7 +870,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
sb_sep_x->set_min(0);
sb_sep_x->set_max(256);
sb_sep_x->set_step(1);
- sb_sep_x->set_val(snap_separation.x);
+ sb_sep_x->set_value(snap_separation.x);
sb_sep_x->set_suffix("px");
sb_sep_x->connect("value_changed", this, "_set_snap_sep_x");
hb_grid->add_child(sb_sep_x);
@@ -873,7 +879,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
sb_sep_y->set_min(0);
sb_sep_y->set_max(256);
sb_sep_y->set_step(1);
- sb_sep_y->set_val(snap_separation.y);
+ sb_sep_y->set_value(snap_separation.y);
sb_sep_y->set_suffix("px");
sb_sep_y->connect("value_changed", this, "_set_snap_sep_y");
hb_grid->add_child(sb_sep_y);
@@ -891,7 +897,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
separator->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hb_tools->add_child(separator);
- icon_zoom = memnew( TextureFrame );
+ icon_zoom = memnew( TextureRect );
hb_tools->add_child(icon_zoom);
zoom_out = memnew( ToolButton );
@@ -914,10 +920,12 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor)
hscroll->connect("value_changed",this,"_scroll_changed");
edit_draw->connect("draw",this,"_region_draw");
- edit_draw->connect("input_event",this,"_region_input");
+ edit_draw->connect("gui_input",this,"_region_input");
draw_zoom=1.0;
updating_scroll=false;
+ edit_draw->set_clip_contents(true);
+
}
void TextureRegionEditorPlugin::edit(Object *p_node)
@@ -927,7 +935,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") || p_obj->is_type("AtlasTexture");
+ return p_obj->is_class("Sprite") || p_obj->is_class("Patch9Rect") || p_obj->is_class("StyleBoxTexture") || p_obj->is_class("AtlasTexture");
}
void TextureRegionEditorPlugin::make_visible(bool p_visible)
@@ -964,22 +972,22 @@ void TextureRegionEditorPlugin::set_state(const Dictionary& p_state){
if (state.has("snap_step")) {
Vector2 s = state["snap_step"];
- region_editor->sb_step_x->set_val(s.x);
- region_editor->sb_step_y->set_val(s.y);
+ region_editor->sb_step_x->set_value(s.x);
+ region_editor->sb_step_y->set_value(s.y);
region_editor->snap_step = s;
}
if (state.has("snap_offset")) {
Vector2 ofs = state["snap_offset"];
- region_editor->sb_off_x->set_val(ofs.x);
- region_editor->sb_off_y->set_val(ofs.y);
+ region_editor->sb_off_x->set_value(ofs.x);
+ region_editor->sb_off_y->set_value(ofs.y);
region_editor->snap_offset = ofs;
}
if (state.has("snap_separation")) {
Vector2 sep = state["snap_separation"];
- region_editor->sb_sep_x->set_val(sep.x);
- region_editor->sb_sep_y->set_val(sep.y);
+ region_editor->sb_sep_x->set_value(sep.x);
+ region_editor->sb_sep_y->set_value(sep.y);
region_editor->snap_separation = sep;
}
diff --git a/tools/editor/plugins/texture_region_editor_plugin.h b/tools/editor/plugins/texture_region_editor_plugin.h
index 3658a38f11..35c0f18efa 100644
--- a/tools/editor/plugins/texture_region_editor_plugin.h
+++ b/tools/editor/plugins/texture_region_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* */
/* Author: Mariano Suligoy */
/* */
@@ -36,13 +36,13 @@
#include "tools/editor/editor_plugin.h"
#include "tools/editor/editor_node.h"
#include "scene/2d/sprite.h"
-#include "scene/gui/patch_9_frame.h"
+#include "scene/gui/patch_9_rect.h"
#include "scene/resources/style_box.h"
#include "scene/resources/texture.h"
class TextureRegionEditor : public Control {
- OBJ_TYPE(TextureRegionEditor, Control );
+ GDCLASS(TextureRegionEditor, Control );
enum SnapMode {
SNAP_NONE,
@@ -53,7 +53,7 @@ class TextureRegionEditor : public Control {
friend class TextureRegionEditorPlugin;
MenuButton *snap_mode_button;
- TextureFrame *icon_zoom;
+ TextureRect *icon_zoom;
ToolButton *zoom_in;
ToolButton *zoom_reset;
ToolButton *zoom_out;
@@ -81,7 +81,7 @@ class TextureRegionEditor : public Control {
Vector2 snap_step;
Vector2 snap_separation;
- Patch9Frame *node_patch9;
+ NinePatchRect *node_patch9;
Sprite *node_sprite;
Ref<StyleBoxTexture> obj_styleBox;
Ref<AtlasTexture> atlas_tex;
@@ -116,6 +116,8 @@ protected:
Vector2 snap_point(Vector2 p_target) const;
+ virtual void _changed_callback(Object *p_changed, const char *p_prop);
+
public:
void _edit_region();
@@ -130,7 +132,7 @@ public:
class TextureRegionEditorPlugin : public EditorPlugin
{
- OBJ_TYPE( TextureRegionEditorPlugin, EditorPlugin );
+ GDCLASS( TextureRegionEditorPlugin, EditorPlugin );
Button *region_button;
TextureRegionEditor *region_editor;
diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp
index 5db331ba45..027e91ade8 100644
--- a/tools/editor/plugins/theme_editor_plugin.cpp
+++ b/tools/editor/plugins/theme_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -631,12 +631,12 @@ void ThemeEditor::_notification(int p_what) {
void ThemeEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_type_menu_cbk",&ThemeEditor::_type_menu_cbk);
- ObjectTypeDB::bind_method("_name_menu_about_to_show",&ThemeEditor::_name_menu_about_to_show);
- ObjectTypeDB::bind_method("_name_menu_cbk",&ThemeEditor::_name_menu_cbk);
- ObjectTypeDB::bind_method("_theme_menu_cbk",&ThemeEditor::_theme_menu_cbk);
- ObjectTypeDB::bind_method("_dialog_cbk",&ThemeEditor::_dialog_cbk);
- ObjectTypeDB::bind_method("_save_template_cbk",&ThemeEditor::_save_template_cbk);
+ ClassDB::bind_method("_type_menu_cbk",&ThemeEditor::_type_menu_cbk);
+ ClassDB::bind_method("_name_menu_about_to_show",&ThemeEditor::_name_menu_about_to_show);
+ ClassDB::bind_method("_name_menu_cbk",&ThemeEditor::_name_menu_cbk);
+ ClassDB::bind_method("_theme_menu_cbk",&ThemeEditor::_theme_menu_cbk);
+ ClassDB::bind_method("_dialog_cbk",&ThemeEditor::_dialog_cbk);
+ ClassDB::bind_method("_save_template_cbk",&ThemeEditor::_save_template_cbk);
}
ThemeEditor::ThemeEditor() {
@@ -668,7 +668,7 @@ ThemeEditor::ThemeEditor() {
theme_menu = memnew( MenuButton );
- theme_menu->set_text("Theme");
+ theme_menu->set_text(TTR("Theme"));
theme_menu->get_popup()->add_item(TTR("Add Item"),POPUP_ADD);
theme_menu->get_popup()->add_item(TTR("Add Class Items"),POPUP_CLASS_ADD);
theme_menu->get_popup()->add_item(TTR("Remove Item"),POPUP_REMOVE);
@@ -679,7 +679,7 @@ ThemeEditor::ThemeEditor() {
add_child(theme_menu);
theme_menu->set_pos(Vector2(3,3)*EDSCALE);
- theme_menu->get_popup()->connect("item_pressed", this,"_theme_menu_cbk");
+ theme_menu->get_popup()->connect("id_pressed", this,"_theme_menu_cbk");
HBoxContainer *main_hb = memnew( HBoxContainer );
@@ -693,9 +693,9 @@ ThemeEditor::ThemeEditor() {
-// main_panel->add_child(panel);
-// panel->set_area_as_parent_rect();
-// panel->set_margin( MARGIN_TOP,20 );
+ //main_panel->add_child(panel);
+ //panel->set_area_as_parent_rect();
+ //panel->set_margin( MARGIN_TOP,20 );
first_vb->add_child(memnew( Label("Label") ));
@@ -711,7 +711,7 @@ ThemeEditor::ThemeEditor() {
first_vb->add_child(cbx );
- ButtonGroup *bg = memnew( ButtonGroup );
+ VBoxContainer *bg = memnew( VBoxContainer );
bg->set_v_size_flags(SIZE_EXPAND_FILL);
VBoxContainer *gbvb = memnew( VBoxContainer );
gbvb->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -750,7 +750,7 @@ ThemeEditor::ThemeEditor() {
first_vb->add_child( memnew( HScrollBar ));
first_vb->add_child( memnew( SpinBox ));
ProgressBar *pb=memnew( ProgressBar );
- pb->set_val(50);
+ pb->set_value(50);
first_vb->add_child( pb);
Panel *pn=memnew( Panel );
pn->set_custom_minimum_size(Size2(40,40)*EDSCALE);
@@ -898,7 +898,7 @@ ThemeEditor::ThemeEditor() {
type_menu->set_text("..");
add_del_dialog->add_child(type_menu);
- type_menu->get_popup()->connect("item_pressed", this,"_type_menu_cbk");
+ type_menu->get_popup()->connect("id_pressed", this,"_type_menu_cbk");
l = memnew( Label );
l->set_pos( Point2(200,5)*EDSCALE );
@@ -918,7 +918,7 @@ ThemeEditor::ThemeEditor() {
add_del_dialog->add_child(name_menu);
name_menu->get_popup()->connect("about_to_show", this,"_name_menu_about_to_show");
- name_menu->get_popup()->connect("item_pressed", this,"_name_menu_cbk");
+ name_menu->get_popup()->connect("id_pressed", this,"_name_menu_cbk");
type_select_label= memnew( Label );
type_select_label->set_pos( Point2(400,5)*EDSCALE );
@@ -963,7 +963,7 @@ void ThemeEditorPlugin::edit(Object *p_node) {
bool ThemeEditorPlugin::handles(Object *p_node) const{
- return p_node->is_type("Theme");
+ return p_node->is_class("Theme");
}
void ThemeEditorPlugin::make_visible(bool p_visible){
@@ -975,7 +975,7 @@ void ThemeEditorPlugin::make_visible(bool p_visible){
} else {
theme_editor->set_process(false);
- if (theme_editor->is_visible())
+ if (theme_editor->is_visible_in_tree())
editor->hide_bottom_panel();
button->hide();
}
@@ -987,7 +987,7 @@ ThemeEditorPlugin::ThemeEditorPlugin(EditorNode *p_node) {
theme_editor = memnew( ThemeEditor );
theme_editor->set_custom_minimum_size(Size2(0,200));
-// p_node->get_viewport()->add_child(theme_editor);
+ //p_node->get_viewport()->add_child(theme_editor);
button=editor->add_bottom_panel_item("Theme",theme_editor);
button->hide();
diff --git a/tools/editor/plugins/theme_editor_plugin.h b/tools/editor/plugins/theme_editor_plugin.h
index ea8f8c1d3c..9251da8e07 100644
--- a/tools/editor/plugins/theme_editor_plugin.h
+++ b/tools/editor/plugins/theme_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -30,7 +30,7 @@
#define THEME_EDITOR_PLUGIN_H
#include "scene/resources/theme.h"
-#include "scene/gui/texture_frame.h"
+#include "scene/gui/texture_rect.h"
#include "scene/gui/option_button.h"
#include "scene/gui/file_dialog.h"
#include "scene/gui/check_box.h"
@@ -44,7 +44,7 @@
class ThemeEditor : public Control {
- OBJ_TYPE( ThemeEditor, Control );
+ GDCLASS( ThemeEditor, Control );
ScrollContainer *scroll;
@@ -103,7 +103,7 @@ public:
class ThemeEditorPlugin : public EditorPlugin {
- OBJ_TYPE( ThemeEditorPlugin, EditorPlugin );
+ GDCLASS( ThemeEditorPlugin, EditorPlugin );
ThemeEditor *theme_editor;
EditorNode *editor;
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp
index 43fe7d7ea9..1a8c35a0be 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.cpp
+++ b/tools/editor/plugins/tile_map_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -53,7 +53,7 @@ void TileMapEditor::_notification(int p_what) {
} break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
- if (is_visible()) {
+ if (is_visible_in_tree()) {
_update_palette();
}
} break;
@@ -189,7 +189,7 @@ void TileMapEditor::_sbox_input(const InputEvent& p_ie) {
p_ie.key.scancode == KEY_PAGEUP ||
p_ie.key.scancode == KEY_PAGEDOWN ) ) {
- palette->call("_input_event", p_ie);
+ palette->call("_gui_input", p_ie);
search_box->accept_event();
}
}
@@ -212,16 +212,16 @@ void TileMapEditor::_update_palette() {
if (tiles.empty())
return;
- float min_size = EDITOR_DEF("tile_map/preview_size", 64);
+ float min_size = EDITOR_DEF("editors/tile_map/preview_size", 64);
min_size *= EDSCALE;
- int hseparation = EDITOR_DEF("tile_map/palette_item_hseparation",8);
- bool show_tile_names = bool(EDITOR_DEF("tile_map/show_tile_names", true));
+ int hseparation = EDITOR_DEF("editors/tile_map/palette_item_hseparation",8);
+ bool show_tile_names = bool(EDITOR_DEF("editors/tile_map/show_tile_names", true));
palette->add_constant_override("hseparation", hseparation*EDSCALE);
palette->add_constant_override("vseparation", 8*EDSCALE);
palette->set_fixed_icon_size(Size2(min_size, min_size));
- palette->set_fixed_column_width(min_size * MAX(size_slider->get_val(), 1));
+ palette->set_fixed_column_width(min_size * MAX(size_slider->get_value(), 1));
String filter = search_box->get_text().strip_edges();
@@ -289,7 +289,7 @@ void TileMapEditor::_pick_tile(const Point2& p_pos) {
canvas_item_editor->update();
}
-DVector<Vector2> TileMapEditor::_bucket_fill(const Point2i& p_start, bool erase) {
+PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i& p_start, bool erase, bool preview) {
int prev_id = node->get_cell(p_start.x, p_start.y);
int id = TileMap::INVALID_CELL;
@@ -297,14 +297,43 @@ DVector<Vector2> TileMapEditor::_bucket_fill(const Point2i& p_start, bool erase)
id = get_selected_tile();
if (id == TileMap::INVALID_CELL)
- return DVector<Vector2>();
+ return PoolVector<Vector2>();
}
- Rect2 r = node->get_item_rect();
+ Rect2i r = node->get_item_rect();
r.pos = r.pos/node->get_cell_size();
r.size = r.size/node->get_cell_size();
- DVector<Vector2> points;
+ int area = r.get_area();
+ if(preview) {
+ // Test if we can re-use the result from preview bucket fill
+ bool invalidate_cache = false;
+ // Area changed
+ if(r != bucket_cache_rect)
+ _clear_bucket_cache();
+ // Cache grid is not initialized
+ if(bucket_cache_visited == 0) {
+ bucket_cache_visited = new bool[area];
+ invalidate_cache = true;
+ }
+ // Tile ID changed or position wasn't visited by the previous fill
+ int loc = (p_start.x - r.get_pos().x) + (p_start.y - r.get_pos().y) * r.get_size().x;
+ if(prev_id != bucket_cache_tile || !bucket_cache_visited[loc]) {
+ invalidate_cache = true;
+ }
+ if(invalidate_cache) {
+ for(int i = 0; i < area; ++i)
+ bucket_cache_visited[i] = false;
+ bucket_cache = PoolVector<Vector2>();
+ bucket_cache_tile = prev_id;
+ bucket_cache_rect = r;
+ }
+ else {
+ return bucket_cache;
+ }
+ }
+
+ PoolVector<Vector2> points;
List<Point2i> queue;
queue.push_back(p_start);
@@ -319,9 +348,17 @@ DVector<Vector2> TileMapEditor::_bucket_fill(const Point2i& p_start, bool erase)
if (node->get_cell(n.x, n.y) == prev_id) {
- node->set_cellv(n, id, flip_h, flip_v, transpose);
-
- points.push_back(n);
+ if(preview) {
+ int loc = (n.x - r.get_pos().x) + (n.y - r.get_pos().y) * r.get_size().x;
+ if(bucket_cache_visited[loc])
+ continue;
+ bucket_cache_visited[loc] = true;
+ bucket_cache.push_back(n);
+ }
+ else {
+ node->set_cellv(n, id, flip_h, flip_v, transpose);
+ points.push_back(n);
+ }
queue.push_back(n + Point2i(0, 1));
queue.push_back(n + Point2i(0, -1));
@@ -330,13 +367,13 @@ DVector<Vector2> TileMapEditor::_bucket_fill(const Point2i& p_start, bool erase)
}
}
- return points;
+ return preview ? bucket_cache : points;
}
-void TileMapEditor::_fill_points(const DVector<Vector2> p_points, const Dictionary& p_op) {
+void TileMapEditor::_fill_points(const PoolVector<Vector2> p_points, const Dictionary& p_op) {
int len = p_points.size();
- DVector<Vector2>::Read pr = p_points.read();
+ PoolVector<Vector2>::Read pr = p_points.read();
int id = p_op["id"];
bool xf = p_op["flip_h"];
@@ -349,10 +386,10 @@ void TileMapEditor::_fill_points(const DVector<Vector2> p_points, const Dictiona
}
}
-void TileMapEditor::_erase_points(const DVector<Vector2> p_points) {
+void TileMapEditor::_erase_points(const PoolVector<Vector2> p_points) {
int len = p_points.size();
- DVector<Vector2>::Read pr = p_points.read();
+ PoolVector<Vector2>::Read pr = p_points.read();
for (int i=0;i<len;i++) {
@@ -380,7 +417,7 @@ void TileMapEditor::_select(const Point2i& p_from, const Point2i& p_to) {
canvas_item_editor->update();
}
-void TileMapEditor::_draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Matrix32& p_xform) {
+void TileMapEditor::_draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Transform2D& p_xform) {
Ref<Texture> t = node->get_tileset()->tile_get_texture(p_cell);
@@ -468,6 +505,25 @@ void TileMapEditor::_draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h
canvas_item_editor->draw_texture_rect_region(t, rect, r, Color(1,1,1,0.5), p_transpose);
}
+void TileMapEditor::_draw_fill_preview(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Transform2D& p_xform) {
+
+ PoolVector<Vector2> points = _bucket_fill(p_point, false, true);
+ PoolVector<Vector2>::Read pr = points.read();
+ int len = points.size();
+ int time_after = OS::get_singleton()->get_ticks_msec();
+
+ for(int i = 0; i < len; ++i) {
+ _draw_cell(p_cell, pr[i], p_flip_h, p_flip_v, p_transpose, p_xform);
+ }
+}
+
+void TileMapEditor::_clear_bucket_cache() {
+ if(bucket_cache_visited) {
+ delete[] bucket_cache_visited;
+ bucket_cache_visited = 0;
+ }
+}
+
void TileMapEditor::_update_copydata() {
copydata.clear();
@@ -539,13 +595,13 @@ static inline Vector<Point2i> line(int x0, int x1, int y0, int y1) {
return points;
}
-bool TileMapEditor::forward_input_event(const InputEvent& p_event) {
+bool TileMapEditor::forward_gui_input(const InputEvent& p_event) {
- if (!node || !node->get_tileset().is_valid() || !node->is_visible())
+ if (!node || !node->get_tileset().is_valid() || !node->is_visible_in_tree())
return false;
- Matrix32 xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform();
- Matrix32 xform_inv = xform.affine_inverse();
+ Transform2D xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform_inv = xform.affine_inverse();
switch(p_event.type) {
@@ -692,7 +748,7 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) {
pop["flip_v"] = node->is_cell_y_flipped(over_tile.x, over_tile.y);
pop["transpose"] = node->is_cell_transposed(over_tile.x, over_tile.y);
- DVector<Vector2> points = _bucket_fill(over_tile);
+ PoolVector<Vector2> points = _bucket_fill(over_tile);
if (points.size() == 0)
return false;
@@ -798,7 +854,7 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) {
pop["flip_v"] = node->is_cell_y_flipped(over_tile.x, over_tile.y);
pop["transpose"] = node->is_cell_transposed(over_tile.x, over_tile.y);
- DVector<Vector2> points = _bucket_fill(over_tile, true);
+ PoolVector<Vector2> points = _bucket_fill(over_tile, true);
if (points.size() == 0)
return false;
@@ -1015,10 +1071,10 @@ void TileMapEditor::_canvas_draw() {
if (!node)
return;
- Matrix32 cell_xf = node->get_cell_transform();
+ Transform2D cell_xf = node->get_cell_transform();
- Matrix32 xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform();
- Matrix32 xform_inv = xform.affine_inverse();
+ Transform2D xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform();
+ Transform2D xform_inv = xform.affine_inverse();
Size2 screen_size=canvas_item_editor->get_size();
@@ -1148,8 +1204,8 @@ void TileMapEditor::_canvas_draw() {
canvas_item_editor->draw_line(endpoints[i],endpoints[(i+1)%4],col,2);
- if (tool==TOOL_SELECTING || tool==TOOL_PICKING || tool==TOOL_BUCKET) {
-
+ bool bucket_preview = EditorSettings::get_singleton()->get("editors/tile_map/bucket_fill_preview");
+ if (tool==TOOL_SELECTING || tool==TOOL_PICKING || !bucket_preview) {
return;
}
@@ -1214,6 +1270,11 @@ void TileMapEditor::_canvas_draw() {
canvas_item_editor->draw_colored_polygon(points, Color(0.2,1.0,0.8,0.2));
+ } else if(tool == TOOL_BUCKET) {
+
+ int tile = get_selected_tile();
+ _draw_fill_preview(tile, over_tile, flip_h, flip_v, transpose, xform);
+
} else {
int st = get_selected_tile();
@@ -1241,10 +1302,10 @@ void TileMapEditor::edit(Node *p_tile_map) {
node=p_tile_map->cast_to<TileMap>();
if (!canvas_item_editor->is_connected("draw",this,"_canvas_draw"))
canvas_item_editor->connect("draw",this,"_canvas_draw");
- if (!canvas_item_editor->is_connected("mouse_enter",this,"_canvas_mouse_enter"))
- canvas_item_editor->connect("mouse_enter",this,"_canvas_mouse_enter");
- if (!canvas_item_editor->is_connected("mouse_exit",this,"_canvas_mouse_exit"))
- canvas_item_editor->connect("mouse_exit",this,"_canvas_mouse_exit");
+ if (!canvas_item_editor->is_connected("mouse_entered",this,"_canvas_mouse_enter"))
+ canvas_item_editor->connect("mouse_entered",this,"_canvas_mouse_enter");
+ if (!canvas_item_editor->is_connected("mouse_exited",this,"_canvas_mouse_exit"))
+ canvas_item_editor->connect("mouse_exited",this,"_canvas_mouse_exit");
_update_palette();
@@ -1253,10 +1314,10 @@ void TileMapEditor::edit(Node *p_tile_map) {
if (canvas_item_editor->is_connected("draw",this,"_canvas_draw"))
canvas_item_editor->disconnect("draw",this,"_canvas_draw");
- if (canvas_item_editor->is_connected("mouse_enter",this,"_canvas_mouse_enter"))
- canvas_item_editor->disconnect("mouse_enter",this,"_canvas_mouse_enter");
- if (canvas_item_editor->is_connected("mouse_exit",this,"_canvas_mouse_exit"))
- canvas_item_editor->disconnect("mouse_exit",this,"_canvas_mouse_exit");
+ if (canvas_item_editor->is_connected("mouse_entered",this,"_canvas_mouse_enter"))
+ canvas_item_editor->disconnect("mouse_entered",this,"_canvas_mouse_enter");
+ if (canvas_item_editor->is_connected("mouse_exited",this,"_canvas_mouse_exit"))
+ canvas_item_editor->disconnect("mouse_exited",this,"_canvas_mouse_exit");
_update_palette();
}
@@ -1264,6 +1325,8 @@ void TileMapEditor::edit(Node *p_tile_map) {
if (node)
node->connect("settings_changed",this,"_tileset_settings_changed");
+ _clear_bucket_cache();
+
}
void TileMapEditor::_tileset_settings_changed() {
@@ -1283,20 +1346,20 @@ void TileMapEditor::_icon_size_changed(float p_value) {
void TileMapEditor::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_text_entered"),&TileMapEditor::_text_entered);
- ObjectTypeDB::bind_method(_MD("_text_changed"),&TileMapEditor::_text_changed);
- ObjectTypeDB::bind_method(_MD("_sbox_input"),&TileMapEditor::_sbox_input);
- ObjectTypeDB::bind_method(_MD("_menu_option"),&TileMapEditor::_menu_option);
- ObjectTypeDB::bind_method(_MD("_canvas_draw"),&TileMapEditor::_canvas_draw);
- ObjectTypeDB::bind_method(_MD("_canvas_mouse_enter"),&TileMapEditor::_canvas_mouse_enter);
- ObjectTypeDB::bind_method(_MD("_canvas_mouse_exit"),&TileMapEditor::_canvas_mouse_exit);
- ObjectTypeDB::bind_method(_MD("_tileset_settings_changed"),&TileMapEditor::_tileset_settings_changed);
- ObjectTypeDB::bind_method(_MD("_update_transform_buttons"),&TileMapEditor::_update_transform_buttons);
+ ClassDB::bind_method(_MD("_text_entered"),&TileMapEditor::_text_entered);
+ ClassDB::bind_method(_MD("_text_changed"),&TileMapEditor::_text_changed);
+ ClassDB::bind_method(_MD("_sbox_input"),&TileMapEditor::_sbox_input);
+ ClassDB::bind_method(_MD("_menu_option"),&TileMapEditor::_menu_option);
+ ClassDB::bind_method(_MD("_canvas_draw"),&TileMapEditor::_canvas_draw);
+ ClassDB::bind_method(_MD("_canvas_mouse_enter"),&TileMapEditor::_canvas_mouse_enter);
+ ClassDB::bind_method(_MD("_canvas_mouse_exit"),&TileMapEditor::_canvas_mouse_exit);
+ ClassDB::bind_method(_MD("_tileset_settings_changed"),&TileMapEditor::_tileset_settings_changed);
+ ClassDB::bind_method(_MD("_update_transform_buttons"),&TileMapEditor::_update_transform_buttons);
- ObjectTypeDB::bind_method(_MD("_fill_points"),&TileMapEditor::_fill_points);
- ObjectTypeDB::bind_method(_MD("_erase_points"),&TileMapEditor::_erase_points);
+ ClassDB::bind_method(_MD("_fill_points"),&TileMapEditor::_fill_points);
+ ClassDB::bind_method(_MD("_erase_points"),&TileMapEditor::_erase_points);
- ObjectTypeDB::bind_method(_MD("_icon_size_changed"), &TileMapEditor::_icon_size_changed);
+ ClassDB::bind_method(_MD("_icon_size_changed"), &TileMapEditor::_icon_size_changed);
}
TileMapEditor::CellOp TileMapEditor::_get_op_from_cell(const Point2i& p_pos)
@@ -1365,6 +1428,9 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
flip_v=false;
transpose=false;
+ bucket_cache_tile = -1;
+ bucket_cache_visited = 0;
+
ED_SHORTCUT("tile_map_editor/erase_selection", TTR("Erase selection"), KEY_DELETE);
ED_SHORTCUT("tile_map_editor/find_tile", TTR("Find tile"), KEY_MASK_CMD+KEY_F);
ED_SHORTCUT("tile_map_editor/transpose", TTR("Transpose"));
@@ -1375,7 +1441,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
search_box->set_h_size_flags(SIZE_EXPAND_FILL);
search_box->connect("text_entered", this, "_text_entered");
search_box->connect("text_changed", this, "_text_changed");
- search_box->connect("input_event", this, "_sbox_input");
+ search_box->connect("gui_input", this, "_sbox_input");
add_child(search_box);
size_slider = memnew( HSlider );
@@ -1383,11 +1449,11 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
size_slider->set_min(0.1f);
size_slider->set_max(4.0f);
size_slider->set_step(0.1f);
- size_slider->set_val(1.0f);
+ size_slider->set_value(1.0f);
size_slider->connect("value_changed", this, "_icon_size_changed");
add_child(size_slider);
- int mw = EDITOR_DEF("tile_map/palette_min_width", 80);
+ int mw = EDITOR_DEF("editors/tile_map/palette_min_width", 80);
// Add tile palette
palette = memnew( ItemList );
@@ -1423,7 +1489,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
p->add_shortcut(ED_SHORTCUT("tile_map_editor/duplicate_selection", TTR("Duplicate Selection"), KEY_MASK_CMD+KEY_D), OPTION_DUPLICATE);
p->add_shortcut(ED_GET_SHORTCUT("tile_map_editor/erase_selection"), OPTION_ERASE_SELECTION);
- p->connect("item_pressed", this, "_menu_option");
+ p->connect("id_pressed", this, "_menu_option");
toolbar->add_child(options);
@@ -1479,6 +1545,10 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
rotate_0->set_pressed(true);
}
+TileMapEditor::~TileMapEditor() {
+ _clear_bucket_cache();
+}
+
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
@@ -1490,7 +1560,7 @@ void TileMapEditorPlugin::edit(Object *p_object) {
bool TileMapEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("TileMap");
+ return p_object->is_class("TileMap");
}
void TileMapEditorPlugin::make_visible(bool p_visible) {
@@ -1509,9 +1579,10 @@ void TileMapEditorPlugin::make_visible(bool p_visible) {
TileMapEditorPlugin::TileMapEditorPlugin(EditorNode *p_node) {
- EDITOR_DEF("tile_map/preview_size",64);
- EDITOR_DEF("tile_map/palette_item_hseparation",8);
- EDITOR_DEF("tile_map/show_tile_names", true);
+ EDITOR_DEF("editors/tile_map/preview_size",64);
+ EDITOR_DEF("editors/tile_map/palette_item_hseparation",8);
+ EDITOR_DEF("editors/tile_map/show_tile_names", true);
+ EDITOR_DEF("editors/tile_map/bucket_fill_preview", true);
tile_map_editor = memnew( TileMapEditor(p_node) );
add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE, tile_map_editor);
diff --git a/tools/editor/plugins/tile_map_editor_plugin.h b/tools/editor/plugins/tile_map_editor_plugin.h
index 2f24002770..08032d9afd 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.h
+++ b/tools/editor/plugins/tile_map_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -44,7 +44,7 @@
class TileMapEditor : public VBoxContainer {
- OBJ_TYPE(TileMapEditor, VBoxContainer );
+ GDCLASS(TileMapEditor, VBoxContainer );
enum Tool {
@@ -106,6 +106,11 @@ class TileMapEditor : public VBoxContainer {
Point2i over_tile;
+ bool * bucket_cache_visited;
+ Rect2i bucket_cache_rect;
+ int bucket_cache_tile;
+ PoolVector<Vector2> bucket_cache;
+
struct CellOp {
int idx;
bool xf;
@@ -129,14 +134,17 @@ class TileMapEditor : public VBoxContainer {
void _pick_tile(const Point2& p_pos);
- DVector<Vector2> _bucket_fill(const Point2i& p_start, bool erase=false);
+ PoolVector<Vector2> _bucket_fill(const Point2i& p_start, bool erase=false, bool preview=false);
- void _fill_points(const DVector<Vector2> p_points, const Dictionary& p_op);
- void _erase_points(const DVector<Vector2> p_points);
+ void _fill_points(const PoolVector<Vector2> p_points, const Dictionary& p_op);
+ void _erase_points(const PoolVector<Vector2> p_points);
void _select(const Point2i& p_from, const Point2i& p_to);
- void _draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Matrix32& p_xform);
+ void _draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Transform2D& p_xform);
+ void _draw_fill_preview(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Transform2D& p_xform);
+ void _clear_bucket_cache();
+
void _update_copydata();
int get_selected_tile() const;
@@ -167,21 +175,22 @@ public:
HBoxContainer *get_toolbar() const { return toolbar; }
- bool forward_input_event(const InputEvent& p_event);
+ bool forward_gui_input(const InputEvent& p_event);
void edit(Node *p_tile_map);
TileMapEditor(EditorNode *p_editor);
+ ~TileMapEditor();
};
class TileMapEditorPlugin : public EditorPlugin {
- OBJ_TYPE( TileMapEditorPlugin, EditorPlugin );
+ GDCLASS( TileMapEditorPlugin, EditorPlugin );
TileMapEditor *tile_map_editor;
public:
- virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return tile_map_editor->forward_input_event(p_event); }
+ virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return tile_map_editor->forward_gui_input(p_event); }
virtual String get_name() const { return "TileMap"; }
bool has_main_screen() const { return false; }
diff --git a/tools/editor/plugins/tile_set_editor_plugin.cpp b/tools/editor/plugins/tile_set_editor_plugin.cpp
index 39a15189e7..bb6236a6d6 100644
--- a/tools/editor/plugins/tile_set_editor_plugin.cpp
+++ b/tools/editor/plugins/tile_set_editor_plugin.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -76,6 +76,8 @@ void TileSetEditor::_import_scene(Node *scene, Ref<TileSet> p_library, bool p_me
p_library->tile_set_texture(id,texture);
p_library->tile_set_material(id,material);
+ p_library->tile_set_modulate(id,mi->get_modulate());
+
Vector2 phys_offset;
Size2 s;
@@ -221,9 +223,9 @@ Error TileSetEditor::update_library_file(Node *p_base_scene, Ref<TileSet> ml,boo
void TileSetEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_menu_cbk",&TileSetEditor::_menu_cbk);
- ObjectTypeDB::bind_method("_menu_confirm",&TileSetEditor::_menu_confirm);
- ObjectTypeDB::bind_method("_name_dialog_confirm",&TileSetEditor::_name_dialog_confirm);
+ ClassDB::bind_method("_menu_cbk",&TileSetEditor::_menu_cbk);
+ ClassDB::bind_method("_menu_confirm",&TileSetEditor::_menu_confirm);
+ ClassDB::bind_method("_name_dialog_confirm",&TileSetEditor::_name_dialog_confirm);
}
TileSetEditor::TileSetEditor(EditorNode *p_editor) {
@@ -240,7 +242,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Create from Scene"),MENU_OPTION_CREATE_FROM_SCENE);
options->get_popup()->add_item(TTR("Merge from Scene"),MENU_OPTION_MERGE_FROM_SCENE);
- options->get_popup()->connect("item_pressed", this,"_menu_cbk");
+ options->get_popup()->connect("id_pressed", this,"_menu_cbk");
editor=p_editor;
cd = memnew(ConfirmationDialog);
add_child(cd);
@@ -268,7 +270,7 @@ void TileSetEditorPlugin::edit(Object *p_node) {
bool TileSetEditorPlugin::handles(Object *p_node) const{
- return p_node->is_type("TileSet");
+ return p_node->is_class("TileSet");
}
void TileSetEditorPlugin::make_visible(bool p_visible){
diff --git a/tools/editor/plugins/tile_set_editor_plugin.h b/tools/editor/plugins/tile_set_editor_plugin.h
index 3f47520e2a..7fec7fa162 100644
--- a/tools/editor/plugins/tile_set_editor_plugin.h
+++ b/tools/editor/plugins/tile_set_editor_plugin.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -38,7 +38,7 @@
class TileSetEditor : public Control {
- OBJ_TYPE( TileSetEditor, Control );
+ GDCLASS( TileSetEditor, Control );
Ref<TileSet> tileset;
@@ -78,7 +78,7 @@ public:
class TileSetEditorPlugin : public EditorPlugin {
- OBJ_TYPE( TileSetEditorPlugin, EditorPlugin );
+ GDCLASS( TileSetEditorPlugin, EditorPlugin );
TileSetEditor *tileset_editor;
EditorNode *editor;
diff --git a/tools/editor/progress_dialog.cpp b/tools/editor/progress_dialog.cpp
index a950f7acfc..03303b8c48 100644
--- a/tools/editor/progress_dialog.cpp
+++ b/tools/editor/progress_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -42,7 +42,7 @@ void BackgroundProgress::_add_task(const String& p_task,const String& p_label, i
t.hb->add_child(l);
t.progress = memnew( ProgressBar );
t.progress->set_max(p_steps);
- t.progress->set_val(p_steps);
+ t.progress->set_value(p_steps);
Control *ec = memnew( Control );
ec->set_h_size_flags(SIZE_EXPAND_FILL);
ec->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -83,9 +83,9 @@ void BackgroundProgress::_task_step(const String& p_task, int p_step){
Task &t=tasks[p_task];
if (p_step<0)
- t.progress->set_val(t.progress->get_val()+1);
+ t.progress->set_value(t.progress->get_value()+1);
else
- t.progress->set_val(p_step);
+ t.progress->set_value(p_step);
}
void BackgroundProgress::_end_task(const String& p_task){
@@ -101,10 +101,10 @@ void BackgroundProgress::_end_task(const String& p_task){
void BackgroundProgress::_bind_methods(){
- ObjectTypeDB::bind_method("_add_task",&BackgroundProgress::_add_task);
- ObjectTypeDB::bind_method("_task_step",&BackgroundProgress::_task_step);
- ObjectTypeDB::bind_method("_end_task",&BackgroundProgress::_end_task);
- ObjectTypeDB::bind_method("_update",&BackgroundProgress::_update);
+ ClassDB::bind_method("_add_task",&BackgroundProgress::_add_task);
+ ClassDB::bind_method("_task_step",&BackgroundProgress::_task_step);
+ ClassDB::bind_method("_end_task",&BackgroundProgress::_end_task);
+ ClassDB::bind_method("_update",&BackgroundProgress::_update);
}
@@ -182,7 +182,7 @@ void ProgressDialog::add_task(const String& p_task,const String& p_label,int p_s
t.vb->add_margin_child(p_label,vb2);
t.progress = memnew( ProgressBar );
t.progress->set_max(p_steps);
- t.progress->set_val(p_steps);
+ t.progress->set_value(p_steps);
vb2->add_child(t.progress);
t.state=memnew( Label );
t.state->set_clip_text(true);
@@ -206,9 +206,9 @@ void ProgressDialog::task_step(const String& p_task, const String& p_state, int
Task &t=tasks[p_task];
if (p_step<0)
- t.progress->set_val(t.progress->get_val()+1);
+ t.progress->set_value(t.progress->get_value()+1);
else
- t.progress->set_val(p_step);
+ t.progress->set_value(p_step);
t.state->set_text(p_state);
last_progress_tick=OS::get_singleton()->get_ticks_usec();
diff --git a/tools/editor/progress_dialog.h b/tools/editor/progress_dialog.h
index c254d45753..60acf825a9 100644
--- a/tools/editor/progress_dialog.h
+++ b/tools/editor/progress_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,7 +37,7 @@
class BackgroundProgress : public HBoxContainer {
- OBJ_TYPE(BackgroundProgress,HBoxContainer);
+ GDCLASS(BackgroundProgress,HBoxContainer);
_THREAD_SAFE_CLASS_
@@ -72,7 +72,7 @@ public:
class ProgressDialog : public Popup {
- OBJ_TYPE( ProgressDialog, Popup );
+ GDCLASS( ProgressDialog, Popup );
struct Task {
String task;
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index 103962716b..10005b6850 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -67,14 +67,14 @@ bool ProjectExportDialog::_create_tree(TreeItem *p_parent,EditorFileSystemDirect
has_items=true;
}
-// int cc = p_options.get_slice_count(",");
+ //int cc = p_options.get_slice_count(",");
for (int i=0;i<p_dir->get_file_count();i++) {
TreeItem *fitem = tree->create_item(item);
//fitem->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
//fitem->set_editable(0,true);
- // fitem->set_checked(0,isfave);
+ //fitem->set_checked(0,isfave);
fitem->set_text(0,p_dir->get_file(i));
String path = p_dir->get_file_path(i);
fitem->set_tooltip(0,path);
@@ -164,8 +164,8 @@ void ProjectExportDialog::_platform_selected() {
String p =platforms->get_selected()->get_metadata(0);
_update_platform();
-// editor->save_import_export();
-// EditorFileSystem::get_singleton()->scan();
+ //editor->save_import_export();
+ //EditorFileSystem::get_singleton()->scan();
}
@@ -176,7 +176,7 @@ void ProjectExportDialog::_scan_finished() {
print_line("**********SCAN DONEEE********");
print_line("**********SCAN DONEEE********");*/
- if (!is_visible()) {
+ if (!is_visible_in_tree()) {
pending_update_tree=true;
return;
}
@@ -274,7 +274,7 @@ void ProjectExportDialog::_script_edited(Variant v) {
void ProjectExportDialog::_sample_convert_edited(int what) {
EditorImportExport::get_singleton()->sample_set_action( EditorImportExport::SampleAction(sample_mode->get_selected()));
- EditorImportExport::get_singleton()->sample_set_max_hz( sample_max_hz->get_val() );
+ EditorImportExport::get_singleton()->sample_set_max_hz( sample_max_hz->get_value() );
EditorImportExport::get_singleton()->sample_set_trim( sample_trim->is_pressed() );
_save_export_cfg();
@@ -288,7 +288,7 @@ void ProjectExportDialog::_notification(int p_what) {
CenterContainer *cc = memnew( CenterContainer );
- TextureFrame *tf = memnew( TextureFrame);
+ TextureRect *tf = memnew( TextureRect);
tf->set_texture(get_icon("ErrorSign","EditorIcons"));
cc->add_child(tf);
plat_errors->add_child(cc);
@@ -313,7 +313,7 @@ void ProjectExportDialog::_notification(int p_what) {
}
EditorFileSystem::get_singleton()->connect("filesystem_changed",this,"_scan_finished");
-// _rescan();
+ //_rescan();
_update_platform();
export_mode->select( EditorImportExport::get_singleton()->get_export_filter() );
convert_text_scenes->set_pressed( EditorImportExport::get_singleton()->get_convert_text_scenes() );
@@ -325,8 +325,8 @@ void ProjectExportDialog::_notification(int p_what) {
tree_vb->show();
image_action->select(EditorImportExport::get_singleton()->get_export_image_action());
- image_quality->set_val(EditorImportExport::get_singleton()->get_export_image_quality());
- image_shrink->set_val(EditorImportExport::get_singleton()->get_export_image_shrink());
+ image_quality->set_value(EditorImportExport::get_singleton()->get_export_image_quality());
+ image_shrink->set_value(EditorImportExport::get_singleton()->get_export_image_shrink());
_update_script();
@@ -343,14 +343,14 @@ void ProjectExportDialog::_notification(int p_what) {
}
image_formats->connect("item_edited",this,"_format_toggled");
group_add->set_icon(get_icon("Add","EditorIcons"));
-// group_del->set_icon(get_icon("Del","EditorIcons"));
+ //group_del->set_icon(get_icon("Del","EditorIcons"));
_update_group_list();
_update_group();
_update_group_tree();
sample_mode->select( EditorImportExport::get_singleton()->sample_get_action() );
- sample_max_hz->set_val( EditorImportExport::get_singleton()->sample_get_max_hz() );
+ sample_max_hz->set_value( EditorImportExport::get_singleton()->sample_get_max_hz() );
sample_trim->set_pressed( EditorImportExport::get_singleton()->sample_get_trim() );
sample_mode->connect("item_selected",this,"_sample_convert_edited");
@@ -368,7 +368,7 @@ void ProjectExportDialog::_notification(int p_what) {
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
- if (is_visible())
+ if (is_visible_in_tree())
_validate_platform();
} break;
@@ -448,7 +448,7 @@ void ProjectExportDialog::_export_mode_changed(int p_idx) {
void ProjectExportDialog::_export_action(const String& p_file) {
- String location = Globals::get_singleton()->globalize_path(p_file).get_base_dir().replace("\\","/");
+ String location = GlobalConfig::get_singleton()->globalize_path(p_file).get_base_dir().replace("\\","/");
while(true) {
@@ -589,6 +589,11 @@ void ProjectExportDialog::custom_action(const String&) {
return;
}
+ if (platform.to_lower()=="android" && _check_android_setting(exporter)==false){
+ // not filled all field for Android release
+ return;
+ }
+
String extension = exporter->get_binary_extension();
file_export_password->set_editable( exporter->requires_password(exporter->is_debugging_enabled()) );
@@ -602,6 +607,204 @@ void ProjectExportDialog::custom_action(const String&) {
}
+LineEdit* ProjectExportDialog::_create_keystore_input(Control* container, const String& p_label, const String& name) {
+
+ HBoxContainer* hb=memnew(HBoxContainer);
+ Label* lb=memnew(Label);
+ LineEdit* input=memnew(LineEdit);
+
+ lb->set_text(p_label);
+ lb->set_custom_minimum_size(Size2(140*EDSCALE,0));
+ lb->set_align(Label::ALIGN_RIGHT);
+
+ input->set_custom_minimum_size(Size2(170*EDSCALE,0));
+ input->set_name(name);
+
+ hb->add_constant_override("separation", 10*EDSCALE);
+ hb->add_child(lb);
+ hb->add_child(input);
+ container->add_child(hb);
+
+ return input;
+
+}
+
+void ProjectExportDialog::_create_android_keystore_window() {
+
+ keystore_file_dialog = memnew( EditorFileDialog );
+ add_child(keystore_file_dialog);
+ keystore_file_dialog->set_mode(EditorFileDialog::MODE_OPEN_DIR);
+ keystore_file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
+ keystore_file_dialog->set_current_dir( "res://" );
+
+ keystore_file_dialog->set_title(TTR("Target Path:"));
+ keystore_file_dialog->connect("dir_selected", this,"_keystore_dir_selected");
+
+ keystore_create_dialog=memnew(ConfirmationDialog);
+ VBoxContainer* vb=memnew(VBoxContainer);
+ vb->set_size(Size2(340*EDSCALE,0));
+ keystore_create_dialog->set_title(TTR("Create Android keystore"));
+
+ _create_keystore_input(vb, TTR("Full name"), "name");
+ _create_keystore_input(vb, TTR("Organizational unit"), "unit");
+ _create_keystore_input(vb, TTR("Organization"), "org");
+ _create_keystore_input(vb, TTR("City"), "city");
+ _create_keystore_input(vb, TTR("State"), "state");
+ _create_keystore_input(vb, TTR("2 letter country code"), "code");
+ _create_keystore_input(vb, TTR("User alias"), "alias");
+ LineEdit* pass=_create_keystore_input(vb, TTR("Password"), "pass");
+ pass->set_placeholder(TTR("at least 6 characters"));
+ _create_keystore_input(vb, TTR("File name"), "file");
+
+ Label* lb_path=memnew(Label);
+ LineEdit* path=memnew(LineEdit);
+ Button* btn=memnew(Button);
+ HBoxContainer* hb=memnew(HBoxContainer);
+
+ lb_path->set_text(TTR("Path : (better to save outside of project)"));
+ path->set_h_size_flags(SIZE_EXPAND_FILL);
+ path->set_name("path");
+ btn->set_text(" .. ");
+ btn->connect("pressed", keystore_file_dialog, "popup_centered_ratio");
+
+ vb->add_spacer();
+ vb->add_child(lb_path);
+ hb->add_child(path);
+ hb->add_child(btn);
+ vb->add_child(hb);
+
+ keystore_create_dialog->add_child(vb);
+ //keystore_create_dialog->set_child_rect(vb);
+ add_child(keystore_create_dialog);
+
+ keystore_create_dialog->connect("confirmed", this, "_create_android_keystore");
+ path->connect("text_changed", this, "_check_keystore_path");
+
+ confirm_keystore = memnew(ConfirmationDialog);
+ confirm_keystore->connect("confirmed", keystore_create_dialog, "popup_centered_minsize");
+ add_child(confirm_keystore);
+
+}
+
+void ProjectExportDialog::_keystore_dir_selected(const String& path) {
+
+ LineEdit* edit=keystore_create_dialog->find_node("path", true, false)->cast_to<LineEdit>();
+ edit->set_text(path.simplify_path());
+
+}
+
+void ProjectExportDialog::_keystore_created() {
+
+ if (error->is_connected("popup_hide", this, "_keystore_created")){
+ error->disconnect("popup_hide", this, "_keystore_created");
+ }
+ custom_action("export_pck");
+
+}
+
+void ProjectExportDialog::_check_keystore_path(const String& path) {
+
+ LineEdit* edit=keystore_create_dialog->find_node("path", true, false)->cast_to<LineEdit>();
+ bool exists = DirAccess::exists(path);
+ if (!exists) {
+ edit->add_color_override("font_color", Color(1,0,0,1));
+ } else {
+ edit->add_color_override("font_color", Color(0,1,0,1));
+ }
+
+}
+
+void ProjectExportDialog::_create_android_keystore() {
+
+ Vector<String> names=String("name,unit,org,city,state,code,alias,pass").split(",");
+ String path=keystore_create_dialog->find_node("path", true, false)->cast_to<LineEdit>()->get_text();
+ String file=keystore_create_dialog->find_node("file", true, false)->cast_to<LineEdit>()->get_text();
+
+ if (file.ends_with(".keystore")==false) {
+ file+=".keystore";
+ }
+ String fullpath=path.plus_file(file);
+ String info="CN=$name, OU=$unit, O=$org, L=$city, S=$state, C=$code";
+ Dictionary dic;
+
+ for (int i=0;i<names.size();i++){
+ LineEdit* edit = keystore_create_dialog->find_node(names[i], true, false)->cast_to<LineEdit>();
+ dic[names[i]]=edit->get_text();
+ info=info.replace("$"+names[i], edit->get_text());
+ }
+
+ String jarsigner=EditorSettings::get_singleton()->get("export/android/jarsigner");
+ String keytool=jarsigner.get_base_dir().plus_file("keytool");
+ String os_name=OS::get_singleton()->get_name();
+ if (os_name.to_lower()=="windows") {
+ keytool+=".exe";
+ }
+
+ bool exist=FileAccess::exists(keytool);
+ if (!exist) {
+ error->set_text("Can't find 'keytool'");
+ error->popup_centered_minsize();
+ return;
+ }
+
+ List<String> args;
+ args.push_back("-genkey");
+ args.push_back("-v");
+ args.push_back("-keystore");
+ args.push_back(fullpath);
+ args.push_back("-alias");
+ args.push_back(dic["alias"]);
+ args.push_back("-storepass");
+ args.push_back(dic["pass"]);
+ args.push_back("-keypass");
+ args.push_back(dic["pass"]);
+ args.push_back("-keyalg");
+ args.push_back("RSA");
+ args.push_back("-keysize");
+ args.push_back("2048");
+ args.push_back("-validity");
+ args.push_back("10000");
+ args.push_back("-dname");
+ args.push_back(info);
+ int retval;
+ OS::get_singleton()->execute(keytool,args,true,NULL,NULL,&retval);
+
+ if (retval==0) { // success
+ platform_options->_edit_set("keystore/release", fullpath);
+ platform_options->_edit_set("keystore/release_user", dic["alias"]);
+ platform_options->_edit_set("keystore/release_password", dic["pass"]);
+
+ error->set_text("Android keystore created at \n"+fullpath);
+ error->connect("popup_hide", this, "_keystore_created");
+ error->popup_centered_minsize();
+ } else { // fail
+ error->set_text("Fail to create android keystore at \n"+fullpath);
+ error->popup_centered_minsize();
+ }
+
+}
+
+bool ProjectExportDialog::_check_android_setting(const Ref<EditorExportPlatform>& exporter) {
+
+ bool is_debugging = exporter->get("debug/debugging_enabled");
+ String release = exporter->get("keystore/release");
+ String user = exporter->get("keystore/release_user");
+ String password = exporter->get("keystore/release_password");
+
+ if (!is_debugging && (release=="" || user=="" || password=="")){
+ if (release==""){
+ confirm_keystore->set_text(TTR("Release keystore is not set.\nDo you want to create one?"));
+ confirm_keystore->popup_centered_minsize();
+ } else {
+ error->set_text(TTR("Fill Keystore/Release User and Release Password"));
+ error->popup_centered_minsize();
+ }
+ return false;
+ }
+
+ return true;
+
+}
void ProjectExportDialog::_group_selected() {
@@ -683,8 +886,8 @@ void ProjectExportDialog::_update_group() {
StringName name = _get_selected_group();
group_image_action->select(EditorImportExport::get_singleton()->image_export_group_get_image_action(name));
group_atlas->set_pressed(EditorImportExport::get_singleton()->image_export_group_get_make_atlas(name));
- group_shrink->set_val(EditorImportExport::get_singleton()->image_export_group_get_shrink(name));
- group_lossy_quality->set_val(EditorImportExport::get_singleton()->image_export_group_get_lossy_quality(name));
+ group_shrink->set_value(EditorImportExport::get_singleton()->image_export_group_get_shrink(name));
+ group_lossy_quality->set_value(EditorImportExport::get_singleton()->image_export_group_get_lossy_quality(name));
if (group_atlas->is_pressed())
atlas_preview->show();
else
@@ -718,7 +921,7 @@ bool ProjectExportDialog::_update_group_treef(TreeItem *p_parent,EditorFileSyste
for(int i=0;i<p_dir->get_file_count();i++) {
String fname = p_dir->get_file(i);
- if (p_extensions.has(fname.to_lower().extension())) {
+ if (p_extensions.has(fname.to_lower().get_extension())) {
String path = p_dir->get_file_path(i);
if (filter!=String() && path.find(filter)==-1)
@@ -806,8 +1009,8 @@ void ProjectExportDialog::_group_changed(Variant v) {
EditorNode::get_undo_redo()->create_action(TTR("Change Image Group"));
EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_image_action",name,group_image_action->get_selected());
EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_make_atlas",name,group_atlas->is_pressed());
- EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,group_shrink->get_val());
- EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_lossy_quality",name,group_lossy_quality->get_val());
+ EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,group_shrink->get_value());
+ EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_lossy_quality",name,group_lossy_quality->get_value());
EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_image_action",name,EditorImportExport::get_singleton()->image_export_group_get_image_action(name));
EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_make_atlas",name,EditorImportExport::get_singleton()->image_export_group_get_make_atlas(name));
EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,EditorImportExport::get_singleton()->image_export_group_get_shrink(name));
@@ -1040,11 +1243,11 @@ void ProjectExportDialog::_group_atlas_preview() {
int flags=0;
- if (Globals::get_singleton()->get("image_loader/filter"))
+ if (GlobalConfig::get_singleton()->get("image_loader/filter"))
flags|=EditorTextureImportPlugin::IMAGE_FLAG_FILTER;
- if (!Globals::get_singleton()->get("image_loader/gen_mipmaps"))
+ if (!GlobalConfig::get_singleton()->get("image_loader/gen_mipmaps"))
flags|=EditorTextureImportPlugin::IMAGE_FLAG_NO_MIPMAPS;
- if (!Globals::get_singleton()->get("image_loader/repeat"))
+ if (!GlobalConfig::get_singleton()->get("image_loader/repeat"))
flags|=EditorTextureImportPlugin::IMAGE_FLAG_REPEAT;
flags|=EditorTextureImportPlugin::IMAGE_FLAG_FIX_BORDER_ALPHA;
@@ -1089,44 +1292,48 @@ void ProjectExportDialog::_image_filter_changed(String) {
void ProjectExportDialog::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_rescan"),&ProjectExportDialog::_rescan);
- ObjectTypeDB::bind_method(_MD("_tree_changed"),&ProjectExportDialog::_tree_changed);
- ObjectTypeDB::bind_method(_MD("_scan_finished"),&ProjectExportDialog::_scan_finished);
- ObjectTypeDB::bind_method(_MD("_platform_selected"),&ProjectExportDialog::_platform_selected);
- ObjectTypeDB::bind_method(_MD("_prop_edited"),&ProjectExportDialog::_prop_edited);
- ObjectTypeDB::bind_method(_MD("_export_mode_changed"),&ProjectExportDialog::_export_mode_changed);
- ObjectTypeDB::bind_method(_MD("_filters_edited"),&ProjectExportDialog::_filters_edited);
- ObjectTypeDB::bind_method(_MD("_filters_exclude_edited"),&ProjectExportDialog::_filters_exclude_edited);
- ObjectTypeDB::bind_method(_MD("_export_action"),&ProjectExportDialog::_export_action);
- ObjectTypeDB::bind_method(_MD("_export_action_pck"),&ProjectExportDialog::_export_action_pck);
- ObjectTypeDB::bind_method(_MD("_quality_edited"),&ProjectExportDialog::_quality_edited);
- ObjectTypeDB::bind_method(_MD("_shrink_edited"),&ProjectExportDialog::_shrink_edited);
- ObjectTypeDB::bind_method(_MD("_image_export_edited"),&ProjectExportDialog::_image_export_edited);
- ObjectTypeDB::bind_method(_MD("_format_toggled"),&ProjectExportDialog::_format_toggled);
- ObjectTypeDB::bind_method(_MD("_group_changed"),&ProjectExportDialog::_group_changed);
- ObjectTypeDB::bind_method(_MD("_group_add"),&ProjectExportDialog::_group_add);
- ObjectTypeDB::bind_method(_MD("_group_del"),&ProjectExportDialog::_group_del);
- ObjectTypeDB::bind_method(_MD("_group_selected"),&ProjectExportDialog::_group_selected);
- ObjectTypeDB::bind_method(_MD("_update_group"),&ProjectExportDialog::_update_group);
- ObjectTypeDB::bind_method(_MD("_update_group_list"),&ProjectExportDialog::_update_group_list);
- ObjectTypeDB::bind_method(_MD("_select_group"),&ProjectExportDialog::_select_group);
- ObjectTypeDB::bind_method(_MD("_update_group_tree"),&ProjectExportDialog::_update_group_tree);
- ObjectTypeDB::bind_method(_MD("_group_item_edited"),&ProjectExportDialog::_group_item_edited);
- ObjectTypeDB::bind_method(_MD("_save_export_cfg"),&ProjectExportDialog::_save_export_cfg);
- ObjectTypeDB::bind_method(_MD("_image_filter_changed"),&ProjectExportDialog::_image_filter_changed);
- ObjectTypeDB::bind_method(_MD("_group_atlas_preview"),&ProjectExportDialog::_group_atlas_preview);
- ObjectTypeDB::bind_method(_MD("_group_select_all"),&ProjectExportDialog::_group_select_all);
- ObjectTypeDB::bind_method(_MD("_group_select_none"),&ProjectExportDialog::_group_select_none);
- ObjectTypeDB::bind_method(_MD("_script_edited"),&ProjectExportDialog::_script_edited);
- ObjectTypeDB::bind_method(_MD("_update_script"),&ProjectExportDialog::_update_script);
- ObjectTypeDB::bind_method(_MD("_sample_convert_edited"),&ProjectExportDialog::_sample_convert_edited);
-
-
- ObjectTypeDB::bind_method(_MD("export_platform"),&ProjectExportDialog::export_platform);
-
-
-// ADD_SIGNAL(MethodInfo("instance"));
-// ADD_SIGNAL(MethodInfo("open"));
+ ClassDB::bind_method(_MD("_rescan"),&ProjectExportDialog::_rescan);
+ ClassDB::bind_method(_MD("_tree_changed"),&ProjectExportDialog::_tree_changed);
+ ClassDB::bind_method(_MD("_scan_finished"),&ProjectExportDialog::_scan_finished);
+ ClassDB::bind_method(_MD("_platform_selected"),&ProjectExportDialog::_platform_selected);
+ ClassDB::bind_method(_MD("_prop_edited"),&ProjectExportDialog::_prop_edited);
+ ClassDB::bind_method(_MD("_export_mode_changed"),&ProjectExportDialog::_export_mode_changed);
+ ClassDB::bind_method(_MD("_filters_edited"),&ProjectExportDialog::_filters_edited);
+ ClassDB::bind_method(_MD("_filters_exclude_edited"),&ProjectExportDialog::_filters_exclude_edited);
+ ClassDB::bind_method(_MD("_export_action"),&ProjectExportDialog::_export_action);
+ ClassDB::bind_method(_MD("_export_action_pck"),&ProjectExportDialog::_export_action_pck);
+ ClassDB::bind_method(_MD("_quality_edited"),&ProjectExportDialog::_quality_edited);
+ ClassDB::bind_method(_MD("_shrink_edited"),&ProjectExportDialog::_shrink_edited);
+ ClassDB::bind_method(_MD("_image_export_edited"),&ProjectExportDialog::_image_export_edited);
+ ClassDB::bind_method(_MD("_format_toggled"),&ProjectExportDialog::_format_toggled);
+ ClassDB::bind_method(_MD("_group_changed"),&ProjectExportDialog::_group_changed);
+ ClassDB::bind_method(_MD("_group_add"),&ProjectExportDialog::_group_add);
+ ClassDB::bind_method(_MD("_group_del"),&ProjectExportDialog::_group_del);
+ ClassDB::bind_method(_MD("_group_selected"),&ProjectExportDialog::_group_selected);
+ ClassDB::bind_method(_MD("_update_group"),&ProjectExportDialog::_update_group);
+ ClassDB::bind_method(_MD("_update_group_list"),&ProjectExportDialog::_update_group_list);
+ ClassDB::bind_method(_MD("_select_group"),&ProjectExportDialog::_select_group);
+ ClassDB::bind_method(_MD("_update_group_tree"),&ProjectExportDialog::_update_group_tree);
+ ClassDB::bind_method(_MD("_group_item_edited"),&ProjectExportDialog::_group_item_edited);
+ ClassDB::bind_method(_MD("_save_export_cfg"),&ProjectExportDialog::_save_export_cfg);
+ ClassDB::bind_method(_MD("_image_filter_changed"),&ProjectExportDialog::_image_filter_changed);
+ ClassDB::bind_method(_MD("_group_atlas_preview"),&ProjectExportDialog::_group_atlas_preview);
+ ClassDB::bind_method(_MD("_group_select_all"),&ProjectExportDialog::_group_select_all);
+ ClassDB::bind_method(_MD("_group_select_none"),&ProjectExportDialog::_group_select_none);
+ ClassDB::bind_method(_MD("_script_edited"),&ProjectExportDialog::_script_edited);
+ ClassDB::bind_method(_MD("_update_script"),&ProjectExportDialog::_update_script);
+ ClassDB::bind_method(_MD("_sample_convert_edited"),&ProjectExportDialog::_sample_convert_edited);
+
+
+ ClassDB::bind_method(_MD("export_platform"),&ProjectExportDialog::export_platform);
+ ClassDB::bind_method(_MD("_create_android_keystore"),&ProjectExportDialog::_create_android_keystore);
+ ClassDB::bind_method(_MD("_check_keystore_path"),&ProjectExportDialog::_check_keystore_path);
+ ClassDB::bind_method(_MD("_keystore_dir_selected"),&ProjectExportDialog::_keystore_dir_selected);
+ ClassDB::bind_method(_MD("_keystore_created"),&ProjectExportDialog::_keystore_created);
+
+
+ //ADD_SIGNAL(MethodInfo("instance"));
+ //ADD_SIGNAL(MethodInfo("open"));
}
@@ -1138,7 +1345,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
sections = memnew( TabContainer );
add_child(sections);
- set_child_rect(sections);
+ //set_child_rect(sections);
VBoxContainer *pvbox = memnew( VBoxContainer );
sections->add_child(pvbox);
@@ -1309,7 +1516,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
group_lossy_quality->set_min(0.1);
group_lossy_quality->set_max(1.0);
group_lossy_quality->set_step(0.01);
- group_lossy_quality->set_val(0.7);
+ group_lossy_quality->set_value(0.7);
group_lossy_quality->connect("value_changed",this,"_quality_edited");
HBoxContainer *gqhb = memnew( HBoxContainer );
@@ -1328,7 +1535,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
group_shrink = memnew(SpinBox);
group_shrink->set_min(1);
group_shrink->set_max(8);
- group_shrink->set_val(1);
+ group_shrink->set_value(1);
group_shrink->set_step(0.001);
group_options->add_margin_child(TTR("Shrink By:"),group_shrink);
group_shrink->connect("value_changed",this,"_group_changed");
@@ -1370,8 +1577,8 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
atlas_preview_dialog = memnew( AcceptDialog );
ScrollContainer *scroll = memnew( ScrollContainer );
atlas_preview_dialog->add_child(scroll);
- atlas_preview_dialog->set_child_rect(scroll);
- atlas_preview_frame = memnew( TextureFrame );
+ //atlas_preview_dialog->set_child_rect(scroll);
+ atlas_preview_frame = memnew( TextureRect );
scroll->add_child(atlas_preview_frame);
add_child(atlas_preview_dialog);
@@ -1454,7 +1661,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
file_export = memnew( EditorFileDialog );
add_child(file_export);
file_export->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
- file_export->set_current_dir( EditorSettings::get_singleton()->get("global/default_project_export_path") );
+ file_export->set_current_dir( EditorSettings::get_singleton()->get("filesystem/directories/default_project_export_path") );
file_export->set_title(TTR("Export Project"));
file_export->connect("file_selected", this,"_export_action");
@@ -1466,7 +1673,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
pck_export = memnew( EditorFileDialog );
pck_export->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
- pck_export->set_current_dir( EditorSettings::get_singleton()->get("global/default_project_export_path") );
+ pck_export->set_current_dir( EditorSettings::get_singleton()->get("filesystem/directories/default_project_export_path") );
pck_export->set_title(TTR("Export Project PCK"));
pck_export->connect("file_selected", this,"_export_action_pck");
pck_export->add_filter("*.pck ; Data Pack");
@@ -1479,6 +1686,8 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
ei="EditorIcons";
ot="Object";
pending_update_tree=true;
+
+ _create_android_keystore_window();
}
@@ -1493,7 +1702,7 @@ void ProjectExport::popup_export() {
presets.insert("default");
List<PropertyInfo> pi;
- Globals::get_singleton()->get_property_list(&pi);
+ GlobalConfig::get_singleton()->get_property_list(&pi);
export_preset->clear();
for (List<PropertyInfo>::Element *E=pi.front();E;E=E->next()) {
@@ -1523,8 +1732,8 @@ Error ProjectExport::export_project(const String& p_preset) {
String selected=p_preset;
- DVector<String> preset_settings = Globals::get_singleton()->get("export_presets/"+selected);
- String preset_path=Globals::get_singleton()->get("export_presets_path/"+selected);
+ PoolVector<String> preset_settings = GlobalConfig::get_singleton()->get("export_presets/"+selected);
+ String preset_path=GlobalConfig::get_singleton()->get("export_presets_path/"+selected);
if (preset_path=="") {
error->set_text("Export path empty, see export options");
@@ -1566,11 +1775,13 @@ Error ProjectExport::export_project(const String& p_preset) {
{
List<String> l;
-// SceneLoader::get_recognized_extensions(&l);
-// for(List<String>::Element *E=l.front();E;E=E->next()) {
-//
-// scene_extensions.insert(E->get());
-// }
+ /*
+ SceneLoader::get_recognized_extensions(&l);
+ for(List<String>::Element *E=l.front();E;E=E->next()) {
+
+ scene_extensions.insert(E->get());
+ }
+ */
ResourceLoader::get_recognized_extensions_for_type("",&l);
for(List<String>::Element *E=l.front();E;E=E->next()) {
@@ -1578,7 +1789,7 @@ Error ProjectExport::export_project(const String& p_preset) {
}
}
- Vector<String> names = Globals::get_singleton()->get_optimizer_presets();
+ Vector<String> names = GlobalConfig::get_singleton()->get_optimizer_presets();
//prepare base paths
@@ -1688,7 +1899,7 @@ Error ProjectExport::export_project(const String& p_preset) {
print_line("Exporting "+itos(idx)+"/"+itos(export_action.size())+": "+path);
- String base_dir = Globals::get_singleton()->localize_path(path.get_base_dir()).replace("\\","/").replace("res://","");
+ String base_dir = GlobalConfig::get_singleton()->localize_path(path.get_base_dir()).replace("\\","/").replace("res://","");
DirAccess *da=DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
String cwd = d->get_current_dir();
da->change_dir(cwd);
@@ -1738,14 +1949,14 @@ Error ProjectExport::export_project(const String& p_preset) {
delete_source=true;
//create an optimized source file
- if (!Globals::get_singleton()->has("optimizer_presets/"+preset)) {
+ if (!GlobalConfig::get_singleton()->has("optimizer_presets/"+preset)) {
memdelete(d);
ERR_EXPLAIN("Unknown optimizer preset: "+preset);
ERR_FAIL_V(ERR_INVALID_DATA);
}
- Dictionary dc = Globals::get_singleton()->get("optimizer_presets/"+preset);
+ Dictionary dc = GlobalConfig::get_singleton()->get("optimizer_presets/"+preset);
ERR_FAIL_COND_V(!dc.has("__type__"),ERR_INVALID_DATA);
String type=dc["__type__"];
@@ -1785,8 +1996,10 @@ Error ProjectExport::export_project(const String& p_preset) {
uint32_t flags=0;
-// if (saver->is_bundle_scenes_enabled())
-// flags|=Reso::FLAG_BUNDLE_INSTANCED_SCENES;
+ /*
+ if (saver->is_bundle_scenes_enabled())
+ flags|=Reso::FLAG_BUNDLE_INSTANCED_SCENES;
+ */
saver->set_bundle_exceptions(NULL);
if (E->get().depaction>=ProjectExportSettings::DA_BUNDLE) {
flags|=ResourceSaver::FLAG_BUNDLE_RESOURCES;
@@ -1832,7 +2045,7 @@ Error ProjectExport::export_project(const String& p_preset) {
ERR_FAIL_COND_V(err,ERR_CANT_OPEN);
}
source_file=write_file;
- // project_settings->add_remapped_path(src_scene,path,platform);
+ //project_settings->add_remapped_path(src_scene,path,platform);
}
@@ -1875,7 +2088,7 @@ Error ProjectExport::export_project(const String& p_preset) {
for (Map<String,Map<String,String> >::Element *E=remapped_paths.front();E;E=E->next()) {
String platform=E->key();
- DVector<String> remaps;
+ PoolVector<String> remaps;
for(Map<String,String>::Element *F=E->get().front();F;F=F->next() ) {
remaps.push_back(F->key());
@@ -1884,13 +2097,13 @@ Error ProjectExport::export_project(const String& p_preset) {
-// added_settings["remap/"+platform]=remaps;`
+ //added_settings["remap/"+platform]=remaps;`
added_settings["remap/"+platform]=Variant(remaps).operator Array();
}
String engine_cfg_path=d->get_current_dir()+"/engine.cfg";
print_line("enginecfg: "+engine_cfg_path);
- Globals::get_singleton()->save_custom(engine_cfg_path,added_settings);
+ GlobalConfig::get_singleton()->save_custom(engine_cfg_path,added_settings);
memdelete(d);
return OK;
@@ -1902,7 +2115,7 @@ ProjectExport::ProjectExport(EditorData* p_data) {
editor_data=p_data;
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
set_title(TTR("Project Export"));
label = memnew( Label );
label->set_text(TTR("Export Preset:"));
diff --git a/tools/editor/project_export.h b/tools/editor/project_export.h
index 8cf2bf3afc..06992a7e34 100644
--- a/tools/editor/project_export.h
+++ b/tools/editor/project_export.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -49,7 +49,7 @@
class EditorNode;
class ProjectExportDialog : public ConfirmationDialog {
- OBJ_TYPE( ProjectExportDialog, ConfirmationDialog );
+ GDCLASS( ProjectExportDialog, ConfirmationDialog );
public:
enum ExportAction {
@@ -73,6 +73,7 @@ private:
bool pending_update_tree;
AcceptDialog *error;
ConfirmationDialog *confirm;
+ ConfirmationDialog *confirm_keystore;
Button *button_reload;
LineEdit *filters, *filters_exclude;
@@ -98,7 +99,7 @@ private:
bool _create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir);
void _rescan();
-// void _confirmed();
+ //void _confirmed();
void _scan_finished();
void _validate_platform();
@@ -133,7 +134,7 @@ private:
AcceptDialog *atlas_preview_dialog;
- TextureFrame *atlas_preview_frame;
+ TextureRect *atlas_preview_frame;
VBoxContainer *script_vbox;
@@ -145,6 +146,9 @@ private:
SpinBox *sample_max_hz;
CheckButton *sample_trim;
+ ConfirmationDialog* keystore_create_dialog;
+ EditorFileDialog* keystore_file_dialog;
+
void _export_mode_changed(int p_idx);
void _prop_edited(String what);
@@ -190,6 +194,13 @@ private:
void _export_action_pck(const String& p_file);
void ok_pressed();
void custom_action(const String&);
+ LineEdit* _create_keystore_input(Control* container, const String& p_label, const String& name);
+ void _create_android_keystore_window();
+ void _create_android_keystore();
+ bool _check_android_setting(const Ref<EditorExportPlatform>& exporter);
+ void _check_keystore_path(const String& path);
+ void _keystore_dir_selected(const String& path);
+ void _keystore_created();
void _save_export_cfg();
void _format_toggled();
@@ -212,7 +223,7 @@ public:
class EditorData;
class ProjectExport : public ConfirmationDialog {
- OBJ_TYPE( ProjectExport, ConfirmationDialog );
+ GDCLASS( ProjectExport, ConfirmationDialog );
EditorData *editor_data;
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp
index b2eae2f6d1..2cf940a29a 100644
--- a/tools/editor/project_manager.cpp
+++ b/tools/editor/project_manager.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -42,7 +42,7 @@
#include "scene/gui/center_container.h"
#include "io/stream_peer_ssl.h"
-#include "scene/gui/texture_frame.h"
+#include "scene/gui/texture_rect.h"
#include "scene/gui/margin_container.h"
#include "io/resource_saver.h"
@@ -54,7 +54,7 @@
class NewProjectDialog : public ConfirmationDialog {
- OBJ_TYPE(NewProjectDialog,ConfirmationDialog);
+ GDCLASS(NewProjectDialog,ConfirmationDialog);
public:
@@ -75,15 +75,22 @@ private:
String zip_title;
AcceptDialog *dialog_error;
- bool _test_path() {
+ String _test_path() {
error->set_text("");
get_ok()->set_disabled(true);
DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
- if (project_path->get_text() != "" && d->change_dir(project_path->get_text())!=OK) {
+ String valid_path;
+ if (d->change_dir(project_path->get_text())==OK){
+ valid_path=project_path->get_text();
+ } else if (d->change_dir(project_path->get_text().strip_edges())==OK) {
+ valid_path=project_path->get_text().strip_edges();
+ }
+
+ if (valid_path == "") {
error->set_text(TTR("Invalid project path, the path must exist!"));
memdelete(d);
- return false;
+ return "";
}
if (mode!=MODE_IMPORT) {
@@ -92,30 +99,29 @@ private:
error->set_text(TTR("Invalid project path, engine.cfg must not exist."));
memdelete(d);
- return false;
+ return "";
}
} else {
- if (project_path->get_text() != "" && !d->file_exists("engine.cfg")) {
+ if (valid_path != "" && !d->file_exists("engine.cfg")) {
error->set_text(TTR("Invalid project path, engine.cfg must exist."));
memdelete(d);
- return false;
+ return "";
}
}
memdelete(d);
get_ok()->set_disabled(false);
- return true;
+ return valid_path;
}
void _path_text_changed(const String& p_path) {
- if ( _test_path() ) {
-
- String sp=p_path;
+ String sp=_test_path();
+ if ( sp!="" ) {
sp=sp.replace("\\","/");
int lidx=sp.find_last("/");
@@ -141,7 +147,8 @@ private:
}
String sp = p.simplify_path();
project_path->set_text(sp);
- _path_text_changed(p);
+ _path_text_changed(sp);
+ get_ok()->call_deferred("grab_focus");
}
void _path_selected(const String& p_path) {
@@ -149,8 +156,8 @@ private:
String p = p_path;
String sp = p.simplify_path();
project_path->set_text(sp);
- _path_text_changed(p);
-
+ _path_text_changed(sp);
+ get_ok()->call_deferred("grab_focus");
}
void _browse_path() {
@@ -172,27 +179,15 @@ private:
void ok_pressed() {
- if (!_test_path())
+ String dir=_test_path();
+ if (dir=="") {
+ error->set_text(TTR("Invalid project path (changed anything?)."));
return;
-
- String dir;
+ }
if (mode==MODE_IMPORT) {
- dir=project_path->get_text();
-
-
+ // nothing to do
} else {
- DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
-
- if (d->change_dir(project_path->get_text())!=OK) {
- error->set_text(TTR("Invalid project path (changed anything?)."));
- memdelete(d);
- return;
- }
-
- dir=d->get_current_dir();
- memdelete(d);
-
if (mode==MODE_NEW) {
@@ -320,8 +315,6 @@ private:
}
-
-
}
dir=dir.replace("\\","/");
@@ -334,7 +327,7 @@ private:
hide();
- emit_signal("project_created");
+ emit_signal("project_created", dir);
}
@@ -342,11 +335,11 @@ protected:
static void _bind_methods() {
- ObjectTypeDB::bind_method("_browse_path",&NewProjectDialog::_browse_path);
- ObjectTypeDB::bind_method("_text_changed",&NewProjectDialog::_text_changed);
- ObjectTypeDB::bind_method("_path_text_changed",&NewProjectDialog::_path_text_changed);
- ObjectTypeDB::bind_method("_path_selected",&NewProjectDialog::_path_selected);
- ObjectTypeDB::bind_method("_file_selected",&NewProjectDialog::_file_selected);
+ ClassDB::bind_method("_browse_path",&NewProjectDialog::_browse_path);
+ ClassDB::bind_method("_text_changed",&NewProjectDialog::_text_changed);
+ ClassDB::bind_method("_path_text_changed",&NewProjectDialog::_path_text_changed);
+ ClassDB::bind_method("_path_selected",&NewProjectDialog::_path_selected);
+ ClassDB::bind_method("_file_selected",&NewProjectDialog::_file_selected);
ADD_SIGNAL( MethodInfo("project_created") );
}
@@ -401,7 +394,7 @@ public:
popup_centered(Size2(500,125)*EDSCALE);
}
-
+ project_path->grab_focus();
_test_path();
}
@@ -411,7 +404,7 @@ public:
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
- set_child_rect(vb);
+ //set_child_rect(vb);
Label* l = memnew(Label);
l->set_text(TTR("Project Path:"));
@@ -458,7 +451,7 @@ public:
fdialog = memnew( FileDialog );
add_child(fdialog);
fdialog->set_access(FileDialog::ACCESS_FILESYSTEM);
- fdialog->set_current_dir( EditorSettings::get_singleton()->get("global/default_project_path") );
+ fdialog->set_current_dir( EditorSettings::get_singleton()->get("filesystem/directories/default_project_path") );
project_name->connect("text_changed", this,"_text_changed");
project_path->connect("text_changed", this,"_path_text_changed");
fdialog->connect("dir_selected", this,"_path_selected");
@@ -495,7 +488,7 @@ void ProjectManager::_notification(int p_what) {
} else if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
- set_process_unhandled_input(is_visible());
+ set_process_unhandled_input(is_visible_in_tree());
}
}
@@ -506,7 +499,7 @@ void ProjectManager::_panel_draw(Node *p_hb) {
hb->draw_line(Point2(0,hb->get_size().y+1),Point2(hb->get_size().x-10,hb->get_size().y+1),get_color("guide_color","Tree"));
if (selected_list.has(hb->get_meta("name"))) {
- hb->draw_style_box(get_stylebox("selected","Tree"),Rect2(Point2(),hb->get_size()-Size2(10,0)));
+ hb->draw_style_box( gui_base->get_stylebox("selected","Tree"),Rect2(Point2(),hb->get_size()-Size2(10,0)));
}
}
@@ -753,7 +746,7 @@ void ProjectManager::_load_recent_projects() {
List<PropertyInfo> properties;
EditorSettings::get_singleton()->get_property_list(&properties);
- Color font_color = get_color("font_color","Tree");
+ Color font_color = gui_base->get_color("font_color","Tree");
List<ProjectItem> projects;
List<ProjectItem> favorite_projects;
@@ -863,34 +856,37 @@ void ProjectManager::_load_recent_projects() {
hb->set_meta("main_scene",main_scene);
hb->set_meta("favorite",is_favorite);
hb->connect("draw",this,"_panel_draw",varray(hb));
- hb->connect("input_event",this,"_panel_input",varray(hb));
+ hb->connect("gui_input",this,"_panel_input",varray(hb));
+ hb->add_constant_override("separation",10*EDSCALE);
VBoxContainer *favorite_box = memnew( VBoxContainer );
TextureButton *favorite = memnew( TextureButton );
favorite->set_normal_texture(favorite_icon);
if (!is_favorite)
- favorite->set_opacity(0.2);
+ favorite->set_modulate(Color(1,1,1,0.2));
favorite->set_v_size_flags(SIZE_EXPAND);
favorite->connect("pressed",this,"_favorite_pressed",varray(hb));
favorite_box->add_child(favorite);
hb->add_child(favorite_box);
- TextureFrame *tf = memnew( TextureFrame );
+ TextureRect *tf = memnew( TextureRect );
tf->set_texture(icon);
hb->add_child(tf);
VBoxContainer *vb = memnew(VBoxContainer);
+ vb->set_name("project");
hb->add_child(vb);
Control *ec = memnew( Control );
ec->set_custom_minimum_size(Size2(0,1));
vb->add_child(ec);
Label *title = memnew( Label(project_name) );
- title->add_font_override("font",get_font("large","Fonts"));
+ title->add_font_override("font", gui_base->get_font("large","Fonts"));
title->add_color_override("font_color",font_color);
vb->add_child(title);
Label *fpath = memnew( Label(path) );
+ fpath->set_name("path");
vb->add_child(fpath);
- fpath->set_opacity(0.5);
+ fpath->set_modulate(Color(1,1,1,0.5));
fpath->add_color_override("font_color",font_color);
scroll_childs->add_child(hb);
@@ -910,6 +906,43 @@ void ProjectManager::_load_recent_projects() {
tabs->set_current_tab(0);
}
+void ProjectManager::_on_project_created(const String& dir) {
+ bool has_already=false;
+ for (int i=0;i<scroll_childs->get_child_count();i++) {
+ HBoxContainer *hb=scroll_childs->get_child(i)->cast_to<HBoxContainer>();
+ Label *fpath=hb->get_node(NodePath("project/path"))->cast_to<Label>();
+ if (fpath->get_text()==dir) {
+ has_already=true;
+ break;
+ }
+ }
+ if (has_already) {
+ _update_scroll_pos(dir);
+ } else {
+ _load_recent_projects();
+ scroll->connect("draw", this, "_update_scroll_pos", varray(dir), CONNECT_ONESHOT);
+ }
+}
+
+void ProjectManager::_update_scroll_pos(const String& dir) {
+ for (int i=0;i<scroll_childs->get_child_count();i++) {
+ HBoxContainer *hb=scroll_childs->get_child(i)->cast_to<HBoxContainer>();
+ Label *fpath=hb->get_node(NodePath("project/path"))->cast_to<Label>();
+ if (fpath->get_text()==dir) {
+ last_clicked=hb->get_meta("name");
+ selected_list.clear();
+ selected_list.insert(hb->get_meta("name"), hb->get_meta("main_scene"));
+ _update_project_buttons();
+ int last_y_visible=scroll->get_v_scroll()+scroll->get_size().y;
+ int offset_diff=(hb->get_pos().y + hb->get_size().y)-last_y_visible;
+
+ if (offset_diff>0)
+ scroll->set_v_scroll(scroll->get_v_scroll()+offset_diff);
+ break;
+ }
+ }
+}
+
void ProjectManager::_open_project_confirm() {
for (Map<String,String>::Element *E=selected_list.front(); E; E=E->next()) {
@@ -970,7 +1003,7 @@ void ProjectManager::_run_project_confirm() {
Error err = OS::get_singleton()->execute(exec,args,false,&pid);
ERR_FAIL_COND(err);
}
- // get_scene()->quit(); do not quit
+ //get_scene()->quit(); do not quit
}
void ProjectManager::_run_project() {
@@ -1100,7 +1133,7 @@ void ProjectManager::_install_project(const String& p_zip_path,const String& p_t
npdialog->show_dialog();
}
-void ProjectManager::_files_dropped(StringArray p_files, int p_screen) {
+void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) {
Set<String> folders_set;
DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
for (int i = 0; i < p_files.size(); i++) {
@@ -1109,7 +1142,7 @@ void ProjectManager::_files_dropped(StringArray p_files, int p_screen) {
}
memdelete(da);
if (folders_set.size()>0) {
- StringArray folders;
+ PoolStringArray folders;
for (Set<String>::Element *E=folders_set.front();E;E=E->next()) {
folders.append(E->get());
}
@@ -1121,7 +1154,7 @@ void ProjectManager::_files_dropped(StringArray p_files, int p_screen) {
dir->list_dir_begin();
String file = dir->get_next();
while(confirm && file!=String()) {
- if (!da->current_is_dir() && file.ends_with("engine.cfg")) {
+ if (!dir->current_is_dir() && file.ends_with("engine.cfg")) {
confirm = false;
}
file = dir->get_next();
@@ -1141,7 +1174,7 @@ void ProjectManager::_files_dropped(StringArray p_files, int p_screen) {
}
}
-void ProjectManager::_scan_multiple_folders(StringArray p_files)
+void ProjectManager::_scan_multiple_folders(PoolStringArray p_files)
{
for (int i = 0; i < p_files.size(); i++) {
_scan_begin(p_files.get(i));
@@ -1150,25 +1183,27 @@ void ProjectManager::_scan_multiple_folders(StringArray p_files)
void ProjectManager::_bind_methods() {
- ObjectTypeDB::bind_method("_open_project",&ProjectManager::_open_project);
- ObjectTypeDB::bind_method("_open_project_confirm",&ProjectManager::_open_project_confirm);
- ObjectTypeDB::bind_method("_run_project",&ProjectManager::_run_project);
- ObjectTypeDB::bind_method("_run_project_confirm",&ProjectManager::_run_project_confirm);
- ObjectTypeDB::bind_method("_scan_projects",&ProjectManager::_scan_projects);
- ObjectTypeDB::bind_method("_scan_begin",&ProjectManager::_scan_begin);
- ObjectTypeDB::bind_method("_import_project",&ProjectManager::_import_project);
- ObjectTypeDB::bind_method("_new_project",&ProjectManager::_new_project);
- ObjectTypeDB::bind_method("_erase_project",&ProjectManager::_erase_project);
- ObjectTypeDB::bind_method("_erase_project_confirm",&ProjectManager::_erase_project_confirm);
- ObjectTypeDB::bind_method("_exit_dialog",&ProjectManager::_exit_dialog);
- ObjectTypeDB::bind_method("_load_recent_projects",&ProjectManager::_load_recent_projects);
- ObjectTypeDB::bind_method("_panel_draw",&ProjectManager::_panel_draw);
- ObjectTypeDB::bind_method("_panel_input",&ProjectManager::_panel_input);
- ObjectTypeDB::bind_method("_unhandled_input",&ProjectManager::_unhandled_input);
- ObjectTypeDB::bind_method("_favorite_pressed",&ProjectManager::_favorite_pressed);
- ObjectTypeDB::bind_method("_install_project",&ProjectManager::_install_project);
- ObjectTypeDB::bind_method("_files_dropped",&ProjectManager::_files_dropped);
- ObjectTypeDB::bind_method(_MD("_scan_multiple_folders", "files"),&ProjectManager::_scan_multiple_folders);
+ ClassDB::bind_method("_open_project",&ProjectManager::_open_project);
+ ClassDB::bind_method("_open_project_confirm",&ProjectManager::_open_project_confirm);
+ ClassDB::bind_method("_run_project",&ProjectManager::_run_project);
+ ClassDB::bind_method("_run_project_confirm",&ProjectManager::_run_project_confirm);
+ ClassDB::bind_method("_scan_projects",&ProjectManager::_scan_projects);
+ ClassDB::bind_method("_scan_begin",&ProjectManager::_scan_begin);
+ ClassDB::bind_method("_import_project",&ProjectManager::_import_project);
+ ClassDB::bind_method("_new_project",&ProjectManager::_new_project);
+ ClassDB::bind_method("_erase_project",&ProjectManager::_erase_project);
+ ClassDB::bind_method("_erase_project_confirm",&ProjectManager::_erase_project_confirm);
+ ClassDB::bind_method("_exit_dialog",&ProjectManager::_exit_dialog);
+ ClassDB::bind_method("_load_recent_projects",&ProjectManager::_load_recent_projects);
+ ClassDB::bind_method("_on_project_created",&ProjectManager::_on_project_created);
+ ClassDB::bind_method("_update_scroll_pos",&ProjectManager::_update_scroll_pos);
+ ClassDB::bind_method("_panel_draw",&ProjectManager::_panel_draw);
+ ClassDB::bind_method("_panel_input",&ProjectManager::_panel_input);
+ ClassDB::bind_method("_unhandled_input",&ProjectManager::_unhandled_input);
+ ClassDB::bind_method("_favorite_pressed",&ProjectManager::_favorite_pressed);
+ ClassDB::bind_method("_install_project",&ProjectManager::_install_project);
+ ClassDB::bind_method("_files_dropped",&ProjectManager::_files_dropped);
+ ClassDB::bind_method(_MD("_scan_multiple_folders", "files"),&ProjectManager::_scan_multiple_folders);
}
@@ -1183,7 +1218,7 @@ ProjectManager::ProjectManager() {
EditorSettings::get_singleton()->set_optimize_save(false); //just write settings as they came
{
- int dpi_mode = EditorSettings::get_singleton()->get("global/hidpi_mode");
+ int dpi_mode = EditorSettings::get_singleton()->get("interface/hidpi_mode");
if (dpi_mode==0) {
editor_set_scale( OS::get_singleton()->get_screen_dpi(0) > 150 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x>2000 ? 2.0 : 1.0 );
} else if (dpi_mode==1) {
@@ -1197,7 +1232,7 @@ ProjectManager::ProjectManager() {
}
}
- FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"));
+ FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesytem/file_dialog/show_hidden_files"));
set_area_as_parent_rect();
set_theme(create_editor_theme());
@@ -1205,6 +1240,7 @@ ProjectManager::ProjectManager() {
gui_base = memnew( Control );
add_child(gui_base);
gui_base->set_area_as_parent_rect();
+ gui_base->set_theme(create_custom_theme());
Panel *panel = memnew( Panel );
gui_base->add_child(panel);
@@ -1220,14 +1256,14 @@ ProjectManager::ProjectManager() {
String cp;
cp.push_back(0xA9);
cp.push_back(0);
- OS::get_singleton()->set_window_title(_MKSTR(VERSION_NAME)+String(" - ")+TTR("Project Manager")+" - "+cp+" 2008-2016 Juan Linietsky, Ariel Manzur.");
+ OS::get_singleton()->set_window_title(_MKSTR(VERSION_NAME)+String(" - ")+TTR("Project Manager")+" - "+cp+" 2008-2017 Juan Linietsky, Ariel Manzur.");
HBoxContainer *top_hb = memnew( HBoxContainer);
vb->add_child(top_hb);
CenterContainer *ccl = memnew( CenterContainer );
Label *l = memnew( Label );
l->set_text(_MKSTR(VERSION_NAME)+String(" - ")+TTR("Project Manager"));
- l->add_font_override("font",get_font("doc","EditorFonts"));
+ l->add_font_override("font", gui_base->get_font("doc","EditorFonts"));
ccl->add_child(l);
top_hb->add_child(ccl);
top_hb->add_spacer();
@@ -1263,7 +1299,7 @@ ProjectManager::ProjectManager() {
search_tree_vb->add_child(search_box);
PanelContainer *pc = memnew( PanelContainer);
- pc->add_style_override("panel",get_stylebox("bg","Tree"));
+ pc->add_style_override("panel", gui_base->get_stylebox("bg","Tree"));
search_tree_vb->add_child(pc);
pc->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -1305,7 +1341,7 @@ ProjectManager::ProjectManager() {
scan_dir->set_access(FileDialog::ACCESS_FILESYSTEM);
scan_dir->set_mode(FileDialog::MODE_OPEN_DIR);
scan_dir->set_title(TTR("Select a Folder to Scan")); // must be after mode or it's overridden
- scan_dir->set_current_dir( EditorSettings::get_singleton()->get("global/default_project_path") );
+ scan_dir->set_current_dir( EditorSettings::get_singleton()->get("filesystem/directories/default_project_path") );
gui_base->add_child(scan_dir);
scan_dir->connect("dir_selected",this,"_scan_begin");
@@ -1379,11 +1415,11 @@ ProjectManager::ProjectManager() {
npdialog = memnew( NewProjectDialog );
gui_base->add_child(npdialog);
- npdialog->connect("project_created", this,"_load_recent_projects");
+ npdialog->connect("project_created", this,"_on_project_created");
_load_recent_projects();
- if ( EditorSettings::get_singleton()->get("global/autoscan_project_path") ) {
- _scan_begin( EditorSettings::get_singleton()->get("global/autoscan_project_path") );
+ if ( EditorSettings::get_singleton()->get("filesystem/directories/autoscan_project_path") ) {
+ _scan_begin( EditorSettings::get_singleton()->get("filesystem/directories/autoscan_project_path") );
}
//get_ok()->set_text("Open");
@@ -1392,8 +1428,6 @@ ProjectManager::ProjectManager() {
last_clicked = "";
SceneTree::get_singleton()->connect("files_dropped", this, "_files_dropped");
-
- gui_base->set_theme(create_custom_theme());
}
@@ -1452,9 +1486,9 @@ void ProjectListFilter::_notification(int p_what) {
void ProjectListFilter::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_command"),&ProjectListFilter::_command);
- ObjectTypeDB::bind_method(_MD("_search_text_changed"), &ProjectListFilter::_search_text_changed);
- ObjectTypeDB::bind_method(_MD("_filter_option_selected"), &ProjectListFilter::_filter_option_selected);
+ ClassDB::bind_method(_MD("_command"),&ProjectListFilter::_command);
+ ClassDB::bind_method(_MD("_search_text_changed"), &ProjectListFilter::_search_text_changed);
+ ClassDB::bind_method(_MD("_filter_option_selected"), &ProjectListFilter::_filter_option_selected);
ADD_SIGNAL( MethodInfo("filter_changed") );
}
diff --git a/tools/editor/project_manager.h b/tools/editor/project_manager.h
index 46f7aea3a5..1fd8a301ea 100644
--- a/tools/editor/project_manager.h
+++ b/tools/editor/project_manager.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,7 +40,7 @@ class NewProjectDialog;
class ProjectListFilter;
class ProjectManager : public Control {
- OBJ_TYPE( ProjectManager, Control );
+ GDCLASS( ProjectManager, Control );
Button *erase_btn;
Button *open_btn;
@@ -85,6 +85,8 @@ class ProjectManager : public Control {
void _scan_begin(const String& p_base);
void _load_recent_projects();
+ void _on_project_created(const String& dir);
+ void _update_scroll_pos(const String& dir);
void _scan_dir(DirAccess *da,float pos, float total,List<String> *r_projects);
void _install_project(const String& p_zip_path,const String& p_title);
@@ -93,8 +95,8 @@ class ProjectManager : public Control {
void _panel_input(const InputEvent& p_ev,Node *p_hb);
void _unhandled_input(const InputEvent& p_ev);
void _favorite_pressed(Node *p_hb);
- void _files_dropped(StringArray p_files, int p_screen);
- void _scan_multiple_folders(StringArray p_files);
+ void _files_dropped(PoolStringArray p_files, int p_screen);
+ void _scan_multiple_folders(PoolStringArray p_files);
protected:
@@ -107,7 +109,7 @@ public:
class ProjectListFilter : public HBoxContainer {
- OBJ_TYPE( ProjectListFilter, HBoxContainer );
+ GDCLASS( ProjectListFilter, HBoxContainer );
private:
diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp
index 02d95abfa2..0396456c49 100644
--- a/tools/editor/project_settings.cpp
+++ b/tools/editor/project_settings.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -74,7 +74,7 @@ void ProjectSettings::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
- globals_editor->edit(Globals::get_singleton());
+ globals_editor->edit(GlobalConfig::get_singleton());
search_button->set_icon(get_icon("Zoom","EditorIcons"));
clear_button->set_icon(get_icon("Close","EditorIcons"));
@@ -82,8 +82,8 @@ void ProjectSettings::_notification(int p_what) {
translation_list->connect("button_pressed",this,"_translation_delete");
_update_actions();
popup_add->add_icon_item(get_icon("Keyboard","EditorIcons"),TTR("Key "),InputEvent::KEY);//"Key " - because the word 'key' has already been used as a key animation
- popup_add->add_icon_item(get_icon("JoyButton","EditorIcons"),TTR("Joy Button"),InputEvent::JOYSTICK_BUTTON);
- popup_add->add_icon_item(get_icon("JoyAxis","EditorIcons"),TTR("Joy Axis"),InputEvent::JOYSTICK_MOTION);
+ popup_add->add_icon_item(get_icon("JoyButton","EditorIcons"),TTR("Joy Button"),InputEvent::JOYPAD_BUTTON);
+ popup_add->add_icon_item(get_icon("JoyAxis","EditorIcons"),TTR("Joy Axis"),InputEvent::JOYPAD_MOTION);
popup_add->add_icon_item(get_icon("Mouse","EditorIcons"),TTR("Mouse Button"),InputEvent::MOUSE_BUTTON);
List<String> tfn;
@@ -136,7 +136,7 @@ void ProjectSettings::_action_edited() {
String action_prop="input/"+new_name;
- if (Globals::get_singleton()->has(action_prop)) {
+ if (GlobalConfig::get_singleton()->has(action_prop)) {
ti->set_text(0,old_name);
add_at="input/"+old_name;
@@ -146,20 +146,17 @@ void ProjectSettings::_action_edited() {
return;
}
- int order = Globals::get_singleton()->get_order(add_at);
- Array va = Globals::get_singleton()->get(add_at);
- bool persisting = Globals::get_singleton()->is_persisting(add_at);
+ int order = GlobalConfig::get_singleton()->get_order(add_at);
+ Array va = GlobalConfig::get_singleton()->get(add_at);
setting=true;
undo_redo->create_action(TTR("Rename Input Action Event"));
- undo_redo->add_do_method(Globals::get_singleton(),"clear",add_at);
- undo_redo->add_do_method(Globals::get_singleton(),"set",action_prop,va);
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",action_prop,persisting);
- undo_redo->add_do_method(Globals::get_singleton(),"set_order",action_prop,order);
- undo_redo->add_undo_method(Globals::get_singleton(),"clear",action_prop);
- undo_redo->add_undo_method(Globals::get_singleton(),"set",add_at,va);
- undo_redo->add_undo_method(Globals::get_singleton(),"set_persisting",add_at,persisting);
- undo_redo->add_undo_method(Globals::get_singleton(),"set_order",add_at,order);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(),"clear",add_at);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(),"set",action_prop,va);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(),"set_order",action_prop,order);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(),"clear",action_prop);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set",add_at,va);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set_order",add_at,order);
undo_redo->add_do_method(this,"_update_actions");
undo_redo->add_undo_method(this,"_update_actions");
undo_redo->add_do_method(this,"_settings_changed");
@@ -179,9 +176,9 @@ void ProjectSettings::_device_input_add() {
InputEvent ie;
String name=add_at;
- Variant old_val = Globals::get_singleton()->get(name);
+ Variant old_val = GlobalConfig::get_singleton()->get(name);
Array arr=old_val;
- ie.device=device_id->get_val();
+ ie.device=device_id->get_value();
ie.type=add_type;
@@ -201,7 +198,7 @@ void ProjectSettings::_device_input_add() {
}
} break;
- case InputEvent::JOYSTICK_MOTION: {
+ case InputEvent::JOYPAD_MOTION: {
ie.joy_motion.axis = device_index->get_selected()>>1;
ie.joy_motion.axis_value = device_index->get_selected()&1?1:-1;
@@ -210,20 +207,20 @@ void ProjectSettings::_device_input_add() {
for(int i=0;i<arr.size();i++) {
InputEvent aie=arr[i];
- if (aie.device == ie.device && aie.type==InputEvent::JOYSTICK_MOTION && aie.joy_motion.axis==ie.joy_motion.axis && aie.joy_motion.axis_value==ie.joy_motion.axis_value) {
+ if (aie.device == ie.device && aie.type==InputEvent::JOYPAD_MOTION && aie.joy_motion.axis==ie.joy_motion.axis && aie.joy_motion.axis_value==ie.joy_motion.axis_value) {
return;
}
}
} break;
- case InputEvent::JOYSTICK_BUTTON: {
+ case InputEvent::JOYPAD_BUTTON: {
ie.joy_button.button_index=device_index->get_selected();
for(int i=0;i<arr.size();i++) {
InputEvent aie=arr[i];
- if (aie.device == ie.device && aie.type==InputEvent::JOYSTICK_BUTTON && aie.joy_button.button_index==ie.joy_button.button_index) {
+ if (aie.device == ie.device && aie.type==InputEvent::JOYPAD_BUTTON && aie.joy_button.button_index==ie.joy_button.button_index) {
return;
}
}
@@ -236,9 +233,8 @@ void ProjectSettings::_device_input_add() {
arr.push_back(ie);
undo_redo->create_action(TTR("Add Input Action Event"));
- undo_redo->add_do_method(Globals::get_singleton(),"set",name,arr);
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",name,true);
- undo_redo->add_undo_method(Globals::get_singleton(),"set",name,old_val);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(),"set",name,arr);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set",name,old_val);
undo_redo->add_do_method(this,"_update_actions");
undo_redo->add_undo_method(this,"_update_actions");
undo_redo->add_do_method(this,"_settings_changed");
@@ -260,7 +256,7 @@ void ProjectSettings::_press_a_key_confirm() {
ie.key.mod=last_wait_for_key.key.mod;
String name=add_at;
- Variant old_val = Globals::get_singleton()->get(name);
+ Variant old_val = GlobalConfig::get_singleton()->get(name);
Array arr=old_val;
for(int i=0;i<arr.size();i++) {
@@ -274,9 +270,8 @@ void ProjectSettings::_press_a_key_confirm() {
arr.push_back(ie);
undo_redo->create_action(TTR("Add Input Action Event"));
- undo_redo->add_do_method(Globals::get_singleton(),"set",name,arr);
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",name,true);
- undo_redo->add_undo_method(Globals::get_singleton(),"set",name,old_val);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(),"set",name,arr);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set",name,old_val);
undo_redo->add_do_method(this,"_update_actions");
undo_redo->add_undo_method(this,"_update_actions");
undo_redo->add_do_method(this,"_settings_changed");
@@ -352,7 +347,7 @@ void ProjectSettings::_add_item(int p_item){
} break;
case InputEvent::MOUSE_BUTTON: {
- device_id->set_val(0);
+ device_id->set_value(0);
device_index_label->set_text(TTR("Mouse Button Index:"));
device_index->clear();
device_index->add_item(TTR("Left Button"));
@@ -366,10 +361,10 @@ void ProjectSettings::_add_item(int p_item){
device_index->add_item(TTR("Button 9"));
device_input->popup_centered_minsize(Size2(350,95));
} break;
- case InputEvent::JOYSTICK_MOTION: {
+ case InputEvent::JOYPAD_MOTION: {
- device_id->set_val(0);
- device_index_label->set_text(TTR("Joystick Axis Index:"));
+ device_id->set_value(0);
+ device_index_label->set_text(TTR("Joypad Axis Index:"));
device_index->clear();
for(int i=0;i<JOY_AXIS_MAX*2;i++) {
@@ -379,10 +374,10 @@ void ProjectSettings::_add_item(int p_item){
device_input->popup_centered_minsize(Size2(350,95));
} break;
- case InputEvent::JOYSTICK_BUTTON: {
+ case InputEvent::JOYPAD_BUTTON: {
- device_id->set_val(3);
- device_index_label->set_text(TTR("Joystick Button Index:"));
+ device_id->set_value(3);
+ device_index_label->set_text(TTR("Joypad Button Index:"));
device_index->clear();
for(int i=0;i<JOY_BUTTON_MAX;i++) {
@@ -423,14 +418,13 @@ void ProjectSettings::_action_button_pressed(Object* p_obj, int p_column,int p_i
//remove main thing
String name="input/"+ti->get_text(0);
- Variant old_val = Globals::get_singleton()->get(name);
- int order=Globals::get_singleton()->get_order(name);
+ Variant old_val = GlobalConfig::get_singleton()->get(name);
+ int order=GlobalConfig::get_singleton()->get_order(name);
undo_redo->create_action(TTR("Add Input Action"));
- undo_redo->add_do_method(Globals::get_singleton(),"clear",name);
- undo_redo->add_undo_method(Globals::get_singleton(),"set",name,old_val);
- undo_redo->add_undo_method(Globals::get_singleton(),"set_order",name,order);
- undo_redo->add_undo_method(Globals::get_singleton(),"set_persisting",name,Globals::get_singleton()->is_persisting(name));
+ undo_redo->add_do_method(GlobalConfig::get_singleton(),"clear",name);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set",name,old_val);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set_order",name,order);
undo_redo->add_do_method(this,"_update_actions");
undo_redo->add_undo_method(this,"_update_actions");
undo_redo->add_do_method(this,"_settings_changed");
@@ -440,7 +434,7 @@ void ProjectSettings::_action_button_pressed(Object* p_obj, int p_column,int p_i
} else {
//remove action
String name="input/"+ti->get_parent()->get_text(0);
- Variant old_val = Globals::get_singleton()->get(name);
+ Variant old_val = GlobalConfig::get_singleton()->get(name);
int idx = ti->get_metadata(0);
Array va = old_val;
@@ -456,8 +450,8 @@ void ProjectSettings::_action_button_pressed(Object* p_obj, int p_column,int p_i
undo_redo->create_action(TTR("Erase Input Action Event"));
- undo_redo->add_do_method(Globals::get_singleton(),"set",name,va);
- undo_redo->add_undo_method(Globals::get_singleton(),"set",name,old_val);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(),"set",name,va);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set",name,old_val);
undo_redo->add_do_method(this,"_update_actions");
undo_redo->add_undo_method(this,"_update_actions");
undo_redo->add_do_method(this,"_settings_changed");
@@ -480,7 +474,7 @@ void ProjectSettings::_update_actions() {
input_editor->set_hide_root(true);
List<PropertyInfo> props;
- Globals::get_singleton()->get_property_list(&props);
+ GlobalConfig::get_singleton()->get_property_list(&props);
for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) {
@@ -496,7 +490,7 @@ void ProjectSettings::_update_actions() {
//item->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
item->set_text(0,name);
item->add_button(0,get_icon("Add","EditorIcons"),1);
- if (!Globals::get_singleton()->get_input_presets().find(pi.name)) {
+ if (!GlobalConfig::get_singleton()->get_input_presets().find(pi.name)) {
item->add_button(0,get_icon("Remove","EditorIcons"),2);
item->set_editable(0,true);
}
@@ -504,7 +498,7 @@ void ProjectSettings::_update_actions() {
//item->set_checked(0,pi.usage&PROPERTY_USAGE_CHECKED);
- Array actions=Globals::get_singleton()->get(pi.name);
+ Array actions=GlobalConfig::get_singleton()->get(pi.name);
for(int i=0;i<actions.size();i++) {
@@ -532,7 +526,7 @@ void ProjectSettings::_update_actions() {
action->set_icon(0,get_icon("Keyboard","EditorIcons"));
} break;
- case InputEvent::JOYSTICK_BUTTON: {
+ case InputEvent::JOYPAD_BUTTON: {
String str = TTR("Device")+" "+itos(ie.device)+", "+TTR("Button")+" "+itos(ie.joy_button.button_index);
if (ie.joy_button.button_index>=0 && ie.joy_button.button_index<JOY_BUTTON_MAX)
@@ -558,7 +552,7 @@ void ProjectSettings::_update_actions() {
action->set_text(0,str);
action->set_icon(0,get_icon("Mouse","EditorIcons"));
} break;
- case InputEvent::JOYSTICK_MOTION: {
+ case InputEvent::JOYPAD_MOTION: {
int ax = ie.joy_motion.axis;
int n = 2*ax + (ie.joy_motion.axis_value<0 ? 0:1);
@@ -636,13 +630,12 @@ void ProjectSettings::_item_add() {
undo_redo->create_action("Add Global Property");
- undo_redo->add_do_property(Globals::get_singleton(), name, value);
- undo_redo->add_do_method(Globals::get_singleton(), "set_persisting", name, true);
+ undo_redo->add_do_property(GlobalConfig::get_singleton(), name, value);
- if (Globals::get_singleton()->has(name)) {
- undo_redo->add_undo_property(Globals::get_singleton(), name, Globals::get_singleton()->get(name));
+ if (GlobalConfig::get_singleton()->has(name)) {
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name));
} else {
- undo_redo->add_undo_property(Globals::get_singleton(), name, Variant());
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, Variant());
}
undo_redo->add_do_method(globals_editor, "update_category_list");
@@ -669,10 +662,9 @@ void ProjectSettings::_item_del() {
undo_redo->create_action("Delete Global Property");
- undo_redo->add_do_property(Globals::get_singleton(), name, Variant());
+ undo_redo->add_do_property(GlobalConfig::get_singleton(), name, Variant());
- undo_redo->add_undo_property(Globals::get_singleton(), name, Globals::get_singleton()->get(name));
- undo_redo->add_undo_method(Globals::get_singleton(), "set_persisting", name, Globals::get_singleton()->is_persisting(name));
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name));
undo_redo->add_do_method(globals_editor, "update_category_list");
undo_redo->add_undo_method(globals_editor, "update_category_list");
@@ -699,7 +691,7 @@ void ProjectSettings::_action_add() {
return;
}
- if (Globals::get_singleton()->has("input/"+action)) {
+ if (GlobalConfig::get_singleton()->has("input/"+action)) {
message->set_text(vformat(TTR("Action '%s' already exists!"),action));
message->popup_centered(Size2(300,100));
return;
@@ -708,9 +700,8 @@ void ProjectSettings::_action_add() {
Array va;
String name = "input/"+action;
undo_redo->create_action(TTR("Add Input Action Event"));
- undo_redo->add_do_method(Globals::get_singleton(),"set",name,va);
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",name,true);
- undo_redo->add_undo_method(Globals::get_singleton(),"clear",name);
+ undo_redo->add_do_method(GlobalConfig::get_singleton(),"set",name,va);
+ undo_redo->add_undo_method(GlobalConfig::get_singleton(),"clear",name);
undo_redo->add_do_method(this,"_update_actions");
undo_redo->add_undo_method(this,"_update_actions");
undo_redo->add_do_method(this,"_settings_changed");
@@ -737,23 +728,14 @@ void ProjectSettings::_action_add() {
void ProjectSettings::_item_checked(const String& p_item, bool p_check) {
- undo_redo->create_action(TTR("Toggle Persisting"));
- String full_item = globals_editor->get_full_item_path(p_item);
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",full_item,p_check);
- undo_redo->add_undo_method(Globals::get_singleton(),"set_persisting",full_item,!p_check);
- undo_redo->add_do_method(this,"_settings_changed");
- undo_redo->add_undo_method(this,"_settings_changed");
- undo_redo->add_do_method(globals_editor->get_property_editor(),"update_tree");
- undo_redo->add_undo_method(globals_editor->get_property_editor(),"update_tree");
- undo_redo->commit_action();
}
void ProjectSettings::_save() {
- Error err = Globals::get_singleton()->save();
+ Error err = GlobalConfig::get_singleton()->save();
message->set_text(err!=OK?TTR("Error saving settings."):TTR("Settings saved OK."));
message->popup_centered(Size2(300,100));
}
@@ -764,21 +746,6 @@ void ProjectSettings::_settings_prop_edited(const String& p_name) {
String full_item = globals_editor->get_full_item_path(p_name);
- if (!Globals::get_singleton()->is_persisting(full_item)) {
- Globals::get_singleton()->set_persisting(full_item,true);
-
- {
- //small usability workaround, if anything related to resolution scaling or size is modified, change all of them together
- if (full_item=="display/width" || full_item=="display/height" || full_item=="display/stretch_mode") {
- Globals::get_singleton()->set_persisting("display/height",true);
- Globals::get_singleton()->set_persisting("display/width",true);
- }
- }
-
-
-// globals_editor->update_property(p_name);
- globals_editor->get_property_editor()->update_tree();
- }
_settings_changed();
}
@@ -810,12 +777,12 @@ void ProjectSettings::_copy_to_platform(int p_which) {
}
String name = catname+"/"+propname;
- Variant value=Globals::get_singleton()->get(name);
+ Variant value=GlobalConfig::get_singleton()->get(name);
catname+="."+popup_platform->get_popup()->get_item_text(p_which);;
name = catname+"/"+propname;
- Globals::get_singleton()->set(name,value);
+ GlobalConfig::get_singleton()->set(name,value);
globals_editor->get_property_editor()->update_tree();
}
@@ -828,7 +795,7 @@ void ProjectSettings::add_translation(const String& p_translation) {
void ProjectSettings::_translation_add(const String& p_path) {
- StringArray translations = Globals::get_singleton()->get("locale/translations");
+ PoolStringArray translations = GlobalConfig::get_singleton()->get("locale/translations");
for(int i=0;i<translations.size();i++) {
@@ -839,9 +806,8 @@ void ProjectSettings::_translation_add(const String& p_path) {
translations.push_back(p_path);
undo_redo->create_action(TTR("Add Translation"));
- undo_redo->add_do_property(Globals::get_singleton(),"locale/translations",translations);
- undo_redo->add_undo_property(Globals::get_singleton(),"locale/translations",Globals::get_singleton()->get("locale/translations"));
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translations",true);
+ undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translations",translations);
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translations",GlobalConfig::get_singleton()->get("locale/translations"));
undo_redo->add_do_method(this,"_update_translations");
undo_redo->add_undo_method(this,"_update_translations");
undo_redo->add_do_method(this,"_settings_changed");
@@ -862,15 +828,15 @@ void ProjectSettings::_translation_delete(Object *p_item,int p_column, int p_but
int idx=ti->get_metadata(0);
- StringArray translations = Globals::get_singleton()->get("locale/translations");
+ PoolStringArray translations = GlobalConfig::get_singleton()->get("locale/translations");
ERR_FAIL_INDEX(idx,translations.size());
translations.remove(idx);
undo_redo->create_action(TTR("Remove Translation"));
- undo_redo->add_do_property(Globals::get_singleton(),"locale/translations",translations);
- undo_redo->add_undo_property(Globals::get_singleton(),"locale/translations",Globals::get_singleton()->get("locale/translations"));
+ undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translations",translations);
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translations",GlobalConfig::get_singleton()->get("locale/translations"));
undo_redo->add_do_method(this,"_update_translations");
undo_redo->add_undo_method(this,"_update_translations");
undo_redo->add_do_method(this,"_settings_changed");
@@ -891,20 +857,19 @@ void ProjectSettings::_translation_res_add(const String& p_path){
Variant prev;
Dictionary remaps;
- if (Globals::get_singleton()->has("locale/translation_remaps")) {
- remaps = Globals::get_singleton()->get("locale/translation_remaps");
+ if (GlobalConfig::get_singleton()->has("locale/translation_remaps")) {
+ remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
prev=remaps;
}
if (remaps.has(p_path))
return; //pointless already has it
- remaps[p_path]=StringArray();
+ remaps[p_path]=PoolStringArray();
undo_redo->create_action(TTR("Add Remapped Path"));
- undo_redo->add_do_property(Globals::get_singleton(),"locale/translation_remaps",remaps);
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translation_remaps",true);
- undo_redo->add_undo_property(Globals::get_singleton(),"locale/translation_remaps",prev);
+ undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translation_remaps",remaps);
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translation_remaps",prev);
undo_redo->add_do_method(this,"_update_translations");
undo_redo->add_undo_method(this,"_update_translations");
undo_redo->add_do_method(this,"_settings_changed");
@@ -920,9 +885,9 @@ void ProjectSettings::_translation_res_option_file_open(){
}
void ProjectSettings::_translation_res_option_add(const String& p_path) {
- ERR_FAIL_COND(!Globals::get_singleton()->has("locale/translation_remaps"));
+ ERR_FAIL_COND(!GlobalConfig::get_singleton()->has("locale/translation_remaps"));
- Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps");
+ Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
TreeItem *k = translation_remap->get_selected();
ERR_FAIL_COND(!k);
@@ -930,15 +895,14 @@ void ProjectSettings::_translation_res_option_add(const String& p_path) {
String key = k->get_metadata(0);
ERR_FAIL_COND(!remaps.has(key));
- StringArray r = remaps[key];
+ PoolStringArray r = remaps[key];
r.push_back(p_path+":"+"en");
remaps[key]=r;
undo_redo->create_action(TTR("Resource Remap Add Remap"));
- undo_redo->add_do_property(Globals::get_singleton(),"locale/translation_remaps",remaps);
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translation_remaps",true);
- undo_redo->add_undo_property(Globals::get_singleton(),"locale/translation_remaps",Globals::get_singleton()->get("locale/translation_remaps"));
+ undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translation_remaps",remaps);
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translation_remaps",GlobalConfig::get_singleton()->get("locale/translation_remaps"));
undo_redo->add_do_method(this,"_update_translations");
undo_redo->add_undo_method(this,"_update_translations");
undo_redo->add_do_method(this,"_settings_changed");
@@ -963,10 +927,10 @@ void ProjectSettings::_translation_res_option_changed() {
if (updating_translations)
return;
- if (!Globals::get_singleton()->has("locale/translation_remaps"))
+ if (!GlobalConfig::get_singleton()->has("locale/translation_remaps"))
return;
- Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps");
+ Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
TreeItem *k = translation_remap->get_selected();
ERR_FAIL_COND(!k);
@@ -984,16 +948,15 @@ void ProjectSettings::_translation_res_option_changed() {
ERR_FAIL_COND(!remaps.has(key));
- StringArray r = remaps[key];
+ PoolStringArray r = remaps[key];
ERR_FAIL_INDEX(idx,r.size());
r.set(idx,path+":"+langs[which]);
remaps[key]=r;
updating_translations=true;
undo_redo->create_action(TTR("Change Resource Remap Language"));
- undo_redo->add_do_property(Globals::get_singleton(),"locale/translation_remaps",remaps);
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translation_remaps",true);
- undo_redo->add_undo_property(Globals::get_singleton(),"locale/translation_remaps",Globals::get_singleton()->get("locale/translation_remaps"));
+ undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translation_remaps",remaps);
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translation_remaps",GlobalConfig::get_singleton()->get("locale/translation_remaps"));
undo_redo->add_do_method(this,"_update_translations");
undo_redo->add_undo_method(this,"_update_translations");
undo_redo->add_do_method(this,"_settings_changed");
@@ -1010,10 +973,10 @@ void ProjectSettings::_translation_res_delete(Object *p_item,int p_column, int p
if (updating_translations)
return;
- if (!Globals::get_singleton()->has("locale/translation_remaps"))
+ if (!GlobalConfig::get_singleton()->has("locale/translation_remaps"))
return;
- Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps");
+ Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
TreeItem *k = p_item->cast_to<TreeItem>();
@@ -1023,9 +986,8 @@ void ProjectSettings::_translation_res_delete(Object *p_item,int p_column, int p
remaps.erase(key);
undo_redo->create_action(TTR("Remove Resource Remap"));
- undo_redo->add_do_property(Globals::get_singleton(),"locale/translation_remaps",remaps);
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translation_remaps",true);
- undo_redo->add_undo_property(Globals::get_singleton(),"locale/translation_remaps",Globals::get_singleton()->get("locale/translation_remaps"));
+ undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translation_remaps",remaps);
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translation_remaps",GlobalConfig::get_singleton()->get("locale/translation_remaps"));
undo_redo->add_do_method(this,"_update_translations");
undo_redo->add_undo_method(this,"_update_translations");
undo_redo->add_do_method(this,"_settings_changed");
@@ -1038,10 +1000,10 @@ void ProjectSettings::_translation_res_option_delete(Object *p_item,int p_column
if (updating_translations)
return;
- if (!Globals::get_singleton()->has("locale/translation_remaps"))
+ if (!GlobalConfig::get_singleton()->has("locale/translation_remaps"))
return;
- Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps");
+ Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
TreeItem *k = translation_remap->get_selected();
ERR_FAIL_COND(!k);
@@ -1052,16 +1014,15 @@ void ProjectSettings::_translation_res_option_delete(Object *p_item,int p_column
int idx = ed->get_metadata(0);
ERR_FAIL_COND(!remaps.has(key));
- StringArray r = remaps[key];
+ PoolStringArray r = remaps[key];
ERR_FAIL_INDEX(idx,remaps.size());
r.remove(idx);
remaps[key]=r;
undo_redo->create_action(TTR("Remove Resource Remap Option"));
- undo_redo->add_do_property(Globals::get_singleton(),"locale/translation_remaps",remaps);
- undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translation_remaps",true);
- undo_redo->add_undo_property(Globals::get_singleton(),"locale/translation_remaps",Globals::get_singleton()->get("locale/translation_remaps"));
+ undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translation_remaps",remaps);
+ undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translation_remaps",GlobalConfig::get_singleton()->get("locale/translation_remaps"));
undo_redo->add_do_method(this,"_update_translations");
undo_redo->add_undo_method(this,"_update_translations");
undo_redo->add_do_method(this,"_settings_changed");
@@ -1082,9 +1043,9 @@ void ProjectSettings::_update_translations() {
translation_list->clear();
TreeItem *root = translation_list->create_item(NULL);
translation_list->set_hide_root(true);
- if (Globals::get_singleton()->has("locale/translations")) {
+ if (GlobalConfig::get_singleton()->has("locale/translations")) {
- StringArray translations = Globals::get_singleton()->get("locale/translations");
+ PoolStringArray translations = GlobalConfig::get_singleton()->get("locale/translations");
for(int i=0;i<translations.size();i++) {
TreeItem *t = translation_list->create_item(root);
@@ -1121,9 +1082,9 @@ void ProjectSettings::_update_translations() {
langnames+=names[i];
}
- if (Globals::get_singleton()->has("locale/translation_remaps")) {
+ if (GlobalConfig::get_singleton()->has("locale/translation_remaps")) {
- Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps");
+ Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps");
List<Variant> rk;
remaps.get_key_list(&rk);
Vector<String> keys;
@@ -1144,7 +1105,7 @@ void ProjectSettings::_update_translations() {
t->select(0);
translation_res_option_add_button->set_disabled(false);
- StringArray selected = remaps[keys[i]];
+ PoolStringArray selected = remaps[keys[i]];
for(int j=0;j<selected.size();j++) {
String s = selected[j];
@@ -1213,41 +1174,41 @@ void ProjectSettings::set_plugins_page() {
void ProjectSettings::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_item_selected"),&ProjectSettings::_item_selected);
- ObjectTypeDB::bind_method(_MD("_item_add"),&ProjectSettings::_item_add);
- ObjectTypeDB::bind_method(_MD("_item_adds"),&ProjectSettings::_item_adds);
- ObjectTypeDB::bind_method(_MD("_item_del"),&ProjectSettings::_item_del);
- ObjectTypeDB::bind_method(_MD("_item_checked"),&ProjectSettings::_item_checked);
- ObjectTypeDB::bind_method(_MD("_save"),&ProjectSettings::_save);
- ObjectTypeDB::bind_method(_MD("_action_add"),&ProjectSettings::_action_add);
- ObjectTypeDB::bind_method(_MD("_action_adds"),&ProjectSettings::_action_adds);
- ObjectTypeDB::bind_method(_MD("_action_selected"),&ProjectSettings::_action_selected);
- ObjectTypeDB::bind_method(_MD("_action_edited"),&ProjectSettings::_action_edited);
- ObjectTypeDB::bind_method(_MD("_action_button_pressed"),&ProjectSettings::_action_button_pressed);
- ObjectTypeDB::bind_method(_MD("_update_actions"),&ProjectSettings::_update_actions);
- ObjectTypeDB::bind_method(_MD("_wait_for_key"),&ProjectSettings::_wait_for_key);
- ObjectTypeDB::bind_method(_MD("_add_item"),&ProjectSettings::_add_item);
- ObjectTypeDB::bind_method(_MD("_device_input_add"),&ProjectSettings::_device_input_add);
- ObjectTypeDB::bind_method(_MD("_press_a_key_confirm"),&ProjectSettings::_press_a_key_confirm);
- ObjectTypeDB::bind_method(_MD("_settings_prop_edited"),&ProjectSettings::_settings_prop_edited);
- ObjectTypeDB::bind_method(_MD("_copy_to_platform"),&ProjectSettings::_copy_to_platform);
- ObjectTypeDB::bind_method(_MD("_update_translations"),&ProjectSettings::_update_translations);
- ObjectTypeDB::bind_method(_MD("_translation_delete"),&ProjectSettings::_translation_delete);
- ObjectTypeDB::bind_method(_MD("_settings_changed"),&ProjectSettings::_settings_changed);
- ObjectTypeDB::bind_method(_MD("_translation_add"),&ProjectSettings::_translation_add);
- ObjectTypeDB::bind_method(_MD("_translation_file_open"),&ProjectSettings::_translation_file_open);
-
- ObjectTypeDB::bind_method(_MD("_translation_res_add"),&ProjectSettings::_translation_res_add);
- ObjectTypeDB::bind_method(_MD("_translation_res_file_open"),&ProjectSettings::_translation_res_file_open);
- ObjectTypeDB::bind_method(_MD("_translation_res_option_add"),&ProjectSettings::_translation_res_option_add);
- ObjectTypeDB::bind_method(_MD("_translation_res_option_file_open"),&ProjectSettings::_translation_res_option_file_open);
- ObjectTypeDB::bind_method(_MD("_translation_res_select"),&ProjectSettings::_translation_res_select);
- ObjectTypeDB::bind_method(_MD("_translation_res_option_changed"),&ProjectSettings::_translation_res_option_changed);
- ObjectTypeDB::bind_method(_MD("_translation_res_delete"),&ProjectSettings::_translation_res_delete);
- ObjectTypeDB::bind_method(_MD("_translation_res_option_delete"),&ProjectSettings::_translation_res_option_delete);
-
- ObjectTypeDB::bind_method(_MD("_clear_search_box"),&ProjectSettings::_clear_search_box);
- ObjectTypeDB::bind_method(_MD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar);
+ ClassDB::bind_method(_MD("_item_selected"),&ProjectSettings::_item_selected);
+ ClassDB::bind_method(_MD("_item_add"),&ProjectSettings::_item_add);
+ ClassDB::bind_method(_MD("_item_adds"),&ProjectSettings::_item_adds);
+ ClassDB::bind_method(_MD("_item_del"),&ProjectSettings::_item_del);
+ ClassDB::bind_method(_MD("_item_checked"),&ProjectSettings::_item_checked);
+ ClassDB::bind_method(_MD("_save"),&ProjectSettings::_save);
+ ClassDB::bind_method(_MD("_action_add"),&ProjectSettings::_action_add);
+ ClassDB::bind_method(_MD("_action_adds"),&ProjectSettings::_action_adds);
+ ClassDB::bind_method(_MD("_action_selected"),&ProjectSettings::_action_selected);
+ ClassDB::bind_method(_MD("_action_edited"),&ProjectSettings::_action_edited);
+ ClassDB::bind_method(_MD("_action_button_pressed"),&ProjectSettings::_action_button_pressed);
+ ClassDB::bind_method(_MD("_update_actions"),&ProjectSettings::_update_actions);
+ ClassDB::bind_method(_MD("_wait_for_key"),&ProjectSettings::_wait_for_key);
+ ClassDB::bind_method(_MD("_add_item"),&ProjectSettings::_add_item);
+ ClassDB::bind_method(_MD("_device_input_add"),&ProjectSettings::_device_input_add);
+ ClassDB::bind_method(_MD("_press_a_key_confirm"),&ProjectSettings::_press_a_key_confirm);
+ ClassDB::bind_method(_MD("_settings_prop_edited"),&ProjectSettings::_settings_prop_edited);
+ ClassDB::bind_method(_MD("_copy_to_platform"),&ProjectSettings::_copy_to_platform);
+ ClassDB::bind_method(_MD("_update_translations"),&ProjectSettings::_update_translations);
+ ClassDB::bind_method(_MD("_translation_delete"),&ProjectSettings::_translation_delete);
+ ClassDB::bind_method(_MD("_settings_changed"),&ProjectSettings::_settings_changed);
+ ClassDB::bind_method(_MD("_translation_add"),&ProjectSettings::_translation_add);
+ ClassDB::bind_method(_MD("_translation_file_open"),&ProjectSettings::_translation_file_open);
+
+ ClassDB::bind_method(_MD("_translation_res_add"),&ProjectSettings::_translation_res_add);
+ ClassDB::bind_method(_MD("_translation_res_file_open"),&ProjectSettings::_translation_res_file_open);
+ ClassDB::bind_method(_MD("_translation_res_option_add"),&ProjectSettings::_translation_res_option_add);
+ ClassDB::bind_method(_MD("_translation_res_option_file_open"),&ProjectSettings::_translation_res_option_file_open);
+ ClassDB::bind_method(_MD("_translation_res_select"),&ProjectSettings::_translation_res_select);
+ ClassDB::bind_method(_MD("_translation_res_option_changed"),&ProjectSettings::_translation_res_option_changed);
+ ClassDB::bind_method(_MD("_translation_res_delete"),&ProjectSettings::_translation_res_delete);
+ ClassDB::bind_method(_MD("_translation_res_option_delete"),&ProjectSettings::_translation_res_option_delete);
+
+ ClassDB::bind_method(_MD("_clear_search_box"),&ProjectSettings::_clear_search_box);
+ ClassDB::bind_method(_MD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar);
}
@@ -1262,7 +1223,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
tab_container = memnew( TabContainer );
add_child(tab_container);
- set_child_rect(tab_container);
+ //set_child_rect(tab_container);
//tab_container->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_BEGIN, 15 );
//tab_container->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END, 15 );
@@ -1347,6 +1308,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
globals_editor = memnew( SectionedPropertyEditor );
props_base->add_child(globals_editor);
+ globals_editor->get_property_editor()->set_undo_redo(EditorNode::get_singleton()->get_undo_redo());
//globals_editor->hide_top_label();
globals_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
globals_editor->get_property_editor()->register_text_enter(search_box);
@@ -1389,13 +1351,13 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
}
- popup_platform->get_popup()->connect("item_pressed",this,"_copy_to_platform");
+ popup_platform->get_popup()->connect("id_pressed",this,"_copy_to_platform");
get_ok()->set_text(TTR("Close"));
set_hide_on_ok(true);
message = memnew( ConfirmationDialog );
add_child(message);
-// message->get_cancel()->hide();
+ //message->get_cancel()->hide();
message->set_hide_on_ok(true);
Control *input_base = memnew( Control );
@@ -1437,7 +1399,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
input_editor->connect("button_pressed",this,"_action_button_pressed");
popup_add = memnew( PopupMenu );
add_child(popup_add);
- popup_add->connect("item_pressed",this,"_add_item");
+ popup_add->connect("id_pressed",this,"_add_item");
press_a_key = memnew( ConfirmationDialog );
press_a_key->set_focus_mode(FOCUS_ALL);
@@ -1451,7 +1413,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
l->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_BEGIN,30);
press_a_key_label=l;
press_a_key->add_child(l);
- press_a_key->connect("input_event",this,"_wait_for_key");
+ press_a_key->connect("gui_input",this,"_wait_for_key");
press_a_key->connect("confirmed",this,"_press_a_key_confirm");
@@ -1462,7 +1424,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
hbc = memnew( HBoxContainer );
device_input->add_child(hbc);
- device_input->set_child_rect(hbc);
+ //device_input->set_child_rect(hbc);
VBoxContainer *vbc_left = memnew( VBoxContainer );
hbc->add_child(vbc_left);
@@ -1472,7 +1434,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
vbc_left->add_child(l);
device_id = memnew( SpinBox );
- device_id->set_val(0);
+ device_id->set_value(0);
vbc_left->add_child(device_id);
VBoxContainer *vbc_right = memnew( VBoxContainer );
@@ -1606,7 +1568,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
timer = memnew( Timer );
timer->set_wait_time(1.5);
- timer->connect("timeout",Globals::get_singleton(),"save");
+ timer->connect("timeout",GlobalConfig::get_singleton(),"save");
timer->set_one_shot(true);
add_child(timer);
diff --git a/tools/editor/project_settings.h b/tools/editor/project_settings.h
index 61ad094d00..bb925a5fd9 100644
--- a/tools/editor/project_settings.h
+++ b/tools/editor/project_settings.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,7 +40,7 @@
//#include "project_export_settings.h"
class ProjectSettings : public AcceptDialog {
- OBJ_TYPE( ProjectSettings, AcceptDialog );
+ GDCLASS( ProjectSettings, AcceptDialog );
TabContainer *tab_container;
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 1a8d373f7f..8f294a5102 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -47,6 +47,7 @@
#include "editor_file_system.h"
#include "create_dialog.h"
#include "property_selector.h"
+#include "globals.h"
void CustomPropertyEditor::_notification(int p_what) {
@@ -173,9 +174,9 @@ void CustomPropertyEditor::_menu_option(int p_which) {
propvalues.push_back(p);
}
- String orig_type = res_orig->get_type();
+ String orig_type = res_orig->get_class();
- Object *inst = ObjectTypeDB::instance( orig_type );
+ Object *inst = ClassDB::instance( orig_type );
Ref<Resource> res = Ref<Resource>( inst->cast_to<Resource>() );
@@ -226,15 +227,26 @@ void CustomPropertyEditor::_menu_option(int p_which) {
ERR_FAIL_COND( inheritors_array.empty() );
+
+
String intype=inheritors_array[p_which-TYPE_BASE_ID];
- Object *obj = ObjectTypeDB::instance(intype);
+ if (intype=="ViewportTexture") {
+
+ scene_tree->set_title(TTR("Pick a Viewport"));
+ scene_tree->popup_centered_ratio();
+ picking_viewport=true;
+ return;
+
+ }
+
+ Object *obj = ClassDB::instance(intype);
ERR_BREAK( !obj );
Resource *res=obj->cast_to<Resource>();
ERR_BREAK( !res );
if (owner && hint==PROPERTY_HINT_RESOURCE_TYPE && hint_text=="Script") {
//make visual script the right type
- res->call("set_instance_base_type",owner->get_type());
+ res->call("set_instance_base_type",owner->get_class());
}
v=Ref<Resource>(res).get_ref_ptr();
@@ -295,6 +307,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
action_buttons[i]->hide();
}
+ checks20gc->hide();
for(int i=0;i<20;i++)
checks20[i]->hide();
@@ -305,12 +318,16 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
case Variant::BOOL: {
+ checks20gc->show();
+
CheckBox *c=checks20[0];
c->set_text("True");
- c->set_pos(Vector2(4,4));
+ checks20gc->set_pos(Vector2(4,4));
c->set_pressed(v);
c->show();
- set_size(checks20[0]->get_pos()+checks20[0]->get_size()+Vector2(4,4)*EDSCALE);
+
+ checks20gc->set_size(checks20gc->get_minimum_size());
+ set_size(checks20gc->get_pos()+checks20gc->get_size()+Vector2(4,4)*EDSCALE);
} break;
case Variant::INT:
@@ -328,27 +345,27 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
if (c>=2) {
if (!hint_text.get_slice(",",1).empty())
- max=hint_text.get_slice(",",1).to_double();
+ max=hint_text.get_slice(",",1).to_double();
}
- if (type==Variant::REAL && c>=3) {
+ if (c>=3) {
if (!hint_text.get_slice(",",2).empty())
- step= hint_text.get_slice(",",2).to_double();
+ step= hint_text.get_slice(",",2).to_double();
}
if (c>=4 && hint_text.get_slice(",",3)=="slider") {
slider->set_min(min);
slider->set_max(max);
- slider->set_step((type==Variant::REAL) ? step : 1);
- slider->set_val(v);
+ slider->set_step(step);
+ slider->set_value(v);
slider->show();
set_size(Size2(110,30)*EDSCALE);
} else {
spinbox->set_min(min);
spinbox->set_max(max);
- spinbox->set_step((type==Variant::REAL) ? step : 1);
- spinbox->set_val(v);
+ spinbox->set_step(step);
+ spinbox->set_value(v);
spinbox->show();
set_size(Size2(70,35)*EDSCALE);
}
@@ -367,10 +384,19 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
return false;
- } else if (hint==PROPERTY_HINT_ALL_FLAGS) {
+ } else if (hint==PROPERTY_HINT_LAYERS_2D_PHYSICS || hint==PROPERTY_HINT_LAYERS_2D_RENDER || hint==PROPERTY_HINT_LAYERS_3D_PHYSICS || hint==PROPERTY_HINT_LAYERS_3D_RENDER) {
- checks20[0]->set_text("");
+ String title;
+ String basename;
+ switch (hint) {
+ case PROPERTY_HINT_LAYERS_2D_RENDER: basename="layer_names/2d_render"; title="2D Render Layers"; break;
+ case PROPERTY_HINT_LAYERS_2D_PHYSICS: basename="layer_names/2d_physics"; title="2D Physics Layers"; break;
+ case PROPERTY_HINT_LAYERS_3D_RENDER: basename="layer_names/3d_render"; title="3D Render Layers"; break;
+ case PROPERTY_HINT_LAYERS_3D_PHYSICS: basename="layer_names/3d_physics";title="3D Physics Layers"; break;
+ }
+
+ checks20gc->show();
uint32_t flgs = v;
for(int i=0;i<2;i++) {
@@ -378,12 +404,9 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
ofs.y+=22*i;
for(int j=0;j<10;j++) {
- CheckBox *c=checks20[i*10+j];
- Point2 o=ofs;
- o.x+=j*22;
- if (j>=5)
- o.x+=4;
- c->set_pos(o);
+ int idx = i*10+j;
+ CheckBox *c=checks20[idx];
+ c->set_text(GlobalConfig::get_singleton()->get(basename+"/layer_"+itos(idx+1)));
c->set_pressed( flgs & (1<<(i*10+j)) );
c->show();
}
@@ -391,7 +414,16 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
}
- set_size(checks20[19]->get_pos()+Size2(20,25)*EDSCALE);
+ show();
+
+ value_label[0]->set_text(title);
+ value_label[0]->show();
+ value_label[0]->set_pos(Vector2(4,4)*EDSCALE);
+
+ checks20gc->set_pos(Vector2(4,4)*EDSCALE+Vector2(0,value_label[0]->get_size().height+4*EDSCALE));
+ checks20gc->set_size(checks20gc->get_minimum_size());
+
+ set_size(Vector2(4,4)*EDSCALE+checks20gc->get_pos()+checks20gc->get_size());
} else if (hint==PROPERTY_HINT_EXP_EASING) {
@@ -689,7 +721,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
value_editor[3]->set_text( String::num( q.w ) );
} break;
- case Variant::_AABB: {
+ case Variant::RECT3: {
List<String> names;
names.push_back("px");
@@ -700,7 +732,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
names.push_back("sz");
config_value_editors(6,3,16,names);
- AABB aabb=v;
+ Rect3 aabb=v;
value_editor[0]->set_text( String::num( aabb.pos.x ) );
value_editor[1]->set_text( String::num( aabb.pos.y ) );
value_editor[2]->set_text( String::num( aabb.pos.z ) );
@@ -709,7 +741,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
value_editor[5]->set_text( String::num( aabb.size.z ) );
} break;
- case Variant::MATRIX32: {
+ case Variant::TRANSFORM2D: {
List<String> names;
names.push_back("xx");
@@ -720,14 +752,14 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
names.push_back("oy");
config_value_editors(6,2,16,names);
- Matrix32 basis=v;
+ Transform2D basis=v;
for(int i=0;i<6;i++) {
value_editor[i]->set_text( String::num( basis.elements[i/2][i%2] ) );
}
} break;
- case Variant::MATRIX3: {
+ case Variant::BASIS: {
List<String> names;
names.push_back("xx");
@@ -741,7 +773,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
names.push_back("zz");
config_value_editors(9,3,16,names);
- Matrix3 basis=v;
+ Basis basis=v;
for(int i=0;i<9;i++) {
value_editor[i]->set_text( String::num( basis.elements[i/3][i%3] ) );
@@ -792,7 +824,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
color_picker->show();
color_picker->set_edit_alpha(hint!=PROPERTY_HINT_COLOR_NO_ALPHA);
- color_picker->set_color(v);
+ color_picker->set_pick_color(v);
set_size( Size2(300*EDSCALE, color_picker->get_combined_minimum_size().height+10*EDSCALE));
color_picker->set_focus_on_line_edit();
/*
@@ -871,7 +903,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
Set<String> valid_inheritors;
valid_inheritors.insert(base);
List<StringName> inheritors;
- ObjectTypeDB::get_inheriters_from(base.strip_edges(),&inheritors);
+ ClassDB::get_inheriters_from_class(base.strip_edges(),&inheritors);
List<StringName>::Element *E=inheritors.front();
while(E) {
valid_inheritors.insert(E->get());
@@ -880,7 +912,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
for(Set<String>::Element *E=valid_inheritors.front();E;E=E->next()) {
String t = E->get();
- if (!ObjectTypeDB::can_instance(t))
+ if (!ClassDB::can_instance(t))
continue;
inheritors_array.push_back(t);
@@ -934,7 +966,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
paste_valid=true;
else
for (int i = 0; i < hint_text.get_slice_count(",");i++)
- if (ObjectTypeDB::is_type(cb->get_type(),hint_text.get_slice(",",i))) {
+ if (ClassDB::is_parent_class(cb->get_class(),hint_text.get_slice(",",i))) {
paste_valid=true;
break;
}
@@ -973,27 +1005,27 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
} break;
- case Variant::RAW_ARRAY: {
+ case Variant::POOL_BYTE_ARRAY: {
} break;
- case Variant::INT_ARRAY: {
+ case Variant::POOL_INT_ARRAY: {
} break;
- case Variant::REAL_ARRAY: {
+ case Variant::POOL_REAL_ARRAY: {
} break;
- case Variant::STRING_ARRAY: {
+ case Variant::POOL_STRING_ARRAY: {
} break;
- case Variant::VECTOR3_ARRAY: {
+ case Variant::POOL_VECTOR3_ARRAY: {
} break;
- case Variant::COLOR_ARRAY: {
+ case Variant::POOL_COLOR_ARRAY: {
} break;
@@ -1012,7 +1044,7 @@ void CustomPropertyEditor::_file_selected(String p_file) {
if (hint==PROPERTY_HINT_FILE || hint==PROPERTY_HINT_DIR) {
- v=Globals::get_singleton()->localize_path(p_file);
+ v=GlobalConfig::get_singleton()->localize_path(p_file);
emit_signal("variant_changed");
hide();
}
@@ -1095,13 +1127,13 @@ void CustomPropertyEditor::_type_create_selected(int p_idx) {
ERR_FAIL_INDEX(p_idx,inheritors_array.size());
//List<String> inheritors;
- //ObjectTypeDB::get_inheriters_from(hint_text,&inheritors);
+ //ClassDB::get_inheriters_from(hint_text,&inheritors);
//inheritors.push_front(hint_text);
//ERR_FAIL_INDEX( p_idx, inheritors.size() );
String intype=inheritors_array[p_idx];
- Object *obj = ObjectTypeDB::instance(intype);
+ Object *obj = ClassDB::instance(intype);
ERR_FAIL_COND( !obj );
@@ -1126,6 +1158,22 @@ void CustomPropertyEditor::_color_changed(const Color& p_color) {
void CustomPropertyEditor::_node_path_selected(NodePath p_path) {
+ if (picking_viewport) {
+
+ Node* to_node=get_node(p_path);
+ if (!to_node->cast_to<Viewport>()) {
+ EditorNode::get_singleton()->show_warning("Selected node is not a Viewport!");
+ return;
+ }
+
+ Ref<ViewportTexture> vt;
+ vt.instance();
+ vt->set_viewport_path_in_scene(get_tree()->get_edited_scene_root()->get_path_to(to_node));
+ vt->setup_local_to_scene();
+ v=vt;
+ emit_signal("variant_changed");
+ return;
+ }
if (hint==PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE && hint_text!=String()) {
@@ -1142,9 +1190,9 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) {
Node *node=NULL;
- if (owner->is_type("Node"))
+ if (owner->is_class("Node"))
node = owner->cast_to<Node>();
- else if (owner->is_type("ArrayPropertyEdit"))
+ else if (owner->is_class("ArrayPropertyEdit"))
node = owner->cast_to<ArrayPropertyEdit>()->get_node();
if (!node) {
@@ -1179,7 +1227,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
} break;
case Variant::INT: {
- if (hint==PROPERTY_HINT_ALL_FLAGS) {
+ if (hint==PROPERTY_HINT_LAYERS_2D_PHYSICS || hint==PROPERTY_HINT_LAYERS_2D_RENDER || hint==PROPERTY_HINT_LAYERS_3D_PHYSICS || hint==PROPERTY_HINT_LAYERS_3D_RENDER) {
uint32_t f = v;
if (checks20[p_which]->is_pressed())
@@ -1262,7 +1310,8 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
if (p_which==0) {
-
+ picking_viewport=false;
+ scene_tree->set_title(TTR("Pick a Node"));
scene_tree->popup_centered_ratio();
} else if (p_which==1) {
@@ -1285,7 +1334,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
if (hint==PROPERTY_HINT_RESOURCE_TYPE) {
- Object *obj = ObjectTypeDB::instance(intype);
+ Object *obj = ClassDB::instance(intype);
ERR_BREAK( !obj );
Resource *res=obj->cast_to<Resource>();
ERR_BREAK( !res );
@@ -1353,7 +1402,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
propvalues.push_back(p);
}
- Ref<Resource> res = Ref<Resource>( ObjectTypeDB::instance( res_orig->get_type() ));
+ Ref<Resource> res = Ref<Resource>( ClassDB::instance( res_orig->get_class() ));
ERR_FAIL_COND(res.is_null());
@@ -1654,7 +1703,7 @@ void CustomPropertyEditor::_modified(String p_string) {
emit_signal("variant_changed");
} break;
- case Variant::_AABB: {
+ case Variant::RECT3: {
Vector3 pos;
Vector3 size;
@@ -1674,13 +1723,13 @@ void CustomPropertyEditor::_modified(String p_string) {
size.y=value_editor[4]->get_text().to_double();
size.z=value_editor[5]->get_text().to_double();
}
- v=AABB(pos,size);
+ v=Rect3(pos,size);
emit_signal("variant_changed");
} break;
- case Variant::MATRIX32: {
+ case Variant::TRANSFORM2D: {
- Matrix32 m;
+ Transform2D m;
for(int i=0;i<6;i++) {
if (evaluator) {
m.elements[i/2][i%2]=evaluator->eval(value_editor[i]->get_text());
@@ -1693,9 +1742,9 @@ void CustomPropertyEditor::_modified(String p_string) {
emit_signal("variant_changed");
} break;
- case Variant::MATRIX3: {
+ case Variant::BASIS: {
- Matrix3 m;
+ Basis m;
for(int i=0;i<9;i++) {
if (evaluator) {
@@ -1711,7 +1760,7 @@ void CustomPropertyEditor::_modified(String p_string) {
} break;
case Variant::TRANSFORM: {
- Matrix3 basis;
+ Basis basis;
for(int i=0;i<9;i++) {
if (evaluator) {
@@ -1771,27 +1820,27 @@ void CustomPropertyEditor::_modified(String p_string) {
} break;
- case Variant::RAW_ARRAY: {
+ case Variant::POOL_BYTE_ARRAY: {
} break;
- case Variant::INT_ARRAY: {
+ case Variant::POOL_INT_ARRAY: {
} break;
- case Variant::REAL_ARRAY: {
+ case Variant::POOL_REAL_ARRAY: {
} break;
- case Variant::STRING_ARRAY: {
+ case Variant::POOL_STRING_ARRAY: {
} break;
- case Variant::VECTOR3_ARRAY: {
+ case Variant::POOL_VECTOR3_ARRAY: {
} break;
- case Variant::COLOR_ARRAY: {
+ case Variant::POOL_COLOR_ARRAY: {
} break;
@@ -1816,9 +1865,9 @@ void CustomPropertyEditor::_focus_enter() {
case Variant::VECTOR3:
case Variant::PLANE:
case Variant::QUAT:
- case Variant::_AABB:
- case Variant::MATRIX32:
- case Variant::MATRIX3:
+ case Variant::RECT3:
+ case Variant::TRANSFORM2D:
+ case Variant::BASIS:
case Variant::TRANSFORM: {
for (int i=0;i<MAX_VALUE_EDITORS;++i) {
if (value_editor[i]->has_focus()) {
@@ -1841,9 +1890,9 @@ void CustomPropertyEditor::_focus_exit() {
case Variant::VECTOR3:
case Variant::PLANE:
case Variant::QUAT:
- case Variant::_AABB:
- case Variant::MATRIX32:
- case Variant::MATRIX3:
+ case Variant::RECT3:
+ case Variant::TRANSFORM2D:
+ case Variant::BASIS:
case Variant::TRANSFORM: {
for (int i=0;i<MAX_VALUE_EDITORS;++i) {
value_editor[i]->select(0, 0);
@@ -1914,22 +1963,22 @@ void CustomPropertyEditor::config_value_editors(int p_amount, int p_columns,int
void CustomPropertyEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_focus_enter", &CustomPropertyEditor::_focus_enter);
- ObjectTypeDB::bind_method("_focus_exit", &CustomPropertyEditor::_focus_exit);
- ObjectTypeDB::bind_method("_modified",&CustomPropertyEditor::_modified);
- ObjectTypeDB::bind_method("_range_modified", &CustomPropertyEditor::_range_modified);
- ObjectTypeDB::bind_method("_scroll_modified",&CustomPropertyEditor::_scroll_modified);
- ObjectTypeDB::bind_method("_action_pressed",&CustomPropertyEditor::_action_pressed);
- ObjectTypeDB::bind_method("_file_selected",&CustomPropertyEditor::_file_selected);
- ObjectTypeDB::bind_method("_type_create_selected",&CustomPropertyEditor::_type_create_selected);
- ObjectTypeDB::bind_method("_node_path_selected",&CustomPropertyEditor::_node_path_selected);
- ObjectTypeDB::bind_method("_color_changed",&CustomPropertyEditor::_color_changed);
- ObjectTypeDB::bind_method("_draw_easing",&CustomPropertyEditor::_draw_easing);
- ObjectTypeDB::bind_method("_drag_easing",&CustomPropertyEditor::_drag_easing);
- ObjectTypeDB::bind_method( "_text_edit_changed",&CustomPropertyEditor::_text_edit_changed);
- ObjectTypeDB::bind_method( "_menu_option",&CustomPropertyEditor::_menu_option);
- ObjectTypeDB::bind_method( "_create_dialog_callback",&CustomPropertyEditor::_create_dialog_callback);
- ObjectTypeDB::bind_method( "_create_selected_property",&CustomPropertyEditor::_create_selected_property);
+ ClassDB::bind_method("_focus_enter", &CustomPropertyEditor::_focus_enter);
+ ClassDB::bind_method("_focus_exit", &CustomPropertyEditor::_focus_exit);
+ ClassDB::bind_method("_modified",&CustomPropertyEditor::_modified);
+ ClassDB::bind_method("_range_modified", &CustomPropertyEditor::_range_modified);
+ ClassDB::bind_method("_scroll_modified",&CustomPropertyEditor::_scroll_modified);
+ ClassDB::bind_method("_action_pressed",&CustomPropertyEditor::_action_pressed);
+ ClassDB::bind_method("_file_selected",&CustomPropertyEditor::_file_selected);
+ ClassDB::bind_method("_type_create_selected",&CustomPropertyEditor::_type_create_selected);
+ ClassDB::bind_method("_node_path_selected",&CustomPropertyEditor::_node_path_selected);
+ ClassDB::bind_method("_color_changed",&CustomPropertyEditor::_color_changed);
+ ClassDB::bind_method("_draw_easing",&CustomPropertyEditor::_draw_easing);
+ ClassDB::bind_method("_drag_easing",&CustomPropertyEditor::_drag_easing);
+ ClassDB::bind_method( "_text_edit_changed",&CustomPropertyEditor::_text_edit_changed);
+ ClassDB::bind_method( "_menu_option",&CustomPropertyEditor::_menu_option);
+ ClassDB::bind_method( "_create_dialog_callback",&CustomPropertyEditor::_create_dialog_callback);
+ ClassDB::bind_method( "_create_selected_property",&CustomPropertyEditor::_create_selected_property);
@@ -1951,8 +2000,8 @@ CustomPropertyEditor::CustomPropertyEditor() {
value_editor[i]->hide();
value_label[i]->hide();
value_editor[i]->connect("text_entered", this,"_modified");
- value_editor[i]->connect("focus_enter", this, "_focus_enter");
- value_editor[i]->connect("focus_exit", this, "_focus_exit");
+ value_editor[i]->connect("focus_entered", this, "_focus_enter");
+ value_editor[i]->connect("focus_exited", this, "_focus_exit");
}
for(int i=0;i<4;i++) {
@@ -1967,11 +2016,21 @@ CustomPropertyEditor::CustomPropertyEditor() {
}
+ checks20gc = memnew( GridContainer );
+ add_child(checks20gc);
+ checks20gc->set_columns(11);
+
for(int i=0;i<20;i++) {
+ if (i==5 || i==15) {
+ Control *space = memnew( Control );
+ space->set_custom_minimum_size(Size2(20,0)*EDSCALE);
+ checks20gc->add_child(space);
+ }
+
checks20[i]=memnew( CheckBox );
checks20[i]->set_toggle_mode(true);
- checks20[i]->set_focus_mode(FOCUS_NONE);
- add_child(checks20[i]);
+ checks20[i]->set_focus_mode(FOCUS_NONE);
+ checks20gc->add_child(checks20[i]);
checks20[i]->hide();
checks20[i]->connect("pressed",this,"_action_pressed",make_binds(i));
checks20[i]->set_tooltip(vformat(TTR("Bit %d, val %d."), i, 1<<i));
@@ -2017,7 +2076,7 @@ CustomPropertyEditor::CustomPropertyEditor() {
type_button = memnew( MenuButton );
add_child(type_button);
type_button->hide();
- type_button->get_popup()->connect("item_pressed", this,"_type_create_selected");
+ type_button->get_popup()->connect("id_pressed", this,"_type_create_selected");
scene_tree = memnew( SceneTreeDialog );
@@ -2025,7 +2084,7 @@ CustomPropertyEditor::CustomPropertyEditor() {
scene_tree->connect("selected", this,"_node_path_selected");
scene_tree->get_scene_tree()->set_show_enabled_subscene(true);
- texture_preview = memnew( TextureFrame );
+ texture_preview = memnew( TextureRect );
add_child( texture_preview);
texture_preview->hide();
@@ -2033,13 +2092,13 @@ CustomPropertyEditor::CustomPropertyEditor() {
add_child(easing_draw);
easing_draw->hide();
easing_draw->connect("draw",this,"_draw_easing");
- easing_draw->connect("input_event",this,"_drag_easing");
+ easing_draw->connect("gui_input",this,"_drag_easing");
//easing_draw->emit_signal(SceneStringNames::get_singleton()->input_event,InputEvent());
easing_draw->set_default_cursor_shape(Control::CURSOR_MOVE);
menu = memnew(PopupMenu);
add_child(menu);
- menu->connect("item_pressed",this,"_menu_option");
+ menu->connect("id_pressed",this,"_menu_option");
evaluator = NULL;
@@ -2102,7 +2161,7 @@ bool PropertyEditor::_get_instanced_node_original_property(const StringName& p_p
bool found=false;
-// print_line("for prop - "+String(p_prop));
+ //print_line("for prop - "+String(p_prop));
while(node) {
@@ -2115,13 +2174,13 @@ bool PropertyEditor::_get_instanced_node_original_property(const StringName& p_p
} else {
ss=node->get_scene_instance_state();
}
- // print_line("at - "+String(edited_scene->get_path_to(node)));
+ //print_line("at - "+String(edited_scene->get_path_to(node)));
if (ss.is_valid()) {
NodePath np = node->get_path_to(orig);
int node_idx = ss->find_node_by_path(np);
- // print_line("\t valid, nodeidx "+itos(node_idx));
+ //print_line("\t valid, nodeidx "+itos(node_idx));
if (node_idx>=0) {
bool lfound=false;
Variant lvar;
@@ -2130,7 +2189,7 @@ bool PropertyEditor::_get_instanced_node_original_property(const StringName& p_p
found=true;
value=lvar;
- // print_line("\t found value "+String(value));
+ //print_line("\t found value "+String(value));
}
}
}
@@ -2156,7 +2215,7 @@ bool PropertyEditor::_is_property_different(const Variant& p_current, const Vari
Node* edited_scene =EditorNode::get_singleton()->get_edited_scene();
bool found_state=false;
- // print_line("for prop - "+String(p_prop));
+ //print_line("for prop - "+String(p_prop));
while(node) {
@@ -2274,7 +2333,7 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p
case Variant::REAL:
case Variant::INT: {
- if (p_hint==PROPERTY_HINT_ALL_FLAGS) {
+ if (p_hint==PROPERTY_HINT_LAYERS_2D_PHYSICS || p_hint==PROPERTY_HINT_LAYERS_2D_RENDER || p_hint==PROPERTY_HINT_LAYERS_3D_PHYSICS || p_hint==PROPERTY_HINT_LAYERS_3D_RENDER) {
tree->update();
break;
}
@@ -2360,10 +2419,10 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p
case Variant::VECTOR3:
case Variant::QUAT:
case Variant::VECTOR2:
- case Variant::_AABB:
+ case Variant::RECT3:
case Variant::RECT2:
- case Variant::MATRIX32:
- case Variant::MATRIX3:
+ case Variant::TRANSFORM2D:
+ case Variant::BASIS:
case Variant::TRANSFORM: {
p_item->set_text(1,obj->get(p_name));
@@ -2404,8 +2463,8 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p
} else {
RES res = obj->get( p_name ).operator RefPtr();
- if (res->is_type("Texture")) {
- int tw = EditorSettings::get_singleton()->get("property_editor/texture_preview_width");
+ if (res->is_class("Texture")) {
+ int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width");
p_item->set_icon_max_width(1,tw);
p_item->set_icon(1,res);
p_item->set_text(1,"");
@@ -2416,20 +2475,20 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p
} else if (res->get_path()!="" && !res->get_path().begins_with("local://")) {
p_item->set_text(1, res->get_path().get_file());
} else {
- p_item->set_text(1,"<"+res->get_type()+">");
+ p_item->set_text(1,"<"+res->get_class()+">");
};
if (res.is_valid() && res->get_path().is_resource_file()) {
p_item->set_tooltip(1,res->get_path());
} else if (res.is_valid()) {
- p_item->set_tooltip(1,res->get_name()+" ("+res->get_type()+")");
+ p_item->set_tooltip(1,res->get_name()+" ("+res->get_class()+")");
}
- if (has_icon(res->get_type(),"EditorIcons")) {
+ if (has_icon(res->get_class(),"EditorIcons")) {
- p_item->set_icon(0,get_icon(res->get_type(),"EditorIcons"));
+ p_item->set_icon(0,get_icon(res->get_class(),"EditorIcons"));
} else {
Dictionary d = p_item->get_metadata(0);
@@ -2448,7 +2507,7 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p
}
}
- if (!res->is_type("Texture")) {
+ if (!res->is_class("Texture")) {
//texture already previews via itself
EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res,this,"_resource_preview_done",p_item->get_instance_ID());
}
@@ -2509,6 +2568,12 @@ void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) {
}
+ if (obj->call("property_can_revert",p_name).operator bool()) {
+
+ has_reload=true;
+ }
+
+
if (!has_reload && !obj->get_script().is_null()) {
Ref<Script> scr = obj->get_script();
Variant orig_value;
@@ -2555,7 +2620,7 @@ bool PropertyEditor::_is_drop_valid(const Dictionary& p_drag_data, const Diction
Ref<Resource> res = drag_data["resource"];
for(int i=0;i<allowed_type.get_slice_count(",");i++) {
String at = allowed_type.get_slice(",",i).strip_edges();
- if (res.is_valid() && ObjectTypeDB::is_type(res->get_type(),at)) {
+ if (res.is_valid() && ClassDB::is_parent_class(res->get_class(),at)) {
return true;
}
}
@@ -2573,7 +2638,7 @@ bool PropertyEditor::_is_drop_valid(const Dictionary& p_drag_data, const Diction
for(int i=0;i<allowed_type.get_slice_count(",");i++) {
String at = allowed_type.get_slice(",",i).strip_edges();
- if (ObjectTypeDB::is_type(ftype,at)) {
+ if (ClassDB::is_parent_class(ftype,at)) {
return true;
}
}
@@ -2737,13 +2802,13 @@ void PropertyEditor::_notification(int p_what) {
if (p_what==NOTIFICATION_DRAG_BEGIN) {
- if (is_visible() && tree->get_root()) {
+ if (is_visible_in_tree() && tree->get_root()) {
_mark_drop_fields(tree->get_root());
}
}
if (p_what==NOTIFICATION_DRAG_END) {
- if (is_visible() && tree->get_root()) {
+ if (is_visible_in_tree() && tree->get_root()) {
_clear_drop_fields(tree->get_root());
}
@@ -2802,7 +2867,7 @@ TreeItem *PropertyEditor::get_parent_node(String p_path,HashMap<String,TreeItem*
item = item_paths.get(p_path);
} else {
-// printf("path %s parent path %s - item name %s\n",p_path.ascii().get_data(),p_path.left( p_path.find_last("/") ).ascii().get_data(),p_path.right( p_path.find_last("/") ).ascii().get_data() );
+ //printf("path %s parent path %s - item name %s\n",p_path.ascii().get_data(),p_path.left( p_path.find_last("/") ).ascii().get_data(),p_path.right( p_path.find_last("/") ).ascii().get_data() );
TreeItem *parent = get_parent_node( p_path.left( p_path.find_last("/") ),item_paths,root );
item = tree->create_item( parent );
@@ -2923,7 +2988,7 @@ void PropertyEditor::refresh() {
if (refresh_countdown>0)
return;
- refresh_countdown=EditorSettings::get_singleton()->get("property_editor/auto_refresh_interval");
+ refresh_countdown=EditorSettings::get_singleton()->get("docks/property_editor/auto_refresh_interval");
}
@@ -2998,6 +3063,8 @@ void PropertyEditor::update_tree() {
TreeItem * current_category=NULL;
String filter = search_box ? search_box->get_text() : "";
+ String group;
+ String group_base;
for (List<PropertyInfo>::Element *I=plist.front() ; I ; I=I->next()) {
@@ -3005,7 +3072,17 @@ void PropertyEditor::update_tree() {
//make sure the property can be edited
- if (p.usage&PROPERTY_USAGE_CATEGORY) {
+ if (p.usage&PROPERTY_USAGE_GROUP) {
+
+ group=p.name;
+ group_base=p.hint_string;
+
+ continue;
+
+ } else if (p.usage&PROPERTY_USAGE_CATEGORY) {
+
+ group="";
+ group_base="";
if (!show_categories)
continue;
@@ -3049,7 +3126,7 @@ void PropertyEditor::update_tree() {
if (E) {
descr=E->get().brief_description;
}
- class_descr_cache[type]=descr.world_wrap(80);
+ class_descr_cache[type]=descr.word_wrap(80);
}
@@ -3062,12 +3139,27 @@ void PropertyEditor::update_tree() {
} else if ( ! (p.usage&PROPERTY_USAGE_EDITOR ) )
continue;
- String name = (p.name.find("/")!=-1)?p.name.right( p.name.find_last("/")+1 ):p.name;
+ String basename=p.name;
+ if (group!="") {
+ if (group_base!="") {
+ if (basename.begins_with(group_base)) {
+ basename=basename.replace_first(group_base,"");
+ } else {
+ group=""; //no longer using group base, clear
+ }
+ }
+ }
+
+ if (group!="") {
+ basename=group+"/"+basename;
+ }
+
+ String name = (basename.find("/")!=-1)?basename.right( basename.find_last("/")+1 ):basename;
if (capitalize_paths)
name = name.camelcase_to_underscore().capitalize();
- String path=p.name.left( p.name.find_last("/") ) ;
+ String path=basename.left( basename.find_last("/") ) ;
if (use_filter && filter!="") {
@@ -3080,10 +3172,12 @@ void PropertyEditor::update_tree() {
continue;
}
- //printf("property %s\n",p.name.ascii().get_data());
+ //printf("property %s\n",basename.ascii().get_data());
TreeItem * parent = get_parent_node(path,item_path,current_category?current_category:root );
- //if (parent->get_parent()==root)
- // parent=root;
+ /*
+ if (parent->get_parent()==root)
+ parent=root;
+ */
int level = 0;
if (parent!=root) {
level++;
@@ -3122,7 +3216,7 @@ void PropertyEditor::update_tree() {
if (use_doc_hints) {
StringName setter;
StringName type;
- if (ObjectTypeDB::get_setter_and_type_for_property(obj->get_type_name(),p.name,type,setter)) {
+ if (ClassDB::get_setter_and_type_for_property(obj->get_class_name(),p.name,type,setter)) {
String descr;
bool found=false;
@@ -3142,7 +3236,7 @@ void PropertyEditor::update_tree() {
if (E) {
for(int i=0;i<E->get().methods.size();i++) {
if (E->get().methods[i].name==setter.operator String()) {
- descr=E->get().methods[i].description.strip_edges().world_wrap(80);
+ descr=E->get().methods[i].description.strip_edges().word_wrap(80);
}
}
}
@@ -3182,6 +3276,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CHECK );
item->set_text(1,TTR("On"));
+ item->set_tooltip(1, obj->get(p.name) ? "True" : "False");
item->set_checked( 1, obj->get( p.name ) );
if (show_type_icons)
item->set_icon( 0, get_icon("Bool","EditorIcons") );
@@ -3203,7 +3298,7 @@ void PropertyEditor::update_tree() {
}
- if (p.hint==PROPERTY_HINT_ALL_FLAGS) {
+ if (p.hint==PROPERTY_HINT_LAYERS_2D_PHYSICS || p.hint==PROPERTY_HINT_LAYERS_2D_RENDER || p.hint==PROPERTY_HINT_LAYERS_3D_PHYSICS || p.hint==PROPERTY_HINT_LAYERS_3D_RENDER) {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable(1,!read_only);
@@ -3257,7 +3352,7 @@ void PropertyEditor::update_tree() {
max=p.hint_string.get_slice(",",1).to_double();
}
- if (p.type==Variant::REAL && c>=3) {
+ if (p.hint!=PROPERTY_HINT_SPRITE_FRAME && c>=3) {
step= p.hint_string.get_slice(",",2).to_double();
}
@@ -3266,7 +3361,7 @@ void PropertyEditor::update_tree() {
item->set_range_config(1,min,max,step,p.hint==PROPERTY_HINT_EXP_RANGE);
} else if (p.hint==PROPERTY_HINT_ENUM) {
-// int c = p.hint_string.get_slice_count(",");
+ //int c = p.hint_string.get_slice_count(",");
item->set_text(1,p.hint_string);
if (show_type_icons)
item->set_icon( 0,get_icon("Enum","EditorIcons") );
@@ -3275,7 +3370,7 @@ void PropertyEditor::update_tree() {
break;
} else if (p.hint==PROPERTY_HINT_OBJECT_ID) {
-// int c = p.hint_string.get_slice_count(",");
+ //int c = p.hint_string.get_slice_count(",");
item->set_cell_mode(1,TreeItem::CELL_MODE_CUSTOM);
String type=p.hint_string;
@@ -3402,17 +3497,37 @@ void PropertyEditor::update_tree() {
Variant v = obj->get(p.name);
+ String type_name = "Array";
+ String type_name_suffix = "";
+
+ String hint = p.hint_string;
+ while(hint.begins_with(itos(Variant::ARRAY)+":")) {
+ type_name += "<Array";
+ type_name_suffix += ">";
+ hint = hint.substr(2, hint.size()-2);
+ }
+ if(hint.find(":") >= 0) {
+ hint = hint.substr(0,hint.find(":"));
+ if(hint.find("/") >= 0) {
+ hint = hint.substr(0,hint.find("/"));
+ }
+ type_name += "<" + Variant::get_type_name(Variant::Type(hint.to_int()));
+ type_name_suffix += ">";
+ }
+ type_name += type_name_suffix;
+
if (v.is_array())
- item->set_text(1,"Array["+itos(v.call("size"))+"]");
+ item->set_text(1,type_name+"["+itos(v.call("size"))+"]");
else
- item->set_text(1,"Array[]");
+ item->set_text(1,type_name+"[]");
+
if (show_type_icons)
item->set_icon( 0, get_icon("ArrayData","EditorIcons") );
} break;
- case Variant::INT_ARRAY: {
+ case Variant::POOL_INT_ARRAY: {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->add_button(1,get_icon("EditResource","EditorIcons"));
@@ -3427,7 +3542,7 @@ void PropertyEditor::update_tree() {
} break;
- case Variant::REAL_ARRAY: {
+ case Variant::POOL_REAL_ARRAY: {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->add_button(1,get_icon("EditResource","EditorIcons"));
@@ -3442,7 +3557,7 @@ void PropertyEditor::update_tree() {
} break;
- case Variant::STRING_ARRAY: {
+ case Variant::POOL_STRING_ARRAY: {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->add_button(1,get_icon("EditResource","EditorIcons"));
@@ -3457,7 +3572,7 @@ void PropertyEditor::update_tree() {
} break;
- case Variant::RAW_ARRAY: {
+ case Variant::POOL_BYTE_ARRAY: {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->add_button(1,get_icon("EditResource","EditorIcons"));
@@ -3472,7 +3587,7 @@ void PropertyEditor::update_tree() {
} break;
- case Variant::VECTOR2_ARRAY: {
+ case Variant::POOL_VECTOR2_ARRAY: {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->add_button(1,get_icon("EditResource","EditorIcons"));
@@ -3487,7 +3602,7 @@ void PropertyEditor::update_tree() {
} break;
- case Variant::VECTOR3_ARRAY: {
+ case Variant::POOL_VECTOR3_ARRAY: {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->add_button(1,get_icon("EditResource","EditorIcons"));
@@ -3502,7 +3617,7 @@ void PropertyEditor::update_tree() {
} break;
- case Variant::COLOR_ARRAY: {
+ case Variant::POOL_COLOR_ARRAY: {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->add_button(1,get_icon("EditResource","EditorIcons"));
@@ -3544,8 +3659,8 @@ void PropertyEditor::update_tree() {
item->set_icon( 0,get_icon("Vector","EditorIcons") );
} break;
- case Variant::MATRIX32:
- case Variant::MATRIX3: {
+ case Variant::TRANSFORM2D:
+ case Variant::BASIS: {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable( 1, true );
@@ -3569,11 +3684,11 @@ void PropertyEditor::update_tree() {
item->set_icon( 0,get_icon("Plane","EditorIcons") );
} break;
- case Variant::_AABB: {
+ case Variant::RECT3: {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable( 1, true );
- item->set_text(1,"AABB");
+ item->set_text(1,"Rect3");
if (show_type_icons)
item->set_icon( 0,get_icon("Rect3","EditorIcons") );
} break;
@@ -3591,7 +3706,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable( 1, !read_only );
-// item->set_text(1,obj->get(p.name));
+ //item->set_text(1,obj->get(p.name));
item->set_custom_bg_color(1,obj->get(p.name));
if (show_type_icons)
item->set_icon( 0,get_icon("Color","EditorIcons") );
@@ -3612,9 +3727,10 @@ void PropertyEditor::update_tree() {
} break;
case Variant::NODE_PATH: {
- item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
+ item->set_cell_mode(1, TreeItem::CELL_MODE_STRING);
item->set_editable( 1, !read_only );
item->set_text(1,obj->get(p.name));
+ item->add_button(1, get_icon("Collapse", "EditorIcons"));
} break;
case Variant::OBJECT: {
@@ -3633,8 +3749,8 @@ void PropertyEditor::update_tree() {
} else {
RES res = obj->get( p.name ).operator RefPtr();
- if (res->is_type("Texture")) {
- int tw = EditorSettings::get_singleton()->get("property_editor/texture_preview_width");
+ if (res->is_class("Texture")) {
+ int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width");
item->set_icon_max_width(1,tw);
item->set_icon(1,res);
item->set_text(1,"");
@@ -3646,19 +3762,19 @@ void PropertyEditor::update_tree() {
item->set_text(1, res->get_path().get_file());
} else {
- item->set_text(1,"<"+res->get_type()+">");
+ item->set_text(1,"<"+res->get_class()+">");
}
- if (has_icon(res->get_type(),"EditorIcons")) {
- type=res->get_type();
+ if (has_icon(res->get_class(),"EditorIcons")) {
+ type=res->get_class();
}
if (res.is_valid() && res->get_path().is_resource_file()) {
item->set_tooltip(1,res->get_path());
} else if (res.is_valid()) {
- item->set_tooltip(1,res->get_name()+" ("+res->get_type()+")");
+ item->set_tooltip(1,res->get_name()+" ("+res->get_class()+")");
}
- if (!res->is_type("Texture")) {
+ if (!res->is_class("Texture")) {
//texture already previews via itself
EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res,this,"_resource_preview_done",item->get_instance_ID());
}
@@ -3676,7 +3792,7 @@ void PropertyEditor::update_tree() {
item->set_icon( 0, get_icon("Object","EditorIcons") );
}
-// item->double_click_signal.connect( Method1<int>( Method2<int,String>( this, &Editoritem_obj_edited ), p.name ) );
+ //item->double_click_signal.connect( Method1<int>( Method2<int,String>( this, &Editoritem_obj_edited ), p.name ) );
} break;
default: {};
@@ -3713,6 +3829,12 @@ void PropertyEditor::update_tree() {
}
+ if (obj->call("property_can_revert",p.name).operator bool()) {
+
+ item->add_button(1,get_icon("ReloadSmall","EditorIcons"),3);
+ has_reload=true;
+ }
+
if (!has_reload && !obj->get_script().is_null()) {
Ref<Script> scr = obj->get_script();
Variant orig_value;
@@ -3763,22 +3885,34 @@ void PropertyEditor::_edit_set(const String& p_name, const Variant& p_value) {
} else {
-
undo_redo->create_action(TTR("Set")+" "+p_name,UndoRedo::MERGE_ENDS);
undo_redo->add_do_property(obj,p_name,p_value);
undo_redo->add_undo_property(obj,p_name,obj->get(p_name));
+
+
undo_redo->add_do_method(this,"_changed_callback",obj,p_name);
undo_redo->add_undo_method(this,"_changed_callback",obj,p_name);
- undo_redo->add_undo_method(this,"_changed_callback",obj,p_name);
+
Resource *r = obj->cast_to<Resource>();
if (r) {
if (!r->is_edited() && String(p_name)!="resource/edited") {
undo_redo->add_do_method(r,"set_edited",true);
undo_redo->add_undo_method(r,"set_edited",false);
}
+
+ if (String(p_name)=="resource_local_to_scene") {
+ bool prev = obj->get(p_name);
+ bool next = p_value;
+ if (next) {
+ undo_redo->add_do_method(this,"setup_local_to_scene");
+ }
+ if (prev) {
+ undo_redo->add_undo_method(this,"setup_local_to_scene");
+ }
+ }
}
- _prop_edited_name[0]=p_name;
- undo_redo->add_do_method(this,"emit_signal",_prop_edited,_prop_edited_name);
+ undo_redo->add_do_method(this,"emit_signal",_prop_edited,p_name);
+ undo_redo->add_undo_method(this,"emit_signal",_prop_edited,p_name);
undo_redo->commit_action();
}
}
@@ -3828,11 +3962,12 @@ void PropertyEditor::_item_edited() {
case Variant::BOOL: {
_edit_set(name,item->is_checked(1));
+ item->set_tooltip(1, item->is_checked(1) ? "True" : "False");
} break;
case Variant::INT:
case Variant::REAL: {
- if (hint==PROPERTY_HINT_ALL_FLAGS)
+ if (hint==PROPERTY_HINT_LAYERS_2D_PHYSICS || hint==PROPERTY_HINT_LAYERS_2D_RENDER || hint==PROPERTY_HINT_LAYERS_3D_PHYSICS || hint==PROPERTY_HINT_LAYERS_3D_RENDER)
break;
if (hint==PROPERTY_HINT_EXP_EASING)
break;
@@ -3873,10 +4008,10 @@ void PropertyEditor::_item_edited() {
case Variant::QUAT: {
} break;
- case Variant::_AABB: {
+ case Variant::RECT3: {
} break;
- case Variant::MATRIX3: {
+ case Variant::BASIS: {
} break;
case Variant::TRANSFORM: {
@@ -3890,6 +4025,7 @@ void PropertyEditor::_item_edited() {
} break;
case Variant::NODE_PATH: {
+ _edit_set(name, NodePath(item->get_text(1)));
} break;
@@ -3901,22 +4037,22 @@ void PropertyEditor::_item_edited() {
} break;
// arrays
- case Variant::RAW_ARRAY: {
+ case Variant::POOL_BYTE_ARRAY: {
} break;
- case Variant::INT_ARRAY: {
+ case Variant::POOL_INT_ARRAY: {
} break;
- case Variant::REAL_ARRAY: {
+ case Variant::POOL_REAL_ARRAY: {
} break;
- case Variant::STRING_ARRAY: {
+ case Variant::POOL_STRING_ARRAY: {
} break;
- case Variant::VECTOR3_ARRAY: {
+ case Variant::POOL_VECTOR3_ARRAY: {
} break;
- case Variant::COLOR_ARRAY: {
+ case Variant::POOL_COLOR_ARRAY: {
} break;
@@ -4039,6 +4175,11 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
return;
}
+ if (obj->call("property_can_revert",prop).operator bool()) {
+ Variant rev = obj->call("property_get_revert",prop);
+ _edit_set(prop,rev);
+ }
+
if (!obj->get_script().is_null()) {
Ref<Script> scr = obj->get_script();
Variant orig_value;
@@ -4065,7 +4206,17 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
String n = d["name"];
String ht = d["hint_text"];
- if (t==Variant::STRING) {
+ if(t == Variant::NODE_PATH) {
+
+ Variant v = obj->get(n);
+ custom_editor->edit(obj, n, (Variant::Type)t, v, h, ht);
+ Rect2 where = tree->get_item_rect(ti, 1);
+ where.pos -= tree->get_scroll();
+ where.pos += tree->get_global_pos();
+ custom_editor->set_pos(where.pos);
+ custom_editor->popup();
+
+ } else if (t==Variant::STRING) {
Variant v = obj->get(n);
@@ -4094,7 +4245,7 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
emit_signal("object_id_selected",obj->get(n));
print_line("OBJ ID SELECTED");
- } else if (t==Variant::ARRAY || t==Variant::INT_ARRAY || t==Variant::REAL_ARRAY || t==Variant::STRING_ARRAY || t==Variant::VECTOR2_ARRAY || t==Variant::VECTOR3_ARRAY || t==Variant::COLOR_ARRAY || t==Variant::RAW_ARRAY) {
+ } else if (t==Variant::ARRAY || t==Variant::POOL_INT_ARRAY || t==Variant::POOL_REAL_ARRAY || t==Variant::POOL_STRING_ARRAY || t==Variant::POOL_VECTOR2_ARRAY || t==Variant::POOL_VECTOR3_ARRAY || t==Variant::POOL_COLOR_ARRAY || t==Variant::POOL_BYTE_ARRAY) {
Variant v = obj->get(n);
@@ -4104,7 +4255,7 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
}
Ref<ArrayPropertyEdit> ape = memnew( ArrayPropertyEdit );
- ape->edit(obj,n,Variant::Type(t));
+ ape->edit(obj,n,ht,Variant::Type(t));
EditorNode::get_singleton()->push_item(ape.ptr());
}
@@ -4192,7 +4343,7 @@ void PropertyEditor::_resource_preview_done(const String& p_path,const Ref<Textu
ERR_FAIL_COND(!ti);
- int tw = EditorSettings::get_singleton()->get("property_editor/texture_preview_width");
+ int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width");
ti->set_icon(1,p_preview); //should be scaled I think?
ti->set_icon_max_width(1,tw);
@@ -4200,24 +4351,24 @@ void PropertyEditor::_resource_preview_done(const String& p_path,const Ref<Textu
}
void PropertyEditor::_bind_methods() {
- ObjectTypeDB::bind_method( "_item_edited",&PropertyEditor::_item_edited);
- ObjectTypeDB::bind_method( "_item_selected",&PropertyEditor::_item_selected);
- ObjectTypeDB::bind_method( "_custom_editor_request",&PropertyEditor::_custom_editor_request);
- ObjectTypeDB::bind_method( "_custom_editor_edited",&PropertyEditor::_custom_editor_edited);
- ObjectTypeDB::bind_method( "_resource_edit_request",&PropertyEditor::_resource_edit_request);
- ObjectTypeDB::bind_method( "_node_removed",&PropertyEditor::_node_removed);
- ObjectTypeDB::bind_method( "_edit_button",&PropertyEditor::_edit_button);
- ObjectTypeDB::bind_method( "_changed_callback",&PropertyEditor::_changed_callbacks);
- ObjectTypeDB::bind_method( "_draw_flags",&PropertyEditor::_draw_flags);
- ObjectTypeDB::bind_method( "_set_range_def",&PropertyEditor::_set_range_def);
- ObjectTypeDB::bind_method( "_filter_changed",&PropertyEditor::_filter_changed);
- ObjectTypeDB::bind_method( "update_tree",&PropertyEditor::update_tree);
- ObjectTypeDB::bind_method( "_resource_preview_done",&PropertyEditor::_resource_preview_done);
- ObjectTypeDB::bind_method( "refresh",&PropertyEditor::refresh);
-
- ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &PropertyEditor::get_drag_data_fw);
- ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &PropertyEditor::can_drop_data_fw);
- ObjectTypeDB::bind_method(_MD("drop_data_fw"), &PropertyEditor::drop_data_fw);
+ ClassDB::bind_method( "_item_edited",&PropertyEditor::_item_edited);
+ ClassDB::bind_method( "_item_selected",&PropertyEditor::_item_selected);
+ ClassDB::bind_method( "_custom_editor_request",&PropertyEditor::_custom_editor_request);
+ ClassDB::bind_method( "_custom_editor_edited",&PropertyEditor::_custom_editor_edited);
+ ClassDB::bind_method( "_resource_edit_request",&PropertyEditor::_resource_edit_request);
+ ClassDB::bind_method( "_node_removed",&PropertyEditor::_node_removed);
+ ClassDB::bind_method( "_edit_button",&PropertyEditor::_edit_button);
+ ClassDB::bind_method( "_changed_callback",&PropertyEditor::_changed_callbacks);
+ ClassDB::bind_method( "_draw_flags",&PropertyEditor::_draw_flags);
+ ClassDB::bind_method( "_set_range_def",&PropertyEditor::_set_range_def);
+ ClassDB::bind_method( "_filter_changed",&PropertyEditor::_filter_changed);
+ ClassDB::bind_method( "update_tree",&PropertyEditor::update_tree);
+ ClassDB::bind_method( "_resource_preview_done",&PropertyEditor::_resource_preview_done);
+ ClassDB::bind_method( "refresh",&PropertyEditor::refresh);
+
+ ClassDB::bind_method(_MD("get_drag_data_fw"), &PropertyEditor::get_drag_data_fw);
+ ClassDB::bind_method(_MD("can_drop_data_fw"), &PropertyEditor::can_drop_data_fw);
+ ClassDB::bind_method(_MD("drop_data_fw"), &PropertyEditor::drop_data_fw);
ADD_SIGNAL( MethodInfo("property_toggled",PropertyInfo( Variant::STRING, "property"),PropertyInfo( Variant::BOOL, "value")));
ADD_SIGNAL( MethodInfo("resource_selected", PropertyInfo( Variant::OBJECT, "res"),PropertyInfo( Variant::STRING, "prop") ) );
@@ -4303,7 +4454,7 @@ void PropertyEditor::set_subsection_selectable(bool p_selectable) {
PropertyEditor::PropertyEditor() {
_prop_edited="property_edited";
- _prop_edited_name.push_back(String());
+
undo_redo=NULL;
obj=NULL;
search_box=NULL;
@@ -4365,7 +4516,7 @@ PropertyEditor::PropertyEditor() {
use_doc_hints=false;
use_filter=false;
subsection_selectable=false;
- show_type_icons=EDITOR_DEF("inspector/show_type_icons",false);
+ show_type_icons=EDITOR_DEF("interface/show_type_icons",false);
}
@@ -4384,10 +4535,11 @@ PropertyEditor::~PropertyEditor()
class SectionedPropertyEditorFilter : public Object {
- OBJ_TYPE( SectionedPropertyEditorFilter, Object );
+ GDCLASS( SectionedPropertyEditorFilter, Object );
Object *edited;
String section;
+ bool allow_sub;
bool _set(const StringName& p_name, const Variant& p_value) {
@@ -4401,6 +4553,7 @@ class SectionedPropertyEditorFilter : public Object {
bool valid;
edited->set(name,p_value,&valid);
+ //_change_notify(p_name.operator String().utf8().get_data());
return valid;
}
@@ -4432,25 +4585,48 @@ class SectionedPropertyEditorFilter : public Object {
PropertyInfo pi=E->get();
int sp = pi.name.find("/");
- if (sp!=-1) {
- String ss = pi.name.substr(0,sp);
- if (ss==section) {
- pi.name=pi.name.substr(sp+1,pi.name.length());
- p_list->push_back(pi);
- }
- } else {
- if (section=="")
- p_list->push_back(pi);
+ if (pi.name=="resource_path" || pi.name=="resource_name" || pi.name.begins_with("script/")) //skip resource stuff
+ continue;
+
+ if (sp==-1) {
+ pi.name="Global/"+pi.name;
+
+ }
+
+ if (pi.name.begins_with(section+"/")) {
+ pi.name=pi.name.replace_first(section+"/","");
+ if (!allow_sub && pi.name.find("/")!=-1)
+ continue;
+ p_list->push_back(pi);
}
}
}
+
+ bool property_can_revert(const String& p_name) {
+
+ return edited->call("property_can_revert",section+"/"+p_name);
+ }
+
+ Variant property_get_revert(const String& p_name) {
+
+ return edited->call("property_get_revert",section+"/"+p_name);
+ }
+
+protected:
+ static void _bind_methods() {
+
+ ClassDB::bind_method("property_can_revert",&SectionedPropertyEditorFilter::property_can_revert);
+ ClassDB::bind_method("property_get_revert",&SectionedPropertyEditorFilter::property_get_revert);
+ }
+
public:
- void set_section(const String& p_section) {
+ void set_section(const String& p_section,bool p_allow_sub) {
section=p_section;
+ allow_sub=p_allow_sub;
_change_notify();
}
@@ -4468,36 +4644,30 @@ public:
void SectionedPropertyEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_section_selected",&SectionedPropertyEditor::_section_selected);
+ ClassDB::bind_method("_section_selected",&SectionedPropertyEditor::_section_selected);
- ObjectTypeDB::bind_method("update_category_list", &SectionedPropertyEditor::update_category_list);
+ ClassDB::bind_method("update_category_list", &SectionedPropertyEditor::update_category_list);
}
-void SectionedPropertyEditor::_section_selected(int p_which) {
+void SectionedPropertyEditor::_section_selected() {
+
+ if (!sections->get_selected())
+ return;
- filter->set_section( sections->get_item_metadata(p_which) );
+ filter->set_section( sections->get_selected()->get_metadata(0), sections->get_selected()->get_children()==NULL);
}
void SectionedPropertyEditor::set_current_section(const String& p_section) {
- int section_idx = sections->find_metadata(p_section);
-
- if (section_idx==sections->get_current())
- return;
-
- if (section_idx!=-1) {
- sections->select(section_idx);
- _section_selected(section_idx);
- } else if (sections->get_item_count()) {
- sections->select(0);
- _section_selected(0);
+ if (section_map.has(p_section)) {
+ section_map[p_section]->select(0);;
}
}
String SectionedPropertyEditor::get_current_section() const {
- if (sections->get_current()!=-1)
- return sections->get_item_metadata( sections->get_current() );
+ if (sections->get_selected())
+ return sections->get_selected()->get_metadata(0);
else
return "";
}
@@ -4534,8 +4704,9 @@ void SectionedPropertyEditor::edit(Object* p_object) {
filter->set_edited(p_object);
editor->edit(filter);
- sections->select(0);
- _section_selected(0);
+ if (sections->get_root()->get_children()) {
+ sections->get_root()->get_children()->select(0);
+ }
} else {
update_category_list();
@@ -4555,7 +4726,12 @@ void SectionedPropertyEditor::update_category_list() {
List<PropertyInfo> pinfo;
o->get_property_list(&pinfo);
- Set<String> existing_sections;
+ section_map.clear();
+
+ TreeItem *root = sections->create_item();
+ section_map[""]=root;
+
+
for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) {
PropertyInfo pi=E->get();
@@ -4565,27 +4741,41 @@ void SectionedPropertyEditor::update_category_list() {
else if ( !(pi.usage&PROPERTY_USAGE_EDITOR) )
continue;
- if (pi.name.find(":")!=-1 || pi.name=="script/script" || pi.name.begins_with("resource/"))
+ if (pi.name.find(":")!=-1 || pi.name=="script/script" || pi.name=="resource_name" || pi.name=="resource_path")
continue;
int sp = pi.name.find("/");
- if (sp!=-1) {
- String sname=pi.name.substr(0,sp);
- if (!existing_sections.has(sname)) {
- existing_sections.insert(sname);
- sections->add_item(sname.capitalize());
- sections->set_item_metadata(sections->get_item_count()-1,sname);
+ if (sp==-1)
+ pi.name="Global/"+pi.name;
+
+ Vector<String> sectionarr = pi.name.split("/");
+ String metasection;
+
+
+ for(int i=0;i<MIN(2,sectionarr.size()-1);i++) {
+
+ TreeItem *parent = section_map[metasection];
+
+ if (i>0) {
+ metasection+="/"+sectionarr[i];
+ } else {
+ metasection=sectionarr[i];
}
- } else {
- if (!existing_sections.has("")) {
- existing_sections.insert("");
- sections->add_item(TTR("Global"));
- sections->set_item_metadata(sections->get_item_count()-1,"");
+
+ if (!section_map.has(metasection)) {
+ TreeItem *ms = sections->create_item(parent);
+ section_map[metasection]=ms;
+ ms->set_text(0,sectionarr[i].capitalize());
+ ms->set_metadata(0,metasection);
+
}
}
+
}
- set_current_section(selected_category);
+ if (section_map.has(selected_category)) {
+ section_map[selected_category]->select(0);
+ }
}
PropertyEditor *SectionedPropertyEditor::get_property_editor() {
@@ -4601,8 +4791,9 @@ SectionedPropertyEditor::SectionedPropertyEditor() {
left_vb->set_custom_minimum_size(Size2(160,0)*EDSCALE);
add_child(left_vb);
- sections = memnew( ItemList );
+ sections = memnew( Tree );
sections->set_v_size_flags(SIZE_EXPAND_FILL);
+ sections->set_hide_root(true);
left_vb->add_margin_child(TTR("Sections:"),sections,true);
@@ -4620,7 +4811,7 @@ SectionedPropertyEditor::SectionedPropertyEditor() {
editor->hide_top_label();
- sections->connect("item_selected",this,"_section_selected");
+ sections->connect("cell_selected",this,"_section_selected");
}
diff --git a/tools/editor/property_editor.h b/tools/editor/property_editor.h
index 3fe332bf87..900d06497f 100644
--- a/tools/editor/property_editor.h
+++ b/tools/editor/property_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -37,10 +37,11 @@
#include "scene/gui/dialogs.h"
#include "scene/gui/color_picker.h"
#include "scene/gui/menu_button.h"
-#include "scene/gui/texture_frame.h"
+#include "scene/gui/texture_rect.h"
#include "scene/gui/text_edit.h"
#include "scene/gui/check_button.h"
#include "scene/gui/split_container.h"
+#include "scene/gui/grid_container.h"
#include "scene_tree_editor.h"
/**
@@ -53,7 +54,7 @@ class PropertySelector;
class CustomPropertyEditor : public Popup {
- OBJ_TYPE( CustomPropertyEditor, Popup );
+ GDCLASS( CustomPropertyEditor, Popup );
enum {
MAX_VALUE_EDITORS=12,
@@ -95,10 +96,12 @@ class CustomPropertyEditor : public Popup {
Button *action_buttons[MAX_ACTION_BUTTONS];
MenuButton *type_button;
Vector<String> inheritors_array;
- TextureFrame *texture_preview;
+ TextureRect *texture_preview;
ColorPicker *color_picker;
TextEdit *text_edit;
bool read_only;
+ bool picking_viewport;
+ GridContainer *checks20gc;
CheckBox *checks20[20];
SpinBox *spinbox;
HSlider *slider;
@@ -163,7 +166,7 @@ public:
class PropertyEditor : public Control {
- OBJ_TYPE( PropertyEditor, Control );
+ GDCLASS( PropertyEditor, Control );
Tree *tree;
Label *top_label;
@@ -174,7 +177,7 @@ class PropertyEditor : public Control {
Object* obj;
- Array _prop_edited_name;
+
StringName _prop_edited;
bool capitalize_paths;
@@ -219,6 +222,8 @@ class PropertyEditor : public Control {
void _edit_button(Object *p_item, int p_column, int p_button);
void _node_removed(Node *p_node);
+
+friend class ProjectExportDialog;
void _edit_set(const String& p_name, const Variant& p_value);
void _draw_flags(Object *ti,const Rect2& p_rect);
@@ -287,17 +292,19 @@ class SectionedPropertyEditorFilter;
class SectionedPropertyEditor : public HBoxContainer {
- OBJ_TYPE(SectionedPropertyEditor,HBoxContainer);
+ GDCLASS(SectionedPropertyEditor,HBoxContainer);
ObjectID obj;
- ItemList *sections;
+ Tree *sections;
SectionedPropertyEditorFilter *filter;
+
+ Map<String,TreeItem*> section_map;
PropertyEditor *editor;
static void _bind_methods();
- void _section_selected(int p_which);
+ void _section_selected();
public:
@@ -315,7 +322,7 @@ public:
};
class PropertyValueEvaluator : public ValueEvaluator {
- OBJ_TYPE( PropertyValueEvaluator, ValueEvaluator );
+ GDCLASS( PropertyValueEvaluator, ValueEvaluator );
Object *obj;
ScriptLanguage *script_language;
diff --git a/tools/editor/property_selector.cpp b/tools/editor/property_selector.cpp
index 20b72240d9..3d9695ac2a 100644
--- a/tools/editor/property_selector.cpp
+++ b/tools/editor/property_selector.cpp
@@ -18,7 +18,7 @@ void PropertySelector::_sbox_input(const InputEvent& p_ie) {
case KEY_PAGEUP:
case KEY_PAGEDOWN: {
- search_options->call("_input_event", p_ie);
+ search_options->call("_gui_input", p_ie);
search_box->accept_event();
TreeItem *root = search_options->get_root();
@@ -87,8 +87,8 @@ void PropertySelector::_update_search() {
StringName base=base_type;
while(base) {
props.push_back(PropertyInfo(Variant::NIL,base,PROPERTY_HINT_NONE,"",PROPERTY_USAGE_CATEGORY));
- ObjectTypeDB::get_property_list(base,&props,true);
- base=ObjectTypeDB::type_inherits_from(base);
+ ClassDB::get_property_list(base,&props,true);
+ base=ClassDB::get_parent_class(base);
}
}
@@ -194,8 +194,8 @@ void PropertySelector::_update_search() {
StringName base=base_type;
while(base) {
methods.push_back(MethodInfo("*"+String(base)));
- ObjectTypeDB::get_method_list(base,&methods,true);
- base=ObjectTypeDB::type_inherits_from(base);
+ ClassDB::get_method_list(base,&methods,true);
+ base=ClassDB::get_parent_class(base);
}
}
@@ -321,8 +321,8 @@ void PropertySelector::_item_selected() {
case InputEvent::KEY: class_type="InputEventKey"; break;
case InputEvent::MOUSE_MOTION: class_type="InputEventMouseMotion"; break;
case InputEvent::MOUSE_BUTTON: class_type="InputEventMouseButton"; break;
- case InputEvent::JOYSTICK_MOTION: class_type="InputEventJoystickMotion"; break;
- case InputEvent::JOYSTICK_BUTTON: class_type="InputEventJoystickButton"; break;
+ case InputEvent::JOYPAD_MOTION: class_type="InputEventJoypadMotion"; break;
+ case InputEvent::JOYPAD_BUTTON: class_type="InputEventJoypadButton"; break;
case InputEvent::SCREEN_TOUCH: class_type="InputEventScreenTouch"; break;
case InputEvent::SCREEN_DRAG: class_type="InputEventScreenDrag"; break;
case InputEvent::ACTION: class_type="InputEventAction"; break;
@@ -358,14 +358,14 @@ void PropertySelector::_item_selected() {
}
}
- at_class=ObjectTypeDB::type_inherits_from(at_class);
+ at_class=ClassDB::get_parent_class(at_class);
}
if (text==String()) {
StringName setter;
StringName type;
- if (ObjectTypeDB::get_setter_and_type_for_property(class_type,name,type,setter)) {
+ if (ClassDB::get_setter_and_type_for_property(class_type,name,type,setter)) {
Map<String,DocData::ClassDoc>::Element *E=dd->class_list.find(type);
if (E) {
for(int i=0;i<E->get().methods.size();i++) {
@@ -395,7 +395,7 @@ void PropertySelector::_item_selected() {
}
}
- at_class=ObjectTypeDB::type_inherits_from(at_class);
+ at_class=ClassDB::get_parent_class(at_class);
}
}
@@ -470,7 +470,7 @@ void PropertySelector::select_method_from_basic_type(Variant::Type p_type, const
void PropertySelector::select_method_from_instance(Object* p_instance, const String &p_current){
- base_type=p_instance->get_type();
+ base_type=p_instance->get_class();
selected=p_current;
type=Variant::NIL;
script=0;
@@ -559,10 +559,10 @@ void PropertySelector::select_property_from_instance(Object* p_instance, const S
void PropertySelector::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_text_changed"),&PropertySelector::_text_changed);
- ObjectTypeDB::bind_method(_MD("_confirmed"),&PropertySelector::_confirmed);
- ObjectTypeDB::bind_method(_MD("_sbox_input"),&PropertySelector::_sbox_input);
- ObjectTypeDB::bind_method(_MD("_item_selected"),&PropertySelector::_item_selected);
+ ClassDB::bind_method(_MD("_text_changed"),&PropertySelector::_text_changed);
+ ClassDB::bind_method(_MD("_confirmed"),&PropertySelector::_confirmed);
+ ClassDB::bind_method(_MD("_sbox_input"),&PropertySelector::_sbox_input);
+ ClassDB::bind_method(_MD("_item_selected"),&PropertySelector::_item_selected);
ADD_SIGNAL(MethodInfo("selected",PropertyInfo(Variant::STRING,"name")));
@@ -574,11 +574,11 @@ PropertySelector::PropertySelector() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
search_box = memnew( LineEdit );
vbc->add_margin_child(TTR("Search:"),search_box);
search_box->connect("text_changed",this,"_text_changed");
- search_box->connect("input_event",this,"_sbox_input");
+ search_box->connect("gui_input",this,"_sbox_input");
search_options = memnew( Tree );
vbc->add_margin_child(TTR("Matches:"),search_options,true);
get_ok()->set_text(TTR("Open"));
diff --git a/tools/editor/property_selector.h b/tools/editor/property_selector.h
index f7f0e7e167..4823d50e0f 100644
--- a/tools/editor/property_selector.h
+++ b/tools/editor/property_selector.h
@@ -6,7 +6,7 @@
#include "editor_help.h"
class PropertySelector : public ConfirmationDialog {
- OBJ_TYPE(PropertySelector,ConfirmationDialog )
+ GDCLASS(PropertySelector,ConfirmationDialog )
LineEdit *search_box;
diff --git a/tools/editor/pvrtc_compress.cpp b/tools/editor/pvrtc_compress.cpp
index 75b5c69bc2..7f84d8d00e 100644
--- a/tools/editor/pvrtc_compress.cpp
+++ b/tools/editor/pvrtc_compress.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -38,7 +38,7 @@ static void (*_base_image_compress_pvrtc4_func)(Image *)=NULL;
static void _compress_image(Image::CompressMode p_mode,Image *p_image) {
- String ttpath = EditorSettings::get_singleton()->get("PVRTC/texture_tool");
+ String ttpath = EditorSettings::get_singleton()->get("filesystem/import/pvrtc_texture_tool");
if (ttpath.strip_edges()=="" || !FileAccess::exists(ttpath)) {
switch(p_mode) {
@@ -82,10 +82,10 @@ static void _compress_image(Image::CompressMode p_mode,Image *p_image) {
}
- if (EditorSettings::get_singleton()->get("PVRTC/fast_conversion").operator bool()) {
+ if (EditorSettings::get_singleton()->get("filesystem/import/pvrtc_fast_conversion").operator bool()) {
args.push_back("-pvrtcfast");
}
- if (p_image->get_mipmaps()>0)
+ if (p_image->has_mipmaps())
args.push_back("-m");
Ref<ImageTexture> t = memnew( ImageTexture );
diff --git a/tools/editor/pvrtc_compress.h b/tools/editor/pvrtc_compress.h
index 129faee080..4ba29026c5 100644
--- a/tools/editor/pvrtc_compress.h
+++ b/tools/editor/pvrtc_compress.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/quick_open.cpp b/tools/editor/quick_open.cpp
index e18dc584d5..ff5ecdf01b 100644
--- a/tools/editor/quick_open.cpp
+++ b/tools/editor/quick_open.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -86,7 +86,7 @@ void EditorQuickOpen::_sbox_input(const InputEvent& p_ie) {
case KEY_PAGEUP:
case KEY_PAGEDOWN: {
- search_options->call("_input_event", p_ie);
+ search_options->call("_gui_input", p_ie);
search_box->accept_event();
TreeItem *root = search_options->get_root();
@@ -166,7 +166,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd, Vector< Pair< S
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_text.is_subsequence_ofi(file))) {
+ if (ClassDB::is_parent_class(efsd->get_file_type(i),base_type) && (search_text.is_subsequence_ofi(file))) {
Pair< String, Ref<Texture> > pair;
pair.first = file;
pair.second = get_icon((has_icon(efsd->get_file_type(i), ei) ? efsd->get_file_type(i) : ot), ei);
@@ -252,9 +252,9 @@ StringName EditorQuickOpen::get_base_type() const {
void EditorQuickOpen::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_text_changed"),&EditorQuickOpen::_text_changed);
- ObjectTypeDB::bind_method(_MD("_confirmed"),&EditorQuickOpen::_confirmed);
- ObjectTypeDB::bind_method(_MD("_sbox_input"),&EditorQuickOpen::_sbox_input);
+ ClassDB::bind_method(_MD("_text_changed"),&EditorQuickOpen::_text_changed);
+ ClassDB::bind_method(_MD("_confirmed"),&EditorQuickOpen::_confirmed);
+ ClassDB::bind_method(_MD("_sbox_input"),&EditorQuickOpen::_sbox_input);
ADD_SIGNAL(MethodInfo("quick_open"));
@@ -266,11 +266,11 @@ EditorQuickOpen::EditorQuickOpen() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
search_box = memnew( LineEdit );
vbc->add_margin_child(TTR("Search:"),search_box);
search_box->connect("text_changed",this,"_text_changed");
- search_box->connect("input_event",this,"_sbox_input");
+ search_box->connect("gui_input",this,"_sbox_input");
search_options = memnew( Tree );
vbc->add_margin_child(TTR("Matches:"),search_options,true);
get_ok()->set_text(TTR("Open"));
diff --git a/tools/editor/quick_open.h b/tools/editor/quick_open.h
index c253f7606e..ef91d910b1 100644
--- a/tools/editor/quick_open.h
+++ b/tools/editor/quick_open.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -35,7 +35,7 @@
#include "pair.h"
class EditorQuickOpen : public ConfirmationDialog {
- OBJ_TYPE(EditorQuickOpen,ConfirmationDialog )
+ GDCLASS(EditorQuickOpen,ConfirmationDialog )
LineEdit *search_box;
Tree *search_options;
diff --git a/tools/editor/register_exporters.h b/tools/editor/register_exporters.h
index dccaa0641f..30ec522a00 100644
--- a/tools/editor/register_exporters.h
+++ b/tools/editor/register_exporters.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
diff --git a/tools/editor/reparent_dialog.cpp b/tools/editor/reparent_dialog.cpp
index 38b0372232..4b6a032b64 100644
--- a/tools/editor/reparent_dialog.cpp
+++ b/tools/editor/reparent_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -75,8 +75,8 @@ void ReparentDialog::set_current(const Set<Node*>& p_selection) {
void ReparentDialog::_bind_methods() {
- ObjectTypeDB::bind_method("_reparent",&ReparentDialog::_reparent);
- ObjectTypeDB::bind_method("_cancel",&ReparentDialog::_cancel);
+ ClassDB::bind_method("_reparent",&ReparentDialog::_reparent);
+ ClassDB::bind_method("_cancel",&ReparentDialog::_cancel);
ADD_SIGNAL( MethodInfo("reparent",PropertyInfo(Variant::NODE_PATH,"path"),PropertyInfo(Variant::BOOL,"keep_global_xform")));
}
@@ -88,7 +88,7 @@ ReparentDialog::ReparentDialog() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
tree = memnew( SceneTreeEditor(false) );
tree->set_show_enabled_subscene(true);
diff --git a/tools/editor/reparent_dialog.h b/tools/editor/reparent_dialog.h
index 1c0fbd2459..5e21f84581 100644
--- a/tools/editor/reparent_dialog.h
+++ b/tools/editor/reparent_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,7 +40,7 @@
*/
class ReparentDialog : public ConfirmationDialog {
- OBJ_TYPE( ReparentDialog, ConfirmationDialog );
+ GDCLASS( ReparentDialog, ConfirmationDialog );
SceneTreeEditor *tree;
CheckBox *keep_transform;
diff --git a/tools/editor/resources_dock.cpp b/tools/editor/resources_dock.cpp
index c73c8c081c..ddd4a782e4 100644
--- a/tools/editor/resources_dock.cpp
+++ b/tools/editor/resources_dock.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -126,10 +126,12 @@ void ResourcesDock::save_resource(const String& p_path,const Ref<Resource>& p_re
int flg=0;
if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources"))
flg|=ResourceSaver::FLAG_COMPRESS;
- //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative"))
- // flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
+ /*
+ if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative"))
+ flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
+ */
- String path = Globals::get_singleton()->localize_path(p_path);
+ String path = GlobalConfig::get_singleton()->localize_path(p_path);
Error err = ResourceSaver::save(path,p_resource,flg|ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS);
if (err!=OK) {
@@ -137,7 +139,7 @@ void ResourcesDock::save_resource(const String& p_path,const Ref<Resource>& p_re
accept->popup_centered_minsize();
return;
}
-// EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type());
+ //EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type());
((Resource*)p_resource.ptr())->set_path(path);
editor->emit_signal("resource_saved",p_resource);
@@ -161,7 +163,7 @@ void ResourcesDock::save_resource_as(const Ref<Resource>& p_resource) {
String existing;
if (extensions.size()) {
- existing="new_"+res->get_type().to_lower()+"."+extensions.front()->get().to_lower();
+ existing="new_"+res->get_class().to_lower()+"."+extensions.front()->get().to_lower();
}
file->set_current_file(existing);
@@ -214,7 +216,7 @@ void ResourcesDock::_update_name(TreeItem *item) {
else if (res->get_path()!="" && res->get_path().find("::")==-1)
item->set_text(0,res->get_path().get_file());
else
- item->set_text(0,res->get_type()+" ("+itos(res->get_instance_ID())+")");
+ item->set_text(0,res->get_class()+" ("+itos(res->get_instance_ID())+")");
}
@@ -267,8 +269,8 @@ void ResourcesDock::add_resource(const Ref<Resource>& p_resource) {
TreeItem *res = resources->create_item(root);
res->set_metadata(0,p_resource);
- if (has_icon(p_resource->get_type(),"EditorIcons")) {
- res->set_icon(0,get_icon(p_resource->get_type(),"EditorIcons"));
+ if (has_icon(p_resource->get_class(),"EditorIcons")) {
+ res->set_icon(0,get_icon(p_resource->get_class(),"EditorIcons"));
}
_update_name(res);
@@ -319,12 +321,12 @@ void ResourcesDock::_create() {
void ResourcesDock::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_tool_selected"),&ResourcesDock::_tool_selected);
- ObjectTypeDB::bind_method(_MD("_create"),&ResourcesDock::_create);
- ObjectTypeDB::bind_method(_MD("_resource_selected"),&ResourcesDock::_resource_selected);
- ObjectTypeDB::bind_method(_MD("_delete"),&ResourcesDock::_delete);
- ObjectTypeDB::bind_method(_MD("remove_resource"),&ResourcesDock::remove_resource);
- ObjectTypeDB::bind_method(_MD("_file_action"),&ResourcesDock::_file_action);
+ ClassDB::bind_method(_MD("_tool_selected"),&ResourcesDock::_tool_selected);
+ ClassDB::bind_method(_MD("_create"),&ResourcesDock::_create);
+ ClassDB::bind_method(_MD("_resource_selected"),&ResourcesDock::_resource_selected);
+ ClassDB::bind_method(_MD("_delete"),&ResourcesDock::_delete);
+ ClassDB::bind_method(_MD("remove_resource"),&ResourcesDock::remove_resource);
+ ClassDB::bind_method(_MD("_file_action"),&ResourcesDock::_file_action);
@@ -366,7 +368,7 @@ ResourcesDock::ResourcesDock(EditorNode *p_editor) {
mb->set_tooltip(TTR("Save Resource"));
mb->get_popup()->add_item(TTR("Save Resource"),TOOL_SAVE);
mb->get_popup()->add_item(TTR("Save Resource As.."),TOOL_SAVE_AS);
- mb->get_popup()->connect("item_pressed",this,"_tool_selected" );
+ mb->get_popup()->connect("id_pressed",this,"_tool_selected" );
hbc->add_child( mb );
button_save=mb;
@@ -377,7 +379,7 @@ ResourcesDock::ResourcesDock(EditorNode *p_editor) {
mb->get_popup()->add_item(TTR("Make Local"),TOOL_MAKE_LOCAL);
mb->get_popup()->add_item(TTR("Copy"),TOOL_COPY);
mb->get_popup()->add_item(TTR("Paste"),TOOL_PASTE);
- mb->get_popup()->connect("item_pressed",this,"_tool_selected" );
+ mb->get_popup()->connect("id_pressed",this,"_tool_selected" );
hbc->add_child( mb );
button_tools=mb;
diff --git a/tools/editor/resources_dock.h b/tools/editor/resources_dock.h
index 978291fc3f..e225786583 100644
--- a/tools/editor/resources_dock.h
+++ b/tools/editor/resources_dock.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -45,7 +45,7 @@ class EditorNode;
class ResourcesDock : public VBoxContainer {
- OBJ_TYPE( ResourcesDock, VBoxContainer );
+ GDCLASS( ResourcesDock, VBoxContainer );
enum {
TOOL_NEW,
diff --git a/tools/editor/run_settings_dialog.cpp b/tools/editor/run_settings_dialog.cpp
index abcfe125f3..4d69c7ad84 100644
--- a/tools/editor/run_settings_dialog.cpp
+++ b/tools/editor/run_settings_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -47,8 +47,8 @@ String RunSettingsDialog::get_custom_arguments() const {
void RunSettingsDialog::_bind_methods() {
- ObjectTypeDB::bind_method("_run_mode_changed",&RunSettingsDialog::_run_mode_changed);
- //ObjectTypeDB::bind_method("_browse_selected_file",&RunSettingsDialog::_browse_selected_file);
+ ClassDB::bind_method("_run_mode_changed",&RunSettingsDialog::_run_mode_changed);
+ //ClassDB::bind_method("_browse_selected_file",&RunSettingsDialog::_browse_selected_file);
}
void RunSettingsDialog::_run_mode_changed(int idx) {
@@ -76,7 +76,7 @@ RunSettingsDialog::RunSettingsDialog() {
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
- set_child_rect(vbc);
+ //set_child_rect(vbc);
run_mode = memnew( OptionButton );
vbc->add_margin_child(TTR("Run Mode:"),run_mode);
diff --git a/tools/editor/run_settings_dialog.h b/tools/editor/run_settings_dialog.h
index 09319702f3..2efc18e43f 100644
--- a/tools/editor/run_settings_dialog.h
+++ b/tools/editor/run_settings_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -36,7 +36,7 @@
class RunSettingsDialog : public AcceptDialog {
- OBJ_TYPE( RunSettingsDialog, AcceptDialog);
+ GDCLASS( RunSettingsDialog, AcceptDialog);
public:
enum RunMode {
RUN_LOCAL_SCENE,
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 9c4e641535..6a1d1ed3b2 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -80,8 +80,11 @@ void SceneTreeDock::_unhandled_key_input(InputEvent p_event) {
else if (ED_IS_SHORTCUT("scene_tree/duplicate", p_event)) {
_tool_selected(TOOL_DUPLICATE);
}
- else if (ED_IS_SHORTCUT("scene_tree/add_script", p_event)) {
- _tool_selected(TOOL_SCRIPT);
+ else if (ED_IS_SHORTCUT("scene_tree/attach_script", p_event)) {
+ _tool_selected(TOOL_ATTACH_SCRIPT);
+ }
+ else if(ED_IS_SHORTCUT("scene_tree/clear_script", p_event)) {
+ _tool_selected(TOOL_CLEAR_SCRIPT);
}
else if (ED_IS_SHORTCUT("scene_tree/move_up", p_event)) {
_tool_selected(TOOL_MOVE_UP);
@@ -171,7 +174,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String>& p_files,Node*
}
- Node*instanced_scene=sdata->instance(true);
+ Node*instanced_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
if (!instanced_scene) {
current_option=-1;
//accept->get_cancel()->hide();
@@ -195,7 +198,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String>& p_files,Node*
}
}
- instanced_scene->set_filename( Globals::get_singleton()->localize_path(p_files[i]) );
+ instanced_scene->set_filename( GlobalConfig::get_singleton()->localize_path(p_files[i]) );
instances.push_back(instanced_scene);
}
@@ -227,7 +230,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String>& p_files,Node*
editor_data->get_undo_redo().add_do_reference(instanced_scene);
editor_data->get_undo_redo().add_undo_method(parent,"remove_child",instanced_scene);
- String new_name = parent->validate_child_name(instanced_scene->get_name());
+ String new_name = parent->validate_child_name(instanced_scene);
ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
editor_data->get_undo_redo().add_do_method(sed,"live_debug_instance_node",edited_scene->get_path_to(parent),p_files[i],new_name);
editor_data->get_undo_redo().add_undo_method(sed,"live_debug_remove_node",NodePath(String(edited_scene->get_path_to(parent))+"/"+new_name));
@@ -238,6 +241,34 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String>& p_files,Node*
}
+void SceneTreeDock::_replace_with_branch_scene(const String& p_file,Node* base) {
+ Ref<PackedScene> sdata = ResourceLoader::load(p_file);
+ if (!sdata.is_valid()) {
+ accept->get_ok()->set_text(TTR("Ugh"));
+ accept->set_text(vformat(TTR("Error loading scene from %s"),p_file));
+ accept->popup_centered_minsize();
+ return;
+ }
+
+ Node *instanced_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
+ if (!instanced_scene) {
+ accept->get_ok()->set_text(TTR("Ugh"));
+ accept->set_text(vformat(TTR("Error instancing scene from %s"),p_file));
+ accept->popup_centered_minsize();
+ return;
+ }
+
+ Node *parent = base->get_parent();
+ int pos = base->get_index();
+ memdelete(base);
+ parent->add_child(instanced_scene);
+ parent->move_child(instanced_scene, pos);
+ instanced_scene->set_owner(edited_scene);
+ editor_selection->clear();
+ editor_selection->add_node(instanced_scene);
+ scene_tree->set_selected(instanced_scene);
+}
+
bool SceneTreeDock::_cyclical_dependency_exists(const String& p_target_scene_path, Node* p_desired_node) {
int childCount = p_desired_node->get_child_count();
@@ -257,17 +288,6 @@ bool SceneTreeDock::_cyclical_dependency_exists(const String& p_target_scene_pat
}
-static String _get_name_num_separator() {
- switch(EditorSettings::get_singleton()->get("scenetree_editor/duplicate_node_name_num_separator").operator int()) {
- case 0: return "";
- case 1: return " ";
- case 2: return "_";
- case 3: return "-";
- }
- return " ";
-}
-
-
void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
current_option=p_tool;
@@ -275,10 +295,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
switch(p_tool) {
case TOOL_NEW: {
-
-
- //if (!_validate_no_foreign())
- // break;
+ /*
+ if (!_validate_no_foreign())
+ break;
+ */
create_dialog->popup(true);
} break;
case TOOL_INSTANCE: {
@@ -299,8 +319,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
break;
}
- //if (!_validate_no_foreign())
- // break;
+ /*
+ if (!_validate_no_foreign())
+ break;
+ */
file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
List<String> extensions;
@@ -325,10 +347,12 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (!current)
break;
- //if (!_validate_no_foreign())
- // break;
- //connect_dialog->popup_centered_ratio();
- //connect_dialog->set_node(current);
+ /*
+ if (!_validate_no_foreign())
+ break;
+ connect_dialog->popup_centered_ratio();
+ connect_dialog->set_node(current);
+ */
} break;
case TOOL_GROUP: {
@@ -336,32 +360,48 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
Node *current = scene_tree->get_selected();
if (!current)
break;
- //if (!_validate_no_foreign())
- // break;
- //groups_editor->set_current(current);
- //groups_editor->popup_centered_ratio();
+ /*
+ if (!_validate_no_foreign())
+ break;
+ groups_editor->set_current(current);
+ groups_editor->popup_centered_ratio();
+ */
} break;
- case TOOL_SCRIPT: {
+ case TOOL_ATTACH_SCRIPT: {
Node *selected = scene_tree->get_selected();
if (!selected)
break;
- //if (!_validate_no_foreign())
- // break;
+ /*
+ if (!_validate_no_foreign())
+ break;
+ */
Ref<Script> existing = selected->get_script();
if (existing.is_valid())
editor->push_item(existing.ptr());
else {
String path = selected->get_filename();
- script_create_dialog->config(selected->get_type(),path);
+ script_create_dialog->config(selected->get_class(),path);
script_create_dialog->popup_centered(Size2(300,290));
//script_create_dialog->popup_centered_minsize();
}
} break;
+ case TOOL_CLEAR_SCRIPT: {
+ Node *selected = scene_tree->get_selected();
+ if(!selected)
+ break;
+
+ Ref<Script> existing = selected->get_script();
+ if(existing.is_valid()) {
+ const RefPtr empty;
+ selected->set_script(empty);
+ }
+
+ } break;
case TOOL_MOVE_UP:
case TOOL_MOVE_DOWN: {
@@ -449,6 +489,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
break;
List<Node*> selection = editor_selection->get_selected_node_list();
+ if (selection.size()==0)
+ break;
List<Node*> reselect;
@@ -474,37 +516,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (selection.size()==1)
dupsingle=dup;
- String name = node->get_name();
-
- String nums;
- for(int i=name.length()-1;i>=0;i--) {
- CharType n=name[i];
- if (n>='0' && n<='9') {
- nums=String::chr(name[i])+nums;
- } else {
- break;
- }
- }
-
- int num=nums.to_int();
- if (num<1)
- num=1;
- else
- num++;
-
- String nnsep = _get_name_num_separator();
- name = name.substr(0,name.length()-nums.length()).strip_edges();
- if ( name.substr(name.length()-nnsep.length(),nnsep.length()) == nnsep) {
- name = name.substr(0,name.length()-nnsep.length());
- }
- String attempt = (name + nnsep + itos(num)).strip_edges();
-
- while(parent->has_node(attempt)) {
- num++;
- attempt = (name + nnsep + itos(num)).strip_edges();
- }
-
- dup->set_name(attempt);
+ dup->set_name(parent->validate_child_name(dup));
editor_data->get_undo_redo().add_do_method(parent,"_add_child_below_node",node, dup);
for (List<Node*>::Element *F=owned.front();F;F=F->next()) {
@@ -522,8 +534,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
- editor_data->get_undo_redo().add_do_method(sed,"live_debug_duplicate_node",edited_scene->get_path_to(node),attempt);
- editor_data->get_undo_redo().add_undo_method(sed,"live_debug_remove_node",NodePath(String(edited_scene->get_path_to(parent))+"/"+attempt));
+ editor_data->get_undo_redo().add_do_method(sed,"live_debug_duplicate_node",edited_scene->get_path_to(node),dup->get_name());
+ editor_data->get_undo_redo().add_undo_method(sed,"live_debug_remove_node",NodePath(String(edited_scene->get_path_to(parent))+"/"+dup->get_name()));
//parent->add_child(dup);
//reselect.push_back(dup);
@@ -684,7 +696,8 @@ void SceneTreeDock::_notification(int p_what) {
}
button_add->set_icon(get_icon("Add","EditorIcons"));
button_instance->set_icon(get_icon("Instance","EditorIcons"));
- button_create_script->set_icon(get_icon("Script","EditorIcons"));
+ button_create_script->set_icon(get_icon("ScriptCreate","EditorIcons"));
+ button_clear_script->set_icon(get_icon("Remove", "EditorIcons"));
filter_icon->set_texture(get_icon("Zoom","EditorIcons"));
@@ -717,7 +730,7 @@ void SceneTreeDock::_node_selected() {
return;
}
- if (ScriptEditor::get_singleton()->is_visible()) {
+ if (ScriptEditor::get_singleton()->is_visible_in_tree()) {
restore_script_editor_on_drag=true;
}
@@ -739,11 +752,11 @@ Node *SceneTreeDock::_duplicate(Node *p_node, Map<Node*,Node*> &duplimap) {
Ref<PackedScene> sd = ResourceLoader::load( p_node->get_filename() );
ERR_FAIL_COND_V(!sd.is_valid(),NULL);
- node = sd->instance(true);
+ node = sd->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
ERR_FAIL_COND_V(!node,NULL);
//node->generate_instance_state();
} else {
- Object *obj = ObjectTypeDB::instance(p_node->get_type());
+ Object *obj = ClassDB::instance(p_node->get_class());
ERR_FAIL_COND_V(!obj,NULL);
node = obj->cast_to<Node>();
if (!node)
@@ -841,7 +854,7 @@ void SceneTreeDock::_fill_path_renames(Vector<StringName> base_path,Vector<Strin
void SceneTreeDock::fill_path_renames(Node* p_node, Node *p_new_parent, List<Pair<NodePath,NodePath> > *p_renames) {
- if (!bool(EDITOR_DEF("animation/autorename_animation_tracks",true)))
+ if (!bool(EDITOR_DEF("editors/animation/autorename_animation_tracks",true)))
return;
@@ -874,7 +887,7 @@ void SceneTreeDock::perform_node_renames(Node* p_base,List<Pair<NodePath,NodePat
if (!r_rem_anims)
r_rem_anims=&rem_anims;
- if (!bool(EDITOR_DEF("animation/autorename_animation_tracks",true)))
+ if (!bool(EDITOR_DEF("editors/animation/autorename_animation_tracks",true)))
return;
if (!p_base) {
@@ -1109,6 +1122,7 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
editor_data->get_undo_redo().create_action(TTR("Reparent Node"));
List<Pair<NodePath,NodePath> > path_renames;
+ Vector<StringName> former_names;
int inc=0;
@@ -1118,6 +1132,7 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
Node *node = p_nodes[ni];
fill_path_renames(node,new_parent,&path_renames);
+ former_names.push_back(node->get_name());
List<Node*> owned;
node->get_owned_by(node->get_owner(),&owned);
@@ -1140,7 +1155,7 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
editor_data->get_undo_redo().add_do_method(new_parent,"move_child",node,p_position_in_parent+inc);
ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
- String new_name = new_parent->validate_child_name(node->get_name());
+ String new_name = new_parent->validate_child_name(node);
editor_data->get_undo_redo().add_do_method(sed,"live_debug_reparent_node",edited_scene->get_path_to(node),edited_scene->get_path_to(new_parent),new_name,-1);
editor_data->get_undo_redo().add_undo_method(sed,"live_debug_reparent_node",NodePath(String(edited_scene->get_path_to(new_parent))+"/"+new_name),edited_scene->get_path_to(node->get_parent()),node->get_name(),node->get_index());
@@ -1159,6 +1174,7 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
editor_data->get_undo_redo().add_do_method(AnimationPlayerEditor::singleton->get_key_editor(),"set_root",node);
editor_data->get_undo_redo().add_undo_method(new_parent,"remove_child",node);
+ editor_data->get_undo_redo().add_undo_method(node,"set_name",former_names[ni]);
inc++;
@@ -1311,10 +1327,18 @@ void SceneTreeDock::_selection_changed() {
_tool_selected(TOOL_MULTI_EDIT);
}
- if (selection_size==1 && EditorNode::get_singleton()->get_editor_selection()->get_selection().front()->key()->get_script().is_null()) {
- button_create_script->show();
+ if (selection_size==1) {
+ if(EditorNode::get_singleton()->get_editor_selection()->get_selection().front()->key()->get_script().is_null()) {
+ button_create_script->show();
+ button_clear_script->hide();
+ }
+ else {
+ button_create_script->hide();
+ button_clear_script->show();
+ }
} else {
button_create_script->hide();
+ button_clear_script->hide();
}
//tool_buttons[TOOL_MULTI_EDIT]->set_disabled(EditorNode::get_singleton()->get_editor_selection()->get_selection().size()<2);
@@ -1360,9 +1384,9 @@ void SceneTreeDock::_create() {
editor_data->get_undo_redo().add_undo_method(parent,"remove_child",child);
- String new_name = parent->validate_child_name(child->get_type());
+ String new_name = parent->validate_child_name(child);
ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
- editor_data->get_undo_redo().add_do_method(sed,"live_debug_create_node",edited_scene->get_path_to(parent),child->get_type(),new_name);
+ editor_data->get_undo_redo().add_do_method(sed,"live_debug_create_node",edited_scene->get_path_to(parent),child->get_class(),new_name);
editor_data->get_undo_redo().add_undo_method(sed,"live_debug_remove_node",NodePath(String(edited_scene->get_path_to(parent))+"/"+new_name));
} else {
@@ -1538,10 +1562,12 @@ void SceneTreeDock::_new_scene_from(String p_file) {
}
int flg=0;
- if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources"))
+ if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources"))
flg|=ResourceSaver::FLAG_COMPRESS;
- //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative"))
- // flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
+ /*
+ if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative"))
+ flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
+ */
err = ResourceSaver::save(p_file,sdata,flg);
@@ -1551,7 +1577,7 @@ void SceneTreeDock::_new_scene_from(String p_file) {
accept->popup_centered_minsize();
return;
}
-
+ _replace_with_branch_scene(p_file, base);
} else {
accept->get_ok()->set_text(TTR("I see.."));
accept->set_text(TTR("Error duplicating scene to save it."));
@@ -1574,7 +1600,7 @@ static bool _is_node_visible(Node* p_node) {
static bool _has_visible_children(Node* p_node) {
- bool collapsed = p_node->has_meta("_editor_collapsed") ? (bool)p_node->get_meta("_editor_collapsed") : false;
+ bool collapsed = p_node->is_displayed_folded();
if (collapsed)
return false;
@@ -1597,7 +1623,7 @@ static Node* _find_last_visible(Node* p_node) {
Node* last=NULL;
- bool collapsed = p_node->has_meta("_editor_collapsed") ? (bool)p_node->get_meta("_editor_collapsed") : false;
+ bool collapsed = p_node->is_displayed_folded();
if (!collapsed) {
for(int i=0;i<p_node->get_child_count();i++) {
@@ -1632,36 +1658,9 @@ void SceneTreeDock::_normalize_drop(Node*& to_node, int &to_pos, int p_type) {
ERR_EXPLAIN("Cannot perform drop above the root node!");
ERR_FAIL();
}
- Node* upper_sibling=NULL;
-
- for(int i=0;i<to_node->get_index();i++) {
- Node *c =to_node->get_parent()->get_child(i);
- if (_is_node_visible(c)) {
- upper_sibling=c;
- }
- }
-
- if (upper_sibling) {
- //quite complicated, look for next visible in tree
- upper_sibling=_find_last_visible(upper_sibling);
-
- if (upper_sibling->get_parent()==to_node->get_parent()) {
- //just insert over this node because nothing is above at an upper level
- to_pos=to_node->get_index();
- to_node=to_node->get_parent();
- } else {
- to_pos=-1; //insert last in whathever is up
- to_node=upper_sibling->get_parent(); //insert at a parent of whathever is up
- }
-
-
- } else {
- //just insert over this node because nothing is above at the same level
- to_pos=to_node->get_index();
- to_node=to_node->get_parent();
-
- }
+ to_pos=to_node->get_index();
+ to_node=to_node->get_parent();
} else if (p_type==1) {
//drop at below selected node
@@ -1731,6 +1730,15 @@ void SceneTreeDock::_files_dropped(Vector<String> p_files,NodePath p_to,int p_ty
_perform_instance_scenes(p_files,node,to_pos);
}
+void SceneTreeDock::_script_dropped(String p_file, NodePath p_to) {
+ Ref<Script> scr = ResourceLoader::load(p_file);
+ ERR_FAIL_COND(!scr.is_valid());
+ Node *n = get_node(p_to);
+ if (n) {
+ n->set_script(scr.get_ref_ptr());
+ }
+}
+
void SceneTreeDock::_nodes_dragged(Array p_nodes,NodePath p_to,int p_type) {
Vector<Node*> nodes;
@@ -1785,7 +1793,8 @@ void SceneTreeDock::_tree_rmb(const Vector2& p_menu_pos) {
//menu->add_icon_item(get_icon("Groups","EditorIcons"),TTR("Edit Groups"),TOOL_GROUP);
//menu->add_icon_item(get_icon("Connect","EditorIcons"),TTR("Edit Connections"),TOOL_CONNECT);
menu->add_separator();
- menu->add_icon_shortcut(get_icon("Script","EditorIcons"),ED_GET_SHORTCUT("scene_tree/add_script"), TOOL_SCRIPT);
+ menu->add_icon_shortcut(get_icon("ScriptCreate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT);
+ menu->add_icon_shortcut(get_icon("Remove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT);
menu->add_separator();
}
@@ -1832,7 +1841,7 @@ void SceneTreeDock::_focus_node() {
Node *node = scene_tree->get_selected();
ERR_FAIL_COND(!node);
- if (node->is_type("CanvasItem")) {
+ if (node->is_class("CanvasItem")) {
CanvasItemEditorPlugin *editor = editor_data->get_editor("2D")->cast_to<CanvasItemEditorPlugin>();
editor->get_canvas_item_editor()->focus_selection();
} else {
@@ -1844,37 +1853,38 @@ void SceneTreeDock::_focus_node() {
void SceneTreeDock::open_script_dialog(Node* p_for_node) {
scene_tree->set_selected(p_for_node,false);
- _tool_selected(TOOL_SCRIPT);
+ _tool_selected(TOOL_ATTACH_SCRIPT);
}
void SceneTreeDock::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_tool_selected"),&SceneTreeDock::_tool_selected,DEFVAL(false));
- ObjectTypeDB::bind_method(_MD("_create"),&SceneTreeDock::_create);
- //ObjectTypeDB::bind_method(_MD("_script_created"),&SceneTreeDock::_script_created);
- ObjectTypeDB::bind_method(_MD("_node_reparent"),&SceneTreeDock::_node_reparent);
- ObjectTypeDB::bind_method(_MD("_set_owners"),&SceneTreeDock::_set_owners);
- ObjectTypeDB::bind_method(_MD("_node_selected"),&SceneTreeDock::_node_selected);
- ObjectTypeDB::bind_method(_MD("_node_renamed"),&SceneTreeDock::_node_renamed);
- ObjectTypeDB::bind_method(_MD("_script_created"),&SceneTreeDock::_script_created);
- ObjectTypeDB::bind_method(_MD("_load_request"),&SceneTreeDock::_load_request);
- ObjectTypeDB::bind_method(_MD("_script_open_request"),&SceneTreeDock::_script_open_request);
- ObjectTypeDB::bind_method(_MD("_unhandled_key_input"),&SceneTreeDock::_unhandled_key_input);
- ObjectTypeDB::bind_method(_MD("_input"),&SceneTreeDock::_input);
- ObjectTypeDB::bind_method(_MD("_nodes_drag_begin"),&SceneTreeDock::_nodes_drag_begin);
- ObjectTypeDB::bind_method(_MD("_delete_confirm"),&SceneTreeDock::_delete_confirm);
- ObjectTypeDB::bind_method(_MD("_node_prerenamed"),&SceneTreeDock::_node_prerenamed);
- ObjectTypeDB::bind_method(_MD("_import_subscene"),&SceneTreeDock::_import_subscene);
- ObjectTypeDB::bind_method(_MD("_selection_changed"),&SceneTreeDock::_selection_changed);
- ObjectTypeDB::bind_method(_MD("_new_scene_from"),&SceneTreeDock::_new_scene_from);
- ObjectTypeDB::bind_method(_MD("_nodes_dragged"),&SceneTreeDock::_nodes_dragged);
- ObjectTypeDB::bind_method(_MD("_files_dropped"),&SceneTreeDock::_files_dropped);
- ObjectTypeDB::bind_method(_MD("_tree_rmb"),&SceneTreeDock::_tree_rmb);
- ObjectTypeDB::bind_method(_MD("_filter_changed"),&SceneTreeDock::_filter_changed);
- ObjectTypeDB::bind_method(_MD("_focus_node"),&SceneTreeDock::_focus_node);
-
-
- ObjectTypeDB::bind_method(_MD("instance"),&SceneTreeDock::instance);
+ ClassDB::bind_method(_MD("_tool_selected"),&SceneTreeDock::_tool_selected,DEFVAL(false));
+ ClassDB::bind_method(_MD("_create"),&SceneTreeDock::_create);
+ //ClassDB::bind_method(_MD("_script_created"),&SceneTreeDock::_script_created);
+ ClassDB::bind_method(_MD("_node_reparent"),&SceneTreeDock::_node_reparent);
+ ClassDB::bind_method(_MD("_set_owners"),&SceneTreeDock::_set_owners);
+ ClassDB::bind_method(_MD("_node_selected"),&SceneTreeDock::_node_selected);
+ ClassDB::bind_method(_MD("_node_renamed"),&SceneTreeDock::_node_renamed);
+ ClassDB::bind_method(_MD("_script_created"),&SceneTreeDock::_script_created);
+ ClassDB::bind_method(_MD("_load_request"),&SceneTreeDock::_load_request);
+ ClassDB::bind_method(_MD("_script_open_request"),&SceneTreeDock::_script_open_request);
+ ClassDB::bind_method(_MD("_unhandled_key_input"),&SceneTreeDock::_unhandled_key_input);
+ ClassDB::bind_method(_MD("_input"),&SceneTreeDock::_input);
+ ClassDB::bind_method(_MD("_nodes_drag_begin"),&SceneTreeDock::_nodes_drag_begin);
+ ClassDB::bind_method(_MD("_delete_confirm"),&SceneTreeDock::_delete_confirm);
+ ClassDB::bind_method(_MD("_node_prerenamed"),&SceneTreeDock::_node_prerenamed);
+ ClassDB::bind_method(_MD("_import_subscene"),&SceneTreeDock::_import_subscene);
+ ClassDB::bind_method(_MD("_selection_changed"),&SceneTreeDock::_selection_changed);
+ ClassDB::bind_method(_MD("_new_scene_from"),&SceneTreeDock::_new_scene_from);
+ ClassDB::bind_method(_MD("_nodes_dragged"),&SceneTreeDock::_nodes_dragged);
+ ClassDB::bind_method(_MD("_files_dropped"),&SceneTreeDock::_files_dropped);
+ ClassDB::bind_method(_MD("_script_dropped"),&SceneTreeDock::_script_dropped);
+ ClassDB::bind_method(_MD("_tree_rmb"),&SceneTreeDock::_tree_rmb);
+ ClassDB::bind_method(_MD("_filter_changed"),&SceneTreeDock::_filter_changed);
+ ClassDB::bind_method(_MD("_focus_node"),&SceneTreeDock::_focus_node);
+
+
+ ClassDB::bind_method(_MD("instance"),&SceneTreeDock::instance);
}
@@ -1895,7 +1905,8 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
ED_SHORTCUT("scene_tree/add_child_node",TTR("Add Child Node"), KEY_MASK_CMD|KEY_A);
ED_SHORTCUT("scene_tree/instance_scene",TTR("Instance Child Scene"));
ED_SHORTCUT("scene_tree/change_node_type", TTR("Change Type"));
- ED_SHORTCUT("scene_tree/add_script", TTR("Add Script"));
+ ED_SHORTCUT("scene_tree/attach_script", TTR("Attach Script"));
+ ED_SHORTCUT("scene_tree/clear_script", TTR("Clear Script"));
ED_SHORTCUT("scene_tree/move_up", TTR("Move Up"), KEY_MASK_CMD | KEY_UP);
ED_SHORTCUT("scene_tree/move_down", TTR("Move Down"), KEY_MASK_CMD | KEY_DOWN);
ED_SHORTCUT("scene_tree/duplicate", TTR("Duplicate"),KEY_MASK_CMD | KEY_D);
@@ -1925,19 +1936,26 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
filter = memnew( LineEdit );
filter->set_h_size_flags(SIZE_EXPAND_FILL);
filter_hbc->add_child(filter);
- filter_icon = memnew( TextureFrame );
+ filter_icon = memnew( TextureRect );
filter_hbc->add_child(filter_icon);
- filter_icon->set_stretch_mode(TextureFrame::STRETCH_KEEP_CENTERED);
+ filter_icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
filter->connect("text_changed",this,"_filter_changed");
tb = memnew( ToolButton );
- tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_SCRIPT, false));
- tb->set_tooltip(TTR("Create a new script for the selected node."));
- tb->set_shortcut(ED_GET_SHORTCUT("scene_tree/add_script"));
+ tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_ATTACH_SCRIPT, false));
+ tb->set_tooltip(TTR("Attach a new or existing script for the selected node."));
+ tb->set_shortcut(ED_GET_SHORTCUT("scene_tree/attach_script"));
filter_hbc->add_child(tb);
button_create_script=tb;
+ tb = memnew(ToolButton);
+ tb->connect("pressed", this, "_tool_selected", make_binds(TOOL_CLEAR_SCRIPT, false));
+ tb->set_tooltip(TTR("Clear a script for the selected node."));
+ tb->set_shortcut(ED_GET_SHORTCUT("scene_tree/clear_script"));
+ filter_hbc->add_child(tb);
+ button_clear_script = tb;
+
scene_tree = memnew( SceneTreeEditor(false,true,true ));
vbc->add_child(scene_tree);
@@ -1951,10 +1969,10 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
scene_tree->connect("open_script",this,"_script_open_request");
scene_tree->connect("nodes_rearranged",this,"_nodes_dragged");
scene_tree->connect("files_dropped",this,"_files_dropped");
+ scene_tree->connect("script_dropped",this,"_script_dropped");
scene_tree->connect("nodes_dragged",this,"_nodes_drag_begin");
scene_tree->get_scene_tree()->connect("item_double_clicked", this, "_focus_node");
- scene_tree->get_scene_tree()->set_delayed_text_editor(true);
scene_tree->set_undo_redo(&editor_data->get_undo_redo());
scene_tree->set_editor_selection(editor_selection);
@@ -2005,7 +2023,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
menu = memnew( PopupMenu );
add_child(menu);
- menu->connect("item_pressed",this,"_tool_selected");
+ menu->connect("id_pressed",this,"_tool_selected");
first_enter=true;
restore_script_editor_on_drag=false;
diff --git a/tools/editor/scene_tree_dock.h b/tools/editor/scene_tree_dock.h
index 971013a568..0699da3474 100644
--- a/tools/editor/scene_tree_dock.h
+++ b/tools/editor/scene_tree_dock.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -49,7 +49,7 @@ class EditorNode;
class SceneTreeDock : public VBoxContainer {
- OBJ_TYPE( SceneTreeDock, VBoxContainer );
+ GDCLASS( SceneTreeDock, VBoxContainer );
enum Tool {
@@ -58,7 +58,8 @@ class SceneTreeDock : public VBoxContainer {
TOOL_REPLACE,
TOOL_CONNECT,
TOOL_GROUP,
- TOOL_SCRIPT,
+ TOOL_ATTACH_SCRIPT,
+ TOOL_CLEAR_SCRIPT,
TOOL_MOVE_UP,
TOOL_MOVE_DOWN,
TOOL_DUPLICATE,
@@ -79,6 +80,7 @@ class SceneTreeDock : public VBoxContainer {
ToolButton *button_add;
ToolButton *button_instance;
ToolButton *button_create_script;
+ ToolButton *button_clear_script;
SceneTreeEditor *scene_tree;
@@ -100,7 +102,7 @@ class SceneTreeDock : public VBoxContainer {
EditorFileDialog *new_scene_from_dialog;
LineEdit *filter;
- TextureFrame *filter_icon;
+ TextureRect *filter_icon;
PopupMenu * menu;
@@ -147,13 +149,16 @@ class SceneTreeDock : public VBoxContainer {
void _nodes_dragged(Array p_nodes,NodePath p_to,int p_type);
void _files_dropped(Vector<String> p_files,NodePath p_to,int p_type);
+ void _script_dropped(String p_file, NodePath p_to);
void _tree_rmb(const Vector2& p_menu_pos);
void _filter_changed(const String& p_filter);
void _perform_instance_scenes(const Vector<String>& p_files,Node* parent,int p_pos);
+ void _replace_with_branch_scene(const String& p_file,Node* base);
+ void _file_selected(String p_file);
protected:
void _notification(int p_what);
@@ -173,7 +178,7 @@ public:
void fill_path_renames(Node* p_node, Node *p_new_parent, List<Pair<NodePath,NodePath> > *p_renames);
void perform_node_renames(Node* p_base,List<Pair<NodePath,NodePath> > *p_renames, Map<Ref<Animation>, Set<int> > *r_rem_anims=NULL);
SceneTreeEditor *get_tree_editor() { return scene_tree; }
-
+ EditorData *get_editor_data() { return editor_data; }
void open_script_dialog(Node* p_for_node);
SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelection *p_editor_selection,EditorData &p_editor_data);
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index e5a97fa26e..7b6a03e20e 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -206,28 +206,15 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id)
} else if (p_id==BUTTON_VISIBILITY) {
- if (n->is_type("Spatial")) {
-
- Spatial *ci = n->cast_to<Spatial>();
- if (!ci->is_visible() && ci->get_parent_spatial() && !ci->get_parent_spatial()->is_visible()) {
- error->set_text(TTR("This item cannot be made visible because the parent is hidden. Unhide the parent first."));
- error->popup_centered_minsize();
- return;
- }
+ if (n->is_class("Spatial")) {
bool v = !bool(n->call("is_hidden"));
undo_redo->create_action(TTR("Toggle Spatial Visible"));
undo_redo->add_do_method(n,"_set_visible_",!v);
undo_redo->add_undo_method(n,"_set_visible_",v);
undo_redo->commit_action();
- } else if (n->is_type("CanvasItem")) {
+ } else if (n->is_class("CanvasItem")) {
- CanvasItem *ci = n->cast_to<CanvasItem>();
- if (!ci->is_visible() && ci->get_parent_item() && !ci->get_parent_item()->is_visible()) {
- error->set_text(TTR("This item cannot be made visible because the parent is hidden. Unhide the parent first."));
- error->popup_centered_minsize();
- return;
- }
bool v = !bool(n->call("is_hidden"));
undo_redo->create_action(TTR("Toggle CanvasItem Visible"));
undo_redo->add_do_method(n,v?"hide":"show");
@@ -237,14 +224,14 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id)
} else if (p_id==BUTTON_LOCK) {
- if (n->is_type("CanvasItem")) {
+ if (n->is_class("CanvasItem")) {
n->set_meta("_edit_lock_", Variant());
_update_tree();
emit_signal("node_changed");
}
} else if (p_id==BUTTON_GROUP) {
- if (n->is_type("CanvasItem")) {
+ if (n->is_class("CanvasItem")) {
n->set_meta("_edit_group_", Variant());
_update_tree();
emit_signal("node_changed");
@@ -254,7 +241,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id)
String config_err = n->get_configuration_warning();
if (config_err==String())
return;
- config_err=config_err.world_wrap(80);
+ config_err=config_err.word_wrap(80);
warning->set_text(config_err);
warning->popup_centered_minsize();
@@ -327,7 +314,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) {
if (p_node->has_meta("_editor_icon"))
icon=p_node->get_meta("_editor_icon");
else
- icon=get_icon( (has_icon(p_node->get_type(),"EditorIcons")?p_node->get_type():String("Object")),"EditorIcons");
+ icon=get_icon( (has_icon(p_node->get_class(),"EditorIcons")?p_node->get_class():String("Object")),"EditorIcons");
item->set_icon(0, icon );
item->set_metadata( 0,p_node->get_path() );
@@ -376,13 +363,13 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) {
if (p_node==get_scene_node() && p_node->get_scene_inherited_state().is_valid()) {
item->add_button(0,get_icon("InstanceOptions","EditorIcons"),BUTTON_SUBSCENE);
- item->set_tooltip(0,TTR("Inherits:")+" "+p_node->get_scene_inherited_state()->get_path()+"\n"+TTR("Type:")+" "+p_node->get_type());
+ item->set_tooltip(0,TTR("Inherits:")+" "+p_node->get_scene_inherited_state()->get_path()+"\n"+TTR("Type:")+" "+p_node->get_class());
} else if (p_node!=get_scene_node() && p_node->get_filename()!="" && can_open_instance) {
item->add_button(0,get_icon("InstanceOptions","EditorIcons"),BUTTON_SUBSCENE);
- item->set_tooltip(0,TTR("Instance:")+" "+p_node->get_filename()+"\n"+TTR("Type:")+" "+p_node->get_type());
+ item->set_tooltip(0,TTR("Instance:")+" "+p_node->get_filename()+"\n"+TTR("Type:")+" "+p_node->get_class());
} else {
- item->set_tooltip(0,String(p_node->get_name())+"\n"+TTR("Type:")+" "+p_node->get_type());
+ item->set_tooltip(0,String(p_node->get_name())+"\n"+TTR("Type:")+" "+p_node->get_class());
}
if (can_open_instance) {
@@ -396,7 +383,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) {
item->add_button(0,get_icon("Script","EditorIcons"),BUTTON_SCRIPT);
}
- if (p_node->is_type("CanvasItem")) {
+ if (p_node->is_class("CanvasItem")) {
bool is_locked = p_node->has_meta("_edit_lock_");//_edit_group_
if (is_locked)
@@ -415,7 +402,8 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) {
if (!p_node->is_connected("visibility_changed",this,"_node_visibility_changed"))
p_node->connect("visibility_changed",this,"_node_visibility_changed",varray(p_node));
- } else if (p_node->is_type("Spatial")) {
+ _update_visibility_color(p_node, item);
+ } else if (p_node->is_class("Spatial")) {
bool h = p_node->call("is_hidden");
if (h)
@@ -426,6 +414,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) {
if (!p_node->is_connected("visibility_changed",this,"_node_visibility_changed"))
p_node->connect("visibility_changed",this,"_node_visibility_changed",varray(p_node));
+ _update_visibility_color(p_node, item);
}
}
@@ -480,9 +469,9 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) {
bool visible=false;
- if (p_node->is_type("CanvasItem")) {
+ if (p_node->is_class("CanvasItem")) {
visible = !p_node->call("is_hidden");
- } else if (p_node->is_type("Spatial")) {
+ } else if (p_node->is_class("Spatial")) {
visible = !p_node->call("is_hidden");
}
@@ -491,9 +480,20 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) {
else
item->set_button(0,idx,get_icon("Visible","EditorIcons"));
-
+ _update_visibility_color(p_node, item);
}
+void SceneTreeEditor::_update_visibility_color(Node *p_node, TreeItem *p_item) {
+ if (p_node->is_class("CanvasItem") || p_node->is_class("Spatial")) {
+ Color color(1,1,1,1);
+ bool visible_on_screen = p_node->call("is_visible");
+ if (!visible_on_screen) {
+ color = Color(0.6,0.6,0.6,1);
+ }
+ int idx=p_item->get_button_by_id(0,BUTTON_VISIBILITY);
+ p_item->set_button_color(0,idx,color);
+ }
+}
void SceneTreeEditor::_node_script_changed(Node *p_node) {
@@ -524,7 +524,7 @@ void SceneTreeEditor::_node_removed(Node *p_node) {
if (p_node->is_connected("script_changed",this,"_node_script_changed"))
p_node->disconnect("script_changed",this,"_node_script_changed");
- if (p_node->is_type("Spatial") || p_node->is_type("CanvasItem")) {
+ if (p_node->is_class("Spatial") || p_node->is_class("CanvasItem")) {
if (p_node->is_connected("visibility_changed",this,"_node_visibility_changed"))
p_node->disconnect("visibility_changed",this,"_node_visibility_changed");
}
@@ -671,8 +671,8 @@ void SceneTreeEditor::_notification(int p_what) {
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);
+ //get_scene()->connect("tree_changed",this,"_tree_changed",Vector<Variant>(),CONNECT_DEFERRED);
+ //get_scene()->connect("node_removed",this,"_node_removed",Vector<Variant>(),CONNECT_DEFERRED);
_update_tree();
}
if (p_what==NOTIFICATION_EXIT_TREE) {
@@ -725,6 +725,12 @@ void SceneTreeEditor::set_selected(Node *p_node,bool p_emit_selected) {
TreeItem* item=p_node?_find(tree->get_root(),p_node->get_path()):NULL;
if (item) {
+ // make visible when it's collapsed
+ TreeItem* node=item->get_parent();
+ while (node && node!=tree->get_root()) {
+ node->set_collapsed(false);
+ node=node->get_parent();
+ }
item->select(0);
item->set_as_cursor(0);
selected=p_node;
@@ -947,13 +953,13 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2& p_point,Control* p_from)
if (i<list_max){
HBoxContainer *hb = memnew( HBoxContainer );
- TextureFrame *tf = memnew(TextureFrame);
+ TextureRect *tf = memnew(TextureRect);
tf->set_texture(icons[i]);
hb->add_child(tf);
Label *label = memnew( Label( selected[i]->get_name() ) );
hb->add_child(label);
vb->add_child(hb);
- hb->set_opacity(opacity_item);
+ hb->set_modulate(Color(1,1,1,opacity_item));
opacity_item -= opacity_step;
}
NodePath p = selected[i]->get_path();
@@ -971,6 +977,10 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2& p_point,Control* p_from)
return drag_data;
}
+bool SceneTreeEditor::_is_script_type(const StringName &p_type) const {
+ return (script_types->find(p_type));
+}
+
bool SceneTreeEditor::can_drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from) const {
if (!can_rename)
@@ -998,9 +1008,13 @@ bool SceneTreeEditor::can_drop_data_fw(const Point2& p_point,const Variant& p_da
if (files.size()==0)
return false; //weird
+ if (_is_script_type(EditorFileSystem::get_singleton()->get_file_type(files[0]))) {
+ tree->set_drop_mode_flags(Tree::DROP_MODE_ON_ITEM);
+ return true;
+ }
for(int i=0;i<files.size();i++) {
- String file = files[0];
+ String file = files[i];
String ftype = EditorFileSystem::get_singleton()->get_file_type(file);
if (ftype!="PackedScene")
return false;
@@ -1044,7 +1058,15 @@ void SceneTreeEditor::drop_data_fw(const Point2& p_point,const Variant& p_data,C
if (String(d["type"])=="files") {
- emit_signal("files_dropped",d["files"],np,section);
+ Vector<String> files = d["files"];
+
+
+ String ftype = EditorFileSystem::get_singleton()->get_file_type(files[0]);
+ if (_is_script_type(ftype)) {
+ emit_signal("script_dropped", files[0],np);
+ } else {
+ emit_signal("files_dropped",files,np,section);
+ }
}
}
@@ -1059,14 +1081,14 @@ void SceneTreeEditor::_warning_changed(Node* p_for_node) {
//should use a timer
update_timer->start();
-// print_line("WARNING CHANGED "+String(p_for_node->get_name()));
+ //print_line("WARNING CHANGED "+String(p_for_node->get_name()));
}
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");
+ bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines");
+ Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color");
if (enable_rl) {
tree->add_constant_override("draw_relationship_lines",1);
@@ -1080,31 +1102,31 @@ void SceneTreeEditor::_editor_settings_changed() {
void SceneTreeEditor::_bind_methods() {
- ObjectTypeDB::bind_method("_tree_changed",&SceneTreeEditor::_tree_changed);
- ObjectTypeDB::bind_method("_update_tree",&SceneTreeEditor::_update_tree);
- ObjectTypeDB::bind_method("_node_removed",&SceneTreeEditor::_node_removed);
- ObjectTypeDB::bind_method("_selected_changed",&SceneTreeEditor::_selected_changed);
- ObjectTypeDB::bind_method("_renamed",&SceneTreeEditor::_renamed);
- ObjectTypeDB::bind_method("_rename_node",&SceneTreeEditor::_rename_node);
- ObjectTypeDB::bind_method("_test_update_tree",&SceneTreeEditor::_test_update_tree);
- ObjectTypeDB::bind_method("_cell_multi_selected",&SceneTreeEditor::_cell_multi_selected);
- ObjectTypeDB::bind_method("_selection_changed",&SceneTreeEditor::_selection_changed);
- ObjectTypeDB::bind_method("_cell_button_pressed",&SceneTreeEditor::_cell_button_pressed);
- ObjectTypeDB::bind_method("_cell_collapsed",&SceneTreeEditor::_cell_collapsed);
- ObjectTypeDB::bind_method("_subscene_option",&SceneTreeEditor::_subscene_option);
- ObjectTypeDB::bind_method("_rmb_select",&SceneTreeEditor::_rmb_select);
- ObjectTypeDB::bind_method("_warning_changed",&SceneTreeEditor::_warning_changed);
+ ClassDB::bind_method("_tree_changed",&SceneTreeEditor::_tree_changed);
+ ClassDB::bind_method("_update_tree",&SceneTreeEditor::_update_tree);
+ ClassDB::bind_method("_node_removed",&SceneTreeEditor::_node_removed);
+ ClassDB::bind_method("_selected_changed",&SceneTreeEditor::_selected_changed);
+ ClassDB::bind_method("_renamed",&SceneTreeEditor::_renamed);
+ ClassDB::bind_method("_rename_node",&SceneTreeEditor::_rename_node);
+ ClassDB::bind_method("_test_update_tree",&SceneTreeEditor::_test_update_tree);
+ ClassDB::bind_method("_cell_multi_selected",&SceneTreeEditor::_cell_multi_selected);
+ ClassDB::bind_method("_selection_changed",&SceneTreeEditor::_selection_changed);
+ ClassDB::bind_method("_cell_button_pressed",&SceneTreeEditor::_cell_button_pressed);
+ ClassDB::bind_method("_cell_collapsed",&SceneTreeEditor::_cell_collapsed);
+ ClassDB::bind_method("_subscene_option",&SceneTreeEditor::_subscene_option);
+ ClassDB::bind_method("_rmb_select",&SceneTreeEditor::_rmb_select);
+ ClassDB::bind_method("_warning_changed",&SceneTreeEditor::_warning_changed);
- ObjectTypeDB::bind_method("_node_script_changed",&SceneTreeEditor::_node_script_changed);
- ObjectTypeDB::bind_method("_node_visibility_changed",&SceneTreeEditor::_node_visibility_changed);
+ ClassDB::bind_method("_node_script_changed",&SceneTreeEditor::_node_script_changed);
+ ClassDB::bind_method("_node_visibility_changed",&SceneTreeEditor::_node_visibility_changed);
- ObjectTypeDB::bind_method("_editor_settings_changed", &SceneTreeEditor::_editor_settings_changed);
+ ClassDB::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);
+ ClassDB::bind_method(_MD("get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw);
+ ClassDB::bind_method(_MD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw);
+ ClassDB::bind_method(_MD("drop_data_fw"), &SceneTreeEditor::drop_data_fw);
- ObjectTypeDB::bind_method(_MD("update_tree"), &SceneTreeEditor::update_tree);
+ ClassDB::bind_method(_MD("update_tree"), &SceneTreeEditor::update_tree);
ADD_SIGNAL( MethodInfo("node_selected") );
ADD_SIGNAL( MethodInfo("node_renamed") );
@@ -1112,7 +1134,8 @@ void SceneTreeEditor::_bind_methods() {
ADD_SIGNAL( MethodInfo("node_changed") );
ADD_SIGNAL( MethodInfo("nodes_dragged") );
ADD_SIGNAL( MethodInfo("nodes_rearranged",PropertyInfo(Variant::ARRAY,"paths"),PropertyInfo(Variant::NODE_PATH,"to_path"),PropertyInfo(Variant::INT,"type") ) );
- ADD_SIGNAL( MethodInfo("files_dropped",PropertyInfo(Variant::STRING_ARRAY,"files"),PropertyInfo(Variant::NODE_PATH,"to_path"),PropertyInfo(Variant::INT,"type") ) );
+ ADD_SIGNAL( MethodInfo("files_dropped",PropertyInfo(Variant::POOL_STRING_ARRAY,"files"),PropertyInfo(Variant::NODE_PATH,"to_path"),PropertyInfo(Variant::INT,"type") ) );
+ ADD_SIGNAL( MethodInfo("script_dropped",PropertyInfo(Variant::STRING,"file"),PropertyInfo(Variant::NODE_PATH,"to_path")));
ADD_SIGNAL( MethodInfo("rmb_pressed",PropertyInfo(Variant::VECTOR2,"pos")) ) ;
ADD_SIGNAL( MethodInfo("open") );
@@ -1163,7 +1186,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open
tree->connect("item_edited", this,"_renamed",varray(),CONNECT_DEFERRED);
tree->connect("multi_selected",this,"_cell_multi_selected");
tree->connect("button_pressed",this,"_cell_button_pressed");
-// tree->connect("item_edited", this,"_renamed",Vector<Variant>(),true);
+ //tree->connect("item_edited", this,"_renamed",Vector<Variant>(),true);
error = memnew( AcceptDialog );
add_child(error);
@@ -1187,14 +1210,14 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open
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");
+ instance_menu->connect("id_pressed",this,"_subscene_option");
add_child(instance_menu);
inheritance_menu = memnew( PopupMenu );
inheritance_menu->add_item(TTR("Clear Inheritance"),SCENE_MENU_CLEAR_INHERITANCE);
inheritance_menu->add_separator();
inheritance_menu->add_item(TTR("Open in Editor"),SCENE_MENU_OPEN_INHERITED);
- inheritance_menu->connect("item_pressed",this,"_subscene_option");
+ inheritance_menu->connect("id_pressed",this,"_subscene_option");
add_child(inheritance_menu);
@@ -1209,12 +1232,16 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open
update_timer->set_wait_time(0.5);
add_child(update_timer);
+ script_types = memnew(List<StringName>);
+ ClassDB::get_inheriters_from_class("Script", script_types);
+
}
SceneTreeEditor::~SceneTreeEditor() {
+ memdelete(script_types);
}
@@ -1237,7 +1264,7 @@ void SceneTreeDialog::_notification(int p_what) {
get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
}
- if (p_what==NOTIFICATION_VISIBILITY_CHANGED && is_visible()) {
+ if (p_what==NOTIFICATION_VISIBILITY_CHANGED && is_visible_in_tree()) {
tree->update_tree();
}
@@ -1262,8 +1289,8 @@ void SceneTreeDialog::_select() {
void SceneTreeDialog::_bind_methods() {
- ObjectTypeDB::bind_method("_select",&SceneTreeDialog::_select);
- ObjectTypeDB::bind_method("_cancel",&SceneTreeDialog::_cancel);
+ ClassDB::bind_method("_select",&SceneTreeDialog::_select);
+ ClassDB::bind_method("_cancel",&SceneTreeDialog::_cancel);
ADD_SIGNAL( MethodInfo("selected",PropertyInfo(Variant::NODE_PATH,"path")));
}
@@ -1275,7 +1302,7 @@ SceneTreeDialog::SceneTreeDialog() {
tree = memnew( SceneTreeEditor(false,false) );
add_child(tree);
- set_child_rect(tree);
+ //set_child_rect(tree);
tree->get_scene_tree()->connect("item_activated",this,"_select");
diff --git a/tools/editor/scene_tree_editor.h b/tools/editor/scene_tree_editor.h
index 79b7a64468..5586f02c00 100644
--- a/tools/editor/scene_tree_editor.h
+++ b/tools/editor/scene_tree_editor.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -40,7 +40,7 @@
*/
class SceneTreeEditor : public Control {
- OBJ_TYPE( SceneTreeEditor, Control );
+ GDCLASS( SceneTreeEditor, Control );
EditorSelection *editor_selection;
@@ -117,6 +117,7 @@ class SceneTreeEditor : public Control {
void _update_selection(TreeItem *item);
void _node_script_changed(Node *p_node);
void _node_visibility_changed(Node *p_node);
+ void _update_visibility_color(Node *p_node, TreeItem *p_item);
void _subscene_option(int p_idx);
void _node_replace_owner(Node* p_base,Node* p_node,Node* p_root);
@@ -137,6 +138,9 @@ class SceneTreeEditor : public Control {
Timer* update_timer;
+ List<StringName> *script_types;
+ bool _is_script_type(const StringName &p_type) const;
+
public:
void set_filter(const String& p_filter);
@@ -168,11 +172,11 @@ public:
class SceneTreeDialog : public ConfirmationDialog {
- OBJ_TYPE( SceneTreeDialog, ConfirmationDialog );
+ GDCLASS( SceneTreeDialog, ConfirmationDialog );
SceneTreeEditor *tree;
-// Button *select;
-// Button *cancel;
+ //Button *select;
+ //Button *cancel;
void update_tree();
void _select();
diff --git a/tools/editor/script_create_dialog.cpp b/tools/editor/script_create_dialog.cpp
index 749198314a..2a76224e33 100644
--- a/tools/editor/script_create_dialog.cpp
+++ b/tools/editor/script_create_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -38,7 +38,7 @@ void ScriptCreateDialog::config(const String& p_base_name,const String&p_base_pa
class_name->set_text("");
parent_name->set_text(p_base_name);
if (p_base_path!="") {
- initial_bp=p_base_path.basename();
+ initial_bp=p_base_path.get_basename();
file_path->set_text(initial_bp+"."+ScriptServer::get_language( language_menu->get_selected() )->get_extension());
} else {
initial_bp="";
@@ -96,8 +96,20 @@ void ScriptCreateDialog::_class_name_changed(const String& p_name) {
void ScriptCreateDialog::ok_pressed() {
- if (class_name->is_editable() && !_validate(class_name->get_text())) {
+ if (create_new){
+ _create_new();
+ } else {
+ _load_exist();
+ }
+
+ create_new=true;
+ _update_controls();
+
+}
+
+void ScriptCreateDialog::_create_new() {
+ if (class_name->is_editable() && !_validate(class_name->get_text())) {
alert->set_text(TTR("Class name is invalid!"));
alert->popup_centered_minsize();
return;
@@ -105,54 +117,55 @@ void ScriptCreateDialog::ok_pressed() {
if (!_validate(parent_name->get_text())) {
alert->set_text(TTR("Parent class name is invalid!"));
alert->popup_centered_minsize();
-
return;
-
}
-
String cname;
if (class_name->is_editable())
cname=class_name->get_text();
-
-
-
Ref<Script> scr = ScriptServer::get_language( language_menu->get_selected() )->get_template(cname,parent_name->get_text());
- //scr->set_source_code(text);
+ String selected_language = language_menu->get_item_text(language_menu->get_selected());
+ editor_settings->set_last_selected_language(selected_language);
if (cname!="")
scr->set_name(cname);
-
if (!internal->is_pressed()) {
-
-
- String lpath = Globals::get_singleton()->localize_path(file_path->get_text());
+ String lpath = GlobalConfig::get_singleton()->localize_path(file_path->get_text());
scr->set_path(lpath);
if (!path_valid) {
-
alert->set_text(TTR("Invalid path!"));
alert->popup_centered_minsize();
return;
-
}
Error err = ResourceSaver::save(lpath,scr,ResourceSaver::FLAG_CHANGE_PATH);
if (err!=OK) {
-
alert->set_text(TTR("Could not create script in filesystem."));
alert->popup_centered_minsize();
return;
}
- //scr->set_path(lpath);
- //EditorFileSystem::get_singleton()->update_file(lpath,scr->get_type());
+ }
+ hide();
+ emit_signal("script_created",scr);
+
+}
+void ScriptCreateDialog::_load_exist() {
+
+ String path=file_path->get_text();
+ RES p_script = ResourceLoader::load(path, "Script");
+ if (p_script.is_null()) {
+ alert->get_ok()->set_text(TTR("Ugh"));
+ alert->set_text(vformat(TTR("Error loading script from %s"), path));
+ alert->popup_centered_minsize();
+ return;
}
hide();
- emit_signal("script_created",scr);
+ emit_signal("script_created",p_script.get_ref_ptr());
}
@@ -164,10 +177,35 @@ void ScriptCreateDialog::_lang_changed(int l) {
} else {
class_name->set_editable(false);
}
- if (file_path->get_text().basename()==initial_bp) {
- file_path->set_text(initial_bp+"."+ScriptServer::get_language( l )->get_extension());
- _path_changed(file_path->get_text());
+
+ String selected_ext="."+ScriptServer::get_language( l )->get_extension();
+ String path=file_path->get_text();
+ String extension="";
+ if (path.find(".")>=0) {
+ extension=path.get_extension();
+ }
+
+ if (extension.length()==0) {
+ // add extension if none
+ path+=selected_ext;
+ _path_changed(path);
+ } else {
+ // change extension by selected language
+ List<String> extensions;
+ // get all possible extensions for script
+ for (int l=0;l<language_menu->get_item_count();l++) {
+ ScriptServer::get_language( l )->get_recognized_extensions(&extensions);
+ }
+
+ for(List<String>::Element *E=extensions.front();E;E=E->next()) {
+ if (E->get().nocasecmp_to(extension)==0) {
+ path=path.get_basename()+selected_ext;
+ _path_changed(path);
+ break;
+ }
+ }
}
+ file_path->set_text(path);
_class_name_changed(class_name->get_text());
}
@@ -189,8 +227,10 @@ void ScriptCreateDialog::_browse_path() {
file_browse->clear_filters();
List<String> extensions;
- int l=language_menu->get_selected();
- ScriptServer::get_language( l )->get_recognized_extensions(&extensions);
+ // get all possible extensions for script
+ for (int l=0;l<language_menu->get_item_count();l++) {
+ ScriptServer::get_language( l )->get_recognized_extensions(&extensions);
+ }
for(List<String>::Element *E=extensions.front();E;E=E->next()) {
file_browse->add_filter("*."+E->get());
@@ -203,7 +243,7 @@ void ScriptCreateDialog::_browse_path() {
void ScriptCreateDialog::_file_selected(const String& p_file) {
- String p = Globals::get_singleton()->localize_path(p_file);
+ String p = GlobalConfig::get_singleton()->localize_path(p_file);
file_path->set_text(p);
_path_changed(p);
@@ -222,7 +262,7 @@ void ScriptCreateDialog::_path_changed(const String& p_path) {
}
- p = Globals::get_singleton()->localize_path(p);
+ p = GlobalConfig::get_singleton()->localize_path(p);
if (!p.begins_with("res://")) {
path_error_label->set_text(TTR("Path is not local"));
@@ -244,58 +284,66 @@ void ScriptCreateDialog::_path_changed(const String& p_path) {
memdelete(d);
}
-
-
FileAccess *f = FileAccess::create(FileAccess::ACCESS_RESOURCES);
-
- if (f->file_exists(p)) {
-
- path_error_label->set_text(TTR("File exists"));
- path_error_label->add_color_override("font_color",Color(1,0.4,0.0,0.8));
- memdelete(f);
- return;
- }
-
+ create_new=!f->file_exists(p);
memdelete(f);
- String extension=p.extension();
+ String extension=p.get_extension();
List<String> extensions;
- int l=language_menu->get_selected();
- ScriptServer::get_language( l )->get_recognized_extensions(&extensions);
+ // get all possible extensions for script
+ for (int l=0;l<language_menu->get_item_count();l++) {
+ ScriptServer::get_language( l )->get_recognized_extensions(&extensions);
+ }
bool found=false;
+ int index=0;
for(List<String>::Element *E=extensions.front();E;E=E->next()) {
if (E->get().nocasecmp_to(extension)==0) {
+ language_menu->select(index); // change Language option by extension
found=true;
break;
}
+ index++;
}
if (!found) {
-
path_error_label->set_text(TTR("Invalid extension"));
path_error_label->add_color_override("font_color",Color(1,0.4,0.0,0.8));
return;
}
+ _update_controls();
- path_error_label->set_text(TTR("Valid path"));
path_error_label->add_color_override("font_color",Color(0,1.0,0.8,0.8));
path_valid=true;
}
+void ScriptCreateDialog::_update_controls() {
+
+ if (create_new) {
+ path_error_label->set_text(TTR("Create new script"));
+ get_ok()->set_text(TTR("Create"));
+ } else {
+ path_error_label->set_text(TTR("Load existing script"));
+ get_ok()->set_text(TTR("Load"));
+ }
+ parent_name->set_editable(create_new);
+ internal->set_disabled(!create_new);
+
+}
+
void ScriptCreateDialog::_bind_methods() {
- ObjectTypeDB::bind_method("_class_name_changed",&ScriptCreateDialog::_class_name_changed);
- ObjectTypeDB::bind_method("_lang_changed",&ScriptCreateDialog::_lang_changed);
- ObjectTypeDB::bind_method("_built_in_pressed",&ScriptCreateDialog::_built_in_pressed);
- ObjectTypeDB::bind_method("_browse_path",&ScriptCreateDialog::_browse_path);
- ObjectTypeDB::bind_method("_file_selected",&ScriptCreateDialog::_file_selected);
- ObjectTypeDB::bind_method("_path_changed",&ScriptCreateDialog::_path_changed);
+ ClassDB::bind_method("_class_name_changed",&ScriptCreateDialog::_class_name_changed);
+ ClassDB::bind_method("_lang_changed",&ScriptCreateDialog::_lang_changed);
+ ClassDB::bind_method("_built_in_pressed",&ScriptCreateDialog::_built_in_pressed);
+ ClassDB::bind_method("_browse_path",&ScriptCreateDialog::_browse_path);
+ ClassDB::bind_method("_file_selected",&ScriptCreateDialog::_file_selected);
+ ClassDB::bind_method("_path_changed",&ScriptCreateDialog::_path_changed);
ADD_SIGNAL(MethodInfo("script_created",PropertyInfo(Variant::OBJECT,"script",PROPERTY_HINT_RESOURCE_TYPE,"Script")));
}
@@ -305,7 +353,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
VBoxContainer *vb = memnew( VBoxContainer );
add_child(vb);
- set_child_rect(vb);
+ //set_child_rect(vb);
class_name = memnew( LineEdit );
@@ -330,7 +378,17 @@ ScriptCreateDialog::ScriptCreateDialog() {
language_menu->add_item(ScriptServer::get_language(i)->get_name());
}
- language_menu->select(0);
+ editor_settings = EditorSettings::get_singleton();
+ String last_selected_language = editor_settings->get_last_selected_language();
+ if (last_selected_language != "")
+ for (int i = 0; i < language_menu->get_item_count(); i++)
+ if (language_menu->get_item_text(i) == last_selected_language)
+ {
+ language_menu->select(i);
+ break;
+ }
+ else language_menu->select(0);
+
language_menu->connect("item_selected",this,"_lang_changed");
//parent_name->set_text();
@@ -364,7 +422,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
set_size(Size2(200,150));
set_hide_on_ok(false);
- set_title(TTR("Create Node Script"));
+ set_title(TTR("Attach Node Script"));
file_browse = memnew( EditorFileDialog );
file_browse->connect("file_selected",this,"_file_selected");
@@ -373,4 +431,6 @@ ScriptCreateDialog::ScriptCreateDialog() {
alert = memnew( AcceptDialog );
add_child(alert);
_lang_changed(0);
+
+ create_new=true;
}
diff --git a/tools/editor/script_create_dialog.h b/tools/editor/script_create_dialog.h
index 181989402e..df16efc73c 100644
--- a/tools/editor/script_create_dialog.h
+++ b/tools/editor/script_create_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -33,10 +33,11 @@
#include "scene/gui/line_edit.h"
#include "scene/gui/option_button.h"
#include "tools/editor/editor_file_dialog.h"
+#include "tools/editor/editor_settings.h"
#include "scene/gui/check_button.h"
class ScriptCreateDialog : public ConfirmationDialog {
- OBJ_TYPE(ScriptCreateDialog,ConfirmationDialog);
+ GDCLASS(ScriptCreateDialog,ConfirmationDialog);
LineEdit *class_name;
Label *error_label;
@@ -49,7 +50,9 @@ class ScriptCreateDialog : public ConfirmationDialog {
VBoxContainer *path_vb;
AcceptDialog *alert;
bool path_valid;
+ bool create_new;
String initial_bp;
+ EditorSettings *editor_settings;
void _path_changed(const String& p_path=String());
@@ -60,6 +63,9 @@ class ScriptCreateDialog : public ConfirmationDialog {
void _browse_path();
void _file_selected(const String& p_file);
virtual void ok_pressed();
+ void _create_new();
+ void _load_exist();
+ void _update_controls();
protected:
static void _bind_methods();
diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp
index 7fba73ca08..e53e69d9e0 100644
--- a/tools/editor/script_editor_debugger.cpp
+++ b/tools/editor/script_editor_debugger.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -46,7 +46,7 @@
class ScriptEditorDebuggerVariables : public Object {
- OBJ_TYPE( ScriptEditorDebuggerVariables, Object );
+ GDCLASS( ScriptEditorDebuggerVariables, Object );
List<PropertyInfo> props;
Map<StringName,Variant> values;
@@ -114,7 +114,7 @@ public:
class ScriptEditorDebuggerInspectedObject : public Object {
- OBJ_TYPE( ScriptEditorDebuggerInspectedObject, Object);
+ GDCLASS( ScriptEditorDebuggerInspectedObject, Object);
@@ -177,7 +177,7 @@ void ScriptEditorDebugger::debug_next() {
ERR_FAIL_COND(!breaked);
ERR_FAIL_COND(connection.is_null());
- ERR_FAIL_COND(!connection->is_connected());
+ ERR_FAIL_COND(!connection->is_connected_to_host());
Array msg;
msg.push_back("next");
ppeer->put_var(msg);
@@ -189,7 +189,7 @@ void ScriptEditorDebugger::debug_step() {
ERR_FAIL_COND(!breaked);
ERR_FAIL_COND(connection.is_null());
- ERR_FAIL_COND(!connection->is_connected());
+ ERR_FAIL_COND(!connection->is_connected_to_host());
Array msg;
msg.push_back("step");
@@ -202,7 +202,7 @@ void ScriptEditorDebugger::debug_break() {
ERR_FAIL_COND(breaked);
ERR_FAIL_COND(connection.is_null());
- ERR_FAIL_COND(!connection->is_connected());
+ ERR_FAIL_COND(!connection->is_connected_to_host());
Array msg;
msg.push_back("break");
@@ -214,7 +214,9 @@ void ScriptEditorDebugger::debug_continue() {
ERR_FAIL_COND(!breaked);
ERR_FAIL_COND(connection.is_null());
- ERR_FAIL_COND(!connection->is_connected());
+ ERR_FAIL_COND(!connection->is_connected_to_host());
+
+ OS::get_singleton()->enable_for_stealing_focus(EditorNode::get_singleton()->get_child_process_id());
Array msg;
msg.push_back("continue");
@@ -292,7 +294,7 @@ void ScriptEditorDebugger::_scene_tree_property_select_object(ObjectID p_object)
void ScriptEditorDebugger::_scene_tree_request() {
ERR_FAIL_COND(connection.is_null());
- ERR_FAIL_COND(!connection->is_connected());
+ ERR_FAIL_COND(!connection->is_connected_to_host());
Array msg;
msg.push_back("request_scene_tree");
@@ -303,7 +305,7 @@ void ScriptEditorDebugger::_scene_tree_request() {
void ScriptEditorDebugger::_video_mem_request() {
ERR_FAIL_COND(connection.is_null());
- ERR_FAIL_COND(!connection->is_connected());
+ ERR_FAIL_COND(!connection->is_connected_to_host());
Array msg;
msg.push_back("request_video_mem");
@@ -518,7 +520,7 @@ void ScriptEditorDebugger::_parse_message(const String& p_msg,const Array& p_dat
d["frame"]=i;
s->set_metadata(0,d);
-// String line = itos(i)+" - "+String(d["file"])+":"+itos(d["line"])+" - at func: "+d["function"];
+ //String line = itos(i)+" - "+String(d["file"])+":"+itos(d["line"])+" - at func: "+d["function"];
String line = itos(i)+" - "+String(d["file"])+":"+itos(d["line"]);
s->set_text(0,line);
@@ -578,8 +580,7 @@ void ScriptEditorDebugger::_parse_message(const String& p_msg,const Array& p_dat
String t = p_data[i];
//LOG
- if (EditorNode::get_log()->is_hidden()) {
- log_forced_visible=true;
+ if (!EditorNode::get_log()->is_visible()) {
if (EditorNode::get_singleton()->are_bottom_panels_hidden()) {
EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log());
}
@@ -904,7 +905,7 @@ void ScriptEditorDebugger::_notification(int p_what) {
inspect_scene_tree_timeout-=get_process_delta_time();
if (inspect_scene_tree_timeout<0) {
inspect_scene_tree_timeout=EditorSettings::get_singleton()->get("debugger/scene_tree_refresh_interval");
- if (inspect_scene_tree->is_visible()) {
+ if (inspect_scene_tree->is_visible_in_tree()) {
_scene_tree_request();
if (inspected_object_id!=0) {
@@ -920,7 +921,7 @@ void ScriptEditorDebugger::_notification(int p_what) {
inspect_edited_object_timeout-=get_process_delta_time();
if (inspect_edited_object_timeout<0) {
inspect_edited_object_timeout=EditorSettings::get_singleton()->get("debugger/remote_inspect_refresh_interval");
- if (inspect_scene_tree->is_visible() && inspected_object_id) {
+ if (inspect_scene_tree->is_visible_in_tree() && inspected_object_id) {
//take the chance and re-inspect selected object
Array msg;
msg.push_back("inspect_object");
@@ -955,7 +956,6 @@ void ScriptEditorDebugger::_notification(int p_what) {
break;
EditorNode::get_log()->add_message("** Debug Process Started **");
- log_forced_visible=false;
ppeer->set_stream_peer(connection);
@@ -993,7 +993,7 @@ void ScriptEditorDebugger::_notification(int p_what) {
}
};
- if (!connection->is_connected()) {
+ if (!connection->is_connected_to_host()) {
stop();
editor->notify_child_process_exited(); //somehow, exited
break;
@@ -1087,11 +1087,11 @@ void ScriptEditorDebugger::start() {
stop();
- if (!EditorNode::get_log()->is_visible()) {
- EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log());
+ if (is_visible_in_tree()) {
+ EditorNode::get_singleton()->make_bottom_panel_item_visible(this);
}
- uint16_t port = GLOBAL_DEF("debug/remote_port",6007);
+ uint16_t port = GLOBAL_GET("network/debug/remote_port");
perf_history.clear();
for(int i=0;i<Performance::MONITOR_MAX;i++) {
@@ -1130,13 +1130,6 @@ void ScriptEditorDebugger::stop(){
pending_in_queue=0;
message.clear();
- if (log_forced_visible) {
- //EditorNode::get_singleton()->make_bottom_panel_item_visible(this);
- if (EditorNode::get_log()->is_visible())
- EditorNode::get_singleton()->hide_bottom_panel();
- log_forced_visible=false;
- }
-
node_path_cache.clear();
res_path_cache.clear();
profiler_signature.clear();
@@ -1153,7 +1146,7 @@ void ScriptEditorDebugger::stop(){
if (hide_on_stop) {
- if (is_visible())
+ if (is_visible_in_tree())
EditorNode::get_singleton()->hide_bottom_panel();
emit_signal("show_debugger",false);
}
@@ -1190,7 +1183,7 @@ void ScriptEditorDebugger::_profiler_activate(bool p_enable) {
void ScriptEditorDebugger::_profiler_seeked() {
- if (!connection.is_valid() || !connection->is_connected())
+ if (!connection.is_valid() || !connection->is_connected_to_host())
return;
if (breaked)
@@ -1212,7 +1205,7 @@ void ScriptEditorDebugger::_stack_dump_frame_selected() {
emit_signal("goto_script_line",s,int(d["line"])-1);
ERR_FAIL_COND(connection.is_null());
- ERR_FAIL_COND(!connection->is_connected());
+ ERR_FAIL_COND(!connection->is_connected_to_host());
///
Array msg;
@@ -1627,7 +1620,7 @@ void ScriptEditorDebugger::set_hide_on_stop(bool p_hide) {
void ScriptEditorDebugger::_paused() {
ERR_FAIL_COND(connection.is_null());
- ERR_FAIL_COND(!connection->is_connected());
+ ERR_FAIL_COND(!connection->is_connected_to_host());
if (!breaked && EditorNode::get_singleton()->get_pause_button()->is_pressed()) {
debug_break();
@@ -1641,39 +1634,39 @@ void ScriptEditorDebugger::_paused() {
void ScriptEditorDebugger::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_stack_dump_frame_selected"),&ScriptEditorDebugger::_stack_dump_frame_selected);
- ObjectTypeDB::bind_method(_MD("debug_next"),&ScriptEditorDebugger::debug_next);
- ObjectTypeDB::bind_method(_MD("debug_step"),&ScriptEditorDebugger::debug_step);
- ObjectTypeDB::bind_method(_MD("debug_break"),&ScriptEditorDebugger::debug_break);
- ObjectTypeDB::bind_method(_MD("debug_continue"),&ScriptEditorDebugger::debug_continue);
- ObjectTypeDB::bind_method(_MD("_output_clear"),&ScriptEditorDebugger::_output_clear);
- ObjectTypeDB::bind_method(_MD("_performance_draw"),&ScriptEditorDebugger::_performance_draw);
- ObjectTypeDB::bind_method(_MD("_performance_select"),&ScriptEditorDebugger::_performance_select);
- ObjectTypeDB::bind_method(_MD("_scene_tree_request"),&ScriptEditorDebugger::_scene_tree_request);
- ObjectTypeDB::bind_method(_MD("_video_mem_request"),&ScriptEditorDebugger::_video_mem_request);
- ObjectTypeDB::bind_method(_MD("_live_edit_set"),&ScriptEditorDebugger::_live_edit_set);
- ObjectTypeDB::bind_method(_MD("_live_edit_clear"),&ScriptEditorDebugger::_live_edit_clear);
-
- ObjectTypeDB::bind_method(_MD("_error_selected"),&ScriptEditorDebugger::_error_selected);
- ObjectTypeDB::bind_method(_MD("_error_stack_selected"),&ScriptEditorDebugger::_error_stack_selected);
- ObjectTypeDB::bind_method(_MD("_profiler_activate"),&ScriptEditorDebugger::_profiler_activate);
- ObjectTypeDB::bind_method(_MD("_profiler_seeked"),&ScriptEditorDebugger::_profiler_seeked);
-
- ObjectTypeDB::bind_method(_MD("_paused"),&ScriptEditorDebugger::_paused);
-
- ObjectTypeDB::bind_method(_MD("_scene_tree_selected"),&ScriptEditorDebugger::_scene_tree_selected);
- ObjectTypeDB::bind_method(_MD("_scene_tree_folded"),&ScriptEditorDebugger::_scene_tree_folded);
-
-
- ObjectTypeDB::bind_method(_MD("live_debug_create_node"),&ScriptEditorDebugger::live_debug_create_node);
- ObjectTypeDB::bind_method(_MD("live_debug_instance_node"),&ScriptEditorDebugger::live_debug_instance_node);
- ObjectTypeDB::bind_method(_MD("live_debug_remove_node"),&ScriptEditorDebugger::live_debug_remove_node);
- ObjectTypeDB::bind_method(_MD("live_debug_remove_and_keep_node"),&ScriptEditorDebugger::live_debug_remove_and_keep_node);
- ObjectTypeDB::bind_method(_MD("live_debug_restore_node"),&ScriptEditorDebugger::live_debug_restore_node);
- ObjectTypeDB::bind_method(_MD("live_debug_duplicate_node"),&ScriptEditorDebugger::live_debug_duplicate_node);
- ObjectTypeDB::bind_method(_MD("live_debug_reparent_node"),&ScriptEditorDebugger::live_debug_reparent_node);
- ObjectTypeDB::bind_method(_MD("_scene_tree_property_select_object"),&ScriptEditorDebugger::_scene_tree_property_select_object);
- ObjectTypeDB::bind_method(_MD("_scene_tree_property_value_edited"),&ScriptEditorDebugger::_scene_tree_property_value_edited);
+ ClassDB::bind_method(_MD("_stack_dump_frame_selected"),&ScriptEditorDebugger::_stack_dump_frame_selected);
+ ClassDB::bind_method(_MD("debug_next"),&ScriptEditorDebugger::debug_next);
+ ClassDB::bind_method(_MD("debug_step"),&ScriptEditorDebugger::debug_step);
+ ClassDB::bind_method(_MD("debug_break"),&ScriptEditorDebugger::debug_break);
+ ClassDB::bind_method(_MD("debug_continue"),&ScriptEditorDebugger::debug_continue);
+ ClassDB::bind_method(_MD("_output_clear"),&ScriptEditorDebugger::_output_clear);
+ ClassDB::bind_method(_MD("_performance_draw"),&ScriptEditorDebugger::_performance_draw);
+ ClassDB::bind_method(_MD("_performance_select"),&ScriptEditorDebugger::_performance_select);
+ ClassDB::bind_method(_MD("_scene_tree_request"),&ScriptEditorDebugger::_scene_tree_request);
+ ClassDB::bind_method(_MD("_video_mem_request"),&ScriptEditorDebugger::_video_mem_request);
+ ClassDB::bind_method(_MD("_live_edit_set"),&ScriptEditorDebugger::_live_edit_set);
+ ClassDB::bind_method(_MD("_live_edit_clear"),&ScriptEditorDebugger::_live_edit_clear);
+
+ ClassDB::bind_method(_MD("_error_selected"),&ScriptEditorDebugger::_error_selected);
+ ClassDB::bind_method(_MD("_error_stack_selected"),&ScriptEditorDebugger::_error_stack_selected);
+ ClassDB::bind_method(_MD("_profiler_activate"),&ScriptEditorDebugger::_profiler_activate);
+ ClassDB::bind_method(_MD("_profiler_seeked"),&ScriptEditorDebugger::_profiler_seeked);
+
+ ClassDB::bind_method(_MD("_paused"),&ScriptEditorDebugger::_paused);
+
+ ClassDB::bind_method(_MD("_scene_tree_selected"),&ScriptEditorDebugger::_scene_tree_selected);
+ ClassDB::bind_method(_MD("_scene_tree_folded"),&ScriptEditorDebugger::_scene_tree_folded);
+
+
+ ClassDB::bind_method(_MD("live_debug_create_node"),&ScriptEditorDebugger::live_debug_create_node);
+ ClassDB::bind_method(_MD("live_debug_instance_node"),&ScriptEditorDebugger::live_debug_instance_node);
+ ClassDB::bind_method(_MD("live_debug_remove_node"),&ScriptEditorDebugger::live_debug_remove_node);
+ ClassDB::bind_method(_MD("live_debug_remove_and_keep_node"),&ScriptEditorDebugger::live_debug_remove_and_keep_node);
+ ClassDB::bind_method(_MD("live_debug_restore_node"),&ScriptEditorDebugger::live_debug_restore_node);
+ ClassDB::bind_method(_MD("live_debug_duplicate_node"),&ScriptEditorDebugger::live_debug_duplicate_node);
+ ClassDB::bind_method(_MD("live_debug_reparent_node"),&ScriptEditorDebugger::live_debug_reparent_node);
+ ClassDB::bind_method(_MD("_scene_tree_property_select_object"),&ScriptEditorDebugger::_scene_tree_property_select_object);
+ ClassDB::bind_method(_MD("_scene_tree_property_value_edited"),&ScriptEditorDebugger::_scene_tree_property_value_edited);
ADD_SIGNAL(MethodInfo("goto_script_line"));
ADD_SIGNAL(MethodInfo("breaked",PropertyInfo(Variant::BOOL,"reallydid"),PropertyInfo(Variant::BOOL,"can_debug")));
@@ -1978,8 +1971,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){
msgdialog = memnew( AcceptDialog );
add_child(msgdialog);
- log_forced_visible=false;
-
p_editor->get_undo_redo()->set_method_notify_callback(_method_changeds,this);
p_editor->get_undo_redo()->set_property_notify_callback(_property_changeds,this);
live_debug=false;
@@ -1995,7 +1986,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){
ScriptEditorDebugger::~ScriptEditorDebugger() {
-// inspector->edit(NULL);
+ //inspector->edit(NULL);
memdelete(variables);
ppeer->set_stream_peer(Ref<StreamPeer>());
diff --git a/tools/editor/script_editor_debugger.h b/tools/editor/script_editor_debugger.h
index c4a7cea1b7..a02934bbaf 100644
--- a/tools/editor/script_editor_debugger.h
+++ b/tools/editor/script_editor_debugger.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -55,7 +55,7 @@ class ScriptEditorDebuggerInspectedObject;
class ScriptEditorDebugger : public Control {
- OBJ_TYPE( ScriptEditorDebugger, Control );
+ GDCLASS( ScriptEditorDebugger, Control );
AcceptDialog *msgdialog;
@@ -96,7 +96,6 @@ class ScriptEditorDebugger : public Control {
TabContainer *tabs;
LineEdit *reason;
- bool log_forced_visible;
ScriptEditorDebuggerVariables *variables;
Button *step;
diff --git a/tools/editor/settings_config_dialog.cpp b/tools/editor/settings_config_dialog.cpp
index 50989ea5cb..c72f2641b7 100644
--- a/tools/editor/settings_config_dialog.cpp
+++ b/tools/editor/settings_config_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -55,7 +55,7 @@ void EditorSettingsDialog::_settings_property_edited(const String& p_name) {
// Small usability workaround to update the text color settings when the
// color theme is changed
- if (full_name == "text_editor/color_theme") {
+ if (full_name == "text_editor/theme/color_theme") {
property_editor->get_property_editor()->update_tree();
}
}
@@ -288,16 +288,16 @@ void EditorSettingsDialog::_press_a_key_confirm() {
void EditorSettingsDialog::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("_settings_save"),&EditorSettingsDialog::_settings_save);
- ObjectTypeDB::bind_method(_MD("_settings_changed"),&EditorSettingsDialog::_settings_changed);
- ObjectTypeDB::bind_method(_MD("_settings_property_edited"),&EditorSettingsDialog::_settings_property_edited);
- ObjectTypeDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box);
- ObjectTypeDB::bind_method(_MD("_clear_shortcut_search_box"),&EditorSettingsDialog::_clear_shortcut_search_box);
- ObjectTypeDB::bind_method(_MD("_shortcut_button_pressed"),&EditorSettingsDialog::_shortcut_button_pressed);
- ObjectTypeDB::bind_method(_MD("_filter_shortcuts"),&EditorSettingsDialog::_filter_shortcuts);
- ObjectTypeDB::bind_method(_MD("_update_shortcuts"),&EditorSettingsDialog::_update_shortcuts);
- ObjectTypeDB::bind_method(_MD("_press_a_key_confirm"),&EditorSettingsDialog::_press_a_key_confirm);
- ObjectTypeDB::bind_method(_MD("_wait_for_key"),&EditorSettingsDialog::_wait_for_key);
+ ClassDB::bind_method(_MD("_settings_save"),&EditorSettingsDialog::_settings_save);
+ ClassDB::bind_method(_MD("_settings_changed"),&EditorSettingsDialog::_settings_changed);
+ ClassDB::bind_method(_MD("_settings_property_edited"),&EditorSettingsDialog::_settings_property_edited);
+ ClassDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box);
+ ClassDB::bind_method(_MD("_clear_shortcut_search_box"),&EditorSettingsDialog::_clear_shortcut_search_box);
+ ClassDB::bind_method(_MD("_shortcut_button_pressed"),&EditorSettingsDialog::_shortcut_button_pressed);
+ ClassDB::bind_method(_MD("_filter_shortcuts"),&EditorSettingsDialog::_filter_shortcuts);
+ ClassDB::bind_method(_MD("_update_shortcuts"),&EditorSettingsDialog::_update_shortcuts);
+ ClassDB::bind_method(_MD("_press_a_key_confirm"),&EditorSettingsDialog::_press_a_key_confirm);
+ ClassDB::bind_method(_MD("_wait_for_key"),&EditorSettingsDialog::_wait_for_key);
}
@@ -307,7 +307,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
tabs = memnew( TabContainer );
add_child(tabs);
- set_child_rect(tabs);
+ //set_child_rect(tabs);
VBoxContainer *vbc = memnew( VBoxContainer );
tabs->add_child(vbc);
@@ -380,7 +380,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
l->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_BEGIN,30);
press_a_key_label=l;
press_a_key->add_child(l);
- press_a_key->connect("input_event",this,"_wait_for_key");
+ press_a_key->connect("gui_input",this,"_wait_for_key");
press_a_key->connect("confirmed",this,"_press_a_key_confirm");
//Button *load = memnew( Button );
diff --git a/tools/editor/settings_config_dialog.h b/tools/editor/settings_config_dialog.h
index 3b91c7f019..17a05c27d3 100644
--- a/tools/editor/settings_config_dialog.h
+++ b/tools/editor/settings_config_dialog.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -36,7 +36,7 @@
class EditorSettingsDialog : public AcceptDialog {
- OBJ_TYPE(EditorSettingsDialog,AcceptDialog);
+ GDCLASS(EditorSettingsDialog,AcceptDialog);
diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp
index 84803eb6db..82dfa94c06 100644
--- a/tools/editor/spatial_editor_gizmos.cpp
+++ b/tools/editor/spatial_editor_gizmos.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -41,6 +41,8 @@
// Keep small children away from this file.
// It's so ugly it will eat them alive
+
+
#define HANDLE_HALF_SIZE 0.05
void EditorSpatialGizmo::clear() {
@@ -82,7 +84,6 @@ void EditorSpatialGizmo::Instance::create_instance(Spatial *p_base) {
if (extra_margin)
VS::get_singleton()->instance_set_extra_visibility_margin(instance,1);
VS::get_singleton()->instance_geometry_set_cast_shadows_setting(instance,VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_geometry_set_flag(instance,VS::INSTANCE_FLAG_RECEIVE_SHADOWS,false);
VS::get_singleton()->instance_set_layer_mask(instance,1<<SpatialEditorViewport::GIZMO_EDIT_LAYER); //gizmos are 26
}
@@ -116,10 +117,10 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat
a[Mesh::ARRAY_VERTEX]=p_lines;
- DVector<Color> color;
+ PoolVector<Color> color;
color.resize(p_lines.size());
{
- DVector<Color>::Write w = color.write();
+ PoolVector<Color>::Write w = color.write();
for(int i=0;i<p_lines.size();i++) {
if (is_selected())
w[i]=Color(1,1,1,0.6);
@@ -132,7 +133,7 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat
a[Mesh::ARRAY_COLOR]=color;
- mesh->add_surface(Mesh::PRIMITIVE_LINES,a);
+ mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES,a);
mesh->surface_set_material(0,p_material);
if (p_billboard) {
@@ -143,7 +144,7 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat
}
if (md) {
- mesh->set_custom_aabb(AABB(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0));
+ mesh->set_custom_aabb(Rect3(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0));
}
}
@@ -181,7 +182,7 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material>& p_material,
a.resize(Mesh::ARRAY_MAX);
a[Mesh::ARRAY_VERTEX]=vs;
a[Mesh::ARRAY_TEX_UV]=uv;
- mesh->add_surface(Mesh::PRIMITIVE_TRIANGLE_FAN,a);
+ mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLE_FAN,a);
mesh->surface_set_material(0,p_material);
if (true) {
@@ -192,7 +193,7 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material>& p_material,
}
if (md) {
- mesh->set_custom_aabb(AABB(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0));
+ mesh->set_custom_aabb(Rect3(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0));
}
}
@@ -244,10 +245,11 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi
Array a;
a.resize(VS::ARRAY_MAX);
a[VS::ARRAY_VERTEX]=p_handles;
- DVector<Color> colors;
+ print_line("handles?: "+itos(p_handles.size()));
+ PoolVector<Color> colors;
{
colors.resize(p_handles.size());
- DVector<Color>::Write w=colors.write();
+ PoolVector<Color>::Write w=colors.write();
for(int i=0;i<p_handles.size();i++) {
Color col(1,1,1,1);
@@ -258,7 +260,7 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi
}
a[VS::ARRAY_COLOR]=colors;
- mesh->add_surface(Mesh::PRIMITIVE_POINTS,a);
+ mesh->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS,a);
mesh->surface_set_material(0,SpatialEditorGizmos::singleton->handle2_material);
if (p_billboard) {
@@ -269,7 +271,7 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi
}
if (md) {
- mesh->set_custom_aabb(AABB(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0));
+ mesh->set_custom_aabb(Rect3(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0));
}
}
@@ -614,14 +616,14 @@ void EditorSpatialGizmo::free(){
void EditorSpatialGizmo::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("add_lines","lines","material:Material","billboard"),&EditorSpatialGizmo::add_lines,DEFVAL(false));
- ObjectTypeDB::bind_method(_MD("add_mesh","mesh:Mesh","billboard","skeleton"),&EditorSpatialGizmo::add_mesh,DEFVAL(false),DEFVAL(RID()));
- ObjectTypeDB::bind_method(_MD("add_collision_segments","segments"),&EditorSpatialGizmo::add_collision_segments);
- ObjectTypeDB::bind_method(_MD("add_collision_triangles","triangles:TriangleMesh"),&EditorSpatialGizmo::add_collision_triangles);
- ObjectTypeDB::bind_method(_MD("add_unscaled_billboard","material:Material","default_scale"),&EditorSpatialGizmo::add_unscaled_billboard,DEFVAL(1));
- ObjectTypeDB::bind_method(_MD("add_handles","handles","billboard","secondary"),&EditorSpatialGizmo::add_handles,DEFVAL(false),DEFVAL(false));
- ObjectTypeDB::bind_method(_MD("set_spatial_node","node:Spatial"),&EditorSpatialGizmo::_set_spatial_node);
- ObjectTypeDB::bind_method(_MD("clear"),&EditorSpatialGizmo::clear);
+ ClassDB::bind_method(_MD("add_lines","lines","material:Material","billboard"),&EditorSpatialGizmo::add_lines,DEFVAL(false));
+ ClassDB::bind_method(_MD("add_mesh","mesh:Mesh","billboard","skeleton"),&EditorSpatialGizmo::add_mesh,DEFVAL(false),DEFVAL(RID()));
+ ClassDB::bind_method(_MD("add_collision_segments","segments"),&EditorSpatialGizmo::add_collision_segments);
+ ClassDB::bind_method(_MD("add_collision_triangles","triangles:TriangleMesh"),&EditorSpatialGizmo::add_collision_triangles);
+ ClassDB::bind_method(_MD("add_unscaled_billboard","material:Material","default_scale"),&EditorSpatialGizmo::add_unscaled_billboard,DEFVAL(1));
+ ClassDB::bind_method(_MD("add_handles","handles","billboard","secondary"),&EditorSpatialGizmo::add_handles,DEFVAL(false),DEFVAL(false));
+ ClassDB::bind_method(_MD("set_spatial_node","node:Spatial"),&EditorSpatialGizmo::_set_spatial_node);
+ ClassDB::bind_method(_MD("clear"),&EditorSpatialGizmo::clear);
BIND_VMETHOD( MethodInfo("redraw"));
BIND_VMETHOD( MethodInfo(Variant::STRING,"get_handle_name",PropertyInfo(Variant::INT,"index")));
@@ -667,9 +669,9 @@ String LightSpatialGizmo::get_handle_name(int p_idx) const {
Variant LightSpatialGizmo::get_handle_value(int p_idx) const{
if (p_idx==0)
- return light->get_parameter(Light::PARAM_RADIUS);
+ return light->get_param(Light::PARAM_RANGE);
if (p_idx==1)
- return light->get_parameter(Light::PARAM_SPOT_ANGLE);
+ return light->get_param(Light::PARAM_SPOT_ANGLE);
return Variant();
}
@@ -727,7 +729,7 @@ void LightSpatialGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_p
if (d<0)
d=0;
- light->set_parameter(Light::PARAM_RADIUS,d);
+ light->set_param(Light::PARAM_RANGE,d);
} else if (light->cast_to<OmniLight>()) {
Plane cp=Plane( gt.origin, p_camera->get_transform().basis.get_axis(2));
@@ -736,15 +738,15 @@ void LightSpatialGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_p
if (cp.intersects_ray(ray_from,ray_dir,&inters)) {
float r = inters.distance_to(gt.origin);
- light->set_parameter(Light::PARAM_RADIUS,r);
+ light->set_param(Light::PARAM_RANGE,r);
}
}
} else if (p_idx==1) {
- float a = _find_closest_angle_to_half_pi_arc(s[0],s[1],light->get_parameter(Light::PARAM_RADIUS),gt);
- light->set_parameter(Light::PARAM_SPOT_ANGLE,CLAMP(a,0.01,89.99));
+ float a = _find_closest_angle_to_half_pi_arc(s[0],s[1],light->get_param(Light::PARAM_RANGE),gt);
+ light->set_param(Light::PARAM_SPOT_ANGLE,CLAMP(a,0.01,89.99));
}
}
@@ -752,21 +754,21 @@ void LightSpatialGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_
if (p_cancel) {
- light->set_parameter(p_idx==0?Light::PARAM_RADIUS:Light::PARAM_SPOT_ANGLE,p_restore);
+ light->set_param(p_idx==0?Light::PARAM_RANGE:Light::PARAM_SPOT_ANGLE,p_restore);
} else if (p_idx==0) {
UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Light Radius"));
- ur->add_do_method(light,"set_parameter",Light::PARAM_RADIUS,light->get_parameter(Light::PARAM_RADIUS));
- ur->add_undo_method(light,"set_parameter",Light::PARAM_RADIUS,p_restore);
+ ur->add_do_method(light,"set_param",Light::PARAM_RANGE,light->get_param(Light::PARAM_RANGE));
+ ur->add_undo_method(light,"set_param",Light::PARAM_RANGE,p_restore);
ur->commit_action();
} else if (p_idx==1) {
UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Light Radius"));
- ur->add_do_method(light,"set_parameter",Light::PARAM_SPOT_ANGLE,light->get_parameter(Light::PARAM_SPOT_ANGLE));
- ur->add_undo_method(light,"set_parameter",Light::PARAM_SPOT_ANGLE,p_restore);
+ ur->add_do_method(light,"set_param",Light::PARAM_SPOT_ANGLE,light->get_param(Light::PARAM_SPOT_ANGLE));
+ ur->add_undo_method(light,"set_param",Light::PARAM_SPOT_ANGLE,p_restore);
ur->commit_action();
}
@@ -798,8 +800,8 @@ void LightSpatialGizmo::redraw() {
for(int i = 0; i < arrow_sides ; i++) {
- Matrix3 ma(Vector3(0,0,1),Math_PI*2*float(i)/arrow_sides);
- Matrix3 mb(Vector3(0,0,1),Math_PI*2*float(i+1)/arrow_sides);
+ Basis ma(Vector3(0,0,1),Math_PI*2*float(i)/arrow_sides);
+ Basis mb(Vector3(0,0,1),Math_PI*2*float(i+1)/arrow_sides);
for(int j=1;j<arrow_points-1;j++) {
@@ -829,7 +831,7 @@ void LightSpatialGizmo::redraw() {
OmniLight *on = light->cast_to<OmniLight>();
- float r = on->get_parameter(Light::PARAM_RADIUS);
+ float r = on->get_param(Light::PARAM_RANGE);
Vector<Vector3> points;
@@ -869,9 +871,9 @@ void LightSpatialGizmo::redraw() {
Vector<Vector3> points;
SpotLight *on = light->cast_to<SpotLight>();
- float r = on->get_parameter(Light::PARAM_RADIUS);
- float w = r*Math::sin(Math::deg2rad(on->get_parameter(Light::PARAM_SPOT_ANGLE)));
- float d = r*Math::cos(Math::deg2rad(on->get_parameter(Light::PARAM_SPOT_ANGLE)));
+ float r = on->get_param(Light::PARAM_RANGE);
+ float w = r*Math::sin(Math::deg2rad(on->get_param(Light::PARAM_SPOT_ANGLE)));
+ float d = r*Math::cos(Math::deg2rad(on->get_param(Light::PARAM_SPOT_ANGLE)));
@@ -1217,7 +1219,7 @@ void SkeletonSpatialGizmo::redraw() {
weights[0]=1;
- AABB aabb;
+ Rect3 aabb;
Color bonecolor = Color(1.0,0.4,0.4,0.3);
Color rootcolor = Color(0.4,1.0,0.4,0.1);
@@ -1423,11 +1425,11 @@ void RoomSpatialGizmo::redraw() {
Ref<RoomBounds> roomie = room->get_room();
if (roomie.is_null())
return;
- DVector<Face3> faces = roomie->get_geometry_hint();
+ PoolVector<Face3> faces = roomie->get_geometry_hint();
Vector<Vector3> lines;
int fc=faces.size();
- DVector<Face3>::Read r =faces.read();
+ PoolVector<Face3>::Read r =faces.read();
Map<_EdgeKey,Vector3> edge_map;
@@ -1541,7 +1543,7 @@ void RayCastSpatialGizmo::redraw() {
}
-RayCastSpatialGizmo::RayCastSpatialGizmo(RayCast* p_raycast){
+RayCastSpatialGizmo::RayCastSpatialGizmo(RayCast* p_raycast) {
set_spatial_node(p_raycast);
raycast=p_raycast;
@@ -1913,7 +1915,7 @@ void CollisionShapeSpatialGizmo::redraw(){
Ref<BoxShape> bs=s;
Vector<Vector3> lines;
- AABB aabb;
+ Rect3 aabb;
aabb.pos=-bs->get_extents();
aabb.size=aabb.pos*-2;
@@ -2054,7 +2056,7 @@ void CollisionShapeSpatialGizmo::redraw(){
if (s->cast_to<ConvexPolygonShape>()) {
- DVector<Vector3> points = s->cast_to<ConvexPolygonShape>()->get_points();
+ PoolVector<Vector3> points = s->cast_to<ConvexPolygonShape>()->get_points();
if (points.size()>3) {
@@ -2161,7 +2163,7 @@ void VisibilityNotifierGizmo::set_handle(int p_idx,Camera *p_camera, const Point
//gt.orthonormalize();
Transform gi = gt.affine_inverse();
- AABB aabb = notifier->get_aabb();
+ Rect3 aabb = notifier->get_aabb();
Vector3 ray_from = p_camera->project_ray_origin(p_point);
Vector3 ray_dir = p_camera->project_ray_normal(p_point);
@@ -2203,7 +2205,7 @@ void VisibilityNotifierGizmo::redraw(){
clear();
Vector<Vector3> lines;
- AABB aabb = notifier->get_aabb();
+ Rect3 aabb = notifier->get_aabb();
for(int i=0;i<12;i++) {
Vector3 a,b;
@@ -2237,6 +2239,321 @@ VisibilityNotifierGizmo::VisibilityNotifierGizmo(VisibilityNotifier* p_notifier)
////////
+///
+
+
+String ReflectionProbeGizmo::get_handle_name(int p_idx) const {
+
+ switch(p_idx) {
+ case 0: return "Extents X";
+ case 1: return "Extents Y";
+ case 2: return "Extents Z";
+ case 3: return "Origin X";
+ case 4: return "Origin Y";
+ case 5: return "Origin Z";
+ }
+
+ return "";
+}
+Variant ReflectionProbeGizmo::get_handle_value(int p_idx) const{
+
+ return Rect3(probe->get_extents(),probe->get_origin_offset());
+}
+void ReflectionProbeGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_point){
+
+ Transform gt = probe->get_global_transform();
+ //gt.orthonormalize();
+ Transform gi = gt.affine_inverse();
+
+
+ if (p_idx<3) {
+ Vector3 extents = probe->get_extents();
+
+ Vector3 ray_from = p_camera->project_ray_origin(p_point);
+ Vector3 ray_dir = p_camera->project_ray_normal(p_point);
+
+ Vector3 sg[2]={gi.xform(ray_from),gi.xform(ray_from+ray_dir*16384)};
+
+ Vector3 axis;
+ axis[p_idx]=1.0;
+
+ Vector3 ra,rb;
+ Geometry::get_closest_points_between_segments(Vector3(),axis*16384,sg[0],sg[1],ra,rb);
+ float d = ra[p_idx];
+ if (d<0.001)
+ d=0.001;
+
+ extents[p_idx]=d;
+ probe->set_extents(extents);
+ } else {
+
+ p_idx-=3;
+
+ Vector3 origin = probe->get_origin_offset();
+ origin[p_idx]=0;
+
+ Vector3 ray_from = p_camera->project_ray_origin(p_point);
+ Vector3 ray_dir = p_camera->project_ray_normal(p_point);
+
+ Vector3 sg[2]={gi.xform(ray_from),gi.xform(ray_from+ray_dir*16384)};
+
+ Vector3 axis;
+ axis[p_idx]=1.0;
+
+ Vector3 ra,rb;
+ Geometry::get_closest_points_between_segments(origin-axis*16384,origin+axis*16384,sg[0],sg[1],ra,rb);
+ float d = ra[p_idx];
+ d+=0.25;
+
+ origin[p_idx]=d;
+ probe->set_origin_offset(origin);
+
+ }
+}
+
+void ReflectionProbeGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_cancel){
+
+ Rect3 restore = p_restore;
+
+ if (p_cancel) {
+ probe->set_extents(restore.pos);
+ probe->set_origin_offset(restore.size);
+ return;
+ }
+
+ UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ ur->create_action(TTR("Change Probe Extents"));
+ ur->add_do_method(probe,"set_extents",probe->get_extents());
+ ur->add_do_method(probe,"set_origin_offset",probe->get_origin_offset());
+ ur->add_undo_method(probe,"set_extents",restore.pos);
+ ur->add_undo_method(probe,"set_origin_offset",restore.size);
+ ur->commit_action();
+
+}
+
+void ReflectionProbeGizmo::redraw(){
+
+ clear();
+
+ Vector<Vector3> lines;
+ Vector<Vector3> internal_lines;
+ Vector3 extents = probe->get_extents();
+
+ Rect3 aabb;
+ aabb.pos=-extents;
+ aabb.size=extents*2;
+
+ for(int i=0;i<12;i++) {
+ Vector3 a,b;
+ aabb.get_edge(i,a,b);
+ lines.push_back(a);
+ lines.push_back(b);
+ }
+
+ for(int i=0;i<8;i++) {
+ Vector3 ep = aabb.get_endpoint(i);
+ internal_lines.push_back(probe->get_origin_offset());
+ internal_lines.push_back(ep);
+
+
+ }
+
+ Vector<Vector3> handles;
+
+
+ for(int i=0;i<3;i++) {
+
+ Vector3 ax;
+ ax[i]=aabb.pos[i]+aabb.size[i];
+ handles.push_back(ax);
+ }
+
+ for(int i=0;i<3;i++) {
+
+
+ Vector3 orig_handle=probe->get_origin_offset();
+ orig_handle[i]-=0.25;
+ lines.push_back(orig_handle);
+ handles.push_back(orig_handle);
+
+ orig_handle[i]+=0.5;
+ lines.push_back(orig_handle);
+ }
+
+ add_lines(lines,SpatialEditorGizmos::singleton->reflection_probe_material);
+ add_lines(internal_lines,SpatialEditorGizmos::singleton->reflection_probe_material_internal);
+ //add_unscaled_billboard(SpatialEditorGizmos::singleton->visi,0.05);
+ add_collision_segments(lines);
+ add_handles(handles);
+
+}
+ReflectionProbeGizmo::ReflectionProbeGizmo(ReflectionProbe* p_probe){
+
+ probe=p_probe;
+ set_spatial_node(p_probe);
+}
+
+////////
+
+
+
+///
+
+
+String GIProbeGizmo::get_handle_name(int p_idx) const {
+
+ switch(p_idx) {
+ case 0: return "Extents X";
+ case 1: return "Extents Y";
+ case 2: return "Extents Z";
+ }
+
+ return "";
+}
+Variant GIProbeGizmo::get_handle_value(int p_idx) const{
+
+ return probe->get_extents();
+}
+void GIProbeGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_point){
+
+ Transform gt = probe->get_global_transform();
+ //gt.orthonormalize();
+ Transform gi = gt.affine_inverse();
+
+
+ Vector3 extents = probe->get_extents();
+
+ Vector3 ray_from = p_camera->project_ray_origin(p_point);
+ Vector3 ray_dir = p_camera->project_ray_normal(p_point);
+
+ Vector3 sg[2]={gi.xform(ray_from),gi.xform(ray_from+ray_dir*16384)};
+
+ Vector3 axis;
+ axis[p_idx]=1.0;
+
+ Vector3 ra,rb;
+ Geometry::get_closest_points_between_segments(Vector3(),axis*16384,sg[0],sg[1],ra,rb);
+ float d = ra[p_idx];
+ if (d<0.001)
+ d=0.001;
+
+ extents[p_idx]=d;
+ probe->set_extents(extents);
+
+}
+
+void GIProbeGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_cancel){
+
+ Vector3 restore = p_restore;
+
+ if (p_cancel) {
+ probe->set_extents(restore);
+ return;
+ }
+
+ UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ ur->create_action(TTR("Change Probe Extents"));
+ ur->add_do_method(probe,"set_extents",probe->get_extents());
+ ur->add_undo_method(probe,"set_extents",restore);
+ ur->commit_action();
+
+}
+
+void GIProbeGizmo::redraw(){
+
+ clear();
+
+ Vector<Vector3> lines;
+ Vector3 extents = probe->get_extents();
+
+ static const int subdivs[GIProbe::SUBDIV_MAX]={64,128,256,512};
+
+ Rect3 aabb = Rect3(-extents,extents*2);
+ int subdiv = subdivs[probe->get_subdiv()];
+ float cell_size = aabb.get_longest_axis_size()/subdiv;
+
+
+ for(int i=0;i<12;i++) {
+ Vector3 a,b;
+ aabb.get_edge(i,a,b);
+ lines.push_back(a);
+ lines.push_back(b);
+ }
+
+ add_lines(lines,SpatialEditorGizmos::singleton->gi_probe_material);
+ add_collision_segments(lines);
+
+ lines.clear();
+
+ for(int i=1;i<subdiv;i++) {
+
+ for(int j=0;j<3;j++) {
+
+
+
+ if (cell_size*i>aabb.size[j]) {
+ continue;
+ }
+
+ Vector2 dir;
+ dir[j]=1.0;
+ Vector2 ta,tb;
+ int j_n1=(j+1)%3;
+ int j_n2=(j+2)%3;
+ ta[j_n1]=1.0;
+ tb[j_n2]=1.0;
+
+
+ for(int k=0;k<4;k++) {
+
+ Vector3 from=aabb.pos,to=aabb.pos;
+ from[j]+= cell_size*i;
+ to[j]+=cell_size*i;
+
+ if (k&1) {
+ to[j_n1]+=aabb.size[j_n1];
+ } else {
+
+ to[j_n2]+=aabb.size[j_n2];
+ }
+
+ if (k&2) {
+ from[j_n1]+=aabb.size[j_n1];
+ from[j_n2]+=aabb.size[j_n2];
+ }
+
+ lines.push_back(from);
+ lines.push_back(to);
+ }
+
+ }
+
+ }
+
+ add_lines(lines,SpatialEditorGizmos::singleton->reflection_probe_material_internal);
+
+ Vector<Vector3> handles;
+
+
+ for(int i=0;i<3;i++) {
+
+ Vector3 ax;
+ ax[i]=aabb.pos[i]+aabb.size[i];
+ handles.push_back(ax);
+ }
+
+
+ add_handles(handles);
+
+}
+GIProbeGizmo::GIProbeGizmo(GIProbe* p_probe){
+
+ probe=p_probe;
+ set_spatial_node(p_probe);
+}
+
+////////
+
void NavigationMeshSpatialGizmo::redraw() {
@@ -2245,8 +2562,8 @@ void NavigationMeshSpatialGizmo::redraw() {
if (navmeshie.is_null())
return;
- DVector<Vector3> vertices = navmeshie->get_vertices();
- DVector<Vector3>::Read vr=vertices.read();
+ PoolVector<Vector3> vertices = navmeshie->get_vertices();
+ PoolVector<Vector3>::Read vr=vertices.read();
List<Face3> faces;
for(int i=0;i<navmeshie->get_polygon_count();i++) {
Vector<int> p = navmeshie->get_polygon(i);
@@ -2265,11 +2582,11 @@ void NavigationMeshSpatialGizmo::redraw() {
return;
Map<_EdgeKey,bool> edge_map;
- DVector<Vector3> tmeshfaces;
+ PoolVector<Vector3> tmeshfaces;
tmeshfaces.resize(faces.size()*3);
{
- DVector<Vector3>::Write tw=tmeshfaces.write();
+ PoolVector<Vector3>::Write tw=tmeshfaces.write();
int tidx=0;
@@ -2320,7 +2637,7 @@ void NavigationMeshSpatialGizmo::redraw() {
Array a;
a.resize(Mesh::ARRAY_MAX);
a[0]=tmeshfaces;
- m->add_surface(Mesh::PRIMITIVE_TRIANGLES,a);
+ m->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES,a);
m->surface_set_material(0,navmesh->is_enabled()?SpatialEditorGizmos::singleton->navmesh_solid_material:SpatialEditorGizmos::singleton->navmesh_solid_material_disabled);
add_mesh(m);
add_collision_segments(lines);
@@ -2800,8 +3117,8 @@ void Generic6DOFJointSpatialGizmo::redraw() {
float s = ll+i*(Math_PI*2.0)/points;
float n = ll+(i+1)*(Math_PI*2.0)/points;
-// Vector3 from=Vector3(0,Math::cos(s),-Math::sin(s) )*cs;
-// Vector3 to=Vector3( 0,Math::cos(n),-Math::sin(n) )*cs;
+ //Vector3 from=Vector3(0,Math::cos(s),-Math::sin(s) )*cs;
+ //Vector3 to=Vector3( 0,Math::cos(n),-Math::sin(n) )*cs;
Vector3 from;
SET_VTX(from,0, Math::cos(s), -Math::sin(s) );
@@ -2928,6 +3245,17 @@ Ref<SpatialEditorGizmo> SpatialEditorGizmos::get_gizmo(Spatial *p_spatial) {
return misg;
}
+ if (p_spatial->cast_to<ReflectionProbe>()) {
+
+ Ref<ReflectionProbeGizmo> misg = memnew( ReflectionProbeGizmo(p_spatial->cast_to<ReflectionProbe>()) );
+ return misg;
+ }
+ if (p_spatial->cast_to<GIProbe>()) {
+
+ Ref<GIProbeGizmo> misg = memnew( GIProbeGizmo(p_spatial->cast_to<GIProbe>()) );
+ return misg;
+ }
+
if (p_spatial->cast_to<VehicleWheel>()) {
Ref<VehicleWheelSpatialGizmo> misg = memnew( VehicleWheelSpatialGizmo(p_spatial->cast_to<VehicleWheel>()) );
@@ -2974,25 +3302,26 @@ Ref<SpatialEditorGizmo> SpatialEditorGizmos::get_gizmo(Spatial *p_spatial) {
}
-Ref<FixedMaterial> SpatialEditorGizmos::create_line_material(const Color& p_base_color) {
+Ref<FixedSpatialMaterial> SpatialEditorGizmos::create_line_material(const Color& p_base_color) {
- Ref<FixedMaterial> line_material = Ref<FixedMaterial>( memnew( FixedMaterial ));
- line_material->set_flag(Material::FLAG_UNSHADED, true);
+ Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ line_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
line_material->set_line_width(3.0);
- line_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- line_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true);
- line_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,p_base_color);
+ line_material->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ //line_material->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ //->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ line_material->set_albedo(p_base_color);
return line_material;
}
-Ref<FixedMaterial> SpatialEditorGizmos::create_solid_material(const Color& p_base_color) {
+Ref<FixedSpatialMaterial> SpatialEditorGizmos::create_solid_material(const Color& p_base_color) {
- Ref<FixedMaterial> line_material = Ref<FixedMaterial>( memnew( FixedMaterial ));
- line_material->set_flag(Material::FLAG_UNSHADED, true);
- line_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- line_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,p_base_color);
+ Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ line_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ line_material->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ line_material->set_albedo(p_base_color);
return line_material;
@@ -3002,65 +3331,68 @@ SpatialEditorGizmos::SpatialEditorGizmos() {
singleton=this;
- handle_material = Ref<FixedMaterial>( memnew( FixedMaterial ));
- handle_material->set_flag(Material::FLAG_UNSHADED, true);
- handle_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(0.8,0.8,0.8));
+ handle_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ handle_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ handle_material->set_albedo(Color(0.8,0.8,0.8));
- handle2_material = Ref<FixedMaterial>( memnew( FixedMaterial ));
- handle2_material->set_flag(Material::FLAG_UNSHADED, true);
- handle2_material->set_fixed_flag(FixedMaterial::FLAG_USE_POINT_SIZE, true);
+ handle2_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ handle2_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ handle2_material->set_flag(FixedSpatialMaterial::FLAG_USE_POINT_SIZE, true);
handle_t = SpatialEditor::get_singleton()->get_icon("Editor3DHandle","EditorIcons");
handle2_material->set_point_size(handle_t->get_width());
- handle2_material->set_texture(FixedMaterial::PARAM_DIFFUSE,handle_t);
- handle2_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1));
- handle2_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- handle2_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true);
+ handle2_material->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,handle_t);
+ handle2_material->set_albedo(Color(1,1,1));
+ handle2_material->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ handle2_material->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ handle2_material->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
light_material = create_line_material(Color(1,1,0.2));
- light_material_omni_icon = Ref<FixedMaterial>( memnew( FixedMaterial ));
- light_material_omni_icon->set_flag(Material::FLAG_UNSHADED, true);
- light_material_omni_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true);
- light_material_omni_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- light_material_omni_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- light_material_omni_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.9));
- light_material_omni_icon->set_texture(FixedMaterial::PARAM_DIFFUSE,SpatialEditor::get_singleton()->get_icon("GizmoLight","EditorIcons"));
+ light_material_omni_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ light_material_omni_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ light_material_omni_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ light_material_omni_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
+ light_material_omni_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ light_material_omni_icon->set_albedo(Color(1,1,1,0.9));
+ light_material_omni_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,SpatialEditor::get_singleton()->get_icon("GizmoLight","EditorIcons"));
- light_material_directional_icon = Ref<FixedMaterial>( memnew( FixedMaterial ));
- light_material_directional_icon->set_flag(Material::FLAG_UNSHADED, true);
- light_material_directional_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true);
- light_material_directional_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- light_material_directional_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- light_material_directional_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.9));
- light_material_directional_icon->set_texture(FixedMaterial::PARAM_DIFFUSE,SpatialEditor::get_singleton()->get_icon("GizmoDirectionalLight","EditorIcons"));
+ light_material_directional_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ light_material_directional_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ light_material_directional_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ light_material_directional_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
+ light_material_directional_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ light_material_directional_icon->set_albedo(Color(1,1,1,0.9));
+ light_material_directional_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,SpatialEditor::get_singleton()->get_icon("GizmoDirectionalLight","EditorIcons"));
camera_material = create_line_material(Color(1.0,0.5,1.0));
navmesh_edge_material = create_line_material(Color(0.1,0.8,1.0));
navmesh_solid_material = create_solid_material(Color(0.1,0.8,1.0,0.4));
- navmesh_edge_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, false);
- navmesh_solid_material->set_flag(Material::FLAG_DOUBLE_SIDED,true);
+ navmesh_edge_material->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, false);
+ navmesh_edge_material->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, false);
+ navmesh_solid_material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
navmesh_edge_material_disabled = create_line_material(Color(1.0,0.8,0.1));
navmesh_solid_material_disabled = create_solid_material(Color(1.0,0.8,0.1,0.4));
- navmesh_edge_material_disabled->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, false);
- navmesh_solid_material_disabled->set_flag(Material::FLAG_DOUBLE_SIDED,true);
+ navmesh_edge_material_disabled->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, false);
+ navmesh_edge_material_disabled->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, false);
+ navmesh_solid_material_disabled->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
skeleton_material = create_line_material(Color(0.6,1.0,0.3));
- skeleton_material->set_flag(Material::FLAG_DOUBLE_SIDED,true);
- skeleton_material->set_flag(Material::FLAG_UNSHADED,true);
- skeleton_material->set_flag(Material::FLAG_ONTOP,true);
- skeleton_material->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
+ skeleton_material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ skeleton_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true);
+ skeleton_material->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true);
+ skeleton_material->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
//position 3D Shared mesh
pos3d_mesh = Ref<Mesh>( memnew( Mesh ) );
{
- DVector<Vector3> cursor_points;
- DVector<Color> cursor_colors;
+ PoolVector<Vector3> cursor_points;
+ PoolVector<Color> cursor_colors;
float cs = 0.25;
cursor_points.push_back(Vector3(+cs,0,0));
cursor_points.push_back(Vector3(-cs,0,0));
@@ -3075,85 +3407,91 @@ SpatialEditorGizmos::SpatialEditorGizmos() {
cursor_colors.push_back(Color(0.5,0.5,1,0.7));
cursor_colors.push_back(Color(0.5,0.5,1,0.7));
- Ref<FixedMaterial> mat = memnew( FixedMaterial );
- mat->set_flag(Material::FLAG_UNSHADED,true);
- mat->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY,true);
- mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true);
+ Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial );
+ mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true);
+ mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true);
+ mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true);
+ mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT,true);
mat->set_line_width(3);
Array d;
d.resize(VS::ARRAY_MAX);
d[Mesh::ARRAY_VERTEX]=cursor_points;
d[Mesh::ARRAY_COLOR]=cursor_colors;
- pos3d_mesh->add_surface(Mesh::PRIMITIVE_LINES,d);
+ pos3d_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES,d);
pos3d_mesh->surface_set_material(0,mat);
}
listener_line_mesh = Ref<Mesh>(memnew(Mesh));
{
- DVector<Vector3> cursor_points;
- DVector<Color> cursor_colors;
+ PoolVector<Vector3> cursor_points;
+ PoolVector<Color> cursor_colors;
cursor_points.push_back(Vector3(0, 0, 0));
cursor_points.push_back(Vector3(0, 0, -1.0));
cursor_colors.push_back(Color(0.5, 0.5, 0.5, 0.7));
cursor_colors.push_back(Color(0.5, 0.5, 0.5, 0.7));
- Ref<FixedMaterial> mat = memnew(FixedMaterial);
- mat->set_flag(Material::FLAG_UNSHADED, true);
- mat->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true);
- mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
+ Ref<FixedSpatialMaterial> mat = memnew(FixedSpatialMaterial);
+ mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
mat->set_line_width(3);
Array d;
d.resize(VS::ARRAY_MAX);
d[Mesh::ARRAY_VERTEX] = cursor_points;
d[Mesh::ARRAY_COLOR] = cursor_colors;
- listener_line_mesh->add_surface(Mesh::PRIMITIVE_LINES, d);
+ listener_line_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, d);
listener_line_mesh->surface_set_material(0, mat);
}
- sample_player_icon = Ref<FixedMaterial>( memnew( FixedMaterial ));
- sample_player_icon->set_flag(Material::FLAG_UNSHADED, true);
- sample_player_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true);
- sample_player_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- sample_player_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- sample_player_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.9));
- sample_player_icon->set_texture(FixedMaterial::PARAM_DIFFUSE,SpatialEditor::get_singleton()->get_icon("GizmoSpatialSamplePlayer","EditorIcons"));
+ sample_player_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ sample_player_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ sample_player_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ sample_player_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
+ sample_player_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ sample_player_icon->set_albedo(Color(1,1,1,0.9));
+ sample_player_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,SpatialEditor::get_singleton()->get_icon("GizmoSpatialSamplePlayer","EditorIcons"));
room_material = create_line_material(Color(1.0,0.6,0.9));
portal_material = create_line_material(Color(1.0,0.8,0.6));
raycast_material = create_line_material(Color(1.0,0.8,0.6));
car_wheel_material = create_line_material(Color(0.6,0.8,1.0));
visibility_notifier_material = create_line_material(Color(1.0,0.5,1.0));
+ reflection_probe_material = create_line_material(Color(0.5,1.0,0.7));
+ reflection_probe_material_internal = create_line_material(Color(0.3,0.8,0.5,0.15));
+ gi_probe_material = create_line_material(Color(0.7,1.0,0.5));
+ gi_probe_material_internal = create_line_material(Color(0.5,0.8,0.3,0.4));
joint_material = create_line_material(Color(0.6,0.8,1.0));
- stream_player_icon = Ref<FixedMaterial>( memnew( FixedMaterial ));
- stream_player_icon->set_flag(Material::FLAG_UNSHADED, true);
- stream_player_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true);
- stream_player_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- stream_player_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- stream_player_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.9));
- stream_player_icon->set_texture(FixedMaterial::PARAM_DIFFUSE,SpatialEditor::get_singleton()->get_icon("GizmoSpatialStreamPlayer","EditorIcons"));
-
- visibility_notifier_icon = Ref<FixedMaterial>( memnew( FixedMaterial ));
- visibility_notifier_icon->set_flag(Material::FLAG_UNSHADED, true);
- visibility_notifier_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true);
- visibility_notifier_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- visibility_notifier_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- visibility_notifier_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.9));
- visibility_notifier_icon->set_texture(FixedMaterial::PARAM_DIFFUSE,SpatialEditor::get_singleton()->get_icon("Visible","EditorIcons"));
-
- listener_icon = Ref<FixedMaterial>(memnew(FixedMaterial));
- listener_icon->set_flag(Material::FLAG_UNSHADED, true);
- listener_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true);
- listener_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER);
- listener_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- listener_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE, Color(1, 1, 1, 0.9));
- listener_icon->set_texture(FixedMaterial::PARAM_DIFFUSE, SpatialEditor::get_singleton()->get_icon("GizmoListener", "EditorIcons"));
+ stream_player_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ stream_player_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ stream_player_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ stream_player_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
+ stream_player_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ stream_player_icon->set_albedo(Color(1,1,1,0.9));
+ stream_player_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,SpatialEditor::get_singleton()->get_icon("GizmoSpatialStreamPlayer","EditorIcons"));
+
+ visibility_notifier_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ));
+ visibility_notifier_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ visibility_notifier_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ visibility_notifier_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
+ visibility_notifier_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ visibility_notifier_icon->set_albedo(Color(1,1,1,0.9));
+ visibility_notifier_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,SpatialEditor::get_singleton()->get_icon("Visible","EditorIcons"));
+
+ listener_icon = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial));
+ listener_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true);
+ listener_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED);
+ listener_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED);
+ listener_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true);
+ listener_icon->set_albedo( Color(1, 1, 1, 0.9));
+ listener_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoListener", "EditorIcons"));
{
- DVector<Vector3> vertices;
+ PoolVector<Vector3> vertices;
#undef ADD_VTX
#define ADD_VTX(m_idx);\
@@ -3198,3 +3536,4 @@ SpatialEditorGizmos::SpatialEditorGizmos() {
}
+
diff --git a/tools/editor/spatial_editor_gizmos.h b/tools/editor/spatial_editor_gizmos.h
index 3d7272f522..8fde52b05a 100644
--- a/tools/editor/spatial_editor_gizmos.h
+++ b/tools/editor/spatial_editor_gizmos.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -45,6 +45,8 @@
#include "scene/3d/portal.h"
#include "scene/3d/ray_cast.h"
#include "scene/3d/navigation_mesh.h"
+#include "scene/3d/reflection_probe.h"
+#include "scene/3d/gi_probe.h"
#include "scene/3d/vehicle_body.h"
#include "scene/3d/collision_polygon.h"
@@ -55,7 +57,7 @@ class Camera;
class EditorSpatialGizmo : public SpatialEditorGizmo {
- OBJ_TYPE(EditorSpatialGizmo,SpatialGizmo);
+ GDCLASS(EditorSpatialGizmo,SpatialGizmo);
struct Instance{
@@ -127,7 +129,7 @@ public:
class LightSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(LightSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(LightSpatialGizmo,EditorSpatialGizmo);
Light* light;
@@ -146,7 +148,7 @@ public:
class ListenerSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(ListenerSpatialGizmo, EditorSpatialGizmo);
+ GDCLASS(ListenerSpatialGizmo, EditorSpatialGizmo);
Listener* listener;
@@ -159,7 +161,7 @@ public:
class CameraSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(CameraSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(CameraSpatialGizmo,EditorSpatialGizmo);
Camera* camera;
@@ -180,7 +182,7 @@ public:
class MeshInstanceSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(MeshInstanceSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(MeshInstanceSpatialGizmo,EditorSpatialGizmo);
MeshInstance* mesh;
@@ -193,7 +195,7 @@ public:
class Position3DSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(Position3DSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(Position3DSpatialGizmo,EditorSpatialGizmo);
Position3D* p3d;
@@ -206,7 +208,7 @@ public:
class SkeletonSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(SkeletonSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(SkeletonSpatialGizmo,EditorSpatialGizmo);
Skeleton* skel;
@@ -222,7 +224,7 @@ public:
class SpatialPlayerSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(SpatialPlayerSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(SpatialPlayerSpatialGizmo,EditorSpatialGizmo);
SpatialPlayer* splayer;
@@ -237,7 +239,7 @@ public:
class TestCubeSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(TestCubeSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(TestCubeSpatialGizmo,EditorSpatialGizmo);
TestCube* tc;
@@ -250,7 +252,7 @@ public:
class RoomSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(RoomSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(RoomSpatialGizmo,EditorSpatialGizmo);
struct _EdgeKey {
@@ -275,7 +277,7 @@ public:
class PortalSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(PortalSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(PortalSpatialGizmo,EditorSpatialGizmo);
Portal* portal;
@@ -289,7 +291,7 @@ public:
class VisibilityNotifierGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(VisibilityNotifierGizmo ,EditorSpatialGizmo);
+ GDCLASS(VisibilityNotifierGizmo ,EditorSpatialGizmo);
VisibilityNotifier* notifier;
@@ -307,10 +309,48 @@ public:
};
+class ReflectionProbeGizmo : public EditorSpatialGizmo {
+
+ GDCLASS(ReflectionProbeGizmo ,EditorSpatialGizmo);
+
+
+ ReflectionProbe* probe;
+
+public:
+
+ virtual String get_handle_name(int p_idx) const;
+ virtual Variant get_handle_value(int p_idx) const;
+ virtual void set_handle(int p_idx,Camera *p_camera, const Point2& p_point);
+ virtual void commit_handle(int p_idx,const Variant& p_restore,bool p_cancel=false);
+
+ void redraw();
+ ReflectionProbeGizmo(ReflectionProbe* p_notifier=NULL);
+
+};
+
+class GIProbeGizmo : public EditorSpatialGizmo {
+
+ GDCLASS(GIProbeGizmo ,EditorSpatialGizmo);
+
+
+ GIProbe* probe;
+
+public:
+
+ virtual String get_handle_name(int p_idx) const;
+ virtual Variant get_handle_value(int p_idx) const;
+ virtual void set_handle(int p_idx,Camera *p_camera, const Point2& p_point);
+ virtual void commit_handle(int p_idx,const Variant& p_restore,bool p_cancel=false);
+
+ void redraw();
+ GIProbeGizmo(GIProbe* p_notifier=NULL);
+
+};
+
class CollisionShapeSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(CollisionShapeSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(CollisionShapeSpatialGizmo,EditorSpatialGizmo);
CollisionShape* cs;
@@ -327,7 +367,7 @@ public:
class CollisionPolygonSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(CollisionPolygonSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(CollisionPolygonSpatialGizmo,EditorSpatialGizmo);
CollisionPolygon* polygon;
@@ -339,9 +379,10 @@ public:
};
+
class RayCastSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(RayCastSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(RayCastSpatialGizmo,EditorSpatialGizmo);
RayCast* raycast;
@@ -356,7 +397,7 @@ public:
class VehicleWheelSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(VehicleWheelSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(VehicleWheelSpatialGizmo,EditorSpatialGizmo);
VehicleWheel* car_wheel;
@@ -370,7 +411,7 @@ public:
class NavigationMeshSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(NavigationMeshSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(NavigationMeshSpatialGizmo,EditorSpatialGizmo);
struct _EdgeKey {
@@ -395,7 +436,7 @@ public:
class PinJointSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(PinJointSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(PinJointSpatialGizmo,EditorSpatialGizmo);
PinJoint* p3d;
@@ -409,7 +450,7 @@ public:
class HingeJointSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(HingeJointSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(HingeJointSpatialGizmo,EditorSpatialGizmo);
HingeJoint* p3d;
@@ -422,7 +463,7 @@ public:
class SliderJointSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(SliderJointSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(SliderJointSpatialGizmo,EditorSpatialGizmo);
SliderJoint* p3d;
@@ -435,7 +476,7 @@ public:
class ConeTwistJointSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(ConeTwistJointSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(ConeTwistJointSpatialGizmo,EditorSpatialGizmo);
ConeTwistJoint* p3d;
@@ -449,7 +490,7 @@ public:
class Generic6DOFJointSpatialGizmo : public EditorSpatialGizmo {
- OBJ_TYPE(Generic6DOFJointSpatialGizmo,EditorSpatialGizmo);
+ GDCLASS(Generic6DOFJointSpatialGizmo,EditorSpatialGizmo);
Generic6DOFJoint* p3d;
@@ -464,34 +505,38 @@ public:
class SpatialEditorGizmos {
public:
- Ref<FixedMaterial> create_line_material(const Color& p_base_color);
- Ref<FixedMaterial> create_solid_material(const Color& p_base_color);
- Ref<FixedMaterial> handle2_material;
- Ref<FixedMaterial> handle_material;
- Ref<FixedMaterial> light_material;
- Ref<FixedMaterial> light_material_omni_icon;
- Ref<FixedMaterial> light_material_directional_icon;
- Ref<FixedMaterial> camera_material;
- Ref<FixedMaterial> skeleton_material;
- Ref<FixedMaterial> room_material;
- Ref<FixedMaterial> portal_material;
- Ref<FixedMaterial> raycast_material;
- Ref<FixedMaterial> visibility_notifier_material;
- Ref<FixedMaterial> car_wheel_material;
- Ref<FixedMaterial> joint_material;
-
- Ref<FixedMaterial> navmesh_edge_material;
- Ref<FixedMaterial> navmesh_solid_material;
- Ref<FixedMaterial> navmesh_edge_material_disabled;
- Ref<FixedMaterial> navmesh_solid_material_disabled;
-
- Ref<FixedMaterial> listener_icon;
-
- Ref<FixedMaterial> sample_player_icon;
- Ref<FixedMaterial> stream_player_icon;
- Ref<FixedMaterial> visibility_notifier_icon;
-
- Ref<FixedMaterial> shape_material;
+ Ref<FixedSpatialMaterial> create_line_material(const Color& p_base_color);
+ Ref<FixedSpatialMaterial> create_solid_material(const Color& p_base_color);
+ Ref<FixedSpatialMaterial> handle2_material;
+ Ref<FixedSpatialMaterial> handle_material;
+ Ref<FixedSpatialMaterial> light_material;
+ Ref<FixedSpatialMaterial> light_material_omni_icon;
+ Ref<FixedSpatialMaterial> light_material_directional_icon;
+ Ref<FixedSpatialMaterial> camera_material;
+ Ref<FixedSpatialMaterial> skeleton_material;
+ Ref<FixedSpatialMaterial> reflection_probe_material;
+ Ref<FixedSpatialMaterial> reflection_probe_material_internal;
+ Ref<FixedSpatialMaterial> gi_probe_material;
+ Ref<FixedSpatialMaterial> gi_probe_material_internal;
+ Ref<FixedSpatialMaterial> room_material;
+ Ref<FixedSpatialMaterial> portal_material;
+ Ref<FixedSpatialMaterial> raycast_material;
+ Ref<FixedSpatialMaterial> visibility_notifier_material;
+ Ref<FixedSpatialMaterial> car_wheel_material;
+ Ref<FixedSpatialMaterial> joint_material;
+
+ Ref<FixedSpatialMaterial> navmesh_edge_material;
+ Ref<FixedSpatialMaterial> navmesh_solid_material;
+ Ref<FixedSpatialMaterial> navmesh_edge_material_disabled;
+ Ref<FixedSpatialMaterial> navmesh_solid_material_disabled;
+
+ Ref<FixedSpatialMaterial> listener_icon;
+
+ Ref<FixedSpatialMaterial> sample_player_icon;
+ Ref<FixedSpatialMaterial> stream_player_icon;
+ Ref<FixedSpatialMaterial> visibility_notifier_icon;
+
+ Ref<FixedSpatialMaterial> shape_material;
Ref<Texture> handle_t;
Ref<Mesh> pos3d_mesh;
@@ -505,5 +550,4 @@ public:
SpatialEditorGizmos();
};
-
#endif // SPATIAL_EDITOR_GIZMOS_H