summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/math/transform_2d.cpp7
-rw-r--r--doc/classes/@GlobalScope.xml3
-rw-r--r--doc/classes/InputMap.xml18
-rw-r--r--doc/classes/OS.xml14
-rw-r--r--doc/classes/RenderingServer.xml10
-rw-r--r--editor/doc_data.cpp17
-rw-r--r--editor/icons/Crosshair.svg1
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp22
-rw-r--r--editor/plugins/node_3d_editor_plugin.h2
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp4
-rw-r--r--modules/gdnative/config.py1
-rw-r--r--modules/gdnative/doc_classes/@NativeScript.xml13
-rw-r--r--modules/gdscript/gdscript_compiler.cpp4
-rw-r--r--modules/mono/config.py1
-rw-r--r--modules/mono/doc_classes/@C#.xml13
-rw-r--r--modules/visual_script/config.py1
-rw-r--r--modules/visual_script/doc_classes/@VisualScript.xml15
17 files changed, 46 insertions, 100 deletions
diff --git a/core/math/transform_2d.cpp b/core/math/transform_2d.cpp
index dee1b3b23e..180aeaa0af 100644
--- a/core/math/transform_2d.cpp
+++ b/core/math/transform_2d.cpp
@@ -78,12 +78,7 @@ void Transform2D::set_skew(float p_angle) {
}
real_t Transform2D::get_rotation() const {
- real_t det = basis_determinant();
- Transform2D m = orthonormalized();
- if (det < 0) {
- m.scale_basis(Size2(1, -1)); // convention to separate rotation and reflection for 2D is to absorb a flip along y into scaling.
- }
- return Math::atan2(m[0].y, m[0].x);
+ return Math::atan2(elements[0].y, elements[0].x);
}
void Transform2D::set_rotation(real_t p_rot) {
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 41811a48b1..9a28a0d085 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -33,6 +33,9 @@
<member name="Geometry3D" type="Geometry3D" setter="" getter="">
The [Geometry3D] singleton.
</member>
+ <member name="GodotSharp" type="GodotSharp" setter="" getter="">
+ The [GodotSharp] singleton.
+ </member>
<member name="IP" type="IP" setter="" getter="">
The [IP] singleton.
</member>
diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml
index 842c69de27..03212538c9 100644
--- a/doc/classes/InputMap.xml
+++ b/doc/classes/InputMap.xml
@@ -41,6 +41,15 @@
Removes all events from an action.
</description>
</method>
+ <method name="action_get_events">
+ <return type="Array">
+ </return>
+ <argument index="0" name="action" type="StringName">
+ </argument>
+ <description>
+ Returns an array of [InputEvent]s associated with a given action.
+ </description>
+ </method>
<method name="action_has_event">
<return type="bool">
</return>
@@ -95,15 +104,6 @@
Returns [code]true[/code] if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior.
</description>
</method>
- <method name="action_get_events">
- <return type="Array">
- </return>
- <argument index="0" name="action" type="StringName">
- </argument>
- <description>
- Returns an array of [InputEvent]s associated with a given action.
- </description>
- </method>
<method name="get_actions">
<return type="Array">
</return>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index b131d2728c..23473290c7 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -254,20 +254,6 @@
[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows.
</description>
</method>
- <method name="get_system_time_msecs" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the epoch time of the operating system in milliseconds.
- </description>
- </method>
- <method name="get_system_time_secs" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the epoch time of the operating system in seconds.
- </description>
- </method>
<method name="get_tablet_driver_count" qualifiers="const">
<return type="int">
</return>
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 516a16e053..8832c0ec4d 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -17,11 +17,6 @@
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/optimization/using_servers.html</link>
</tutorials>
- <members>
- <member name="render_loop_enabled" type="bool" setter="set_render_loop_enabled" getter="is_render_loop_enabled" default="true">
- If [code]false[/code], disables rendering completely, but the engine logic is still being processed. You can call [method force_draw] to draw a frame even with rendering disabled.
- </member>
- </members>
<methods>
<method name="black_bars_set_images">
<return type="void">
@@ -3014,6 +3009,11 @@
</description>
</method>
</methods>
+ <members>
+ <member name="render_loop_enabled" type="bool" setter="set_render_loop_enabled" getter="is_render_loop_enabled">
+ If [code]false[/code], disables rendering completely, but the engine logic is still being processed. You can call [method force_draw] to draw a frame even with rendering disabled.
+ </member>
+ </members>
<signals>
<signal name="frame_post_draw">
<description>
diff --git a/editor/doc_data.cpp b/editor/doc_data.cpp
index c52d91b03d..54acbe9559 100644
--- a/editor/doc_data.cpp
+++ b/editor/doc_data.cpp
@@ -662,18 +662,19 @@ void DocData::generate(bool p_basic_types) {
}
}
- //built in script reference
+ // Built-in script reference.
+ // We only add a doc entry for languages which actually define any built-in
+ // methods or constants.
{
for (int i = 0; i < ScriptServer::get_language_count(); i++) {
ScriptLanguage *lang = ScriptServer::get_language(i);
String cname = "@" + lang->get_name();
- class_list[cname] = ClassDoc();
- ClassDoc &c = class_list[cname];
+ ClassDoc c;
c.name = cname;
+ // Get functions.
List<MethodInfo> minfo;
-
lang->get_public_functions(&minfo);
for (List<MethodInfo>::Element *E = minfo.front(); E; E = E->next()) {
@@ -706,6 +707,7 @@ void DocData::generate(bool p_basic_types) {
c.methods.push_back(md);
}
+ // Get constants.
List<Pair<String, Variant>> cinfo;
lang->get_public_constants(&cinfo);
@@ -715,6 +717,13 @@ void DocData::generate(bool p_basic_types) {
cd.value = E->get().second;
c.constants.push_back(cd);
}
+
+ // Skip adding the lang if it doesn't expose anything (e.g. C#).
+ if (c.methods.empty() && c.constants.empty()) {
+ continue;
+ }
+
+ class_list[cname] = c;
}
}
}
diff --git a/editor/icons/Crosshair.svg b/editor/icons/Crosshair.svg
deleted file mode 100644
index b6fa5ec654..0000000000
--- a/editor/icons/Crosshair.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m6 1v5h-5v1 3h5v5h4v-5h5v-4h-5v-5z" fill-opacity=".627451"/><path d="m2 7v2l5.0000803.0000197-.0000803 4.9999803h2l-.0000803-4.9999803 5.0000803-.0000197v-2l-5.0000803.0001803.0000803-5.0001803h-2l.0000803 5.0001803z" fill="#fefefe" fill-opacity=".862745"/></svg> \ No newline at end of file
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 7bf8fd7d26..975957d56c 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -2174,6 +2174,8 @@ void Node3DEditorViewport::set_freelook_active(bool active_now) {
freelook_speed = base_speed * cursor.distance;
}
+ previous_mouse_position = get_local_mouse_position();
+
// Hide mouse like in an FPS (warping doesn't work)
Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_CAPTURED);
@@ -2183,6 +2185,11 @@ void Node3DEditorViewport::set_freelook_active(bool active_now) {
// Restore mouse
Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE);
+
+ // Restore the previous mouse position when leaving freelook mode.
+ // This is done because leaving `Input.MOUSE_MODE_CAPTURED` will center the cursor
+ // due to OS limitations.
+ warp_mouse(previous_mouse_position);
}
freelook_active = active_now;
@@ -2341,13 +2348,6 @@ void Node3DEditorViewport::_notification(int p_what) {
call_deferred("update_transform_gizmo_view");
}
- if (p_what == NOTIFICATION_READY) {
- // The crosshair icon doesn't depend on the editor theme.
- crosshair->set_texture(get_theme_icon("Crosshair", "EditorIcons"));
- // Set the anchors and margins after changing the icon to ensure it's centered correctly.
- crosshair->set_anchors_and_margins_preset(PRESET_CENTER);
- }
-
if (p_what == NOTIFICATION_PROCESS) {
real_t delta = get_process_delta_time();
@@ -2473,10 +2473,6 @@ void Node3DEditorViewport::_notification(int p_what) {
current_camera = camera;
}
- // Display the crosshair only while freelooking. Hide it otherwise,
- // as the crosshair can be distracting.
- crosshair->set_visible(freelook_active);
-
if (show_info) {
String text;
text += "X: " + rtos(current_camera->get_translation().x).pad_decimals(1) + "\n";
@@ -3866,10 +3862,6 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito
camera->make_current();
surface->set_focus_mode(FOCUS_ALL);
- crosshair = memnew(TextureRect);
- crosshair->set_mouse_filter(MOUSE_FILTER_IGNORE);
- surface->add_child(crosshair);
-
VBoxContainer *vbox = memnew(VBoxContainer);
surface->add_child(vbox);
vbox->set_position(Point2(10, 10) * EDSCALE);
diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h
index 83173b5ad2..2fe1938f28 100644
--- a/editor/plugins/node_3d_editor_plugin.h
+++ b/editor/plugins/node_3d_editor_plugin.h
@@ -284,8 +284,8 @@ private:
bool freelook_active;
real_t freelook_speed;
+ Vector2 previous_mouse_position;
- TextureRect *crosshair;
Label *info_label;
Label *cinema_label;
Label *locked_label;
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index b3d4b391d3..07bf5b53cd 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -492,12 +492,14 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
tools[SHAPE_NEW_RECTANGLE]->set_toggle_mode(true);
tools[SHAPE_NEW_RECTANGLE]->set_button_group(tg);
tools[SHAPE_NEW_RECTANGLE]->set_tooltip(TTR("Create a new rectangle."));
+ tools[SHAPE_NEW_RECTANGLE]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(SHAPE_NEW_RECTANGLE));
tools[SHAPE_NEW_POLYGON] = memnew(ToolButton);
toolbar->add_child(tools[SHAPE_NEW_POLYGON]);
tools[SHAPE_NEW_POLYGON]->set_toggle_mode(true);
tools[SHAPE_NEW_POLYGON]->set_button_group(tg);
tools[SHAPE_NEW_POLYGON]->set_tooltip(TTR("Create a new polygon."));
+ tools[SHAPE_NEW_POLYGON]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(SHAPE_NEW_POLYGON));
separator_shape_toggle = memnew(VSeparator);
toolbar->add_child(separator_shape_toggle);
@@ -1908,7 +1910,7 @@ void TileSetEditor::_on_tool_clicked(int p_tool) {
}
}
}
- } else if (p_tool == TOOL_SELECT) {
+ } else if (p_tool == TOOL_SELECT || p_tool == SHAPE_NEW_POLYGON || p_tool == SHAPE_NEW_RECTANGLE) {
if (creating_shape) {
// Cancel Creation
creating_shape = false;
diff --git a/modules/gdnative/config.py b/modules/gdnative/config.py
index 4b997e4bfe..7603e7d69d 100644
--- a/modules/gdnative/config.py
+++ b/modules/gdnative/config.py
@@ -8,7 +8,6 @@ def configure(env):
def get_doc_classes():
return [
- "@NativeScript",
"XRInterfaceGDNative",
"GDNative",
"GDNativeLibrary",
diff --git a/modules/gdnative/doc_classes/@NativeScript.xml b/modules/gdnative/doc_classes/@NativeScript.xml
deleted file mode 100644
index 809b225e21..0000000000
--- a/modules/gdnative/doc_classes/@NativeScript.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="@NativeScript" version="4.0">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <tutorials>
- </tutorials>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index bc095ae1f9..5bc9003c29 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -1422,6 +1422,10 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
codegen.opcodes.push_back(0);
codegen.opcodes.write[else_addr] = codegen.opcodes.size();
+ codegen.opcodes.push_back(GDScriptFunction::OPCODE_LINE);
+ codegen.opcodes.push_back(cf->body_else->line);
+ codegen.current_line = cf->body_else->line;
+
Error err2 = _parse_block(codegen, cf->body_else, p_stack_level, p_break_addr, p_continue_addr);
if (err2) {
return err2;
diff --git a/modules/mono/config.py b/modules/mono/config.py
index 7980a86cb3..cd659057ef 100644
--- a/modules/mono/config.py
+++ b/modules/mono/config.py
@@ -57,7 +57,6 @@ def configure(env):
def get_doc_classes():
return [
- "@C#",
"CSharpScript",
"GodotSharp",
]
diff --git a/modules/mono/doc_classes/@C#.xml b/modules/mono/doc_classes/@C#.xml
deleted file mode 100644
index 83a7fbf02c..0000000000
--- a/modules/mono/doc_classes/@C#.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="@C#" version="4.0">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <tutorials>
- </tutorials>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
diff --git a/modules/visual_script/config.py b/modules/visual_script/config.py
index bd459ca344..b15479797c 100644
--- a/modules/visual_script/config.py
+++ b/modules/visual_script/config.py
@@ -8,7 +8,6 @@ def configure(env):
def get_doc_classes():
return [
- "@VisualScript",
"VisualScriptBasicTypeConstant",
"VisualScriptBuiltinFunc",
"VisualScriptClassConstant",
diff --git a/modules/visual_script/doc_classes/@VisualScript.xml b/modules/visual_script/doc_classes/@VisualScript.xml
deleted file mode 100644
index a2b966bfbb..0000000000
--- a/modules/visual_script/doc_classes/@VisualScript.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="@VisualScript" version="4.0">
- <brief_description>
- Built-in visual script functions.
- </brief_description>
- <description>
- A list of built-in visual script functions, see [VisualScriptBuiltinFunc] and [VisualScript].
- </description>
- <tutorials>
- </tutorials>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>