diff options
100 files changed, 1612 insertions, 441 deletions
diff --git a/core/math/SCsub b/core/math/SCsub index aa98c34f79..0995298a4b 100644 --- a/core/math/SCsub +++ b/core/math/SCsub @@ -22,7 +22,7 @@ if not has_module: env_thirdparty = env_math.Clone() env_thirdparty.disable_warnings() # Custom config file - env_thirdparty.Append(CPPDEFINES=[('MBEDTLS_CONFIG_FILE', "thirdparty/mbedtls/include/godot_core_mbedtls_config.h")]) + env_thirdparty.Append(CPPDEFINES=[('MBEDTLS_CONFIG_FILE', '\\"thirdparty/mbedtls/include/godot_core_mbedtls_config.h\\"')]) thirdparty_mbedtls_dir = "#thirdparty/mbedtls/library/" thirdparty_mbedtls_sources = [ "aes.c", diff --git a/core/ustring.cpp b/core/ustring.cpp index 706e8a3cc1..75e3b6f22e 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3338,7 +3338,7 @@ String String::http_unescape() const { if ((ord1 >= '0' && ord1 <= '9') || (ord1 >= 'A' && ord1 <= 'Z')) { CharType ord2 = ord_at(i + 2); if ((ord2 >= '0' && ord2 <= '9') || (ord2 >= 'A' && ord2 <= 'Z')) { - char bytes[2] = { (char)ord1, (char)ord2 }; + char bytes[3] = { (char)ord1, (char)ord2, 0 }; res += (char)strtol(bytes, NULL, 16); i += 2; } diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml index 4d2a11578f..82839b6bab 100644 --- a/doc/classes/AnimationNodeTransition.xml +++ b/doc/classes/AnimationNodeTransition.xml @@ -7,6 +7,42 @@ <tutorials> </tutorials> <methods> + <method name="get_input_caption" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="input" type="int"> + </argument> + <description> + </description> + </method> + <method name="is_input_set_as_auto_advance" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="input" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_input_as_auto_advance"> + <return type="void"> + </return> + <argument index="0" name="input" type="int"> + </argument> + <argument index="1" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_input_caption"> + <return type="void"> + </return> + <argument index="0" name="input" type="int"> + </argument> + <argument index="1" name="caption" type="String"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="input_0/auto_advance" type="bool" setter="set_input_as_auto_advance" getter="is_input_set_as_auto_advance"> diff --git a/doc/classes/AudioEffectChorus.xml b/doc/classes/AudioEffectChorus.xml index 13bc6ac097..4da125ba63 100644 --- a/doc/classes/AudioEffectChorus.xml +++ b/doc/classes/AudioEffectChorus.xml @@ -9,6 +9,114 @@ <tutorials> </tutorials> <methods> + <method name="get_voice_cutoff_hz" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_voice_delay_ms" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_voice_depth_ms" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_voice_level_db" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_voice_pan" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_voice_rate_hz" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_voice_cutoff_hz"> + <return type="void"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <argument index="1" name="cutoff_hz" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_voice_delay_ms"> + <return type="void"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <argument index="1" name="delay_ms" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_voice_depth_ms"> + <return type="void"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <argument index="1" name="depth_ms" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_voice_level_db"> + <return type="void"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <argument index="1" name="level_db" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_voice_pan"> + <return type="void"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <argument index="1" name="pan" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_voice_rate_hz"> + <return type="void"> + </return> + <argument index="0" name="voice_idx" type="int"> + </argument> + <argument index="1" name="rate_hz" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="dry" type="float" setter="set_dry" getter="get_dry" default="1.0"> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 3d8730b588..f92cf8fabc 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -45,11 +45,11 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> </theme_item> - <theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> </theme_item> diff --git a/doc/classes/CPUParticles.xml b/doc/classes/CPUParticles.xml index 8152a52c86..12e00be04a 100644 --- a/doc/classes/CPUParticles.xml +++ b/doc/classes/CPUParticles.xml @@ -19,6 +19,38 @@ Sets this node's properties to match a given [Particles] node with an assigned [ParticlesMaterial]. </description> </method> + <method name="get_param" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles.Parameter"> + </argument> + <description> + </description> + </method> + <method name="get_param_curve" qualifiers="const"> + <return type="Curve"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles.Parameter"> + </argument> + <description> + </description> + </method> + <method name="get_param_randomness" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles.Parameter"> + </argument> + <description> + </description> + </method> + <method name="get_particle_flag" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="flag" type="int" enum="CPUParticles.Flags"> + </argument> + <description> + </description> + </method> <method name="restart"> <return type="void"> </return> @@ -26,6 +58,46 @@ Restarts the particle emitter. </description> </method> + <method name="set_param"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles.Parameter"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_param_curve"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles.Parameter"> + </argument> + <argument index="1" name="curve" type="Curve"> + </argument> + <description> + </description> + </method> + <method name="set_param_randomness"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles.Parameter"> + </argument> + <argument index="1" name="randomness" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_particle_flag"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="CPUParticles.Flags"> + </argument> + <argument index="1" name="enable" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="amount" type="int" setter="set_amount" getter="get_amount" default="8"> diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index 585b8b5f5b..7380014b96 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -20,6 +20,38 @@ Sets this node's properties to match a given [Particles2D] node with an assigned [ParticlesMaterial]. </description> </method> + <method name="get_param" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter"> + </argument> + <description> + </description> + </method> + <method name="get_param_curve" qualifiers="const"> + <return type="Curve"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter"> + </argument> + <description> + </description> + </method> + <method name="get_param_randomness" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter"> + </argument> + <description> + </description> + </method> + <method name="get_particle_flag" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="flag" type="int" enum="CPUParticles2D.Flags"> + </argument> + <description> + </description> + </method> <method name="restart"> <return type="void"> </return> @@ -27,6 +59,46 @@ Restarts the particle emitter. </description> </method> + <method name="set_param"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_param_curve"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter"> + </argument> + <argument index="1" name="curve" type="Curve"> + </argument> + <description> + </description> + </method> + <method name="set_param_randomness"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="CPUParticles2D.Parameter"> + </argument> + <argument index="1" name="randomness" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_particle_flag"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="CPUParticles2D.Flags"> + </argument> + <argument index="1" name="enable" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="amount" type="int" setter="set_amount" getter="get_amount" default="8"> diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index e9a9f22e82..750b6851b6 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -45,6 +45,22 @@ Returns the location of the [Camera2D]'s screen-center, relative to the origin. </description> </method> + <method name="get_drag_margin" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> + <method name="get_limit" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> <method name="make_current"> <return type="void"> </return> @@ -60,6 +76,26 @@ This has no effect if smoothing is disabled. </description> </method> + <method name="set_drag_margin"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="drag_margin" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_limit"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="limit" type="int"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="anchor_mode" type="int" setter="set_anchor_mode" getter="get_anchor_mode" enum="Camera2D.AnchorMode" default="1"> diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 5583775f95..80b5e90717 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -23,11 +23,11 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> </theme_item> - <theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="font_color_hover_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> </theme_item> diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index daed9128a9..f4d0e0657b 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -21,11 +21,11 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> </theme_item> - <theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="font_color_hover_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> </theme_item> diff --git a/doc/classes/ConeTwistJoint.xml b/doc/classes/ConeTwistJoint.xml index ad9c2b3a35..4c95a4bef9 100644 --- a/doc/classes/ConeTwistJoint.xml +++ b/doc/classes/ConeTwistJoint.xml @@ -11,6 +11,24 @@ <tutorials> </tutorials> <methods> + <method name="get_param" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="ConeTwistJoint.Param"> + </argument> + <description> + </description> + </method> + <method name="set_param"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="ConeTwistJoint.Param"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="bias" type="float" setter="set_param" getter="get_param" default="0.3"> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index d25c2b31ee..8ca0bb0b9b 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -173,6 +173,14 @@ The methods [method can_drop_data] and [method drop_data] must be implemented on controls that want to receive drop data. </description> </method> + <method name="get_anchor" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> <method name="get_begin" qualifiers="const"> <return type="Vector2"> </return> @@ -240,6 +248,14 @@ Returns [member margin_right] and [member margin_bottom]. </description> </method> + <method name="get_focus_neighbour" qualifiers="const"> + <return type="NodePath"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> <method name="get_focus_owner" qualifiers="const"> <return type="Control"> </return> @@ -274,6 +290,14 @@ <description> </description> </method> + <method name="get_margin" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> <method name="get_minimum_size" qualifiers="const"> <return type="Vector2"> </return> @@ -574,6 +598,16 @@ Sets [member margin_right] and [member margin_bottom] at the same time. </description> </method> + <method name="set_focus_neighbour"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="neighbour" type="NodePath"> + </argument> + <description> + </description> + </method> <method name="set_global_position"> <return type="void"> </return> @@ -584,6 +618,16 @@ <description> </description> </method> + <method name="set_margin"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="offset" type="float"> + </argument> + <description> + </description> + </method> <method name="set_margins_preset"> <return type="void"> </return> diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml index b7710068a6..ac707d09bc 100644 --- a/doc/classes/DynamicFont.xml +++ b/doc/classes/DynamicFont.xml @@ -40,6 +40,14 @@ Returns the number of fallback fonts. </description> </method> + <method name="get_spacing" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="type" type="int"> + </argument> + <description> + </description> + </method> <method name="remove_fallback"> <return type="void"> </return> @@ -60,6 +68,16 @@ Sets the fallback font at index [code]idx[/code]. </description> </method> + <method name="set_spacing"> + <return type="void"> + </return> + <argument index="0" name="type" type="int"> + </argument> + <argument index="1" name="value" type="int"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="extra_spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0"> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 9df8ae1aa5..613c5b6563 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -15,6 +15,24 @@ <link>https://docs.godotengine.org/en/latest/tutorials/3d/high_dynamic_range.html</link> </tutorials> <methods> + <method name="is_glow_level_enabled" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_glow_level"> + <return type="void"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <argument index="1" name="enabled" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="adjustment_brightness" type="float" setter="set_adjustment_brightness" getter="get_adjustment_brightness" default="1.0"> diff --git a/doc/classes/Generic6DOFJoint.xml b/doc/classes/Generic6DOFJoint.xml index 91a1cb1cd4..bc34f3ac0d 100644 --- a/doc/classes/Generic6DOFJoint.xml +++ b/doc/classes/Generic6DOFJoint.xml @@ -9,6 +9,114 @@ <tutorials> </tutorials> <methods> + <method name="get_flag_x" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> + </argument> + <description> + </description> + </method> + <method name="get_flag_y" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> + </argument> + <description> + </description> + </method> + <method name="get_flag_z" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> + </argument> + <description> + </description> + </method> + <method name="get_param_x" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> + </argument> + <description> + </description> + </method> + <method name="get_param_y" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> + </argument> + <description> + </description> + </method> + <method name="get_param_z" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> + </argument> + <description> + </description> + </method> + <method name="set_flag_x"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> + </argument> + <argument index="1" name="value" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_flag_y"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> + </argument> + <argument index="1" name="value" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_flag_z"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> + </argument> + <argument index="1" name="value" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_param_x"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_param_y"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_param_z"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="angular_limit_x/damping" type="float" setter="set_param_x" getter="get_param_x" default="1.0"> diff --git a/doc/classes/GeometryInstance.xml b/doc/classes/GeometryInstance.xml index eb1847a055..49c1ce480f 100644 --- a/doc/classes/GeometryInstance.xml +++ b/doc/classes/GeometryInstance.xml @@ -9,6 +9,14 @@ <tutorials> </tutorials> <methods> + <method name="get_flag" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="flag" type="int" enum="GeometryInstance.Flags"> + </argument> + <description> + </description> + </method> <method name="set_custom_aabb"> <return type="void"> </return> @@ -18,6 +26,16 @@ Overrides the bounding box of this node with a custom one. To remove it, set an [AABB] with all fields set to zero. </description> </method> + <method name="set_flag"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="GeometryInstance.Flags"> + </argument> + <argument index="1" name="value" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="cast_shadow" type="int" setter="set_cast_shadows_setting" getter="get_cast_shadows_setting" enum="GeometryInstance.ShadowCastingSetting" default="1"> diff --git a/doc/classes/HingeJoint.xml b/doc/classes/HingeJoint.xml index 0ac67be96c..4582e36da6 100644 --- a/doc/classes/HingeJoint.xml +++ b/doc/classes/HingeJoint.xml @@ -9,6 +9,42 @@ <tutorials> </tutorials> <methods> + <method name="get_flag" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="flag" type="int" enum="HingeJoint.Flag"> + </argument> + <description> + </description> + </method> + <method name="get_param" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="HingeJoint.Param"> + </argument> + <description> + </description> + </method> + <method name="set_flag"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="HingeJoint.Flag"> + </argument> + <argument index="1" name="enabled" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_param"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="HingeJoint.Param"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="angular_limit/bias" type="float" setter="set_param" getter="get_param" default="0.3"> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index 95c0e663ce..8515d1063d 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -505,7 +505,7 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.627451, 0.627451, 0.627451, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.63, 0.63, 0.63, 1 )"> </theme_item> <theme_item name="font_color_selected" type="Color" default="Color( 1, 1, 1, 1 )"> </theme_item> diff --git a/doc/classes/KinematicBody.xml b/doc/classes/KinematicBody.xml index b4e6b0abab..b7c4200b95 100644 --- a/doc/classes/KinematicBody.xml +++ b/doc/classes/KinematicBody.xml @@ -12,6 +12,14 @@ <link>https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link> </tutorials> <methods> + <method name="get_axis_lock" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="axis" type="int" enum="PhysicsServer.BodyAxis"> + </argument> + <description> + </description> + </method> <method name="get_floor_velocity" qualifiers="const"> <return type="Vector3"> </return> @@ -120,6 +128,16 @@ As long as the [code]snap[/code] vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting[code]snap[/code] to[code](0, 0, 0)[/code] or by using [method move_and_slide] instead. </description> </method> + <method name="set_axis_lock"> + <return type="void"> + </return> + <argument index="0" name="axis" type="int" enum="PhysicsServer.BodyAxis"> + </argument> + <argument index="1" name="lock" type="bool"> + </argument> + <description> + </description> + </method> <method name="test_move"> <return type="bool"> </return> diff --git a/doc/classes/Light.xml b/doc/classes/Light.xml index 64d8442180..6ef7c2652d 100644 --- a/doc/classes/Light.xml +++ b/doc/classes/Light.xml @@ -10,6 +10,24 @@ <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> </tutorials> <methods> + <method name="get_param" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="Light.Param"> + </argument> + <description> + </description> + </method> + <method name="set_param"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="Light.Param"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="editor_only" type="bool" setter="set_editor_only" getter="is_editor_only" default="false"> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 482ec28c56..d90a290fdc 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -187,21 +187,21 @@ <theme_items> <theme_item name="clear" type="Texture"> </theme_item> - <theme_item name="clear_button_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="clear_button_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> <theme_item name="clear_button_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> </theme_item> - <theme_item name="cursor_color" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="cursor_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="focus" type="StyleBox"> </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> <theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )"> </theme_item> - <theme_item name="font_color_uneditable" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 0.5 )"> + <theme_item name="font_color_uneditable" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )"> </theme_item> <theme_item name="minimum_spaces" type="int" default="12"> </theme_item> @@ -209,7 +209,7 @@ </theme_item> <theme_item name="read_only" type="StyleBox"> </theme_item> - <theme_item name="selection_color" type="Color" default="Color( 0.490196, 0.490196, 0.490196, 1 )"> + <theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )"> </theme_item> </theme_items> </class> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 5dfb55a8dd..3e6b5e8c1a 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -32,9 +32,9 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> - <theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> </theme_item> diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 609bf6317a..40d2160baa 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -46,11 +46,11 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> <theme_item name="font_color_disabled" type="Color" default="Color( 1, 1, 1, 0.3 )"> </theme_item> - <theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> </theme_item> diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml index 0723d50ba1..c50c1b6079 100644 --- a/doc/classes/NinePatchRect.xml +++ b/doc/classes/NinePatchRect.xml @@ -9,6 +9,24 @@ <tutorials> </tutorials> <methods> + <method name="get_patch_margin" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> + <method name="set_patch_margin"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="value" type="int"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode" default="0"> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index c44495ead9..0c2566e845 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -229,11 +229,11 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> </theme_item> - <theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> </theme_item> diff --git a/doc/classes/Particles.xml b/doc/classes/Particles.xml index 7ff99ebb73..3b9a0554e8 100644 --- a/doc/classes/Particles.xml +++ b/doc/classes/Particles.xml @@ -18,6 +18,14 @@ Returns the axis-aligned bounding box that contains all the particles that are active in the current frame. </description> </method> + <method name="get_draw_pass_mesh" qualifiers="const"> + <return type="Mesh"> + </return> + <argument index="0" name="pass" type="int"> + </argument> + <description> + </description> + </method> <method name="restart"> <return type="void"> </return> @@ -25,6 +33,16 @@ Restarts the particle emission, clearing existing particles. </description> </method> + <method name="set_draw_pass_mesh"> + <return type="void"> + </return> + <argument index="0" name="pass" type="int"> + </argument> + <argument index="1" name="mesh" type="Mesh"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="amount" type="int" setter="set_amount" getter="get_amount" default="8"> diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml index ff8e01c6c9..624a8d4dc5 100644 --- a/doc/classes/ParticlesMaterial.xml +++ b/doc/classes/ParticlesMaterial.xml @@ -11,6 +11,78 @@ <tutorials> </tutorials> <methods> + <method name="get_flag" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="flag" type="int" enum="ParticlesMaterial.Flags"> + </argument> + <description> + </description> + </method> + <method name="get_param" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> + </argument> + <description> + </description> + </method> + <method name="get_param_randomness" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> + </argument> + <description> + </description> + </method> + <method name="get_param_texture" qualifiers="const"> + <return type="Texture"> + </return> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> + </argument> + <description> + </description> + </method> + <method name="set_flag"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="ParticlesMaterial.Flags"> + </argument> + <argument index="1" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_param"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_param_randomness"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> + </argument> + <argument index="1" name="randomness" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_param_texture"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> + </argument> + <argument index="1" name="texture" type="Texture"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="angle" type="float" setter="set_param" getter="get_param" default="0.0"> diff --git a/doc/classes/PinJoint.xml b/doc/classes/PinJoint.xml index 10ae3d27d9..647a59feef 100644 --- a/doc/classes/PinJoint.xml +++ b/doc/classes/PinJoint.xml @@ -9,6 +9,24 @@ <tutorials> </tutorials> <methods> + <method name="get_param" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="PinJoint.Param"> + </argument> + <description> + </description> + </method> + <method name="set_param"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="PinJoint.Param"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="params/bias" type="float" setter="set_param" getter="get_param" default="0.3"> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index a05aff9a59..3d6693da15 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -598,7 +598,7 @@ <theme_item name="font" type="Font"> Sets a custom [Font]. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> Sets a custom [Color] for the [Font]. </theme_item> <theme_item name="font_color_accel" type="Color" default="Color( 0.7, 0.7, 0.7, 0.8 )"> @@ -606,7 +606,7 @@ <theme_item name="font_color_disabled" type="Color" default="Color( 0.4, 0.4, 0.4, 0.8 )"> Sets a custom [Color] for disabled text. </theme_item> - <theme_item name="font_color_hover" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color_hover" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> Sets a custom [Color] for the hovered text. </theme_item> <theme_item name="hover" type="StyleBox"> diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml index a8168958cf..96d377fd5e 100644 --- a/doc/classes/ProgressBar.xml +++ b/doc/classes/ProgressBar.xml @@ -24,7 +24,7 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="font_color_shadow" type="Color" default="Color( 0, 0, 0, 1 )"> </theme_item> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 3e9e063c0c..22dae4fe71 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -164,7 +164,7 @@ <member name="android/modules" type="String" setter="" getter="" default=""""> Comma-separated list of custom Android modules (which must have been built in the Android export templates) using their Java package path, e.g. [code]org/godotengine/org/GodotPaymentV3,org/godotengine/godot/MyCustomSingleton"[/code]. </member> - <member name="application/boot_splash/bg_color" type="Color" setter="" getter="" default="Color( 0.137255, 0.137255, 0.137255, 1 )"> + <member name="application/boot_splash/bg_color" type="Color" setter="" getter="" default="Color( 0.14, 0.14, 0.14, 1 )"> Background color for the boot splash. </member> <member name="application/boot_splash/fullsize" type="bool" setter="" getter="" default="true"> @@ -720,6 +720,8 @@ <member name="network/limits/packet_peer_stream/max_buffer_po2" type="int" setter="" getter="" default="16"> Default size of packet peer stream for deserializing Godot data. Over this size, data is dropped. </member> + <member name="network/limits/tcp/connect_timeout_seconds" type="int" setter="" getter="" default="30"> + </member> <member name="network/limits/websocket_client/max_in_buffer_kb" type="int" setter="" getter="" default="64"> </member> <member name="network/limits/websocket_client/max_in_packets" type="int" setter="" getter="" default="1024"> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 405eb59563..81f5f44866 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -331,7 +331,7 @@ </theme_item> <theme_item name="focus" type="StyleBox"> </theme_item> - <theme_item name="font_color_selected" type="Color" default="Color( 0.490196, 0.490196, 0.490196, 1 )"> + <theme_item name="font_color_selected" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )"> </theme_item> <theme_item name="font_color_shadow" type="Color" default="Color( 0, 0, 0, 0 )"> </theme_item> diff --git a/doc/classes/RigidBody.xml b/doc/classes/RigidBody.xml index a705789413..07eed6bb34 100644 --- a/doc/classes/RigidBody.xml +++ b/doc/classes/RigidBody.xml @@ -82,6 +82,14 @@ Applies a torque impulse which will be affected by the body mass and shape. This will rotate the body around the [code]impulse[/code] vector passed. </description> </method> + <method name="get_axis_lock" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="axis" type="int" enum="PhysicsServer.BodyAxis"> + </argument> + <description> + </description> + </method> <method name="get_colliding_bodies" qualifiers="const"> <return type="Array"> </return> @@ -90,6 +98,16 @@ [b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. </description> </method> + <method name="set_axis_lock"> + <return type="void"> + </return> + <argument index="0" name="axis" type="int" enum="PhysicsServer.BodyAxis"> + </argument> + <argument index="1" name="lock" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_axis_velocity"> <return type="void"> </return> diff --git a/doc/classes/SliderJoint.xml b/doc/classes/SliderJoint.xml index a91f67f107..3f22b5a37c 100644 --- a/doc/classes/SliderJoint.xml +++ b/doc/classes/SliderJoint.xml @@ -9,6 +9,24 @@ <tutorials> </tutorials> <methods> + <method name="get_param" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="param" type="int" enum="SliderJoint.Param"> + </argument> + <description> + </description> + </method> + <method name="set_param"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="SliderJoint.Param"> + </argument> + <argument index="1" name="value" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="angular_limit/damping" type="float" setter="set_param" getter="get_param" default="0.0"> diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml index 5e18e72f90..f739fed733 100644 --- a/doc/classes/SpatialMaterial.xml +++ b/doc/classes/SpatialMaterial.xml @@ -10,6 +10,60 @@ <link>https://docs.godotengine.org/en/latest/tutorials/3d/spatial_material.html</link> </tutorials> <methods> + <method name="get_feature" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="feature" type="int" enum="SpatialMaterial.Feature"> + </argument> + <description> + </description> + </method> + <method name="get_flag" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="flag" type="int" enum="SpatialMaterial.Flags"> + </argument> + <description> + </description> + </method> + <method name="get_texture" qualifiers="const"> + <return type="Texture"> + </return> + <argument index="0" name="param" type="int" enum="SpatialMaterial.TextureParam"> + </argument> + <description> + </description> + </method> + <method name="set_feature"> + <return type="void"> + </return> + <argument index="0" name="feature" type="int" enum="SpatialMaterial.Feature"> + </argument> + <argument index="1" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_flag"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="SpatialMaterial.Flags"> + </argument> + <argument index="1" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_texture"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="SpatialMaterial.TextureParam"> + </argument> + <argument index="1" name="texture" type="Texture"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="albedo_color" type="Color" setter="set_albedo" getter="get_albedo" default="Color( 1, 1, 1, 1 )"> diff --git a/doc/classes/SpriteBase3D.xml b/doc/classes/SpriteBase3D.xml index 9c5ed213a8..5529da909d 100644 --- a/doc/classes/SpriteBase3D.xml +++ b/doc/classes/SpriteBase3D.xml @@ -15,12 +15,30 @@ <description> </description> </method> + <method name="get_draw_flag" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="flag" type="int" enum="SpriteBase3D.DrawFlags"> + </argument> + <description> + </description> + </method> <method name="get_item_rect" qualifiers="const"> <return type="Rect2"> </return> <description> </description> </method> + <method name="set_draw_flag"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="SpriteBase3D.DrawFlags"> + </argument> + <argument index="1" name="enabled" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" enum="SpriteBase3D.AlphaCutMode" default="0"> diff --git a/doc/classes/StreamTexture.xml b/doc/classes/StreamTexture.xml index 20cbadb5f0..9c7adea079 100644 --- a/doc/classes/StreamTexture.xml +++ b/doc/classes/StreamTexture.xml @@ -9,6 +9,14 @@ <tutorials> </tutorials> <methods> + <method name="load"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="path" type="String"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="load_path" type="String" setter="load" getter="get_load_path" default=""""> diff --git a/doc/classes/StyleBox.xml b/doc/classes/StyleBox.xml index 6b8f076211..1d873ef0b1 100644 --- a/doc/classes/StyleBox.xml +++ b/doc/classes/StyleBox.xml @@ -31,6 +31,14 @@ <description> </description> </method> + <method name="get_default_margin" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> <method name="get_margin" qualifiers="const"> <return type="float"> </return> @@ -55,6 +63,16 @@ Returns the "offset" of a stylebox. This helper function returns a value equivalent to [code]Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP))[/code]. </description> </method> + <method name="set_default_margin"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="offset" type="float"> + </argument> + <description> + </description> + </method> <method name="test_mask" qualifiers="const"> <return type="bool"> </return> diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml index 28f49f831c..05ee79eef2 100644 --- a/doc/classes/StyleBoxFlat.xml +++ b/doc/classes/StyleBoxFlat.xml @@ -24,12 +24,46 @@ <tutorials> </tutorials> <methods> + <method name="get_border_width" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> <method name="get_border_width_min" qualifiers="const"> <return type="int"> </return> <description> </description> </method> + <method name="get_corner_radius" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="corner" type="int" enum="Corner"> + </argument> + <description> + </description> + </method> + <method name="get_expand_margin" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> + <method name="set_border_width"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="width" type="int"> + </argument> + <description> + </description> + </method> <method name="set_border_width_all"> <return type="void"> </return> @@ -38,6 +72,16 @@ <description> </description> </method> + <method name="set_corner_radius"> + <return type="void"> + </return> + <argument index="0" name="corner" type="int" enum="Corner"> + </argument> + <argument index="1" name="radius" type="int"> + </argument> + <description> + </description> + </method> <method name="set_corner_radius_all"> <return type="void"> </return> @@ -60,6 +104,16 @@ <description> </description> </method> + <method name="set_expand_margin"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="size" type="float"> + </argument> + <description> + </description> + </method> <method name="set_expand_margin_all"> <return type="void"> </return> diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index e51120f269..f68d749d3b 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -9,6 +9,22 @@ <tutorials> </tutorials> <methods> + <method name="get_expand_margin_size" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> + <method name="get_margin_size" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> <method name="set_expand_margin_all"> <return type="void"> </return> @@ -31,6 +47,26 @@ <description> </description> </method> + <method name="set_expand_margin_size"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="size" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_margin_size"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="size" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="StyleBoxTexture.AxisStretchMode" default="0"> diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index 2eb8411078..22b009a15a 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -189,11 +189,11 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color_bg" type="Color" default="Color( 0.690196, 0.690196, 0.690196, 1 )"> + <theme_item name="font_color_bg" type="Color" default="Color( 0.69, 0.69, 0.69, 1 )"> </theme_item> <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> </theme_item> - <theme_item name="font_color_fg" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="font_color_fg" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="hseparation" type="int" default="4"> </theme_item> diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index b6d702ba45..6bd7b8c2c3 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -260,11 +260,11 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color_bg" type="Color" default="Color( 0.690196, 0.690196, 0.690196, 1 )"> + <theme_item name="font_color_bg" type="Color" default="Color( 0.69, 0.69, 0.69, 1 )"> </theme_item> <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )"> </theme_item> - <theme_item name="font_color_fg" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="font_color_fg" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="hseparation" type="int" default="4"> </theme_item> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index e665178809..22c769330d 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -520,7 +520,7 @@ </constant> </constants> <theme_items> - <theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 0 )"> + <theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 1 )"> Sets the background [Color] of this [TextEdit]. [member syntax_highlighting] has to be enabled. </theme_item> <theme_item name="bookmark_color" type="Color" default="Color( 0.08, 0.49, 0.98, 1 )"> @@ -533,17 +533,17 @@ </theme_item> <theme_item name="caret_background_color" type="Color" default="Color( 0, 0, 0, 1 )"> </theme_item> - <theme_item name="caret_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="caret_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> <theme_item name="code_folding_color" type="Color" default="Color( 0.8, 0.8, 0.8, 0.8 )"> </theme_item> <theme_item name="completion" type="StyleBox"> </theme_item> - <theme_item name="completion_background_color" type="Color" default="Color( 0.172549, 0.164706, 0.196078, 1 )"> + <theme_item name="completion_background_color" type="Color" default="Color( 0.17, 0.16, 0.2, 1 )"> </theme_item> - <theme_item name="completion_existing_color" type="Color" default="Color( 0.87451, 0.87451, 0.87451, 0.129412 )"> + <theme_item name="completion_existing_color" type="Color" default="Color( 0.87, 0.87, 0.87, 0.13 )"> </theme_item> - <theme_item name="completion_font_color" type="Color" default="Color( 0.666667, 0.666667, 0.666667, 1 )"> + <theme_item name="completion_font_color" type="Color" default="Color( 0.67, 0.67, 0.67, 1 )"> </theme_item> <theme_item name="completion_lines" type="int" default="7"> </theme_item> @@ -553,7 +553,7 @@ </theme_item> <theme_item name="completion_scroll_width" type="int" default="3"> </theme_item> - <theme_item name="completion_selected_color" type="Color" default="Color( 0.262745, 0.258824, 0.266667, 1 )"> + <theme_item name="completion_selected_color" type="Color" default="Color( 0.26, 0.26, 0.27, 1 )"> </theme_item> <theme_item name="current_line_color" type="Color" default="Color( 0.25, 0.25, 0.26, 0.8 )"> Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled. @@ -569,16 +569,16 @@ <theme_item name="font" type="Font"> Sets the default [Font]. </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> Sets the font [Color]. </theme_item> - <theme_item name="font_color_readonly" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 0.5 )"> + <theme_item name="font_color_readonly" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )"> </theme_item> <theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )"> </theme_item> - <theme_item name="function_color" type="Color" default="Color( 0.4, 0.635294, 0.807843, 1 )"> + <theme_item name="function_color" type="Color" default="Color( 0.4, 0.64, 0.81, 1 )"> </theme_item> - <theme_item name="line_number_color" type="Color" default="Color( 0.666667, 0.666667, 0.666667, 0.4 )"> + <theme_item name="line_number_color" type="Color" default="Color( 0.67, 0.67, 0.67, 0.4 )"> Sets the [Color] of the line numbers. [member show_line_numbers] has to be enabled. </theme_item> <theme_item name="line_spacing" type="int" default="4"> @@ -587,24 +587,24 @@ <theme_item name="mark_color" type="Color" default="Color( 1, 0.4, 0.4, 0.4 )"> Sets the [Color] of marked text. </theme_item> - <theme_item name="member_variable_color" type="Color" default="Color( 0.901961, 0.305882, 0.34902, 1 )"> + <theme_item name="member_variable_color" type="Color" default="Color( 0.9, 0.31, 0.35, 1 )"> </theme_item> <theme_item name="normal" type="StyleBox"> Sets the [StyleBox] of this [TextEdit]. </theme_item> - <theme_item name="number_color" type="Color" default="Color( 0.921569, 0.584314, 0.196078, 1 )"> + <theme_item name="number_color" type="Color" default="Color( 0.92, 0.58, 0.2, 1 )"> </theme_item> <theme_item name="read_only" type="StyleBox"> Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled. </theme_item> - <theme_item name="safe_line_number_color" type="Color" default="Color( 0.666667, 0.784314, 0.666667, 0.6 )"> + <theme_item name="safe_line_number_color" type="Color" default="Color( 0.67, 0.78, 0.67, 0.6 )"> </theme_item> - <theme_item name="selection_color" type="Color" default="Color( 0.490196, 0.490196, 0.490196, 1 )"> + <theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )"> Sets the highlight [Color] of text selections. </theme_item> <theme_item name="space" type="Texture"> </theme_item> - <theme_item name="symbol_color" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="symbol_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="tab" type="Texture"> Sets a custom [Texture] for tab text characters. diff --git a/doc/classes/TextureProgress.xml b/doc/classes/TextureProgress.xml index 409d005067..3900b8bf45 100644 --- a/doc/classes/TextureProgress.xml +++ b/doc/classes/TextureProgress.xml @@ -9,6 +9,24 @@ <tutorials> </tutorials> <methods> + <method name="get_stretch_margin" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> + <method name="set_stretch_margin"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="value" type="int"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="fill_mode" type="int" setter="set_fill_mode" getter="get_fill_mode" default="0"> diff --git a/doc/classes/ToolButton.xml b/doc/classes/ToolButton.xml index 3511987474..f617c2a94f 100644 --- a/doc/classes/ToolButton.xml +++ b/doc/classes/ToolButton.xml @@ -23,11 +23,11 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.95, 1, 0.3 )"> </theme_item> - <theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> </theme_item> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 416a9eb656..22c74d4ca5 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -382,7 +382,7 @@ </theme_item> <theme_item name="custom_button" type="StyleBox"> </theme_item> - <theme_item name="custom_button_font_highlight" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )"> + <theme_item name="custom_button_font_highlight" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> </theme_item> <theme_item name="custom_button_hover" type="StyleBox"> </theme_item> @@ -396,7 +396,7 @@ </theme_item> <theme_item name="font" type="Font"> </theme_item> - <theme_item name="font_color" type="Color" default="Color( 0.690196, 0.690196, 0.690196, 1 )"> + <theme_item name="font_color" type="Color" default="Color( 0.69, 0.69, 0.69, 1 )"> </theme_item> <theme_item name="font_color_selected" type="Color" default="Color( 1, 1, 1, 1 )"> </theme_item> @@ -408,7 +408,7 @@ </theme_item> <theme_item name="item_margin" type="int" default="12"> </theme_item> - <theme_item name="relationship_line_color" type="Color" default="Color( 0.27451, 0.27451, 0.27451, 1 )"> + <theme_item name="relationship_line_color" type="Color" default="Color( 0.27, 0.27, 0.27, 1 )"> </theme_item> <theme_item name="scroll_border" type="int" default="4"> </theme_item> @@ -422,7 +422,7 @@ </theme_item> <theme_item name="selection_color" type="Color" default="Color( 0.1, 0.1, 1, 0.8 )"> </theme_item> - <theme_item name="title_button_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )"> + <theme_item name="title_button_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> </theme_item> <theme_item name="title_button_font" type="Font"> </theme_item> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index d9c7013d34..3a4acb351d 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -337,6 +337,18 @@ Sets the given column's button [Texture] at index [code]button_idx[/code] to [code]button[/code]. </description> </method> + <method name="set_button_disabled"> + <return type="void"> + </return> + <argument index="0" name="column" type="int"> + </argument> + <argument index="1" name="button_idx" type="int"> + </argument> + <argument index="2" name="disabled" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_cell_mode"> <return type="void"> </return> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 5d5a62456f..9b24aa1a86 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -67,6 +67,14 @@ Returns information about the viewport from the rendering pipeline. </description> </method> + <method name="get_shadow_atlas_quadrant_subdiv" qualifiers="const"> + <return type="int" enum="Viewport.ShadowAtlasQuadrantSubdiv"> + </return> + <argument index="0" name="quadrant" type="int"> + </argument> + <description> + </description> + </method> <method name="get_size_override" qualifiers="const"> <return type="Vector2"> </return> @@ -155,6 +163,16 @@ <description> </description> </method> + <method name="set_shadow_atlas_quadrant_subdiv"> + <return type="void"> + </return> + <argument index="0" name="quadrant" type="int"> + </argument> + <argument index="1" name="subdiv" type="int" enum="Viewport.ShadowAtlasQuadrantSubdiv"> + </argument> + <description> + </description> + </method> <method name="set_size_override"> <return type="void"> </return> diff --git a/doc/classes/VisibilityEnabler.xml b/doc/classes/VisibilityEnabler.xml index 4acb4d87c1..e3c7d05fce 100644 --- a/doc/classes/VisibilityEnabler.xml +++ b/doc/classes/VisibilityEnabler.xml @@ -9,6 +9,24 @@ <tutorials> </tutorials> <methods> + <method name="is_enabler_enabled" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="enabler" type="int" enum="VisibilityEnabler.Enabler"> + </argument> + <description> + </description> + </method> + <method name="set_enabler"> + <return type="void"> + </return> + <argument index="0" name="enabler" type="int" enum="VisibilityEnabler.Enabler"> + </argument> + <argument index="1" name="enabled" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="freeze_bodies" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="true"> diff --git a/doc/classes/VisibilityEnabler2D.xml b/doc/classes/VisibilityEnabler2D.xml index dbea3f5de8..0f25c00489 100644 --- a/doc/classes/VisibilityEnabler2D.xml +++ b/doc/classes/VisibilityEnabler2D.xml @@ -9,6 +9,24 @@ <tutorials> </tutorials> <methods> + <method name="is_enabler_enabled" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="enabler" type="int" enum="VisibilityEnabler2D.Enabler"> + </argument> + <description> + </description> + </method> + <method name="set_enabler"> + <return type="void"> + </return> + <argument index="0" name="enabler" type="int" enum="VisibilityEnabler2D.Enabler"> + </argument> + <argument index="1" name="enabled" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="freeze_bodies" type="bool" setter="set_enabler" getter="is_enabler_enabled" default="true"> diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 7c396e1da3..2e070d7963 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -161,7 +161,8 @@ bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col) result_line = line; result_col = col; - set_error(""); + _update_results_count(); + set_error(vformat(TTR("Found %d matches(s)."), results_count)); } else { result_line = -1; result_col = -1; @@ -184,6 +185,8 @@ void FindReplaceBar::_replace() { text_edit->insert_text_at_cursor(get_replace_text()); text_edit->end_complex_operation(); + + results_count = -1; } search_current(); @@ -271,6 +274,7 @@ void FindReplaceBar::_replace_all() { set_error(vformat(TTR("Replaced %d occurrence(s)."), rc)); text_edit->call_deferred("connect", "text_changed", this, "_editor_text_changed"); + results_count = -1; } void FindReplaceBar::_get_search_from(int &r_line, int &r_col) { @@ -297,6 +301,36 @@ void FindReplaceBar::_get_search_from(int &r_line, int &r_col) { } } +void FindReplaceBar::_update_results_count() { + if (results_count != -1) + return; + + results_count = 0; + + String searched = get_search_text(); + if (searched.empty()) return; + + String full_text = text_edit->get_text(); + + int from_pos = 0; + + while (true) { + int pos = is_case_sensitive() ? full_text.find(searched, from_pos) : full_text.findn(searched, from_pos); + if (pos == -1) break; + + if (is_whole_words()) { + from_pos++; // Making sure we won't hit the same match next time, if we get out via a continue. + if (pos > 0 && !is_symbol(full_text[pos - 1])) + continue; + if (pos + searched.length() < full_text.length() && !is_symbol(full_text[pos + searched.length()])) + continue; + } + + results_count++; + from_pos = pos + searched.length(); + } +} + bool FindReplaceBar::search_current() { uint32_t flags = 0; @@ -420,11 +454,13 @@ void FindReplaceBar::popup_replace() { void FindReplaceBar::_search_options_changed(bool p_pressed) { + results_count = -1; search_current(); } void FindReplaceBar::_editor_text_changed() { + results_count = -1; if (is_visible_in_tree()) { preserve_cursor = true; search_current(); @@ -434,6 +470,7 @@ void FindReplaceBar::_editor_text_changed() { void FindReplaceBar::_search_text_changed(const String &p_text) { + results_count = -1; search_current(); } @@ -486,6 +523,7 @@ void FindReplaceBar::set_error(const String &p_label) { void FindReplaceBar::set_text_edit(TextEdit *p_text_edit) { + results_count = -1; text_edit = p_text_edit; text_edit->connect("text_changed", this, "_editor_text_changed"); } @@ -512,6 +550,7 @@ void FindReplaceBar::_bind_methods() { FindReplaceBar::FindReplaceBar() { + results_count = -1; replace_all_mode = false; preserve_cursor = false; diff --git a/editor/code_editor.h b/editor/code_editor.h index 5af1f531a9..700e72627c 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -83,11 +83,13 @@ class FindReplaceBar : public HBoxContainer { int result_line; int result_col; + int results_count; bool replace_all_mode; bool preserve_cursor; void _get_search_from(int &r_line, int &r_col); + void _update_results_count(); void _show_search(); void _hide_bar(); diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index 6ee07d3661..a8ba54d4f8 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -323,8 +323,14 @@ void DocData::generate(bool p_basic_types) { if (E->get().name == "" || (E->get().name[0] == '_' && !(E->get().flags & METHOD_FLAG_VIRTUAL))) continue; //hidden, don't count - if (skip_setter_getter_methods && setters_getters.has(E->get().name) && E->get().name.find("/") == -1) - continue; + if (skip_setter_getter_methods && setters_getters.has(E->get().name)) { + // Don't skip parametric setters and getters, i.e. method which require + // one or more parameters to define what property should be set or retrieved. + // E.g. CPUParticles::set_param(Parameter param, float value). + if (E->get().arguments.size() == 0 /* getter */ || (E->get().arguments.size() == 1 && E->get().return_val.type == Variant::NIL /* setter */)) { + continue; + } + } MethodDoc method; @@ -366,21 +372,6 @@ void DocData::generate(bool p_basic_types) { method.arguments.push_back(argument); } - - /* - String hint; - switch(arginfo.hint) { - case PROPERTY_HINT_DIR: hint="A directory."; break; - case PROPERTY_HINT_RANGE: hint="Range - min: "+arginfo.hint_string.get_slice(",",0)+" max: "+arginfo.hint_string.get_slice(",",1)+" step: "+arginfo.hint_string.get_slice(",",2); break; - case PROPERTY_HINT_ENUM: hint="Values: "; for(int j=0;j<arginfo.hint_string.get_slice_count(",");j++) { if (j>0) hint+=", "; hint+=arginfo.hint_string.get_slice(",",j)+"="+itos(j); } break; - case PROPERTY_HINT_LENGTH: hint="Length: "+arginfo.hint_string; break; - case PROPERTY_HINT_FLAGS: hint="Values: "; for(int j=0;j<arginfo.hint_string.get_slice_count(",");j++) { if (j>0) hint+=", "; hint+=arginfo.hint_string.get_slice(",",j)+"="+itos(1<<j); } break; - case PROPERTY_HINT_FILE: hint="A file:"; break; - //case PROPERTY_HINT_RESOURCE_TYPE: hint="Type: "+arginfo.hint_string; break; - }; - if (hint!="") - _write_string(f,4,hint); -*/ } c.methods.push_back(method); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index b9fb532c4a..2180742bbb 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -76,9 +76,9 @@ void EditorAudioBus::_notification(int p_what) { disabled_vu = get_icon("BusVuFrozen", "EditorIcons"); - Color solo_color = Color::html(EditorSettings::get_singleton()->is_dark_theme() ? "#ffe337" : "#ffeb70"); - Color mute_color = Color::html(EditorSettings::get_singleton()->is_dark_theme() ? "#ff2929" : "#ff7070"); - Color bypass_color = Color::html(EditorSettings::get_singleton()->is_dark_theme() ? "#22ccff" : "#70deff"); + Color solo_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(1.0, 0.89, 0.22) : Color(1.0, 0.92, 0.44); + Color mute_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(1.0, 0.16, 0.16) : Color(1.0, 0.44, 0.44); + Color bypass_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(0.13, 0.8, 1.0) : Color(0.44, 0.87, 1.0); solo->set_icon(get_icon("AudioBusSolo", "EditorIcons")); solo->add_color_override("icon_color_pressed", solo_color); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index d1f765a312..cd5d26e577 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1348,39 +1348,39 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { if (col.begins_with("#")) color = Color::html(col); else if (col == "aqua") - color = Color::html("#00FFFF"); + color = Color(0, 1, 1); else if (col == "black") - color = Color::html("#000000"); + color = Color(0, 0, 0); else if (col == "blue") - color = Color::html("#0000FF"); + color = Color(0, 0, 1); else if (col == "fuchsia") - color = Color::html("#FF00FF"); + color = Color(1, 0, 1); else if (col == "gray" || col == "grey") - color = Color::html("#808080"); + color = Color(0.5, 0.5, 0.5); else if (col == "green") - color = Color::html("#008000"); + color = Color(0, 0.5, 0); else if (col == "lime") - color = Color::html("#00FF00"); + color = Color(0, 1, 0); else if (col == "maroon") - color = Color::html("#800000"); + color = Color(0.5, 0, 0); else if (col == "navy") - color = Color::html("#000080"); + color = Color(0, 0, 0.5); else if (col == "olive") - color = Color::html("#808000"); + color = Color(0.5, 0.5, 0); else if (col == "purple") - color = Color::html("#800080"); + color = Color(0.5, 0, 0.5); else if (col == "red") - color = Color::html("#FF0000"); + color = Color(1, 0, 0); else if (col == "silver") - color = Color::html("#C0C0C0"); + color = Color(0.75, 0.75, 0.75); else if (col == "teal") - color = Color::html("#008008"); + color = Color(0, 0.5, 0.5); else if (col == "white") - color = Color::html("#FFFFFF"); + color = Color(1, 1, 1); else if (col == "yellow") - color = Color::html("#FFFF00"); + color = Color(1, 1, 0); else - color = Color(0, 0, 0, 1); //base_color; + color = Color(0, 0, 0); //base_color; p_rt->push_color(color); pos = brk_end + 1; diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 8e8c12ba44..2c0449398e 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -354,9 +354,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["interface/theme/preset"] = PropertyInfo(Variant::STRING, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Alien,Arc,Godot 2,Grey,Light,Solarized (Dark),Solarized (Light),Custom", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/icon_and_font_color", 0); hints["interface/theme/icon_and_font_color"] = PropertyInfo(Variant::INT, "interface/theme/icon_and_font_color", PROPERTY_HINT_ENUM, "Auto,Dark,Light", PROPERTY_USAGE_DEFAULT); - _initial_set("interface/theme/base_color", Color::html("#323b4f")); + _initial_set("interface/theme/base_color", Color(0.2, 0.23, 0.31)); hints["interface/theme/base_color"] = PropertyInfo(Variant::COLOR, "interface/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT); - _initial_set("interface/theme/accent_color", Color::html("#699ce8")); + _initial_set("interface/theme/accent_color", Color(0.41, 0.61, 0.91)); hints["interface/theme/accent_color"] = PropertyInfo(Variant::COLOR, "interface/theme/accent_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/contrast", 0.25); hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01"); @@ -505,10 +505,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("editors/grid_map/pick_distance", 5000.0); // 3D - _initial_set("editors/3d/primary_grid_color", Color::html("909090")); + _initial_set("editors/3d/primary_grid_color", Color(0.56, 0.56, 0.56)); hints["editors/3d/primary_grid_color"] = PropertyInfo(Variant::COLOR, "editors/3d/primary_grid_color", PROPERTY_HINT_COLOR_NO_ALPHA, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - _initial_set("editors/3d/secondary_grid_color", Color::html("606060")); + _initial_set("editors/3d/secondary_grid_color", Color(0.38, 0.38, 0.38)); hints["editors/3d/secondary_grid_color"] = PropertyInfo(Variant::COLOR, "editors/3d/secondary_grid_color", PROPERTY_HINT_COLOR_NO_ALPHA, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("editors/3d/grid_size", 50); @@ -648,32 +648,32 @@ void EditorSettings::_load_default_text_editor_theme() { bool dark_theme = is_dark_theme(); - _initial_set("text_editor/highlighting/symbol_color", Color::html("badfff")); - _initial_set("text_editor/highlighting/keyword_color", Color::html("ffffb3")); - _initial_set("text_editor/highlighting/base_type_color", Color::html("a4ffd4")); - _initial_set("text_editor/highlighting/engine_type_color", Color::html("83d3ff")); - _initial_set("text_editor/highlighting/comment_color", Color::html("676767")); - _initial_set("text_editor/highlighting/string_color", Color::html("ef6ebe")); - _initial_set("text_editor/highlighting/background_color", dark_theme ? Color::html("3b000000") : Color::html("#323b4f")); - _initial_set("text_editor/highlighting/completion_background_color", Color::html("2C2A32")); - _initial_set("text_editor/highlighting/completion_selected_color", Color::html("434244")); - _initial_set("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")); - _initial_set("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")); - _initial_set("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")); - _initial_set("text_editor/highlighting/text_color", Color::html("aaaaaa")); - _initial_set("text_editor/highlighting/line_number_color", Color::html("66aaaaaa")); - _initial_set("text_editor/highlighting/safe_line_number_color", Color::html("99aac8aa")); - _initial_set("text_editor/highlighting/caret_color", Color::html("aaaaaa")); - _initial_set("text_editor/highlighting/caret_background_color", Color::html("000000")); - _initial_set("text_editor/highlighting/text_selected_color", Color::html("000000")); - _initial_set("text_editor/highlighting/selection_color", Color::html("5a699ce8")); + _initial_set("text_editor/highlighting/symbol_color", Color(0.73, 0.87, 1.0)); + _initial_set("text_editor/highlighting/keyword_color", Color(1.0, 1.0, 0.7)); + _initial_set("text_editor/highlighting/base_type_color", Color(0.64, 1.0, 0.83)); + _initial_set("text_editor/highlighting/engine_type_color", Color(0.51, 0.83, 1.0)); + _initial_set("text_editor/highlighting/comment_color", Color(0.4, 0.4, 0.4)); + _initial_set("text_editor/highlighting/string_color", Color(0.94, 0.43, 0.75)); + _initial_set("text_editor/highlighting/background_color", dark_theme ? Color(0.0, 0.0, 0.0, 0.23) : Color(0.2, 0.23, 0.31)); + _initial_set("text_editor/highlighting/completion_background_color", Color(0.17, 0.16, 0.2)); + _initial_set("text_editor/highlighting/completion_selected_color", Color(0.26, 0.26, 0.27)); + _initial_set("text_editor/highlighting/completion_existing_color", Color(0.13, 0.87, 0.87, 0.87)); + _initial_set("text_editor/highlighting/completion_scroll_color", Color(1, 1, 1)); + _initial_set("text_editor/highlighting/completion_font_color", Color(0.67, 0.67, 0.67)); + _initial_set("text_editor/highlighting/text_color", Color(0.67, 0.67, 0.67)); + _initial_set("text_editor/highlighting/line_number_color", Color(0.67, 0.67, 0.67, 0.4)); + _initial_set("text_editor/highlighting/safe_line_number_color", Color(0.67, 0.78, 0.67, 0.6)); + _initial_set("text_editor/highlighting/caret_color", Color(0.67, 0.67, 0.67)); + _initial_set("text_editor/highlighting/caret_background_color", Color(0, 0, 0)); + _initial_set("text_editor/highlighting/text_selected_color", Color(0, 0, 0)); + _initial_set("text_editor/highlighting/selection_color", Color(0.41, 0.61, 0.91, 0.35)); _initial_set("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2)); _initial_set("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15)); _initial_set("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1)); _initial_set("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15)); - _initial_set("text_editor/highlighting/number_color", Color::html("EB9532")); - _initial_set("text_editor/highlighting/function_color", Color::html("66a2ce")); - _initial_set("text_editor/highlighting/member_variable_color", Color::html("e64e59")); + _initial_set("text_editor/highlighting/number_color", Color(0.92, 0.58, 0.2)); + _initial_set("text_editor/highlighting/function_color", Color(0.4, 0.64, 0.81)); + _initial_set("text_editor/highlighting/member_variable_color", Color(0.9, 0.31, 0.35)); _initial_set("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4)); _initial_set("text_editor/highlighting/bookmark_color", Color(0.08, 0.49, 0.98)); _initial_set("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2)); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index ff38b4b650..4eceb09792 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -257,44 +257,44 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // Please, use alphabet order if you've added new theme here(After "Default" and "Custom") if (preset == "Default") { - preset_accent_color = Color::html("#699ce8"); - preset_base_color = Color::html("#323b4f"); + preset_accent_color = Color(0.41, 0.61, 0.91); + preset_base_color = Color(0.2, 0.23, 0.31); preset_contrast = default_contrast; } else if (preset == "Custom") { accent_color = EDITOR_GET("interface/theme/accent_color"); base_color = EDITOR_GET("interface/theme/base_color"); contrast = EDITOR_GET("interface/theme/contrast"); } else if (preset == "Alien") { - preset_accent_color = Color::html("#1bfe99"); - preset_base_color = Color::html("#2f373f"); + preset_accent_color = Color(0.11, 1.0, 0.6); + preset_base_color = Color(0.18, 0.22, 0.25); preset_contrast = 0.25; } else if (preset == "Arc") { - preset_accent_color = Color::html("#5294e2"); - preset_base_color = Color::html("#383c4a"); + preset_accent_color = Color(0.32, 0.58, 0.89); + preset_base_color = Color(0.22, 0.24, 0.29); preset_contrast = 0.25; } else if (preset == "Godot 2") { - preset_accent_color = Color::html("#86ace2"); - preset_base_color = Color::html("#3C3A44"); + preset_accent_color = Color(0.53, 0.67, 0.89); + preset_base_color = Color(0.24, 0.23, 0.27); preset_contrast = 0.25; } else if (preset == "Grey") { - preset_accent_color = Color::html("#b8e4ff"); - preset_base_color = Color::html("#3d3d3d"); + preset_accent_color = Color(0.72, 0.89, 1.0); + preset_base_color = Color(0.24, 0.24, 0.24); preset_contrast = 0.2; } else if (preset == "Light") { - preset_accent_color = Color::html("#2070ff"); - preset_base_color = Color::html("#ffffff"); + preset_accent_color = Color(0.13, 0.44, 1.0); + preset_base_color = Color(1, 1, 1); preset_contrast = 0.08; } else if (preset == "Solarized (Dark)") { - preset_accent_color = Color::html("#268bd2"); - preset_base_color = Color::html("#073642"); + preset_accent_color = Color(0.15, 0.55, 0.82); + preset_base_color = Color(0.03, 0.21, 0.26); preset_contrast = 0.23; } else if (preset == "Solarized (Light)") { - preset_accent_color = Color::html("#268bd2"); - preset_base_color = Color::html("#fdf6e3"); + preset_accent_color = Color(0.15, 0.55, 0.82); + preset_base_color = Color(0.99, 0.96, 0.89); preset_contrast = 0.06; } else { // Default - preset_accent_color = Color::html("#699ce8"); - preset_base_color = Color::html("#323b4f"); + preset_accent_color = Color(0.41, 0.61, 0.91); + preset_base_color = Color(0.2, 0.23, 0.31); preset_contrast = default_contrast; } @@ -1088,14 +1088,14 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.7); // editor main color - const Color main_color = Color::html(dark_theme ? "#57b3ff" : "#0480ff"); + const Color main_color = dark_theme ? Color(0.34, 0.7, 1.0) : Color(0.02, 0.5, 1.0); - const Color symbol_color = Color::html("#5792ff").linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3); - const Color keyword_color = Color::html("#ff7185"); - const Color basetype_color = Color::html(dark_theme ? "#42ffc2" : "#00c161"); + const Color symbol_color = Color(0.34, 0.57, 1.0).linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3); + const Color keyword_color = Color(1.0, 0.44, 0.52); + const Color basetype_color = dark_theme ? Color(0.26, 1.0, 0.76) : Color(0.0, 0.76, 0.38); const Color type_color = basetype_color.linear_interpolate(mono_color, dark_theme ? 0.7 : 0.5); const Color comment_color = dim_color; - const Color string_color = Color::html(dark_theme ? "#ffd942" : "#ffd118").linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3); + const Color string_color = (dark_theme ? Color(1.0, 0.85, 0.26) : Color(1.0, 0.82, 0.09)).linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3); const Color te_background_color = dark_theme ? background_color : base_color; const Color completion_background_color = dark_theme ? base_color : background_color; diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 7b4ae0f2e9..3ab2ae1643 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -365,10 +365,10 @@ void VisualShaderEditor::_update_graph() { } static const Color type_color[4] = { - Color::html("#61daf4"), // scalar - Color::html("#d67dee"), // vector - Color::html("#8da6f0"), // boolean - Color::html("#f6a86e") // transform + Color(0.38, 0.85, 0.96), // scalar + Color(0.84, 0.49, 0.93), // vector + Color(0.55, 0.65, 0.94), // boolean + Color(0.96, 0.66, 0.43) // transform }; List<VisualShader::Connection> connections; diff --git a/main/main_builders.py b/main/main_builders.py index 038a7d17f5..c48aaaa572 100644 --- a/main/main_builders.py +++ b/main/main_builders.py @@ -19,7 +19,7 @@ def make_splash(target, source, env): g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef BOOT_SPLASH_H\n") g.write("#define BOOT_SPLASH_H\n") - g.write('static const Color boot_splash_bg_color = Color::html("#232323");\n') + g.write('static const Color boot_splash_bg_color = Color(0.14, 0.14, 0.14);\n') g.write("static const unsigned char boot_splash_png[] = {\n") for i in range(len(buf)): g.write(byte_to_str(buf[i]) + ",\n") @@ -38,7 +38,7 @@ def make_splash_editor(target, source, env): g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef BOOT_SPLASH_EDITOR_H\n") g.write("#define BOOT_SPLASH_EDITOR_H\n") - g.write('static const Color boot_splash_editor_bg_color = Color::html("#232323");\n') + g.write('static const Color boot_splash_editor_bg_color = Color(0.14, 0.14, 0.14);\n') g.write("static const unsigned char boot_splash_editor_png[] = {\n") for i in range(len(buf)): g.write(byte_to_str(buf[i]) + ",\n") diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp index 62b65fe96b..963b40529d 100644 --- a/modules/gdscript/editor/gdscript_highlighter.cpp +++ b/modules/gdscript/editor/gdscript_highlighter.cpp @@ -370,8 +370,8 @@ void GDScriptSyntaxHighlighter::_update_cache() { bool default_theme = text_editor_color_theme == "Default"; bool dark_theme = settings->is_dark_theme(); - function_definition_color = Color::html(default_theme ? "#01e1ff" : dark_theme ? "#01e1ff" : "#00a5ba"); - node_path_color = Color::html(default_theme ? "#64c15a" : dark_theme ? "64c15a" : "#518b4b"); + function_definition_color = default_theme ? Color(0.0, 0.88, 1.0) : dark_theme ? Color(0.0, 0.88, 1.0) : Color(0.0, 0.65, 0.73); + node_path_color = default_theme ? Color(0.39, 0.76, 0.35) : dark_theme ? Color(0.39, 0.76, 0.35) : Color(0.32, 0.55, 0.29); EDITOR_DEF("text_editor/highlighting/gdscript/function_definition_color", function_definition_color); EDITOR_DEF("text_editor/highlighting/gdscript/node_path_color", node_path_color); diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index b5c91a8585..7492816f18 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -867,17 +867,26 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { script->reload(p_soft_reload); script->update_exports(); + + if (!script->valid) { + script->pending_reload_instances.clear(); + continue; + } } else { const StringName &class_namespace = script->tied_class_namespace_for_reload; const StringName &class_name = script->tied_class_name_for_reload; GDMonoAssembly *project_assembly = gdmono->get_project_assembly(); - GDMonoAssembly *tools_assembly = gdmono->get_tools_assembly(); // Search in project and tools assemblies first as those are the most likely to have the class GDMonoClass *script_class = (project_assembly ? project_assembly->get_class(class_namespace, class_name) : NULL); + +#ifdef TOOLS_ENABLED if (!script_class) { + GDMonoAssembly *tools_assembly = gdmono->get_tools_assembly(); script_class = (tools_assembly ? tools_assembly->get_class(class_namespace, class_name) : NULL); } +#endif + if (!script_class) { script_class = gdmono->get_class(class_namespace, class_name); } @@ -897,12 +906,7 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { GDMonoClass *native = GDMonoUtils::get_class_native_base(script_class); - Ref<CSharpScript> new_script = CSharpScript::create_for_managed_type(script_class, native); - CRASH_COND(new_script.is_null()); - - new_script->pending_reload_instances = script->pending_reload_instances; - new_script->pending_reload_state = script->pending_reload_state; - script = new_script; + CSharpScript::initialize_for_managed_type(script, script_class, native); } String native_name = NATIVE_GDMONOCLASS_NAME(script->native); @@ -953,7 +957,6 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { CRASH_COND(si != NULL); #endif // Re-create script instance - obj->set_script(script.get_ref_ptr()); // will create the script instance as well } } @@ -1203,7 +1206,9 @@ CSharpLanguage::CSharpLanguage() { scripts_metadata_invalidated = true; +#ifdef TOOLS_ENABLED godotsharp_editor = NULL; +#endif } CSharpLanguage::~CSharpLanguage() { @@ -2144,7 +2149,6 @@ void CSharpScript::_update_exports_values(Map<StringName, Variant> &values, List propnames.push_back(E->get()); } } -#endif void CSharpScript::_update_member_info_no_exports() { @@ -2191,6 +2195,7 @@ void CSharpScript::_update_member_info_no_exports() { } } } +#endif bool CSharpScript::_update_exports() { @@ -2673,35 +2678,46 @@ void CSharpScript::_bind_methods() { Ref<CSharpScript> CSharpScript::create_for_managed_type(GDMonoClass *p_class, GDMonoClass *p_native) { - // This method should not fail + // This method should not fail, only assertions allowed CRASH_COND(p_class == NULL); // TODO OPTIMIZE: Cache the 'CSharpScript' associated with this 'p_class' instead of allocating a new one every time Ref<CSharpScript> script = memnew(CSharpScript); - script->name = p_class->get_name(); - script->script_class = p_class; - script->native = p_native; + initialize_for_managed_type(script, p_class, p_native); - CRASH_COND(script->native == NULL); + return script; +} + +void CSharpScript::initialize_for_managed_type(Ref<CSharpScript> p_script, GDMonoClass *p_class, GDMonoClass *p_native) { + + // This method should not fail, only assertions allowed + + CRASH_COND(p_class == NULL); + + p_script->name = p_class->get_name(); + p_script->script_class = p_class; + p_script->native = p_native; - GDMonoClass *base = script->script_class->get_parent_class(); + CRASH_COND(p_script->native == NULL); - if (base != script->native) - script->base = base; + GDMonoClass *base = p_script->script_class->get_parent_class(); - script->valid = true; - script->tool = script->script_class->has_attribute(CACHED_CLASS(ToolAttribute)); + if (base != p_script->native) + p_script->base = base; - if (!script->tool) { - GDMonoClass *nesting_class = script->script_class->get_nesting_class(); - script->tool = nesting_class && nesting_class->has_attribute(CACHED_CLASS(ToolAttribute)); + p_script->valid = true; + p_script->tool = p_script->script_class->has_attribute(CACHED_CLASS(ToolAttribute)); + + if (!p_script->tool) { + GDMonoClass *nesting_class = p_script->script_class->get_nesting_class(); + p_script->tool = nesting_class && nesting_class->has_attribute(CACHED_CLASS(ToolAttribute)); } #if TOOLS_ENABLED - if (!script->tool) { - script->tool = script->script_class->get_assembly() == GDMono::get_singleton()->get_tools_assembly(); + if (!p_script->tool) { + p_script->tool = p_script->script_class->get_assembly() == GDMono::get_singleton()->get_tools_assembly(); } #endif @@ -2710,10 +2726,10 @@ Ref<CSharpScript> CSharpScript::create_for_managed_type(GDMonoClass *p_class, GD // Native base methods must be fetched before the current class. // Not needed if the script class itself is a native class. - if (script->script_class != script->native) { - GDMonoClass *native_top = script->native; + if (p_script->script_class != p_script->native) { + GDMonoClass *native_top = p_script->native; while (native_top) { - native_top->fetch_methods_with_godot_api_checks(script->native); + native_top->fetch_methods_with_godot_api_checks(p_script->native); if (native_top == CACHED_CLASS(GodotObject)) break; @@ -2723,19 +2739,19 @@ Ref<CSharpScript> CSharpScript::create_for_managed_type(GDMonoClass *p_class, GD } #endif - script->script_class->fetch_methods_with_godot_api_checks(script->native); + p_script->script_class->fetch_methods_with_godot_api_checks(p_script->native); // Need to fetch method from base classes as well - GDMonoClass *top = script->script_class; - while (top && top != script->native) { - top->fetch_methods_with_godot_api_checks(script->native); + GDMonoClass *top = p_script->script_class; + while (top && top != p_script->native) { + top->fetch_methods_with_godot_api_checks(p_script->native); top = top->get_parent_class(); } - script->load_script_signals(script->script_class, script->native); - script->_update_member_info_no_exports(); - - return script; + p_script->load_script_signals(p_script->script_class, p_script->native); +#ifdef TOOLS_ENABLED + p_script->_update_member_info_no_exports(); +#endif } bool CSharpScript::can_instance() const { diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index d31a1c35d2..eb168f344d 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -121,6 +121,7 @@ class CSharpScript : public Script { bool placeholder_fallback_enabled; bool exports_invalidated; void _update_exports_values(Map<StringName, Variant> &values, List<PropertyInfo> &propnames); + void _update_member_info_no_exports(); virtual void _placeholder_erased(PlaceHolderScriptInstance *p_placeholder); #endif @@ -131,7 +132,6 @@ class CSharpScript : public Script { void load_script_signals(GDMonoClass *p_class, GDMonoClass *p_native_class); bool _get_signal(GDMonoClass *p_class, GDMonoClass *p_delegate, Vector<Argument> ¶ms); - void _update_member_info_no_exports(); bool _update_exports(); #ifdef TOOLS_ENABLED bool _get_member_export(IMonoClassMember *p_member, bool p_inspect_export, PropertyInfo &r_prop_info, bool &r_exported); @@ -144,6 +144,7 @@ class CSharpScript : public Script { // Do not use unless you know what you are doing friend void GDMonoInternals::tie_managed_to_unmanaged(MonoObject *, Object *); static Ref<CSharpScript> create_for_managed_type(GDMonoClass *p_class, GDMonoClass *p_native); + static void initialize_for_managed_type(Ref<CSharpScript> p_script, GDMonoClass *p_class, GDMonoClass *p_native); protected: static void _bind_methods(); @@ -354,7 +355,9 @@ public: _FORCE_INLINE_ static CSharpLanguage *get_singleton() { return singleton; } +#ifdef TOOLS_ENABLED _FORCE_INLINE_ EditorPlugin *get_godotsharp_editor() const { return godotsharp_editor; } +#endif static void release_script_gchandle(Ref<MonoGCHandle> &p_gchandle); static void release_script_gchandle(MonoObject *p_expected_obj, Ref<MonoGCHandle> &p_gchandle); diff --git a/modules/mono/editor/GodotTools/GodotTools/CSharpProject.cs b/modules/mono/editor/GodotTools/GodotTools/CSharpProject.cs index 0426f0ac5a..3ba311c283 100644 --- a/modules/mono/editor/GodotTools/GodotTools/CSharpProject.cs +++ b/modules/mono/editor/GodotTools/GodotTools/CSharpProject.cs @@ -58,7 +58,7 @@ namespace GodotTools { var oldFileDict = (Dictionary) oldFileVar; - if (ulong.TryParse((string) oldFileDict["modified_time"], out ulong storedModifiedTime)) + if (ulong.TryParse(oldFileDict["modified_time"] as string, out ulong storedModifiedTime)) { if (storedModifiedTime == modifiedTime) { diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 1a440e5ced..45037bf637 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -875,14 +875,14 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir, Vect da->make_dir("Core"); da->make_dir("ObjectType"); - String core_dir = path_join(p_proj_dir, "Core"); - String obj_type_dir = path_join(p_proj_dir, "ObjectType"); + String core_dir = path::join(p_proj_dir, "Core"); + String obj_type_dir = path::join(p_proj_dir, "ObjectType"); // Generate source file for global scope constants and enums { StringBuilder constants_source; _generate_global_constants(constants_source); - String output_file = path_join(core_dir, BINDINGS_GLOBAL_SCOPE_CLASS "_constants.cs"); + String output_file = path::join(core_dir, BINDINGS_GLOBAL_SCOPE_CLASS "_constants.cs"); Error save_err = _save_file(output_file, constants_source); if (save_err != OK) return save_err; @@ -896,7 +896,7 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir, Vect if (itype.api_type == ClassDB::API_EDITOR) continue; - String output_file = path_join(obj_type_dir, itype.proxy_name + ".cs"); + String output_file = path::join(obj_type_dir, itype.proxy_name + ".cs"); Error err = _generate_cs_type(itype, output_file); if (err == ERR_SKIP) @@ -917,7 +917,7 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir, Vect const String &file_name = E->key(); const GodotCsCompressedFile &file_data = E->value(); - String output_file = path_join(core_dir, file_name); + String output_file = path::join(core_dir, file_name); Vector<uint8_t> data; data.resize(file_data.uncompressed_size); @@ -971,7 +971,7 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir, Vect cs_icalls_content.append(INDENT1 CLOSE_BLOCK CLOSE_BLOCK); - String internal_methods_file = path_join(core_dir, BINDINGS_CLASS_NATIVECALLS ".cs"); + String internal_methods_file = path::join(core_dir, BINDINGS_CLASS_NATIVECALLS ".cs"); Error err = _save_file(internal_methods_file, cs_icalls_content); if (err != OK) @@ -996,8 +996,8 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir, Ve da->make_dir("Core"); da->make_dir("ObjectType"); - String core_dir = path_join(p_proj_dir, "Core"); - String obj_type_dir = path_join(p_proj_dir, "ObjectType"); + String core_dir = path::join(p_proj_dir, "Core"); + String obj_type_dir = path::join(p_proj_dir, "ObjectType"); for (OrderedHashMap<StringName, TypeInterface>::Element E = obj_types.front(); E; E = E.next()) { const TypeInterface &itype = E.get(); @@ -1005,7 +1005,7 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir, Ve if (itype.api_type != ClassDB::API_EDITOR) continue; - String output_file = path_join(obj_type_dir, itype.proxy_name + ".cs"); + String output_file = path::join(obj_type_dir, itype.proxy_name + ".cs"); Error err = _generate_cs_type(itype, output_file); if (err == ERR_SKIP) @@ -1051,7 +1051,7 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir, Ve cs_icalls_content.append(INDENT1 CLOSE_BLOCK CLOSE_BLOCK); - String internal_methods_file = path_join(core_dir, BINDINGS_CLASS_NATIVECALLS_EDITOR ".cs"); + String internal_methods_file = path::join(core_dir, BINDINGS_CLASS_NATIVECALLS_EDITOR ".cs"); Error err = _save_file(internal_methods_file, cs_icalls_content); if (err != OK) @@ -1064,7 +1064,7 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir, Ve Error BindingsGenerator::generate_cs_api(const String &p_output_dir) { - String output_dir = DirAccess::get_full_path(p_output_dir, DirAccess::ACCESS_FILESYSTEM); + String output_dir = path::abspath(path::realpath(p_output_dir)); DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); ERR_FAIL_COND_V(!da, ERR_CANT_CREATE); @@ -1862,7 +1862,7 @@ Error BindingsGenerator::generate_glue(const String &p_output_dir) { output.append("\n#endif // MONO_GLUE_ENABLED\n"); - Error save_err = _save_file(path_join(p_output_dir, "mono_glue.gen.cpp"), output); + Error save_err = _save_file(path::join(p_output_dir, "mono_glue.gen.cpp"), output); if (save_err != OK) return save_err; @@ -2192,7 +2192,7 @@ void BindingsGenerator::_populate_object_type_interfaces() { itype.base_name = ClassDB::get_parent_class(type_cname); itype.is_singleton = Engine::get_singleton()->has_singleton(itype.proxy_name); - itype.is_instantiable = ClassDB::can_instance(type_cname) && !itype.is_singleton; + itype.is_instantiable = class_info->creation_func && !itype.is_singleton; itype.is_reference = ClassDB::is_parent_class(type_cname, name_cache.type_Reference); itype.memory_own = itype.is_reference; diff --git a/modules/mono/glue/base_object_glue.cpp b/modules/mono/glue/base_object_glue.cpp index 75b2dfce9a..6d85f55b97 100644 --- a/modules/mono/glue/base_object_glue.cpp +++ b/modules/mono/glue/base_object_glue.cpp @@ -219,7 +219,18 @@ MonoBoolean godot_icall_DynamicGodotObject_SetMember(Object *p_ptr, MonoString * } MonoString *godot_icall_Object_ToString(Object *p_ptr) { - return GDMonoMarshal::mono_string_from_godot(Variant(p_ptr).operator String()); +#ifdef DEBUG_ENABLED + // Cannot happen in C#; would get an ObjectDisposedException instead. + CRASH_COND(p_ptr == NULL); + + if (ScriptDebugger::get_singleton() && !Object::cast_to<Reference>(p_ptr)) { // Only if debugging! + // Cannot happen either in C#; the handle is nullified when the object is destroyed + CRASH_COND(!ObjectDB::instance_validate(p_ptr)); + } +#endif + + String result = "[" + p_ptr->get_class() + ":" + itos(p_ptr->get_instance_id()) + "]"; + return GDMonoMarshal::mono_string_from_godot(result); } void godot_register_object_icalls() { diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 7ae991eeaa..06fbae019c 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -241,9 +241,9 @@ void GDMono::initialize() { locations.push_back("/usr/local/var/homebrew/linked/mono/"); for (int i = 0; i < locations.size(); i++) { - String hint_assembly_rootdir = path_join(locations[i], "lib"); - String hint_mscorlib_path = path_join(hint_assembly_rootdir, "mono", "4.5", "mscorlib.dll"); - String hint_config_dir = path_join(locations[i], "etc"); + String hint_assembly_rootdir = path::join(locations[i], "lib"); + String hint_mscorlib_path = path::join(hint_assembly_rootdir, "mono", "4.5", "mscorlib.dll"); + String hint_config_dir = path::join(locations[i], "etc"); if (FileAccess::exists(hint_mscorlib_path) && DirAccess::exists(hint_config_dir)) { assembly_rootdir = hint_assembly_rootdir; @@ -564,6 +564,7 @@ bool GDMono::_load_corlib_assembly() { return success; } +#ifdef TOOLS_ENABLED static bool copy_api_assembly(const String &p_src_dir, const String &p_dst_dir, const String &p_assembly_name, APIAssembly::Type p_api_type) { // Create destination directory if needed @@ -607,6 +608,7 @@ static bool copy_api_assembly(const String &p_src_dir, const String &p_dst_dir, return true; } +#endif bool GDMono::_load_core_api_assembly() { diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp index 6e431f51e7..20863b1afe 100644 --- a/modules/mono/utils/path_utils.cpp +++ b/modules/mono/utils/path_utils.cpp @@ -36,16 +36,21 @@ #include "core/project_settings.h" #ifdef WINDOWS_ENABLED +#include <windows.h> + #define ENV_PATH_SEP ";" #else -#define ENV_PATH_SEP ":" #include <limits.h> +#include <unistd.h> + +#define ENV_PATH_SEP ":" #endif #include <stdlib.h> -String path_which(const String &p_name) { +namespace path { +String find_executable(const String &p_name) { #ifdef WINDOWS_ENABLED Vector<String> exts = OS::get_singleton()->get_environment("PATHEXT").split(ENV_PATH_SEP, false); #endif @@ -55,7 +60,7 @@ String path_which(const String &p_name) { return String(); for (int i = 0; i < env_path.size(); i++) { - String p = path_join(env_path[i], p_name); + String p = path::join(env_path[i], p_name); #ifdef WINDOWS_ENABLED for (int j = 0; j < exts.size(); j++) { @@ -73,42 +78,96 @@ String path_which(const String &p_name) { return String(); } -void fix_path(const String &p_path, String &r_out) { - r_out = p_path.replace("\\", "/"); +String cwd() { +#ifdef WINDOWS_ENABLED + const DWORD expected_size = ::GetCurrentDirectoryW(0, NULL); + + String buffer; + buffer.resize((int)expected_size); + if (::GetCurrentDirectoryW(expected_size, buffer.ptrw()) == 0) + return "."; + + return buffer.simplify_path(); +#else + char buffer[PATH_MAX]; + if (::getcwd(buffer, sizeof(buffer)) == NULL) + return "."; + + String result; + if (result.parse_utf8(buffer)) + return "."; - while (true) { // in case of using 2 or more slash - String compare = r_out.replace("//", "/"); - if (r_out == compare) - break; - else - r_out = compare; + return result.simplify_path(); +#endif +} + +String abspath(const String &p_path) { + if (p_path.is_abs_path()) { + return p_path.simplify_path(); + } else { + return path::join(path::cwd(), p_path).simplify_path(); } } -bool rel_path_to_abs(const String &p_existing_path, String &r_abs_path) { +String realpath(const String &p_path) { #ifdef WINDOWS_ENABLED - CharType ret[_MAX_PATH]; - if (::_wfullpath(ret, p_existing_path.c_str(), _MAX_PATH)) { - String abspath = String(ret).replace("\\", "/"); - int pos = abspath.find(":/"); - if (pos != -1) { - r_abs_path = abspath.substr(pos - 1, abspath.length()); - } else { - r_abs_path = abspath; - } - return true; - } -#else - char *resolved_path = ::realpath(p_existing_path.utf8().get_data(), NULL); - if (resolved_path) { - String retstr; - bool success = !retstr.parse_utf8(resolved_path); - ::free(resolved_path); - if (success) { - r_abs_path = retstr; - return true; - } + // Open file without read/write access + HANDLE hFile = ::CreateFileW(p_path.c_str(), 0, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + + if (hFile == INVALID_HANDLE_VALUE) + return p_path; + + const DWORD expected_size = ::GetFinalPathNameByHandleW(hFile, NULL, 0, FILE_NAME_NORMALIZED); + + if (expected_size == 0) { + ::CloseHandle(hFile); + return p_path; } + + String buffer; + buffer.resize((int)expected_size); + ::GetFinalPathNameByHandleW(hFile, buffer.ptrw(), expected_size, FILE_NAME_NORMALIZED); + + ::CloseHandle(hFile); + return buffer.simplify_path(); +#elif UNIX_ENABLED + char *resolved_path = ::realpath(p_path.utf8().get_data(), NULL); + + if (!resolved_path) + return p_path; + + String result; + bool parse_ok = result.parse_utf8(resolved_path); + ::free(resolved_path); + + if (parse_ok) + return p_path; + + return result.simplify_path(); #endif - return false; } + +String join(const String &p_a, const String &p_b) { + if (p_a.empty()) + return p_b; + + const CharType a_last = p_a[p_a.length() - 1]; + if ((a_last == '/' || a_last == '\\') || + (p_b.size() > 0 && (p_b[0] == '/' || p_b[0] == '\\'))) { + return p_a + p_b; + } + + return p_a + "/" + p_b; +} + +String join(const String &p_a, const String &p_b, const String &p_c) { + return path::join(path::join(p_a, p_b), p_c); +} + +String join(const String &p_a, const String &p_b, const String &p_c, const String &p_d) { + return path::join(path::join(path::join(p_a, p_b), p_c), p_d); +} + +} // namespace path diff --git a/modules/mono/utils/path_utils.h b/modules/mono/utils/path_utils.h index 69edf4deb7..ca25bc09f7 100644 --- a/modules/mono/utils/path_utils.h +++ b/modules/mono/utils/path_utils.h @@ -31,24 +31,32 @@ #ifndef PATH_UTILS_H #define PATH_UTILS_H +#include "core/string_builder.h" #include "core/ustring.h" -_FORCE_INLINE_ String path_join(const String &e1, const String &e2) { - return e1.plus_file(e2); -} +namespace path { -_FORCE_INLINE_ String path_join(const String &e1, const String &e2, const String &e3) { - return e1.plus_file(e2).plus_file(e3); -} +String join(const String &p_a, const String &p_b); +String join(const String &p_a, const String &p_b, const String &p_c); +String join(const String &p_a, const String &p_b, const String &p_c, const String &p_d); -_FORCE_INLINE_ String path_join(const String &e1, const String &e2, const String &e3, const String &e4) { - return e1.plus_file(e2).plus_file(e3).plus_file(e4); -} +String find_executable(const String &p_name); -String path_which(const String &p_name); +/// Returns a normalized absolute path to the current working directory +String cwd(); -void fix_path(const String &p_path, String &r_out); +/** + * Obtains a normalized absolute path to p_path. Symbolic links are + * not resolved. The path p_path might not exist in the file system. + */ +String abspath(const String &p_path); -bool rel_path_to_abs(const String &p_existing_path, String &r_abs_path); +/** + * Obtains a normalized path to p_path with symbolic links resolved. + * The resulting path might be either a relative or an absolute path. + */ +String realpath(const String &p_path); + +} // namespace path #endif // PATH_UTILS_H diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 4579644d49..31d5e4665a 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -341,74 +341,74 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { Color color; if (dark_theme) switch (p_type) { - case Variant::NIL: color = Color::html("#69ecbd"); break; - - case Variant::BOOL: color = Color::html("#8da6f0"); break; - case Variant::INT: color = Color::html("#7dc6ef"); break; - case Variant::REAL: color = Color::html("#61daf4"); break; - case Variant::STRING: color = Color::html("#6ba7ec"); break; - - case Variant::VECTOR2: color = Color::html("#bd91f1"); break; - case Variant::RECT2: color = Color::html("#f191a5"); break; - case Variant::VECTOR3: color = Color::html("#d67dee"); break; - case Variant::TRANSFORM2D: color = Color::html("#c4ec69"); break; - case Variant::PLANE: color = Color::html("#f77070"); break; - case Variant::QUAT: color = Color::html("#ec69a3"); break; - case Variant::AABB: color = Color::html("#ee7991"); break; - case Variant::BASIS: color = Color::html("#e3ec69"); break; - case Variant::TRANSFORM: color = Color::html("#f6a86e"); break; - - case Variant::COLOR: color = Color::html("#9dff70"); break; - case Variant::NODE_PATH: color = Color::html("#6993ec"); break; - case Variant::_RID: color = Color::html("#69ec9a"); break; - case Variant::OBJECT: color = Color::html("#79f3e8"); break; - case Variant::DICTIONARY: color = Color::html("#77edb1"); break; - - case Variant::ARRAY: color = Color::html("#e0e0e0"); break; - case Variant::POOL_BYTE_ARRAY: color = Color::html("#aaf4c8"); break; - case Variant::POOL_INT_ARRAY: color = Color::html("#afdcf5"); break; - case Variant::POOL_REAL_ARRAY: color = Color::html("#97e7f8"); break; - case Variant::POOL_STRING_ARRAY: color = Color::html("#9dc4f2"); break; - case Variant::POOL_VECTOR2_ARRAY: color = Color::html("#d1b3f5"); break; - case Variant::POOL_VECTOR3_ARRAY: color = Color::html("#df9bf2"); break; - case Variant::POOL_COLOR_ARRAY: color = Color::html("#e9ff97"); break; + case Variant::NIL: color = Color(0.41, 0.93, 0.74); break; + + case Variant::BOOL: color = Color(0.55, 0.65, 0.94); break; + case Variant::INT: color = Color(0.49, 0.78, 0.94); break; + case Variant::REAL: color = Color(0.38, 0.85, 0.96); break; + case Variant::STRING: color = Color(0.42, 0.65, 0.93); break; + + case Variant::VECTOR2: color = Color(0.74, 0.57, 0.95); break; + case Variant::RECT2: color = Color(0.95, 0.57, 0.65); break; + case Variant::VECTOR3: color = Color(0.84, 0.49, 0.93); break; + case Variant::TRANSFORM2D: color = Color(0.77, 0.93, 0.41); break; + case Variant::PLANE: color = Color(0.97, 0.44, 0.44); break; + case Variant::QUAT: color = Color(0.93, 0.41, 0.64); break; + case Variant::AABB: color = Color(0.93, 0.47, 0.57); break; + case Variant::BASIS: color = Color(0.89, 0.93, 0.41); break; + case Variant::TRANSFORM: color = Color(0.96, 0.66, 0.43); break; + + case Variant::COLOR: color = Color(0.62, 1.0, 0.44); break; + case Variant::NODE_PATH: color = Color(0.41, 0.58, 0.93); break; + case Variant::_RID: color = Color(0.41, 0.93, 0.6); break; + case Variant::OBJECT: color = Color(0.47, 0.95, 0.91); break; + case Variant::DICTIONARY: color = Color(0.47, 0.93, 0.69); break; + + case Variant::ARRAY: color = Color(0.88, 0.88, 0.88); break; + case Variant::POOL_BYTE_ARRAY: color = Color(0.67, 0.96, 0.78); break; + case Variant::POOL_INT_ARRAY: color = Color(0.69, 0.86, 0.96); break; + case Variant::POOL_REAL_ARRAY: color = Color(0.59, 0.91, 0.97); break; + case Variant::POOL_STRING_ARRAY: color = Color(0.62, 0.77, 0.95); break; + case Variant::POOL_VECTOR2_ARRAY: color = Color(0.82, 0.7, 0.96); break; + case Variant::POOL_VECTOR3_ARRAY: color = Color(0.87, 0.61, 0.95); break; + case Variant::POOL_COLOR_ARRAY: color = Color(0.91, 1.0, 0.59); break; default: color.set_hsv(p_type / float(Variant::VARIANT_MAX), 0.7, 0.7); } else switch (p_type) { - case Variant::NIL: color = Color::html("#25e3a0"); break; - - case Variant::BOOL: color = Color::html("#6d8eeb"); break; - case Variant::INT: color = Color::html("#4fb2e9"); break; - case Variant::REAL: color = Color::html("#27ccf0"); break; - case Variant::STRING: color = Color::html("#4690e7"); break; - - case Variant::VECTOR2: color = Color::html("#ad76ee"); break; - case Variant::RECT2: color = Color::html("#ee758e"); break; - case Variant::VECTOR3: color = Color::html("#dc6aed"); break; - case Variant::TRANSFORM2D: color = Color::html("#96ce1a"); break; - case Variant::PLANE: color = Color::html("#f77070"); break; - case Variant::QUAT: color = Color::html("#ec69a3"); break; - case Variant::AABB: color = Color::html("#ee7991"); break; - case Variant::BASIS: color = Color::html("#b2bb19"); break; - case Variant::TRANSFORM: color = Color::html("#f49047"); break; - - case Variant::COLOR: color = Color::html("#3cbf00"); break; - case Variant::NODE_PATH: color = Color::html("#6993ec"); break; - case Variant::_RID: color = Color::html("#2ce573"); break; - case Variant::OBJECT: color = Color::html("#12d5c3"); break; - case Variant::DICTIONARY: color = Color::html("#57e99f"); break; - - case Variant::ARRAY: color = Color::html("#737373"); break; - case Variant::POOL_BYTE_ARRAY: color = Color::html("#61ea98"); break; - case Variant::POOL_INT_ARRAY: color = Color::html("#61baeb"); break; - case Variant::POOL_REAL_ARRAY: color = Color::html("#40d3f2"); break; - case Variant::POOL_STRING_ARRAY: color = Color::html("#609fea"); break; - case Variant::POOL_VECTOR2_ARRAY: color = Color::html("#9d5dea"); break; - case Variant::POOL_VECTOR3_ARRAY: color = Color::html("#ca5aea"); break; - case Variant::POOL_COLOR_ARRAY: color = Color::html("#92ba00"); break; + case Variant::NIL: color = Color(0.15, 0.89, 0.63); break; + + case Variant::BOOL: color = Color(0.43, 0.56, 0.92); break; + case Variant::INT: color = Color(0.31, 0.7, 0.91); break; + case Variant::REAL: color = Color(0.15, 0.8, 0.94); break; + case Variant::STRING: color = Color(0.27, 0.56, 0.91); break; + + case Variant::VECTOR2: color = Color(0.68, 0.46, 0.93); break; + case Variant::RECT2: color = Color(0.93, 0.46, 0.56); break; + case Variant::VECTOR3: color = Color(0.86, 0.42, 0.93); break; + case Variant::TRANSFORM2D: color = Color(0.59, 0.81, 0.1); break; + case Variant::PLANE: color = Color(0.97, 0.44, 0.44); break; + case Variant::QUAT: color = Color(0.93, 0.41, 0.64); break; + case Variant::AABB: color = Color(0.93, 0.47, 0.57); break; + case Variant::BASIS: color = Color(0.7, 0.73, 0.1); break; + case Variant::TRANSFORM: color = Color(0.96, 0.56, 0.28); break; + + case Variant::COLOR: color = Color(0.24, 0.75, 0.0); break; + case Variant::NODE_PATH: color = Color(0.41, 0.58, 0.93); break; + case Variant::_RID: color = Color(0.17, 0.9, 0.45); break; + case Variant::OBJECT: color = Color(0.07, 0.84, 0.76); break; + case Variant::DICTIONARY: color = Color(0.34, 0.91, 0.62); break; + + case Variant::ARRAY: color = Color(0.45, 0.45, 0.45); break; + case Variant::POOL_BYTE_ARRAY: color = Color(0.38, 0.92, 0.6); break; + case Variant::POOL_INT_ARRAY: color = Color(0.38, 0.73, 0.92); break; + case Variant::POOL_REAL_ARRAY: color = Color(0.25, 0.83, 0.95); break; + case Variant::POOL_STRING_ARRAY: color = Color(0.38, 0.62, 0.92); break; + case Variant::POOL_VECTOR2_ARRAY: color = Color(0.62, 0.36, 0.92); break; + case Variant::POOL_VECTOR3_ARRAY: color = Color(0.79, 0.35, 0.92); break; + case Variant::POOL_COLOR_ARRAY: color = Color(0.57, 0.73, 0.0); break; default: color.set_hsv(p_type / float(Variant::VARIANT_MAX), 0.3, 0.3); @@ -3054,19 +3054,19 @@ void VisualScriptEditor::_notification(int p_what) { List<Pair<String, Color> > colors; if (dark_theme) { - colors.push_back(Pair<String, Color>("flow_control", Color::html("#f4f4f4"))); - colors.push_back(Pair<String, Color>("functions", Color::html("#f58581"))); - colors.push_back(Pair<String, Color>("data", Color::html("#80f6cf"))); - colors.push_back(Pair<String, Color>("operators", Color::html("#ab97df"))); - colors.push_back(Pair<String, Color>("custom", Color::html("#80bbf6"))); - colors.push_back(Pair<String, Color>("constants", Color::html("#f680b0"))); + colors.push_back(Pair<String, Color>("flow_control", Color(0.96, 0.96, 0.96))); + colors.push_back(Pair<String, Color>("functions", Color(0.96, 0.52, 0.51))); + colors.push_back(Pair<String, Color>("data", Color(0.5, 0.96, 0.81))); + colors.push_back(Pair<String, Color>("operators", Color(0.67, 0.59, 0.87))); + colors.push_back(Pair<String, Color>("custom", Color(0.5, 0.73, 0.96))); + colors.push_back(Pair<String, Color>("constants", Color(0.96, 0.5, 0.69))); } else { - colors.push_back(Pair<String, Color>("flow_control", Color::html("#424242"))); - colors.push_back(Pair<String, Color>("functions", Color::html("#f26661"))); - colors.push_back(Pair<String, Color>("data", Color::html("#13bb83"))); - colors.push_back(Pair<String, Color>("operators", Color::html("#8265d0"))); - colors.push_back(Pair<String, Color>("custom", Color::html("#4ea0f2"))); - colors.push_back(Pair<String, Color>("constants", Color::html("#f02f7d"))); + colors.push_back(Pair<String, Color>("flow_control", Color(0.26, 0.26, 0.26))); + colors.push_back(Pair<String, Color>("functions", Color(0.95, 0.4, 0.38))); + colors.push_back(Pair<String, Color>("data", Color(0.07, 0.73, 0.51))); + colors.push_back(Pair<String, Color>("operators", Color(0.51, 0.4, 0.82))); + colors.push_back(Pair<String, Color>("custom", Color(0.31, 0.63, 0.95))); + colors.push_back(Pair<String, Color>("constants", Color(0.94, 0.18, 0.49))); } for (List<Pair<String, Color> >::Element *E = colors.front(); E; E = E->next()) { diff --git a/modules/websocket/wsl_client.cpp b/modules/websocket/wsl_client.cpp index b2d865a58f..86374e8f80 100644 --- a/modules/websocket/wsl_client.cpp +++ b/modules/websocket/wsl_client.cpp @@ -92,6 +92,7 @@ void WSLClient::_do_handshake() { data->id = 1; _peer->make_context(data, _in_buf_size, _in_pkt_size, _out_buf_size, _out_pkt_size); _on_connect(protocol); + break; } _resp_pos += 1; } diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index b7ace804ef..c7f622dee3 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -663,7 +663,7 @@ StringName AnimatedSprite::get_animation() const { String AnimatedSprite::get_configuration_warning() const { if (frames.is_null()) { - return TTR("A SpriteFrames resource must be created or set in the 'Frames' property in order for AnimatedSprite to display frames."); + return TTR("A SpriteFrames resource must be created or set in the \"Frames\" property in order for AnimatedSprite to display frames."); } return String(); diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index 36c88e395a..202c7c9cf2 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -389,7 +389,7 @@ String CollisionObject2D::get_configuration_warning() const { if (shapes.empty()) { if (!warning.empty()) { - warning += "\n"; + warning += "\n\n"; } warning += TTR("This node has no shape, so it can't collide or interact with other objects.\nConsider adding a CollisionShape2D or CollisionPolygon2D as a child to define its shape."); } diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 7f01ff8806..7b3eab175a 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -347,7 +347,7 @@ void Light2D::_notification(int p_what) { String Light2D::get_configuration_warning() const { if (!texture.is_valid()) { - return TTR("A texture with the shape of the light must be supplied to the 'texture' property."); + return TTR("A texture with the shape of the light must be supplied to the \"Texture\" property."); } return String(); diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index 3a3f90ac4b..313b23b9d4 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -268,7 +268,7 @@ String LightOccluder2D::get_configuration_warning() const { } if (occluder_polygon.is_valid() && occluder_polygon->get_polygon().size() == 0) { - return TTR("The occluder polygon for this occluder is empty. Please draw a polygon!"); + return TTR("The occluder polygon for this occluder is empty. Please draw a polygon."); } return String(); diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 95acf13fad..39b3375f09 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -963,7 +963,7 @@ String RigidBody2D::get_configuration_warning() const { if ((get_mode() == MODE_RIGID || get_mode() == MODE_CHARACTER) && (ABS(t.elements[0].length() - 1.0) > 0.05 || ABS(t.elements[1].length() - 1.0) > 0.05)) { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } warning += TTR("Size changes to RigidBody2D (in character or rigid modes) will be overridden by the physics engine when running.\nChange the size in children collision shapes instead."); } diff --git a/scene/2d/skeleton_2d.cpp b/scene/2d/skeleton_2d.cpp index aa15255384..bf43fca864 100644 --- a/scene/2d/skeleton_2d.cpp +++ b/scene/2d/skeleton_2d.cpp @@ -137,7 +137,7 @@ String Bone2D::get_configuration_warning() const { String warning = Node2D::get_configuration_warning(); if (!skeleton) { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } if (parent_bone) { warning += TTR("This Bone2D chain should end at a Skeleton2D node."); @@ -148,7 +148,7 @@ String Bone2D::get_configuration_warning() const { if (rest == Transform2D(0, 0, 0, 0, 0, 0)) { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } warning += TTR("This bone lacks a proper REST pose. Go to the Skeleton2D node and set one."); } diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index cf544a5473..c79cd80e2e 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -1780,7 +1780,7 @@ String TileMap::get_configuration_warning() const { if (use_parent && !collision_parent) { if (!warning.empty()) { - warning += "\n"; + warning += "\n\n"; } return TTR("TileMap with Use Parent on needs a parent CollisionObject2D to give shapes to. Please use it as a child of Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."); } diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index 1cf037daf2..a1d074e6cd 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -327,7 +327,7 @@ void VisibilityEnabler2D::_node_removed(Node *p_node) { String VisibilityEnabler2D::get_configuration_warning() const { #ifdef TOOLS_ENABLED if (is_inside_tree() && get_parent() && (get_parent()->get_filename() == String() && get_parent() != get_tree()->get_edited_scene_root())) { - return TTR("VisibilityEnable2D works best when used with the edited scene root directly as parent."); + return TTR("VisibilityEnabler2D works best when used with the edited scene root directly as parent."); } #endif return String(); diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp index dfa8fce9be..263a2d8de6 100644 --- a/scene/3d/arvr_nodes.cpp +++ b/scene/3d/arvr_nodes.cpp @@ -61,7 +61,7 @@ String ARVRCamera::get_configuration_warning() const { // must be child node of ARVROrigin! ARVROrigin *origin = Object::cast_to<ARVROrigin>(get_parent()); if (origin == NULL) { - return TTR("ARVRCamera must have an ARVROrigin node as its parent"); + return TTR("ARVRCamera must have an ARVROrigin node as its parent."); }; return String(); diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp index fc46cf5bdb..9d3e2983c4 100644 --- a/scene/3d/collision_object.cpp +++ b/scene/3d/collision_object.cpp @@ -371,7 +371,7 @@ String CollisionObject::get_configuration_warning() const { if (shapes.empty()) { if (warning == String()) { - warning += "\n"; + warning += "\n\n"; } warning += TTR("This node has no shape, so it can't collide or interact with other objects.\nConsider adding a CollisionShape or CollisionPolygon as a child to define its shape."); } diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp index 219ea56681..2b030641eb 100644 --- a/scene/3d/collision_shape.cpp +++ b/scene/3d/collision_shape.cpp @@ -120,7 +120,7 @@ String CollisionShape::get_configuration_warning() const { } if (!shape.is_valid()) { - return TTR("A shape must be provided for CollisionShape to function. Please create a shape resource for it!"); + return TTR("A shape must be provided for CollisionShape to function. Please create a shape resource for it."); } if (shape->is_class("PlaneShape")) { diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 2e64872616..4ef945ab8d 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -51,6 +51,7 @@ void Light::set_param(Param p_param, float p_value) { if (p_param == PARAM_SPOT_ANGLE) { _change_notify("spot_angle"); + update_configuration_warning(); } else if (p_param == PARAM_RANGE) { _change_notify("omni_range"); _change_notify("spot_range"); @@ -68,6 +69,10 @@ void Light::set_shadow(bool p_enable) { shadow = p_enable; VS::get_singleton()->light_set_shadow(light, p_enable); + + if (type == VisualServer::LIGHT_SPOT) { + update_configuration_warning(); + } } bool Light::has_shadow() const { @@ -465,6 +470,20 @@ OmniLight::OmniLight() : set_shadow_detail(SHADOW_DETAIL_HORIZONTAL); } +String SpotLight::get_configuration_warning() const { + String warning = Light::get_configuration_warning(); + + if (has_shadow() && get_param(PARAM_SPOT_ANGLE) >= 90.0) { + if (warning != String()) { + warning += "\n\n"; + } + + warning += TTR("A SpotLight with an angle wider than 90 degrees cannot cast shadows."); + } + + return warning; +} + void SpotLight::_bind_methods() { ADD_GROUP("Spot", "spot_"); diff --git a/scene/3d/light.h b/scene/3d/light.h index ddd5bc6b3a..5d365758b5 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -221,6 +221,8 @@ protected: static void _bind_methods(); public: + virtual String get_configuration_warning() const; + SpotLight() : Light(VisualServer::LIGHT_SPOT) {} }; diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index 84078911cb..d55c795d38 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -270,7 +270,7 @@ String PathFollow::get_configuration_warning() const { } else { Path *path = Object::cast_to<Path>(get_parent()); if (path->get_curve().is_valid() && !path->get_curve()->is_up_vector_enabled() && rotation_mode == ROTATION_ORIENTED) { - return TTR("PathFollow ROTATION_ORIENTED requires \"Up Vector\" enabled in its parent Path's Curve resource."); + return TTR("PathFollow's ROTATION_ORIENTED requires \"Up Vector\" to be enabled in its parent Path's Curve resource."); } } diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index d3aad7000d..2f8b2ecc5c 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -934,7 +934,7 @@ String RigidBody::get_configuration_warning() const { if ((get_mode() == MODE_RIGID || get_mode() == MODE_CHARACTER) && (ABS(t.basis.get_axis(0).length() - 1.0) > 0.05 || ABS(t.basis.get_axis(1).length() - 1.0) > 0.05 || ABS(t.basis.get_axis(2).length() - 1.0) > 0.05)) { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } warning += TTR("Size changes to RigidBody (in character or rigid modes) will be overridden by the physics engine when running.\nChange the size in children collision shapes instead."); } diff --git a/scene/3d/remote_transform.cpp b/scene/3d/remote_transform.cpp index add77e0272..28c6fbf5f7 100644 --- a/scene/3d/remote_transform.cpp +++ b/scene/3d/remote_transform.cpp @@ -177,7 +177,7 @@ bool RemoteTransform::get_update_scale() const { String RemoteTransform::get_configuration_warning() const { if (!has_node(remote_node) || !Object::cast_to<Spatial>(get_node(remote_node))) { - return TTR("Path property must point to a valid Spatial node to work."); + return TTR("The \"Remote Path\" property must point to a valid Spatial or Spatial-derived node to work."); } return String(); diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index d0f8799a64..67c79d8b5a 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -1061,7 +1061,7 @@ StringName AnimatedSprite3D::get_animation() const { String AnimatedSprite3D::get_configuration_warning() const { if (frames.is_null()) { - return TTR("A SpriteFrames resource must be created or set in the 'Frames' property in order for AnimatedSprite3D to display frames."); + return TTR("A SpriteFrames resource must be created or set in the \"Frames\" property in order for AnimatedSprite3D to display frames."); } return String(); diff --git a/scene/3d/world_environment.cpp b/scene/3d/world_environment.cpp index 3cd43cbf5b..8d46b4161d 100644 --- a/scene/3d/world_environment.cpp +++ b/scene/3d/world_environment.cpp @@ -80,7 +80,7 @@ Ref<Environment> WorldEnvironment::get_environment() const { String WorldEnvironment::get_configuration_warning() const { if (!environment.is_valid()) { - return TTR("WorldEnvironment needs an Environment resource."); + return TTR("WorldEnvironment requires its \"Environment\" property to contain an Environment to have a visible effect."); } if (/*!is_visible_in_tree() ||*/ !is_inside_tree()) diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 54f0fdc26a..6745b57cff 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -1342,15 +1342,15 @@ String AnimationTree::get_configuration_warning() const { if (!root.is_valid()) { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } - warning += TTR("A root AnimationNode for the graph is not set."); + warning += TTR("No root AnimationNode for the graph is set."); } if (!has_node(animation_player)) { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } warning += TTR("Path to an AnimationPlayer node containing animations is not set."); @@ -1361,7 +1361,7 @@ String AnimationTree::get_configuration_warning() const { if (!player) { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } warning += TTR("Path set for AnimationPlayer does not lead to an AnimationPlayer node."); @@ -1370,10 +1370,10 @@ String AnimationTree::get_configuration_warning() const { if (!player->has_node(player->get_root())) { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } - warning += TTR("AnimationPlayer root is not a valid node."); + warning += TTR("The AnimationPlayer root node is not a valid node."); return warning; } diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index c9cf5f8308..449076f863 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -175,9 +175,9 @@ String Container::get_configuration_warning() const { if (get_class() == "Container" && get_script().is_null()) { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } - warning += TTR("Container by itself serves no purpose unless a script configures its children placement behavior.\nIf you don't intend to add a script, then please use a plain 'Control' node instead."); + warning += TTR("Container by itself serves no purpose unless a script configures its children placement behavior.\nIf you don't intend to add a script, use a plain Control node instead."); } return warning; } diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index eccd42cb9f..26be17f6c1 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2711,7 +2711,7 @@ String Control::get_configuration_warning() const { if (data.mouse_filter == MOUSE_FILTER_IGNORE && data.tooltip != "") { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } warning += TTR("The Hint Tooltip won't be displayed as the control's Mouse Filter is set to \"Ignore\". To solve this, set the Mouse Filter to \"Stop\" or \"Pass\"."); } diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 9e996e5519..3e003af396 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -234,7 +234,7 @@ Popup::Popup() { String Popup::get_configuration_warning() const { if (is_visible_in_tree()) { - return TTR("Popups will hide by default unless you call popup() or any of the popup*() functions. Making them visible for editing is fine though, but they will hide upon running."); + return TTR("Popups will hide by default unless you call popup() or any of the popup*() functions. Making them visible for editing is fine, but they will hide upon running."); } return String(); diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index d00acaf08a..e709bac377 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -35,9 +35,9 @@ String Range::get_configuration_warning() const { if (shared->exp_ratio && shared->min <= 0) { if (warning != String()) { - warning += "\n"; + warning += "\n\n"; } - warning += TTR("If exp_edit is true min_value must be > 0."); + warning += TTR("If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0."); } return warning; diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 5b91299de6..d6c0981ebc 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1942,37 +1942,37 @@ Error RichTextLabel::append_bbcode(const String &p_bbcode) { if (col.begins_with("#")) color = Color::html(col); else if (col == "aqua") - color = Color::html("#00FFFF"); + color = Color(0, 1, 1); else if (col == "black") - color = Color::html("#000000"); + color = Color(0, 0, 0); else if (col == "blue") - color = Color::html("#0000FF"); + color = Color(0, 0, 1); else if (col == "fuchsia") - color = Color::html("#FF00FF"); + color = Color(1, 0, 1); else if (col == "gray" || col == "grey") - color = Color::html("#808080"); + color = Color(0.5, 0.5, 0.5); else if (col == "green") - color = Color::html("#008000"); + color = Color(0, 0.5, 0); else if (col == "lime") - color = Color::html("#00FF00"); + color = Color(0, 1, 0); else if (col == "maroon") - color = Color::html("#800000"); + color = Color(0.5, 0, 0); else if (col == "navy") - color = Color::html("#000080"); + color = Color(0, 0, 0.5); else if (col == "olive") - color = Color::html("#808000"); + color = Color(0.5, 0.5, 0); else if (col == "purple") - color = Color::html("#800080"); + color = Color(0.5, 0, 0.5); else if (col == "red") - color = Color::html("#FF0000"); + color = Color(1, 0, 0); else if (col == "silver") - color = Color::html("#C0C0C0"); + color = Color(0.75, 0.75, 0.75); else if (col == "teal") - color = Color::html("#008008"); + color = Color(0, 0.5, 0.5); else if (col == "white") - color = Color::html("#FFFFFF"); + color = Color(1, 1, 1); else if (col == "yellow") - color = Color::html("#FFFF00"); + color = Color(1, 1, 0); else color = base_color; diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index d83ae47671..461281a4ed 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -486,7 +486,7 @@ String ScrollContainer::get_configuration_warning() const { } if (found != 1) - return TTR("ScrollContainer is intended to work with a single child control.\nUse a container as child (VBox,HBox,etc), or a Control and set the custom minimum size manually."); + return TTR("ScrollContainer is intended to work with a single child control.\nUse a container as child (VBox, HBox, etc.), or a Control and set the custom minimum size manually."); else return ""; } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index a7b4e08553..7a937843ab 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3287,28 +3287,6 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } break; - case KEY_U: { - if (!k->get_command() || k->get_shift()) { - scancode_handled = false; - break; - } else { - if (selection.active) { - int ini = selection.from_line; - int end = selection.to_line; - - for (int i = ini; i <= end; i++) { - _uncomment_line(i); - } - } else { - _uncomment_line(cursor.line); - if (cursor.column >= get_line(cursor.line).length()) { - cursor.column = MAX(0, get_line(cursor.line).length() - 1); - } - } - update(); - } - } break; - default: { scancode_handled = false; @@ -3367,24 +3345,6 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { } } -void TextEdit::_uncomment_line(int p_line) { - String line_text = get_line(p_line); - for (int i = 0; i < line_text.length(); i++) { - if (line_text[i] == '#') { - _remove_text(p_line, i, p_line, i + 1); - if (p_line == selection.to_line && selection.to_column > line_text.length() - 1) { - selection.to_column -= 1; - if (selection.to_column >= selection.from_column) { - selection.active = false; - } - } - return; - } else if (line_text[i] != '\t' && line_text[i] != ' ') { - return; - } - } -} - void TextEdit::_scroll_up(real_t p_delta) { if (scrolling && smooth_scroll_enabled && SGN(target_v_scroll - v_scroll->get_value()) != SGN(-p_delta)) diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 9fb8e03288..b47dac0902 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -395,7 +395,6 @@ private: void _update_selection_mode_word(); void _update_selection_mode_line(); - void _uncomment_line(int p_line); void _scroll_up(real_t p_delta); void _scroll_down(real_t p_delta); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 8624baa005..4005505830 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -571,21 +571,7 @@ int TreeItem::get_button_by_id(int p_column, int p_id) const { return -1; } -void TreeItem::set_disable_button(int p_column, int p_idx, bool p_disabled) { - ERR_FAIL_INDEX(p_column, cells.size()); - ERR_FAIL_INDEX(p_idx, cells[p_column].buttons.size()); - - cells.write[p_column].buttons.write[p_idx].disabled = p_disabled; - _changed_notify(p_column); -} -bool TreeItem::is_button_disabled(int p_column, int p_idx) const { - - ERR_FAIL_INDEX_V(p_column, cells.size(), false); - ERR_FAIL_INDEX_V(p_idx, cells[p_column].buttons.size(), false); - - return cells[p_column].buttons[p_idx].disabled; -} void TreeItem::set_button(int p_column, int p_idx, const Ref<Texture> &p_button) { ERR_FAIL_COND(p_button.is_null()); @@ -603,6 +589,23 @@ void TreeItem::set_button_color(int p_column, int p_idx, const Color &p_color) { _changed_notify(p_column); } +void TreeItem::set_button_disabled(int p_column, int p_idx, bool p_disabled) { + + ERR_FAIL_INDEX(p_column, cells.size()); + ERR_FAIL_INDEX(p_idx, cells[p_column].buttons.size()); + + cells.write[p_column].buttons.write[p_idx].disabled = p_disabled; + _changed_notify(p_column); +} + +bool TreeItem::is_button_disabled(int p_column, int p_idx) const { + + ERR_FAIL_INDEX_V(p_column, cells.size(), false); + ERR_FAIL_INDEX_V(p_idx, cells[p_column].buttons.size(), false); + + return cells[p_column].buttons[p_idx].disabled; +} + void TreeItem::set_editable(int p_column, bool p_editable) { ERR_FAIL_INDEX(p_column, cells.size()); @@ -792,8 +795,8 @@ void TreeItem::_bind_methods() { ClassDB::bind_method(D_METHOD("get_button", "column", "button_idx"), &TreeItem::get_button); ClassDB::bind_method(D_METHOD("set_button", "column", "button_idx", "button"), &TreeItem::set_button); ClassDB::bind_method(D_METHOD("erase_button", "column", "button_idx"), &TreeItem::erase_button); + ClassDB::bind_method(D_METHOD("set_button_disabled", "column", "button_idx", "disabled"), &TreeItem::set_button_disabled); ClassDB::bind_method(D_METHOD("is_button_disabled", "column", "button_idx"), &TreeItem::is_button_disabled); - ClassDB::bind_method(D_METHOD("set_disable_button", "column", "button_idx", "disabled"), &TreeItem::set_disable_button); ClassDB::bind_method(D_METHOD("set_expand_right", "column", "enable"), &TreeItem::set_expand_right); ClassDB::bind_method(D_METHOD("get_expand_right", "column"), &TreeItem::get_expand_right); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 6e5e2c1eba..b6cdab766f 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -209,10 +209,10 @@ public: int get_button_id(int p_column, int p_idx) const; void erase_button(int p_column, int p_idx); int get_button_by_id(int p_column, int p_id) const; - bool is_button_disabled(int p_column, int p_idx) const; void set_button(int p_column, int p_idx, const Ref<Texture> &p_button); void set_button_color(int p_column, int p_idx, const Color &p_color); - void set_disable_button(int p_column, int p_idx, bool p_disabled); + void set_button_disabled(int p_column, int p_idx, bool p_disabled); + bool is_button_disabled(int p_column, int p_idx) const; /* range works for mode number or mode combo */ diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index cf6ce3a5ef..fb0fb4f8e3 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -177,13 +177,13 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const // Font Colors - Color control_font_color = Color::html("e0e0e0"); - Color control_font_color_lower = Color::html("a0a0a0"); - Color control_font_color_low = Color::html("b0b0b0"); - Color control_font_color_hover = Color::html("f0f0f0"); + Color control_font_color = Color(0.88, 0.88, 0.88); + Color control_font_color_lower = Color(0.63, 0.63, 0.63); + Color control_font_color_low = Color(0.69, 0.69, 0.69); + Color control_font_color_hover = Color(0.94, 0.94, 0.94); Color control_font_color_disabled = Color(0.9, 0.9, 0.9, 0.2); - Color control_font_color_pressed = Color::html("ffffff"); - Color font_color_selection = Color::html("7d7d7d"); + Color control_font_color_pressed = Color(1, 1, 1); + Color font_color_selection = Color(0.49, 0.49, 0.49); // Panel @@ -432,12 +432,12 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_font("font", "TextEdit", default_font); - theme->set_color("background_color", "TextEdit", Color(0, 0, 0, 0)); - theme->set_color("completion_background_color", "TextEdit", Color::html("2C2A32")); - theme->set_color("completion_selected_color", "TextEdit", Color::html("434244")); - theme->set_color("completion_existing_color", "TextEdit", Color::html("21dfdfdf")); + theme->set_color("background_color", "TextEdit", Color(0, 0, 0)); + theme->set_color("completion_background_color", "TextEdit", Color(0.17, 0.16, 0.2)); + theme->set_color("completion_selected_color", "TextEdit", Color(0.26, 0.26, 0.27)); + theme->set_color("completion_existing_color", "TextEdit", Color(0.87, 0.87, 0.87, 0.13)); theme->set_color("completion_scroll_color", "TextEdit", control_font_color_pressed); - theme->set_color("completion_font_color", "TextEdit", Color::html("aaaaaa")); + theme->set_color("completion_font_color", "TextEdit", Color(0.67, 0.67, 0.67)); theme->set_color("font_color", "TextEdit", control_font_color); theme->set_color("font_color_selected", "TextEdit", Color(0, 0, 0)); theme->set_color("font_color_readonly", "TextEdit", Color(control_font_color.r, control_font_color.g, control_font_color.b, 0.5f)); @@ -449,14 +449,14 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("code_folding_color", "TextEdit", Color(0.8, 0.8, 0.8, 0.8)); theme->set_color("current_line_color", "TextEdit", Color(0.25, 0.25, 0.26, 0.8)); theme->set_color("caret_color", "TextEdit", control_font_color); - theme->set_color("caret_background_color", "TextEdit", Color::html("000000")); + theme->set_color("caret_background_color", "TextEdit", Color(0, 0, 0)); theme->set_color("symbol_color", "TextEdit", control_font_color_hover); theme->set_color("brace_mismatch_color", "TextEdit", Color(1, 0.2, 0.2)); - theme->set_color("line_number_color", "TextEdit", Color::html("66aaaaaa")); - theme->set_color("safe_line_number_color", "TextEdit", Color::html("99aac8aa")); - theme->set_color("function_color", "TextEdit", Color::html("66a2ce")); - theme->set_color("member_variable_color", "TextEdit", Color::html("e64e59")); - theme->set_color("number_color", "TextEdit", Color::html("EB9532")); + theme->set_color("line_number_color", "TextEdit", Color(0.67, 0.67, 0.67, 0.4)); + theme->set_color("safe_line_number_color", "TextEdit", Color(0.67, 0.78, 0.67, 0.6)); + theme->set_color("function_color", "TextEdit", Color(0.4, 0.64, 0.81)); + theme->set_color("member_variable_color", "TextEdit", Color(0.9, 0.31, 0.35)); + theme->set_color("number_color", "TextEdit", Color(0.92, 0.58, 0.2)); theme->set_color("word_highlighted_color", "TextEdit", Color(0.8, 0.9, 0.9, 0.15)); theme->set_constant("completion_lines", "TextEdit", 7); @@ -651,7 +651,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("cursor_color", "Tree", Color(0, 0, 0)); theme->set_color("guide_color", "Tree", Color(0, 0, 0, 0.1)); theme->set_color("drop_position_color", "Tree", Color(1, 0.3, 0.2)); - theme->set_color("relationship_line_color", "Tree", Color::html("464646")); + theme->set_color("relationship_line_color", "Tree", Color(0.27, 0.27, 0.27)); theme->set_color("custom_button_font_highlight", "Tree", control_font_color_hover); theme->set_constant("hseparation", "Tree", 4 * scale); |