diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-10-13 01:19:32 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-10-13 01:19:32 -0300 |
commit | b3cda43a0fb49e1cb9c8414077a23fa4b61ede38 (patch) | |
tree | 1fee133b2fbc6f2bade96cc9914a449cbb9dbe1e /main/main.cpp | |
parent | 52e756752e1db9e4cf7c5bb7e92d44995ad674c4 (diff) | |
parent | aad2bbdb6fb7c8217d7e75480b38e45f00cb3abd (diff) |
Merge branch 'master' of https://github.com/okamstudio/godot
Conflicts:
platform/windows/detect.py
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp index 7006b48282..84f7c3a88e 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -75,7 +75,7 @@ #include "core/io/file_access_zip.h" #include "translation.h" #include "version.h" -#include "os/input.h" +#include "main/input_default.h" #include "performance.h" static Globals *globals=NULL; @@ -926,6 +926,9 @@ Error Main::setup2() { id->set_emulate_touch(true); } } + + + MAIN_PRINT("Main: Load Remaps"); MAIN_PRINT("Main: Load Scene Types"); @@ -933,6 +936,20 @@ Error Main::setup2() { register_scene_types(); register_server_types(); + GLOBAL_DEF("display/custom_mouse_cursor",String()); + GLOBAL_DEF("display/custom_mouse_cursor_hotspot",Vector2()); + Globals::get_singleton()->set_custom_property_info("display/custom_mouse_cursor",PropertyInfo(Variant::STRING,"display/custom_mouse_cursor",PROPERTY_HINT_FILE,"*.png,*.webp")); + + if (String(Globals::get_singleton()->get("display/custom_mouse_cursor"))!=String()) { + + print_line("use custom cursor"); + Ref<Texture> cursor=ResourceLoader::load(Globals::get_singleton()->get("display/custom_mouse_cursor")); + if (cursor.is_valid()) { + print_line("loaded ok"); + Vector2 hotspot = Globals::get_singleton()->get("display/custom_mouse_cursor_hotspot"); + Input::get_singleton()->set_custom_mouse_cursor(cursor,hotspot); + } + } #ifdef TOOLS_ENABLED EditorNode::register_editor_types(); ObjectTypeDB::register_type<PCKPacker>(); // todo: move somewhere else |