Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Funexpected patches to official 3.2.3. #17

Open
wants to merge 95 commits into
base: official-3.2.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
af76bf1
[funexpected] update expoter with custom icons & entitlements
jkb0o Sep 23, 2020
c6dcdc3
[funexpected] bypass debug/release feature tags when exporting
jkb0o Mar 13, 2019
cef98d0
[funexpected] Expose Viewport.find_control to gdscript
jkb0o Sep 4, 2018
7d62999
[funexpected] Do not reset controls's scale inside containers
jkb0o Sep 4, 2018
4e980d8
[funexpected] Add parallax_visibility_notifier
jkb0o Sep 4, 2018
57430cf
[funexpected] steering_behaviours module
jkb0o Sep 4, 2018
726fcd5
[funexpected] spine module
jkb0o Feb 25, 2020
7d4274e
[funexpected] Increase threads stack size.
jkb0o Sep 7, 2018
a999f64
[funexpected] Add ios template build/install script
jkb0o Sep 7, 2018
45268ce
[funexpected] add test point in polygon
truenoldor Oct 1, 2018
f083a1a
[funexpected] Node.set_parent/kill
jkb0o Oct 4, 2018
2ec273c
[funexpected] ios payload and reciept verification
jkb0o Nov 21, 2018
2158e72
[funexpected] Optional `store_compressed` flag for vram textures to r…
jkb0o Dec 21, 2018
ef690c2
[funexpected] expose nsobject_to/from_variant to app_delegate
jkb0o Jan 31, 2019
2a3a523
[funexpected] expose Object.call_multilevel/call_multilevel_reversed
jkb0o Feb 9, 2019
1568d4a
[funexpected] scene pausing by branches also
jkb0o Feb 9, 2019
5d1370b
[funexpected] translate link button
jkb0o Feb 22, 2019
6afe720
[funexpected] expose resource cached resource pathes for leak detection
jkb0o Mar 1, 2019
24dcda5
[funexpected] ImageTexture::get_data returns same images in editor ea…
jkb0o Sep 11, 2018
c576bcf
[funexpected] fix string capitalization & to_lower
AndreevAndrei Apr 2, 2019
8ac5d12
[funexpected] gdnative loads dependenent dynamic libraries
jkb0o May 13, 2019
41cd40b
[funexpected] add traditional and simplified chinese translations
jkb0o Jul 5, 2019
cfeb392
[funexpected] better translatoin selection
jkb0o Jul 31, 2019
8991c83
[funexpected] send messages to NotificationCenter to allow init nativ…
sdshorin Aug 13, 2019
a0bf308
[funexpected] expose ios AppStore request review
sdshorin Aug 13, 2019
d04911f
[funexpected] expose ios sharing
sdshorin Aug 13, 2019
f9de902
[funexpected] fix wrong import
jkb0o Aug 15, 2019
a242cea
[funexpected] now `is` in GDScript can handle NativeScript as well
jkb0o Aug 29, 2019
3470fae
[funexpected] prevent crash on ios13 when entering background mode
jkb0o Oct 1, 2019
5536de7
[funexpected] implemented system font rendering for osx & ios
jkb0o Oct 8, 2019
be2dbde
[funexpected] support for orientation change
jkb0o Oct 30, 2019
a467138
[funexpected] add iOS::get_app_version
sdshorin Dec 2, 2019
8879a1d
[funexpected] do not warn about instance is gone after yield
jkb0o Feb 27, 2020
516f7c5
[funexpected] No silenced by the ring/silent switch
sdshorin Feb 26, 2020
af95bb7
[funexpected] use system fonts only for ios/osx
jkb0o Mar 4, 2020
fd9a3cb
[funexpected] log when some resource not loaded
jkb0o Mar 13, 2020
f77a60d
[funexpected] fix iOS::share_data for new IOS, add return stuff for f…
sdshorin Dec 30, 2019
bebf97a
[funexpected] fix relative input & touch emulation for js
jkb0o Mar 20, 2020
e9feded
[funexpected] improve scroll_container, remove inner inerctial scroll
sdshorin Mar 24, 2020
e03b05b
[funexpected] add keyboard_hidden signal to InputDefault on iOS
sdshorin Apr 17, 2020
684bb8e
[funexpected] fix system fonts for web
jkb0o May 15, 2020
6876a03
[funexpected] implement mouse_mode = pass to LineEdit
sdshorin Apr 23, 2020
8ae9770
[funexpected] add keyboard_height_changed signal to BaseInput
sdshorin Apr 23, 2020
41e032b
[funexpected] fix keyboard_height_changed signal
sdshorin Apr 29, 2020
162b260
[funexpected.flash] initial commit
jkb0o Sep 21, 2020
504ec73
[template] install web teamplate
nevanna Jun 8, 2020
d477324
[funexpected] implement in_app_store.finish_all_transactions
jkb0o Aug 11, 2020
3a72738
[funexpected] Add PROPERTY_USAGE_ALWAYS_SHARE_ON_DUPLICATE flag
jkb0o Sep 9, 2020
ae89876
[funexpected] Add export template compilation script for Android, clo…
sergey-khrykov Sep 10, 2020
e9bc074
[funexpected] Ignore small movements when new touch happens
sergey-khrykov Sep 10, 2020
48f5feb
[funexpected] allow to override '_custom_features' in 'override.cfg'
jkb0o Sep 11, 2020
c6460ce
[funexpected] allow reassinging singletons via OS.add_global_constant
jkb0o Sep 12, 2020
2cc3d26
[funexpected] Respect res://.import/* resource dependencies on export
jkb0o Apr 5, 2018
f5a12b6
[funexpected] use release_debug instead of relase for ios templates
jkb0o Sep 22, 2020
d789b76
[funexpected] implement CustomErrorHandler
jkb0o Sep 22, 2020
5ddeef5
[funexpected] build ios template in release_debug
jkb0o Sep 23, 2020
51b06b3
[funexpected] add sript for editor, use executables submodule
jkb0o Sep 23, 2020
0099e82
[funexpected] fix ios export path generation when exporting ipa with …
jkb0o Sep 23, 2020
3dee076
[funexpected] fix search pathes for ios static gdnative libs
jkb0o Sep 24, 2020
19b1a94
[funexpected.flash] fix editor crash when opeinng help
jkb0o Sep 25, 2020
3d0d3d2
[funexpected] add godot.headless
jkb0o Sep 25, 2020
dbcb20c
[funexpeceted] bypass more ios delegate events to NotificationCenter
jkb0o Sep 28, 2020
9cd36c0
[funexpected.flash] better exporter, warnings and loop time calculations
jkb0o Oct 1, 2020
b7be37b
[funexpected] update executables
jkb0o Oct 1, 2020
67fc8d4
[funexpected] support arkit & camera modules for ios
jkb0o Oct 9, 2020
af20402
[funexpected] do not include *.m files on for server builds on linux
jkb0o Oct 11, 2020
7ec2769
Respect importer version & import params when testing for reimport
jkb0o Oct 9, 2020
f9d9135
[funexpected.export] export all presets from custom cfg file, closes …
sdshorin Sep 24, 2020
8b5f718
[funexpected.flash] update flash importer
jkb0o Oct 15, 2020
4da10cc
[funexpected.flash] fix crash & duration
jkb0o Oct 15, 2020
26e20f9
[funexpected] update executables
jkb0o Oct 15, 2020
9603615
[funexpected.flash] fix wrong layer index calculation
jkb0o Oct 15, 2020
fe08d0d
[funexecpected.executables] compiled fix for flash
jkb0o Oct 15, 2020
9ee5b32
[funexpected] fix wron params hashing when testing for reimport
jkb0o Oct 17, 2020
5d02a88
[funexepted.executables] Latest executsbles
jkb0o Oct 21, 2020
4f36711
[funexpected.arkit] fix landscape camera orientation
jkb0o Oct 26, 2020
3c8f8c8
[funexpected] latest executables
jkb0o Oct 26, 2020
3257769
Fix Android template compilation fatal error
sergey-khrykov Oct 26, 2020
bd60b96
[funexpected.arkit] reduce jittering, interpolate camera
jkb0o Oct 30, 2020
64959db
[funexpected] update executables
jkb0o Oct 30, 2020
404d2f6
[xcodeproj] add languages (#18)
sergey-bychenko Nov 6, 2020
694fc6c
[funexpected] update executables
sergey-bychenko Nov 9, 2020
7d98ba9
[funexpected] gix broken links
sdshorin Nov 9, 2020
51a8b2a
[executables] fix missed langs
jkb0o Dec 14, 2020
fb0ea1e
[funexpected.flash] fix disposition & tweens
jkb0o Dec 16, 2020
6eab87f
[funexpected.executables] update flash
jkb0o Dec 16, 2020
7b9f137
[funexpected] fix translations
sdshorin Dec 22, 2020
409461d
[funexpected] update executables
sdshorin Dec 22, 2020
4ed76a4
[funexpected.flash] fix ios error spawning & clipping
jkb0o Dec 29, 2020
30f33b2
[funexpected.executables] add fixed flash
jkb0o Dec 29, 2020
edabbae
[funexpected.flash] fix colors & support flash folders
jkb0o Jan 18, 2021
d3f0e1e
[funexpected.executables] fix flash colors & support flash folders
jkb0o Jan 18, 2021
f0a7e12
[funexpected.flash] update clipping texture in draw stage
jkb0o Jan 28, 2021
0e049a1
[funexpected.executables] update clipping texture in draw stage
jkb0o Jan 28, 2021
cdb7036
[funexpected.export] remove extra files from exported pack (#25)
sdshorin Jan 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "modules/spine"]
path = modules/spine
url = git@github.com:funexpected/godot-spine-module.git
[submodule "modules/flash"]
path = modules/flash
url = git@github.com:funexpected/godot-flash-module.git
[submodule "executables"]
path = executables
url = git@github.com:funexpected/godot.executables.git
17 changes: 17 additions & 0 deletions core/bind/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ PoolStringArray _ResourceLoader::get_dependencies(const String &p_path) {
return ret;
};

PoolStringArray _ResourceLoader::get_cached_resource_pathes() {
return ResourceLoader::get_cached_resource_pathes();
}

#ifndef DISABLE_DEPRECATED
bool _ResourceLoader::has(const String &p_path) {
WARN_PRINTS("ResourceLoader.has() is deprecated, please replace it with the equivalent has_cached() or the new exists().");
Expand All @@ -132,6 +136,7 @@ void _ResourceLoader::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_recognized_extensions_for_type", "type"), &_ResourceLoader::get_recognized_extensions_for_type);
ClassDB::bind_method(D_METHOD("set_abort_on_missing_resources", "abort"), &_ResourceLoader::set_abort_on_missing_resources);
ClassDB::bind_method(D_METHOD("get_dependencies", "path"), &_ResourceLoader::get_dependencies);
ClassDB::bind_method(D_METHOD("get_cached_resource_pathes"), &_ResourceLoader::get_cached_resource_pathes);
ClassDB::bind_method(D_METHOD("has_cached", "path"), &_ResourceLoader::has_cached);
ClassDB::bind_method(D_METHOD("exists", "path", "type_hint"), &_ResourceLoader::exists, DEFVAL(""));
#ifndef DISABLE_DEPRECATED
Expand Down Expand Up @@ -1643,6 +1648,11 @@ bool _Geometry::point_is_inside_triangle(const Vector2 &s, const Vector2 &a, con
return Geometry::is_point_in_triangle(s, a, b, c);
}

bool _Geometry::point_is_inside_polygon(const Vector2 &point, const Vector<Vector2> &polygon) const{

return Geometry::is_point_in_polygon(point, polygon);
}

PoolVector<Vector3> _Geometry::segment_intersects_sphere(const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_sphere_pos, real_t p_sphere_radius) {

PoolVector<Vector3> r;
Expand Down Expand Up @@ -1866,6 +1876,7 @@ void _Geometry::_bind_methods() {
ClassDB::bind_method(D_METHOD("segment_intersects_cylinder", "from", "to", "height", "radius"), &_Geometry::segment_intersects_cylinder);
ClassDB::bind_method(D_METHOD("segment_intersects_convex", "from", "to", "planes"), &_Geometry::segment_intersects_convex);
ClassDB::bind_method(D_METHOD("point_is_inside_triangle", "point", "a", "b", "c"), &_Geometry::point_is_inside_triangle);
ClassDB::bind_method(D_METHOD("point_is_inside_polygon", "point", "polygon"), &_Geometry::point_is_inside_polygon);

ClassDB::bind_method(D_METHOD("is_polygon_clockwise", "polygon"), &_Geometry::is_polygon_clockwise);
ClassDB::bind_method(D_METHOD("is_point_in_polygon", "point", "polygon"), &_Geometry::is_point_in_polygon);
Expand Down Expand Up @@ -3158,6 +3169,10 @@ Object *_Engine::get_singleton_object(const String &p_name) const {
return Engine::get_singleton()->get_singleton_object(p_name);
}

void _Engine::add_global_constant(const String &p_name, const Variant &p_value) const {
Engine::get_singleton()->add_global_constant(p_name, p_value);
}

void _Engine::set_editor_hint(bool p_enabled) {

Engine::get_singleton()->set_editor_hint(p_enabled);
Expand Down Expand Up @@ -3200,6 +3215,8 @@ void _Engine::_bind_methods() {
ClassDB::bind_method(D_METHOD("has_singleton", "name"), &_Engine::has_singleton);
ClassDB::bind_method(D_METHOD("get_singleton", "name"), &_Engine::get_singleton_object);

ClassDB::bind_method(D_METHOD("add_global_constant", "name", "value"), &_Engine::add_global_constant);

ClassDB::bind_method(D_METHOD("set_editor_hint", "enabled"), &_Engine::set_editor_hint);
ClassDB::bind_method(D_METHOD("is_editor_hint"), &_Engine::is_editor_hint);

Expand Down
4 changes: 4 additions & 0 deletions core/bind/core_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class _ResourceLoader : public Object {
PoolVector<String> get_recognized_extensions_for_type(const String &p_type);
void set_abort_on_missing_resources(bool p_abort);
PoolStringArray get_dependencies(const String &p_path);
PoolStringArray get_cached_resource_pathes();
#ifndef DISABLE_DEPRECATED
bool has(const String &p_path);
#endif // DISABLE_DEPRECATED
Expand Down Expand Up @@ -408,6 +409,7 @@ class _Geometry : public Object {
Variant ray_intersects_triangle(const Vector3 &p_from, const Vector3 &p_dir, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2);
Variant segment_intersects_triangle(const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2);
bool point_is_inside_triangle(const Vector2 &s, const Vector2 &a, const Vector2 &b, const Vector2 &c) const;
bool point_is_inside_polygon(const Vector2 &point, const Vector<Vector2> &polygon) const;

PoolVector<Vector3> segment_intersects_sphere(const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_sphere_pos, real_t p_sphere_radius);
PoolVector<Vector3> segment_intersects_cylinder(const Vector3 &p_from, const Vector3 &p_to, float p_height, float p_radius);
Expand Down Expand Up @@ -781,6 +783,8 @@ class _Engine : public Object {
bool has_singleton(const String &p_name) const;
Object *get_singleton_object(const String &p_name) const;

void add_global_constant(const String &p_name, const Variant &p_value) const;

void set_editor_hint(bool p_enabled);
bool is_editor_hint() const;

Expand Down
26 changes: 26 additions & 0 deletions core/custom_error_handler.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "core/custom_error_handler.h"
#include "core/script_language.h"

void CustomErrorHandler::_handle_error(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type) {
CustomErrorHandler *self = (CustomErrorHandler*)p_self;

if (p_type == ERR_HANDLER_SCRIPT) {
self->handle_error(p_func, p_file, p_line, p_error, p_errorexp);
}
}

void CustomErrorHandler::handle_error(const String &p_func, const String &p_file, int p_line, const String &p_error, const String &p_errorexp) {
if (get_script_instance() && get_script_instance()->has_method("handle_error")) {
get_script_instance()->call("handle_error", p_func, p_file, p_line, p_error, p_errorexp);
}
}

CustomErrorHandler::CustomErrorHandler() {
eh.userdata = this;
eh.errfunc = _handle_error;
add_error_handler(&eh);
}

CustomErrorHandler::~CustomErrorHandler() {
remove_error_handler(&eh);
}
18 changes: 18 additions & 0 deletions core/custom_error_handler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef ERROR_HANDLER_H
#define ERROR_HANDLER_H

#include "core/object.h"

class CustomErrorHandler : public Object {

GDCLASS(CustomErrorHandler, Object);
ErrorHandlerList eh;
static void _handle_error(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type);

public:
void handle_error(const String &p_func, const String &p_file, int p_line, const String &p_error, const String &p_errorexp);
CustomErrorHandler();
~CustomErrorHandler();
};

#endif
54 changes: 54 additions & 0 deletions core/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "core/license.gen.h"
#include "core/version.h"
#include "core/version_hash.gen.h"
#include "core/io/resource_loader.h"

void Engine::set_iterations_per_second(int p_ips) {

Expand Down Expand Up @@ -210,6 +211,59 @@ void Engine::get_singletons(List<Singleton> *p_singletons) {
p_singletons->push_back(E->get());
}

void Engine::add_global_constant(const String &p_name, const Variant &p_value) const {
for (int i = 0; i < ScriptServer::get_language_count(); i++) {
ScriptServer::get_language(i)->add_global_constant(p_name, p_value);
}
}

void Engine::add_custom_error_handlers() {
String custom_error_handler_base_class = CustomErrorHandler::get_class_static();
List<StringName> global_classes;
ScriptServer::get_global_class_list(&global_classes);

for (List<StringName>::Element *E = global_classes.front(); E; E = E->next()) {

StringName class_name = E->get();
StringName base_class = ScriptServer::get_global_class_native_base(class_name);

if (base_class == custom_error_handler_base_class) {
String path = ScriptServer::get_global_class_path(class_name);
add_custom_error_handler(path);
}
}
}

void Engine::add_custom_error_handler(const String &p_path) {
for (List<CustomErrorHandler *>::Element *E = custom_error_handlers.front(); E; E = E->next()) {
if (E->get()->get_script_instance() && E->get()->get_script_instance()->get_script()->get_path() == p_path) {
return;
}
}
Ref<Resource> res = ResourceLoader::load(p_path);
if (res.is_null()) return;
if (!res->is_class("Script")) return;

Ref<Script> script = res;
StringName base_type = script->get_instance_base_type();
bool valid_type = ClassDB::is_parent_class(base_type, CustomErrorHandler::get_class_static());
ERR_FAIL_COND_MSG(!valid_type, "Script does not inherit a CustomErrorHandler: " + p_path + ".");

Object *obj = ClassDB::instance(base_type);
ERR_FAIL_COND_MSG(obj == NULL, "Cannot instance script as custom error handler, expected 'CustomErrorHandler' inheritance, got: " + String(base_type) + ".");

CustomErrorHandler *handler = Object::cast_to<CustomErrorHandler>(obj);
handler->set_script(script.get_ref_ptr());
custom_error_handlers.push_back(handler);
}

void Engine::remove_custom_error_handlers() {
for (List<CustomErrorHandler *>::Element *E = custom_error_handlers.front(); E; E = E->next()) {
memdelete(E->get());
}
custom_error_handlers.clear();
}

Engine *Engine::singleton = NULL;

Engine *Engine::get_singleton() {
Expand Down
7 changes: 7 additions & 0 deletions core/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#ifndef ENGINE_H
#define ENGINE_H

#include "core/custom_error_handler.h"
#include "core/list.h"
#include "core/os/main_loop.h"
#include "core/ustring.h"
Expand Down Expand Up @@ -69,6 +70,7 @@ class Engine {
bool _in_physics;

List<Singleton> singletons;
List<CustomErrorHandler *> custom_error_handlers;
Map<StringName, Object *> singleton_ptrs;

bool editor_hint;
Expand Down Expand Up @@ -109,6 +111,11 @@ class Engine {
bool has_singleton(const String &p_name) const;
Object *get_singleton_object(const String &p_name) const;

void add_global_constant(const String &p_name, const Variant &p_value) const;
void add_custom_error_handlers();
void add_custom_error_handler(const String &p_path);
void remove_custom_error_handlers();

_FORCE_INLINE_ bool get_use_pixel_snap() const { return _pixel_snap; }

#ifdef TOOLS_ENABLED
Expand Down
1 change: 1 addition & 0 deletions core/io/resource_importer.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class ResourceImporter : public Reference {
public:
virtual String get_importer_name() const = 0;
virtual String get_visible_name() const = 0;
virtual int get_importer_version() const { return 0; }
virtual void get_recognized_extensions(List<String> *p_extensions) const = 0;
virtual String get_save_extension() const = 0;
virtual String get_resource_type() const = 0;
Expand Down
11 changes: 11 additions & 0 deletions core/io/resource_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ RES ResourceLoader::_load(const String &p_path, const String &p_original_path, c
return res;
}

print_line(String("Failed to load resource from '") + p_path + "'.");
ERR_FAIL_COND_V_MSG(found, RES(),
vformat("Failed loading resource: %s. Make sure resources have been imported by opening the project in the editor at least once.", p_path));

Expand Down Expand Up @@ -923,6 +924,16 @@ void ResourceLoader::clear_path_remaps() {
path_remaps.clear();
}

PoolStringArray ResourceLoader::get_cached_resource_pathes() {
PoolStringArray result;
List<String> keys;
ResourceCache::resources.get_key_list(&keys);
for (List<String>::Element *E = keys.front(); E; E = E->next()) {
result.push_back(E->get());
}
return result;
}

void ResourceLoader::set_load_callback(ResourceLoadedCallback p_callback) {
_loaded_callback = p_callback;
}
Expand Down
2 changes: 2 additions & 0 deletions core/io/resource_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ class ResourceLoader {
static void load_translation_remaps();
static void clear_translation_remaps();

static PoolStringArray get_cached_resource_pathes();

static void set_load_callback(ResourceLoadedCallback p_callback);
static ResourceLoaderImport import;

Expand Down
59 changes: 58 additions & 1 deletion core/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ void Object::get_property_list(List<PropertyInfo> *p_list, bool p_reversed) cons
#ifdef TOOLS_ENABLED
p_list->push_back(PropertyInfo(Variant::NIL, "Script", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
#endif
p_list->push_back(PropertyInfo(Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script", PROPERTY_USAGE_DEFAULT));
p_list->push_back(PropertyInfo(Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_ALWAYS_SHARE_ON_DUPLICATE));
}
if (!metadata.empty()) {
p_list->push_back(PropertyInfo(Variant::DICTIONARY, "__meta__", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL));
Expand Down Expand Up @@ -700,6 +700,46 @@ Variant Object::_call_deferred_bind(const Variant **p_args, int p_argcount, Vari
return Variant();
}

Variant Object::_call_multilevel_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
if (p_argcount < 1) {
r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 0;
return Variant();
}

if (p_args[0]->get_type() != Variant::STRING) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
return Variant();
}
r_error.error = Variant::CallError::CALL_OK;

StringName method = *p_args[0];
call_multilevel(method, &p_args[1], p_argcount - 1);
return Variant();
}

Variant Object::_call_multilevel_reversed_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
if (p_argcount < 1) {
r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_error.argument = 0;
return Variant();
}

if (p_args[0]->get_type() != Variant::STRING) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::STRING;
return Variant();
}
r_error.error = Variant::CallError::CALL_OK;

StringName method = *p_args[0];
call_multilevel_reversed(method, &p_args[1], p_argcount - 1);
return Variant();
}

#ifdef DEBUG_ENABLED
static void _test_call_error(const StringName &p_func, const Variant::CallError &error) {

Expand Down Expand Up @@ -1752,9 +1792,26 @@ void Object::_bind_methods() {
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_deferred", &Object::_call_deferred_bind, mi, varray(), false);
}

{
MethodInfo mi;
mi.name = "call_multilevel";
mi.arguments.push_back(PropertyInfo(Variant::STRING, "method"));

ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_multilevel", &Object::_call_multilevel_bind, mi);
}

{
MethodInfo mi;
mi.name = "call_multilevel_reversed";
mi.arguments.push_back(PropertyInfo(Variant::STRING, "method"));

ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_multilevel_reversed", &Object::_call_multilevel_reversed_bind, mi);
}

ClassDB::bind_method(D_METHOD("set_deferred", "property", "value"), &Object::set_deferred);

ClassDB::bind_method(D_METHOD("callv", "method", "arg_array"), &Object::callv);
//ClassDB::bind_method(D_METHOD)

ClassDB::bind_method(D_METHOD("has_method", "method"), &Object::has_method);

Expand Down
3 changes: 3 additions & 0 deletions core/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ enum PropertyUsageFlags {
PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT = 1 << 23,
PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT = 1 << 24,
PROPERTY_USAGE_KEYING_INCREMENTS = 1 << 25, // Used in inspector to increment property when keyed in animation player
PROPERTY_USAGE_ALWAYS_SHARE_ON_DUPLICATE = 1 << 26, // If the object is duplicated this property will never be duplicated

PROPERTY_USAGE_DEFAULT = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK,
PROPERTY_USAGE_DEFAULT_INTL = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK | PROPERTY_USAGE_INTERNATIONALIZED,
Expand Down Expand Up @@ -558,6 +559,8 @@ class Object {

Variant _call_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
Variant _call_deferred_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
Variant _call_multilevel_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
Variant _call_multilevel_reversed_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error);

virtual const StringName *_get_class_namev() const {
if (!_class_name)
Expand Down
2 changes: 2 additions & 0 deletions core/os/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ void Input::_bind_methods() {
BIND_ENUM_CONSTANT(CURSOR_HELP);

ADD_SIGNAL(MethodInfo("joy_connection_changed", PropertyInfo(Variant::INT, "device"), PropertyInfo(Variant::BOOL, "connected")));
ADD_SIGNAL(MethodInfo("keyboard_height_changed", PropertyInfo(Variant::INT, "height")));
ADD_SIGNAL(MethodInfo("keyboard_hidden"));
}

void Input::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
Expand Down
3 changes: 3 additions & 0 deletions core/os/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ class Input : public Object {
virtual void action_press(const StringName &p_action, float p_strength = 1.f) = 0;
virtual void action_release(const StringName &p_action) = 0;

virtual void keyboard_hidden() = 0;
virtual void virtual_keyboard_height_changed(int p_height) = 0;

void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const;

virtual bool is_emulating_touch_from_mouse() const = 0;
Expand Down
Loading