|
@@ -679,6 +679,7 @@ static jmethodID _isVideoPlaying=0;
|
|
|
static jmethodID _pauseVideo=0;
|
|
|
static jmethodID _stopVideo=0;
|
|
|
static jmethodID _setKeepScreenOn=0;
|
|
|
+static jmethodID _alertDialog=0;
|
|
|
|
|
|
static void _gfx_init_func(void* ud, bool gl2) {
|
|
|
|
|
@@ -783,6 +784,13 @@ static void _set_keep_screen_on(bool p_enabled) {
|
|
|
env->CallVoidMethod(_godot_instance, _setKeepScreenOn, p_enabled);
|
|
|
}
|
|
|
|
|
|
+static void _alert(const String& p_message, const String& p_title) {
|
|
|
+ JNIEnv* env = ThreadAndroid::get_env();
|
|
|
+ jstring jStrMessage = env->NewStringUTF(p_message.utf8().get_data());
|
|
|
+ jstring jStrTitle = env->NewStringUTF(p_title.utf8().get_data());
|
|
|
+ env->CallVoidMethod(_godot_instance, _alertDialog, jStrMessage, jStrTitle);
|
|
|
+}
|
|
|
+
|
|
|
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager) {
|
|
|
|
|
|
__android_log_print(ANDROID_LOG_INFO,"godot","**INIT EVENT! - %p\n",env);
|
|
@@ -820,6 +828,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * e
|
|
|
|
|
|
_on_video_init = env->GetMethodID(cls, "onVideoInit", "(Z)V");
|
|
|
_setKeepScreenOn = env->GetMethodID(cls,"setKeepScreenOn","(Z)V");
|
|
|
+ _alertDialog = env->GetMethodID(cls,"alert","(Ljava/lang/String;Ljava/lang/String;)V");
|
|
|
|
|
|
jclass clsio = env->FindClass("org/godotengine/godot/Godot");
|
|
|
if (cls) {
|
|
@@ -883,7 +892,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * e
|
|
|
|
|
|
__android_log_print(ANDROID_LOG_INFO,"godot","CMDLINE LEN %i - APK EXPANSION %I\n",cmdlen,int(use_apk_expansion));
|
|
|
|
|
|
- os_android = new OS_Android(_gfx_init_func,env,_open_uri,_get_data_dir,_get_locale, _get_model, _get_screen_dpi, _show_vk, _hide_vk,_set_screen_orient,_get_unique_id, _get_system_dir, _play_video,_is_video_playing, _pause_video, _stop_video, _set_keep_screen_on, use_apk_expansion);
|
|
|
+ os_android = new OS_Android(_gfx_init_func,env,_open_uri,_get_data_dir,_get_locale, _get_model, _get_screen_dpi, _show_vk, _hide_vk,_set_screen_orient,_get_unique_id, _get_system_dir, _play_video,_is_video_playing, _pause_video, _stop_video, _set_keep_screen_on, _alert, use_apk_expansion);
|
|
|
os_android->set_need_reload_hooks(p_need_reload_hook);
|
|
|
|
|
|
char wd[500];
|