diff --git a/include/mcpelauncher/minecraft_utils.h b/include/mcpelauncher/minecraft_utils.h index f570279..8073e9d 100644 --- a/include/mcpelauncher/minecraft_utils.h +++ b/include/mcpelauncher/minecraft_utils.h @@ -38,4 +38,6 @@ class MinecraftUtils { static void setupGLES2Symbols(void* (*resolver)(const char*)); + static bool mouseHidden; + }; diff --git a/src/minecraft_utils.cpp b/src/minecraft_utils.cpp index 871784b..1dd77a4 100644 --- a/src/minecraft_utils.cpp +++ b/src/minecraft_utils.cpp @@ -21,6 +21,7 @@ #include #endif +bool MinecraftUtils::mouseHidden = false; void MinecraftUtils::workaroundLocaleBug() { setenv("LC_ALL", "C", 1); // HACK: Force set locale to one recognized by MCPE so that the outdated C++ standard library MCPE uses doesn't fail to find one } @@ -155,6 +156,12 @@ std::unordered_map MinecraftUtils::getApi() { syms["mcpelauncher_host_dlopen"] = (void *) dlopen; syms["mcpelauncher_host_dlsym"] = (void *) dlsym; syms["mcpelauncher_host_dlclose"] = (void *) dlclose; + syms["mcpelauncher_pattern"] = (void *)+ [](void* handle, const char *pattern) -> void* { + return PatchUtils::patternSearch(handle, pattern); + }; + syms["mcpelauncher_ismouselocked"] = (void *)+ []() -> bool { + return mouseHidden; + }; return syms; }