Skip to content

Commit

Permalink
Merge pull request #57212 from akien-mga/3.x-cherrypicks
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Jan 25, 2022
2 parents d62166f + f8afd16 commit e17af68
Show file tree
Hide file tree
Showing 24 changed files with 3,667 additions and 56 deletions.
2 changes: 1 addition & 1 deletion core/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ Variant Array::max() const {
}

const void *Array::id() const {
return _p->array.ptr();
return _p;
}

Array::Array(const Array &p_from) {
Expand Down
2 changes: 1 addition & 1 deletion core/dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void Dictionary::operator=(const Dictionary &p_dictionary) {
}

const void *Dictionary::id() const {
return _p->variant_map.id();
return _p;
}

Dictionary::Dictionary(const Dictionary &p_from) {
Expand Down
2 changes: 1 addition & 1 deletion core/io/http_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ Error HTTPClient::poll() {
return OK;
}

int HTTPClient::get_response_body_length() const {
int64_t HTTPClient::get_response_body_length() const {
return body_size;
}

Expand Down
2 changes: 1 addition & 1 deletion core/io/http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class HTTPClient : public Reference {
bool is_response_chunked() const;
int get_response_code() const;
Error get_response_headers(List<String> *r_response);
int get_response_body_length() const;
int64_t get_response_body_length() const;

PoolByteArray read_response_body_chunk(); // Can't get body as partial text because of most encodings UTF8, gzip, etc.

Expand Down
13 changes: 2 additions & 11 deletions doc/classes/AnimationNodeOneShot.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
<link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="get_mix_mode" qualifiers="const">
<return type="int" enum="AnimationNodeOneShot.MixMode" />
<description>
</description>
</method>
<method name="set_mix_mode">
<return type="void" />
<argument index="0" name="mode" type="int" enum="AnimationNodeOneShot.MixMode" />
<description>
</description>
</method>
</methods>
<members>
<member name="autorestart" type="bool" setter="set_autorestart" getter="has_autorestart" default="false">
Expand All @@ -37,6 +26,8 @@
</member>
<member name="fadeout_time" type="float" setter="set_fadeout_time" getter="get_fadeout_time" default="0.1">
</member>
<member name="mix_mode" type="int" setter="set_mix_mode" getter="get_mix_mode" enum="AnimationNodeOneShot.MixMode" default="0">
</member>
<member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false">
</member>
</members>
Expand Down
13 changes: 13 additions & 0 deletions doc/classes/BitMap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<tutorials>
</tutorials>
<methods>
<method name="convert_to_image" qualifiers="const">
<return type="Image" />
<description>
Returns an image of the same size as the bitmap and with a [enum Image.Format] of type [code]FORMAT_L8[/code]. [code]true[/code] bits of the bitmap are being converted into white pixels, and [code]false[/code] bits into black.
</description>
</method>
<method name="create">
<return type="void" />
<argument index="0" name="size" type="Vector2" />
Expand Down Expand Up @@ -58,6 +64,13 @@
<description>
</description>
</method>
<method name="resize">
<return type="void" />
<argument index="0" name="new_size" type="Vector2" />
<description>
Resizes the image to [code]new_size[/code].
</description>
</method>
<method name="set_bit">
<return type="void" />
<argument index="0" name="position" type="Vector2" />
Expand Down
8 changes: 4 additions & 4 deletions doc/classes/Tree.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<argument index="0" name="parent" type="Object" default="null" />
<argument index="1" name="idx" type="int" default="-1" />
<description>
Creates an item in the tree and adds it as a child of [code]parent[/code].
Creates an item in the tree and adds it as a child of [code]parent[/code], which can be either a valid [TreeItem] or [code]null[/code].
If [code]parent[/code] is [code]null[/code], the root item will be the parent, or the new item will be the root itself if the tree is empty.
The new item will be the [code]idx[/code]th child of parent, or it will be the last child if there are not enough siblings.
</description>
Expand Down Expand Up @@ -111,7 +111,7 @@
<argument index="0" name="item" type="Object" />
<argument index="1" name="column" type="int" default="-1" />
<description>
Returns the rectangle area for the specified item. If [code]column[/code] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns.
Returns the rectangle area for the specified [TreeItem]. If [code]column[/code] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns.
</description>
</method>
<method name="get_item_at_position" qualifiers="const">
Expand All @@ -125,7 +125,7 @@
<return type="TreeItem" />
<argument index="0" name="from" type="Object" />
<description>
Returns the next selected item after the given one, or [code]null[/code] if the end is reached.
Returns the next selected [TreeItem] after the given one, or [code]null[/code] if the end is reached.
If [code]from[/code] is [code]null[/code], this returns the first selected item.
</description>
</method>
Expand Down Expand Up @@ -167,7 +167,7 @@
<return type="void" />
<argument index="0" name="item" type="Object" />
<description>
Causes the [Tree] to jump to the specified item.
Causes the [Tree] to jump to the specified [TreeItem].
</description>
</method>
<method name="set_column_expand">
Expand Down
3 changes: 3 additions & 0 deletions editor/plugins/animation_blend_tree_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,9 @@ void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref<Anima
}

void AnimationNodeBlendTreeEditor::_node_renamed_focus_out(Node *le, Ref<AnimationNode> p_node) {
if (le == nullptr) {
return; // The text_submitted signal triggered the graph update and freed the LineEdit.
}
_node_renamed(le->call("get_text"), p_node);
}

Expand Down
1 change: 1 addition & 0 deletions editor/plugins/asset_library_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ void EditorAssetLibrary::_notification(int p_what) {

case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
_update_repository_options();
setup_http_request(request);
} break;
}
}
Expand Down
27 changes: 19 additions & 8 deletions editor/plugins/sprite_frames_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,19 +822,30 @@ void SpriteFramesEditor::_update_library(bool p_skip_selector) {

for (int i = 0; i < frames->get_frame_count(edited_anim); i++) {
String name;
Ref<Texture> icon;
Ref<Texture> frame = frames->get_frame(edited_anim, i);

if (frames->get_frame(edited_anim, i).is_null()) {
if (frame.is_null()) {
name = itos(i) + ": " + TTR("(empty)");

} else {
name = itos(i) + ": " + frames->get_frame(edited_anim, i)->get_name();
icon = frames->get_frame(edited_anim, i);
name = itos(i) + ": " + frame->get_name();
}

tree->add_item(name, icon);
if (frames->get_frame(edited_anim, i).is_valid()) {
tree->set_item_tooltip(tree->get_item_count() - 1, frames->get_frame(edited_anim, i)->get_path());
tree->add_item(name, frame);
if (frame.is_valid()) {
String tooltip = frame->get_path();

// Frame is often saved as an AtlasTexture subresource within a scene/resource file,
// thus its path might be not what the user is looking for. So we're also showing
// subsequent source texture paths.
String prefix = String::utf8("┖╴");
Ref<AtlasTexture> at = frame;
while (at.is_valid() && at->get_atlas().is_valid()) {
tooltip += "\n" + prefix + at->get_atlas()->get_path();
prefix = " " + prefix;
at = at->get_atlas();
}

tree->set_item_tooltip(tree->get_item_count() - 1, tooltip);
}
if (sel == i) {
tree->select(tree->get_item_count() - 1);
Expand Down
1 change: 1 addition & 0 deletions editor/rename_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und
vbc->add_child(lbl_preview_title);

lbl_preview = memnew(Label);
lbl_preview->set_autowrap(true);
vbc->add_child(lbl_preview);

// ---- Dialog related
Expand Down
4 changes: 2 additions & 2 deletions misc/dist/html/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="application-name" content="Godot" />
<meta name="apple-mobile-web-app-title" content="Godot" />
<meta name="theme-color" content="#478cbf" />
<meta name="msapplication-navbutton-color" content="#478cbf" />
<meta name="theme-color" content="#202531" />
<meta name="msapplication-navbutton-color" content="#202531" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="msapplication-starturl" content="/latest" />
<meta property="og:site_name" content="Godot Engine Web Editor" />
Expand Down
2 changes: 1 addition & 1 deletion misc/dist/html/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start_url": "./godot.tools.html",
"display": "standalone",
"orientation": "landscape",
"theme_color": "#478cbf",
"theme_color": "#202531",
"icons": [
{
"src": "favicon.png",
Expand Down
2 changes: 2 additions & 0 deletions misc/dist/html/offline.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#202531" />
<meta name="msapplication-navbutton-color" content="#202531" />
<title>You are offline</title>
<style>
html {
Expand Down
6 changes: 3 additions & 3 deletions platform/javascript/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ def configure(env):

if env["tools"]:
if not env["threads_enabled"]:
print("Threads must be enabled to build the editor. Please add the 'threads_enabled=yes' option")
sys.exit(255)
print('Note: Forcing "threads_enabled=yes" as it is required for the web editor.')
env["threads_enabled"] = "yes"
if env["initial_memory"] < 64:
print("Editor build requires at least 64MiB of initial memory. Forcing it.")
print('Note: Forcing "initial_memory=64" as it is required for the web editor.')
env["initial_memory"] = 64
else:
# Disable exceptions and rtti on non-tools (template) builds
Expand Down
2 changes: 1 addition & 1 deletion platform/javascript/http_client_javascript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Error HTTPClient::get_response_headers(List<String> *r_response) {
return OK;
}

int HTTPClient::get_response_body_length() const {
int64_t HTTPClient::get_response_body_length() const {
return godot_js_fetch_body_length_get(js_id);
}

Expand Down
Loading

0 comments on commit e17af68

Please sign in to comment.