From 9b1973dac52ae78fd7f3a3c51e651338d7dc1ed3 Mon Sep 17 00:00:00 2001 From: AdamPlenty <58278560+AdamPlenty@users.noreply.github.com> Date: Sat, 23 Jul 2022 19:57:16 +0100 Subject: [PATCH] You can now use the directional keys to scroll the front map. (#1673) --- src/front_landview.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/front_landview.c b/src/front_landview.c index 76cbb7cc7b..1d6a6bdcdd 100644 --- a/src/front_landview.c +++ b/src/front_landview.c @@ -53,6 +53,7 @@ #include "vidmode.h" #include "vidfade.h" #include "game_legacy.h" +#include "front_input.h" #include "keeperfx.hpp" @@ -1197,7 +1198,7 @@ void frontmap_draw(void) void check_mouse_scroll(void) { long mx = GetMouseX(); - if (mx < 8) + if ( (mx < 8) || ( (is_game_key_pressed(Gkey_MoveLeft, NULL, false)) || (is_key_pressed(KC_LEFT,KMod_DONTCARE)) ) ) { map_info.velocity_x -= 8; if (map_info.velocity_x < -48) @@ -1205,7 +1206,7 @@ void check_mouse_scroll(void) if (map_info.velocity_x > 48) map_info.velocity_x = 48; } else - if (mx >= lbDisplay.PhysicalScreenWidth-8) + if ( (mx >= lbDisplay.PhysicalScreenWidth-8) || ( (is_game_key_pressed(Gkey_MoveRight, NULL, false)) || (is_key_pressed(KC_RIGHT,KMod_DONTCARE)) ) ) { map_info.velocity_x += 8; if (map_info.velocity_x < -48) @@ -1214,7 +1215,7 @@ void check_mouse_scroll(void) map_info.velocity_x = 48; } long my = GetMouseY(); - if (my < 8) + if ( (my < 8) || ( (is_game_key_pressed(Gkey_MoveUp, NULL, false)) || (is_key_pressed(KC_UP,KMod_DONTCARE)) ) ) { map_info.velocity_y -= 8; if (map_info.velocity_y < -48) @@ -1222,7 +1223,7 @@ void check_mouse_scroll(void) if (map_info.velocity_y > 48) map_info.velocity_y = 48; } else - if (my >= lbDisplay.PhysicalScreenHeight-8) + if ( (my >= lbDisplay.PhysicalScreenHeight-8) || ( (is_game_key_pressed(Gkey_MoveDown, NULL, false)) || (is_key_pressed(KC_DOWN,KMod_DONTCARE)) ) ) { map_info.velocity_y += 8; if (map_info.velocity_y < -48)