diff options
Diffstat (limited to 'scene')
135 files changed, 612 insertions, 537 deletions
diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h index 32226ef5a4..01426db999 100644 --- a/scene/2d/area_2d.h +++ b/scene/2d/area_2d.h @@ -31,7 +31,7 @@ #ifndef AREA_2D_H #define AREA_2D_H -#include "core/vset.h" +#include "core/templates/vset.h" #include "scene/2d/collision_object_2d.h" class Area2D : public CollisionObject2D { diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index 5b89ac15b1..9bd716aeaa 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -30,7 +30,7 @@ #include "audio_stream_player_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "scene/2d/area_2d.h" #include "scene/main/window.h" diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index fd4d5981ff..e22b24c16f 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -30,7 +30,7 @@ #include "camera_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "core/math/math_funcs.h" #include "scene/scene_string_names.h" #include "servers/rendering_server.h" diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 3cbb0f72f8..64d82d715c 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -31,7 +31,7 @@ #include "collision_polygon_2d.h" #include "collision_object_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "core/math/geometry_2d.h" #include "scene/resources/concave_polygon_shape_2d.h" #include "scene/resources/convex_polygon_shape_2d.h" diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index d022c857f3..a5cd624235 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -31,7 +31,7 @@ #include "collision_shape_2d.h" #include "collision_object_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "scene/resources/capsule_shape_2d.h" #include "scene/resources/circle_shape_2d.h" #include "scene/resources/concave_polygon_shape_2d.h" diff --git a/scene/2d/cpu_particles_2d.h b/scene/2d/cpu_particles_2d.h index 5b405246e2..2296e0434e 100644 --- a/scene/2d/cpu_particles_2d.h +++ b/scene/2d/cpu_particles_2d.h @@ -31,7 +31,7 @@ #ifndef CPU_PARTICLES_2D_H #define CPU_PARTICLES_2D_H -#include "core/rid.h" +#include "core/templates/rid.h" #include "scene/2d/node_2d.h" #include "scene/resources/texture.h" diff --git a/scene/2d/gpu_particles_2d.cpp b/scene/2d/gpu_particles_2d.cpp index a9fdb103b2..a4a930455b 100644 --- a/scene/2d/gpu_particles_2d.cpp +++ b/scene/2d/gpu_particles_2d.cpp @@ -35,7 +35,7 @@ #include "scene/scene_string_names.h" #ifdef TOOLS_ENABLED -#include "core/engine.h" +#include "core/config/engine.h" #endif void GPUParticles2D::set_emitting(bool p_emitting) { diff --git a/scene/2d/gpu_particles_2d.h b/scene/2d/gpu_particles_2d.h index f1001a39fe..0d1b82d93e 100644 --- a/scene/2d/gpu_particles_2d.h +++ b/scene/2d/gpu_particles_2d.h @@ -31,7 +31,7 @@ #ifndef PARTICLES_2D_H #define PARTICLES_2D_H -#include "core/rid.h" +#include "core/templates/rid.h" #include "scene/2d/node_2d.h" #include "scene/resources/texture.h" diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index 8df72d7aac..0e4b1836da 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -30,7 +30,7 @@ #include "joints_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "physics_body_2d.h" #include "servers/physics_server_2d.h" diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 8e425b62da..2b373a669b 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -30,7 +30,7 @@ #include "light_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "servers/rendering_server.h" void Light2D::_update_light_visibility() { diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index b2ea60f895..0531762ed8 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -31,7 +31,7 @@ #include "light_occluder_2d.h" #include "core/math/geometry_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #define LINE_GRAB_WIDTH 8 diff --git a/scene/2d/line_builder.h b/scene/2d/line_builder.h index 9e3dbbd6c1..0e033d9be1 100644 --- a/scene/2d/line_builder.h +++ b/scene/2d/line_builder.h @@ -31,7 +31,7 @@ #ifndef LINE_BUILDER_H #define LINE_BUILDER_H -#include "core/color.h" +#include "core/math/color.h" #include "core/math/vector2.h" #include "line_2d.h" #include "scene/resources/gradient.h" diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index 9949ac6228..1c7063d0d3 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -30,7 +30,7 @@ #include "navigation_agent_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "core/math/geometry_2d.h" #include "scene/2d/navigation_2d.h" #include "servers/navigation_server_2d.h" diff --git a/scene/2d/navigation_agent_2d.h b/scene/2d/navigation_agent_2d.h index 9474392ddf..1f2377837b 100644 --- a/scene/2d/navigation_agent_2d.h +++ b/scene/2d/navigation_agent_2d.h @@ -31,7 +31,7 @@ #ifndef NAVIGATION_AGENT_2D_H #define NAVIGATION_AGENT_2D_H -#include "core/vector.h" +#include "core/templates/vector.h" #include "scene/main/node.h" class Node2D; diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index 67e7176e6e..98817ec03e 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -30,8 +30,8 @@ #include "navigation_region_2d.h" +#include "core/config/engine.h" #include "core/core_string_names.h" -#include "core/engine.h" #include "core/math/geometry_2d.h" #include "core/os/mutex.h" #include "navigation_2d.h" diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 72250e96b3..42c2585487 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -30,7 +30,7 @@ #include "node_2d.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" #include "scene/gui/control.h" #include "scene/main/window.h" #include "servers/rendering_server.h" diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index ec1f1f40fa..01aa5838b4 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -30,7 +30,7 @@ #include "parallax_layer.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "parallax_background.h" void ParallaxLayer::set_motion_scale(const Size2 &p_scale) { diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index d5994422e7..d305f2805e 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -30,7 +30,7 @@ #include "path_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "core/math/geometry_2d.h" #include "scene/scene_string_names.h" diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 402eac644f..300799ff9d 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -30,12 +30,12 @@ #include "physics_body_2d.h" -#include "core/class_db.h" +#include "core/config/engine.h" #include "core/core_string_names.h" -#include "core/engine.h" -#include "core/list.h" #include "core/math/math_funcs.h" -#include "core/rid.h" +#include "core/object/class_db.h" +#include "core/templates/list.h" +#include "core/templates/rid.h" #include "scene/scene_string_names.h" void PhysicsBody2D::_notification(int p_what) { diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index aefea56fa3..1db2d23bb8 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -31,7 +31,7 @@ #ifndef PHYSICS_BODY_2D_H #define PHYSICS_BODY_2D_H -#include "core/vset.h" +#include "core/templates/vset.h" #include "scene/2d/collision_object_2d.h" #include "scene/resources/physics_material.h" #include "servers/physics_server_2d.h" diff --git a/scene/2d/position_2d.cpp b/scene/2d/position_2d.cpp index a94a9f7085..8e4165cf50 100644 --- a/scene/2d/position_2d.cpp +++ b/scene/2d/position_2d.cpp @@ -30,7 +30,7 @@ #include "position_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "scene/resources/texture.h" const float DEFAULT_GIZMO_EXTENTS = 10.0; diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index a00db36077..e53f89c46d 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -31,7 +31,7 @@ #include "ray_cast_2d.h" #include "collision_object_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "physics_body_2d.h" #include "servers/physics_server_2d.h" diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index b9dd8f5405..22b615a379 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -31,8 +31,8 @@ #ifndef TILE_MAP_H #define TILE_MAP_H -#include "core/self_list.h" -#include "core/vset.h" +#include "core/templates/self_list.h" +#include "core/templates/vset.h" #include "scene/2d/navigation_2d.h" #include "scene/2d/node_2d.h" #include "scene/resources/tile_set.h" diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index 9cec589cfb..e217f2a394 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -30,7 +30,7 @@ #include "visibility_notifier_2d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "gpu_particles_2d.h" #include "scene/2d/animated_sprite_2d.h" #include "scene/2d/physics_body_2d.h" diff --git a/scene/3d/area_3d.h b/scene/3d/area_3d.h index 07d24f39a7..7d1f030baf 100644 --- a/scene/3d/area_3d.h +++ b/scene/3d/area_3d.h @@ -31,7 +31,7 @@ #ifndef AREA_3D_H #define AREA_3D_H -#include "core/vset.h" +#include "core/templates/vset.h" #include "scene/3d/collision_object_3d.h" class Area3D : public CollisionObject3D { diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 6e4db8f382..b093788d75 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -30,7 +30,7 @@ #include "audio_stream_player_3d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "scene/3d/area_3d.h" #include "scene/3d/camera_3d.h" #include "scene/3d/listener_3d.h" diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp index e867891ec0..38c9e96fbc 100644 --- a/scene/3d/baked_lightmap.cpp +++ b/scene/3d/baked_lightmap.cpp @@ -37,7 +37,7 @@ #include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/os/os.h" -#include "core/sort_array.h" +#include "core/templates/sort_array.h" #include "lightmap_probe.h" void BakedLightmapData::add_user(const NodePath &p_path, const Rect2 &p_uv_scale, int p_slice_index, int32_t p_sub_instance) { diff --git a/scene/3d/baked_lightmap.h b/scene/3d/baked_lightmap.h index bebb579252..8808569215 100644 --- a/scene/3d/baked_lightmap.h +++ b/scene/3d/baked_lightmap.h @@ -31,7 +31,7 @@ #ifndef BAKED_LIGHTMAP_H #define BAKED_LIGHTMAP_H -#include "core/local_vector.h" +#include "core/templates/local_vector.h" #include "scene/3d/light_3d.h" #include "scene/3d/lightmapper.h" #include "scene/3d/mesh_instance_3d.h" diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index ecbaca7bd1..a6433f8f58 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -31,7 +31,7 @@ #include "camera_3d.h" #include "collision_object_3d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "core/math/camera_matrix.h" #include "scene/resources/material.h" #include "scene/resources/surface_tool.h" diff --git a/scene/3d/cpu_particles_3d.h b/scene/3d/cpu_particles_3d.h index f44d0dfcfa..078861011b 100644 --- a/scene/3d/cpu_particles_3d.h +++ b/scene/3d/cpu_particles_3d.h @@ -31,7 +31,7 @@ #ifndef CPU_PARTICLES_H #define CPU_PARTICLES_H -#include "core/rid.h" +#include "core/templates/rid.h" #include "scene/3d/visual_instance_3d.h" class CPUParticles3D : public GeometryInstance3D { diff --git a/scene/3d/gpu_particles_3d.h b/scene/3d/gpu_particles_3d.h index b68acef21c..f0e5f05e5b 100644 --- a/scene/3d/gpu_particles_3d.h +++ b/scene/3d/gpu_particles_3d.h @@ -31,7 +31,7 @@ #ifndef PARTICLES_H #define PARTICLES_H -#include "core/rid.h" +#include "core/templates/rid.h" #include "scene/3d/visual_instance_3d.h" #include "scene/resources/material.h" diff --git a/scene/3d/gpu_particles_collision_3d.cpp b/scene/3d/gpu_particles_collision_3d.cpp index baaaa23185..1f0d5d587d 100644 --- a/scene/3d/gpu_particles_collision_3d.cpp +++ b/scene/3d/gpu_particles_collision_3d.cpp @@ -30,7 +30,7 @@ #include "gpu_particles_collision_3d.h" -#include "core/thread_work_pool.h" +#include "core/templates/thread_work_pool.h" #include "mesh_instance_3d.h" #include "scene/3d/camera_3d.h" #include "scene/main/viewport.h" diff --git a/scene/3d/gpu_particles_collision_3d.h b/scene/3d/gpu_particles_collision_3d.h index 4c73c7bcb2..9b644ade6b 100644 --- a/scene/3d/gpu_particles_collision_3d.h +++ b/scene/3d/gpu_particles_collision_3d.h @@ -31,8 +31,8 @@ #ifndef GPU_PARTICLES_COLLISION_3D_H #define GPU_PARTICLES_COLLISION_3D_H -#include "core/local_vector.h" -#include "core/rid.h" +#include "core/templates/local_vector.h" +#include "core/templates/rid.h" #include "scene/3d/visual_instance_3d.h" #include "scene/resources/material.h" diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index 46c3f18c38..2dc3cd3230 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -30,8 +30,8 @@ #include "light_3d.h" -#include "core/engine.h" -#include "core/project_settings.h" +#include "core/config/engine.h" +#include "core/config/project_settings.h" #include "scene/resources/surface_tool.h" bool Light3D::_can_gizmo_scale() const { diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp index 422b566867..f9f8f276a3 100644 --- a/scene/3d/navigation_agent_3d.cpp +++ b/scene/3d/navigation_agent_3d.cpp @@ -30,7 +30,7 @@ #include "navigation_agent_3d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "scene/3d/navigation_3d.h" #include "servers/navigation_server_3d.h" diff --git a/scene/3d/navigation_agent_3d.h b/scene/3d/navigation_agent_3d.h index e80367ea50..dcfd302561 100644 --- a/scene/3d/navigation_agent_3d.h +++ b/scene/3d/navigation_agent_3d.h @@ -31,7 +31,7 @@ #ifndef NAVIGATION_AGENT_H #define NAVIGATION_AGENT_H -#include "core/vector.h" +#include "core/templates/vector.h" #include "scene/main/node.h" class Node3D; diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp index 138788cf2d..e8005f38ed 100644 --- a/scene/3d/node_3d.cpp +++ b/scene/3d/node_3d.cpp @@ -30,8 +30,8 @@ #include "node_3d.h" -#include "core/engine.h" -#include "core/message_queue.h" +#include "core/config/engine.h" +#include "core/object/message_queue.h" #include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "scene/scene_string_names.h" diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp index d0d2d6f9f4..f25a64c567 100644 --- a/scene/3d/path_3d.cpp +++ b/scene/3d/path_3d.cpp @@ -30,7 +30,7 @@ #include "path_3d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "scene/scene_string_names.h" void Path3D::_notification(int p_what) { diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 579088b835..a3e00d2cc3 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -30,11 +30,11 @@ #include "physics_body_3d.h" -#include "core/class_db.h" +#include "core/config/engine.h" #include "core/core_string_names.h" -#include "core/engine.h" -#include "core/list.h" -#include "core/rid.h" +#include "core/object/class_db.h" +#include "core/templates/list.h" +#include "core/templates/rid.h" #include "scene/3d/collision_shape_3d.h" #include "scene/scene_string_names.h" #include "servers/navigation_server_3d.h" diff --git a/scene/3d/physics_body_3d.h b/scene/3d/physics_body_3d.h index d3dddeae55..da947ba02e 100644 --- a/scene/3d/physics_body_3d.h +++ b/scene/3d/physics_body_3d.h @@ -31,7 +31,7 @@ #ifndef PHYSICS_BODY_3D_H #define PHYSICS_BODY_3D_H -#include "core/vset.h" +#include "core/templates/vset.h" #include "scene/3d/collision_object_3d.h" #include "scene/resources/physics_material.h" #include "servers/physics_server_3d.h" diff --git a/scene/3d/ray_cast_3d.cpp b/scene/3d/ray_cast_3d.cpp index 69f09ef569..811e8a331b 100644 --- a/scene/3d/ray_cast_3d.cpp +++ b/scene/3d/ray_cast_3d.cpp @@ -31,7 +31,7 @@ #include "ray_cast_3d.h" #include "collision_object_3d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "mesh_instance_3d.h" #include "servers/physics_server_3d.h" diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index 6723ca04b9..0ae1c0e3b6 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -30,10 +30,10 @@ #include "skeleton_3d.h" -#include "core/engine.h" -#include "core/message_queue.h" -#include "core/project_settings.h" -#include "core/type_info.h" +#include "core/config/engine.h" +#include "core/config/project_settings.h" +#include "core/object/message_queue.h" +#include "core/variant/type_info.h" #include "scene/3d/physics_body_3d.h" #include "scene/resources/surface_tool.h" #include "scene/scene_string_names.h" diff --git a/scene/3d/skeleton_3d.h b/scene/3d/skeleton_3d.h index a21891a32e..95c49750fa 100644 --- a/scene/3d/skeleton_3d.h +++ b/scene/3d/skeleton_3d.h @@ -31,7 +31,7 @@ #ifndef SKELETON_3D_H #define SKELETON_3D_H -#include "core/rid.h" +#include "core/templates/rid.h" #include "scene/3d/node_3d.h" #include "scene/resources/skin.h" diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp index 3b5c328e43..132c35771b 100644 --- a/scene/3d/soft_body_3d.cpp +++ b/scene/3d/soft_body_3d.cpp @@ -30,10 +30,10 @@ #include "soft_body_3d.h" -#include "core/class_db.h" -#include "core/list.h" +#include "core/object/class_db.h" #include "core/os/os.h" -#include "core/rid.h" +#include "core/templates/list.h" +#include "core/templates/rid.h" #include "scene/3d/collision_object_3d.h" #include "scene/3d/physics_body_3d.h" #include "scene/3d/skeleton_3d.h" diff --git a/scene/3d/spring_arm_3d.cpp b/scene/3d/spring_arm_3d.cpp index 9775ecc6c6..287d760db0 100644 --- a/scene/3d/spring_arm_3d.cpp +++ b/scene/3d/spring_arm_3d.cpp @@ -30,7 +30,7 @@ #include "spring_arm_3d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "scene/3d/collision_object_3d.h" #include "scene/resources/sphere_shape_3d.h" #include "servers/physics_server_3d.h" diff --git a/scene/3d/velocity_tracker_3d.cpp b/scene/3d/velocity_tracker_3d.cpp index db10f3273b..eba7d44c16 100644 --- a/scene/3d/velocity_tracker_3d.cpp +++ b/scene/3d/velocity_tracker_3d.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "velocity_tracker_3d.h" -#include "core/engine.h" +#include "core/config/engine.h" void VelocityTracker3D::set_track_physics_step(bool p_track_physics_step) { physics_step = p_track_physics_step; diff --git a/scene/3d/visibility_notifier_3d.cpp b/scene/3d/visibility_notifier_3d.cpp index a64b0df1cc..9f5c40caf4 100644 --- a/scene/3d/visibility_notifier_3d.cpp +++ b/scene/3d/visibility_notifier_3d.cpp @@ -30,7 +30,7 @@ #include "visibility_notifier_3d.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "scene/3d/camera_3d.h" #include "scene/3d/physics_body_3d.h" #include "scene/animation/animation_player.h" diff --git a/scene/3d/visual_instance_3d.h b/scene/3d/visual_instance_3d.h index 195674f62d..51bcb411da 100644 --- a/scene/3d/visual_instance_3d.h +++ b/scene/3d/visual_instance_3d.h @@ -32,7 +32,7 @@ #define VISUAL_INSTANCE_H #include "core/math/face3.h" -#include "core/rid.h" +#include "core/templates/rid.h" #include "scene/3d/node_3d.h" #include "scene/resources/material.h" diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 4c869943e5..e9e17148d6 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -30,8 +30,8 @@ #include "animation_player.h" -#include "core/engine.h" -#include "core/message_queue.h" +#include "core/config/engine.h" +#include "core/object/message_queue.h" #include "scene/scene_string_names.h" #include "servers/audio/audio_stream.h" diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index bb5d536600..2ef3ba87b2 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -31,7 +31,7 @@ #include "animation_tree.h" #include "animation_blend_tree.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "scene/scene_string_names.h" #include "servers/audio/audio_stream.h" diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index 48f70e88cb..14aae9c7bf 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -30,7 +30,7 @@ #include "audio_stream_player.h" -#include "core/engine.h" +#include "core/config/engine.h" void AudioStreamPlayer::_mix_to_bus(const AudioFrame *p_frames, int p_amount) { int bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus); diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp index f57c8e58db..f848fc3e68 100644 --- a/scene/debugger/scene_debugger.cpp +++ b/scene/debugger/scene_debugger.cpp @@ -32,7 +32,7 @@ #include "core/debugger/engine_debugger.h" #include "core/io/marshalls.h" -#include "core/script_language.h" +#include "core/object/script_language.h" #include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "scene/resources/packed_scene.h" diff --git a/scene/debugger/scene_debugger.h b/scene/debugger/scene_debugger.h index 80e329f1f2..af2d8904b5 100644 --- a/scene/debugger/scene_debugger.h +++ b/scene/debugger/scene_debugger.h @@ -31,10 +31,10 @@ #ifndef SCENE_DEBUGGER_H #define SCENE_DEBUGGER_H -#include "core/array.h" -#include "core/class_db.h" -#include "core/pair.h" -#include "core/ustring.h" +#include "core/object/class_db.h" +#include "core/string/ustring.h" +#include "core/templates/pair.h" +#include "core/variant/array.h" class Script; diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index e400801b66..e86ad09aa6 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -30,7 +30,7 @@ #include "button.h" -#include "core/translation.h" +#include "core/string/translation.h" #include "servers/rendering_server.h" Size2 Button::get_minimum_size() const { diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp index 1ddc730dd1..790faeb4fd 100644 --- a/scene/gui/check_button.cpp +++ b/scene/gui/check_button.cpp @@ -30,7 +30,7 @@ #include "check_button.h" -#include "core/print_string.h" +#include "core/string/print_string.h" #include "servers/rendering_server.h" Size2 CheckButton::get_icon_size() const { diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index 470a7db2dc..5643110b89 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "container.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" #include "scene/scene_string_names.h" void Container::_child_minsize_changed() { diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index cb35519da1..50d29a3a02 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -30,12 +30,12 @@ #include "control.h" +#include "core/config/project_settings.h" #include "core/math/geometry_2d.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" #include "core/os/keyboard.h" #include "core/os/os.h" -#include "core/print_string.h" -#include "core/project_settings.h" +#include "core/string/print_string.h" #include "scene/gui/label.h" #include "scene/gui/panel.h" #include "scene/main/canvas_layer.h" @@ -728,13 +728,13 @@ Size2 Control::get_minimum_size() const { } template <class T> -bool Control::_find_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, T &r_ret, T (Theme::*get_func)(const StringName &, const StringName &) const, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_type) { +bool Control::_find_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, T &r_ret, T (Theme::*get_func)(const StringName &, const StringName &) const, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_node_type) { // try with custom themes Control *theme_owner = p_theme_owner; Window *theme_owner_window = p_theme_owner_window; while (theme_owner || theme_owner_window) { - StringName class_name = p_type; + StringName class_name = p_node_type; while (class_name != StringName()) { if (theme_owner && (theme_owner->data.theme.operator->()->*has_func)(p_name, class_name)) { @@ -771,13 +771,13 @@ bool Control::_find_theme_item(Control *p_theme_owner, Window *p_theme_owner_win return false; } -bool Control::_has_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_type) { +bool Control::_has_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_node_type) { // try with custom themes Control *theme_owner = p_theme_owner; Window *theme_owner_window = p_theme_owner_window; while (theme_owner || theme_owner_window) { - StringName class_name = p_type; + StringName class_name = p_node_type; while (class_name != StringName()) { if (theme_owner && (theme_owner->data.theme.operator->()->*has_func)(p_name, class_name)) { @@ -812,176 +812,176 @@ bool Control::_has_theme_item(Control *p_theme_owner, Window *p_theme_owner_wind return false; } -Ref<Texture2D> Control::get_theme_icon(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +Ref<Texture2D> Control::get_theme_icon(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { const Ref<Texture2D> *tex = data.icon_override.getptr(p_name); if (tex) { return *tex; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return get_icons(data.theme_owner, data.theme_owner_window, p_name, type); } -Ref<Texture2D> Control::get_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { +Ref<Texture2D> Control::get_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { Ref<Texture2D> icon; - if (_find_theme_item(p_theme_owner, p_theme_owner_window, icon, &Theme::get_icon, &Theme::has_icon, p_name, p_type)) { + if (_find_theme_item(p_theme_owner, p_theme_owner_window, icon, &Theme::get_icon, &Theme::has_icon, p_name, p_node_type)) { return icon; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_icon(p_name, p_type)) { - return Theme::get_project_default()->get_icon(p_name, p_type); + if (Theme::get_project_default()->has_icon(p_name, p_node_type)) { + return Theme::get_project_default()->get_icon(p_name, p_node_type); } } - return Theme::get_default()->get_icon(p_name, p_type); + return Theme::get_default()->get_icon(p_name, p_node_type); } -Ref<Shader> Control::get_theme_shader(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +Ref<Shader> Control::get_theme_shader(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { const Ref<Shader> *sdr = data.shader_override.getptr(p_name); if (sdr) { return *sdr; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return get_shaders(data.theme_owner, data.theme_owner_window, p_name, type); } -Ref<Shader> Control::get_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { +Ref<Shader> Control::get_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { Ref<Shader> shader; - if (_find_theme_item(p_theme_owner, p_theme_owner_window, shader, &Theme::get_shader, &Theme::has_shader, p_name, p_type)) { + if (_find_theme_item(p_theme_owner, p_theme_owner_window, shader, &Theme::get_shader, &Theme::has_shader, p_name, p_node_type)) { return shader; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_shader(p_name, p_type)) { - return Theme::get_project_default()->get_shader(p_name, p_type); + if (Theme::get_project_default()->has_shader(p_name, p_node_type)) { + return Theme::get_project_default()->get_shader(p_name, p_node_type); } } - return Theme::get_default()->get_shader(p_name, p_type); + return Theme::get_default()->get_shader(p_name, p_node_type); } -Ref<StyleBox> Control::get_theme_stylebox(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +Ref<StyleBox> Control::get_theme_stylebox(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { const Ref<StyleBox> *style = data.style_override.getptr(p_name); if (style) { return *style; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return get_styleboxs(data.theme_owner, data.theme_owner_window, p_name, type); } -Ref<StyleBox> Control::get_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { +Ref<StyleBox> Control::get_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { Ref<StyleBox> stylebox; - if (_find_theme_item(p_theme_owner, p_theme_owner_window, stylebox, &Theme::get_stylebox, &Theme::has_stylebox, p_name, p_type)) { + if (_find_theme_item(p_theme_owner, p_theme_owner_window, stylebox, &Theme::get_stylebox, &Theme::has_stylebox, p_name, p_node_type)) { return stylebox; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_stylebox(p_name, p_type)) { - return Theme::get_project_default()->get_stylebox(p_name, p_type); + if (Theme::get_project_default()->has_stylebox(p_name, p_node_type)) { + return Theme::get_project_default()->get_stylebox(p_name, p_node_type); } } - return Theme::get_default()->get_stylebox(p_name, p_type); + return Theme::get_default()->get_stylebox(p_name, p_node_type); } -Ref<Font> Control::get_theme_font(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +Ref<Font> Control::get_theme_font(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { const Ref<Font> *font = data.font_override.getptr(p_name); if (font) { return *font; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return get_fonts(data.theme_owner, data.theme_owner_window, p_name, type); } -Ref<Font> Control::get_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { +Ref<Font> Control::get_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { Ref<Font> font; - if (_find_theme_item(p_theme_owner, p_theme_owner_window, font, &Theme::get_font, &Theme::has_font, p_name, p_type)) { + if (_find_theme_item(p_theme_owner, p_theme_owner_window, font, &Theme::get_font, &Theme::has_font, p_name, p_node_type)) { return font; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_font(p_name, p_type)) { - return Theme::get_project_default()->get_font(p_name, p_type); + if (Theme::get_project_default()->has_font(p_name, p_node_type)) { + return Theme::get_project_default()->get_font(p_name, p_node_type); } } - return Theme::get_default()->get_font(p_name, p_type); + return Theme::get_default()->get_font(p_name, p_node_type); } -Color Control::get_theme_color(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +Color Control::get_theme_color(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { const Color *color = data.color_override.getptr(p_name); if (color) { return *color; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return get_colors(data.theme_owner, data.theme_owner_window, p_name, type); } -Color Control::get_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { +Color Control::get_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { Color color; - if (_find_theme_item(p_theme_owner, p_theme_owner_window, color, &Theme::get_color, &Theme::has_color, p_name, p_type)) { + if (_find_theme_item(p_theme_owner, p_theme_owner_window, color, &Theme::get_color, &Theme::has_color, p_name, p_node_type)) { return color; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_color(p_name, p_type)) { - return Theme::get_project_default()->get_color(p_name, p_type); + if (Theme::get_project_default()->has_color(p_name, p_node_type)) { + return Theme::get_project_default()->get_color(p_name, p_node_type); } } - return Theme::get_default()->get_color(p_name, p_type); + return Theme::get_default()->get_color(p_name, p_node_type); } -int Control::get_theme_constant(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +int Control::get_theme_constant(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { const int *constant = data.constant_override.getptr(p_name); if (constant) { return *constant; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return get_constants(data.theme_owner, data.theme_owner_window, p_name, type); } -int Control::get_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { +int Control::get_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { int constant; - if (_find_theme_item(p_theme_owner, p_theme_owner_window, constant, &Theme::get_constant, &Theme::has_constant, p_name, p_type)) { + if (_find_theme_item(p_theme_owner, p_theme_owner_window, constant, &Theme::get_constant, &Theme::has_constant, p_name, p_node_type)) { return constant; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_constant(p_name, p_type)) { - return Theme::get_project_default()->get_constant(p_name, p_type); + if (Theme::get_project_default()->has_constant(p_name, p_node_type)) { + return Theme::get_project_default()->get_constant(p_name, p_node_type); } } - return Theme::get_default()->get_constant(p_name, p_type); + return Theme::get_default()->get_constant(p_name, p_node_type); } bool Control::has_theme_icon_override(const StringName &p_name) const { @@ -1014,154 +1014,154 @@ bool Control::has_theme_constant_override(const StringName &p_name) const { return constant != nullptr; } -bool Control::has_theme_icon(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +bool Control::has_theme_icon(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { if (has_theme_icon_override(p_name)) { return true; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return has_icons(data.theme_owner, data.theme_owner_window, p_name, type); } -bool Control::has_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { - if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_icon, p_name, p_type)) { +bool Control::has_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { + if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_icon, p_name, p_node_type)) { return true; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_color(p_name, p_type)) { + if (Theme::get_project_default()->has_color(p_name, p_node_type)) { return true; } } - return Theme::get_default()->has_icon(p_name, p_type); + return Theme::get_default()->has_icon(p_name, p_node_type); } -bool Control::has_theme_shader(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +bool Control::has_theme_shader(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { if (has_theme_shader_override(p_name)) { return true; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return has_shaders(data.theme_owner, data.theme_owner_window, p_name, type); } -bool Control::has_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { - if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_shader, p_name, p_type)) { +bool Control::has_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { + if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_shader, p_name, p_node_type)) { return true; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_shader(p_name, p_type)) { + if (Theme::get_project_default()->has_shader(p_name, p_node_type)) { return true; } } - return Theme::get_default()->has_shader(p_name, p_type); + return Theme::get_default()->has_shader(p_name, p_node_type); } -bool Control::has_theme_stylebox(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +bool Control::has_theme_stylebox(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { if (has_theme_stylebox_override(p_name)) { return true; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return has_styleboxs(data.theme_owner, data.theme_owner_window, p_name, type); } -bool Control::has_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { - if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_stylebox, p_name, p_type)) { +bool Control::has_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { + if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_stylebox, p_name, p_node_type)) { return true; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_stylebox(p_name, p_type)) { + if (Theme::get_project_default()->has_stylebox(p_name, p_node_type)) { return true; } } - return Theme::get_default()->has_stylebox(p_name, p_type); + return Theme::get_default()->has_stylebox(p_name, p_node_type); } -bool Control::has_theme_font(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +bool Control::has_theme_font(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { if (has_theme_font_override(p_name)) { return true; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return has_fonts(data.theme_owner, data.theme_owner_window, p_name, type); } -bool Control::has_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { - if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_font, p_name, p_type)) { +bool Control::has_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { + if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_font, p_name, p_node_type)) { return true; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_font(p_name, p_type)) { + if (Theme::get_project_default()->has_font(p_name, p_node_type)) { return true; } } - return Theme::get_default()->has_font(p_name, p_type); + return Theme::get_default()->has_font(p_name, p_node_type); } -bool Control::has_theme_color(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +bool Control::has_theme_color(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { if (has_theme_color_override(p_name)) { return true; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); return has_colors(data.theme_owner, data.theme_owner_window, p_name, type); } -bool Control::has_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { - if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_color, p_name, p_type)) { +bool Control::has_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { + if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_color, p_name, p_node_type)) { return true; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_color(p_name, p_type)) { + if (Theme::get_project_default()->has_color(p_name, p_node_type)) { return true; } } - return Theme::get_default()->has_color(p_name, p_type); + return Theme::get_default()->has_color(p_name, p_node_type); } -bool Control::has_theme_constant(const StringName &p_name, const StringName &p_type) const { - if (p_type == StringName() || p_type == get_class_name()) { +bool Control::has_theme_constant(const StringName &p_name, const StringName &p_node_type) const { + if (p_node_type == StringName() || p_node_type == get_class_name()) { if (has_theme_constant_override(p_name)) { return true; } } - StringName type = p_type ? p_type : get_class_name(); + StringName type = p_node_type ? p_node_type : get_class_name(); - return has_constants(data.theme_owner, data.theme_owner_window, p_name, p_type); + return has_constants(data.theme_owner, data.theme_owner_window, p_name, p_node_type); } -bool Control::has_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type) { - if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_constant, p_name, p_type)) { +bool Control::has_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type) { + if (_has_theme_item(p_theme_owner, p_theme_owner_window, &Theme::has_constant, p_name, p_node_type)) { return true; } if (Theme::get_project_default().is_valid()) { - if (Theme::get_project_default()->has_constant(p_name, p_type)) { + if (Theme::get_project_default()->has_constant(p_name, p_node_type)) { return true; } } - return Theme::get_default()->has_constant(p_name, p_type); + return Theme::get_default()->has_constant(p_name, p_node_type); } Rect2 Control::get_parent_anchorable_rect() const { diff --git a/scene/gui/control.h b/scene/gui/control.h index 83e79f908f..3be839a5fb 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -32,7 +32,7 @@ #define CONTROL_H #include "core/math/transform_2d.h" -#include "core/rid.h" +#include "core/templates/rid.h" #include "scene/gui/shortcut.h" #include "scene/main/canvas_item.h" #include "scene/main/node.h" @@ -236,23 +236,23 @@ private: static void _propagate_theme_changed(Node *p_at, Control *p_owner, Window *p_owner_window, bool p_assign = true); template <class T> - _FORCE_INLINE_ static bool _find_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, T &, T (Theme::*get_func)(const StringName &, const StringName &) const, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_type); + _FORCE_INLINE_ static bool _find_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, T &, T (Theme::*get_func)(const StringName &, const StringName &) const, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_node_type); - _FORCE_INLINE_ static bool _has_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_type); + _FORCE_INLINE_ static bool _has_theme_item(Control *p_theme_owner, Window *p_theme_owner_window, bool (Theme::*has_func)(const StringName &, const StringName &) const, const StringName &p_name, const StringName &p_node_type); - static Ref<Texture2D> get_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); - static Ref<Shader> get_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); - static Ref<StyleBox> get_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); - static Ref<Font> get_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); - static Color get_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); - static int get_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); + static Ref<Texture2D> get_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); + static Ref<Shader> get_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); + static Ref<StyleBox> get_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); + static Ref<Font> get_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); + static Color get_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); + static int get_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); - static bool has_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); - static bool has_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); - static bool has_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); - static bool has_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); - static bool has_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); - static bool has_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_type = StringName()); + static bool has_icons(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); + static bool has_shaders(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); + static bool has_styleboxs(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); + static bool has_fonts(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); + static bool has_colors(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); + static bool has_constants(Control *p_theme_owner, Window *p_theme_owner_window, const StringName &p_name, const StringName &p_node_type = StringName()); protected: virtual void add_child_notify(Node *p_child) override; @@ -429,12 +429,12 @@ public: void add_theme_color_override(const StringName &p_name, const Color &p_color); void add_theme_constant_override(const StringName &p_name, int p_constant); - Ref<Texture2D> get_theme_icon(const StringName &p_name, const StringName &p_type = StringName()) const; - Ref<Shader> get_theme_shader(const StringName &p_name, const StringName &p_type = StringName()) const; - Ref<StyleBox> get_theme_stylebox(const StringName &p_name, const StringName &p_type = StringName()) const; - Ref<Font> get_theme_font(const StringName &p_name, const StringName &p_type = StringName()) const; - Color get_theme_color(const StringName &p_name, const StringName &p_type = StringName()) const; - int get_theme_constant(const StringName &p_name, const StringName &p_type = StringName()) const; + Ref<Texture2D> get_theme_icon(const StringName &p_name, const StringName &p_node_type = StringName()) const; + Ref<Shader> get_theme_shader(const StringName &p_name, const StringName &p_node_type = StringName()) const; + Ref<StyleBox> get_theme_stylebox(const StringName &p_name, const StringName &p_node_type = StringName()) const; + Ref<Font> get_theme_font(const StringName &p_name, const StringName &p_node_type = StringName()) const; + Color get_theme_color(const StringName &p_name, const StringName &p_node_type = StringName()) const; + int get_theme_constant(const StringName &p_name, const StringName &p_node_type = StringName()) const; bool has_theme_icon_override(const StringName &p_name) const; bool has_theme_shader_override(const StringName &p_name) const; @@ -443,12 +443,12 @@ public: bool has_theme_color_override(const StringName &p_name) const; bool has_theme_constant_override(const StringName &p_name) const; - bool has_theme_icon(const StringName &p_name, const StringName &p_type = StringName()) const; - bool has_theme_shader(const StringName &p_name, const StringName &p_type = StringName()) const; - bool has_theme_stylebox(const StringName &p_name, const StringName &p_type = StringName()) const; - bool has_theme_font(const StringName &p_name, const StringName &p_type = StringName()) const; - bool has_theme_color(const StringName &p_name, const StringName &p_type = StringName()) const; - bool has_theme_constant(const StringName &p_name, const StringName &p_type = StringName()) const; + bool has_theme_icon(const StringName &p_name, const StringName &p_node_type = StringName()) const; + bool has_theme_shader(const StringName &p_name, const StringName &p_node_type = StringName()) const; + bool has_theme_stylebox(const StringName &p_name, const StringName &p_node_type = StringName()) const; + bool has_theme_font(const StringName &p_name, const StringName &p_node_type = StringName()) const; + bool has_theme_color(const StringName &p_name, const StringName &p_node_type = StringName()) const; + bool has_theme_constant(const StringName &p_name, const StringName &p_node_type = StringName()) const; /* TOOLTIP */ diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 430e98d50e..4f59f4a36a 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -31,8 +31,8 @@ #include "dialogs.h" #include "core/os/keyboard.h" -#include "core/print_string.h" -#include "core/translation.h" +#include "core/string/print_string.h" +#include "core/string/translation.h" #include "line_edit.h" #ifdef TOOLS_ENABLED diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 2da61bdde7..7ce4e90f28 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -31,7 +31,7 @@ #include "file_dialog.h" #include "core/os/keyboard.h" -#include "core/print_string.h" +#include "core/string/print_string.h" #include "scene/gui/label.h" FileDialog::GetIconFunc FileDialog::get_icon_func = nullptr; diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp index ecd4ad17ea..53d7ead548 100644 --- a/scene/gui/gradient_edit.cpp +++ b/scene/gui/gradient_edit.cpp @@ -357,7 +357,7 @@ void GradientEdit::_notification(int p_what) { //Draw point markers for (int i = 0; i < points.size(); i++) { - Color col = points[i].color.contrasted(); + Color col = points[i].color.inverted(); col.a = 0.9; draw_line(Vector2(points[i].offset * total_w, 0), Vector2(points[i].offset * total_w, h / 2), col); diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 54150d130d..6708b18e0a 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -29,8 +29,8 @@ /*************************************************************************/ #include "item_list.h" +#include "core/config/project_settings.h" #include "core/os/os.h" -#include "core/project_settings.h" void ItemList::add_item(const String &p_item, const Ref<Texture2D> &p_texture, bool p_selectable) { Item item; diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 9e3418a5c9..9df63a3c71 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -30,9 +30,9 @@ #include "label.h" -#include "core/print_string.h" -#include "core/project_settings.h" -#include "core/translation.h" +#include "core/config/project_settings.h" +#include "core/string/print_string.h" +#include "core/string/translation.h" void Label::set_autowrap(bool p_autowrap) { if (autowrap == p_autowrap) { diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 1b8f04297d..649f5a5f66 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -30,11 +30,11 @@ #include "line_edit.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" #include "core/os/keyboard.h" #include "core/os/os.h" -#include "core/print_string.h" -#include "core/translation.h" +#include "core/string/print_string.h" +#include "core/string/translation.h" #include "label.h" #include "servers/display_server.h" #ifdef TOOLS_ENABLED @@ -679,7 +679,7 @@ void LineEdit::_notification(int p_what) { } break; #endif case NOTIFICATION_RESIZED: { - window_pos = 0; + scroll_offset = 0; set_cursor_position(get_cursor_position()); } break; @@ -735,7 +735,7 @@ void LineEdit::_notification(int p_what) { x_ofs = style->get_offset().x; } break; case ALIGN_CENTER: { - if (window_pos != 0) { + if (scroll_offset != 0) { x_ofs = style->get_offset().x; } else { x_ofs = MAX(style->get_margin(MARGIN_LEFT), int(size.width - (cached_text_width)) / 2); @@ -747,7 +747,7 @@ void LineEdit::_notification(int p_what) { } int ofs_max = width - style->get_margin(MARGIN_RIGHT); - int char_ofs = window_pos; + int char_ofs = scroll_offset; int y_area = height - style->get_minimum_size().height; int y_ofs = style->get_offset().y + (y_area - font->get_height()) / 2; @@ -780,7 +780,7 @@ void LineEdit::_notification(int p_what) { r_icon->draw(ci, Point2(width - r_icon->get_width() - style->get_margin(MARGIN_RIGHT), height / 2 - r_icon->get_height() / 2), color_icon); if (align == ALIGN_CENTER) { - if (window_pos == 0) { + if (scroll_offset == 0) { x_ofs = MAX(style->get_margin(MARGIN_LEFT), int(size.width - cached_text_width - r_icon->get_width() - style->get_margin(MARGIN_RIGHT) * 2) / 2); } } else { @@ -1023,7 +1023,7 @@ void LineEdit::undo() { TextOperation op = undo_stack_pos->get(); text = op.text; cached_width = op.cached_width; - window_pos = op.window_pos; + scroll_offset = op.scroll_offset; set_cursor_position(op.cursor_pos); if (expand_to_text_length) { @@ -1044,7 +1044,7 @@ void LineEdit::redo() { TextOperation op = undo_stack_pos->get(); text = op.text; cached_width = op.cached_width; - window_pos = op.window_pos; + scroll_offset = op.scroll_offset; set_cursor_position(op.cursor_pos); if (expand_to_text_length) { @@ -1071,7 +1071,7 @@ void LineEdit::shift_selection_check_post(bool p_shift) { void LineEdit::set_cursor_at_pixel_pos(int p_x) { Ref<Font> font = get_theme_font("font"); - int ofs = window_pos; + int ofs = scroll_offset; Ref<StyleBox> style = get_theme_stylebox("normal"); int pixel_ofs = 0; Size2 size = get_size(); @@ -1084,7 +1084,7 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) { pixel_ofs = int(style->get_offset().x); } break; case ALIGN_CENTER: { - if (window_pos != 0) { + if (scroll_offset != 0) { pixel_ofs = int(style->get_offset().x); } else { pixel_ofs = int(size.width - (cached_width)) / 2; @@ -1122,7 +1122,7 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) { int LineEdit::get_cursor_pixel_pos() { Ref<Font> font = get_theme_font("font"); - int ofs = window_pos; + int ofs = scroll_offset; Ref<StyleBox> style = get_theme_stylebox("normal"); int pixel_ofs = 0; Size2 size = get_size(); @@ -1135,7 +1135,7 @@ int LineEdit::get_cursor_pixel_pos() { pixel_ofs = int(style->get_offset().x); } break; case ALIGN_CENTER: { - if (window_pos != 0) { + if (scroll_offset != 0) { pixel_ofs = int(style->get_offset().x); } else { pixel_ofs = int(size.width - (cached_width)) / 2; @@ -1236,7 +1236,7 @@ void LineEdit::delete_char() { set_cursor_position(get_cursor_position() - 1); if (align == ALIGN_CENTER || align == ALIGN_RIGHT) { - window_pos = CLAMP(window_pos - 1, 0, MAX(text.length() - 1, 0)); + scroll_offset = CLAMP(scroll_offset - 1, 0, MAX(text.length() - 1, 0)); } _text_changed(); @@ -1262,12 +1262,12 @@ void LineEdit::delete_text(int p_from_column, int p_to_column) { if (cursor_pos >= text.length()) { cursor_pos = text.length(); } - if (window_pos > cursor_pos) { - window_pos = cursor_pos; + if (scroll_offset > cursor_pos) { + scroll_offset = cursor_pos; } if (align == ALIGN_CENTER || align == ALIGN_RIGHT) { - window_pos = CLAMP(window_pos - (p_to_column - p_from_column), 0, MAX(text.length() - 1, 0)); + scroll_offset = CLAMP(scroll_offset - (p_to_column - p_from_column), 0, MAX(text.length() - 1, 0)); } if (!text_changed_dirty) { @@ -1288,7 +1288,7 @@ void LineEdit::set_text(String p_text) { update(); cursor_pos = 0; - window_pos = 0; + scroll_offset = 0; } void LineEdit::clear() { @@ -1332,16 +1332,16 @@ void LineEdit::set_cursor_position(int p_pos) { cursor_pos = p_pos; if (!is_inside_tree()) { - window_pos = cursor_pos; + scroll_offset = cursor_pos; return; } Ref<StyleBox> style = get_theme_stylebox("normal"); Ref<Font> font = get_theme_font("font"); - if (cursor_pos <= window_pos) { + if (cursor_pos <= scroll_offset) { // Adjust window if cursor goes too much to the left. - set_window_pos(MAX(0, cursor_pos - 1)); + set_scroll_offset(MAX(0, cursor_pos - 1)); } else { // Adjust window if cursor goes too much to the right. int window_width = get_size().width - style->get_minimum_size().width; @@ -1354,12 +1354,12 @@ void LineEdit::set_cursor_position(int p_pos) { if (window_width < 0) { return; } - int wp = window_pos; + int wp = scroll_offset; if (font.is_valid()) { int accum_width = 0; - for (int i = cursor_pos; i >= window_pos; i--) { + for (int i = cursor_pos; i >= scroll_offset; i--) { if (i >= text.length()) { // Do not do this, because if the cursor is at the end, its just fine that it takes no space. // accum_width = font->get_char_size(' ').width; @@ -1378,8 +1378,8 @@ void LineEdit::set_cursor_position(int p_pos) { } } - if (wp != window_pos) { - set_window_pos(wp); + if (wp != scroll_offset) { + set_scroll_offset(wp); } } update(); @@ -1389,13 +1389,17 @@ int LineEdit::get_cursor_position() const { return cursor_pos; } -void LineEdit::set_window_pos(int p_pos) { - window_pos = p_pos; - if (window_pos < 0) { - window_pos = 0; +void LineEdit::set_scroll_offset(int p_pos) { + scroll_offset = p_pos; + if (scroll_offset < 0) { + scroll_offset = 0; } } +int LineEdit::get_scroll_offset() const { + return scroll_offset; +} + void LineEdit::append_at_cursor(String p_text) { if ((max_length <= 0) || (text.length() + p_text.length() <= max_length)) { String pre = text.substr(0, cursor_pos); @@ -1413,7 +1417,7 @@ void LineEdit::clear_internal() { _clear_undo_stack(); cached_width = 0; cursor_pos = 0; - window_pos = 0; + scroll_offset = 0; undo_text = ""; text = ""; update(); @@ -1644,7 +1648,7 @@ void LineEdit::_editor_settings_changed() { void LineEdit::set_expand_to_text_length(bool p_enabled) { expand_to_text_length = p_enabled; minimum_size_changed(); - set_window_pos(0); + set_scroll_offset(0); } bool LineEdit::get_expand_to_text_length() const { @@ -1771,7 +1775,7 @@ void LineEdit::_create_undo_state() { op.text = text; op.cached_width = cached_width; op.cursor_pos = cursor_pos; - op.window_pos = window_pos; + op.scroll_offset = scroll_offset; undo_stack.push_back(op); } @@ -1816,6 +1820,7 @@ void LineEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("get_placeholder_alpha"), &LineEdit::get_placeholder_alpha); ClassDB::bind_method(D_METHOD("set_cursor_position", "position"), &LineEdit::set_cursor_position); ClassDB::bind_method(D_METHOD("get_cursor_position"), &LineEdit::get_cursor_position); + ClassDB::bind_method(D_METHOD("get_scroll_offset"), &LineEdit::get_scroll_offset); ClassDB::bind_method(D_METHOD("set_expand_to_text_length", "enabled"), &LineEdit::set_expand_to_text_length); ClassDB::bind_method(D_METHOD("get_expand_to_text_length"), &LineEdit::get_expand_to_text_length); ClassDB::bind_method(D_METHOD("cursor_set_blink_enabled", "enabled"), &LineEdit::cursor_set_blink_enabled); @@ -1898,7 +1903,7 @@ LineEdit::LineEdit() { cached_width = 0; cached_placeholder_width = 0; cursor_pos = 0; - window_pos = 0; + scroll_offset = 0; window_has_focus = true; max_length = 0; pass = false; diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index d6cc1f1f11..a5e5b6988f 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -80,7 +80,7 @@ private: PopupMenu *menu; int cursor_pos; - int window_pos; + int scroll_offset; int max_length; // 0 for no maximum. int cached_width; @@ -106,7 +106,7 @@ private: struct TextOperation { int cursor_pos; - int window_pos; + int scroll_offset; int cached_width; String text; }; @@ -144,7 +144,8 @@ private: void shift_selection_check_post(bool); void selection_fill_at_cursor(); - void set_window_pos(int p_pos); + void set_scroll_offset(int p_pos); + int get_scroll_offset() const; void set_cursor_at_pixel_pos(int p_x); int get_cursor_pixel_pos(); diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 5780cc5e71..f0e69a94a4 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -30,7 +30,7 @@ #include "option_button.h" -#include "core/print_string.h" +#include "core/string/print_string.h" Size2 OptionButton::get_minimum_size() const { Size2 minsize = Button::get_minimum_size(); diff --git a/scene/gui/panel.cpp b/scene/gui/panel.cpp index d8d9beca2b..acbb6d7ab5 100644 --- a/scene/gui/panel.cpp +++ b/scene/gui/panel.cpp @@ -30,7 +30,7 @@ #include "panel.h" -#include "core/print_string.h" +#include "core/string/print_string.h" void Panel::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW) { diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index de866fa956..791c78e2b4 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -30,7 +30,7 @@ #include "popup.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "core/os/keyboard.h" #include "scene/gui/panel.h" @@ -93,7 +93,7 @@ void Popup::_notification(int p_what) { } void Popup::_parent_focused() { - if (popped_up) { + if (popped_up && close_on_parent_focus) { _close_pressed(); } } @@ -112,7 +112,19 @@ void Popup::set_as_minsize() { set_size(get_contents_minimum_size()); } +void Popup::set_close_on_parent_focus(bool p_close) { + close_on_parent_focus = p_close; +} + +bool Popup::get_close_on_parent_focus() { + return close_on_parent_focus; +} + void Popup::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_close_on_parent_focus", "close"), &Popup::set_close_on_parent_focus); + ClassDB::bind_method(D_METHOD("get_close_on_parent_focus"), &Popup::get_close_on_parent_focus); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "close_on_parent_focus"), "set_close_on_parent_focus", "get_close_on_parent_focus"); + ADD_SIGNAL(MethodInfo("popup_hide")); } diff --git a/scene/gui/popup.h b/scene/gui/popup.h index 3e5b89ccf3..48e7ea9452 100644 --- a/scene/gui/popup.h +++ b/scene/gui/popup.h @@ -33,13 +33,14 @@ #include "scene/main/window.h" -#include "core/local_vector.h" +#include "core/templates/local_vector.h" class Popup : public Window { GDCLASS(Popup, Window); LocalVector<Window *> visible_parents; bool popped_up = false; + bool close_on_parent_focus = true; void _input_from_window(const Ref<InputEvent> &p_event); @@ -57,6 +58,10 @@ protected: public: void set_as_minsize(); + + void set_close_on_parent_focus(bool p_close); + bool get_close_on_parent_focus(); + Popup(); ~Popup(); }; diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 578d8a96e8..7baf32173f 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -33,8 +33,8 @@ #include "core/input/input.h" #include "core/os/keyboard.h" #include "core/os/os.h" -#include "core/print_string.h" -#include "core/translation.h" +#include "core/string/print_string.h" +#include "core/string/translation.h" String PopupMenu::_get_accel_text(int p_item) const { ERR_FAIL_INDEX_V(p_item, items.size(), String()); @@ -173,11 +173,11 @@ int PopupMenu::_get_mouse_over(const Point2 &p_over) const { return -1; } -void PopupMenu::_activate_submenu(int over) { - Node *n = get_node(items[over].submenu); - ERR_FAIL_COND_MSG(!n, "Item subnode does not exist: " + items[over].submenu + "."); +void PopupMenu::_activate_submenu(int p_over) { + Node *n = get_node(items[p_over].submenu); + ERR_FAIL_COND_MSG(!n, "Item subnode does not exist: " + items[p_over].submenu + "."); Popup *submenu_popup = Object::cast_to<Popup>(n); - ERR_FAIL_COND_MSG(!submenu_popup, "Item subnode is not a Popup: " + items[over].submenu + "."); + ERR_FAIL_COND_MSG(!submenu_popup, "Item subnode is not a Popup: " + items[p_over].submenu + "."); if (submenu_popup->is_visible()) { return; //already visible! } @@ -190,7 +190,7 @@ void PopupMenu::_activate_submenu(int over) { float scroll_offset = control->get_position().y; - Point2 submenu_pos = this_pos + Point2(this_rect.size.width, items[over]._ofs_cache + scroll_offset); + Point2 submenu_pos = this_pos + Point2(this_rect.size.width, items[p_over]._ofs_cache + scroll_offset); Size2 submenu_size = submenu_popup->get_size(); // Fix pos if going outside parent rect @@ -198,6 +198,7 @@ void PopupMenu::_activate_submenu(int over) { submenu_pos.x = this_pos.x - submenu_size.width; } + submenu_popup->set_close_on_parent_focus(false); submenu_popup->set_position(submenu_pos); submenu_popup->set_as_minsize(); // Shrink the popup size to it's contents. submenu_popup->popup(); @@ -210,11 +211,11 @@ void PopupMenu::_activate_submenu(int over) { // Autohide area above the submenu item submenu_pum->clear_autohide_areas(); - submenu_pum->add_autohide_area(Rect2(this_rect.position.x, this_rect.position.y, this_rect.size.x, items[over]._ofs_cache + scroll_offset + style->get_offset().height - vsep / 2)); + submenu_pum->add_autohide_area(Rect2(this_rect.position.x, this_rect.position.y, this_rect.size.x, items[p_over]._ofs_cache + scroll_offset + style->get_offset().height - vsep / 2)); // If there is an area below the submenu item, add an autohide area there. - if (items[over]._ofs_cache + items[over]._height_cache + scroll_offset <= control->get_size().height) { - int from = items[over]._ofs_cache + items[over]._height_cache + scroll_offset + vsep / 2 + style->get_offset().height; + if (items[p_over]._ofs_cache + items[p_over]._height_cache + scroll_offset <= control->get_size().height) { + int from = items[p_over]._ofs_cache + items[p_over]._height_cache + scroll_offset + vsep / 2 + style->get_offset().height; submenu_pum->add_autohide_area(Rect2(this_rect.position.x, this_rect.position.y + from, this_rect.size.x, this_rect.size.y - from)); } } @@ -547,6 +548,31 @@ void PopupMenu::_draw_background() { style->draw(ci2, Rect2(Point2(), margin_container->get_size())); } +void PopupMenu::_minimum_lifetime_timeout() { + close_allowed = true; + // If the mouse still isn't in this popup after timer expires, close. + if (!get_visible_rect().has_point(get_mouse_position())) { + _close_pressed(); + } +} + +void PopupMenu::_close_pressed() { + // Only apply minimum lifetime to submenus. + PopupMenu *parent_pum = Object::cast_to<PopupMenu>(get_parent()); + if (!parent_pum) { + Popup::_close_pressed(); + return; + } + + // If the timer has expired, close. If timer is still running, do nothing. + if (close_allowed) { + close_allowed = false; + Popup::_close_pressed(); + } else if (minimum_lifetime_timer->is_stopped()) { + minimum_lifetime_timer->start(); + } +} + void PopupMenu::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { @@ -566,7 +592,7 @@ void PopupMenu::_notification(int p_what) { control->update(); } break; case NOTIFICATION_WM_MOUSE_ENTER: { - //grab_focus(); + grab_focus(); } break; case NOTIFICATION_WM_MOUSE_EXIT: { if (mouse_over >= 0 && (items[mouse_over].submenu == "" || submenu_over != -1)) { @@ -1484,6 +1510,12 @@ PopupMenu::PopupMenu() { submenu_timer->set_one_shot(true); submenu_timer->connect("timeout", callable_mp(this, &PopupMenu::_submenu_timeout)); add_child(submenu_timer); + + minimum_lifetime_timer = memnew(Timer); + minimum_lifetime_timer->set_wait_time(0.3); + minimum_lifetime_timer->set_one_shot(true); + minimum_lifetime_timer->connect("timeout", callable_mp(this, &PopupMenu::_minimum_lifetime_timeout)); + add_child(minimum_lifetime_timer); } PopupMenu::~PopupMenu() { diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index e8f82ba869..a2e7d7e6cd 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -86,6 +86,9 @@ class PopupMenu : public Popup { } }; + bool close_allowed = false; + + Timer *minimum_lifetime_timer = nullptr; Timer *submenu_timer; List<Rect2> autohide_areas; Vector<Item> items; @@ -102,7 +105,7 @@ class PopupMenu : public Popup { void _scroll_to_item(int p_item); void _gui_input(const Ref<InputEvent> &p_event); - void _activate_submenu(int over); + void _activate_submenu(int p_over); void _submenu_timeout(); uint64_t popup_time_msec = 0; @@ -130,6 +133,9 @@ class PopupMenu : public Popup { void _draw_items(); void _draw_background(); + void _minimum_lifetime_timeout(); + void _close_pressed(); + protected: friend class MenuButton; void _notification(int p_what); diff --git a/scene/gui/reference_rect.cpp b/scene/gui/reference_rect.cpp index 32ec0049f0..773acb2713 100644 --- a/scene/gui/reference_rect.cpp +++ b/scene/gui/reference_rect.cpp @@ -30,7 +30,7 @@ #include "reference_rect.h" -#include "core/engine.h" +#include "core/config/engine.h" void ReferenceRect::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW) { diff --git a/scene/gui/rich_text_effect.cpp b/scene/gui/rich_text_effect.cpp index 2628e5ab0f..76ca8abcc7 100644 --- a/scene/gui/rich_text_effect.cpp +++ b/scene/gui/rich_text_effect.cpp @@ -30,7 +30,7 @@ #include "rich_text_effect.h" -#include "core/script_language.h" +#include "core/object/script_language.h" void RichTextEffect::_bind_methods() { BIND_VMETHOD(MethodInfo(Variant::BOOL, "_process_custom_fx", PropertyInfo(Variant::OBJECT, "char_fx", PROPERTY_HINT_RESOURCE_TYPE, "CharFXTransform"))); diff --git a/scene/gui/rich_text_effect.h b/scene/gui/rich_text_effect.h index a5401f7eaa..e6b9f09e4d 100644 --- a/scene/gui/rich_text_effect.h +++ b/scene/gui/rich_text_effect.h @@ -31,7 +31,7 @@ #ifndef RICH_TEXT_EFFECT_H #define RICH_TEXT_EFFECT_H -#include "core/resource.h" +#include "core/io/resource.h" class RichTextEffect : public Resource { GDCLASS(RichTextEffect, Resource); diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 0e9ef71892..9340d98ede 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -32,7 +32,7 @@ #include "core/os/keyboard.h" #include "core/os/os.h" -#include "core/print_string.h" +#include "core/string/print_string.h" #include "scene/main/window.h" bool ScrollBar::focus_by_default = false; diff --git a/scene/gui/shortcut.h b/scene/gui/shortcut.h index 0d7809e5cf..176958b397 100644 --- a/scene/gui/shortcut.h +++ b/scene/gui/shortcut.h @@ -32,7 +32,7 @@ #define SHORTCUT_H #include "core/input/input_event.h" -#include "core/resource.h" +#include "core/io/resource.h" class Shortcut : public Resource { GDCLASS(Shortcut, Resource); diff --git a/scene/gui/subviewport_container.cpp b/scene/gui/subviewport_container.cpp index 4e1ad2ae05..c5f56fe8e2 100644 --- a/scene/gui/subviewport_container.cpp +++ b/scene/gui/subviewport_container.cpp @@ -30,7 +30,7 @@ #include "subviewport_container.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "scene/main/viewport.h" Size2 SubViewportContainer::get_minimum_size() const { diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index bd9c2da5bc..d92f41af2d 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -30,7 +30,7 @@ #include "tab_container.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" #include "scene/gui/box_container.h" #include "scene/gui/label.h" #include "scene/gui/texture_rect.h" diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index d47f771d1d..eefe8cc3bc 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -30,7 +30,7 @@ #include "tabs.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" #include "scene/gui/box_container.h" #include "scene/gui/label.h" #include "scene/gui/texture_rect.h" diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index fb397759aa..77ac3d6702 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -30,12 +30,12 @@ #include "text_edit.h" +#include "core/config/project_settings.h" #include "core/input/input.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" +#include "core/object/script_language.h" #include "core/os/keyboard.h" #include "core/os/os.h" -#include "core/project_settings.h" -#include "core/script_language.h" #include "scene/main/window.h" #ifdef TOOLS_ENABLED @@ -1559,7 +1559,19 @@ void TextEdit::_notification(int p_what) { } if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) { - DisplayServer::get_singleton()->virtual_keyboard_show(get_text(), get_global_rect(), true); + String text = _base_get_text(0, 0, selection.selecting_line, selection.selecting_column); + int cursor_start = text.length(); + int cursor_end = -1; + + if (selection.active) { + String selected_text = _base_get_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); + + if (selected_text.length() > 0) { + cursor_end = cursor_start + selected_text.length(); + } + } + + DisplayServer::get_singleton()->virtual_keyboard_show(get_text(), get_global_rect(), true, -1, cursor_start, cursor_end); } } break; case NOTIFICATION_FOCUS_EXIT: { diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index 484b14d11c..e0d98d1c22 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -30,7 +30,7 @@ #include "texture_progress.h" -#include "core/engine.h" +#include "core/config/engine.h" void TextureProgress::set_under_texture(const Ref<Texture2D> &p_texture) { under = p_texture; diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 318496df70..bcb375d786 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -30,12 +30,12 @@ #include "tree.h" +#include "core/config/project_settings.h" #include "core/input/input.h" #include "core/math/math_funcs.h" #include "core/os/keyboard.h" #include "core/os/os.h" -#include "core/print_string.h" -#include "core/project_settings.h" +#include "core/string/print_string.h" #include "scene/main/window.h" #include "box_container.h" diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 740374d09e..e6c35352f5 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -31,7 +31,7 @@ #include "canvas_item.h" #include "core/input/input.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" #include "scene/2d/canvas_group.h" #include "scene/main/canvas_layer.h" #include "scene/main/viewport.h" diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index da0169b60b..f484d25dc1 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -30,7 +30,7 @@ #include "http_request.h" #include "core/io/compression.h" -#include "core/ustring.h" +#include "core/string/ustring.h" void HTTPRequest::_redirect_request(const String &p_new_url) { } diff --git a/scene/main/node.cpp b/scene/main/node.cpp index e7753089c7..38baa6c97e 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -32,8 +32,8 @@ #include "core/core_string_names.h" #include "core/io/resource_loader.h" -#include "core/message_queue.h" -#include "core/print_string.h" +#include "core/object/message_queue.h" +#include "core/string/print_string.h" #include "instance_placeholder.h" #include "scene/debugger/scene_debugger.h" #include "scene/resources/packed_scene.h" @@ -2889,7 +2889,6 @@ void Node::_bind_methods() { ADD_SIGNAL(MethodInfo("tree_exiting")); ADD_SIGNAL(MethodInfo("tree_exited")); - ADD_GROUP("Pause", "pause_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "pause_mode", PROPERTY_HINT_ENUM, "Inherit,Stop,Process"), "set_pause_mode", "get_pause_mode"); ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "name", PROPERTY_HINT_NONE, "", 0), "set_name", "get_name"); diff --git a/scene/main/node.h b/scene/main/node.h index 09943d0626..2f8a0673e9 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -31,12 +31,12 @@ #ifndef NODE_H #define NODE_H -#include "core/class_db.h" -#include "core/map.h" -#include "core/node_path.h" -#include "core/project_settings.h" -#include "core/script_language.h" -#include "core/typed_array.h" +#include "core/config/project_settings.h" +#include "core/object/class_db.h" +#include "core/object/script_language.h" +#include "core/string/node_path.h" +#include "core/templates/map.h" +#include "core/variant/typed_array.h" #include "scene/main/scene_tree.h" class Viewport; diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 40479a796f..cffd1126ee 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -30,16 +30,16 @@ #include "scene_tree.h" +#include "core/config/project_settings.h" #include "core/debugger/engine_debugger.h" #include "core/input/input.h" #include "core/io/marshalls.h" #include "core/io/resource_loader.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" #include "core/os/dir_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" -#include "core/print_string.h" -#include "core/project_settings.h" +#include "core/string/print_string.h" #include "node.h" #include "scene/debugger/scene_debugger.h" #include "scene/resources/dynamic_font.h" diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index e5ab4f9958..3e5802ce2e 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -34,7 +34,7 @@ #include "core/io/multiplayer_api.h" #include "core/os/main_loop.h" #include "core/os/thread_safe.h" -#include "core/self_list.h" +#include "core/templates/self_list.h" #include "scene/resources/mesh.h" #include "scene/resources/world_2d.h" #include "scene/resources/world_3d.h" diff --git a/scene/main/shader_globals_override.cpp b/scene/main/shader_globals_override.cpp index 86c08ca6e9..432fb5b4fb 100644 --- a/scene/main/shader_globals_override.cpp +++ b/scene/main/shader_globals_override.cpp @@ -202,7 +202,7 @@ void ShaderGlobalsOverride::_get_property_list(List<PropertyInfo> *p_list) const Override o; o.in_use = false; Callable::CallError ce; - o.override = Variant::construct(pinfo.type, nullptr, 0, ce); + Variant::construct(pinfo.type, o.override, nullptr, 0, ce); overrides[variables[i]] = o; } diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index fb55892b54..c9fce2f6c2 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -30,7 +30,7 @@ #include "timer.h" -#include "core/engine.h" +#include "core/config/engine.h" void Timer::_notification(int p_what) { switch (p_what) { diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index d512f1809c..17411bb490 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -30,11 +30,11 @@ #include "viewport.h" +#include "core/config/project_settings.h" #include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/input/input.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "scene/2d/collision_object_2d.h" #include "scene/3d/camera_3d.h" #include "scene/3d/collision_object_3d.h" diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 9d224dc744..7997dc12e1 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -30,9 +30,9 @@ #include "register_scene_types.h" -#include "core/class_db.h" +#include "core/config/project_settings.h" +#include "core/object/class_db.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "scene/2d/animated_sprite_2d.h" #include "scene/2d/area_2d.h" #include "scene/2d/audio_stream_player_2d.h" diff --git a/scene/resources/animation.h b/scene/resources/animation.h index 722a400fd6..c52431f5f6 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -31,7 +31,7 @@ #ifndef ANIMATION_H #define ANIMATION_H -#include "core/resource.h" +#include "core/io/resource.h" class Animation : public Resource { GDCLASS(Animation, Resource); diff --git a/scene/resources/bit_map.h b/scene/resources/bit_map.h index 59f3b4dc3c..56ff72c094 100644 --- a/scene/resources/bit_map.h +++ b/scene/resources/bit_map.h @@ -31,9 +31,9 @@ #ifndef BIT_MAP_H #define BIT_MAP_H -#include "core/image.h" +#include "core/io/image.h" +#include "core/io/resource.h" #include "core/io/resource_loader.h" -#include "core/resource.h" class BitMap : public Resource { GDCLASS(BitMap, Resource); diff --git a/scene/resources/camera_effects.h b/scene/resources/camera_effects.h index 99fd4eb37c..9a26f3d0b2 100644 --- a/scene/resources/camera_effects.h +++ b/scene/resources/camera_effects.h @@ -31,8 +31,8 @@ #ifndef CAMERA_EFFECTS_H #define CAMERA_EFFECTS_H -#include "core/resource.h" -#include "core/rid.h" +#include "core/io/resource.h" +#include "core/templates/rid.h" class CameraEffects : public Resource { GDCLASS(CameraEffects, Resource); diff --git a/scene/resources/curve.h b/scene/resources/curve.h index 57ddaf897d..6c5f4b7057 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -31,7 +31,7 @@ #ifndef CURVE_H #define CURVE_H -#include "core/resource.h" +#include "core/io/resource.h" // y(x) curve class Curve : public Resource { diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h index a881e21da8..73ba42f8a7 100644 --- a/scene/resources/dynamic_font.h +++ b/scene/resources/dynamic_font.h @@ -37,7 +37,7 @@ #include "core/io/resource_loader.h" #include "core/os/mutex.h" #include "core/os/thread_safe.h" -#include "core/pair.h" +#include "core/templates/pair.h" #include "scene/resources/font.h" #include <ft2build.h> diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index f4edab07b5..bacdb6be54 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -30,7 +30,7 @@ #include "environment.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "servers/rendering_server.h" #include "texture.h" diff --git a/scene/resources/environment.h b/scene/resources/environment.h index 9b7247b58d..23c7f5180c 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -31,7 +31,7 @@ #ifndef ENVIRONMENT_H #define ENVIRONMENT_H -#include "core/resource.h" +#include "core/io/resource.h" #include "scene/resources/sky.h" #include "scene/resources/texture.h" #include "servers/rendering_server.h" diff --git a/scene/resources/font.h b/scene/resources/font.h index c739520da3..d8c350bb41 100644 --- a/scene/resources/font.h +++ b/scene/resources/font.h @@ -31,8 +31,8 @@ #ifndef FONT_H #define FONT_H -#include "core/map.h" -#include "core/resource.h" +#include "core/io/resource.h" +#include "core/templates/map.h" #include "scene/resources/texture.h" class Font : public Resource { diff --git a/scene/resources/gradient.h b/scene/resources/gradient.h index 6518b13ee8..e839909770 100644 --- a/scene/resources/gradient.h +++ b/scene/resources/gradient.h @@ -31,7 +31,7 @@ #ifndef GRADIENT_H #define GRADIENT_H -#include "core/resource.h" +#include "core/io/resource.h" class Gradient : public Resource { GDCLASS(Gradient, Resource); diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index a5f8cdaf88..35c967ce27 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -30,7 +30,7 @@ #include "material.h" -#include "core/engine.h" +#include "core/config/engine.h" #ifdef TOOLS_ENABLED #include "editor/editor_settings.h" @@ -2637,6 +2637,8 @@ BaseMaterial3D::BaseMaterial3D(bool p_orm) : orm = p_orm; // Initialize to the same values as the shader shading_mode = SHADING_MODE_PER_PIXEL; + transparency = TRANSPARENCY_DISABLED; + alpha_antialiasing_mode = ALPHA_ANTIALIASING_OFF; set_albedo(Color(1.0, 1.0, 1.0, 1.0)); set_specular(0.5); set_roughness(1.0); diff --git a/scene/resources/material.h b/scene/resources/material.h index da1808d348..caf28eea18 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -31,8 +31,8 @@ #ifndef MATERIAL_H #define MATERIAL_H -#include "core/resource.h" -#include "core/self_list.h" +#include "core/io/resource.h" +#include "core/templates/self_list.h" #include "scene/resources/shader.h" #include "scene/resources/texture.h" #include "servers/rendering/shader_language.h" diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index e9606e03e6..060846d5b6 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -30,7 +30,7 @@ #include "mesh.h" -#include "core/pair.h" +#include "core/templates/pair.h" #include "scene/resources/concave_polygon_shape_3d.h" #include "scene/resources/convex_polygon_shape_3d.h" #include "surface_tool.h" diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index b0a30a5627..81c18eea2d 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -31,9 +31,9 @@ #ifndef MESH_H #define MESH_H +#include "core/io/resource.h" #include "core/math/face3.h" #include "core/math/triangle_mesh.h" -#include "core/resource.h" #include "scene/resources/material.h" #include "scene/resources/shape_3d.h" #include "servers/rendering_server.h" diff --git a/scene/resources/mesh_library.h b/scene/resources/mesh_library.h index 450e2c16e3..0d5fb3005b 100644 --- a/scene/resources/mesh_library.h +++ b/scene/resources/mesh_library.h @@ -31,8 +31,8 @@ #ifndef MESH_LIBRARY_H #define MESH_LIBRARY_H -#include "core/map.h" -#include "core/resource.h" +#include "core/io/resource.h" +#include "core/templates/map.h" #include "mesh.h" #include "scene/3d/navigation_region_3d.h" #include "shape_3d.h" diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 5e8bfd9387..5ce253f970 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -30,10 +30,10 @@ #include "packed_scene.h" +#include "core/config/engine.h" +#include "core/config/project_settings.h" #include "core/core_string_names.h" -#include "core/engine.h" #include "core/io/resource_loader.h" -#include "core/project_settings.h" #include "scene/2d/node_2d.h" #include "scene/3d/node_3d.h" #include "scene/gui/control.h" diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index 004758afa5..b8b3f84ecc 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -31,7 +31,7 @@ #ifndef PACKED_SCENE_H #define PACKED_SCENE_H -#include "core/resource.h" +#include "core/io/resource.h" #include "scene/main/node.h" class SceneState : public Reference { diff --git a/scene/resources/particles_material.h b/scene/resources/particles_material.h index 7aca708889..12fa53ef29 100644 --- a/scene/resources/particles_material.h +++ b/scene/resources/particles_material.h @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "core/rid.h" +#include "core/templates/rid.h" #include "scene/resources/material.h" #ifndef PARTICLES_MATERIAL_H diff --git a/scene/resources/physics_material.h b/scene/resources/physics_material.h index 34aa7066df..e9222ffa1b 100644 --- a/scene/resources/physics_material.h +++ b/scene/resources/physics_material.h @@ -31,7 +31,7 @@ #ifndef PHYSICS_MATERIAL_H #define PHYSICS_MATERIAL_H -#include "core/resource.h" +#include "core/io/resource.h" #include "servers/physics_server_3d.h" class PhysicsMaterial : public Resource { diff --git a/scene/resources/polygon_path_finder.h b/scene/resources/polygon_path_finder.h index baee4dc20d..44a97b4294 100644 --- a/scene/resources/polygon_path_finder.h +++ b/scene/resources/polygon_path_finder.h @@ -31,7 +31,7 @@ #ifndef POLYGON_PATH_FINDER_H #define POLYGON_PATH_FINDER_H -#include "core/resource.h" +#include "core/io/resource.h" class PolygonPathFinder : public Resource { GDCLASS(PolygonPathFinder, Resource); diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index ba39593690..1d5f29ab14 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -30,9 +30,9 @@ #include "resource_format_text.h" +#include "core/config/project_settings.h" #include "core/io/resource_format_binary.h" #include "core/os/dir_access.h" -#include "core/project_settings.h" #include "core/version.h" //version 2: changed names for basis, aabb, Vectors, etc. diff --git a/scene/resources/resource_format_text.h b/scene/resources/resource_format_text.h index cf522c9364..ca7b0b021f 100644 --- a/scene/resources/resource_format_text.h +++ b/scene/resources/resource_format_text.h @@ -34,7 +34,7 @@ #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/os/file_access.h" -#include "core/variant_parser.h" +#include "core/variant/variant_parser.h" #include "scene/resources/packed_scene.h" class ResourceLoaderText { diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index 92f0353abf..76d37eaa71 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "shader.h" + #include "core/os/file_access.h" #include "scene/scene_string_names.h" #include "servers/rendering/shader_language.h" @@ -80,7 +81,7 @@ void Shader::get_param_list(List<PropertyInfo> *p_params) const { params_cache[pi.name] = E->get().name; if (p_params) { //small little hack - if (pi.type == Variant::_RID) { + if (pi.type == Variant::RID) { pi.type = Variant::OBJECT; } p_params->push_back(pi); diff --git a/scene/resources/shader.h b/scene/resources/shader.h index 7dcec7811a..f2ea582ff0 100644 --- a/scene/resources/shader.h +++ b/scene/resources/shader.h @@ -31,9 +31,9 @@ #ifndef SHADER_H #define SHADER_H +#include "core/io/resource.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" -#include "core/resource.h" #include "scene/resources/texture.h" class Shader : public Resource { diff --git a/scene/resources/shape_2d.h b/scene/resources/shape_2d.h index bb4688a02d..495ffdd38b 100644 --- a/scene/resources/shape_2d.h +++ b/scene/resources/shape_2d.h @@ -31,7 +31,7 @@ #ifndef SHAPE_2D_H #define SHAPE_2D_H -#include "core/resource.h" +#include "core/io/resource.h" class Shape2D : public Resource { GDCLASS(Shape2D, Resource); diff --git a/scene/resources/shape_3d.h b/scene/resources/shape_3d.h index eb9607e3a6..5a9c2e3b9c 100644 --- a/scene/resources/shape_3d.h +++ b/scene/resources/shape_3d.h @@ -31,7 +31,7 @@ #ifndef SHAPE_3D_H #define SHAPE_3D_H -#include "core/resource.h" +#include "core/io/resource.h" class ArrayMesh; diff --git a/scene/resources/skin.h b/scene/resources/skin.h index 57aaf1afd4..e6ed4f1768 100644 --- a/scene/resources/skin.h +++ b/scene/resources/skin.h @@ -31,7 +31,7 @@ #ifndef SKIN_H #define SKIN_H -#include "core/resource.h" +#include "core/io/resource.h" class Skin : public Resource { GDCLASS(Skin, Resource) diff --git a/scene/resources/sky_material.h b/scene/resources/sky_material.h index 5e23020d66..5411994b7d 100644 --- a/scene/resources/sky_material.h +++ b/scene/resources/sky_material.h @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "core/rid.h" +#include "core/templates/rid.h" #include "scene/resources/material.h" #ifndef SKY_MATERIAL_H diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index c5caab1b5a..a1237776c6 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -31,7 +31,7 @@ #ifndef STYLE_BOX_H #define STYLE_BOX_H -#include "core/resource.h" +#include "core/io/resource.h" #include "scene/resources/texture.h" #include "servers/rendering_server.h" diff --git a/scene/resources/syntax_highlighter.cpp b/scene/resources/syntax_highlighter.cpp index e7b49892d8..e3e4373fa9 100644 --- a/scene/resources/syntax_highlighter.cpp +++ b/scene/resources/syntax_highlighter.cpp @@ -30,7 +30,7 @@ #include "syntax_highlighter.h" -#include "core/script_language.h" +#include "core/object/script_language.h" #include "scene/gui/text_edit.h" Dictionary SyntaxHighlighter::get_line_syntax_highlighting(int p_line) { diff --git a/scene/resources/syntax_highlighter.h b/scene/resources/syntax_highlighter.h index 720227a256..62865920d3 100644 --- a/scene/resources/syntax_highlighter.h +++ b/scene/resources/syntax_highlighter.h @@ -31,7 +31,7 @@ #ifndef SYNTAX_HIGHLIGHTER_H #define SYNTAX_HIGHLIGHTER_H -#include "core/resource.h" +#include "core/io/resource.h" class TextEdit; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 39ef6eeafa..07de202cc8 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -498,7 +498,7 @@ Error StreamTexture2D::_load_data(const String &p_path, int &tw, int &th, int &t ERR_FAIL_COND_V(image.is_null(), ERR_INVALID_PARAMETER); FileAccess *f = FileAccess::open(p_path, FileAccess::READ); - ERR_FAIL_COND_V(!f, ERR_CANT_OPEN); + ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, vformat("Unable to open file: %s.", p_path)); uint8_t header[4]; f->get_buffer(header, 4); @@ -893,7 +893,7 @@ Image::Format StreamTexture3D::get_format() const { Error StreamTexture3D::_load_data(const String &p_path, Vector<Ref<Image>> &r_data, Image::Format &r_format, int &r_width, int &r_height, int &r_depth, bool &r_mipmaps) { FileAccessRef f = FileAccess::open(p_path, FileAccess::READ); - ERR_FAIL_COND_V(!f, ERR_CANT_OPEN); + ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, vformat("Unable to open file: %s.", p_path)); uint8_t header[4]; f->get_buffer(header, 4); @@ -2325,7 +2325,7 @@ Error StreamTextureLayered::_load_data(const String &p_path, Vector<Ref<Image>> ERR_FAIL_COND_V(images.size() != 0, ERR_INVALID_PARAMETER); FileAccessRef f = FileAccess::open(p_path, FileAccess::READ); - ERR_FAIL_COND_V(!f, ERR_CANT_OPEN); + ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, vformat("Unable to open file: %s.", p_path)); uint8_t header[4]; f->get_buffer(header, 4); diff --git a/scene/resources/texture.h b/scene/resources/texture.h index fd48afccda..3bc1ca8463 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -31,13 +31,13 @@ #ifndef TEXTURE_H #define TEXTURE_H +#include "core/io/resource.h" #include "core/io/resource_loader.h" #include "core/math/rect2.h" #include "core/os/file_access.h" #include "core/os/mutex.h" #include "core/os/rw_lock.h" #include "core/os/thread_safe.h" -#include "core/resource.h" #include "scene/resources/curve.h" #include "scene/resources/gradient.h" #include "servers/camera_server.h" diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 6a85d357ff..ccff49829e 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -30,17 +30,17 @@ #include "theme.h" #include "core/os/file_access.h" -#include "core/print_string.h" +#include "core/string/print_string.h" void Theme::_emit_theme_changed() { emit_changed(); } -Vector<String> Theme::_get_icon_list(const String &p_type) const { +Vector<String> Theme::_get_icon_list(const String &p_node_type) const { Vector<String> ilret; List<StringName> il; - get_icon_list(p_type, &il); + get_icon_list(p_node_type, &il); ilret.resize(il.size()); int i = 0; @@ -51,11 +51,11 @@ Vector<String> Theme::_get_icon_list(const String &p_type) const { return ilret; } -Vector<String> Theme::_get_stylebox_list(const String &p_type) const { +Vector<String> Theme::_get_stylebox_list(const String &p_node_type) const { Vector<String> ilret; List<StringName> il; - get_stylebox_list(p_type, &il); + get_stylebox_list(p_node_type, &il); ilret.resize(il.size()); int i = 0; @@ -81,11 +81,11 @@ Vector<String> Theme::_get_stylebox_types() const { return ilret; } -Vector<String> Theme::_get_font_list(const String &p_type) const { +Vector<String> Theme::_get_font_list(const String &p_node_type) const { Vector<String> ilret; List<StringName> il; - get_font_list(p_type, &il); + get_font_list(p_node_type, &il); ilret.resize(il.size()); int i = 0; @@ -96,11 +96,11 @@ Vector<String> Theme::_get_font_list(const String &p_type) const { return ilret; } -Vector<String> Theme::_get_color_list(const String &p_type) const { +Vector<String> Theme::_get_color_list(const String &p_node_type) const { Vector<String> ilret; List<StringName> il; - get_color_list(p_type, &il); + get_color_list(p_node_type, &il); ilret.resize(il.size()); int i = 0; @@ -111,11 +111,11 @@ Vector<String> Theme::_get_color_list(const String &p_type) const { return ilret; } -Vector<String> Theme::_get_constant_list(const String &p_type) const { +Vector<String> Theme::_get_constant_list(const String &p_node_type) const { Vector<String> ilret; List<StringName> il; - get_constant_list(p_type, &il); + get_constant_list(p_node_type, &il); ilret.resize(il.size()); int i = 0; @@ -126,7 +126,7 @@ Vector<String> Theme::_get_constant_list(const String &p_type) const { return ilret; } -Vector<String> Theme::_get_type_list(const String &p_type) const { +Vector<String> Theme::_get_type_list(const String &p_node_type) const { Vector<String> ilret; List<StringName> il; @@ -325,19 +325,19 @@ void Theme::set_default_font(const Ref<Font> &p_font) { default_font = p_font; } -void Theme::set_icon(const StringName &p_name, const StringName &p_type, const Ref<Texture2D> &p_icon) { +void Theme::set_icon(const StringName &p_name, const StringName &p_node_type, const Ref<Texture2D> &p_icon) { //ERR_FAIL_COND(p_icon.is_null()); - bool new_value = !icon_map.has(p_type) || !icon_map[p_type].has(p_name); + bool new_value = !icon_map.has(p_node_type) || !icon_map[p_node_type].has(p_name); - if (icon_map[p_type].has(p_name) && icon_map[p_type][p_name].is_valid()) { - icon_map[p_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); + if (icon_map[p_node_type].has(p_name) && icon_map[p_node_type][p_name].is_valid()) { + icon_map[p_node_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); } - icon_map[p_type][p_name] = p_icon; + icon_map[p_node_type][p_name] = p_icon; if (p_icon.is_valid()) { - icon_map[p_type][p_name]->connect("changed", callable_mp(this, &Theme::_emit_theme_changed), varray(), CONNECT_REFERENCE_COUNTED); + icon_map[p_node_type][p_name]->connect("changed", callable_mp(this, &Theme::_emit_theme_changed), varray(), CONNECT_REFERENCE_COUNTED); } if (new_value) { @@ -346,50 +346,50 @@ void Theme::set_icon(const StringName &p_name, const StringName &p_type, const R } } -Ref<Texture2D> Theme::get_icon(const StringName &p_name, const StringName &p_type) const { - if (icon_map.has(p_type) && icon_map[p_type].has(p_name) && icon_map[p_type][p_name].is_valid()) { - return icon_map[p_type][p_name]; +Ref<Texture2D> Theme::get_icon(const StringName &p_name, const StringName &p_node_type) const { + if (icon_map.has(p_node_type) && icon_map[p_node_type].has(p_name) && icon_map[p_node_type][p_name].is_valid()) { + return icon_map[p_node_type][p_name]; } else { return default_icon; } } -bool Theme::has_icon(const StringName &p_name, const StringName &p_type) const { - return (icon_map.has(p_type) && icon_map[p_type].has(p_name) && icon_map[p_type][p_name].is_valid()); +bool Theme::has_icon(const StringName &p_name, const StringName &p_node_type) const { + return (icon_map.has(p_node_type) && icon_map[p_node_type].has(p_name) && icon_map[p_node_type][p_name].is_valid()); } -void Theme::clear_icon(const StringName &p_name, const StringName &p_type) { - ERR_FAIL_COND(!icon_map.has(p_type)); - ERR_FAIL_COND(!icon_map[p_type].has(p_name)); +void Theme::clear_icon(const StringName &p_name, const StringName &p_node_type) { + ERR_FAIL_COND(!icon_map.has(p_node_type)); + ERR_FAIL_COND(!icon_map[p_node_type].has(p_name)); - if (icon_map[p_type][p_name].is_valid()) { - icon_map[p_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); + if (icon_map[p_node_type][p_name].is_valid()) { + icon_map[p_node_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); } - icon_map[p_type].erase(p_name); + icon_map[p_node_type].erase(p_name); _change_notify(); emit_changed(); } -void Theme::get_icon_list(StringName p_type, List<StringName> *p_list) const { +void Theme::get_icon_list(StringName p_node_type, List<StringName> *p_list) const { ERR_FAIL_NULL(p_list); - if (!icon_map.has(p_type)) { + if (!icon_map.has(p_node_type)) { return; } const StringName *key = nullptr; - while ((key = icon_map[p_type].next(key))) { + while ((key = icon_map[p_node_type].next(key))) { p_list->push_back(*key); } } -void Theme::set_shader(const StringName &p_name, const StringName &p_type, const Ref<Shader> &p_shader) { - bool new_value = !shader_map.has(p_type) || !shader_map[p_type].has(p_name); +void Theme::set_shader(const StringName &p_name, const StringName &p_node_type, const Ref<Shader> &p_shader) { + bool new_value = !shader_map.has(p_node_type) || !shader_map[p_node_type].has(p_name); - shader_map[p_type][p_name] = p_shader; + shader_map[p_node_type][p_name] = p_shader; if (new_value) { _change_notify(); @@ -397,54 +397,54 @@ void Theme::set_shader(const StringName &p_name, const StringName &p_type, const } } -Ref<Shader> Theme::get_shader(const StringName &p_name, const StringName &p_type) const { - if (shader_map.has(p_type) && shader_map[p_type].has(p_name) && shader_map[p_type][p_name].is_valid()) { - return shader_map[p_type][p_name]; +Ref<Shader> Theme::get_shader(const StringName &p_name, const StringName &p_node_type) const { + if (shader_map.has(p_node_type) && shader_map[p_node_type].has(p_name) && shader_map[p_node_type][p_name].is_valid()) { + return shader_map[p_node_type][p_name]; } else { return nullptr; } } -bool Theme::has_shader(const StringName &p_name, const StringName &p_type) const { - return (shader_map.has(p_type) && shader_map[p_type].has(p_name) && shader_map[p_type][p_name].is_valid()); +bool Theme::has_shader(const StringName &p_name, const StringName &p_node_type) const { + return (shader_map.has(p_node_type) && shader_map[p_node_type].has(p_name) && shader_map[p_node_type][p_name].is_valid()); } -void Theme::clear_shader(const StringName &p_name, const StringName &p_type) { - ERR_FAIL_COND(!shader_map.has(p_type)); - ERR_FAIL_COND(!shader_map[p_type].has(p_name)); +void Theme::clear_shader(const StringName &p_name, const StringName &p_node_type) { + ERR_FAIL_COND(!shader_map.has(p_node_type)); + ERR_FAIL_COND(!shader_map[p_node_type].has(p_name)); - shader_map[p_type].erase(p_name); + shader_map[p_node_type].erase(p_name); _change_notify(); emit_changed(); } -void Theme::get_shader_list(const StringName &p_type, List<StringName> *p_list) const { +void Theme::get_shader_list(const StringName &p_node_type, List<StringName> *p_list) const { ERR_FAIL_NULL(p_list); - if (!shader_map.has(p_type)) { + if (!shader_map.has(p_node_type)) { return; } const StringName *key = nullptr; - while ((key = shader_map[p_type].next(key))) { + while ((key = shader_map[p_node_type].next(key))) { p_list->push_back(*key); } } -void Theme::set_stylebox(const StringName &p_name, const StringName &p_type, const Ref<StyleBox> &p_style) { +void Theme::set_stylebox(const StringName &p_name, const StringName &p_node_type, const Ref<StyleBox> &p_style) { //ERR_FAIL_COND(p_style.is_null()); - bool new_value = !style_map.has(p_type) || !style_map[p_type].has(p_name); + bool new_value = !style_map.has(p_node_type) || !style_map[p_node_type].has(p_name); - if (style_map[p_type].has(p_name) && style_map[p_type][p_name].is_valid()) { - style_map[p_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); + if (style_map[p_node_type].has(p_name) && style_map[p_node_type][p_name].is_valid()) { + style_map[p_node_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); } - style_map[p_type][p_name] = p_style; + style_map[p_node_type][p_name] = p_style; if (p_style.is_valid()) { - style_map[p_type][p_name]->connect("changed", callable_mp(this, &Theme::_emit_theme_changed), varray(), CONNECT_REFERENCE_COUNTED); + style_map[p_node_type][p_name]->connect("changed", callable_mp(this, &Theme::_emit_theme_changed), varray(), CONNECT_REFERENCE_COUNTED); } if (new_value) { @@ -453,42 +453,42 @@ void Theme::set_stylebox(const StringName &p_name, const StringName &p_type, con emit_changed(); } -Ref<StyleBox> Theme::get_stylebox(const StringName &p_name, const StringName &p_type) const { - if (style_map.has(p_type) && style_map[p_type].has(p_name) && style_map[p_type][p_name].is_valid()) { - return style_map[p_type][p_name]; +Ref<StyleBox> Theme::get_stylebox(const StringName &p_name, const StringName &p_node_type) const { + if (style_map.has(p_node_type) && style_map[p_node_type].has(p_name) && style_map[p_node_type][p_name].is_valid()) { + return style_map[p_node_type][p_name]; } else { return default_style; } } -bool Theme::has_stylebox(const StringName &p_name, const StringName &p_type) const { - return (style_map.has(p_type) && style_map[p_type].has(p_name) && style_map[p_type][p_name].is_valid()); +bool Theme::has_stylebox(const StringName &p_name, const StringName &p_node_type) const { + return (style_map.has(p_node_type) && style_map[p_node_type].has(p_name) && style_map[p_node_type][p_name].is_valid()); } -void Theme::clear_stylebox(const StringName &p_name, const StringName &p_type) { - ERR_FAIL_COND(!style_map.has(p_type)); - ERR_FAIL_COND(!style_map[p_type].has(p_name)); +void Theme::clear_stylebox(const StringName &p_name, const StringName &p_node_type) { + ERR_FAIL_COND(!style_map.has(p_node_type)); + ERR_FAIL_COND(!style_map[p_node_type].has(p_name)); - if (style_map[p_type][p_name].is_valid()) { - style_map[p_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); + if (style_map[p_node_type][p_name].is_valid()) { + style_map[p_node_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); } - style_map[p_type].erase(p_name); + style_map[p_node_type].erase(p_name); _change_notify(); emit_changed(); } -void Theme::get_stylebox_list(StringName p_type, List<StringName> *p_list) const { +void Theme::get_stylebox_list(StringName p_node_type, List<StringName> *p_list) const { ERR_FAIL_NULL(p_list); - if (!style_map.has(p_type)) { + if (!style_map.has(p_node_type)) { return; } const StringName *key = nullptr; - while ((key = style_map[p_type].next(key))) { + while ((key = style_map[p_node_type].next(key))) { p_list->push_back(*key); } } @@ -502,19 +502,19 @@ void Theme::get_stylebox_types(List<StringName> *p_list) const { } } -void Theme::set_font(const StringName &p_name, const StringName &p_type, const Ref<Font> &p_font) { +void Theme::set_font(const StringName &p_name, const StringName &p_node_type, const Ref<Font> &p_font) { //ERR_FAIL_COND(p_font.is_null()); - bool new_value = !font_map.has(p_type) || !font_map[p_type].has(p_name); + bool new_value = !font_map.has(p_node_type) || !font_map[p_node_type].has(p_name); - if (font_map[p_type][p_name].is_valid()) { - font_map[p_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); + if (font_map[p_node_type][p_name].is_valid()) { + font_map[p_node_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); } - font_map[p_type][p_name] = p_font; + font_map[p_node_type][p_name] = p_font; if (p_font.is_valid()) { - font_map[p_type][p_name]->connect("changed", callable_mp(this, &Theme::_emit_theme_changed), varray(), CONNECT_REFERENCE_COUNTED); + font_map[p_node_type][p_name]->connect("changed", callable_mp(this, &Theme::_emit_theme_changed), varray(), CONNECT_REFERENCE_COUNTED); } if (new_value) { @@ -523,9 +523,9 @@ void Theme::set_font(const StringName &p_name, const StringName &p_type, const R } } -Ref<Font> Theme::get_font(const StringName &p_name, const StringName &p_type) const { - if (font_map.has(p_type) && font_map[p_type].has(p_name) && font_map[p_type][p_name].is_valid()) { - return font_map[p_type][p_name]; +Ref<Font> Theme::get_font(const StringName &p_name, const StringName &p_node_type) const { + if (font_map.has(p_node_type) && font_map[p_node_type].has(p_name) && font_map[p_node_type][p_name].is_valid()) { + return font_map[p_node_type][p_name]; } else if (default_theme_font.is_valid()) { return default_theme_font; } else { @@ -533,41 +533,41 @@ Ref<Font> Theme::get_font(const StringName &p_name, const StringName &p_type) co } } -bool Theme::has_font(const StringName &p_name, const StringName &p_type) const { - return (font_map.has(p_type) && font_map[p_type].has(p_name) && font_map[p_type][p_name].is_valid()); +bool Theme::has_font(const StringName &p_name, const StringName &p_node_type) const { + return (font_map.has(p_node_type) && font_map[p_node_type].has(p_name) && font_map[p_node_type][p_name].is_valid()); } -void Theme::clear_font(const StringName &p_name, const StringName &p_type) { - ERR_FAIL_COND(!font_map.has(p_type)); - ERR_FAIL_COND(!font_map[p_type].has(p_name)); +void Theme::clear_font(const StringName &p_name, const StringName &p_node_type) { + ERR_FAIL_COND(!font_map.has(p_node_type)); + ERR_FAIL_COND(!font_map[p_node_type].has(p_name)); - if (font_map[p_type][p_name].is_valid()) { - font_map[p_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); + if (font_map[p_node_type][p_name].is_valid()) { + font_map[p_node_type][p_name]->disconnect("changed", callable_mp(this, &Theme::_emit_theme_changed)); } - font_map[p_type].erase(p_name); + font_map[p_node_type].erase(p_name); _change_notify(); emit_changed(); } -void Theme::get_font_list(StringName p_type, List<StringName> *p_list) const { +void Theme::get_font_list(StringName p_node_type, List<StringName> *p_list) const { ERR_FAIL_NULL(p_list); - if (!font_map.has(p_type)) { + if (!font_map.has(p_node_type)) { return; } const StringName *key = nullptr; - while ((key = font_map[p_type].next(key))) { + while ((key = font_map[p_node_type].next(key))) { p_list->push_back(*key); } } -void Theme::set_color(const StringName &p_name, const StringName &p_type, const Color &p_color) { - bool new_value = !color_map.has(p_type) || !color_map[p_type].has(p_name); +void Theme::set_color(const StringName &p_name, const StringName &p_node_type, const Color &p_color) { + bool new_value = !color_map.has(p_node_type) || !color_map[p_node_type].has(p_name); - color_map[p_type][p_name] = p_color; + color_map[p_node_type][p_name] = p_color; if (new_value) { _change_notify(); @@ -575,44 +575,44 @@ void Theme::set_color(const StringName &p_name, const StringName &p_type, const } } -Color Theme::get_color(const StringName &p_name, const StringName &p_type) const { - if (color_map.has(p_type) && color_map[p_type].has(p_name)) { - return color_map[p_type][p_name]; +Color Theme::get_color(const StringName &p_name, const StringName &p_node_type) const { + if (color_map.has(p_node_type) && color_map[p_node_type].has(p_name)) { + return color_map[p_node_type][p_name]; } else { return Color(); } } -bool Theme::has_color(const StringName &p_name, const StringName &p_type) const { - return (color_map.has(p_type) && color_map[p_type].has(p_name)); +bool Theme::has_color(const StringName &p_name, const StringName &p_node_type) const { + return (color_map.has(p_node_type) && color_map[p_node_type].has(p_name)); } -void Theme::clear_color(const StringName &p_name, const StringName &p_type) { - ERR_FAIL_COND(!color_map.has(p_type)); - ERR_FAIL_COND(!color_map[p_type].has(p_name)); +void Theme::clear_color(const StringName &p_name, const StringName &p_node_type) { + ERR_FAIL_COND(!color_map.has(p_node_type)); + ERR_FAIL_COND(!color_map[p_node_type].has(p_name)); - color_map[p_type].erase(p_name); + color_map[p_node_type].erase(p_name); _change_notify(); emit_changed(); } -void Theme::get_color_list(StringName p_type, List<StringName> *p_list) const { +void Theme::get_color_list(StringName p_node_type, List<StringName> *p_list) const { ERR_FAIL_NULL(p_list); - if (!color_map.has(p_type)) { + if (!color_map.has(p_node_type)) { return; } const StringName *key = nullptr; - while ((key = color_map[p_type].next(key))) { + while ((key = color_map[p_node_type].next(key))) { p_list->push_back(*key); } } -void Theme::set_constant(const StringName &p_name, const StringName &p_type, int p_constant) { - bool new_value = !constant_map.has(p_type) || !constant_map[p_type].has(p_name); - constant_map[p_type][p_name] = p_constant; +void Theme::set_constant(const StringName &p_name, const StringName &p_node_type, int p_constant) { + bool new_value = !constant_map.has(p_node_type) || !constant_map[p_node_type].has(p_name); + constant_map[p_node_type][p_name] = p_constant; if (new_value) { _change_notify(); @@ -620,37 +620,37 @@ void Theme::set_constant(const StringName &p_name, const StringName &p_type, int } } -int Theme::get_constant(const StringName &p_name, const StringName &p_type) const { - if (constant_map.has(p_type) && constant_map[p_type].has(p_name)) { - return constant_map[p_type][p_name]; +int Theme::get_constant(const StringName &p_name, const StringName &p_node_type) const { + if (constant_map.has(p_node_type) && constant_map[p_node_type].has(p_name)) { + return constant_map[p_node_type][p_name]; } else { return 0; } } -bool Theme::has_constant(const StringName &p_name, const StringName &p_type) const { - return (constant_map.has(p_type) && constant_map[p_type].has(p_name)); +bool Theme::has_constant(const StringName &p_name, const StringName &p_node_type) const { + return (constant_map.has(p_node_type) && constant_map[p_node_type].has(p_name)); } -void Theme::clear_constant(const StringName &p_name, const StringName &p_type) { - ERR_FAIL_COND(!constant_map.has(p_type)); - ERR_FAIL_COND(!constant_map[p_type].has(p_name)); +void Theme::clear_constant(const StringName &p_name, const StringName &p_node_type) { + ERR_FAIL_COND(!constant_map.has(p_node_type)); + ERR_FAIL_COND(!constant_map[p_node_type].has(p_name)); - constant_map[p_type].erase(p_name); + constant_map[p_node_type].erase(p_name); _change_notify(); emit_changed(); } -void Theme::get_constant_list(StringName p_type, List<StringName> *p_list) const { +void Theme::get_constant_list(StringName p_node_type, List<StringName> *p_list) const { ERR_FAIL_NULL(p_list); - if (!constant_map.has(p_type)) { + if (!constant_map.has(p_node_type)) { return; } const StringName *key = nullptr; - while ((key = constant_map[p_type].next(key))) { + while ((key = constant_map[p_node_type].next(key))) { p_list->push_back(*key); } } @@ -800,43 +800,43 @@ void Theme::get_type_list(List<StringName> *p_list) const { } void Theme::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_icon", "name", "type", "texture"), &Theme::set_icon); - ClassDB::bind_method(D_METHOD("get_icon", "name", "type"), &Theme::get_icon); - ClassDB::bind_method(D_METHOD("has_icon", "name", "type"), &Theme::has_icon); - ClassDB::bind_method(D_METHOD("clear_icon", "name", "type"), &Theme::clear_icon); - ClassDB::bind_method(D_METHOD("get_icon_list", "type"), &Theme::_get_icon_list); - - ClassDB::bind_method(D_METHOD("set_stylebox", "name", "type", "texture"), &Theme::set_stylebox); - ClassDB::bind_method(D_METHOD("get_stylebox", "name", "type"), &Theme::get_stylebox); - ClassDB::bind_method(D_METHOD("has_stylebox", "name", "type"), &Theme::has_stylebox); - ClassDB::bind_method(D_METHOD("clear_stylebox", "name", "type"), &Theme::clear_stylebox); - ClassDB::bind_method(D_METHOD("get_stylebox_list", "type"), &Theme::_get_stylebox_list); + ClassDB::bind_method(D_METHOD("set_icon", "name", "node_type", "texture"), &Theme::set_icon); + ClassDB::bind_method(D_METHOD("get_icon", "name", "node_type"), &Theme::get_icon); + ClassDB::bind_method(D_METHOD("has_icon", "name", "node_type"), &Theme::has_icon); + ClassDB::bind_method(D_METHOD("clear_icon", "name", "node_type"), &Theme::clear_icon); + ClassDB::bind_method(D_METHOD("get_icon_list", "node_type"), &Theme::_get_icon_list); + + ClassDB::bind_method(D_METHOD("set_stylebox", "name", "node_type", "texture"), &Theme::set_stylebox); + ClassDB::bind_method(D_METHOD("get_stylebox", "name", "node_type"), &Theme::get_stylebox); + ClassDB::bind_method(D_METHOD("has_stylebox", "name", "node_type"), &Theme::has_stylebox); + ClassDB::bind_method(D_METHOD("clear_stylebox", "name", "node_type"), &Theme::clear_stylebox); + ClassDB::bind_method(D_METHOD("get_stylebox_list", "node_type"), &Theme::_get_stylebox_list); ClassDB::bind_method(D_METHOD("get_stylebox_types"), &Theme::_get_stylebox_types); - ClassDB::bind_method(D_METHOD("set_font", "name", "type", "font"), &Theme::set_font); - ClassDB::bind_method(D_METHOD("get_font", "name", "type"), &Theme::get_font); - ClassDB::bind_method(D_METHOD("has_font", "name", "type"), &Theme::has_font); - ClassDB::bind_method(D_METHOD("clear_font", "name", "type"), &Theme::clear_font); - ClassDB::bind_method(D_METHOD("get_font_list", "type"), &Theme::_get_font_list); + ClassDB::bind_method(D_METHOD("set_font", "name", "node_type", "font"), &Theme::set_font); + ClassDB::bind_method(D_METHOD("get_font", "name", "node_type"), &Theme::get_font); + ClassDB::bind_method(D_METHOD("has_font", "name", "node_type"), &Theme::has_font); + ClassDB::bind_method(D_METHOD("clear_font", "name", "node_type"), &Theme::clear_font); + ClassDB::bind_method(D_METHOD("get_font_list", "node_type"), &Theme::_get_font_list); - ClassDB::bind_method(D_METHOD("set_color", "name", "type", "color"), &Theme::set_color); - ClassDB::bind_method(D_METHOD("get_color", "name", "type"), &Theme::get_color); - ClassDB::bind_method(D_METHOD("has_color", "name", "type"), &Theme::has_color); - ClassDB::bind_method(D_METHOD("clear_color", "name", "type"), &Theme::clear_color); - ClassDB::bind_method(D_METHOD("get_color_list", "type"), &Theme::_get_color_list); + ClassDB::bind_method(D_METHOD("set_color", "name", "node_type", "color"), &Theme::set_color); + ClassDB::bind_method(D_METHOD("get_color", "name", "node_type"), &Theme::get_color); + ClassDB::bind_method(D_METHOD("has_color", "name", "node_type"), &Theme::has_color); + ClassDB::bind_method(D_METHOD("clear_color", "name", "node_type"), &Theme::clear_color); + ClassDB::bind_method(D_METHOD("get_color_list", "node_type"), &Theme::_get_color_list); - ClassDB::bind_method(D_METHOD("set_constant", "name", "type", "constant"), &Theme::set_constant); - ClassDB::bind_method(D_METHOD("get_constant", "name", "type"), &Theme::get_constant); - ClassDB::bind_method(D_METHOD("has_constant", "name", "type"), &Theme::has_constant); - ClassDB::bind_method(D_METHOD("clear_constant", "name", "type"), &Theme::clear_constant); - ClassDB::bind_method(D_METHOD("get_constant_list", "type"), &Theme::_get_constant_list); + ClassDB::bind_method(D_METHOD("set_constant", "name", "node_type", "constant"), &Theme::set_constant); + ClassDB::bind_method(D_METHOD("get_constant", "name", "node_type"), &Theme::get_constant); + ClassDB::bind_method(D_METHOD("has_constant", "name", "node_type"), &Theme::has_constant); + ClassDB::bind_method(D_METHOD("clear_constant", "name", "node_type"), &Theme::clear_constant); + ClassDB::bind_method(D_METHOD("get_constant_list", "node_type"), &Theme::_get_constant_list); ClassDB::bind_method(D_METHOD("clear"), &Theme::clear); ClassDB::bind_method(D_METHOD("set_default_font", "font"), &Theme::set_default_theme_font); ClassDB::bind_method(D_METHOD("get_default_font"), &Theme::get_default_theme_font); - ClassDB::bind_method(D_METHOD("get_type_list", "type"), &Theme::_get_type_list); + ClassDB::bind_method(D_METHOD("get_type_list", "node_type"), &Theme::_get_type_list); ClassDB::bind_method("copy_default_theme", &Theme::copy_default_theme); ClassDB::bind_method(D_METHOD("copy_theme", "other"), &Theme::copy_theme); diff --git a/scene/resources/theme.h b/scene/resources/theme.h index 3c72ddd8a2..9c17a69e5d 100644 --- a/scene/resources/theme.h +++ b/scene/resources/theme.h @@ -31,8 +31,8 @@ #ifndef THEME_H #define THEME_H +#include "core/io/resource.h" #include "core/io/resource_loader.h" -#include "core/resource.h" #include "scene/resources/font.h" #include "scene/resources/shader.h" #include "scene/resources/style_box.h" @@ -51,13 +51,13 @@ class Theme : public Resource { HashMap<StringName, HashMap<StringName, Color>> color_map; HashMap<StringName, HashMap<StringName, int>> constant_map; - Vector<String> _get_icon_list(const String &p_type) const; - Vector<String> _get_stylebox_list(const String &p_type) const; + Vector<String> _get_icon_list(const String &p_node_type) const; + Vector<String> _get_stylebox_list(const String &p_node_type) const; Vector<String> _get_stylebox_types() const; - Vector<String> _get_font_list(const String &p_type) const; - Vector<String> _get_color_list(const String &p_type) const; - Vector<String> _get_constant_list(const String &p_type) const; - Vector<String> _get_type_list(const String &p_type) const; + Vector<String> _get_font_list(const String &p_node_type) const; + Vector<String> _get_color_list(const String &p_node_type) const; + Vector<String> _get_constant_list(const String &p_node_type) const; + Vector<String> _get_type_list(const String &p_node_type) const; protected: bool _set(const StringName &p_name, const Variant &p_value); @@ -88,42 +88,42 @@ public: void set_default_theme_font(const Ref<Font> &p_default_font); Ref<Font> get_default_theme_font() const; - void set_icon(const StringName &p_name, const StringName &p_type, const Ref<Texture2D> &p_icon); - Ref<Texture2D> get_icon(const StringName &p_name, const StringName &p_type) const; - bool has_icon(const StringName &p_name, const StringName &p_type) const; - void clear_icon(const StringName &p_name, const StringName &p_type); - void get_icon_list(StringName p_type, List<StringName> *p_list) const; - - void set_shader(const StringName &p_name, const StringName &p_type, const Ref<Shader> &p_shader); - Ref<Shader> get_shader(const StringName &p_name, const StringName &p_type) const; - bool has_shader(const StringName &p_name, const StringName &p_type) const; - void clear_shader(const StringName &p_name, const StringName &p_type); - void get_shader_list(const StringName &p_type, List<StringName> *p_list) const; - - void set_stylebox(const StringName &p_name, const StringName &p_type, const Ref<StyleBox> &p_style); - Ref<StyleBox> get_stylebox(const StringName &p_name, const StringName &p_type) const; - bool has_stylebox(const StringName &p_name, const StringName &p_type) const; - void clear_stylebox(const StringName &p_name, const StringName &p_type); - void get_stylebox_list(StringName p_type, List<StringName> *p_list) const; + void set_icon(const StringName &p_name, const StringName &p_node_type, const Ref<Texture2D> &p_icon); + Ref<Texture2D> get_icon(const StringName &p_name, const StringName &p_node_type) const; + bool has_icon(const StringName &p_name, const StringName &p_node_type) const; + void clear_icon(const StringName &p_name, const StringName &p_node_type); + void get_icon_list(StringName p_node_type, List<StringName> *p_list) const; + + void set_shader(const StringName &p_name, const StringName &p_node_type, const Ref<Shader> &p_shader); + Ref<Shader> get_shader(const StringName &p_name, const StringName &p_node_type) const; + bool has_shader(const StringName &p_name, const StringName &p_node_type) const; + void clear_shader(const StringName &p_name, const StringName &p_node_type); + void get_shader_list(const StringName &p_node_type, List<StringName> *p_list) const; + + void set_stylebox(const StringName &p_name, const StringName &p_node_type, const Ref<StyleBox> &p_style); + Ref<StyleBox> get_stylebox(const StringName &p_name, const StringName &p_node_type) const; + bool has_stylebox(const StringName &p_name, const StringName &p_node_type) const; + void clear_stylebox(const StringName &p_name, const StringName &p_node_type); + void get_stylebox_list(StringName p_node_type, List<StringName> *p_list) const; void get_stylebox_types(List<StringName> *p_list) const; - void set_font(const StringName &p_name, const StringName &p_type, const Ref<Font> &p_font); - Ref<Font> get_font(const StringName &p_name, const StringName &p_type) const; - bool has_font(const StringName &p_name, const StringName &p_type) const; - void clear_font(const StringName &p_name, const StringName &p_type); - void get_font_list(StringName p_type, List<StringName> *p_list) const; - - void set_color(const StringName &p_name, const StringName &p_type, const Color &p_color); - Color get_color(const StringName &p_name, const StringName &p_type) const; - bool has_color(const StringName &p_name, const StringName &p_type) const; - void clear_color(const StringName &p_name, const StringName &p_type); - void get_color_list(StringName p_type, List<StringName> *p_list) const; - - void set_constant(const StringName &p_name, const StringName &p_type, int p_constant); - int get_constant(const StringName &p_name, const StringName &p_type) const; - bool has_constant(const StringName &p_name, const StringName &p_type) const; - void clear_constant(const StringName &p_name, const StringName &p_type); - void get_constant_list(StringName p_type, List<StringName> *p_list) const; + void set_font(const StringName &p_name, const StringName &p_node_type, const Ref<Font> &p_font); + Ref<Font> get_font(const StringName &p_name, const StringName &p_node_type) const; + bool has_font(const StringName &p_name, const StringName &p_node_type) const; + void clear_font(const StringName &p_name, const StringName &p_node_type); + void get_font_list(StringName p_node_type, List<StringName> *p_list) const; + + void set_color(const StringName &p_name, const StringName &p_node_type, const Color &p_color); + Color get_color(const StringName &p_name, const StringName &p_node_type) const; + bool has_color(const StringName &p_name, const StringName &p_node_type) const; + void clear_color(const StringName &p_name, const StringName &p_node_type); + void get_color_list(StringName p_node_type, List<StringName> *p_list) const; + + void set_constant(const StringName &p_name, const StringName &p_node_type, int p_constant); + int get_constant(const StringName &p_name, const StringName &p_node_type) const; + bool has_constant(const StringName &p_name, const StringName &p_node_type) const; + void clear_constant(const StringName &p_name, const StringName &p_node_type); + void get_constant_list(StringName p_node_type, List<StringName> *p_list) const; void get_type_list(List<StringName> *p_list) const; diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index dcd8f11400..4581763e9c 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -30,9 +30,9 @@ #include "tile_set.h" -#include "core/array.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "core/math/geometry_2d.h" +#include "core/variant/array.h" bool TileSet::_set(const StringName &p_name, const Variant &p_value) { String n = p_name; diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index aab428aa21..79f1b4aa95 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -31,8 +31,8 @@ #ifndef TILE_SET_H #define TILE_SET_H -#include "core/array.h" -#include "core/resource.h" +#include "core/io/resource.h" +#include "core/variant/array.h" #include "scene/2d/light_occluder_2d.h" #include "scene/2d/navigation_region_2d.h" #include "scene/resources/convex_polygon_shape_2d.h" diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index ac68b6a079..141d4b09f5 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -30,7 +30,7 @@ #include "visual_shader.h" -#include "core/vmap.h" +#include "core/templates/vmap.h" #include "servers/rendering/shader_types.h" #include "visual_shader_nodes.h" diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h index e3d8dae032..41c4642ee3 100644 --- a/scene/resources/visual_shader.h +++ b/scene/resources/visual_shader.h @@ -31,7 +31,7 @@ #ifndef VISUAL_SHADER_H #define VISUAL_SHADER_H -#include "core/string_builder.h" +#include "core/string/string_builder.h" #include "scene/gui/control.h" #include "scene/resources/shader.h" diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index d2bc2bea31..41d3fe20be 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -30,7 +30,7 @@ #include "world_2d.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "scene/2d/camera_2d.h" #include "scene/2d/visibility_notifier_2d.h" #include "scene/main/window.h" @@ -341,8 +341,8 @@ void World2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_direct_space_state"), &World2D::get_direct_space_state); - ADD_PROPERTY(PropertyInfo(Variant::_RID, "canvas", PROPERTY_HINT_NONE, "", 0), "", "get_canvas"); - ADD_PROPERTY(PropertyInfo(Variant::_RID, "space", PROPERTY_HINT_NONE, "", 0), "", "get_space"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "canvas", PROPERTY_HINT_NONE, "", 0), "", "get_canvas"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "space", PROPERTY_HINT_NONE, "", 0), "", "get_space"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "direct_space_state", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsDirectSpaceState2D", 0), "", "get_direct_space_state"); } diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h index c330719104..11614f9aa4 100644 --- a/scene/resources/world_2d.h +++ b/scene/resources/world_2d.h @@ -31,8 +31,8 @@ #ifndef WORLD_2D_H #define WORLD_2D_H -#include "core/project_settings.h" -#include "core/resource.h" +#include "core/config/project_settings.h" +#include "core/io/resource.h" #include "servers/physics_server_2d.h" class VisibilityNotifier2D; diff --git a/scene/resources/world_3d.cpp b/scene/resources/world_3d.cpp index 8100f150ef..b8fb3825ce 100644 --- a/scene/resources/world_3d.cpp +++ b/scene/resources/world_3d.cpp @@ -321,8 +321,8 @@ void World3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "fallback_environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_fallback_environment", "get_fallback_environment"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "camera_effects", PROPERTY_HINT_RESOURCE_TYPE, "CameraEffects"), "set_camera_effects", "get_camera_effects"); - ADD_PROPERTY(PropertyInfo(Variant::_RID, "space", PROPERTY_HINT_NONE, "", 0), "", "get_space"); - ADD_PROPERTY(PropertyInfo(Variant::_RID, "scenario", PROPERTY_HINT_NONE, "", 0), "", "get_scenario"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "space", PROPERTY_HINT_NONE, "", 0), "", "get_space"); + ADD_PROPERTY(PropertyInfo(Variant::RID, "scenario", PROPERTY_HINT_NONE, "", 0), "", "get_scenario"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "direct_space_state", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsDirectSpaceState3D", 0), "", "get_direct_space_state"); } diff --git a/scene/resources/world_3d.h b/scene/resources/world_3d.h index 02a821637f..93e9c72e59 100644 --- a/scene/resources/world_3d.h +++ b/scene/resources/world_3d.h @@ -31,7 +31,7 @@ #ifndef WORLD_3D_H #define WORLD_3D_H -#include "core/resource.h" +#include "core/io/resource.h" #include "scene/resources/camera_effects.h" #include "scene/resources/environment.h" #include "servers/physics_server_3d.h" diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index 1ae244492e..b1168c84b9 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -31,8 +31,8 @@ #ifndef SCENE_STRING_NAMES_H #define SCENE_STRING_NAMES_H -#include "core/node_path.h" -#include "core/string_name.h" +#include "core/string/node_path.h" +#include "core/string/string_name.h" class SceneStringNames { friend void register_scene_types(); |