summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/@GDScript.xml2
-rw-r--r--doc/classes/InputEventMouseButton.xml2
-rw-r--r--doc/classes/Rect2.xml1
-rw-r--r--doc/classes/TreeItem.xml2
-rw-r--r--doc/classes/ViewportTexture.xml4
-rw-r--r--editor/animation_track_editor_plugins.cpp40
-rw-r--r--main/main.cpp1
7 files changed, 43 insertions, 9 deletions
diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml
index cddc59ab71..a4ca830d4d 100644
--- a/doc/classes/@GDScript.xml
+++ b/doc/classes/@GDScript.xml
@@ -4,7 +4,7 @@
Built-in GDScript functions.
</brief_description>
<description>
- This contains the list of built-in gdscript functions. Mostly math functions and other utilities. Everything else is expanded by objects.
+ List of core built-in GDScript functions. Math functions and other utilities. Everything else is provided by objects. (Keywords: builtin, built in, global functions.)
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/InputEventMouseButton.xml b/doc/classes/InputEventMouseButton.xml
index fd326f97d5..50641dceed 100644
--- a/doc/classes/InputEventMouseButton.xml
+++ b/doc/classes/InputEventMouseButton.xml
@@ -21,7 +21,7 @@
If [code]true[/code] the mouse button's state is a double-click. If [code]false[/code] the mouse button's state is released.
</member>
<member name="factor" type="float" setter="set_factor" getter="get_factor">
- TO TALK in PR, reduz said : i think it's used for apple touch but i don't remember what it does
+ Magnitude. Amount (or delta) of the event. Used for scroll events, indicates scroll amount (vertically or horizontally). Only supported on some platforms, sensitivity varies by platform. May be 0 if not supported.
</member>
<member name="pressed" type="bool" setter="set_pressed" getter="is_pressed">
If [code]true[/code] the mouse button's state is pressed. If [code]false[/code] the mouse button's state is released.
diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml
index c21106074b..1eea940da9 100644
--- a/doc/classes/Rect2.xml
+++ b/doc/classes/Rect2.xml
@@ -42,6 +42,7 @@
<return type="Rect2">
</return>
<description>
+ Returns a [code]Rect2[/code] with equivalent position and area, modified so that the top-left corner is the origin and [code]width[/code] and [code]height[/code] are positive.
</description>
</method>
<method name="clip">
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index 6448b26972..57e0f2825a 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -308,7 +308,7 @@
<argument index="0" name="child" type="Object">
</argument>
<description>
- Removes the child TreeItem at index [code]index[/code].
+ Removes the given child TreeItem.
</description>
</method>
<method name="select">
diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml
index 83ffc6bcfd..67f1e09c75 100644
--- a/doc/classes/ViewportTexture.xml
+++ b/doc/classes/ViewportTexture.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ViewportTexture" inherits="Texture" category="Core" version="3.1">
<brief_description>
+ Texture which displays the content of a [Viewport].
</brief_description>
<description>
+ Displays the content of a [Viewport] node as a dynamic [Texture]. This can be used to mix controls, 2D, and 3D elements in the same scene.
+ To create a ViewportTexture in code, use the [method Viewport.get_texture] method on the target viewport.
</description>
<tutorials>
</tutorials>
@@ -12,6 +15,7 @@
</methods>
<members>
<member name="viewport_path" type="NodePath" setter="set_viewport_path_in_scene" getter="get_viewport_path_in_scene">
+ The path to the [Viewport] node to display. This is relative to the scene root, not to the node which uses the texture.
</member>
</members>
<constants>
diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp
index 660c69f4a4..d0c91f10d9 100644
--- a/editor/animation_track_editor_plugins.cpp
+++ b/editor/animation_track_editor_plugins.cpp
@@ -357,14 +357,28 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
}
} else if (Object::cast_to<AnimatedSprite>(object) || Object::cast_to<AnimatedSprite3D>(object)) {
- int frame = get_animation()->track_get_key_value(get_track(), p_index);
- String animation = "default"; //may be smart and go through other tracks to find if animation is set
-
Ref<SpriteFrames> sf = object->call("get_sprite_frames");
if (sf.is_null()) {
return AnimationTrackEdit::get_key_rect(p_index, p_pixels_sec);
}
+ List<StringName> animations;
+ sf->get_animation_list(&animations);
+
+ int frame = get_animation()->track_get_key_value(get_track(), p_index);
+ String animation;
+ if (animations.size() == 1) {
+ animation = animations.front()->get();
+ } else {
+ // Go through other track to find if animation is set
+ String animation_path = get_animation()->track_get_path(get_track());
+ animation_path = animation_path.replace(":frame", ":animation");
+ int animation_track = get_animation()->find_track(animation_path);
+ float track_time = get_animation()->track_get_key_time(get_track(), p_index);
+ int animaiton_index = get_animation()->track_find_key(animation_track, track_time);
+ animation = get_animation()->track_get_key_value(animation_track, animaiton_index);
+ }
+
Ref<Texture> texture = sf->get_frame(animation, frame);
if (!texture.is_valid()) {
return AnimationTrackEdit::get_key_rect(p_index, p_pixels_sec);
@@ -430,15 +444,29 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
} else if (Object::cast_to<AnimatedSprite>(object) || Object::cast_to<AnimatedSprite3D>(object)) {
- int frame = get_animation()->track_get_key_value(get_track(), p_index);
- String animation = "default"; //may be smart and go through other tracks to find if animation is set
-
Ref<SpriteFrames> sf = object->call("get_sprite_frames");
if (sf.is_null()) {
AnimationTrackEdit::draw_key(p_index, p_pixels_sec, p_x, p_selected, p_clip_left, p_clip_right);
return;
}
+ List<StringName> animations;
+ sf->get_animation_list(&animations);
+
+ int frame = get_animation()->track_get_key_value(get_track(), p_index);
+ String animation;
+ if (animations.size() == 1) {
+ animation = animations.front()->get();
+ } else {
+ // Go through other track to find if animation is set
+ String animation_path = get_animation()->track_get_path(get_track());
+ animation_path = animation_path.replace(":frame", ":animation");
+ int animation_track = get_animation()->find_track(animation_path);
+ float track_time = get_animation()->track_get_key_time(get_track(), p_index);
+ int animaiton_index = get_animation()->track_find_key(animation_track, track_time);
+ animation = get_animation()->track_get_key_value(animation_track, animaiton_index);
+ }
+
texture = sf->get_frame(animation, frame);
if (!texture.is_valid()) {
AnimationTrackEdit::draw_key(p_index, p_pixels_sec, p_x, p_selected, p_clip_left, p_clip_right);
diff --git a/main/main.cpp b/main/main.cpp
index f719830cbc..2e3c2f41b9 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -539,6 +539,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else if (I->get() == "--build-solutions") { // Build the scripting solution such C#
auto_build_solutions = true;
+ editor = true;
#endif
} else if (I->get() == "--no-window") { // disable window creation, Windows only