summaryrefslogtreecommitdiffstats
path: root/platform/android/java_godot_lib_jni.cpp
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuyakou@gmail.com>2023-02-21 09:18:08 -0800
committerFredia Huya-Kouadio <fhuyakou@gmail.com>2023-02-22 00:16:39 -0800
commit445053a62d90ee2b190e4ccca376141b2d2400e8 (patch)
tree9714175613858b99a8b1478eedd84169d1e931f8 /platform/android/java_godot_lib_jni.cpp
parent7e79aead99a53ee7cdf383add9a6a2aea4f15beb (diff)
downloadredot-engine-445053a62d90ee2b190e4ccca376141b2d2400e8.tar.gz
Enable granular control of touchscreen related settings
Diffstat (limited to 'platform/android/java_godot_lib_jni.cpp')
-rw-r--r--platform/android/java_godot_lib_jni.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp
index e7abe580f1..1a0087e18d 100644
--- a/platform/android/java_godot_lib_jni.cpp
+++ b/platform/android/java_godot_lib_jni.cpp
@@ -57,6 +57,10 @@
#include <android/native_window_jni.h>
+#ifdef TOOLS_ENABLED
+#include "editor/editor_settings.h"
+#endif
+
static JavaClassWrapper *java_class_wrapper = nullptr;
static OS_Android *os_android = nullptr;
static AndroidInputHandler *input_handler = nullptr;
@@ -427,6 +431,18 @@ JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv *
return env->NewStringUTF(GLOBAL_GET(js).operator String().utf8().get_data());
}
+JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getEditorSetting(JNIEnv *env, jclass clazz, jstring p_setting_key) {
+ String editor_setting = "";
+#ifdef TOOLS_ENABLED
+ String godot_setting_key = jstring_to_string(p_setting_key, env);
+ editor_setting = EDITOR_GET(godot_setting_key).operator String();
+#else
+ WARN_PRINT("Access to the Editor Settings in only available on Editor builds");
+#endif
+
+ return env->NewStringUTF(editor_setting.utf8().get_data());
+}
+
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv *env, jclass clazz, jlong ID, jstring method, jobjectArray params) {
Object *obj = ObjectDB::get_instance(ObjectID(ID));
ERR_FAIL_NULL(obj);