mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-20 17:39:29 +08:00
opt: don't handle input when don't show ui
This commit is contained in:
@@ -58,7 +58,7 @@ int64_t my_Input(void* thiz, void* ex_ab, void* ex_ac)
|
||||
g_use_native_input.store(true);
|
||||
}
|
||||
|
||||
if (g_imgui_started.load()) {
|
||||
if (g_imgui_started.load() && CrackerUI::get_instance().is_ui_showed()) {
|
||||
ImGui_ImplAndroid_HandleInputEvent((AInputEvent *) thiz);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ int64_t my_Consume(void* thiz, int64_t arg1, char arg2, int64_t arg3, uint32_t*
|
||||
g_use_native_input.store(true);
|
||||
}
|
||||
|
||||
if (g_imgui_started.load()) {
|
||||
if (g_imgui_started.load() && CrackerUI::get_instance().is_ui_showed()) {
|
||||
ImGui_ImplAndroid_HandleInputEvent(*input_event);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ void My_ImGui_ImplAndroid_HandleInputEvent(const UnityEngine_Touch_o& touch) {
|
||||
using GlobalClickEventMgr_HandlePinchOnTouch_fnT = void(void* thiz, UnityEngine_Touch_array* touches);
|
||||
GlobalClickEventMgr_HandlePinchOnTouch_fnT* old_GlobalClickEventMgr_HandlePinchOnTouch = nullptr;
|
||||
void my_GlobalClickEventMgr_HandlePinchOnTouch(void* thiz, UnityEngine_Touch_array* touches) {
|
||||
if (touches != nullptr && !g_use_native_input.load() && g_imgui_started.load()) {
|
||||
if (touches != nullptr && !g_use_native_input.load() && g_imgui_started.load() && CrackerUI::get_instance().is_ui_showed()) {
|
||||
for(int i = 0; i < touches->max_length; i++) {
|
||||
My_ImGui_ImplAndroid_HandleInputEvent(touches->m_Items[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user