Advance messages by scrolling mouse wheel down

Now the 'A' command accepts mouse wheel down events in addition to
keyboard and mouse buttons.
This commit is contained in:
kichikuou
2025-11-04 10:17:30 +09:00
parent a911d71b57
commit 51ab709da7
3 changed files with 16 additions and 2 deletions
+3 -1
View File
@@ -410,12 +410,14 @@ void NACT::cmd_a()
ags->draw_push(text_window);
}
get_wheel(); // clear wheel input
// キーが押されて離されるまで待機
while (!msgskip->skipping()) {
if(terminate) {
return;
}
if(get_key()) {
if (get_key() || get_wheel() < 0) {
break;
}
sys_sleep(16);
+1
View File
@@ -149,6 +149,7 @@ protected:
uint8 get_key();
void get_cursor(int* x, int* y);
void set_cursor(int x, int y);
int get_wheel();
SDL_GameController *sdl_gamecontroller = NULL;
+12 -1
View File
@@ -21,7 +21,7 @@ enum TouchState {
};
extern SDL_Window* g_window;
static int mousex, mousey;
static int mousex, mousey, wheel;
static TouchState touch_state = TOUCH_NONE;
void NACT::handle_event(SDL_Event e)
@@ -47,6 +47,10 @@ void NACT::handle_event(SDL_Event e)
mousey = e.motion.y * ags->screen_height / ags->window_height;
break;
case SDL_MOUSEWHEEL:
wheel += e.wheel.y * (e.wheel.direction == SDL_MOUSEWHEEL_FLIPPED ? -1 : 1);
break;
case SDL_FINGERDOWN:
case SDL_FINGERUP:
case SDL_FINGERMOTION:
@@ -154,6 +158,13 @@ void NACT::set_cursor(int x, int y)
SDL_WarpMouseInWindow(g_window, x, y);
}
int NACT::get_wheel()
{
int val = wheel;
wheel = 0;
return val;
}
void NACT::show_quit_dialog()
{
const SDL_MessageBoxButtonData buttons[] = {