1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-09-28 21:19:24 +00:00

increase size of yes/no box touch area

This commit is contained in:
Alula 2021-04-28 21:34:09 +02:00
parent 65be03261c
commit 8d906536c1
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA
2 changed files with 4 additions and 4 deletions

View file

@ -479,7 +479,7 @@ impl GameScene {
batch.add_rect( batch.add_rect(
center + 51.0 + pos_x, center + 51.0 + pos_x,
state.canvas_size.1 - 86.0, pos_y + 10.0,
&state.constants.textscript.textbox_rect_cursor, &state.constants.textscript.textbox_rect_cursor,
); );
} }

View file

@ -657,9 +657,9 @@ impl TextScriptVM {
let (off_left, _, off_right, off_bottom) = let (off_left, _, off_right, off_bottom) =
crate::framework::graphics::screen_insets_scaled(ctx, state.scale); crate::framework::graphics::screen_insets_scaled(ctx, state.scale);
let box_x = ((state.canvas_size.0 - off_left - off_right) / 2.0) as isize + 51; let box_x = ((state.canvas_size.0 - off_left - off_right) / 2.0) as isize + 51;
let box_y = (state.canvas_size.1 - off_bottom - 96.0) as isize; let box_y = (state.canvas_size.1 - off_bottom - 96.0 - 10.0) as isize;
if state.touch_controls.consume_click_in(Rect::new_size(box_x, box_y, 40, 20)) { if state.touch_controls.consume_click_in(Rect::new_size(box_x, box_y, 40, 40)) {
match selection { match selection {
ConfirmSelection::Yes => confirm = true, ConfirmSelection::Yes => confirm = true,
ConfirmSelection::No => { ConfirmSelection::No => {
@ -673,7 +673,7 @@ impl TextScriptVM {
); );
} }
} }
} else if state.touch_controls.consume_click_in(Rect::new_size(box_x + 41, box_y, 40, 20)) { } else if state.touch_controls.consume_click_in(Rect::new_size(box_x + 41, box_y, 40, 40)) {
match selection { match selection {
ConfirmSelection::Yes => { ConfirmSelection::Yes => {
state.sound_manager.play_sfx(1); state.sound_manager.play_sfx(1);