mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-09 07:09:58 +03:00
Skip 400ms delay after opening menu if mouse movement is disabled
This removes the 400ms delay in NACT::wait_after_open_menu() if automatic mouse movement is disabled, because there's less risk of miss-clicking.
This commit is contained in:
@@ -31,6 +31,7 @@ void NACT::text_dialog()
|
||||
|
||||
void NACT::platform_initialize()
|
||||
{
|
||||
mouse_move_enabled = false;
|
||||
}
|
||||
|
||||
void NACT::platform_finalize()
|
||||
|
||||
@@ -38,6 +38,7 @@ void NACT::text_dialog()
|
||||
|
||||
void NACT::platform_initialize()
|
||||
{
|
||||
mouse_move_enabled = false;
|
||||
if (custom_event_type == static_cast<Uint32>(-1)) {
|
||||
custom_event_type = SDL_RegisterEvents(1);
|
||||
EM_ASM({ setInterval(() => _msgskip_syncFile(), 5000); });
|
||||
|
||||
+10
-13
@@ -504,21 +504,18 @@ uint16 NACT::random(uint16 range)
|
||||
|
||||
void NACT::wait_after_open_menu()
|
||||
{
|
||||
// 連打による誤クリック防止
|
||||
Uint32 dwTime = SDL_GetTicks();
|
||||
Uint32 dwWait = dwTime + 400;
|
||||
if (mouse_move_enabled) {
|
||||
// 連打による誤クリック防止
|
||||
Uint32 dwTime = SDL_GetTicks();
|
||||
Uint32 dwWait = dwTime + 400;
|
||||
|
||||
while(dwTime < dwWait) {
|
||||
if(terminate) {
|
||||
return;
|
||||
while(dwTime < dwWait) {
|
||||
if(terminate) {
|
||||
return;
|
||||
}
|
||||
sys_sleep(10);
|
||||
dwTime = SDL_GetTicks();
|
||||
}
|
||||
/*
|
||||
if(get_key() == 16) {
|
||||
break;
|
||||
}
|
||||
*/
|
||||
sys_sleep(10);
|
||||
dwTime = SDL_GetTicks();
|
||||
}
|
||||
|
||||
// クリック中の間は待機
|
||||
|
||||
Reference in New Issue
Block a user